From 2f01fe57a8d37767827d6db42850aef86a767c53 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 15 Nov 2010 10:39:52 +0300 Subject: add dijit/dojo stuff; initial ui mockup --- lib/dijit/_editor/plugins/NewPage.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 lib/dijit/_editor/plugins/NewPage.js (limited to 'lib/dijit/_editor/plugins/NewPage.js') diff --git a/lib/dijit/_editor/plugins/NewPage.js b/lib/dijit/_editor/plugins/NewPage.js new file mode 100644 index 000000000..14c2cfa62 --- /dev/null +++ b/lib/dijit/_editor/plugins/NewPage.js @@ -0,0 +1,36 @@ +/* + Copyright (c) 2004-2010, 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 +*/ + + +if(!dojo._hasResource["dijit._editor.plugins.NewPage"]){ +dojo._hasResource["dijit._editor.plugins.NewPage"]=true; +dojo.provide("dijit._editor.plugins.NewPage"); +dojo.require("dijit._editor._Plugin"); +dojo.require("dijit.form.Button"); +dojo.require("dojo.i18n"); +dojo.requireLocalization("dijit._editor","commands",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"); +dojo.declare("dijit._editor.plugins.NewPage",dijit._editor._Plugin,{content:"
",_initButton:function(){ +var _1=dojo.i18n.getLocalization("dijit._editor","commands"),_2=this.editor; +this.button=new dijit.form.Button({label:_1["newPage"],dir:_2.dir,lang:_2.lang,showLabel:false,iconClass:this.iconClassPrefix+" "+this.iconClassPrefix+"NewPage",tabIndex:"-1",onClick:dojo.hitch(this,"_newPage")}); +},setEditor:function(_3){ +this.editor=_3; +this._initButton(); +},_newPage:function(){ +this.editor.beginEditing(); +this.editor.set("value",this.content); +this.editor.endEditing(); +this.editor.focus(); +}}); +dojo.subscribe(dijit._scopeName+".Editor.getPlugin",null,function(o){ +if(o.plugin){ +return; +} +var _4=o.args.name.toLowerCase(); +if(_4==="newpage"){ +o.plugin=new dijit._editor.plugins.NewPage({content:("content" in o.args)?o.args.content:"
"}); +} +}); +} -- cgit v1.2.3