summaryrefslogtreecommitdiff
path: root/includes/js/dojox/sketch/Toolbar.js
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
commit1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch)
tree3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojox/sketch/Toolbar.js
parent104d59099e048688c4dbac37d72137006e396558 (diff)
downloadsemanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz
semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/sketch/Toolbar.js')
-rw-r--r--includes/js/dojox/sketch/Toolbar.js96
1 files changed, 0 insertions, 96 deletions
diff --git a/includes/js/dojox/sketch/Toolbar.js b/includes/js/dojox/sketch/Toolbar.js
deleted file mode 100644
index 73dc82c..0000000
--- a/includes/js/dojox/sketch/Toolbar.js
+++ /dev/null
@@ -1,96 +0,0 @@
-if(!dojo._hasResource["dojox.sketch.Toolbar"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojox.sketch.Toolbar"] = true;
-dojo.provide("dojox.sketch.Toolbar");
-
-dojo.require("dojox.sketch.Annotation");
-dojo.require("dijit.Toolbar");
-dojo.require("dijit.form.Button");
-dojo.require("dijit.form.Slider");
-
-dojo.declare("dojox.sketch.ButtonGroup", null, {
- constructor: function(){
- this._childMaps={};
- this._children=[];
- },
- add: function(/*_Plugin*/ plugin){
- this._childMaps[plugin]=plugin.connect(plugin,'onActivate',dojo.hitch(this,'_resetGroup',plugin));
- this._children.push(plugin);
- },
-// remove: function(/*_Plugin*/ plugin){
-// widget.disconnect(this._childMaps[widget.id]);
-// delete this._childMaps[widget.id];
-// this._children.splice(this._children.indexOf(widget.id),1);
-// },
- _resetGroup: function(p){
- var cs=this._children;
- dojo.forEach(cs,function(c){
- if(p!=c && c['attr']){
- c.attr('checked',false);
- }
- });
- }
-});
-
-dojo.declare("dojox.sketch.Toolbar", dijit.Toolbar, {
- figure: null,
- plugins: null,
- postCreate: function(){
- this.inherited(arguments);
- this.shapeGroup=new dojox.sketch.ButtonGroup;
-
- this.connect(this.figure,'onLoad','reset');
- if(!this.plugins){
- this.plugins=['Slider','Lead','SingleArrow','DoubleArrow','Underline','Preexisting'];
- }
- this._plugins=[];
-
- dojo.forEach(this.plugins,function(obj){
- var name=dojo.isString(obj)?obj:obj.name;
- var p=new dojox.sketch.tools[name](obj.args||{});
- this._plugins.push(p);
- p.setFigure(this.figure);
- p.setToolbar(this);
- if(!this._defaultTool && p.button){
- this._defaultTool=p;
- }
- },this);
- },
- destroy: function(){
- dojo.forEach(this._plugins,function(p){
- p.destroy();
- });
- this.inherited(arguments);
- delete this._defaultTool;
- delete this._plugins;
- },
- addGroupItem: function(/*_Plugin*/item,group){
- if(group!='toolsGroup'){
- console.error('not supported group '+group);
- return;
- }
-
- this.shapeGroup.add(item);
- },
- reset: function(){
- this._defaultTool.activate();
- },
- _setShape: function(s){
- if(!this.figure.surface) return;
- // now do the action.
- if(this.figure.hasSelections()){
- for(var i=0; i<this.figure.selected.length; i++){
- var before=this.figure.selected[i].serialize();
- this.figure.convert(this.figure.selected[i], s);
- this.figure.history.add(ta.CommandTypes.Convert, this.figure.selected[i], before);
- }
- }
- }
-});
-
-dojox.sketch.makeToolbar=function(node,figure){
- var toolbar=new dojox.sketch.Toolbar({"figure":figure});
- node.appendChild(toolbar.domNode);
- return toolbar;
-};
-
-}