"More" item load support

master
vitalif 2013-01-17 15:10:59 +00:00 committed by Vitaliy Filippov
parent 7c4b926cc5
commit 71b44059e8
2 changed files with 15 additions and 7 deletions

View File

@ -111,9 +111,9 @@ var nicImageUploadGTButton = nicEditorAdvancedButton.extend({
nicEditorAdvancedButton.prototype.removePane.apply(this);
},
gtLoadData: function(hint, value) {
POST(GT.domain+'/api.php?action=listimgs&format=json', {value: value}, function(r){
try { hint.replaceItems(JSON.parse(r.responseText)); }
gtLoadData: function(hint, value, more) {
POST(GT.domain+'/api.php?action=listimgs&format=json', {value: value, more: more}, function(r){
try { hint.replaceItems(JSON.parse(r.responseText), more > 0); }
catch(e) {}
});
},

View File

@ -2,9 +2,9 @@
/* START CONFIG */
var nicLinkGTOptions = {
buttons : {
'link' : {name : __('Add Link'), type : 'nicLinkGTButton', tags : ['A']},
'unlink' : {name : __('Remove Link'), command : 'unlink', noActive : true}
buttons: {
link: {name: __('Add Link'), type: 'nicLinkGTButton', tags: ['A']},
unlink: {name: __('Remove Link'), command: 'unlink', noActive: true}
}
};
/* END CONFIG */
@ -16,7 +16,7 @@ var nicLinkGTButton = nicEditorAdvancedButton.extend({
'': {type: 'title', txt: __('Add/Edit Link')},
'href': {type: 'text', txt: __('URL or Page'), value: '', style: {width: '150px'}},
'title': {type: 'text', txt: __('Hint')},
'target': {type: 'select', txt: __('Open In'), options: {'' : __('Current Window'), '_blank': __('New Window')}, style: {width: '100px'}}
'target': {type: 'select', txt: __('Open In'), options: {'': __('Current Window'), '_blank': __('New Window')}, style: {width: '100px'}}
}, this.parseParams(this.ln || {}));
this.hinter = new SimpleAutocomplete(this.inputs['href'], this.gtLoadData.closure(this), {
emptyText: false,
@ -78,6 +78,14 @@ var nicLinkGTButton = nicEditorAdvancedButton.extend({
target: this.inputs['target'].options[this.inputs['target'].selectedIndex].value
});
}
},
removePane: function() {
if (this.hinter) {
this.hinter.remove();
this.hinter = null;
}
nicEditorAdvancedButton.prototype.removePane.apply(this);
}
});