/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.editor.plugins.Preview"],["require","dijit.form.Button"],["require","dijit._editor._Plugin"],["require","dojo.i18n"],["requireLocalization","dojox.editor.plugins","Preview",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw","ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.editor.plugins.Preview"]){_4._hasResource["dojox.editor.plugins.Preview"]=true;_4.provide("dojox.editor.plugins.Preview");_4.require("dijit.form.Button");_4.require("dijit._editor._Plugin");_4.require("dojo.i18n");_4.declare("dojox.editor.plugins.Preview",_5._editor._Plugin,{useDefaultCommand:false,styles:"",stylesheets:null,iconClassPrefix:"dijitAdditionalEditorIcon",_initButton:function(){this._nlsResources=_4.i18n.getLocalization("dojox.editor.plugins","Preview");this.button=new _5.form.Button({label:this._nlsResources["preview"],showLabel:false,iconClass:this.iconClassPrefix+" "+this.iconClassPrefix+"Preview",tabIndex:"-1",onClick:_4.hitch(this,"_preview")});},setEditor:function(_7){this.editor=_7;this._initButton();},updateState:function(){this.button.set("disabled",this.get("disabled"));},_preview:function(){try{var _8=this.editor.get("value");var _9="\t\t<meta http-equiv='Content-Type' content='text/html; charset='UTF-8'>\n";var i;if(this.stylesheets){for(i=0;i<this.stylesheets.length;i++){_9+="\t\t<link rel='stylesheet' type='text/css' href='"+this.stylesheets[i]+"'>\n";}}if(this.styles){_9+=("\t\t<style>"+this.styles+"</style>\n");}_8="<html>\n\t<head>\n"+_9+"\t</head>\n\t<body>\n"+_8+"\n\t</body>\n</html>";var _a=window.open("javascript: ''",this._nlsResources["preview"],"status=1,menubar=0,location=0,toolbar=0");_a.document.open();_a.document.write(_8);_a.document.close();}catch(e){console.warn(e);}}});_4.subscribe(_5._scopeName+".Editor.getPlugin",null,function(o){if(o.plugin){return;}var _b=o.args.name.toLowerCase();if(_b==="preview"){o.plugin=new _6.editor.plugins.Preview({styles:("styles" in o.args)?o.args.styles:"",stylesheets:("stylesheets" in o.args)?o.args.stylesheets:null});}});}}};});