Changeset 1011 for branches/new-dialogs-merge/modules/CreateLink
- Timestamp:
- 06/07/08 09:08:53 (4 years ago)
- Location:
- branches/new-dialogs-merge/modules/CreateLink
- Files:
-
- 2 modified
-
link.js (modified) (2 diffs)
-
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;
