"More" item load support
parent
7c4b926cc5
commit
71b44059e8
|
@ -111,9 +111,9 @@ var nicImageUploadGTButton = nicEditorAdvancedButton.extend({
|
||||||
nicEditorAdvancedButton.prototype.removePane.apply(this);
|
nicEditorAdvancedButton.prototype.removePane.apply(this);
|
||||||
},
|
},
|
||||||
|
|
||||||
gtLoadData: function(hint, value) {
|
gtLoadData: function(hint, value, more) {
|
||||||
POST(GT.domain+'/api.php?action=listimgs&format=json', {value: value}, function(r){
|
POST(GT.domain+'/api.php?action=listimgs&format=json', {value: value, more: more}, function(r){
|
||||||
try { hint.replaceItems(JSON.parse(r.responseText)); }
|
try { hint.replaceItems(JSON.parse(r.responseText), more > 0); }
|
||||||
catch(e) {}
|
catch(e) {}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
16
nicLinkGT.js
16
nicLinkGT.js
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
/* START CONFIG */
|
/* START CONFIG */
|
||||||
var nicLinkGTOptions = {
|
var nicLinkGTOptions = {
|
||||||
buttons : {
|
buttons: {
|
||||||
'link' : {name : __('Add Link'), type : 'nicLinkGTButton', tags : ['A']},
|
link: {name: __('Add Link'), type: 'nicLinkGTButton', tags: ['A']},
|
||||||
'unlink' : {name : __('Remove Link'), command : 'unlink', noActive : true}
|
unlink: {name: __('Remove Link'), command: 'unlink', noActive: true}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
/* END CONFIG */
|
/* END CONFIG */
|
||||||
|
@ -16,7 +16,7 @@ var nicLinkGTButton = nicEditorAdvancedButton.extend({
|
||||||
'': {type: 'title', txt: __('Add/Edit Link')},
|
'': {type: 'title', txt: __('Add/Edit Link')},
|
||||||
'href': {type: 'text', txt: __('URL or Page'), value: '', style: {width: '150px'}},
|
'href': {type: 'text', txt: __('URL or Page'), value: '', style: {width: '150px'}},
|
||||||
'title': {type: 'text', txt: __('Hint')},
|
'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.parseParams(this.ln || {}));
|
||||||
this.hinter = new SimpleAutocomplete(this.inputs['href'], this.gtLoadData.closure(this), {
|
this.hinter = new SimpleAutocomplete(this.inputs['href'], this.gtLoadData.closure(this), {
|
||||||
emptyText: false,
|
emptyText: false,
|
||||||
|
@ -78,6 +78,14 @@ var nicLinkGTButton = nicEditorAdvancedButton.extend({
|
||||||
target: this.inputs['target'].options[this.inputs['target'].selectedIndex].value
|
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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue