Add border option to nicTable, use SimpleAutocomplete in GT

master
vitalif 2013-01-11 22:25:22 +00:00 committed by Vitaliy Filippov
parent 99ec926910
commit 66899c818e
4 changed files with 29 additions and 12 deletions

View File

@ -1485,25 +1485,28 @@ var nicTableOptions = {
/* END CONFIG */
var nicTableButton = nicEditorAdvancedButton.extend({
addPane : function() {
addPane: function() {
this.t = this.ne.selectedInstance.selElm().parentTag('TABLE');
var r = 3, c = 3, h = '';
var r = 3, c = 3, h = '', b = 'yes';
if (this.t && (r = this.t.rows.length)) {
c = this.t.rows[0].cells.length;
if (this.t.rows[0].cells[c-1].nodeName == 'TH') h += 'top';
if (this.t.rows[r-1].cells[0].nodeName == 'TH') h += 'left';
if (this.t.className.indexOf('bordered') < 0) b = 'no';
}
this.addForm({
'': {type: 'title', txt: __('Add/Edit Table')},
'cols': {type: 'text', txt: __('Columns'), value: c, style: {width: '50px'}},
'rows': {type: 'text', txt: __('Rows'), value: r, style: {width: '50px'}},
'header': {type: 'select', txt: __('Headers'), value: h, options: {'':__('None'), left:__('Left'), top:__('Top'), topleft:__('Top and Left')}}
'header': {type: 'select', txt: __('Headers'), value: h, options: {'':__('None'), left:__('Left'), top:__('Top'), topleft:__('Top and Left')}},
'bordered': {type: 'select', txt: __('Borders'), value: b, options: {'no':__('No'), 'yes':__('Yes')}}
},this.t);
},
submit : function(e) {
submit: function(e) {
var r = parseInt(this.inputs['rows'].value);
var c = parseInt(this.inputs['cols'].value);
var cl = this.inputs['bordered'].value == 'no' ? '' : 'bordered';
var i, j;
if(!this.t) {
var tmp = 'javascript:nicImTemp();', h = '';
@ -1514,6 +1517,7 @@ var nicTableButton = nicEditorAdvancedButton.extend({
this.t = this.findElm('TABLE','title',tmp);
}
if(this.t) {
this.t.className = cl;
this.t.removeAttribute('title');
for (i = this.t.rows.length-1; i >= r; i--) {
this.t.deleteRow(r);

View File

@ -24,7 +24,10 @@ var nicImageUploadGTButton = nicEditorAdvancedButton.extend({
'alt': {type: 'text', txt: __('Popup text'), style: {width: '150px'}}
}, params);
this.hinter = new SimpleAutocomplete(this.inputs['src'], this.gtLoadData.closure(this), null, null, null, false, true);
this.hinter = new SimpleAutocomplete(this.inputs['src'], this.gtLoadData.closure(this), {
emptyText: false,
allowHTML: true
});
s = this.inputs['href'].parentNode;
new bkElement('br').appendTo(s);
@ -156,11 +159,15 @@ var nicImageUploadGTButton = nicEditorAdvancedButton.extend({
target: this.inputs['newwindow'].checked ? '_blank' : '',
title: alt
};
if (!lnk.href.length && gtId && gtId[1] && (w || h)) {
// If link URL is not '-', add lightbox (relative path)
lnk.href = 'file.php?action=thumb&id='+gtId[1];
lnk.target = '_blank';
lnk.rel = 'lightbox';
if (!lnk.href.length) {
if (gtId && gtId[1] && (w || h)) {
// If link URL is not '-', add lightbox (relative path)
lnk.href = 'file.php?action=thumb&id='+gtId[1];
lnk.target = '_blank';
lnk.rel = 'lightbox';
} else {
lnk.href = '-';
}
}
var p = $BK(this.im.parentNode);
if (p.nodeName != 'A' && lnk.href != '-') {

View File

@ -18,7 +18,10 @@ var nicLinkGTButton = nicEditorAdvancedButton.extend({
'title': {type: 'text', txt: __('Hint')},
'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), null, null, null, false, true);
this.hinter = new SimpleAutocomplete(this.inputs['href'], this.gtLoadData.closure(this), {
emptyText: false,
allowHTML: true
});
},
parseParams: function(elm) {

View File

@ -92,7 +92,10 @@ var nicRu = {
'Headers': 'Заголовок',
'None': 'Нет',
'Top': 'Сверху',
'Top and Left': 'Сверху и слева'
'Top and Left': 'Сверху и слева',
'Borders': 'Рамки',
'Yes': 'Да',
'No': 'Нет'
};
function __(s) {