Edit File by line
/home/barbar84/www/wp-inclu.../js/tinymce/utils
File: editable_selects.js
/**
[0] Fix | Delete
* editable_selects.js
[1] Fix | Delete
*
[2] Fix | Delete
* Released under LGPL License.
[3] Fix | Delete
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
[4] Fix | Delete
*
[5] Fix | Delete
* License: http://www.tinymce.com/license
[6] Fix | Delete
* Contributing: http://www.tinymce.com/contributing
[7] Fix | Delete
*/
[8] Fix | Delete
[9] Fix | Delete
var TinyMCE_EditableSelects = {
[10] Fix | Delete
editSelectElm : null,
[11] Fix | Delete
[12] Fix | Delete
init : function () {
[13] Fix | Delete
var nl = document.getElementsByTagName("select"), i, d = document, o;
[14] Fix | Delete
[15] Fix | Delete
for (i = 0; i < nl.length; i++) {
[16] Fix | Delete
if (nl[i].className.indexOf('mceEditableSelect') != -1) {
[17] Fix | Delete
o = new Option(tinyMCEPopup.editor.translate('value'), '__mce_add_custom__');
[18] Fix | Delete
[19] Fix | Delete
o.className = 'mceAddSelectValue';
[20] Fix | Delete
[21] Fix | Delete
nl[i].options[nl[i].options.length] = o;
[22] Fix | Delete
nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
[23] Fix | Delete
}
[24] Fix | Delete
}
[25] Fix | Delete
},
[26] Fix | Delete
[27] Fix | Delete
onChangeEditableSelect : function (e) {
[28] Fix | Delete
var d = document, ne, se = window.event ? window.event.srcElement : e.target;
[29] Fix | Delete
[30] Fix | Delete
if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
[31] Fix | Delete
ne = d.createElement("input");
[32] Fix | Delete
ne.id = se.id + "_custom";
[33] Fix | Delete
ne.name = se.name + "_custom";
[34] Fix | Delete
ne.type = "text";
[35] Fix | Delete
[36] Fix | Delete
ne.style.width = se.offsetWidth + 'px';
[37] Fix | Delete
se.parentNode.insertBefore(ne, se);
[38] Fix | Delete
se.style.display = 'none';
[39] Fix | Delete
ne.focus();
[40] Fix | Delete
ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
[41] Fix | Delete
ne.onkeydown = TinyMCE_EditableSelects.onKeyDown;
[42] Fix | Delete
TinyMCE_EditableSelects.editSelectElm = se;
[43] Fix | Delete
}
[44] Fix | Delete
},
[45] Fix | Delete
[46] Fix | Delete
onBlurEditableSelectInput : function () {
[47] Fix | Delete
var se = TinyMCE_EditableSelects.editSelectElm;
[48] Fix | Delete
[49] Fix | Delete
if (se) {
[50] Fix | Delete
if (se.previousSibling.value != '') {
[51] Fix | Delete
addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
[52] Fix | Delete
selectByValue(document.forms[0], se.id, se.previousSibling.value);
[53] Fix | Delete
} else {
[54] Fix | Delete
selectByValue(document.forms[0], se.id, '');
[55] Fix | Delete
}
[56] Fix | Delete
[57] Fix | Delete
se.style.display = 'inline';
[58] Fix | Delete
se.parentNode.removeChild(se.previousSibling);
[59] Fix | Delete
TinyMCE_EditableSelects.editSelectElm = null;
[60] Fix | Delete
}
[61] Fix | Delete
},
[62] Fix | Delete
[63] Fix | Delete
onKeyDown : function (e) {
[64] Fix | Delete
e = e || window.event;
[65] Fix | Delete
[66] Fix | Delete
if (e.keyCode == 13) {
[67] Fix | Delete
TinyMCE_EditableSelects.onBlurEditableSelectInput();
[68] Fix | Delete
}
[69] Fix | Delete
}
[70] Fix | Delete
};
[71] Fix | Delete
[72] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function