diff -r 490d5cc509ed -r cf61fcea0001 wp/wp-includes/js/tinymce/utils/form_utils.js --- a/wp/wp-includes/js/tinymce/utils/form_utils.js Tue Jun 09 11:14:17 2015 +0000 +++ b/wp/wp-includes/js/tinymce/utils/form_utils.js Mon Oct 14 17:39:30 2019 +0200 @@ -1,8 +1,8 @@ /** * form_utils.js * - * Copyright, Moxiecode Systems AB * Released under LGPL License. + * Copyright (c) 1999-2017 Ephox Corp. All rights reserved * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing @@ -11,200 +11,212 @@ var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme")); function getColorPickerHTML(id, target_form_element) { - var h = "", dom = tinyMCEPopup.dom; + var h = "", dom = tinyMCEPopup.dom; - if (label = dom.select('label[for=' + target_form_element + ']')[0]) { - label.id = label.id || dom.uniqueId(); - } + if (label = dom.select('label[for=' + target_form_element + ']')[0]) { + label.id = label.id || dom.uniqueId(); + } - h += ''; - h += ' '; + h += ''; + h += ' '; - return h; + return h; } function updateColor(img_id, form_element_id) { - document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; + document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; } function setBrowserDisabled(id, state) { - var img = document.getElementById(id); - var lnk = document.getElementById(id + "_link"); + var img = document.getElementById(id); + var lnk = document.getElementById(id + "_link"); - if (lnk) { - if (state) { - lnk.setAttribute("realhref", lnk.getAttribute("href")); - lnk.removeAttribute("href"); - tinyMCEPopup.dom.addClass(img, 'disabled'); - } else { - if (lnk.getAttribute("realhref")) - lnk.setAttribute("href", lnk.getAttribute("realhref")); + if (lnk) { + if (state) { + lnk.setAttribute("realhref", lnk.getAttribute("href")); + lnk.removeAttribute("href"); + tinyMCEPopup.dom.addClass(img, 'disabled'); + } else { + if (lnk.getAttribute("realhref")) { + lnk.setAttribute("href", lnk.getAttribute("realhref")); + } - tinyMCEPopup.dom.removeClass(img, 'disabled'); - } - } + tinyMCEPopup.dom.removeClass(img, 'disabled'); + } + } } function getBrowserHTML(id, target_form_element, type, prefix) { - var option = prefix + "_" + type + "_browser_callback", cb, html; + var option = prefix + "_" + type + "_browser_callback", cb, html; - cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); + cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); - if (!cb) - return ""; + if (!cb) { + return ""; + } - html = ""; - html += ''; - html += ' '; + html = ""; + html += ''; + html += ' '; - return html; + return html; } function openBrowser(img_id, target_form_element, type, option) { - var img = document.getElementById(img_id); + var img = document.getElementById(img_id); - if (img.className != "mceButtonDisabled") - tinyMCEPopup.openBrowser(target_form_element, type, option); + if (img.className != "mceButtonDisabled") { + tinyMCEPopup.openBrowser(target_form_element, type, option); + } } function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { - if (!form_obj || !form_obj.elements[field_name]) - return; - - if (!value) - value = ""; + if (!form_obj || !form_obj.elements[field_name]) { + return; + } - var sel = form_obj.elements[field_name]; + if (!value) { + value = ""; + } - var found = false; - for (var i=0; i