Changeset 1011 for branches/new-dialogs-merge/modules
- Timestamp:
- 06/07/08 09:08:53 (4 years ago)
- Location:
- branches/new-dialogs-merge/modules
- Files:
-
- 6 modified
-
CreateLink/link.js (modified) (2 diffs)
-
CreateLink/pluginMethods.js (modified) (1 diff)
-
InsertImage/insert_image.js (modified) (2 diffs)
-
InsertImage/pluginMethods.js (modified) (2 diffs)
-
InsertTable/insert_table.js (modified) (3 diffs)
-
InsertTable/pluginMethods.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/new-dialogs-merge/modules/CreateLink/link.js
r1009 r1011 50 50 CreateLink.prototype.onGenerateOnce = function() 51 51 { 52 this.prepareDialog(); 53 this.loadScripts(); 52 CreateLink.loadAssets(); 54 53 }; 55 54 56 CreateLink. prototype.loadScripts = function()55 CreateLink.loadAssets = function() 57 56 { 58 var self = this; 59 if(!this.methodsReady) 60 { 61 Xinha._getback(_editor_url + 'modules/CreateLink/pluginMethods.js', function(getback) { eval(getback); self.methodsReady = true; }); 62 return; 63 } 64 }; 57 var self = CreateLink; 58 if (self.loading) return; 59 self.loading = true; 60 Xinha._getback(_editor_url + 'modules/CreateLink/dialog.html', function(getback) { self.html = getback; self.dialogReady = true; }); 61 Xinha._getback(_editor_url + 'modules/CreateLink/pluginMethods.js', function(getback) { eval(getback); self.methodsReady = true; }); 62 } 65 63 66 64 CreateLink.prototype.onUpdateToolbar = function() 67 65 { 68 if (!(this.dialogReady && this.methodsReady))66 if (!(CreateLink.dialogReady && CreateLink.methodsReady)) 69 67 { 70 this.editor._toolbarObjects.createlink.state("enabled", false);68 this.editor._toolbarObjects.createlink.state("enabled", false); 71 69 } 70 else this.onUpdateToolbar = null; 72 71 }; 73 72 … … 77 76 var editor = this.editor; 78 77 79 if(!this.html) // retrieve the raw dialog contents 80 { 81 Xinha._getback(_editor_url + 'modules/CreateLink/dialog.html', function(getback) { self.html = getback; self.prepareDialog(); }); 82 return; 83 } 84 85 // Now we have everything we need, so we can build the dialog. 86 87 var dialog = this.dialog = new Xinha.Dialog(editor, this.html, 'Xinha',{width:400}) 78 var dialog = this.dialog = new Xinha.Dialog(editor, CreateLink.html, 'Xinha',{width:400}) 88 79 // Connect the OK and Cancel buttons 89 80 dialog.getElementById('ok').onclick = function() {self.apply();} -
branches/new-dialogs-merge/modules/CreateLink/pluginMethods.js
r1008 r1011 2 2 CreateLink.prototype.show = function(a) 3 3 { 4 if (!this.dialog) 5 { 6 this.prepareDialog(); 7 } 4 8 var editor = this.editor; 5 9 this.a = a; -
branches/new-dialogs-merge/modules/InsertImage/insert_image.js
r1008 r1011 46 46 InsertImage.prototype.onGenerateOnce = function() 47 47 { 48 this.prepareDialog(); 49 this.loadScripts(); 48 InsertImage.loadAssets(); 50 49 }; 51 50 52 InsertImage. prototype.loadScripts = function()51 InsertImage.loadAssets = function() 53 52 { 54 var self = this; 55 if(!this.methodsReady) 56 { 57 Xinha._getback(_editor_url + 'modules/InsertImage/pluginMethods.js', function(getback) { eval(getback); self.methodsReady = true; }); 58 return; 59 } 53 var self = InsertImage; 54 if (self.loading) return; 55 self.loading = true; 56 Xinha._getback(_editor_url + 'modules/InsertImage/dialog.html', function(getback) { self.html = getback; self.dialogReady = true; }); 57 Xinha._getback(_editor_url + 'modules/InsertImage/pluginMethods.js', function(getback) { eval(getback); self.methodsReady = true; }); 60 58 }; 61 62 59 InsertImage.prototype.onUpdateToolbar = function() 63 60 { 64 if (!( this.dialogReady && this.methodsReady))61 if (!(InsertImage.dialogReady && InsertImage.methodsReady)) 65 62 { 66 63 this.editor._toolbarObjects.insertimage.state("enabled", false); 67 64 } 65 else this.onUpdateToolbar = null; 68 66 }; 69 67 … … 73 71 var editor = this.editor; 74 72 75 if(!this.html) // retrieve the raw dialog contents 76 { 77 Xinha._getback(_editor_url + 'modules/InsertImage/dialog.html', function(getback) { self.html = getback; self.prepareDialog(); }); 78 return; 79 } 80 81 // Now we have everything we need, so we can build the dialog. 82 83 var dialog = this.dialog = new Xinha.Dialog(editor, this.html, 'Xinha',{width:410}) 73 var dialog = this.dialog = new Xinha.Dialog(editor, InsertImage.html, 'Xinha',{width:410}) 84 74 // Connect the OK and Cancel buttons 85 75 dialog.getElementById('ok').onclick = function() {self.apply();} -
branches/new-dialogs-merge/modules/InsertImage/pluginMethods.js
r1008 r1011 1 1 InsertImage.prototype.show = function(image) 2 2 { 3 var editor = this.editor; 3 if (!this.dialog) this.prepareDialog(); 4 5 var editor = this.editor; 4 6 if ( typeof image == "undefined" ) 5 7 { … … 60 62 InsertImage.prototype.apply = function() 61 63 { 62 63 64 var param = this.dialog.hide(); 64 65 if (!param.f_url) -
branches/new-dialogs-merge/modules/InsertTable/insert_table.js
r1008 r1011 37 37 var self = this; 38 38 39 editor.config.btnList.inserttable[3] = function() { self.show(); }39 editor.config.btnList.inserttable[3] = function() { self.show(); } 40 40 } 41 41 … … 47 47 InsertTable.prototype.onGenerateOnce = function() 48 48 { 49 this.prepareDialog(); 50 this.loadScripts(); 49 InsertTable.loadAssets(); 51 50 }; 52 53 InsertTable.prototype.loadScripts = function() 51 InsertTable.loadAssets = function() 54 52 { 55 var self = this; 56 if(!this.methodsReady) 57 { 58 Xinha._getback(_editor_url + 'modules/InsertTable/pluginMethods.js', function(getback) { eval(getback); self.methodsReady = true; }); 59 return; 60 } 53 var self = InsertTable; 54 if (self.loading) return; 55 self.loading = true; 56 Xinha._getback(_editor_url + 'modules/InsertTable/dialog.html', function(getback) { self.html = getback; self.dialogReady = true; }); 57 Xinha._getback(_editor_url + 'modules/InsertTable/pluginMethods.js', function(getback) { eval(getback); self.methodsReady = true; }); 61 58 }; 62 59 63 60 InsertTable.prototype.onUpdateToolbar = function() 64 61 { 65 if (!( this.dialogReady && this.methodsReady))62 if (!(InsertTable.dialogReady && InsertTable.methodsReady)) 66 63 { 67 64 this.editor._toolbarObjects.inserttable.state("enabled", false); 68 65 } 66 else this.onUpdateToolbar = null; 69 67 }; 70 68 … … 74 72 var editor = this.editor; 75 73 76 if(!this.html) // retrieve the raw dialog contents 77 { 78 Xinha._getback(_editor_url + 'modules/InsertTable/dialog.html', function(getback) { self.html = getback; self.prepareDialog(); }); 79 return; 80 } 81 82 // Now we have everything we need, so we can build the dialog. 83 84 var dialog = this.dialog = new Xinha.Dialog(editor, this.html, 'Xinha',{width:400}) 74 var dialog = this.dialog = new Xinha.Dialog(editor, InsertTable.html, 'Xinha',{width:400}) 85 75 // Connect the OK and Cancel buttons 86 76 dialog.getElementById('ok').onclick = function() {self.apply();} -
branches/new-dialogs-merge/modules/InsertTable/pluginMethods.js
r1008 r1011 1 1 InsertTable.prototype.show = function(image) 2 2 { 3 var editor = this.editor; 3 if (!this.dialog) this.prepareDialog(); 4 5 var editor = this.editor; 4 6 5 7 var values =
