From b1a16b5893856224b6635ce0b69b252e8493bdda Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Thu, 27 Jul 2017 19:38:36 -0300 Subject: [PATCH 01/35] work in progress webpack Swat --- www/javascript/swat-abstract-overlay.js | 464 +++++++++--------- www/javascript/swat-accordion.js | 2 + www/javascript/swat-actions.js | 291 ++++++----- www/javascript/swat-button.js | 146 +++--- www/javascript/swat-calendar.js | 2 + www/javascript/swat-cascade.js | 2 + www/javascript/swat-change-order.js | 2 + www/javascript/swat-check-all.js | 2 + www/javascript/swat-checkbox-cell-renderer.js | 2 + www/javascript/swat-checkbox-entry-list.js | 4 + www/javascript/swat-checkbox-list.js | 2 + 11 files changed, 457 insertions(+), 462 deletions(-) diff --git a/www/javascript/swat-abstract-overlay.js b/www/javascript/swat-abstract-overlay.js index 055fcec3b..7d19087fb 100644 --- a/www/javascript/swat-abstract-overlay.js +++ b/www/javascript/swat-abstract-overlay.js @@ -3,311 +3,293 @@ * * @copyright 2005-2016 silverorange */ +class SwatAbstractOverlay { + // {{{ constructor() + + /** + * Creates an abstract overlay widget + * + * @param string id + */ + constructor(id) { + this.id = id; + this.container = document.getElementById(this.id); + this.value_field = document.getElementById(this.id + '_value'); + + this.is_open = false; + this.is_drawn = false; + + // list of select elements to hide for IE6 + this.select_elements = []; + + YAHOO.util.Event.onDOMReady(this.init, this, true); + } -// {{{ function SwatAbstractOverlay() - -/** - * Creates an abstract overlay widget - * - * @param string id - */ -function SwatAbstractOverlay(id) -{ - this.id = id; - this.container = document.getElementById(this.id); - this.value_field = document.getElementById(this.id + '_value'); + // }}} + // {{{ init() - this.is_open = false; - this.is_drawn = false; + init() { + this.draw(); + this.drawCloseDiv(); + this.createOverlay(); + }, - // list of select elements to hide for IE6 - this.select_elements = []; + // }}} + // {{{ draw() - YAHOO.util.Event.onDOMReady(this.init, this, true); -} + draw() { + this.overlay_content = document.createElement('div'); + this.overlay_content.id = this.id + '_overlay'; + YAHOO.util.Dom.addClass(this.overlay_content, 'swat-overlay'); + this.overlay_content.style.display = 'none'; -SwatAbstractOverlay.close_text = 'Close'; + this.overlay_content.appendChild(this.getHeader()); + this.overlay_content.appendChild(this.getBody()); + this.overlay_content.appendChild(this.getFooter()); -// }}} -// {{{ SwatAbstractOverlay.prototype.init + this.toggle_button = this.getToggleButton(); + this.toggle_button.appendChild(this.overlay_content); -SwatAbstractOverlay.prototype.init = function() -{ - this.draw(); - this.drawCloseDiv(); - this.createOverlay(); -}; + this.container.appendChild(this.toggle_button); + }, -// }}} -// {{{ SwatAbstractOverlay.prototype.draw + // }}} + // {{{ getToggleButton() -SwatAbstractOverlay.prototype.draw = function() -{ - this.overlay_content = document.createElement('div'); - this.overlay_content.id = this.id + '_overlay'; - YAHOO.util.Dom.addClass(this.overlay_content, 'swat-overlay'); - this.overlay_content.style.display = 'none'; + getToggleButton() { + var toggle_button = document.createElement('button'); + YAHOO.util.Dom.addClass(toggle_button, 'swat-overlay-toggle-button'); - this.overlay_content.appendChild(this.getHeader()); - this.overlay_content.appendChild(this.getBody()); - this.overlay_content.appendChild(this.getFooter()); + // the type property is readonly in IE so use setAttribute() here + toggle_button.setAttribute('type', 'button'); - this.toggle_button = this.getToggleButton(); - this.toggle_button.appendChild(this.overlay_content); + YAHOO.util.Event.on(toggle_button, 'click', this.toggle, this, true); - this.container.appendChild(this.toggle_button); -}; + return toggle_button; + }, -// }}} -// {{{ SwatAbstractOverlay.prototype.getToggleButton + // }}} + // {{{ getHeader() -SwatAbstractOverlay.prototype.getToggleButton = function() -{ - var toggle_button = document.createElement('button'); - YAHOO.util.Dom.addClass(toggle_button, 'swat-overlay-toggle-button'); + getHeader() { + var header = document.createElement('div'); + YAHOO.util.Dom.addClass(header, 'hd'); + header.appendChild(this.getCloseLink()); + return header; + }, - // the type property is readonly in IE so use setAttribute() here - toggle_button.setAttribute('type', 'button'); + // }}} + // {{{ getBody() - YAHOO.util.Event.on(toggle_button, 'click', this.toggle, this, true); + getBody() { + var body = document.createElement('div'); + YAHOO.util.Dom.addClass(body, 'bd'); + return body; + }, - return toggle_button; -}; + // }}} + // {{{ getFooter() -// }}} -// {{{ SwatAbstractOverlay.prototype.getHeader + getFooter() { + var footer = document.createElement('div'); + YAHOO.util.Dom.addClass(footer, 'ft'); + return footer; + }, -SwatAbstractOverlay.prototype.getHeader = function() -{ - var header = document.createElement('div'); - YAHOO.util.Dom.addClass(header, 'hd'); - header.appendChild(this.getCloseLink()); - return header; -}; + // }}} + // {{{ getCloseLink() -// }}} -// {{{ SwatAbstractOverlay.prototype.getBody + getCloseLink() { + var close_link = document.createElement('a'); + close_link.className = 'swat-overlay-close-link'; + close_link.href = '#close'; + close_link.appendChild(document.createTextNode( + SwatAbstractOverlay.close_text)); -SwatAbstractOverlay.prototype.getBody = function() -{ - var body = document.createElement('div'); - YAHOO.util.Dom.addClass(body, 'bd'); - return body; -}; + YAHOO.util.Event.on(close_link, 'click', this.handleCloseLink, this, true); -// }}} -// {{{ SwatAbstractOverlay.prototype.getFooter + return close_link; + }, -SwatAbstractOverlay.prototype.getFooter = function() -{ - var footer = document.createElement('div'); - YAHOO.util.Dom.addClass(footer, 'ft'); - return footer; -}; + // }}} + // {{{ createOverlay() -// }}} -// {{{ SwatAbstractOverlay.prototype.getCloseLink + /** + * Creates overlay widget when toggle button has been drawn + */ + createOverlay(event) { + this.overlay = new YAHOO.widget.Overlay(this.id + '_overlay', + { visible: false, constraintoviewport: true }); -SwatAbstractOverlay.prototype.getCloseLink = function() -{ - var close_link = document.createElement('a'); - close_link.className = 'swat-overlay-close-link'; - close_link.href = '#close'; - close_link.appendChild(document.createTextNode( - SwatAbstractOverlay.close_text)); + this.overlay.body.appendChild(this.getBodyContent()); - YAHOO.util.Event.on(close_link, 'click', this.handleCloseLink, this, true); + this.overlay.render(this.container); + this.overlay_content.style.display = 'block'; + this.is_drawn = true; + }, - return close_link; -}; + // }}} + // {{{ close() -// }}} -// {{{ SwatAbstractOverlay.prototype.createOverlay + /** + * Closes this overlay + */ + close() { + this.hideCloseDiv(); -/** - * Creates overlay widget when toggle button has been drawn - */ -SwatAbstractOverlay.prototype.createOverlay = function(event) -{ - this.overlay = new YAHOO.widget.Overlay(this.id + '_overlay', - { visible: false, constraintoviewport: true }); + this.overlay.hide(); + SwatZIndexManager.lowerElement(this.overlay_content); + this.is_open = false; - this.overlay.body.appendChild(this.getBodyContent()); + this.removeKeyPressHandler(); + }, - this.overlay.render(this.container); - this.overlay_content.style.display = 'block'; - this.is_drawn = true; -}; + // }}} + // {{{ open() -// }}} -// {{{ SwatAbstractOverlay.prototype.close + /** + * Opens this overlay + */ + open() { + this.showCloseDiv(); -/** - * Closes this overlay - */ -SwatAbstractOverlay.prototype.close = function() -{ - this.hideCloseDiv(); + this.overlay.cfg.setProperty('context', this.getOverlayContext()); - this.overlay.hide(); - SwatZIndexManager.lowerElement(this.overlay_content); - this.is_open = false; + this.overlay.show(); + this.is_open = true; - this.removeKeyPressHandler(); -}; + SwatZIndexManager.raiseElement(this.overlay_content); -// }}} -// {{{ SwatAbstractOverlay.prototype.open + this.addKeyPressHandler(); + }, -/** - * Opens this overlay - */ -SwatAbstractOverlay.prototype.open = function() -{ - this.showCloseDiv(); + // }}} + // {{{ getOverlayContext() - this.overlay.cfg.setProperty('context', this.getOverlayContext()); + /** + * Get the context for positioning the overlay + */ + getOverlayContext() { + return [this.toggle_button, 'tl', 'bl']; + }, + + // }}} + // {{{ getBodyContent - this.overlay.show(); - this.is_open = true; + /** + * Draws this overlay + */ + getBodyContent() + { + return document.createElement('div'); + }, - SwatZIndexManager.raiseElement(this.overlay_content); + // }}} + // {{{ toggle() - this.addKeyPressHandler(); -}; + toggle() { + if (this.is_open) + this.close(); + else + this.open(); + }, -// }}} -// {{{ SwatAbstractOverlay.prototype.getOverlayContext + // }}} + // {{{ drawCloseDiv() -/** - * Get the context for positioning the overlay - */ -SwatAbstractOverlay.prototype.getOverlayContext = function() -{ - return [this.toggle_button, 'tl', 'bl']; -}; + drawCloseDiv() { + this.close_div = document.createElement('div'); -// }}} -// {{{ SwatAbstractOverlay.prototype.getBodyContent + this.close_div.className = 'swat-overlay-close-div'; + this.close_div.style.display = 'none'; -/** - * Draws this overlay - */ -SwatAbstractOverlay.prototype.getBodyContent = function() -{ - return document.createElement('div'); -}; + YAHOO.util.Event.on(this.close_div, 'click', this.close, this, true); -// }}} -// {{{ SwatAbstractOverlay.prototype.toggle + this.container.appendChild(this.close_div); + }, -SwatAbstractOverlay.prototype.toggle = function() -{ - if (this.is_open) - this.close(); - else - this.open(); -}; + // }}} + // {{{ showCloseDiv() -// }}} -// {{{ SwatAbstractOverlay.prototype.drawCloseDiv + showCloseDiv() { + if (YAHOO.env.ua.ie == 6) { + this.select_elements = document.getElementsByTagName('select'); + for (var i = 0; i < this.select_elements.length; i++) { + this.select_elements[i].style._visibility = + this.select_elements[i].style.visibility; -SwatAbstractOverlay.prototype.drawCloseDiv = function() -{ - this.close_div = document.createElement('div'); + this.select_elements[i].style.visibility = 'hidden'; + } + } - this.close_div.className = 'swat-overlay-close-div'; - this.close_div.style.display = 'none'; + this.close_div.style.height = YAHOO.util.Dom.getDocumentHeight() + 'px'; + this.close_div.style.display = 'block'; + SwatZIndexManager.raiseElement(this.close_div); + }, + + // }}} + // {{{ hideCloseDiv() + + hideCloseDiv() { + SwatZIndexManager.lowerElement(this.close_div); + this.close_div.style.display = 'none'; + if (YAHOO.env.ua.ie == 6) { + for (var i = 0; i < this.select_elements.length; i++) { + this.select_elements[i].style.visibility = + this.select_elements[i].style._visibility; + } + } + }, - YAHOO.util.Event.on(this.close_div, 'click', this.close, this, true); + // }}} + // {{{ handleKeyPress() - this.container.appendChild(this.close_div); -}; + handleKeyPress(e) { + YAHOO.util.Event.preventDefault(e); -// }}} -// {{{ SwatAbstractOverlay.prototype.showCloseDiv + // close preview on backspace or escape + if (e.keyCode == 8 || e.keyCode == 27) + this.close(); + }, -SwatAbstractOverlay.prototype.showCloseDiv = function() -{ - if (YAHOO.env.ua.ie == 6) { - this.select_elements = document.getElementsByTagName('select'); - for (var i = 0; i < this.select_elements.length; i++) { - this.select_elements[i].style._visibility = - this.select_elements[i].style.visibility; + // }}} + // {{{ handleKeyPress() - this.select_elements[i].style.visibility = 'hidden'; + handleKeyPress(e) { + // close preview on escape or enter key + if (e.keyCode == 27 || e.keyCode == 13) { + YAHOO.util.Event.preventDefault(e); + this.close(); } - } + }, - this.close_div.style.height = YAHOO.util.Dom.getDocumentHeight() + 'px'; - this.close_div.style.display = 'block'; - SwatZIndexManager.raiseElement(this.close_div); -}; - -// }}} -// {{{ SwatAbstractOverlay.prototype.hideCloseDiv - -SwatAbstractOverlay.prototype.hideCloseDiv = function() -{ - SwatZIndexManager.lowerElement(this.close_div); - this.close_div.style.display = 'none'; - if (YAHOO.env.ua.ie == 6) { - for (var i = 0; i < this.select_elements.length; i++) { - this.select_elements[i].style.visibility = - this.select_elements[i].style._visibility; - } - } -}; + // }}} + // {{{ addKeyPressHandler() -// }}} -// {{{ SwatAbstractOverlay.prototype.handleKeyPress + addKeyPressHandler() { + YAHOO.util.Event.on(document, 'keypress', + this.handleKeyPress, this, true); + }, -SwatAbstractOverlay.prototype.handleKeyPress = function(e) -{ - YAHOO.util.Event.preventDefault(e); + // }}} + // {{{ removeKeyPressHandler() - // close preview on backspace or escape - if (e.keyCode == 8 || e.keyCode == 27) - this.close(); -}; + removeKeyPressHandler() { + YAHOO.util.Event.removeListener(document, 'keypress', + this.handleKeyPress, this, true); + }, -// }}} -// {{{ SwatAbstractOverlay.prototype.handleKeyPress + // }}} + // {{{ handleCloseLink() -SwatAbstractOverlay.prototype.handleKeyPress = function(e) -{ - // close preview on escape or enter key - if (e.keyCode == 27 || e.keyCode == 13) { + handleCloseLink(e) { YAHOO.util.Event.preventDefault(e); this.close(); - } -}; - -// }}} -// {{{ SwatAbstractOverlay.prototype.addKeyPressHandler - -SwatAbstractOverlay.prototype.addKeyPressHandler = function() -{ - YAHOO.util.Event.on(document, 'keypress', - this.handleKeyPress, this, true); -}; + }, -// }}} -// {{{ SwatAbstractOverlay.prototype.removeKeyPressHandler - -SwatAbstractOverlay.prototype.removeKeyPressHandler = function() -{ - YAHOO.util.Event.removeListener(document, 'keypress', - this.handleKeyPress, this, true); -}; - -// }}} -// {{{ SwatAbstractOverlay.prototype.handleCloseLink + // }}} +} -SwatAbstractOverlay.prototype.handleCloseLink = function(e) -{ - YAHOO.util.Event.preventDefault(e); - this.close(); -}; +SwatAbstractOverlay.close_text = 'Close'; -// }}} +module.exports = SwatAbstractOverlay; diff --git a/www/javascript/swat-accordion.js b/www/javascript/swat-accordion.js index 31fff332d..dbb0d8611 100644 --- a/www/javascript/swat-accordion.js +++ b/www/javascript/swat-accordion.js @@ -229,3 +229,5 @@ SwatAccordionPage.prototype.setStatus = function(stat) 'swat-accordion-page-closed'); } }; + +module.exports = SwatAccordion; diff --git a/www/javascript/swat-actions.js b/www/javascript/swat-actions.js index 14c70e850..6fe4d1d05 100644 --- a/www/javascript/swat-actions.js +++ b/www/javascript/swat-actions.js @@ -1,51 +1,146 @@ -function SwatActions(id, values, selected) -{ - this.id = id; - this.flydown = document.getElementById(id + '_action_flydown'); - this.selected_element = (selected) ? - document.getElementById(id + '_' + selected) : null; - - var button = document.getElementById(id + '_apply_button'); - - this.values = values; - this.message_shown = false; - this.view = null; - this.selector_id = null; - - // create message content area - this.message_content = document.createElement('span'); - - // create message dismiss link - var message_dismiss = document.createElement('a'); - message_dismiss.href = '#'; - message_dismiss.title = SwatActions.dismiss_text; - YAHOO.util.Dom.addClass(message_dismiss, - 'swat-actions-message-dismiss-link'); - - message_dismiss.appendChild( - document.createTextNode(SwatActions.dismiss_text)); - - YAHOO.util.Event.addListener(message_dismiss, 'click', - this.handleMessageClose, this, true); - - // create message span and add content area and dismiss link - this.message_span = document.createElement('span'); - YAHOO.util.Dom.addClass(this.message_span, 'swat-actions-message'); - this.message_span.style.visibility = 'hidden'; - this.message_span.appendChild(this.message_content); - this.message_span.appendChild(message_dismiss); - - // add message span to document - button.parentNode.appendChild(this.message_span); - - YAHOO.util.Event.addListener(this.flydown, 'change', - this.handleChange, this, true); - - YAHOO.util.Event.addListener(this.flydown, 'keyup', - this.handleChange, this, true); - - YAHOO.util.Event.addListener(button, 'click', - this.handleButtonClick, this, true); +class SwatActions { + constructor(id, values, selected) { + this.id = id; + this.flydown = document.getElementById(id + '_action_flydown'); + this.selected_element = (selected) ? + document.getElementById(id + '_' + selected) : null; + + var button = document.getElementById(id + '_apply_button'); + + this.values = values; + this.message_shown = false; + this.view = null; + this.selector_id = null; + + // create message content area + this.message_content = document.createElement('span'); + + // create message dismiss link + var message_dismiss = document.createElement('a'); + message_dismiss.href = '#'; + message_dismiss.title = SwatActions.dismiss_text; + YAHOO.util.Dom.addClass(message_dismiss, + 'swat-actions-message-dismiss-link'); + + message_dismiss.appendChild( + document.createTextNode(SwatActions.dismiss_text)); + + YAHOO.util.Event.addListener(message_dismiss, 'click', + this.handleMessageClose, this, true); + + // create message span and add content area and dismiss link + this.message_span = document.createElement('span'); + YAHOO.util.Dom.addClass(this.message_span, 'swat-actions-message'); + this.message_span.style.visibility = 'hidden'; + this.message_span.appendChild(this.message_content); + this.message_span.appendChild(message_dismiss); + + // add message span to document + button.parentNode.appendChild(this.message_span); + + YAHOO.util.Event.addListener(this.flydown, 'change', + this.handleChange, this, true); + + YAHOO.util.Event.addListener(this.flydown, 'keyup', + this.handleChange, this, true); + + YAHOO.util.Event.addListener(button, 'click', + this.handleButtonClick, this, true); + } + + setViewSelector(view, selector_id) { + if (view.getSelectorItemCount) { + this.view = view; + this.selector_id = selector_id; + } + }, + + handleChange() { + if (this.selected_element) + YAHOO.util.Dom.addClass(this.selected_element, 'swat-hidden'); + + var id = this.id + '_' + + this.values[this.flydown.selectedIndex]; + + this.selected_element = document.getElementById(id); + + if (this.selected_element) + YAHOO.util.Dom.removeClass(this.selected_element, 'swat-hidden'); + }, + + handleButtonClick(e) { + var is_blank; + var value_exp = this.flydown.value.split('|', 2); + if (value_exp.length == 1) + is_blank = (value_exp[0] === ''); + else + is_blank = (value_exp[1] == 'N;'); + + if (this.view) { + var items_selected = + (this.view.getSelectorItemCount(this.selector_id) > 0); + } else { + var items_selected = true; + } + + var message; + if (is_blank && !items_selected) { + message = SwatActions.select_an_item_and_an_action_text; + } else if (is_blank) { + message = SwatActions.select_an_action_text; + } else if (!items_selected) { + message = SwatActions.select_an_item_text; + } + + if (message) { + YAHOO.util.Event.preventDefault(e); + this.showMessage(message); + } + }, + + handleMessageClose(e) { + YAHOO.util.Event.preventDefault(e); + this.hideMessage(); + }, + + showMessage(message_text) { + if (this.message_content.firstChild) + this.message_content.removeChild(this.message_content.firstChild); + + this.message_content.appendChild( + document.createTextNode(message_text + ' ')); + + if (!this.message_shown) { + this.message_span.style.opacity = 0; + this.message_span.style.visibility = 'visible'; + + var animation = new YAHOO.util.Anim(this.message_span, + { opacity: { from: 0, to: 1} }, + 0.3, YAHOO.util.Easing.easeInStrong); + + animation.animate(); + + this.message_shown = true; + } + }, + + hideMessage() { + if (this.message_shown) { + var animation = new YAHOO.util.Anim(this.message_span, + { opacity: { from: 1, to: 0} }, + 0.3, YAHOO.util.Easing.easeOutStrong); + + animation.onComplete.subscribe( + function() + { + this.message_span.style.visibility = 'hidden'; + this.message_shown = false; + }, + this, true); + + animation.animate(); + } + }, } SwatActions.dismiss_text = 'Dismiss message.'; @@ -54,102 +149,4 @@ SwatActions.select_an_item_text = 'Please select one or more items.'; SwatActions.select_an_item_and_an_action_text = 'Please select an action, and one or more items.'; -SwatActions.prototype.setViewSelector = function(view, selector_id) -{ - if (view.getSelectorItemCount) { - this.view = view; - this.selector_id = selector_id; - } -}; - -SwatActions.prototype.handleChange = function() -{ - if (this.selected_element) - YAHOO.util.Dom.addClass(this.selected_element, 'swat-hidden'); - - var id = this.id + '_' + - this.values[this.flydown.selectedIndex]; - - this.selected_element = document.getElementById(id); - - if (this.selected_element) - YAHOO.util.Dom.removeClass(this.selected_element, 'swat-hidden'); -}; - -SwatActions.prototype.handleButtonClick = function(e) -{ - var is_blank; - var value_exp = this.flydown.value.split('|', 2); - if (value_exp.length == 1) - is_blank = (value_exp[0] === ''); - else - is_blank = (value_exp[1] == 'N;'); - - if (this.view) { - var items_selected = - (this.view.getSelectorItemCount(this.selector_id) > 0); - } else { - var items_selected = true; - } - - var message; - if (is_blank && !items_selected) { - message = SwatActions.select_an_item_and_an_action_text; - } else if (is_blank) { - message = SwatActions.select_an_action_text; - } else if (!items_selected) { - message = SwatActions.select_an_item_text; - } - - if (message) { - YAHOO.util.Event.preventDefault(e); - this.showMessage(message); - } -}; - -SwatActions.prototype.handleMessageClose = function(e) -{ - YAHOO.util.Event.preventDefault(e); - this.hideMessage(); -}; - -SwatActions.prototype.showMessage = function(message_text) -{ - if (this.message_content.firstChild) - this.message_content.removeChild(this.message_content.firstChild); - - this.message_content.appendChild( - document.createTextNode(message_text + ' ')); - - if (!this.message_shown) { - this.message_span.style.opacity = 0; - this.message_span.style.visibility = 'visible'; - - var animation = new YAHOO.util.Anim(this.message_span, - { opacity: { from: 0, to: 1} }, - 0.3, YAHOO.util.Easing.easeInStrong); - - animation.animate(); - - this.message_shown = true; - } -}; - -SwatActions.prototype.hideMessage = function() -{ - if (this.message_shown) { - var animation = new YAHOO.util.Anim(this.message_span, - { opacity: { from: 1, to: 0} }, - 0.3, YAHOO.util.Easing.easeOutStrong); - - animation.onComplete.subscribe( - function() - { - this.message_span.style.visibility = 'hidden'; - this.message_shown = false; - }, - this, true); - - animation.animate(); - } -}; +module.exports = SwatActions; diff --git a/www/javascript/swat-button.js b/www/javascript/swat-button.js index 25f045f17..61f908846 100644 --- a/www/javascript/swat-button.js +++ b/www/javascript/swat-button.js @@ -1,88 +1,86 @@ -function SwatButton(id, show_processing_throbber) -{ - this.id = id; +class SwatButton { + constructor(id, show_processing_throbber) { + this.id = id; - this.button = document.getElementById(this.id); + this.button = document.getElementById(this.id); - // deprecated - this.show_processing_throbber = show_processing_throbber; + // deprecated + this.show_processing_throbber = show_processing_throbber; - this.confirmation_message = ''; - this.throbber_container = null; + this.confirmation_message = ''; + this.throbber_container = null; - if (show_processing_throbber) { - this.initThrobber(); - } - - YAHOO.util.Event.addListener(this.button, 'click', - this.handleClick, this, true); -} + if (show_processing_throbber) { + this.initThrobber(); + } -SwatButton.prototype.handleClick = function(e) -{ - var confirmed = (this.confirmation_message) ? - confirm(this.confirmation_message) : true; - - if (confirmed) { - if (this.throbber_container !== null) { - this.button.disabled = true; - YAHOO.util.Dom.addClass(this.button, 'swat-insensitive'); - - // add button to form data manually since we disabled it above - var div = document.createElement('div'); - var hidden_field = document.createElement('input'); - hidden_field.type = 'hidden'; - hidden_field.name = this.id; - hidden_field.value = this.button.value; - div.appendChild(hidden_field); - this.button.form.appendChild(div); - - this.showThrobber(); - var form = YAHOO.util.Dom.getAncestorByTagName(this.button, 'form'); - if (form) { - form.submit(); // needed for IE and WebKit + YAHOO.util.Event.addListener(this.button, 'click', + this.handleClick, this, true); + }, + + handleClick(e) { + var confirmed = (this.confirmation_message) ? + confirm(this.confirmation_message) : true; + + if (confirmed) { + if (this.throbber_container !== null) { + this.button.disabled = true; + YAHOO.util.Dom.addClass(this.button, 'swat-insensitive'); + + // add button to form data manually since we disabled it above + var div = document.createElement('div'); + var hidden_field = document.createElement('input'); + hidden_field.type = 'hidden'; + hidden_field.name = this.id; + hidden_field.value = this.button.value; + div.appendChild(hidden_field); + this.button.form.appendChild(div); + + this.showThrobber(); + var form = YAHOO.util.Dom.getAncestorByTagName(this.button, 'form'); + if (form) { + form.submit(); // needed for IE and WebKit + } } + } else { + YAHOO.util.Event.preventDefault(e); } - } else { - YAHOO.util.Event.preventDefault(e); - } -}; + }, + + initThrobber() { + this.throbber_container = document.createElement('span'); + + YAHOO.util.Dom.addClass(this.throbber_container, + 'swat-button-processing-throbber'); -SwatButton.prototype.initThrobber = function() -{ - this.throbber_container = document.createElement('span'); + this.button.parentNode.appendChild(this.throbber_container); + }, - YAHOO.util.Dom.addClass(this.throbber_container, - 'swat-button-processing-throbber'); + showThrobber() { + var animation = new YAHOO.util.Anim(this.throbber_container, + { opacity: { to: 0.5 }}, 1, YAHOO.util.Easing.easingNone); - this.button.parentNode.appendChild(this.throbber_container); -}; + animation.animate(); + }, -SwatButton.prototype.showThrobber = function() -{ - var animation = new YAHOO.util.Anim(this.throbber_container, - { opacity: { to: 0.5 }}, 1, YAHOO.util.Easing.easingNone); + setProcessingMessage(message) { + if (this.throbber_container === null) { + this.initThrobber(); + } - animation.animate(); -}; + if (message.length > 0) { + this.throbber_container.appendChild(document.createTextNode(message)); + YAHOO.util.Dom.addClass(this.throbber_container, + 'swat-button-processing-throbber-text'); + } else { + // the following string is a UTF-8 encoded non breaking space + this.throbber_container.appendChild(document.createTextNode(' ')); + } + }, -SwatButton.prototype.setProcessingMessage = function(message) -{ - if (this.throbber_container === null) { - this.initThrobber(); - } + setConfirmationMessage(message) { + this.confirmation_message = message; + }, +} - if (message.length > 0) { - this.throbber_container.appendChild(document.createTextNode(message)); - YAHOO.util.Dom.addClass(this.throbber_container, - 'swat-button-processing-throbber-text'); - } else { - // the following string is a UTF-8 encoded non breaking space - this.throbber_container.appendChild(document.createTextNode(' ')); - } -}; - -SwatButton.prototype.setConfirmationMessage = function(message) -{ - this.confirmation_message = message; -}; +module.exports = SwatButton; diff --git a/www/javascript/swat-calendar.js b/www/javascript/swat-calendar.js index e9857823d..c0a19411d 100644 --- a/www/javascript/swat-calendar.js +++ b/www/javascript/swat-calendar.js @@ -883,3 +883,5 @@ SwatCalendar.prototype.handleDocumentClick = function(e) this.close(); } }; + +module.exports = SwatCalendar; diff --git a/www/javascript/swat-cascade.js b/www/javascript/swat-cascade.js index 606133d0e..595a621ce 100644 --- a/www/javascript/swat-cascade.js +++ b/www/javascript/swat-cascade.js @@ -80,3 +80,5 @@ function SwatCascadeChild(value, title, selected) this.title = title; this.selected = selected; } + +module.exports = SwatCascade; diff --git a/www/javascript/swat-change-order.js b/www/javascript/swat-change-order.js index c009daa3c..90b310284 100644 --- a/www/javascript/swat-change-order.js +++ b/www/javascript/swat-change-order.js @@ -1058,3 +1058,5 @@ SwatChangeOrder.prototype.isGrid = function() }; // }}} + +module.exports = SwatChangeOrder; diff --git a/www/javascript/swat-check-all.js b/www/javascript/swat-check-all.js index 30709aa97..6a3929d10 100644 --- a/www/javascript/swat-check-all.js +++ b/www/javascript/swat-check-all.js @@ -89,3 +89,5 @@ SwatCheckAll.prototype.clickHandler = function() this.controller.checkAll(this.check_all.checked); this.updateExtendedCheckbox(); }; + +module.exports = SwatCheckAll; diff --git a/www/javascript/swat-checkbox-cell-renderer.js b/www/javascript/swat-checkbox-cell-renderer.js index dc77a14ad..68ff7bfe1 100644 --- a/www/javascript/swat-checkbox-cell-renderer.js +++ b/www/javascript/swat-checkbox-cell-renderer.js @@ -132,3 +132,5 @@ SwatCheckboxCellRenderer.prototype.updateNode = function(checkbox_node, } } }; + +module.exports = SwatCheckboxCellRenderer; diff --git a/www/javascript/swat-checkbox-entry-list.js b/www/javascript/swat-checkbox-entry-list.js index 3a4a74ca9..e65831585 100644 --- a/www/javascript/swat-checkbox-entry-list.js +++ b/www/javascript/swat-checkbox-entry-list.js @@ -1,3 +1,5 @@ +const SwatCheckboxList = require('./swat-checkbox-list'); + function SwatCheckboxEntryList(id) { this.entry_list = []; @@ -63,3 +65,5 @@ SwatCheckboxEntryList.prototype.updateFields = function() for (var i = 0; i < this.check_list.length; i++) this.setEntrySensitivity(i, this.check_list[i].checked); }; + +module.exports = SwatCheckboxEntryList; diff --git a/www/javascript/swat-checkbox-list.js b/www/javascript/swat-checkbox-list.js index 7ea7407f2..46dfffd42 100644 --- a/www/javascript/swat-checkbox-list.js +++ b/www/javascript/swat-checkbox-list.js @@ -62,3 +62,5 @@ SwatCheckboxList.prototype.checkAll = function(checked) } } }; + +module.exports = SwatCheckboxList; From d69f4b18d1dea2627e4434a5a9e3b933328ab5b0 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Sat, 30 Dec 2017 19:31:27 -0400 Subject: [PATCH 02/35] COnvert more classes to ES6 modules --- www/javascript/swat-abstract-overlay.js | 98 +- www/javascript/swat-accordion-page.js | 37 + www/javascript/swat-accordion.js | 351 ++-- www/javascript/swat-actions.js | 62 +- www/javascript/swat-button.js | 55 +- www/javascript/swat-calendar.js | 1476 +++++++++-------- www/javascript/swat-cascade-child.js | 9 + www/javascript/swat-cascade.js | 142 +- www/javascript/swat-check-all.js | 174 +- www/javascript/swat-checkbox-cell-renderer.js | 233 ++- www/javascript/swat-checkbox-entry-list.js | 106 +- www/javascript/swat-checkbox-list.js | 113 +- www/javascript/swat-disclosure.js | 421 +++-- www/javascript/swat-fieldset.js | 61 +- www/javascript/swat-form.js | 82 +- www/javascript/swat-frame-disclosure.js | 65 + www/javascript/swat-image-cropper.js | 40 +- www/javascript/swat-image-preview-display.js | 491 +++--- .../swat-message-display-message.js | 137 ++ www/javascript/swat-message-display.js | 162 +- www/javascript/swat-progress-bar.js | 465 +++--- .../swat-radio-button-cell-renderer.js | 89 +- www/javascript/swat-radio-note-book.js | 302 ++-- www/javascript/swat-rating.js | 265 ++- www/javascript/swat-search-entry.js | 333 ++-- www/javascript/swat-simple-color-entry.js | 525 +++--- www/javascript/swat-table-view-input-row.js | 343 ++-- www/javascript/swat-table-view.js | 246 +-- www/javascript/swat-textarea.js | 314 ++-- www/javascript/swat-tile-view.js | 161 +- www/javascript/swat-time-entry.js | 430 ++--- www/javascript/swat-view.js | 321 ++-- www/javascript/swat-z-index-manager.js | 96 +- www/javascript/swat-z-index-node.js | 41 + 34 files changed, 4273 insertions(+), 3973 deletions(-) create mode 100644 www/javascript/swat-accordion-page.js create mode 100644 www/javascript/swat-cascade-child.js create mode 100644 www/javascript/swat-frame-disclosure.js create mode 100644 www/javascript/swat-message-display-message.js create mode 100644 www/javascript/swat-z-index-node.js diff --git a/www/javascript/swat-abstract-overlay.js b/www/javascript/swat-abstract-overlay.js index 7d19087fb..1ec9c17e2 100644 --- a/www/javascript/swat-abstract-overlay.js +++ b/www/javascript/swat-abstract-overlay.js @@ -1,3 +1,5 @@ +const SwatZIndexManager = require('./swat-z-index-manager'); + /** * Abstract overlay widget * @@ -32,7 +34,7 @@ class SwatAbstractOverlay { this.draw(); this.drawCloseDiv(); this.createOverlay(); - }, + } // }}} // {{{ draw() @@ -51,7 +53,7 @@ class SwatAbstractOverlay { this.toggle_button.appendChild(this.overlay_content); this.container.appendChild(this.toggle_button); - }, + } // }}} // {{{ getToggleButton() @@ -66,7 +68,7 @@ class SwatAbstractOverlay { YAHOO.util.Event.on(toggle_button, 'click', this.toggle, this, true); return toggle_button; - }, + } // }}} // {{{ getHeader() @@ -76,7 +78,7 @@ class SwatAbstractOverlay { YAHOO.util.Dom.addClass(header, 'hd'); header.appendChild(this.getCloseLink()); return header; - }, + } // }}} // {{{ getBody() @@ -85,7 +87,7 @@ class SwatAbstractOverlay { var body = document.createElement('div'); YAHOO.util.Dom.addClass(body, 'bd'); return body; - }, + } // }}} // {{{ getFooter() @@ -94,22 +96,31 @@ class SwatAbstractOverlay { var footer = document.createElement('div'); YAHOO.util.Dom.addClass(footer, 'ft'); return footer; - }, + } // }}} // {{{ getCloseLink() getCloseLink() { var close_link = document.createElement('a'); + close_link.className = 'swat-overlay-close-link'; close_link.href = '#close'; - close_link.appendChild(document.createTextNode( - SwatAbstractOverlay.close_text)); - - YAHOO.util.Event.on(close_link, 'click', this.handleCloseLink, this, true); + close_link.appendChild( + document.createTextNode( + SwatAbstractOverlay.close_text + ) + ); + YAHOO.util.Event.on( + close_link, + 'click', + this.handleCloseLink, + this, + true + ); return close_link; - }, + } // }}} // {{{ createOverlay() @@ -118,15 +129,17 @@ class SwatAbstractOverlay { * Creates overlay widget when toggle button has been drawn */ createOverlay(event) { - this.overlay = new YAHOO.widget.Overlay(this.id + '_overlay', - { visible: false, constraintoviewport: true }); + this.overlay = new YAHOO.widget.Overlay( + this.id + '_overlay', + { visible: false, constraintoviewport: true } + ); this.overlay.body.appendChild(this.getBodyContent()); this.overlay.render(this.container); this.overlay_content.style.display = 'block'; this.is_drawn = true; - }, + } // }}} // {{{ close() @@ -142,7 +155,7 @@ class SwatAbstractOverlay { this.is_open = false; this.removeKeyPressHandler(); - }, + } // }}} // {{{ open() @@ -161,7 +174,7 @@ class SwatAbstractOverlay { SwatZIndexManager.raiseElement(this.overlay_content); this.addKeyPressHandler(); - }, + } // }}} // {{{ getOverlayContext() @@ -171,7 +184,7 @@ class SwatAbstractOverlay { */ getOverlayContext() { return [this.toggle_button, 'tl', 'bl']; - }, + } // }}} // {{{ getBodyContent @@ -179,20 +192,20 @@ class SwatAbstractOverlay { /** * Draws this overlay */ - getBodyContent() - { + getBodyContent() { return document.createElement('div'); - }, + } // }}} // {{{ toggle() toggle() { - if (this.is_open) + if (this.is_open) { this.close(); - else + } else { this.open(); - }, + } + } // }}} // {{{ drawCloseDiv() @@ -206,7 +219,7 @@ class SwatAbstractOverlay { YAHOO.util.Event.on(this.close_div, 'click', this.close, this, true); this.container.appendChild(this.close_div); - }, + } // }}} // {{{ showCloseDiv() @@ -225,7 +238,7 @@ class SwatAbstractOverlay { this.close_div.style.height = YAHOO.util.Dom.getDocumentHeight() + 'px'; this.close_div.style.display = 'block'; SwatZIndexManager.raiseElement(this.close_div); - }, + } // }}} // {{{ hideCloseDiv() @@ -239,7 +252,7 @@ class SwatAbstractOverlay { this.select_elements[i].style._visibility; } } - }, + } // }}} // {{{ handleKeyPress() @@ -248,36 +261,47 @@ class SwatAbstractOverlay { YAHOO.util.Event.preventDefault(e); // close preview on backspace or escape - if (e.keyCode == 8 || e.keyCode == 27) + if (e.keyCode === 8 || e.keyCode === 27) { this.close(); - }, + } + } // }}} // {{{ handleKeyPress() handleKeyPress(e) { // close preview on escape or enter key - if (e.keyCode == 27 || e.keyCode == 13) { + if (e.keyCode === 27 || e.keyCode === 13) { YAHOO.util.Event.preventDefault(e); this.close(); } - }, + } // }}} // {{{ addKeyPressHandler() addKeyPressHandler() { - YAHOO.util.Event.on(document, 'keypress', - this.handleKeyPress, this, true); - }, + YAHOO.util.Event.on( + document, + 'keypress', + this.handleKeyPress, + this, + true + ); + } // }}} // {{{ removeKeyPressHandler() removeKeyPressHandler() { - YAHOO.util.Event.removeListener(document, 'keypress', - this.handleKeyPress, this, true); - }, + YAHOO.util.Event.removeListener( + document, + 'keypress', + this.handleKeyPress, + this, + true + ); + } // }}} // {{{ handleCloseLink() @@ -285,7 +309,7 @@ class SwatAbstractOverlay { handleCloseLink(e) { YAHOO.util.Event.preventDefault(e); this.close(); - }, + } // }}} } diff --git a/www/javascript/swat-accordion-page.js b/www/javascript/swat-accordion-page.js new file mode 100644 index 000000000..c3746d073 --- /dev/null +++ b/www/javascript/swat-accordion-page.js @@ -0,0 +1,37 @@ +class SwatAccordionPage { + constructor(el) { + this.element = el; + this.toggle = YAHOO.util.Dom.getFirstChild(el); + this.toggleLink = YAHOO.util.Dom.getElementsByClassName( + 'swat-accordion-page-link', + 'a', + this.toggle + )[0]; + this.animation = YAHOO.util.Dom.getNextSibling(this.toggle); + this.content = YAHOO.util.Dom.getFirstChild(this.animation); + } + + setStatus(status) { + if (status === 'opened') { + YAHOO.util.Dom.removeClass( + this.element, + 'swat-accordion-page-closed' + ); + YAHOO.util.Dom.addClass( + this.element, + 'swat-accordion-page-opened' + ); + } else { + YAHOO.util.Dom.removeClass( + this.element, + 'swat-accordion-page-opened' + ); + YAHOO.util.Dom.addClass( + this.element, + 'swat-accordion-page-closed' + ); + } + } +} + +module.exports = SwatAccordionPage; diff --git a/www/javascript/swat-accordion.js b/www/javascript/swat-accordion.js index dbb0d8611..9a2197e16 100644 --- a/www/javascript/swat-accordion.js +++ b/www/javascript/swat-accordion.js @@ -1,233 +1,204 @@ -function SwatAccordion(id) -{ - this.id = id; - this.current_page = null; - this.animate = true; - this.always_open = true; // by default, always keep one page open - this.semaphore = false; - this.pageChangeEvent = new YAHOO.util.CustomEvent('pageChange'); - this.postInitEvent = new YAHOO.util.CustomEvent('postInit'); - - YAHOO.util.Event.onDOMReady(this.init, this, true); -} - -SwatAccordion.resize_period = 0.25; // seconds - -SwatAccordion.prototype.init = function() -{ - this.container = document.getElementById(this.id); - this.pages = []; - - var page; - var pages = YAHOO.util.Dom.getChildren(this.container); - - // check to see if a page is open via a hash-tag - var hash_open_page = this.getPageFromHash(); - - for (var i = 0; i < pages.length; i++) { - page = new SwatAccordionPage(pages[i]); - - var status_icon = document.createElement('span'); - status_icon.className = 'swat-accordion-toggle-status'; - - page.toggle.insertBefore(status_icon, page.toggle.firstChild); - this.addLinkHash(page); +const SwatAccordionPage = require('./swat-accordion-page'); + +class SwatAccordion { + constructor(id) { + this.id = id; + this.current_page = null; + this.animate = true; + this.always_open = true; // by default, always keep one page open + this.semaphore = false; + this.pageChangeEvent = new YAHOO.util.CustomEvent('pageChange'); + this.postInitEvent = new YAHOO.util.CustomEvent('postInit'); - if (hash_open_page === page.element || (hash_open_page === null && - YAHOO.util.Dom.hasClass(page.element, 'selected'))) { + YAHOO.util.Event.onDOMReady(this.init, this, true); + } - this.current_page = page; - YAHOO.util.Dom.removeClass(page.element, 'selected'); - YAHOO.util.Dom.addClass(page.element, 'swat-accordion-page-opened'); - } else { - page.animation.style.display = 'none'; - YAHOO.util.Dom.addClass(page.element, 'swat-accordion-page-closed'); + init() { + this.container = document.getElementById(this.id); + this.pages = []; + + var page; + var pages = YAHOO.util.Dom.getChildren(this.container); + + // check to see if a page is open via a hash-tag + var hash_open_page = this.getPageFromHash(); + + for (var i = 0; i < pages.length; i++) { + page = new SwatAccordionPage(pages[i]); + + var status_icon = document.createElement('span'); + status_icon.className = 'swat-accordion-toggle-status'; + + page.toggle.insertBefore(status_icon, page.toggle.firstChild); + this.addLinkHash(page); + + if (hash_open_page === page.element || (hash_open_page === null && + YAHOO.util.Dom.hasClass(page.element, 'selected')) + ) { + this.current_page = page; + YAHOO.util.Dom.removeClass(page.element, 'selected'); + YAHOO.util.Dom.addClass( + page.element, + 'swat-accordion-page-opened' + ); + } else { + page.animation.style.display = 'none'; + YAHOO.util.Dom.addClass( + page.element, + 'swat-accordion-page-closed' + ); + } + + var that = this; + (function() { + var the_page = page; + YAHOO.util.Event.on(page.toggleLink, 'click', function (e) { + if (!that.always_open && the_page === that.current_page) { + var set_page = null; + } else { + var set_page = the_page; + } + + if (that.animate) { + that.setPageWithAnimation(set_page); + } else { + that.setPage(set_page); + } + }); + })(); + + this.pages.push(page); } - var that = this; - (function() { - var the_page = page; - YAHOO.util.Event.on(page.toggleLink, 'click', function (e) { - if (!that.always_open && the_page === that.current_page) { - var set_page = null; - } else { - var set_page = the_page; - } - - if (that.animate) { - that.setPageWithAnimation(set_page); - } else { - that.setPage(set_page); - } - }); - })(); - - this.pages.push(page); + this.postInitEvent.fire(); } - this.postInitEvent.fire(); - -}; - -SwatAccordion.prototype.getPageFromHash = function() -{ - var pages = YAHOO.util.Dom.getChildren(this.container); + getPageFromHash() { + var pages = YAHOO.util.Dom.getChildren(this.container); - // check to see if a page is open via a hash-tag - var hash_open_page = null; - for (var i = 0; i < pages.length; i++) { - if (location.hash == '#open_' + pages[i].id) { - hash_open_page = pages[i]; + // check to see if a page is open via a hash-tag + var hash_open_page = null; + for (var i = 0; i < pages.length; i++) { + if (location.hash == '#open_' + pages[i].id) { + hash_open_page = pages[i]; + } } - } - - return hash_open_page; -}; -SwatAccordion.prototype.addLinkHash = function(page) -{ - page.toggleLink.href = location.href.split('#')[0] + '#' + - 'open_' + page.element.id; -}; + return hash_open_page; + } -SwatAccordion.prototype.setPage = function(page) -{ - if (this.current_page === page) { - return; + addLinkHash(page) { + page.toggleLink.href = location.href.split('#')[0] + '#' + + 'open_' + page.element.id; } - for (var i = 0; i < this.pages.length; i++) { - if (this.pages[i] === page) { - this.pages[i].animation.style.display = 'block'; - this.pages[i].setStatus('opened'); - } else { - this.pages[i].animation.style.display = 'none'; - this.pages[i].setStatus('closed'); + setPage(page) { + if (this.current_page === page) { + return; } - } - this.pageChangeEvent.fire(page, this.current_page); + for (var i = 0; i < this.pages.length; i++) { + if (this.pages[i] === page) { + this.pages[i].animation.style.display = 'block'; + this.pages[i].setStatus('opened'); + } else { + this.pages[i].animation.style.display = 'none'; + this.pages[i].setStatus('closed'); + } + } - this.current_page = page; -}; + this.pageChangeEvent.fire(page, this.current_page); -SwatAccordion.prototype.setPageWithAnimation = function(new_page) -{ - if (this.current_page === new_page || this.semaphore) { - return; + this.current_page = page; } - this.semaphore = true; + setPageWithAnimation(new_page) { + if (this.current_page === new_page || this.semaphore) { + return; + } - var old_page = this.current_page; + this.semaphore = true; - // old_page === null means we're opening from a completely closed state - if (old_page !== null) { - var old_region = YAHOO.util.Dom.getRegion(old_page.animation); - var old_from_height = old_region.height; - var old_to_height = 0; - old_page.animation.style.overflow = 'hidden'; - } + var old_page = this.current_page; - // new_page === null means we're closing to a completely closed state - if (new_page === null) { - var new_to_height = 0; - - var anim = new YAHOO.util.Anim( - old_page.animation, { }, - SwatAccordion.resize_period, - YAHOO.util.Easing.easeBoth); - } else { - new_page.animation.style.overflow = 'hidden'; - - if (new_page.animation.style.height === '' || - new_page.animation.style.height == 'auto') { - new_page.animation.style.height = '0'; - new_from_height = 0; - } else { - new_from_height = parseInt(new_page.animation.style.height); + // old_page === null means we're opening from a completely closed state + if (old_page !== null) { + var old_region = YAHOO.util.Dom.getRegion(old_page.animation); + var old_from_height = old_region.height; + var old_to_height = 0; + old_page.animation.style.overflow = 'hidden'; } - new_page.animation.style.display = 'block'; + // new_page === null means we're closing to a completely closed state + if (new_page === null) { + var new_to_height = 0; - var new_region = YAHOO.util.Dom.getRegion(new_page.content); - var new_to_height = new_region.height; + var anim = new YAHOO.util.Anim( + old_page.animation, { }, + SwatAccordion.resize_period, + YAHOO.util.Easing.easeBoth); + } else { + new_page.animation.style.overflow = 'hidden'; - var anim = new YAHOO.util.Anim( - new_page.animation, { }, - SwatAccordion.resize_period, - YAHOO.util.Easing.easeBoth); - } + if (new_page.animation.style.height === '' || + new_page.animation.style.height == 'auto') { + new_page.animation.style.height = '0'; + new_from_height = 0; + } else { + new_from_height = parseInt(new_page.animation.style.height); + } - anim.onTween.subscribe(function (name, data) { - if (old_page !== null) { - var old_height = Math.ceil( - anim.doMethod('height', old_from_height, old_to_height)); + new_page.animation.style.display = 'block'; - old_page.animation.style.height = old_height + 'px'; + var new_region = YAHOO.util.Dom.getRegion(new_page.content); + var new_to_height = new_region.height; + + var anim = new YAHOO.util.Anim( + new_page.animation, { }, + SwatAccordion.resize_period, + YAHOO.util.Easing.easeBoth); } - if (new_page !== null) { - var new_height = Math.floor( - anim.doMethod('height', new_from_height, new_to_height)); + anim.onTween.subscribe(function (name, data) { + if (old_page !== null) { + var old_height = Math.ceil( + anim.doMethod('height', old_from_height, old_to_height)); - new_page.animation.style.height = new_height + 'px'; - } - }, this, true); + old_page.animation.style.height = old_height + 'px'; + } - anim.onComplete.subscribe(function () { - if (new_page !== null) { - new_page.animation.style.height = 'auto'; - } + if (new_page !== null) { + var new_height = Math.floor( + anim.doMethod('height', new_from_height, new_to_height)); - this.semaphore = false; - }, this, true); + new_page.animation.style.height = new_height + 'px'; + } + }, this, true); - anim.animate(); + anim.onComplete.subscribe(function () { + if (new_page !== null) { + new_page.animation.style.height = 'auto'; + } - if (old_page !== null) { - old_page.setStatus('closed'); - } + this.semaphore = false; + }, this, true); - if (new_page !== null) { - new_page.setStatus('opened'); - } + anim.animate(); - this.pageChangeEvent.fire(new_page, old_page); + if (old_page !== null) { + old_page.setStatus('closed'); + } - this.current_page = new_page; -}; + if (new_page !== null) { + new_page.setStatus('opened'); + } -function SwatAccordionPage(el) -{ - this.element = el; - this.toggle = YAHOO.util.Dom.getFirstChild(el); - this.toggleLink = YAHOO.util.Dom.getElementsByClassName( - 'swat-accordion-page-link', 'a', this.toggle)[0]; + this.pageChangeEvent.fire(new_page, old_page); - this.animation = YAHOO.util.Dom.getNextSibling(this.toggle); - this.content = YAHOO.util.Dom.getFirstChild(this.animation); + this.current_page = new_page; + } } -SwatAccordionPage.prototype.setStatus = function(stat) -{ - if (stat === 'opened') { - YAHOO.util.Dom.removeClass( - this.element, - 'swat-accordion-page-closed'); - - YAHOO.util.Dom.addClass( - this.element, - 'swat-accordion-page-opened'); - } else { - YAHOO.util.Dom.removeClass( - this.element, - 'swat-accordion-page-opened'); - - YAHOO.util.Dom.addClass( - this.element, - 'swat-accordion-page-closed'); - } -}; +SwatAccordion.resize_period = 0.25; // seconds module.exports = SwatAccordion; diff --git a/www/javascript/swat-actions.js b/www/javascript/swat-actions.js index 6fe4d1d05..781c038cc 100644 --- a/www/javascript/swat-actions.js +++ b/www/javascript/swat-actions.js @@ -23,10 +23,16 @@ class SwatActions { 'swat-actions-message-dismiss-link'); message_dismiss.appendChild( - document.createTextNode(SwatActions.dismiss_text)); + document.createTextNode(SwatActions.dismiss_text) + ); - YAHOO.util.Event.addListener(message_dismiss, 'click', - this.handleMessageClose, this, true); + YAHOO.util.Event.addListener( + message_dismiss, + 'click', + this.handleMessageClose, + this, + true + ); // create message span and add content area and dismiss link this.message_span = document.createElement('span'); @@ -53,28 +59,31 @@ class SwatActions { this.view = view; this.selector_id = selector_id; } - }, + } handleChange() { - if (this.selected_element) + if (this.selected_element) { YAHOO.util.Dom.addClass(this.selected_element, 'swat-hidden'); + } var id = this.id + '_' + this.values[this.flydown.selectedIndex]; this.selected_element = document.getElementById(id); - if (this.selected_element) + if (this.selected_element) { YAHOO.util.Dom.removeClass(this.selected_element, 'swat-hidden'); - }, + } + } handleButtonClick(e) { var is_blank; var value_exp = this.flydown.value.split('|', 2); - if (value_exp.length == 1) + if (value_exp.length === 1) { is_blank = (value_exp[0] === ''); - else + } else { is_blank = (value_exp[1] == 'N;'); + } if (this.view) { var items_selected = @@ -96,51 +105,60 @@ class SwatActions { YAHOO.util.Event.preventDefault(e); this.showMessage(message); } - }, + } handleMessageClose(e) { YAHOO.util.Event.preventDefault(e); this.hideMessage(); - }, + } showMessage(message_text) { - if (this.message_content.firstChild) + if (this.message_content.firstChild) { this.message_content.removeChild(this.message_content.firstChild); + } this.message_content.appendChild( - document.createTextNode(message_text + ' ')); + document.createTextNode(message_text + ' ') + ); if (!this.message_shown) { this.message_span.style.opacity = 0; this.message_span.style.visibility = 'visible'; - var animation = new YAHOO.util.Anim(this.message_span, + var animation = new YAHOO.util.Anim( + this.message_span, { opacity: { from: 0, to: 1} }, - 0.3, YAHOO.util.Easing.easeInStrong); + 0.3, + YAHOO.util.Easing.easeInStrong + ); animation.animate(); this.message_shown = true; } - }, + } hideMessage() { if (this.message_shown) { - var animation = new YAHOO.util.Anim(this.message_span, + var animation = new YAHOO.util.Anim( + this.message_span, { opacity: { from: 1, to: 0} }, - 0.3, YAHOO.util.Easing.easeOutStrong); + 0.3, + YAHOO.util.Easing.easeOutStrong + ); animation.onComplete.subscribe( - function() - { + function() { this.message_span.style.visibility = 'hidden'; this.message_shown = false; }, - this, true); + this, + true + ); animation.animate(); } - }, + } } SwatActions.dismiss_text = 'Dismiss message.'; diff --git a/www/javascript/swat-button.js b/www/javascript/swat-button.js index 61f908846..9640f6583 100644 --- a/www/javascript/swat-button.js +++ b/www/javascript/swat-button.js @@ -14,13 +14,19 @@ class SwatButton { this.initThrobber(); } - YAHOO.util.Event.addListener(this.button, 'click', - this.handleClick, this, true); - }, + YAHOO.util.Event.addListener( + this.button, + 'click', + this.handleClick, + this, + true + ); + } handleClick(e) { - var confirmed = (this.confirmation_message) ? - confirm(this.confirmation_message) : true; + var confirmed = (this.confirmation_message) + ? confirm(this.confirmation_message) + : true; if (confirmed) { if (this.throbber_container !== null) { @@ -37,7 +43,10 @@ class SwatButton { this.button.form.appendChild(div); this.showThrobber(); - var form = YAHOO.util.Dom.getAncestorByTagName(this.button, 'form'); + var form = YAHOO.util.Dom.getAncestorByTagName( + this.button, + 'form' + ); if (form) { form.submit(); // needed for IE and WebKit } @@ -45,23 +54,29 @@ class SwatButton { } else { YAHOO.util.Event.preventDefault(e); } - }, + } initThrobber() { this.throbber_container = document.createElement('span'); - YAHOO.util.Dom.addClass(this.throbber_container, - 'swat-button-processing-throbber'); + YAHOO.util.Dom.addClass( + this.throbber_container, + 'swat-button-processing-throbber' + ); this.button.parentNode.appendChild(this.throbber_container); - }, + } showThrobber() { - var animation = new YAHOO.util.Anim(this.throbber_container, - { opacity: { to: 0.5 }}, 1, YAHOO.util.Easing.easingNone); + var animation = new YAHOO.util.Anim( + this.throbber_container, + { opacity: { to: 0.5 }}, + 1, + YAHOO.util.Easing.easingNone + ); animation.animate(); - }, + } setProcessingMessage(message) { if (this.throbber_container === null) { @@ -69,18 +84,22 @@ class SwatButton { } if (message.length > 0) { - this.throbber_container.appendChild(document.createTextNode(message)); - YAHOO.util.Dom.addClass(this.throbber_container, - 'swat-button-processing-throbber-text'); + this.throbber_container.appendChild( + document.createTextNode(message) + ); + YAHOO.util.Dom.addClass( + this.throbber_container, + 'swat-button-processing-throbber-text' + ); } else { // the following string is a UTF-8 encoded non breaking space this.throbber_container.appendChild(document.createTextNode(' ')); } - }, + } setConfirmationMessage(message) { this.confirmation_message = message; - }, + } } module.exports = SwatButton; diff --git a/www/javascript/swat-calendar.js b/www/javascript/swat-calendar.js index c0a19411d..58633ee27 100644 --- a/www/javascript/swat-calendar.js +++ b/www/javascript/swat-calendar.js @@ -21,867 +21,887 @@ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 */ -/** - * Creates a SwatCalendar JavaScript object - * - * @param string id - * @param string start_date - * @param string end_date - */ -function SwatCalendar(id, start_date, end_date) -{ - SwatCalendar.preloadImages(); - - this.id = id; - this.is_webkit = - (/AppleWebKit|Konqueror|KHTML/gi).test(navigator.userAgent); - - var date = new Date(); - if (start_date.length == 10) { - this.start_date = SwatCalendar.stringToDate(start_date); - } else { - var year = (date.getFullYear() - 5); - this.start_date = new Date(year, 0, 1); - } - - if (end_date.length == 10) { - this.end_date = SwatCalendar.stringToDate(end_date); - } else { - var year = (date.getFullYear() + 5); - this.end_date = new Date(year, 0, 1); - } +class SwatCalendar { + /** + * Creates a SwatCalendar JavaScript object + * + * @param string id + * @param string start_date + * @param string end_date + */ + constructor(id, start_date, end_date) { + SwatCalendar.preloadImages(); - this.date_entry = null; + this.id = id; + this.is_webkit = + (/AppleWebKit|Konqueror|KHTML/gi).test(navigator.userAgent); - this.value = document.getElementById(this.id + '_value'); + var date = new Date(); + if (start_date.length == 10) { + this.start_date = SwatCalendar.stringToDate(start_date); + } else { + var year = (date.getFullYear() - 5); + this.start_date = new Date(year, 0, 1); + } - // Draw the calendar on window load to prevent "Operation Aborted" errors - // in MSIE 6 and 7. - YAHOO.util.Event.on(window, 'load', this.createOverlay, this, true); + if (end_date.length == 10) { + this.end_date = SwatCalendar.stringToDate(end_date); + } else { + var year = (date.getFullYear() + 5); + this.end_date = new Date(year, 0, 1); + } - this.open = false; - this.positioned = false; - this.drawn = false; - this.sensitive = true; -} + this.date_entry = null; -/** - * Custom effect for hiding and showing the overlay - * - * Shows instantly and hides with configurable fade duration. - */ -SwatCalendar.Effect = function(overlay, duration) -{ - var effect = YAHOO.widget.ContainerEffect.FADE(overlay, duration); - effect.attrIn = { - attributes : { opacity: { from: 0, to: 1 } }, - duration : 0, - method : YAHOO.util.Easing.easeIn - }; - effect.init(); - return effect; -}; + this.value = document.getElementById(this.id + '_value'); -SwatCalendar.images_preloaded = false; + // Draw the calendar on window load to prevent "Operation Aborted" + // errors in MSIE 6 and 7. + YAHOO.util.Event.on(window, 'load', this.createOverlay, this, true); -SwatCalendar.preloadImages = function() -{ - if (SwatCalendar.images_preloaded) { - return; + this.open = false; + this.positioned = false; + this.drawn = false; + this.sensitive = true; } - SwatCalendar.go_previous_insensitive_image = new Image(); - SwatCalendar.go_previous_insensitive_image.src = - 'packages/swat/images/go-previous-insensitive.png'; - - SwatCalendar.go_next_insensitive_image = new Image(); - SwatCalendar.go_next_insensitive_image.src = - 'packages/swat/images/go-next-insensitive.png'; - - SwatCalendar.go_previous_image = new Image(); - SwatCalendar.go_previous_image.src = 'packages/swat/images/go-previous.png'; - - SwatCalendar.go_next_image = new Image(); - SwatCalendar.go_next_image.src = 'packages/swat/images/go-next.png'; - - SwatCalendar.images_preloaded = true; -}; - -// string data -SwatCalendar.week_names = [ - 'Sun', 'Mon', 'Tue', - 'Wed', 'Thu', 'Fri', - 'Sat']; - -SwatCalendar.month_names = [ - 'Jan', 'Feb', 'Mar', - 'Apr', 'May', 'Jun', - 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; + /** + * Creates calendar toggle button and overlay widget + */ + createOverlay() { + this.container = document.getElementById(this.id); + + this.drawButton(); + this.overlay = new YAHOO.widget.Overlay( + this.id + '_div', { + visible: false, + constraintoviewport: true, + effect: { + effect: SwatCalendar.Effect, + duration: 0.25 + } + } + ); -SwatCalendar.prev_alt_text = 'Previous Month'; -SwatCalendar.next_alt_text = 'Next Month'; -SwatCalendar.close_text = 'Close'; -SwatCalendar.nodate_text = 'No Date'; -SwatCalendar.today_text = 'Today'; + document.getElementById(this.id + '_div').style.display = 'block'; -SwatCalendar.open_toggle_text = 'open calendar'; -SwatCalendar.close_toggle_text = 'close calendar'; + this.overlay.render(document.body); + } -/** - * Creates calendar toggle button and overlay widget - */ -SwatCalendar.prototype.createOverlay = function() -{ - this.container = document.getElementById(this.id); - - this.drawButton(); - this.overlay = new YAHOO.widget.Overlay( - this.id + '_div', - { - visible : false, - constraintoviewport : true, - effect : { - effect: SwatCalendar.Effect, - duration: 0.25 - } + /** + * Associates this calendar control with an existing SwatDateEntry JavaScript + * object + * + * @param SwatDateEntry entry + */ + setDateEntry(date_entry) { + if (typeof(SwatDateEntry) !== 'undefined' && + date_entry instanceof SwatDateEntry + ) { + this.date_entry = date_entry; + date_entry.calendar = this; } - ); - - document.getElementById(this.id + '_div').style.display = 'block'; - - this.overlay.render(document.body); -}; + } -/** - * Associates this calendar control with an existing SwatDateEntry JavaScript - * object - * - * @param SwatDateEntry entry - */ -SwatCalendar.prototype.setDateEntry = function(date_entry) -{ - if (typeof(SwatDateEntry) != 'undefined' && - date_entry instanceof SwatDateEntry) { - this.date_entry = date_entry; - date_entry.calendar = this; + /** + * @deprecated Use setDateEntry() instead. + */ + setSwatDateEntry(entry) { + this.setDateEntry(entry); } -}; -/** - * @deprecated Use setDateEntry() instead. - */ -SwatCalendar.prototype.setSwatDateEntry = function(entry) -{ - this.setDateEntry(entry); -}; + setSensitivity(sensitivity) { + if (!sensitivity && this.open) { + this.close(); + } -SwatCalendar.prototype.setSensitivity = function(sensitivity) -{ - if (!sensitivity && this.open) { - this.close(); - } + if (sensitivity) { + YAHOO.util.Dom.removeClass(this.container, 'swat-insensitive'); - if (sensitivity) { - YAHOO.util.Dom.removeClass(this.container, 'swat-insensitive'); + if (this.drawn) { + if (this.toggle_button_insensitive.parentNode) { + this.toggle_button_insensitive.parentNode.removeChild( + this.toggle_button_insensitive + ); + } - if (this.drawn) { - if (this.toggle_button_insensitive.parentNode) { - this.toggle_button_insensitive.parentNode.removeChild( - this.toggle_button_insensitive); + this.container.insertBefore( + this.toggle_button, + this.container.firstChild + ); } - this.container.insertBefore(this.toggle_button, - this.container.firstChild); - } + } else { + YAHOO.util.Dom.addClass(this.container, 'swat-insensitive'); - } else { - YAHOO.util.Dom.addClass(this.container, 'swat-insensitive'); + if (this.drawn) { + if (this.toggle_button.parentNode) { + this.toggle_button.parentNode.removeChild( + this.toggle_button + ); + } - if (this.drawn) { - if (this.toggle_button.parentNode) { - this.toggle_button.parentNode.removeChild(this.toggle_button); + this.container.insertBefore( + this.toggle_button_insensitive, + this.container.firstChild + ); } - - this.container.insertBefore(this.toggle_button_insensitive, - this.container.firstChild); } + + this.sensitive = sensitivity; } - this.sensitive = sensitivity; -}; + /** + * Displays the toggle button for this calendar control + */ + drawButton() { + this.toggle_button_insensitive = document.createElement('span'); + YAHOO.util.Dom.addClass( + this.toggle_button_insensitive, + 'swat-calendar-toggle-button' + ); + + this.toggle_button = document.createElement('a'); + this.toggle_button.id = this.id + '_toggle'; + this.toggle_button.href = '#'; + this.toggle_button.title = SwatCalendar.open_toggle_text; + YAHOO.util.Dom.addClass( + this.toggle_button, + 'swat-calendar-toggle-button' + ); + YAHOO.util.Event.on(this.toggle_button, 'click', + function(e) { + YAHOO.util.Event.preventDefault(e); + this.toggle(); + }, + this, + true + ); + + if (this.is_webkit) { + // Zero-width-space holds the link open in WebKit browsers. Only apply + // to WebKit because IE can't display the character correctly. + this.toggle_button.appendChild(document.createTextNode('\u200b')); + this.toggle_button_insensitive.appendChild( + document.createTextNode('\u200b') + ); + } -/** - * Displays the toggle button for this calendar control - */ -SwatCalendar.prototype.drawButton = function() -{ - this.toggle_button_insensitive = document.createElement('span'); - YAHOO.util.Dom.addClass(this.toggle_button_insensitive, - 'swat-calendar-toggle-button'); - - this.toggle_button = document.createElement('a'); - this.toggle_button.id = this.id + '_toggle'; - this.toggle_button.href = '#'; - this.toggle_button.title = SwatCalendar.open_toggle_text; - YAHOO.util.Dom.addClass(this.toggle_button, 'swat-calendar-toggle-button'); - YAHOO.util.Event.on(this.toggle_button, 'click', - function(e) - { - YAHOO.util.Event.preventDefault(e); - this.toggle(); - }, - this, - true - ); - - if (this.is_webkit) { - // Zero-width-space holds the link open in WebKit browsers. Only apply - // to WebKit because IE can't display the character correctly. - this.toggle_button.appendChild(document.createTextNode('\u200b')); - this.toggle_button_insensitive.appendChild( - document.createTextNode('\u200b')); - } + var calendar_div = document.createElement('div'); + calendar_div.id = this.id + '_div'; + calendar_div.style.display = 'none'; + YAHOO.util.Dom.addClass(calendar_div, 'swat-calendar-div'); - var calendar_div = document.createElement('div'); - calendar_div.id = this.id + '_div'; - calendar_div.style.display = 'none'; - YAHOO.util.Dom.addClass(calendar_div, 'swat-calendar-div'); + var overlay_header = document.createElement('div'); + YAHOO.util.Dom.addClass(overlay_header, 'hd'); - var overlay_header = document.createElement('div'); - YAHOO.util.Dom.addClass(overlay_header, 'hd'); + var overlay_body = document.createElement('div'); + YAHOO.util.Dom.addClass(overlay_body, 'bd'); - var overlay_body = document.createElement('div'); - YAHOO.util.Dom.addClass(overlay_body, 'bd'); + var overlay_footer = document.createElement('div'); + YAHOO.util.Dom.addClass(overlay_footer, 'ft'); - var overlay_footer = document.createElement('div'); - YAHOO.util.Dom.addClass(overlay_footer, 'ft'); + calendar_div.appendChild(overlay_header); + calendar_div.appendChild(overlay_body); + calendar_div.appendChild(overlay_footer); - calendar_div.appendChild(overlay_header); - calendar_div.appendChild(overlay_body); - calendar_div.appendChild(overlay_footer); + if (this.sensitive) { + this.container.appendChild(this.toggle_button); + } else { + this.container.appendChild(this.toggle_button_insensitive); + } + this.container.appendChild(calendar_div); - if (this.sensitive) { - this.container.appendChild(this.toggle_button); - } else { - this.container.appendChild(this.toggle_button_insensitive); + this.drawn = true; } - this.container.appendChild(calendar_div); - this.drawn = true; -}; + /** + * Sets the values of an associated SwatDateEntry widget to the values + * of this SwatCalendar + * + * @param number year + * @param number month + * @param number day + */ + setDateValues(year, month, day) { + // make sure the date is in the valid range + var date = new Date(year, month - 1, day); + if (date < this.start_date) { + year = this.start_date.getFullYear(); + month = this.start_date.getMonth() + 1; + day = this.start_date.getDate(); + } else if (date >= this.end_date) { + year = this.end_date.getFullYear(); + month = this.end_date.getMonth() + 1; + day = this.end_date.getDate(); + } -/** - * Decides if a given year is a leap year - * - * @param number year - * - * @return number - */ -SwatCalendar.isLeapYear = function(year) -{ - return ( - ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0) - ) ? 1 : 0; -}; + if (this.date_entry === null) { + // save internal date value in MM/DD/YYYY format + month = (month < 10) ? '0' + month : month; + this.value.value = month + '/' + day + '/' + year; + } else { + this.date_entry.setYear(year); + this.date_entry.setMonth(month); + this.date_entry.setDay(day); + } -/** - * Parses a date string into a Date object - * - * @param string date_string - * - * @return Date - */ -SwatCalendar.stringToDate = function(date_string) -{ - var date_parts = date_string.split('/'); + this.redraw(); + } - var mm = date_parts[0] * 1; - var dd = date_parts[1] * 1; - var yyyy = date_parts[2] * 1; + /** + * Sets the associated date widget to the specified date and updates the + * calendar display + */ + setDate(element, yyyy, mm, dd) { + this.setDateValues(yyyy, mm, dd); + if (this.selected_element) { + this.selected_element.className = 'swat-calendar-cell'; + } - return new Date(yyyy, mm - 1, dd); -}; + element.className = 'swat-calendar-current-cell'; -/** - * Sets the values of an associated SwatDateEntry widget to the values - * of this SwatCalendar - * - * @param number year - * @param number month - * @param number day - */ -SwatCalendar.prototype.setDateValues = function(year, month, day) -{ - // make sure the date is in the valid range - var date = new Date(year, month - 1, day); - if (date < this.start_date) { - year = this.start_date.getFullYear(); - month = this.start_date.getMonth() + 1; - day = this.start_date.getDate(); - } else if (date >= this.end_date) { - year = this.end_date.getFullYear(); - month = this.end_date.getMonth() + 1; - day = this.end_date.getDate(); + this.selected_element = element; } - if (this.date_entry === null) { - // save internal date value in MM/DD/YYYY format - month = (month < 10) ? '0' + month : month; - this.value.value = month + '/' + day + '/' + year; - } else { - this.date_entry.setYear(year); - this.date_entry.setMonth(month); - this.date_entry.setDay(day); + /** + * Closes this calendar + */ + close() { + this.overlay.hide(); + this.open = false; + YAHOO.util.Event.removeListener( + document, + 'click', + this.handleDocumentClick + ); + } + + /** + * Closes this calendar and sets the associated date widget to the + * specified date + */ + closeAndSetDate(yyyy, mm, dd) { + this.setDateValues(yyyy, mm, dd); + this.close(); } - this.redraw(); -}; - -/** - * Sets the associated date widget to the specified date and updates the - * calendar display - */ -SwatCalendar.prototype.setDate = function(element, yyyy, mm, dd) -{ - this.setDateValues(yyyy, mm, dd); - if (this.selected_element) { - this.selected_element.className = 'swat-calendar-cell'; + /** + * Closes this calendar and sets the associated date widget as blank + */ + closeAndSetBlank() { + this.setBlank(); + this.close(); } - element.className = 'swat-calendar-current-cell'; + /** + * Sets the associated date widget as blank + */ + setBlank() { + if (this.date_entry !== null) { + this.date_entry.setYear(''); + this.date_entry.setMonth(''); + this.date_entry.setDay(''); + if (this.date_entry.time_entry !== null) { + this.date_entry.time_entry.reset(); + } + } + } - this.selected_element = element; -}; + /** + * Closes this calendar and sets the associated date widget to today's + * date + */ + closeAndSetToday() { + this.setToday(); + this.close(); + } -/** - * Closes this calendar - */ -SwatCalendar.prototype.close = function() -{ - this.overlay.hide(); - this.open = false; - YAHOO.util.Event.removeListener(document, 'click', - this.handleDocumentClick); -}; + /** + * Sets the associated date widget to today's date + */ + setToday() { + var today = new Date(); + var mm = today.getMonth() + 1; + var dd = today.getDate(); + var yyyy = today.getYear(); + + if (yyyy < 1000) { + yyyy = yyyy + 1900; + } + this.setDateValues(yyyy, mm, dd); + } -// }}} + /** + * Redraws this calendar without hiding it first + */ + redraw() { + var start_date = this.start_date; + var end_date = this.end_date; + + var month_flydown = document.getElementById(this.id + '_month_flydown'); + for (var i = 0; i < month_flydown.options.length;i++) { + if (month_flydown.options[i].selected) { + var mm = month_flydown.options[i].value; + break; + } + } -/** - * Closes this calendar and sets the associated date widget to the - * specified date - */ -SwatCalendar.prototype.closeAndSetDate = function(yyyy, mm, dd) -{ - this.setDateValues(yyyy, mm, dd); - this.close(); -}; + var year_flydown = document.getElementById(this.id + '_year_flydown'); + for (var i = 0; i < year_flydown.options.length; i++) { + if (year_flydown.options[i].selected) { + var yyyy = year_flydown.options[i].value; + break; + } + } -/** - * Closes this calendar and sets the associated date widget as blank - */ -SwatCalendar.prototype.closeAndSetBlank = function() -{ - this.setBlank(); - this.close(); -}; + /* + * Who knows why you need this? If you don't cast it to a number, + * the browser goes into some kind of infinite loop -- at least in + * IE6.0/Win32 + */ + mm = mm * 1; + yyyy = yyyy * 1; -/** - * Sets the associated date widget as blank - */ -SwatCalendar.prototype.setBlank = function() -{ - if (this.date_entry !== null) { - this.date_entry.setYear(''); - this.date_entry.setMonth(''); - this.date_entry.setDay(''); - if (this.date_entry.time_entry !== null) { - this.date_entry.time_entry.reset(); + if (yyyy == end_date.getFullYear() && mm > end_date.getMonth()) { + yyyy = (end_date.getFullYear() - 1); } - } -}; -/** - * Closes this calendar and sets the associated date widget to today's - * date - */ -SwatCalendar.prototype.closeAndSetToday = function() -{ - this.setToday(); - this.close(); -}; + if (yyyy == start_date.getFullYear() && mm < start_date.getMonth()) { + yyyy = (start_date.getFullYear() + 1); + } -/** - * Sets the associated date widget to today's date - */ -SwatCalendar.prototype.setToday = function() -{ - var today = new Date(); - var mm = today.getMonth() + 1; - var dd = today.getDate(); - var yyyy = today.getYear(); - - if (yyyy < 1000) { - yyyy = yyyy + 1900; + this.draw(yyyy, mm); } - this.setDateValues(yyyy, mm, dd); -}; + buildControls() { + var today = new Date(); -/** - * Redraws this calendar without hiding it first - */ -SwatCalendar.prototype.redraw = function() -{ - var start_date = this.start_date; - var end_date = this.end_date; + var start_date = this.start_date; + var end_date = this.end_date; - var month_flydown = document.getElementById(this.id + '_month_flydown'); - for (var i = 0; i < month_flydown.options.length;i++) { - if (month_flydown.options[i].selected) { - var mm = month_flydown.options[i].value; - break; - } - } + var yyyy = (arguments[0]) ? arguments[0] : today.getYear(); + var mm = (arguments[1]) ? arguments[1] : today.getMonth(); + var dd = (arguments[2]) ? arguments[2] : today.getDay(); - var year_flydown = document.getElementById(this.id + '_year_flydown'); - for (var i = 0; i < year_flydown.options.length; i++) { - if (year_flydown.options[i].selected) { - var yyyy = year_flydown.options[i].value; - break; + /* + * Mozilla hack, I am sure there is a more elegent way, but I did it + * on a Friday to get a release out the door... + */ + if (yyyy < 1000) { + yyyy = yyyy + 1900; } - } - - /* - * Who knows why you need this? If you don't cast it to a number, - * the browser goes into some kind of infinite loop -- at least in - * IE6.0/Win32 - */ - mm = mm * 1; - yyyy = yyyy * 1; - if (yyyy == end_date.getFullYear() && mm > end_date.getMonth()) - yyyy = (end_date.getFullYear() - 1); + // First build the month selection box + var month_array = ''; -SwatCalendar.prototype.buildControls = function() -{ - var today = new Date(); + var year_array = ''; - /* - * Mozilla hack, I am sure there is a more elegent way, but I did it - * on a Friday to get a release out the door... - */ - if (yyyy < 1000) { - yyyy = yyyy + 1900; + return (month_array + ' ' + year_array); } - // First build the month selection box - var month_array = ''; + draw() { + var start_date = this.start_date; + var end_date = this.end_date; - var year_array = ''; + var start_ts = start_date.getTime(); + var end_ts = end_date.getTime(); + var today_ts = today.getTime(); - return (month_array + ' ' + year_array); -}; + if (yyyy === null && mm === null) { + if (this.date_entry) { + var d = this.date_entry.getDay(); + var m = this.date_entry.getMonth(); + var y = this.date_entry.getYear(); -SwatCalendar.prototype.toggle = function() -{ - if (this.open) { - this.close(); - this.toggle_button.title = SwatCalendar.open_toggle_text; - } else { - this.draw(); - this.toggle_button.title = SwatCalendar.close_toggle_text; - } -}; + var day = (d === null) ? today.getDate() : parseInt(d, 10); + var month = (m === null) ? today.getMonth() + 1 : parseInt(m, 10); + var year = (y === null) ? today.getYear() : parseInt(y, 10); -SwatCalendar.prototype.draw = function() -{ - var start_date = this.start_date; - var end_date = this.end_date; - - var yyyy = (arguments[0]) ? arguments[0] : null; - var mm = (arguments[1]) ? arguments[1] : null; - var dd = (arguments[2]) ? arguments[2] : null; - - var today = new Date(); - - var start_ts = start_date.getTime(); - var end_ts = end_date.getTime(); - var today_ts = today.getTime(); - - if (yyyy === null && mm === null) { - if (this.date_entry) { - var d = this.date_entry.getDay(); - var m = this.date_entry.getMonth(); - var y = this.date_entry.getYear(); - - var day = (d === null) ? today.getDate() : parseInt(d); - var month = (m === null) ? today.getMonth() + 1 : parseInt(m); - var year = (y === null) ? today.getYear() : parseInt(y); - - //TODO: figure out if the last two conditions are ever run - if (day !== 0 && month !== 0 && year !== 0) { - mm = month; - dd = day; - yyyy = year; - } else if (today_ts >= start_ts && today_ts <= end_ts) { - mm = today.getMonth() + 1; - dd = today.getDate(); - yyyy = today.getYear(); + //TODO: figure out if the last two conditions are ever run + if (day !== 0 && month !== 0 && year !== 0) { + mm = month; + dd = day; + yyyy = year; + } else if (today_ts >= start_ts && today_ts <= end_ts) { + mm = today.getMonth() + 1; + dd = today.getDate(); + yyyy = today.getYear(); + } else { + mm = start_date.getMonth() + 1; + dd = start_date.getDate(); + yyyy = start_date.getYear(); + } + } else if (this.value.value) { + var date = SwatCalendar.stringToDate(this.value.value); + dd = date.getDate(); + mm = date.getMonth() + 1; + yyyy = date.getFullYear(); } else { mm = start_date.getMonth() + 1; dd = start_date.getDate(); yyyy = start_date.getYear(); } - } else if (this.value.value) { - var date = SwatCalendar.stringToDate(this.value.value); - dd = date.getDate(); - mm = date.getMonth() + 1; - yyyy = date.getFullYear(); - } else { - mm = start_date.getMonth() + 1; - dd = start_date.getDate(); - yyyy = start_date.getYear(); - } - } else if (dd === null) { - if (this.date_entry) { - var d = this.date_entry.getDay(); - var m = this.date_entry.getMonth(); - var y = this.date_entry.getYear(); - - var day = (d === null) ? today.getDate() : parseInt(d); - var month = (m === null) ? today.getMonth() + 1 : parseInt(m); - var year = (y === null) ? today.getYear() : parseInt(y); - - if (mm == month && yyyy == year) { - dd = day; - } - } else if (this.value.value) { - var date = SwatCalendar.stringToDate(this.value.value); - var day = date.getDate(); - var month = date.getMonth() + 1; - var year = date.getFullYear(); - if (mm == month && yyyy == year) { - dd = day; + } else if (dd === null) { + if (this.date_entry) { + var d = this.date_entry.getDay(); + var m = this.date_entry.getMonth(); + var y = this.date_entry.getYear(); + + var day = (d === null) ? today.getDate() : parseInt(d, 10); + var month = (m === null) ? today.getMonth() + 1 : parseInt(m, 10); + var year = (y === null) ? today.getYear() : parseInt(y, 10); + + if (mm == month && yyyy == year) { + dd = day; + } + } else if (this.value.value) { + var date = SwatCalendar.stringToDate(this.value.value); + var day = date.getDate(); + var month = date.getMonth() + 1; + var year = date.getFullYear(); + if (mm == month && yyyy == year) { + dd = day; + } + } else { + mm = start_date.getMonth() + 1; + dd = start_date.getDate(); + yyyy = start_date.getYear(); } - } else { - mm = start_date.getMonth() + 1; - dd = start_date.getDate(); - yyyy = start_date.getYear(); } - } - /* - * Mozilla hack, I am sure there is a more elegent way, but I did it - * on a Friday to get a release out the door... - */ - if (yyyy < 1000) { - yyyy = yyyy + 1900; - } - - // sanity check. make sure the date is in the valid range - var display_date = new Date(yyyy, mm - 1, dd); - if (display_date < this.start_date) { - yyyy = this.start_date.getFullYear(); - mmm = this.start_date.getMonth() + 1; - dd = this.start_date.getDate(); - } else if (display_date >= this.end_date) { - yyyy = this.end_date.getFullYear(); - mm = this.end_date.getMonth() + 1; - dd = this.end_date.getDate(); - } + /* + * Mozilla hack, I am sure there is a more elegent way, but I did it + * on a Friday to get a release out the door... + */ + if (yyyy < 1000) { + yyyy = yyyy + 1900; + } - var new_date = new Date(yyyy, mm - 1, 1); - var start_day = new_date.getDay(); + // sanity check. make sure the date is in the valid range + var display_date = new Date(yyyy, mm - 1, dd); + if (display_date < this.start_date) { + yyyy = this.start_date.getFullYear(); + mmm = this.start_date.getMonth() + 1; + dd = this.start_date.getDate(); + } else if (display_date >= this.end_date) { + yyyy = this.end_date.getFullYear(); + mm = this.end_date.getMonth() + 1; + dd = this.end_date.getDate(); + } - var dom = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + var new_date = new Date(yyyy, mm - 1, 1); + var start_day = new_date.getDay(); - var this_month = new_date.getMonth() + 1; - var this_year = new_date.getFullYear(); + var dom = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - var next_month = this_month + 1; - var prev_month = this_month - 1; - var prev_year = this_year; - var next_year = this_year; - if (this_month == 12) { - next_month = 1; - next_year = next_year + 1; - } else if (this_month == 1) { - prev_month = 12; - prev_year = prev_year - 1; - } + var this_month = new_date.getMonth() + 1; + var this_year = new_date.getFullYear(); - var end_year = end_date.getFullYear(); - var start_year = start_date.getFullYear(); - var end_month = end_date.getMonth(); - var start_month = start_date.getMonth(); + var next_month = this_month + 1; + var prev_month = this_month - 1; + var prev_year = this_year; + var next_year = this_year; + if (this_month == 12) { + next_month = 1; + next_year = next_year + 1; + } else if (this_month == 1) { + prev_month = 12; + prev_year = prev_year - 1; + } - var calendar_start = - (this_year == start_year && this_month == (start_month + 1)); + var end_year = end_date.getFullYear(); + var start_year = start_date.getFullYear(); + var end_month = end_date.getMonth(); + var start_month = start_date.getMonth(); - var calendar_end = - (this_year == end_year && this_month == (end_month + 1)); + var calendar_start = + (this_year === start_year && this_month === (start_month + 1)); - if (calendar_start) { - var prev_link = 'return false;'; - var prev_img = 'go-previous-insensitive.png'; - var prev_class = 'swat-calendar-arrows-off'; - } else { - var prev_link = this.id + '_obj.draw(' + - prev_year + ',' + prev_month + '); ' + - 'SwatCalendar.stopEventPropagation(event || window.event);"'; + var calendar_end = + (this_year === end_year && this_month === (end_month + 1)); - var prev_img = 'go-previous.png'; - var prev_class = 'swat-calendar-arrows'; - } + if (calendar_start) { + var prev_link = 'return false;'; + var prev_img = 'go-previous-insensitive.png'; + var prev_class = 'swat-calendar-arrows-off'; + } else { + var prev_link = this.id + '_obj.draw(' + + prev_year + ',' + prev_month + '); ' + + 'SwatCalendar.stopEventPropagation(event || window.event);"'; - if (calendar_end) { - var next_link = 'return false;'; - var next_img = 'go-next-insensitive.png'; - var next_class = 'swat-calendar-arrows-off'; - } else { - var next_link = this.id + '_obj.draw(' + - next_year + ',' + next_month + '); ' + - 'SwatCalendar.stopEventPropagation(event || window.event);"'; - - var next_img = 'go-next.png'; - var next_class = 'swat-calendar-arrows'; - } + var prev_img = 'go-previous.png'; + var prev_class = 'swat-calendar-arrows'; + } - var prev_alt = SwatCalendar.prev_alt_text; - var next_alt = SwatCalendar.next_alt_text; - - var date_controls = - '' + - '' + - '
' + - '' + - '' + - this.buildControls(yyyy, mm, dd) + - '' + - '' + - '
' + - ''; - - var begin_table = ''; - - var week_header = ''; - for (var i = 0; i < SwatCalendar.week_names.length; i++) { - if (i == SwatCalendar.week_names.length - 1) { - week_header += ''; + if (calendar_end) { + var next_link = 'return false;'; + var next_img = 'go-next-insensitive.png'; + var next_class = 'swat-calendar-arrows-off'; } else { - week_header += ''; + var next_link = this.id + '_obj.draw(' + + next_year + ',' + next_month + '); ' + + 'SwatCalendar.stopEventPropagation(event || window.event);"'; + + var next_img = 'go-next.png'; + var next_class = 'swat-calendar-arrows'; + } + + var prev_alt = SwatCalendar.prev_alt_text; + var next_alt = SwatCalendar.next_alt_text; + + var date_controls = + '' + + ''; + + var begin_table = '
' + - SwatCalendar.week_names[i] + '' + - SwatCalendar.week_names[i] + '
' + + '' + + '
' + + '' + prev_alt + '' + + '' + + this.buildControls(yyyy, mm, dd) + + '' + + '' + next_alt + '' + + '
' + + '
'; + + var week_header = ''; + for (var i = 0; i < SwatCalendar.week_names.length; i++) { + if (i == SwatCalendar.week_names.length - 1) { + week_header += ''; + } else { + week_header += ''; + } } - } - week_header += ''; + week_header += ''; - var close_controls = '' + - '' + + '
' + + SwatCalendar.week_names[i] + '' + + SwatCalendar.week_names[i] + '
'; + var close_controls = '
'; - if (this.date_entry !== null) { - close_controls += - '' + SwatCalendar.nodate_text + - ' '; - } + if (this.date_entry !== null) { + close_controls += + '' + SwatCalendar.nodate_text + + ' '; + } - if (today_ts >= start_ts && today_ts <= end_ts) { - close_controls += - '' + SwatCalendar.today_text + - ' '; - } + if (today_ts >= start_ts && today_ts <= end_ts) { + close_controls += + '' + SwatCalendar.today_text + + ' '; + } - close_controls += - '' + SwatCalendar.close_text + ' ' + - '
'; - - var cur_html = ''; - var end_day = (SwatCalendar.isLeapYear(yyyy) && mm == 2) ? 29 : dom[mm - 1]; - var prev_end_day = (SwatCalendar.isLeapYear(yyyy) && prev_month == 2) ? - 29 : dom[prev_month - 1]; - - var cell_class = ''; - var cell_current = ''; - var onclick = ''; - - var cell = 0; - for (var row = 0; row < 6; row++) { - cur_html += ''; - for (var col = 0; col < 7; col++) { - cell++; - // this month days - if (cell > start_day && cell <= (start_day + end_day)) { - day = cell - start_day; - - if (dd == day) { - cell_class = 'swat-calendar-current-cell'; - cell_current = 'id="' + this.id + '_current_cell" '; + close_controls += + '' + SwatCalendar.close_text + ' ' + + ''; + + var cur_html = ''; + var end_day = (SwatCalendar.isLeapYear(yyyy) && mm === 2) + ? 29 + : dom[mm - 1]; + + var prev_end_day = (SwatCalendar.isLeapYear(yyyy) && prev_month === 2) + ? 29 + : dom[prev_month - 1]; + + var cell_class = ''; + var cell_current = ''; + var onclick = ''; + + var cell = 0; + for (var row = 0; row < 6; row++) { + cur_html += ''; + for (var col = 0; col < 7; col++) { + cell++; + // this month days + if (cell > start_day && cell <= (start_day + end_day)) { + day = cell - start_day; + + if (dd == day) { + cell_class = 'swat-calendar-current-cell'; + cell_current = 'id="' + this.id + '_current_cell" '; + } else { + cell_class = 'swat-calendar-cell'; + cell_current = ''; + } + + onclick = ' onclick="' + this.id + '_obj.setDateValues(' + + yyyy + ',' + mm + ',' + day + '); ' + + 'SwatCalendar.stopEventPropagation(event || window.event);"'; + + if (calendar_start && day < start_date.getDate()) { + cell_class = 'swat-calendar-invalid-cell'; + onclick = ''; + } else if (calendar_end && day > end_date.getDate()) { + cell_class = 'swat-calendar-invalid-cell'; + onclick = ''; + } + + cur_html += '' + day + ''; + + // previous month end days + } else if (cell <= start_day) { + cur_html += '' + + (prev_end_day - start_day + cell) + ''; + + // next month start days } else { - cell_class = 'swat-calendar-cell'; - cell_current = ''; + cur_html += '' + + (cell - end_day - start_day) + ''; } + } + cur_html += ''; + } - onclick = ' onclick="' + this.id + '_obj.setDateValues(' + - yyyy + ',' + mm + ',' + day + '); ' + - 'SwatCalendar.stopEventPropagation(event || window.event);"'; - - if (calendar_start && day < start_date.getDate()) { - cell_class = 'swat-calendar-invalid-cell'; - onclick = ''; - } else if (calendar_end && day > end_date.getDate()) { - cell_class = 'swat-calendar-invalid-cell'; - onclick = ''; - } + // draw calendar + var calendar_div = document.getElementById(this.id + '_div'); + calendar_div.childNodes[1].innerHTML = + begin_table + date_controls + week_header + + cur_html + close_controls; - cur_html += '' + day + ''; + if (!this.open) { - // previous month end days - } else if (cell <= start_day) { - cur_html += '' + - (prev_end_day - start_day + cell) + ''; + // only set position once + if (!this.positioned) { + this.overlay.cfg.setProperty('context', + [this.toggle_button, 'tl', 'bl']); - // next month start days - } else { - cur_html += '' + - (cell - end_day - start_day) + ''; + this.positioned = true; } + + this.overlay.show(); + this.open = true; + + YAHOO.util.Event.on( + document, + 'click', + this.handleDocumentClick, + this, + true + ); } - cur_html += ''; } - // draw calendar - var calendar_div = document.getElementById(this.id + '_div'); - calendar_div.childNodes[1].innerHTML = - begin_table + date_controls + week_header + - cur_html + close_controls; + handleDocumentClick(e) { + var close = true; - if (!this.open) { + var target = YAHOO.util.Event.getTarget(e); - // only set position once - if (!this.positioned) { - this.overlay.cfg.setProperty('context', - [this.toggle_button, 'tl', 'bl']); + if (target === this.toggle_button || target === this.overlay.element) { + close = false; + } else { + while (target.parentNode) { + target = target.parentNode; + if (target === this.overlay.element || + YAHOO.util.Dom.hasClass(target, 'swat-calendar-frame')) { + close = false; + break; + } + } + } - this.positioned = true; + if (close) { + this.close(); } + } +} - this.overlay.show(); - this.open = true; +/** + * Custom effect for hiding and showing the overlay + * + * Shows instantly and hides with configurable fade duration. + */ +SwatCalendar.Effect = function(overlay, duration) { + var effect = YAHOO.widget.ContainerEffect.FADE(overlay, duration); + effect.attrIn = { + attributes: { opacity: { from: 0, to: 1 } }, + duration: 0, + method: YAHOO.util.Easing.easeIn + }; + effect.init(); + return effect; +} + +SwatCalendar.images_preloaded = false; - YAHOO.util.Event.on(document, 'click', this.handleDocumentClick, - this, true); +SwatCalendar.preloadImages = function() { + if (SwatCalendar.images_preloaded) { + return; } + + SwatCalendar.go_previous_insensitive_image = new Image(); + SwatCalendar.go_previous_insensitive_image.src = + 'packages/swat/images/go-previous-insensitive.png'; + + SwatCalendar.go_next_insensitive_image = new Image(); + SwatCalendar.go_next_insensitive_image.src = + 'packages/swat/images/go-next-insensitive.png'; + + SwatCalendar.go_previous_image = new Image(); + SwatCalendar.go_previous_image.src = 'packages/swat/images/go-previous.png'; + + SwatCalendar.go_next_image = new Image(); + SwatCalendar.go_next_image.src = 'packages/swat/images/go-next.png'; + + SwatCalendar.images_preloaded = true; }; -SwatCalendar.stopEventPropagation = function(e) -{ - if (e.stopPropagation) { - e.stopPropagation(); - } else if (window.event) { - window.event.cancelBubble = true; - } +// string data +SwatCalendar.week_names = [ + 'Sun', 'Mon', 'Tue', + 'Wed', 'Thu', 'Fri', + 'Sat' +]; + +SwatCalendar.month_names = [ + 'Jan', 'Feb', 'Mar', + 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec' +]; +SwatCalendar.prev_alt_text = 'Previous Month'; +SwatCalendar.next_alt_text = 'Next Month'; +SwatCalendar.close_text = 'Close'; +SwatCalendar.nodate_text = 'No Date'; +SwatCalendar.today_text = 'Today'; + +SwatCalendar.open_toggle_text = 'open calendar'; +SwatCalendar.close_toggle_text = 'close calendar'; + +/** + * Decides if a given year is a leap year + * + * @param number year + * + * @return number + */ +SwatCalendar.isLeapYear = function(year) { + return ( + ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0) + ) ? 1 : 0; }; -SwatCalendar.prototype.handleDocumentClick = function(e) -{ - var close = true; +/** + * Parses a date string into a Date object + * + * @param string date_string + * + * @return Date + */ +SwatCalendar.stringToDate = function(date_string) { + var date_parts = date_string.split('/'); - var target = YAHOO.util.Event.getTarget(e); + var mm = date_parts[0] * 1; + var dd = date_parts[1] * 1; + var yyyy = date_parts[2] * 1; - if (target === this.toggle_button || target === this.overlay.element) { - close = false; - } else { - while (target.parentNode) { - target = target.parentNode; - if (target === this.overlay.element || - YAHOO.util.Dom.hasClass(target, 'swat-calendar-frame')) { - close = false; - break; - } - } - } + return new Date(yyyy, mm - 1, dd); +}; - if (close) { - this.close(); + +SwatCalendar.stopEventPropagation = function(e) { + if (e.stopPropagation) { + e.stopPropagation(); + } else if (window.event) { + window.event.cancelBubble = true; } + }; module.exports = SwatCalendar; diff --git a/www/javascript/swat-cascade-child.js b/www/javascript/swat-cascade-child.js new file mode 100644 index 000000000..de5458e8f --- /dev/null +++ b/www/javascript/swat-cascade-child.js @@ -0,0 +1,9 @@ +class SwatCascadeChild { + constructor(value, title, selected) { + this.value = value; + this.title = title; + this.selected = selected; + } +} + +module.exports = SwatCascadeChild; diff --git a/www/javascript/swat-cascade.js b/www/javascript/swat-cascade.js index 595a621ce..7304bcdf1 100644 --- a/www/javascript/swat-cascade.js +++ b/www/javascript/swat-cascade.js @@ -1,84 +1,86 @@ -function SwatCascade(from_flydown_id, to_flydown_id) -{ - this.from_flydown = document.getElementById(from_flydown_id); - this.to_flydown = document.getElementById(to_flydown_id); - this.children = []; +const SwatCascadeChild = require('./swat-cascade-child'); + +class SwatCascade { + constructor(from_flydown_id, to_flydown_id) { + this.from_flydown = document.getElementById(from_flydown_id); + this.to_flydown = document.getElementById(to_flydown_id); + this.children = []; + + YAHOO.util.Event.addListener( + this.from_flydown, + 'change', + this.handleChange, + this, + true + ); + + this.from_flydown._cascade = this; + } - YAHOO.util.Event.addListener(this.from_flydown, 'change', - this.handleChange, this, true); + handleChange(e) { + this.update(); + } - this.from_flydown._cascade = this; -} + update() { + this._updateHelper(false); + } -SwatCascade.prototype.handleChange = function(e) -{ - this.update(); -}; - -SwatCascade.prototype.update = function() -{ - this._updateHelper(false); -}; - -SwatCascade.prototype.addChild = function(from_flydown_value, value, title, - selected) -{ - if (!this.children[from_flydown_value]) - this.children[from_flydown_value] = []; - - this.children[from_flydown_value].push( - new SwatCascadeChild(value, title, selected)); -}; - -SwatCascade.prototype.init = function() -{ - this._updateHelper(true); -}; - -SwatCascade.prototype._updateHelper = function(init) -{ - var child_options = this.children[this.from_flydown.value]; - - // clear old options - this.to_flydown.options.length = 0; - - // update any children - if (this.to_flydown._cascade) { - this.to_flydown._cascade.update(); + addChild(from_flydown_value, value, title, selected) { + if (!this.children[from_flydown_value]) { + this.children[from_flydown_value] = []; + } + + this.children[from_flydown_value].push( + new SwatCascadeChild(value, title, selected) + ); } - if (child_options) { - this.to_flydown.disabled = false; + init() { + this._updateHelper(true); + } - for (var i = 0; i < child_options.length; i++) { - // only select default option if we are intializing - if (init) { - this.to_flydown.options[this.to_flydown.options.length] = - new Option(child_options[i].title, - child_options[i].value, child_options[i].selected); + _updateHelper(init) { + var child_options = this.children[this.from_flydown.value]; - if (child_options[i].selected) { - this.to_flydown.value = child_options[i].value; + // clear old options + this.to_flydown.options.length = 0; + + // update any children + if (this.to_flydown._cascade) { + this.to_flydown._cascade.update(); + } + + if (child_options) { + this.to_flydown.disabled = false; + + for (var i = 0; i < child_options.length; i++) { + // only select default option if we are intializing + if (init) { + this.to_flydown.options[this.to_flydown.options.length] = + new Option( + child_options[i].title, + child_options[i].value, + child_options[i].selected + ); + + if (child_options[i].selected) { + this.to_flydown.value = child_options[i].value; + } + } else { + this.to_flydown.options[this.to_flydown.options.length] = + new Option( + child_options[i].title, + child_options[i].value + ); } - } else { - this.to_flydown.options[this.to_flydown.options.length] = - new Option(child_options[i].title, - child_options[i].value); } - } - } else { - // the following string contains UTF-8 encoded non breaking spaces - this.to_flydown.options[0] = new Option('      ', 0); - this.to_flydown.disabled = true; + } else { + // the following string contains UTF-8 encoded non breaking spaces + this.to_flydown.options[0] = new Option('      ', 0); + this.to_flydown.disabled = true; + } } -}; - -function SwatCascadeChild(value, title, selected) -{ - this.value = value; - this.title = title; - this.selected = selected; } module.exports = SwatCascade; diff --git a/www/javascript/swat-check-all.js b/www/javascript/swat-check-all.js index 6a3929d10..d1f9a7d34 100644 --- a/www/javascript/swat-check-all.js +++ b/www/javascript/swat-check-all.js @@ -1,93 +1,105 @@ -/** - * Creates a new check-all object - * - * The check-all object is responsible for handling change events and - * notifying its controller on state change. - * - * @param string id the unique identifier of this check-all object. - * @param integer extended_count the count of all selected items including - * those not currently visible. - * @param string extended_title a title to display next to the checkbox for - * selecting extended items - */ -function SwatCheckAll(id, extended_count, extended_title) -{ - this.id = id; - this.check_all = document.getElementById(id + '_value'); - this.controller = null; - this.extended_count = extended_count; - this.extended_title = extended_title; -} +class SwatCheckAll { + /** + * Creates a new check-all object + * + * The check-all object is responsible for handling change events and + * notifying its controller on state change. + * + * @param string id the unique identifier of this check-all object. + * @param integer extended_count the count of all selected items including + * those not currently visible. + * @param string extended_title a title to display next to the checkbox for + * selecting extended items + */ + constructor(id, extended_count, extended_title) { + this.id = id; + this.check_all = document.getElementById(id + '_value'); + this.controller = null; + this.extended_count = extended_count; + this.extended_title = extended_title; + } -/** - * Set the state of this check-all object - * - * SwatCheckboxList uses this method to update the check-all's state when all - * checkbox list items are checked/unchecked. - * - * @param boolean checked the new state of this check-all object. - */ -SwatCheckAll.prototype.setState = function(checked) -{ - this.check_all.checked = checked; - this.updateExtendedCheckbox(); -}; + /** + * Set the state of this check-all object + * + * SwatCheckboxList uses this method to update the check-all's state when + * all checkbox list items are checked/unchecked. + * + * @param boolean checked the new state of this check-all object. + */ + setState(checked) + { + this.check_all.checked = checked; + this.updateExtendedCheckbox(); + } -SwatCheckAll.prototype.updateExtendedCheckbox = function() -{ - var container = document.getElementById(this.id + '_extended'); + updateExtendedCheckbox() { + var container = document.getElementById(this.id + '_extended'); - if (!container) - return; + if (!container) { + return; + } - if (this.check_all.checked) { - var in_attributes = { opacity: { from: 0, to: 1 } }; - var in_animation = new YAHOO.util.Anim(container, in_attributes, - 0.5, YAHOO.util.Easing.easeIn); + if (this.check_all.checked) { + var in_attributes = { opacity: { from: 0, to: 1 } }; + var in_animation = new YAHOO.util.Anim( + container, + in_attributes, + 0.5, + YAHOO.util.Easing.easeIn + ); - container.style.opacity = 0; - container.style.display = 'block'; - in_animation.animate(); - } else { - container.style.display = 'none'; - container.getElementsByTagName('input')[0].checked = false; + container.style.opacity = 0; + container.style.display = 'block'; + in_animation.animate(); + } else { + container.style.display = 'none'; + container.getElementsByTagName('input')[0].checked = false; + } } -}; -/** - * Sets the controlling checkbox list - * - * This adds an event handler to the check-all to update the list when this - * check-all is checked/unchecked. - * - * @param SwatCheckboxList controller the JavaScript object that represents the - * checkbox list controlling this check-all - * object. - */ -SwatCheckAll.prototype.setController = function(controller) -{ - // only add the event handler the first time - if (this.controller === null) { - YAHOO.util.Event.addListener(this.check_all, 'click', - this.clickHandler, this, true); + /** + * Sets the controlling checkbox list + * + * This adds an event handler to the check-all to update the list when this + * check-all is checked/unchecked. + * + * @param SwatCheckboxList controller the JavaScript object that represents + * the checkbox list controlling this + * check-all object. + */ + setController(controller) { + // only add the event handler the first time + if (this.controller === null) { + YAHOO.util.Event.addListener( + this.check_all, + 'click', + this.clickHandler, + this, + true + ); + YAHOO.util.Event.addListener( + this.check_all, + 'dblclick', + this.clickHandler, + this, + true + ); + } - YAHOO.util.Event.addListener(this.check_all, 'dblclick', - this.clickHandler, this, true); + this.controller = controller; + this.controller.check_all = this; + this.controller.updateCheckAll(); } - this.controller = controller; - this.controller.check_all = this; - this.controller.updateCheckAll(); -}; - -/** - * Handles click events for this check-all object - */ -SwatCheckAll.prototype.clickHandler = function() -{ - // check all checkboxes in the controller object - this.controller.checkAll(this.check_all.checked); - this.updateExtendedCheckbox(); -}; + /** + * Handles click events for this check-all object + */ + clickHandler() { + // check all checkboxes in the controller object + this.controller.checkAll(this.check_all.checked); + this.updateExtendedCheckbox(); + } +} module.exports = SwatCheckAll; diff --git a/www/javascript/swat-checkbox-cell-renderer.js b/www/javascript/swat-checkbox-cell-renderer.js index 68ff7bfe1..f15ce4743 100644 --- a/www/javascript/swat-checkbox-cell-renderer.js +++ b/www/javascript/swat-checkbox-cell-renderer.js @@ -1,136 +1,131 @@ -/** - * Checkbox cell renderer controller - * - * @param string id the unique identifier of the checkbox column. - * @param SwatView view the view containing this checkbox cell renderer. - */ -function SwatCheckboxCellRenderer(id, view) -{ - this.id = id; - this.view = view; - - /* - * Reference to a checkall widget if it exists. This reference is set by - * the SwatCheckAll widget. +class SwatCheckboxCellRenderer { + /** + * Checkbox cell renderer controller + * + * @param string id the unique identifier of the checkbox column. + * @param SwatView view the view containing this checkbox cell renderer. */ - this.check_all = null; - this.last_clicked_index = null; - - this.init(); -} - -SwatCheckboxCellRenderer.prototype.init = function() -{ - this.check_list = []; + constructor(id, view) { + this.id = id; + this.view = view; + + /* + * Reference to a checkall widget if it exists. This reference is set by + * the SwatCheckAll widget. + */ + this.check_all = null; + this.last_clicked_index = null; + + this.init(); + } - /* - * Get all checkboxes with name = id + [] and that are contained in the - * currect view. Note: getElementsByName() does not work from a node - * element. - */ - var view_node = document.getElementById(this.view.id); - var input_nodes = view_node.getElementsByTagName('input'); - for (var i = 0; i < input_nodes.length; i++) { - if (input_nodes[i].name == this.id + '[]') { - input_nodes[i]._index = this.check_list.length; - this.check_list.push(input_nodes[i]); - this.updateNode(input_nodes[i]); - YAHOO.util.Event.addListener(input_nodes[i], 'click', - this.handleClick, this, true); - - YAHOO.util.Event.addListener(input_nodes[i], 'dblclick', - this.handleClick, this, true); - - // prevent selecting label text when shify key is held - YAHOO.util.Event.addListener(input_nodes[i].parentNode, 'mousedown', - this.handleMouseDown, this, true); + init() { + this.check_list = []; + + /* + * Get all checkboxes with name = id + [] and that are contained in the + * currect view. Note: getElementsByName() does not work from a node + * element. + */ + var view_node = document.getElementById(this.view.id); + var input_nodes = view_node.getElementsByTagName('input'); + for (var i = 0; i < input_nodes.length; i++) { + if (input_nodes[i].name == this.id + '[]') { + input_nodes[i]._index = this.check_list.length; + this.check_list.push(input_nodes[i]); + this.updateNode(input_nodes[i]); + YAHOO.util.Event.addListener(input_nodes[i], 'click', + this.handleClick, this, true); + + YAHOO.util.Event.addListener(input_nodes[i], 'dblclick', + this.handleClick, this, true); + + // prevent selecting label text when shify key is held + YAHOO.util.Event.addListener(input_nodes[i].parentNode, 'mousedown', + this.handleMouseDown, this, true); + } } } -}; - -SwatCheckboxCellRenderer.prototype.handleMouseDown = function(e) -{ - // prevent selecting label text when shify key is held - YAHOO.util.Event.preventDefault(e); -}; - -SwatCheckboxCellRenderer.prototype.handleClick = function(e) -{ - var checkbox_node = YAHOO.util.Event.getTarget(e); - this.updateNode(checkbox_node, e.shiftKey); - this.updateCheckAll(); - this.last_clicked_index = checkbox_node._index; -}; - -SwatCheckboxCellRenderer.prototype.updateCheckAll = function() -{ - if (this.check_all === null) - return; - - var count = 0; - for (var i = 0; i < this.check_list.length; i++) - if (this.check_list[i].checked || this.check_list[i].disabled) - count++; - else if (count > 0) - break; // can't possibly be all checked or none checked - - this.check_all.setState(count > 0 && count == this.check_list.length); -}; - -SwatCheckboxCellRenderer.prototype.checkAll = function(checked) -{ - for (var i = 0; i < this.check_list.length; i++) { - if (!this.check_list[i].disabled) { - this.check_list[i].checked = checked; - } - this.updateNode(this.check_list[i]); + + handleMouseDown(e) { + // prevent selecting label text when shify key is held + YAHOO.util.Event.preventDefault(e); } -}; - -SwatCheckboxCellRenderer.prototype.checkBetween = function(a, b) -{ - if (a > b) { - var c = ++a; - a = ++b; - b = c; + + handleClick(e) { + var checkbox_node = YAHOO.util.Event.getTarget(e); + this.updateNode(checkbox_node, e.shiftKey); + this.updateCheckAll(); + this.last_clicked_index = checkbox_node._index; } - for (var i = a; i < b; i++) { - if (!this.check_list[i].disabled) { - this.check_list[i].checked = true; - this.view.selectItem(this.check_list[i], this.id); + updateCheckAll() { + if (this.check_all === null) { + return; } + + var count = 0; + for (var i = 0; i < this.check_list.length; i++) { + if (this.check_list[i].checked || this.check_list[i].disabled) { + count++; + } else if (count > 0) { + break; // can't possibly be all checked or none checked + } + } + + this.check_all.setState(count > 0 && count === this.check_list.length); } -}; - -SwatCheckboxCellRenderer.prototype.uncheckBetween = function(a, b) -{ - if (a > b) { - var c = ++a; - a = ++b; - b = c; + + checkAll(checked) { + for (var i = 0; i < this.check_list.length; i++) { + if (!this.check_list[i].disabled) { + this.check_list[i].checked = checked; + } + this.updateNode(this.check_list[i]); + } } - for (var i = a; i < b; i++) { - this.check_list[i].checked = false; - this.view.deselectItem(this.check_list[i], this.id); + checkBetween(a, b) { + if (a > b) { + var c = ++a; + a = ++b; + b = c; + } + + for (var i = a; i < b; i++) { + if (!this.check_list[i].disabled) { + this.check_list[i].checked = true; + this.view.selectItem(this.check_list[i], this.id); + } + } } -}; - -SwatCheckboxCellRenderer.prototype.updateNode = function(checkbox_node, - shift_key) -{ - if (checkbox_node.checked) { - this.view.selectItem(checkbox_node, this.id); - if (shift_key && this.last_clicked_index !== null) { - this.checkBetween(this.last_clicked_index, checkbox_node._index); + + uncheckBetween(a, b) { + if (a > b) { + var c = ++a; + a = ++b; + b = c; } - } else { - this.view.deselectItem(checkbox_node, this.id); - if (shift_key && this.last_clicked_index !== null) { - this.uncheckBetween(this.last_clicked_index, checkbox_node._index); + + for (var i = a; i < b; i++) { + this.check_list[i].checked = false; + this.view.deselectItem(this.check_list[i], this.id); } } -}; + + updateNode(checkbox_node, shift_key) { + if (checkbox_node.checked) { + this.view.selectItem(checkbox_node, this.id); + if (shift_key && this.last_clicked_index !== null) { + this.checkBetween(this.last_clicked_index, checkbox_node._index); + } + } else { + this.view.deselectItem(checkbox_node, this.id); + if (shift_key && this.last_clicked_index !== null) { + this.uncheckBetween(this.last_clicked_index, checkbox_node._index); + } + } + } +} module.exports = SwatCheckboxCellRenderer; diff --git a/www/javascript/swat-checkbox-entry-list.js b/www/javascript/swat-checkbox-entry-list.js index e65831585..44bbd58c4 100644 --- a/www/javascript/swat-checkbox-entry-list.js +++ b/www/javascript/swat-checkbox-entry-list.js @@ -1,69 +1,67 @@ const SwatCheckboxList = require('./swat-checkbox-list'); -function SwatCheckboxEntryList(id) -{ - this.entry_list = []; - SwatCheckboxEntryList.superclass.constructor.call(this, id); -} - -YAHOO.lang.extend(SwatCheckboxEntryList, SwatCheckboxList, { +class SwatCheckboxEntryList extends SwatCheckboxList { + constructor(id) { + super(id); + this.entry_list = []; + } -init: function() -{ - SwatCheckboxEntryList.superclass.init.call(this); + init() { + super.init(); - for (var i = 0; i < this.check_list.length; i++) { - var option = this.check_list[i]; - this.entry_list[i] = document.getElementById( - this.id + '_entry_' + option.value); + for (var i = 0; i < this.check_list.length; i++) { + var option = this.check_list[i]; + this.entry_list[i] = document.getElementById( + this.id + '_entry_' + option.value + ); + this.check_list[i]._index = i; + } - this.check_list[i]._index = i; + this.updateFields(); } - this.updateFields(); -}, - -handleClick: function(e) -{ - SwatCheckboxEntryList.superclass.handleClick.call(this, e); - var target = YAHOO.util.Event.getTarget(e); - this.toggleEntry(target._index); -}, - -checkAll: function(checked) -{ - SwatCheckboxEntryList.superclass.checkAll.call(this, checked); - for (var i = 0; i < this.check_list.length; i++) - this.setEntrySensitivity(i, checked); -} + handleClick(e) { + super.handleClick(e); + var target = YAHOO.util.Event.getTarget(e); + this.toggleEntry(target._index); + } -}); + checkAll(checked) { + super.checkAll(checked); + for (var i = 0; i < this.check_list.length; i++) { + this.setEntrySensitivity(i, checked); + } + } -SwatCheckboxEntryList.prototype.toggleEntry = function(index) -{ - if (this.entry_list[index]) - this.setEntrySensitivity(index, this.entry_list[index].disabled); -}; + toggleEntry(index) { + if (this.entry_list[index]) { + this.setEntrySensitivity(index, this.entry_list[index].disabled); + } + }; -SwatCheckboxEntryList.prototype.setEntrySensitivity = function(index, - sensitivity) -{ - if (this.entry_list[index]) { - if (sensitivity) { - this.entry_list[index].disabled = false; - YAHOO.util.Dom.removeClass(this.entry_list[index], - 'swat-insensitive'); - } else { - this.entry_list[index].disabled = true; - YAHOO.util.Dom.addClass(this.entry_list[index], 'swat-insensitive'); + setEntrySensitivity(index, sensitivity) { + if (this.entry_list[index]) { + if (sensitivity) { + this.entry_list[index].disabled = false; + YAHOO.util.Dom.removeClass( + this.entry_list[index], + 'swat-insensitive' + ); + } else { + this.entry_list[index].disabled = true; + YAHOO.util.Dom.addClass( + this.entry_list[index], + 'swat-insensitive' + ); + } } } -}; -SwatCheckboxEntryList.prototype.updateFields = function() -{ - for (var i = 0; i < this.check_list.length; i++) - this.setEntrySensitivity(i, this.check_list[i].checked); -}; + updateFields = function() { + for (var i = 0; i < this.check_list.length; i++) { + this.setEntrySensitivity(i, this.check_list[i].checked); + } + } +} module.exports = SwatCheckboxEntryList; diff --git a/www/javascript/swat-checkbox-list.js b/www/javascript/swat-checkbox-list.js index 46dfffd42..b910ff9b7 100644 --- a/www/javascript/swat-checkbox-list.js +++ b/www/javascript/swat-checkbox-list.js @@ -1,66 +1,75 @@ -/** - * JavaScript SwatCheckboxList component - * - * @param id string Id of the matching {@link SwatCheckboxList} object. - */ -function SwatCheckboxList(id) -{ - this.id = id; - this.check_list = []; - this.check_all = null; // a reference to a check-all js object - YAHOO.util.Event.onDOMReady(this.init, this, true); -} +class SwatCheckboxList { + /** + * JavaScript SwatCheckboxList component + * + * @param id string Id of the matching {@link SwatCheckboxList} object. + */ + constructor(id) { + this.id = id; + this.check_list = []; + this.check_all = null; // a reference to a check-all js object + YAHOO.util.Event.onDOMReady(this.init, this, true); + } -SwatCheckboxList.prototype.init = function() -{ - var id = this.id; - var container = document.getElementById(this.id); - var input_elements = container.getElementsByTagName('INPUT'); - for (var i = 0; i < input_elements.length; i++) { - if (input_elements[i].type == 'checkbox' && - input_elements[i].id.substring(0, id.length) == id) { - this.check_list.push(input_elements[i]); + init() { + var id = this.id; + var container = document.getElementById(this.id); + var input_elements = container.getElementsByTagName('INPUT'); + for (var i = 0; i < input_elements.length; i++) { + if (input_elements[i].type == 'checkbox' && + input_elements[i].id.substring(0, id.length) === id) { + this.check_list.push(input_elements[i]); + } } - } - for (var i = 0; i < this.check_list.length; i++) { - YAHOO.util.Event.on(this.check_list[i], 'click', - this.handleClick, this, true); + for (var i = 0; i < this.check_list.length; i++) { + YAHOO.util.Event.on( + this.check_list[i], + 'click', + this.handleClick, + this, + true + ); + YAHOO.util.Event.on( + this.check_list[i], + 'dblclick', + this.handleClick, + this, + true + ); + } - YAHOO.util.Event.on(this.check_list[i], 'dblclick', - this.handleClick, this, true); + this.updateCheckAll(); } - this.updateCheckAll(); -}; - -SwatCheckboxList.prototype.handleClick = function(event) -{ - this.updateCheckAll(); -}; + handleClick(event) { + this.updateCheckAll(); + } -SwatCheckboxList.prototype.updateCheckAll = function () -{ - if (this.check_all === null) - return; + updateCheckAll() { + if (this.check_all === null) { + return; + } - var count = 0; - for (var i = 0; i < this.check_list.length; i++) - if (this.check_list[i].checked || this.check_list[i].disabled) - count++; - else if (count > 0) - break; // can't possibly be all checked or none checked + var count = 0; + for (var i = 0; i < this.check_list.length; i++) { + if (this.check_list[i].checked || this.check_list[i].disabled) { + count++; + } else if (count > 0) { + break; // can't possibly be all checked or none checked + } + } - this.check_all.setState(count == this.check_list.length); -}; + this.check_all.setState(count == this.check_list.length); + } -SwatCheckboxList.prototype.checkAll = function(checked) -{ - for (var i = 0; i < this.check_list.length; i++) { - if (!this.check_list[i].disabled) { - this.check_list[i].checked = checked; + checkAll(checked) { + for (var i = 0; i < this.check_list.length; i++) { + if (!this.check_list[i].disabled) { + this.check_list[i].checked = checked; + } } } -}; +} module.exports = SwatCheckboxList; diff --git a/www/javascript/swat-disclosure.js b/www/javascript/swat-disclosure.js index b43f1134c..2fdf52af0 100644 --- a/www/javascript/swat-disclosure.js +++ b/www/javascript/swat-disclosure.js @@ -1,259 +1,238 @@ -function SwatDisclosure(id, open) -{ - this.id = id; - this.div = document.getElementById(id); - this.input = document.getElementById(id + '_input'); - this.animate_div = this.getAnimateDiv(); - - // get initial state - if (this.input.value.length) { - // remembered state from post values - this.opened = (this.input.value == 'opened'); - } else { - // initial display - this.opened = open; - } - - // prevent closing during opening animation and vice versa - this.semaphore = false; +class SwatDisclosure { + constructor(id, open) { + this.id = id; + this.div = document.getElementById(id); + this.input = document.getElementById(id + '_input'); + this.animate_div = this.getAnimateDiv(); + + // get initial state + if (this.input.value.length) { + // remembered state from post values + this.opened = (this.input.value == 'opened'); + } else { + // initial display + this.opened = open; + } - YAHOO.util.Event.onDOMReady(this.init, this, true); -} + // prevent closing during opening animation and vice versa + this.semaphore = false; -SwatDisclosure.prototype.init = function() -{ - this.drawDisclosureLink(); - this.drawPeekabooFix(); - - // set initial display state - if (this.opened) - this.open(); - else - this.close(); -}; - -SwatDisclosure.prototype.toggle = function() -{ - if (this.opened) { - this.closeWithAnimation(); - } else { - this.openWithAnimation(); + YAHOO.util.Event.onDOMReady(this.init, this, true); } -}; - -SwatDisclosure.prototype.getSpan = function() -{ - return this.div.firstChild; -}; - -SwatDisclosure.prototype.getAnimateDiv = function() -{ - return this.div.firstChild.nextSibling.nextSibling.firstChild; -}; - -SwatDisclosure.prototype.drawPeekabooFix = function() -{ - var container = document.getElementById(this.id); - if (container.currentStyle && - typeof container.currentStyle.hasLayout != 'undefined') { - /* - * This fix is needed for IE6/7 and fixes display of relative - * positioned elements below this disclosure during and after - * animations. - */ - - var empty_div = document.createElement('div'); - var peekaboo_div = document.createElement('div'); - peekaboo_div.style.height = '0'; - peekaboo_div.style.margin = '0'; - peekaboo_div.style.padding = '0'; - peekaboo_div.style.border = 'none'; - peekaboo_div.appendChild(empty_div); - - if (container.nextSibling) { - container.parentNode.insertBefore(peekaboo_div, - container.nextSibling); + + init() { + this.drawDisclosureLink(); + this.drawPeekabooFix(); + + // set initial display state + if (this.opened) { + this.open(); } else { - container.parentNode.appendChild(peekaboo_div); + this.close(); } } -}; - -SwatDisclosure.prototype.drawDisclosureLink = function() -{ - var span = this.getSpan(); - if (span.firstChild && span.firstChild.nodeType == 3) - var text = document.createTextNode(span.firstChild.nodeValue); - else - var text = document.createTextNode(''); - - this.anchor = document.createElement('a'); - this.anchor.href = '#'; - if (this.opened) - YAHOO.util.Dom.addClass(this.anchor, 'swat-disclosure-anchor-opened'); - else - YAHOO.util.Dom.addClass(this.anchor, 'swat-disclosure-anchor-closed'); - YAHOO.util.Event.addListener(this.anchor, 'click', - function(e) - { - YAHOO.util.Event.preventDefault(e); - this.toggle(); - }, this, true); + toggle() { + if (this.opened) { + this.closeWithAnimation(); + } else { + this.openWithAnimation(); + } + } - this.anchor.appendChild(text); + getSpan() { + return this.div.firstChild; + } - span.parentNode.replaceChild(this.anchor, span); -}; + getAnimateDiv() { + return this.div.firstChild.nextSibling.nextSibling.firstChild; + } -SwatDisclosure.prototype.close = function() -{ - YAHOO.util.Dom.removeClass(this.div, 'swat-disclosure-control-opened'); - YAHOO.util.Dom.addClass(this.div, 'swat-disclosure-control-closed'); + drawPeekabooFix() { + var container = document.getElementById(this.id); + if (container.currentStyle && + typeof container.currentStyle.hasLayout !== 'undefined' + ) { + /* + * This fix is needed for IE6/7 and fixes display of relative + * positioned elements below this disclosure during and after + * animations. + */ + + var empty_div = document.createElement('div'); + var peekaboo_div = document.createElement('div'); + peekaboo_div.style.height = '0'; + peekaboo_div.style.margin = '0'; + peekaboo_div.style.padding = '0'; + peekaboo_div.style.border = 'none'; + peekaboo_div.appendChild(empty_div); + + if (container.nextSibling) { + container.parentNode.insertBefore( + peekaboo_div, + container.nextSibling + ); + } else { + container.parentNode.appendChild(peekaboo_div); + } + } + } - YAHOO.util.Dom.removeClass(this.anchor, 'swat-disclosure-anchor-opened'); - YAHOO.util.Dom.addClass(this.anchor, 'swat-disclosure-anchor-closed'); + drawDisclosureLink() { + var text; + var span = this.getSpan(); + if (span.firstChild && span.firstChild.nodeType === 3) { + text = document.createTextNode(span.firstChild.nodeValue); + } else { + text = document.createTextNode(''); + } - this.semaphore = false; + this.anchor = document.createElement('a'); + this.anchor.href = '#'; + if (this.opened) { + YAHOO.util.Dom.addClass( + this.anchor, + 'swat-disclosure-anchor-opened' + ); + } else { + YAHOO.util.Dom.addClass( + this.anchor, + 'swat-disclosure-anchor-closed' + ); + } - this.input.value = 'closed'; + YAHOO.util.Event.addListener(this.anchor, 'click', + function(e) { + YAHOO.util.Event.preventDefault(e); + this.toggle(); + }, this, true); - this.opened = false; -}; + this.anchor.appendChild(text); -SwatDisclosure.prototype.closeWithAnimation = function() -{ - if (this.semaphore) - return; + span.parentNode.replaceChild(this.anchor, span); + } - YAHOO.util.Dom.removeClass(this.anchor, 'swat-disclosure-anchor-opened'); - YAHOO.util.Dom.addClass(this.anchor, 'swat-disclosure-anchor-closed'); + close() { + YAHOO.util.Dom.removeClass(this.div, 'swat-disclosure-control-opened'); + YAHOO.util.Dom.addClass(this.div, 'swat-disclosure-control-closed'); - this.animate_div.style.overflow = 'hidden'; - this.animate_div.style.height = 'auto'; - var attributes = { height: { to: 0 } }; - var animation = new YAHOO.util.Anim(this.animate_div, attributes, 0.25, - YAHOO.util.Easing.easeOut); + YAHOO.util.Dom.removeClass( + this.anchor, + 'swat-disclosure-anchor-opened' + ); + YAHOO.util.Dom.addClass(this.anchor, 'swat-disclosure-anchor-closed'); - this.semaphore = true; - animation.onComplete.subscribe(this.handleClose, this, true); - animation.animate(); + this.semaphore = false; - this.input.value = 'closed'; - this.opened = false; -}; + this.input.value = 'closed'; -SwatDisclosure.prototype.open = function() -{ - YAHOO.util.Dom.removeClass(this.div, 'swat-disclosure-control-closed'); - YAHOO.util.Dom.addClass(this.div, 'swat-disclosure-control-opened'); + this.opened = false; + } - YAHOO.util.Dom.removeClass(this.anchor, 'swat-disclosure-anchor-closed'); - YAHOO.util.Dom.addClass(this.anchor, 'swat-disclosure-anchor-opened'); + closeWithAnimation() { + if (this.semaphore) { + return; + } - this.semaphore = false; + YAHOO.util.Dom.removeClass( + this.anchor, + 'swat-disclosure-anchor-opened' + ); + YAHOO.util.Dom.addClass(this.anchor, 'swat-disclosure-anchor-closed'); - this.input.value = 'opened'; - this.opened = true; -}; + this.animate_div.style.overflow = 'hidden'; + this.animate_div.style.height = 'auto'; + var attributes = { height: { to: 0 } }; + var animation = new YAHOO.util.Anim( + this.animate_div, + attributes, + 0.25, + YAHOO.util.Easing.easeOut + ); + + this.semaphore = true; + animation.onComplete.subscribe(this.handleClose, this, true); + animation.animate(); + + this.input.value = 'closed'; + this.opened = false; + } -SwatDisclosure.prototype.openWithAnimation = function() -{ - if (this.semaphore) - return; + open() { + YAHOO.util.Dom.removeClass(this.div, 'swat-disclosure-control-closed'); + YAHOO.util.Dom.addClass(this.div, 'swat-disclosure-control-opened'); - YAHOO.util.Dom.removeClass(this.div, 'swat-disclosure-control-closed'); - YAHOO.util.Dom.addClass(this.div, 'swat-disclosure-control-opened'); + YAHOO.util.Dom.removeClass( + this.anchor, + 'swat-disclosure-anchor-closed' + ); + YAHOO.util.Dom.addClass(this.anchor, 'swat-disclosure-anchor-opened'); - YAHOO.util.Dom.removeClass(this.anchor, 'swat-disclosure-anchor-closed'); - YAHOO.util.Dom.addClass(this.anchor, 'swat-disclosure-anchor-opened'); + this.semaphore = false; - // get display height - this.animate_div.parentNode.style.overflow = 'hidden'; - this.animate_div.parentNode.style.height = '0'; - this.animate_div.style.visibility = 'hidden'; - this.animate_div.style.overflow = 'hidden'; - this.animate_div.style.display = 'block'; - this.animate_div.style.height = 'auto'; - var height = this.animate_div.offsetHeight; - this.animate_div.style.height = '0'; - this.animate_div.style.visibility = 'visible'; - this.animate_div.parentNode.style.height = ''; - this.animate_div.parentNode.style.overflow = 'visible'; + this.input.value = 'opened'; + this.opened = true; + } - var attributes = { height: { to: height, from: 0 } }; - var animation = new YAHOO.util.Anim(this.animate_div, attributes, 0.5, - YAHOO.util.Easing.easeOut); + openWithAnimation() { + if (this.semaphore) { + return; + } - this.semaphore = true; - animation.onComplete.subscribe(this.handleOpen, this, true); - animation.animate(); + YAHOO.util.Dom.removeClass(this.div, 'swat-disclosure-control-closed'); + YAHOO.util.Dom.addClass(this.div, 'swat-disclosure-control-opened'); - this.input.value = 'opened'; - this.opened = true; -}; + YAHOO.util.Dom.removeClass( + this.anchor, + 'swat-disclosure-anchor-closed' + ); + YAHOO.util.Dom.addClass(this.anchor, 'swat-disclosure-anchor-opened'); -SwatDisclosure.prototype.handleClose = function() -{ - YAHOO.util.Dom.removeClass(this.div, 'swat-disclosure-control-opened'); - YAHOO.util.Dom.addClass(this.div, 'swat-disclosure-control-closed'); + // get display height + this.animate_div.parentNode.style.overflow = 'hidden'; + this.animate_div.parentNode.style.height = '0'; + this.animate_div.style.visibility = 'hidden'; + this.animate_div.style.overflow = 'hidden'; + this.animate_div.style.display = 'block'; + this.animate_div.style.height = 'auto'; + var height = this.animate_div.offsetHeight; + this.animate_div.style.height = '0'; + this.animate_div.style.visibility = 'visible'; + this.animate_div.parentNode.style.height = ''; + this.animate_div.parentNode.style.overflow = 'visible'; + + var attributes = { height: { to: height, from: 0 } }; + var animation = new YAHOO.util.Anim( + this.animate_div, + attributes, + 0.5, + YAHOO.util.Easing.easeOut + ); + + this.semaphore = true; + animation.onComplete.subscribe(this.handleOpen, this, true); + animation.animate(); + + this.input.value = 'opened'; + this.opened = true; + } - this.semaphore = false; -}; + handleClose() { + YAHOO.util.Dom.removeClass(this.div, 'swat-disclosure-control-opened'); + YAHOO.util.Dom.addClass(this.div, 'swat-disclosure-control-closed'); -SwatDisclosure.prototype.handleOpen = function() -{ - // allow font resizing to work again - this.animate_div.style.height = 'auto'; + this.semaphore = false; + } - // re-set overflow to visible for styles that might depend on it - this.animate_div.style.overflow = 'visible'; + handleOpen() { + // allow font resizing to work again + this.animate_div.style.height = 'auto'; - this.semaphore = false; -}; - -function SwatFrameDisclosure(id, open) -{ - SwatFrameDisclosure.superclass.constructor.call(this, id, open); -} + // re-set overflow to visible for styles that might depend on it + this.animate_div.style.overflow = 'visible'; -YAHOO.lang.extend(SwatFrameDisclosure, SwatDisclosure, { - -getSpan: function() -{ - return this.div.firstChild.firstChild; -}, - -close: function() -{ - SwatFrameDisclosure.superclass.close.call(this); - YAHOO.util.Dom.removeClass(this.div, 'swat-frame-disclosure-control-opened'); - YAHOO.util.Dom.addClass(this.div, 'swat-frame-disclosure-control-closed'); -}, - -handleClose: function() -{ - SwatFrameDisclosure.superclass.handleClose.call(this); - YAHOO.util.Dom.removeClass(this.div, 'swat-frame-disclosure-control-opened'); - YAHOO.util.Dom.addClass(this.div, 'swat-frame-disclosure-control-closed'); -}, - -open: function() -{ - SwatFrameDisclosure.superclass.open.call(this); - YAHOO.util.Dom.removeClass(this.div, 'swat-frame-disclosure-control-closed'); - YAHOO.util.Dom.addClass(this.div, 'swat-frame-disclosure-control-opened'); -}, - -openWithAnimation: function() -{ - if (this.semaphore) - return; - - SwatFrameDisclosure.superclass.openWithAnimation.call(this); - - YAHOO.util.Dom.removeClass(this.div, 'swat-frame-disclosure-control-closed'); - YAHOO.util.Dom.addClass(this.div, 'swat-frame-disclosure-control-opened'); + this.semaphore = false; + } } -}); +module.exports = SwatDisclosure; diff --git a/www/javascript/swat-fieldset.js b/www/javascript/swat-fieldset.js index c1d3b1e8d..a1c6ca2d2 100644 --- a/www/javascript/swat-fieldset.js +++ b/www/javascript/swat-fieldset.js @@ -1,34 +1,39 @@ -function SwatFieldset(id) -{ - this.id = id; - YAHOO.util.Event.onAvailable(this.id, this.init, this, true); -} +class SwatFieldset { + constructor(id) { + this.id = id; + YAHOO.util.Event.onAvailable(this.id, this.init, this, true); + } -SwatFieldset.prototype.init = function() -{ - var container = document.getElementById(this.id); - if (container.currentStyle && - typeof container.currentStyle.hasLayout != 'undefined') { + init() { + var container = document.getElementById(this.id); + if (container.currentStyle && + typeof container.currentStyle.hasLayout !== 'undefined' + ) { - /* - * This fix is needed for IE6/7 and fixes display of relative - * positioned elements below this fieldset during and after - * animations. - */ + /* + * This fix is needed for IE6/7 and fixes display of relative + * positioned elements below this fieldset during and after + * animations. + */ - var empty_div = document.createElement('div'); - var peekaboo_div = document.createElement('div'); - peekaboo_div.style.height = '0'; - peekaboo_div.style.margin = '0'; - peekaboo_div.style.padding = '0'; - peekaboo_div.style.border = 'none'; - peekaboo_div.appendChild(empty_div); + var empty_div = document.createElement('div'); + var peekaboo_div = document.createElement('div'); + peekaboo_div.style.height = '0'; + peekaboo_div.style.margin = '0'; + peekaboo_div.style.padding = '0'; + peekaboo_div.style.border = 'none'; + peekaboo_div.appendChild(empty_div); - if (container.nextSibling) { - container.parentNode.insertBefore(peekaboo_div, - container.nextSibling); - } else { - container.parentNode.appendChild(peekaboo_div); + if (container.nextSibling) { + container.parentNode.insertBefore( + peekaboo_div, + container.nextSibling + ); + } else { + container.parentNode.appendChild(peekaboo_div); + } } } -}; +} + +module.exports = SwatFieldset; diff --git a/www/javascript/swat-form.js b/www/javascript/swat-form.js index d02a0568a..2d8d3b1a6 100644 --- a/www/javascript/swat-form.js +++ b/www/javascript/swat-form.js @@ -1,47 +1,51 @@ -function SwatForm(id, connection_close_url) -{ - this.id = id; - this.form_element = document.getElementById(id); - this.connection_close_url = connection_close_url; - - if (this.connection_close_url) { - YAHOO.util.Event.on(this.form_element, 'submit', this.handleSubmit, - this, true); +class SwatForm { + constructor(id, connection_close_url) { + this.id = id; + this.form_element = document.getElementById(id); + this.connection_close_url = connection_close_url; + + if (this.connection_close_url) { + YAHOO.util.Event.on( + this.form_element, + 'submit', + this.handleSubmit, + this, + true + ); + } } -} -SwatForm.prototype.setDefaultFocus = function(element_id) -{ - // TODO: check if another element in this form is already focused + setDefaultFocus(element_id) { + // TODO: check if another element in this form is already focused - function isFunction(obj) - { - return (typeof obj == 'function' || typeof obj == 'object'); + function isFunction(obj) { + return (typeof obj === 'function' || typeof obj === 'object'); + } + + var element = document.getElementById(element_id); + if (element && !element.disabled && isFunction(element.focus)) { + element.focus(); + } } - var element = document.getElementById(element_id); - if (element && !element.disabled && isFunction(element.focus)) - element.focus(); -}; - -SwatForm.prototype.setAutocomplete = function(state) -{ - this.form_element.setAttribute('autocomplete', (state) ? 'on' : 'off'); -}; - -SwatForm.prototype.closePersistentConnection = function() -{ - var is_safari_osx = /^.*mac os x.*safari.*$/i.test(navigator.userAgent); - if (is_safari_osx && this.connection_close_url && XMLHttpRequest) { - var request = new XMLHttpRequest(); - request.open('GET', this.connection_close_url, false); - request.send(null); + setAutocomplete(state) { + this.form_element.setAttribute('autocomplete', (state) ? 'on' : 'off'); } -}; -SwatForm.prototype.handleSubmit = function(e) -{ - if (this.form_element.enctype == 'multipart/form-data') { - this.closePersistentConnection(); + closePersistentConnection() { + var is_safari_osx = /^.*mac os x.*safari.*$/i.test(navigator.userAgent); + if (is_safari_osx && this.connection_close_url && XMLHttpRequest) { + var request = new XMLHttpRequest(); + request.open('GET', this.connection_close_url, false); + request.send(null); + } } -}; + + handleSubmit(e) { + if (this.form_element.enctype === 'multipart/form-data') { + this.closePersistentConnection(); + } + } +} + +module.exports = SwatForm; diff --git a/www/javascript/swat-frame-disclosure.js b/www/javascript/swat-frame-disclosure.js new file mode 100644 index 000000000..637f6dc5f --- /dev/null +++ b/www/javascript/swat-frame-disclosure.js @@ -0,0 +1,65 @@ +const SwatDisclosure = require('./swat-disclosure'); + +class SwatFrameDisclosure extends SwatDisclosure { + getSpan() { + return this.div.firstChild.firstChild; + } + + close() { + super.close(); + + YAHOO.util.Dom.removeClass( + this.div, + 'swat-frame-disclosure-control-opened' + ); + YAHOO.util.Dom.addClass( + this.div, + 'swat-frame-disclosure-control-closed' + ); + } + + handleClose() { + super.handleClose(); + + YAHOO.util.Dom.removeClass( + this.div, + 'swat-frame-disclosure-control-opened' + ); + YAHOO.util.Dom.addClass( + this.div, + 'swat-frame-disclosure-control-closed' + ); + } + + open() { + super.open(); + + YAHOO.util.Dom.removeClass( + this.div, + 'swat-frame-disclosure-control-closed' + ); + YAHOO.util.Dom.addClass( + this.div, + 'swat-frame-disclosure-control-opened' + ); + } + + openWithAnimation() { + if (this.semaphore) { + return; + } + + super.openWithAnimation(); + + YAHOO.util.Dom.removeClass( + this.div, + 'swat-frame-disclosure-control-closed' + ); + YAHOO.util.Dom.addClass( + this.div, + 'swat-frame-disclosure-control-opened' + ); + } +} + +module.exports = SwatFrameDisclosure; diff --git a/www/javascript/swat-image-cropper.js b/www/javascript/swat-image-cropper.js index e21f2741f..5dc14b187 100644 --- a/www/javascript/swat-image-cropper.js +++ b/www/javascript/swat-image-cropper.js @@ -1,21 +1,27 @@ -function SwatImageCropper(id, config) -{ - this.id = id; +class SwatImageCropper { + constructor(id, config) { + this.id = id; - this.cropper = new YAHOO.widget.ImageCropper(this.id + '_image', config); - this.cropper.on('moveEvent', this.handleChange, this, true); + this.cropper = new YAHOO.widget.ImageCropper( + this.id + '_image', + config + ); - this.crop_box_width = document.getElementById(this.id + '_width'); - this.crop_box_height = document.getElementById(this.id + '_height'); - this.crop_box_x = document.getElementById(this.id + '_x'); - this.crop_box_y = document.getElementById(this.id + '_y'); + this.cropper.on('moveEvent', this.handleChange, this, true); + + this.crop_box_width = document.getElementById(this.id + '_width'); + this.crop_box_height = document.getElementById(this.id + '_height'); + this.crop_box_x = document.getElementById(this.id + '_x'); + this.crop_box_y = document.getElementById(this.id + '_y'); + } + + handleChange() { + var coords = this.cropper.getCropCoords(); + this.crop_box_width.value = coords.width; + this.crop_box_height.value = coords.height; + this.crop_box_x.value = coords.left; + this.crop_box_y.value = coords.top; + } } -SwatImageCropper.prototype.handleChange = function() -{ - var coords = this.cropper.getCropCoords(); - this.crop_box_width.value = coords.width; - this.crop_box_height.value = coords.height; - this.crop_box_x.value = coords.left; - this.crop_box_y.value = coords.top; -}; +module.exports = SwatImageCropper; diff --git a/www/javascript/swat-image-preview-display.js b/www/javascript/swat-image-preview-display.js index d07127f37..ddb44f95a 100644 --- a/www/javascript/swat-image-preview-display.js +++ b/www/javascript/swat-image-preview-display.js @@ -1,286 +1,293 @@ -function SwatImagePreviewDisplay(id, preview_src, preview_width, preview_height, - show_title, preview_title) -{ - this.id = id; - this.opened = false; - this.show_title = show_title; - this.preview_title = preview_title; - this.preview_src = preview_src; - this.preview_width = preview_width; - this.preview_height = preview_height; - - this.onOpen = new YAHOO.util.CustomEvent('open'); - this.onClose = new YAHOO.util.CustomEvent('close'); - - YAHOO.util.Event.onDOMReady(this.init, this, true); -} +const SwatZIndexManager = require('./swat-z-index-manager'); + +class SwatImagePreviewDisplay { + constructor(id, preview_src, preview_width, preview_height, show_title, preview_title) { + this.id = id; + this.opened = false; + this.show_title = show_title; + this.preview_title = preview_title; + this.preview_src = preview_src; + this.preview_width = preview_width; + this.preview_height = preview_height; + + this.onOpen = new YAHOO.util.CustomEvent('open'); + this.onClose = new YAHOO.util.CustomEvent('close'); + + YAHOO.util.Event.onDOMReady(this.init, this, true); + } -SwatImagePreviewDisplay.close_text = 'Close'; + init() { + this.drawOverlay(); -/** - * Padding of preview image - * - * @var Number - */ -SwatImagePreviewDisplay.padding = 16; + // link up the thumbnail image + var image_wrapper = document.getElementById(this.id + '_wrapper'); + if (image_wrapper.tagName === 'A') { -SwatImagePreviewDisplay.prototype.init = function() -{ - this.drawOverlay(); + image_wrapper.href = '#view'; + YAHOO.util.Event.on(image_wrapper, 'click', function(e) { + YAHOO.util.Event.preventDefault(e); + if (!this.opened) { + this.onOpen.fire('thumbnail'); + } + this.open(); + }, this, true); - // link up the thumbnail image - var image_wrapper = document.getElementById(this.id + '_wrapper'); - if (image_wrapper.tagName == 'A') { + } else { + var image_link = document.createElement('a'); - image_wrapper.href = '#view'; - YAHOO.util.Event.on(image_wrapper, 'click', function(e) { - YAHOO.util.Event.preventDefault(e); - if (!this.opened) { - this.onOpen.fire('thumbnail'); + image_link.title = image_wrapper.title; + image_link.className = image_wrapper.className; + image_link.href = '#view'; + + while (image_wrapper.firstChild) { + image_link.appendChild(image_wrapper.firstChild); } - this.open(); - }, this, true); - } else { - var image_link = document.createElement('a'); + image_wrapper.parentNode.replaceChild(image_link, image_wrapper); - image_link.title = image_wrapper.title; - image_link.className = image_wrapper.className; - image_link.href = '#view'; + if (this.show_title) { + var span_tag = document.createElement('span'); + span_tag.className = 'swat-image-preview-title'; + span_tag.appendChild( + document.createTextNode(image_wrapper.title) + ); + image_link.appendChild(span_tag); + } - while (image_wrapper.firstChild) { - image_link.appendChild(image_wrapper.firstChild); + YAHOO.util.Event.on(image_link, 'click', function(e) { + YAHOO.util.Event.preventDefault(e); + if (!this.opened) { + this.onOpen.fire('thumbnail'); + } + this.open(); + }, this, true); } + } - image_wrapper.parentNode.replaceChild(image_link, image_wrapper); + open() { + YAHOO.util.Event.on( + document, + 'keydown', + this.handleKeyDown, + this, + true + ); - if (this.show_title) { - var span_tag = document.createElement('span'); - span_tag.className = 'swat-image-preview-title'; - span_tag.appendChild(document.createTextNode(image_wrapper.title)); - image_link.appendChild(span_tag); - } + // get approximate max height and width excluding close text + var padding = SwatImagePreviewDisplay.padding; + var max_width = YAHOO.util.Dom.getViewportWidth() - (padding * 2); + var max_height = YAHOO.util.Dom.getViewportHeight() - (padding * 2); - YAHOO.util.Event.on(image_link, 'click', function(e) { - YAHOO.util.Event.preventDefault(e); - if (!this.opened) { - this.onOpen.fire('thumbnail'); - } - this.open(); - }, this, true); - } -}; + this.showOverlay(); -SwatImagePreviewDisplay.prototype.open = function() -{ - YAHOO.util.Event.on(document, 'keydown', this.handleKeyDown, this, true); + this.scaleImage(max_width, max_height); - // get approximate max height and width excluding close text - var padding = SwatImagePreviewDisplay.padding; - var max_width = YAHOO.util.Dom.getViewportWidth() - (padding * 2); - var max_height = YAHOO.util.Dom.getViewportHeight() - (padding * 2); + this.preview_container.style.visibility = 'hidden'; + this.preview_container.style.display = 'block'; - this.showOverlay(); + // now that is it displayed, adjust height for the close text + var region = YAHOO.util.Dom.getRegion(this.preview_header); + max_height -= (region.bottom - region.top); + this.scaleImage(max_width, max_height); - this.scaleImage(max_width, max_height); + this.preview_container.style.visibility = 'visible'; - this.preview_container.style.visibility = 'hidden'; - this.preview_container.style.display = 'block'; + // x is relative to center of page + var scroll_top = YAHOO.util.Dom.getDocumentScrollTop(); + var x = -Math.round((this.preview_image.width + padding) / 2); + var y = Math.round( + (max_height - this.preview_image.height + padding) / 2 + ) + scroll_top; - // now that is it displayed, adjust height for the close text - var region = YAHOO.util.Dom.getRegion(this.preview_header); - max_height -= (region.bottom - region.top); - this.scaleImage(max_width, max_height); + this.preview_container.style.top = y + 'px'; - this.preview_container.style.visibility = 'visible'; + // set x + this.preview_container.style.left = '50%'; + this.preview_container.style.marginLeft = x + 'px'; - // x is relative to center of page - var scroll_top = YAHOO.util.Dom.getDocumentScrollTop(); - var x = -Math.round((this.preview_image.width + padding) / 2); - var y = Math.round((max_height - this.preview_image.height + padding) / 2) + - scroll_top; + this.opened = true; + } - this.preview_container.style.top = y + 'px'; + scaleImage(max_width, max_height) { + // if preview image is larger than viewport width, scale down + if (this.preview_image.width > max_width) { + this.preview_image.height = (this.preview_image.height * + (max_width / this.preview_image.width)); - // set x - this.preview_container.style.left = '50%'; - this.preview_container.style.marginLeft = x + 'px'; + this.preview_image.width = max_width; + } - this.opened = true; -}; + // if preview image is larger than viewport height, scale down + if (this.preview_image.height > max_height) { + this.preview_image.width = (this.preview_image.width * + (max_height / this.preview_image.height)); -SwatImagePreviewDisplay.prototype.scaleImage = function(max_width, max_height) -{ - // if preview image is larger than viewport width, scale down - if (this.preview_image.width > max_width) { - this.preview_image.height = (this.preview_image.height * - (max_width / this.preview_image.width)); + this.preview_image.height = max_height; + } - this.preview_image.width = max_width; + // For IE 6 & 7 + this.preview_container.style.width = this.preview_image.width + 'px'; } - // if preview image is larger than viewport height, scale down - if (this.preview_image.height > max_height) { - this.preview_image.width = (this.preview_image.width * - (max_height / this.preview_image.height)); + drawOverlay() { + this.overlay = document.createElement('div'); - this.preview_image.height = max_height; - } + this.overlay.className = 'swat-image-preview-overlay'; + this.overlay.style.display = 'none'; - // For IE 6 & 7 - this.preview_container.style.width = this.preview_image.width + 'px'; -}; + SwatZIndexManager.raiseElement(this.overlay); -SwatImagePreviewDisplay.prototype.drawOverlay = function() -{ - this.overlay = document.createElement('div'); + this.draw(); - this.overlay.className = 'swat-image-preview-overlay'; - this.overlay.style.display = 'none'; + this.overlay.appendChild(this.preview_mask); + this.overlay.appendChild(this.preview_container); - SwatZIndexManager.raiseElement(this.overlay); + var body = document.getElementsByTagName('body')[0]; + body.appendChild(this.overlay); + } - this.draw(); + draw() { + // overlay mask + this.preview_mask = document.createElement('a'); + this.preview_mask.className = 'swat-image-preview-mask'; + this.preview_mask.href = '#close'; - this.overlay.appendChild(this.preview_mask); - this.overlay.appendChild(this.preview_container); + SwatZIndexManager.raiseElement(this.preview_mask); - var body = document.getElementsByTagName('body')[0]; - body.appendChild(this.overlay); -}; + YAHOO.util.Event.on(this.preview_mask, 'click', function(e) { + YAHOO.util.Event.preventDefault(e); + if (this.opened) { + this.onClose.fire('overlayMask'); + } + this.close(); + }, this, true); -SwatImagePreviewDisplay.prototype.draw = function() -{ - // overlay mask - this.preview_mask = document.createElement('a'); - this.preview_mask.className = 'swat-image-preview-mask'; - this.preview_mask.href = '#close'; + YAHOO.util.Event.on(this.preview_mask, 'mouseover', function(e) { + YAHOO.util.Dom.addClass(this.preview_close_button, + 'swat-image-preview-close-hover'); + }, this, true); - SwatZIndexManager.raiseElement(this.preview_mask); + YAHOO.util.Event.on(this.preview_mask, 'mouseout', function(e) { + YAHOO.util.Dom.removeClass(this.preview_close_button, + 'swat-image-preview-close-hover'); + }, this, true); - YAHOO.util.Event.on(this.preview_mask, 'click', function(e) { - YAHOO.util.Event.preventDefault(e); - if (this.opened) { - this.onClose.fire('overlayMask'); + // preview title + this.title = document.createElement('span'); + this.title.className = 'swat-image-preview-title'; + if (this.preview_title) { + this.title.appendChild(document.createTextNode(this.preview_title)); + } else { + // non-breaking space to hold container open when there is no title + this.title.appendChild(document.createTextNode(' ')); } - this.close(); - }, this, true); - - YAHOO.util.Event.on(this.preview_mask, 'mouseover', function(e) { - YAHOO.util.Dom.addClass(this.preview_close_button, - 'swat-image-preview-close-hover'); - }, this, true); - - YAHOO.util.Event.on(this.preview_mask, 'mouseout', function(e) { - YAHOO.util.Dom.removeClass(this.preview_close_button, - 'swat-image-preview-close-hover'); - }, this, true); - - // preview title - this.title = document.createElement('span'); - this.title.className = 'swat-image-preview-title'; - if (this.preview_title) { - this.title.appendChild(document.createTextNode(this.preview_title)); - } else { - // non-breaking space to hold container open when there is no title - this.title.appendChild(document.createTextNode(' ')); + + // close button + this.preview_close_button = this.drawCloseButton(); + SwatZIndexManager.raiseElement(this.preview_close_button); + + // header + this.preview_header = document.createElement('span'); + this.preview_header.className = 'swat-image-preview-header'; + this.preview_header.appendChild(this.preview_close_button); + this.preview_header.appendChild(this.title); + + SwatZIndexManager.raiseElement(this.preview_header); + + // image + this.preview_image = document.createElement('img'); + this.preview_image.id = this.id + '_preview'; + this.preview_image.src = this.preview_src; + this.preview_image.width = this.preview_width; + this.preview_image.height = this.preview_height; + + // image container + this.preview_container = document.createElement('a'); + this.preview_container.href = '#close'; + this.preview_container.className = 'swat-image-preview-container'; + this.preview_container.style.display = 'none'; + this.preview_container.appendChild(this.preview_header); + this.preview_container.appendChild(this.preview_image); + + // For IE6 & 7 + this.preview_container.style.width = this.preview_width + 'px'; + + SwatZIndexManager.raiseElement(this.preview_container); + + YAHOO.util.Event.on(this.preview_container, 'click', function(e) { + YAHOO.util.Event.preventDefault(e); + if (this.opened) { + this.onClose.fire('container'); + } + this.close(); + }, this, true); + + YAHOO.util.Event.on(this.preview_container, 'mouseover', function(e) { + YAHOO.util.Dom.addClass(this.preview_close_button, + 'swat-image-preview-close-hover'); + }, this, true); + + YAHOO.util.Event.on(this.preview_container, 'mouseout', function(e) { + YAHOO.util.Dom.removeClass(this.preview_close_button, + 'swat-image-preview-close-hover'); + }, this, true); } - // close button - this.preview_close_button = this.drawCloseButton(); - SwatZIndexManager.raiseElement(this.preview_close_button); - - // header - this.preview_header = document.createElement('span'); - this.preview_header.className = 'swat-image-preview-header'; - this.preview_header.appendChild(this.preview_close_button); - this.preview_header.appendChild(this.title); - - SwatZIndexManager.raiseElement(this.preview_header); - - // image - this.preview_image = document.createElement('img'); - this.preview_image.id = this.id + '_preview'; - this.preview_image.src = this.preview_src; - this.preview_image.width = this.preview_width; - this.preview_image.height = this.preview_height; - - // image container - this.preview_container = document.createElement('a'); - this.preview_container.href = '#close'; - this.preview_container.className = 'swat-image-preview-container'; - this.preview_container.style.display = 'none'; - this.preview_container.appendChild(this.preview_header); - this.preview_container.appendChild(this.preview_image); - - // For IE6 & 7 - this.preview_container.style.width = this.preview_width + 'px'; - - SwatZIndexManager.raiseElement(this.preview_container); - - YAHOO.util.Event.on(this.preview_container, 'click', function(e) { - YAHOO.util.Event.preventDefault(e); - if (this.opened) { - this.onClose.fire('container'); - } - this.close(); - }, this, true); - - YAHOO.util.Event.on(this.preview_container, 'mouseover', function(e) { - YAHOO.util.Dom.addClass(this.preview_close_button, - 'swat-image-preview-close-hover'); - }, this, true); - - YAHOO.util.Event.on(this.preview_container, 'mouseout', function(e) { - YAHOO.util.Dom.removeClass(this.preview_close_button, - 'swat-image-preview-close-hover'); - }, this, true); -}; - -SwatImagePreviewDisplay.prototype.drawCloseButton = function() -{ - var button = document.createElement('span'); - - button.className = 'swat-image-preview-close'; - button.appendChild( - document.createTextNode( - SwatImagePreviewDisplay.close_text - ) - ); - - return button; -}; - -SwatImagePreviewDisplay.prototype.showOverlay = function() -{ - this.overlay.style.height = YAHOO.util.Dom.getDocumentHeight() + 'px'; - this.overlay.style.display = 'block'; -}; - -SwatImagePreviewDisplay.prototype.hideOverlay = function() -{ - this.overlay.style.display = 'none'; -}; - -SwatImagePreviewDisplay.prototype.close = function() -{ - YAHOO.util.Event.removeListener(document, 'keydown', this.handleKeyDown); - - this.hideOverlay(); - - this.preview_container.style.display = 'none'; - - this.opened = false; -}; - -SwatImagePreviewDisplay.prototype.handleKeyDown = function(e) -{ - // close preview on backspace or escape - if (e.keyCode == 8 || e.keyCode == 27) { - YAHOO.util.Event.preventDefault(e); - if (this.opened) { - this.onClose.fire('keyboard'); + drawCloseButton() { + var button = document.createElement('span'); + + button.className = 'swat-image-preview-close'; + button.appendChild( + document.createTextNode( + SwatImagePreviewDisplay.close_text + ) + ); + + return button; + } + + showOverlay() { + this.overlay.style.height = YAHOO.util.Dom.getDocumentHeight() + 'px'; + this.overlay.style.display = 'block'; + } + + hideOverlay() { + this.overlay.style.display = 'none'; + } + + close() { + YAHOO.util.Event.removeListener( + document, + 'keydown', + this.handleKeyDown + ); + + this.hideOverlay(); + + this.preview_container.style.display = 'none'; + + this.opened = false; + } + + handleKeyDown(e) { + // close preview on backspace or escape + if (e.keyCode === 8 || e.keyCode === 27) { + YAHOO.util.Event.preventDefault(e); + if (this.opened) { + this.onClose.fire('keyboard'); + } + this.close(); } - this.close(); } -}; +} + +SwatImagePreviewDisplay.close_text = 'Close'; + +/** + * Padding of preview image + * + * @var Number + */ +SwatImagePreviewDisplay.padding = 16; + +module.exports = SwatImagePreviewDisplay; diff --git a/www/javascript/swat-message-display-message.js b/www/javascript/swat-message-display-message.js new file mode 100644 index 000000000..131a01812 --- /dev/null +++ b/www/javascript/swat-message-display-message.js @@ -0,0 +1,137 @@ +class SwatMessageDisplayMessage { + /** + * A message in a message display + * + * @param Number message_index the message to hide from this list. + */ + constructor(message_display_id, message_index) { + this.id = message_display_id + '_' + message_index; + this.message_div = document.getElementById(this.id); + this.drawDismissLink(); + } + + drawDismissLink() { + var text = document.createTextNode( + SwatMessageDisplayMessage.close_text + ); + + var anchor = document.createElement('a'); + anchor.href = '#'; + anchor.title = SwatMessageDisplayMessage.close_text; + YAHOO.util.Dom.addClass(anchor, 'swat-message-display-dismiss-link'); + YAHOO.util.Event.addListener(anchor, 'click', + function(e, message) { + YAHOO.util.Event.preventDefault(e); + message.hide(); + }, this); + + anchor.appendChild(text); + + var container = this.message_div.firstChild; + container.insertBefore(anchor, container.firstChild); + } + + /** + * Hides this message + * + * Uses the self-healing transition pattern described at + * {@link http://developer.yahoo.com/ypatterns/pattern.php?pattern=selfhealing}. + */ + hide() { + if (this.message_div !== null) { + // fade out message + var fade_animation = new YAHOO.util.Anim( + this.message_div, + { opacity: { to: 0 } }, + SwatMessageDisplayMessage.fade_duration, + YAHOO.util.Easing.easingOut + ); + + // after fading out, shrink the empty space away + fade_animation.onComplete.subscribe(this.shrink, this, true); + fade_animation.animate(); + } + } + + shrink() { + var duration = SwatMessageDisplayMessage.shrink_duration; + var easing = YAHOO.util.Easing.easeInStrong; + + var attributes = { + height: { to: 0 }, + marginBottom: { to: 0 } + }; + + // collapse margins + if (this.message_div.nextSibling) { + // shrink top margin of next message in message display + var next_message_animation = new YAHOO.util.Anim( + this.message_div.nextSibling, + { marginTop: { to: 0 } }, + duration, + easing + ); + next_message_animation.animate(); + } else { + // shrink top margin of element directly below message display + + // find first element node + var script_node = this.message_div.parentNode.nextSibling; + var node = script_node.nextSibling; + while (node && node.nodeType != 1) + node = node.nextSibling; + + if (node) { + var previous_message_animation = new YAHOO.util.Anim( + node, + { marginTop: { to: 0 } }, + duration, + easing + ); + previous_message_animation.animate(); + } + } + + // if this is the last message in the display, shrink the message display + // top margin to zero. + if (this.message_div.parentNode.childNodes.length === 1) { + + // collapse top margin of last message + attributes.marginTop = { to: 0 }; + + var message_display_animation = new YAHOO.util.Anim( + this.message_div.parentNode, + { marginTop: { to: 0 } }, + duration, + easing + ); + message_display_animation.animate(); + } + + // disappear this message + var shrink_animation = new YAHOO.util.Anim( + this.message_div, + attributes, + duration, + easing + ); + shrink_animation.onComplete.subscribe(this.remove, this, true); + shrink_animation.animate(); + } + + remove() { + YAHOO.util.Event.purgeElement(this.message_div, true); + + var removed_node = this.message_div.parentNode.removeChild( + this.message_div + ); + + delete removed_node; + }; +} + +SwatMessageDisplayMessage.close_text = 'Dismiss message'; +SwatMessageDisplayMessage.fade_duration = 0.3; +SwatMessageDisplayMessage.shrink_duration = 0.3; + +module.exports = SwatMessageDisplayMessage; diff --git a/www/javascript/swat-message-display.js b/www/javascript/swat-message-display.js index 570f8d273..fcc878cae 100644 --- a/www/javascript/swat-message-display.js +++ b/www/javascript/swat-message-display.js @@ -1,146 +1,26 @@ -function SwatMessageDisplay(id, hideable_messages) -{ - this.id = id; - this.messages = []; - - // create message objects for this display - for (var i = 0; i < hideable_messages.length; i++) { - var message = new SwatMessageDisplayMessage(this.id, - hideable_messages[i]); - - this.messages[i] = message; - } -} - -SwatMessageDisplay.prototype.getMessage = function(index) -{ - if (this.messages[index]) - return this.messages[index]; - else - return false; -}; - -/** - * A message in a message display - * - * @param Number message_index the message to hide from this list. - */ -function SwatMessageDisplayMessage(message_display_id, message_index) -{ - this.id = message_display_id + '_' + message_index; - this.message_div = document.getElementById(this.id); - this.drawDismissLink(); -} - -SwatMessageDisplayMessage.close_text = 'Dismiss message'; -SwatMessageDisplayMessage.fade_duration = 0.3; -SwatMessageDisplayMessage.shrink_duration = 0.3; - -SwatMessageDisplayMessage.prototype.drawDismissLink = function() -{ - var text = document.createTextNode(SwatMessageDisplayMessage.close_text); - - var anchor = document.createElement('a'); - anchor.href = '#'; - anchor.title = SwatMessageDisplayMessage.close_text; - YAHOO.util.Dom.addClass(anchor, 'swat-message-display-dismiss-link'); - YAHOO.util.Event.addListener(anchor, 'click', - function(e, message) - { - YAHOO.util.Event.preventDefault(e); - message.hide(); - }, this); - - anchor.appendChild(text); - - var container = this.message_div.firstChild; - container.insertBefore(anchor, container.firstChild); -}; - -/** - * Hides this message - * - * Uses the self-healing transition pattern described at - * {@link http://developer.yahoo.com/ypatterns/pattern.php?pattern=selfhealing}. - */ -SwatMessageDisplayMessage.prototype.hide = function() -{ - if (this.message_div !== null) { - // fade out message - var fade_animation = new YAHOO.util.Anim(this.message_div, - { opacity: { to: 0 } }, - SwatMessageDisplayMessage.fade_duration, - YAHOO.util.Easing.easingOut); - - // after fading out, shrink the empty space away - fade_animation.onComplete.subscribe(this.shrink, this, true); - fade_animation.animate(); - } -}; - -SwatMessageDisplayMessage.prototype.shrink = function() -{ - var duration = SwatMessageDisplayMessage.shrink_duration; - var easing = YAHOO.util.Easing.easeInStrong; - - var attributes = { - height: { to: 0 }, - marginBottom: { to: 0 } - }; - - // collapse margins - if (this.message_div.nextSibling) { - // shrink top margin of next message in message display - var next_message_animation = new YAHOO.util.Anim( - this.message_div.nextSibling, { marginTop: { to: 0 } }, - duration, easing); - - next_message_animation.animate(); - } else { - // shrink top margin of element directly below message display - - // find first element node - var script_node = this.message_div.parentNode.nextSibling; - var node = script_node.nextSibling; - while (node && node.nodeType != 1) - node = node.nextSibling; - - if (node) { - var previous_message_animation = new YAHOO.util.Anim( - node, { marginTop: { to: 0 } }, duration, easing); - - previous_message_animation.animate(); +const SwatMessageDisplayMessage = require('./swat-message-display-message'); + +class SwatMessageDisplay { + constructor(id, hideable_messages) { + this.id = id; + this.messages = []; + + // create message objects for this display + for (var i = 0; i < hideable_messages.length; i++) { + var message = new SwatMessageDisplayMessage( + this.id, + hideable_messages[i] + ); + this.messages[i] = message; } } - // if this is the last message in the display, shrink the message display - // top margin to zero. - if (this.message_div.parentNode.childNodes.length == 1) { - - // collapse top margin of last message - attributes.marginTop = { to: 0 }; - - var message_display_animation = new YAHOO.util.Anim( - this.message_div.parentNode, { marginTop: { to: 0 } }, duration, - easing); - - message_display_animation.animate(); + getMessage(index) { + if (this.messages[index]) { + return this.messages[index]; + } + return false; } +} - // disappear this message - var shrink_animation = new YAHOO.util.Anim(this.message_div, - attributes, duration, easing); - - shrink_animation.onComplete.subscribe(this.remove, this, true); - shrink_animation.animate(); -}; - -SwatMessageDisplayMessage.prototype.remove = function() -{ - YAHOO.util.Event.purgeElement(this.message_div, true); - - var removed_node = - this.message_div.parentNode.removeChild(this.message_div); - - delete removed_node; -}; +module.exports = SwatMessageDisplay; diff --git a/www/javascript/swat-progress-bar.js b/www/javascript/swat-progress-bar.js index d13bccb3e..6fabe6979 100644 --- a/www/javascript/swat-progress-bar.js +++ b/www/javascript/swat-progress-bar.js @@ -6,253 +6,270 @@ * * @copyright 2007-2016 silverorange */ -function SwatProgressBar(id, orientation, value) -{ - this.id = id; - this.orientation = orientation; - this.value = value; - - this.pulse_step = 0.05; - this.pulse_position = 0; - this.pulse_width = 0.15; - this.pulse_direction = 1; - - this.full = document.getElementById(this.id + '_full'); - this.empty = document.getElementById(this.id + '_empty'); - this.text = document.getElementById(this.id + '_text'); - this.container = document.getElementById(this.id); - - this.changeValueEvent = new YAHOO.util.CustomEvent('changeValue'); - this.pulseEvent = new YAHOO.util.CustomEvent('pulse'); - - this.animation = null; - - YAHOO.util.Event.onDOMReady(function() { - // Hack for Gecko and WebKit to load background images for full part of - // progress bar. If the bar starts at zero, these browsers don't load - // the background image, even when the bar's value changes. - this.full_stubb = document.createElement('div'); - this.full_stubb.className = this.full.className; - this.full_stubb.style.width = '100px'; - this.full_stubb.style.height = '100px'; - this.full_stubb.style.position = 'absolute'; - this.full_stubb.style.top = '-10000px'; - document.body.appendChild(this.full_stubb); - }, this, true); -} +class SwatProgressBar { + constructor(id, orientation, value) { + this.id = id; + this.orientation = orientation; + this.value = value; + + this.pulse_step = 0.05; + this.pulse_position = 0; + this.pulse_width = 0.15; + this.pulse_direction = 1; -SwatProgressBar.ORIENTATION_LEFT_TO_RIGHT = 1; -SwatProgressBar.ORIENTATION_RIGHT_TO_LEFT = 2; -SwatProgressBar.ORIENTATION_BOTTOM_TO_TOP = 3; -SwatProgressBar.ORIENTATION_TOP_TO_BOTTOM = 4; + this.full = document.getElementById(this.id + '_full'); + this.empty = document.getElementById(this.id + '_empty'); + this.text = document.getElementById(this.id + '_text'); + this.container = document.getElementById(this.id); + + this.changeValueEvent = new YAHOO.util.CustomEvent('changeValue'); + this.pulseEvent = new YAHOO.util.CustomEvent('pulse'); + + this.animation = null; + + YAHOO.util.Event.onDOMReady(function() { + // Hack for Gecko and WebKit to load background images for full + // part of progress bar. If the bar starts at zero, these browsers + // don't load the background image, even when the bar's value + // changes. + this.full_stubb = document.createElement('div'); + this.full_stubb.className = this.full.className; + this.full_stubb.style.width = '100px'; + this.full_stubb.style.height = '100px'; + this.full_stubb.style.position = 'absolute'; + this.full_stubb.style.top = '-10000px'; + document.body.appendChild(this.full_stubb); + }, this, true); + } -SwatProgressBar.EPSILON = 0.0001; + setValue(value) { + if (this.value === value) { + return; + } -SwatProgressBar.ANIMATION_DURATION = 0.5; + this.value = value; -SwatProgressBar.prototype.setValue = function(value) -{ - if (this.value == value) - return; - - this.value = value; - - var full_width = 100 * value; - var empty_width = 100 - (100 * value); - full_width = (full_width > 100) ? 100 : full_width; - empty_width = (empty_width < 0) ? 0 : empty_width; - - // reset position if bar was set to pulse-mode - if (this.orientation !== SwatProgressBar.ORIENTATION_BOTTOM_TO_TOP) - this.full.style.position = 'static'; - - // reset empty div if bar was set to pulse mode - this.empty.style.display = 'block'; - - switch (this.orientation) { - case SwatProgressBar.ORIENTATION_LEFT_TO_RIGHT: - case SwatProgressBar.ORIENTATION_RIGHT_TO_LEFT: - default: - this.full.style.width = full_width + '%'; - this.empty.style.width = empty_width + '%'; - break; - - case SwatProgressBar.ORIENTATION_BOTTOM_TO_TOP: - this.full.style.top = empty_width + '%'; - this.empty.style.top = '-' + full_width + '%'; - // fall through - - case SwatProgressBar.ORIENTATION_TOP_TO_BOTTOM: - this.full.style.height = full_width + '%'; - this.empty.style.height = empty_width + '%'; - break; - } + var full_width = 100 * value; + var empty_width = 100 - (100 * value); + full_width = (full_width > 100) ? 100 : full_width; + empty_width = (empty_width < 0) ? 0 : empty_width; - this.changeValueEvent.fire(this.value); -}; - -SwatProgressBar.prototype.setValueWithAnimation = function(value) -{ - if (this.value == value) - return; - - var old_full_width = 100 * this.value; - var old_empty_width = 100 - (100 * this.value); - old_full_width = (old_full_width > 100) ? 100 : old_full_width; - old_empty_width = (old_empty_width < 0) ? 0 : old_empty_width; - - // set new value - this.value = value; - - var new_full_width = 100 * value; - var new_empty_width = 100 - (100 * value); - new_full_width = (new_full_width > 100) ? 100 : new_full_width; - new_empty_width = (new_empty_width < 0) ? 0 : new_empty_width; - - // reset position if bar was set to pulse-mode - if (this.orientation !== SwatProgressBar.ORIENTATION_BOTTOM_TO_TOP) - this.full.style.position = 'static'; - - // reset empty div if bar was set to pulse mode - this.empty.style.display = 'block'; - - var full_attributes = {}; - - switch (this.orientation) { - case SwatProgressBar.ORIENTATION_LEFT_TO_RIGHT: - case SwatProgressBar.ORIENTATION_RIGHT_TO_LEFT: - default: - full_attributes['width'] = { - from: old_full_width, - to: new_full_width, - unit: '%' - }; - break; - - case SwatProgressBar.ORIENTATION_BOTTOM_TO_TOP: - full_attributes['top'] = { - from: old_empty_width, - to: new_empty_width, - unit: '%' - }; - // fall through - - case SwatProgressBar.ORIENTATION_TOP_TO_BOTTOM: - full_attributes['height'] = { - from: old_full_width, - to: new_full_width, - unit: '%' - }; - break; - } + // reset position if bar was set to pulse-mode + if (this.orientation !== SwatProgressBar.ORIENTATION_BOTTOM_TO_TOP) { + this.full.style.position = 'static'; + } + + // reset empty div if bar was set to pulse mode + this.empty.style.display = 'block'; - // stop existing animation - if (this.animation !== null && this.animation.isAnimated()) { - this.animation.stop(); + switch (this.orientation) { + case SwatProgressBar.ORIENTATION_LEFT_TO_RIGHT: + case SwatProgressBar.ORIENTATION_RIGHT_TO_LEFT: + default: + this.full.style.width = full_width + '%'; + this.empty.style.width = empty_width + '%'; + break; + + case SwatProgressBar.ORIENTATION_BOTTOM_TO_TOP: + this.full.style.top = empty_width + '%'; + this.empty.style.top = '-' + full_width + '%'; + // fall through + + case SwatProgressBar.ORIENTATION_TOP_TO_BOTTOM: + this.full.style.height = full_width + '%'; + this.empty.style.height = empty_width + '%'; + break; + } + + this.changeValueEvent.fire(this.value); } - this.animation = new YAHOO.util.Anim(this.full, full_attributes, - SwatProgressBar.ANIMATION_DURATION); + setValueWithAnimation(value) { + if (this.value === value) { + return; + } + + var old_full_width = 100 * this.value; + var old_empty_width = 100 - (100 * this.value); + old_full_width = (old_full_width > 100) ? 100 : old_full_width; + old_empty_width = (old_empty_width < 0) ? 0 : old_empty_width; - // Synchronize empty div resizing with full div animation. Don't do - // this with a separate animation. - this.animation.onTween.subscribe(function() { - var percent = this.animation.currentFrame / this.animation.totalFrames; + // set new value + this.value = value; + + var new_full_width = 100 * value; + var new_empty_width = 100 - (100 * value); + new_full_width = (new_full_width > 100) ? 100 : new_full_width; + new_empty_width = (new_empty_width < 0) ? 0 : new_empty_width; + + // reset position if bar was set to pulse-mode + if (this.orientation !== SwatProgressBar.ORIENTATION_BOTTOM_TO_TOP) { + this.full.style.position = 'static'; + } - var full_percent = old_full_width + - ((new_full_width - old_full_width) * percent); + // reset empty div if bar was set to pulse mode + this.empty.style.display = 'block'; - var empty_percent = 100.00 - full_percent; + var full_attributes = {}; switch (this.orientation) { - case SwatProgressBar.ORIENTATION_LEFT_TO_RIGHT: - case SwatProgressBar.ORIENTATION_RIGHT_TO_LEFT: - default: - this.empty.style.width = empty_percent + '%'; - break; - - case SwatProgressBar.ORIENTATION_BOTTOM_TO_TOP: - this.empty.style.top = -full_percent + '%'; - // fall through - - case SwatProgressBar.ORIENTATION_TOP_TO_BOTTOM: - this.empty.style.height = empty_percent + '%'; - break; + case SwatProgressBar.ORIENTATION_LEFT_TO_RIGHT: + case SwatProgressBar.ORIENTATION_RIGHT_TO_LEFT: + default: + full_attributes['width'] = { + from: old_full_width, + to: new_full_width, + unit: '%' + }; + break; + + case SwatProgressBar.ORIENTATION_BOTTOM_TO_TOP: + full_attributes['top'] = { + from: old_empty_width, + to: new_empty_width, + unit: '%' + }; + // fall through + + case SwatProgressBar.ORIENTATION_TOP_TO_BOTTOM: + full_attributes['height'] = { + from: old_full_width, + to: new_full_width, + unit: '%' + }; + break; } - }, this, true); - this.animation.animate(); + // stop existing animation + if (this.animation !== null && this.animation.isAnimated()) { + this.animation.stop(); + } + + this.animation = new YAHOO.util.Anim( + this.full, + full_attributes, + SwatProgressBar.ANIMATION_DURATION + ); + + // Synchronize empty div resizing with full div animation. Don't do + // this with a separate animation. + this.animation.onTween.subscribe(function() { + var percent = this.animation.currentFrame / + this.animation.totalFrames; + + var full_percent = old_full_width + + ((new_full_width - old_full_width) * percent); + + var empty_percent = 100.00 - full_percent; + + switch (this.orientation) { + case SwatProgressBar.ORIENTATION_LEFT_TO_RIGHT: + case SwatProgressBar.ORIENTATION_RIGHT_TO_LEFT: + default: + this.empty.style.width = empty_percent + '%'; + break; + + case SwatProgressBar.ORIENTATION_BOTTOM_TO_TOP: + this.empty.style.top = -full_percent + '%'; + // fall through - this.changeValueEvent.fire(this.value); -}; + case SwatProgressBar.ORIENTATION_TOP_TO_BOTTOM: + this.empty.style.height = empty_percent + '%'; + break; + } + }, this, true); -SwatProgressBar.prototype.setText = function(text) -{ - if (this.text.innerText) { - this.text.innerText = text; - } else { - this.text.textContent = text; + this.animation.animate(); + + this.changeValueEvent.fire(this.value); } -}; - -SwatProgressBar.prototype.getValue = function() -{ - return this.value; -}; - -SwatProgressBar.prototype.pulse = function() -{ - this.full.style.position = 'relative'; - this.empty.style.display = 'none'; - - switch (this.orientation) { - case SwatProgressBar.ORIENTATION_LEFT_TO_RIGHT: - default: - this.full.style.width = (this.pulse_width * 100) + '%'; - this.full.style.left = (this.pulse_position * 100) + '%'; - break; - - case SwatProgressBar.ORIENTATION_RIGHT_TO_LEFT: - this.full.style.width = (this.pulse_width * 100) + '%'; - this.full.style.left = '-' + (this.pulse_position * 100) + '%'; - break; - - case SwatProgressBar.ORIENTATION_BOTTOM_TO_TOP: - this.full.style.height = (this.pulse_width * 100) + '%'; - this.full.style.top = - ((1 - (this.pulse_position + this.pulse_width)) * 100) + '%'; - - break; - - case SwatProgressBar.ORIENTATION_TOP_TO_BOTTOM: - this.full.style.height = (this.pulse_width * 100) + '%'; - this.full.style.top = (this.pulse_position * 100) + '%'; - break; + + setText(text) { + if (this.text.innerText) { + this.text.innerText = text; + } else { + this.text.textContent = text; + } } - var new_pulse_position = - this.pulse_position + this.pulse_step * this.pulse_direction; + getValue = function() { + return this.value; + } - if (this.pulse_direction == 1 && - this.compare(new_pulse_position + this.pulse_width, 1) > 0) - this.pulse_direction = -1; + pulse() { + this.full.style.position = 'relative'; + this.empty.style.display = 'none'; - if (this.pulse_direction == -1 && this.compare(new_pulse_position, 0) < 0) - this.pulse_direction = 1; + switch (this.orientation) { + case SwatProgressBar.ORIENTATION_LEFT_TO_RIGHT: + default: + this.full.style.width = (this.pulse_width * 100) + '%'; + this.full.style.left = (this.pulse_position * 100) + '%'; + break; + + case SwatProgressBar.ORIENTATION_RIGHT_TO_LEFT: + this.full.style.width = (this.pulse_width * 100) + '%'; + this.full.style.left = '-' + (this.pulse_position * 100) + '%'; + break; + + case SwatProgressBar.ORIENTATION_BOTTOM_TO_TOP: + this.full.style.height = (this.pulse_width * 100) + '%'; + this.full.style.top = + ((1 - (this.pulse_position + this.pulse_width)) * 100) + '%'; + + break; + + case SwatProgressBar.ORIENTATION_TOP_TO_BOTTOM: + this.full.style.height = (this.pulse_width * 100) + '%'; + this.full.style.top = (this.pulse_position * 100) + '%'; + break; + } - this.pulse_position += (this.pulse_step * this.pulse_direction); + var new_pulse_position = + this.pulse_position + this.pulse_step * this.pulse_direction; - this.pulseEvent.fire(); + if (this.pulse_direction === 1 && + this.compare(new_pulse_position + this.pulse_width, 1) > 0 + ) { + this.pulse_direction = -1; + } - // preserve precision across multiple calls to pulse() - this.pulse_position = - Math.round(this.pulse_position / SwatProgressBar.EPSILON) * - SwatProgressBar.EPSILON; -}; + if (this.pulse_direction === -1 && + this.compare(new_pulse_position, 0) < 0 + ) { + this.pulse_direction = 1; + } + + this.pulse_position += (this.pulse_step * this.pulse_direction); + + this.pulseEvent.fire(); + + // preserve precision across multiple calls to pulse() + this.pulse_position = + Math.round(this.pulse_position / SwatProgressBar.EPSILON) * + SwatProgressBar.EPSILON; + } + + compare(x, y) { + if (Math.abs(x - y) < SwatProgressBar.EPSILON) { + return 0; + } + + if (x > y) { + return 1; + } + + return -1; + } +} + +SwatProgressBar.ORIENTATION_LEFT_TO_RIGHT = 1; +SwatProgressBar.ORIENTATION_RIGHT_TO_LEFT = 2; +SwatProgressBar.ORIENTATION_BOTTOM_TO_TOP = 3; +SwatProgressBar.ORIENTATION_TOP_TO_BOTTOM = 4; + +SwatProgressBar.EPSILON = 0.0001; + +SwatProgressBar.ANIMATION_DURATION = 0.5; -SwatProgressBar.prototype.compare = function(x, y) -{ - if (Math.abs(x - y) < SwatProgressBar.EPSILON) return 0; - if (x > y) return 1; - return -1; -}; +module.exports = SwatProgressBar; diff --git a/www/javascript/swat-radio-button-cell-renderer.js b/www/javascript/swat-radio-button-cell-renderer.js index 35cca2906..933e8295e 100644 --- a/www/javascript/swat-radio-button-cell-renderer.js +++ b/www/javascript/swat-radio-button-cell-renderer.js @@ -1,52 +1,55 @@ -/** - * Radio button cell renderer controller - * - * @param string id the unique identifier of this radio button cell renderer. - * @param SwatView view the view containing this radio button cell renderer. - */ -function SwatRadioButtonCellRenderer(id, view) -{ - this.id = id; - this.view = view; - this.radio_list = []; - this.current_node = null; - - /* - * Get all radio buttons with name = id and that are contained in the - * currect view. Note: getElementsByName() does not work from a node - * element. +class SwatRadioButtonCellRenderer { + /** + * Radio button cell renderer controller + * + * @param string id the unique identifier of this radio button cell renderer. + * @param SwatView view the view containing this radio button cell renderer. */ - var view_node = document.getElementById(this.view.id); - var input_nodes = view_node.getElementsByTagName('input'); - for (var i = 0; i < input_nodes.length; i++) { - if (input_nodes[i].name == id) { - if (input_nodes[i].checked) - this.current_node = input_nodes[i]; + constructor(id, view) { + this.id = id; + this.view = view; + this.radio_list = []; + this.current_node = null; + + /* + * Get all radio buttons with name = id and that are contained in the + * currect view. Note: getElementsByName() does not work from a node + * element. + */ + var view_node = document.getElementById(this.view.id); + var input_nodes = view_node.getElementsByTagName('input'); + for (var i = 0; i < input_nodes.length; i++) { + if (input_nodes[i].name == id) { + if (input_nodes[i].checked) + this.current_node = input_nodes[i]; - this.radio_list.push(input_nodes[i]); - this.updateNode(input_nodes[i]); - YAHOO.util.Event.addListener(input_nodes[i], 'click', - this.handleClick, this, true); + this.radio_list.push(input_nodes[i]); + this.updateNode(input_nodes[i]); + YAHOO.util.Event.addListener(input_nodes[i], 'click', + this.handleClick, this, true); - YAHOO.util.Event.addListener(input_nodes[i], 'dblclick', - this.handleClick, this, true); + YAHOO.util.Event.addListener(input_nodes[i], 'dblclick', + this.handleClick, this, true); + } } } -} -SwatRadioButtonCellRenderer.prototype.handleClick = function(e) -{ - if (this.current_node) + handleClick(e) { + if (this.current_node) { + this.updateNode(this.current_node); + } + + this.current_node = YAHOO.util.Event.getTarget(e); this.updateNode(this.current_node); + } - this.current_node = YAHOO.util.Event.getTarget(e); - this.updateNode(this.current_node); -}; + updateNode(radio_button_node) { + if (radio_button_node.checked) { + this.view.selectItem(radio_button_node, this.id); + } else { + this.view.deselectItem(radio_button_node, this.id); + } + } +} -SwatRadioButtonCellRenderer.prototype.updateNode = function(radio_button_node) -{ - if (radio_button_node.checked) - this.view.selectItem(radio_button_node, this.id); - else - this.view.deselectItem(radio_button_node, this.id); -}; +module.exports = SwatRadioButtonCellRenderer; diff --git a/www/javascript/swat-radio-note-book.js b/www/javascript/swat-radio-note-book.js index 532baf2f5..8f073068c 100644 --- a/www/javascript/swat-radio-note-book.js +++ b/www/javascript/swat-radio-note-book.js @@ -1,195 +1,193 @@ -function SwatRadioNoteBook(id) -{ - this.id = id; - this.current_page = null; +class SwatRadioNoteBook { + constructor(id) { + this.id = id; + this.current_page = null; - YAHOO.util.Event.onDOMReady(this.init, this, true); -} + YAHOO.util.Event.onDOMReady(this.init, this, true); + } -SwatRadioNoteBook.FADE_DURATION = 0.25; -SwatRadioNoteBook.SLIDE_DURATION = 0.15; -SwatRadioNoteBook.prototype.init = function() -{ - var table = document.getElementById(this.id); - - // get radio options - var unfiltered_options = document.getElementsByName(this.id); - this.options = []; - var count = 0; - for (var i = 0; i < unfiltered_options.length; i++) { - if (unfiltered_options[i].name == this.id) { - this.options.push(unfiltered_options[i]); - (function() { - var option = unfiltered_options[i]; - var index = count; - YAHOO.util.Event.on(option, 'click', function(e) { - this.setPageWithAnimation(this.pages[index]); - }, this, true); - }).call(this); - count++; + init() { + var table = document.getElementById(this.id); + + // get radio options + var unfiltered_options = document.getElementsByName(this.id); + this.options = []; + var count = 0; + for (var i = 0; i < unfiltered_options.length; i++) { + if (unfiltered_options[i].name == this.id) { + this.options.push(unfiltered_options[i]); + (function() { + var option = unfiltered_options[i]; + var index = count; + YAHOO.util.Event.on(option, 'click', function(e) { + this.setPageWithAnimation(this.pages[index]); + }, this, true); + }).call(this); + count++; + } } - } - // get pages - var tbody = YAHOO.util.Dom.getFirstChild(table); - var rows = YAHOO.util.Dom.getChildrenBy(tbody, function(n) { - return (YAHOO.util.Dom.hasClass(n, 'swat-radio-note-book-page-row')); - }); - - this.pages = []; - var page; - for (var i = 0; i < rows.length; i++) { - page = YAHOO.util.Dom.getFirstChild( - YAHOO.util.Dom.getNextSibling( - YAHOO.util.Dom.getFirstChild(rows[i]) - ) - ); + // get pages + var tbody = YAHOO.util.Dom.getFirstChild(table); + var rows = YAHOO.util.Dom.getChildrenBy(tbody, function(n) { + return (YAHOO.util.Dom.hasClass( + n, + 'swat-radio-note-book-page-row' + )); + }); + + this.pages = []; + var page; + for (var i = 0; i < rows.length; i++) { + page = YAHOO.util.Dom.getFirstChild( + YAHOO.util.Dom.getNextSibling( + YAHOO.util.Dom.getFirstChild(rows[i]) + ) + ); + + if (YAHOO.util.Dom.hasClass(page, 'selected')) { + this.current_page = page; + } - if (YAHOO.util.Dom.hasClass(page, 'selected')) { - this.current_page = page; - } + if (this.options[i].checked) { + this.current_page = page; + } else { + this.closePage(page); + } - if (this.options[i].checked) { - this.current_page = page; - } else { - this.closePage(page); + this.pages.push(page); } - - this.pages.push(page); } -}; - -SwatRadioNoteBook.prototype.setPage = function(page) -{ -}; -SwatRadioNoteBook.prototype.setPageWithAnimation = function(page) -{ - if (this.current_page == page) { - return; + setPage(page) { } - this.closePageWithAnimation(this.current_page); - this.openPageWithAnimation(page); - - this.current_page = page; -}; + setPageWithAnimation(page) { + if (this.current_page === page) { + return; + } -SwatRadioNoteBook.prototype.openPageWithAnimation = function(page) -{ - page.style.overflow = 'visible'; - page.style.height = '0'; - page.firstChild.style.visibility = 'visible'; - page.firstChild.style.height = 'auto'; + this.closePageWithAnimation(this.current_page); + this.openPageWithAnimation(page); - var region = YAHOO.util.Dom.getRegion(page.firstChild); - var height = region.height; + this.current_page = page; + } - var anim = new YAHOO.util.Anim( - page, - { 'height': { to: height } }, - SwatRadioNoteBook.SLIDE_DURATION, - YAHOO.util.Easing.easeIn - ); + openPageWithAnimation(page) { + page.style.overflow = 'visible'; + page.style.height = '0'; + page.firstChild.style.visibility = 'visible'; + page.firstChild.style.height = 'auto'; - anim.onComplete.subscribe(function() { - page.style.height = 'auto'; - this.restorePageFocusability(page); + var region = YAHOO.util.Dom.getRegion(page.firstChild); + var height = region.height; var anim = new YAHOO.util.Anim( page, - { opacity: { to: 1 } }, - SwatRadioNoteBook.FADE_DURATION, + { 'height': { to: height } }, + SwatRadioNoteBook.SLIDE_DURATION, YAHOO.util.Easing.easeIn ); + anim.onComplete.subscribe(function() { + page.style.height = 'auto'; + this.restorePageFocusability(page); + + var anim = new YAHOO.util.Anim( + page, + { opacity: { to: 1 } }, + SwatRadioNoteBook.FADE_DURATION, + YAHOO.util.Easing.easeIn + ); + + anim.animate(); + }, this, true); + anim.animate(); - }, this, true); - - anim.animate(); -}; - -SwatRadioNoteBook.prototype.closePage = function(page) -{ - YAHOO.util.Dom.setStyle(page, 'opacity', '0'); - page.style.overflow = 'hidden'; - page.style.height = '0'; - this.removePageFocusability(page); -}; - -SwatRadioNoteBook.prototype.closePageWithAnimation = function(page) -{ - var anim = new YAHOO.util.Anim( - page, - { opacity: { to: 0 } }, - SwatRadioNoteBook.FADE_DURATION, - YAHOO.util.Easing.easeOut - ); - - anim.onComplete.subscribe(function() { + } + closePage(page) { + YAHOO.util.Dom.setStyle(page, 'opacity', '0'); page.style.overflow = 'hidden'; + page.style.height = '0'; this.removePageFocusability(page); + }; + closePageWithAnimation(page) { var anim = new YAHOO.util.Anim( page, - { height: { to: 0 } }, - SwatRadioNoteBook.SLIDE_DURATION, + { opacity: { to: 0 } }, + SwatRadioNoteBook.FADE_DURATION, YAHOO.util.Easing.easeOut ); - anim.animate(); - }, this, true); + anim.onComplete.subscribe(function() { + page.style.overflow = 'hidden'; + this.removePageFocusability(page); - anim.animate(); -}; + var anim = new YAHOO.util.Anim( + page, + { height: { to: 0 } }, + SwatRadioNoteBook.SLIDE_DURATION, + YAHOO.util.Easing.easeOut + ); -SwatRadioNoteBook.prototype.removePageFocusability = function(page) -{ - var elements = YAHOO.util.Selector.query( - 'input, select, textarea, button, a, *[tabindex]', - page - ); + anim.animate(); + }, this, true); - for (var i = 0; i < elements.length; i++) { - if (elements[i].getAttribute('_' + this.id + '_tabindex') === null) { - var tabindex; + anim.animate(); + } - if ('hasAttribute' in elements[i]) { - tabindex = elements[i].getAttribute('tabindex'); - } else { - tabindex = elements[i].tabIndex; // for old IE - if (tabindex === 0) { - tabindex = null; + removePageFocusability(page) { + var elements = YAHOO.util.Selector.query( + 'input, select, textarea, button, a, *[tabindex]', + page + ); + + for (var i = 0; i < elements.length; i++) { + if (elements[i].getAttribute('_' + this.id + '_tabindex') === null) { + var tabindex; + + if ('hasAttribute' in elements[i]) { + tabindex = elements[i].getAttribute('tabindex'); + } else { + tabindex = elements[i].tabIndex; // for old IE + if (tabindex === 0) { + tabindex = null; + } } - } - elements[i]['_' + this.id + '_tabindex'] = tabindex; - elements[i].tabindex = -1; - elements[i].setAttribute('tabIndex', -1); // For old IE + elements[i]['_' + this.id + '_tabindex'] = tabindex; + elements[i].tabindex = -1; + elements[i].setAttribute('tabIndex', -1); // For old IE + } } } -}; - -SwatRadioNoteBook.prototype.restorePageFocusability = function(page) -{ - var elements = YAHOO.util.Selector.query( - 'input, select, textarea, button, a, *[tabindex]', - page - ); - - for (var i = 0; i < elements.length; i++) { - if (elements[i].getAttribute('_' + this.id + '_tabindex') !== null) { - var tabindex = elements[i]['_' + this.id + '_tabindex']; - if (tabindex === '' || tabindex === null) { - elements[i].removeAttribute('tabindex'); - elements[i].removeAttribute('tabIndex'); // For old IE - } else { - elements[i].tabindex = tabindex; - elements[i].setAttribute('tabIndex', tabindex); // For old IE + + restorePageFocusability(page) { + var elements = YAHOO.util.Selector.query( + 'input, select, textarea, button, a, *[tabindex]', + page + ); + + for (var i = 0; i < elements.length; i++) { + if (elements[i].getAttribute('_' + this.id + '_tabindex') !== null) { + var tabindex = elements[i]['_' + this.id + '_tabindex']; + if (tabindex === '' || tabindex === null) { + elements[i].removeAttribute('tabindex'); + elements[i].removeAttribute('tabIndex'); // For old IE + } else { + elements[i].tabindex = tabindex; + elements[i].setAttribute('tabIndex', tabindex); // For old IE + } + elements[i].removeAttribute('_' + this.id + '_tabindex'); } - elements[i].removeAttribute('_' + this.id + '_tabindex'); } } -}; +} + +SwatRadioNoteBook.FADE_DURATION = 0.25; +SwatRadioNoteBook.SLIDE_DURATION = 0.15; + +module.exports = SwatRadioNoteBook; diff --git a/www/javascript/swat-rating.js b/www/javascript/swat-rating.js index 0453d40c4..9910bb1e1 100644 --- a/www/javascript/swat-rating.js +++ b/www/javascript/swat-rating.js @@ -48,181 +48,174 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ +class SwatRating { + constructor(id, max_value) { + this.id = id; + this.max_value = max_value; + this.stars = []; + this.sensitive = true; -function SwatRating(id, max_value) -{ - this.id = id; - this.max_value = max_value; - this.stars = []; - this.sensitive = true; + YAHOO.util.Event.onDOMReady(this.init, this, true); + } - YAHOO.util.Event.onDOMReady(this.init, this, true); -} + init() { + var Dom = YAHOO.util.Dom; + var Event = YAHOO.util.Event; -SwatRating.prototype.init = function() -{ - var Dom = YAHOO.util.Dom; - var Event = YAHOO.util.Event; + this.flydown = document.getElementById(this.id + '_flydown'); + this.rating_div = document.getElementById(this.id); + this.sensitive = (!Dom.hasClass(this.rating_div, 'swat-insensitive')); - this.flydown = document.getElementById(this.id + '_flydown'); - this.rating_div = document.getElementById(this.id); - this.sensitive = (!Dom.hasClass(this.rating_div, 'swat-insensitive')); + Dom.setStyle(this.flydown, 'display', 'none'); - Dom.setStyle(this.flydown, 'display', 'none'); + var star_div = document.createElement('div'); + star_div.className = 'swat-rating-star-container'; - var star_div = document.createElement('div'); - star_div.className = 'swat-rating-star-container'; + for (var i = 1; i <= this.max_value; i++) { + var star = document.createElement('span'); + star.id = this.id + '_star' + i; + star.tabIndex = '0'; - for (var i = 1; i <= this.max_value; i++) { - var star = document.createElement('span'); - star.id = this.id + '_star' + i; - star.tabIndex = '0'; + Dom.addClass(star, 'swat-rating-star'); + if (i <= parseInt(this.flydown.value, 10)) { + Dom.addClass(star, 'swat-rating-selected'); + } - Dom.addClass(star, 'swat-rating-star'); - if (i <= parseInt(this.flydown.value, 10)) { - Dom.addClass(star, 'swat-rating-selected'); + star_div.appendChild(star); + + Event.on(star, 'focus', this.handleFocus, i, this); + Event.on(star, 'blur', this.handleBlur, i, this); + Event.on(star, 'mouseover', this.handleFocus, i, this); + Event.on(star, 'mouseout', this.handleBlur, this, true); + Event.on(star, 'click', this.handleClick, i, this); + Event.on(star, 'keypress', function(e, focus_star) { + if (Event.getCharCode(e) === 13 || + Event.getCharCode(e) === 32 + ) { + Event.preventDefault(e); + this.handleClick(e, focus_star); + } + }, i, this); + + this.stars.push(star); } - star_div.appendChild(star); - - Event.on(star, 'focus', this.handleFocus, i, this); - Event.on(star, 'blur', this.handleBlur, i, this); - Event.on(star, 'mouseover', this.handleFocus, i, this); - Event.on(star, 'mouseout', this.handleBlur, this, true); - Event.on(star, 'click', this.handleClick, i, this); - Event.on(star, 'keypress', function(e, focus_star) { - if (Event.getCharCode(e) == 13 || Event.getCharCode(e) == 32) { - Event.preventDefault(e); - this.handleClick(e, focus_star); - } - }, i, this); + var clear = document.createElement('div'); + clear.className = 'swat-rating-clear'; - this.stars.push(star); + this.rating_div.appendChild(star_div); + this.rating_div.appendChild(clear); } - var clear = document.createElement('div'); - clear.className = 'swat-rating-clear'; - - this.rating_div.appendChild(star_div); - this.rating_div.appendChild(clear); -}; + setSensitivity(sensitivity) { + var Dom = YAHOO.util.Dom; -SwatRating.prototype.setSensitivity = function(sensitivity) -{ - var Dom = YAHOO.util.Dom; - - if (sensitivity) { - Dom.removeClass(this.rating_div, 'swat-insensitive'); - this.sensitive = true; - } else { - Dom.addClass(this.rating_div, 'swat-insensitive'); - this.sensitive = false; - } -}; - -SwatRating.prototype.handleFocus = function(event, focus_star) -{ - if (!this.sensitive) { - return; + if (sensitivity) { + Dom.removeClass(this.rating_div, 'swat-insensitive'); + this.sensitive = true; + } else { + Dom.addClass(this.rating_div, 'swat-insensitive'); + this.sensitive = false; + } } - var Dom = YAHOO.util.Dom; - var Event = YAHOO.util.Event; + handleFocus(event, focus_star) { + if (!this.sensitive) { + return; + } - for (var i = 0; i < focus_star; i++) { - Dom.addClass(this.stars[i], 'swat-rating-hover'); - } -}; + var Dom = YAHOO.util.Dom; -SwatRating.prototype.handleBlur = function(event) -{ - var Dom = YAHOO.util.Dom; - var Event = YAHOO.util.Event; + for (var i = 0; i < focus_star; i++) { + Dom.addClass(this.stars[i], 'swat-rating-hover'); + } + }; - // code to handle movement away from the star - for (var i = 0; i < this.max_value; i++) { - Dom.removeClass(this.stars[i], 'swat-rating-hover'); - } -}; + handleBlur(event) { + var Dom = YAHOO.util.Dom; -SwatRating.prototype.handleClick = function(event, clicked_star) -{ - if (!this.sensitive) { - return; + // code to handle movement away from the star + for (var i = 0; i < this.max_value; i++) { + Dom.removeClass(this.stars[i], 'swat-rating-hover'); + } } - var Dom = YAHOO.util.Dom; - var Event = YAHOO.util.Event; + handleClick(event, clicked_star) { + if (!this.sensitive) { + return; + } - // reset 'on' style for each star - for (var i = 0; i < this.max_value; i++) { - Dom.removeClass(this.stars[i], 'swat-rating-selected'); - } + var Dom = YAHOO.util.Dom; - // if you click on the current rating, it sets the rating to empty - if (this.flydown.value === clicked_star.toString()) { - this.flydown.value = ''; + // reset 'on' style for each star for (var i = 0; i < this.max_value; i++) { - Dom.removeClass(this.stars[i], 'swat-rating-hover'); + Dom.removeClass(this.stars[i], 'swat-rating-selected'); } - return; - } - // this will set the current value of the flydown - for (var i = 0; i < this.flydown.childNodes.length; i++) { - var option = this.flydown.childNodes[i]; - if (option.value == clicked_star.toString()) { - this.flydown.value = clicked_star; - break; + // if you click on the current rating, it sets the rating to empty + if (this.flydown.value === clicked_star.toString()) { + this.flydown.value = ''; + for (var i = 0; i < this.max_value; i++) { + Dom.removeClass(this.stars[i], 'swat-rating-hover'); + } + return; } - } - // cycle through stars - for (var i = 0; i < clicked_star; i++) { - Dom.addClass(this.stars[i], 'swat-rating-selected'); - } -}; - -SwatRating.prototype.getValue = function() -{ - var value = null; + // this will set the current value of the flydown + for (var i = 0; i < this.flydown.childNodes.length; i++) { + var option = this.flydown.childNodes[i]; + if (option.value === clicked_star.toString()) { + this.flydown.value = clicked_star; + break; + } + } - var index = this.flydown.value; - if (index !== null && index !== '') { - value = this.flydown.options[index].value; + // cycle through stars + for (var i = 0; i < clicked_star; i++) { + Dom.addClass(this.stars[i], 'swat-rating-selected'); + } } - return value; -}; + getValue() { + var value = null; -SwatRating.prototype.setValue = function(rating) -{ - var Dom = YAHOO.util.Dom; - var Event = YAHOO.util.Event; + var index = this.flydown.value; + if (index !== null && index !== '') { + value = this.flydown.options[index].value; + } - // clear 'on' style for each star - for (var i = 0; i < this.max_value; i++) { - Dom.removeClass(this.stars[i], 'swat-rating-selected'); + return value; } - if (rating === '' || rating === null) { - this.flydown.value = ''; + setValue(rating) { + var Dom = YAHOO.util.Dom; + + // clear 'on' style for each star for (var i = 0; i < this.max_value; i++) { - Dom.removeClass(this.stars[i], 'swat-rating-hover'); + Dom.removeClass(this.stars[i], 'swat-rating-selected'); } - } else { - // set the current value of the flydown - for (var i = 0; i < this.flydown.options.length; i++) { - var option = this.flydown.options[i]; - if (option.value == rating) { - this.flydown.value = i; - break; + + if (rating === '' || rating === null) { + this.flydown.value = ''; + for (var i = 0; i < this.max_value; i++) { + Dom.removeClass(this.stars[i], 'swat-rating-hover'); + } + } else { + // set the current value of the flydown + for (var i = 0; i < this.flydown.options.length; i++) { + var option = this.flydown.options[i]; + if (option.value === rating) { + this.flydown.value = i; + break; + } } - } - // set 'on' style for each star - for (var i = 0; i < rating; i++) { - Dom.addClass(this.stars[i], 'swat-rating-selected'); + // set 'on' style for each star + for (var i = 0; i < rating; i++) { + Dom.addClass(this.stars[i], 'swat-rating-selected'); + } } } -}; +} + +module.exports = SwatRating; diff --git a/www/javascript/swat-search-entry.js b/www/javascript/swat-search-entry.js index a7b730a3c..f9b85406e 100644 --- a/www/javascript/swat-search-entry.js +++ b/www/javascript/swat-search-entry.js @@ -1,174 +1,215 @@ -function SwatSearchEntry(id) -{ - this.id = id; - this.input = document.getElementById(this.id); - this.input._search_entry = this; - - var labels = document.getElementsByTagName('label'); - var label = null; - - for (var i = labels.length - 1; i >= 0; i--) { - if (labels[i].htmlFor == this.id) { - label = labels[i]; - break; +class SwatSearchEntry { + constructor(id) { + this.id = id; + this.input = document.getElementById(this.id); + this.input._search_entry = this; + + var labels = document.getElementsByTagName('label'); + var label = null; + + for (var i = labels.length - 1; i >= 0; i--) { + if (labels[i].htmlFor == this.id) { + label = labels[i]; + break; + } } - } - - if (label !== null) { - this.label_text = - (label.innerText) ? label.innerText : label.textContent; - this.input_name = this.input.getAttribute('name'); - this.input_value = this.input.value; - - label.style.display = 'none'; + if (label !== null) { + this.label_text = (label.innerText) + ? label.innerText + : label.textContent; + + this.input_name = this.input.getAttribute('name'); + this.input_value = this.input.value; + + label.style.display = 'none'; + + YAHOO.util.Event.addListener( + this.input, + 'focus', + this.handleFocus, + this, + true + ); + YAHOO.util.Event.addListener( + this.input, + 'blur', + this.handleBlur, + this, + true + ); + + YAHOO.util.Event.onDOMReady(this.init, this, true); + } + } - YAHOO.util.Event.addListener(this.input, 'focus', this.handleFocus, - this, true); + init() { + if (this.input.value === '' && !this.input._focused) { + this.showLabelText(); + } else { + this.hideLabelText(); + } + } - YAHOO.util.Event.addListener(this.input, 'blur', this.handleBlur, - this, true); + handleKeyDown(e) { + // prevent esc from undoing the clearing of label text in Firefox + if (e.keyCode === 27) { + this.input.value = ''; + } - YAHOO.util.Event.onDOMReady(this.init, this, true); + YAHOO.util.Event.removeListener(this.input, 'keypress', this.handleKeyDown); } -} -SwatSearchEntry.prototype.init = function() -{ - if (this.input.value === '' && !this.input._focused) { - this.showLabelText(); - } else { + handleFocus(e) { this.hideLabelText(); - } -}; + this.input.focus(); // IE hack to focus -SwatSearchEntry.prototype.handleKeyDown = function(e) -{ - // prevent esc from undoing the clearing of label text in Firefox - if (e.keyCode == 27) { - this.input.value = ''; + // hack to enable initialization when focused + this.input._focused = true; } - YAHOO.util.Event.removeListener(this.input, 'keypress', this.handleKeyDown); -}; - -SwatSearchEntry.prototype.handleFocus = function(e) -{ - this.hideLabelText(); - this.input.focus(); // IE hack to focus - - // hack to enable initialization when focused - this.input._focused = true; -}; - -SwatSearchEntry.prototype.handleBlur = function(e) -{ - if (this.input.value === '') - this.showLabelText(); - - YAHOO.util.Event.removeListener(this.input, 'keypress', this.handleKeyDown); - - // hack to enable initialization when focused - this.input._focused = false; -}; - -SwatSearchEntry.prototype.showLabelText = function() -{ - if (this.isLabelTextShown()) - return; - - YAHOO.util.Dom.addClass(this.input, 'swat-search-entry-empty'); - - if (this.input.hasAttribute) { - this.input.removeAttribute('name'); - } else { - // IE can't set name attribute at runtime and doesn't have - // hasAttribute method. Unbelievable but it's true. - if (this.input.name) { - // remove name attribute - var outer_html = this.input.outerHTML.replace( - 'name=' + this.input_name, ''); - - var old_input = this.input; - this.input = document.createElement(outer_html); - - // replace old input with new one - old_input.parentNode.insertBefore(this.input, old_input); - - // prevent IE memory leaks - YAHOO.util.Event.purgeElement(old_input); - old_input.parentNode.removeChild(old_input); - - // add event handlers back - YAHOO.util.Event.addListener(this.input, 'focus', this.handleFocus, - this, true); - - YAHOO.util.Event.addListener(this.input, 'blur', this.handleBlur, - this, true); + handleBlur(e) { + if (this.input.value === '') { + this.showLabelText(); } - } - this.input_value = this.input.value; - this.input.value = this.label_text; -}; + YAHOO.util.Event.removeListener( + this.input, + 'keypress', + this.handleKeyDown + ); -SwatSearchEntry.prototype.isLabelTextShown = function() -{ - if (this.input.hasAttribute) { - var shown = (!this.input.hasAttribute('name')); - } else { - var shown = (!this.input.getAttribute('name')); + // hack to enable initialization when focused + this.input._focused = false; } - return shown; -}; - -SwatSearchEntry.prototype.hideLabelText = function() -{ - if (!this.isLabelTextShown()) - return; - - var hide = false; + showLabelText() { + if (this.isLabelTextShown()) { + return; + } - if (this.input.hasAttribute) { - if (!this.input.hasAttribute('name')) { - this.input.setAttribute('name', this.input_name); - hide = true; + YAHOO.util.Dom.addClass(this.input, 'swat-search-entry-empty'); + + if (this.input.hasAttribute) { + this.input.removeAttribute('name'); + } else { + // IE can't set name attribute at runtime and doesn't have + // hasAttribute method. Unbelievable but it's true. + if (this.input.name) { + // remove name attribute + var outer_html = this.input.outerHTML.replace( + 'name=' + this.input_name, + '' + ); + + var old_input = this.input; + this.input = document.createElement(outer_html); + + // replace old input with new one + old_input.parentNode.insertBefore(this.input, old_input); + + // prevent IE memory leaks + YAHOO.util.Event.purgeElement(old_input); + old_input.parentNode.removeChild(old_input); + + // add event handlers back + YAHOO.util.Event.addListener( + this.input, + 'focus', + this.handleFocus, + this, + true + ); + YAHOO.util.Event.addListener( + this.input, + 'blur', + this.handleBlur, + this, + true + ); + } } - } else { - // IE hack - seriously, unbelievable. - if (!this.input.getAttribute('name')) { - // we want the same input with a name attribute - var outer_html = this.input.outerHTML.replace( - 'id=' + this.id, - 'id=' + this.id + ' name=' + this.input_name); + this.input_value = this.input.value; + this.input.value = this.label_text; + } - var old_input = this.input; - this.input = document.createElement(outer_html); + isLabelTextShown() { + var shown; - // add event handlers back - YAHOO.util.Event.addListener(this.input, 'focus', this.handleFocus, - this, true); + if (this.input.hasAttribute) { + shown = (!this.input.hasAttribute('name')); + } else { + shown = (!this.input.getAttribute('name')); + } - YAHOO.util.Event.addListener(this.input, 'blur', this.handleBlur, - this, true); + return shown; + } - // replace old input with new one - old_input.parentNode.insertBefore(this.input, old_input); + hideLabelText() { + if (!this.isLabelTextShown()) { + return; + } - // prevent IE memory leaks - YAHOO.util.Event.purgeElement(old_input); - old_input.parentNode.removeChild(old_input); + var hide = false; + + if (this.input.hasAttribute) { + if (!this.input.hasAttribute('name')) { + this.input.setAttribute('name', this.input_name); + hide = true; + } + } else { + // IE hack - seriously, unbelievable. + if (!this.input.getAttribute('name')) { + + // we want the same input with a name attribute + var outer_html = this.input.outerHTML.replace( + 'id=' + this.id, + 'id=' + this.id + ' name=' + this.input_name + ); + + var old_input = this.input; + this.input = document.createElement(outer_html); + + // add event handlers back + YAHOO.util.Event.addListener( + this.input, + 'focus', + this.handleFocus, + this, + true + ); + YAHOO.util.Event.addListener( + this.input, + 'blur', + this.handleBlur, + this, + true + ); + + // replace old input with new one + old_input.parentNode.insertBefore(this.input, old_input); + + // prevent IE memory leaks + YAHOO.util.Event.purgeElement(old_input); + old_input.parentNode.removeChild(old_input); + + hide = true; + } + } - hide = true; + if (hide) { + this.input.value = this.input_value; + YAHOO.util.Dom.removeClass(this.input, 'swat-search-entry-empty'); + YAHOO.util.Event.addListener( + this.input, + 'keypress', + this.handleKeyDown, + this, + true + ); } } +} - if (hide) { - this.input.value = this.input_value; - YAHOO.util.Dom.removeClass(this.input, 'swat-search-entry-empty'); - YAHOO.util.Event.addListener(this.input, 'keypress', - this.handleKeyDown, this, true); - } -}; +module.exports = SwatSearchEntry; diff --git a/www/javascript/swat-simple-color-entry.js b/www/javascript/swat-simple-color-entry.js index e064db2c1..9baef6c1a 100644 --- a/www/javascript/swat-simple-color-entry.js +++ b/www/javascript/swat-simple-color-entry.js @@ -1,326 +1,313 @@ -// {{{ function SwatSimpleColorEntry - -/** - * Simple color entry widget - * - * @param string id - * @param Array colors - * @param string none_option_title - * - * @copyright 2005-2016 silverorange - */ -function SwatSimpleColorEntry(id, colors, none_option_title) -{ - SwatSimpleColorEntry.superclass.constructor.call(this, id); - - this.colors = colors; - this.none_option_title = none_option_title; - - // this tries to make a square palette - this.columns = Math.ceil(Math.sqrt(this.colors.length)); - - this.current_color = null; - this.colorChangeEvent = new YAHOO.util.CustomEvent('colorChange'); -} - -// }}} -// {{{ YAHOO.lang.extend(SwatSimpleColorEntry, SwatAbstractOverlay) - -YAHOO.lang.extend(SwatSimpleColorEntry, SwatAbstractOverlay, { -// {{{ init - -init: function() -{ - this.hex_input_tag = document.createElement('input'); - this.hex_input_tag.type = 'text'; - this.hex_input_tag.id = this.id + '_hex_color'; - this.hex_input_tag.size = 6; - - YAHOO.util.Event.on(this.hex_input_tag, 'change', - this.handleInputChange, this, true); - - YAHOO.util.Event.on(this.hex_input_tag, 'keyup', - this.handleInputChange, this, true); - - SwatSimpleColorEntry.superclass.init.call(this); - - this.input_tag = document.getElementById(this.id + '_value'); - this.setColor(this.input_tag.value); -}, +const SwatAbstractOverlay = require('./swat-abstract-overlay'); + +class SwatSimpleColorEntry extends SwatAbstractOverlay { + /** + * Simple color entry widget + * + * @param string id + * @param Array colors + * @param string none_option_title + * + * @copyright 2005-2016 silverorange + */ + constructor(id, colors, none_option_title) { + super(id); + + this.colors = colors; + this.none_option_title = none_option_title; + + // this tries to make a square palette + this.columns = Math.ceil(Math.sqrt(this.colors.length)); + + this.current_color = null; + this.colorChangeEvent = new YAHOO.util.CustomEvent('colorChange'); + } -// }}} -// {{{ getBodyContent + init() { + this.hex_input_tag = document.createElement('input'); + this.hex_input_tag.type = 'text'; + this.hex_input_tag.id = this.id + '_hex_color'; + this.hex_input_tag.size = 6; -getBodyContent: function() -{ - var table = document.createElement('table'); - table.className = 'swat-simple-color-entry-table'; - table.cellSpacing = '1'; + YAHOO.util.Event.on(this.hex_input_tag, 'change', + this.handleInputChange, this, true); - var tbody = document.createElement('tbody'); + YAHOO.util.Event.on(this.hex_input_tag, 'keyup', + this.handleInputChange, this, true); - if (this.colors.length % this.columns === 0) - var num_cells = this.colors.length; - else - var num_cells = this.colors.length + - (this.columns - (this.colors.length % this.columns)); + SwatSimpleColorEntry.superclass.init.call(this); - var trow; - var tcell; - var anchor; - var text; + this.input_tag = document.getElementById(this.id + '_value'); + this.setColor(this.input_tag.value); + } - if (this.none_option_title !== null) { - trow = document.createElement('tr'); - tcell = document.createElement('td'); - tcell.id = this.id + '_palette_null'; - tcell.colSpan = this.columns; - YAHOO.util.Dom.addClass(tcell, - 'swat-simple-color-entry-palette-blank'); + getBodyContent() { + var table = document.createElement('table'); + table.className = 'swat-simple-color-entry-table'; + table.cellSpacing = '1'; - text = document.createTextNode(this.none_option_title); + var tbody = document.createElement('tbody'); - anchor = document.createElement('a'); - anchor.href = '#'; - anchor.appendChild(text); - tcell.appendChild(anchor); - trow.appendChild(tcell); - tbody.appendChild(trow); + if (this.colors.length % this.columns === 0) { + var num_cells = this.colors.length; + } else { + var num_cells = this.colors.length + + (this.columns - (this.colors.length % this.columns)); + } - YAHOO.util.Event.addListener(anchor, 'click', this.selectNull, - this, true); - } + var trow; + var tcell; + var anchor; + var text; - for (var i = 0; i < num_cells; i++) { - if (i % this.columns === 0) + if (this.none_option_title !== null) { trow = document.createElement('tr'); + tcell = document.createElement('td'); + tcell.id = this.id + '_palette_null'; + tcell.colSpan = this.columns; + YAHOO.util.Dom.addClass( + tcell, + 'swat-simple-color-entry-palette-blank' + ); - tcell = document.createElement('td'); - text = document.createTextNode(' '); // non-breaking UTF-8 space - - if (i < this.colors.length) { - tcell.id = this.id + '_palette_' + i; - tcell.style.background = '#' + this.colors[i]; + text = document.createTextNode(this.none_option_title); anchor = document.createElement('a'); anchor.href = '#'; anchor.appendChild(text); - - YAHOO.util.Event.addListener(anchor, 'click', this.selectColor, - this, true); - tcell.appendChild(anchor); - } else { - YAHOO.util.Dom.addClass(tcell, - 'swat-simple-color-entry-palette-blank'); - - tcell.appendChild(text); - } - - trow.appendChild(tcell); - - if ((i + 1) % this.columns === 0) + trow.appendChild(tcell); tbody.appendChild(trow); - } - - table.appendChild(tbody); - var div_tag = document.createElement('div'); - div_tag.appendChild(table); - return div_tag; -}, + YAHOO.util.Event.addListener( + anchor, + 'click', + this.selectNull, + this, + true + ); + } -// }}} -// {{{ getToggleButton + for (var i = 0; i < num_cells; i++) { + if (i % this.columns === 0) { + trow = document.createElement('tr'); + } -getToggleButton: function() -{ - var toggle_button = SwatSimpleColorEntry.superclass.getToggleButton.call(this); + tcell = document.createElement('td'); + text = document.createTextNode(' '); // non-breaking UTF-8 space + + if (i < this.colors.length) { + tcell.id = this.id + '_palette_' + i; + tcell.style.background = '#' + this.colors[i]; + + anchor = document.createElement('a'); + anchor.href = '#'; + anchor.appendChild(text); + + YAHOO.util.Event.addListener( + anchor, + 'click', + this.selectColor, + this, + true + ); + + tcell.appendChild(anchor); + } else { + YAHOO.util.Dom.addClass( + tcell, + 'swat-simple-color-entry-palette-blank' + ); + tcell.appendChild(text); + } - this.toggle_button_content = document.createElement('div'); - this.toggle_button_content.className = 'swat-overlay-toggle-button-content'; - // the following string is a UTF-8 encoded non breaking space - this.toggle_button_content.appendChild(document.createTextNode(' ')); - toggle_button.appendChild(this.toggle_button_content); + trow.appendChild(tcell); - return toggle_button; -}, + if ((i + 1) % this.columns === 0) { + tbody.appendChild(trow); + } + } -// }}} -// {{{ getFooter + table.appendChild(tbody); -getFooter: function() -{ - var title = document.createTextNode('#'); + var div_tag = document.createElement('div'); + div_tag.appendChild(table); + return div_tag; + } - var label_tag = document.createElement('label'); - label_tag.htmlFor = this.id + '_hex_color'; - label_tag.appendChild(title); + getToggleButton() { + var toggle_button = super.getToggleButton(); - var hex_div = document.createElement('div'); - hex_div.className = 'swat-simple-color-entry-palette-hex-color'; - hex_div.appendChild(label_tag); - hex_div.appendChild(this.hex_input_tag); + this.toggle_button_content = document.createElement('div'); + this.toggle_button_content.className = + 'swat-overlay-toggle-button-content'; - var footer = SwatSimpleColorEntry.superclass.getFooter.call(this); - footer.appendChild(hex_div); - return footer; -} + // the following string is a UTF-8 encoded non breaking space + this.toggle_button_content.appendChild(document.createTextNode(' ')); + toggle_button.appendChild(this.toggle_button_content); -// }}} + return toggle_button; + } -}); + getFooter() { + var title = document.createTextNode('#'); -// }}} -// {{{ SwatSimpleColorEntry.prototype.handleInputChange + var label_tag = document.createElement('label'); + label_tag.htmlFor = this.id + '_hex_color'; + label_tag.appendChild(title); -SwatSimpleColorEntry.prototype.handleInputChange = function() -{ - var color = this.hex_input_tag.value; + var hex_div = document.createElement('div'); + hex_div.className = 'swat-simple-color-entry-palette-hex-color'; + hex_div.appendChild(label_tag); + hex_div.appendChild(this.hex_input_tag); - if (color.charAt(0) === '#') { - color = color.slice(1); + var footer = super.getFooter(); + footer.appendChild(hex_div); + return footer; } - if (color.length === 3) { - var hex3 = /^[0-9a-f]{3}$/i; - if (!hex3.test(color)) { - color = null; + handleInputChange() { + var color = this.hex_input_tag.value; + + if (color.charAt(0) === '#') { + color = color.slice(1); } - } else if (color.length === 6) { - var hex6 = /^[0-9a-f]{6}$/i; - if (!hex6.test(color)) { + + if (color.length === 3) { + var hex3 = /^[0-9a-f]{3}$/i; + if (!hex3.test(color)) { + color = null; + } + } else if (color.length === 6) { + var hex6 = /^[0-9a-f]{6}$/i; + if (!hex6.test(color)) { + color = null; + } + } else { color = null; } - } else { - color = null; - } - if (color) { - this.setColor(color); - } -}; - -// }}} -// {{{ SwatSimpleColorEntry.prototype.setColor - -/** - * Sets the value of the color entry input tag to the selected color and - * highlights the selected color - * - * @param number color the hex value of the color - */ -SwatSimpleColorEntry.prototype.setColor = function(color) -{ - if (!/^([0-9a-f]{3}){1,2}$/i.test(color)) { - color = null; + if (color) { + this.setColor(color); + } } - var changed = (this.current_color != color); - - if (changed) { - if (color === null) { - // IE fix, it sets string 'null' otherwise - this.input_tag.value = ''; - } else { - this.input_tag.value = color; + /** + * Sets the value of the color entry input tag to the selected color and + * highlights the selected color + * + * @param number color the hex value of the color + */ + setColor(color) { + if (!/^([0-9a-f]{3}){1,2}$/i.test(color)) { + color = null; } - if (color === null) { - if (this.hex_input_tag.value !== '') { + var changed = (this.current_color != color); + + if (changed) { + if (color === null) { // IE fix, it sets string 'null' otherwise - this.hex_input_tag.value = ''; + this.input_tag.value = ''; + } else { + this.input_tag.value = color; } - YAHOO.util.Dom.setStyle(this.toggle_button_content, - 'background', 'url(packages/swat/images/color-entry-null.png)'); - } else { - if (this.hex_input_tag.value !== color) { - this.hex_input_tag.value = color; + + if (color === null) { + if (this.hex_input_tag.value !== '') { + // IE fix, it sets string 'null' otherwise + this.hex_input_tag.value = ''; + } + YAHOO.util.Dom.setStyle( + this.toggle_button_content, + 'background', + 'url(packages/swat/images/color-entry-null.png)' + ); + } else { + if (this.hex_input_tag.value !== color) { + this.hex_input_tag.value = color; + } + YAHOO.util.Dom.setStyle(this.toggle_button_content, + 'background', '#' + color); } - YAHOO.util.Dom.setStyle(this.toggle_button_content, - 'background', '#' + color); - } - this.current_color = color; + this.current_color = color; - if (color === null) { - this.colorChangeEvent.fire(null); - } else { - this.colorChangeEvent.fire('#' + color); - } + if (color === null) { + this.colorChangeEvent.fire(null); + } else { + this.colorChangeEvent.fire('#' + color); + } - this.highlightPaletteEntry(color); - } -}; - -// }}} -// {{{ SwatSimpleColorEntry.prototype.selectNull - -/** - * Event handler that sets the color to null - * - * @param Event the event that triggered this select. - */ -SwatSimpleColorEntry.prototype.selectNull = function(e) -{ - YAHOO.util.Event.preventDefault(e); - this.setColor(null); -}; - -// }}} -// {{{ SwatSimpleColorEntry.prototype.selectColor - -/** - * Event handler that sets the color to the selected color - * - * @param Event the event that triggered this select. - */ -SwatSimpleColorEntry.prototype.selectColor = function(event) -{ - YAHOO.util.Event.preventDefault(event); - var cell = YAHOO.util.Event.getTarget(event); - var color_index = cell.parentNode.id.split('_palette_')[1]; - - this.setColor(this.colors[color_index]); -}; - -// }}} -// {{{ SwatSimpleColorEntry.prototype.highlightPaletteEntry - -/** - * Highlights a pallete entry - * - * @param number color the hex value of the color - */ -SwatSimpleColorEntry.prototype.highlightPaletteEntry = function(color) -{ - if (this.none_option_title !== null) { - var null_entry = document.getElementById(this.id + '_palette_null'); - - if (color === null) { - YAHOO.util.Dom.addClass(null_entry, - 'swat-simple-color-entry-palette-selected'); - } else { - YAHOO.util.Dom.removeClass(null_entry, - 'swat-simple-color-entry-palette-selected'); + this.highlightPaletteEntry(color); } } - for (var i = 0; i < this.colors.length; i++) { - var palette_entry = - document.getElementById(this.id + '_palette_' + i); + /** + * Event handler that sets the color to null + * + * @param Event the event that triggered this select. + */ + selectNull(e) { + YAHOO.util.Event.preventDefault(e); + this.setColor(null); + } - if (this.current_color !== null && - this.colors[i].toLowerCase() == - this.current_color.toLowerCase()) { + /** + * Event handler that sets the color to the selected color + * + * @param Event the event that triggered this select. + */ + selectColor(event) { + YAHOO.util.Event.preventDefault(event); + var cell = YAHOO.util.Event.getTarget(event); + var color_index = cell.parentNode.id.split('_palette_')[1]; + + this.setColor(this.colors[color_index]); + } - YAHOO.util.Dom.addClass(palette_entry, - 'swat-simple-color-entry-palette-selected'); - } else { - YAHOO.util.Dom.removeClass(palette_entry, - 'swat-simple-color-entry-palette-selected'); + /** + * Highlights a pallete entry + * + * @param number color the hex value of the color + */ + highlightPaletteEntry(color) { + if (this.none_option_title !== null) { + var null_entry = document.getElementById(this.id + '_palette_null'); + + if (color === null) { + YAHOO.util.Dom.addClass( + null_entry, + 'swat-simple-color-entry-palette-selected' + ); + } else { + YAHOO.util.Dom.removeClass( + null_entry, + 'swat-simple-color-entry-palette-selected' + ); + } + } + + for (var i = 0; i < this.colors.length; i++) { + var palette_entry = + document.getElementById(this.id + '_palette_' + i); + + if (this.current_color !== null && + this.colors[i].toLowerCase() === + this.current_color.toLowerCase() + ) { + YAHOO.util.Dom.addClass( + palette_entry, + 'swat-simple-color-entry-palette-selected' + ); + } else { + YAHOO.util.Dom.removeClass( + palette_entry, + 'swat-simple-color-entry-palette-selected' + ); + } } } -}; +} -// }}} +module.exports = SwatSimpleColorEntry; diff --git a/www/javascript/swat-table-view-input-row.js b/www/javascript/swat-table-view-input-row.js index 4300137df..9a9e757ca 100644 --- a/www/javascript/swat-table-view-input-row.js +++ b/www/javascript/swat-table-view-input-row.js @@ -5,46 +5,191 @@ * @copyright 2004-2016 silverorange * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 */ +class SwatTableViewInputRow { + /** + * A table view row that can add an arbitrary number of data entry rows + * + * @param String id the identifier of this row. + * @param String row_string the XML string to use when inserting a new row. The + * XML string can contain '%s' placeholders. Before + * a new row is added, the placeholders are replaced + * with the new row index. + */ + constructor(id, row_string) { + this.id = id; -/** - * A table view row that can add an arbitrary number of data entry rows - * - * @param String id the identifier of this row. - * @param String row_string the XML string to use when inserting a new row. The - * XML string can contain '%s' placeholders. Before - * a new row is added, the placeholders are replaced - * with the new row index. - */ -function SwatTableViewInputRow(id, row_string) -{ - this.id = id; + // decode string + row_string = row_string.replace(/</g, '<').replace(/>/g, '>'); + row_string = row_string.replace(/"/g, '"').replace(/&/g, '&'); + + /* + * Pack row string in an XHTML document + * + * We purposly do not specify a DTD here as Internet Explorer is too slow + * when given a DTD. The XML string is encoded in UTF-8 with no special + * entities at this point. + */ + this.row_string = "\n" + + '' + + 'row' + + row_string + + '
'; + + this.enter_row = document.getElementById(this.id + '_enter_row'); + + // get table node belonging to the enter row + this.table = this.enter_row; + while (this.table.nodeName.toLowerCase() !== 'table') { + this.table = this.table.parentNode; + } - // decode string - row_string = row_string.replace(/</g, '<').replace(/>/g, '>'); - row_string = row_string.replace(/"/g, '"').replace(/&/g, '&'); + this.replicators = null; + this.replicators_input = null; + } - /* - * Pack row string in an XHTML document + /** + * Initializes the replicator array * - * We purposly do not specify a DTD here as Internet Explorer is too slow - * when given a DTD. The XML string is encoded in UTF-8 with no special - * entities at this point. + * @return boolean true if the replicators were successfully initialized and + * false if they were not. */ - this.row_string = "\n" + - '' + - 'row' + - row_string + - '
'; + initReplicators() { + if (this.replicators === null) { + this.replicators_input = document.getElementsByName( + this.id + '_replicators' + )[0]; + + if (this.replicators_input === null) { + return false; + } + + if (this.replicators_input.value === '') { + this.replicators = []; + } else { + this.replicators = this.replicators_input.value.split(','); + } + } + return true; + } + + /** + * Adds a new data row to the table + */ + addRow() { + if (!this.initReplicators()) { + return; + } + + var replicator_id; + if (this.replicators.length > 0) { + replicator_id = (parseInt( + this.replicators[this.replicators.length - 1], + 10 + ) + 1).toString(); + } else { + replicator_id = '0'; + } - this.enter_row = document.getElementById(this.id + '_enter_row'); + this.replicators.push(replicator_id); + this.replicators_input.value = this.replicators.join(','); + + var document_string = this.row_string.replace(/%s/g, replicator_id); + var dom = SwatTableViewInputRow.parser.loadXML(document_string); + var source_tr = dom.documentElement.getElementsByTagName('tr')[0]; + + if (document.importNode && !SwatTableViewInputRow.is_webkit) { + try { + var dest_tr = document.importNode(source_tr, true); + this.enter_row.parentNode.insertBefore(dest_tr, this.enter_row); + } catch (ex) { + /* + * IE9 specific code. IE9 claims to support importNode, but fails + * when it is called. + */ + var dest_tr = this.table.insertRow(this.enter_row.rowIndex); + SwatTableViewInputRow_parseTableRow(source_tr, dest_tr); + } + } else { + /* + * Internet Explorer and Safari specific code + * + * Uses the table object model instead of the DOM. IE does not + * implement importNode() and Safari's importNode() implementation is + * broken. + */ + var dest_tr = this.table.insertRow(this.enter_row.rowIndex); + SwatTableViewInputRow_parseTableRow(source_tr, dest_tr); + } + + dest_tr.className = 'swat-table-view-input-row'; + dest_tr.id = this.id + '_row_' + replicator_id; + + var node = dest_tr; + var dest_color = 'transparent'; + while (dest_color == 'transparent' && node) { + dest_color = YAHOO.util.Dom.getStyle(node, 'background-color'); + node = node.parentNode; + } + if (dest_color == 'transparent') { + dest_color = '#ffffff'; + } + + var animation = new YAHOO.util.ColorAnim( + dest_tr, + { backgroundColor: { from: '#fffbc9', to: dest_color } }, + 1, + YAHOO.util.Easing.easeOut + ); - // get table node belonging to the enter row - this.table = this.enter_row; - while (this.table.nodeName.toLowerCase() != 'table') - this.table = this.table.parentNode; + animation.animate(); - this.replicators = null; - this.replicators_input = null; + /* + * Run scripts + * + * A better way to do this might be to remove the script nodes from the + * document and then run the scripts. This way we can ensure the scripts + * are only run once. + */ + var scripts = dom.documentElement.getElementsByTagName('script'); + for (var i = 0; i < scripts.length; i++) { + if (scripts[0].getAttribute('type') === 'text/javascript' && + scripts[0].childNodes.length > 0 + ) { + eval(scripts[i].firstChild.nodeValue); + } + } + } + + /** + * Removes a data row from the table + */ + removeRow(replicator_id) { + if (!this.initReplicators()) { + return; + } + + // remove replicator_id from replicators array + var replicator_index = -1; + for (var i = 0; i < this.replicators.length; i++) { + if (this.replicators[i] == replicator_id) { + replicator_index = i; + break; + } + } + if (replicator_index != -1) { + this.replicators.splice(replicator_index, 1); + this.replicators_input.value = this.replicators.join(','); + } + + // remove row from document + var row_id = this.id + '_row_' + replicator_id; + var row = document.getElementById(row_id); + if (row && row.parentNode !== null) { + var removed_row = row.parentNode.removeChild(row); + delete removed_row; + } + } } /** @@ -91,7 +236,7 @@ function SwatTableViewInputRow_getXMLParser() }; } - if (parser === null && typeof DOMParser != 'undefined') { + if (parser === null && typeof DOMParser !== 'undefined') { /* * Mozilla, Safari and Opera have a proprietary DOMParser() * class. @@ -176,134 +321,4 @@ if (!document.importNode || SwatTableViewInputRow.is_webkit) { } } -/** - * Initializes the replicator array - * - * @return boolean true if the replicators were successfully initialized and - * false if they were not. - */ -SwatTableViewInputRow.prototype.initReplicators = function() -{ - if (this.replicators === null) { - this.replicators_input = document.getElementsByName(this.id + - '_replicators')[0]; - - if (this.replicators_input === null) - return false; - - if (this.replicators_input.value === '') - this.replicators = []; - else - this.replicators = this.replicators_input.value.split(','); - } - return true; -}; - -/** - * Adds a new data row to the table - */ -SwatTableViewInputRow.prototype.addRow = function() -{ - if (!this.initReplicators()) - return; - - var replicator_id; - if (this.replicators.length > 0) - replicator_id = (parseInt( - this.replicators[this.replicators.length - 1]) + 1).toString(); - else - replicator_id = '0'; - - this.replicators.push(replicator_id); - this.replicators_input.value = this.replicators.join(','); - - var document_string = this.row_string.replace(/%s/g, replicator_id); - var dom = SwatTableViewInputRow.parser.loadXML(document_string); - var source_tr = dom.documentElement.getElementsByTagName('tr')[0]; - - if (document.importNode && !SwatTableViewInputRow.is_webkit) { - try { - var dest_tr = document.importNode(source_tr, true); - this.enter_row.parentNode.insertBefore(dest_tr, this.enter_row); - } catch (ex) { - /* - * IE9 specific code. IE9 claims to support importNode, but fails - * when it is called. - */ - var dest_tr = this.table.insertRow(this.enter_row.rowIndex); - SwatTableViewInputRow_parseTableRow(source_tr, dest_tr); - } - } else { - /* - * Internet Explorer and Safari specific code - * - * Uses the table object model instead of the DOM. IE does not - * implement importNode() and Safari's importNode() implementation is - * broken. - */ - var dest_tr = this.table.insertRow(this.enter_row.rowIndex); - SwatTableViewInputRow_parseTableRow(source_tr, dest_tr); - } - - dest_tr.className = 'swat-table-view-input-row'; - dest_tr.id = this.id + '_row_' + replicator_id; - - var node = dest_tr; - var dest_color = 'transparent'; - while (dest_color == 'transparent' && node) { - dest_color = YAHOO.util.Dom.getStyle(node, 'background-color'); - node = node.parentNode; - } - if (dest_color == 'transparent') { - dest_color = '#ffffff'; - } - - var animation = new YAHOO.util.ColorAnim(dest_tr, - { backgroundColor: { from: '#fffbc9', to: dest_color } }, 1, - YAHOO.util.Easing.easeOut); - - animation.animate(); - - /* - * Run scripts - * - * A better way to do this might be to remove the script nodes from the - * document and then run the scripts. This way we can ensure the scripts - * are only run once. - */ - var scripts = dom.documentElement.getElementsByTagName('script'); - for (var i = 0; i < scripts.length; i++) - if (scripts[0].getAttribute('type') == 'text/javascript' && - scripts[0].childNodes.length > 0) - eval(scripts[i].firstChild.nodeValue); -}; - -/** - * Removes a data row from the table - */ -SwatTableViewInputRow.prototype.removeRow = function(replicator_id) -{ - if (!this.initReplicators()) - return; - - // remove replicator_id from replicators array - var replicator_index = -1; - for (var i = 0; i < this.replicators.length; i++) { - if (this.replicators[i] == replicator_id) { - replicator_index = i; - break; - } - } - if (replicator_index != -1) { - this.replicators.splice(replicator_index, 1); - this.replicators_input.value = this.replicators.join(','); - } - - // remove row from document - var row_id = this.id + '_row_' + replicator_id; - var row = document.getElementById(row_id); - if (row && row.parentNode !== null) { - var removed_row = row.parentNode.removeChild(row); - delete removed_row; - } -}; +module.exports = SwatTableViewInputRow; diff --git a/www/javascript/swat-table-view.js b/www/javascript/swat-table-view.js index fa817bb19..f69e6b9cb 100644 --- a/www/javascript/swat-table-view.js +++ b/www/javascript/swat-table-view.js @@ -1,145 +1,147 @@ -/** - * JavaScript for the SwatTableView widget - * - * @param id string Id of the matching {@link SwatTableView}. - */ -function SwatTableView(id) -{ - SwatTableView.superclass.constructor.call(this, id); - - this.table_node = document.getElementById(this.id); - - // look for tbody node - var tbody_node = null; - for (var i = 0; i < this.table_node.childNodes.length; i++) { - if (this.table_node.childNodes[i].nodeName == 'TBODY') { - tbody_node = this.table_node.childNodes[i]; - break; +const SwatView = require('./swat-view'); + +class SwatTableView extends SwatView { + /** + * JavaScript for the SwatTableView widget + * + * @param id string Id of the matching {@link SwatTableView}. + */ + constructor(id) { + super(id); + + this.table_node = document.getElementById(this.id); + + // look for tbody node + var tbody_node = null; + for (var i = 0; i < this.table_node.childNodes.length; i++) { + if (this.table_node.childNodes[i].nodeName == 'TBODY') { + tbody_node = this.table_node.childNodes[i]; + break; + } } - } - // no tbody node, so item rows are directly in table node - if (tbody_node === null) - tbody_node = this.table_node; + // no tbody node, so item rows are directly in table node + if (tbody_node === null) { + tbody_node = this.table_node; + } - for (var i = 0; i < tbody_node.childNodes.length; i++) { - if (tbody_node.childNodes[i].nodeName == 'TR') - this.items.push(tbody_node.childNodes[i]); + for (var i = 0; i < tbody_node.childNodes.length; i++) { + if (tbody_node.childNodes[i].nodeName === 'TR') { + this.items.push(tbody_node.childNodes[i]); + } + } } -} -YAHOO.lang.extend(SwatTableView, SwatView, { - -/** - * Gets an item node in a table-view - * - * The item node is the closest parent table row element. - * - * @param DOMElement node the arbitrary descendant node. - * - * @return DOMElement the item node. - */ -getItemNode: function(node) -{ - var row_node = node; - - // search for containing table row element - while (row_node.nodeName != 'TR' && row_node.nodeName != 'BODY') - row_node = row_node.parentNode; - - // we reached the body element without finding the row node - if (row_node.nodeName == 'BODY') - row_node = node; - - return row_node; -} + /** + * Gets an item node in a table-view + * + * The item node is the closest parent table row element. + * + * @param DOMElement node the arbitrary descendant node. + * + * @return DOMElement the item node. + */ + getItemNode(node) { + var row_node = node; + + // search for containing table row element + while (row_node.nodeName !== 'TR' && row_node.nodeName !== 'BODY') { + row_node = row_node.parentNode; + } -}); - -/** - * Selects an item node in this table-view - * - * For table-views, this method also highlights selected item rows. - * - * @param DOMElement node an arbitrary descendant node of the item node to be - * selected. - * @param String selector an identifier of the object that selected the item - * node. - */ -SwatTableView.prototype.selectItem = function(node, selector) -{ - SwatTableView.superclass.selectItem.call(this, node, selector); - - var row_node = this.getItemNode(node); - - // highlight table row of selected item in this view - if (this.isSelected(row_node)) { - var odd = (YAHOO.util.Dom.hasClass(row_node, 'odd') || - YAHOO.util.Dom.hasClass(row_node, 'highlight-odd')); - - if (odd) { - YAHOO.util.Dom.removeClass(row_node, 'odd'); - YAHOO.util.Dom.addClass(row_node, 'highlight-odd'); - } else { - YAHOO.util.Dom.addClass(row_node, 'highlight'); + // we reached the body element without finding the row node + if (row_node.nodeName === 'BODY') { + row_node = node; } - var spanning_row = row_node.nextSibling; - while (spanning_row && YAHOO.util.Dom.hasClass( - spanning_row, 'swat-table-view-spanning-column')) { + return row_node; + } + + /** + * Selects an item node in this table-view + * + * For table-views, this method also highlights selected item rows. + * + * @param DOMElement node an arbitrary descendant node of the item node to + * be selected. + * @param String selector an identifier of the object that selected the + * item node. + */ + selectItem = function(node, selector) { + super.selectItem(node, selector); + + var row_node = this.getItemNode(node); + + // highlight table row of selected item in this view + if (this.isSelected(row_node)) { + var odd = (YAHOO.util.Dom.hasClass(row_node, 'odd') || + YAHOO.util.Dom.hasClass(row_node, 'highlight-odd')); if (odd) { - YAHOO.util.Dom.removeClass(spanning_row, 'odd'); - YAHOO.util.Dom.addClass(spanning_row, 'highlight-odd'); + YAHOO.util.Dom.removeClass(row_node, 'odd'); + YAHOO.util.Dom.addClass(row_node, 'highlight-odd'); } else { - YAHOO.util.Dom.addClass(spanning_row, 'highlight'); + YAHOO.util.Dom.addClass(row_node, 'highlight'); } - spanning_row = spanning_row.nextSibling; + var spanning_row = row_node.nextSibling; + while (spanning_row && YAHOO.util.Dom.hasClass( + spanning_row, 'swat-table-view-spanning-column') + ) { + if (odd) { + YAHOO.util.Dom.removeClass(spanning_row, 'odd'); + YAHOO.util.Dom.addClass(spanning_row, 'highlight-odd'); + } else { + YAHOO.util.Dom.addClass(spanning_row, 'highlight'); + } + + spanning_row = spanning_row.nextSibling; + } } } -}; - -/** - * Deselects an item node in this table-view - * - * For table-views, this method also unhighlights deselected item rows. - * - * @param DOMElement node an arbitrary descendant node of the item node to be - * deselected. - * @param String selector an identifier of the object that deselected the item - * node. - */ -SwatTableView.prototype.deselectItem = function(node, selector) -{ - SwatTableView.superclass.deselectItem.call(this, node, selector); - - var row_node = this.getItemNode(node); - - // unhighlight table row of item in this view - if (!this.isSelected(row_node)) { - var odd = (YAHOO.util.Dom.hasClass(row_node, 'odd') || - YAHOO.util.Dom.hasClass(row_node, 'highlight-odd')); - - if (odd) { - YAHOO.util.Dom.removeClass(row_node, 'highlight-odd'); - YAHOO.util.Dom.addClass(row_node, 'odd'); - } else { - YAHOO.util.Dom.removeClass(row_node, 'highlight'); - } - var spanning_row = row_node.nextSibling; - while (spanning_row && YAHOO.util.Dom.hasClass( - spanning_row, 'swat-table-view-spanning-column')) { + /** + * Deselects an item node in this table-view + * + * For table-views, this method also unhighlights deselected item rows. + * + * @param DOMElement node an arbitrary descendant node of the item node to be + * deselected. + * @param String selector an identifier of the object that deselected the item + * node. + */ + deselectItem(node, selector) { + super.deselectItem(node, selector); + + var row_node = this.getItemNode(node); + + // unhighlight table row of item in this view + if (!this.isSelected(row_node)) { + var odd = (YAHOO.util.Dom.hasClass(row_node, 'odd') || + YAHOO.util.Dom.hasClass(row_node, 'highlight-odd')); if (odd) { - YAHOO.util.Dom.removeClass(spanning_row, 'highlight-odd'); - YAHOO.util.Dom.addClass(spanning_row, 'odd'); + YAHOO.util.Dom.removeClass(row_node, 'highlight-odd'); + YAHOO.util.Dom.addClass(row_node, 'odd'); } else { - YAHOO.util.Dom.removeClass(spanning_row, 'highlight'); + YAHOO.util.Dom.removeClass(row_node, 'highlight'); } - spanning_row = spanning_row.nextSibling; + var spanning_row = row_node.nextSibling; + while (spanning_row && YAHOO.util.Dom.hasClass( + spanning_row, 'swat-table-view-spanning-column') + ) { + if (odd) { + YAHOO.util.Dom.removeClass(spanning_row, 'highlight-odd'); + YAHOO.util.Dom.addClass(spanning_row, 'odd'); + } else { + YAHOO.util.Dom.removeClass(spanning_row, 'highlight'); + } + + spanning_row = spanning_row.nextSibling; + } } } -}; +} + +module.exports = SwatTableView; diff --git a/www/javascript/swat-textarea.js b/www/javascript/swat-textarea.js index e3c729a26..4d9a0644b 100644 --- a/www/javascript/swat-textarea.js +++ b/www/javascript/swat-textarea.js @@ -5,179 +5,148 @@ * @copyright 2007-2016 silverorange * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 */ - -// {{{ function SwatTextarea() - -/** - * Creates a new textarea object - * - * @param string id the unique identifier of this textarea object. - * @param boolean resizeable whether or not this textarea is resizeable. - */ -function SwatTextarea(id, resizeable) -{ - this.id = id; - - if (resizeable) { - YAHOO.util.Event.onContentReady( - this.id, this.handleOnAvailable, this, true); +class SwatTextarea { + // {{{ constructor() + + /** + * Creates a new textarea object + * + * @param string id the unique identifier of this textarea object. + * @param boolean resizeable whether or not this textarea is resizeable. + */ + constructor(id, resizeable) { + this.id = id; + + if (resizeable) { + YAHOO.util.Event.onContentReady( + this.id, + this.handleOnAvailable, + this, + true + ); + } } -} -// }}} -// {{{ SwatTextarea.registerPendingTextarea() + // }}} + // {{{ handleOnAvailable() + + /** + * Sets up the resize handle when the textarea is available and loaded in + * the DOM tree + */ + handleOnAvailable() { + this.textarea = document.getElementById(this.id); + + // check if textarea already is resizable, and if so, don't add resize + // handle. + if (SwatTextarea.supports_resize) { + var resize = YAHOO.util.Dom.getStyle(this.textarea, 'resize'); + if (resize == 'both' || resize == 'vertical') { + return; + } + } -SwatTextarea.registerPendingTextarea = function(textarea) -{ - SwatTextarea.pending_textareas.push(textarea); + this.handle_div = document.createElement('div'); + this.handle_div.className = 'swat-textarea-resize-handle'; + this.handle_div._textarea = this.textarea; - if (SwatTextarea.pending_interval === null) { - SwatTextarea.pending_interval = setInterval( - SwatTextarea.pollPendingTextareas, - SwatTextarea.pending_poll_interval * 1000 - ); - } -}; + this.textarea._resize = this; -// }}} -// {{{ SwatTextarea.pollPendingTextareas() + YAHOO.util.Event.addListener(this.handle_div, 'touchstart', + SwatTextarea.touchstartEventHandler, this.handle_div); -SwatTextarea.pollPendingTextareas = function() -{ - for (var i = 0; i < SwatTextarea.pending_textareas.length; i++) { - if (SwatTextarea.pending_textareas[i].textarea.offsetWidth > 0) { - SwatTextarea.pending_textareas[i].initialize(); - SwatTextarea.pending_textareas.splice(i, 1); - i--; - } - } - - if (SwatTextarea.pending_textareas.length === 0) { - clearInterval(SwatTextarea.pending_interval); - SwatTextarea.pending_interval = null; - } -}; + YAHOO.util.Event.addListener(this.handle_div, 'mousedown', + SwatTextarea.mousedownEventHandler, this.handle_div); -// }}} -// {{{ handleOnAvailable() + this.textarea.parentNode.appendChild(this.handle_div); + YAHOO.util.Dom.addClass( + this.textarea.parentNode, + 'swat-textarea-with-resize'); -/** - * Sets up the resize handle when the textarea is available and loaded in the - * DOM tree - */ -SwatTextarea.prototype.handleOnAvailable = function() -{ - this.textarea = document.getElementById(this.id); - - // check if textarea already is resizable, and if so, don't add resize - // handle. - if (SwatTextarea.supports_resize) { - var resize = YAHOO.util.Dom.getStyle(this.textarea, 'resize'); - if (resize == 'both' || resize == 'vertical') { + // if textarea is not currently visible, delay initilization + if (this.textarea.offsetWidth === 0) { + SwatTextarea.registerPendingTextarea(this); return; } - } - - this.handle_div = document.createElement('div'); - this.handle_div.className = 'swat-textarea-resize-handle'; - this.handle_div._textarea = this.textarea; - this.textarea._resize = this; - - YAHOO.util.Event.addListener(this.handle_div, 'touchstart', - SwatTextarea.touchstartEventHandler, this.handle_div); - - YAHOO.util.Event.addListener(this.handle_div, 'mousedown', - SwatTextarea.mousedownEventHandler, this.handle_div); - - this.textarea.parentNode.appendChild(this.handle_div); - YAHOO.util.Dom.addClass( - this.textarea.parentNode, - 'swat-textarea-with-resize'); - - // if textarea is not currently visible, delay initilization - if (this.textarea.offsetWidth === 0) { - SwatTextarea.registerPendingTextarea(this); - return; + this.initialize(); } - this.initialize(); -}; - -// }}} -// {{{ initialize() - -SwatTextarea.prototype.initialize = function() -{ - var style_width = YAHOO.util.Dom.getStyle(this.textarea, 'width'); - var left_border, right_border; - - if (style_width.indexOf('%') != -1) { - left_border = parseInt( - YAHOO.util.Dom.getComputedStyle( - this.textarea, - 'borderLeftWidth' - ), - 10 - ) - parseInt( - YAHOO.util.Dom.getComputedStyle( - this.handle_div, - 'borderLeftWidth' - ), - 10 - ); - - right_border = parseInt( - YAHOO.util.Dom.getComputedStyle( - this.textarea, - 'borderRightWidth' - ), - 10 - ) - parseInt( - YAHOO.util.Dom.getComputedStyle( - this.handle_div, - 'borderRightWidth' - ), - 10 - ); - - this.handle_div.style.width = style_width; - this.handle_div.style.paddingLeft = left_border; - this.handle_div.style.paddingRight = right_border; - } else { - var width = this.textarea.offsetWidth; - - left_border = parseInt( - YAHOO.util.Dom.getComputedStyle( - this.handle_div, - 'borderLeftWidth' - ), - 10 - ); + // }}} + // {{{ initialize() + + initialize() { + var style_width = YAHOO.util.Dom.getStyle(this.textarea, 'width'); + var left_border, right_border; + + if (style_width.indexOf('%') != -1) { + left_border = parseInt( + YAHOO.util.Dom.getComputedStyle( + this.textarea, + 'borderLeftWidth' + ), + 10 + ) - parseInt( + YAHOO.util.Dom.getComputedStyle( + this.handle_div, + 'borderLeftWidth' + ), + 10 + ); + + right_border = parseInt( + YAHOO.util.Dom.getComputedStyle( + this.textarea, + 'borderRightWidth' + ), + 10 + ) - parseInt( + YAHOO.util.Dom.getComputedStyle( + this.handle_div, + 'borderRightWidth' + ), + 10 + ); + + this.handle_div.style.width = style_width; + this.handle_div.style.paddingLeft = left_border; + this.handle_div.style.paddingRight = right_border; + } else { + var width = this.textarea.offsetWidth; + + left_border = parseInt( + YAHOO.util.Dom.getComputedStyle( + this.handle_div, + 'borderLeftWidth' + ), + 10 + ); + + right_border = parseInt( + YAHOO.util.Dom.getComputedStyle( + this.handle_div, + 'borderRightWidth' + ), + 10 + ); + + this.handle_div.style.width = + (width - left_border - right_border) + 'px'; + } - right_border = parseInt( - YAHOO.util.Dom.getComputedStyle( - this.handle_div, - 'borderRightWidth' - ), - 10 - ); + this.handle_div.style.height = SwatTextarea.resize_handle_height + 'px'; + this.handle_div.style.fontSize = '0'; // for IE6 height - this.handle_div.style.width = - (width - left_border - right_border) + 'px'; + if ('ontouchstart' in window) { + // make it taller for fingers + this.handle_div.style.height = + (SwatTextarea.resize_handle_height + 16) + 'px'; + } } - this.handle_div.style.height = SwatTextarea.resize_handle_height + 'px'; - this.handle_div.style.fontSize = '0'; // for IE6 height - - if ('ontouchstart' in window) { - // make it taller for fingers - this.handle_div.style.height = - (SwatTextarea.resize_handle_height + 16) + 'px'; - } -}; + // }}} +} -// }}} // {{{ static properties /** @@ -258,6 +227,39 @@ SwatTextarea.supports_resize = (function() { (resize === '' || resize === 'none')); })(); +// }}} +// {{{ SwatTextarea.registerPendingTextarea() + +SwatTextarea.registerPendingTextarea = function(textarea) +{ + SwatTextarea.pending_textareas.push(textarea); + + if (SwatTextarea.pending_interval === null) { + SwatTextarea.pending_interval = setInterval( + SwatTextarea.pollPendingTextareas, + SwatTextarea.pending_poll_interval * 1000 + ); + } +}; + +// }}} +// {{{ SwatTextarea.pollPendingTextareas() + +SwatTextarea.pollPendingTextareas = function() +{ + for (var i = 0; i < SwatTextarea.pending_textareas.length; i++) { + if (SwatTextarea.pending_textareas[i].textarea.offsetWidth > 0) { + SwatTextarea.pending_textareas[i].initialize(); + SwatTextarea.pending_textareas.splice(i, 1); + i--; + } + } + + if (SwatTextarea.pending_textareas.length === 0) { + clearInterval(SwatTextarea.pending_interval); + SwatTextarea.pending_interval = null; + } +}; // }}} // {{{ SwatTextarea.mousedownEventHandler() @@ -493,3 +495,5 @@ SwatTextarea.touchendEventHandler = function(e, handle) }; // }}} + +module.exports = SwatTextarea; diff --git a/www/javascript/swat-tile-view.js b/www/javascript/swat-tile-view.js index 4f150e421..a585b78e3 100644 --- a/www/javascript/swat-tile-view.js +++ b/www/javascript/swat-tile-view.js @@ -1,95 +1,98 @@ -/** - * JavaScript for the SwatTileView widget - * - * @param id string Id of the matching {@link SwatTileView}. - */ -function SwatTileView(id) -{ - SwatTileView.superclass.constructor.call(this, id); - this.init(); -} +const SwatView = require('./swat-view'); -YAHOO.lang.extend(SwatTileView, SwatView, { +class SwatTileView extends SwatView { + /** + * JavaScript for the SwatTileView widget + * + * @param id string Id of the matching {@link SwatTileView}. + */ + constructor(id) { + super(id); + this.init(); + } -/** - * Gets an item node in a tile view - * - * The item node is the parent div one level below the root tile view - * element. - * - * @param DOMElement node the arbitrary descendant node. - * - * @return DOMElement the item node. - */ -getItemNode: function(node) -{ - var tile_node = node; + /** + * Gets an item node in a tile view + * + * The item node is the parent div one level below the root tile view + * element. + * + * @param DOMElement node the arbitrary descendant node. + * + * @return DOMElement the item node. + */ + getItemNode(node) { + var tile_node = node; - // search for containing tile element - while (tile_node.parentNode !== this.view_node && - tile_node.nodeName != 'BODY') - tile_node = tile_node.parentNode; + // search for containing tile element + while (tile_node.parentNode !== this.view_node && + tile_node.nodeName != 'BODY' + ) { + tile_node = tile_node.parentNode; + } - // we reached the body element without finding the tile node - if (tile_node.nodeName == 'BODY') - tile_node = node; + // we reached the body element without finding the tile node + if (tile_node.nodeName === 'BODY') { + tile_node = node; + } - return tile_node; -} + return tile_node; + } -}); -SwatTileView.prototype.init = function() -{ - this.items = []; - this.view_node = document.getElementById(this.id); + init() { + this.items = []; + this.view_node = document.getElementById(this.id); - for (var i = 0; i < this.view_node.childNodes.length; i++) { - var node_name = this.view_node.childNodes[i].nodeName.toLowerCase(); - if (node_name == 'div') { - this.items.push(this.view_node.childNodes[i]); + for (var i = 0; i < this.view_node.childNodes.length; i++) { + var node_name = this.view_node.childNodes[i].nodeName.toLowerCase(); + if (node_name === 'div') { + this.items.push(this.view_node.childNodes[i]); + } } } -}; -/** - * Selects an item node in this tile view - * - * For tile views, this method also highlights selected tiles. - * - * @param DOMElement node an arbitrary descendant node of the item node to be - * selected. - * @param String selector an identifier of the object that selected the item - * node. - */ -SwatTileView.prototype.selectItem = function(node, selector) -{ - SwatTileView.superclass.selectItem.call(this, node, selector); + /** + * Selects an item node in this tile view + * + * For tile views, this method also highlights selected tiles. + * + * @param DOMElement node an arbitrary descendant node of the item node to + * be selected. + * @param String selector an identifier of the object that selected the + * item node. + */ + selectItem(node, selector) { + super.selectItem(node, selector); - var tile_node = this.getItemNode(node); - if (this.isSelected(tile_node) && - !YAHOO.util.Dom.hasClass(tile_node, 'highlight')) { - YAHOO.util.Dom.addClass(tile_node, 'highlight'); + var tile_node = this.getItemNode(node); + if (this.isSelected(tile_node) && + !YAHOO.util.Dom.hasClass(tile_node, 'highlight') + ) { + YAHOO.util.Dom.addClass(tile_node, 'highlight'); + } } -}; -/** - * Deselects an item node in this tile view - * - * For tile views, this method also unhighlights deselected tiles. - * - * @param DOMElement node an arbitrary descendant node of the item node to be - * deselected. - * @param String selector an identifier of the object that deselected the item - * node. - */ -SwatTileView.prototype.deselectItem = function(node, selector) -{ - SwatTileView.superclass.deselectItem.call(this, node, selector); + /** + * Deselects an item node in this tile view + * + * For tile views, this method also unhighlights deselected tiles. + * + * @param DOMElement node an arbitrary descendant node of the item node to + * be deselected. + * @param String selector an identifier of the object that deselected the + * item node. + */ + deselectItem(node, selector) { + super.deselectItem(node, selector); - var tile_node = this.getItemNode(node); - if (!this.isSelected(tile_node) && - YAHOO.util.Dom.hasClass(tile_node, 'highlight')) { - YAHOO.util.Dom.removeClass(tile_node, 'highlight'); + var tile_node = this.getItemNode(node); + if (!this.isSelected(tile_node) && + YAHOO.util.Dom.hasClass(tile_node, 'highlight') + ) { + YAHOO.util.Dom.removeClass(tile_node, 'highlight'); + } } -}; +} + +module.exports = SwatTileView; diff --git a/www/javascript/swat-time-entry.js b/www/javascript/swat-time-entry.js index 742f5ee24..c06e06b5e 100644 --- a/www/javascript/swat-time-entry.js +++ b/www/javascript/swat-time-entry.js @@ -1,236 +1,278 @@ -function SwatTimeEntry(id, use_current_time) -{ - this.id = id; - this.use_current_time = use_current_time; +class SwatTimeEntry { + constructor(id, use_current_time) { + this.id = id; + this.use_current_time = use_current_time; + + this.hour = document.getElementById(id + '_hour'); + this.minute = document.getElementById(id + '_minute'); + this.second = document.getElementById(id + '_second'); + this.am_pm = document.getElementById(id + '_am_pm'); + + this.twelve_hour = (this.hour !== null && this.am_pm !== null); + + this.date_entry = null; + + if (this.hour) + YAHOO.util.Event.addListener( + this.hour, + 'change', + this.handleHourChange, + this, + true + ); + } - this.hour = document.getElementById(id + '_hour'); - this.minute = document.getElementById(id + '_minute'); - this.second = document.getElementById(id + '_second'); - this.am_pm = document.getElementById(id + '_am_pm'); + if (this.minute) { + YAHOO.util.Event.addListener( + this.minute, + 'change', + this.handleMinuteChange, + this, + true + ); + } - this.twelve_hour = (this.hour !== null && this.am_pm !== null); + if (this.second) { + YAHOO.util.Event.addListener( + this.second, + 'change', + this.handleSecondChange, + this, + true + ); + } - this.date_entry = null; + if (this.am_pm) { + YAHOO.util.Event.addListener( + this.am_pm, + 'change', + this.handleAmPmChange, + this, + true + ); + } - if (this.hour) - YAHOO.util.Event.addListener(this.hour, 'change', - this.handleHourChange, this, true); + this.lookup_table = {}; + this.reverse_lookup_table = {}; + } - if (this.minute) - YAHOO.util.Event.addListener(this.minute, 'change', - this.handleMinuteChange, this, true); + setSensitivity(sensitivity) { + var elements = []; - if (this.second) - YAHOO.util.Event.addListener(this.second, 'change', - this.handleSecondChange, this, true); + if (this.hour) { + elements.push(this.hour); + } - if (this.am_pm) - YAHOO.util.Event.addListener(this.am_pm, 'change', - this.handleAmPmChange, this, true); + if (this.minute) { + elements.push(this.minute); + } - this.lookup_table = {}; - this.reverse_lookup_table = {}; -} + if (this.second) { + elements.push(this.second); + } -SwatTimeEntry.prototype.setSensitivity = function(sensitivity) -{ - var elements = []; + if (this.am_pm) { + elements.push(this.am_pm); + } - if (this.hour) - elements.push(this.hour); + for (var i = 0; i < elements.length; i++) { + if (sensitivity) { + elements[i].disabled = false; + YAHOO.util.Dom.removeClass(elements[i], 'swat-insensitive'); + } else { + elements[i].disabled = true; + YAHOO.util.Dom.addClass(elements[i], 'swat-insensitive'); + } + } + } - if (this.minute) - elements.push(this.minute); + handleHourChange() { + this.update('hour'); + } - if (this.second) - elements.push(this.second); + handleMinuteChange() { + this.update('minute'); + } - if (this.am_pm) - elements.push(this.am_pm); + handleSecondChange() { + this.update('second'); + } + + handleAmPmChange() { + this.update('am_pm'); + } - for (var i = 0; i < elements.length; i++) { - if (sensitivity) { - elements[i].disabled = false; - YAHOO.util.Dom.removeClass(elements[i], 'swat-insensitive'); - } else { - elements[i].disabled = true; - YAHOO.util.Dom.addClass(elements[i], 'swat-insensitive'); + addLookupTable(table_name, table) { + this.lookup_table[table_name] = table; + this.reverse_lookup_table[table_name] = {}; + for (var key in table) { + this.reverse_lookup_table[table_name][table[key]] = key; } } -}; - -SwatTimeEntry.prototype.handleHourChange = function() -{ - this.update('hour'); -}; - -SwatTimeEntry.prototype.handleMinuteChange = function() -{ - this.update('minute'); -}; - -SwatTimeEntry.prototype.handleSecondChange = function() -{ - this.update('second'); -}; - -SwatTimeEntry.prototype.handleAmPmChange = function() -{ - this.update('am_pm'); -}; - -SwatTimeEntry.prototype.addLookupTable = function(table_name, table) -{ - this.lookup_table[table_name] = table; - this.reverse_lookup_table[table_name] = {}; - for (var key in table) { - this.reverse_lookup_table[table_name][table[key]] = key; + + lookup(table_name, key) { + return this.lookup_table[table_name][key]; } -}; - -SwatTimeEntry.prototype.lookup = function(table_name, key) -{ - return this.lookup_table[table_name][key]; -}; - -SwatTimeEntry.prototype.reverseLookup = function(table_name, key) -{ - var value = this.reverse_lookup_table[table_name][key]; - if (value === undefined) { - value = null; + + reverseLookup(table_name, key) { + var value = this.reverse_lookup_table[table_name][key]; + if (value === undefined) { + value = null; + } + return value; } - return value; -}; - -SwatTimeEntry.prototype.setDateEntry = function(date_entry) -{ - if (typeof SwatDateEntry != 'undefined' && - date_entry instanceof SwatDateEntry) { - this.date_entry = date_entry; - date_entry.time_entry = this; + + setDateEntry(date_entry) { + if (typeof SwatDateEntry !== 'undefined' && + date_entry instanceof SwatDateEntry + ) { + this.date_entry = date_entry; + date_entry.time_entry = this; + } } -}; -/** - * @deprecated Use setDateEntry() instead. - */ -SwatTimeEntry.prototype.setSwatDate = function(swat_date) -{ - this.setDateEntry(swat_date); -}; + /** + * @deprecated Use setDateEntry() instead. + */ + setSwatDate(swat_date) { + this.setDateEntry(swat_date); + } -SwatTimeEntry.prototype.reset = function(reset_date) -{ - if (this.hour) - this.hour.selectedIndex = 0; + reset(reset_date) { + if (this.hour) { + this.hour.selectedIndex = 0; + } - if (this.minute) - this.minute.selectedIndex = 0; + if (this.minute) { + this.minute.selectedIndex = 0; + } - if (this.second) - this.second.selectedIndex = 0; + if (this.second) { + this.second.selectedIndex = 0; + } - if (this.am_pm) - this.am_pm.selectedIndex = 0; + if (this.am_pm) { + this.am_pm.selectedIndex = 0; + } - if (this.date_entry && reset_date) - this.date_entry.reset(false); -}; + if (this.date_entry && reset_date) { + this.date_entry.reset(false); + } + } -SwatTimeEntry.prototype.setNow = function(set_date) -{ - var now = new Date(); - var hour = now.getHours(); + setNow(set_date) { + var now = new Date(); + var hour = now.getHours(); - if (this.twelve_hour) { - if (hour < 12) { // 0000-1100 is am - var am_pm = 1; - } else { // 1200-2300 is pm - if (hour != 12) - hour -= 12; + if (this.twelve_hour) { + if (hour < 12) { // 0000-1100 is am + var am_pm = 1; + } else { // 1200-2300 is pm + if (hour != 12) { + hour -= 12; + } + + var am_pm = 2; + } + } - var am_pm = 2; + if (this.hour && this.hour.selectedIndex === 0) { + this.hour.selectedIndex = this.lookup('hour', hour); } - } - if (this.hour && this.hour.selectedIndex === 0) - this.hour.selectedIndex = this.lookup('hour', hour); + if (this.minute && this.minute.selectedIndex === 0) { + this.minute.selectedIndex = this.lookup('minute', now.getMinutes()); + } - if (this.minute && this.minute.selectedIndex === 0) - this.minute.selectedIndex = this.lookup('minute', now.getMinutes()); + if (this.second && this.second.selectedIndex === 0) { + this.second.selectedIndex = this.lookup('second', now.getSeconds()); + } - if (this.second && this.second.selectedIndex === 0) - this.second.selectedIndex = this.lookup('second', now.getSeconds()); + if (this.am_pm && this.am_pm.selectedIndex === 0) { + this.am_pm.selectedIndex = am_pm; + } - if (this.am_pm && this.am_pm.selectedIndex === 0) - this.am_pm.selectedIndex = am_pm; + if (this.date_entry && set_date) { + this.date_entry.setNow(false); + } + } - if (this.date_entry && set_date) - this.date_entry.setNow(false); -}; + setDefault(set_date) { + if (this.hour && this.hour.selectedIndex === 0) { + if (this.am_pm) { + this.hour.selectedIndex = 12; + } else { + this.hour.selectedIndex = 1; + } + } -SwatTimeEntry.prototype.setDefault = function(set_date) -{ - if (this.hour && this.hour.selectedIndex === 0) { - if (this.am_pm) - this.hour.selectedIndex = 12; - else - this.hour.selectedIndex = 1; - } + if (this.minute && this.minute.selectedIndex === 0) { + this.minute.selectedIndex = 1; + } - if (this.minute && this.minute.selectedIndex === 0) - this.minute.selectedIndex = 1; - - if (this.second && this.second.selectedIndex === 0) - this.second.selectedIndex = 1; - - if (this.am_pm && this.am_pm.selectedIndex === 0) - this.am_pm.selectedIndex = 1; - - if (this.date_entry && set_date) - this.date_entry.setDefault(false); -}; - -SwatTimeEntry.prototype.update = function(field) -{ - // hour is required for this, so stop if it doesn't exist - if (!this.hour) - return; - - var index; - - switch (field) { - case 'hour': - index = this.hour.selectedIndex; - break; - case 'minute': - index = this.minute.selectedIndex; - break; - case 'second': - index = this.second.selectedIndex; - break; - case 'am_pm': - index = this.am_pm.selectedIndex; - break; - } + if (this.second && this.second.selectedIndex === 0) { + this.second.selectedIndex = 1; + } - // don't do anything if we select the blank option - if (index > 0) { - var now = new Date(); - var this_hour = now.getHours(); + if (this.am_pm && this.am_pm.selectedIndex === 0) { + this.am_pm.selectedIndex = 1; + } - if (this.twelve_hour) { - if (this_hour > 12) - this_hour -= 12; + if (this.date_entry && set_date) { + this.date_entry.setDefault(false); + } + } + + update(field) { + // hour is required for this, so stop if it doesn't exist + if (!this.hour) { + return; + } - if (this_hour === 0) - this_hour = 12; + var index; + + switch (field) { + case 'hour': + index = this.hour.selectedIndex; + break; + case 'minute': + index = this.minute.selectedIndex; + break; + case 'second': + index = this.second.selectedIndex; + break; + case 'am_pm': + index = this.am_pm.selectedIndex; + break; } - if (this.reverseLookup('hour', this.hour.selectedIndex) == this_hour && - this.use_current_time) - this.setNow(true); - else - this.setDefault(true); + // don't do anything if we select the blank option + if (index > 0) { + var now = new Date(); + var this_hour = now.getHours(); + + if (this.twelve_hour) { + if (this_hour > 12) { + this_hour -= 12; + } + + if (this_hour === 0) { + this_hour = 12; + } + } + + var lookup_hour = this.reverseLookup( + 'hour', + this.hour.selectedIndex + ); + + if (lookup_hour == this_hour && this.use_current_time) { + this.setNow(true); + } else { + this.setDefault(true); + } + } } -}; +} + +module.exports = SwatTimeEntry; diff --git a/www/javascript/swat-view.js b/www/javascript/swat-view.js index d5a10341a..ed20a5cc7 100644 --- a/www/javascript/swat-view.js +++ b/www/javascript/swat-view.js @@ -1,175 +1,180 @@ -/** - * Creates a new recordset view - * - * This is the base class used for recordset views. It is primarily - * responsible for providing helper methods for dynamically highlighting - * selecgted items in the view. - * - * @param String id the identifier of this view. - * - * @see SwatTableView - * @see SwatTileView - */ -function SwatView(id) -{ - this.id = id; - this.item_selection_counts = []; - this.item_selectors = []; - this.selector_item_counts = []; - this.items = []; -} +class SwatView { + /** + * Creates a new recordset view + * + * This is the base class used for recordset views. It is primarily + * responsible for providing helper methods for dynamically highlighting + * selecgted items in the view. + * + * @param String id the identifier of this view. + * + * @see SwatTableView + * @see SwatTileView + */ + constructor(id) { + this.id = id; + this.item_selection_counts = []; + this.item_selectors = []; + this.selector_item_counts = []; + this.items = []; + } -/** - * Gets an item node given an arbitrary descendant node - * - * @param DOMElement node the arbitrary descendant node. - * - * @return DOMElement the item node. - */ -SwatView.prototype.getItemNode = function(node) -{ - return node; -}; - -/** - * Gets an identifier for an item in this view - * - * @param DOMElement item_node an item node in this view - * - * @return String an identifier for the given item node. - * - * @see SwatView::getItemNode() - * @todo I'd like to improve this method to not use an O(n) lookup algorithm. - */ -SwatView.prototype.getItemNodeKey = function(item_node) -{ - var key = null; - for (var i = 0; i < this.items.length; i++) { - if (item_node === this.items[i]) { - key = i; - break; - } + /** + * Gets an item node given an arbitrary descendant node + * + * @param DOMElement node the arbitrary descendant node. + * + * @return DOMElement the item node. + */ + getItemNode(node) { + return node; } - return key; -}; - -/** - * Gets the number of items selected in this view for the specified selector - * - * @param String the selector identifier to coult the selected items for. - * - * @return Number the number of selected items for the given selector. - */ -SwatView.prototype.getSelectorItemCount = function(selector) -{ - if (this.selector_item_counts[selector]) - return this.selector_item_counts[selector]; - - return 0; -}; - -/** - * Selects an item node in this view - * - * An item may be selected multiple times by different selectors. This can - * be checked using the SwatView::isSelected() method. - * - * @param DOMElement node an arbitrary descendant node of the item node to be - * selected. - * @param String selector an identifier of the object that selected the item - * node. - */ -SwatView.prototype.selectItem = function(node, selector) -{ - // get main selectable item node key - var key = this.getItemNodeKey(this.getItemNode(node)); - - if (!this.item_selectors[key]) - this.item_selectors[key] = []; - - // if this item node is already not selected by the selector, increment - // the selection count - if (!this.item_selectors[key][selector]) { - // increment selection count for the item - if (this.item_selection_counts[key]) { - this.item_selection_counts[key]++; - } else { - this.item_selection_counts[key] = 1; + + /** + * Gets an identifier for an item in this view + * + * @param DOMElement item_node an item node in this view + * + * @return String an identifier for the given item node. + * + * @see SwatView::getItemNode() + * @todo I'd like to improve this method to not use an O(n) lookup algorithm. + */ + getItemNodeKey(item_node) { + var key = null; + for (var i = 0; i < this.items.length; i++) { + if (item_node === this.items[i]) { + key = i; + break; + } } + return key; + } - // increment item count for the selector + /** + * Gets the number of items selected in this view for the specified selector + * + * @param String the selector identifier to coult the selected items for. + * + * @return Number the number of selected items for the given selector. + */ + getSelectorItemCount(selector) { if (this.selector_item_counts[selector]) { - this.selector_item_counts[selector]++; - } else { - this.selector_item_counts[selector] = 1; + return this.selector_item_counts[selector]; } + + return 0; } - // remember that this node is selected by the selector - this.item_selectors[key][selector] = true; -}; - -/** - * Deselects an item node in this view - * - * An item may be selected multiple times by different selectors. This can - * be checked using the SwatView::isSelected() method. - * - * @param DOMElement node an arbitrary descendant node of the item node to be - * deselected. - * @param String selector an identifier of the object that deselected the item - * node. - */ -SwatView.prototype.deselectItem = function(node, selector) -{ - // get main selectable item node - var key = this.getItemNodeKey(this.getItemNode(node)); - - // can only deselect if the item node is selected - if (this.item_selectors[key]) { - // check if the item node is selected by the selector - if (this.item_selectors[key][selector]) { - // remember that the item node is not selected by the selector - this.item_selectors[key][selector] = false; - - // decrement the selection count for the item + /** + * Selects an item node in this view + * + * An item may be selected multiple times by different selectors. This can + * be checked using the SwatView::isSelected() method. + * + * @param DOMElement node an arbitrary descendant node of the item node to + * be selected. + * @param String selector an identifier of the object that selected the + * item node. + */ + selectItem(node, selector) { + // get main selectable item node key + var key = this.getItemNodeKey(this.getItemNode(node)); + + if (!this.item_selectors[key]) { + this.item_selectors[key] = []; + } + + // if this item node is already not selected by the selector, increment + // the selection count + if (!this.item_selectors[key][selector]) { + // increment selection count for the item if (this.item_selection_counts[key]) { - this.item_selection_counts[key] = - Math.max(this.item_selection_counts[key] - 1, 0); + this.item_selection_counts[key]++; } else { - this.item_selection_counts[key] = 0; + this.item_selection_counts[key] = 1; } - // decrement the item count for the selector + // increment item count for the selector if (this.selector_item_counts[selector]) { - this.selector_item_counts[selector] = - Math.max(this.selector_item_counts[selector] - 1, 0); + this.selector_item_counts[selector]++; } else { - this.selector_item_counts[selector] = 0; + this.selector_item_counts[selector] = 1; } } + + // remember that this node is selected by the selector + this.item_selectors[key][selector] = true; } -}; - -/** - * Checks whether or not an item node is selected given an arbitrary - * descendant node - * - * An item is considered selected if one or more selectors have selected - * it. - * - * @param DOMElement node an arbitrary descendant node of the item node to - * be checked for selection. - * - * @return Boolean true if the item node is selected and false if it is not. - */ -SwatView.prototype.isSelected = function(node) -{ - var key = this.getItemNodeKey(this.getItemNode(node)); - if (typeof(this.item_selection_counts[key]) == 'undefined') - var selected = false; - else - var selected = (this.item_selection_counts[key] > 0); - - return selected; -}; + + /** + * Deselects an item node in this view + * + * An item may be selected multiple times by different selectors. This can + * be checked using the SwatView::isSelected() method. + * + * @param DOMElement node an arbitrary descendant node of the item node to + * be deselected. + * @param String selector an identifier of the object that deselected the + * item node. + */ + deselectItem(node, selector) { + // get main selectable item node + var key = this.getItemNodeKey(this.getItemNode(node)); + + // can only deselect if the item node is selected + if (this.item_selectors[key]) { + // check if the item node is selected by the selector + if (this.item_selectors[key][selector]) { + // remember that the item node is not selected by the selector + this.item_selectors[key][selector] = false; + + // decrement the selection count for the item + if (this.item_selection_counts[key]) { + this.item_selection_counts[key] = Math.max( + this.item_selection_counts[key] - 1, + 0 + ); + } else { + this.item_selection_counts[key] = 0; + } + + // decrement the item count for the selector + if (this.selector_item_counts[selector]) { + this.selector_item_counts[selector] = Math.max( + this.selector_item_counts[selector] - 1, + 0 + ); + } else { + this.selector_item_counts[selector] = 0; + } + } + } + } + + /** + * Checks whether or not an item node is selected given an arbitrary + * descendant node + * + * An item is considered selected if one or more selectors have selected + * it. + * + * @param DOMElement node an arbitrary descendant node of the item node to + * be checked for selection. + * + * @return Boolean true if the item node is selected and false if it is not. + */ + isSelected(node) { + var selected; + var key = this.getItemNodeKey(this.getItemNode(node)); + if (typeof(this.item_selection_counts[key]) === 'undefined') { + selected = false; + } else { + selected = (this.item_selection_counts[key] > 0); + } + + return selected; + } +} + +module.exports = SwatView; diff --git a/www/javascript/swat-z-index-manager.js b/www/javascript/swat-z-index-manager.js index 09563bb54..dae6ca66f 100644 --- a/www/javascript/swat-z-index-manager.js +++ b/www/javascript/swat-z-index-manager.js @@ -1,54 +1,30 @@ -function SwatZIndexNode(element) -{ - if (element) { - this.element = element; - this.element._swat_z_index_node = this; - } else { - this.element = null; - } +const SwatZIndexNode = require('./swat-z-index-node'); - this.parent = null; - this.nodes = []; +/** + * An object to manage element z-indexes for a webpage + */ +class SwatZIndexManager { } -SwatZIndexNode.prototype.add = function(node) -{ - for (var i = 0; i < this.nodes.length; i++) { - if (this.nodes[i] === node || this.nodes[i].id === node) { - return; - } - } - - this.nodes.push(node); - node.parent = this; -}; - -SwatZIndexNode.prototype.remove = function(node) -{ - var found = false; +SwatZIndexManager.tree = new SwatZIndexNode(); - for (var i = 0; i < this.nodes.length; i++) { - if (this.nodes[i] === node) { - found = this.nodes[i]; - found.parent = null; - this.nodes.splice(i, 1); - break; - } - } +SwatZIndexManager.groups = {}; - return found; -}; +/** + * Default starting z-index for elements + * + * @var number + */ +SwatZIndexManager.start = 10; -SwatZIndexManager.reindex = function() -{ +SwatZIndexManager.reindex = function() { SwatZIndexManager.reindexNode( SwatZIndexManager.tree, SwatZIndexManager.start ); }; -SwatZIndexManager.reindexNode = function(node, index) -{ +SwatZIndexManager.reindexNode = function(node, index) { if (node.element) { node.element.style.zIndex = index; index++; @@ -61,8 +37,7 @@ SwatZIndexManager.reindexNode = function(node, index) return index; }; -SwatZIndexManager.unindexNode = function(node) -{ +SwatZIndexManager.unindexNode = function(node) { if (node.element) { node.element.style.zIndex = 0; } @@ -74,24 +49,6 @@ SwatZIndexManager.unindexNode = function(node) return index; }; -/** - * An object to manage element z-indexes for a webpage - */ -function SwatZIndexManager() -{ -} - -SwatZIndexManager.tree = new SwatZIndexNode(); - -SwatZIndexManager.groups = {}; - -/** - * Default starting z-index for elements - * - * @var number - */ -SwatZIndexManager.start = 10; - /** * Raises an element to the top * @@ -100,8 +57,7 @@ SwatZIndexManager.start = 10; * * @param DOMElement element the element to raise. */ -SwatZIndexManager.raiseElement = function(element, group) -{ +SwatZIndexManager.raiseElement = function(element, group) { var node; // create node if it does not exist @@ -136,8 +92,7 @@ SwatZIndexManager.raiseElement = function(element, group) SwatZIndexManager.reindex(); }; -SwatZIndexManager.raiseGroup = function(group) -{ +SwatZIndexManager.raiseGroup = function(group) { if (!SwatZIndexManager.groups[group]) { return; } @@ -151,8 +106,7 @@ SwatZIndexManager.raiseGroup = function(group) SwatZIndexManager.reindex(); }; -SwatZIndexManager.lowerGroup = function(group) -{ +SwatZIndexManager.lowerGroup = function(group) { if (!SwatZIndexManager.groups[group]) { return; } @@ -162,8 +116,7 @@ SwatZIndexManager.lowerGroup = function(group) SwatZIndexManager.removeGroup(group); }; -SwatZIndexManager.removeGroup = function(group) -{ +SwatZIndexManager.removeGroup = function(group) { if (!SwatZIndexManager.groups[group]) { return; } @@ -189,10 +142,8 @@ SwatZIndexManager.removeGroup = function(group) * @return mixed the element that was lowered or null if the element was not * found. */ -SwatZIndexManager.lowerElement = function(element, group) -{ +SwatZIndexManager.lowerElement = function(element, group) { element.style.zIndex = 0; - return SwatZIndexManager.removeElement(element, group); }; @@ -205,8 +156,7 @@ SwatZIndexManager.lowerElement = function(element, group) * @return mixed the element that was removed or null if the element was not * found. */ -SwatZIndexManager.removeElement = function(element, group) -{ +SwatZIndexManager.removeElement = function(element, group) { if (!element._swat_z_index_node) { return null; } @@ -231,3 +181,5 @@ SwatZIndexManager.removeElement = function(element, group) return element; }; + +module.exports = SwatZIndexManager; diff --git a/www/javascript/swat-z-index-node.js b/www/javascript/swat-z-index-node.js new file mode 100644 index 000000000..5c644ae3e --- /dev/null +++ b/www/javascript/swat-z-index-node.js @@ -0,0 +1,41 @@ +class SwatZIndexNode { + constructor(element) { + if (element) { + this.element = element; + this.element._swat_z_index_node = this; + } else { + this.element = null; + } + + this.parent = null; + this.nodes = []; + } + + add(node) { + for (var i = 0; i < this.nodes.length; i++) { + if (this.nodes[i] === node || this.nodes[i].id === node) { + return; + } + } + + this.nodes.push(node); + node.parent = this; + } + + remove(node) { + var found = false; + + for (var i = 0; i < this.nodes.length; i++) { + if (this.nodes[i] === node) { + found = this.nodes[i]; + found.parent = null; + this.nodes.splice(i, 1); + break; + } + } + + return found; + } +} + +module.exports = SwatZIndexNode; From ebe0194732c47546a3594058df08539182df9401 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Sun, 31 Dec 2017 03:32:20 -0400 Subject: [PATCH 03/35] Convert remaining two classes to ES6 --- www/javascript/swat-change-order.js | 1353 ++++++++++++++------------- www/javascript/swat-date-entry.js | 518 +++++----- 2 files changed, 955 insertions(+), 916 deletions(-) diff --git a/www/javascript/swat-change-order.js b/www/javascript/swat-change-order.js index 90b310284..71641085b 100644 --- a/www/javascript/swat-change-order.js +++ b/www/javascript/swat-change-order.js @@ -9,6 +9,675 @@ * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 */ +class SwatChangeOrder { + // {{{ function SwatChangeOrder() + + /** + * An orderable list control widget + * + * @param string id the unique identifier of this object. + * @param boolean sensitive the initial sensitive of this object. + */ + constructor(id, sensitive) { + this.is_webkit = + (/AppleWebKit|Konqueror|KHTML/gi).test(navigator.userAgent); + + this.id = id; + + this.list_div = document.getElementById(this.id + '_list'); + this.buttons = document.getElementsByName(this.id + '_buttons'); + + // the following two lines must be split on two lines to + // handle a Firefox bug. + var hidden_value = document.getElementById(this.id + '_value'); + var value_array = hidden_value.value.split(','); + var count = 0; + var node = null; + + // re-populate list with dynamic items if page is refreshed + var items_value = document.getElementById(this.id + '_dynamic_items').value; + if (items_value !== '') { + this.list_div.innerHTML = items_value; + } + + // remove text nodes and set value on nodes + for (var i = 0; i < this.list_div.childNodes.length; i++) { + node = this.list_div.childNodes[i]; + if (node.nodeType === 3) { + this.list_div.removeChild(node); + i--; + } else if (node.nodeType === 1) { + + // remove sentinel node and drop-shadow + if (node.id == this.id + '_sentinel' || node.id == 'drop') { + this.list_div.removeChild(node); + i--; + continue; + } + + node.order_value = value_array[count]; + node.order_index = count; + // assign a back reference for event handlers + node.controller = this; + + // add click handlers to the list items + YAHOO.util.Event.addListener( + node, + 'mousedown', + SwatChangeOrder_mousedownEventHandler + ); + + YAHOO.util.Dom.removeClass( + node, + 'swat-change-order-item-active' + ); + + count++; + } + } + + // since the DOM only has an insertBefore() method we use a sentinel + // node to make moving nodes down easier. + var sentinel_node = document.createElement('div'); + sentinel_node.id = this.id + '_sentinel'; + sentinel_node.style.display = 'block'; + this.list_div.appendChild(sentinel_node); + + // while not a real semaphore, this does prevent the user from breaking + // things by clicking buttons or items while an animation is occuring. + this.semaphore = true; + + this.active_div = null; + + // this is hard coded to true so we can chose the first element + if (this.list_div.firstChild !== sentinel_node) { + this.sensitive = true; + + this.choose(this.list_div.firstChild); + this.scrollList(this.getScrollPosition(this.list_div.firstChild)); + } + + this.sensitive = sensitive; + this.orderChangeEvent = new YAHOO.util.CustomEvent('orderChange'); + + // add grippies + YAHOO.util.Event.on(window, 'load', function() { + var node, grippy, height; + // exclude last item because it is the sentinel node + for (var i = 0; i < this.list_div.childNodes.length - 1; i++) { + node = this.list_div.childNodes[i]; + + grippy = document.createElement('span'); + grippy.className = 'swat-change-order-item-grippy'; + height = YAHOO.util.Dom.getRegion(node).height - 4; + grippy.style.height = height + 'px'; + node.insertBefore(grippy, node.firstChild); + + } + }, this, true); + } + + // }}} + // {{{ add() + + /** + * Dynamically adds an item to this change-order + * + * @param DOMElement el the element to add to the select list. + * @param String value the value to save for the order of the element. + * + * @return Boolean true if the element was added, otherwise false. + */ + add(el, value) { + if (!this.semaphore) { + // TODO queue elements and add when semaphore is available + return false; + } + + YAHOO.util.Dom.addClass(el, 'swat-change-order-item'); + + YAHOO.util.Event.addListener( + el, + 'mousedown', + SwatChangeOrder_mousedownEventHandler + ); + + var order_index = this.count(); + + el.controller = this; + el.order_index = order_index; + el.order_value = value; + + this.list_div.insertBefore(el, this.list_div.childNodes[order_index]); + + // update hidden value + var value_array; + var hidden_value = document.getElementById(this.id + '_value'); + if (hidden_value.value === '') { + value_array = []; + } else { + value_array = hidden_value.value.split(','); + } + value_array.push(value); + hidden_value.value = value_array.join(','); + + this.updateDynamicItemsValue(); + + return true; + } + + // }}} + // {{{ remove() + + /** + * Dynamically removes an item from this change-order + * + * @param DOMElement el the element to remove. + * + * @return Boolean true if the element was removed, otherwise false. + */ + remove(el) { + if (!this.semaphore) { + // TODO queue elements and remove when semaphore is available + return false; + } + + YAHOO.util.Event.purgeElement(el); + + // remove from hidden value + var hidden_value = document.getElementById(this.id + '_value'); + var value_array = hidden_value.value.split(','); + value_array.splice(el.order_index, 1); + hidden_value.value = value_array.join(','); + + if (this.active_div === el) { + this.active_div = null; + } + + this.list_div.removeChild(el); + + this.updateDynamicItemsValue(); + + return true; + } + + // }}} + // {{{ count() + + /** + * Gets the number of items in this change-order + * + * @return Number the number of items in this change-order. + */ + count() { + return this.list_div.childNodes.length - 1; + } + + // }}} + // {{{ containsValue() + + /** + * Gets whether or not this change-order contains an item with the given + * value + * + * @param String value the value to check for. + * + * @return Boolean true if there is an item with the given value in this + * change-order, otherwise false. + */ + containsValue(value) { + var value_array; + var hidden_value = document.getElementById(this.id + '_value'); + if (hidden_value.value === '') { + value_array = []; + } else { + value_array = hidden_value.value.split(','); + } + + for (var i = 0; i < value_array.length; i++) { + if (value_array[i] === value) { + return true; + } + } + + return false; + } + + // }}} + // {{{ choose() + + /** + * Choses an element in this change order as the active div + * + * Only allows chosing if the semaphore is not set. + * + * @param DOMNode div the element to chose. + */ + choose(div) { + if (this.semaphore && this.sensitive && div !== this.active_div && + !SwatChangeOrder.is_dragging + ) { + if (this.active_div !== null) { + this.active_div.className = 'swat-change-order-item'; + } + + div.className = 'swat-change-order-item ' + + 'swat-change-order-item-active'; + + this.active_div = div; + + // update the index value of this element + for (var i = 0; i < this.list_div.childNodes.length; i++) { + if (this.list_div.childNodes[i] === this.active_div) { + this.active_div.order_index = i; + break; + } + } + } + } + + // }}} + // {{{ moveToTop() + + /** + * Moves the active element to the top of the list + * + * Only functions if the semaphore is not set. Sets the semaphore. + */ + moveToTop() { + if (this.semaphore && this.sensitive) { + this.semaphore = false; + this.setButtonsSensitive(false); + + var steps = Math.ceil( + this.active_div.order_index / SwatChangeOrder.animation_frames + ); + + this.moveToTopHelper(steps); + } + } + + // }}} + // {{{ moveToTopHelper() + + /** + * A helper method that moves the active element up and sets a timeout callback + * to move it up again until it reaches the top + * + * Unsets the semaphore after the active element is at the top. + * + * @param number steps the number of steps to skip when moving the active + * element. + */ + moveToTopHelper(steps) { + if (this.moveUpHelper(steps)) { + setTimeout( + 'SwatChangeOrder_staticMoveToTop(' + + this.id + '_obj, ' + steps + ');', + SwatChangeOrder.animation_delay + ); + } else { + this.semaphore = true; + this.setButtonsSensitive(true); + this.updateDynamicItemsValue(); + } + } + + // }}} + // {{{ moveToBottom() + + /** + * Moves the active element to the bottom of the list + * + * Only functions if the semaphore is not set. Sets the semaphore. + */ + moveToBottom() { + if (this.semaphore && this.sensitive) { + this.semaphore = false; + this.setButtonsSensitive(false); + + var steps = Math.ceil(( + this.list_div.childNodes.length - + this.active_div.order_index - 1 + ) / SwatChangeOrder.animation_frames + ); + + this.moveToBottomHelper(steps); + } + } + + // }}} + // {{{ moveToBottomHelper() + + /** + * A helper method that moves the active element down and sets a timeout + * callback to move it down again until it reaches the bottom + * + * Unsets the semaphore after the active element is at the bottom. + * + * @param number steps the number of steps to skip when moving the active + * element. + */ + moveToBottomHelper(steps) { + if (this.moveDownHelper(steps)) { + setTimeout( + 'SwatChangeOrder_staticMoveToBottom(' + + this.id + '_obj, ' + steps + ');', + SwatChangeOrder.animation_delay + ); + } else { + this.semaphore = true; + this.setButtonsSensitive(true); + this.updateDynamicItemsValue(); + } + } + + // }}} + // {{{ moveUp() + + /** + * Moves the active element up one space + * + * Only functions if the semaphore is not set. + */ + moveUp() { + if (this.semaphore && this.sensitive) { + this.moveUpHelper(1); + this.updateDynamicItemsValue(); + } + } + + // }}} + // {{{ moveDown() + + /** + * Moves the active element down one space + * + * Only functions if the semaphore is not set. + */ + moveDown() { + if (this.semaphore && this.sensitive) { + this.moveDownHelper(1); + this.updateDynamicItemsValue(); + } + } + + // }}} + // {{{ moveUpHelper() + + /** + * Moves the active element up a number of steps + * + * @param number steps the number of steps to move the active element up by. + * + * @return boolean true if the element is not hitting the top of the list, + * false otherwise. + */ + moveUpHelper(steps) { + // can't move the top of the list up + if (this.list_div.firstChild === this.active_div) { + return false; + } + + var return_val = true; + + var prev_div = this.active_div; + for (var i = 0; i < steps; i++) { + prev_div = prev_div.previousSibling; + if (prev_div === this.list_div.firstChild) { + return_val = false; + break; + } + } + + this.list_div.insertBefore(this.active_div, prev_div); + + this.active_div.order_index = Math.max( + this.active_div.order_index - steps, + 0 + ); + + this.updateValue(); + this.scrollList(this.getScrollPosition(this.active_div)); + + return return_val; + } + + // }}} + // {{{ moveDownHelper() + + /** + * Moves the active element down a number of steps + * + * @param number steps the number of steps to move the active element down + * by. + * + * @return boolean true if the element is not hitting the bottom of the + * list, false otherwise. + */ + moveDownHelper(steps) { + // can't move the bottom of the list down + if (this.list_div.lastChild.previousSibling === this.active_div) { + return false; + } + + var return_val = true; + + var prev_div = this.active_div; + for (var i = 0; i < steps + 1; i++) { + prev_div = prev_div.nextSibling; + if (prev_div === this.list_div.lastChild) { + return_val = false; + break; + } + } + + this.list_div.insertBefore(this.active_div, prev_div); + + // we take the minimum of the list length - 1 to get the highest index + // and then - 1 again for the sentinel. + this.active_div.order_index = Math.min( + this.active_div.order_index + steps, + this.list_div.childNodes.length - 2 + ); + + this.updateValue(); + this.scrollList(this.getScrollPosition(this.active_div)); + + return return_val; + } + + // }}} + // {{{ setButtonsSensitive() + + /** + * Sets the sensitivity on buttons for this control + * + * @param boolean sensitive whether the buttons are sensitive. + */ + setButtonsSensitive(sensitive) { + for (var i = 0; i < this.buttons.length; i++) { + this.buttons[i].disabled = !sensitive; + } + } + + // }}} + // {{{ setSensitive() + + /** + * Sets whether this control is sensitive + * + * @param boolean sensitive whether this control is sensitive. + */ + setSensitive(sensitive) { + this.setButtonsSensitive(sensitive); + this.sensitive = sensitive; + + if (sensitive) { + document.getElementById(this.id).className = + 'swat-change-order'; + } else { + document.getElementById(this.id).className = + 'swat-change-order swat-change-order-insensitive'; + } + } + + // }}} + // {{{ updateValue() + + /** + * Updates the value of the hidden field containing the ordering of elements + */ + updateValue() { + var temp = ''; + var index = 0; + var drop_marker = SwatChangeOrder.dragging_drop_marker; + + // one less than list length so we don't count the sentinal node + for (var i = 0; i < this.list_div.childNodes.length - 1; i++) { + // ignore drop marker node + if (this.list_div.childNodes[i] != drop_marker) { + if (index > 0) { + temp += ','; + } + + temp += this.list_div.childNodes[i].order_value; + + // update node indexes + this.list_div.childNodes[i].order_index = index; + index++; + } + } + + var hidden_field = document.getElementById(this.id + '_value'); + + // fire order-changed event + if (temp != hidden_field.value) { + this.orderChangeEvent.fire(temp); + } + + // update a hidden field with current order of keys + hidden_field.value = temp; + } + + // }}} + // {{{ updateDynamicItemsValue() + + /** + * Updates the value of the hidden field containing the dynamic item nodes + * + * This allows the changeorder state to stay consistent when the page is + * soft-refreshed after adding or removing items. + */ + updateDynamicItemsValue() { + var items_value = document.getElementById(this.id + '_dynamic_items'); + items_value.value = this.list_div.innerHTML; + } + + // }}} + // {{{ getScrollPosition() + + /** + * Gets the y-position of the active element in the scrolling section + */ + getScrollPosition(element) { + // this conditional is to fix behaviour in IE + if (this.list_div.firstChild.offsetTop > this.list_div.offsetTop) { + var y_position = (element.offsetTop - this.list_div.offsetTop) + + (element.offsetHeight / 2); + } else { + var y_position = element.offsetTop + (element.offsetHeight / 2); + } + + return y_position; + } + + // }}} + // {{{ scrollList() + + /** + * Scrolls the list to a y-position + * + * This method acts the same as scrollTo() but it acts on a div instead of + * the window. + * + * @param number y_coord the y value to scroll the list to in pixels. + */ + scrollList(y_coord) { + // clientHeight is the height of the visible scroll area + var half_list_height = parseInt(this.list_div.clientHeight / 2); + + if (y_coord < half_list_height) { + this.list_div.scrollTop = 0; + return; + } + + // scrollHeight is the height of the contents inside the scroll area + if (this.list_div.scrollHeight - y_coord < half_list_height) { + this.list_div.scrollTop = this.list_div.scrollHeight - + this.list_div.clientHeight; + + return; + } + + // offsetHeight is clientHeight + padding + var factor = (y_coord - half_list_height) / + (this.list_div.scrollHeight - this.list_div.offsetHeight); + + this.list_div.scrollTop = Math.floor( + (this.list_div.scrollHeight - this.list_div.clientHeight) * factor + ); + } + + // }}} + // {{{ isGrid() + + /** + * Whether this SwatChangeOrder widget represents a vertical list (default) + * or a grid of items. + */ + isGrid() { + var node = this.list_div.childNodes[0]; + return (YAHOO.util.Dom.getStyle(node, 'float') !== 'none'); + } + + // }}} +} +// {{{ static properties + +/** + * Height in pixels of auto-scroll hotspots + * + * @var number + */ +SwatChangeOrder.hotspot_height = 40; + +/** + * Exponential value to use to auto-scroll hotspots + * + * @var number + */ +SwatChangeOrder.hotspot_exponent = 1.15; + +/** + * Delay in milliseconds to use for animations + * + * @var number + */ +SwatChangeOrder.animation_delay = 10; + +/** + * The number of frames of animation to use + * + * @var number + */ +SwatChangeOrder.animation_frames = 5; + +SwatChangeOrder.shadow_item_padding = 0; +SwatChangeOrder.dragging_item = null; +SwatChangeOrder.is_dragging = false; + +// }}} // {{{ function SwatChangeOrder_mousemoveEventHandler() /** @@ -29,7 +698,7 @@ function SwatChangeOrder_mousemoveEventHandler(event) var drop_marker = SwatChangeOrder.dragging_drop_marker; var list_div = shadow_item.original_item.parentNode; - if (shadow_item.style.display == 'none') { + if (shadow_item.style.display === 'none') { SwatChangeOrder.is_dragging = true; shadow_item.style.display = 'block'; shadow_item.scroll_timer = @@ -370,693 +1039,35 @@ function SwatChangeOrder_mousedownEventHandler(event) } // }}} -// {{{ function SwatChangeOrder() +// {{{ function SwatChangeOrder_staticMoveToTop() /** - * An orderable list control widget + * A static callback function for the move-to-top window timeout. * - * @param string id the unique identifier of this object. - * @param boolean sensitive the initial sensitive of this object. + * @param SwatChangeOrder change_order the change-order widget to work with. + * @param number steps the number of steps to skip when moving the active + * element. */ -function SwatChangeOrder(id, sensitive) +function SwatChangeOrder_staticMoveToTop(change_order, steps) { - this.is_webkit = - (/AppleWebKit|Konqueror|KHTML/gi).test(navigator.userAgent); - - this.id = id; - - this.list_div = document.getElementById(this.id + '_list'); - this.buttons = document.getElementsByName(this.id + '_buttons'); - - // the following two lines must be split on two lines to - // handle a Firefox bug. - var hidden_value = document.getElementById(this.id + '_value'); - var value_array = hidden_value.value.split(','); - var count = 0; - var node = null; - - // re-populate list with dynamic items if page is refreshed - var items_value = document.getElementById(this.id + '_dynamic_items').value; - if (items_value !== '') { - this.list_div.innerHTML = items_value; - } - - // remove text nodes and set value on nodes - for (var i = 0; i < this.list_div.childNodes.length; i++) { - node = this.list_div.childNodes[i]; - if (node.nodeType == 3) { - this.list_div.removeChild(node); - i--; - } else if (node.nodeType == 1) { - - // remove sentinel node and drop-shadow - if (node.id == this.id + '_sentinel' || node.id == 'drop') { - this.list_div.removeChild(node); - i--; - continue; - } - - node.order_value = value_array[count]; - node.order_index = count; - // assign a back reference for event handlers - node.controller = this; - // add click handlers to the list items - YAHOO.util.Event.addListener(node, 'mousedown', - SwatChangeOrder_mousedownEventHandler); - - YAHOO.util.Dom.removeClass(node, 'swat-change-order-item-active'); - - count++; - } - } - - // since the DOM only has an insertBefore() method we use a sentinel node - // to make moving nodes down easier. - var sentinel_node = document.createElement('div'); - sentinel_node.id = this.id + '_sentinel'; - sentinel_node.style.display = 'block'; - this.list_div.appendChild(sentinel_node); - - // while not a real semaphore, this does prevent the user from breaking - // things by clicking buttons or items while an animation is occuring. - this.semaphore = true; - - this.active_div = null; - - // this is hard coded to true so we can chose the first element - if (this.list_div.firstChild !== sentinel_node) { - this.sensitive = true; - - this.choose(this.list_div.firstChild); - this.scrollList(this.getScrollPosition(this.list_div.firstChild)); - } - - this.sensitive = sensitive; - this.orderChangeEvent = new YAHOO.util.CustomEvent('orderChange'); - - // add grippies - YAHOO.util.Event.on(window, 'load', function() { - var node, grippy, height; - // exclude last item because it is the sentinel node - for (var i = 0; i < this.list_div.childNodes.length - 1; i++) { - node = this.list_div.childNodes[i]; - - grippy = document.createElement('span'); - grippy.className = 'swat-change-order-item-grippy'; - height = YAHOO.util.Dom.getRegion(node).height - 4; - grippy.style.height = height + 'px'; - node.insertBefore(grippy, node.firstChild); - - } - }, this, true); + change_order.moveToTopHelper(steps); } // }}} -// {{{ static properties - -/** - * Height in pixels of auto-scroll hotspots - * - * @var number - */ -SwatChangeOrder.hotspot_height = 40; - -/** - * Exponential value to use to auto-scroll hotspots - * - * @var number - */ -SwatChangeOrder.hotspot_exponent = 1.15; +// {{{ function SwatChangeOrder_staticMoveToBottom() /** - * Delay in milliseconds to use for animations + * A static callback function for the move-to-bottom window timeout. * - * @var number - */ -SwatChangeOrder.animation_delay = 10; - -/** - * The number of frames of animation to use - * - * @var number - */ -SwatChangeOrder.animation_frames = 5; - -SwatChangeOrder.shadow_item_padding = 0; -SwatChangeOrder.dragging_item = null; -SwatChangeOrder.is_dragging = false; - -// }}} -// {{{ function SwatChangeOrder_staticMoveToTop() - -/** - * A static callback function for the move-to-top window timeout. - * - * @param SwatChangeOrder change_order the change-order widget to work with. - * @param number steps the number of steps to skip when moving the active - * element. - */ -function SwatChangeOrder_staticMoveToTop(change_order, steps) -{ - change_order.moveToTopHelper(steps); -} - -// }}} -// {{{ function SwatChangeOrder_staticMoveToBottom() - -/** - * A static callback function for the move-to-bottom window timeout. - * - * @param SwatChangeOrder change_order the change-order widget to work with. - * @param number steps the number of steps to skip when moving the active - * element. + * @param SwatChangeOrder change_order the change-order widget to work with. + * @param number steps the number of steps to skip when moving the active + * element. */ function SwatChangeOrder_staticMoveToBottom(change_order, steps) { change_order.moveToBottomHelper(steps); } -// }}} -// {{{ add() - -/** - * Dynamically adds an item to this change-order - * - * @param DOMElement el the element to add to the select list. - * @param String value the value to save for the order of the element. - * - * @return Boolean true if the element was added, otherwise false. - */ -SwatChangeOrder.prototype.add = function(el, value) -{ - if (!this.semaphore) { - // TODO queue elements and add when semaphore is available - return false; - } - - YAHOO.util.Dom.addClass(el, 'swat-change-order-item'); - - YAHOO.util.Event.addListener(el, 'mousedown', - SwatChangeOrder_mousedownEventHandler); - - var order_index = this.count(); - - el.controller = this; - el.order_index = order_index; - el.order_value = value; - - this.list_div.insertBefore(el, this.list_div.childNodes[order_index]); - - // update hidden value - var value_array; - var hidden_value = document.getElementById(this.id + '_value'); - if (hidden_value.value === '') { - value_array = []; - } else { - value_array = hidden_value.value.split(','); - } - value_array.push(value); - hidden_value.value = value_array.join(','); - - this.updateDynamicItemsValue(); - - return true; -}; - -// }}} -// {{{ remove() - -/** - * Dynamically removes an item from this change-order - * - * @param DOMElement el the element to remove. - * - * @return Boolean true if the element was removed, otherwise false. - */ -SwatChangeOrder.prototype.remove = function(el) -{ - if (!this.semaphore) { - // TODO queue elements and remove when semaphore is available - return false; - } - - YAHOO.util.Event.purgeElement(el); - - // remove from hidden value - var hidden_value = document.getElementById(this.id + '_value'); - var value_array = hidden_value.value.split(','); - value_array.splice(el.order_index, 1); - hidden_value.value = value_array.join(','); - - if (this.active_div === el) { - this.active_div = null; - } - - this.list_div.removeChild(el); - - this.updateDynamicItemsValue(); - - return true; -}; - -// }}} -// {{{ count() - -/** - * Gets the number of items in this change-order - * - * @return Number the number of items in this change-order. - */ -SwatChangeOrder.prototype.count = function() -{ - return this.list_div.childNodes.length - 1; -}; - -// }}} -// {{{ containsValue() - -/** - * Gets whether or not this change-order contains an item with the given value - * - * @param String value the value to check for. - * - * @return Boolean true if there is an item with the given value in this - * change-order, otherwise false. - */ -SwatChangeOrder.prototype.containsValue = function(value) -{ - var value_array; - var hidden_value = document.getElementById(this.id + '_value'); - if (hidden_value.value === '') { - value_array = []; - } else { - value_array = hidden_value.value.split(','); - } - - for (var i = 0; i < value_array.length; i++) { - if (value_array[i] === value) { - return true; - } - } - - return false; -}; - -// }}} -// {{{ choose() - -/** - * Choses an element in this change order as the active div - * - * Only allows chosing if the semaphore is not set. - * - * @param DOMNode div the element to chose. - */ -SwatChangeOrder.prototype.choose = function(div) -{ - if (this.semaphore && this.sensitive && div !== this.active_div && - !SwatChangeOrder.is_dragging) { - - if (this.active_div !== null) { - this.active_div.className = 'swat-change-order-item'; - } - - div.className = 'swat-change-order-item swat-change-order-item-active'; - - this.active_div = div; - - // update the index value of this element - for (var i = 0; i < this.list_div.childNodes.length; i++) { - if (this.list_div.childNodes[i] === this.active_div) { - this.active_div.order_index = i; - break; - } - } - } -}; - -// }}} -// {{{ moveToTop() - -/** - * Moves the active element to the top of the list - * - * Only functions if the semaphore is not set. Sets the semaphore. - */ -SwatChangeOrder.prototype.moveToTop = function() -{ - if (this.semaphore && this.sensitive) { - this.semaphore = false; - this.setButtonsSensitive(false); - - var steps = Math.ceil(this.active_div.order_index / - SwatChangeOrder.animation_frames); - - this.moveToTopHelper(steps); - } -}; - -// }}} -// {{{ moveToTopHelper() - -/** - * A helper method that moves the active element up and sets a timeout callback - * to move it up again until it reaches the top - * - * Unsets the semaphore after the active element is at the top. - * - * @param number steps the number of steps to skip when moving the active - * element. - */ -SwatChangeOrder.prototype.moveToTopHelper = function(steps) -{ - if (this.moveUpHelper(steps)) { - setTimeout('SwatChangeOrder_staticMoveToTop(' + - this.id + '_obj, ' + steps + ');', - SwatChangeOrder.animation_delay); - } else { - this.semaphore = true; - this.setButtonsSensitive(true); - this.updateDynamicItemsValue(); - } -}; - -// }}} -// {{{ moveToBottom() - -/** - * Moves the active element to the bottom of the list - * - * Only functions if the semaphore is not set. Sets the semaphore. - */ -SwatChangeOrder.prototype.moveToBottom = function() -{ - if (this.semaphore && this.sensitive) { - this.semaphore = false; - this.setButtonsSensitive(false); - - var steps = Math.ceil((this.list_div.childNodes.length - this.active_div.order_index - 1) / - SwatChangeOrder.animation_frames); - - this.moveToBottomHelper(steps); - } -}; - -// }}} -// {{{ moveToBottomHelper() - -/** - * A helper method that moves the active element down and sets a timeout - * callback to move it down again until it reaches the bottom - * - * Unsets the semaphore after the active element is at the bottom. - * - * @param number steps the number of steps to skip when moving the active - * element. - */ -SwatChangeOrder.prototype.moveToBottomHelper = function(steps) -{ - if (this.moveDownHelper(steps)) { - setTimeout('SwatChangeOrder_staticMoveToBottom(' + - this.id + '_obj, ' + steps + ');', - SwatChangeOrder.animation_delay); - } else { - this.semaphore = true; - this.setButtonsSensitive(true); - this.updateDynamicItemsValue(); - } -}; - -// }}} -// {{{ moveUp() - -/** - * Moves the active element up one space - * - * Only functions if the semaphore is not set. - */ -SwatChangeOrder.prototype.moveUp = function() -{ - if (this.semaphore && this.sensitive) { - this.moveUpHelper(1); - this.updateDynamicItemsValue(); - } -}; - -// }}} -// {{{ moveDown() - -/** - * Moves the active element down one space - * - * Only functions if the semaphore is not set. - */ -SwatChangeOrder.prototype.moveDown = function() -{ - if (this.semaphore && this.sensitive) { - this.moveDownHelper(1); - this.updateDynamicItemsValue(); - } -}; - -// }}} -// {{{ moveUpHelper() - -/** - * Moves the active element up a number of steps - * - * @param number steps the number of steps to move the active element up by. - * - * @return boolean true if the element is not hitting the top of the list, - * false otherwise. - */ -SwatChangeOrder.prototype.moveUpHelper = function(steps) -{ - // can't move the top of the list up - if (this.list_div.firstChild === this.active_div) - return false; - - var return_val = true; - - var prev_div = this.active_div; - for (var i = 0; i < steps; i++) { - prev_div = prev_div.previousSibling; - if (prev_div === this.list_div.firstChild) { - return_val = false; - break; - } - } - - this.list_div.insertBefore(this.active_div, prev_div); - - this.active_div.order_index = - Math.max(this.active_div.order_index - steps, 0); - - this.updateValue(); - this.scrollList(this.getScrollPosition(this.active_div)); - - return return_val; -}; - -// }}} -// {{{ moveDownHelper() - -/** - * Moves the active element down a number of steps - * - * @param number steps the number of steps to move the active element down by. - * - * @return boolean true if the element is not hitting the bottom of the list, - * false otherwise. - */ -SwatChangeOrder.prototype.moveDownHelper = function(steps) -{ - // can't move the bottom of the list down - if (this.list_div.lastChild.previousSibling === this.active_div) - return false; - - var return_val = true; - - var prev_div = this.active_div; - for (var i = 0; i < steps + 1; i++) { - prev_div = prev_div.nextSibling; - if (prev_div === this.list_div.lastChild) { - return_val = false; - break; - } - } - - this.list_div.insertBefore(this.active_div, prev_div); - - // we take the minimum of the list length - 1 to get the highest index - // and then - 1 again for the sentinel. - this.active_div.order_index = - Math.min(this.active_div.order_index + steps, - this.list_div.childNodes.length - 2); - - this.updateValue(); - this.scrollList(this.getScrollPosition(this.active_div)); - - return return_val; -}; - -// }}} -// {{{ setButtonsSensitive() - -/** - * Sets the sensitivity on buttons for this control - * - * @param boolean sensitive whether the buttons are sensitive. - */ -SwatChangeOrder.prototype.setButtonsSensitive = function(sensitive) -{ - for (var i = 0; i < this.buttons.length; i++) - this.buttons[i].disabled = !sensitive; -}; - -// }}} -// {{{ setSensitive() - -/** - * Sets whether this control is sensitive - * - * @param boolean sensitive whether this control is sensitive. - */ -SwatChangeOrder.prototype.setSensitive = function(sensitive) -{ - this.setButtonsSensitive(sensitive); - this.sensitive = sensitive; - - if (sensitive) { - document.getElementById(this.id).className = - 'swat-change-order'; - } else { - document.getElementById(this.id).className = - 'swat-change-order swat-change-order-insensitive'; - } -}; - -// }}} -// {{{ updateValue() - -/** - * Updates the value of the hidden field containing the ordering of elements - */ -SwatChangeOrder.prototype.updateValue = function() -{ - var temp = ''; - var index = 0; - var drop_marker = SwatChangeOrder.dragging_drop_marker; - - // one less than list length so we don't count the sentinal node - for (var i = 0; i < this.list_div.childNodes.length - 1; i++) { - // ignore drop marker node - if (this.list_div.childNodes[i] != drop_marker) { - if (index > 0) - temp += ','; - - temp += this.list_div.childNodes[i].order_value; - - // update node indexes - this.list_div.childNodes[i].order_index = index; - index++; - } - } - - var hidden_field = document.getElementById(this.id + '_value'); - - // fire order-changed event - if (temp != hidden_field.value) - this.orderChangeEvent.fire(temp); - - // update a hidden field with current order of keys - hidden_field.value = temp; -}; - -// }}} -// {{{ updateDynamicItemsValue() - -/** - * Updates the value of the hidden field containing the dynamic item nodes - * - * This allows the changeorder state to stay consistent when the page is - * soft-refreshed after adding or removing items. - */ -SwatChangeOrder.prototype.updateDynamicItemsValue = function() -{ - var items_value = document.getElementById(this.id + '_dynamic_items'); - items_value.value = this.list_div.innerHTML; -}; - -// }}} -// {{{ getScrollPosition() - -/** - * Gets the y-position of the active element in the scrolling section - */ -SwatChangeOrder.prototype.getScrollPosition = function(element) -{ - // this conditional is to fix behaviour in IE - if (this.list_div.firstChild.offsetTop > this.list_div.offsetTop) - var y_position = (element.offsetTop - this.list_div.offsetTop) + - (element.offsetHeight / 2); - else - var y_position = element.offsetTop + - (element.offsetHeight / 2); - - return y_position; -}; - -// }}} -// {{{ scrollList() - -/** - * Scrolls the list to a y-position - * - * This method acts the same as scrollTo() but it acts on a div instead of the - * window. - * - * @param number y_coord the y value to scroll the list to in pixels. - */ -SwatChangeOrder.prototype.scrollList = function(y_coord) -{ - // clientHeight is the height of the visible scroll area - var half_list_height = parseInt(this.list_div.clientHeight / 2); - - if (y_coord < half_list_height) { - this.list_div.scrollTop = 0; - return; - } - - // scrollHeight is the height of the contents inside the scroll area - if (this.list_div.scrollHeight - y_coord < half_list_height) { - this.list_div.scrollTop = this.list_div.scrollHeight - - this.list_div.clientHeight; - - return; - } - - // offsetHeight is clientHeight + padding - var factor = (y_coord - half_list_height) / - (this.list_div.scrollHeight - this.list_div.offsetHeight); - - this.list_div.scrollTop = Math.floor( - (this.list_div.scrollHeight - this.list_div.clientHeight) * factor); -}; - -// }}} -// {{{ isGrid() - -/** - * Whether this SwatChangeOrder widget represents a vertical list (default) or - * a grid of items. - */ -SwatChangeOrder.prototype.isGrid = function() -{ - var node = this.list_div.childNodes[0]; - return (YAHOO.util.Dom.getStyle(node, 'float') != 'none'); -}; - // }}} module.exports = SwatChangeOrder; diff --git a/www/javascript/swat-date-entry.js b/www/javascript/swat-date-entry.js index 73d412c63..5646c10fb 100644 --- a/www/javascript/swat-date-entry.js +++ b/www/javascript/swat-date-entry.js @@ -1,294 +1,322 @@ -function SwatDateEntry(id, use_current_date) -{ - this.id = id; - this.use_current_date = use_current_date; - - this.year = document.getElementById(id + '_year'); - this.month = document.getElementById(id + '_month'); - this.day = document.getElementById(id + '_day'); +class SwatDateEntry { + constructor(id, use_current_date) { + this.id = id; + this.use_current_date = use_current_date; + + this.year = document.getElementById(id + '_year'); + this.month = document.getElementById(id + '_month'); + this.day = document.getElementById(id + '_day'); + + this.calendar = null; + this.time_entry = null; + + if (this.year) { + YAHOO.util.Event.addListener( + this.year, + 'change', + this.handleYearChange, + this, + true + ); + } - this.calendar = null; - this.time_entry = null; + if (this.month) { + YAHOO.util.Event.addListener( + this.month, + 'change', + this.handleMonthChange, + this, + true + ); + } - if (this.year) - YAHOO.util.Event.addListener(this.year, 'change', - this.handleYearChange, this, true); + if (this.day) { + YAHOO.util.Event.addListener( + this.day, + 'change', + this.handleDayChange, + this, + true + ); + } - if (this.month) - YAHOO.util.Event.addListener(this.month, 'change', - this.handleMonthChange, this, true); + this.lookup_table = {}; + this.reverse_lookup_table = {}; + } - if (this.day) - YAHOO.util.Event.addListener(this.day, 'change', - this.handleDayChange, this, true); + setSensitivity(sensitivity) { + var elements = []; - this.lookup_table = {}; - this.reverse_lookup_table = {}; -} + if (this.year) { + elements.push(this.year); + } -SwatDateEntry.prototype.setSensitivity = function(sensitivity) -{ - var elements = []; + if (this.month) { + elements.push(this.month); + } - if (this.year) - elements.push(this.year); + if (this.day) { + elements.push(this.day); + } - if (this.month) - elements.push(this.month); + for (var i = 0; i < elements.length; i++) { + if (sensitivity) { + elements[i].disabled = false; + YAHOO.util.Dom.removeClass(elements[i], 'swat-insensitive'); + } else { + elements[i].disabled = true; + YAHOO.util.Dom.addClass(elements[i], 'swat-insensitive'); + } + } - if (this.day) - elements.push(this.day); + if (this.calendar) { + this.calendar.setSensitivity(sensitivity); + } - for (var i = 0; i < elements.length; i++) { - if (sensitivity) { - elements[i].disabled = false; - YAHOO.util.Dom.removeClass(elements[i], 'swat-insensitive'); - } else { - elements[i].disabled = true; - YAHOO.util.Dom.addClass(elements[i], 'swat-insensitive'); + if (this.time_entry) { + this.time_entry.setSensitivity(sensitivity); } } - if (this.calendar) - this.calendar.setSensitivity(sensitivity); - - if (this.time_entry) - this.time_entry.setSensitivity(sensitivity); -}; - -SwatDateEntry.prototype.handleYearChange = function() -{ - this.update('year'); -}; - -SwatDateEntry.prototype.handleMonthChange = function() -{ - this.update('month'); -}; - -SwatDateEntry.prototype.handleDayChange = function() -{ - this.update('day'); -}; - -SwatDateEntry.prototype.addLookupTable = function(table_name, table) -{ - this.lookup_table[table_name] = table; - this.reverse_lookup_table[table_name] = {}; - for (var key in table) { - this.reverse_lookup_table[table_name][table[key]] = key; + handleYearChange() { + this.update('year'); } -}; - -SwatDateEntry.prototype.lookup = function(table_name, key) -{ - return this.lookup_table[table_name][key]; -}; - -SwatDateEntry.prototype.reverseLookup = function(table_name, key) -{ - var value = this.reverse_lookup_table[table_name][key]; - if (value === undefined) { - value = null; + + handleMonthChange() { + this.update('month'); } - return value; -}; - -SwatDateEntry.prototype.setCalendar = function(calendar) -{ - if (typeof SwatCalendar != 'undefined' && - calendar instanceof SwatCalendar) { - this.calendar = calendar; - calendar.date_entry = this; + + handleDayChange() { + this.update('day'); } -}; - -SwatDateEntry.prototype.setTimeEntry = function(time_entry) -{ - if (typeof SwatTimeEntry != 'undefined' && - time_entry instanceof SwatTimeEntry) { - this.time_entry = time_entry; - time_entry.date_entry = this; + + addLookupTable(table_name, table) { + this.lookup_table[table_name] = table; + this.reverse_lookup_table[table_name] = {}; + for (var key in table) { + this.reverse_lookup_table[table_name][table[key]] = key; + } } -}; - -/** - * @deprecated Use setTimeEntry() instead. - */ -SwatDateEntry.prototype.setSwatTime = function(swat_time) -{ - this.setTimeEntry(swat_time); -}; - -SwatDateEntry.prototype.reset = function(reset_time) -{ - if (this.year) - this.year.selectedIndex = 0; - - if (this.month) - this.month.selectedIndex = 0; - - if (this.day) - this.day.selectedIndex = 0; - - if (this.time_entry && reset_time) - this.time_entry.reset(false); -}; - -SwatDateEntry.prototype.setNow = function(set_time) -{ - var now = new Date(); - - if (this.year && this.year.selectedIndex === 0) { - var this_year = this.lookup('year', now.getFullYear()); - - if (this_year) - this.year.selectedIndex = this_year; - else - this.year.selectedIndex = 1; + + lookup(table_name, key) { + return this.lookup_table[table_name][key]; } - if (this.month && this.month.selectedIndex === 0) { - var this_month = this.lookup('month', now.getMonth() + 1); + reverseLookup(table_name, key) { + var value = this.reverse_lookup_table[table_name][key]; + if (value === undefined) { + value = null; + } + return value; + } - if (this_month) - this.month.selectedIndex = this_month; - else - this.month.selectedIndex = 1; + setCalendar(calendar) { + if (typeof SwatCalendar !== 'undefined' && + calendar instanceof SwatCalendar + ) { + this.calendar = calendar; + calendar.date_entry = this; + } } - if (this.day && this.day.selectedIndex === 0) { - var this_day = this.lookup('day', now.getDate()); - if (this_day) - this.day.selectedIndex = this_day; - else - this.day.selectedIndex = 1; + setTimeEntry(time_entry) { + if (typeof SwatTimeEntry !== 'undefined' && + time_entry instanceof SwatTimeEntry + ) { + this.time_entry = time_entry; + time_entry.date_entry = this; + } } - if (this.time_entry && set_time) - this.time_entry.setNow(false); -}; - -SwatDateEntry.prototype.setDefault = function(set_time) -{ - var now = new Date(); - - if (this.year && this.year.selectedIndex === 0) { - /* - * Default to this year if it exists in the options. This behaviour - * is somewhat different from the others, but just makes common sense. - */ - var this_year = this.lookup('year', now.getFullYear()); - - if (this_year) - this.year.selectedIndex = this_year; - else - this.year.selectedIndex = 1; + /** + * @deprecated Use setTimeEntry() instead. + */ + setSwatTime(swat_time) { + this.setTimeEntry(swat_time); } - if (this.month && this.month.selectedIndex === 0) - this.month.selectedIndex = 1; - - if (this.day && this.day.selectedIndex === 0) - this.day.selectedIndex = 1; - - if (this.time_entry && set_time) - this.time_entry.setDefault(false); -}; - -SwatDateEntry.prototype.update = function(field) -{ - // month is required for this, so stop if it doesn't exist - if (!this.month) - return; - - var index = null; - switch (field) { - case 'day': - index = this.day.selectedIndex; - break; - case 'month': - index = this.month.selectedIndex; - break; - case 'year': - index = this.year.selectedIndex; - break; + reset(reset_time) { + if (this.year) { + this.year.selectedIndex = 0; + } + + if (this.month) { + this.month.selectedIndex = 0; + } + + if (this.day) { + this.day.selectedIndex = 0; + } + + if (this.time_entry && reset_time) { + this.time_entry.reset(false); + } + } + + setNow(set_time) { + var now = new Date(); + + if (this.year && this.year.selectedIndex === 0) { + var this_year = this.lookup('year', now.getFullYear()); + + if (this_year) { + this.year.selectedIndex = this_year; + } else { + this.year.selectedIndex = 1; + } + } + + if (this.month && this.month.selectedIndex === 0) { + var this_month = this.lookup('month', now.getMonth() + 1); + + if (this_month) { + this.month.selectedIndex = this_month; + } else { + this.month.selectedIndex = 1; + } + } + + if (this.day && this.day.selectedIndex === 0) { + var this_day = this.lookup('day', now.getDate()); + if (this_day) { + this.day.selectedIndex = this_day; + } else { + this.day.selectedIndex = 1; + } + } + + if (this.time_entry && set_time) { + this.time_entry.setNow(false); + } } - // don't do anything if we select the blank option - if (index !== 0) { + setDefault(set_time) { var now = new Date(); - var this_month = now.getMonth() + 1; - if (this.getMonth() == this_month && this.use_current_date) - this.setNow(true); - else - this.setDefault(true); + if (this.year && this.year.selectedIndex === 0) { + /* + * Default to this year if it exists in the options. This behaviour + * is somewhat different from the others, but just makes common sense. + */ + var this_year = this.lookup('year', now.getFullYear()); + + if (this_year) { + this.year.selectedIndex = this_year; + } else { + this.year.selectedIndex = 1; + } + } + + if (this.month && this.month.selectedIndex === 0) { + this.month.selectedIndex = 1; + } + + if (this.day && this.day.selectedIndex === 0) { + this.day.selectedIndex = 1; + } + + if (this.time_entry && set_time) { + this.time_entry.setDefault(false); + } + } + + update(field) { + // month is required for this, so stop if it doesn't exist + if (!this.month) { + return; + } + + var index = null; + switch (field) { + case 'day': + index = this.day.selectedIndex; + break; + case 'month': + index = this.month.selectedIndex; + break; + case 'year': + index = this.year.selectedIndex; + break; + } + + // don't do anything if we select the blank option + if (index !== 0) { + var now = new Date(); + var this_month = now.getMonth() + 1; + + if (this.getMonth() == this_month && this.use_current_date) { + this.setNow(true); + } else { + this.setDefault(true); + } + } } -}; -SwatDateEntry.prototype.getDay = function() -{ - var day = null; + getDay() { + var day = null; - if (this.day) - day = this.reverseLookup('day', this.day.selectedIndex); + if (this.day) { + day = this.reverseLookup('day', this.day.selectedIndex); + } - return day; -}; + return day; + } -SwatDateEntry.prototype.getMonth = function() -{ - var month = null; + getMonth() { + var month = null; - if (this.month) - month = this.reverseLookup('month', this.month.selectedIndex); + if (this.month) { + month = this.reverseLookup('month', this.month.selectedIndex); + } - return month; -}; + return month; + } -SwatDateEntry.prototype.getYear = function() -{ - var year = null; + getYear() { + var year = null; - if (this.year) - year = this.reverseLookup('year', this.year.selectedIndex); + if (this.year) { + year = this.reverseLookup('year', this.year.selectedIndex); + } - return year; -}; + return year; + } -SwatDateEntry.prototype.setDay = function(day) -{ - if (this.day) { - var this_day = this.lookup('day', day); + setDay(day) { + if (this.day) { + var this_day = this.lookup('day', day); - if (this_day) - this.day.selectedIndex = this_day; - else - this.day.selectedIndex = 0; + if (this_day) { + this.day.selectedIndex = this_day; + } else { + this.day.selectedIndex = 0; + } + } } -}; -SwatDateEntry.prototype.setMonth = function(month) -{ - if (this.month) { - var this_month = this.lookup('month', month); + setMonth(month) { + if (this.month) { + var this_month = this.lookup('month', month); - if (this_month) - this.month.selectedIndex = this_month; - else - this.month.selectedIndex = 0; + if (this_month) { + this.month.selectedIndex = this_month; + } else { + this.month.selectedIndex = 0; + } + } } -}; -SwatDateEntry.prototype.setYear = function(year) -{ - if (this.year) { - var this_year = this.lookup('year', year); + setYear(year) { + if (this.year) { + var this_year = this.lookup('year', year); - if (this_year) - this.year.selectedIndex = this_year; - else - this.year.selectedIndex = 0; + if (this_year) { + this.year.selectedIndex = this_year; + } else { + this.year.selectedIndex = 0; + } + } } -}; +} + +module.exports = SwatDateEntry; From 8984c0e4c101739273d0fc319e4fbea11656d4a7 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Sun, 31 Dec 2017 03:45:54 -0400 Subject: [PATCH 04/35] Use ES6 import and export for modules --- www/javascript/swat-abstract-overlay.js | 4 +-- www/javascript/swat-accordion-page.js | 4 +-- www/javascript/swat-accordion.js | 4 +-- www/javascript/swat-actions.js | 2 +- www/javascript/swat-button.js | 4 +-- www/javascript/swat-calendar.js | 3 +- www/javascript/swat-cascade-child.js | 4 +-- www/javascript/swat-cascade.js | 6 ++-- www/javascript/swat-change-order.js | 3 +- www/javascript/swat-check-all.js | 4 +-- www/javascript/swat-checkbox-cell-renderer.js | 23 ++++++++++----- www/javascript/swat-checkbox-entry-list.js | 6 ++-- www/javascript/swat-checkbox-list.js | 4 +-- www/javascript/swat-date-entry.js | 4 +-- www/javascript/swat-disclosure.js | 4 +-- www/javascript/swat-fieldset.js | 4 +-- www/javascript/swat-form.js | 4 +-- www/javascript/swat-frame-disclosure.js | 6 ++-- www/javascript/swat-image-cropper.js | 4 +-- www/javascript/swat-image-preview-display.js | 4 +-- .../swat-message-display-message.js | 10 +++++-- www/javascript/swat-message-display.js | 6 ++-- www/javascript/swat-progress-bar.js | 2 +- .../swat-radio-button-cell-renderer.js | 4 +-- www/javascript/swat-radio-note-book.js | 3 +- www/javascript/swat-rating.js | 4 +-- www/javascript/swat-search-entry.js | 4 +-- www/javascript/swat-simple-color-entry.js | 6 ++-- www/javascript/swat-table-view-input-row.js | 2 +- www/javascript/swat-table-view.js | 6 ++-- www/javascript/swat-textarea.js | 29 +++++++------------ www/javascript/swat-tile-view.js | 6 ++-- www/javascript/swat-time-entry.js | 4 +-- www/javascript/swat-view.js | 4 +-- www/javascript/swat-z-index-manager.js | 4 +-- www/javascript/swat-z-index-node.js | 4 +-- 36 files changed, 78 insertions(+), 121 deletions(-) diff --git a/www/javascript/swat-abstract-overlay.js b/www/javascript/swat-abstract-overlay.js index 1ec9c17e2..ba4504099 100644 --- a/www/javascript/swat-abstract-overlay.js +++ b/www/javascript/swat-abstract-overlay.js @@ -1,4 +1,4 @@ -const SwatZIndexManager = require('./swat-z-index-manager'); +import SwatZIndexManager from './swat-z-index-manager'; /** * Abstract overlay widget @@ -316,4 +316,4 @@ class SwatAbstractOverlay { SwatAbstractOverlay.close_text = 'Close'; -module.exports = SwatAbstractOverlay; +export default SwatAbstractOverlay; diff --git a/www/javascript/swat-accordion-page.js b/www/javascript/swat-accordion-page.js index c3746d073..c9b0d7d21 100644 --- a/www/javascript/swat-accordion-page.js +++ b/www/javascript/swat-accordion-page.js @@ -1,4 +1,4 @@ -class SwatAccordionPage { +export default class SwatAccordionPage { constructor(el) { this.element = el; this.toggle = YAHOO.util.Dom.getFirstChild(el); @@ -33,5 +33,3 @@ class SwatAccordionPage { } } } - -module.exports = SwatAccordionPage; diff --git a/www/javascript/swat-accordion.js b/www/javascript/swat-accordion.js index 9a2197e16..d06c037d4 100644 --- a/www/javascript/swat-accordion.js +++ b/www/javascript/swat-accordion.js @@ -1,4 +1,4 @@ -const SwatAccordionPage = require('./swat-accordion-page'); +import SwatAccordionPage from './swat-accordion-page'; class SwatAccordion { constructor(id) { @@ -201,4 +201,4 @@ class SwatAccordion { SwatAccordion.resize_period = 0.25; // seconds -module.exports = SwatAccordion; +export default SwatAccordion; diff --git a/www/javascript/swat-actions.js b/www/javascript/swat-actions.js index 781c038cc..87137bed0 100644 --- a/www/javascript/swat-actions.js +++ b/www/javascript/swat-actions.js @@ -167,4 +167,4 @@ SwatActions.select_an_item_text = 'Please select one or more items.'; SwatActions.select_an_item_and_an_action_text = 'Please select an action, and one or more items.'; -module.exports = SwatActions; +export defalult SwatActions; diff --git a/www/javascript/swat-button.js b/www/javascript/swat-button.js index 9640f6583..66da00417 100644 --- a/www/javascript/swat-button.js +++ b/www/javascript/swat-button.js @@ -1,4 +1,4 @@ -class SwatButton { +export default class SwatButton { constructor(id, show_processing_throbber) { this.id = id; @@ -101,5 +101,3 @@ class SwatButton { this.confirmation_message = message; } } - -module.exports = SwatButton; diff --git a/www/javascript/swat-calendar.js b/www/javascript/swat-calendar.js index 58633ee27..25146c4ad 100644 --- a/www/javascript/swat-calendar.js +++ b/www/javascript/swat-calendar.js @@ -20,7 +20,6 @@ * @author Michael Gauthier * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 */ - class SwatCalendar { /** * Creates a SwatCalendar JavaScript object @@ -904,4 +903,4 @@ SwatCalendar.stopEventPropagation = function(e) { }; -module.exports = SwatCalendar; +export default SwatCalendar; diff --git a/www/javascript/swat-cascade-child.js b/www/javascript/swat-cascade-child.js index de5458e8f..8315f4e69 100644 --- a/www/javascript/swat-cascade-child.js +++ b/www/javascript/swat-cascade-child.js @@ -1,9 +1,7 @@ -class SwatCascadeChild { +export default class SwatCascadeChild { constructor(value, title, selected) { this.value = value; this.title = title; this.selected = selected; } } - -module.exports = SwatCascadeChild; diff --git a/www/javascript/swat-cascade.js b/www/javascript/swat-cascade.js index 7304bcdf1..6513fb8f8 100644 --- a/www/javascript/swat-cascade.js +++ b/www/javascript/swat-cascade.js @@ -1,6 +1,6 @@ -const SwatCascadeChild = require('./swat-cascade-child'); +import SwatCascadeChild from './swat-cascade-child'; -class SwatCascade { +export default class SwatCascade { constructor(from_flydown_id, to_flydown_id) { this.from_flydown = document.getElementById(from_flydown_id); this.to_flydown = document.getElementById(to_flydown_id); @@ -82,5 +82,3 @@ class SwatCascade { } } } - -module.exports = SwatCascade; diff --git a/www/javascript/swat-change-order.js b/www/javascript/swat-change-order.js index 71641085b..041f8fab7 100644 --- a/www/javascript/swat-change-order.js +++ b/www/javascript/swat-change-order.js @@ -8,7 +8,6 @@ * @copyright 2004-2016 silverorange * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 */ - class SwatChangeOrder { // {{{ function SwatChangeOrder() @@ -1070,4 +1069,4 @@ function SwatChangeOrder_staticMoveToBottom(change_order, steps) // }}} -module.exports = SwatChangeOrder; +export default SwatChangeOrder; diff --git a/www/javascript/swat-check-all.js b/www/javascript/swat-check-all.js index d1f9a7d34..3263be4dc 100644 --- a/www/javascript/swat-check-all.js +++ b/www/javascript/swat-check-all.js @@ -1,4 +1,4 @@ -class SwatCheckAll { +export default class SwatCheckAll { /** * Creates a new check-all object * @@ -101,5 +101,3 @@ class SwatCheckAll { this.updateExtendedCheckbox(); } } - -module.exports = SwatCheckAll; diff --git a/www/javascript/swat-checkbox-cell-renderer.js b/www/javascript/swat-checkbox-cell-renderer.js index f15ce4743..c8931cf95 100644 --- a/www/javascript/swat-checkbox-cell-renderer.js +++ b/www/javascript/swat-checkbox-cell-renderer.js @@ -1,4 +1,4 @@ -class SwatCheckboxCellRenderer { +export default class SwatCheckboxCellRenderer { /** * Checkbox cell renderer controller * @@ -41,8 +41,13 @@ class SwatCheckboxCellRenderer { this.handleClick, this, true); // prevent selecting label text when shify key is held - YAHOO.util.Event.addListener(input_nodes[i].parentNode, 'mousedown', - this.handleMouseDown, this, true); + YAHOO.util.Event.addListener( + input_nodes[i].parentNode, + 'mousedown', + this.handleMouseDown, + this, + true + ); } } } @@ -117,15 +122,19 @@ class SwatCheckboxCellRenderer { if (checkbox_node.checked) { this.view.selectItem(checkbox_node, this.id); if (shift_key && this.last_clicked_index !== null) { - this.checkBetween(this.last_clicked_index, checkbox_node._index); + this.checkBetween( + this.last_clicked_index, + checkbox_node._index + ); } } else { this.view.deselectItem(checkbox_node, this.id); if (shift_key && this.last_clicked_index !== null) { - this.uncheckBetween(this.last_clicked_index, checkbox_node._index); + this.uncheckBetween( + this.last_clicked_index, + checkbox_node._index + ); } } } } - -module.exports = SwatCheckboxCellRenderer; diff --git a/www/javascript/swat-checkbox-entry-list.js b/www/javascript/swat-checkbox-entry-list.js index 44bbd58c4..dbb5d48b5 100644 --- a/www/javascript/swat-checkbox-entry-list.js +++ b/www/javascript/swat-checkbox-entry-list.js @@ -1,6 +1,6 @@ -const SwatCheckboxList = require('./swat-checkbox-list'); +import SwatCheckboxList from './swat-checkbox-list'; -class SwatCheckboxEntryList extends SwatCheckboxList { +export default class SwatCheckboxEntryList extends SwatCheckboxList { constructor(id) { super(id); this.entry_list = []; @@ -63,5 +63,3 @@ class SwatCheckboxEntryList extends SwatCheckboxList { } } } - -module.exports = SwatCheckboxEntryList; diff --git a/www/javascript/swat-checkbox-list.js b/www/javascript/swat-checkbox-list.js index b910ff9b7..d7091cf74 100644 --- a/www/javascript/swat-checkbox-list.js +++ b/www/javascript/swat-checkbox-list.js @@ -1,4 +1,4 @@ -class SwatCheckboxList { +export default class SwatCheckboxList { /** * JavaScript SwatCheckboxList component * @@ -71,5 +71,3 @@ class SwatCheckboxList { } } } - -module.exports = SwatCheckboxList; diff --git a/www/javascript/swat-date-entry.js b/www/javascript/swat-date-entry.js index 5646c10fb..0a0dfb10c 100644 --- a/www/javascript/swat-date-entry.js +++ b/www/javascript/swat-date-entry.js @@ -1,4 +1,4 @@ -class SwatDateEntry { +export default class SwatDateEntry { constructor(id, use_current_date) { this.id = id; this.use_current_date = use_current_date; @@ -318,5 +318,3 @@ class SwatDateEntry { } } } - -module.exports = SwatDateEntry; diff --git a/www/javascript/swat-disclosure.js b/www/javascript/swat-disclosure.js index 2fdf52af0..d5fab943f 100644 --- a/www/javascript/swat-disclosure.js +++ b/www/javascript/swat-disclosure.js @@ -1,4 +1,4 @@ -class SwatDisclosure { +export defaukt class SwatDisclosure { constructor(id, open) { this.id = id; this.div = document.getElementById(id); @@ -234,5 +234,3 @@ class SwatDisclosure { this.semaphore = false; } } - -module.exports = SwatDisclosure; diff --git a/www/javascript/swat-fieldset.js b/www/javascript/swat-fieldset.js index a1c6ca2d2..8fd3aa9d1 100644 --- a/www/javascript/swat-fieldset.js +++ b/www/javascript/swat-fieldset.js @@ -1,4 +1,4 @@ -class SwatFieldset { +export default class SwatFieldset { constructor(id) { this.id = id; YAHOO.util.Event.onAvailable(this.id, this.init, this, true); @@ -35,5 +35,3 @@ class SwatFieldset { } } } - -module.exports = SwatFieldset; diff --git a/www/javascript/swat-form.js b/www/javascript/swat-form.js index 2d8d3b1a6..a84cf9885 100644 --- a/www/javascript/swat-form.js +++ b/www/javascript/swat-form.js @@ -1,4 +1,4 @@ -class SwatForm { +export default class SwatForm { constructor(id, connection_close_url) { this.id = id; this.form_element = document.getElementById(id); @@ -47,5 +47,3 @@ class SwatForm { } } } - -module.exports = SwatForm; diff --git a/www/javascript/swat-frame-disclosure.js b/www/javascript/swat-frame-disclosure.js index 637f6dc5f..4b245d2f9 100644 --- a/www/javascript/swat-frame-disclosure.js +++ b/www/javascript/swat-frame-disclosure.js @@ -1,6 +1,6 @@ -const SwatDisclosure = require('./swat-disclosure'); +import SwatDisclosure from './swat-disclosure'; -class SwatFrameDisclosure extends SwatDisclosure { +export default class SwatFrameDisclosure extends SwatDisclosure { getSpan() { return this.div.firstChild.firstChild; } @@ -61,5 +61,3 @@ class SwatFrameDisclosure extends SwatDisclosure { ); } } - -module.exports = SwatFrameDisclosure; diff --git a/www/javascript/swat-image-cropper.js b/www/javascript/swat-image-cropper.js index 5dc14b187..1230b8a73 100644 --- a/www/javascript/swat-image-cropper.js +++ b/www/javascript/swat-image-cropper.js @@ -1,4 +1,4 @@ -class SwatImageCropper { +export default class SwatImageCropper { constructor(id, config) { this.id = id; @@ -23,5 +23,3 @@ class SwatImageCropper { this.crop_box_y.value = coords.top; } } - -module.exports = SwatImageCropper; diff --git a/www/javascript/swat-image-preview-display.js b/www/javascript/swat-image-preview-display.js index ddb44f95a..1d6c75b97 100644 --- a/www/javascript/swat-image-preview-display.js +++ b/www/javascript/swat-image-preview-display.js @@ -1,4 +1,4 @@ -const SwatZIndexManager = require('./swat-z-index-manager'); +import SwatZIndexManager from './swat-z-index-manager'; class SwatImagePreviewDisplay { constructor(id, preview_src, preview_width, preview_height, show_title, preview_title) { @@ -290,4 +290,4 @@ SwatImagePreviewDisplay.close_text = 'Close'; */ SwatImagePreviewDisplay.padding = 16; -module.exports = SwatImagePreviewDisplay; +export default SwatImagePreviewDisplay; diff --git a/www/javascript/swat-message-display-message.js b/www/javascript/swat-message-display-message.js index 131a01812..6b0ad20df 100644 --- a/www/javascript/swat-message-display-message.js +++ b/www/javascript/swat-message-display-message.js @@ -19,11 +19,15 @@ class SwatMessageDisplayMessage { anchor.href = '#'; anchor.title = SwatMessageDisplayMessage.close_text; YAHOO.util.Dom.addClass(anchor, 'swat-message-display-dismiss-link'); - YAHOO.util.Event.addListener(anchor, 'click', + YAHOO.util.Event.addListener( + anchor, + 'click', function(e, message) { YAHOO.util.Event.preventDefault(e); message.hide(); - }, this); + }, + this + ); anchor.appendChild(text); @@ -134,4 +138,4 @@ SwatMessageDisplayMessage.close_text = 'Dismiss message'; SwatMessageDisplayMessage.fade_duration = 0.3; SwatMessageDisplayMessage.shrink_duration = 0.3; -module.exports = SwatMessageDisplayMessage; +export default SwatMessageDisplayMessage; diff --git a/www/javascript/swat-message-display.js b/www/javascript/swat-message-display.js index fcc878cae..dd37e6a83 100644 --- a/www/javascript/swat-message-display.js +++ b/www/javascript/swat-message-display.js @@ -1,6 +1,6 @@ -const SwatMessageDisplayMessage = require('./swat-message-display-message'); +import SwatMessageDisplayMessage from './swat-message-display-message'; -class SwatMessageDisplay { +export default class SwatMessageDisplay { constructor(id, hideable_messages) { this.id = id; this.messages = []; @@ -22,5 +22,3 @@ class SwatMessageDisplay { return false; } } - -module.exports = SwatMessageDisplay; diff --git a/www/javascript/swat-progress-bar.js b/www/javascript/swat-progress-bar.js index 6fabe6979..af08476ed 100644 --- a/www/javascript/swat-progress-bar.js +++ b/www/javascript/swat-progress-bar.js @@ -272,4 +272,4 @@ SwatProgressBar.EPSILON = 0.0001; SwatProgressBar.ANIMATION_DURATION = 0.5; -module.exports = SwatProgressBar; +export default SwatProgressBar; diff --git a/www/javascript/swat-radio-button-cell-renderer.js b/www/javascript/swat-radio-button-cell-renderer.js index 933e8295e..5b9903426 100644 --- a/www/javascript/swat-radio-button-cell-renderer.js +++ b/www/javascript/swat-radio-button-cell-renderer.js @@ -1,4 +1,4 @@ -class SwatRadioButtonCellRenderer { +export default class SwatRadioButtonCellRenderer { /** * Radio button cell renderer controller * @@ -51,5 +51,3 @@ class SwatRadioButtonCellRenderer { } } } - -module.exports = SwatRadioButtonCellRenderer; diff --git a/www/javascript/swat-radio-note-book.js b/www/javascript/swat-radio-note-book.js index 8f073068c..acf4dc725 100644 --- a/www/javascript/swat-radio-note-book.js +++ b/www/javascript/swat-radio-note-book.js @@ -6,7 +6,6 @@ class SwatRadioNoteBook { YAHOO.util.Event.onDOMReady(this.init, this, true); } - init() { var table = document.getElementById(this.id); @@ -190,4 +189,4 @@ class SwatRadioNoteBook { SwatRadioNoteBook.FADE_DURATION = 0.25; SwatRadioNoteBook.SLIDE_DURATION = 0.15; -module.exports = SwatRadioNoteBook; +export default SwatRadioNoteBook; diff --git a/www/javascript/swat-rating.js b/www/javascript/swat-rating.js index 9910bb1e1..f9a550705 100644 --- a/www/javascript/swat-rating.js +++ b/www/javascript/swat-rating.js @@ -48,7 +48,7 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ -class SwatRating { +export default class SwatRating { constructor(id, max_value) { this.id = id; this.max_value = max_value; @@ -217,5 +217,3 @@ class SwatRating { } } } - -module.exports = SwatRating; diff --git a/www/javascript/swat-search-entry.js b/www/javascript/swat-search-entry.js index f9b85406e..381121956 100644 --- a/www/javascript/swat-search-entry.js +++ b/www/javascript/swat-search-entry.js @@ -1,4 +1,4 @@ -class SwatSearchEntry { +export default class SwatSearchEntry { constructor(id) { this.id = id; this.input = document.getElementById(this.id); @@ -211,5 +211,3 @@ class SwatSearchEntry { } } } - -module.exports = SwatSearchEntry; diff --git a/www/javascript/swat-simple-color-entry.js b/www/javascript/swat-simple-color-entry.js index 9baef6c1a..ec69fa8e2 100644 --- a/www/javascript/swat-simple-color-entry.js +++ b/www/javascript/swat-simple-color-entry.js @@ -1,6 +1,6 @@ -const SwatAbstractOverlay = require('./swat-abstract-overlay'); +import SwatAbstractOverlay from './swat-abstract-overlay'; -class SwatSimpleColorEntry extends SwatAbstractOverlay { +export default class SwatSimpleColorEntry extends SwatAbstractOverlay { /** * Simple color entry widget * @@ -309,5 +309,3 @@ class SwatSimpleColorEntry extends SwatAbstractOverlay { } } } - -module.exports = SwatSimpleColorEntry; diff --git a/www/javascript/swat-table-view-input-row.js b/www/javascript/swat-table-view-input-row.js index 9a9e757ca..e85d494dc 100644 --- a/www/javascript/swat-table-view-input-row.js +++ b/www/javascript/swat-table-view-input-row.js @@ -321,4 +321,4 @@ if (!document.importNode || SwatTableViewInputRow.is_webkit) { } } -module.exports = SwatTableViewInputRow; +export default SwatTableViewInputRow; diff --git a/www/javascript/swat-table-view.js b/www/javascript/swat-table-view.js index f69e6b9cb..75c37edec 100644 --- a/www/javascript/swat-table-view.js +++ b/www/javascript/swat-table-view.js @@ -1,6 +1,6 @@ -const SwatView = require('./swat-view'); +import SwatView from './swat-view'; -class SwatTableView extends SwatView { +export default class SwatTableView extends SwatView { /** * JavaScript for the SwatTableView widget * @@ -143,5 +143,3 @@ class SwatTableView extends SwatView { } } } - -module.exports = SwatTableView; diff --git a/www/javascript/swat-textarea.js b/www/javascript/swat-textarea.js index 4d9a0644b..8d71e53b5 100644 --- a/www/javascript/swat-textarea.js +++ b/www/javascript/swat-textarea.js @@ -230,8 +230,7 @@ SwatTextarea.supports_resize = (function() { // }}} // {{{ SwatTextarea.registerPendingTextarea() -SwatTextarea.registerPendingTextarea = function(textarea) -{ +SwatTextarea.registerPendingTextarea = function(textarea) { SwatTextarea.pending_textareas.push(textarea); if (SwatTextarea.pending_interval === null) { @@ -245,8 +244,7 @@ SwatTextarea.registerPendingTextarea = function(textarea) // }}} // {{{ SwatTextarea.pollPendingTextareas() -SwatTextarea.pollPendingTextareas = function() -{ +SwatTextarea.pollPendingTextareas = function() { for (var i = 0; i < SwatTextarea.pending_textareas.length; i++) { if (SwatTextarea.pending_textareas[i].textarea.offsetWidth > 0) { SwatTextarea.pending_textareas[i].initialize(); @@ -272,8 +270,7 @@ SwatTextarea.pollPendingTextareas = function() * * @return boolean false */ -SwatTextarea.mousedownEventHandler = function(e, handle) -{ +SwatTextarea.mousedownEventHandler = function(e, handle) { // prevent text selection YAHOO.util.Event.preventDefault(e); @@ -324,8 +321,7 @@ SwatTextarea.mousedownEventHandler = function(e, handle) * * @return boolean false */ -SwatTextarea.touchstartEventHandler = function(e, handle) -{ +SwatTextarea.touchstartEventHandler = function(e, handle) { // prevent text selection YAHOO.util.Event.preventDefault(e); @@ -375,8 +371,7 @@ SwatTextarea.touchstartEventHandler = function(e, handle) * * @return boolean false. */ -SwatTextarea.mousemoveEventHandler = function(e, handle) -{ +SwatTextarea.mousemoveEventHandler = function(e, handle) { var resize_handle = SwatTextarea.dragging_item; var textarea = resize_handle._textarea; @@ -384,8 +379,9 @@ SwatTextarea.mousemoveEventHandler = function(e, handle) SwatTextarea.dragging_mouse_origin_y; var height = SwatTextarea.dragging_origin_height + delta; - if (height >= SwatTextarea.min_height) + if (height >= SwatTextarea.min_height) { textarea.style.height = height + 'px'; + } return false; }; @@ -402,8 +398,7 @@ SwatTextarea.mousemoveEventHandler = function(e, handle) * * @return boolean false. */ -SwatTextarea.touchmoveEventHandler = function(e, handle) -{ +SwatTextarea.touchmoveEventHandler = function(e, handle) { var resize_handle = SwatTextarea.dragging_item; var textarea = resize_handle._textarea; @@ -440,8 +435,7 @@ SwatTextarea.touchmoveEventHandler = function(e, handle) * * @return boolean false. */ -SwatTextarea.mouseupEventHandler = function(e, handle) -{ +SwatTextarea.mouseupEventHandler = function(e, handle) { // only allow left click to do things var is_webkit = (/AppleWebKit|Konqueror|KHTML/gi).test(navigator.userAgent); var is_ie = (navigator.userAgent.indexOf('MSIE') != -1); @@ -489,11 +483,10 @@ SwatTextarea.mouseupEventHandler = function(e, handle) * * @return boolean false. */ -SwatTextarea.touchendEventHandler = function(e, handle) -{ +SwatTextarea.touchendEventHandler = function(e, handle) { return SwatTextarea.mouseupEventHandler(e, handle); }; // }}} -module.exports = SwatTextarea; +export default SwatTextarea; diff --git a/www/javascript/swat-tile-view.js b/www/javascript/swat-tile-view.js index a585b78e3..1051eabc7 100644 --- a/www/javascript/swat-tile-view.js +++ b/www/javascript/swat-tile-view.js @@ -1,6 +1,6 @@ -const SwatView = require('./swat-view'); +import SwatView from './swat-view'; -class SwatTileView extends SwatView { +export default class SwatTileView extends SwatView { /** * JavaScript for the SwatTileView widget * @@ -94,5 +94,3 @@ class SwatTileView extends SwatView { } } } - -module.exports = SwatTileView; diff --git a/www/javascript/swat-time-entry.js b/www/javascript/swat-time-entry.js index c06e06b5e..d6ec74554 100644 --- a/www/javascript/swat-time-entry.js +++ b/www/javascript/swat-time-entry.js @@ -1,4 +1,4 @@ -class SwatTimeEntry { +export default class SwatTimeEntry { constructor(id, use_current_time) { this.id = id; this.use_current_time = use_current_time; @@ -274,5 +274,3 @@ class SwatTimeEntry { } } } - -module.exports = SwatTimeEntry; diff --git a/www/javascript/swat-view.js b/www/javascript/swat-view.js index ed20a5cc7..73ad63ab9 100644 --- a/www/javascript/swat-view.js +++ b/www/javascript/swat-view.js @@ -1,4 +1,4 @@ -class SwatView { +export default class SwatView { /** * Creates a new recordset view * @@ -176,5 +176,3 @@ class SwatView { return selected; } } - -module.exports = SwatView; diff --git a/www/javascript/swat-z-index-manager.js b/www/javascript/swat-z-index-manager.js index dae6ca66f..536e719c0 100644 --- a/www/javascript/swat-z-index-manager.js +++ b/www/javascript/swat-z-index-manager.js @@ -1,4 +1,4 @@ -const SwatZIndexNode = require('./swat-z-index-node'); +import SwatZIndexNode from './swat-z-index-node'; /** * An object to manage element z-indexes for a webpage @@ -182,4 +182,4 @@ SwatZIndexManager.removeElement = function(element, group) { return element; }; -module.exports = SwatZIndexManager; +export default SwatZIndexManager; diff --git a/www/javascript/swat-z-index-node.js b/www/javascript/swat-z-index-node.js index 5c644ae3e..75058bfe1 100644 --- a/www/javascript/swat-z-index-node.js +++ b/www/javascript/swat-z-index-node.js @@ -1,4 +1,4 @@ -class SwatZIndexNode { +export default class SwatZIndexNode { constructor(element) { if (element) { this.element = element; @@ -37,5 +37,3 @@ class SwatZIndexNode { return found; } } - -module.exports = SwatZIndexNode; From b4bd07fc8c133fdd3b20e667fbd39ea8ec7ac219 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Sun, 31 Dec 2017 04:00:36 -0400 Subject: [PATCH 05/35] Add bundle file for webpack --- www/javascript/index.js | 67 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 www/javascript/index.js diff --git a/www/javascript/index.js b/www/javascript/index.js new file mode 100644 index 000000000..fcbc2c1cd --- /dev/null +++ b/www/javascript/index.js @@ -0,0 +1,67 @@ +import SwatAccordion from './swat-accordion'; +import SwatActions from './swat-actions'; +import SwatButton from './swat-button'; +import SwatCalendar from './swat-calendar'; +import SwatCascade from './swat-cascade'; +import SwatChangeOrder from './swat-change-order'; +import SwatCheckAll from './swat-check-all'; +import SwatCheckboxCellRenderer from './swat-checkbox-cell-renderer'; +import SwatCheckboxEntryList from './swat-checkbox-entry-list'; +import SwatCheckboxList from './swat-checkbox-list'; +import SwatColorEntry from './swat-color-entry'; +import SwatDateEntry from './swat-date-entry'; +import SwatDisclosure from './swat-disclosure'; +import SwatExpandableCheckboxTree from './swat-expandable-checkbox-tree'; +import SwatFieldset from './swat-fieldset'; +import SwatForm from './swat-form'; +import SwatFrameDisclosure from './swat-frame-disclosure'; +import SwatImageCropper from './swat-image-cropper'; +import SwatImagePreviewDisplay from './swat-image-preview-display'; +import SwatMessageDisplay from './swat-message-display'; +import SwatProgressBar from './swat-progress-bar'; +import SwatRadioButtonCellRenderer from './swat-radio-button-cell-renderer'; +import SwatRadioNoteBook from './swat-radio-note-book'; +import SwatRating from './swat-rating'; +import SwatSearchEntry from './swat-search-entry'; +import SwatSimpleColorEntry from './swat-simple-color-entry'; +import SwatTableViewInputRow from './swat-table-view-input-row'; +import SwatTableView from './swat-table-view'; +import SwatTextarea from './swat-textarea'; +import SwatTileView from './swat-tile-view'; +import SwatTimeEntry from './swat-time-entry'; +import SwatView from './swat-view'; +import SwatZIndexManager from './swat-z-index-manager'; + +global.SwatAccordion = SwatAccordion; +global.SwatActions = SwatActions; +global.SwatButton = SwatButton; +global.SwatCalendar = SwatCalendar; +global.SwatCascade = SwatCascade; +global.SwatChangeOrder = SwatChangeOrder; +global.SwatCheckAll = SwatCheckAll; +global.SwatCheckboxCellRenderer = SwatCheckboxCellRenderer; +global.SwatCheckboxEntryList = SwatCheckboxEntryList; +global.SwatCheckboxList = SwatCheckboxList; +global.SwatColorEntry = SwatColorEntry; +global.SwatDateEntry = SwatDateEntry; +global.SwatDisclosure = SwatDisclosure; +global.SwatExpandableCheckboxTree = SwatExpandableCheckboxTree; +global.SwatFieldset = SwatFieldset; +global.SwatForm = SwatForm; +global.SwatFrameDisclosure = SwatFrameDisclosure; +global.SwatImageCropper = SwatImageCropper; +global.SwatImagePreviewDisplay = SwatImagePreviewDisplay; +global.SwatMessageDisplay = SwatMessageDisplay; +global.SwatProgressBar = SwatProgressBar; +global.SwatRadioButtonCellRenderer = SwatRadioButtonCellRenderer; +global.SwatRadioNoteBook = SwatRadioNoteBook; +global.SwatRating = SwatRating; +global.SwatSearchEntry = SwatSearchEntry; +global.SwatSimpleColorEntry = SwatSimpleColorEntry; +global.SwatTableViewInputRow = SwatTableViewInputRow; +global.SwatTableView = SwatTableView; +global.SwatTextarea = SwatTextarea; +global.SwatTileView = SwatTileView; +global.SwatTimeEntry = SwatTimeEntry; +global.SwatView = SwatView; +global.SwatZIndexManager = SwatZIndexManager; From 90081c998b0840ebd8dbd3e6e12802cde351ee1e Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Sun, 31 Dec 2017 04:48:22 -0400 Subject: [PATCH 06/35] Make the demo app work again --- demo/.gitignore | 1 + demo/autoloader-rules.conf | 3 - demo/composer.json | 85 ++++++++++++++++++++ demo/include/demos/DetailsViewDemo.php | 4 +- demo/include/demos/TableViewDemo.php | 4 +- demo/include/demos/TableViewInputRowDemo.php | 4 +- demo/include/demos/TileViewDemo.php | 4 +- demo/include/demos/ViewSelectorDemo.php | 4 +- demo/www/index.php | 3 +- demo/www/packages/swat | 2 +- demo/www/packages/yui | 1 + 11 files changed, 99 insertions(+), 16 deletions(-) create mode 100644 demo/.gitignore delete mode 100644 demo/autoloader-rules.conf create mode 100644 demo/composer.json create mode 120000 demo/www/packages/yui diff --git a/demo/.gitignore b/demo/.gitignore new file mode 100644 index 000000000..61ead8666 --- /dev/null +++ b/demo/.gitignore @@ -0,0 +1 @@ +/vendor diff --git a/demo/autoloader-rules.conf b/demo/autoloader-rules.conf deleted file mode 100644 index ba7e1ed31..000000000 --- a/demo/autoloader-rules.conf +++ /dev/null @@ -1,3 +0,0 @@ -# Swat Package -/^Swat(.*)?Exception$/ Swat/exceptions/Swat$1Exception.php 1 -/^Swat(.*)/ Swat/Swat$1.php 1 diff --git a/demo/composer.json b/demo/composer.json new file mode 100644 index 000000000..f1aba0dd8 --- /dev/null +++ b/demo/composer.json @@ -0,0 +1,85 @@ +{ + "name": "silverorange/swat-demo", + "description": "Demo of Swat", + "type": "library", + "keywords": [ "swat", "toolkit", "widget", "demo" ], + "homepage": "https://code.silverorange.com/swat", + "license": "LGPL-2.1", + "authors": [ + { + "name": "Charles Waddell", + "email": "charles@silverorange.com" + }, + { + "name": "Isaac Grant", + "email": "isaac@silverorange.com" + }, + { + "name": "Michael Gauthier", + "email": "mike@silverorange.com" + }, + { + "name": "Nathan Frederikson", + "email": "nathan@silverorange.com" + }, + { + "name": "Nick Burka", + "email": "nick@silverorange.com" + }, + { + "name": "Steven Garrity", + "email": "steven@silverorange.com" + } + ], + "repositories": [ + { + "type": "composer", + "url": "https://composer", + "options": { + "ssl": { + "cafile": "/Users/gauthierm/composer.crt" + } + } + }, + { + "packagist": false + } + ], + "require": { + "php": ">=5.6.0", + "ext-dom": "*", + "ext-iconv": "*", + "ext-intl": "*", + "ext-mbstring": "*", + "ext-pcre": "*", + "pear/pear_exception": "^1.0.0", + "silverorange/mdb2": "^3.1.1", + "silverorange/concentrate": "^1.0.0", + "silverorange/yui": "^1.0.11" + }, + "require-dev": { + "silverorange/coding-standard": "^0.6.0" + }, + "autoload": { + "classmap": [ + "include/", + "vendor/silverorange/swat/Swat", + "vendor/silverorange/swat/SwatDB", + "vendor/silverorange/swat/SwatI18N" + ] + }, + "scripts": { + "lint": "./vendor/bin/phpcs", + "pre-autoload-dump": [ + "rm -rf ./vendor/silverorange/swat && ln -s ../../../ ./vendor/silverorange/swat" + ], + "post-install-cmd": [ + "rm -rf ./vendor/silverorange/swat && ln -s ../../../ ./vendor/silverorange/swat", + "./vendor/bin/phpcs --config-set installed_paths vendor/silverorange/coding-standard/src" + ], + "post-update-cmd": [ + "rm -rf ./vendor/silverorange/swat && ln -s ../../../ ./vendor/silverorange/swat", + "./vendor/bin/phpcs --config-set installed_paths vendor/silverorange/coding-standard/src" + ] + } +} diff --git a/demo/include/demos/DetailsViewDemo.php b/demo/include/demos/DetailsViewDemo.php index 95cbb1d41..5cc9741f1 100644 --- a/demo/include/demos/DetailsViewDemo.php +++ b/demo/include/demos/DetailsViewDemo.php @@ -17,7 +17,7 @@ public function buildDemoUI(SwatUI $ui) { $details_view = $ui->getWidget('details_view'); - $fruit = new FruitObject(); + $fruit = new DetailsFruitObject(); $fruit->align = 'middle'; $fruit->title = 'Apple'; @@ -50,7 +50,7 @@ public function buildDemoUI(SwatUI $ui) * @copyright 2005-2016 silverorange * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 */ -class FruitObject +class DetailsFruitObject { // {{{ public properties diff --git a/demo/include/demos/TableViewDemo.php b/demo/include/demos/TableViewDemo.php index 2529d4409..a6cfc04fb 100644 --- a/demo/include/demos/TableViewDemo.php +++ b/demo/include/demos/TableViewDemo.php @@ -37,7 +37,7 @@ public function buildDemoUI(SwatUI $ui) $table_store = new SwatTableStore(); foreach ($data as $datum) { - $fruit = new FruitObject(); + $fruit = new TableFruitObject(); $fruit->image = $datum[0]; $fruit->image_width = $datum[1]; $fruit->image_height = $datum[2]; @@ -64,7 +64,7 @@ public function buildDemoUI(SwatUI $ui) * @copyright 2005-2016 silverorange * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 */ -class FruitObject +class TableFruitObject { // {{{ public properties diff --git a/demo/include/demos/TableViewInputRowDemo.php b/demo/include/demos/TableViewInputRowDemo.php index 1ac6abb95..fe0dc2608 100644 --- a/demo/include/demos/TableViewInputRowDemo.php +++ b/demo/include/demos/TableViewInputRowDemo.php @@ -34,7 +34,7 @@ public function buildDemoUI(SwatUI $ui) $table_store = new SwatTableStore(); foreach ($data as $datum) { - $fruit = new FruitObject(); + $fruit = new InputFruitObject(); $fruit->title = $datum[0]; $fruit->makes_jam = $datum[1]; $fruit->makes_pie = $datum[2]; @@ -55,7 +55,7 @@ public function buildDemoUI(SwatUI $ui) * @copyright 2006-2016 silverorange * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 */ -class FruitObject +class InputFruitObject { // {{{ public properties diff --git a/demo/include/demos/TileViewDemo.php b/demo/include/demos/TileViewDemo.php index b1c19183d..7ea8e0977 100644 --- a/demo/include/demos/TileViewDemo.php +++ b/demo/include/demos/TileViewDemo.php @@ -88,7 +88,7 @@ public function buildDemoUI(SwatUI $ui) $table_store = new SwatTableStore(); foreach ($data as $datum) { - $fruit = new FruitObject(); + $fruit = new TileFruitObject(); $fruit->image = $datum[0]; $fruit->image_width = $datum[1]; @@ -116,7 +116,7 @@ public function buildDemoUI(SwatUI $ui) * @copyright 2005-2016 silverorange * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 */ -class FruitObject +class TileFruitObject { // {{{ public properties diff --git a/demo/include/demos/ViewSelectorDemo.php b/demo/include/demos/ViewSelectorDemo.php index 3b126d1ce..e9961a23a 100644 --- a/demo/include/demos/ViewSelectorDemo.php +++ b/demo/include/demos/ViewSelectorDemo.php @@ -27,7 +27,7 @@ public function buildDemoUI(SwatUI $ui) $table_store = new SwatTableStore(); foreach ($data as $datum) { - $fruit = new FruitObject(); + $fruit = new SelectorFruitObject(); $fruit->image = $datum[0]; $fruit->image_width = $datum[1]; $fruit->image_height = $datum[2]; @@ -58,7 +58,7 @@ public function buildDemoUI(SwatUI $ui) * @copyright 2009-2016 silverorange * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 */ -class FruitObject +class SelectorFruitObject { // {{{ public properties diff --git a/demo/www/index.php b/demo/www/index.php index 2ad9742e8..29b4c9898 100644 --- a/demo/www/index.php +++ b/demo/www/index.php @@ -2,8 +2,7 @@ setlocale(LC_ALL, 'fr_FR.utf8'); -require_once __DIR__.'/vendor/autoload.php'; -require_once __DIR__.'/../include/DemoApplication.php'; +require_once __DIR__.'/../vendor/autoload.php'; SwatException::setupHandler(); diff --git a/demo/www/packages/swat b/demo/www/packages/swat index 6a0aec973..e3bcf6986 120000 --- a/demo/www/packages/swat +++ b/demo/www/packages/swat @@ -1 +1 @@ -../../../www/ \ No newline at end of file +../../vendor/silverorange/swat/www \ No newline at end of file diff --git a/demo/www/packages/yui b/demo/www/packages/yui new file mode 120000 index 000000000..e0477ef2c --- /dev/null +++ b/demo/www/packages/yui @@ -0,0 +1 @@ +../../vendor/silverorange/yui/www \ No newline at end of file From 0533d4168c5d474f10e6c725393d2f4911049684 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Sun, 31 Dec 2017 04:49:51 -0400 Subject: [PATCH 07/35] Add readme for demo --- demo/README.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 demo/README.md diff --git a/demo/README.md b/demo/README.md new file mode 100644 index 000000000..d0062eb87 --- /dev/null +++ b/demo/README.md @@ -0,0 +1,6 @@ +Running The Demo +================ + 1. run `composer install` + 2. go into the `www` directory + 3. run `php -S localhost:8000` + 4. visit http://localhost:8000/ in your browser From 4bf068e907818e1835b71bdd2778e2ac904d71b4 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Sun, 31 Dec 2017 05:27:01 -0400 Subject: [PATCH 08/35] Fix minor typos --- www/javascript/index.js | 66 +++++++++---------- www/javascript/swat-actions.js | 2 +- www/javascript/swat-checkbox-entry-list.js | 2 +- www/javascript/swat-disclosure.js | 2 +- .../swat-message-display-message.js | 4 +- www/javascript/swat-progress-bar.js | 2 +- www/javascript/swat-table-view-input-row.js | 5 +- www/javascript/swat-table-view.js | 2 +- www/javascript/swat-time-entry.js | 2 +- 9 files changed, 42 insertions(+), 45 deletions(-) diff --git a/www/javascript/index.js b/www/javascript/index.js index fcbc2c1cd..fab9dd63e 100644 --- a/www/javascript/index.js +++ b/www/javascript/index.js @@ -32,36 +32,36 @@ import SwatTimeEntry from './swat-time-entry'; import SwatView from './swat-view'; import SwatZIndexManager from './swat-z-index-manager'; -global.SwatAccordion = SwatAccordion; -global.SwatActions = SwatActions; -global.SwatButton = SwatButton; -global.SwatCalendar = SwatCalendar; -global.SwatCascade = SwatCascade; -global.SwatChangeOrder = SwatChangeOrder; -global.SwatCheckAll = SwatCheckAll; -global.SwatCheckboxCellRenderer = SwatCheckboxCellRenderer; -global.SwatCheckboxEntryList = SwatCheckboxEntryList; -global.SwatCheckboxList = SwatCheckboxList; -global.SwatColorEntry = SwatColorEntry; -global.SwatDateEntry = SwatDateEntry; -global.SwatDisclosure = SwatDisclosure; -global.SwatExpandableCheckboxTree = SwatExpandableCheckboxTree; -global.SwatFieldset = SwatFieldset; -global.SwatForm = SwatForm; -global.SwatFrameDisclosure = SwatFrameDisclosure; -global.SwatImageCropper = SwatImageCropper; -global.SwatImagePreviewDisplay = SwatImagePreviewDisplay; -global.SwatMessageDisplay = SwatMessageDisplay; -global.SwatProgressBar = SwatProgressBar; -global.SwatRadioButtonCellRenderer = SwatRadioButtonCellRenderer; -global.SwatRadioNoteBook = SwatRadioNoteBook; -global.SwatRating = SwatRating; -global.SwatSearchEntry = SwatSearchEntry; -global.SwatSimpleColorEntry = SwatSimpleColorEntry; -global.SwatTableViewInputRow = SwatTableViewInputRow; -global.SwatTableView = SwatTableView; -global.SwatTextarea = SwatTextarea; -global.SwatTileView = SwatTileView; -global.SwatTimeEntry = SwatTimeEntry; -global.SwatView = SwatView; -global.SwatZIndexManager = SwatZIndexManager; +window.SwatAccordion = SwatAccordion; +window.SwatActions = SwatActions; +window.SwatButton = SwatButton; +window.SwatCalendar = SwatCalendar; +window.SwatCascade = SwatCascade; +window.SwatChangeOrder = SwatChangeOrder; +window.SwatCheckAll = SwatCheckAll; +window.SwatCheckboxCellRenderer = SwatCheckboxCellRenderer; +window.SwatCheckboxEntryList = SwatCheckboxEntryList; +window.SwatCheckboxList = SwatCheckboxList; +window.SwatColorEntry = SwatColorEntry; +window.SwatDateEntry = SwatDateEntry; +window.SwatDisclosure = SwatDisclosure; +window.SwatExpandableCheckboxTree = SwatExpandableCheckboxTree; +window.SwatFieldset = SwatFieldset; +window.SwatForm = SwatForm; +window.SwatFrameDisclosure = SwatFrameDisclosure; +window.SwatImageCropper = SwatImageCropper; +window.SwatImagePreviewDisplay = SwatImagePreviewDisplay; +window.SwatMessageDisplay = SwatMessageDisplay; +window.SwatProgressBar = SwatProgressBar; +window.SwatRadioButtonCellRenderer = SwatRadioButtonCellRenderer; +window.SwatRadioNoteBook = SwatRadioNoteBook; +window.SwatRating = SwatRating; +window.SwatSearchEntry = SwatSearchEntry; +window.SwatSimpleColorEntry = SwatSimpleColorEntry; +window.SwatTableViewInputRow = SwatTableViewInputRow; +window.SwatTableView = SwatTableView; +window.SwatTextarea = SwatTextarea; +window.SwatTileView = SwatTileView; +window.SwatTimeEntry = SwatTimeEntry; +window.SwatView = SwatView; +window.SwatZIndexManager = SwatZIndexManager; diff --git a/www/javascript/swat-actions.js b/www/javascript/swat-actions.js index 87137bed0..b2c7cd030 100644 --- a/www/javascript/swat-actions.js +++ b/www/javascript/swat-actions.js @@ -167,4 +167,4 @@ SwatActions.select_an_item_text = 'Please select one or more items.'; SwatActions.select_an_item_and_an_action_text = 'Please select an action, and one or more items.'; -export defalult SwatActions; +export default SwatActions; diff --git a/www/javascript/swat-checkbox-entry-list.js b/www/javascript/swat-checkbox-entry-list.js index dbb5d48b5..41773295c 100644 --- a/www/javascript/swat-checkbox-entry-list.js +++ b/www/javascript/swat-checkbox-entry-list.js @@ -57,7 +57,7 @@ export default class SwatCheckboxEntryList extends SwatCheckboxList { } } - updateFields = function() { + updateFields() { for (var i = 0; i < this.check_list.length; i++) { this.setEntrySensitivity(i, this.check_list[i].checked); } diff --git a/www/javascript/swat-disclosure.js b/www/javascript/swat-disclosure.js index d5fab943f..041fb7b7c 100644 --- a/www/javascript/swat-disclosure.js +++ b/www/javascript/swat-disclosure.js @@ -1,4 +1,4 @@ -export defaukt class SwatDisclosure { +export default class SwatDisclosure { constructor(id, open) { this.id = id; this.div = document.getElementById(id); diff --git a/www/javascript/swat-message-display-message.js b/www/javascript/swat-message-display-message.js index 6b0ad20df..7290f428a 100644 --- a/www/javascript/swat-message-display-message.js +++ b/www/javascript/swat-message-display-message.js @@ -126,11 +126,9 @@ class SwatMessageDisplayMessage { remove() { YAHOO.util.Event.purgeElement(this.message_div, true); - var removed_node = this.message_div.parentNode.removeChild( + this.message_div.parentNode.removeChild( this.message_div ); - - delete removed_node; }; } diff --git a/www/javascript/swat-progress-bar.js b/www/javascript/swat-progress-bar.js index af08476ed..0333e2578 100644 --- a/www/javascript/swat-progress-bar.js +++ b/www/javascript/swat-progress-bar.js @@ -192,7 +192,7 @@ class SwatProgressBar { } } - getValue = function() { + getValue() { return this.value; } diff --git a/www/javascript/swat-table-view-input-row.js b/www/javascript/swat-table-view-input-row.js index e85d494dc..051c61435 100644 --- a/www/javascript/swat-table-view-input-row.js +++ b/www/javascript/swat-table-view-input-row.js @@ -186,8 +186,7 @@ class SwatTableViewInputRow { var row_id = this.id + '_row_' + replicator_id; var row = document.getElementById(row_id); if (row && row.parentNode !== null) { - var removed_row = row.parentNode.removeChild(row); - delete removed_row; + row.parentNode.removeChild(row); } } } @@ -241,7 +240,7 @@ function SwatTableViewInputRow_getXMLParser() * Mozilla, Safari and Opera have a proprietary DOMParser() * class. */ - dom_parser = new DOMParser(); + var dom_parser = new DOMParser(); // Cannot add loadXML method to a newly created DOMParser because it // crashes Safari diff --git a/www/javascript/swat-table-view.js b/www/javascript/swat-table-view.js index 75c37edec..2b4bea547 100644 --- a/www/javascript/swat-table-view.js +++ b/www/javascript/swat-table-view.js @@ -67,7 +67,7 @@ export default class SwatTableView extends SwatView { * @param String selector an identifier of the object that selected the * item node. */ - selectItem = function(node, selector) { + selectItem(node, selector) { super.selectItem(node, selector); var row_node = this.getItemNode(node); diff --git a/www/javascript/swat-time-entry.js b/www/javascript/swat-time-entry.js index d6ec74554..3e7176c8c 100644 --- a/www/javascript/swat-time-entry.js +++ b/www/javascript/swat-time-entry.js @@ -12,7 +12,7 @@ export default class SwatTimeEntry { this.date_entry = null; - if (this.hour) + if (this.hour) { YAHOO.util.Event.addListener( this.hour, 'change', From ba67c88f4f469e70646f9a987c89df44b8fd53b1 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Sun, 31 Dec 2017 05:27:34 -0400 Subject: [PATCH 09/35] Add webpack config and update demo to use it --- demo/.gitignore | 1 + demo/include/layout.php | 26 ++++++++++++-------------- demo/package.json | 17 +++++++++++++++++ demo/webpack.config.js | 23 +++++++++++++++++++++++ 4 files changed, 53 insertions(+), 14 deletions(-) create mode 100644 demo/package.json create mode 100644 demo/webpack.config.js diff --git a/demo/.gitignore b/demo/.gitignore index 61ead8666..26d6131fb 100644 --- a/demo/.gitignore +++ b/demo/.gitignore @@ -1 +1,2 @@ /vendor +/node_modules diff --git a/demo/include/layout.php b/demo/include/layout.php index ca90bd062..113e591fe 100644 --- a/demo/include/layout.php +++ b/demo/include/layout.php @@ -1,16 +1,14 @@ - - - - - - - - - <?php echo $title; ?> - - - - - + + + + + + + <?php echo $title; ?> + + + + + diff --git a/demo/package.json b/demo/package.json new file mode 100644 index 000000000..790c4a5c4 --- /dev/null +++ b/demo/package.json @@ -0,0 +1,17 @@ +{ + "name": "swat-demo", + "scripts": { + "build": "webpack", + "postinstall": "NODE_ENV=production webpack --optimize-minimize" + }, + "dependencies": { + "babel-core": "^6.26.0", + "babel-loader": "^7.1.2", + "babel-preset-env": "^1.6.1", + "css-loader": "^0.28.7", + "extract-text-webpack-plugin": "^3.0.2", + "style-loader": "^0.19.1", + "url-loader": "^0.5.7", + "webpack": "^3.10.0" + } +} diff --git a/demo/webpack.config.js b/demo/webpack.config.js new file mode 100644 index 000000000..c5f809769 --- /dev/null +++ b/demo/webpack.config.js @@ -0,0 +1,23 @@ +module.exports = { + entry: './vendor/silverorange/swat/www/javascript/index.js', + output: { + filename: 'www/bundle.js' + }, + module: { + rules: [ + { + test: /\.js$/, + exclude: /(node_modules)/, + use: { + loader: 'babel-loader', + options: { + presets: ['env'] + } + } + } + ] + }, + resolve: { + symlinks: false + } +}; From d11c36995d4176b1124309d5647882880fa63612 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Sun, 31 Dec 2017 06:07:39 -0400 Subject: [PATCH 10/35] Import CSS in JS --- www/javascript/index.js | 14 ++++++++++++++ www/javascript/swat-accordion.js | 1 + www/javascript/swat-actions.js | 2 ++ www/javascript/swat-calendar.js | 2 ++ www/javascript/swat-change-order.js | 2 ++ www/javascript/swat-checkbox-entry-list.js | 1 + www/javascript/swat-disclosure.js | 2 ++ www/javascript/swat-frame-disclosure.js | 1 + www/javascript/swat-image-preview-display.js | 1 + www/javascript/swat-message-display-message.js | 2 ++ www/javascript/swat-message-display.js | 1 + www/javascript/swat-progress-bar.js | 2 ++ www/javascript/swat-radio-note-book.js | 2 ++ www/javascript/swat-rating.js | 2 ++ www/javascript/swat-search-entry.js | 2 ++ www/javascript/swat-simple-color-entry.js | 1 + www/javascript/swat-table-view.js | 1 + www/javascript/swat-textarea.js | 2 ++ www/javascript/swat-tile-view.js | 1 + 19 files changed, 42 insertions(+) diff --git a/www/javascript/index.js b/www/javascript/index.js index fab9dd63e..cae5d3e22 100644 --- a/www/javascript/index.js +++ b/www/javascript/index.js @@ -18,6 +18,7 @@ import SwatFrameDisclosure from './swat-frame-disclosure'; import SwatImageCropper from './swat-image-cropper'; import SwatImagePreviewDisplay from './swat-image-preview-display'; import SwatMessageDisplay from './swat-message-display'; +import SwatMessageDisplayMessage from './swat-message-display-message'; import SwatProgressBar from './swat-progress-bar'; import SwatRadioButtonCellRenderer from './swat-radio-button-cell-renderer'; import SwatRadioNoteBook from './swat-radio-note-book'; @@ -32,6 +33,18 @@ import SwatTimeEntry from './swat-time-entry'; import SwatView from './swat-view'; import SwatZIndexManager from './swat-z-index-manager'; +import '../styles/swat-details-view.css'; +import '../styles/swat-menu.css'; +import '../styles/swat-money-cell-renderer.css'; +import '../styles/swat-note-book.css'; +import '../styles/swat-null-text-cell-renderer.css'; +import '../styles/swat-pagination.css'; +import '../styles/swat-radio-list.css'; +import '../styles/swat-radio-table.css'; +import '../styles/swat-tool-link.css'; +import '../styles/swat-toolbar.css'; +import '../styles/swat.css'; + window.SwatAccordion = SwatAccordion; window.SwatActions = SwatActions; window.SwatButton = SwatButton; @@ -52,6 +65,7 @@ window.SwatFrameDisclosure = SwatFrameDisclosure; window.SwatImageCropper = SwatImageCropper; window.SwatImagePreviewDisplay = SwatImagePreviewDisplay; window.SwatMessageDisplay = SwatMessageDisplay; +window.SwatMessageDisplayMessage = SwatMessageDisplayMessage; window.SwatProgressBar = SwatProgressBar; window.SwatRadioButtonCellRenderer = SwatRadioButtonCellRenderer; window.SwatRadioNoteBook = SwatRadioNoteBook; diff --git a/www/javascript/swat-accordion.js b/www/javascript/swat-accordion.js index d06c037d4..632d19ff4 100644 --- a/www/javascript/swat-accordion.js +++ b/www/javascript/swat-accordion.js @@ -1,4 +1,5 @@ import SwatAccordionPage from './swat-accordion-page'; +import '../styles/swat-accordion.css'; class SwatAccordion { constructor(id) { diff --git a/www/javascript/swat-actions.js b/www/javascript/swat-actions.js index b2c7cd030..4a03cada5 100644 --- a/www/javascript/swat-actions.js +++ b/www/javascript/swat-actions.js @@ -1,3 +1,5 @@ +import '../styles/swat-actions.css'; + class SwatActions { constructor(id, values, selected) { this.id = id; diff --git a/www/javascript/swat-calendar.js b/www/javascript/swat-calendar.js index 25146c4ad..6c8743220 100644 --- a/www/javascript/swat-calendar.js +++ b/www/javascript/swat-calendar.js @@ -1,3 +1,5 @@ +import '../styles/swat-calendar.css'; + /** * Calendar Widget Version 1.0 * diff --git a/www/javascript/swat-change-order.js b/www/javascript/swat-change-order.js index 041f8fab7..540b84694 100644 --- a/www/javascript/swat-change-order.js +++ b/www/javascript/swat-change-order.js @@ -1,3 +1,5 @@ +import '../styles/swat-change-order.css'; + /** * An orderable list control widget * diff --git a/www/javascript/swat-checkbox-entry-list.js b/www/javascript/swat-checkbox-entry-list.js index 41773295c..084662928 100644 --- a/www/javascript/swat-checkbox-entry-list.js +++ b/www/javascript/swat-checkbox-entry-list.js @@ -1,4 +1,5 @@ import SwatCheckboxList from './swat-checkbox-list'; +import '../styles/swat-checkbox-entry-list.css'; export default class SwatCheckboxEntryList extends SwatCheckboxList { constructor(id) { diff --git a/www/javascript/swat-disclosure.js b/www/javascript/swat-disclosure.js index 041fb7b7c..395c0bb0a 100644 --- a/www/javascript/swat-disclosure.js +++ b/www/javascript/swat-disclosure.js @@ -1,3 +1,5 @@ +import '../styles/swat-disclosure.css'; + export default class SwatDisclosure { constructor(id, open) { this.id = id; diff --git a/www/javascript/swat-frame-disclosure.js b/www/javascript/swat-frame-disclosure.js index 4b245d2f9..d246df1df 100644 --- a/www/javascript/swat-frame-disclosure.js +++ b/www/javascript/swat-frame-disclosure.js @@ -1,4 +1,5 @@ import SwatDisclosure from './swat-disclosure'; +import '../styles/swat-frame-disclosure.css'; export default class SwatFrameDisclosure extends SwatDisclosure { getSpan() { diff --git a/www/javascript/swat-image-preview-display.js b/www/javascript/swat-image-preview-display.js index 1d6c75b97..90272f0d4 100644 --- a/www/javascript/swat-image-preview-display.js +++ b/www/javascript/swat-image-preview-display.js @@ -1,4 +1,5 @@ import SwatZIndexManager from './swat-z-index-manager'; +import '../styles/swat-image-preview-display.css'; class SwatImagePreviewDisplay { constructor(id, preview_src, preview_width, preview_height, show_title, preview_title) { diff --git a/www/javascript/swat-message-display-message.js b/www/javascript/swat-message-display-message.js index 7290f428a..4b21b591e 100644 --- a/www/javascript/swat-message-display-message.js +++ b/www/javascript/swat-message-display-message.js @@ -1,3 +1,5 @@ +import '../styles/swat-message.css'; + class SwatMessageDisplayMessage { /** * A message in a message display diff --git a/www/javascript/swat-message-display.js b/www/javascript/swat-message-display.js index dd37e6a83..9b88e8bb8 100644 --- a/www/javascript/swat-message-display.js +++ b/www/javascript/swat-message-display.js @@ -1,4 +1,5 @@ import SwatMessageDisplayMessage from './swat-message-display-message'; +import '../styles/swat-message-display.css'; export default class SwatMessageDisplay { constructor(id, hideable_messages) { diff --git a/www/javascript/swat-progress-bar.js b/www/javascript/swat-progress-bar.js index 0333e2578..26744e523 100644 --- a/www/javascript/swat-progress-bar.js +++ b/www/javascript/swat-progress-bar.js @@ -1,3 +1,5 @@ +import '../styles/swat-progress-bar.css'; + /** * Progress bar * diff --git a/www/javascript/swat-radio-note-book.js b/www/javascript/swat-radio-note-book.js index acf4dc725..1444947c7 100644 --- a/www/javascript/swat-radio-note-book.js +++ b/www/javascript/swat-radio-note-book.js @@ -1,3 +1,5 @@ +import '../styles/swat-radio-note-book.css'; + class SwatRadioNoteBook { constructor(id) { this.id = id; diff --git a/www/javascript/swat-rating.js b/www/javascript/swat-rating.js index f9a550705..701a1e049 100644 --- a/www/javascript/swat-rating.js +++ b/www/javascript/swat-rating.js @@ -1,3 +1,5 @@ +import '../styles/swat-rating.css'; + /** * Rating control for Swat * diff --git a/www/javascript/swat-search-entry.js b/www/javascript/swat-search-entry.js index 381121956..6dde61e1f 100644 --- a/www/javascript/swat-search-entry.js +++ b/www/javascript/swat-search-entry.js @@ -1,3 +1,5 @@ +import '../styles/swat-search-entry.css'; + export default class SwatSearchEntry { constructor(id) { this.id = id; diff --git a/www/javascript/swat-simple-color-entry.js b/www/javascript/swat-simple-color-entry.js index ec69fa8e2..c120e19a7 100644 --- a/www/javascript/swat-simple-color-entry.js +++ b/www/javascript/swat-simple-color-entry.js @@ -1,4 +1,5 @@ import SwatAbstractOverlay from './swat-abstract-overlay'; +import '../styles/swat-color-entry.css'; export default class SwatSimpleColorEntry extends SwatAbstractOverlay { /** diff --git a/www/javascript/swat-table-view.js b/www/javascript/swat-table-view.js index 2b4bea547..505ec5213 100644 --- a/www/javascript/swat-table-view.js +++ b/www/javascript/swat-table-view.js @@ -1,4 +1,5 @@ import SwatView from './swat-view'; +import '../styles/swat-table-view.css'; export default class SwatTableView extends SwatView { /** diff --git a/www/javascript/swat-textarea.js b/www/javascript/swat-textarea.js index 8d71e53b5..0dcf2a875 100644 --- a/www/javascript/swat-textarea.js +++ b/www/javascript/swat-textarea.js @@ -1,3 +1,5 @@ +import '../styles/swat-textarea.css'; + /** * A resizeable textarea widget * diff --git a/www/javascript/swat-tile-view.js b/www/javascript/swat-tile-view.js index 1051eabc7..d5197f806 100644 --- a/www/javascript/swat-tile-view.js +++ b/www/javascript/swat-tile-view.js @@ -1,4 +1,5 @@ import SwatView from './swat-view'; +import '../styles/swat-tile-view.css'; export default class SwatTileView extends SwatView { /** From 8d9116c75bb85518ee72f1e2822659e9df7d029f Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Sun, 31 Dec 2017 06:08:01 -0400 Subject: [PATCH 11/35] Add fileloader and extract text plugins --- demo/package.json | 3 ++- demo/webpack.config.js | 27 ++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/demo/package.json b/demo/package.json index 790c4a5c4..8f286b3f7 100644 --- a/demo/package.json +++ b/demo/package.json @@ -2,7 +2,7 @@ "name": "swat-demo", "scripts": { "build": "webpack", - "postinstall": "NODE_ENV=production webpack --optimize-minimize" + "optimize": "webpack --optimize-minimize" }, "dependencies": { "babel-core": "^6.26.0", @@ -10,6 +10,7 @@ "babel-preset-env": "^1.6.1", "css-loader": "^0.28.7", "extract-text-webpack-plugin": "^3.0.2", + "file-loader": "^1.1.6", "style-loader": "^0.19.1", "url-loader": "^0.5.7", "webpack": "^3.10.0" diff --git a/demo/webpack.config.js b/demo/webpack.config.js index c5f809769..575923103 100644 --- a/demo/webpack.config.js +++ b/demo/webpack.config.js @@ -1,3 +1,5 @@ +const ExtractTextPlugin = require('extract-text-webpack-plugin'); + module.exports = { entry: './vendor/silverorange/swat/www/javascript/index.js', output: { @@ -5,6 +7,14 @@ module.exports = { }, module: { rules: [ + { + test: /\.css$/, + exclude: /(node_modules)/, + use: ExtractTextPlugin.extract({ + fallback: 'style-loader', + use: [ 'css-loader' ] + }) + }, { test: /\.js$/, exclude: /(node_modules)/, @@ -14,10 +24,25 @@ module.exports = { presets: ['env'] } } + }, + { + test: /\.(gif|png|jpe?g|svg)$/i, + exclude: /(node_modules)/, + use: { + loader: 'file-loader', + options: { + useRelativePath: true, + publicPath: 'images/', + outputPath: 'www/images/' + } + } } ] }, resolve: { symlinks: false - } + }, + plugins: [ + new ExtractTextPlugin('www/bundle.css') + ] }; From 9b0e34930b2c472302cfaa934db05385823224c5 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Sun, 31 Dec 2017 06:08:17 -0400 Subject: [PATCH 12/35] Add styles to layout --- demo/include/layout.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demo/include/layout.php b/demo/include/layout.php index 113e591fe..caa7cefe7 100644 --- a/demo/include/layout.php +++ b/demo/include/layout.php @@ -4,7 +4,8 @@ - + + <?php echo $title; ?> From 82f746cd7f11c4f33e61f4cec7d75012d23cb012 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Sun, 31 Dec 2017 06:20:44 -0400 Subject: [PATCH 13/35] Fix method signature --- Swat/SwatGroupedFlydown.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Swat/SwatGroupedFlydown.php b/Swat/SwatGroupedFlydown.php index 18f29560a..b24a26f3f 100644 --- a/Swat/SwatGroupedFlydown.php +++ b/Swat/SwatGroupedFlydown.php @@ -24,8 +24,16 @@ class SwatGroupedFlydown extends SwatTreeFlydown * * @throws SwatException if the tree more than 3 levels deep. */ - public function setTree(SwatTreeFlydownNode $tree) + public function setTree($tree) { + if (!$tree instanceof SwatTreeFlydownNode) { + throw new SwatInvalidClassException( + 'Tree must be an intance of SwatDataTreeNode.', + 0, + $tree + ); + } + $this->checkTree($tree); parent::setTree($tree); } From 9abf7ce7e44f76e59faba9056e946a81fab7aad0 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Mon, 1 Jan 2018 03:39:15 -0400 Subject: [PATCH 14/35] Use Webpack shimming to modularize YUI2 components --- Swat/SwatButton.php | 33 ++----- demo/include/layout.php | 5 +- demo/package.json | 1 + demo/webpack.config.js | 50 ++++++++-- www/javascript/index.js | 22 +++++ www/javascript/swat-abstract-overlay.js | 75 +++++--------- www/javascript/swat-accordion-page.js | 30 ++---- www/javascript/swat-accordion.js | 57 ++++++----- www/javascript/swat-actions.js | 63 ++++++------ www/javascript/swat-button.js | 97 ++++++++----------- www/javascript/swat-disclosure.js | 44 +++++---- www/javascript/swat-form.js | 4 +- .../swat-message-display-message.js | 26 ++--- www/javascript/swat-simple-color-entry.js | 38 ++++---- www/javascript/yui.js | 12 +++ 15 files changed, 292 insertions(+), 265 deletions(-) create mode 100644 www/javascript/yui.js diff --git a/Swat/SwatButton.php b/Swat/SwatButton.php index 5b22b3fae..3d3d15d01 100644 --- a/Swat/SwatButton.php +++ b/Swat/SwatButton.php @@ -365,36 +365,19 @@ protected function getJavaScriptClass() */ protected function getInlineJavaScript() { - $show_processing_throbber = $this->show_processing_throbber - ? 'true' - : 'false'; + $options = [ + 'show_processing_throbber' => $this->show_processing_throbber, + 'processing_message' => $this->processing_throbber_message, + 'confirmation_message' => $this->confirmation_message, + ]; - $javascript = sprintf( - "var %s_obj = new %s('%s', %s);", + $javascript = sprintf("var %s_obj = new %s(%s, %s);", $this->id, $this->getJavaScriptClass(), - $this->id, - $show_processing_throbber + SwatString::quoteJavaScriptString($this->id), + json_encode($options) ); - if ($this->show_processing_throbber) { - $javascript .= sprintf( - "\n%s_obj.setProcessingMessage(%s);", - $this->id, - SwatString::quoteJavaScriptString( - $this->processing_throbber_message - ) - ); - } - - if ($this->confirmation_message !== null) { - $javascript .= sprintf( - "\n%s_obj.setConfirmationMessage(%s);", - $this->id, - SwatString::quoteJavaScriptString($this->confirmation_message) - ); - } - return $javascript; } diff --git a/demo/include/layout.php b/demo/include/layout.php index caa7cefe7..b0d7316fb 100644 --- a/demo/include/layout.php +++ b/demo/include/layout.php @@ -2,9 +2,8 @@ - - - + + <?php echo $title; ?> diff --git a/demo/package.json b/demo/package.json index 8f286b3f7..181eaa7ff 100644 --- a/demo/package.json +++ b/demo/package.json @@ -9,6 +9,7 @@ "babel-loader": "^7.1.2", "babel-preset-env": "^1.6.1", "css-loader": "^0.28.7", + "exports-loader": "^0.6.4", "extract-text-webpack-plugin": "^3.0.2", "file-loader": "^1.1.6", "style-loader": "^0.19.1", diff --git a/demo/webpack.config.js b/demo/webpack.config.js index 575923103..65e0617e0 100644 --- a/demo/webpack.config.js +++ b/demo/webpack.config.js @@ -1,9 +1,12 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin'); +const ProvidePlugin = require('webpack').ProvidePlugin; module.exports = { - entry: './vendor/silverorange/swat/www/javascript/index.js', + entry: { + swat: './vendor/silverorange/swat/www/javascript/index.js', + }, output: { - filename: 'www/bundle.js' + filename: 'www/[name].js' }, module: { rules: [ @@ -36,13 +39,48 @@ module.exports = { outputPath: 'www/images/' } } - } - ] + }, + { + test: /yahoo\/yahoo.js$/, + use: 'exports-loader?YAHOO' + }, + { + test: /dom\/dom.js$/, + use: 'exports-loader?Dom=YAHOO.util.Dom' + }, + { + test: /event\/event.js$/, + use: 'exports-loader?Event=YAHOO.util.Event,CustomEvent=YAHOO.util.CustomEvent,Subscriber=YAHOO.util.Subscriber' + }, + { + test: /animation\/animation.js$/, + use: 'exports-loader?Anim=YAHOO.util.Anim,AnimMgr=YAHOO.util.AnimMgr,Easing=YAHOO.util.Easing' + }, + { + test: /container\/container_core.js$/, + use: 'exports-loader?Config=YAHOO.util.Config,Module=YAHOO.widget.Module,Overlay=YAHOO.widget.Overlay,OverlayManager=YAHOO.widget.OverlayManager,ContainerEffect=YAHOO.widget.ContainerEffect' + }, + ], }, resolve: { symlinks: false }, plugins: [ - new ExtractTextPlugin('www/bundle.css') - ] + new ExtractTextPlugin('www/swat.css'), + new ProvidePlugin({ + YAHOO: '../../../yui/www/yahoo/yahoo', + 'YAHOO.util.Dom': ['../../../yui/www/dom/dom', 'Dom'], + 'YAHOO.util.Event': ['../../../yui/www/event/event', 'Event'], + 'YAHOO.util.CustomEvent': ['../../../yui/www/event/event', 'CustomEvent'], + 'YAHOO.util.Subscriber': ['../../../yui/www/event/event', 'Subscriber'], + 'YAHOO.util.Anim': ['../../../yui/www/animation/animation', 'Anim'], + 'YAHOO.util.AnimMgr': ['../../../yui/www/animation/animation', 'AnimMgr'], + 'YAHOO.util.Easing': ['../../../yui/www/animation/animation', 'Easing'], + 'YAHOO.util.Config': ['../../../yui/www/container/container_core', 'Config'], + 'YAHOO.widget.Module': ['../../../yui/www/container/container_core', 'Module'], + 'YAHOO.widget.Overlay': ['../../../yui/www/container/container_core', 'Overlay'], + 'YAHOO.widget.OverlayManager': ['../../../yui/www/container/container_core', 'OverlayManager'], + 'YAHOO.widget.ContainerEffect': ['../../../yui/www/container/container_core', 'ContainerEffect'], + }), + ], }; diff --git a/www/javascript/index.js b/www/javascript/index.js index cae5d3e22..0bb086f98 100644 --- a/www/javascript/index.js +++ b/www/javascript/index.js @@ -1,6 +1,8 @@ +import SwatAbstractOverlay from './swat-abstract-overlay'; import SwatAccordion from './swat-accordion'; import SwatActions from './swat-actions'; import SwatButton from './swat-button'; +/* import SwatCalendar from './swat-calendar'; import SwatCascade from './swat-cascade'; import SwatChangeOrder from './swat-change-order'; @@ -10,27 +12,36 @@ import SwatCheckboxEntryList from './swat-checkbox-entry-list'; import SwatCheckboxList from './swat-checkbox-list'; import SwatColorEntry from './swat-color-entry'; import SwatDateEntry from './swat-date-entry'; +*/ import SwatDisclosure from './swat-disclosure'; +/* import SwatExpandableCheckboxTree from './swat-expandable-checkbox-tree'; import SwatFieldset from './swat-fieldset'; +*/ import SwatForm from './swat-form'; import SwatFrameDisclosure from './swat-frame-disclosure'; +/* import SwatImageCropper from './swat-image-cropper'; import SwatImagePreviewDisplay from './swat-image-preview-display'; +*/ import SwatMessageDisplay from './swat-message-display'; import SwatMessageDisplayMessage from './swat-message-display-message'; +/* import SwatProgressBar from './swat-progress-bar'; import SwatRadioButtonCellRenderer from './swat-radio-button-cell-renderer'; import SwatRadioNoteBook from './swat-radio-note-book'; import SwatRating from './swat-rating'; import SwatSearchEntry from './swat-search-entry'; +*/ import SwatSimpleColorEntry from './swat-simple-color-entry'; +/* import SwatTableViewInputRow from './swat-table-view-input-row'; import SwatTableView from './swat-table-view'; import SwatTextarea from './swat-textarea'; import SwatTileView from './swat-tile-view'; import SwatTimeEntry from './swat-time-entry'; import SwatView from './swat-view'; +*/ import SwatZIndexManager from './swat-z-index-manager'; import '../styles/swat-details-view.css'; @@ -45,9 +56,11 @@ import '../styles/swat-tool-link.css'; import '../styles/swat-toolbar.css'; import '../styles/swat.css'; +window.SwatAbstractOverlay = SwatAbstractOverlay; window.SwatAccordion = SwatAccordion; window.SwatActions = SwatActions; window.SwatButton = SwatButton; +/* window.SwatCalendar = SwatCalendar; window.SwatCascade = SwatCascade; window.SwatChangeOrder = SwatChangeOrder; @@ -57,25 +70,34 @@ window.SwatCheckboxEntryList = SwatCheckboxEntryList; window.SwatCheckboxList = SwatCheckboxList; window.SwatColorEntry = SwatColorEntry; window.SwatDateEntry = SwatDateEntry; +*/ window.SwatDisclosure = SwatDisclosure; +/* window.SwatExpandableCheckboxTree = SwatExpandableCheckboxTree; window.SwatFieldset = SwatFieldset; +*/ window.SwatForm = SwatForm; window.SwatFrameDisclosure = SwatFrameDisclosure; +/* window.SwatImageCropper = SwatImageCropper; window.SwatImagePreviewDisplay = SwatImagePreviewDisplay; +*/ window.SwatMessageDisplay = SwatMessageDisplay; window.SwatMessageDisplayMessage = SwatMessageDisplayMessage; +/* window.SwatProgressBar = SwatProgressBar; window.SwatRadioButtonCellRenderer = SwatRadioButtonCellRenderer; window.SwatRadioNoteBook = SwatRadioNoteBook; window.SwatRating = SwatRating; window.SwatSearchEntry = SwatSearchEntry; +*/ window.SwatSimpleColorEntry = SwatSimpleColorEntry; +/* window.SwatTableViewInputRow = SwatTableViewInputRow; window.SwatTableView = SwatTableView; window.SwatTextarea = SwatTextarea; window.SwatTileView = SwatTileView; window.SwatTimeEntry = SwatTimeEntry; window.SwatView = SwatView; +*/ window.SwatZIndexManager = SwatZIndexManager; diff --git a/www/javascript/swat-abstract-overlay.js b/www/javascript/swat-abstract-overlay.js index ba4504099..d478da5a9 100644 --- a/www/javascript/swat-abstract-overlay.js +++ b/www/javascript/swat-abstract-overlay.js @@ -1,3 +1,5 @@ +import { Overlay } from '../../../yui/www/container/container_core'; + import SwatZIndexManager from './swat-z-index-manager'; /** @@ -24,7 +26,13 @@ class SwatAbstractOverlay { // list of select elements to hide for IE6 this.select_elements = []; - YAHOO.util.Event.onDOMReady(this.init, this, true); + this.init = this.init.bind(this); + this.toggle = this.toggle.bind(this); + this.close = this.close.bind(this); + this.handleCloseLink = this.handleCloseLink.bind(this); + this.handleKeyPress = this.handleKeyPress.bind(this); + + document.addEventListener('DOMContentLoaded', this.init); } // }}} @@ -42,7 +50,7 @@ class SwatAbstractOverlay { draw() { this.overlay_content = document.createElement('div'); this.overlay_content.id = this.id + '_overlay'; - YAHOO.util.Dom.addClass(this.overlay_content, 'swat-overlay'); + this.overlay_content.classList.add('swat-overlay'); this.overlay_content.style.display = 'none'; this.overlay_content.appendChild(this.getHeader()); @@ -60,12 +68,11 @@ class SwatAbstractOverlay { getToggleButton() { var toggle_button = document.createElement('button'); - YAHOO.util.Dom.addClass(toggle_button, 'swat-overlay-toggle-button'); + toggle_button.classList.add('swat-overlay-toggle-button'); // the type property is readonly in IE so use setAttribute() here toggle_button.setAttribute('type', 'button'); - - YAHOO.util.Event.on(toggle_button, 'click', this.toggle, this, true); + toggle_button.addEventListener('click', this.toggle); return toggle_button; } @@ -75,7 +82,7 @@ class SwatAbstractOverlay { getHeader() { var header = document.createElement('div'); - YAHOO.util.Dom.addClass(header, 'hd'); + header.classList.add('hd'); header.appendChild(this.getCloseLink()); return header; } @@ -85,7 +92,7 @@ class SwatAbstractOverlay { getBody() { var body = document.createElement('div'); - YAHOO.util.Dom.addClass(body, 'bd'); + body.classList.add('bd'); return body; } @@ -94,7 +101,7 @@ class SwatAbstractOverlay { getFooter() { var footer = document.createElement('div'); - YAHOO.util.Dom.addClass(footer, 'ft'); + footer.classList.add('ft'); return footer; } @@ -111,13 +118,7 @@ class SwatAbstractOverlay { SwatAbstractOverlay.close_text ) ); - YAHOO.util.Event.on( - close_link, - 'click', - this.handleCloseLink, - this, - true - ); + close_link.addEventListener('click', this.handleCloseLink); return close_link; } @@ -129,7 +130,7 @@ class SwatAbstractOverlay { * Creates overlay widget when toggle button has been drawn */ createOverlay(event) { - this.overlay = new YAHOO.widget.Overlay( + this.overlay = new Overlay( this.id + '_overlay', { visible: false, constraintoviewport: true } ); @@ -216,7 +217,7 @@ class SwatAbstractOverlay { this.close_div.className = 'swat-overlay-close-div'; this.close_div.style.display = 'none'; - YAHOO.util.Event.on(this.close_div, 'click', this.close, this, true); + this.close_div.addEventListener('click', this.close); this.container.appendChild(this.close_div); } @@ -225,17 +226,7 @@ class SwatAbstractOverlay { // {{{ showCloseDiv() showCloseDiv() { - if (YAHOO.env.ua.ie == 6) { - this.select_elements = document.getElementsByTagName('select'); - for (var i = 0; i < this.select_elements.length; i++) { - this.select_elements[i].style._visibility = - this.select_elements[i].style.visibility; - - this.select_elements[i].style.visibility = 'hidden'; - } - } - - this.close_div.style.height = YAHOO.util.Dom.getDocumentHeight() + 'px'; + this.close_div.style.height = document.body.clientHeight + 'px'; this.close_div.style.display = 'block'; SwatZIndexManager.raiseElement(this.close_div); } @@ -246,19 +237,13 @@ class SwatAbstractOverlay { hideCloseDiv() { SwatZIndexManager.lowerElement(this.close_div); this.close_div.style.display = 'none'; - if (YAHOO.env.ua.ie == 6) { - for (var i = 0; i < this.select_elements.length; i++) { - this.select_elements[i].style.visibility = - this.select_elements[i].style._visibility; - } - } } // }}} // {{{ handleKeyPress() handleKeyPress(e) { - YAHOO.util.Event.preventDefault(e); + e.preventDefault(); // close preview on backspace or escape if (e.keyCode === 8 || e.keyCode === 27) { @@ -272,7 +257,7 @@ class SwatAbstractOverlay { handleKeyPress(e) { // close preview on escape or enter key if (e.keyCode === 27 || e.keyCode === 13) { - YAHOO.util.Event.preventDefault(e); + e.preventDefault(); this.close(); } } @@ -281,33 +266,21 @@ class SwatAbstractOverlay { // {{{ addKeyPressHandler() addKeyPressHandler() { - YAHOO.util.Event.on( - document, - 'keypress', - this.handleKeyPress, - this, - true - ); + document.addEventListener('keypress', this.handleKeyPress); } // }}} // {{{ removeKeyPressHandler() removeKeyPressHandler() { - YAHOO.util.Event.removeListener( - document, - 'keypress', - this.handleKeyPress, - this, - true - ); + document.removeEventListener('keypress', this.handleKeyPress); } // }}} // {{{ handleCloseLink() handleCloseLink(e) { - YAHOO.util.Event.preventDefault(e); + e.preventDefault(); this.close(); } diff --git a/www/javascript/swat-accordion-page.js b/www/javascript/swat-accordion-page.js index c9b0d7d21..3e855aa1b 100644 --- a/www/javascript/swat-accordion-page.js +++ b/www/javascript/swat-accordion-page.js @@ -1,35 +1,25 @@ +import { Dom } from '../../../yui/www/dom/dom'; + export default class SwatAccordionPage { constructor(el) { this.element = el; - this.toggle = YAHOO.util.Dom.getFirstChild(el); - this.toggleLink = YAHOO.util.Dom.getElementsByClassName( + this.toggle = Dom.getFirstChild(el); + this.toggleLink = Dom.getElementsByClassName( 'swat-accordion-page-link', 'a', this.toggle )[0]; - this.animation = YAHOO.util.Dom.getNextSibling(this.toggle); - this.content = YAHOO.util.Dom.getFirstChild(this.animation); + this.animation = Dom.getNextSibling(this.toggle); + this.content = Dom.getFirstChild(this.animation); } setStatus(status) { if (status === 'opened') { - YAHOO.util.Dom.removeClass( - this.element, - 'swat-accordion-page-closed' - ); - YAHOO.util.Dom.addClass( - this.element, - 'swat-accordion-page-opened' - ); + this.element.classList.remove('swat-accordion-page-closed'); + this.element.classList.add('swat-accordion-page-opened'); } else { - YAHOO.util.Dom.removeClass( - this.element, - 'swat-accordion-page-opened' - ); - YAHOO.util.Dom.addClass( - this.element, - 'swat-accordion-page-closed' - ); + this.element.classList.remove('swat-accordion-page-opened'); + this.element.classList.add('swat-accordion-page-closed'); } } } diff --git a/www/javascript/swat-accordion.js b/www/javascript/swat-accordion.js index 632d19ff4..1780d5705 100644 --- a/www/javascript/swat-accordion.js +++ b/www/javascript/swat-accordion.js @@ -1,4 +1,9 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { CustomEvent } from '../../../yui/www/event/event'; +import { Anim, Easing } from '../../../yui/www/animation/animation'; + import SwatAccordionPage from './swat-accordion-page'; + import '../styles/swat-accordion.css'; class SwatAccordion { @@ -8,10 +13,12 @@ class SwatAccordion { this.animate = true; this.always_open = true; // by default, always keep one page open this.semaphore = false; - this.pageChangeEvent = new YAHOO.util.CustomEvent('pageChange'); - this.postInitEvent = new YAHOO.util.CustomEvent('postInit'); + this.pageChangeEvent = new CustomEvent('pageChange'); + this.postInitEvent = new CustomEvent('postInit'); - YAHOO.util.Event.onDOMReady(this.init, this, true); + this.init = this.init.bind(this); + + document.addEventListener('DOMContentLoaded', this.init); } init() { @@ -19,7 +26,7 @@ class SwatAccordion { this.pages = []; var page; - var pages = YAHOO.util.Dom.getChildren(this.container); + var pages = Dom.getChildren(this.container); // check to see if a page is open via a hash-tag var hash_open_page = this.getPageFromHash(); @@ -34,30 +41,25 @@ class SwatAccordion { this.addLinkHash(page); if (hash_open_page === page.element || (hash_open_page === null && - YAHOO.util.Dom.hasClass(page.element, 'selected')) + page.element.classList.contains('selected')) ) { this.current_page = page; - YAHOO.util.Dom.removeClass(page.element, 'selected'); - YAHOO.util.Dom.addClass( - page.element, - 'swat-accordion-page-opened' - ); + page.element.classList.remove('selected'); + page.element.classList.add('swat-accordion-page-opened'); } else { page.animation.style.display = 'none'; - YAHOO.util.Dom.addClass( - page.element, - 'swat-accordion-page-closed' - ); + page.element.classList.add('swat-accordion-page-closed'); } var that = this; (function() { var the_page = page; - YAHOO.util.Event.on(page.toggleLink, 'click', function (e) { + page.toggleLink.addEventListener('click', function (e) { + var set_page; if (!that.always_open && the_page === that.current_page) { - var set_page = null; + set_page = null; } else { - var set_page = the_page; + set_page = the_page; } if (that.animate) { @@ -75,7 +77,7 @@ class SwatAccordion { } getPageFromHash() { - var pages = YAHOO.util.Dom.getChildren(this.container); + var pages = Dom.getChildren(this.container); // check to see if a page is open via a hash-tag var hash_open_page = null; @@ -121,10 +123,11 @@ class SwatAccordion { this.semaphore = true; var old_page = this.current_page; + var new_from_height = 0; // old_page === null means we're opening from a completely closed state if (old_page !== null) { - var old_region = YAHOO.util.Dom.getRegion(old_page.animation); + var old_region = Dom.getRegion(old_page.animation); var old_from_height = old_region.height; var old_to_height = 0; old_page.animation.style.overflow = 'hidden'; @@ -134,30 +137,32 @@ class SwatAccordion { if (new_page === null) { var new_to_height = 0; - var anim = new YAHOO.util.Anim( + var anim = new Anim( old_page.animation, { }, SwatAccordion.resize_period, - YAHOO.util.Easing.easeBoth); + Easing.easeBoth + ); } else { new_page.animation.style.overflow = 'hidden'; if (new_page.animation.style.height === '' || - new_page.animation.style.height == 'auto') { + new_page.animation.style.height === 'auto' + ) { new_page.animation.style.height = '0'; - new_from_height = 0; } else { new_from_height = parseInt(new_page.animation.style.height); } new_page.animation.style.display = 'block'; - var new_region = YAHOO.util.Dom.getRegion(new_page.content); + var new_region = Dom.getRegion(new_page.content); var new_to_height = new_region.height; - var anim = new YAHOO.util.Anim( + var anim = new Anim( new_page.animation, { }, SwatAccordion.resize_period, - YAHOO.util.Easing.easeBoth); + Easing.easeBoth + ); } anim.onTween.subscribe(function (name, data) { diff --git a/www/javascript/swat-actions.js b/www/javascript/swat-actions.js index 4a03cada5..45b385804 100644 --- a/www/javascript/swat-actions.js +++ b/www/javascript/swat-actions.js @@ -1,19 +1,32 @@ +import { Anim, Easing } from '../../../yui/www/animation/animation'; + import '../styles/swat-actions.css'; class SwatActions { constructor(id, values, selected) { this.id = id; - this.flydown = document.getElementById(id + '_action_flydown'); - this.selected_element = (selected) ? - document.getElementById(id + '_' + selected) : null; - - var button = document.getElementById(id + '_apply_button'); this.values = values; this.message_shown = false; this.view = null; this.selector_id = null; + this.handleMessageClose = this.handleMessageClose.bind(this); + this.handleChange = this.handleChange.bind(this); + + document.addEventListener('DOMContentLoaded', () => { + this.init(selected); + }); + } + + init(selected) { + this.flydown = document.getElementById(this.id + '_action_flydown'); + this.selected_element = (selected) + ? document.getElementById(this.id + '_' + selected) + : null; + + var button = document.getElementById(this.id + '_apply_button'); + // create message content area this.message_content = document.createElement('span'); @@ -21,24 +34,16 @@ class SwatActions { var message_dismiss = document.createElement('a'); message_dismiss.href = '#'; message_dismiss.title = SwatActions.dismiss_text; - YAHOO.util.Dom.addClass(message_dismiss, - 'swat-actions-message-dismiss-link'); - + message_dismiss.classList.add('swat-actions-message-dismiss-link'); message_dismiss.appendChild( document.createTextNode(SwatActions.dismiss_text) ); - YAHOO.util.Event.addListener( - message_dismiss, - 'click', - this.handleMessageClose, - this, - true - ); + message_dismiss.addEventListener('click', this.handleMessageClose); // create message span and add content area and dismiss link this.message_span = document.createElement('span'); - YAHOO.util.Dom.addClass(this.message_span, 'swat-actions-message'); + this.message_span.classList.add('swat-actions-message') this.message_span.style.visibility = 'hidden'; this.message_span.appendChild(this.message_content); this.message_span.appendChild(message_dismiss); @@ -46,14 +51,10 @@ class SwatActions { // add message span to document button.parentNode.appendChild(this.message_span); - YAHOO.util.Event.addListener(this.flydown, 'change', - this.handleChange, this, true); - - YAHOO.util.Event.addListener(this.flydown, 'keyup', - this.handleChange, this, true); + this.flydown.addEventListener('change', this.handleChange); + this.flydown.addEventListener('keyup', this.handleChange); - YAHOO.util.Event.addListener(button, 'click', - this.handleButtonClick, this, true); + button.addEventListener('click', this.handleButtonClick); } setViewSelector(view, selector_id) { @@ -65,7 +66,7 @@ class SwatActions { handleChange() { if (this.selected_element) { - YAHOO.util.Dom.addClass(this.selected_element, 'swat-hidden'); + this.selected_element.classList.add('swat-hidden'); } var id = this.id + '_' + @@ -74,7 +75,7 @@ class SwatActions { this.selected_element = document.getElementById(id); if (this.selected_element) { - YAHOO.util.Dom.removeClass(this.selected_element, 'swat-hidden'); + this.selected_element.classList.remove('swat-hidden'); } } @@ -104,13 +105,13 @@ class SwatActions { } if (message) { - YAHOO.util.Event.preventDefault(e); + e.preventDefault(); this.showMessage(message); } } handleMessageClose(e) { - YAHOO.util.Event.preventDefault(e); + e.preventDefault(); this.hideMessage(); } @@ -127,11 +128,11 @@ class SwatActions { this.message_span.style.opacity = 0; this.message_span.style.visibility = 'visible'; - var animation = new YAHOO.util.Anim( + var animation = new Anim( this.message_span, { opacity: { from: 0, to: 1} }, 0.3, - YAHOO.util.Easing.easeInStrong + Easing.easeInStrong ); animation.animate(); @@ -142,11 +143,11 @@ class SwatActions { hideMessage() { if (this.message_shown) { - var animation = new YAHOO.util.Anim( + var animation = new Anim( this.message_span, { opacity: { from: 1, to: 0} }, 0.3, - YAHOO.util.Easing.easeOutStrong + Easing.easeOutStrong ); animation.onComplete.subscribe( diff --git a/www/javascript/swat-button.js b/www/javascript/swat-button.js index 66da00417..109ba551e 100644 --- a/www/javascript/swat-button.js +++ b/www/javascript/swat-button.js @@ -1,26 +1,49 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { Anim, Easing } from '../../../yui/www/animation/animation'; + export default class SwatButton { - constructor(id, show_processing_throbber) { + constructor(id, options) { this.id = id; - this.button = document.getElementById(this.id); - - // deprecated - this.show_processing_throbber = show_processing_throbber; + this.confirmation_message = options.confirmation_message || ''; + this.processing_message = options.processing_message || ''; - this.confirmation_message = ''; this.throbber_container = null; - if (show_processing_throbber) { - this.initThrobber(); - } + this.handleClick = this.handleClick.bind(this); + + document.addEventListener('DOMContentLoaded', () => { + this.init(); + if (options.show_processing_throbber) { + this.initThrobber(); + } + }); + } + + init() { + this.button = document.getElementById(this.id); + this.button.addEventListener('click', this.handleClick); + } - YAHOO.util.Event.addListener( - this.button, - 'click', - this.handleClick, - this, - true + initThrobber() { + this.throbber_container = document.createElement('span'); + this.throbber_container.classList.add( + 'swat-button-processing-throbber' ); + + if (this.processing_message.length > 0) { + this.throbber_container.appendChild( + document.createTextNode(this.processing_message) + ); + this.throbber_container.classList.add( + 'swat-button-processing-throbber-text' + ); + } else { + // the following string is a UTF-8 encoded non breaking space + this.throbber_container.appendChild(document.createTextNode(' ')); + } + + this.button.parentNode.appendChild(this.throbber_container); } handleClick(e) { @@ -31,7 +54,7 @@ export default class SwatButton { if (confirmed) { if (this.throbber_container !== null) { this.button.disabled = true; - YAHOO.util.Dom.addClass(this.button, 'swat-insensitive'); + this.button.classList.add('swat-insensitive') // add button to form data manually since we disabled it above var div = document.createElement('div'); @@ -43,7 +66,7 @@ export default class SwatButton { this.button.form.appendChild(div); this.showThrobber(); - var form = YAHOO.util.Dom.getAncestorByTagName( + var form = Dom.getAncestorByTagName( this.button, 'form' ); @@ -52,52 +75,18 @@ export default class SwatButton { } } } else { - YAHOO.util.Event.preventDefault(e); + e.preventDefault(); } } - initThrobber() { - this.throbber_container = document.createElement('span'); - - YAHOO.util.Dom.addClass( - this.throbber_container, - 'swat-button-processing-throbber' - ); - - this.button.parentNode.appendChild(this.throbber_container); - } - showThrobber() { - var animation = new YAHOO.util.Anim( + var animation = new Anim( this.throbber_container, { opacity: { to: 0.5 }}, 1, - YAHOO.util.Easing.easingNone + Easing.easingNone ); animation.animate(); } - - setProcessingMessage(message) { - if (this.throbber_container === null) { - this.initThrobber(); - } - - if (message.length > 0) { - this.throbber_container.appendChild( - document.createTextNode(message) - ); - YAHOO.util.Dom.addClass( - this.throbber_container, - 'swat-button-processing-throbber-text' - ); - } else { - // the following string is a UTF-8 encoded non breaking space - this.throbber_container.appendChild(document.createTextNode(' ')); - } - } - - setConfirmationMessage(message) { - this.confirmation_message = message; - } } diff --git a/www/javascript/swat-disclosure.js b/www/javascript/swat-disclosure.js index 395c0bb0a..6e2ad91d9 100644 --- a/www/javascript/swat-disclosure.js +++ b/www/javascript/swat-disclosure.js @@ -1,3 +1,7 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { Event } from '../../../yui/www/event/event'; +import { Anim, Easing } from '../../../yui/www/animation/animation'; + import '../styles/swat-disclosure.css'; export default class SwatDisclosure { @@ -19,7 +23,7 @@ export default class SwatDisclosure { // prevent closing during opening animation and vice versa this.semaphore = false; - YAHOO.util.Event.onDOMReady(this.init, this, true); + Event.onDOMReady(this.init, this, true); } init() { @@ -92,18 +96,18 @@ export default class SwatDisclosure { this.anchor = document.createElement('a'); this.anchor.href = '#'; if (this.opened) { - YAHOO.util.Dom.addClass( + Dom.addClass( this.anchor, 'swat-disclosure-anchor-opened' ); } else { - YAHOO.util.Dom.addClass( + Dom.addClass( this.anchor, 'swat-disclosure-anchor-closed' ); } - YAHOO.util.Event.addListener(this.anchor, 'click', + Event.addListener(this.anchor, 'click', function(e) { YAHOO.util.Event.preventDefault(e); this.toggle(); @@ -136,20 +140,20 @@ export default class SwatDisclosure { return; } - YAHOO.util.Dom.removeClass( + Dom.removeClass( this.anchor, 'swat-disclosure-anchor-opened' ); - YAHOO.util.Dom.addClass(this.anchor, 'swat-disclosure-anchor-closed'); + Dom.addClass(this.anchor, 'swat-disclosure-anchor-closed'); this.animate_div.style.overflow = 'hidden'; this.animate_div.style.height = 'auto'; var attributes = { height: { to: 0 } }; - var animation = new YAHOO.util.Anim( + var animation = new Anim( this.animate_div, attributes, 0.25, - YAHOO.util.Easing.easeOut + Easing.easeOut ); this.semaphore = true; @@ -161,14 +165,14 @@ export default class SwatDisclosure { } open() { - YAHOO.util.Dom.removeClass(this.div, 'swat-disclosure-control-closed'); - YAHOO.util.Dom.addClass(this.div, 'swat-disclosure-control-opened'); + Dom.removeClass(this.div, 'swat-disclosure-control-closed'); + Dom.addClass(this.div, 'swat-disclosure-control-opened'); - YAHOO.util.Dom.removeClass( + Dom.removeClass( this.anchor, 'swat-disclosure-anchor-closed' ); - YAHOO.util.Dom.addClass(this.anchor, 'swat-disclosure-anchor-opened'); + Dom.addClass(this.anchor, 'swat-disclosure-anchor-opened'); this.semaphore = false; @@ -181,14 +185,14 @@ export default class SwatDisclosure { return; } - YAHOO.util.Dom.removeClass(this.div, 'swat-disclosure-control-closed'); - YAHOO.util.Dom.addClass(this.div, 'swat-disclosure-control-opened'); + Dom.removeClass(this.div, 'swat-disclosure-control-closed'); + Dom.addClass(this.div, 'swat-disclosure-control-opened'); - YAHOO.util.Dom.removeClass( + Dom.removeClass( this.anchor, 'swat-disclosure-anchor-closed' ); - YAHOO.util.Dom.addClass(this.anchor, 'swat-disclosure-anchor-opened'); + Dom.addClass(this.anchor, 'swat-disclosure-anchor-opened'); // get display height this.animate_div.parentNode.style.overflow = 'hidden'; @@ -204,11 +208,11 @@ export default class SwatDisclosure { this.animate_div.parentNode.style.overflow = 'visible'; var attributes = { height: { to: height, from: 0 } }; - var animation = new YAHOO.util.Anim( + var animation = new Anim( this.animate_div, attributes, 0.5, - YAHOO.util.Easing.easeOut + Easing.easeOut ); this.semaphore = true; @@ -220,8 +224,8 @@ export default class SwatDisclosure { } handleClose() { - YAHOO.util.Dom.removeClass(this.div, 'swat-disclosure-control-opened'); - YAHOO.util.Dom.addClass(this.div, 'swat-disclosure-control-closed'); + Dom.removeClass(this.div, 'swat-disclosure-control-opened'); + Dom.addClass(this.div, 'swat-disclosure-control-closed'); this.semaphore = false; } diff --git a/www/javascript/swat-form.js b/www/javascript/swat-form.js index a84cf9885..84f1f654c 100644 --- a/www/javascript/swat-form.js +++ b/www/javascript/swat-form.js @@ -1,3 +1,5 @@ +import { Event } from '../../../yui/www/event/event'; + export default class SwatForm { constructor(id, connection_close_url) { this.id = id; @@ -5,7 +7,7 @@ export default class SwatForm { this.connection_close_url = connection_close_url; if (this.connection_close_url) { - YAHOO.util.Event.on( + Event.on( this.form_element, 'submit', this.handleSubmit, diff --git a/www/javascript/swat-message-display-message.js b/www/javascript/swat-message-display-message.js index 4b21b591e..87b471a4c 100644 --- a/www/javascript/swat-message-display-message.js +++ b/www/javascript/swat-message-display-message.js @@ -1,3 +1,7 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { Event } from '../../../yui/www/event/event'; +import { Anim, Easing } from '../../../yui/www/animation/animation'; + import '../styles/swat-message.css'; class SwatMessageDisplayMessage { @@ -20,12 +24,12 @@ class SwatMessageDisplayMessage { var anchor = document.createElement('a'); anchor.href = '#'; anchor.title = SwatMessageDisplayMessage.close_text; - YAHOO.util.Dom.addClass(anchor, 'swat-message-display-dismiss-link'); - YAHOO.util.Event.addListener( + Dom.addClass(anchor, 'swat-message-display-dismiss-link'); + Event.addListener( anchor, 'click', function(e, message) { - YAHOO.util.Event.preventDefault(e); + Event.preventDefault(e); message.hide(); }, this @@ -46,11 +50,11 @@ class SwatMessageDisplayMessage { hide() { if (this.message_div !== null) { // fade out message - var fade_animation = new YAHOO.util.Anim( + var fade_animation = new Anim( this.message_div, { opacity: { to: 0 } }, SwatMessageDisplayMessage.fade_duration, - YAHOO.util.Easing.easingOut + Easing.easingOut ); // after fading out, shrink the empty space away @@ -61,7 +65,7 @@ class SwatMessageDisplayMessage { shrink() { var duration = SwatMessageDisplayMessage.shrink_duration; - var easing = YAHOO.util.Easing.easeInStrong; + var easing = Easing.easeInStrong; var attributes = { height: { to: 0 }, @@ -71,7 +75,7 @@ class SwatMessageDisplayMessage { // collapse margins if (this.message_div.nextSibling) { // shrink top margin of next message in message display - var next_message_animation = new YAHOO.util.Anim( + var next_message_animation = new Anim( this.message_div.nextSibling, { marginTop: { to: 0 } }, duration, @@ -88,7 +92,7 @@ class SwatMessageDisplayMessage { node = node.nextSibling; if (node) { - var previous_message_animation = new YAHOO.util.Anim( + var previous_message_animation = new Anim( node, { marginTop: { to: 0 } }, duration, @@ -105,7 +109,7 @@ class SwatMessageDisplayMessage { // collapse top margin of last message attributes.marginTop = { to: 0 }; - var message_display_animation = new YAHOO.util.Anim( + var message_display_animation = new Anim( this.message_div.parentNode, { marginTop: { to: 0 } }, duration, @@ -115,7 +119,7 @@ class SwatMessageDisplayMessage { } // disappear this message - var shrink_animation = new YAHOO.util.Anim( + var shrink_animation = new Anim( this.message_div, attributes, duration, @@ -126,7 +130,7 @@ class SwatMessageDisplayMessage { } remove() { - YAHOO.util.Event.purgeElement(this.message_div, true); + Event.purgeElement(this.message_div, true); this.message_div.parentNode.removeChild( this.message_div diff --git a/www/javascript/swat-simple-color-entry.js b/www/javascript/swat-simple-color-entry.js index c120e19a7..3e17a3522 100644 --- a/www/javascript/swat-simple-color-entry.js +++ b/www/javascript/swat-simple-color-entry.js @@ -1,4 +1,8 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { CustomEvent, Event } from '../../../yui/www/event/event'; + import SwatAbstractOverlay from './swat-abstract-overlay'; + import '../styles/swat-color-entry.css'; export default class SwatSimpleColorEntry extends SwatAbstractOverlay { @@ -21,7 +25,7 @@ export default class SwatSimpleColorEntry extends SwatAbstractOverlay { this.columns = Math.ceil(Math.sqrt(this.colors.length)); this.current_color = null; - this.colorChangeEvent = new YAHOO.util.CustomEvent('colorChange'); + this.colorChangeEvent = new CustomEvent('colorChange'); } init() { @@ -30,13 +34,13 @@ export default class SwatSimpleColorEntry extends SwatAbstractOverlay { this.hex_input_tag.id = this.id + '_hex_color'; this.hex_input_tag.size = 6; - YAHOO.util.Event.on(this.hex_input_tag, 'change', + Event.on(this.hex_input_tag, 'change', this.handleInputChange, this, true); - YAHOO.util.Event.on(this.hex_input_tag, 'keyup', + Event.on(this.hex_input_tag, 'keyup', this.handleInputChange, this, true); - SwatSimpleColorEntry.superclass.init.call(this); + super.init(); this.input_tag = document.getElementById(this.id + '_value'); this.setColor(this.input_tag.value); @@ -66,7 +70,7 @@ export default class SwatSimpleColorEntry extends SwatAbstractOverlay { tcell = document.createElement('td'); tcell.id = this.id + '_palette_null'; tcell.colSpan = this.columns; - YAHOO.util.Dom.addClass( + Dom.addClass( tcell, 'swat-simple-color-entry-palette-blank' ); @@ -80,7 +84,7 @@ export default class SwatSimpleColorEntry extends SwatAbstractOverlay { trow.appendChild(tcell); tbody.appendChild(trow); - YAHOO.util.Event.addListener( + Event.addListener( anchor, 'click', this.selectNull, @@ -105,7 +109,7 @@ export default class SwatSimpleColorEntry extends SwatAbstractOverlay { anchor.href = '#'; anchor.appendChild(text); - YAHOO.util.Event.addListener( + Event.addListener( anchor, 'click', this.selectColor, @@ -115,7 +119,7 @@ export default class SwatSimpleColorEntry extends SwatAbstractOverlay { tcell.appendChild(anchor); } else { - YAHOO.util.Dom.addClass( + Dom.addClass( tcell, 'swat-simple-color-entry-palette-blank' ); @@ -219,7 +223,7 @@ export default class SwatSimpleColorEntry extends SwatAbstractOverlay { // IE fix, it sets string 'null' otherwise this.hex_input_tag.value = ''; } - YAHOO.util.Dom.setStyle( + Dom.setStyle( this.toggle_button_content, 'background', 'url(packages/swat/images/color-entry-null.png)' @@ -228,7 +232,7 @@ export default class SwatSimpleColorEntry extends SwatAbstractOverlay { if (this.hex_input_tag.value !== color) { this.hex_input_tag.value = color; } - YAHOO.util.Dom.setStyle(this.toggle_button_content, + Dom.setStyle(this.toggle_button_content, 'background', '#' + color); } @@ -250,7 +254,7 @@ export default class SwatSimpleColorEntry extends SwatAbstractOverlay { * @param Event the event that triggered this select. */ selectNull(e) { - YAHOO.util.Event.preventDefault(e); + Event.preventDefault(e); this.setColor(null); } @@ -260,8 +264,8 @@ export default class SwatSimpleColorEntry extends SwatAbstractOverlay { * @param Event the event that triggered this select. */ selectColor(event) { - YAHOO.util.Event.preventDefault(event); - var cell = YAHOO.util.Event.getTarget(event); + Event.preventDefault(event); + var cell = Event.getTarget(event); var color_index = cell.parentNode.id.split('_palette_')[1]; this.setColor(this.colors[color_index]); @@ -277,12 +281,12 @@ export default class SwatSimpleColorEntry extends SwatAbstractOverlay { var null_entry = document.getElementById(this.id + '_palette_null'); if (color === null) { - YAHOO.util.Dom.addClass( + Dom.addClass( null_entry, 'swat-simple-color-entry-palette-selected' ); } else { - YAHOO.util.Dom.removeClass( + Dom.removeClass( null_entry, 'swat-simple-color-entry-palette-selected' ); @@ -297,12 +301,12 @@ export default class SwatSimpleColorEntry extends SwatAbstractOverlay { this.colors[i].toLowerCase() === this.current_color.toLowerCase() ) { - YAHOO.util.Dom.addClass( + Dom.addClass( palette_entry, 'swat-simple-color-entry-palette-selected' ); } else { - YAHOO.util.Dom.removeClass( + Dom.removeClass( palette_entry, 'swat-simple-color-entry-palette-selected' ); diff --git a/www/javascript/yui.js b/www/javascript/yui.js new file mode 100644 index 000000000..503b7149d --- /dev/null +++ b/www/javascript/yui.js @@ -0,0 +1,12 @@ +import YAHOO from require('../../../yui/www/yahoo/yahoo.js'); +/* +console.log(YAHOO); +window.YAHOO = YAHOO; + +require('../../../yui/www/dom/dom.js'); +require('../../../yui/www/event/event.js'); +require('../../../yui/www/animation/animation.js'); +require('../../../yui/www/container/container.js'); +require('../../../yui/www/imagecropper/imagecropper.js'); +require('../../../yui/www/tabview/tabview.js'); +*/ From 32d27edaf1f533a4eb283afcf8982e4918ddf851 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Mon, 1 Jan 2018 03:48:36 -0400 Subject: [PATCH 15/35] Better formatting of loader options --- demo/webpack.config.js | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/demo/webpack.config.js b/demo/webpack.config.js index 65e0617e0..0fa6b9605 100644 --- a/demo/webpack.config.js +++ b/demo/webpack.config.js @@ -42,23 +42,53 @@ module.exports = { }, { test: /yahoo\/yahoo.js$/, - use: 'exports-loader?YAHOO' + use: { + loader: 'exports-loader?YAHOO', + } }, { test: /dom\/dom.js$/, - use: 'exports-loader?Dom=YAHOO.util.Dom' + use: { + loader: 'exports-loader', + options: { + Dom: 'YAHOO.util.Dom', + }, + }, }, { test: /event\/event.js$/, - use: 'exports-loader?Event=YAHOO.util.Event,CustomEvent=YAHOO.util.CustomEvent,Subscriber=YAHOO.util.Subscriber' + use: { + loader: 'exports-loader', + options: { + Event: 'YAHOO.util.Event', + CustomEvent: 'YAHOO.util.CustomEvent', + Subscriber: 'YAHOO.util.Subscriber', + }, + }, }, { test: /animation\/animation.js$/, - use: 'exports-loader?Anim=YAHOO.util.Anim,AnimMgr=YAHOO.util.AnimMgr,Easing=YAHOO.util.Easing' + use: { + loader: 'exports-loader', + options: { + Anim: 'YAHOO.util.Anim', + AnimMgr: 'YAHOO.util.AnimMgr', + Easing: 'YAHOO.util.Easing', + }, + }, }, { test: /container\/container_core.js$/, - use: 'exports-loader?Config=YAHOO.util.Config,Module=YAHOO.widget.Module,Overlay=YAHOO.widget.Overlay,OverlayManager=YAHOO.widget.OverlayManager,ContainerEffect=YAHOO.widget.ContainerEffect' + use: { + loader: 'exports-loader', + options: { + Config: 'YAHOO.util.Config', + Module: 'YAHOO.widget.Module', + Overlay: 'YAHOO.widget.Overlay', + OverlayManager: 'YAHOO.widget.OverlayManager', + ContainerEffect: 'YAHOO.widget.ContainerEffect', + }, + }, }, ], }, From bcaf7ad36dca5b88a0773fa438d8b5ec007efb12 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Mon, 1 Jan 2018 03:49:57 -0400 Subject: [PATCH 16/35] Remove unused file --- www/javascript/yui.js | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 www/javascript/yui.js diff --git a/www/javascript/yui.js b/www/javascript/yui.js deleted file mode 100644 index 503b7149d..000000000 --- a/www/javascript/yui.js +++ /dev/null @@ -1,12 +0,0 @@ -import YAHOO from require('../../../yui/www/yahoo/yahoo.js'); -/* -console.log(YAHOO); -window.YAHOO = YAHOO; - -require('../../../yui/www/dom/dom.js'); -require('../../../yui/www/event/event.js'); -require('../../../yui/www/animation/animation.js'); -require('../../../yui/www/container/container.js'); -require('../../../yui/www/imagecropper/imagecropper.js'); -require('../../../yui/www/tabview/tabview.js'); -*/ From 2c439fb1deefd4590ecf5605124a0e22fb8c9a75 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Mon, 1 Jan 2018 04:15:46 -0400 Subject: [PATCH 17/35] Remove widget html head entries from PHP --- Swat/SwatAbstractOverlay.php | 12 ------------ Swat/SwatAccordion.php | 7 ------- Swat/SwatActions.php | 20 -------------------- Swat/SwatButton.php | 5 ----- Swat/SwatCalendar.php | 10 ---------- Swat/SwatCascadeFlydown.php | 6 ------ Swat/SwatChangeOrder.php | 9 --------- Swat/SwatCheckAll.php | 3 --- Swat/SwatCheckboxCellRenderer.php | 6 ------ Swat/SwatCheckboxEntryList.php | 26 -------------------------- Swat/SwatCheckboxList.php | 4 ---- Swat/SwatDateEntry.php | 4 ---- Swat/SwatDetailsView.php | 17 ----------------- Swat/SwatDisclosure.php | 6 ------ Swat/SwatFieldset.php | 6 ------ Swat/SwatForm.php | 9 --------- Swat/SwatFrameDisclosure.php | 17 ----------------- Swat/SwatImageCropper.php | 6 ------ Swat/SwatImagePreviewDisplay.php | 17 ----------------- Swat/SwatMessageDisplay.php | 11 ----------- Swat/SwatMoneyCellRenderer.php | 15 --------------- Swat/SwatNoteBook.php | 6 ------ Swat/SwatPagination.php | 2 -- Swat/SwatProgressBar.php | 7 ------- Swat/SwatRadioButtonCellRenderer.php | 6 ------ Swat/SwatRadioList.php | 2 -- Swat/SwatRadioNoteBook.php | 10 ---------- Swat/SwatRadioTable.php | 17 ----------------- Swat/SwatRating.php | 7 ------- Swat/SwatSearchEntry.php | 6 ------ Swat/SwatSimpleColorEntry.php | 12 ------------ Swat/SwatTableView.php | 21 --------------------- Swat/SwatTableViewInputRow.php | 6 ------ Swat/SwatTextarea.php | 21 --------------------- Swat/SwatTileView.php | 18 ------------------ Swat/SwatTimeEntry.php | 4 ---- Swat/SwatToolLink.php | 17 ----------------- Swat/SwatToolbar.php | 17 ----------------- Swat/SwatView.php | 19 ------------------- Swat/SwatWidget.php | 2 -- 40 files changed, 416 deletions(-) diff --git a/Swat/SwatAbstractOverlay.php b/Swat/SwatAbstractOverlay.php index cb21e3d1b..157e5e2eb 100644 --- a/Swat/SwatAbstractOverlay.php +++ b/Swat/SwatAbstractOverlay.php @@ -49,19 +49,7 @@ abstract class SwatAbstractOverlay extends SwatInputControl implements SwatState public function __construct($id = null) { parent::__construct($id); - $this->requires_id = true; - - $yui = new SwatYUI(array('dom', 'event', 'container')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addJavaScript( - 'packages/swat/javascript/swat-abstract-overlay.js' - ); - - $this->addJavaScript( - 'packages/swat/javascript/swat-z-index-manager.js' - ); } // }}} diff --git a/Swat/SwatAccordion.php b/Swat/SwatAccordion.php index 911d30adf..3965f1f14 100644 --- a/Swat/SwatAccordion.php +++ b/Swat/SwatAccordion.php @@ -43,14 +43,7 @@ class SwatAccordion extends SwatNoteBook public function __construct($id = null) { parent::__construct($id); - $this->requires_id = true; - - $yui = new SwatYUI(array('yahoo', 'dom', 'event', 'animation')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addStyleSheet('packages/swat/styles/swat-accordion.css'); - $this->addJavaScript('packages/swat/javascript/swat-accordion.js'); } // }}} diff --git a/Swat/SwatActions.php b/Swat/SwatActions.php index d6aaf533e..a22a8fd03 100644 --- a/Swat/SwatActions.php +++ b/Swat/SwatActions.php @@ -79,26 +79,6 @@ class SwatActions extends SwatControl implements SwatUIParent */ private $selector; - // }}} - // {{{ public function __construct() - - /** - * Creates a new actions list - * - * @param string $id a non-visible unique id for this widget. - * - * @see SwatWidget::__construct() - */ - public function __construct($id = null) - { - parent::__construct($id); - - $yui = new SwatYUI(array('dom', 'event', 'animation')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - $this->addJavaScript('packages/swat/javascript/swat-actions.js'); - $this->addStyleSheet('packages/swat/styles/swat-actions.css'); - } - // }}} // {{{ public function init() diff --git a/Swat/SwatButton.php b/Swat/SwatButton.php index 3d3d15d01..0a6034feb 100644 --- a/Swat/SwatButton.php +++ b/Swat/SwatButton.php @@ -116,11 +116,6 @@ class SwatButton extends SwatInputControl public function __construct($id = null) { parent::__construct($id); - - $yui = new SwatYUI(array('dom', 'event', 'animation')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - $this->addJavaScript('packages/swat/javascript/swat-button.js'); - $this->requires_id = true; } diff --git a/Swat/SwatCalendar.php b/Swat/SwatCalendar.php index f2d008396..845ee4533 100644 --- a/Swat/SwatCalendar.php +++ b/Swat/SwatCalendar.php @@ -41,17 +41,7 @@ class SwatCalendar extends SwatControl public function __construct($id = null) { parent::__construct($id); - $this->requires_id = true; - - $yui = new SwatYUI(array('dom', 'container')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addStyleSheet('packages/swat/styles/swat-calendar.css'); - $this->addJavaScript('packages/swat/javascript/swat-calendar.js'); - $this->addJavaScript( - 'packages/swat/javascript/swat-z-index-manager.js' - ); } // }}} diff --git a/Swat/SwatCascadeFlydown.php b/Swat/SwatCascadeFlydown.php index ee09d2743..95fa63506 100644 --- a/Swat/SwatCascadeFlydown.php +++ b/Swat/SwatCascadeFlydown.php @@ -55,13 +55,7 @@ class SwatCascadeFlydown extends SwatFlydown public function __construct($id = null) { parent::__construct($id); - $this->requires_id = true; - - $yui = new SwatYUI(array('event')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addJavaScript('packages/swat/javascript/swat-cascade.js'); } // }}} diff --git a/Swat/SwatChangeOrder.php b/Swat/SwatChangeOrder.php index 3155a20f7..25ae523da 100644 --- a/Swat/SwatChangeOrder.php +++ b/Swat/SwatChangeOrder.php @@ -55,15 +55,6 @@ public function __construct($id = null) { parent::__construct($id); $this->requires_id = true; - - $yui = new SwatYUI(array('dom', 'event')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addStyleSheet('packages/swat/styles/swat-change-order.css'); - $this->addJavaScript('packages/swat/javascript/swat-change-order.js'); - $this->addJavaScript( - 'packages/swat/javascript/swat-z-index-manager.js' - ); } // }}} diff --git a/Swat/SwatCheckAll.php b/Swat/SwatCheckAll.php index 7f93a0141..ac858ab17 100644 --- a/Swat/SwatCheckAll.php +++ b/Swat/SwatCheckAll.php @@ -73,9 +73,6 @@ public function __construct($id = null) { parent::__construct($id); $this->title = Swat::_('Select All'); - $yui = new SwatYUI(array('event')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - $this->addJavaScript('packages/swat/javascript/swat-check-all.js'); } // }}} diff --git a/Swat/SwatCheckboxCellRenderer.php b/Swat/SwatCheckboxCellRenderer.php index 0cd758e73..3dd4a50e0 100644 --- a/Swat/SwatCheckboxCellRenderer.php +++ b/Swat/SwatCheckboxCellRenderer.php @@ -90,12 +90,6 @@ public function __construct() $this->makePropertyStatic('id'); - $yui = new SwatYUI(array('dom')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - $this->addJavaScript( - 'packages/swat/javascript/swat-checkbox-cell-renderer.js' - ); - // auto-generate an id to use if no id is set $this->id = $this->getUniqueId(); } diff --git a/Swat/SwatCheckboxEntryList.php b/Swat/SwatCheckboxEntryList.php index dd2433190..b5fdbd4d2 100644 --- a/Swat/SwatCheckboxEntryList.php +++ b/Swat/SwatCheckboxEntryList.php @@ -54,32 +54,6 @@ class SwatCheckboxEntryList extends SwatCheckboxList */ protected $entry_widgets = array(); - // }}} - // {{{ public function __construct() - - /** - * Creates a new checkbox entry list - * - * @param string $id a non-visible unique id for this widget. - * - * @see SwatCheckboxList::__construct() - */ - public function __construct($id = null) - { - parent::__construct($id); - - $yui = new SwatYUI(array('dom', 'event')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addJavaScript( - 'packages/swat/javascript/swat-checkbox-entry-list.js' - ); - - $this->addStyleSheet( - 'packages/swat/styles/swat-checkbox-entry-list.css' - ); - } - // }}} // {{{ public function display() diff --git a/Swat/SwatCheckboxList.php b/Swat/SwatCheckboxList.php index aa8bd1169..ad5d3e284 100644 --- a/Swat/SwatCheckboxList.php +++ b/Swat/SwatCheckboxList.php @@ -66,10 +66,6 @@ public function __construct($id = null) { parent::__construct($id); $this->requires_id = true; - $yui = new SwatYUI(array('event')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - $this->addJavaScript('packages/swat/javascript/swat-checkbox-list.js'); - $this->addStyleSheet('packages/swat/styles/swat.css'); } // }}} diff --git a/Swat/SwatDateEntry.php b/Swat/SwatDateEntry.php index 67106cefd..17a02e927 100644 --- a/Swat/SwatDateEntry.php +++ b/Swat/SwatDateEntry.php @@ -128,10 +128,6 @@ public function __construct($id = null) $this->setValidRange(-20, 20); $this->requires_id = true; - - $yui = new SwatYUI(array('event')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - $this->addJavaScript('packages/swat/javascript/swat-date-entry.js'); } // }}} diff --git a/Swat/SwatDetailsView.php b/Swat/SwatDetailsView.php index e74657982..84f7db4a5 100644 --- a/Swat/SwatDetailsView.php +++ b/Swat/SwatDetailsView.php @@ -48,23 +48,6 @@ class SwatDetailsView extends SwatControl implements SwatUIParent */ private $fields_by_id = array(); - // }}} - // {{{ public function __construct() - - /** - * Creates a new details view - * - * @param string $id a non-visible unique id for this widget. - * - * @see SwatWidget::__construct() - */ - public function __construct($id = null) - { - parent::__construct($id); - - $this->addStyleSheet('packages/swat/styles/swat-details-view.css'); - } - // }}} // {{{ public function init() diff --git a/Swat/SwatDisclosure.php b/Swat/SwatDisclosure.php index 8183f3969..248b2dfbc 100644 --- a/Swat/SwatDisclosure.php +++ b/Swat/SwatDisclosure.php @@ -39,12 +39,6 @@ public function __construct($id = null) { parent::__construct($id); $this->requires_id = true; - - $yui = new SwatYUI(array('dom', 'animation')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addJavaScript('packages/swat/javascript/swat-disclosure.js'); - $this->addStyleSheet('packages/swat/styles/swat-disclosure.css'); } // }}} diff --git a/Swat/SwatFieldset.php b/Swat/SwatFieldset.php index 935626705..4a2f9e3e4 100644 --- a/Swat/SwatFieldset.php +++ b/Swat/SwatFieldset.php @@ -53,13 +53,7 @@ class SwatFieldset extends SwatDisplayableContainer implements SwatTitleable public function __construct($id = null) { parent::__construct($id); - $this->requires_id = true; - - // JavaScript for IE peekaboo hack - $yui = new SwatYUI(array('event')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - $this->addJavaScript('packages/swat/javascript/swat-fieldset.js'); } // }}} diff --git a/Swat/SwatForm.php b/Swat/SwatForm.php index ead5982ac..3d3484200 100644 --- a/Swat/SwatForm.php +++ b/Swat/SwatForm.php @@ -256,8 +256,6 @@ public function __construct($id = null) } $this->requires_id = true; - - $this->addJavaScript('packages/swat/javascript/swat-form.js'); } // }}} @@ -325,13 +323,6 @@ public function display() $this->displayHiddenFields(); $form_tag->close(); - if ($this->connection_close_uri != '') { - $yui = new SwatYUI(array('event')); - $this->html_head_entry_set->addEntrySet( - $yui->getHtmlHeadEntrySet() - ); - } - Swat::displayInlineJavaScript($this->getInlineJavaScript()); } diff --git a/Swat/SwatFrameDisclosure.php b/Swat/SwatFrameDisclosure.php index 3212738f3..e7fa41744 100644 --- a/Swat/SwatFrameDisclosure.php +++ b/Swat/SwatFrameDisclosure.php @@ -9,23 +9,6 @@ */ class SwatFrameDisclosure extends SwatDisclosure { - // {{{ public function __construct() - - /** - * Creates a new frame disclosure container - * - * @param string $id a non-visible unique id for this widget. - * - * @see SwatWidget::__construct() - */ - public function __construct($id = null) - { - parent::__construct($id); - - $this->addStyleSheet('packages/swat/styles/swat-frame-disclosure.css'); - } - - // }}} // {{{ public function display() /** diff --git a/Swat/SwatImageCropper.php b/Swat/SwatImageCropper.php index 09c2dab87..5c00efcfc 100644 --- a/Swat/SwatImageCropper.php +++ b/Swat/SwatImageCropper.php @@ -142,13 +142,7 @@ class SwatImageCropper extends SwatInputControl public function __construct($id = null) { parent::__construct($id); - $this->requires_id = true; - - $yui = new SwatYUI(array('imagecropper')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addJavaScript('packages/swat/javascript/swat-image-cropper.js'); } // }}} diff --git a/Swat/SwatImagePreviewDisplay.php b/Swat/SwatImagePreviewDisplay.php index 8eb017b84..adfe368af 100644 --- a/Swat/SwatImagePreviewDisplay.php +++ b/Swat/SwatImagePreviewDisplay.php @@ -153,24 +153,7 @@ class SwatImagePreviewDisplay extends SwatImageDisplay public function __construct($id = null) { parent::__construct($id); - $this->requires_id = true; - - $yui = new SwatYUI(array('dom', 'event')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addJavaScript( - 'packages/swat/javascript/swat-z-index-manager.js' - ); - - $this->addJavaScript( - 'packages/swat/javascript/swat-image-preview-display.js' - ); - - $this->addStyleSheet( - 'packages/swat/styles/swat-image-preview-display.css' - ); - $this->title = Swat::_('View Larger Image'); } diff --git a/Swat/SwatMessageDisplay.php b/Swat/SwatMessageDisplay.php index 8c972244d..22064b051 100644 --- a/Swat/SwatMessageDisplay.php +++ b/Swat/SwatMessageDisplay.php @@ -76,18 +76,7 @@ class SwatMessageDisplay extends SwatControl public function __construct($id = null) { parent::__construct($id); - $this->requires_id = true; - - $yui = new SwatYUI(array('animation')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addJavaScript( - 'packages/swat/javascript/swat-message-display.js' - ); - - $this->addStyleSheet('packages/swat/styles/swat-message.css'); - $this->addStyleSheet('packages/swat/styles/swat-message-display.css'); } // }}} diff --git a/Swat/SwatMoneyCellRenderer.php b/Swat/SwatMoneyCellRenderer.php index cc231693d..7131e9261 100644 --- a/Swat/SwatMoneyCellRenderer.php +++ b/Swat/SwatMoneyCellRenderer.php @@ -75,21 +75,6 @@ class SwatMoneyCellRenderer extends SwatCellRenderer */ public $null_display_value = null; - // }}} - // {{{ public function __construct() - - /** - * Creates a money cell renderer - */ - public function __construct() - { - parent::__construct(); - - $this->addStyleSheet( - 'packages/swat/styles/swat-money-cell-renderer.css' - ); - } - // }}} // {{{ public function render() diff --git a/Swat/SwatNoteBook.php b/Swat/SwatNoteBook.php index b7b74c597..3c42bed80 100644 --- a/Swat/SwatNoteBook.php +++ b/Swat/SwatNoteBook.php @@ -80,13 +80,7 @@ class SwatNoteBook extends SwatWidget implements SwatUIParent public function __construct($id = null) { parent::__construct($id); - $this->requires_id = true; - - $yui = new SwatYUI(array('tabview')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addStyleSheet('packages/swat/styles/swat-note-book.css'); } // }}} diff --git a/Swat/SwatPagination.php b/Swat/SwatPagination.php index f4d1f972f..02c7255a2 100644 --- a/Swat/SwatPagination.php +++ b/Swat/SwatPagination.php @@ -165,8 +165,6 @@ public function __construct($id = null) /* These strings include a non-breaking space */ $this->previous_label = Swat::_('‹ Previous'); $this->next_label = Swat::_('Next ›'); - - $this->addStyleSheet('packages/swat/styles/swat-pagination.css'); } // }}} diff --git a/Swat/SwatProgressBar.php b/Swat/SwatProgressBar.php index f6d18eb6c..ba9d570c6 100644 --- a/Swat/SwatProgressBar.php +++ b/Swat/SwatProgressBar.php @@ -131,14 +131,7 @@ class SwatProgressBar extends SwatControl public function __construct($id = null) { parent::__construct($id); - $this->requires_id = true; - - $yui = new SwatYUI(array('event')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addStyleSheet('packages/swat/styles/swat-progress-bar.css'); - $this->addJavaScript('packages/swat/javascript/swat-progress-bar.js'); } // }}} diff --git a/Swat/SwatRadioButtonCellRenderer.php b/Swat/SwatRadioButtonCellRenderer.php index c8a72c7f8..d580b8f5f 100644 --- a/Swat/SwatRadioButtonCellRenderer.php +++ b/Swat/SwatRadioButtonCellRenderer.php @@ -82,12 +82,6 @@ public function __construct() $this->makePropertyStatic('id'); - $yui = new SwatYUI(array('dom')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - $this->addJavaScript( - 'packages/swat/javascript/swat-radio-button-cell-renderer.js' - ); - // auto-generate an id to use if no id is set $this->id = $this->getUniqueId(); } diff --git a/Swat/SwatRadioList.php b/Swat/SwatRadioList.php index ee6922c2b..59bb39663 100644 --- a/Swat/SwatRadioList.php +++ b/Swat/SwatRadioList.php @@ -41,8 +41,6 @@ public function __construct($id = null) $this->show_blank = false; $this->requires_id = true; - - $this->addStyleSheet('packages/swat/styles/swat-radio-list.css'); } // }}} diff --git a/Swat/SwatRadioNoteBook.php b/Swat/SwatRadioNoteBook.php index 4cf47d287..6bb40fcbf 100644 --- a/Swat/SwatRadioNoteBook.php +++ b/Swat/SwatRadioNoteBook.php @@ -53,17 +53,7 @@ class SwatRadioNoteBook extends SwatInputControl implements SwatUIParent public function __construct($id = null) { parent::__construct($id); - $this->requires_id = true; - - $yui = new SwatYUI(array('dom', 'event', 'animation', 'selector')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addStyleSheet('packages/swat/styles/swat-radio-note-book.css'); - - $this->addJavaScript( - 'packages/swat/javascript/swat-radio-note-book.js' - ); } // }}} diff --git a/Swat/SwatRadioTable.php b/Swat/SwatRadioTable.php index 446fb4ba3..3a1077939 100644 --- a/Swat/SwatRadioTable.php +++ b/Swat/SwatRadioTable.php @@ -9,23 +9,6 @@ */ class SwatRadioTable extends SwatRadioList { - // {{{ public function __construct() - - /** - * Creates a new radio table - * - * @param string $id a non-visible unique id for this widget. - * - * @see SwatWidget::__construct() - */ - public function __construct($id = null) - { - parent::__construct($id); - - $this->addStyleSheet('packages/swat/styles/swat-radio-table.css'); - } - - // }}} // {{{ public function display() public function display() diff --git a/Swat/SwatRating.php b/Swat/SwatRating.php index f0dc1ea34..0fbbe70c4 100644 --- a/Swat/SwatRating.php +++ b/Swat/SwatRating.php @@ -37,14 +37,7 @@ class SwatRating extends SwatInputControl public function __construct($id = null) { parent::__construct($id); - $this->requires_id = true; - - $yui = new SwatYUI(array('dom', 'animation')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addJavaScript('packages/swat/javascript/swat-rating.js'); - $this->addStyleSheet('packages/swat/styles/swat-rating.css'); } // }}} diff --git a/Swat/SwatSearchEntry.php b/Swat/SwatSearchEntry.php index a4cf7ae9f..cfa4d0feb 100644 --- a/Swat/SwatSearchEntry.php +++ b/Swat/SwatSearchEntry.php @@ -28,13 +28,7 @@ class SwatSearchEntry extends SwatEntry public function __construct($id = null) { parent::__construct($id); - $this->requires_id = true; - - $yui = new SwatYUI(array('dom', 'event')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - $this->addJavaScript('packages/swat/javascript/swat-search-entry.js'); - $this->addStyleSheet('packages/swat/styles/swat-search-entry.css'); } // }}} diff --git a/Swat/SwatSimpleColorEntry.php b/Swat/SwatSimpleColorEntry.php index 2d16f1032..18467a005 100644 --- a/Swat/SwatSimpleColorEntry.php +++ b/Swat/SwatSimpleColorEntry.php @@ -92,18 +92,6 @@ public function __construct($id = null) if ($this->none_option_title === null) { $this->none_option_title = Swat::_('None'); } - - $this->addJavaScript( - 'packages/swat/javascript/swat-simple-color-entry.js' - ); - - $this->addJavaScript( - 'packages/swat/javascript/swat-abstract-overlay.js' - ); - - $this->addStyleSheet( - 'packages/swat/styles/swat-simple-color-entry.css' - ); } // }}} diff --git a/Swat/SwatTableView.php b/Swat/SwatTableView.php index d4c01082e..6ca94d08a 100644 --- a/Swat/SwatTableView.php +++ b/Swat/SwatTableView.php @@ -189,27 +189,6 @@ class SwatTableView extends SwatView implements SwatUIParent // }}} // general methods - // {{{ public function __construct() - - /** - * Creates a new table view - * - * @param string $id a non-visible unique id for this widget. - * - * @see SwatWidget::__construct() - */ - public function __construct($id = null) - { - parent::__construct($id); - - $yui = new SwatYUI(array('dom')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - - $this->addJavaScript('packages/swat/javascript/swat-table-view.js'); - $this->addStyleSheet('packages/swat/styles/swat-table-view.css'); - } - - // }}} // {{{ public function init() /** diff --git a/Swat/SwatTableViewInputRow.php b/Swat/SwatTableViewInputRow.php index b34827c47..ad1224daa 100644 --- a/Swat/SwatTableViewInputRow.php +++ b/Swat/SwatTableViewInputRow.php @@ -107,12 +107,6 @@ public function __construct() { parent::__construct(); $this->enter_text = Swat::_('enter another'); - - $yui = new SwatYUI(array('animation')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - $this->addJavaScript( - 'packages/swat/javascript/swat-table-view-input-row.js' - ); } // }}} diff --git a/Swat/SwatTextarea.php b/Swat/SwatTextarea.php index ce4b91ad3..688eae945 100644 --- a/Swat/SwatTextarea.php +++ b/Swat/SwatTextarea.php @@ -99,27 +99,6 @@ class SwatTextarea extends SwatInputControl implements SwatState */ public $placeholder; - // }}} - // {{{ public function __construct() - - /** - * Creates a new textarea widget - * - * Sets the widget title to a default value. - * - * @param string $id a non-visible unique id for this widget. - * - * @see SwatWidget::__construct() - */ - public function __construct($id = null) - { - parent::__construct($id); - $yui = new SwatYUI(array('dom', 'event')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - $this->addJavaScript('packages/swat/javascript/swat-textarea.js'); - $this->addStyleSheet('packages/swat/styles/swat-textarea.css'); - } - // }}} // {{{ public function display() diff --git a/Swat/SwatTileView.php b/Swat/SwatTileView.php index ab488101d..eca55ea12 100644 --- a/Swat/SwatTileView.php +++ b/Swat/SwatTileView.php @@ -140,24 +140,6 @@ class SwatTileView extends SwatView implements SwatUIParent */ private $tile = null; - // }}} - // {{{ public function __construct() - - /** - * Creates a new tile view - * - * @param string $id a non-visable unique id for this widget. - * - * @see SwatWidget:__construct() - */ - public function __construct($id = null) - { - parent::__construct($id); - - $this->addStyleSheet('packages/swat/styles/swat-tile-view.css'); - $this->addJavaScript('packages/swat/javascript/swat-tile-view.js'); - } - // }}} // {{{ public function init() diff --git a/Swat/SwatTimeEntry.php b/Swat/SwatTimeEntry.php index 5b4a22462..2ac3de6c1 100644 --- a/Swat/SwatTimeEntry.php +++ b/Swat/SwatTimeEntry.php @@ -159,10 +159,6 @@ public function __construct($id = null) $this->requires_id = true; - $yui = new SwatYUI(array('event')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - $this->addJavaScript('packages/swat/javascript/swat-time-entry.js'); - // guess twelve-hour or twenty-four hour default based on locale $locale_format = nl_langinfo(T_FMT); $this->twelve_hour = diff --git a/Swat/SwatToolLink.php b/Swat/SwatToolLink.php index 5156c523f..2668dd341 100644 --- a/Swat/SwatToolLink.php +++ b/Swat/SwatToolLink.php @@ -103,23 +103,6 @@ class SwatToolLink extends SwatControl */ protected $stock_class = null; - // }}} - // {{{ public function __construct() - - /** - * Creates a new toollink - * - * @param string $id a non-visible unique id for this widget. - * - * @see SwatWidget::__construct() - */ - public function __construct($id = null) - { - parent::__construct($id); - - $this->addStyleSheet('packages/swat/styles/swat-tool-link.css'); - } - // }}} // {{{ public function init() diff --git a/Swat/SwatToolbar.php b/Swat/SwatToolbar.php index 0659870cc..ff96408f1 100644 --- a/Swat/SwatToolbar.php +++ b/Swat/SwatToolbar.php @@ -9,23 +9,6 @@ */ class SwatToolbar extends SwatDisplayableContainer { - // {{{ public function __construct() - - /** - * Creates a new toolbar - * - * @param string $id a non-visible unique id for this widget. - * - * @see SwatWidget::__construct() - */ - public function __construct($id = null) - { - parent::__construct($id); - - $this->addStyleSheet('packages/swat/styles/swat-toolbar.css'); - } - - // }}} // {{{ public function display() /** diff --git a/Swat/SwatView.php b/Swat/SwatView.php index 603a9de93..7a1e3a6e4 100644 --- a/Swat/SwatView.php +++ b/Swat/SwatView.php @@ -56,25 +56,6 @@ abstract class SwatView extends SwatControl */ protected $selectors = array(); - // }}} - // {{{ public function __construct() - - /** - * Creates a new recordset view - * - * @param string $id a non-visible unique id for this recordset view. - * - * @see SwatWidget::__construct() - */ - public function __construct($id = null) - { - parent::__construct($id); - - $yui = new SwatYUI(array('dom')); - $this->html_head_entry_set->addEntrySet($yui->getHtmlHeadEntrySet()); - $this->addJavaScript('packages/swat/javascript/swat-view.js'); - } - // }}} // {{{ public function init() diff --git a/Swat/SwatWidget.php b/Swat/SwatWidget.php index 15d594ed9..4a5805447 100644 --- a/Swat/SwatWidget.php +++ b/Swat/SwatWidget.php @@ -150,9 +150,7 @@ abstract class SwatWidget extends SwatUIObject public function __construct($id = null) { parent::__construct(); - $this->id = $id; - $this->addStylesheet('packages/swat/styles/swat.css'); } // }}} From 4e60cc1a532e035a2424612aa9c2073f6b2a41c2 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Mon, 1 Jan 2018 20:42:29 -0400 Subject: [PATCH 18/35] Add, remove and update demos --- demo/include/DemoApplication.php | 1 + demo/include/demos/dateentry.xml | 6 ++-- demo/include/demos/progressbar.xml | 39 ++++++++++----------- demo/include/demos/radionotebook.xml | 51 ++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+), 21 deletions(-) create mode 100644 demo/include/demos/radionotebook.xml diff --git a/demo/include/DemoApplication.php b/demo/include/DemoApplication.php index 84d5a3257..cf766e048 100644 --- a/demo/include/DemoApplication.php +++ b/demo/include/DemoApplication.php @@ -39,6 +39,7 @@ class DemoApplication 'PasswordEntry' => 'SwatPasswordEntry', 'ProgressBar' => 'SwatProgressBar', 'RadioList' => 'SwatRadioList', + 'RadioNoteBook' => 'SwatRadioNoteBook', 'Rating' => 'SwatRating', 'Replicable' => 'SwatReplicable', 'SelectList' => 'SwatSelectList', diff --git a/demo/include/demos/dateentry.xml b/demo/include/demos/dateentry.xml index cfdf12c2d..fe3256071 100644 --- a/demo/include/demos/dateentry.xml +++ b/demo/include/demos/dateentry.xml @@ -21,11 +21,13 @@ ]]> text/xml diff --git a/demo/include/demos/progressbar.xml b/demo/include/demos/progressbar.xml index 750a8d2f7..1bb5c0e1e 100644 --- a/demo/include/demos/progressbar.xml +++ b/demo/include/demos/progressbar.xml @@ -64,19 +64,19 @@ } // increase value on mouse movement - function handleMouseMove(event, progress_bar) - { - var value = progress_bar.getValue(); - if (value > 1) { - progress_bar.pulse(); - } else { - var value = progress_bar.getValue() + 0.01; - progress_bar.setValue(value); - } - } - YAHOO.util.Event.addListener('download_progress', 'mousemove', - handleMouseMove, download_progress_obj); + download_progress.addEventListener( + 'mousemove', + function handleMouseMove() { + var value = download_progress_obj.getValue(); + if (value > 1) { + download_progress_obj.pulse(); + } else { + var value = download_progress_obj.getValue() + 0.01; + download_progress_obj.setValue(value); + } + } + ); download_progress_obj.changeValueEvent.subscribe( handleDownloadValueChange); @@ -91,14 +91,15 @@ } // set random value on mouse click - function handleClick(event, progress_bar) - { - var value = Math.round(Math.random() * 100) / 100; - progress_bar.setValueWithAnimation(value); - } - YAHOO.util.Event.addListener('upload_progress', 'click', - handleClick, upload_progress_obj); + + upload_progress.addEventListener( + 'click', + function handleClick() { + var value = Math.round(Math.random() * 100) / 100; + upload_progress_obj.setValueWithAnimation(value); + } + ); upload_progress_obj.changeValueEvent.subscribe( handleUploadValueChange); diff --git a/demo/include/demos/radionotebook.xml b/demo/include/demos/radionotebook.xml new file mode 100644 index 000000000..a3e712269 --- /dev/null +++ b/demo/include/demos/radionotebook.xml @@ -0,0 +1,51 @@ + + + + + + + + Lorum Ipsum + + + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed massa. + Proin aliquam lacus sed felis. Proin sit amet odio luctus ipsum + tristique gravida. Sed pharetra. Duis tortor lorem, porta in, + lacinia nec, molestie sed, dolor. Nulla tortor. Phasellus + scelerisque. Pellentesque orci nisl, aliquam eget, dictum quis, + imperdiet egestas, nibh. Ut ut ante. Proin metus urna, ornare at, + auctor eu, pretium vitae, nibh. + + + + + Praesent Justo + + + Praesent justo sem, sollicitudin vitae, eleifend quis, bibendum non, + diam. Vivamus sed leo. Proin molestie velit. Vestibulum sodales + lobortis augue. Phasellus tempor. Donec vulputate malesuada dolor. + In gravida. Ut placerat ipsum sit amet ligula ultricies posuere. + Vestibulum blandit fringilla elit. Maecenas et mi non sapien congue + pretium. Maecenas euismod lorem ac nisl. Morbi rhoncus tristique. + + + + + Phasellus Tincidunt + + + Phasellus tincidunt, purus et vehicula ultricies, felis sapien + cursus diam, quis ultrices dui metus sed ipsum. Donec sit amet odio. + Cras facilisis mattis libero. Morbi rhoncus tristique magna. + Cras urna enim, viverra gravida, fringilla quis, semper vitae, dui. + Pellentesque habitant morbi tristique senectus et netus et + malesuada fames ac turpis egestas. In consectetuer justo et dolor + eleifend tincidunt. + + + + + + + From 5062ecfbeb07d3e29ec15a6d722f0dce7d0d87db Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Mon, 1 Jan 2018 20:42:53 -0400 Subject: [PATCH 19/35] Modularize more of YUI --- demo/webpack.config.js | 50 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/demo/webpack.config.js b/demo/webpack.config.js index 0fa6b9605..47dbb1ba4 100644 --- a/demo/webpack.config.js +++ b/demo/webpack.config.js @@ -52,6 +52,8 @@ module.exports = { loader: 'exports-loader', options: { Dom: 'YAHOO.util.Dom', + Region: 'YAHOO.util.Region', + Point: 'YAHOO.util.Point', }, }, }, @@ -61,6 +63,7 @@ module.exports = { loader: 'exports-loader', options: { Event: 'YAHOO.util.Event', + EventProvider: 'YAHOO.util.EventProvider', CustomEvent: 'YAHOO.util.CustomEvent', Subscriber: 'YAHOO.util.Subscriber', }, @@ -90,6 +93,44 @@ module.exports = { }, }, }, + { + test: /element\/element.js$/, + use: { + loader: 'exports-loader', + options: { + Attribute: 'YAHOO.util.Attribute', + AttributeProvider: 'YAHOO.util.AttributeProvider', + Element: 'YAHOO.util.Element', + }, + }, + }, + { + test: /imagecropper\/imagecropper.js$/, + use: { + loader: 'exports-loader', + options: { + ImageCropper: 'YAHOO.widget.ImageCropper', + }, + }, + }, + { + test: /selector\/selector.js$/, + use: { + loader: 'exports-loader', + options: { + Selector: 'YAHOO.util.Selector', + }, + }, + }, + { + test: /tabview\/tabview.js$/, + use: { + loader: 'exports-loader', + options: { + TabView: 'YAHOO.widget.TabView', + }, + }, + }, ], }, resolve: { @@ -100,17 +141,26 @@ module.exports = { new ProvidePlugin({ YAHOO: '../../../yui/www/yahoo/yahoo', 'YAHOO.util.Dom': ['../../../yui/www/dom/dom', 'Dom'], + 'YAHOO.util.Region': ['../../../yui/www/dom/dom', 'Region'], + 'YAHOO.util.Point': ['../../../yui/www/dom/dom', 'Point'], 'YAHOO.util.Event': ['../../../yui/www/event/event', 'Event'], + 'YAHOO.util.EventProvider': ['../../../yui/www/event/event', 'EventProvider'], 'YAHOO.util.CustomEvent': ['../../../yui/www/event/event', 'CustomEvent'], 'YAHOO.util.Subscriber': ['../../../yui/www/event/event', 'Subscriber'], 'YAHOO.util.Anim': ['../../../yui/www/animation/animation', 'Anim'], 'YAHOO.util.AnimMgr': ['../../../yui/www/animation/animation', 'AnimMgr'], 'YAHOO.util.Easing': ['../../../yui/www/animation/animation', 'Easing'], + 'YAHOO.util.Selector': ['../../../yui/www/selector/selector', 'Selector'], + 'YAHOO.util.Attribute': ['../../../yui/www/element/element', 'Attribute'], + 'YAHOO.util.AttributeProvider': ['../../../yui/www/element/element', 'AttributeProvider'], + 'YAHOO.util.Element': ['../../../yui/www/element/element', 'Element'], 'YAHOO.util.Config': ['../../../yui/www/container/container_core', 'Config'], 'YAHOO.widget.Module': ['../../../yui/www/container/container_core', 'Module'], 'YAHOO.widget.Overlay': ['../../../yui/www/container/container_core', 'Overlay'], 'YAHOO.widget.OverlayManager': ['../../../yui/www/container/container_core', 'OverlayManager'], 'YAHOO.widget.ContainerEffect': ['../../../yui/www/container/container_core', 'ContainerEffect'], + 'YAHOO.widget.ImageCropper': ['../../../yui/www/imagecropper/imagecropper', 'ImageCropper'], + 'YAHOO.widget.TabView': ['../../../yui/www/tabview/tabview', 'TabView'], }), ], }; From 6ae294db87c55ae7d5fc45b88c877ab1432d66a9 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Mon, 1 Jan 2018 20:43:18 -0400 Subject: [PATCH 20/35] Add a class for SwatNoteBook --- Swat/SwatNoteBook.php | 12 ++++++++---- www/javascript/swat-note-book.js | 10 ++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 www/javascript/swat-note-book.js diff --git a/Swat/SwatNoteBook.php b/Swat/SwatNoteBook.php index 3c42bed80..e0269a663 100644 --- a/Swat/SwatNoteBook.php +++ b/Swat/SwatNoteBook.php @@ -10,6 +10,7 @@ */ class SwatNoteBook extends SwatWidget implements SwatUIParent { +<<<<<<< HEAD // {{{ constants /** @@ -552,12 +553,15 @@ protected function getInlineJavaScript() break; } + $options = [ + 'orientation' => $position, + ]; + return sprintf( - "var %s_obj = new YAHOO.widget.TabView(" . - "'%s', {orientation: '%s'});", - $this->id, + 'var %s_obj = new SwatNoteBook(%s, %s);', $this->id, - $position + SwatString::quoteJavaScriptString($this->id), + json_encode($options) ); } diff --git a/www/javascript/swat-note-book.js b/www/javascript/swat-note-book.js new file mode 100644 index 000000000..3f1a4184d --- /dev/null +++ b/www/javascript/swat-note-book.js @@ -0,0 +1,10 @@ +import { TabView } from '../../../yui/www/tabview/tabview'; + +import '../../../yui/www/tabview/assets/tabview.css'; +import '../styles/swat-note-book.css'; + +export default class SwatNoteBook { + constructor(id, options) { + this.tabview = new TabView(id, options); + } +} From 20f6486b0b664f781e338a499ad81fcb6d7f9041 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Mon, 1 Jan 2018 20:43:52 -0400 Subject: [PATCH 21/35] Import YUI modules in swat widgets --- www/javascript/index.js | 31 ++--- www/javascript/swat-button.js | 2 + www/javascript/swat-calendar.js | 41 +++--- www/javascript/swat-cascade.js | 4 +- www/javascript/swat-change-order.js | 81 ++++++----- www/javascript/swat-check-all.js | 12 +- www/javascript/swat-checkbox-cell-renderer.js | 26 +++- www/javascript/swat-checkbox-entry-list.js | 7 +- www/javascript/swat-checkbox-list.js | 8 +- www/javascript/swat-date-entry.js | 13 +- www/javascript/swat-fieldset.js | 6 +- www/javascript/swat-form.js | 2 + www/javascript/swat-image-cropper.js | 4 +- www/javascript/swat-image-preview-display.js | 74 +++++----- www/javascript/swat-progress-bar.js | 12 +- .../swat-radio-button-cell-renderer.js | 22 ++- www/javascript/swat-radio-note-book.js | 47 ++++--- www/javascript/swat-rating.js | 20 +-- www/javascript/swat-search-entry.js | 31 +++-- www/javascript/swat-table-view.js | 49 ++++--- www/javascript/swat-textarea.js | 75 +++++----- www/javascript/swat-tile-view.js | 8 +- www/javascript/swat-time-entry.js | 15 +- www/styles/swat-abstract-overlay.css | 22 +++ www/styles/swat-button.css | 37 +++++ www/styles/swat-expandable-checkbox-tree.css | 49 +++++++ www/styles/swat-fieldset.css | 24 ++++ www/styles/swat-form.css | 0 www/styles/swat-frame.css | 20 +++ www/styles/swat.css | 131 +----------------- 30 files changed, 487 insertions(+), 386 deletions(-) create mode 100644 www/styles/swat-abstract-overlay.css create mode 100644 www/styles/swat-button.css create mode 100644 www/styles/swat-expandable-checkbox-tree.css create mode 100644 www/styles/swat-fieldset.css create mode 100644 www/styles/swat-form.css create mode 100644 www/styles/swat-frame.css diff --git a/www/javascript/index.js b/www/javascript/index.js index 0bb086f98..5b3813f41 100644 --- a/www/javascript/index.js +++ b/www/javascript/index.js @@ -2,7 +2,6 @@ import SwatAbstractOverlay from './swat-abstract-overlay'; import SwatAccordion from './swat-accordion'; import SwatActions from './swat-actions'; import SwatButton from './swat-button'; -/* import SwatCalendar from './swat-calendar'; import SwatCascade from './swat-cascade'; import SwatChangeOrder from './swat-change-order'; @@ -10,57 +9,51 @@ import SwatCheckAll from './swat-check-all'; import SwatCheckboxCellRenderer from './swat-checkbox-cell-renderer'; import SwatCheckboxEntryList from './swat-checkbox-entry-list'; import SwatCheckboxList from './swat-checkbox-list'; +/* import SwatColorEntry from './swat-color-entry'; -import SwatDateEntry from './swat-date-entry'; */ +import SwatDateEntry from './swat-date-entry'; import SwatDisclosure from './swat-disclosure'; -/* import SwatExpandableCheckboxTree from './swat-expandable-checkbox-tree'; import SwatFieldset from './swat-fieldset'; -*/ import SwatForm from './swat-form'; import SwatFrameDisclosure from './swat-frame-disclosure'; -/* import SwatImageCropper from './swat-image-cropper'; import SwatImagePreviewDisplay from './swat-image-preview-display'; -*/ import SwatMessageDisplay from './swat-message-display'; import SwatMessageDisplayMessage from './swat-message-display-message'; -/* +import SwatNoteBook from './swat-note-book'; import SwatProgressBar from './swat-progress-bar'; import SwatRadioButtonCellRenderer from './swat-radio-button-cell-renderer'; import SwatRadioNoteBook from './swat-radio-note-book'; import SwatRating from './swat-rating'; import SwatSearchEntry from './swat-search-entry'; -*/ import SwatSimpleColorEntry from './swat-simple-color-entry'; /* import SwatTableViewInputRow from './swat-table-view-input-row'; +*/ import SwatTableView from './swat-table-view'; import SwatTextarea from './swat-textarea'; import SwatTileView from './swat-tile-view'; import SwatTimeEntry from './swat-time-entry'; import SwatView from './swat-view'; -*/ import SwatZIndexManager from './swat-z-index-manager'; +import '../styles/swat.css'; import '../styles/swat-details-view.css'; -import '../styles/swat-menu.css'; +import '../styles/swat-frame.css'; import '../styles/swat-money-cell-renderer.css'; -import '../styles/swat-note-book.css'; import '../styles/swat-null-text-cell-renderer.css'; import '../styles/swat-pagination.css'; import '../styles/swat-radio-list.css'; import '../styles/swat-radio-table.css'; import '../styles/swat-tool-link.css'; import '../styles/swat-toolbar.css'; -import '../styles/swat.css'; window.SwatAbstractOverlay = SwatAbstractOverlay; window.SwatAccordion = SwatAccordion; window.SwatActions = SwatActions; window.SwatButton = SwatButton; -/* window.SwatCalendar = SwatCalendar; window.SwatCascade = SwatCascade; window.SwatChangeOrder = SwatChangeOrder; @@ -68,36 +61,32 @@ window.SwatCheckAll = SwatCheckAll; window.SwatCheckboxCellRenderer = SwatCheckboxCellRenderer; window.SwatCheckboxEntryList = SwatCheckboxEntryList; window.SwatCheckboxList = SwatCheckboxList; +/* window.SwatColorEntry = SwatColorEntry; -window.SwatDateEntry = SwatDateEntry; */ +window.SwatDateEntry = SwatDateEntry; window.SwatDisclosure = SwatDisclosure; -/* window.SwatExpandableCheckboxTree = SwatExpandableCheckboxTree; window.SwatFieldset = SwatFieldset; -*/ window.SwatForm = SwatForm; window.SwatFrameDisclosure = SwatFrameDisclosure; -/* window.SwatImageCropper = SwatImageCropper; window.SwatImagePreviewDisplay = SwatImagePreviewDisplay; -*/ window.SwatMessageDisplay = SwatMessageDisplay; window.SwatMessageDisplayMessage = SwatMessageDisplayMessage; -/* +window.SwatNoteBook = SwatNoteBook; window.SwatProgressBar = SwatProgressBar; window.SwatRadioButtonCellRenderer = SwatRadioButtonCellRenderer; window.SwatRadioNoteBook = SwatRadioNoteBook; window.SwatRating = SwatRating; window.SwatSearchEntry = SwatSearchEntry; -*/ window.SwatSimpleColorEntry = SwatSimpleColorEntry; /* window.SwatTableViewInputRow = SwatTableViewInputRow; +*/ window.SwatTableView = SwatTableView; window.SwatTextarea = SwatTextarea; window.SwatTileView = SwatTileView; window.SwatTimeEntry = SwatTimeEntry; window.SwatView = SwatView; -*/ window.SwatZIndexManager = SwatZIndexManager; diff --git a/www/javascript/swat-button.js b/www/javascript/swat-button.js index 109ba551e..7fccd6623 100644 --- a/www/javascript/swat-button.js +++ b/www/javascript/swat-button.js @@ -1,6 +1,8 @@ import { Dom } from '../../../yui/www/dom/dom'; import { Anim, Easing } from '../../../yui/www/animation/animation'; +import '../styles/swat-button.css'; + export default class SwatButton { constructor(id, options) { this.id = id; diff --git a/www/javascript/swat-calendar.js b/www/javascript/swat-calendar.js index 6c8743220..45afcf4ad 100644 --- a/www/javascript/swat-calendar.js +++ b/www/javascript/swat-calendar.js @@ -1,3 +1,8 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { Event, CustomEvent } from '../../../yui/www/event/event'; +import { Overlay, ContainerEffect } from '../../../yui/www/container/container_core'; + +import '../../../yui/www/container/assets/container-core.css'; import '../styles/swat-calendar.css'; /** @@ -58,7 +63,7 @@ class SwatCalendar { // Draw the calendar on window load to prevent "Operation Aborted" // errors in MSIE 6 and 7. - YAHOO.util.Event.on(window, 'load', this.createOverlay, this, true); + Event.on(window, 'load', this.createOverlay, this, true); this.open = false; this.positioned = false; @@ -73,7 +78,7 @@ class SwatCalendar { this.container = document.getElementById(this.id); this.drawButton(); - this.overlay = new YAHOO.widget.Overlay( + this.overlay = new Overlay( this.id + '_div', { visible: false, constraintoviewport: true, @@ -117,7 +122,7 @@ class SwatCalendar { } if (sensitivity) { - YAHOO.util.Dom.removeClass(this.container, 'swat-insensitive'); + Dom.removeClass(this.container, 'swat-insensitive'); if (this.drawn) { if (this.toggle_button_insensitive.parentNode) { @@ -133,7 +138,7 @@ class SwatCalendar { } } else { - YAHOO.util.Dom.addClass(this.container, 'swat-insensitive'); + Dom.addClass(this.container, 'swat-insensitive'); if (this.drawn) { if (this.toggle_button.parentNode) { @@ -157,7 +162,7 @@ class SwatCalendar { */ drawButton() { this.toggle_button_insensitive = document.createElement('span'); - YAHOO.util.Dom.addClass( + Dom.addClass( this.toggle_button_insensitive, 'swat-calendar-toggle-button' ); @@ -166,13 +171,13 @@ class SwatCalendar { this.toggle_button.id = this.id + '_toggle'; this.toggle_button.href = '#'; this.toggle_button.title = SwatCalendar.open_toggle_text; - YAHOO.util.Dom.addClass( + Dom.addClass( this.toggle_button, 'swat-calendar-toggle-button' ); - YAHOO.util.Event.on(this.toggle_button, 'click', + Event.on(this.toggle_button, 'click', function(e) { - YAHOO.util.Event.preventDefault(e); + Event.preventDefault(e); this.toggle(); }, this, @@ -191,16 +196,16 @@ class SwatCalendar { var calendar_div = document.createElement('div'); calendar_div.id = this.id + '_div'; calendar_div.style.display = 'none'; - YAHOO.util.Dom.addClass(calendar_div, 'swat-calendar-div'); + Dom.addClass(calendar_div, 'swat-calendar-div'); var overlay_header = document.createElement('div'); - YAHOO.util.Dom.addClass(overlay_header, 'hd'); + Dom.addClass(overlay_header, 'hd'); var overlay_body = document.createElement('div'); - YAHOO.util.Dom.addClass(overlay_body, 'bd'); + Dom.addClass(overlay_body, 'bd'); var overlay_footer = document.createElement('div'); - YAHOO.util.Dom.addClass(overlay_footer, 'ft'); + Dom.addClass(overlay_footer, 'ft'); calendar_div.appendChild(overlay_header); calendar_div.appendChild(overlay_body); @@ -271,7 +276,7 @@ class SwatCalendar { close() { this.overlay.hide(); this.open = false; - YAHOO.util.Event.removeListener( + Event.removeListener( document, 'click', this.handleDocumentClick @@ -768,7 +773,7 @@ class SwatCalendar { this.overlay.show(); this.open = true; - YAHOO.util.Event.on( + Event.on( document, 'click', this.handleDocumentClick, @@ -781,7 +786,7 @@ class SwatCalendar { handleDocumentClick(e) { var close = true; - var target = YAHOO.util.Event.getTarget(e); + var target = Event.getTarget(e); if (target === this.toggle_button || target === this.overlay.element) { close = false; @@ -789,7 +794,7 @@ class SwatCalendar { while (target.parentNode) { target = target.parentNode; if (target === this.overlay.element || - YAHOO.util.Dom.hasClass(target, 'swat-calendar-frame')) { + Dom.hasClass(target, 'swat-calendar-frame')) { close = false; break; } @@ -808,11 +813,11 @@ class SwatCalendar { * Shows instantly and hides with configurable fade duration. */ SwatCalendar.Effect = function(overlay, duration) { - var effect = YAHOO.widget.ContainerEffect.FADE(overlay, duration); + var effect = ContainerEffect.FADE(overlay, duration); effect.attrIn = { attributes: { opacity: { from: 0, to: 1 } }, duration: 0, - method: YAHOO.util.Easing.easeIn + method: Easing.easeIn }; effect.init(); return effect; diff --git a/www/javascript/swat-cascade.js b/www/javascript/swat-cascade.js index 6513fb8f8..e4e86836d 100644 --- a/www/javascript/swat-cascade.js +++ b/www/javascript/swat-cascade.js @@ -1,3 +1,5 @@ +import { Event } from '../../../yui/www/event/event'; + import SwatCascadeChild from './swat-cascade-child'; export default class SwatCascade { @@ -6,7 +8,7 @@ export default class SwatCascade { this.to_flydown = document.getElementById(to_flydown_id); this.children = []; - YAHOO.util.Event.addListener( + Event.addListener( this.from_flydown, 'change', this.handleChange, diff --git a/www/javascript/swat-change-order.js b/www/javascript/swat-change-order.js index 540b84694..5cdfe225d 100644 --- a/www/javascript/swat-change-order.js +++ b/www/javascript/swat-change-order.js @@ -1,3 +1,6 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { Event, CustomEvent } from '../../../yui/www/event/event'; + import '../styles/swat-change-order.css'; /** @@ -62,13 +65,13 @@ class SwatChangeOrder { node.controller = this; // add click handlers to the list items - YAHOO.util.Event.addListener( + Event.addListener( node, 'mousedown', SwatChangeOrder_mousedownEventHandler ); - YAHOO.util.Dom.removeClass( + Dom.removeClass( node, 'swat-change-order-item-active' ); @@ -99,10 +102,10 @@ class SwatChangeOrder { } this.sensitive = sensitive; - this.orderChangeEvent = new YAHOO.util.CustomEvent('orderChange'); + this.orderChangeEvent = new CustomEvent('orderChange'); // add grippies - YAHOO.util.Event.on(window, 'load', function() { + Event.on(window, 'load', function() { var node, grippy, height; // exclude last item because it is the sentinel node for (var i = 0; i < this.list_div.childNodes.length - 1; i++) { @@ -110,7 +113,7 @@ class SwatChangeOrder { grippy = document.createElement('span'); grippy.className = 'swat-change-order-item-grippy'; - height = YAHOO.util.Dom.getRegion(node).height - 4; + height = Dom.getRegion(node).height - 4; grippy.style.height = height + 'px'; node.insertBefore(grippy, node.firstChild); @@ -135,9 +138,9 @@ class SwatChangeOrder { return false; } - YAHOO.util.Dom.addClass(el, 'swat-change-order-item'); + Dom.addClass(el, 'swat-change-order-item'); - YAHOO.util.Event.addListener( + Event.addListener( el, 'mousedown', SwatChangeOrder_mousedownEventHandler @@ -183,7 +186,7 @@ class SwatChangeOrder { return false; } - YAHOO.util.Event.purgeElement(el); + Event.purgeElement(el); // remove from hidden value var hidden_value = document.getElementById(this.id + '_value'); @@ -312,11 +315,9 @@ class SwatChangeOrder { */ moveToTopHelper(steps) { if (this.moveUpHelper(steps)) { - setTimeout( - 'SwatChangeOrder_staticMoveToTop(' + - this.id + '_obj, ' + steps + ');', - SwatChangeOrder.animation_delay - ); + setTimeout(() => { + SwatChangeOrder_staticMoveToTop(this, steps); + }, SwatChangeOrder.animation_delay); } else { this.semaphore = true; this.setButtonsSensitive(true); @@ -361,11 +362,9 @@ class SwatChangeOrder { */ moveToBottomHelper(steps) { if (this.moveDownHelper(steps)) { - setTimeout( - 'SwatChangeOrder_staticMoveToBottom(' + - this.id + '_obj, ' + steps + ');', - SwatChangeOrder.animation_delay - ); + setTimeout(() => { + SwatChangeOrder_staticMoveToBottom(this, steps); + }, SwatChangeOrder.animation_delay); } else { this.semaphore = true; this.setButtonsSensitive(true); @@ -639,7 +638,7 @@ class SwatChangeOrder { */ isGrid() { var node = this.list_div.childNodes[0]; - return (YAHOO.util.Dom.getStyle(node, 'float') !== 'none'); + return (Dom.getStyle(node, 'float') !== 'none'); } // }}} @@ -709,8 +708,8 @@ function SwatChangeOrder_mousemoveEventHandler(event) setInterval(SwatChangeOrder_updateTimerHandler(), 300); } - var left = YAHOO.util.Event.getPageX(event) - shadow_item.mouse_offset_x; - var top = YAHOO.util.Event.getPageY(event) - shadow_item.mouse_offset_y; + var left = Event.getPageX(event) - shadow_item.mouse_offset_x; + var top = Event.getPageY(event) - shadow_item.mouse_offset_y; shadow_item.style.top = top + 'px'; shadow_item.style.left = left + 'px'; @@ -733,13 +732,13 @@ function SwatChangeOrder_keydownEventHandler(event) { // user pressed escape if (event.keyCode == 27) { - YAHOO.util.Event.removeListener(document, 'mousemove', + Event.removeListener(document, 'mousemove', SwatChangeOrder_mousemoveEventHandler); - YAHOO.util.Event.removeListener(document, 'mouseup', + Event.removeListener(document, 'mouseup', SwatChangeOrder_mouseupEventHandler); - YAHOO.util.Event.removeListener(document, 'keydown', + Event.removeListener(document, 'keydown', SwatChangeOrder_keydownEventHandler); var shadow_item = SwatChangeOrder.dragging_item; @@ -775,8 +774,8 @@ function SwatChangeOrder_scrollTimerHandler() var shadow_item = SwatChangeOrder.dragging_item; var list_div = shadow_item.original_item.parentNode; - var list_div_top = YAHOO.util.Dom.getY(list_div); - var middle = YAHOO.util.Dom.getY(shadow_item) + + var list_div_top = Dom.getY(list_div); + var middle = Dom.getY(shadow_item) + Math.floor(shadow_item.offsetHeight / 2); // top hot spot scrolls list up @@ -831,13 +830,13 @@ function SwatChangeOrder_updateDropPosition() var drop_marker = SwatChangeOrder.dragging_drop_marker; var list_div = shadow_item.original_item.parentNode; - var y_middle = YAHOO.util.Dom.getY(shadow_item) + + var y_middle = Dom.getY(shadow_item) + Math.floor(shadow_item.offsetHeight / 2) - - YAHOO.util.Dom.getY(list_div) + list_div.scrollTop; + Dom.getY(list_div) + list_div.scrollTop; - var x_middle = YAHOO.util.Dom.getX(shadow_item) + + var x_middle = Dom.getX(shadow_item) + Math.floor(shadow_item.offsetWidth / 2) - - YAHOO.util.Dom.getX(list_div) + list_div.scrollLeft; + Dom.getX(list_div) + list_div.scrollLeft; var is_grid = shadow_item.original_item.controller.isGrid(); @@ -927,13 +926,13 @@ function SwatChangeOrder_mouseupEventHandler(event) (!is_ie && !is_webkit && event.button !== 0)) return false; - YAHOO.util.Event.removeListener(document, 'mousemove', + Event.removeListener(document, 'mousemove', SwatChangeOrder_mousemoveEventHandler); - YAHOO.util.Event.removeListener(document, 'mouseup', + Event.removeListener(document, 'mouseup', SwatChangeOrder_mouseupEventHandler); -// YAHOO.util.Event.removeListener(document, 'keydown', +// Event.removeListener(document, 'keydown', // SwatChangeOrder_keydownEventHandler); var shadow_item = SwatChangeOrder.dragging_item; @@ -976,7 +975,7 @@ function SwatChangeOrder_mouseupEventHandler(event) function SwatChangeOrder_mousedownEventHandler(event) { // prevent text selection - YAHOO.util.Event.preventDefault(event); + Event.preventDefault(event); // only allow left click to do things var is_webkit = (/AppleWebKit|Konqueror|KHTML/gi).test(navigator.userAgent); @@ -1002,11 +1001,11 @@ function SwatChangeOrder_mousedownEventHandler(event) shadow_item.className += ' swat-change-order-item-shadow'; shadow_item.style.width = (this.offsetWidth - 4) + 'px'; - shadow_item.mouse_offset_x = YAHOO.util.Event.getPageX(event) - - YAHOO.util.Dom.getX(this); + shadow_item.mouse_offset_x = Event.getPageX(event) - + Dom.getX(this); - shadow_item.mouse_offset_y = YAHOO.util.Event.getPageY(event) - - YAHOO.util.Dom.getY(this); + shadow_item.mouse_offset_y = Event.getPageY(event) - + Dom.getY(this); var drop_marker = document.createElement('div'); @@ -1027,13 +1026,13 @@ function SwatChangeOrder_mousedownEventHandler(event) SwatChangeOrder.dragging_item = shadow_item; SwatChangeOrder.dragging_drop_marker = drop_marker; - YAHOO.util.Event.addListener(document, 'mousemove', + Event.addListener(document, 'mousemove', SwatChangeOrder_mousemoveEventHandler); - YAHOO.util.Event.addListener(document, 'mouseup', + Event.addListener(document, 'mouseup', SwatChangeOrder_mouseupEventHandler); - YAHOO.util.Event.addListener(document, 'keydown', + Event.addListener(document, 'keydown', SwatChangeOrder_keydownEventHandler); return false; diff --git a/www/javascript/swat-check-all.js b/www/javascript/swat-check-all.js index 3263be4dc..bc0f484d3 100644 --- a/www/javascript/swat-check-all.js +++ b/www/javascript/swat-check-all.js @@ -1,3 +1,7 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { Event } from '../../../yui/www/event/event'; +import { Anim, Easing } from '../../../yui/www/animation/animation'; + export default class SwatCheckAll { /** * Creates a new check-all object @@ -42,11 +46,11 @@ export default class SwatCheckAll { if (this.check_all.checked) { var in_attributes = { opacity: { from: 0, to: 1 } }; - var in_animation = new YAHOO.util.Anim( + var in_animation = new Anim( container, in_attributes, 0.5, - YAHOO.util.Easing.easeIn + Easing.easeIn ); container.style.opacity = 0; @@ -71,14 +75,14 @@ export default class SwatCheckAll { setController(controller) { // only add the event handler the first time if (this.controller === null) { - YAHOO.util.Event.addListener( + Event.addListener( this.check_all, 'click', this.clickHandler, this, true ); - YAHOO.util.Event.addListener( + Event.addListener( this.check_all, 'dblclick', this.clickHandler, diff --git a/www/javascript/swat-checkbox-cell-renderer.js b/www/javascript/swat-checkbox-cell-renderer.js index c8931cf95..57403be1c 100644 --- a/www/javascript/swat-checkbox-cell-renderer.js +++ b/www/javascript/swat-checkbox-cell-renderer.js @@ -1,3 +1,5 @@ +import { Event } from '../../../yui/www/event/event'; + export default class SwatCheckboxCellRenderer { /** * Checkbox cell renderer controller @@ -34,14 +36,24 @@ export default class SwatCheckboxCellRenderer { input_nodes[i]._index = this.check_list.length; this.check_list.push(input_nodes[i]); this.updateNode(input_nodes[i]); - YAHOO.util.Event.addListener(input_nodes[i], 'click', - this.handleClick, this, true); + Event.addListener( + input_nodes[i], + 'click', + this.handleClick, + this, + true + ); - YAHOO.util.Event.addListener(input_nodes[i], 'dblclick', - this.handleClick, this, true); + Event.addListener( + input_nodes[i], + 'dblclick', + this.handleClick, + this, + true + ); // prevent selecting label text when shify key is held - YAHOO.util.Event.addListener( + Event.addListener( input_nodes[i].parentNode, 'mousedown', this.handleMouseDown, @@ -54,11 +66,11 @@ export default class SwatCheckboxCellRenderer { handleMouseDown(e) { // prevent selecting label text when shify key is held - YAHOO.util.Event.preventDefault(e); + Event.preventDefault(e); } handleClick(e) { - var checkbox_node = YAHOO.util.Event.getTarget(e); + var checkbox_node = Event.getTarget(e); this.updateNode(checkbox_node, e.shiftKey); this.updateCheckAll(); this.last_clicked_index = checkbox_node._index; diff --git a/www/javascript/swat-checkbox-entry-list.js b/www/javascript/swat-checkbox-entry-list.js index 084662928..33d165d17 100644 --- a/www/javascript/swat-checkbox-entry-list.js +++ b/www/javascript/swat-checkbox-entry-list.js @@ -1,4 +1,7 @@ +import { Dom } from '../../../yui/www/dom/dom'; + import SwatCheckboxList from './swat-checkbox-list'; + import '../styles/swat-checkbox-entry-list.css'; export default class SwatCheckboxEntryList extends SwatCheckboxList { @@ -44,13 +47,13 @@ export default class SwatCheckboxEntryList extends SwatCheckboxList { if (this.entry_list[index]) { if (sensitivity) { this.entry_list[index].disabled = false; - YAHOO.util.Dom.removeClass( + Dom.removeClass( this.entry_list[index], 'swat-insensitive' ); } else { this.entry_list[index].disabled = true; - YAHOO.util.Dom.addClass( + Dom.addClass( this.entry_list[index], 'swat-insensitive' ); diff --git a/www/javascript/swat-checkbox-list.js b/www/javascript/swat-checkbox-list.js index d7091cf74..4553b3e6a 100644 --- a/www/javascript/swat-checkbox-list.js +++ b/www/javascript/swat-checkbox-list.js @@ -1,3 +1,5 @@ +import { Event } from '../../../yui/www/event/event'; + export default class SwatCheckboxList { /** * JavaScript SwatCheckboxList component @@ -8,7 +10,7 @@ export default class SwatCheckboxList { this.id = id; this.check_list = []; this.check_all = null; // a reference to a check-all js object - YAHOO.util.Event.onDOMReady(this.init, this, true); + Event.onDOMReady(this.init, this, true); } init() { @@ -23,14 +25,14 @@ export default class SwatCheckboxList { } for (var i = 0; i < this.check_list.length; i++) { - YAHOO.util.Event.on( + Event.on( this.check_list[i], 'click', this.handleClick, this, true ); - YAHOO.util.Event.on( + Event.on( this.check_list[i], 'dblclick', this.handleClick, diff --git a/www/javascript/swat-date-entry.js b/www/javascript/swat-date-entry.js index 0a0dfb10c..94978d841 100644 --- a/www/javascript/swat-date-entry.js +++ b/www/javascript/swat-date-entry.js @@ -1,3 +1,6 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { Event } from '../../../yui/www/event/event'; + export default class SwatDateEntry { constructor(id, use_current_date) { this.id = id; @@ -11,7 +14,7 @@ export default class SwatDateEntry { this.time_entry = null; if (this.year) { - YAHOO.util.Event.addListener( + Event.addListener( this.year, 'change', this.handleYearChange, @@ -21,7 +24,7 @@ export default class SwatDateEntry { } if (this.month) { - YAHOO.util.Event.addListener( + Event.addListener( this.month, 'change', this.handleMonthChange, @@ -31,7 +34,7 @@ export default class SwatDateEntry { } if (this.day) { - YAHOO.util.Event.addListener( + Event.addListener( this.day, 'change', this.handleDayChange, @@ -62,10 +65,10 @@ export default class SwatDateEntry { for (var i = 0; i < elements.length; i++) { if (sensitivity) { elements[i].disabled = false; - YAHOO.util.Dom.removeClass(elements[i], 'swat-insensitive'); + Dom.removeClass(elements[i], 'swat-insensitive'); } else { elements[i].disabled = true; - YAHOO.util.Dom.addClass(elements[i], 'swat-insensitive'); + Dom.addClass(elements[i], 'swat-insensitive'); } } diff --git a/www/javascript/swat-fieldset.js b/www/javascript/swat-fieldset.js index 8fd3aa9d1..5a79f41cc 100644 --- a/www/javascript/swat-fieldset.js +++ b/www/javascript/swat-fieldset.js @@ -1,7 +1,11 @@ +import { Event } from '../../../yui/www/event/event'; + +import '../styles/swat-fieldset.css'; + export default class SwatFieldset { constructor(id) { this.id = id; - YAHOO.util.Event.onAvailable(this.id, this.init, this, true); + Event.onAvailable(this.id, this.init, this, true); } init() { diff --git a/www/javascript/swat-form.js b/www/javascript/swat-form.js index 84f1f654c..f19a15a93 100644 --- a/www/javascript/swat-form.js +++ b/www/javascript/swat-form.js @@ -1,5 +1,7 @@ import { Event } from '../../../yui/www/event/event'; +import '../styles/swat-form.css'; + export default class SwatForm { constructor(id, connection_close_url) { this.id = id; diff --git a/www/javascript/swat-image-cropper.js b/www/javascript/swat-image-cropper.js index 1230b8a73..fdde65431 100644 --- a/www/javascript/swat-image-cropper.js +++ b/www/javascript/swat-image-cropper.js @@ -1,8 +1,10 @@ +import { ImageCropper } from '../../../yui/www/imagecropper/imagecropper'; + export default class SwatImageCropper { constructor(id, config) { this.id = id; - this.cropper = new YAHOO.widget.ImageCropper( + this.cropper = new ImageCropper( this.id + '_image', config ); diff --git a/www/javascript/swat-image-preview-display.js b/www/javascript/swat-image-preview-display.js index 90272f0d4..7d9f1b063 100644 --- a/www/javascript/swat-image-preview-display.js +++ b/www/javascript/swat-image-preview-display.js @@ -1,4 +1,8 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { Event, CustomEvent } from '../../../yui/www/event/event'; + import SwatZIndexManager from './swat-z-index-manager'; + import '../styles/swat-image-preview-display.css'; class SwatImagePreviewDisplay { @@ -11,10 +15,10 @@ class SwatImagePreviewDisplay { this.preview_width = preview_width; this.preview_height = preview_height; - this.onOpen = new YAHOO.util.CustomEvent('open'); - this.onClose = new YAHOO.util.CustomEvent('close'); + this.onOpen = new CustomEvent('open'); + this.onClose = new CustomEvent('close'); - YAHOO.util.Event.onDOMReady(this.init, this, true); + Event.onDOMReady(this.init, this, true); } init() { @@ -25,8 +29,8 @@ class SwatImagePreviewDisplay { if (image_wrapper.tagName === 'A') { image_wrapper.href = '#view'; - YAHOO.util.Event.on(image_wrapper, 'click', function(e) { - YAHOO.util.Event.preventDefault(e); + Event.on(image_wrapper, 'click', function(e) { + Event.preventDefault(e); if (!this.opened) { this.onOpen.fire('thumbnail'); } @@ -55,8 +59,8 @@ class SwatImagePreviewDisplay { image_link.appendChild(span_tag); } - YAHOO.util.Event.on(image_link, 'click', function(e) { - YAHOO.util.Event.preventDefault(e); + Event.on(image_link, 'click', function(e) { + Event.preventDefault(e); if (!this.opened) { this.onOpen.fire('thumbnail'); } @@ -66,7 +70,7 @@ class SwatImagePreviewDisplay { } open() { - YAHOO.util.Event.on( + Event.on( document, 'keydown', this.handleKeyDown, @@ -76,8 +80,8 @@ class SwatImagePreviewDisplay { // get approximate max height and width excluding close text var padding = SwatImagePreviewDisplay.padding; - var max_width = YAHOO.util.Dom.getViewportWidth() - (padding * 2); - var max_height = YAHOO.util.Dom.getViewportHeight() - (padding * 2); + var max_width = Dom.getViewportWidth() - (padding * 2); + var max_height = Dom.getViewportHeight() - (padding * 2); this.showOverlay(); @@ -87,14 +91,14 @@ class SwatImagePreviewDisplay { this.preview_container.style.display = 'block'; // now that is it displayed, adjust height for the close text - var region = YAHOO.util.Dom.getRegion(this.preview_header); + var region = Dom.getRegion(this.preview_header); max_height -= (region.bottom - region.top); this.scaleImage(max_width, max_height); this.preview_container.style.visibility = 'visible'; // x is relative to center of page - var scroll_top = YAHOO.util.Dom.getDocumentScrollTop(); + var scroll_top = Dom.getDocumentScrollTop(); var x = -Math.round((this.preview_image.width + padding) / 2); var y = Math.round( (max_height - this.preview_image.height + padding) / 2 @@ -155,22 +159,26 @@ class SwatImagePreviewDisplay { SwatZIndexManager.raiseElement(this.preview_mask); - YAHOO.util.Event.on(this.preview_mask, 'click', function(e) { - YAHOO.util.Event.preventDefault(e); + Event.on(this.preview_mask, 'click', function(e) { + Event.preventDefault(e); if (this.opened) { this.onClose.fire('overlayMask'); } this.close(); }, this, true); - YAHOO.util.Event.on(this.preview_mask, 'mouseover', function(e) { - YAHOO.util.Dom.addClass(this.preview_close_button, - 'swat-image-preview-close-hover'); + Event.on(this.preview_mask, 'mouseover', function(e) { + Dom.addClass( + this.preview_close_button, + 'swat-image-preview-close-hover' + ); }, this, true); - YAHOO.util.Event.on(this.preview_mask, 'mouseout', function(e) { - YAHOO.util.Dom.removeClass(this.preview_close_button, - 'swat-image-preview-close-hover'); + Event.on(this.preview_mask, 'mouseout', function(e) { + Dom.removeClass( + this.preview_close_button, + 'swat-image-preview-close-hover' + ); }, this, true); // preview title @@ -215,22 +223,26 @@ class SwatImagePreviewDisplay { SwatZIndexManager.raiseElement(this.preview_container); - YAHOO.util.Event.on(this.preview_container, 'click', function(e) { - YAHOO.util.Event.preventDefault(e); + Event.on(this.preview_container, 'click', function(e) { + Event.preventDefault(e); if (this.opened) { this.onClose.fire('container'); } this.close(); }, this, true); - YAHOO.util.Event.on(this.preview_container, 'mouseover', function(e) { - YAHOO.util.Dom.addClass(this.preview_close_button, - 'swat-image-preview-close-hover'); + Event.on(this.preview_container, 'mouseover', function(e) { + Dom.addClass( + this.preview_close_button, + 'swat-image-preview-close-hover' + ); }, this, true); - YAHOO.util.Event.on(this.preview_container, 'mouseout', function(e) { - YAHOO.util.Dom.removeClass(this.preview_close_button, - 'swat-image-preview-close-hover'); + Event.on(this.preview_container, 'mouseout', function(e) { + Dom.removeClass( + this.preview_close_button, + 'swat-image-preview-close-hover' + ); }, this, true); } @@ -248,7 +260,7 @@ class SwatImagePreviewDisplay { } showOverlay() { - this.overlay.style.height = YAHOO.util.Dom.getDocumentHeight() + 'px'; + this.overlay.style.height = Dom.getDocumentHeight() + 'px'; this.overlay.style.display = 'block'; } @@ -257,7 +269,7 @@ class SwatImagePreviewDisplay { } close() { - YAHOO.util.Event.removeListener( + Event.removeListener( document, 'keydown', this.handleKeyDown @@ -273,7 +285,7 @@ class SwatImagePreviewDisplay { handleKeyDown(e) { // close preview on backspace or escape if (e.keyCode === 8 || e.keyCode === 27) { - YAHOO.util.Event.preventDefault(e); + Event.preventDefault(e); if (this.opened) { this.onClose.fire('keyboard'); } diff --git a/www/javascript/swat-progress-bar.js b/www/javascript/swat-progress-bar.js index 26744e523..2592f7e9e 100644 --- a/www/javascript/swat-progress-bar.js +++ b/www/javascript/swat-progress-bar.js @@ -1,3 +1,7 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { Event, CustomEvent } from '../../../yui/www/event/event'; +import { Anim } from '../../../yui/www/animation/animation'; + import '../styles/swat-progress-bar.css'; /** @@ -24,12 +28,12 @@ class SwatProgressBar { this.text = document.getElementById(this.id + '_text'); this.container = document.getElementById(this.id); - this.changeValueEvent = new YAHOO.util.CustomEvent('changeValue'); - this.pulseEvent = new YAHOO.util.CustomEvent('pulse'); + this.changeValueEvent = new CustomEvent('changeValue'); + this.pulseEvent = new CustomEvent('pulse'); this.animation = null; - YAHOO.util.Event.onDOMReady(function() { + Event.onDOMReady(function() { // Hack for Gecko and WebKit to load background images for full // part of progress bar. If the bar starts at zero, these browsers // don't load the background image, even when the bar's value @@ -147,7 +151,7 @@ class SwatProgressBar { this.animation.stop(); } - this.animation = new YAHOO.util.Anim( + this.animation = new Anim( this.full, full_attributes, SwatProgressBar.ANIMATION_DURATION diff --git a/www/javascript/swat-radio-button-cell-renderer.js b/www/javascript/swat-radio-button-cell-renderer.js index 5b9903426..c97d0a045 100644 --- a/www/javascript/swat-radio-button-cell-renderer.js +++ b/www/javascript/swat-radio-button-cell-renderer.js @@ -1,3 +1,5 @@ +import { Event } from '../../../yui/www/event/event'; + export default class SwatRadioButtonCellRenderer { /** * Radio button cell renderer controller @@ -25,11 +27,21 @@ export default class SwatRadioButtonCellRenderer { this.radio_list.push(input_nodes[i]); this.updateNode(input_nodes[i]); - YAHOO.util.Event.addListener(input_nodes[i], 'click', - this.handleClick, this, true); + Event.addListener( + input_nodes[i], + 'click', + this.handleClick, + this, + true + ); - YAHOO.util.Event.addListener(input_nodes[i], 'dblclick', - this.handleClick, this, true); + Event.addListener( + input_nodes[i], + 'dblclick', + this.handleClick, + this, + true + ); } } } @@ -39,7 +51,7 @@ export default class SwatRadioButtonCellRenderer { this.updateNode(this.current_node); } - this.current_node = YAHOO.util.Event.getTarget(e); + this.current_node = Event.getTarget(e); this.updateNode(this.current_node); } diff --git a/www/javascript/swat-radio-note-book.js b/www/javascript/swat-radio-note-book.js index 1444947c7..19eca5dcb 100644 --- a/www/javascript/swat-radio-note-book.js +++ b/www/javascript/swat-radio-note-book.js @@ -1,3 +1,8 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { Selector } from '../../../yui/www/selector/selector'; +import { Event } from '../../../yui/www/event/event'; +import { Anim, Easing } from '../../../yui/www/animation/animation'; + import '../styles/swat-radio-note-book.css'; class SwatRadioNoteBook { @@ -5,7 +10,7 @@ class SwatRadioNoteBook { this.id = id; this.current_page = null; - YAHOO.util.Event.onDOMReady(this.init, this, true); + Event.onDOMReady(this.init, this, true); } init() { @@ -21,7 +26,7 @@ class SwatRadioNoteBook { (function() { var option = unfiltered_options[i]; var index = count; - YAHOO.util.Event.on(option, 'click', function(e) { + Event.on(option, 'click', function(e) { this.setPageWithAnimation(this.pages[index]); }, this, true); }).call(this); @@ -30,9 +35,9 @@ class SwatRadioNoteBook { } // get pages - var tbody = YAHOO.util.Dom.getFirstChild(table); - var rows = YAHOO.util.Dom.getChildrenBy(tbody, function(n) { - return (YAHOO.util.Dom.hasClass( + var tbody = Dom.getFirstChild(table); + var rows = Dom.getChildrenBy(tbody, function(n) { + return (Dom.hasClass( n, 'swat-radio-note-book-page-row' )); @@ -41,13 +46,13 @@ class SwatRadioNoteBook { this.pages = []; var page; for (var i = 0; i < rows.length; i++) { - page = YAHOO.util.Dom.getFirstChild( - YAHOO.util.Dom.getNextSibling( - YAHOO.util.Dom.getFirstChild(rows[i]) + page = Dom.getFirstChild( + Dom.getNextSibling( + Dom.getFirstChild(rows[i]) ) ); - if (YAHOO.util.Dom.hasClass(page, 'selected')) { + if (Dom.hasClass(page, 'selected')) { this.current_page = page; } @@ -81,25 +86,25 @@ class SwatRadioNoteBook { page.firstChild.style.visibility = 'visible'; page.firstChild.style.height = 'auto'; - var region = YAHOO.util.Dom.getRegion(page.firstChild); + var region = Dom.getRegion(page.firstChild); var height = region.height; - var anim = new YAHOO.util.Anim( + var anim = new Anim( page, { 'height': { to: height } }, SwatRadioNoteBook.SLIDE_DURATION, - YAHOO.util.Easing.easeIn + Easing.easeIn ); anim.onComplete.subscribe(function() { page.style.height = 'auto'; this.restorePageFocusability(page); - var anim = new YAHOO.util.Anim( + var anim = new Anim( page, { opacity: { to: 1 } }, SwatRadioNoteBook.FADE_DURATION, - YAHOO.util.Easing.easeIn + Easing.easeIn ); anim.animate(); @@ -109,29 +114,29 @@ class SwatRadioNoteBook { } closePage(page) { - YAHOO.util.Dom.setStyle(page, 'opacity', '0'); + Dom.setStyle(page, 'opacity', '0'); page.style.overflow = 'hidden'; page.style.height = '0'; this.removePageFocusability(page); }; closePageWithAnimation(page) { - var anim = new YAHOO.util.Anim( + var anim = new Anim( page, { opacity: { to: 0 } }, SwatRadioNoteBook.FADE_DURATION, - YAHOO.util.Easing.easeOut + Easing.easeOut ); anim.onComplete.subscribe(function() { page.style.overflow = 'hidden'; this.removePageFocusability(page); - var anim = new YAHOO.util.Anim( + var anim = new Anim( page, { height: { to: 0 } }, SwatRadioNoteBook.SLIDE_DURATION, - YAHOO.util.Easing.easeOut + Easing.easeOut ); anim.animate(); @@ -141,7 +146,7 @@ class SwatRadioNoteBook { } removePageFocusability(page) { - var elements = YAHOO.util.Selector.query( + var elements = Selector.query( 'input, select, textarea, button, a, *[tabindex]', page ); @@ -167,7 +172,7 @@ class SwatRadioNoteBook { } restorePageFocusability(page) { - var elements = YAHOO.util.Selector.query( + var elements = Selector.query( 'input, select, textarea, button, a, *[tabindex]', page ); diff --git a/www/javascript/swat-rating.js b/www/javascript/swat-rating.js index 701a1e049..c408fdb53 100644 --- a/www/javascript/swat-rating.js +++ b/www/javascript/swat-rating.js @@ -1,3 +1,6 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { Event } from '../../../yui/www/event/event'; + import '../styles/swat-rating.css'; /** @@ -57,20 +60,17 @@ export default class SwatRating { this.stars = []; this.sensitive = true; - YAHOO.util.Event.onDOMReady(this.init, this, true); + Event.onDOMReady(this.init, this, true); } init() { - var Dom = YAHOO.util.Dom; - var Event = YAHOO.util.Event; - this.flydown = document.getElementById(this.id + '_flydown'); this.rating_div = document.getElementById(this.id); this.sensitive = (!Dom.hasClass(this.rating_div, 'swat-insensitive')); Dom.setStyle(this.flydown, 'display', 'none'); - var star_div = document.createElement('div'); + var star_div = document.createElement('div'); star_div.className = 'swat-rating-star-container'; for (var i = 1; i <= this.max_value; i++) { @@ -110,8 +110,6 @@ export default class SwatRating { } setSensitivity(sensitivity) { - var Dom = YAHOO.util.Dom; - if (sensitivity) { Dom.removeClass(this.rating_div, 'swat-insensitive'); this.sensitive = true; @@ -126,16 +124,12 @@ export default class SwatRating { return; } - var Dom = YAHOO.util.Dom; - for (var i = 0; i < focus_star; i++) { Dom.addClass(this.stars[i], 'swat-rating-hover'); } }; handleBlur(event) { - var Dom = YAHOO.util.Dom; - // code to handle movement away from the star for (var i = 0; i < this.max_value; i++) { Dom.removeClass(this.stars[i], 'swat-rating-hover'); @@ -147,8 +141,6 @@ export default class SwatRating { return; } - var Dom = YAHOO.util.Dom; - // reset 'on' style for each star for (var i = 0; i < this.max_value; i++) { Dom.removeClass(this.stars[i], 'swat-rating-selected'); @@ -190,8 +182,6 @@ export default class SwatRating { } setValue(rating) { - var Dom = YAHOO.util.Dom; - // clear 'on' style for each star for (var i = 0; i < this.max_value; i++) { Dom.removeClass(this.stars[i], 'swat-rating-selected'); diff --git a/www/javascript/swat-search-entry.js b/www/javascript/swat-search-entry.js index 6dde61e1f..71ff46303 100644 --- a/www/javascript/swat-search-entry.js +++ b/www/javascript/swat-search-entry.js @@ -1,3 +1,6 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { Event } from '../../../yui/www/event/event'; + import '../styles/swat-search-entry.css'; export default class SwatSearchEntry { @@ -26,14 +29,14 @@ export default class SwatSearchEntry { label.style.display = 'none'; - YAHOO.util.Event.addListener( + Event.addListener( this.input, 'focus', this.handleFocus, this, true ); - YAHOO.util.Event.addListener( + Event.addListener( this.input, 'blur', this.handleBlur, @@ -41,7 +44,7 @@ export default class SwatSearchEntry { true ); - YAHOO.util.Event.onDOMReady(this.init, this, true); + Event.onDOMReady(this.init, this, true); } } @@ -59,7 +62,7 @@ export default class SwatSearchEntry { this.input.value = ''; } - YAHOO.util.Event.removeListener(this.input, 'keypress', this.handleKeyDown); + Event.removeListener(this.input, 'keypress', this.handleKeyDown); } handleFocus(e) { @@ -75,7 +78,7 @@ export default class SwatSearchEntry { this.showLabelText(); } - YAHOO.util.Event.removeListener( + Event.removeListener( this.input, 'keypress', this.handleKeyDown @@ -90,7 +93,7 @@ export default class SwatSearchEntry { return; } - YAHOO.util.Dom.addClass(this.input, 'swat-search-entry-empty'); + Dom.addClass(this.input, 'swat-search-entry-empty'); if (this.input.hasAttribute) { this.input.removeAttribute('name'); @@ -111,18 +114,18 @@ export default class SwatSearchEntry { old_input.parentNode.insertBefore(this.input, old_input); // prevent IE memory leaks - YAHOO.util.Event.purgeElement(old_input); + Event.purgeElement(old_input); old_input.parentNode.removeChild(old_input); // add event handlers back - YAHOO.util.Event.addListener( + Event.addListener( this.input, 'focus', this.handleFocus, this, true ); - YAHOO.util.Event.addListener( + Event.addListener( this.input, 'blur', this.handleBlur, @@ -174,14 +177,14 @@ export default class SwatSearchEntry { this.input = document.createElement(outer_html); // add event handlers back - YAHOO.util.Event.addListener( + Event.addListener( this.input, 'focus', this.handleFocus, this, true ); - YAHOO.util.Event.addListener( + Event.addListener( this.input, 'blur', this.handleBlur, @@ -193,7 +196,7 @@ export default class SwatSearchEntry { old_input.parentNode.insertBefore(this.input, old_input); // prevent IE memory leaks - YAHOO.util.Event.purgeElement(old_input); + Event.purgeElement(old_input); old_input.parentNode.removeChild(old_input); hide = true; @@ -202,8 +205,8 @@ export default class SwatSearchEntry { if (hide) { this.input.value = this.input_value; - YAHOO.util.Dom.removeClass(this.input, 'swat-search-entry-empty'); - YAHOO.util.Event.addListener( + Dom.removeClass(this.input, 'swat-search-entry-empty'); + Event.addListener( this.input, 'keypress', this.handleKeyDown, diff --git a/www/javascript/swat-table-view.js b/www/javascript/swat-table-view.js index 505ec5213..49ba8471d 100644 --- a/www/javascript/swat-table-view.js +++ b/www/javascript/swat-table-view.js @@ -75,25 +75,28 @@ export default class SwatTableView extends SwatView { // highlight table row of selected item in this view if (this.isSelected(row_node)) { - var odd = (YAHOO.util.Dom.hasClass(row_node, 'odd') || - YAHOO.util.Dom.hasClass(row_node, 'highlight-odd')); + var odd = ( + row_node.classList.contains('odd') || + row_node.classList.contains('highlight-odd') + ); if (odd) { - YAHOO.util.Dom.removeClass(row_node, 'odd'); - YAHOO.util.Dom.addClass(row_node, 'highlight-odd'); + row_node.classList.remove('odd'); + row_node.classList.add('highlight-odd'); } else { - YAHOO.util.Dom.addClass(row_node, 'highlight'); + row_node.classList.add('highlight'); } var spanning_row = row_node.nextSibling; - while (spanning_row && YAHOO.util.Dom.hasClass( - spanning_row, 'swat-table-view-spanning-column') - ) { + while (spanning_row && spanning_row.classList.contains( + 'swat-table-view-spanning-column' + )) { if (odd) { - YAHOO.util.Dom.removeClass(spanning_row, 'odd'); - YAHOO.util.Dom.addClass(spanning_row, 'highlight-odd'); + spanning_row.classList.remove('odd'); + spanning_row.classList.add('highlight-odd'); + } else { - YAHOO.util.Dom.addClass(spanning_row, 'highlight'); + spanning_row.classList.add('highlight'); } spanning_row = spanning_row.nextSibling; @@ -118,25 +121,27 @@ export default class SwatTableView extends SwatView { // unhighlight table row of item in this view if (!this.isSelected(row_node)) { - var odd = (YAHOO.util.Dom.hasClass(row_node, 'odd') || - YAHOO.util.Dom.hasClass(row_node, 'highlight-odd')); + var odd = ( + row_node.classList.contains('odd') || + row_node.classList.contains('highlight-odd') + ); if (odd) { - YAHOO.util.Dom.removeClass(row_node, 'highlight-odd'); - YAHOO.util.Dom.addClass(row_node, 'odd'); + row_node.classList.remove('highlight-odd'); + row_node.classList.add('odd'); } else { - YAHOO.util.Dom.removeClass(row_node, 'highlight'); + row_node.classList.remove('highlight'); } var spanning_row = row_node.nextSibling; - while (spanning_row && YAHOO.util.Dom.hasClass( - spanning_row, 'swat-table-view-spanning-column') - ) { + while (spanning_row && spanning_row.classList.contains( + 'swat-table-view-spanning-column' + )) { if (odd) { - YAHOO.util.Dom.removeClass(spanning_row, 'highlight-odd'); - YAHOO.util.Dom.addClass(spanning_row, 'odd'); + spanning_row.classList.remove('highlight-odd'); + spanning_row.classList.add('odd'); } else { - YAHOO.util.Dom.removeClass(spanning_row, 'highlight'); + spanning_row.classList.remove('highlight'); } spanning_row = spanning_row.nextSibling; diff --git a/www/javascript/swat-textarea.js b/www/javascript/swat-textarea.js index 0dcf2a875..0c13e4158 100644 --- a/www/javascript/swat-textarea.js +++ b/www/javascript/swat-textarea.js @@ -1,3 +1,6 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { Event } from '../../../yui/www/event/event'; + import '../styles/swat-textarea.css'; /** @@ -20,7 +23,7 @@ class SwatTextarea { this.id = id; if (resizeable) { - YAHOO.util.Event.onContentReady( + Event.onContentReady( this.id, this.handleOnAvailable, this, @@ -42,7 +45,7 @@ class SwatTextarea { // check if textarea already is resizable, and if so, don't add resize // handle. if (SwatTextarea.supports_resize) { - var resize = YAHOO.util.Dom.getStyle(this.textarea, 'resize'); + var resize = Dom.getStyle(this.textarea, 'resize'); if (resize == 'both' || resize == 'vertical') { return; } @@ -54,14 +57,14 @@ class SwatTextarea { this.textarea._resize = this; - YAHOO.util.Event.addListener(this.handle_div, 'touchstart', + Event.addListener(this.handle_div, 'touchstart', SwatTextarea.touchstartEventHandler, this.handle_div); - YAHOO.util.Event.addListener(this.handle_div, 'mousedown', + Event.addListener(this.handle_div, 'mousedown', SwatTextarea.mousedownEventHandler, this.handle_div); this.textarea.parentNode.appendChild(this.handle_div); - YAHOO.util.Dom.addClass( + Dom.addClass( this.textarea.parentNode, 'swat-textarea-with-resize'); @@ -78,18 +81,18 @@ class SwatTextarea { // {{{ initialize() initialize() { - var style_width = YAHOO.util.Dom.getStyle(this.textarea, 'width'); + var style_width = Dom.getStyle(this.textarea, 'width'); var left_border, right_border; if (style_width.indexOf('%') != -1) { left_border = parseInt( - YAHOO.util.Dom.getComputedStyle( + Dom.getComputedStyle( this.textarea, 'borderLeftWidth' ), 10 ) - parseInt( - YAHOO.util.Dom.getComputedStyle( + Dom.getComputedStyle( this.handle_div, 'borderLeftWidth' ), @@ -97,13 +100,13 @@ class SwatTextarea { ); right_border = parseInt( - YAHOO.util.Dom.getComputedStyle( + Dom.getComputedStyle( this.textarea, 'borderRightWidth' ), 10 ) - parseInt( - YAHOO.util.Dom.getComputedStyle( + Dom.getComputedStyle( this.handle_div, 'borderRightWidth' ), @@ -117,7 +120,7 @@ class SwatTextarea { var width = this.textarea.offsetWidth; left_border = parseInt( - YAHOO.util.Dom.getComputedStyle( + Dom.getComputedStyle( this.handle_div, 'borderLeftWidth' ), @@ -125,7 +128,7 @@ class SwatTextarea { ); right_border = parseInt( - YAHOO.util.Dom.getComputedStyle( + Dom.getComputedStyle( this.handle_div, 'borderRightWidth' ), @@ -221,7 +224,7 @@ SwatTextarea.pending_poll_interval = 0.1; // in seconds */ SwatTextarea.supports_resize = (function() { var div = document.createElement('div'); - var resize = YAHOO.util.Dom.getStyle(div, 'resize'); + var resize = Dom.getStyle(div, 'resize'); // Both iOS and Android feature detection say they support resize, but // they do not. Fall back to checking the UA here. @@ -274,7 +277,7 @@ SwatTextarea.pollPendingTextareas = function() { */ SwatTextarea.mousedownEventHandler = function(e, handle) { // prevent text selection - YAHOO.util.Event.preventDefault(e); + Event.preventDefault(e); // only allow left click to do things var is_webkit = (/AppleWebKit|Konqueror|KHTML/gi).test(navigator.userAgent); @@ -285,13 +288,13 @@ SwatTextarea.mousedownEventHandler = function(e, handle) { SwatTextarea.dragging_item = handle; SwatTextarea.dragging_mouse_origin_y = - YAHOO.util.Event.getPageY(e); + Event.getPageY(e); var textarea = handle._textarea; - YAHOO.util.Dom.setStyle(textarea, 'opacity', 0.25); + Dom.setStyle(textarea, 'opacity', 0.25); - var height = parseInt(YAHOO.util.Dom.getStyle(textarea, 'height')); + var height = parseInt(Dom.getStyle(textarea, 'height')); if (height) { SwatTextarea.dragging_origin_height = height; } else { @@ -299,16 +302,16 @@ SwatTextarea.mousedownEventHandler = function(e, handle) { SwatTextarea.dragging_origin_height = textarea.clientHeight; } - YAHOO.util.Event.removeListener(handle, 'mousedown', + Event.removeListener(handle, 'mousedown', SwatTextarea.mousedownEventHandler); - YAHOO.util.Event.removeListener(handle, 'touchstart', + Event.removeListener(handle, 'touchstart', SwatTextarea.touchstartEventHandler); - YAHOO.util.Event.addListener(document, 'mousemove', + Event.addListener(document, 'mousemove', SwatTextarea.mousemoveEventHandler, handle); - YAHOO.util.Event.addListener(document, 'mouseup', + Event.addListener(document, 'mouseup', SwatTextarea.mouseupEventHandler, handle); }; @@ -325,7 +328,7 @@ SwatTextarea.mousedownEventHandler = function(e, handle) { */ SwatTextarea.touchstartEventHandler = function(e, handle) { // prevent text selection - YAHOO.util.Event.preventDefault(e); + Event.preventDefault(e); SwatTextarea.dragging_item = handle; @@ -337,9 +340,9 @@ SwatTextarea.touchstartEventHandler = function(e, handle) { var textarea = handle._textarea; - YAHOO.util.Dom.setStyle(textarea, 'opacity', 0.25); + Dom.setStyle(textarea, 'opacity', 0.25); - var height = parseInt(YAHOO.util.Dom.getStyle(textarea, 'height')); + var height = parseInt(Dom.getStyle(textarea, 'height')); if (height) { SwatTextarea.dragging_origin_height = height; } else { @@ -347,16 +350,16 @@ SwatTextarea.touchstartEventHandler = function(e, handle) { SwatTextarea.dragging_origin_height = textarea.clientHeight; } - YAHOO.util.Event.removeListener(handle, 'mousedown', + Event.removeListener(handle, 'mousedown', SwatTextarea.mousedownEventHandler); - YAHOO.util.Event.removeListener(handle, 'touchstart', + Event.removeListener(handle, 'touchstart', SwatTextarea.touchstartEventHandler); - YAHOO.util.Event.addListener(document, 'touchmove', + Event.addListener(document, 'touchmove', SwatTextarea.touchmoveEventHandler, handle); - YAHOO.util.Event.addListener(document, 'touchend', + Event.addListener(document, 'touchend', SwatTextarea.touchendEventHandler, handle); } }; @@ -377,7 +380,7 @@ SwatTextarea.mousemoveEventHandler = function(e, handle) { var resize_handle = SwatTextarea.dragging_item; var textarea = resize_handle._textarea; - var delta = YAHOO.util.Event.getPageY(e) - + var delta = Event.getPageY(e) - SwatTextarea.dragging_mouse_origin_y; var height = SwatTextarea.dragging_origin_height + delta; @@ -445,29 +448,29 @@ SwatTextarea.mouseupEventHandler = function(e, handle) { (!is_ie && !is_webkit && e.button !== 0)) return false; - YAHOO.util.Event.removeListener(document, 'mousemove', + Event.removeListener(document, 'mousemove', SwatTextarea.mousemoveEventHandler); - YAHOO.util.Event.removeListener(document, 'touchmove', + Event.removeListener(document, 'touchmove', SwatTextarea.touchmoveEventHandler); - YAHOO.util.Event.removeListener(document, 'mouseup', + Event.removeListener(document, 'mouseup', SwatTextarea.mouseupEventHandler); - YAHOO.util.Event.removeListener(document, 'touchend', + Event.removeListener(document, 'touchend', SwatTextarea.touchendEventHandler); - YAHOO.util.Event.addListener(handle, 'mousedown', + Event.addListener(handle, 'mousedown', SwatTextarea.mousedownEventHandler, handle); - YAHOO.util.Event.addListener(handle, 'touchstart', + Event.addListener(handle, 'touchstart', SwatTextarea.touchstartEventHandler, handle); SwatTextarea.dragging_item = null; SwatTextarea.dragging_mouse_origin_y = null; SwatTextarea.dragging_origin_height = null; - YAHOO.util.Dom.setStyle(handle._textarea, 'opacity', 1); + Dom.setStyle(handle._textarea, 'opacity', 1); return false; }; diff --git a/www/javascript/swat-tile-view.js b/www/javascript/swat-tile-view.js index d5197f806..77878d867 100644 --- a/www/javascript/swat-tile-view.js +++ b/www/javascript/swat-tile-view.js @@ -68,9 +68,9 @@ export default class SwatTileView extends SwatView { var tile_node = this.getItemNode(node); if (this.isSelected(tile_node) && - !YAHOO.util.Dom.hasClass(tile_node, 'highlight') + !tile_node.classList.contains('highlight') ) { - YAHOO.util.Dom.addClass(tile_node, 'highlight'); + tile_node.classList.add('highlight'); } } @@ -89,9 +89,9 @@ export default class SwatTileView extends SwatView { var tile_node = this.getItemNode(node); if (!this.isSelected(tile_node) && - YAHOO.util.Dom.hasClass(tile_node, 'highlight') + tile_node.classList.contains('highlight') ) { - YAHOO.util.Dom.removeClass(tile_node, 'highlight'); + tile_node.classList.remove('highlight'); } } } diff --git a/www/javascript/swat-time-entry.js b/www/javascript/swat-time-entry.js index 3e7176c8c..0e6a27d38 100644 --- a/www/javascript/swat-time-entry.js +++ b/www/javascript/swat-time-entry.js @@ -1,3 +1,6 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { Event } from '../../../yui/www/event/event'; + export default class SwatTimeEntry { constructor(id, use_current_time) { this.id = id; @@ -13,7 +16,7 @@ export default class SwatTimeEntry { this.date_entry = null; if (this.hour) { - YAHOO.util.Event.addListener( + Event.addListener( this.hour, 'change', this.handleHourChange, @@ -23,7 +26,7 @@ export default class SwatTimeEntry { } if (this.minute) { - YAHOO.util.Event.addListener( + Event.addListener( this.minute, 'change', this.handleMinuteChange, @@ -33,7 +36,7 @@ export default class SwatTimeEntry { } if (this.second) { - YAHOO.util.Event.addListener( + Event.addListener( this.second, 'change', this.handleSecondChange, @@ -43,7 +46,7 @@ export default class SwatTimeEntry { } if (this.am_pm) { - YAHOO.util.Event.addListener( + Event.addListener( this.am_pm, 'change', this.handleAmPmChange, @@ -78,10 +81,10 @@ export default class SwatTimeEntry { for (var i = 0; i < elements.length; i++) { if (sensitivity) { elements[i].disabled = false; - YAHOO.util.Dom.removeClass(elements[i], 'swat-insensitive'); + Dom.removeClass(elements[i], 'swat-insensitive'); } else { elements[i].disabled = true; - YAHOO.util.Dom.addClass(elements[i], 'swat-insensitive'); + Dom.addClass(elements[i], 'swat-insensitive'); } } } diff --git a/www/styles/swat-abstract-overlay.css b/www/styles/swat-abstract-overlay.css new file mode 100644 index 000000000..fe73846f6 --- /dev/null +++ b/www/styles/swat-abstract-overlay.css @@ -0,0 +1,22 @@ +.swat-overlay { + background: #fff; + border: 1px solid #ccc; + padding: 0; + margin: 0; +} + +.swat-overlay-close-div { + position: fixed; + top: 0; + left: 0; + width: 100%; +} + +.swat-overlay .hd { + text-align: right; + padding: 2px; +} + +.swat-overlay-close-link { + font-weight: bold; +} diff --git a/www/styles/swat-button.css b/www/styles/swat-button.css new file mode 100644 index 000000000..78ea7c6e9 --- /dev/null +++ b/www/styles/swat-button.css @@ -0,0 +1,37 @@ +.swat-header-form-field input.swat-primary, +.swat-footer-form-field input.swat-primary { + font-weight: bold; +} + +.swat-header-form-field .swat-button, +.swat-footer-form-field .swat-button, +.swat-header-form-field .swat-reset-button, +.swat-footer-form-field .swat-reset-button { + margin-right: 0.5em; +} + +.swat-button-compact { + font-size: 80%; + padding: 0; + border-width: 1px; +} + +.swat-button, +.swat-reset-button { + vertical-align: middle; +} + +.swat-button-processing-throbber { + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; + filter: alpha(opacity=0); + opacity: 0; + padding-left: 20px; + margin-left: 0.5em; + background: url(../images/swat-button-throbber.gif) no-repeat 0 0; + display: inline-block; /* This is needed for IE8 opacity to work */ +} + +.swat-image-button { + cursor: pointer; + cursor: hand; +} diff --git a/www/styles/swat-expandable-checkbox-tree.css b/www/styles/swat-expandable-checkbox-tree.css new file mode 100644 index 000000000..23bc851b1 --- /dev/null +++ b/www/styles/swat-expandable-checkbox-tree.css @@ -0,0 +1,49 @@ +a.swat-expandable-checkbox-tree-anchor-opened { + background: url(../images/swat-disclosure-open.png) top left no-repeat; + padding: 0 0 0 16px; + zoom: 1; /* IE hack */ +} + +a.swat-expandable-checkbox-tree-anchor-closed { + background: url(../images/swat-disclosure-closed.png) top left no-repeat; + padding: 0 0 0 16px; + zoom: 1; /* IE hack */ +} + +.swat-expandable-checkbox-tree input { + vertical-align: middle; +} + +.swat-expandable-checkbox-tree ul { + list-style-type: none; + margin: 0; + padding: 0; +} + +.swat-expandable-checkbox-tree ul li { + margin-left: 16px; +} + +.swat-expandable-checkbox-tree ul li.swat-expandable-checkbox-tree-expander { + margin-left: 0; +} + +.swat-expandable-checkbox-tree ul li ul li { + margin-left: 36px; +} + +.swat-expandable-checkbox-tree ul li ul li.swat-expandable-checkbox-tree-expander { + margin-left: 20px; +} + +.swat-expandable-checkbox-tree-opened { + display: block; +} + +.swat-expandable-checkbox-tree-closed { + display: none; +} + +.swat-expandable-checkbox-tree-image { + vertical-align: text-top; +} diff --git a/www/styles/swat-fieldset.css b/www/styles/swat-fieldset.css new file mode 100644 index 000000000..4fcf3707a --- /dev/null +++ b/www/styles/swat-fieldset.css @@ -0,0 +1,24 @@ +.swat-fieldset, +.swat-grouping-form-field-fieldset { + border: 1px solid #ccc; + margin-bottom: 1em; + padding: 0 1em 1em 1em; + position: relative; +} + +.swat-fieldset legend, +.swat-grouping-form-field legend { + font-weight: bold; + color: #666; + padding: 0 0.3em; + line-height: 2; +} + +.swat-grouping-form-field .swat-form-field { + padding-top: 1em; +} + +.swat-grouping-form-field .swat-form-field label { + color: #666; + font-weight: normal; +} diff --git a/www/styles/swat-form.css b/www/styles/swat-form.css new file mode 100644 index 000000000..e69de29bb diff --git a/www/styles/swat-frame.css b/www/styles/swat-frame.css new file mode 100644 index 000000000..5f6b4aff8 --- /dev/null +++ b/www/styles/swat-frame.css @@ -0,0 +1,20 @@ +.swat-frame { + margin: 1em 0; + border: 1px solid #dcceb2; + background: #fff url(../images/swat-frame-background.png) top right no-repeat; +} + +.swat-frame .swat-frame-title { + margin: 1px 1px 0 1px; + padding: 2px 6px; + color: #6b5d40; + background: #f8f6f0 url(../images/swat-frame-header.png) bottom left repeat-x; +} + +.swat-frame-contents { + padding: 16px; +} + +.swat-frame .swat-frame-subtitle { + font-weight: normal; +} diff --git a/www/styles/swat.css b/www/styles/swat.css index 90af43253..451ea0bbf 100644 --- a/www/styles/swat.css +++ b/www/styles/swat.css @@ -8,36 +8,19 @@ img.swat-image-cell-renderer { vertical-align: middle; } color: #888; } -option.swat-blank-option, -option.swat-flydown-option-divider { - color: #888; -} - - -/* SwatFrame */ - -.swat-frame { - margin: 1em 0; - border: 1px solid #dcceb2; - background: #fff url(../images/swat-frame-background.png) top right no-repeat; -} - -.swat-frame .swat-frame-title { - margin: 1px 1px 0 1px; - padding: 2px 6px; - color: #6b5d40; - background: #f8f6f0 url(../images/swat-frame-header.png) bottom left repeat-x; +.swat-nowrap { + white-space: nowrap; } -.swat-frame-contents { - padding: 16px; +input.swat-insensitive { + cursor: default; } -.swat-frame .swat-frame-subtitle { - font-weight: normal; +option.swat-blank-option, +option.swat-flydown-option-divider { + color: #888; } - /* SwatForm */ .swat-form { margin: 0; padding: 0; } @@ -144,34 +127,6 @@ ul.swat-radio-list li { margin: 0 5px 0 0; } -/* SwatFieldset */ - -.swat-fieldset, -.swat-grouping-form-field-fieldset { - border: 1px solid #ccc; - margin-bottom: 1em; - padding: 0 1em 1em 1em; - position: relative; -} - -.swat-fieldset legend, -.swat-grouping-form-field legend { - font-weight: bold; - color: #666; - padding: 0 0.3em; - line-height: 2; -} - -.swat-grouping-form-field .swat-form-field { - padding-top: 1em; -} - -.swat-grouping-form-field .swat-form-field label { - color: #666; - font-weight: normal; -} - - /* Swat Date Entry and SwatTimeEntry*/ .swat-date-entry, @@ -226,54 +181,6 @@ ul.swat-radio-list li { color: #333; } -/* Swat Buttons */ - -.swat-header-form-field input.swat-primary, -.swat-footer-form-field input.swat-primary { - font-weight: bold; -} - -.swat-header-form-field .swat-button, -.swat-footer-form-field .swat-button, -.swat-header-form-field .swat-reset-button, -.swat-footer-form-field .swat-reset-button { - margin-right: 0.5em; -} - -.swat-button-compact { - font-size: 80%; - padding: 0; - border-width: 1px; -} - -.swat-nowrap { - white-space: nowrap; -} - -.swat-button, -.swat-reset-button { - vertical-align: middle; -} - -.swat-button-processing-throbber { - -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - opacity: 0; - padding-left: 20px; - margin-left: 0.5em; - background: url(../images/swat-button-throbber.gif) no-repeat 0 0; - display: inline-block; /* This is needed for IE8 opacity to work */ -} - -.swat-image-button { - cursor: pointer; - cursor: hand; -} - -input.swat-insensitive { - cursor: default; -} - /* SwatFormField */ .swat-form-field { @@ -284,30 +191,6 @@ blockquote.swat-db-debug { border: 1px solid #666; } -/* SwatAbstractOverlay */ - -.swat-overlay { - background: #fff; - border: 1px solid #ccc; - padding: 0; - margin: 0; -} - -.swat-overlay-close-div { - position: fixed; - top: 0; - left: 0; - width: 100%; -} - -.swat-overlay .hd { - text-align: right; - padding: 2px; -} - -.swat-overlay-close-link { - font-weight: bold; -} /* SwatRemoveInputCell */ From b397d779a7a964578e966f1888b068998ea94fa8 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Mon, 1 Jan 2018 20:48:59 -0400 Subject: [PATCH 22/35] Remove YAHOO deps from frame disclosure --- www/javascript/swat-frame-disclosure.js | 41 ++++++------------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/www/javascript/swat-frame-disclosure.js b/www/javascript/swat-frame-disclosure.js index d246df1df..13709a6b8 100644 --- a/www/javascript/swat-frame-disclosure.js +++ b/www/javascript/swat-frame-disclosure.js @@ -1,4 +1,5 @@ import SwatDisclosure from './swat-disclosure'; + import '../styles/swat-frame-disclosure.css'; export default class SwatFrameDisclosure extends SwatDisclosure { @@ -9,40 +10,22 @@ export default class SwatFrameDisclosure extends SwatDisclosure { close() { super.close(); - YAHOO.util.Dom.removeClass( - this.div, - 'swat-frame-disclosure-control-opened' - ); - YAHOO.util.Dom.addClass( - this.div, - 'swat-frame-disclosure-control-closed' - ); + this.div.classList.remove('swat-frame-disclosure-control-opened'); + this.div.classList.add('swat-frame-disclosure-control-closed'); } handleClose() { super.handleClose(); - YAHOO.util.Dom.removeClass( - this.div, - 'swat-frame-disclosure-control-opened' - ); - YAHOO.util.Dom.addClass( - this.div, - 'swat-frame-disclosure-control-closed' - ); + this.div.classList.remove('swat-frame-disclosure-control-opened'); + this.div.classList.add('swat-frame-disclosure-control-closed'); } open() { super.open(); - YAHOO.util.Dom.removeClass( - this.div, - 'swat-frame-disclosure-control-closed' - ); - YAHOO.util.Dom.addClass( - this.div, - 'swat-frame-disclosure-control-opened' - ); + this.div.classList.remove('swat-frame-disclosure-control-closed'); + this.div.classList.add('swat-frame-disclosure-control-opened'); } openWithAnimation() { @@ -52,13 +35,7 @@ export default class SwatFrameDisclosure extends SwatDisclosure { super.openWithAnimation(); - YAHOO.util.Dom.removeClass( - this.div, - 'swat-frame-disclosure-control-closed' - ); - YAHOO.util.Dom.addClass( - this.div, - 'swat-frame-disclosure-control-opened' - ); + this.div.classList.remove('swat-frame-disclosure-control-closed'); + this.div.classList.add('swat-frame-disclosure-control-opened'); } } From 170e5d57b55e46ce53b4ce46c34928e8fed2ad31 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Tue, 2 Jan 2018 02:05:37 -0400 Subject: [PATCH 23/35] Fix bundling bugs with YUI2 element and dom --- demo/dom-loader.js | 30 +++++++++++++++++++ demo/element-loader.js | 65 +++++++++++++++++++++++++++++++++++++++++ demo/package.json | 2 ++ demo/webpack.config.js | 66 ++++++++++++++++++++++++++++++++---------- 4 files changed, 148 insertions(+), 15 deletions(-) create mode 100644 demo/dom-loader.js create mode 100644 demo/element-loader.js diff --git a/demo/dom-loader.js b/demo/dom-loader.js new file mode 100644 index 000000000..edbae9f08 --- /dev/null +++ b/demo/dom-loader.js @@ -0,0 +1,30 @@ +const loaderUtils = require('loader-utils'); +const SourceNode = require('source-map').SourceNode; +const SourceMapConsumer = require('source-map').SourceMapConsumer; + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +const ElementLoader = function(content, sourceMap) { + if (this.cacheable) { + this.cacheable(); + } + + if (sourceMap) { + const currentRequest = loaderUtils.getCurrentRequest(this); + const node = SourceNode.fromStringWithSourceMap( + content.replace(/Y\.Element/g, 'eval(\'Y.Element\')'), + new SourceMapConsumer(sourceMap) + ); + const result = node.toStringWithSourceMap({ + file: currentRequest + }); + this.callback(null, result.code, result.map.toJSON()); + return; + } + + return content.replace(/Y\.Element/g, 'eval(\'Y.Element\')'); +}; + +module.exports = ElementLoader; diff --git a/demo/element-loader.js b/demo/element-loader.js new file mode 100644 index 000000000..06661f1ad --- /dev/null +++ b/demo/element-loader.js @@ -0,0 +1,65 @@ +const loaderUtils = require('loader-utils'); +const SourceNode = require('source-map').SourceNode; +const SourceMapConsumer = require('source-map').SourceMapConsumer; + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +const ElementLoader = function(content, sourceMap) { + if (this.cacheable) { + this.cacheable(); + } + const patch = ` + + YAHOO.util.Element.prototype.addListener = function(type, fn, obj, scope) { + scope = scope || this; + + var el = this.get('element') || this.get('id'); + var self = this; + var specialTypes = { + mouseenter: true, + mouseleave: true + }; + + if (specialTypes[type] && !YAHOO.util.Event._createMouseDelegate) { + return false; + } + + if (!this._events[type]) { // create on the fly + if (el && this.DOM_EVENTS[type]) { + YAHOO.util.Event.on(el, type, function(e, matchedEl) { + // Remove IE hacks that break in modern browsers running in + // strict mode. + + // Note: matchedEl el is passed back for delegated listeners + self.fireEvent(type, e, matchedEl); + + }, obj, scope); + } + this.createEvent(type, {scope: this}); + } + + // notify via customEvent + return YAHOO.util.EventProvider.prototype.subscribe.apply(this, arguments); + }; + `; + + if (sourceMap) { + const currentRequest = loaderUtils.getCurrentRequest(this); + const node = SourceNode.fromStringWithSourceMap( + content, + new SourceMapConsumer(sourceMap) + ); + node.add(patch); + const result = node.toStringWithSourceMap({ + file: currentRequest + }); + this.callback(null, result.code, result.map.toJSON()); + return; + } + + return content + patch; +}; + +module.exports = ElementLoader; diff --git a/demo/package.json b/demo/package.json index 181eaa7ff..f2299b490 100644 --- a/demo/package.json +++ b/demo/package.json @@ -12,6 +12,8 @@ "exports-loader": "^0.6.4", "extract-text-webpack-plugin": "^3.0.2", "file-loader": "^1.1.6", + "loader-utils": "^1.1.0", + "source-map": "^0.6.1", "style-loader": "^0.19.1", "url-loader": "^0.5.7", "webpack": "^3.10.0" diff --git a/demo/webpack.config.js b/demo/webpack.config.js index 47dbb1ba4..62df7bdfa 100644 --- a/demo/webpack.config.js +++ b/demo/webpack.config.js @@ -2,6 +2,7 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin'); const ProvidePlugin = require('webpack').ProvidePlugin; module.exports = { +// devtool: 'source-map', entry: { swat: './vendor/silverorange/swat/www/javascript/index.js', }, @@ -15,7 +16,12 @@ module.exports = { exclude: /(node_modules)/, use: ExtractTextPlugin.extract({ fallback: 'style-loader', - use: [ 'css-loader' ] + use: [ { + loader: 'css-loader', + options: { +// sourceMap: true, + }, + } ], }) }, { @@ -48,14 +54,19 @@ module.exports = { }, { test: /dom\/dom.js$/, - use: { - loader: 'exports-loader', - options: { - Dom: 'YAHOO.util.Dom', - Region: 'YAHOO.util.Region', - Point: 'YAHOO.util.Point', + use: [ + { + loader: 'exports-loader', + options: { + Dom: 'YAHOO.util.Dom', + Region: 'YAHOO.util.Region', + Point: 'YAHOO.util.Point', + }, }, - }, + { + loader: './dom-loader', + }, + ], }, { test: /event\/event.js$/, @@ -95,14 +106,19 @@ module.exports = { }, { test: /element\/element.js$/, - use: { - loader: 'exports-loader', - options: { - Attribute: 'YAHOO.util.Attribute', - AttributeProvider: 'YAHOO.util.AttributeProvider', - Element: 'YAHOO.util.Element', + use: [ + { + loader: 'exports-loader', + options: { + Attribute: 'YAHOO.util.Attribute', + AttributeProvider: 'YAHOO.util.AttributeProvider', + Element: 'YAHOO.util.Element', + }, }, - }, + { + loader: './element-loader', + }, + ], }, { test: /imagecropper\/imagecropper.js$/, @@ -131,6 +147,24 @@ module.exports = { }, }, }, + { + test: /resize\/resize.js$/, + use: { + loader: 'exports-loader', + options: { + Resize: 'YAHOO.util.Resize', + }, + }, + }, + { + test: /dragdrop\/dragdrop.js$/, + use: { + loader: 'exports-loader', + options: { + DD: 'YAHOO.util.DD', + }, + }, + }, ], }, resolve: { @@ -154,6 +188,8 @@ module.exports = { 'YAHOO.util.Attribute': ['../../../yui/www/element/element', 'Attribute'], 'YAHOO.util.AttributeProvider': ['../../../yui/www/element/element', 'AttributeProvider'], 'YAHOO.util.Element': ['../../../yui/www/element/element', 'Element'], + 'YAHOO.util.Resize': ['../../../yui/www/resize/resize', 'Resize'], + 'YAHOO.util.DD': ['../../../yui/www/dragdrop/dragdrop', 'DD'], 'YAHOO.util.Config': ['../../../yui/www/container/container_core', 'Config'], 'YAHOO.widget.Module': ['../../../yui/www/container/container_core', 'Module'], 'YAHOO.widget.Overlay': ['../../../yui/www/container/container_core', 'Overlay'], From e17e95e7f79e62907221803b61635e256f7c8b27 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Tue, 2 Jan 2018 02:06:40 -0400 Subject: [PATCH 24/35] Fix bugs with calendar and image cropper --- www/javascript/swat-calendar.js | 1 + www/javascript/swat-image-cropper.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/www/javascript/swat-calendar.js b/www/javascript/swat-calendar.js index 45afcf4ad..28343d020 100644 --- a/www/javascript/swat-calendar.js +++ b/www/javascript/swat-calendar.js @@ -1,5 +1,6 @@ import { Dom } from '../../../yui/www/dom/dom'; import { Event, CustomEvent } from '../../../yui/www/event/event'; +import { Easing } from '../../../yui/www/animation/animation'; import { Overlay, ContainerEffect } from '../../../yui/www/container/container_core'; import '../../../yui/www/container/assets/container-core.css'; diff --git a/www/javascript/swat-image-cropper.js b/www/javascript/swat-image-cropper.js index fdde65431..916390234 100644 --- a/www/javascript/swat-image-cropper.js +++ b/www/javascript/swat-image-cropper.js @@ -1,5 +1,8 @@ import { ImageCropper } from '../../../yui/www/imagecropper/imagecropper'; +import '../../../yui/www/resize/assets/skins/sam/resize.css'; +import '../../../yui/www/imagecropper/assets/skins/sam/imagecropper.css'; + export default class SwatImageCropper { constructor(id, config) { this.id = id; From 438f04bd3e7207f847f2b397b798095fb9b5fd79 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Tue, 2 Jan 2018 02:06:55 -0400 Subject: [PATCH 25/35] Exclude color entry --- www/javascript/index.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/www/javascript/index.js b/www/javascript/index.js index 5b3813f41..7d3d19fe4 100644 --- a/www/javascript/index.js +++ b/www/javascript/index.js @@ -9,9 +9,6 @@ import SwatCheckAll from './swat-check-all'; import SwatCheckboxCellRenderer from './swat-checkbox-cell-renderer'; import SwatCheckboxEntryList from './swat-checkbox-entry-list'; import SwatCheckboxList from './swat-checkbox-list'; -/* -import SwatColorEntry from './swat-color-entry'; -*/ import SwatDateEntry from './swat-date-entry'; import SwatDisclosure from './swat-disclosure'; import SwatExpandableCheckboxTree from './swat-expandable-checkbox-tree'; @@ -61,9 +58,6 @@ window.SwatCheckAll = SwatCheckAll; window.SwatCheckboxCellRenderer = SwatCheckboxCellRenderer; window.SwatCheckboxEntryList = SwatCheckboxEntryList; window.SwatCheckboxList = SwatCheckboxList; -/* -window.SwatColorEntry = SwatColorEntry; -*/ window.SwatDateEntry = SwatDateEntry; window.SwatDisclosure = SwatDisclosure; window.SwatExpandableCheckboxTree = SwatExpandableCheckboxTree; From d882cca9d5bf6ec09cd4e9e3bfd1ca0898bcda32 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Tue, 2 Jan 2018 02:07:12 -0400 Subject: [PATCH 26/35] ws --- www/javascript/swat-message-display.js | 1 + www/javascript/swat-table-view.js | 1 + www/javascript/swat-tile-view.js | 1 + 3 files changed, 3 insertions(+) diff --git a/www/javascript/swat-message-display.js b/www/javascript/swat-message-display.js index 9b88e8bb8..ea58f64b5 100644 --- a/www/javascript/swat-message-display.js +++ b/www/javascript/swat-message-display.js @@ -1,4 +1,5 @@ import SwatMessageDisplayMessage from './swat-message-display-message'; + import '../styles/swat-message-display.css'; export default class SwatMessageDisplay { diff --git a/www/javascript/swat-table-view.js b/www/javascript/swat-table-view.js index 49ba8471d..97e54c94b 100644 --- a/www/javascript/swat-table-view.js +++ b/www/javascript/swat-table-view.js @@ -1,4 +1,5 @@ import SwatView from './swat-view'; + import '../styles/swat-table-view.css'; export default class SwatTableView extends SwatView { diff --git a/www/javascript/swat-tile-view.js b/www/javascript/swat-tile-view.js index 77878d867..46a82159f 100644 --- a/www/javascript/swat-tile-view.js +++ b/www/javascript/swat-tile-view.js @@ -1,4 +1,5 @@ import SwatView from './swat-view'; + import '../styles/swat-tile-view.css'; export default class SwatTileView extends SwatView { From 5617c797d9db040aef364037ddc2d6333e424a57 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Tue, 2 Jan 2018 02:09:44 -0400 Subject: [PATCH 27/35] Modularize CSS for date and time entry --- www/javascript/swat-date-entry.js | 2 ++ www/javascript/swat-time-entry.js | 2 ++ www/styles/swat-date-entry.css | 3 +++ www/styles/swat-time-entry.css | 3 +++ www/styles/swat.css | 7 ------- 5 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 www/styles/swat-date-entry.css create mode 100644 www/styles/swat-time-entry.css diff --git a/www/javascript/swat-date-entry.js b/www/javascript/swat-date-entry.js index 94978d841..61d3c6f31 100644 --- a/www/javascript/swat-date-entry.js +++ b/www/javascript/swat-date-entry.js @@ -1,6 +1,8 @@ import { Dom } from '../../../yui/www/dom/dom'; import { Event } from '../../../yui/www/event/event'; +import '../styles/swat-date-entry.css'; + export default class SwatDateEntry { constructor(id, use_current_date) { this.id = id; diff --git a/www/javascript/swat-time-entry.js b/www/javascript/swat-time-entry.js index 0e6a27d38..0cd0ceaa2 100644 --- a/www/javascript/swat-time-entry.js +++ b/www/javascript/swat-time-entry.js @@ -1,6 +1,8 @@ import { Dom } from '../../../yui/www/dom/dom'; import { Event } from '../../../yui/www/event/event'; +import '../styles/swat-time-entry.css'; + export default class SwatTimeEntry { constructor(id, use_current_time) { this.id = id; diff --git a/www/styles/swat-date-entry.css b/www/styles/swat-date-entry.css new file mode 100644 index 000000000..0fa24537e --- /dev/null +++ b/www/styles/swat-date-entry.css @@ -0,0 +1,3 @@ +.swat-date-entry { + white-space: nowrap; +} diff --git a/www/styles/swat-time-entry.css b/www/styles/swat-time-entry.css new file mode 100644 index 000000000..96444ff26 --- /dev/null +++ b/www/styles/swat-time-entry.css @@ -0,0 +1,3 @@ +.swat-time-entry { + white-space: nowrap; +} diff --git a/www/styles/swat.css b/www/styles/swat.css index 451ea0bbf..c72eb3ddf 100644 --- a/www/styles/swat.css +++ b/www/styles/swat.css @@ -127,13 +127,6 @@ ul.swat-radio-list li { margin: 0 5px 0 0; } -/* Swat Date Entry and SwatTimeEntry*/ - -.swat-date-entry, -.swat-time-entry { - white-space: nowrap; -} - /* Swat Actions */ From cf6c6d133fd098805395761ed27003db5113776b Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Tue, 2 Jan 2018 02:14:12 -0400 Subject: [PATCH 28/35] Modularize more actions CSS --- www/styles/swat-actions.css | 24 ++++++++++++++++++- www/styles/swat-frame.css | 21 +++++++++++++++++ www/styles/swat.css | 46 ------------------------------------- 3 files changed, 44 insertions(+), 47 deletions(-) diff --git a/www/styles/swat-actions.css b/www/styles/swat-actions.css index e0775569a..201885928 100644 --- a/www/styles/swat-actions.css +++ b/www/styles/swat-actions.css @@ -1,4 +1,26 @@ -/* SwatActions */ +.swat-actions { + text-align: left; +} + +.swat-actions-controls { + margin-bottom: 0.5em; +} + +.swat-actions label { + display: inline; +} + +.swat-actions-note { + color: #666; + font-size: 85%; + padding-top: 0.3em; +} + +.swat-actions .swat-button-apply { + font-weight: bold; + color: #333; +} + .swat-actions .swat-actions-controls * { vertical-align: middle; } diff --git a/www/styles/swat-frame.css b/www/styles/swat-frame.css index 5f6b4aff8..1b03d0dad 100644 --- a/www/styles/swat-frame.css +++ b/www/styles/swat-frame.css @@ -18,3 +18,24 @@ .swat-frame .swat-frame-subtitle { font-weight: normal; } + +.swat-actions, +.swat-header-form-field, +.swat-footer-form-field { + padding: 1em 0; +} + +.swat-frame .swat-actions, +.swat-frame .swat-header-form-field, +.swat-frame .swat-footer-form-field { + background: #f1ebdf url(../images/swat-form-footer.png) top left repeat-x; + padding: 1em; + margin: 15px -15px -15px -15px; + position: relative; +} + +.swat-frame .swat-header-form-field { + background: #f7f5f3 url(../images/swat-form-header.png) top left repeat-x; + margin: -15px -15px 15px -15px; + background-position: bottom left; +} diff --git a/www/styles/swat.css b/www/styles/swat.css index c72eb3ddf..24821c03a 100644 --- a/www/styles/swat.css +++ b/www/styles/swat.css @@ -128,52 +128,6 @@ ul.swat-radio-list li { } -/* Swat Actions */ - -.swat-actions { - text-align: left; -} - -.swat-actions-controls { - margin-bottom: 0.5em; -} - -.swat-actions, -.swat-header-form-field, -.swat-footer-form-field { - padding: 1em 0; -} - -.swat-frame .swat-actions, -.swat-frame .swat-header-form-field, -.swat-frame .swat-footer-form-field { - background: #f1ebdf url(../images/swat-form-footer.png) top left repeat-x; - padding: 1em; - margin: 15px -15px -15px -15px; - position: relative; -} - -.swat-frame .swat-header-form-field { - background: #f7f5f3 url(../images/swat-form-header.png) top left repeat-x; - margin: -15px -15px 15px -15px; - background-position: bottom left; -} - -.swat-actions label { - display: inline; -} - -.swat-actions-note { - color: #666; - font-size: 85%; - padding-top: 0.3em; -} - -.swat-actions .swat-button-apply { - font-weight: bold; - color: #333; -} - /* SwatFormField */ .swat-form-field { From 6f04ae9bc39a39caff2c3ac6f31480a7417c575f Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Tue, 2 Jan 2018 18:44:21 -0400 Subject: [PATCH 29/35] Modularize YUI ColorAnim --- demo/webpack.config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/demo/webpack.config.js b/demo/webpack.config.js index 62df7bdfa..18e381054 100644 --- a/demo/webpack.config.js +++ b/demo/webpack.config.js @@ -88,6 +88,7 @@ module.exports = { Anim: 'YAHOO.util.Anim', AnimMgr: 'YAHOO.util.AnimMgr', Easing: 'YAHOO.util.Easing', + ColorAnim: 'YAHOO.util.ColorAnim', }, }, }, @@ -184,6 +185,7 @@ module.exports = { 'YAHOO.util.Anim': ['../../../yui/www/animation/animation', 'Anim'], 'YAHOO.util.AnimMgr': ['../../../yui/www/animation/animation', 'AnimMgr'], 'YAHOO.util.Easing': ['../../../yui/www/animation/animation', 'Easing'], + 'YAHOO.util.ColorAnim': ['../../../yui/www/animation/animation', 'ColorAnim'], 'YAHOO.util.Selector': ['../../../yui/www/selector/selector', 'Selector'], 'YAHOO.util.Attribute': ['../../../yui/www/element/element', 'Attribute'], 'YAHOO.util.AttributeProvider': ['../../../yui/www/element/element', 'AttributeProvider'], From 0aaf2b44db7b0b5df87fc8f47135d9cc8cc28b8c Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Tue, 2 Jan 2018 18:44:34 -0400 Subject: [PATCH 30/35] Import abstract overlay styles --- www/javascript/swat-abstract-overlay.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/www/javascript/swat-abstract-overlay.js b/www/javascript/swat-abstract-overlay.js index d478da5a9..e46f786bc 100644 --- a/www/javascript/swat-abstract-overlay.js +++ b/www/javascript/swat-abstract-overlay.js @@ -2,6 +2,8 @@ import { Overlay } from '../../../yui/www/container/container_core'; import SwatZIndexManager from './swat-z-index-manager'; +import '../styles/swat-abstract-overlay.css'; + /** * Abstract overlay widget * From 027bf1c8cc0c689d4224e61f99120c8e3051ec92 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Tue, 2 Jan 2018 18:44:53 -0400 Subject: [PATCH 31/35] Minor fixes to textarea --- www/javascript/swat-textarea.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/javascript/swat-textarea.js b/www/javascript/swat-textarea.js index 0c13e4158..060d34716 100644 --- a/www/javascript/swat-textarea.js +++ b/www/javascript/swat-textarea.js @@ -64,9 +64,9 @@ class SwatTextarea { SwatTextarea.mousedownEventHandler, this.handle_div); this.textarea.parentNode.appendChild(this.handle_div); - Dom.addClass( - this.textarea.parentNode, - 'swat-textarea-with-resize'); + this.textarea.parentNode.classList.add( + 'swat-textarea-with-resize' + ); // if textarea is not currently visible, delay initilization if (this.textarea.offsetWidth === 0) { @@ -294,7 +294,7 @@ SwatTextarea.mousedownEventHandler = function(e, handle) { Dom.setStyle(textarea, 'opacity', 0.25); - var height = parseInt(Dom.getStyle(textarea, 'height')); + var height = parseInt(Dom.getStyle(textarea, 'height'), 10); if (height) { SwatTextarea.dragging_origin_height = height; } else { From 53eceff0cc5b9949ef03959944b94b8337dbcb27 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Tue, 2 Jan 2018 18:45:20 -0400 Subject: [PATCH 32/35] Make table-view-input-row work --- www/javascript/index.js | 4 - www/javascript/swat-table-view-input-row.js | 224 ++++++++++---------- 2 files changed, 110 insertions(+), 118 deletions(-) diff --git a/www/javascript/index.js b/www/javascript/index.js index 7d3d19fe4..c1dd8add8 100644 --- a/www/javascript/index.js +++ b/www/javascript/index.js @@ -26,9 +26,7 @@ import SwatRadioNoteBook from './swat-radio-note-book'; import SwatRating from './swat-rating'; import SwatSearchEntry from './swat-search-entry'; import SwatSimpleColorEntry from './swat-simple-color-entry'; -/* import SwatTableViewInputRow from './swat-table-view-input-row'; -*/ import SwatTableView from './swat-table-view'; import SwatTextarea from './swat-textarea'; import SwatTileView from './swat-tile-view'; @@ -75,9 +73,7 @@ window.SwatRadioNoteBook = SwatRadioNoteBook; window.SwatRating = SwatRating; window.SwatSearchEntry = SwatSearchEntry; window.SwatSimpleColorEntry = SwatSimpleColorEntry; -/* window.SwatTableViewInputRow = SwatTableViewInputRow; -*/ window.SwatTableView = SwatTableView; window.SwatTextarea = SwatTextarea; window.SwatTileView = SwatTileView; diff --git a/www/javascript/swat-table-view-input-row.js b/www/javascript/swat-table-view-input-row.js index 051c61435..472d94f06 100644 --- a/www/javascript/swat-table-view-input-row.js +++ b/www/javascript/swat-table-view-input-row.js @@ -1,3 +1,110 @@ +import { Dom } from '../../../yui/www/dom/dom'; +import { ColorAnim, Easing } from '../../../yui/www/animation/animation'; + +/** + * Gets an XML parser with a loadXML() method + */ +function SwatTableViewInputRow_getXMLParser() { + var parser = null; + var is_ie = true; + + try { + var dom = new ActiveXObject('Msxml2.XMLDOM'); + } catch (err1) { + try { + var dom = new ActiveXObject('Microsoft.XMLDOM'); + } catch (err2) { + is_ie = false; + } + } + + if (is_ie) { + /* + * Internet Explorer's XMLDOM object has a proprietary loadXML() + * method. Our method returns the document. + */ + parser = function() {}; + parser.loadXML = function(document_string) { + if (!dom.loadXML(document_string)) + alert(dom.parseError.reason); + + return dom; + }; + } + + if (parser === null && typeof DOMParser !== 'undefined') { + /* + * Mozilla, Safari and Opera have a proprietary DOMParser() + * class. + */ + var dom_parser = new DOMParser(); + + // Cannot add loadXML method to a newly created DOMParser because it + // crashes Safari + parser = function() {}; + parser.loadXML = function(document_string) { + return dom_parser.parseFromString(document_string, 'text/xml'); + }; + } + + return parser; +}; + +/* + * If the browser does not support the importNode() method then we need to + * manually copy nodes from one document to the current document. These methods + * parse a HTMLTableRowNode in one document into a table row in this document. + */ + +/** + * Parses a table row from one document into another + * + * Internet Explorer does not allow writing to the innerHTML property for + * table row nodes so the table cells are individually inserted and cloned. + * + * @param HTMLTableRowNode source_tr the table row from the source document. + * @param HTMLTableRowNode dest_tr the table row in the destination + * document. + */ +function SwatTableViewInputRow_parseTableRow(source_tr, dest_tr) { + var child_node; + var dest_td; + var source_attributes; + for (var i = 0; i < source_tr.childNodes.length; i++) { + child_node = source_tr.childNodes[i]; + if (child_node.nodeType == 1 && child_node.nodeName == 'td') { + dest_td = dest_tr.insertCell(-1); + source_attributes = child_node.attributes; + for (var j = 0; j < source_attributes.length; j++) { + if (source_attributes[j].name == 'class') { + dest_td.className = source_attributes[j].value; + } else { + dest_td.setAttribute(source_attributes[j].name, + source_attributes[j].value); + } + } + SwatTableViewInputRow_parseTableCell(child_node, dest_td); + } + } +} + +/** + * Parses a table cell from one document into another + * + * @param HTMLTableRowNode source_td the table cell from the source + * document. + * @param HTMLTableRowNode dest_td the table cell in the destination + * document. + */ +function SwatTableViewInputRow_parseTableCell(source_td, dest_td) { + // Internet Explorer does not have an innerHTML property set on + // imported DOM nodes even if the imported document is XHTML. + if (source_td.innerHTML) + dest_td.innerHTML = source_td.innerHTML; + else + dest_td.innerHTML = source_td.xml; +} + /** * A table view row that can add an arbitrary number of data entry rows * @@ -128,18 +235,18 @@ class SwatTableViewInputRow { var node = dest_tr; var dest_color = 'transparent'; while (dest_color == 'transparent' && node) { - dest_color = YAHOO.util.Dom.getStyle(node, 'background-color'); + dest_color = Dom.getStyle(node, 'background-color'); node = node.parentNode; } if (dest_color == 'transparent') { dest_color = '#ffffff'; } - var animation = new YAHOO.util.ColorAnim( + var animation = new ColorAnim( dest_tr, { backgroundColor: { from: '#fffbc9', to: dest_color } }, 1, - YAHOO.util.Easing.easeOut + Easing.easeOut ); animation.animate(); @@ -202,58 +309,6 @@ class SwatTableViewInputRow { SwatTableViewInputRow.is_webkit = (/AppleWebKit|Konqueror|KHTML/gi).test(navigator.userAgent); -/** - * Gets an XML parser with a loadXML() method - */ -function SwatTableViewInputRow_getXMLParser() -{ - var parser = null; - var is_ie = true; - - try { - var dom = new ActiveXObject('Msxml2.XMLDOM'); - } catch (err1) { - try { - var dom = new ActiveXObject('Microsoft.XMLDOM'); - } catch (err2) { - is_ie = false; - } - } - - if (is_ie) { - /* - * Internet Explorer's XMLDOM object has a proprietary loadXML() - * method. Our method returns the document. - */ - parser = function() {}; - parser.loadXML = function(document_string) - { - if (!dom.loadXML(document_string)) - alert(dom.parseError.reason); - - return dom; - }; - } - - if (parser === null && typeof DOMParser !== 'undefined') { - /* - * Mozilla, Safari and Opera have a proprietary DOMParser() - * class. - */ - var dom_parser = new DOMParser(); - - // Cannot add loadXML method to a newly created DOMParser because it - // crashes Safari - parser = function() {}; - parser.loadXML = function(document_string) - { - return dom_parser.parseFromString(document_string, 'text/xml'); - }; - } - - return parser; -} - /** * The XML parser used by this widget * @@ -261,63 +316,4 @@ function SwatTableViewInputRow_getXMLParser() */ SwatTableViewInputRow.parser = SwatTableViewInputRow_getXMLParser(); -/* - * If the browser does not support the importNode() method then we need to - * manually copy nodes from one document to the current document. These methods - * parse a HTMLTableRowNode in one document into a table row in this document. - */ -if (!document.importNode || SwatTableViewInputRow.is_webkit) { - - /** - * Parses a table row from one document into another - * - * Internet Explorer does not allow writing to the innerHTML property for - * table row nodes so the table cells are individually inserted and cloned. - * - * @param HTMLTableRowNode source_tr the table row from the source document. - * @param HTMLTableRowNode dest_tr the table row in the destination - * document. - */ - function SwatTableViewInputRow_parseTableRow(source_tr, dest_tr) - { - var child_node; - var dest_td; - var source_attributes; - for (var i = 0; i < source_tr.childNodes.length; i++) { - child_node = source_tr.childNodes[i]; - if (child_node.nodeType == 1 && child_node.nodeName == 'td') { - dest_td = dest_tr.insertCell(-1); - source_attributes = child_node.attributes; - for (var j = 0; j < source_attributes.length; j++) { - if (source_attributes[j].name == 'class') { - dest_td.className = source_attributes[j].value; - } else { - dest_td.setAttribute(source_attributes[j].name, - source_attributes[j].value); - } - } - SwatTableViewInputRow_parseTableCell(child_node, dest_td); - } - } - } - - /** - * Parses a table cell from one document into another - * - * @param HTMLTableRowNode source_td the table cell from the source - * document. - * @param HTMLTableRowNode dest_td the table cell in the destination - * document. - */ - function SwatTableViewInputRow_parseTableCell(source_td, dest_td) - { - // Internet Explorer does not have an innerHTML property set on - // imported DOM nodes even if the imported document is XHTML. - if (source_td.innerHTML) - dest_td.innerHTML = source_td.innerHTML; - else - dest_td.innerHTML = source_td.xml; - } -} - export default SwatTableViewInputRow; From c985e1b2235ab4d9c9123a99f295ae97afa22ae6 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Wed, 3 Jan 2018 19:44:42 -0400 Subject: [PATCH 33/35] Update to TinyMCE 4.x and make work with webpack --- Swat/SwatTextareaEditor.php | 207 ------------------------- demo/include/demos/textareaeditor.xml | 1 - demo/include/layout.php | 1 + demo/package.json | 1 + demo/webpack.config.js | 10 ++ www/javascript/index.js | 1 + www/javascript/swat-textarea-editor.js | 96 ++++++++++++ www/styles/swat-textarea-editor.css | 9 ++ 8 files changed, 118 insertions(+), 208 deletions(-) create mode 100644 www/javascript/swat-textarea-editor.js create mode 100644 www/styles/swat-textarea-editor.css diff --git a/Swat/SwatTextareaEditor.php b/Swat/SwatTextareaEditor.php index cab175ddf..81ee81a72 100644 --- a/Swat/SwatTextareaEditor.php +++ b/Swat/SwatTextareaEditor.php @@ -13,12 +13,6 @@ */ class SwatTextareaEditor extends SwatTextarea { - // {{{ class constants - - const MODE_VISUAL = 1; - const MODE_SOURCE = 2; - - // }}} // {{{ public properties /** @@ -53,29 +47,6 @@ class SwatTextareaEditor extends SwatTextarea */ public $base_href = null; - /** - * Editing mode to use - * - * Must be one of either {@link SwatTextareaEditor::MODE_VISUAL} or - * {@link SwatTextareaEditor::MODE_SOURCE}. - * - * Defaults to SwatTextareaEditor::MODE_VISUAL. - * - * @var integer - */ - public $mode = self::MODE_VISUAL; - - /** - * Whether or not the mode switching behavior is enabled - * - * If set to false, only {@link SwatTextAreaEditor::$mode} will be ignored - * and only {@link SwatTextAreaEditor::MODE_VISUAL} will be available for - * the editor. - * - * @var boolean - */ - public $modes_enabled = true; - /** * An optional JSON server used to provide uploaded image data to the * insert image dialog @@ -138,11 +109,6 @@ public function __construct($id = null) $this->requires_id = true; $this->rows = 30; - - $this->addJavaScript('packages/swat/javascript/tiny_mce/tiny_mce.js'); - $this->addJavaScript( - 'packages/swat/javascript/swat-z-index-manager.js' - ); } // }}} @@ -199,16 +165,7 @@ public function display() $textarea_tag->display(); - // hidden field to preserve editing mode in form data - $input_tag = new SwatHtmlTag('input'); - $input_tag->type = 'hidden'; - $input_tag->id = $this->id . '_mode'; - $input_tag->value = $this->mode; - $input_tag->display(); - $div_tag->close(); - - Swat::displayInlineJavaScript($this->getInlineJavaScript()); } // }}} @@ -229,170 +186,6 @@ public function getFocusableHtmlId() return null; } - // }}} - // {{{ protected function getConfig() - - protected function getConfig() - { - $buttons = implode(',', $this->getConfigButtons()); - - $blockformats = array( - 'p', - 'blockquote', - 'pre', - 'h1', - 'h2', - 'h3', - 'h4', - 'h5', - 'h6' - ); - - $blockformats = implode(',', $blockformats); - - $modes = $this->modes_enabled ? 'yes' : 'no'; - $image_server = $this->image_server ? $this->image_server : ''; - - $config = array( - 'mode' => 'exact', - 'elements' => $this->id, - 'theme' => 'advanced', - 'theme_advanced_buttons1' => $buttons, - 'theme_advanced_buttons2' => '', - 'theme_advanced_buttons3' => '', - 'theme_advanced_toolbar_location' => 'top', - 'theme_advanced_toolbar_align' => 'left', - 'theme_advanced_blockformats' => $blockformats, - 'skin' => 'swat', - 'plugins' => 'swat,media,paste', - 'swat_modes_enabled' => $modes, - 'swat_image_server' => $image_server, - 'paste_remove_spans' => true, - 'paste_remove_styles' => true - ); - - return $config; - } - - // }}} - // {{{ protected function getConfigButtons() - - protected function getConfigButtons() - { - return array( - 'bold', - 'italic', - '|', - 'formatselect', - '|', - 'removeformat', - '|', - 'undo', - 'redo', - '|', - 'outdent', - 'indent', - '|', - 'bullist', - 'numlist', - '|', - 'link', - 'image', - 'snippet' - ); - } - - // }}} - // {{{ protected function getInlineJavaScript() - - protected function getInlineJavaScript() - { - $base_href = 'editor_base_' . $this->id; - ob_start(); - - if ($this->base_href === null) { - echo "var {$base_href} = " . - "document.getElementsByTagName('base');\n"; - - echo "if ({$base_href}.length) {\n"; - echo "\t{$base_href} = {$base_href}[0];\n"; - echo "\t{$base_href} = {$base_href}.href;\n"; - echo "} else {\n"; - echo "\t{$base_href} = location.href.split('#', 2)[0];\n"; - echo "\t{$base_href} = {$base_href}.split('?', 2)[0];\n"; - echo "\t{$base_href} = {$base_href}.substring(\n"; - echo "\t\t0, {$base_href}.lastIndexOf('/') + 1);\n"; - echo "}\n"; - } else { - echo "var {$base_href} = " . - SwatString::quoteJavaScriptString($this->base_href) . - ";\n"; - } - - echo "tinyMCE.init({\n"; - - $lines = array(); - foreach ($this->getConfig() as $name => $value) { - if (is_string($value)) { - $value = SwatString::quoteJavaScriptString($value); - } elseif (is_bool($value)) { - $value = $value ? 'true' : 'false'; - } - $lines[] = "\t" . $name . ": " . $value; - } - - $lines[] = "\tdocument_base_url: {$base_href}"; - - echo implode(",\n", $lines); - - // Make removeformat button also clear inline alignments, styles, - // colors and classes. - echo ",\n" . - "\tformats: {\n" . - "\t\tremoveformat : [\n" . - "\t\t\t{\n" . - "\t\t\t\tselector : 'b,strong,em,i,font,u,strike',\n" . - "\t\t\t\tremove : 'all',\n" . - "\t\t\t\tsplit : true,\n" . - "\t\t\t\texpand : false,\n" . - "\t\t\t\tblock_expand : true,\n" . - "\t\t\t\tdeep : true\n" . - "\t\t\t},\n" . - "\t\t\t{\n" . - "\t\t\t\tselector : 'span',\n" . - "\t\t\t\tattributes : [\n" . - "\t\t\t\t\t'style',\n" . - "\t\t\t\t\t'class',\n" . - "\t\t\t\t\t'align',\n" . - "\t\t\t\t\t'color',\n" . - "\t\t\t\t\t'background'\n" . - "\t\t\t\t],\n" . - "\t\t\t\tremove : 'empty',\n" . - "\t\t\t\tsplit : true,\n" . - "\t\t\t\texpand : false,\n" . - "\t\t\t\tdeep : true\n" . - "\t\t\t},\n" . - "\t\t\t{\n" . - "\t\t\t\tselector : '*',\n" . - "\t\t\t\tattributes : [\n" . - "\t\t\t\t\t'style',\n" . - "\t\t\t\t\t'class',\n" . - "\t\t\t\t\t'align',\n" . - "\t\t\t\t\t'color',\n" . - "\t\t\t\t\t'background'\n" . - "\t\t\t\t],\n" . - "\t\t\t\tsplit : false,\n" . - "\t\t\t\texpand : false,\n" . - "\t\t\t\tdeep : true\n" . - "\t\t\t}\n" . - "\t\t]\n" . - "\t}"; - - echo "\n});"; - - return ob_get_clean(); - } - // }}} // {{{ protected function getCSSClassNames() diff --git a/demo/include/demos/textareaeditor.xml b/demo/include/demos/textareaeditor.xml index 4f29b83cc..9f6865d89 100644 --- a/demo/include/demos/textareaeditor.xml +++ b/demo/include/demos/textareaeditor.xml @@ -6,7 +6,6 @@ Visual Editor Text Area - MODE_VISUAL We’ve been using free and open-source diff --git a/demo/include/layout.php b/demo/include/layout.php index b0d7316fb..fb0cd9856 100644 --- a/demo/include/layout.php +++ b/demo/include/layout.php @@ -3,6 +3,7 @@ + <?php echo $title; ?> diff --git a/demo/package.json b/demo/package.json index f2299b490..6c32dabd2 100644 --- a/demo/package.json +++ b/demo/package.json @@ -15,6 +15,7 @@ "loader-utils": "^1.1.0", "source-map": "^0.6.1", "style-loader": "^0.19.1", + "tinymce": "^4.7.4", "url-loader": "^0.5.7", "webpack": "^3.10.0" } diff --git a/demo/webpack.config.js b/demo/webpack.config.js index 18e381054..bdd84733d 100644 --- a/demo/webpack.config.js +++ b/demo/webpack.config.js @@ -5,6 +5,7 @@ module.exports = { // devtool: 'source-map', entry: { swat: './vendor/silverorange/swat/www/javascript/index.js', + editor: './vendor/silverorange/swat/www/javascript/swat-textarea-editor.js', }, output: { filename: 'www/[name].js' @@ -166,6 +167,15 @@ module.exports = { }, }, }, + /*{ + test: /tiny_mce_src.js$/, + use: { + loader: 'exports-loader', + options: { + tinyMCE: 'tinyMCE', + }, + }, + },*/ ], }, resolve: { diff --git a/www/javascript/index.js b/www/javascript/index.js index c1dd8add8..e893204fd 100644 --- a/www/javascript/index.js +++ b/www/javascript/index.js @@ -42,6 +42,7 @@ import '../styles/swat-null-text-cell-renderer.css'; import '../styles/swat-pagination.css'; import '../styles/swat-radio-list.css'; import '../styles/swat-radio-table.css'; +import '../styles/swat-textarea-editor.css'; import '../styles/swat-tool-link.css'; import '../styles/swat-toolbar.css'; diff --git a/www/javascript/swat-textarea-editor.js b/www/javascript/swat-textarea-editor.js new file mode 100644 index 000000000..2e54db130 --- /dev/null +++ b/www/javascript/swat-textarea-editor.js @@ -0,0 +1,96 @@ +// Import TinyMCE +import tinymce from 'tinymce/tinymce'; + +// A theme is also required +import 'tinymce/themes/modern/theme'; + +// Any plugins you want to use has to be imported +import 'tinymce/plugins/autolink'; +import 'tinymce/plugins/code'; +import 'tinymce/plugins/image'; +import 'tinymce/plugins/link'; +import 'tinymce/plugins/lists'; +import 'tinymce/plugins/paste'; + +/* +require.context( + 'file?name=[path][name].[ext]&context=tinymce!tinymce/skins', + true, + /.* / +);*/ + +tinymce.init({ + selector: '.swat-textarea-editor', + + plugins: [ + 'autolink', + 'code', + 'paste', + 'image', + 'link', + 'lists', + ], + + // appearance + menubar: false, + branding: false, + elementpath: false, + statusbar: false, + toolbar: ' bold italic | formatselect | removeformat | outdent indent | bullist numlist | link image | code ', + block_formats: 'Paragraph=p;Blockquote=blockquote;Preformatted=pre;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;', + + // Make removeformat button also clear inline alignments, styles, colors + // and classes. + formats: { + removeformat: [ + { + selector: 'b,strong,em,i,font,u,strike', + remove: 'all', + split: true, + expand: false, + block_expand: true, + deep: true, + }, + { + selector: 'span', + attributes: [ + 'style', + 'class', + 'align', + 'color', + 'background', + ], + remove: 'empty', + split: true, + expand: false, + deep: true, + }, + { + selector: '*', + attributes: [ + 'style', + 'class', + 'align', + 'color', + 'background', + ], + split: false, + expand: false, + deep: true, + }, + ], + }, + + // link plugin + link_context_toolbar: true, + link_title: false, + target_list: false, + + // image plugin + image_caption: false, + image_description: false, + image_dimensions: false, + image_title: false, + + width: 640, +}); diff --git a/www/styles/swat-textarea-editor.css b/www/styles/swat-textarea-editor.css new file mode 100644 index 000000000..6225c39e6 --- /dev/null +++ b/www/styles/swat-textarea-editor.css @@ -0,0 +1,9 @@ +/* prevent moving popup dialogs */ + +.mce-window-head .mce-dragh { + display: none; +} + +.mce-window-head .mce-close { + display: none; +} From 0ee197f12fe131447f56d852e6aa7789d1cdb965 Mon Sep 17 00:00:00 2001 From: Michael Gauthier Date: Wed, 3 Jan 2018 19:51:22 -0400 Subject: [PATCH 34/35] Remove TinyMCE sources These can be imported via composer or NPM. --- www/javascript/tiny_mce/langs/en.js | 223 - www/javascript/tiny_mce/license.txt | 504 - .../tiny_mce/plugins/advhr/css/advhr.css | 5 - .../tiny_mce/plugins/advhr/editor_plugin.js | 1 - .../plugins/advhr/editor_plugin_src.js | 57 - .../tiny_mce/plugins/advhr/js/rule.js | 43 - .../tiny_mce/plugins/advhr/langs/en_dlg.js | 7 - .../tiny_mce/plugins/advhr/rule.htm | 58 - .../plugins/advimage/css/advimage.css | 13 - .../plugins/advimage/editor_plugin.js | 1 - .../plugins/advimage/editor_plugin_src.js | 50 - .../tiny_mce/plugins/advimage/image.htm | 235 - .../tiny_mce/plugins/advimage/img/sample.gif | Bin 1624 -> 0 bytes .../tiny_mce/plugins/advimage/js/image.js | 458 - .../tiny_mce/plugins/advimage/langs/en_dlg.js | 45 - .../plugins/advimagescale/editor_plugin.js | 454 - .../tiny_mce/plugins/advlink/css/advlink.css | 8 - .../tiny_mce/plugins/advlink/editor_plugin.js | 1 - .../plugins/advlink/editor_plugin_src.js | 61 - .../tiny_mce/plugins/advlink/js/advlink.js | 532 - .../tiny_mce/plugins/advlink/langs/en_dlg.js | 54 - .../tiny_mce/plugins/advlink/link.htm | 338 - .../tiny_mce/plugins/advlist/editor_plugin.js | 1 - .../plugins/advlist/editor_plugin_src.js | 176 - .../plugins/autolink/editor_plugin.js | 1 - .../plugins/autolink/editor_plugin_src.js | 172 - .../plugins/autoresize/editor_plugin.js | 1 - .../plugins/autoresize/editor_plugin_src.js | 137 - .../plugins/autosave/editor_plugin.js | 1 - .../plugins/autosave/editor_plugin_src.js | 431 - .../tiny_mce/plugins/autosave/langs/en.js | 4 - .../tiny_mce/plugins/bbcode/editor_plugin.js | 1 - .../plugins/bbcode/editor_plugin_src.js | 120 - .../plugins/contextmenu/editor_plugin.js | 1 - .../plugins/contextmenu/editor_plugin_src.js | 160 - .../plugins/directionality/editor_plugin.js | 1 - .../directionality/editor_plugin_src.js | 82 - .../plugins/emotions/editor_plugin.js | 1 - .../plugins/emotions/editor_plugin_src.js | 43 - .../tiny_mce/plugins/emotions/emotions.htm | 41 - .../plugins/emotions/img/smiley-cool.gif | Bin 354 -> 0 bytes .../plugins/emotions/img/smiley-cry.gif | Bin 329 -> 0 bytes .../emotions/img/smiley-embarassed.gif | Bin 331 -> 0 bytes .../emotions/img/smiley-foot-in-mouth.gif | Bin 342 -> 0 bytes .../plugins/emotions/img/smiley-frown.gif | Bin 340 -> 0 bytes .../plugins/emotions/img/smiley-innocent.gif | Bin 336 -> 0 bytes .../plugins/emotions/img/smiley-kiss.gif | Bin 338 -> 0 bytes .../plugins/emotions/img/smiley-laughing.gif | Bin 343 -> 0 bytes .../emotions/img/smiley-money-mouth.gif | Bin 321 -> 0 bytes .../plugins/emotions/img/smiley-sealed.gif | Bin 323 -> 0 bytes .../plugins/emotions/img/smiley-smile.gif | Bin 344 -> 0 bytes .../plugins/emotions/img/smiley-surprised.gif | Bin 338 -> 0 bytes .../emotions/img/smiley-tongue-out.gif | Bin 328 -> 0 bytes .../plugins/emotions/img/smiley-undecided.gif | Bin 337 -> 0 bytes .../plugins/emotions/img/smiley-wink.gif | Bin 350 -> 0 bytes .../plugins/emotions/img/smiley-yell.gif | Bin 336 -> 0 bytes .../tiny_mce/plugins/emotions/js/emotions.js | 22 - .../tiny_mce/plugins/emotions/langs/en_dlg.js | 20 - .../tiny_mce/plugins/example/dialog.htm | 22 - .../tiny_mce/plugins/example/editor_plugin.js | 1 - .../plugins/example/editor_plugin_src.js | 84 - .../tiny_mce/plugins/example/img/example.gif | Bin 87 -> 0 bytes .../tiny_mce/plugins/example/js/dialog.js | 19 - .../tiny_mce/plugins/example/langs/en.js | 3 - .../tiny_mce/plugins/example/langs/en_dlg.js | 3 - .../example_dependency/editor_plugin.js | 1 - .../example_dependency/editor_plugin_src.js | 50 - .../plugins/fullpage/css/fullpage.css | 143 - .../plugins/fullpage/editor_plugin.js | 1 - .../plugins/fullpage/editor_plugin_src.js | 399 - .../tiny_mce/plugins/fullpage/fullpage.htm | 259 - .../tiny_mce/plugins/fullpage/js/fullpage.js | 232 - .../tiny_mce/plugins/fullpage/langs/en_dlg.js | 85 - .../plugins/fullscreen/editor_plugin.js | 1 - .../plugins/fullscreen/editor_plugin_src.js | 159 - .../plugins/fullscreen/fullscreen.htm | 109 - .../tiny_mce/plugins/iespell/editor_plugin.js | 1 - .../plugins/iespell/editor_plugin_src.js | 54 - .../plugins/inlinepopups/editor_plugin.js | 1 - .../plugins/inlinepopups/editor_plugin_src.js | 696 - .../skins/clearlooks2/img/alert.gif | Bin 810 -> 0 bytes .../skins/clearlooks2/img/button.gif | Bin 272 -> 0 bytes .../skins/clearlooks2/img/buttons.gif | Bin 1195 -> 0 bytes .../skins/clearlooks2/img/confirm.gif | Bin 907 -> 0 bytes .../skins/clearlooks2/img/corners.gif | Bin 909 -> 0 bytes .../skins/clearlooks2/img/horizontal.gif | Bin 769 -> 0 bytes .../skins/clearlooks2/img/vertical.gif | Bin 84 -> 0 bytes .../inlinepopups/skins/clearlooks2/window.css | 90 - .../plugins/inlinepopups/template.htm | 387 - .../plugins/insertdatetime/editor_plugin.js | 1 - .../insertdatetime/editor_plugin_src.js | 83 - .../tiny_mce/plugins/layer/editor_plugin.js | 1 - .../plugins/layer/editor_plugin_src.js | 214 - .../plugins/legacyoutput/editor_plugin.js | 1 - .../plugins/legacyoutput/editor_plugin_src.js | 139 - .../tiny_mce/plugins/lists/editor_plugin.js | 1 - .../plugins/lists/editor_plugin_src.js | 688 - .../tiny_mce/plugins/media/css/content.css | 6 - .../tiny_mce/plugins/media/css/media.css | 17 - .../tiny_mce/plugins/media/editor_plugin.js | 1 - .../plugins/media/editor_plugin_src.js | 777 - .../tiny_mce/plugins/media/img/flash.gif | Bin 241 -> 0 bytes .../tiny_mce/plugins/media/img/flv_player.swf | Bin 11668 -> 0 bytes .../tiny_mce/plugins/media/img/quicktime.gif | Bin 303 -> 0 bytes .../tiny_mce/plugins/media/img/realmedia.gif | Bin 439 -> 0 bytes .../tiny_mce/plugins/media/img/shockwave.gif | Bin 387 -> 0 bytes .../tiny_mce/plugins/media/img/trans.gif | Bin 43 -> 0 bytes .../plugins/media/img/windowsmedia.gif | Bin 415 -> 0 bytes .../tiny_mce/plugins/media/js/embed.js | 73 - .../tiny_mce/plugins/media/js/media.js | 355 - .../tiny_mce/plugins/media/langs/en_dlg.js | 109 - .../tiny_mce/plugins/media/media.htm | 812 - .../tiny_mce/plugins/media/moxieplayer.swf | Bin 33931 -> 0 bytes .../plugins/nonbreaking/editor_plugin.js | 1 - .../plugins/nonbreaking/editor_plugin_src.js | 53 - .../plugins/noneditable/editor_plugin.js | 1 - .../plugins/noneditable/editor_plugin_src.js | 95 - .../plugins/pagebreak/css/content.css | 1 - .../plugins/pagebreak/editor_plugin.js | 1 - .../plugins/pagebreak/editor_plugin_src.js | 74 - .../plugins/pagebreak/img/pagebreak.gif | Bin 325 -> 0 bytes .../tiny_mce/plugins/pagebreak/img/trans.gif | Bin 43 -> 0 bytes .../tiny_mce/plugins/paste/blank.htm | 21 - .../tiny_mce/plugins/paste/css/blank.css | 14 - .../tiny_mce/plugins/paste/css/pasteword.css | 3 - .../tiny_mce/plugins/paste/editor_plugin.js | 1 - .../plugins/paste/editor_plugin_src.js | 942 - .../tiny_mce/plugins/paste/js/pastetext.js | 36 - .../tiny_mce/plugins/paste/js/pasteword.js | 51 - .../tiny_mce/plugins/paste/langs/en_dlg.js | 5 - .../tiny_mce/plugins/paste/pastetext.htm | 27 - .../tiny_mce/plugins/paste/pasteword.htm | 21 - .../tiny_mce/plugins/preview/editor_plugin.js | 1 - .../plugins/preview/editor_plugin_src.js | 53 - .../tiny_mce/plugins/preview/example.html | 28 - .../plugins/preview/jscripts/embed.js | 73 - .../tiny_mce/plugins/preview/preview.html | 17 - .../tiny_mce/plugins/print/editor_plugin.js | 1 - .../plugins/print/editor_plugin_src.js | 34 - .../tiny_mce/plugins/safari/blank.htm | 1 - .../tiny_mce/plugins/safari/editor_plugin.js | 1 - .../plugins/safari/editor_plugin_src.js | 438 - .../tiny_mce/plugins/save/editor_plugin.js | 1 - .../plugins/save/editor_plugin_src.js | 101 - .../searchreplace/css/searchreplace.css | 6 - .../plugins/searchreplace/editor_plugin.js | 1 - .../searchreplace/editor_plugin_src.js | 61 - .../plugins/searchreplace/js/searchreplace.js | 142 - .../plugins/searchreplace/langs/en_dlg.js | 16 - .../plugins/searchreplace/searchreplace.htm | 100 - .../plugins/spellchecker/css/content.css | 1 - .../plugins/spellchecker/editor_plugin.js | 1 - .../plugins/spellchecker/editor_plugin_src.js | 434 - .../plugins/spellchecker/img/wline.gif | Bin 46 -> 0 bytes .../tiny_mce/plugins/style/css/props.css | 13 - .../tiny_mce/plugins/style/editor_plugin.js | 1 - .../plugins/style/editor_plugin_src.js | 55 - .../tiny_mce/plugins/style/js/props.js | 635 - .../tiny_mce/plugins/style/langs/en_dlg.js | 70 - .../tiny_mce/plugins/style/props.htm | 838 - .../plugins/tabfocus/editor_plugin.js | 1 - .../plugins/tabfocus/editor_plugin_src.js | 114 - .../tiny_mce/plugins/table/cell.htm | 180 - .../tiny_mce/plugins/table/css/cell.css | 17 - .../tiny_mce/plugins/table/css/row.css | 25 - .../tiny_mce/plugins/table/css/table.css | 13 - .../tiny_mce/plugins/table/editor_plugin.js | 1 - .../plugins/table/editor_plugin_src.js | 1263 -- .../tiny_mce/plugins/table/js/cell.js | 319 - .../tiny_mce/plugins/table/js/merge_cells.js | 27 - .../tiny_mce/plugins/table/js/row.js | 237 - .../tiny_mce/plugins/table/js/table.js | 450 - .../tiny_mce/plugins/table/langs/en_dlg.js | 75 - .../tiny_mce/plugins/table/merge_cells.htm | 32 - www/javascript/tiny_mce/plugins/table/row.htm | 158 - .../tiny_mce/plugins/table/table.htm | 188 - .../tiny_mce/plugins/template/blank.htm | 12 - .../plugins/template/css/template.css | 23 - .../plugins/template/editor_plugin.js | 1 - .../plugins/template/editor_plugin_src.js | 159 - .../tiny_mce/plugins/template/js/template.js | 106 - .../tiny_mce/plugins/template/langs/en_dlg.js | 15 - .../tiny_mce/plugins/template/template.htm | 31 - .../plugins/visualchars/editor_plugin.js | 1 - .../plugins/visualchars/editor_plugin_src.js | 83 - .../plugins/wordcount/editor_plugin.js | 1 - .../plugins/wordcount/editor_plugin_src.js | 114 - .../tiny_mce/plugins/xhtmlxtras/abbr.htm | 142 - .../tiny_mce/plugins/xhtmlxtras/acronym.htm | 142 - .../plugins/xhtmlxtras/attributes.htm | 149 - .../tiny_mce/plugins/xhtmlxtras/cite.htm | 142 - .../plugins/xhtmlxtras/css/attributes.css | 11 - .../tiny_mce/plugins/xhtmlxtras/css/popup.css | 9 - .../tiny_mce/plugins/xhtmlxtras/del.htm | 162 - .../plugins/xhtmlxtras/editor_plugin.js | 1 - .../plugins/xhtmlxtras/editor_plugin_src.js | 132 - .../tiny_mce/plugins/xhtmlxtras/ins.htm | 162 - .../tiny_mce/plugins/xhtmlxtras/js/abbr.js | 28 - .../tiny_mce/plugins/xhtmlxtras/js/acronym.js | 28 - .../plugins/xhtmlxtras/js/attributes.js | 111 - .../tiny_mce/plugins/xhtmlxtras/js/cite.js | 28 - .../tiny_mce/plugins/xhtmlxtras/js/del.js | 53 - .../plugins/xhtmlxtras/js/element_common.js | 229 - .../tiny_mce/plugins/xhtmlxtras/js/ins.js | 53 - .../plugins/xhtmlxtras/langs/en_dlg.js | 32 - .../tiny_mce/themes/advanced/about.htm | 52 - .../tiny_mce/themes/advanced/anchor.htm | 26 - .../tiny_mce/themes/advanced/charmap.htm | 51 - .../tiny_mce/themes/advanced/color_picker.htm | 74 - .../themes/advanced/editor_template.js | 1 - .../themes/advanced/editor_template_src.js | 1358 -- .../tiny_mce/themes/advanced/image.htm | 80 - .../themes/advanced/img/colorpicker.jpg | Bin 2584 -> 0 bytes .../tiny_mce/themes/advanced/img/iframe.gif | Bin 600 -> 0 bytes .../themes/advanced/img/pagebreak.gif | Bin 325 -> 0 bytes .../themes/advanced/img/quicktime.gif | Bin 301 -> 0 bytes .../themes/advanced/img/realmedia.gif | Bin 439 -> 0 bytes .../themes/advanced/img/shockwave.gif | Bin 384 -> 0 bytes .../tiny_mce/themes/advanced/img/trans.gif | Bin 43 -> 0 bytes .../tiny_mce/themes/advanced/img/video.gif | Bin 597 -> 0 bytes .../themes/advanced/img/windowsmedia.gif | Bin 415 -> 0 bytes .../tiny_mce/themes/advanced/js/about.js | 73 - .../tiny_mce/themes/advanced/js/anchor.js | 42 - .../tiny_mce/themes/advanced/js/charmap.js | 355 - .../themes/advanced/js/color_picker.js | 329 - .../tiny_mce/themes/advanced/js/image.js | 247 - .../tiny_mce/themes/advanced/js/link.js | 153 - .../themes/advanced/js/source_editor.js | 56 - .../tiny_mce/themes/advanced/langs/en.js | 68 - .../tiny_mce/themes/advanced/langs/en_dlg.js | 54 - .../tiny_mce/themes/advanced/link.htm | 57 - .../tiny_mce/themes/advanced/shortcuts.htm | 47 - .../themes/advanced/skins/default/content.css | 47 - .../themes/advanced/skins/default/dialog.css | 117 - .../advanced/skins/default/img/buttons.png | Bin 3133 -> 0 bytes .../advanced/skins/default/img/items.gif | Bin 64 -> 0 bytes .../advanced/skins/default/img/menu_arrow.gif | Bin 68 -> 0 bytes .../advanced/skins/default/img/menu_check.gif | Bin 70 -> 0 bytes .../advanced/skins/default/img/progress.gif | Bin 1787 -> 0 bytes .../advanced/skins/default/img/tabs.gif | Bin 1322 -> 0 bytes .../themes/advanced/skins/default/ui.css | 214 - .../advanced/skins/highcontrast/content.css | 23 - .../advanced/skins/highcontrast/dialog.css | 105 - .../themes/advanced/skins/highcontrast/ui.css | 102 - .../themes/advanced/skins/o2k7/content.css | 46 - .../themes/advanced/skins/o2k7/dialog.css | 117 - .../advanced/skins/o2k7/img/button_bg.png | Bin 2766 -> 0 bytes .../skins/o2k7/img/button_bg_black.png | Bin 651 -> 0 bytes .../skins/o2k7/img/button_bg_silver.png | Bin 2084 -> 0 bytes .../themes/advanced/skins/o2k7/ui.css | 217 - .../themes/advanced/skins/o2k7/ui_black.css | 8 - .../themes/advanced/skins/o2k7/ui_silver.css | 5 - .../themes/advanced/source_editor.htm | 25 - .../tiny_mce/themes/simple/editor_template.js | 1 - .../themes/simple/editor_template_src.js | 84 - .../tiny_mce/themes/simple/img/icons.gif | Bin 806 -> 0 bytes .../tiny_mce/themes/simple/langs/en.js | 11 - .../themes/simple/skins/default/content.css | 25 - .../themes/simple/skins/default/ui.css | 32 - .../themes/simple/skins/o2k7/content.css | 17 - .../simple/skins/o2k7/img/button_bg.png | Bin 5102 -> 0 bytes .../tiny_mce/themes/simple/skins/o2k7/ui.css | 35 - www/javascript/tiny_mce/tiny_mce.js | 1 - www/javascript/tiny_mce/tiny_mce_popup.js | 5 - www/javascript/tiny_mce/tiny_mce_src.js | 16161 ---------------- .../tiny_mce/utils/editable_selects.js | 70 - www/javascript/tiny_mce/utils/form_utils.js | 210 - www/javascript/tiny_mce/utils/mctabs.js | 162 - www/javascript/tiny_mce/utils/validate.js | 252 - 269 files changed, 41587 deletions(-) delete mode 100644 www/javascript/tiny_mce/langs/en.js delete mode 100644 www/javascript/tiny_mce/license.txt delete mode 100644 www/javascript/tiny_mce/plugins/advhr/css/advhr.css delete mode 100644 www/javascript/tiny_mce/plugins/advhr/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/advhr/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/advhr/js/rule.js delete mode 100644 www/javascript/tiny_mce/plugins/advhr/langs/en_dlg.js delete mode 100644 www/javascript/tiny_mce/plugins/advhr/rule.htm delete mode 100644 www/javascript/tiny_mce/plugins/advimage/css/advimage.css delete mode 100644 www/javascript/tiny_mce/plugins/advimage/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/advimage/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/advimage/image.htm delete mode 100644 www/javascript/tiny_mce/plugins/advimage/img/sample.gif delete mode 100644 www/javascript/tiny_mce/plugins/advimage/js/image.js delete mode 100644 www/javascript/tiny_mce/plugins/advimage/langs/en_dlg.js delete mode 100644 www/javascript/tiny_mce/plugins/advimagescale/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/advlink/css/advlink.css delete mode 100644 www/javascript/tiny_mce/plugins/advlink/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/advlink/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/advlink/js/advlink.js delete mode 100644 www/javascript/tiny_mce/plugins/advlink/langs/en_dlg.js delete mode 100644 www/javascript/tiny_mce/plugins/advlink/link.htm delete mode 100644 www/javascript/tiny_mce/plugins/advlist/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/advlist/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/autolink/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/autolink/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/autoresize/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/autoresize/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/autosave/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/autosave/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/autosave/langs/en.js delete mode 100644 www/javascript/tiny_mce/plugins/bbcode/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/bbcode/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/contextmenu/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/contextmenu/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/directionality/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/directionality/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/emotions/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/emotions/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/emotions/emotions.htm delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-cool.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-cry.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-embarassed.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-frown.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-innocent.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-kiss.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-laughing.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-sealed.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-smile.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-surprised.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-undecided.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-wink.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/img/smiley-yell.gif delete mode 100644 www/javascript/tiny_mce/plugins/emotions/js/emotions.js delete mode 100644 www/javascript/tiny_mce/plugins/emotions/langs/en_dlg.js delete mode 100644 www/javascript/tiny_mce/plugins/example/dialog.htm delete mode 100644 www/javascript/tiny_mce/plugins/example/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/example/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/example/img/example.gif delete mode 100644 www/javascript/tiny_mce/plugins/example/js/dialog.js delete mode 100644 www/javascript/tiny_mce/plugins/example/langs/en.js delete mode 100644 www/javascript/tiny_mce/plugins/example/langs/en_dlg.js delete mode 100644 www/javascript/tiny_mce/plugins/example_dependency/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/example_dependency/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/fullpage/css/fullpage.css delete mode 100644 www/javascript/tiny_mce/plugins/fullpage/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/fullpage/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/fullpage/fullpage.htm delete mode 100644 www/javascript/tiny_mce/plugins/fullpage/js/fullpage.js delete mode 100644 www/javascript/tiny_mce/plugins/fullpage/langs/en_dlg.js delete mode 100644 www/javascript/tiny_mce/plugins/fullscreen/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/fullscreen/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/fullscreen/fullscreen.htm delete mode 100644 www/javascript/tiny_mce/plugins/iespell/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/iespell/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/inlinepopups/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/inlinepopups/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif delete mode 100644 www/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/button.gif delete mode 100644 www/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif delete mode 100644 www/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif delete mode 100644 www/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif delete mode 100644 www/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif delete mode 100644 www/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif delete mode 100644 www/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css delete mode 100644 www/javascript/tiny_mce/plugins/inlinepopups/template.htm delete mode 100644 www/javascript/tiny_mce/plugins/insertdatetime/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/insertdatetime/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/layer/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/layer/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/legacyoutput/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/legacyoutput/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/lists/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/lists/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/media/css/content.css delete mode 100644 www/javascript/tiny_mce/plugins/media/css/media.css delete mode 100644 www/javascript/tiny_mce/plugins/media/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/media/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/media/img/flash.gif delete mode 100644 www/javascript/tiny_mce/plugins/media/img/flv_player.swf delete mode 100644 www/javascript/tiny_mce/plugins/media/img/quicktime.gif delete mode 100644 www/javascript/tiny_mce/plugins/media/img/realmedia.gif delete mode 100644 www/javascript/tiny_mce/plugins/media/img/shockwave.gif delete mode 100644 www/javascript/tiny_mce/plugins/media/img/trans.gif delete mode 100644 www/javascript/tiny_mce/plugins/media/img/windowsmedia.gif delete mode 100644 www/javascript/tiny_mce/plugins/media/js/embed.js delete mode 100644 www/javascript/tiny_mce/plugins/media/js/media.js delete mode 100644 www/javascript/tiny_mce/plugins/media/langs/en_dlg.js delete mode 100644 www/javascript/tiny_mce/plugins/media/media.htm delete mode 100644 www/javascript/tiny_mce/plugins/media/moxieplayer.swf delete mode 100644 www/javascript/tiny_mce/plugins/nonbreaking/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/nonbreaking/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/noneditable/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/noneditable/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/pagebreak/css/content.css delete mode 100644 www/javascript/tiny_mce/plugins/pagebreak/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/pagebreak/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/pagebreak/img/pagebreak.gif delete mode 100644 www/javascript/tiny_mce/plugins/pagebreak/img/trans.gif delete mode 100644 www/javascript/tiny_mce/plugins/paste/blank.htm delete mode 100644 www/javascript/tiny_mce/plugins/paste/css/blank.css delete mode 100644 www/javascript/tiny_mce/plugins/paste/css/pasteword.css delete mode 100644 www/javascript/tiny_mce/plugins/paste/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/paste/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/paste/js/pastetext.js delete mode 100644 www/javascript/tiny_mce/plugins/paste/js/pasteword.js delete mode 100644 www/javascript/tiny_mce/plugins/paste/langs/en_dlg.js delete mode 100644 www/javascript/tiny_mce/plugins/paste/pastetext.htm delete mode 100644 www/javascript/tiny_mce/plugins/paste/pasteword.htm delete mode 100644 www/javascript/tiny_mce/plugins/preview/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/preview/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/preview/example.html delete mode 100644 www/javascript/tiny_mce/plugins/preview/jscripts/embed.js delete mode 100644 www/javascript/tiny_mce/plugins/preview/preview.html delete mode 100644 www/javascript/tiny_mce/plugins/print/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/print/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/safari/blank.htm delete mode 100644 www/javascript/tiny_mce/plugins/safari/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/safari/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/save/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/save/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/searchreplace/css/searchreplace.css delete mode 100644 www/javascript/tiny_mce/plugins/searchreplace/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/searchreplace/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/searchreplace/js/searchreplace.js delete mode 100644 www/javascript/tiny_mce/plugins/searchreplace/langs/en_dlg.js delete mode 100644 www/javascript/tiny_mce/plugins/searchreplace/searchreplace.htm delete mode 100644 www/javascript/tiny_mce/plugins/spellchecker/css/content.css delete mode 100644 www/javascript/tiny_mce/plugins/spellchecker/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/spellchecker/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/spellchecker/img/wline.gif delete mode 100644 www/javascript/tiny_mce/plugins/style/css/props.css delete mode 100644 www/javascript/tiny_mce/plugins/style/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/style/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/style/js/props.js delete mode 100644 www/javascript/tiny_mce/plugins/style/langs/en_dlg.js delete mode 100644 www/javascript/tiny_mce/plugins/style/props.htm delete mode 100644 www/javascript/tiny_mce/plugins/tabfocus/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/tabfocus/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/table/cell.htm delete mode 100644 www/javascript/tiny_mce/plugins/table/css/cell.css delete mode 100644 www/javascript/tiny_mce/plugins/table/css/row.css delete mode 100644 www/javascript/tiny_mce/plugins/table/css/table.css delete mode 100644 www/javascript/tiny_mce/plugins/table/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/table/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/table/js/cell.js delete mode 100644 www/javascript/tiny_mce/plugins/table/js/merge_cells.js delete mode 100644 www/javascript/tiny_mce/plugins/table/js/row.js delete mode 100644 www/javascript/tiny_mce/plugins/table/js/table.js delete mode 100644 www/javascript/tiny_mce/plugins/table/langs/en_dlg.js delete mode 100644 www/javascript/tiny_mce/plugins/table/merge_cells.htm delete mode 100644 www/javascript/tiny_mce/plugins/table/row.htm delete mode 100644 www/javascript/tiny_mce/plugins/table/table.htm delete mode 100644 www/javascript/tiny_mce/plugins/template/blank.htm delete mode 100644 www/javascript/tiny_mce/plugins/template/css/template.css delete mode 100644 www/javascript/tiny_mce/plugins/template/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/template/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/template/js/template.js delete mode 100644 www/javascript/tiny_mce/plugins/template/langs/en_dlg.js delete mode 100644 www/javascript/tiny_mce/plugins/template/template.htm delete mode 100644 www/javascript/tiny_mce/plugins/visualchars/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/visualchars/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/wordcount/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/wordcount/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/abbr.htm delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/acronym.htm delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/attributes.htm delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/cite.htm delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/css/attributes.css delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/css/popup.css delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/del.htm delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/editor_plugin.js delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/ins.htm delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/js/abbr.js delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/js/acronym.js delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/js/attributes.js delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/js/cite.js delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/js/del.js delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/js/element_common.js delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/js/ins.js delete mode 100644 www/javascript/tiny_mce/plugins/xhtmlxtras/langs/en_dlg.js delete mode 100644 www/javascript/tiny_mce/themes/advanced/about.htm delete mode 100644 www/javascript/tiny_mce/themes/advanced/anchor.htm delete mode 100644 www/javascript/tiny_mce/themes/advanced/charmap.htm delete mode 100644 www/javascript/tiny_mce/themes/advanced/color_picker.htm delete mode 100644 www/javascript/tiny_mce/themes/advanced/editor_template.js delete mode 100644 www/javascript/tiny_mce/themes/advanced/editor_template_src.js delete mode 100644 www/javascript/tiny_mce/themes/advanced/image.htm delete mode 100644 www/javascript/tiny_mce/themes/advanced/img/colorpicker.jpg delete mode 100644 www/javascript/tiny_mce/themes/advanced/img/iframe.gif delete mode 100644 www/javascript/tiny_mce/themes/advanced/img/pagebreak.gif delete mode 100644 www/javascript/tiny_mce/themes/advanced/img/quicktime.gif delete mode 100644 www/javascript/tiny_mce/themes/advanced/img/realmedia.gif delete mode 100644 www/javascript/tiny_mce/themes/advanced/img/shockwave.gif delete mode 100644 www/javascript/tiny_mce/themes/advanced/img/trans.gif delete mode 100644 www/javascript/tiny_mce/themes/advanced/img/video.gif delete mode 100644 www/javascript/tiny_mce/themes/advanced/img/windowsmedia.gif delete mode 100644 www/javascript/tiny_mce/themes/advanced/js/about.js delete mode 100644 www/javascript/tiny_mce/themes/advanced/js/anchor.js delete mode 100644 www/javascript/tiny_mce/themes/advanced/js/charmap.js delete mode 100644 www/javascript/tiny_mce/themes/advanced/js/color_picker.js delete mode 100644 www/javascript/tiny_mce/themes/advanced/js/image.js delete mode 100644 www/javascript/tiny_mce/themes/advanced/js/link.js delete mode 100644 www/javascript/tiny_mce/themes/advanced/js/source_editor.js delete mode 100644 www/javascript/tiny_mce/themes/advanced/langs/en.js delete mode 100644 www/javascript/tiny_mce/themes/advanced/langs/en_dlg.js delete mode 100644 www/javascript/tiny_mce/themes/advanced/link.htm delete mode 100644 www/javascript/tiny_mce/themes/advanced/shortcuts.htm delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/default/content.css delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/default/dialog.css delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/default/img/buttons.png delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/default/img/items.gif delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/default/img/menu_check.gif delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/default/img/progress.gif delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/default/img/tabs.gif delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/default/ui.css delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/highcontrast/content.css delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/highcontrast/dialog.css delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/highcontrast/ui.css delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/o2k7/content.css delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/o2k7/dialog.css delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/o2k7/ui.css delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/o2k7/ui_black.css delete mode 100644 www/javascript/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css delete mode 100644 www/javascript/tiny_mce/themes/advanced/source_editor.htm delete mode 100644 www/javascript/tiny_mce/themes/simple/editor_template.js delete mode 100644 www/javascript/tiny_mce/themes/simple/editor_template_src.js delete mode 100644 www/javascript/tiny_mce/themes/simple/img/icons.gif delete mode 100644 www/javascript/tiny_mce/themes/simple/langs/en.js delete mode 100644 www/javascript/tiny_mce/themes/simple/skins/default/content.css delete mode 100644 www/javascript/tiny_mce/themes/simple/skins/default/ui.css delete mode 100644 www/javascript/tiny_mce/themes/simple/skins/o2k7/content.css delete mode 100644 www/javascript/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png delete mode 100644 www/javascript/tiny_mce/themes/simple/skins/o2k7/ui.css delete mode 100644 www/javascript/tiny_mce/tiny_mce.js delete mode 100644 www/javascript/tiny_mce/tiny_mce_popup.js delete mode 100644 www/javascript/tiny_mce/tiny_mce_src.js delete mode 100644 www/javascript/tiny_mce/utils/editable_selects.js delete mode 100644 www/javascript/tiny_mce/utils/form_utils.js delete mode 100644 www/javascript/tiny_mce/utils/mctabs.js delete mode 100644 www/javascript/tiny_mce/utils/validate.js diff --git a/www/javascript/tiny_mce/langs/en.js b/www/javascript/tiny_mce/langs/en.js deleted file mode 100644 index 8a80d46b1..000000000 --- a/www/javascript/tiny_mce/langs/en.js +++ /dev/null @@ -1,223 +0,0 @@ -tinyMCE.addI18n({en:{ -common:{ -edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", -apply:"Apply", -insert:"Insert", -update:"Update", -cancel:"Cancel", -close:"Close", -browse:"Browse", -class_name:"Class", -not_set:"-- Not set --", -clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", -clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", -popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", -invalid_data:"{#field} is invalid", -invalid_data_number:"{#field} must be a number", -invalid_data_min:"{#field} must be a number greater than {#min}", -invalid_data_size:"{#field} must be a number or percentage", -more_colors:"More colors" -}, -colors:{ -'000000':'Black', -'993300':'Burnt orange', -'333300':'Dark olive', -'003300':'Dark green', -'003366':'Dark azure', -'000080':'Navy Blue', -'333399':'Indigo', -'333333':'Very dark gray', -'800000':'Maroon', -'FF6600':'Orange', -'808000':'Olive', -'008000':'Green', -'008080':'Teal', -'0000FF':'Blue', -'666699':'Grayish blue', -'808080':'Gray', -'FF0000':'Red', -'FF9900':'Amber', -'99CC00':'Yellow green', -'339966':'Sea green', -'33CCCC':'Turquoise', -'3366FF':'Royal blue', -'800080':'Purple', -'999999':'Medium gray', -'FF00FF':'Magenta', -'FFCC00':'Gold', -'FFFF00':'Yellow', -'00FF00':'Lime', -'00FFFF':'Aqua', -'00CCFF':'Sky blue', -'993366':'Brown', -'C0C0C0':'Silver', -'FF99CC':'Pink', -'FFCC99':'Peach', -'FFFF99':'Light yellow', -'CCFFCC':'Pale green', -'CCFFFF':'Pale cyan', -'99CCFF':'Light sky blue', -'CC99FF':'Plum', -'FFFFFF':'White' -}, -contextmenu:{ -align:"Alignment", -left:"Left", -center:"Center", -right:"Right", -full:"Full" -}, -insertdatetime:{ -date_fmt:"%Y-%m-%d", -time_fmt:"%H:%M:%S", -insertdate_desc:"Insert date", -inserttime_desc:"Insert time", -months_long:"January,February,March,April,May,June,July,August,September,October,November,December", -months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", -day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", -day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" -}, -print:{ -print_desc:"Print" -}, -preview:{ -preview_desc:"Preview" -}, -directionality:{ -ltr_desc:"Direction left to right", -rtl_desc:"Direction right to left" -}, -layer:{ -insertlayer_desc:"Insert new layer", -forward_desc:"Move forward", -backward_desc:"Move backward", -absolute_desc:"Toggle absolute positioning", -content:"New layer..." -}, -save:{ -save_desc:"Save", -cancel_desc:"Cancel all changes" -}, -nonbreaking:{ -nonbreaking_desc:"Insert non-breaking space character" -}, -iespell:{ -iespell_desc:"Run spell checking", -download:"ieSpell not detected. Do you want to install it now?" -}, -advhr:{ -advhr_desc:"Horizontal rule" -}, -emotions:{ -emotions_desc:"Emotions" -}, -searchreplace:{ -search_desc:"Find", -replace_desc:"Find/Replace" -}, -advimage:{ -image_desc:"Insert/edit image" -}, -advlink:{ -link_desc:"Insert/edit link" -}, -xhtmlxtras:{ -cite_desc:"Citation", -abbr_desc:"Abbreviation", -acronym_desc:"Acronym", -del_desc:"Deletion", -ins_desc:"Insertion", -attribs_desc:"Insert/Edit Attributes" -}, -style:{ -desc:"Edit CSS Style" -}, -paste:{ -paste_text_desc:"Paste as Plain Text", -paste_word_desc:"Paste from Word", -selectall_desc:"Select All", -plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.", -plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode." -}, -paste_dlg:{ -text_title:"Use CTRL+V on your keyboard to paste the text into the window.", -text_linebreaks:"Keep linebreaks", -word_title:"Use CTRL+V on your keyboard to paste the text into the window." -}, -table:{ -desc:"Inserts a new table", -row_before_desc:"Insert row before", -row_after_desc:"Insert row after", -delete_row_desc:"Delete row", -col_before_desc:"Insert column before", -col_after_desc:"Insert column after", -delete_col_desc:"Remove column", -split_cells_desc:"Split merged table cells", -merge_cells_desc:"Merge table cells", -row_desc:"Table row properties", -cell_desc:"Table cell properties", -props_desc:"Table properties", -paste_row_before_desc:"Paste table row before", -paste_row_after_desc:"Paste table row after", -cut_row_desc:"Cut table row", -copy_row_desc:"Copy table row", -del:"Delete table", -row:"Row", -col:"Column", -cell:"Cell" -}, -autosave:{ -unload_msg:"The changes you made will be lost if you navigate away from this page.", -restore_content:"Restore auto-saved content.", -warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?." -}, -fullscreen:{ -desc:"Toggle fullscreen mode" -}, -media:{ -desc:"Insert / edit embedded media", -edit:"Edit embedded media" -}, -fullpage:{ -desc:"Document properties" -}, -template:{ -desc:"Insert predefined template content" -}, -visualchars:{ -desc:"Visual control characters on/off." -}, -spellchecker:{ -desc:"Toggle spellchecker", -menu:"Spellchecker settings", -ignore_word:"Ignore word", -ignore_words:"Ignore all", -langs:"Languages", -wait:"Please wait...", -sug:"Suggestions", -no_sug:"No suggestions", -no_mpell:"No misspellings found.", -learn_word:"Learn word" -}, -pagebreak:{ -desc:"Insert page break." -}, -advlist:{ -types:"Types", -def:"Default", -lower_alpha:"Lower alpha", -lower_greek:"Lower greek", -lower_roman:"Lower roman", -upper_alpha:"Upper alpha", -upper_roman:"Upper roman", -circle:"Circle", -disc:"Disc", -square:"Square" -}, -aria:{ -rich_text_area:"Rich Text Area" -}, -wordcount:{ -words: 'Words: ' -} -}}); \ No newline at end of file diff --git a/www/javascript/tiny_mce/license.txt b/www/javascript/tiny_mce/license.txt deleted file mode 100644 index 60d6d4c8f..000000000 --- a/www/javascript/tiny_mce/license.txt +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/www/javascript/tiny_mce/plugins/advhr/css/advhr.css b/www/javascript/tiny_mce/plugins/advhr/css/advhr.css deleted file mode 100644 index 0e2283498..000000000 --- a/www/javascript/tiny_mce/plugins/advhr/css/advhr.css +++ /dev/null @@ -1,5 +0,0 @@ -input.radio {border:1px none #000; background:transparent; vertical-align:middle;} -.panel_wrapper div.current {height:80px;} -#width {width:50px; vertical-align:middle;} -#width2 {width:50px; vertical-align:middle;} -#size {width:100px;} diff --git a/www/javascript/tiny_mce/plugins/advhr/editor_plugin.js b/www/javascript/tiny_mce/plugins/advhr/editor_plugin.js deleted file mode 100644 index 4d3b062de..000000000 --- a/www/javascript/tiny_mce/plugins/advhr/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AdvancedHRPlugin",{init:function(a,b){a.addCommand("mceAdvancedHr",function(){a.windowManager.open({file:b+"/rule.htm",width:250+parseInt(a.getLang("advhr.delta_width",0)),height:160+parseInt(a.getLang("advhr.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("advhr",{title:"advhr.advhr_desc",cmd:"mceAdvancedHr"});a.onNodeChange.add(function(d,c,e){c.setActive("advhr",e.nodeName=="HR")});a.onClick.add(function(c,d){d=d.target;if(d.nodeName==="HR"){c.selection.select(d)}})},getInfo:function(){return{longname:"Advanced HR",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advhr",tinymce.plugins.AdvancedHRPlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/advhr/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/advhr/editor_plugin_src.js deleted file mode 100644 index 0c652d330..000000000 --- a/www/javascript/tiny_mce/plugins/advhr/editor_plugin_src.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.AdvancedHRPlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceAdvancedHr', function() { - ed.windowManager.open({ - file : url + '/rule.htm', - width : 250 + parseInt(ed.getLang('advhr.delta_width', 0)), - height : 160 + parseInt(ed.getLang('advhr.delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('advhr', { - title : 'advhr.advhr_desc', - cmd : 'mceAdvancedHr' - }); - - ed.onNodeChange.add(function(ed, cm, n) { - cm.setActive('advhr', n.nodeName == 'HR'); - }); - - ed.onClick.add(function(ed, e) { - e = e.target; - - if (e.nodeName === 'HR') - ed.selection.select(e); - }); - }, - - getInfo : function() { - return { - longname : 'Advanced HR', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advhr', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('advhr', tinymce.plugins.AdvancedHRPlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/advhr/js/rule.js b/www/javascript/tiny_mce/plugins/advhr/js/rule.js deleted file mode 100644 index b6cbd66c7..000000000 --- a/www/javascript/tiny_mce/plugins/advhr/js/rule.js +++ /dev/null @@ -1,43 +0,0 @@ -var AdvHRDialog = { - init : function(ed) { - var dom = ed.dom, f = document.forms[0], n = ed.selection.getNode(), w; - - w = dom.getAttrib(n, 'width'); - f.width.value = w ? parseInt(w) : (dom.getStyle('width') || ''); - f.size.value = dom.getAttrib(n, 'size') || parseInt(dom.getStyle('height')) || ''; - f.noshade.checked = !!dom.getAttrib(n, 'noshade') || !!dom.getStyle('border-width'); - selectByValue(f, 'width2', w.indexOf('%') != -1 ? '%' : 'px'); - }, - - update : function() { - var ed = tinyMCEPopup.editor, h, f = document.forms[0], st = ''; - - h = ' - - - {#advhr.advhr_desc} - - - - - - - -
- - -
-
- - - - - - - - - - - - - -
- - - -
-
-
- -
- - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/advimage/css/advimage.css b/www/javascript/tiny_mce/plugins/advimage/css/advimage.css deleted file mode 100644 index 0a6251a69..000000000 --- a/www/javascript/tiny_mce/plugins/advimage/css/advimage.css +++ /dev/null @@ -1,13 +0,0 @@ -#src_list, #over_list, #out_list {width:280px;} -.mceActionPanel {margin-top:7px;} -.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;} -.checkbox {border:0;} -.panel_wrapper div.current {height:305px;} -#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;} -#align, #classlist {width:150px;} -#width, #height {vertical-align:middle; width:50px; text-align:center;} -#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;} -#class_list {width:180px;} -input {width: 280px;} -#constrain, #onmousemovecheck {width:auto;} -#id, #dir, #lang, #usemap, #longdesc {width:200px;} diff --git a/www/javascript/tiny_mce/plugins/advimage/editor_plugin.js b/www/javascript/tiny_mce/plugins/advimage/editor_plugin.js deleted file mode 100644 index d613a6139..000000000 --- a/www/javascript/tiny_mce/plugins/advimage/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class","").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/advimage/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/advimage/editor_plugin_src.js deleted file mode 100644 index d2678cbcf..000000000 --- a/www/javascript/tiny_mce/plugins/advimage/editor_plugin_src.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.AdvancedImagePlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceAdvImage', function() { - // Internal image object like a flash placeholder - if (ed.dom.getAttrib(ed.selection.getNode(), 'class', '').indexOf('mceItem') != -1) - return; - - ed.windowManager.open({ - file : url + '/image.htm', - width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)), - height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('image', { - title : 'advimage.image_desc', - cmd : 'mceAdvImage' - }); - }, - - getInfo : function() { - return { - longname : 'Advanced image', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/advimage/image.htm b/www/javascript/tiny_mce/plugins/advimage/image.htm deleted file mode 100644 index ed16b3d4a..000000000 --- a/www/javascript/tiny_mce/plugins/advimage/image.htm +++ /dev/null @@ -1,235 +0,0 @@ - - - - {#advimage_dlg.dialog_title} - - - - - - - - - - -
- - -
-
-
- {#advimage_dlg.general} - - - - - - - - - - - - - - - - - - - -
- -
- {#advimage_dlg.preview} - -
-
- -
-
- {#advimage_dlg.tab_appearance} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- {#advimage_dlg.example_img} - Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam - nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum - edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam - erat volutpat. -
-
- - x - - px -
  - - - - -
-
-
-
- -
-
- {#advimage_dlg.swap_image} - - - - - - - - - - - - - - - - - - - - - -
- - - - -
 
- - - - -
 
-
- -
- {#advimage_dlg.misc} - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- - - - -
 
-
-
-
- -
- - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/advimage/img/sample.gif b/www/javascript/tiny_mce/plugins/advimage/img/sample.gif deleted file mode 100644 index 53bf6890b507741c10910c9e2217ad8247b98e8d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1624 zcmV-e2B-N)Nk%w1VJ!eH0OkMy|NsB}{r&v>{Q3F$`1ttq^YifV@ayaA>FMd_=H}w! z;^5%m-rnBb-QC>W+}qpR+S=OL+1c3G*w@$B*4Eb4)YQ|{)zHw=&d$%x&CScp%gV~i z$;rvc$jHXV#>B+L!^6YE!otD9!N9=4zrVk|y}i7=yt})*y1Kf#xw*Hux3;#nwY9ah zw6wFcv$C?Xv9YnRu&}SMudc4Ht*x!BtgNf6tE#H1si~={sjjD|r>3T+rKP2$q@<&x zqobp!qN1Xqp`oFnrJ$goprE6lpP!zdp`MSWoSd7Ro12@UnwpxLnw^=MnV6WE zmzS58mX?*3mz9;3mX?*2l$4W`lai8@l9G~eg|M^H&l zLpBo?51@vfgB2q_TVh*dNP<;cR$Wg!vYsMHR!qvvOis>GNH`+ zJ3B|tqgANiBSy@x>Q#;x7+DuU7&rwlf#S04)VZvA$XoUy8Y&f7)SqP<}Lw@L# zA(@Cohl`6CZyedUu^BlmK|DG5$Kl2f8z@uCc)^k-3m7$G!njf7$;XhOW>^`rV#UFh zEN#eG;bP?tCs>{+)q)ceg9$aDAaTZ{MGK5rU8ty$qz8){MT#gHGX{#XEJHLonBXFa zj+#9GE&^pq!`qG`K5iiC!gq}sRY|1yD8?j++_^oR0g+)NNtZN`)08!0q=}AA4HhIo zFaa9NYu8%97=oos5f?O`lwre~4VfoIei+FyK|urxj@C(-q(sS(!$5uL3j&jg7&XY% zlr17;3GGL;2K8>CB87G97;W(2VZ((D+3Hz;L;bylfhf(kFNV8at)h;hdM z85WX(#*Hq@@BYePt3t_l{ zCL3|YVWydA0Fz{rTl65n00)c^)^-jJn1c zRVXtA6mkUMEDLU|v7{JK&_IJ2ciiCy7BOT1fdUBh8b=yrbYaCAchCU_7?H`b1`}4q zLB|_mI2!;7W4QCq6F1O+MW||6AwmKafUrReUA&QotxQZI8D$G)AuSVV@X<&A9v;~H zKnWjo&;bljq=29aCeV-t5GBYkL=Q}q(S~FLd2t39MyRmC%_GFHkPc7CfIt8P*emqV z0YK2j9A+kmW^!tn(ZmG+L=6DZR99W}8p9?Utr=#t@rE2=zxf3QQ(JBJ&<{Z2>8EUP zeX1B)2w_3gXV)D-0Tt+=#@cV-0f!PU#MglZ3m6b}0e08zK^x;9(u?Tga{%?&nNTXhcEuM_#J>yL>p*a zuZJ2pliCGSp!Ye8>YFq@)ZOW-uT~OrjFQK!)UyVGFt7ni'); - }, - - init : function(ed) { - var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode(), fl = tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList'); - - tinyMCEPopup.resizeToInnerSize(); - this.fillClassList('class_list'); - this.fillFileList('src_list', fl); - this.fillFileList('over_list', fl); - this.fillFileList('out_list', fl); - TinyMCE_EditableSelects.init(); - - if (n.nodeName == 'IMG') { - nl.src.value = dom.getAttrib(n, 'src'); - nl.width.value = dom.getAttrib(n, 'width'); - nl.height.value = dom.getAttrib(n, 'height'); - nl.alt.value = dom.getAttrib(n, 'alt'); - nl.title.value = dom.getAttrib(n, 'title'); - nl.vspace.value = this.getAttrib(n, 'vspace'); - nl.hspace.value = this.getAttrib(n, 'hspace'); - nl.border.value = this.getAttrib(n, 'border'); - selectByValue(f, 'align', this.getAttrib(n, 'align')); - selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true); - nl.style.value = dom.getAttrib(n, 'style'); - nl.id.value = dom.getAttrib(n, 'id'); - nl.dir.value = dom.getAttrib(n, 'dir'); - nl.lang.value = dom.getAttrib(n, 'lang'); - nl.usemap.value = dom.getAttrib(n, 'usemap'); - nl.longdesc.value = dom.getAttrib(n, 'longdesc'); - nl.insert.value = ed.getLang('update'); - - if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover'))) - nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); - - if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout'))) - nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1'); - - if (ed.settings.inline_styles) { - // Move attribs to styles - if (dom.getAttrib(n, 'align')) - this.updateStyle('align'); - - if (dom.getAttrib(n, 'hspace')) - this.updateStyle('hspace'); - - if (dom.getAttrib(n, 'border')) - this.updateStyle('border'); - - if (dom.getAttrib(n, 'vspace')) - this.updateStyle('vspace'); - } - } - - // Setup browse button - document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); - if (isVisible('srcbrowser')) - document.getElementById('src').style.width = '260px'; - - // Setup browse button - document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image'); - if (isVisible('overbrowser')) - document.getElementById('onmouseoversrc').style.width = '260px'; - - // Setup browse button - document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image'); - if (isVisible('outbrowser')) - document.getElementById('onmouseoutsrc').style.width = '260px'; - - // If option enabled default contrain proportions to checked - if (ed.getParam("advimage_constrain_proportions", true)) - f.constrain.checked = true; - - // Check swap image if valid data - if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value) - this.setSwapImage(true); - else - this.setSwapImage(false); - - this.changeAppearance(); - this.showPreviewImage(nl.src.value, 1); - }, - - insert : function(file, title) { - var ed = tinyMCEPopup.editor, t = this, f = document.forms[0]; - - if (f.src.value === '') { - if (ed.selection.getNode().nodeName == 'IMG') { - ed.dom.remove(ed.selection.getNode()); - ed.execCommand('mceRepaint'); - } - - tinyMCEPopup.close(); - return; - } - - if (tinyMCEPopup.getParam("accessibility_warnings", 1)) { - if (!f.alt.value) { - tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) { - if (s) - t.insertAndClose(); - }); - - return; - } - } - - t.insertAndClose(); - }, - - insertAndClose : function() { - var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el; - - tinyMCEPopup.restoreSelection(); - - // Fixes crash in Safari - if (tinymce.isWebKit) - ed.getWin().focus(); - - if (!ed.settings.inline_styles) { - args = { - vspace : nl.vspace.value, - hspace : nl.hspace.value, - border : nl.border.value, - align : getSelectValue(f, 'align') - }; - } else { - // Remove deprecated values - args = { - vspace : '', - hspace : '', - border : '', - align : '' - }; - } - - tinymce.extend(args, { - src : nl.src.value.replace(/ /g, '%20'), - width : nl.width.value, - height : nl.height.value, - alt : nl.alt.value, - title : nl.title.value, - 'class' : getSelectValue(f, 'class_list'), - style : nl.style.value, - id : nl.id.value, - dir : nl.dir.value, - lang : nl.lang.value, - usemap : nl.usemap.value, - longdesc : nl.longdesc.value - }); - - args.onmouseover = args.onmouseout = ''; - - if (f.onmousemovecheck.checked) { - if (nl.onmouseoversrc.value) - args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';"; - - if (nl.onmouseoutsrc.value) - args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';"; - } - - el = ed.selection.getNode(); - - if (el && el.nodeName == 'IMG') { - ed.dom.setAttribs(el, args); - } else { - ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); - ed.dom.setAttribs('__mce_tmp', args); - ed.dom.setAttrib('__mce_tmp', 'id', ''); - ed.undoManager.add(); - } - - tinyMCEPopup.editor.execCommand('mceRepaint'); - tinyMCEPopup.editor.focus(); - tinyMCEPopup.close(); - }, - - getAttrib : function(e, at) { - var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; - - if (ed.settings.inline_styles) { - switch (at) { - case 'align': - if (v = dom.getStyle(e, 'float')) - return v; - - if (v = dom.getStyle(e, 'vertical-align')) - return v; - - break; - - case 'hspace': - v = dom.getStyle(e, 'margin-left') - v2 = dom.getStyle(e, 'margin-right'); - - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'vspace': - v = dom.getStyle(e, 'margin-top') - v2 = dom.getStyle(e, 'margin-bottom'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'border': - v = 0; - - tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { - sv = dom.getStyle(e, 'border-' + sv + '-width'); - - // False or not the same as prev - if (!sv || (sv != v && v !== 0)) { - v = 0; - return false; - } - - if (sv) - v = sv; - }); - - if (v) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - } - } - - if (v = dom.getAttrib(e, at)) - return v; - - return ''; - }, - - setSwapImage : function(st) { - var f = document.forms[0]; - - f.onmousemovecheck.checked = st; - setBrowserDisabled('overbrowser', !st); - setBrowserDisabled('outbrowser', !st); - - if (f.over_list) - f.over_list.disabled = !st; - - if (f.out_list) - f.out_list.disabled = !st; - - f.onmouseoversrc.disabled = !st; - f.onmouseoutsrc.disabled = !st; - }, - - fillClassList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { - cl = []; - - tinymce.each(v.split(';'), function(v) { - var p = v.split('='); - - cl.push({'title' : p[0], 'class' : p[1]}); - }); - } else - cl = tinyMCEPopup.editor.dom.getClasses(); - - if (cl.length > 0) { - lst.options.length = 0; - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - - tinymce.each(cl, function(o) { - lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = typeof(l) === 'function' ? l() : window[l]; - lst.options.length = 0; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - resetImageData : function() { - var f = document.forms[0]; - - f.elements.width.value = f.elements.height.value = ''; - }, - - updateImageData : function(img, st) { - var f = document.forms[0]; - - if (!st) { - f.elements.width.value = img.width; - f.elements.height.value = img.height; - } - - this.preloadImg = img; - }, - - changeAppearance : function() { - var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg'); - - if (img) { - if (ed.getParam('inline_styles')) { - ed.dom.setAttrib(img, 'style', f.style.value); - } else { - img.align = f.align.value; - img.border = f.border.value; - img.hspace = f.hspace.value; - img.vspace = f.vspace.value; - } - } - }, - - changeHeight : function() { - var f = document.forms[0], tp, t = this; - - if (!f.constrain.checked || !t.preloadImg) { - return; - } - - if (f.width.value == "" || f.height.value == "") - return; - - tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height; - f.height.value = tp.toFixed(0); - }, - - changeWidth : function() { - var f = document.forms[0], tp, t = this; - - if (!f.constrain.checked || !t.preloadImg) { - return; - } - - if (f.width.value == "" || f.height.value == "") - return; - - tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width; - f.width.value = tp.toFixed(0); - }, - - updateStyle : function(ty) { - var dom = tinyMCEPopup.dom, b, bStyle, bColor, v, isIE = tinymce.isIE, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value}); - - if (tinyMCEPopup.editor.settings.inline_styles) { - // Handle align - if (ty == 'align') { - dom.setStyle(img, 'float', ''); - dom.setStyle(img, 'vertical-align', ''); - - v = getSelectValue(f, 'align'); - if (v) { - if (v == 'left' || v == 'right') - dom.setStyle(img, 'float', v); - else - img.style.verticalAlign = v; - } - } - - // Handle border - if (ty == 'border') { - b = img.style.border ? img.style.border.split(' ') : []; - bStyle = dom.getStyle(img, 'border-style'); - bColor = dom.getStyle(img, 'border-color'); - - dom.setStyle(img, 'border', ''); - - v = f.border.value; - if (v || v == '0') { - if (v == '0') - img.style.border = isIE ? '0' : '0 none none'; - else { - if (b.length == 3 && b[isIE ? 2 : 1]) - bStyle = b[isIE ? 2 : 1]; - else if (!bStyle || bStyle == 'none') - bStyle = 'solid'; - if (b.length == 3 && b[isIE ? 0 : 2]) - bColor = b[isIE ? 0 : 2]; - else if (!bColor || bColor == 'none') - bColor = 'black'; - img.style.border = v + 'px ' + bStyle + ' ' + bColor; - } - } - } - - // Handle hspace - if (ty == 'hspace') { - dom.setStyle(img, 'marginLeft', ''); - dom.setStyle(img, 'marginRight', ''); - - v = f.hspace.value; - if (v) { - img.style.marginLeft = v + 'px'; - img.style.marginRight = v + 'px'; - } - } - - // Handle vspace - if (ty == 'vspace') { - dom.setStyle(img, 'marginTop', ''); - dom.setStyle(img, 'marginBottom', ''); - - v = f.vspace.value; - if (v) { - img.style.marginTop = v + 'px'; - img.style.marginBottom = v + 'px'; - } - } - - // Merge - dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText), 'img'); - } - }, - - changeMouseMove : function() { - }, - - showPreviewImage : function(u, st) { - if (!u) { - tinyMCEPopup.dom.setHTML('prev', ''); - return; - } - - if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true)) - this.resetImageData(); - - u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u); - - if (!st) - tinyMCEPopup.dom.setHTML('prev', ''); - else - tinyMCEPopup.dom.setHTML('prev', ''); - } -}; - -ImageDialog.preInit(); -tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/www/javascript/tiny_mce/plugins/advimage/langs/en_dlg.js b/www/javascript/tiny_mce/plugins/advimage/langs/en_dlg.js deleted file mode 100644 index d8f11e030..000000000 --- a/www/javascript/tiny_mce/plugins/advimage/langs/en_dlg.js +++ /dev/null @@ -1,45 +0,0 @@ -tinyMCE.addI18n('en.advimage_dlg',{ -tab_general:"General", -tab_appearance:"Appearance", -tab_advanced:"Advanced", -general:"General", -title:"Title", -preview:"Preview", -constrain_proportions:"Constrain proportions", -langdir:"Language direction", -langcode:"Language code", -long_desc:"Long description link", -style:"Style", -classes:"Classes", -ltr:"Left to right", -rtl:"Right to left", -id:"Id", -map:"Image map", -swap_image:"Swap image", -alt_image:"Alternative image", -mouseover:"for mouse over", -mouseout:"for mouse out", -misc:"Miscellaneous", -example_img:"Appearance preview image", -missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.", -dialog_title:"Insert/edit image", -src:"Image URL", -alt:"Image description", -list:"Image list", -border:"Border", -dimensions:"Dimensions", -width:"Width", -height:"Height", -vspace:"Vertical space", -hspace:"Horizontal space", -align:"Alignment", -align_baseline:"Baseline", -align_top:"Top", -align_middle:"Middle", -align_bottom:"Bottom", -align_texttop:"Text top", -align_textbottom:"Text bottom", -align_left:"Left", -align_right:"Right", -image_list:"Image list" -}); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/advimagescale/editor_plugin.js b/www/javascript/tiny_mce/plugins/advimagescale/editor_plugin.js deleted file mode 100644 index 9237b6b2c..000000000 --- a/www/javascript/tiny_mce/plugins/advimagescale/editor_plugin.js +++ /dev/null @@ -1,454 +0,0 @@ -/** - * TinyMCE Advanced Image Resize Helper Plugin - * - * Forces images to maintain aspect ratio while scaling - also optionally enforces - * min/max image dimensions, and appends width/height to the image URL for server-side - * resizing - * - * @author Marc Hodgins - * @link http://www.hodginsmedia.com Hodgins Media Ventures Inc. - * @copyright Copyright (C) 2008 Hodgins Media Ventures Inc., All right reserved. - * @license http://www.opensource.org/licenses/lgpl-3.0.html LGPLv3 - */ -(function() { - - /** - * Stores pre-resize image dimensions - * @var {array} (w,h) - */ - var originalDimensions = new Array(); - - /** - * Stores last dimensions before a resize - * @var {array} (w,h) - */ - var lastDimensions = new Array(); - - /** - * Track mousedown status in editor - * @var {boolean} - */ - var edMouseDown = false; - - tinymce.create('tinymce.plugins.AdvImageScale', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed, url) { - - // Watch for mousedown (as a fall through to ensure that prepareImage() definitely - // got called on an image tag before mouseup). - // - // Normally this should have happened via the onPreProcess/onSetContent listeners, but - // for completeness we check once more here in case there are edge cases we've missed. - ed.onMouseDown.add(function(ed, e) { - var el = tinyMCE.activeEditor.selection.getNode(); - if (el.nodeName == 'IMG') { - // prepare image for resizing - prepareImage(ed, e.target); - } - return true; - }); - - // Watch for mouseup (catch image resizes) - ed.onMouseUp.add(function(ed, e) { - var el = tinyMCE.activeEditor.selection.getNode(); - if (el.nodeName == 'IMG') { - // setTimeout is necessary to allow the browser to complete the resize so we have new dimensions - setTimeout(function() { - constrainSize(ed, el); - }, 100); - } - return true; - }); - - /***************************************************** - * ENFORCE CONSTRAINTS ON CONTENT INSERTED INTO EDITOR - *****************************************************/ - - // Catch editor.setContent() events via onPreProcess (because onPreProcess allows us to - // modify the DOM before it is inserted, unlike onSetContent) - ed.onPreProcess.add(function(ed, o) { - if (!o.set) return; // only 'set' operations let us modify the nodes - - // loop in each img node and run constrainSize - tinymce.each(ed.dom.select('img', o.node), function(currentNode) { - constrainSize(ed, currentNode); - }); - }); - - // To be complete, we also need to watch for setContent() calls on the selection object so that - // constraints are enforced (i.e. in case an tag is inserted via mceInsertContent). - // So, catch all insertions using the editor's selection object - ed.onInit.add(function(ed) { - // http://wiki.moxiecode.com/index.php/TinyMCE:API/tinymce.dom.Selection/onSetContent - ed.selection.onSetContent.add(function(se, o) { - // @todo This seems to grab the entire editor contents - it works but could - // perform poorly on large documents - var currentNode = se.getNode(); - tinymce.each(ed.dom.select('img', currentNode), function (currentNode) { - // IF condition required as tinyMCE inserts 24x24 placeholders uner some conditions - if (currentNode.id != "__mce_tmp") - constrainSize(ed, currentNode); - }); - }); - }); - - /***************************** - * DISALLOW EXTERNAL IMAGE DRAG/DROPS - *****************************/ - // This is a hack. Listening for drag events wasn't working. - // - // Watches for mousedown and mouseup/dragdrop events within the editor. If a mouseup or - // dragdrop occurs in the editor without a preceeding mousedown, we assume it is an external - // dragdrop that should be rejected. - if (ed.getParam('advimagescale_reject_external_dragdrop', true)) { - - // catch mousedowns mouseups and dragdrops (which are basically mouseups too..) - ed.onMouseDown.add(function(e) { edMouseDown = true; }); - ed.onMouseUp.add(function(e) { edMouseDown = false; }); - ed.onInit.add(function(ed, o) { - tinymce.dom.Event.add(ed.getBody().parentNode, 'dragdrop', function(e) { edMouseDown = false; }); - }); - - // watch for drag attempts - var evt = (tinymce.isIE) ? 'dragenter' : 'dragover'; // IE allows dragdrop reject on dragenter (more efficient) - ed.onInit.add(function(ed, o) { - // use parentNode to go above editor content, to cover entire editor area - tinymce.dom.Event.add(ed.getBody().parentNode, evt, function (e) { - if (!edMouseDown) { - // disallow drop - return tinymce.dom.Event.cancel(e); - } - }); - }); - - } - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Advanced Image Resize Helper', - author : 'Marc Hodgins', - authorurl : 'http://www.hodginsmedia.com', - infourl : 'http://code.google.com/p/tinymce-plugin-advimagescale', - version : '1.1.2' - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('advimagescale', tinymce.plugins.AdvImageScale); - - /** - * Store image dimensions, pre-resize - * - * @param {object} el HTMLDomNode - */ - function storeDimensions(ed, el) { - var dom = ed.dom; - var elId = dom.getAttrib(el, 'mce_advimageresize_id'); - - // store original dimensions if this is the first resize of this element - if (!originalDimensions[elId]) { - originalDimensions[elId] = lastDimensions[elId] = {width: dom.getAttrib(el, 'width', el.width), height: dom.getAttrib(el, 'height', el.height)}; - } - return true; - } - - /** - * Prepare image for resizing - * Check to see if we've seen this IMG tag before; does tasks such as adding - * unique IDs to image tags, saving "original" image dimensions, etc. - * @param {object} e is optional - */ - function prepareImage(ed, el) { - var dom = ed.dom; - var elId= dom.getAttrib(el, 'mce_advimageresize_id'); - - // is this the first time this image tag has been seen? - if (!elId) { - var elId = ed.dom.uniqueId(); - dom.setAttrib(el, 'mce_advimageresize_id', elId); - storeDimensions(ed, el); - } - - return elId; - } - - /** - * Adjusts width and height to keep within min/max bounds and also maintain aspect ratio - * If mce_noresize attribute is set to image tag, then image resize is disallowed - */ - function constrainSize(ed, el, e) { - var dom = ed.dom; - var elId = prepareImage(ed, el); // also calls storeDimensions - var resized = (dom.getAttrib(el, 'width') != lastDimensions[elId].width || dom.getAttrib(el, 'height') != lastDimensions[elId].height); - - if (!resized) - return; // nothing to do - - // disallow image resize if mce_noresize or the noresize class is set on the image tag - if (dom.getAttrib(el, 'mce_noresize') || dom.hasClass(el, ed.getParam('advimagescale_noresize_class', 'noresize')) || ed.getParam('advimagescale_noresize_all')) { - dom.setAttrib(el, 'width', lastDimensions[elId].width); - dom.setAttrib(el, 'height', lastDimensions[elId].height); - if (tinymce.isGecko) - fixGeckoHandles(ed); - return; - } - - // Both IE7 and Gecko (as of FF3.0.03) has a "expands image by border width" bug before doing anything else - if (ed.getParam('advimagescale_fix_border_glitch', true /* default to true */)) { - fixImageBorderGlitch(ed, el); - storeDimensions(ed, el); // store adjusted dimensions - } - - // filter by regexp so only some images get constrained - var src_filter = ed.getParam('advimagescale_filter_src'); - if (src_filter) { - var r = new RegExp(src_filter); - if (!el.src.match(r)) { - return; // skip this element - } - } - - // allow filtering by classname - var class_filter = ed.getParam('advimagescale_filter_class'); - if (class_filter) { - if (!dom.hasClass(el, class_filter)) { - return; // skip this element, doesn't have the class we want - } - } - - // populate new dimensions object - var newDimensions = { width: dom.getAttrib(el, 'width', el.width), height: dom.getAttrib(el, 'height', el.height) }; - - // adjust w/h to maintain aspect ratio - if (ed.getParam('advimagescale_maintain_aspect_ratio', true /* default to true */)) { - newDimensions = maintainAspect(ed, el, newDimensions.width, newDimensions.height); - } - - // enforce minW/minH/maxW/maxH - newDimensions = checkBoundaries(ed, el, newDimensions.width, newDimensions.height); - - // was an adjustment made? - var adjusted = (dom.getAttrib(el, 'width', el.width) != newDimensions.width || dom.getAttrib(el, 'height', el.height) != newDimensions.height); - - // apply new w/h - if (adjusted) { - dom.setAttrib(el, 'width', newDimensions.width); - dom.setAttrib(el, 'height', newDimensions.height); - if (tinymce.isGecko) fixGeckoHandles(ed); - } - - if (ed.getParam('advimagescale_append_to_url')) { - appendToUri(ed, el, dom.getAttrib(el, 'width', el.width), dom.getAttrib(el, 'height', el.height)); - } - - // was the image resized? - if (lastDimensions[elId].width != dom.getAttrib(el, 'width', el.width) || lastDimensions[elId].height != dom.getAttrib(el, 'height', el.height)) { - // call "image resized" callback (if set) - if (ed.getParam('advimagescale_resize_callback')) { - ed.getParam('advimagescale_resize_callback')(ed, el); - } - } - - // remember "last dimensions" for next time - lastDimensions[elId] = { width: dom.getAttrib(el, 'width', el.width), height: dom.getAttrib(el, 'height', el.height) }; - } - - /** - * Fixes IE7 and Gecko border width glitch - * - * Both "add" the border width to an image after the resize handles have been - * dropped. This reverses it by looking at the "previous" known size and comparing - * to the current size. If they don't match, then a resize has taken place and the browser - * has (probably) messed it up. So, we reverse it. Note, this will probably need to be - * wrapped in a conditional statement if/when each browser fixes this bug. - */ - function fixImageBorderGlitch(ed, el) { - var dom = ed.dom; - var elId = dom.getAttrib(el, 'mce_advimageresize_id'); - var currentWidth = dom.getAttrib(el, 'width', el.width); - var currentHeight= dom.getAttrib(el, 'height', el.height); - var adjusted = false; - - // if current dimensions do not match what we last saw, then a resize has taken place - if (currentWidth != lastDimensions[elId].width) { - var adjustWidth = 0; - - // get computed border left/right widths - adjustWidth += parseInt(dom.getStyle(el, 'borderLeftWidth', 'borderLeftWidth')); - adjustWidth += parseInt(dom.getStyle(el, 'borderRightWidth', 'borderRightWidth')); - - // reset the width height to NOT include these amounts - if (adjustWidth > 0) { - dom.setAttrib(el, 'width', (currentWidth - adjustWidth)); - adjusted = true; - } - } - if (currentHeight != lastDimensions[elId].height) { - var adjustHeight = 0; - - // get computed border top/bottom widths - adjustHeight += parseInt(dom.getStyle(el, 'borderTopWidth', 'borderTopWidth')); - adjustHeight += parseInt(dom.getStyle(el, 'borderBottomWidth', 'borderBottomWidth')); - - if (adjustHeight > 0) { - dom.setAttrib(el, 'height', (currentHeight - adjustHeight)); - adjusted = true; - } - } - if (adjusted && tinymce.isGecko) fixGeckoHandles(ed); - } - - /** - * Fix gecko resize handles glitch - */ - function fixGeckoHandles(ed) { - ed.execCommand('mceRepaint', false); - } - - /** - * Set image dimensions on into a uri as querystring params - */ - function appendToUri(ed, el, w, h) { - var dom = ed.dom; - var uri = dom.getAttrib(el, 'src'); - var wKey = ed.getParam('advimagescale_url_width_key', 'w'); - uri = setQueryParam(uri, wKey, w); - var hKey = ed.getParam('advimagescale_url_height_key', 'h'); - uri = setQueryParam(uri, hKey, h); - - // no need to continue if URL didn't change - if (uri == dom.getAttrib(el, 'src')) { - return; - } - - // trigger image loading callback (if set) - if (ed.getParam('advimagescale_loading_callback')) { - // call loading callback - ed.getParam('advimagescale_loading_callback')(el); - } - // hook image load(ed) callback (if set) - if (ed.getParam('advimagescale_loaded_callback')) { - // hook load event on the image tag to call the loaded callback - tinymce.dom.Event.add(el, 'load', imageLoadedCallback, {el: el, ed: ed}); - } - - // set new src - dom.setAttrib(el, 'src', uri); - } - - /** - * Callback event when an image is (re)loaded - * @param {object} e Event (use e.target or this.el to access element, this.ed to access editor instance) - */ - function imageLoadedCallback(e) { - var el = this.el; // image element - var ed = this.ed; // editor - var callback = ed.getParam('advimagescale_loaded_callback'); // user specified callback - - // call callback, pass img as param - callback(el); - - // remove callback event - tinymce.dom.Event.remove(el, 'load', imageLoadedCallback); - } - - /** - * Sets URL querystring parameters by appending or replacing existing params of same name - */ - function setQueryParam(uri, key, value) { - if (!uri.match(/\?/)) uri += '?'; - if (!uri.match(new RegExp('([\?&])' + key + '='))) { - if (!uri.match(/[&\?]$/)) uri += '&'; - uri += key + '=' + escape(value); - } else { - uri = uri.replace(new RegExp('([\?\&])' + key + '=[^&]*'), '$1' + key + '=' + escape(value)); - } - return uri; - } - - /** - * Returns w/h that maintain aspect ratio - */ - function maintainAspect(ed, el, w, h) { - var elId = ed.dom.getAttrib(el, 'mce_advimageresize_id'); - - // calculate aspect ratio of original so we can maintain it - var ratio = originalDimensions[elId].width / originalDimensions[elId].height; - - // decide which dimension changed more (percentage), because that's the - // one we'll respect (the other we'll adjust to keep aspect ratio) - var lastW = lastDimensions[elId].width; - var lastH = lastDimensions[elId].height; - var deltaW = Math.abs(lastW - w); // absolute - var deltaH = Math.abs(lastH - h); // absolute - var pctW = Math.abs(deltaW / lastW); // percentage - var pctH = Math.abs(deltaH / lastH); // percentage - - if (deltaW || deltaH) { - if (pctW > pctH) { - // width changed more - use that as the locked point and adjust height - return { width: w, height: Math.round(w / ratio) }; - } else { - // height changed more - use that as the locked point and adjust width - return { width: Math.round(h * ratio), height: h }; - } - } - - // nothing changed - return { width: w, height: h }; - } - - /** - * Enforce min/max boundaries - * - * Returns true if an adjustment was made - */ - function checkBoundaries(ed, el, w, h) { - - var elId = ed.dom.getAttrib(el, 'mce_advimageresize_id'); - var maxW = ed.getParam('advimagescale_max_width'); - var maxH = ed.getParam('advimagescale_max_height'); - var minW = ed.getParam('advimagescale_min_width'); - var minH = ed.getParam('advimagescale_min_height'); - var maintainAspect = ed.getParam('advimagescale_maintain_aspect_ratio', true); - var oW = originalDimensions[elId].width; - var oH = originalDimensions[elId].height; - var ratio = oW/oH; - - // max - if (maxW && w > maxW) { - w = maxW; - h = maintainAspect ? Math.round(w / ratio) : h; - } - if (maxH && h > maxH) { - h = maxH; - w = maintainAspect ? Math.round(h * ratio) : w; - } - - // min - if (minW && w < minW) { - w = minW; - h = maintainAspect ? Math.round(w / ratio) : h; - } - if (minH && h < minH) { - h = minH; - w = maintainAspect ? Math.round(h * ratio) : h; - } - - return { width: w, height:h }; - } - -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/advlink/css/advlink.css b/www/javascript/tiny_mce/plugins/advlink/css/advlink.css deleted file mode 100644 index 14364316a..000000000 --- a/www/javascript/tiny_mce/plugins/advlink/css/advlink.css +++ /dev/null @@ -1,8 +0,0 @@ -.mceLinkList, .mceAnchorList, #targetlist {width:280px;} -.mceActionPanel {margin-top:7px;} -.panel_wrapper div.current {height:320px;} -#classlist, #title, #href {width:280px;} -#popupurl, #popupname {width:200px;} -#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;} -#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;} -#events_panel input {width:200px;} diff --git a/www/javascript/tiny_mce/plugins/advlink/editor_plugin.js b/www/javascript/tiny_mce/plugins/advlink/editor_plugin.js deleted file mode 100644 index 983fe5a9c..000000000 --- a/www/javascript/tiny_mce/plugins/advlink/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/advlink/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/advlink/editor_plugin_src.js deleted file mode 100644 index 14e46a762..000000000 --- a/www/javascript/tiny_mce/plugins/advlink/editor_plugin_src.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.AdvancedLinkPlugin', { - init : function(ed, url) { - this.editor = ed; - - // Register commands - ed.addCommand('mceAdvLink', function() { - var se = ed.selection; - - // No selection and not in link - if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A')) - return; - - ed.windowManager.open({ - file : url + '/link.htm', - width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)), - height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('link', { - title : 'advlink.link_desc', - cmd : 'mceAdvLink' - }); - - ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink'); - - ed.onNodeChange.add(function(ed, cm, n, co) { - cm.setDisabled('link', co && n.nodeName != 'A'); - cm.setActive('link', n.nodeName == 'A' && !n.name); - }); - }, - - getInfo : function() { - return { - longname : 'Advanced link', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/advlink/js/advlink.js b/www/javascript/tiny_mce/plugins/advlink/js/advlink.js deleted file mode 100644 index 837c937c6..000000000 --- a/www/javascript/tiny_mce/plugins/advlink/js/advlink.js +++ /dev/null @@ -1,532 +0,0 @@ -/* Functions for the advlink plugin popup */ - -tinyMCEPopup.requireLangPack(); - -var templates = { - "window.open" : "window.open('${url}','${target}','${options}')" -}; - -function preinit() { - var url; - - if (url = tinyMCEPopup.getParam("external_link_list_url")) - document.write(''); -} - -function changeClass() { - var f = document.forms[0]; - - f.classes.value = getSelectValue(f, 'classlist'); -} - -function init() { - tinyMCEPopup.resizeToInnerSize(); - - var formObj = document.forms[0]; - var inst = tinyMCEPopup.editor; - var elm = inst.selection.getNode(); - var action = "insert"; - var html; - - document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink'); - document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink'); - document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target'); - - // Link list - html = getLinkListHTML('linklisthref','href'); - if (html == "") - document.getElementById("linklisthrefrow").style.display = 'none'; - else - document.getElementById("linklisthrefcontainer").innerHTML = html; - - // Anchor list - html = getAnchorListHTML('anchorlist','href'); - if (html == "") - document.getElementById("anchorlistrow").style.display = 'none'; - else - document.getElementById("anchorlistcontainer").innerHTML = html; - - // Resize some elements - if (isVisible('hrefbrowser')) - document.getElementById('href').style.width = '260px'; - - if (isVisible('popupurlbrowser')) - document.getElementById('popupurl').style.width = '180px'; - - elm = inst.dom.getParent(elm, "A"); - if (elm != null && elm.nodeName == "A") - action = "update"; - - formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true); - - setPopupControlsDisabled(true); - - if (action == "update") { - var href = inst.dom.getAttrib(elm, 'href'); - var onclick = inst.dom.getAttrib(elm, 'onclick'); - - // Setup form data - setFormValue('href', href); - setFormValue('title', inst.dom.getAttrib(elm, 'title')); - setFormValue('id', inst.dom.getAttrib(elm, 'id')); - setFormValue('style', inst.dom.getAttrib(elm, "style")); - setFormValue('rel', inst.dom.getAttrib(elm, 'rel')); - setFormValue('rev', inst.dom.getAttrib(elm, 'rev')); - setFormValue('charset', inst.dom.getAttrib(elm, 'charset')); - setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang')); - setFormValue('dir', inst.dom.getAttrib(elm, 'dir')); - setFormValue('lang', inst.dom.getAttrib(elm, 'lang')); - setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); - setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); - setFormValue('type', inst.dom.getAttrib(elm, 'type')); - setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus')); - setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur')); - setFormValue('onclick', onclick); - setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick')); - setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown')); - setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup')); - setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover')); - setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove')); - setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout')); - setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress')); - setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown')); - setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup')); - setFormValue('target', inst.dom.getAttrib(elm, 'target')); - setFormValue('classes', inst.dom.getAttrib(elm, 'class')); - - // Parse onclick data - if (onclick != null && onclick.indexOf('window.open') != -1) - parseWindowOpen(onclick); - else - parseFunction(onclick); - - // Select by the values - selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir')); - selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel')); - selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev')); - selectByValue(formObj, 'linklisthref', href); - - if (href.charAt(0) == '#') - selectByValue(formObj, 'anchorlist', href); - - addClassesToList('classlist', 'advlink_styles'); - - selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true); - selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true); - } else - addClassesToList('classlist', 'advlink_styles'); -} - -function checkPrefix(n) { - if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) - n.value = 'mailto:' + n.value; - - if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) - n.value = 'http://' + n.value; -} - -function setFormValue(name, value) { - document.forms[0].elements[name].value = value; -} - -function parseWindowOpen(onclick) { - var formObj = document.forms[0]; - - // Preprocess center code - if (onclick.indexOf('return false;') != -1) { - formObj.popupreturn.checked = true; - onclick = onclick.replace('return false;', ''); - } else - formObj.popupreturn.checked = false; - - var onClickData = parseLink(onclick); - - if (onClickData != null) { - formObj.ispopup.checked = true; - setPopupControlsDisabled(false); - - var onClickWindowOptions = parseOptions(onClickData['options']); - var url = onClickData['url']; - - formObj.popupname.value = onClickData['target']; - formObj.popupurl.value = url; - formObj.popupwidth.value = getOption(onClickWindowOptions, 'width'); - formObj.popupheight.value = getOption(onClickWindowOptions, 'height'); - - formObj.popupleft.value = getOption(onClickWindowOptions, 'left'); - formObj.popuptop.value = getOption(onClickWindowOptions, 'top'); - - if (formObj.popupleft.value.indexOf('screen') != -1) - formObj.popupleft.value = "c"; - - if (formObj.popuptop.value.indexOf('screen') != -1) - formObj.popuptop.value = "c"; - - formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes"; - formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes"; - formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes"; - formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes"; - formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes"; - formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes"; - formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes"; - - buildOnClick(); - } -} - -function parseFunction(onclick) { - var formObj = document.forms[0]; - var onClickData = parseLink(onclick); - - // TODO: Add stuff here -} - -function getOption(opts, name) { - return typeof(opts[name]) == "undefined" ? "" : opts[name]; -} - -function setPopupControlsDisabled(state) { - var formObj = document.forms[0]; - - formObj.popupname.disabled = state; - formObj.popupurl.disabled = state; - formObj.popupwidth.disabled = state; - formObj.popupheight.disabled = state; - formObj.popupleft.disabled = state; - formObj.popuptop.disabled = state; - formObj.popuplocation.disabled = state; - formObj.popupscrollbars.disabled = state; - formObj.popupmenubar.disabled = state; - formObj.popupresizable.disabled = state; - formObj.popuptoolbar.disabled = state; - formObj.popupstatus.disabled = state; - formObj.popupreturn.disabled = state; - formObj.popupdependent.disabled = state; - - setBrowserDisabled('popupurlbrowser', state); -} - -function parseLink(link) { - link = link.replace(new RegExp(''', 'g'), "'"); - - var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1"); - - // Is function name a template function - var template = templates[fnName]; - if (template) { - // Build regexp - var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi")); - var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\("; - var replaceStr = ""; - for (var i=0; i'); - for (var i=0; i' + name + ''; - } - - if (html == "") - return ""; - - html = ''; - - return html; -} - -function insertAction() { - var inst = tinyMCEPopup.editor; - var elm, elementArray, i; - - elm = inst.selection.getNode(); - checkPrefix(document.forms[0].href); - - elm = inst.dom.getParent(elm, "A"); - - // Remove element if there is no href - if (!document.forms[0].href.value) { - i = inst.selection.getBookmark(); - inst.dom.remove(elm, 1); - inst.selection.moveToBookmark(i); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - return; - } - - // Create new anchor elements - if (elm == null) { - inst.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); - - elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';}); - for (i=0; i' + tinyMCELinkList[i][0] + ''; - - html += ''; - - return html; - - // tinyMCE.debug('-- image list start --', html, '-- image list end --'); -} - -function getTargetListHTML(elm_id, target_form_element) { - var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';'); - var html = ''; - - html += ''; - - return html; -} - -// While loading -preinit(); -tinyMCEPopup.onInit.add(init); diff --git a/www/javascript/tiny_mce/plugins/advlink/langs/en_dlg.js b/www/javascript/tiny_mce/plugins/advlink/langs/en_dlg.js deleted file mode 100644 index 19dff2936..000000000 --- a/www/javascript/tiny_mce/plugins/advlink/langs/en_dlg.js +++ /dev/null @@ -1,54 +0,0 @@ -tinyMCE.addI18n('en.advlink_dlg',{ -title:"Insert/edit link", -url:"Link URL", -target:"Target", -titlefield:"Title", -is_email:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?", -is_external:"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?", -list:"Link list", -general_tab:"General", -popup_tab:"Popup", -events_tab:"Events", -advanced_tab:"Advanced", -general_props:"General properties", -popup_props:"Popup properties", -event_props:"Events", -advanced_props:"Advanced properties", -popup_opts:"Options", -anchor_names:"Anchors", -target_same:"Open in this window / frame", -target_parent:"Open in parent window / frame", -target_top:"Open in top frame (replaces all frames)", -target_blank:"Open in new window", -popup:"Javascript popup", -popup_url:"Popup URL", -popup_name:"Window name", -popup_return:"Insert 'return false'", -popup_scrollbars:"Show scrollbars", -popup_statusbar:"Show status bar", -popup_toolbar:"Show toolbars", -popup_menubar:"Show menu bar", -popup_location:"Show location bar", -popup_resizable:"Make window resizable", -popup_dependent:"Dependent (Mozilla/Firefox only)", -popup_size:"Size", -width:"Width", -height:"Height", -popup_position:"Position (X/Y)", -id:"Id", -style:"Style", -classes:"Classes", -target_name:"Target name", -langdir:"Language direction", -target_langcode:"Target language", -langcode:"Language code", -encoding:"Target character encoding", -mime:"Target MIME type", -rel:"Relationship page to target", -rev:"Relationship target to page", -tabindex:"Tabindex", -accesskey:"Accesskey", -ltr:"Left to right", -rtl:"Right to left", -link_list:"Link list" -}); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/advlink/link.htm b/www/javascript/tiny_mce/plugins/advlink/link.htm deleted file mode 100644 index 8ab7c2a95..000000000 --- a/www/javascript/tiny_mce/plugins/advlink/link.htm +++ /dev/null @@ -1,338 +0,0 @@ - - - - {#advlink_dlg.title} - - - - - - - - - -
- - - - -
- - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/advlist/editor_plugin.js b/www/javascript/tiny_mce/plugins/advlist/editor_plugin.js deleted file mode 100644 index 57ecce6e0..000000000 --- a/www/javascript/tiny_mce/plugins/advlist/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.AdvListPlugin",{init:function(b,c){var d=this;d.editor=b;function e(g){var f=[];a(g.split(/,/),function(h){f.push({title:"advlist."+(h=="default"?"def":h.replace(/-/g,"_")),styles:{listStyleType:h=="default"?"":h}})});return f}d.numlist=b.getParam("advlist_number_styles")||e("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");d.bullist=b.getParam("advlist_bullet_styles")||e("default,circle,disc,square");if(tinymce.isIE&&/MSIE [2-7]/.test(navigator.userAgent)){d.isIE7=true}},createControl:function(d,b){var f=this,e,i,g=f.editor;if(d=="numlist"||d=="bullist"){if(f[d][0].title=="advlist.def"){i=f[d][0]}function c(j,l){var k=true;a(l.styles,function(n,m){if(g.dom.getStyle(j,m)!=n){k=false;return false}});return k}function h(){var k,l=g.dom,j=g.selection;k=l.getParent(j.getNode(),"ol,ul");if(!k||k.nodeName==(d=="bullist"?"OL":"UL")||c(k,i)){g.execCommand(d=="bullist"?"InsertUnorderedList":"InsertOrderedList")}if(i){k=l.getParent(j.getNode(),"ol,ul");if(k){l.setStyles(k,i.styles);k.removeAttribute("data-mce-style")}}g.focus()}e=b.createSplitButton(d,{title:"advanced."+d+"_desc","class":"mce_"+d,onclick:function(){h()}});e.onRenderMenu.add(function(j,k){k.onHideMenu.add(function(){if(f.bookmark){g.selection.moveToBookmark(f.bookmark);f.bookmark=0}});k.onShowMenu.add(function(){var n=g.dom,m=n.getParent(g.selection.getNode(),"ol,ul"),l;if(m||i){l=f[d];a(k.items,function(o){var p=true;o.setSelected(0);if(m&&!o.isDisabled()){a(l,function(q){if(q.id==o.id){if(!c(m,q)){p=false;return false}}});if(p){o.setSelected(1)}}});if(!m){k.items[i.id].setSelected(1)}}g.focus();if(tinymce.isIE){f.bookmark=g.selection.getBookmark(1)}});k.add({id:g.dom.uniqueId(),title:"advlist.types","class":"mceMenuItemTitle",titleItem:true}).setDisabled(1);a(f[d],function(l){if(f.isIE7&&l.styles.listStyleType=="lower-greek"){return}l.id=g.dom.uniqueId();k.add({id:l.id,title:l.title,onclick:function(){i=l;h()}})})});return e}},getInfo:function(){return{longname:"Advanced lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlist",tinymce.plugins.AdvListPlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/advlist/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/advlist/editor_plugin_src.js deleted file mode 100644 index a8f046b41..000000000 --- a/www/javascript/tiny_mce/plugins/advlist/editor_plugin_src.js +++ /dev/null @@ -1,176 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each; - - tinymce.create('tinymce.plugins.AdvListPlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - function buildFormats(str) { - var formats = []; - - each(str.split(/,/), function(type) { - formats.push({ - title : 'advlist.' + (type == 'default' ? 'def' : type.replace(/-/g, '_')), - styles : { - listStyleType : type == 'default' ? '' : type - } - }); - }); - - return formats; - }; - - // Setup number formats from config or default - t.numlist = ed.getParam("advlist_number_styles") || buildFormats("default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"); - t.bullist = ed.getParam("advlist_bullet_styles") || buildFormats("default,circle,disc,square"); - - if (tinymce.isIE && /MSIE [2-7]/.test(navigator.userAgent)) - t.isIE7 = true; - }, - - createControl: function(name, cm) { - var t = this, btn, format, editor = t.editor; - - if (name == 'numlist' || name == 'bullist') { - // Default to first item if it's a default item - if (t[name][0].title == 'advlist.def') - format = t[name][0]; - - function hasFormat(node, format) { - var state = true; - - each(format.styles, function(value, name) { - // Format doesn't match - if (editor.dom.getStyle(node, name) != value) { - state = false; - return false; - } - }); - - return state; - }; - - function applyListFormat() { - var list, dom = editor.dom, sel = editor.selection; - - // Check for existing list element - list = dom.getParent(sel.getNode(), 'ol,ul'); - - // Switch/add list type if needed - if (!list || list.nodeName == (name == 'bullist' ? 'OL' : 'UL') || hasFormat(list, format)) - editor.execCommand(name == 'bullist' ? 'InsertUnorderedList' : 'InsertOrderedList'); - - // Append styles to new list element - if (format) { - list = dom.getParent(sel.getNode(), 'ol,ul'); - if (list) { - dom.setStyles(list, format.styles); - list.removeAttribute('data-mce-style'); - } - } - - editor.focus(); - }; - - btn = cm.createSplitButton(name, { - title : 'advanced.' + name + '_desc', - 'class' : 'mce_' + name, - onclick : function() { - applyListFormat(); - } - }); - - btn.onRenderMenu.add(function(btn, menu) { - menu.onHideMenu.add(function() { - if (t.bookmark) { - editor.selection.moveToBookmark(t.bookmark); - t.bookmark = 0; - } - }); - - menu.onShowMenu.add(function() { - var dom = editor.dom, list = dom.getParent(editor.selection.getNode(), 'ol,ul'), fmtList; - - if (list || format) { - fmtList = t[name]; - - // Unselect existing items - each(menu.items, function(item) { - var state = true; - - item.setSelected(0); - - if (list && !item.isDisabled()) { - each(fmtList, function(fmt) { - if (fmt.id == item.id) { - if (!hasFormat(list, fmt)) { - state = false; - return false; - } - } - }); - - if (state) - item.setSelected(1); - } - }); - - // Select the current format - if (!list) - menu.items[format.id].setSelected(1); - } - - editor.focus(); - - // IE looses it's selection so store it away and restore it later - if (tinymce.isIE) { - t.bookmark = editor.selection.getBookmark(1); - } - }); - - menu.add({id : editor.dom.uniqueId(), title : 'advlist.types', 'class' : 'mceMenuItemTitle', titleItem: true}).setDisabled(1); - - each(t[name], function(item) { - // IE<8 doesn't support lower-greek, skip it - if (t.isIE7 && item.styles.listStyleType == 'lower-greek') - return; - - item.id = editor.dom.uniqueId(); - - menu.add({id : item.id, title : item.title, onclick : function() { - format = item; - applyListFormat(); - }}); - }); - }); - - return btn; - } - }, - - getInfo : function() { - return { - longname : 'Advanced lists', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlist', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('advlist', tinymce.plugins.AdvListPlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/autolink/editor_plugin.js b/www/javascript/tiny_mce/plugins/autolink/editor_plugin.js deleted file mode 100644 index c0f683a85..000000000 --- a/www/javascript/tiny_mce/plugins/autolink/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AutolinkPlugin",{init:function(a,b){var c=this;if(tinyMCE.isIE){return}a.onKeyDown.add(function(d,f){if(f.keyCode==13){return c.handleEnter(d)}});a.onKeyPress.add(function(d,f){if(f.which==41){return c.handleEclipse(d)}});a.onKeyUp.add(function(d,f){if(f.keyCode==32){return c.handleSpacebar(d)}})},handleEclipse:function(a){this.parseCurrentLine(a,-1,"(",true)},handleSpacebar:function(a){this.parseCurrentLine(a,0,"",true)},handleEnter:function(a){this.parseCurrentLine(a,-1,"",false)},parseCurrentLine:function(i,d,b,g){var a,f,c,n,k,m,h,e,j;a=i.selection.getRng().cloneRange();if(a.startOffset<5){e=a.endContainer.previousSibling;if(e==null){if(a.endContainer.firstChild==null||a.endContainer.firstChild.nextSibling==null){return}e=a.endContainer.firstChild.nextSibling}j=e.length;a.setStart(e,j);a.setEnd(e,j);if(a.endOffset<5){return}f=a.endOffset;n=e}else{n=a.endContainer;if(n.nodeType!=3&&n.firstChild){while(n.nodeType!=3&&n.firstChild){n=n.firstChild}a.setStart(n,0);a.setEnd(n,n.nodeValue.length)}if(a.endOffset==1){f=2}else{f=a.endOffset-1-d}}c=f;do{a.setStart(n,f-2);a.setEnd(n,f-1);f-=1}while(a.toString()!=" "&&a.toString()!=""&&a.toString().charCodeAt(0)!=160&&(f-2)>=0&&a.toString()!=b);if(a.toString()==b||a.toString().charCodeAt(0)==160){a.setStart(n,f);a.setEnd(n,c);f+=1}else{if(a.startOffset==0){a.setStart(n,0);a.setEnd(n,c)}else{a.setStart(n,f);a.setEnd(n,c)}}m=a.toString();h=m.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)(.+)$/i);if(h){if(h[1]=="www."){h[1]="http://www."}k=i.selection.getBookmark();i.selection.setRng(a);tinyMCE.execCommand("mceInsertLink",false,h[1]+h[2]);i.selection.moveToBookmark(k);if(tinyMCE.isWebKit){i.selection.collapse(false);var l=Math.min(n.length,c+1);a.setStart(n,l);a.setEnd(n,l);i.selection.setRng(a)}}},getInfo:function(){return{longname:"Autolink",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autolink",tinymce.plugins.AutolinkPlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/autolink/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/autolink/editor_plugin_src.js deleted file mode 100644 index ddfe0494a..000000000 --- a/www/javascript/tiny_mce/plugins/autolink/editor_plugin_src.js +++ /dev/null @@ -1,172 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2011, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.AutolinkPlugin', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - - init : function(ed, url) { - var t = this; - - // Internet Explorer has built-in automatic linking - if (tinyMCE.isIE) - return; - - // Add a key down handler - ed.onKeyDown.add(function(ed, e) { - if (e.keyCode == 13) - return t.handleEnter(ed); - }); - - ed.onKeyPress.add(function(ed, e) { - if (e.which == 41) - return t.handleEclipse(ed); - }); - - // Add a key up handler - ed.onKeyUp.add(function(ed, e) { - if (e.keyCode == 32) - return t.handleSpacebar(ed); - }); - }, - - handleEclipse : function(ed) { - this.parseCurrentLine(ed, -1, '(', true); - }, - - handleSpacebar : function(ed) { - this.parseCurrentLine(ed, 0, '', true); - }, - - handleEnter : function(ed) { - this.parseCurrentLine(ed, -1, '', false); - }, - - parseCurrentLine : function(ed, end_offset, delimiter, goback) { - var r, end, start, endContainer, bookmark, text, matches, prev, len; - - // We need at least five characters to form a URL, - // hence, at minimum, five characters from the beginning of the line. - r = ed.selection.getRng().cloneRange(); - if (r.startOffset < 5) { - // During testing, the caret is placed inbetween two text nodes. - // The previous text node contains the URL. - prev = r.endContainer.previousSibling; - if (prev == null) { - if (r.endContainer.firstChild == null || r.endContainer.firstChild.nextSibling == null) - return; - - prev = r.endContainer.firstChild.nextSibling; - } - len = prev.length; - r.setStart(prev, len); - r.setEnd(prev, len); - - if (r.endOffset < 5) - return; - - end = r.endOffset; - endContainer = prev; - } else { - endContainer = r.endContainer; - - // Get a text node - if (endContainer.nodeType != 3 && endContainer.firstChild) { - while (endContainer.nodeType != 3 && endContainer.firstChild) - endContainer = endContainer.firstChild; - - r.setStart(endContainer, 0); - r.setEnd(endContainer, endContainer.nodeValue.length); - } - - if (r.endOffset == 1) - end = 2; - else - end = r.endOffset - 1 - end_offset; - } - - start = end; - - do - { - // Move the selection one character backwards. - r.setStart(endContainer, end - 2); - r.setEnd(endContainer, end - 1); - end -= 1; - - // Loop until one of the following is found: a blank space,  , delimeter, (end-2) >= 0 - } while (r.toString() != ' ' && r.toString() != '' && r.toString().charCodeAt(0) != 160 && (end -2) >= 0 && r.toString() != delimiter); - - if (r.toString() == delimiter || r.toString().charCodeAt(0) == 160) { - r.setStart(endContainer, end); - r.setEnd(endContainer, start); - end += 1; - } else if (r.startOffset == 0) { - r.setStart(endContainer, 0); - r.setEnd(endContainer, start); - } - else { - r.setStart(endContainer, end); - r.setEnd(endContainer, start); - } - - text = r.toString(); - matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)(.+)$/i); - - if (matches) { - if (matches[1] == 'www.') { - matches[1] = 'http://www.'; - } - - bookmark = ed.selection.getBookmark(); - - ed.selection.setRng(r); - tinyMCE.execCommand('mceInsertLink',false, matches[1] + matches[2]); - ed.selection.moveToBookmark(bookmark); - - // TODO: Determine if this is still needed. - if (tinyMCE.isWebKit) { - // move the caret to its original position - ed.selection.collapse(false); - var max = Math.min(endContainer.length, start + 1); - r.setStart(endContainer, max); - r.setEnd(endContainer, max); - ed.selection.setRng(r); - } - } - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Autolink', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autolink', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('autolink', tinymce.plugins.AutolinkPlugin); -})(); diff --git a/www/javascript/tiny_mce/plugins/autoresize/editor_plugin.js b/www/javascript/tiny_mce/plugins/autoresize/editor_plugin.js deleted file mode 100644 index 6c4ff0d5d..000000000 --- a/www/javascript/tiny_mce/plugins/autoresize/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this,e=0;if(a.getParam("fullscreen_is_enabled")){return}function b(){var i=a.getDoc(),f=i.body,k=i.documentElement,h=tinymce.DOM,j=d.autoresize_min_height,g;g=tinymce.isIE?f.scrollHeight:i.body.offsetHeight;if(g>d.autoresize_min_height){j=g}if(d.autoresize_max_height&&g>d.autoresize_max_height){j=d.autoresize_max_height;a.getBody().style.overflowY="auto"}else{a.getBody().style.overflowY="hidden"}if(j!==e){h.setStyle(h.get(a.id+"_ifr"),"height",j+"px");e=j}if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=parseInt(a.getParam("autoresize_min_height",a.getElement().offsetHeight));d.autoresize_max_height=parseInt(a.getParam("autoresize_max_height",0));a.onInit.add(function(f){f.dom.setStyle(f.getBody(),"paddingBottom",f.getParam("autoresize_bottom_margin",50)+"px")});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);if(a.getParam("autoresize_on_init",true)){a.onInit.add(function(g,f){g.setProgressState(true);d.throbbing=true;g.getBody().style.overflowY="hidden"});a.onLoadContent.add(function(g,f){b();setTimeout(function(){b();g.setProgressState(false);d.throbbing=false},1250)})}a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/autoresize/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/autoresize/editor_plugin_src.js deleted file mode 100644 index 7d113419d..000000000 --- a/www/javascript/tiny_mce/plugins/autoresize/editor_plugin_src.js +++ /dev/null @@ -1,137 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - /** - * Auto Resize - * - * This plugin automatically resizes the content area to fit its content height. - * It will retain a minimum height, which is the height of the content area when - * it's initialized. - */ - tinymce.create('tinymce.plugins.AutoResizePlugin', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed, url) { - var t = this, oldSize = 0; - - if (ed.getParam('fullscreen_is_enabled')) - return; - - /** - * This method gets executed each time the editor needs to resize. - */ - function resize() { - var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight; - - // Get height differently depending on the browser used - myHeight = tinymce.isIE ? b.scrollHeight : d.body.offsetHeight; - - // Don't make it smaller than the minimum height - if (myHeight > t.autoresize_min_height) - resizeHeight = myHeight; - - // If a maximum height has been defined don't exceed this height - if (t.autoresize_max_height && myHeight > t.autoresize_max_height) { - resizeHeight = t.autoresize_max_height; - ed.getBody().style.overflowY = "auto"; - } else - ed.getBody().style.overflowY = "hidden"; - - // Resize content element - if (resizeHeight !== oldSize) { - DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); - oldSize = resizeHeight; - } - - // if we're throbbing, we'll re-throb to match the new size - if (t.throbbing) { - ed.setProgressState(false); - ed.setProgressState(true); - } - }; - - t.editor = ed; - - // Define minimum height - t.autoresize_min_height = parseInt( ed.getParam('autoresize_min_height', ed.getElement().offsetHeight) ); - - // Define maximum height - t.autoresize_max_height = parseInt( ed.getParam('autoresize_max_height', 0) ); - - // Add padding at the bottom for better UX - ed.onInit.add(function(ed){ - ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px'); - }); - - // Add appropriate listeners for resizing content area - ed.onChange.add(resize); - ed.onSetContent.add(resize); - ed.onPaste.add(resize); - ed.onKeyUp.add(resize); - ed.onPostRender.add(resize); - - if (ed.getParam('autoresize_on_init', true)) { - // Things to do when the editor is ready - ed.onInit.add(function(ed, l) { - // Show throbber until content area is resized properly - ed.setProgressState(true); - t.throbbing = true; - - // Hide scrollbars - ed.getBody().style.overflowY = "hidden"; - }); - - ed.onLoadContent.add(function(ed, l) { - resize(); - - // Because the content area resizes when its content CSS loads, - // and we can't easily add a listener to its onload event, - // we'll just trigger a resize after a short loading period - setTimeout(function() { - resize(); - - // Disable throbber - ed.setProgressState(false); - t.throbbing = false; - }, 1250); - }); - } - - // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); - ed.addCommand('mceAutoResize', resize); - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Auto Resize', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin); -})(); diff --git a/www/javascript/tiny_mce/plugins/autosave/editor_plugin.js b/www/javascript/tiny_mce/plugins/autosave/editor_plugin.js deleted file mode 100644 index 7f49107e6..000000000 --- a/www/javascript/tiny_mce/plugins/autosave/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(e){var c="autosave",g="restoredraft",b=true,f,d,a=e.util.Dispatcher;e.create("tinymce.plugins.AutoSave",{init:function(i,j){var h=this,l=i.settings;h.editor=i;function k(n){var m={s:1000,m:60000};n=/^(\d+)([ms]?)$/.exec(""+n);return(n[2]?m[n[2]]:1)*parseInt(n)}e.each({ask_before_unload:b,interval:"30s",retention:"20m",minlength:50},function(n,m){m=c+"_"+m;if(l[m]===f){l[m]=n}});l.autosave_interval=k(l.autosave_interval);l.autosave_retention=k(l.autosave_retention);i.addButton(g,{title:c+".restore_content",onclick:function(){if(i.getContent({draft:true}).replace(/\s| |<\/?p[^>]*>|]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){h.storeDraft();i.nodeChanged()},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();try{m.save("TinyMCE")}catch(o){}},getItem:function(l){var m=i.getElement();try{m.load("TinyMCE");return m.getAttribute(l)}catch(n){return null}},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent({draft:true});if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,i=h.storage;if(i){content=i.getItem(h.key);if(content){h.editor.setContent(content);h.onRestoreDraft.dispatch(h,{content:content})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()]*>|]*>/gi, "").length > 0) { - // Show confirm dialog if the editor isn't empty - ed.windowManager.confirm( - PLUGIN_NAME + ".warning_message", - function(ok) { - if (ok) - self.restoreDraft(); - } - ); - } else - self.restoreDraft(); - } - }); - - // Enable/disable restoredraft button depending on if there is a draft stored or not - ed.onNodeChange.add(function() { - var controlManager = ed.controlManager; - - if (controlManager.get(RESTORE_DRAFT)) - controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft()); - }); - - ed.onInit.add(function() { - // Check if the user added the restore button, then setup auto storage logic - if (ed.controlManager.get(RESTORE_DRAFT)) { - // Setup storage engine - self.setupStorage(ed); - - // Auto save contents each interval time - setInterval(function() { - self.storeDraft(); - ed.nodeChanged(); - }, settings.autosave_interval); - } - }); - - /** - * This event gets fired when a draft is stored to local storage. - * - * @event onStoreDraft - * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. - * @param {Object} draft Draft object containing the HTML contents of the editor. - */ - self.onStoreDraft = new Dispatcher(self); - - /** - * This event gets fired when a draft is restored from local storage. - * - * @event onStoreDraft - * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. - * @param {Object} draft Draft object containing the HTML contents of the editor. - */ - self.onRestoreDraft = new Dispatcher(self); - - /** - * This event gets fired when a draft removed/expired. - * - * @event onRemoveDraft - * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event. - * @param {Object} draft Draft object containing the HTML contents of the editor. - */ - self.onRemoveDraft = new Dispatcher(self); - - // Add ask before unload dialog only add one unload handler - if (!unloadHandlerAdded) { - window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler; - unloadHandlerAdded = TRUE; - } - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @method getInfo - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Auto save', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - /** - * Returns an expiration date UTC string. - * - * @method getExpDate - * @return {String} Expiration date UTC string. - */ - getExpDate : function() { - return new Date( - new Date().getTime() + this.editor.settings.autosave_retention - ).toUTCString(); - }, - - /** - * This method will setup the storage engine. If the browser has support for it. - * - * @method setupStorage - */ - setupStorage : function(ed) { - var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK"; - - self.key = PLUGIN_NAME + ed.id; - - // Loop though each storage engine type until we find one that works - tinymce.each([ - function() { - // Try HTML5 Local Storage - if (localStorage) { - localStorage.setItem(testKey, testVal); - - if (localStorage.getItem(testKey) === testVal) { - localStorage.removeItem(testKey); - - return localStorage; - } - } - }, - - function() { - // Try HTML5 Session Storage - if (sessionStorage) { - sessionStorage.setItem(testKey, testVal); - - if (sessionStorage.getItem(testKey) === testVal) { - sessionStorage.removeItem(testKey); - - return sessionStorage; - } - } - }, - - function() { - // Try IE userData - if (tinymce.isIE) { - ed.getElement().style.behavior = "url('#default#userData')"; - - // Fake localStorage on old IE - return { - autoExpires : TRUE, - - setItem : function(key, value) { - var userDataElement = ed.getElement(); - - userDataElement.setAttribute(key, value); - userDataElement.expires = self.getExpDate(); - - try { - userDataElement.save("TinyMCE"); - } catch (e) { - // Ignore, saving might fail if "Userdata Persistence" is disabled in IE - } - }, - - getItem : function(key) { - var userDataElement = ed.getElement(); - - try { - userDataElement.load("TinyMCE"); - return userDataElement.getAttribute(key); - } catch (e) { - // Ignore, loading might fail if "Userdata Persistence" is disabled in IE - return null; - } - }, - - removeItem : function(key) { - ed.getElement().removeAttribute(key); - } - }; - } - }, - ], function(setup) { - // Try executing each function to find a suitable storage engine - try { - self.storage = setup(); - - if (self.storage) - return false; - } catch (e) { - // Ignore - } - }); - }, - - /** - * This method will store the current contents in the the storage engine. - * - * @method storeDraft - */ - storeDraft : function() { - var self = this, storage = self.storage, editor = self.editor, expires, content; - - // Is the contents dirty - if (storage) { - // If there is no existing key and the contents hasn't been changed since - // it's original value then there is no point in saving a draft - if (!storage.getItem(self.key) && !editor.isDirty()) - return; - - // Store contents if the contents if longer than the minlength of characters - content = editor.getContent({draft: true}); - if (content.length > editor.settings.autosave_minlength) { - expires = self.getExpDate(); - - // Store expiration date if needed IE userData has auto expire built in - if (!self.storage.autoExpires) - self.storage.setItem(self.key + "_expires", expires); - - self.storage.setItem(self.key, content); - self.onStoreDraft.dispatch(self, { - expires : expires, - content : content - }); - } - } - }, - - /** - * This method will restore the contents from the storage engine back to the editor. - * - * @method restoreDraft - */ - restoreDraft : function() { - var self = this, storage = self.storage; - - if (storage) { - content = storage.getItem(self.key); - - if (content) { - self.editor.setContent(content); - self.onRestoreDraft.dispatch(self, { - content : content - }); - } - } - }, - - /** - * This method will return true/false if there is a local storage draft available. - * - * @method hasDraft - * @return {boolean} true/false state if there is a local draft. - */ - hasDraft : function() { - var self = this, storage = self.storage, expDate, exists; - - if (storage) { - // Does the item exist at all - exists = !!storage.getItem(self.key); - if (exists) { - // Storage needs autoexpire - if (!self.storage.autoExpires) { - expDate = new Date(storage.getItem(self.key + "_expires")); - - // Contents hasn't expired - if (new Date().getTime() < expDate.getTime()) - return TRUE; - - // Remove it if it has - self.removeDraft(); - } else - return TRUE; - } - } - - return false; - }, - - /** - * Removes the currently stored draft. - * - * @method removeDraft - */ - removeDraft : function() { - var self = this, storage = self.storage, key = self.key, content; - - if (storage) { - // Get current contents and remove the existing draft - content = storage.getItem(key); - storage.removeItem(key); - storage.removeItem(key + "_expires"); - - // Dispatch remove event if we had any contents - if (content) { - self.onRemoveDraft.dispatch(self, { - content : content - }); - } - } - }, - - "static" : { - // Internal unload handler will be called before the page is unloaded - _beforeUnloadHandler : function(e) { - var msg; - - tinymce.each(tinyMCE.editors, function(ed) { - // Store a draft for each editor instance - if (ed.plugins.autosave) - ed.plugins.autosave.storeDraft(); - - // Never ask in fullscreen mode - if (ed.getParam("fullscreen_is_enabled")) - return; - - // Setup a return message if the editor is dirty - if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload")) - msg = ed.getLang("autosave.unload_msg"); - }); - - return msg; - } - } - }); - - tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave); -})(tinymce); diff --git a/www/javascript/tiny_mce/plugins/autosave/langs/en.js b/www/javascript/tiny_mce/plugins/autosave/langs/en.js deleted file mode 100644 index fce6bd3e1..000000000 --- a/www/javascript/tiny_mce/plugins/autosave/langs/en.js +++ /dev/null @@ -1,4 +0,0 @@ -tinyMCE.addI18n('en.autosave',{ -restore_content: "Restore auto-saved content", -warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?" -}); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/bbcode/editor_plugin.js b/www/javascript/tiny_mce/plugins/bbcode/editor_plugin.js deleted file mode 100644 index 8f8821fd6..000000000 --- a/www/javascript/tiny_mce/plugins/bbcode/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/(.*?)<\/font>/gi,"$1");b(//gi,"[img]$1[/img]");b(/(.*?)<\/span>/gi,"[code]$1[/code]");b(/(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/(.*?)<\/span>/gi,"[u]$1[/u]");b(//gi,"[u]");b(/]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/
/gi,"\n");b(//gi,"\n");b(/
/gi,"\n");b(/

/gi,"");b(/<\/p>/gi,"\n");b(/ |\u00a0/gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"
");b(/\[b\]/gi,"");b(/\[\/b\]/gi,"");b(/\[i\]/gi,"");b(/\[\/i\]/gi,"");b(/\[u\]/gi,"");b(/\[\/u\]/gi,"");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2');b(/\[url\](.*?)\[\/url\]/gi,'$1');b(/\[img\](.*?)\[\/img\]/gi,'');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2');b(/\[code\](.*?)\[\/code\]/gi,'$1 ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/bbcode/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/bbcode/editor_plugin_src.js deleted file mode 100644 index 4e7eb3377..000000000 --- a/www/javascript/tiny_mce/plugins/bbcode/editor_plugin_src.js +++ /dev/null @@ -1,120 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.BBCodePlugin', { - init : function(ed, url) { - var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase(); - - ed.onBeforeSetContent.add(function(ed, o) { - o.content = t['_' + dialect + '_bbcode2html'](o.content); - }); - - ed.onPostProcess.add(function(ed, o) { - if (o.set) - o.content = t['_' + dialect + '_bbcode2html'](o.content); - - if (o.get) - o.content = t['_' + dialect + '_html2bbcode'](o.content); - }); - }, - - getInfo : function() { - return { - longname : 'BBCode Plugin', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - // HTML -> BBCode in PunBB dialect - _punbb_html2bbcode : function(s) { - s = tinymce.trim(s); - - function rep(re, str) { - s = s.replace(re, str); - }; - - // example: to [b] - rep(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"); - rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); - rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); - rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"); - rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"); - rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"); - rep(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"); - rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"); - rep(/(.*?)<\/font>/gi,"$1"); - rep(//gi,"[img]$1[/img]"); - rep(/(.*?)<\/span>/gi,"[code]$1[/code]"); - rep(/(.*?)<\/span>/gi,"[quote]$1[/quote]"); - rep(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"); - rep(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"); - rep(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"); - rep(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"); - rep(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"); - rep(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"); - rep(/<\/(strong|b)>/gi,"[/b]"); - rep(/<(strong|b)>/gi,"[b]"); - rep(/<\/(em|i)>/gi,"[/i]"); - rep(/<(em|i)>/gi,"[i]"); - rep(/<\/u>/gi,"[/u]"); - rep(/(.*?)<\/span>/gi,"[u]$1[/u]"); - rep(//gi,"[u]"); - rep(/]*>/gi,"[quote]"); - rep(/<\/blockquote>/gi,"[/quote]"); - rep(/
/gi,"\n"); - rep(//gi,"\n"); - rep(/
/gi,"\n"); - rep(/

/gi,""); - rep(/<\/p>/gi,"\n"); - rep(/ |\u00a0/gi," "); - rep(/"/gi,"\""); - rep(/</gi,"<"); - rep(/>/gi,">"); - rep(/&/gi,"&"); - - return s; - }, - - // BBCode -> HTML from PunBB dialect - _punbb_bbcode2html : function(s) { - s = tinymce.trim(s); - - function rep(re, str) { - s = s.replace(re, str); - }; - - // example: [b] to - rep(/\n/gi,"
"); - rep(/\[b\]/gi,""); - rep(/\[\/b\]/gi,""); - rep(/\[i\]/gi,""); - rep(/\[\/i\]/gi,""); - rep(/\[u\]/gi,""); - rep(/\[\/u\]/gi,""); - rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2"); - rep(/\[url\](.*?)\[\/url\]/gi,"$1"); - rep(/\[img\](.*?)\[\/img\]/gi,""); - rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2"); - rep(/\[code\](.*?)\[\/code\]/gi,"$1 "); - rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 "); - - return s; - } - }); - - // Register plugin - tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/contextmenu/editor_plugin.js b/www/javascript/tiny_mce/plugins/contextmenu/editor_plugin.js deleted file mode 100644 index af7ae5445..000000000 --- a/www/javascript/tiny_mce/plugins/contextmenu/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(e){var h=this,f,d,i;h.editor=e;d=e.settings.contextmenu_never_use_native;h.onContextMenu=new tinymce.util.Dispatcher(this);f=e.onContextMenu.add(function(j,k){if((i!==0?i:k.ctrlKey)&&!d){return}a.cancel(k);if(k.target.nodeName=="IMG"){j.selection.select(k.target)}h._getMenu(j).showMenu(k.clientX||k.pageX,k.clientY||k.pageY);a.add(j.getDoc(),"click",function(l){g(j,l)});j.nodeChanged()});e.onRemove.add(function(){if(h._menu){h._menu.removeAll()}});function g(j,k){i=0;if(k&&k.button==2){i=k.ctrlKey;return}if(h._menu){h._menu.removeAll();h._menu.destroy();a.remove(j.getDoc(),"click",g)}}e.onMouseDown.add(g);e.onKeyDown.add(g);e.onKeyDown.add(function(j,k){if(k.shiftKey&&!k.ctrlKey&&!k.altKey&&k.keyCode===121){a.cancel(k);f(j,k)}})},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(e){var g=this,d=g._menu,j=e.selection,f=j.isCollapsed(),h=j.getNode()||e.getBody(),i,k;if(d){d.removeAll();d.destroy()}k=b.getPos(e.getContentAreaContainer());d=e.controlManager.createDropMenu("contextmenu",{offset_x:k.x+e.getParam("contextmenu_offset_x",0),offset_y:k.y+e.getParam("contextmenu_offset_y",0),constrain:1,keyboard_focus:true});g._menu=d;d.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(f);d.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(f);d.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((h.nodeName=="A"&&!e.dom.getAttrib(h,"name"))||!f){d.addSeparator();d.add({title:"advanced.link_desc",icon:"link",cmd:e.plugins.advlink?"mceAdvLink":"mceLink",ui:true});d.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}d.addSeparator();d.add({title:"advanced.image_desc",icon:"image",cmd:e.plugins.advimage?"mceAdvImage":"mceImage",ui:true});d.addSeparator();i=d.addMenu({title:"contextmenu.align"});i.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});i.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});i.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});i.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});g.onContextMenu.dispatch(g,d,h,f);return d}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/contextmenu/editor_plugin_src.js deleted file mode 100644 index 956fbea99..000000000 --- a/www/javascript/tiny_mce/plugins/contextmenu/editor_plugin_src.js +++ /dev/null @@ -1,160 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM; - - /** - * This plugin a context menu to TinyMCE editor instances. - * - * @class tinymce.plugins.ContextMenu - */ - tinymce.create('tinymce.plugins.ContextMenu', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @method init - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed) { - var t = this, showMenu, contextmenuNeverUseNative, realCtrlKey; - - t.editor = ed; - - contextmenuNeverUseNative = ed.settings.contextmenu_never_use_native; - - /** - * This event gets fired when the context menu is shown. - * - * @event onContextMenu - * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event. - * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed. - */ - t.onContextMenu = new tinymce.util.Dispatcher(this); - - showMenu = ed.onContextMenu.add(function(ed, e) { - // Block TinyMCE menu on ctrlKey and work around Safari issue - if ((realCtrlKey !== 0 ? realCtrlKey : e.ctrlKey) && !contextmenuNeverUseNative) - return; - - Event.cancel(e); - - // Select the image if it's clicked. WebKit would other wise expand the selection - if (e.target.nodeName == 'IMG') - ed.selection.select(e.target); - - t._getMenu(ed).showMenu(e.clientX || e.pageX, e.clientY || e.pageY); - Event.add(ed.getDoc(), 'click', function(e) { - hide(ed, e); - }); - - ed.nodeChanged(); - }); - - ed.onRemove.add(function() { - if (t._menu) - t._menu.removeAll(); - }); - - function hide(ed, e) { - realCtrlKey = 0; - - // Since the contextmenu event moves - // the selection we need to store it away - if (e && e.button == 2) { - realCtrlKey = e.ctrlKey; - return; - } - - if (t._menu) { - t._menu.removeAll(); - t._menu.destroy(); - Event.remove(ed.getDoc(), 'click', hide); - } - }; - - ed.onMouseDown.add(hide); - ed.onKeyDown.add(hide); - ed.onKeyDown.add(function(ed, e) { - if (e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode === 121) { - Event.cancel(e); - showMenu(ed, e); - } - }); - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @method getInfo - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Contextmenu', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - _getMenu : function(ed) { - var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p; - - if (m) { - m.removeAll(); - m.destroy(); - } - - p = DOM.getPos(ed.getContentAreaContainer()); - - m = ed.controlManager.createDropMenu('contextmenu', { - offset_x : p.x + ed.getParam('contextmenu_offset_x', 0), - offset_y : p.y + ed.getParam('contextmenu_offset_y', 0), - constrain : 1, - keyboard_focus: true - }); - - t._menu = m; - - m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col); - m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col); - m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'}); - - if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) { - m.addSeparator(); - m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); - m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); - } - - m.addSeparator(); - m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); - - m.addSeparator(); - am = m.addMenu({title : 'contextmenu.align'}); - am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'}); - am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'}); - am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'}); - am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'}); - - t.onContextMenu.dispatch(t, m, el, col); - - return m; - } - }); - - // Register plugin - tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu); -})(); diff --git a/www/javascript/tiny_mce/plugins/directionality/editor_plugin.js b/www/javascript/tiny_mce/plugins/directionality/editor_plugin.js deleted file mode 100644 index bce8e7399..000000000 --- a/www/javascript/tiny_mce/plugins/directionality/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/directionality/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/directionality/editor_plugin_src.js deleted file mode 100644 index 4444959bf..000000000 --- a/www/javascript/tiny_mce/plugins/directionality/editor_plugin_src.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Directionality', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - ed.addCommand('mceDirectionLTR', function() { - var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); - - if (e) { - if (ed.dom.getAttrib(e, "dir") != "ltr") - ed.dom.setAttrib(e, "dir", "ltr"); - else - ed.dom.setAttrib(e, "dir", ""); - } - - ed.nodeChanged(); - }); - - ed.addCommand('mceDirectionRTL', function() { - var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock); - - if (e) { - if (ed.dom.getAttrib(e, "dir") != "rtl") - ed.dom.setAttrib(e, "dir", "rtl"); - else - ed.dom.setAttrib(e, "dir", ""); - } - - ed.nodeChanged(); - }); - - ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'}); - ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'}); - - ed.onNodeChange.add(t._nodeChange, t); - }, - - getInfo : function() { - return { - longname : 'Directionality', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _nodeChange : function(ed, cm, n) { - var dom = ed.dom, dir; - - n = dom.getParent(n, dom.isBlock); - if (!n) { - cm.setDisabled('ltr', 1); - cm.setDisabled('rtl', 1); - return; - } - - dir = dom.getAttrib(n, 'dir'); - cm.setActive('ltr', dir == "ltr"); - cm.setDisabled('ltr', 0); - cm.setActive('rtl', dir == "rtl"); - cm.setDisabled('rtl', 0); - } - }); - - // Register plugin - tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/emotions/editor_plugin.js b/www/javascript/tiny_mce/plugins/emotions/editor_plugin.js deleted file mode 100644 index dbdd8ffb5..000000000 --- a/www/javascript/tiny_mce/plugins/emotions/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(a){a.create("tinymce.plugins.EmotionsPlugin",{init:function(b,c){b.addCommand("mceEmotion",function(){b.windowManager.open({file:c+"/emotions.htm",width:250+parseInt(b.getLang("emotions.delta_width",0)),height:160+parseInt(b.getLang("emotions.delta_height",0)),inline:1},{plugin_url:c})});b.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("emotions",a.plugins.EmotionsPlugin)})(tinymce); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/emotions/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/emotions/editor_plugin_src.js deleted file mode 100644 index 71d541697..000000000 --- a/www/javascript/tiny_mce/plugins/emotions/editor_plugin_src.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - tinymce.create('tinymce.plugins.EmotionsPlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceEmotion', function() { - ed.windowManager.open({ - file : url + '/emotions.htm', - width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)), - height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'}); - }, - - getInfo : function() { - return { - longname : 'Emotions', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin); -})(tinymce); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/emotions/emotions.htm b/www/javascript/tiny_mce/plugins/emotions/emotions.htm deleted file mode 100644 index 2c91002e4..000000000 --- a/www/javascript/tiny_mce/plugins/emotions/emotions.htm +++ /dev/null @@ -1,41 +0,0 @@ - - - - {#emotions_dlg.title} - - - - - -

-
{#emotions_dlg.title}:

- - - - - - - - - - - - - - - - - - - - - - - - - - -
{#emotions_dlg.cool}{#emotions_dlg.cry}{#emotions_dlg.embarassed}{#emotions_dlg.foot_in_mouth}
{#emotions_dlg.frown}{#emotions_dlg.innocent}{#emotions_dlg.kiss}{#emotions_dlg.laughing}
{#emotions_dlg.money_mouth}{#emotions_dlg.sealed}{#emotions_dlg.smile}{#emotions_dlg.surprised}
{#emotions_dlg.tongue-out}{#emotions_dlg.undecided}{#emotions_dlg.wink}{#emotions_dlg.yell}
-
- - diff --git a/www/javascript/tiny_mce/plugins/emotions/img/smiley-cool.gif b/www/javascript/tiny_mce/plugins/emotions/img/smiley-cool.gif deleted file mode 100644 index ba90cc36fb0415d0273d1cd206bff63fd9c91fde..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 354 zcmV-o0iFIwNk%w1VG;lm0Mr!#3ke00dJfFY%i+lrhK7V(RutUQJhPY;?(XfrsZKgL z7WLQ^zPO&zzav{)SL^9nBOw~z(=orMEH5uC-P_gr`uhCnASMa|$-iRw?m_(dUwU8) zq>Kx}s1_F$4FCWDA^8LW0018VEC2ui01^Na000Hw;3tYzX_jM3Qpv$_M?zI9i5=0S zX-{-uv=l3%&P0s%m9Ox_a(m_c|u z01g3U0`Wll5)poVdma=N8y<3f0Sf~hXmTC}2oxMW4FdxUj+z4<0}lrX2nP=qkDRIt z9Ge*(qzMrj3jrIOjvI{`5eWzt3`G_T8yChG8w(a19SkK12@M(+799Zr9n=~PzBCmA z5)BU-)YKUd4H5!D9|!^o9kWIe9SH(WDHRk92}DZ?3})2$P@$55g90f0N)ZA8JID5J Aw*UYD diff --git a/www/javascript/tiny_mce/plugins/emotions/img/smiley-cry.gif b/www/javascript/tiny_mce/plugins/emotions/img/smiley-cry.gif deleted file mode 100644 index 74d897a4f6d22e814e2b054e98b8a75fb464b4be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 329 zcmV-P0k-}}Nk%w1VG;lm0Mr-&E)xPSit@9T3%;vR+|V+?t0A(pllJjXrMl7n=_A_a za^B+Su$LjvyC3@TIQZNZa##w=!k(SO^P#bO*w(eU#;{U83XFCU_V)J5wrb+;g2vkN z#>U24qVoOvY5)KLA^8LW0018VEC2ui01^Na000HX;3tY$X_jM3QUfCh%s^o(nF++< zc?Th6v=oL>*by8K!mhvwelUXuuW&&U9iGO3hM@>Njw{l^#0q9mWpcefdI;O$;efnY zkd~@r-o$*74FCWI1%d((4+jDz0va0>69^fI6%`W{8w!gU1pyL>prH>E0R<%k6Aq%H z4ij+^9TEwM5P}eh2@)L<~6+>@EpxfA0YrcPNsSu diff --git a/www/javascript/tiny_mce/plugins/emotions/img/smiley-embarassed.gif b/www/javascript/tiny_mce/plugins/emotions/img/smiley-embarassed.gif deleted file mode 100644 index 963a96b8a7593b1d8bcbab073abe5ee4e539dbf6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 331 zcmV-R0kr-{Nk%w1VG;lm0MrryDh>j~yq&6%75dW~z^P39(NxsGDE{UkxtkIEq(S-a zRKlwv+S=Lr?>hbYY~sQ?c3T&ZcN_Nh_EU3s(>Io6B&>WW`@bsw**)Ocy1bht z{*G6|uwwqUQ2+n{A^8LW0018VEC2ui01^Na000HZ;3tYwX_jM3YQ!c88=*-m*&&bO zILd=`w3KAC;8hxpif*w9ek6oqV-Z0L77fROK$BSR@5BAv-%C>6y>>#+D4e#&nz^qMDItlpp zTG728+|V&?R13PIEBW(C`uh6d*t-1sZ^XQv;oDD}iYLOV7uVO;{`xl4#4tJ{0;h@! z>)kdc3IhA?Hvj+tA^8La0018VEC2ui01^Na06+!P;3tYuX_ljS7!u|-O)I}TzP1q%xT4HOFwMJaO;2ml)!00$)141pU08x3594IX?4 o5YuAA8yXz~76K1c;3^jg77WP185Rf^u}23N0sR5^q(T4yJ1sVN5dZ)H diff --git a/www/javascript/tiny_mce/plugins/emotions/img/smiley-frown.gif b/www/javascript/tiny_mce/plugins/emotions/img/smiley-frown.gif deleted file mode 100644 index 716f55e161bfebb1c3d34f0b0f40c177fc82c30b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 340 zcmV-a0jvH;Nk%w1VG;lm0MroxK_>;q#>Sw62=mns-On=0wransPVevT^YK{Dy(0YY zH)vE6x0?;Wqb>gZas1^OT0si>`ugD5y87}*#H$s=yq(wA*8cf7{`y+(+9J7|9QfT7 z`ROHiU=Y&6FaQ7mA^8LW0018VEC2ui01^Na000Hi;3tYvX_jM3N`@u~nju9hSuh^r zIEcp-wA7(NL0~2d#RP+(G!CPPA>o*KJjv_CkucCA5=K?AfF#RG2V*8BU@jL304|4P z2;PGRF@bj$et;Jf2pR_mVsIA<85|n}kQ*Bq42Ovqj*yy>6P0=h3X&9Z01yyk~2N4w%7#RW^55W%`0vQ+-6(y_*2pqz~90*;x9}yM}%$UI(7t#$D mK_3Se1{4HKM+6iG7EmeH6$V631{L5n)#CyC0qx-*Apkoyg?w!Q diff --git a/www/javascript/tiny_mce/plugins/emotions/img/smiley-innocent.gif b/www/javascript/tiny_mce/plugins/emotions/img/smiley-innocent.gif deleted file mode 100644 index 334d49e0e60f2997c9ba24071764f95d9e08a5cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 336 zcmV-W0k8f?Nk%w1VG;lm0MrryI4TI-%dP0m5~*+Y`T~ z7Rth){q{I_X%*S48uRZ|(b3V&wIKTX`u+WJzo<^$#wuY;3W|Cf{O29IkTAcaE&lpe z+P*^H)-tknA^-pYA^8LW0018VEC2ui01^Na000He;3tYwX_n)75QgVvNQ`6#5gcMm zEEG~blgXokptKAJgCU?%JT?yos!R6cPtcQWh2siHlNI2L}ifQhgX02^InZ2?-ktkqVRyZJY^Trk|lv zovp437?1~d46O)?2(1i+2NDYk8<+_Kil!K!3njA^!I#dL8x<729}*B65mC=m5gHH@ iDi9P3f*VjB3KS4HDb_qqRul{0DIT=Nk%w1VG;lm0Mrx!QauaC#>Vb6G=_5=^YB^9wrc376Sb5I-qJGf@9vZ# z5WlKU(!eVB+7tfnDXp0zyB`?BZ5IChalob*`uh6d*t+@dKGHcU+L|83yq*5~IoH?L zy`?Gp<{bX|SpWb4A^8LW0018VEC2ui01^Na000Hg;3tYyX_jM3R?Bl7&r(q;SsVx< zNd$5fv{ZsKA$SlL3&KN~a1tZRf*~1Ltkx9~2uL3&z-yb0WJDRY082|tP diff --git a/www/javascript/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/www/javascript/tiny_mce/plugins/emotions/img/smiley-laughing.gif deleted file mode 100644 index 82c5b182e61d32bd394acae551eff180f1eebd26..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 343 zcmV-d0jT~*Nk%w1VG;lm0Q4UK!lp8=s;1-69HWK?p_PpF=Pd8~Ygtcnp*fHAL z**;z>w3iC}`fmL6IkKB1N;3zEa}&zKpsu1;_V)HocR5-{J~BcYvE`YXhBnc@CfU=! za(Ec zG>66zv=rqr;2j)}gKqE$ekcSD?}0=WLB?AWp85)qALd+P=4)6X4oXy{bw2>K^d$ z@6ERvva+(4ib~41YUkTEn1&#?rzrOHT>1I=Y*h`+%*@WtPUPg|!@EEI_d5LgZ>^Og z-qyBKJqy*wF8}}lA^8La0018VEC2ui01^Na06+!6;3tYxX_lj?7+U61R3gAaEg8x< zT>%mSfCwURnWQF&g=Q0ZxH1ulW`QtH0>O!5%iT_X0VBy_@EkOngU8?ye~=H!t21{= z9@Uj3a_UbE88~kh5Eq7rh!7QSBn1c?0|Off1&k^`5*QE<4-gmSR<4C>Dj%C>6W(lWoQPVevT^YB^Fy&h6M z4YZgH{O~qtR1(Ci8T;lQ`uh6d*t-7xar*K{#Jrulo-Wtd*44u?{`oh#n;gQXGXDEo z_}UUC3IeK%0ssI2A^8La0018VEC2ui01^Na06+!R;3tYuX_ljSEE482&%+G^XK%|f zLKbCc4u{4-u|QG~LqamSTo?@JM3OKZAr!|Z2IzP@fY`=CIg$vA3qm46TowfLCt29I z6pDKuvnf~)83+sm9yW#?9s>^(89F=~2?!W44-6Ox2^vNza}fp^9v&G65pp936%Gg+ z6HpTy2o4oGoh+>l3Q)KVQwybl2oo*<4a3D469|nfEii|MH4`}p1_cZp0ssj%2>=2d q41Na?)CpS;4gvxWVpZcR76uLludD?Q1{SnP2NnVU0rZ&)0RTIit8@_n diff --git a/www/javascript/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/www/javascript/tiny_mce/plugins/emotions/img/smiley-surprised.gif deleted file mode 100644 index 0cc9bb71cca4cdeafbb248ce7e07c3708c1cbd64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 338 zcmV-Y0j>T=Nk%w1VG;lm0Q4UK`{WwN#>SnDDC*4*{OcpiwransPVevTQacIr@mkQp zCf(06s)_=>r7UYx48o@u`uh6d*t-7rH~ji<`P&oj;5Wp)o!8ga`SV6TA_BIW5#ZWV z{`*)c32kA}f=futY?#YE7kxGD|7L}4&OEDw$hkm+~<00QS>F_H?J#bz?uEHnl42f5(9 z5O)`6Q9V2o5;YVLUK)Y`7!Nr+4GMq?85s%^2?`BGDRU798Vn2?1`%>22R{iO0u>bk z9tlA?nk*O<3zHJH6&Mp5qALj)E(mxM!Y&vII4dm@1Ov{`f*8pL3xPEVUI>D>1_uxa kNm?`6VH{N6Di;P13m6<67z+;u7qCYM7XkVK^`jvGJD~P?KL7v# diff --git a/www/javascript/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif b/www/javascript/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif deleted file mode 100644 index 2075dc16058f1f17912167675ce5cfb9986fc71d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 328 zcmV-O0k{4~Nk%w1VG;lm0Mrx!CJF+^#>SU@3-{U*rx+Q^wrc$ABfqLn@9*x?z8(4X zSW-O=@){bmmI~g|GQXoP);cvj3|f1M8e@{G*!tYaiCEujj1NGxRN#6#tiCETo+{x{Hkzt z5k-kPvcD=V2nbmjCgL6k{uF&2nP-t0s;w<385Nx2oxDb z9T5Pp7qJl?3Kkh9oe2sCr5F$p7zPSlsUH*@54w*83=9Or4;w)r2pcU95(FL|1Th;< aDaRQH4;Tal7#Y$v#?=Au0pHUfApkpvZg^t= diff --git a/www/javascript/tiny_mce/plugins/emotions/img/smiley-undecided.gif b/www/javascript/tiny_mce/plugins/emotions/img/smiley-undecided.gif deleted file mode 100644 index bef7e257303f8243c89787e7a7f9955dd1f112e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 337 zcmV-X0j~Z>Nk%w1VG;lm0MroxDi#99#>R?y8~4}{%C>6#>?OadPVevTr-=vi@LATn z4rERY-qJF+n+?CCE&B3D{{3Shh?>WT0o%`b%*Voqm`dL;(4F35y zc485^n;g!+Bme*aA^8LW0018VEC2ui01^Na000Hf;3tYvX_jM3N=AnuogqakNi<9X zK?&0kwA8^tNn{?C$|IAYI1ZzT!2>}iuMddFK#NEkRl!7%6brJAnUs;)XcnA}TNBSP zxQ9;SvEfwYeSaGd2^|LqU~(QF1qBxr3Ii7x84ZVt8wCTKoSYAqc?p`G2onnpk`IOl z1`HLGj}riN2p1K12N4z&8IBDc6tEWs859;JtRB6>lf+xO9}yT19toMv8wnl`7(pKg j7zPv!OGgY81{hE&(iR3pP6ig;HPPS!_yOwPA0Yrc)=Yf3 diff --git a/www/javascript/tiny_mce/plugins/emotions/img/smiley-wink.gif b/www/javascript/tiny_mce/plugins/emotions/img/smiley-wink.gif deleted file mode 100644 index 0631c7616ec8624ddeee02b633326f697ee72f80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 350 zcmV-k0ipg!Nk%w1VG;lm0Q4UK(ZVUl#>Sn03F^-g-qAA3wransPV?|t@9*x%vmQ`7 z4E*pcw3rOOq%3t@4*K#({N^40{c-yG`rz2Q!KfI-yq*61HrBop*VoqW<}&{JS@_x# zwwfF$4Fdh~IsgCwA^8La0018VEC2ui01^Na06+!X;3tYwX_ljiFp=e23$zWxW@`*G zN?2ty6iUNT!AMdPLn89IbS7WCB_mWF$+hzY-{PWkp(?(Xf;zbH~P z3jOdj?W+^YwrakfE8fyG&5jTBz!3WS`fgM_;MltQ+c}4GO8)(E`S3`@yq&d~5!ct& z)v79NObo)O7XSbNA^8LW0018VEC2ui01^Na000He;3tYwX_jM3QifI(nn6h_*=Wyk zUB{y}v=qYOIUF#R3dZPhAVv~H;(|a2yN_5FH&J0|$eJ3kw4gj1Y?v5d#>LMV12^6BYy$1)ZKA zga!|m2?POz0R)f>4+aPl8KD{gz`+G_9vLMFQU?RU!8uyH9}*i52|cC+7S0YEK_3Vk i1|APfM-Ltb8&4_H83sg61{vHn(cc000qNZzApkp - - - {#example_dlg.title} - - - - - -
-

Here is a example dialog.

-

Selected text:

-

Custom arg:

- -
- - -
-
- - - diff --git a/www/javascript/tiny_mce/plugins/example/editor_plugin.js b/www/javascript/tiny_mce/plugins/example/editor_plugin.js deleted file mode 100644 index ec1f81ea4..000000000 --- a/www/javascript/tiny_mce/plugins/example/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/example/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/example/editor_plugin_src.js deleted file mode 100644 index 9a0e7da15..000000000 --- a/www/javascript/tiny_mce/plugins/example/editor_plugin_src.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - // Load plugin specific language pack - tinymce.PluginManager.requireLangPack('example'); - - tinymce.create('tinymce.plugins.ExamplePlugin', { - /** - * Initializes the plugin, this will be executed after the plugin has been created. - * This call is done before the editor instance has finished it's initialization so use the onInit event - * of the editor instance to intercept that event. - * - * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in. - * @param {string} url Absolute URL to where the plugin is located. - */ - init : function(ed, url) { - // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); - ed.addCommand('mceExample', function() { - ed.windowManager.open({ - file : url + '/dialog.htm', - width : 320 + parseInt(ed.getLang('example.delta_width', 0)), - height : 120 + parseInt(ed.getLang('example.delta_height', 0)), - inline : 1 - }, { - plugin_url : url, // Plugin absolute URL - some_custom_arg : 'custom arg' // Custom argument - }); - }); - - // Register example button - ed.addButton('example', { - title : 'example.desc', - cmd : 'mceExample', - image : url + '/img/example.gif' - }); - - // Add a node change handler, selects the button in the UI when a image is selected - ed.onNodeChange.add(function(ed, cm, n) { - cm.setActive('example', n.nodeName == 'IMG'); - }); - }, - - /** - * Creates control instances based in the incomming name. This method is normally not - * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons - * but you sometimes need to create more complex controls like listboxes, split buttons etc then this - * method can be used to create those. - * - * @param {String} n Name of the control to create. - * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control. - * @return {tinymce.ui.Control} New control instance or null if no control was created. - */ - createControl : function(n, cm) { - return null; - }, - - /** - * Returns information about the plugin as a name/value array. - * The current keys are longname, author, authorurl, infourl and version. - * - * @return {Object} Name/value array containing information about the plugin. - */ - getInfo : function() { - return { - longname : 'Example plugin', - author : 'Some author', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example', - version : "1.0" - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/example/img/example.gif b/www/javascript/tiny_mce/plugins/example/img/example.gif deleted file mode 100644 index 1ab5da4461113d2af579898528246fdbe52ecd00..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 87 zcmZ?wbhEHb6k!lyn83&Y1dNP~ia%L^OhyJB5FaGNz@*pGzw+SQ`#f{}FJ-?!v#V)e mtsGNfpJeCKSAiOz**>0`XR2{OVa>-G_df0vaY"}i=f.getAll("title")[0];if(i&&i.firstChild){h.metatitle=i.firstChild.value}b(f.getAll("meta"),function(m){var k=m.attr("name"),j=m.attr("http-equiv"),l;if(k){h["meta"+k.toLowerCase()]=m.attr("content")}else{if(j=="Content-Type"){l=/charset\s*=\s*(.*)\s*/gi.exec(m.attr("content"));if(l){h.docencoding=l[1]}}}});i=f.getAll("html")[0];if(i){h.langcode=d(i,"lang")||d(i,"xml:lang")}i=f.getAll("link")[0];if(i&&i.attr("rel")=="stylesheet"){h.stylesheet=i.attr("href")}i=f.getAll("body")[0];if(i){h.langdir=d(i,"dir");h.style=d(i,"style");h.visited_color=d(i,"vlink");h.link_color=d(i,"link");h.active_color=d(i,"alink")}return h},_dataToHtml:function(g){var f,d,h,j,k,e=this.editor.dom;function c(n,l,m){n.attr(l,m?m:undefined)}function i(l){if(d.firstChild){d.insert(l,d.firstChild)}else{d.append(l)}}f=this._parseHeader();d=f.getAll("head")[0];if(!d){j=f.getAll("html")[0];d=new a("head",1);if(j.firstChild){j.insert(d,j.firstChild,true)}else{j.append(d)}}j=f.firstChild;if(g.xml_pi){k='version="1.0"';if(g.docencoding){k+=' encoding="'+g.docencoding+'"'}if(j.type!=7){j=new a("xml",7);f.insert(j,f.firstChild,true)}j.value=k}else{if(j&&j.type==7){j.remove()}}j=f.getAll("#doctype")[0];if(g.doctype){if(!j){j=new a("#doctype",10);if(g.xml_pi){f.insert(j,f.firstChild)}else{i(j)}}j.value=g.doctype.substring(9,g.doctype.length-1)}else{if(j){j.remove()}}j=f.getAll("title")[0];if(g.metatitle){if(!j){j=new a("title",1);j.append(new a("#text",3)).value=g.metatitle;i(j)}}if(g.docencoding){j=null;b(f.getAll("meta"),function(l){if(l.attr("http-equiv")=="Content-Type"){j=l}});if(!j){j=new a("meta",1);j.attr("http-equiv","Content-Type");j.shortEnded=true;i(j)}j.attr("content","text/html; charset="+g.docencoding)}b("keywords,description,author,copyright,robots".split(","),function(m){var l=f.getAll("meta"),n,p,o=g["meta"+m];for(n=0;n"))},_parseHeader:function(){return new tinymce.html.DomParser({validate:false,root_name:"#document"}).parse(this.head)},_setContent:function(g,d){var m=this,i,c,h=d.content,f,l="",e=m.editor.dom,j;function k(n){return n.replace(/<\/?[A-Z]+/g,function(o){return o.toLowerCase()})}if(d.format=="raw"&&m.head){return}if(d.source_view&&g.getParam("fullpage_hide_in_source_view")){return}h=h.replace(/<(\/?)BODY/gi,"<$1body");i=h.indexOf("",i);m.head=k(h.substring(0,i+1));c=h.indexOf("\n"}f=m._parseHeader();b(f.getAll("style"),function(n){if(n.firstChild){l+=n.firstChild.value}});j=f.getAll("body")[0];if(j){e.setAttribs(m.editor.getBody(),{style:j.attr("style")||"",dir:j.attr("dir")||"",vLink:j.attr("vlink")||"",link:j.attr("link")||"",aLink:j.attr("alink")||""})}if(l){e.add(m.editor.getDoc().getElementsByTagName("head")[0],"style",{id:"fullpage_styles"},l)}else{e.remove("fullpage_styles")}},_getDefaultHeader:function(){var f="",c=this.editor,e,d="";if(c.getParam("fullpage_default_xml_pi")){f+='\n'}f+=c.getParam("fullpage_default_doctype",'');f+="\n\n\n";if(e=c.getParam("fullpage_default_title")){f+=""+e+"\n"}if(e=c.getParam("fullpage_default_encoding")){f+='\n'}if(e=c.getParam("fullpage_default_font_family")){d+="font-family: "+e+";"}if(e=c.getParam("fullpage_default_font_size")){d+="font-size: "+e+";"}if(e=c.getParam("fullpage_default_text_color")){d+="color: "+e+";"}f+="\n\n";return f},_getContent:function(d,e){var c=this;if(!e.source_view||!d.getParam("fullpage_hide_in_source_view")){e.content=tinymce.trim(c.head)+"\n"+tinymce.trim(e.content)+"\n"+tinymce.trim(c.foot)}}});tinymce.PluginManager.add("fullpage",tinymce.plugins.FullPagePlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/fullpage/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/fullpage/editor_plugin_src.js deleted file mode 100644 index 5725b5615..000000000 --- a/www/javascript/tiny_mce/plugins/fullpage/editor_plugin_src.js +++ /dev/null @@ -1,399 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each, Node = tinymce.html.Node; - - tinymce.create('tinymce.plugins.FullPagePlugin', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceFullPageProperties', function() { - ed.windowManager.open({ - file : url + '/fullpage.htm', - width : 430 + parseInt(ed.getLang('fullpage.delta_width', 0)), - height : 495 + parseInt(ed.getLang('fullpage.delta_height', 0)), - inline : 1 - }, { - plugin_url : url, - data : t._htmlToData() - }); - }); - - // Register buttons - ed.addButton('fullpage', {title : 'fullpage.desc', cmd : 'mceFullPageProperties'}); - - ed.onBeforeSetContent.add(t._setContent, t); - ed.onGetContent.add(t._getContent, t); - }, - - getInfo : function() { - return { - longname : 'Fullpage', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private plugin internal methods - - _htmlToData : function() { - var headerFragment = this._parseHeader(), data = {}, nodes, elm, matches, editor = this.editor; - - function getAttr(elm, name) { - var value = elm.attr(name); - - return value || ''; - }; - - // Default some values - data.fontface = editor.getParam("fullpage_default_fontface", ""); - data.fontsize = editor.getParam("fullpage_default_fontsize", ""); - - // Parse XML PI - elm = headerFragment.firstChild; - if (elm.type == 7) { - data.xml_pi = true; - matches = /encoding="([^"]+)"/.exec(elm.value); - if (matches) - data.docencoding = matches[1]; - } - - // Parse doctype - elm = headerFragment.getAll('#doctype')[0]; - if (elm) - data.doctype = '"; - - // Parse title element - elm = headerFragment.getAll('title')[0]; - if (elm && elm.firstChild) { - data.metatitle = elm.firstChild.value; - } - - // Parse meta elements - each(headerFragment.getAll('meta'), function(meta) { - var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), matches; - - if (name) - data['meta' + name.toLowerCase()] = meta.attr('content'); - else if (httpEquiv == "Content-Type") { - matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content')); - - if (matches) - data.docencoding = matches[1]; - } - }); - - // Parse html attribs - elm = headerFragment.getAll('html')[0]; - if (elm) - data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); - - // Parse stylesheet - elm = headerFragment.getAll('link')[0]; - if (elm && elm.attr('rel') == 'stylesheet') - data.stylesheet = elm.attr('href'); - - // Parse body parts - elm = headerFragment.getAll('body')[0]; - if (elm) { - data.langdir = getAttr(elm, 'dir'); - data.style = getAttr(elm, 'style'); - data.visited_color = getAttr(elm, 'vlink'); - data.link_color = getAttr(elm, 'link'); - data.active_color = getAttr(elm, 'alink'); - } - - return data; - }, - - _dataToHtml : function(data) { - var headerFragment, headElement, html, elm, value, dom = this.editor.dom; - - function setAttr(elm, name, value) { - elm.attr(name, value ? value : undefined); - }; - - function addHeadNode(node) { - if (headElement.firstChild) - headElement.insert(node, headElement.firstChild); - else - headElement.append(node); - }; - - headerFragment = this._parseHeader(); - headElement = headerFragment.getAll('head')[0]; - if (!headElement) { - elm = headerFragment.getAll('html')[0]; - headElement = new Node('head', 1); - - if (elm.firstChild) - elm.insert(headElement, elm.firstChild, true); - else - elm.append(headElement); - } - - // Add/update/remove XML-PI - elm = headerFragment.firstChild; - if (data.xml_pi) { - value = 'version="1.0"'; - - if (data.docencoding) - value += ' encoding="' + data.docencoding + '"'; - - if (elm.type != 7) { - elm = new Node('xml', 7); - headerFragment.insert(elm, headerFragment.firstChild, true); - } - - elm.value = value; - } else if (elm && elm.type == 7) - elm.remove(); - - // Add/update/remove doctype - elm = headerFragment.getAll('#doctype')[0]; - if (data.doctype) { - if (!elm) { - elm = new Node('#doctype', 10); - - if (data.xml_pi) - headerFragment.insert(elm, headerFragment.firstChild); - else - addHeadNode(elm); - } - - elm.value = data.doctype.substring(9, data.doctype.length - 1); - } else if (elm) - elm.remove(); - - // Add/update/remove title - elm = headerFragment.getAll('title')[0]; - if (data.metatitle) { - if (!elm) { - elm = new Node('title', 1); - elm.append(new Node('#text', 3)).value = data.metatitle; - addHeadNode(elm); - } - } - - // Add meta encoding - if (data.docencoding) { - elm = null; - each(headerFragment.getAll('meta'), function(meta) { - if (meta.attr('http-equiv') == 'Content-Type') - elm = meta; - }); - - if (!elm) { - elm = new Node('meta', 1); - elm.attr('http-equiv', 'Content-Type'); - elm.shortEnded = true; - addHeadNode(elm); - } - - elm.attr('content', 'text/html; charset=' + data.docencoding); - } - - // Add/update/remove meta - each('keywords,description,author,copyright,robots'.split(','), function(name) { - var nodes = headerFragment.getAll('meta'), i, meta, value = data['meta' + name]; - - for (i = 0; i < nodes.length; i++) { - meta = nodes[i]; - - if (meta.attr('name') == name) { - if (value) - meta.attr('content', value); - else - meta.remove(); - - return; - } - } - - if (value) { - elm = new Node('meta', 1); - elm.attr('name', name); - elm.attr('content', value); - elm.shortEnded = true; - - addHeadNode(elm); - } - }); - - // Add/update/delete link - elm = headerFragment.getAll('link')[0]; - if (elm && elm.attr('rel') == 'stylesheet') { - if (data.stylesheet) - elm.attr('href', data.stylesheet); - else - elm.remove(); - } else if (data.stylesheet) { - elm = new Node('link', 1); - elm.attr({ - rel : 'stylesheet', - text : 'text/css', - href : data.stylesheet - }); - elm.shortEnded = true; - - addHeadNode(elm); - } - - // Update body attributes - elm = headerFragment.getAll('body')[0]; - if (elm) { - setAttr(elm, 'dir', data.langdir); - setAttr(elm, 'style', data.style); - setAttr(elm, 'vlink', data.visited_color); - setAttr(elm, 'link', data.link_color); - setAttr(elm, 'alink', data.active_color); - - // Update iframe body as well - dom.setAttribs(this.editor.getBody(), { - style : data.style, - dir : data.dir, - vLink : data.visited_color, - link : data.link_color, - aLink : data.active_color - }); - } - - // Set html attributes - elm = headerFragment.getAll('html')[0]; - if (elm) { - setAttr(elm, 'lang', data.langcode); - setAttr(elm, 'xml:lang', data.langcode); - } - - // Serialize header fragment and crop away body part - html = new tinymce.html.Serializer({ - validate: false, - indent: true, - apply_source_formatting : true, - indent_before: 'head,html,body,meta,title,script,link,style', - indent_after: 'head,html,body,meta,title,script,link,style' - }).serialize(headerFragment); - - this.head = html.substring(0, html.indexOf('')); - }, - - _parseHeader : function() { - // Parse the contents with a DOM parser - return new tinymce.html.DomParser({ - validate: false, - root_name: '#document' - }).parse(this.head); - }, - - _setContent : function(ed, o) { - var self = this, startPos, endPos, content = o.content, headerFragment, styles = '', dom = self.editor.dom, elm; - - function low(s) { - return s.replace(/<\/?[A-Z]+/g, function(a) { - return a.toLowerCase(); - }) - }; - - // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate - if (o.format == 'raw' && self.head) - return; - - if (o.source_view && ed.getParam('fullpage_hide_in_source_view')) - return; - - // Parse out head, body and footer - content = content.replace(/<(\/?)BODY/gi, '<$1body'); - startPos = content.indexOf('', startPos); - self.head = low(content.substring(0, startPos + 1)); - - endPos = content.indexOf('\n'; - - header += editor.getParam('fullpage_default_doctype', ''); - header += '\n\n\n'; - - if (value = editor.getParam('fullpage_default_title')) - header += '' + value + '\n'; - - if (value = editor.getParam('fullpage_default_encoding')) - header += '\n'; - - if (value = editor.getParam('fullpage_default_font_family')) - styles += 'font-family: ' + value + ';'; - - if (value = editor.getParam('fullpage_default_font_size')) - styles += 'font-size: ' + value + ';'; - - if (value = editor.getParam('fullpage_default_text_color')) - styles += 'color: ' + value + ';'; - - header += '\n\n'; - - return header; - }, - - _getContent : function(ed, o) { - var self = this; - - if (!o.source_view || !ed.getParam('fullpage_hide_in_source_view')) - o.content = tinymce.trim(self.head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(self.foot); - } - }); - - // Register plugin - tinymce.PluginManager.add('fullpage', tinymce.plugins.FullPagePlugin); -})(); diff --git a/www/javascript/tiny_mce/plugins/fullpage/fullpage.htm b/www/javascript/tiny_mce/plugins/fullpage/fullpage.htm deleted file mode 100644 index 14ab8652e..000000000 --- a/www/javascript/tiny_mce/plugins/fullpage/fullpage.htm +++ /dev/null @@ -1,259 +0,0 @@ - - - - {#fullpage_dlg.title} - - - - - - - -
- - -
-
-
- {#fullpage_dlg.meta_props} - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
 
 
 
 
  - -
-
- -
- {#fullpage_dlg.langprops} - - - - - - - - - - - - - - - - - - - - - - -
- -
  - -
 
- -
 
-
-
- -
-
- {#fullpage_dlg.appearance_textprops} - - - - - - - - - - - - - - - - -
- -
- -
- - - - - -
 
-
-
- -
- {#fullpage_dlg.appearance_bgprops} - - - - - - - - - - -
- - - - - -
 
-
- - - - - -
 
-
-
- -
- {#fullpage_dlg.appearance_marginprops} - - - - - - - - - - - - - - -
-
- -
- {#fullpage_dlg.appearance_linkprops} - - - - - - - - - - - - - - - - - -
- - - - - -
-
- - - - - -
 
-
- - - - - -
 
-
  
-
- -
- {#fullpage_dlg.appearance_style} - - - - - - - - - - -
- - - - -
 
-
-
-
- -
- - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/fullpage/js/fullpage.js b/www/javascript/tiny_mce/plugins/fullpage/js/fullpage.js deleted file mode 100644 index 3f672ad3b..000000000 --- a/www/javascript/tiny_mce/plugins/fullpage/js/fullpage.js +++ /dev/null @@ -1,232 +0,0 @@ -/** - * fullpage.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinyMCEPopup.requireLangPack(); - - var defaultDocTypes = - 'XHTML 1.0 Transitional=,' + - 'XHTML 1.0 Frameset=,' + - 'XHTML 1.0 Strict=,' + - 'XHTML 1.1=,' + - 'HTML 4.01 Transitional=,' + - 'HTML 4.01 Strict=,' + - 'HTML 4.01 Frameset='; - - var defaultEncodings = - 'Western european (iso-8859-1)=iso-8859-1,' + - 'Central European (iso-8859-2)=iso-8859-2,' + - 'Unicode (UTF-8)=utf-8,' + - 'Chinese traditional (Big5)=big5,' + - 'Cyrillic (iso-8859-5)=iso-8859-5,' + - 'Japanese (iso-2022-jp)=iso-2022-jp,' + - 'Greek (iso-8859-7)=iso-8859-7,' + - 'Korean (iso-2022-kr)=iso-2022-kr,' + - 'ASCII (us-ascii)=us-ascii'; - - var defaultFontNames = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings'; - var defaultFontSizes = '10px,11px,12px,13px,14px,15px,16px'; - - function setVal(id, value) { - var elm = document.getElementById(id); - - if (elm) { - value = value || ''; - - if (elm.nodeName == "SELECT") - selectByValue(document.forms[0], id, value); - else if (elm.type == "checkbox") - elm.checked = !!value; - else - elm.value = value; - } - }; - - function getVal(id) { - var elm = document.getElementById(id); - - if (elm.nodeName == "SELECT") - return elm.options[elm.selectedIndex].value; - - if (elm.type == "checkbox") - return elm.checked; - - return elm.value; - }; - - window.FullPageDialog = { - changedStyle : function() { - var val, styles = tinyMCEPopup.editor.dom.parseStyle(getVal('style')); - - setVal('fontface', styles['font-face']); - setVal('fontsize', styles['font-size']); - setVal('textcolor', styles['color']); - - if (val = styles['background-image']) - setVal('bgimage', val.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1")); - else - setVal('bgimage', ''); - - setVal('bgcolor', styles['background-color']); - - // Reset margin form elements - setVal('topmargin', ''); - setVal('rightmargin', ''); - setVal('bottommargin', ''); - setVal('leftmargin', ''); - - // Expand margin - if (val = styles['margin']) { - val = val.split(' '); - styles['margin-top'] = val[0] || ''; - styles['margin-right'] = val[1] || val[0] || ''; - styles['margin-bottom'] = val[2] || val[0] || ''; - styles['margin-left'] = val[3] || val[0] || ''; - } - - if (val = styles['margin-top']) - setVal('topmargin', val.replace(/px/, '')); - - if (val = styles['margin-right']) - setVal('rightmargin', val.replace(/px/, '')); - - if (val = styles['margin-bottom']) - setVal('bottommargin', val.replace(/px/, '')); - - if (val = styles['margin-left']) - setVal('leftmargin', val.replace(/px/, '')); - - updateColor('bgcolor_pick', 'bgcolor'); - updateColor('textcolor_pick', 'textcolor'); - }, - - changedStyleProp : function() { - var val, dom = tinyMCEPopup.editor.dom, styles = dom.parseStyle(getVal('style')); - - styles['font-face'] = getVal('fontface'); - styles['font-size'] = getVal('fontsize'); - styles['color'] = getVal('textcolor'); - styles['background-color'] = getVal('bgcolor'); - - if (val = getVal('bgimage')) - styles['background-image'] = "url('" + val + "')"; - else - styles['background-image'] = ''; - - delete styles['margin']; - - if (val = getVal('topmargin')) - styles['margin-top'] = val + "px"; - else - styles['margin-top'] = ''; - - if (val = getVal('rightmargin')) - styles['margin-right'] = val + "px"; - else - styles['margin-right'] = ''; - - if (val = getVal('bottommargin')) - styles['margin-bottom'] = val + "px"; - else - styles['margin-bottom'] = ''; - - if (val = getVal('leftmargin')) - styles['margin-left'] = val + "px"; - else - styles['margin-left'] = ''; - - // Serialize, parse and reserialize this will compress redundant styles - setVal('style', dom.serializeStyle(dom.parseStyle(dom.serializeStyle(styles)))); - this.changedStyle(); - }, - - update : function() { - var data = {}; - - tinymce.each(tinyMCEPopup.dom.select('select,input,textarea'), function(node) { - data[node.id] = getVal(node.id); - }); - - tinyMCEPopup.editor.plugins.fullpage._dataToHtml(data); - tinyMCEPopup.close(); - } - }; - - function init() { - var form = document.forms[0], i, item, list, editor = tinyMCEPopup.editor; - - // Setup doctype select box - list = editor.getParam("fullpage_doctypes", defaultDocTypes).split(','); - for (i = 0; i < list.length; i++) { - item = list[i].split('='); - - if (item.length > 1) - addSelectValue(form, 'doctype', item[0], item[1]); - } - - // Setup fonts select box - list = editor.getParam("fullpage_fonts", defaultFontNames).split(';'); - for (i = 0; i < list.length; i++) { - item = list[i].split('='); - - if (item.length > 1) - addSelectValue(form, 'fontface', item[0], item[1]); - } - - // Setup fontsize select box - list = editor.getParam("fullpage_fontsizes", defaultFontSizes).split(','); - for (i = 0; i < list.length; i++) - addSelectValue(form, 'fontsize', list[i], list[i]); - - // Setup encodings select box - list = editor.getParam("fullpage_encodings", defaultEncodings).split(','); - for (i = 0; i < list.length; i++) { - item = list[i].split('='); - - if (item.length > 1) - addSelectValue(form, 'docencoding', item[0], item[1]); - } - - // Setup color pickers - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - document.getElementById('link_color_pickcontainer').innerHTML = getColorPickerHTML('link_color_pick','link_color'); - document.getElementById('visited_color_pickcontainer').innerHTML = getColorPickerHTML('visited_color_pick','visited_color'); - document.getElementById('active_color_pickcontainer').innerHTML = getColorPickerHTML('active_color_pick','active_color'); - document.getElementById('textcolor_pickcontainer').innerHTML = getColorPickerHTML('textcolor_pick','textcolor'); - document.getElementById('stylesheet_browsercontainer').innerHTML = getBrowserHTML('stylesheetbrowser','stylesheet','file','fullpage'); - document.getElementById('bgimage_pickcontainer').innerHTML = getBrowserHTML('bgimage_browser','bgimage','image','fullpage'); - - // Resize some elements - if (isVisible('stylesheetbrowser')) - document.getElementById('stylesheet').style.width = '220px'; - - if (isVisible('link_href_browser')) - document.getElementById('element_link_href').style.width = '230px'; - - if (isVisible('bgimage_browser')) - document.getElementById('bgimage').style.width = '210px'; - - // Update form - tinymce.each(tinyMCEPopup.getWindowArg('data'), function(value, key) { - setVal(key, value); - }); - - FullPageDialog.changedStyle(); - - // Update colors - updateColor('textcolor_pick', 'textcolor'); - updateColor('bgcolor_pick', 'bgcolor'); - updateColor('visited_color_pick', 'visited_color'); - updateColor('active_color_pick', 'active_color'); - updateColor('link_color_pick', 'link_color'); - }; - - tinyMCEPopup.onInit.add(init); -})(); diff --git a/www/javascript/tiny_mce/plugins/fullpage/langs/en_dlg.js b/www/javascript/tiny_mce/plugins/fullpage/langs/en_dlg.js deleted file mode 100644 index f5801b8b3..000000000 --- a/www/javascript/tiny_mce/plugins/fullpage/langs/en_dlg.js +++ /dev/null @@ -1,85 +0,0 @@ -tinyMCE.addI18n('en.fullpage_dlg',{ -title:"Document properties", -meta_tab:"General", -appearance_tab:"Appearance", -advanced_tab:"Advanced", -meta_props:"Meta information", -langprops:"Language and encoding", -meta_title:"Title", -meta_keywords:"Keywords", -meta_description:"Description", -meta_robots:"Robots", -doctypes:"Doctype", -langcode:"Language code", -langdir:"Language direction", -ltr:"Left to right", -rtl:"Right to left", -xml_pi:"XML declaration", -encoding:"Character encoding", -appearance_bgprops:"Background properties", -appearance_marginprops:"Body margins", -appearance_linkprops:"Link colors", -appearance_textprops:"Text properties", -bgcolor:"Background color", -bgimage:"Background image", -left_margin:"Left margin", -right_margin:"Right margin", -top_margin:"Top margin", -bottom_margin:"Bottom margin", -text_color:"Text color", -font_size:"Font size", -font_face:"Font face", -link_color:"Link color", -hover_color:"Hover color", -visited_color:"Visited color", -active_color:"Active color", -textcolor:"Color", -fontsize:"Font size", -fontface:"Font family", -meta_index_follow:"Index and follow the links", -meta_index_nofollow:"Index and don't follow the links", -meta_noindex_follow:"Do not index but follow the links", -meta_noindex_nofollow:"Do not index and don\'t follow the links", -appearance_style:"Stylesheet and style properties", -stylesheet:"Stylesheet", -style:"Style", -author:"Author", -copyright:"Copyright", -add:"Add new element", -remove:"Remove selected element", -moveup:"Move selected element up", -movedown:"Move selected element down", -head_elements:"Head elements", -info:"Information", -add_title:"Title element", -add_meta:"Meta element", -add_script:"Script element", -add_style:"Style element", -add_link:"Link element", -add_base:"Base element", -add_comment:"Comment node", -title_element:"Title element", -script_element:"Script element", -style_element:"Style element", -base_element:"Base element", -link_element:"Link element", -meta_element:"Meta element", -comment_element:"Comment", -src:"Src", -language:"Language", -href:"Href", -target:"Target", -type:"Type", -charset:"Charset", -defer:"Defer", -media:"Media", -properties:"Properties", -name:"Name", -value:"Value", -content:"Content", -rel:"Rel", -rev:"Rev", -hreflang:"Href lang", -general_props:"General", -advanced_props:"Advanced" -}); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/fullscreen/editor_plugin.js b/www/javascript/tiny_mce/plugins/fullscreen/editor_plugin.js deleted file mode 100644 index 6eae3ec84..000000000 --- a/www/javascript/tiny_mce/plugins/fullscreen/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent({format:"raw"}),{format:"raw"});d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().firstChild);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/fullscreen/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/fullscreen/editor_plugin_src.js deleted file mode 100644 index 3477c86c9..000000000 --- a/www/javascript/tiny_mce/plugins/fullscreen/editor_plugin_src.js +++ /dev/null @@ -1,159 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM; - - tinymce.create('tinymce.plugins.FullScreenPlugin', { - init : function(ed, url) { - var t = this, s = {}, vp, posCss; - - t.editor = ed; - - // Register commands - ed.addCommand('mceFullScreen', function() { - var win, de = DOM.doc.documentElement; - - if (ed.getParam('fullscreen_is_enabled')) { - if (ed.getParam('fullscreen_new_window')) - closeFullscreen(); // Call to close in new window - else { - DOM.win.setTimeout(function() { - tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc); - tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'}); - tinyMCE.remove(ed); - DOM.remove('mce_fullscreen_container'); - de.style.overflow = ed.getParam('fullscreen_html_overflow'); - DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow')); - DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly')); - tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings - }, 10); - } - - return; - } - - if (ed.getParam('fullscreen_new_window')) { - win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight); - try { - win.resizeTo(screen.availWidth, screen.availHeight); - } catch (e) { - // Ignore - } - } else { - tinyMCE.oldSettings = tinyMCE.settings; // Store old settings - s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto'; - s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1); - vp = DOM.getViewPort(); - s.fullscreen_scrollx = vp.x; - s.fullscreen_scrolly = vp.y; - - // Fixes an Opera bug where the scrollbars doesn't reappear - if (tinymce.isOpera && s.fullscreen_overflow == 'visible') - s.fullscreen_overflow = 'auto'; - - // Fixes an IE bug where horizontal scrollbars would appear - if (tinymce.isIE && s.fullscreen_overflow == 'scroll') - s.fullscreen_overflow = 'auto'; - - // Fixes an IE bug where the scrollbars doesn't reappear - if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll')) - s.fullscreen_html_overflow = 'auto'; - - if (s.fullscreen_overflow == '0px') - s.fullscreen_overflow = ''; - - DOM.setStyle(DOM.doc.body, 'overflow', 'hidden'); - de.style.overflow = 'hidden'; //Fix for IE6/7 - vp = DOM.getViewPort(); - DOM.win.scrollTo(0, 0); - - if (tinymce.isIE) - vp.h -= 1; - - // Use fixed position if it exists - if (tinymce.isIE6) - posCss = 'absolute;top:' + vp.y; - else - posCss = 'fixed;top:0'; - - n = DOM.add(DOM.doc.body, 'div', { - id : 'mce_fullscreen_container', - style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'}); - DOM.add(n, 'div', {id : 'mce_fullscreen'}); - - tinymce.each(ed.settings, function(v, n) { - s[n] = v; - }); - - s.id = 'mce_fullscreen'; - s.width = n.clientWidth; - s.height = n.clientHeight - 15; - s.fullscreen_is_enabled = true; - s.fullscreen_editor_id = ed.id; - s.theme_advanced_resizing = false; - s.save_onsavecallback = function() { - ed.setContent(tinyMCE.get(s.id).getContent({format : 'raw'}), {format : 'raw'}); - ed.execCommand('mceSave'); - }; - - tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) { - s[k] = v; - }); - - if (s.theme_advanced_toolbar_location === 'external') - s.theme_advanced_toolbar_location = 'top'; - - t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s); - t.fullscreenEditor.onInit.add(function() { - t.fullscreenEditor.setContent(ed.getContent()); - t.fullscreenEditor.focus(); - }); - - t.fullscreenEditor.render(); - - t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container'); - t.fullscreenElement.update(); - //document.body.overflow = 'hidden'; - - t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() { - var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize; - - // Get outer/inner size to get a delta size that can be used to calc the new iframe size - outerSize = fed.dom.getSize(fed.getContainer().firstChild); - innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]); - - fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h); - }); - } - }); - - // Register buttons - ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'}); - - ed.onNodeChange.add(function(ed, cm) { - cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled')); - }); - }, - - getInfo : function() { - return { - longname : 'Fullscreen', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/fullscreen/fullscreen.htm b/www/javascript/tiny_mce/plugins/fullscreen/fullscreen.htm deleted file mode 100644 index 4c4f27e48..000000000 --- a/www/javascript/tiny_mce/plugins/fullscreen/fullscreen.htm +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - -
- -
- - - - - diff --git a/www/javascript/tiny_mce/plugins/iespell/editor_plugin.js b/www/javascript/tiny_mce/plugins/iespell/editor_plugin.js deleted file mode 100644 index e9cba106c..000000000 --- a/www/javascript/tiny_mce/plugins/iespell/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.IESpell",{init:function(a,b){var c=this,d;if(!tinymce.isIE){return}c.editor=a;a.addCommand("mceIESpell",function(){try{d=new ActiveXObject("ieSpell.ieSpellExtension");d.CheckDocumentNode(a.getDoc().documentElement)}catch(f){if(f.number==-2146827859){a.windowManager.confirm(a.getLang("iespell.download"),function(e){if(e){window.open("http://www.iespell.com/download.php","ieSpellDownload","")}})}else{a.windowManager.alert("Error Loading ieSpell: Exception "+f.number)}}});a.addButton("iespell",{title:"iespell.iespell_desc",cmd:"mceIESpell"})},getInfo:function(){return{longname:"IESpell (IE Only)",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("iespell",tinymce.plugins.IESpell)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/iespell/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/iespell/editor_plugin_src.js deleted file mode 100644 index 1b2bb9846..000000000 --- a/www/javascript/tiny_mce/plugins/iespell/editor_plugin_src.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.IESpell', { - init : function(ed, url) { - var t = this, sp; - - if (!tinymce.isIE) - return; - - t.editor = ed; - - // Register commands - ed.addCommand('mceIESpell', function() { - try { - sp = new ActiveXObject("ieSpell.ieSpellExtension"); - sp.CheckDocumentNode(ed.getDoc().documentElement); - } catch (e) { - if (e.number == -2146827859) { - ed.windowManager.confirm(ed.getLang("iespell.download"), function(s) { - if (s) - window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); - }); - } else - ed.windowManager.alert("Error Loading ieSpell: Exception " + e.number); - } - }); - - // Register buttons - ed.addButton('iespell', {title : 'iespell.iespell_desc', cmd : 'mceIESpell'}); - }, - - getInfo : function() { - return { - longname : 'IESpell (IE Only)', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/iespell', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('iespell', tinymce.plugins.IESpell); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/inlinepopups/editor_plugin.js b/www/javascript/tiny_mce/plugins/inlinepopups/editor_plugin.js deleted file mode 100644 index ef648174f..000000000 --- a/www/javascript/tiny_mce/plugins/inlinepopups/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(s,j){var z=this,i,k="",r=z.editor,g=0,v=0,h,m,o,q,l,x,y,n;s=s||{};j=j||{};if(!s.inline){return z.parent(s,j)}n=z._frontWindow();if(n&&d.get(n.id+"_ifr")){n.focussedElement=d.get(n.id+"_ifr").contentWindow.document.activeElement}if(!s.type){z.bookmark=r.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240)+(tinymce.isIE?8:0);s.min_width=parseInt(s.min_width||150);s.min_height=parseInt(s.min_height||100);s.max_width=parseInt(s.max_width||2000);s.max_height=parseInt(s.max_height||2000);s.left=s.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(s.width/2)));s.top=s.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(s.height/2)));s.movable=s.resizable=true;j.mce_width=s.width;j.mce_height=s.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=s.auto_focus;z.features=s;z.params=j;z.onOpen.dispatch(z,s,j);if(s.type){k+=" mceModal";if(s.type){k+=" mce"+s.type.substring(0,1).toUpperCase()+s.type.substring(1)}s.resizable=false}if(s.statusbar){k+=" mceStatusbar"}if(s.resizable){k+=" mceResizable"}if(s.minimizable){k+=" mceMinimizable"}if(s.maximizable){k+=" mceMaximizable"}if(s.movable){k+=" mceMovable"}z._addAll(d.doc.body,["div",{id:i,role:"dialog","aria-labelledby":s.type?i+"_content":i+"_title","class":(r.settings.inlinepopups_skin||"clearlooks2")+(tinymce.isIE&&window.getSelection?" ie9":""),style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},s.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft",tabindex:"0"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight",tabindex:"0"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!s.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;v+=d.get(i+"_top").clientHeight;v+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:s.top,left:s.left,width:s.width+g,height:s.height+v});y=s.url||s.file;if(y){if(tinymce.relaxedDomain){y+=(y.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}y=tinymce._addVer(y)}if(!s.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:s.width,height:s.height});d.setAttrib(i+"_ifr","src",y)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(s.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",s.content.replace("\n","
"));a.add(i,"keyup",function(f){var p=27;if(f.keyCode===p){s.button_func(false);return a.cancel(f)}});a.add(i,"keydown",function(f){var t,p=9;if(f.keyCode===p){t=d.select("a.mceCancel",i+"_wrapper")[0];if(t&&t!==f.target){t.focus()}else{d.get(i+"_ok").focus()}return a.cancel(f)}})}o=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=z.windows[i];z.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return z._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return z._startDrag(i,t,u.className.substring(13))}}}}}});q=a.add(i,"click",function(f){var p=f.target;z.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":z.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":s.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});a.add([i+"_left",i+"_right"],"focus",function(p){var t=d.get(i+"_ifr");if(t){var f=t.contentWindow.document.body;var u=d.select(":input:enabled,*[tabindex=0]",f);if(p.target.id===(i+"_left")){u[u.length-1].focus()}else{u[0].focus()}}else{d.get(i+"_ok").focus()}});x=z.windows[i]={id:i,mousedown_func:o,click_func:q,element:new b(i,{blocker:1,container:r.getContainer()}),iframeElement:new b(i+"_ifr"),features:s,deltaWidth:g,deltaHeight:v};x.iframeElement.on("focus",function(){z.focus(i)});if(z.count==0&&z.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(z.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:z.zIndex-1}});d.show("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","true")}else{d.setStyle("mceModalBlocker","z-index",z.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}d.setAttrib(i,"aria-hidden","false");z.focus(i);z._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}z.count++;return x},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h;if(f.focussedElement){f.focussedElement.focus()}else{if(d.get(h+"_ok")){d.get(f.id+"_ok").focus()}else{if(d.get(f.id+"_ifr")){d.get(f.id+"_ifr").focus()}}}}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;gf){g=h;f=h.zIndex}});return g},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/inlinepopups/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/inlinepopups/editor_plugin_src.js deleted file mode 100644 index ac6fb1cb9..000000000 --- a/www/javascript/tiny_mce/plugins/inlinepopups/editor_plugin_src.js +++ /dev/null @@ -1,696 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is; - - tinymce.create('tinymce.plugins.InlinePopups', { - init : function(ed, url) { - // Replace window manager - ed.onBeforeRenderUI.add(function() { - ed.windowManager = new tinymce.InlineWindowManager(ed); - DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css"); - }); - }, - - getInfo : function() { - return { - longname : 'InlinePopups', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', { - InlineWindowManager : function(ed) { - var t = this; - - t.parent(ed); - t.zIndex = 300000; - t.count = 0; - t.windows = {}; - }, - - open : function(f, p) { - var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u, parentWindow; - - f = f || {}; - p = p || {}; - - // Run native windows - if (!f.inline) - return t.parent(f, p); - - parentWindow = t._frontWindow(); - if (parentWindow && DOM.get(parentWindow.id + '_ifr')) { - parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement; - } - - // Only store selection if the type is a normal window - if (!f.type) - t.bookmark = ed.selection.getBookmark(1); - - id = DOM.uniqueId(); - vp = DOM.getViewPort(); - f.width = parseInt(f.width || 320); - f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0); - f.min_width = parseInt(f.min_width || 150); - f.min_height = parseInt(f.min_height || 100); - f.max_width = parseInt(f.max_width || 2000); - f.max_height = parseInt(f.max_height || 2000); - f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0))); - f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0))); - f.movable = f.resizable = true; - p.mce_width = f.width; - p.mce_height = f.height; - p.mce_inline = true; - p.mce_window_id = id; - p.mce_auto_focus = f.auto_focus; - - // Transpose -// po = DOM.getPos(ed.getContainer()); -// f.left -= po.x; -// f.top -= po.y; - - t.features = f; - t.params = p; - t.onOpen.dispatch(t, f, p); - - if (f.type) { - opt += ' mceModal'; - - if (f.type) - opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1); - - f.resizable = false; - } - - if (f.statusbar) - opt += ' mceStatusbar'; - - if (f.resizable) - opt += ' mceResizable'; - - if (f.minimizable) - opt += ' mceMinimizable'; - - if (f.maximizable) - opt += ' mceMaximizable'; - - if (f.movable) - opt += ' mceMovable'; - - // Create DOM objects - t._addAll(DOM.doc.body, - ['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'}, - ['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt}, - ['div', {id : id + '_top', 'class' : 'mceTop'}, - ['div', {'class' : 'mceLeft'}], - ['div', {'class' : 'mceCenter'}], - ['div', {'class' : 'mceRight'}], - ['span', {id : id + '_title'}, f.title || ''] - ], - - ['div', {id : id + '_middle', 'class' : 'mceMiddle'}, - ['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}], - ['span', {id : id + '_content'}], - ['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}] - ], - - ['div', {id : id + '_bottom', 'class' : 'mceBottom'}, - ['div', {'class' : 'mceLeft'}], - ['div', {'class' : 'mceCenter'}], - ['div', {'class' : 'mceRight'}], - ['span', {id : id + '_status'}, 'Content'] - ], - - ['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}], - ['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}], - ['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}], - ['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}] - ] - ] - ); - - DOM.setStyles(id, {top : -10000, left : -10000}); - - // Fix gecko rendering bug, where the editors iframe messed with window contents - if (tinymce.isGecko) - DOM.setStyle(id, 'overflow', 'auto'); - - // Measure borders - if (!f.type) { - dw += DOM.get(id + '_left').clientWidth; - dw += DOM.get(id + '_right').clientWidth; - dh += DOM.get(id + '_top').clientHeight; - dh += DOM.get(id + '_bottom').clientHeight; - } - - // Resize window - DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh}); - - u = f.url || f.file; - if (u) { - if (tinymce.relaxedDomain) - u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain; - - u = tinymce._addVer(u); - } - - if (!f.type) { - DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'}); - DOM.setStyles(id + '_ifr', {width : f.width, height : f.height}); - DOM.setAttrib(id + '_ifr', 'src', u); - } else { - DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok'); - - if (f.type == 'confirm') - DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel'); - - DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'}); - DOM.setHTML(id + '_content', f.content.replace('\n', '
')); - - Event.add(id, 'keyup', function(evt) { - var VK_ESCAPE = 27; - if (evt.keyCode === VK_ESCAPE) { - f.button_func(false); - return Event.cancel(evt); - } - }); - - Event.add(id, 'keydown', function(evt) { - var cancelButton, VK_TAB = 9; - if (evt.keyCode === VK_TAB) { - cancelButton = DOM.select('a.mceCancel', id + '_wrapper')[0]; - if (cancelButton && cancelButton !== evt.target) { - cancelButton.focus(); - } else { - DOM.get(id + '_ok').focus(); - } - return Event.cancel(evt); - } - }); - } - - // Register events - mdf = Event.add(id, 'mousedown', function(e) { - var n = e.target, w, vp; - - w = t.windows[id]; - t.focus(id); - - if (n.nodeName == 'A' || n.nodeName == 'a') { - if (n.className == 'mceMax') { - w.oldPos = w.element.getXY(); - w.oldSize = w.element.getSize(); - - vp = DOM.getViewPort(); - - // Reduce viewport size to avoid scrollbars - vp.w -= 2; - vp.h -= 2; - - w.element.moveTo(vp.x, vp.y); - w.element.resizeTo(vp.w, vp.h); - DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight}); - DOM.addClass(id + '_wrapper', 'mceMaximized'); - } else if (n.className == 'mceMed') { - // Reset to old size - w.element.moveTo(w.oldPos.x, w.oldPos.y); - w.element.resizeTo(w.oldSize.w, w.oldSize.h); - w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight); - - DOM.removeClass(id + '_wrapper', 'mceMaximized'); - } else if (n.className == 'mceMove') - return t._startDrag(id, e, n.className); - else if (DOM.hasClass(n, 'mceResize')) - return t._startDrag(id, e, n.className.substring(13)); - } - }); - - clf = Event.add(id, 'click', function(e) { - var n = e.target; - - t.focus(id); - - if (n.nodeName == 'A' || n.nodeName == 'a') { - switch (n.className) { - case 'mceClose': - t.close(null, id); - return Event.cancel(e); - - case 'mceButton mceOk': - case 'mceButton mceCancel': - f.button_func(n.className == 'mceButton mceOk'); - return Event.cancel(e); - } - } - }); - - // Make sure the tab order loops within the dialog. - Event.add([id + '_left', id + '_right'], 'focus', function(evt) { - var iframe = DOM.get(id + '_ifr'); - if (iframe) { - var body = iframe.contentWindow.document.body; - var focusable = DOM.select(':input:enabled,*[tabindex=0]', body); - if (evt.target.id === (id + '_left')) { - focusable[focusable.length - 1].focus(); - } else { - focusable[0].focus(); - } - } else { - DOM.get(id + '_ok').focus(); - } - }); - - // Add window - w = t.windows[id] = { - id : id, - mousedown_func : mdf, - click_func : clf, - element : new Element(id, {blocker : 1, container : ed.getContainer()}), - iframeElement : new Element(id + '_ifr'), - features : f, - deltaWidth : dw, - deltaHeight : dh - }; - - w.iframeElement.on('focus', function() { - t.focus(id); - }); - - // Setup blocker - if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') { - DOM.add(DOM.doc.body, 'div', { - id : 'mceModalBlocker', - 'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker', - style : {zIndex : t.zIndex - 1} - }); - - DOM.show('mceModalBlocker'); // Reduces flicker in IE - DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'true'); - } else - DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1); - - if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel)) - DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2}); - - DOM.setAttrib(id, 'aria-hidden', 'false'); - t.focus(id); - t._fixIELayout(id, 1); - - // Focus ok button - if (DOM.get(id + '_ok')) - DOM.get(id + '_ok').focus(); - t.count++; - - return w; - }, - - focus : function(id) { - var t = this, w; - - if (w = t.windows[id]) { - w.zIndex = this.zIndex++; - w.element.setStyle('zIndex', w.zIndex); - w.element.update(); - - id = id + '_wrapper'; - DOM.removeClass(t.lastId, 'mceFocus'); - DOM.addClass(id, 'mceFocus'); - t.lastId = id; - - if (w.focussedElement) { - w.focussedElement.focus(); - } else if (DOM.get(id + '_ok')) { - DOM.get(w.id + '_ok').focus(); - } else if (DOM.get(w.id + '_ifr')) { - DOM.get(w.id + '_ifr').focus(); - } - } - }, - - _addAll : function(te, ne) { - var i, n, t = this, dom = tinymce.DOM; - - if (is(ne, 'string')) - te.appendChild(dom.doc.createTextNode(ne)); - else if (ne.length) { - te = te.appendChild(dom.create(ne[0], ne[1])); - - for (i=2; i ix) { - fw = w; - ix = w.zIndex; - } - }); - return fw; - }, - - setTitle : function(w, ti) { - var e; - - w = this._findId(w); - - if (e = DOM.get(w + '_title')) - e.innerHTML = DOM.encode(ti); - }, - - alert : function(txt, cb, s) { - var t = this, w; - - w = t.open({ - title : t, - type : 'alert', - button_func : function(s) { - if (cb) - cb.call(s || t, s); - - t.close(null, w.id); - }, - content : DOM.encode(t.editor.getLang(txt, txt)), - inline : 1, - width : 400, - height : 130 - }); - }, - - confirm : function(txt, cb, s) { - var t = this, w; - - w = t.open({ - title : t, - type : 'confirm', - button_func : function(s) { - if (cb) - cb.call(s || t, s); - - t.close(null, w.id); - }, - content : DOM.encode(t.editor.getLang(txt, txt)), - inline : 1, - width : 400, - height : 130 - }); - }, - - // Internal functions - - _findId : function(w) { - var t = this; - - if (typeof(w) == 'string') - return w; - - each(t.windows, function(wo) { - var ifr = DOM.get(wo.id + '_ifr'); - - if (ifr && w == ifr.contentWindow) { - w = wo.id; - return false; - } - }); - - return w; - }, - - _fixIELayout : function(id, s) { - var w, img; - - if (!tinymce.isIE6) - return; - - // Fixes the bug where hover flickers and does odd things in IE6 - each(['n','s','w','e','nw','ne','sw','se'], function(v) { - var e = DOM.get(id + '_resize_' + v); - - DOM.setStyles(e, { - width : s ? e.clientWidth : '', - height : s ? e.clientHeight : '', - cursor : DOM.getStyle(e, 'cursor', 1) - }); - - DOM.setStyle(id + "_bottom", 'bottom', '-1px'); - - e = 0; - }); - - // Fixes graphics glitch - if (w = this.windows[id]) { - // Fixes rendering bug after resize - w.element.hide(); - w.element.show(); - - // Forced a repaint of the window - //DOM.get(id).style.filter = ''; - - // IE has a bug where images used in CSS won't get loaded - // sometimes when the cache in the browser is disabled - // This fix tries to solve it by loading the images using the image object - each(DOM.select('div,a', id), function(e, i) { - if (e.currentStyle.backgroundImage != 'none') { - img = new Image(); - img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1'); - } - }); - - DOM.get(id).style.filter = ''; - } - } - }); - - // Register plugin - tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups); -})(); - diff --git a/www/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif b/www/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif deleted file mode 100644 index 219139857ead162c6c83fa92e4a36eb978359b70..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 810 zcmV+_1J(RTNk%v~VITk?0QP$T|NsBgZf>Is3*B5?sT&&Hqoc$;Jkrt6&k+&QHa5gV zL)l77I5;@fLqpYMWVc- z$;Z;u(cpZ1*{!X#QBc56PRYv1%goBm&CA4*kj9vnyFxN007q4)xCFi000000000000000EC2ui03ZM$000O7 zfO>+1goTEOh>41ejE#Ddx`lYP=u<6#D$nuIz(SWI zEFA^}1Gr=fzyf({6gh@S$E;fb0W@inbw`OH0<0jyAcaV_tY`tu;Q-}9nL~DuW|c$B zfB{+;EgA@rVMxoncy#S%&Cx=|gM5Uj%<`AEF#ro5b_h^H$lZ~%j?uQsqv1gcLINnz z$V0lc>C>q5v`E0^fS@#T44@D}8^s49D{>FmJ;a6Y1;88FsF47UkqoaP7{SB5x%21H on;U^3X3&`#Kb|Dn&b_<$?>}ZBkL3i3`Sa-0r$^%&nWI1eJN~S2!T1AL!8o=VbdauRnv)25R3VTvA=Vh!~_a@6HSLb|**VT%3)4#v_zecXW!-k{VZ-e zYiw<6@2F~4>g?_7FYjibFlA~}%e0v@C(W8Wb*_&)DBrWN@OfznH1FT4{BUps!wTd|YdJ0002^_xJYp^u)%)d3$)z&B_1&{{R30 z000000000000000A^8LW000^QEC2ui0CWH_000I5phk>jX`ZJhqHH^=Zk(=iEn-2g z?|i>wBOI?nEEih2q)UH?AHyg7~@-@+VH6!(;c_ zxnl@0-@$+5z5y6S@uA0c2rFuI7V_gjj3zt(raakjrMZ$WvB8W9atTdoP;NHMsS_E` zo&bQ*s1XAOQ5i;$x=5;&g^B@Cqe`7hmFm-~ShGUCs0c-^w)`cdp#12=eOP%eQY|sD1+r)(d#BVZMbAD~4*IvE#>(BS&T|xw7TPlrL+3 zoO$zRs18Dl9!)zw58wX%{rd5@fPehOCg6KeHK5@Cf($n3po0lM*gyda7AK*C5k5#^gBwbip@gwr zxFA#zlxU)fn3pyG@#n&{$-F`k&?i#Os}T#YskFu{;S5}9I=NKOD% zl13IcK>xnz`3B3WgWQ!)wLkXuHnZ0c5HvW}0r6=_Zpm`ce)8x0(|!A=bwNAx@Vw%7Dp(bgC44=paU%GsGm?BAnBx(R%)rGkzT6lrjlmL z>8F%>3M!~kDPZcUsHUnas#2}$>Z=O03hS(=%1Z03TZN@7Sh{A#Yp+%P3hY!W2w?27 z$R?|-vc)dz?6bx;3+=SXN=q&OwHg>}*IdYMD_6JPx&>~yY8|WCxyGKWSi0&O#%{ZU z8SB}+^3J(S<94K>q#ugahfi?d(AAt1bTp(;R8!O__ z4hjuog&|&Ow1y6L_~6nY!bY^QK&A*J1XR};BaJ(@)KE`%6)&h8Wq?g93 z?c|kAwoPS{a3?9ZmalP{H`@ZtDW{vp&e>*|d8!$>oy!S+xSFqx+4!8sJ}PKTu0Ct)uD=R znI-zTdit_%`kX1XwzT=HMfsK@_J>ZF~`Wpm{14%#gX`?RrPxW_?tKTt2vcW z2>QE!xVg8it*iEY1oe3U*4Nd~$-n>r00000000000000000000EC2ui03ZM$000O7 zfOvv~gm?`F4o?Cg0#6PF4TX}EcwG(x5lCAjW+Pij5dscfl$1#VUuGE{0IjYW2VVk7 z5T%0+1Q8<=O0K@HMI#Xek);g`Mh92F%&$fa#ghcdz0KAc8w9nIO}f?A*AY#Uc?QbO z3RLO});$J!g;5v0=nMAj%^ep}gir!z-+rO6w*Un=4+5YJDiFZ~I2Q!xfRmu3z#s=| zihz4T@CCRUY8(uDQlbX9GX%kWEb(N}zkt6a5bW@S#*YBZWC(Bx@FPJRcY+3`q2d)A zmpx#*`mrL2J)uzF{Ai_fBnOke0ssw~U_pYYQE6~!DagSGIIXnWiQ2(U2e47_$%qtG zKtl_-P`Bc}lcVA-0SHd)Rj{DU-aA7Q5{fb)$6lukR^TP_fghoAf$`3v(q`|FciePj zJ`5Lzj&afk40%I3YKsBdC>>Kxp>@z91EARoLqLOw8Eg0E5TStp1}jr0SxLdA!VxyA zTM#iJc<2lS0|XplvLpqLZT(nO0fGgM1vVN!2oVuSgpdy!*jPa0LraD3QY1MMPyWV) z5M!Jt2O|PlAVvri?2tta_j#uua~06xgMa@$K*EIEGPkB#}sYrS(hdInBZpyW+|1vW7c?#%0ZK)9R8@uU$7A%*K`47Ku)&&@N8% zYK4`}Z?(#q)nzsJ;d4P#TS@)v!Eck-?^kOUr>&MXooZI6QXu6`cgvfGK6NyRP`l0I zbUL24e{$GuZ=Tk)b;~w3oNZk)lVQ14(q~xFwmqvbt?JB%Wl>kZ(_t4$`g=#dTP!FfZc90uIhs65nZyc!gn8KV?V^`fOK%epx0W~O)FaE->(0k z?N*!%1i?_`Kh=Lv7=%p(X0u)L3pjdSo+ZClpSM3^jOZ=j+CO8eJz!t zq0G`~;ye*V;nnyBVl=9W>Jj!cd0-F0N&tsQ8zkEnF;O24JZ?^&qO;nwIHcqN+QW1R89rxky}AI}=gmx4Tw`N1SlNC{7h0s;mS9Zt)}#|SIi=REJiRqNljiTH@k0@h zx>r*jSI^6*BI>TpNc;poVS4>2-YcJQ#?7&Nd)eix@@huXX@A74D!h?VgENw#pGCd% zsxdBiJjhjk58aQsL`ifN^D`QSq1}1pNdyf@Mne4A*(&$hR50t$mZ#==bMuuaZyc{W z3OccYpqV9ab*SFuDkp>y%A>aq7N>y#HQJSeP+30Wl?>dA3F_dI^EEnyd3AIUAW9 QatMOy3rC81I1F^)55?|uDF6Tf diff --git a/www/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif b/www/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif deleted file mode 100644 index c2a2ad454db194e428a7b9da40f62d5376a17428..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 769 zcmb7?=`WiB0LI^D)(HC`v6*aD4AW#LGRb0Oi$tH~CP=nb%N%8n zy02ceuewTUUDeW|RaMp*TlLV6R$o=rQOY{@AME+?`}QQiCwU%4Jq)?`{5B8=ECT1T z+wH!7{zji$)-UA>D9({)xO1SJGLHK54Mat(}s4_unMiKjB85EHng*~!Ddt+?(c5uHG4ZI zsc>jP#5Y6w6Wj5!Y=0^oK*&D+R;Yh@ze z7vfi;qFW{owiOfGqcB@XkwUZ0j?Km4{qjE- z6c!Z|O1!?5l~+^}tE#*^aCo0?lZ$rLKBwT;dI+nLO(UEMvb-ad9elEWPw8Xg(t zx$y<#6T+{PQ@$ecjAT|iC%dxnP5yoH$I`OLFU5*drPiz>bidcu^@a^2v}rP3-`?4^ z?Cl>M-Z(n8ot*x$0~Z|;ku35!-qAHSQN*GM3tW8AN#VWJNrHQD+6qXfO_zB^6eFVU zOjzupAb0*`W8} zQVeE5Djt<a0+Owme6r2OGio7DoTWqkhGKj0`0*1-*<$#uL5YH*kC8Z>wpCvYO~asp;G r-~A;>$wp)vkltB=c_?k6Zw*FUgrbAm;sB08O9+}m=}H3OFd*zN8L+JA diff --git a/www/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif b/www/javascript/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif deleted file mode 100644 index 0b4cc3682a1c62b3583d83ad83b84fce14461ec3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 84 zcmZ?wbh9u| --> - - -Template for dialogs - - - - -
-
-
-
-
-
-
- Blured -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Focused -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Statusbar -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Statusbar, Resizable -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Resizable, Maximizable -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Blurred, Maximizable, Statusbar, Resizable -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Maximized, Maximizable, Minimizable -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Blured -
- -
-
- Content -
-
- -
-
-
-
- Statusbar text. -
- - - - - - - - - - - - - - -
-
- -
-
-
-
-
-
- Alert -
- -
-
- - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - -
-
-
- -
-
-
-
-
- - - Ok - -
-
- -
-
-
-
-
-
- Confirm -
- -
-
- - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - This is a very long error message. This is a very long error message. - -
-
-
- -
-
-
-
-
- - - Ok - Cancel - -
-
-
- - - diff --git a/www/javascript/tiny_mce/plugins/insertdatetime/editor_plugin.js b/www/javascript/tiny_mce/plugins/insertdatetime/editor_plugin.js deleted file mode 100644 index 938ce6b17..000000000 --- a/www/javascript/tiny_mce/plugins/insertdatetime/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.InsertDateTime",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceInsertDate",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_dateFormat",a.getLang("insertdatetime.date_fmt")));a.execCommand("mceInsertContent",false,d)});a.addCommand("mceInsertTime",function(){var d=c._getDateTime(new Date(),a.getParam("plugin_insertdate_timeFormat",a.getLang("insertdatetime.time_fmt")));a.execCommand("mceInsertContent",false,d)});a.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"});a.addButton("inserttime",{title:"insertdatetime.inserttime_desc",cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,a){var c=this.editor;function b(g,d){g=""+g;if(g.length-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{if(g[c]>0){a[c].style.zIndex=g[c]-1}}}else{for(f=0;fg[c]){j=f;break}}if(j>-1){a[c].style.zIndex=g[j];a[j].style.zIndex=g[c]}else{a[c].style.zIndex=g[c]+1}}b.execCommand("mceRepaint")},_getParentLayer:function(a){return this.editor.dom.getParent(a,function(b){return b.nodeType==1&&/^(absolute|relative|static)$/i.test(b.style.position)})},_insertLayer:function(){var a=this.editor,b=a.dom.getPos(a.dom.getParent(a.selection.getNode(),"*"));a.dom.add(a.getBody(),"div",{style:{position:"absolute",left:b.x,top:(b.y>20?b.y:20),width:100,height:100},"class":"mceItemVisualAid"},a.selection.getContent()||a.getLang("layer.content"))},_toggleAbsolute:function(){var a=this.editor,b=this._getParentLayer(a.selection.getNode());if(!b){b=a.dom.getParent(a.selection.getNode(),"DIV,P,IMG")}if(b){if(b.style.position.toLowerCase()=="absolute"){a.dom.setStyles(b,{position:"",left:"",top:"",width:"",height:""});a.dom.removeClass(b,"mceItemVisualAid")}else{if(b.style.left==""){b.style.left=20+"px"}if(b.style.top==""){b.style.top=20+"px"}if(b.style.width==""){b.style.width=b.width?(b.width+"px"):"100px"}if(b.style.height==""){b.style.height=b.height?(b.height+"px"):"100px"}b.style.position="absolute";a.dom.setAttrib(b,"data-mce-style","");a.addVisual(a.getBody())}a.execCommand("mceRepaint");a.nodeChanged()}}});tinymce.PluginManager.add("layer",tinymce.plugins.Layer)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/layer/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/layer/editor_plugin_src.js deleted file mode 100644 index a8ac5a72f..000000000 --- a/www/javascript/tiny_mce/plugins/layer/editor_plugin_src.js +++ /dev/null @@ -1,214 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Layer', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceInsertLayer', t._insertLayer, t); - - ed.addCommand('mceMoveForward', function() { - t._move(1); - }); - - ed.addCommand('mceMoveBackward', function() { - t._move(-1); - }); - - ed.addCommand('mceMakeAbsolute', function() { - t._toggleAbsolute(); - }); - - // Register buttons - ed.addButton('moveforward', {title : 'layer.forward_desc', cmd : 'mceMoveForward'}); - ed.addButton('movebackward', {title : 'layer.backward_desc', cmd : 'mceMoveBackward'}); - ed.addButton('absolute', {title : 'layer.absolute_desc', cmd : 'mceMakeAbsolute'}); - ed.addButton('insertlayer', {title : 'layer.insertlayer_desc', cmd : 'mceInsertLayer'}); - - ed.onInit.add(function() { - if (tinymce.isIE) - ed.getDoc().execCommand('2D-Position', false, true); - }); - - ed.onNodeChange.add(t._nodeChange, t); - ed.onVisualAid.add(t._visualAid, t); - }, - - getInfo : function() { - return { - longname : 'Layer', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/layer', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _nodeChange : function(ed, cm, n) { - var le, p; - - le = this._getParentLayer(n); - p = ed.dom.getParent(n, 'DIV,P,IMG'); - - if (!p) { - cm.setDisabled('absolute', 1); - cm.setDisabled('moveforward', 1); - cm.setDisabled('movebackward', 1); - } else { - cm.setDisabled('absolute', 0); - cm.setDisabled('moveforward', !le); - cm.setDisabled('movebackward', !le); - cm.setActive('absolute', le && le.style.position.toLowerCase() == "absolute"); - } - }, - - // Private methods - - _visualAid : function(ed, e, s) { - var dom = ed.dom; - - tinymce.each(dom.select('div,p', e), function(e) { - if (/^(absolute|relative|static)$/i.test(e.style.position)) { - if (s) - dom.addClass(e, 'mceItemVisualAid'); - else - dom.removeClass(e, 'mceItemVisualAid'); - } - }); - }, - - _move : function(d) { - var ed = this.editor, i, z = [], le = this._getParentLayer(ed.selection.getNode()), ci = -1, fi = -1, nl; - - nl = []; - tinymce.walk(ed.getBody(), function(n) { - if (n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position)) - nl.push(n); - }, 'childNodes'); - - // Find z-indexes - for (i=0; i -1) { - nl[ci].style.zIndex = z[fi]; - nl[fi].style.zIndex = z[ci]; - } else { - if (z[ci] > 0) - nl[ci].style.zIndex = z[ci] - 1; - } - } else { - // Move forward - - // Try find a higher one - for (i=0; i z[ci]) { - fi = i; - break; - } - } - - if (fi > -1) { - nl[ci].style.zIndex = z[fi]; - nl[fi].style.zIndex = z[ci]; - } else - nl[ci].style.zIndex = z[ci] + 1; - } - - ed.execCommand('mceRepaint'); - }, - - _getParentLayer : function(n) { - return this.editor.dom.getParent(n, function(n) { - return n.nodeType == 1 && /^(absolute|relative|static)$/i.test(n.style.position); - }); - }, - - _insertLayer : function() { - var ed = this.editor, p = ed.dom.getPos(ed.dom.getParent(ed.selection.getNode(), '*')); - - ed.dom.add(ed.getBody(), 'div', { - style : { - position : 'absolute', - left : p.x, - top : (p.y > 20 ? p.y : 20), - width : 100, - height : 100 - }, - 'class' : 'mceItemVisualAid' - }, ed.selection.getContent() || ed.getLang('layer.content')); - }, - - _toggleAbsolute : function() { - var ed = this.editor, le = this._getParentLayer(ed.selection.getNode()); - - if (!le) - le = ed.dom.getParent(ed.selection.getNode(), 'DIV,P,IMG'); - - if (le) { - if (le.style.position.toLowerCase() == "absolute") { - ed.dom.setStyles(le, { - position : '', - left : '', - top : '', - width : '', - height : '' - }); - - ed.dom.removeClass(le, 'mceItemVisualAid'); - } else { - if (le.style.left == "") - le.style.left = 20 + 'px'; - - if (le.style.top == "") - le.style.top = 20 + 'px'; - - if (le.style.width == "") - le.style.width = le.width ? (le.width + 'px') : '100px'; - - if (le.style.height == "") - le.style.height = le.height ? (le.height + 'px') : '100px'; - - le.style.position = "absolute"; - - ed.dom.setAttrib(le, 'data-mce-style', ''); - ed.addVisual(ed.getBody()); - } - - ed.execCommand('mceRepaint'); - ed.nodeChanged(); - } - } - }); - - // Register plugin - tinymce.PluginManager.add('layer', tinymce.plugins.Layer); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/legacyoutput/editor_plugin.js b/www/javascript/tiny_mce/plugins/legacyoutput/editor_plugin.js deleted file mode 100644 index b3a4ce31c..000000000 --- a/www/javascript/tiny_mce/plugins/legacyoutput/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(a){a.onAddEditor.addToTop(function(c,b){b.settings.inline_styles=false});a.create("tinymce.plugins.LegacyOutput",{init:function(b){b.onInit.add(function(){var c="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",e=a.explode(b.settings.font_size_style_values),d=b.schema;b.formatter.register({alignleft:{selector:c,attributes:{align:"left"}},aligncenter:{selector:c,attributes:{align:"center"}},alignright:{selector:c,attributes:{align:"right"}},alignfull:{selector:c,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:true}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:true}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(f){return a.inArray(e,f.value)+1}}},forecolor:{inline:"font",styles:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}});a.each("b,i,u,strike".split(","),function(f){d.addValidElements(f+"[*]")});if(!d.getElementRule("font")){d.addValidElements("font[face|size|color|style]")}a.each(c.split(","),function(f){var h=d.getElementRule(f),g;if(h){if(!h.attributes.align){h.attributes.align={};h.attributesOrder.push("align")}}});b.onNodeChange.add(function(g,k){var j,f,h,i;f=g.dom.getParent(g.selection.getNode(),"font");if(f){h=f.face;i=f.size}if(j=k.get("fontselect")){j.select(function(l){return l==h})}if(j=k.get("fontsizeselect")){j.select(function(m){var l=a.inArray(e,m.fontSize);return l+1==i})}})})},getInfo:function(){return{longname:"LegacyOutput",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput",version:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("legacyoutput",a.plugins.LegacyOutput)})(tinymce); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/legacyoutput/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/legacyoutput/editor_plugin_src.js deleted file mode 100644 index e627ec76e..000000000 --- a/www/javascript/tiny_mce/plugins/legacyoutput/editor_plugin_src.js +++ /dev/null @@ -1,139 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - * - * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align - * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash - * - * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are - * not apart of the newer specifications for HTML and XHTML. - */ - -(function(tinymce) { - // Override inline_styles setting to force TinyMCE to produce deprecated contents - tinymce.onAddEditor.addToTop(function(tinymce, editor) { - editor.settings.inline_styles = false; - }); - - // Create the legacy ouput plugin - tinymce.create('tinymce.plugins.LegacyOutput', { - init : function(editor) { - editor.onInit.add(function() { - var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', - fontSizes = tinymce.explode(editor.settings.font_size_style_values), - schema = editor.schema; - - // Override some internal formats to produce legacy elements and attributes - editor.formatter.register({ - // Change alignment formats to use the deprecated align attribute - alignleft : {selector : alignElements, attributes : {align : 'left'}}, - aligncenter : {selector : alignElements, attributes : {align : 'center'}}, - alignright : {selector : alignElements, attributes : {align : 'right'}}, - alignfull : {selector : alignElements, attributes : {align : 'justify'}}, - - // Change the basic formatting elements to use deprecated element types - bold : [ - {inline : 'b', remove : 'all'}, - {inline : 'strong', remove : 'all'}, - {inline : 'span', styles : {fontWeight : 'bold'}} - ], - italic : [ - {inline : 'i', remove : 'all'}, - {inline : 'em', remove : 'all'}, - {inline : 'span', styles : {fontStyle : 'italic'}} - ], - underline : [ - {inline : 'u', remove : 'all'}, - {inline : 'span', styles : {textDecoration : 'underline'}, exact : true} - ], - strikethrough : [ - {inline : 'strike', remove : 'all'}, - {inline : 'span', styles : {textDecoration: 'line-through'}, exact : true} - ], - - // Change font size and font family to use the deprecated font element - fontname : {inline : 'font', attributes : {face : '%value'}}, - fontsize : { - inline : 'font', - attributes : { - size : function(vars) { - return tinymce.inArray(fontSizes, vars.value) + 1; - } - } - }, - - // Setup font elements for colors as well - forecolor : {inline : 'font', styles : {color : '%value'}}, - hilitecolor : {inline : 'font', styles : {backgroundColor : '%value'}} - }); - - // Check that deprecated elements are allowed if not add them - tinymce.each('b,i,u,strike'.split(','), function(name) { - schema.addValidElements(name + '[*]'); - }); - - // Add font element if it's missing - if (!schema.getElementRule("font")) - schema.addValidElements("font[face|size|color|style]"); - - // Add the missing and depreacted align attribute for the serialization engine - tinymce.each(alignElements.split(','), function(name) { - var rule = schema.getElementRule(name), found; - - if (rule) { - if (!rule.attributes.align) { - rule.attributes.align = {}; - rule.attributesOrder.push('align'); - } - } - }); - - // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes - editor.onNodeChange.add(function(editor, control_manager) { - var control, fontElm, fontName, fontSize; - - // Find font element get it's name and size - fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); - if (fontElm) { - fontName = fontElm.face; - fontSize = fontElm.size; - } - - // Select/unselect the font name in droplist - if (control = control_manager.get('fontselect')) { - control.select(function(value) { - return value == fontName; - }); - } - - // Select/unselect the font size in droplist - if (control = control_manager.get('fontsizeselect')) { - control.select(function(value) { - var index = tinymce.inArray(fontSizes, value.fontSize); - - return index + 1 == fontSize; - }); - } - }); - }); - }, - - getInfo : function() { - return { - longname : 'LegacyOutput', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/legacyoutput', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('legacyoutput', tinymce.plugins.LegacyOutput); -})(tinymce); diff --git a/www/javascript/tiny_mce/plugins/lists/editor_plugin.js b/www/javascript/tiny_mce/plugins/lists/editor_plugin.js deleted file mode 100644 index 0fb8263ed..000000000 --- a/www/javascript/tiny_mce/plugins/lists/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var e=tinymce.each,r=tinymce.dom.Event,g;function p(t,s){while(t&&(t.nodeType===8||(t.nodeType===3&&/^[ \t\n\r]*$/.test(t.nodeValue)))){t=s(t)}return t}function b(s){return p(s,function(t){return t.previousSibling})}function i(s){return p(s,function(t){return t.nextSibling})}function d(s,u,t){return s.dom.getParent(u,function(v){return tinymce.inArray(t,v)!==-1})}function n(s){return s&&(s.tagName==="OL"||s.tagName==="UL")}function c(u,v){var t,w,s;t=b(u.lastChild);while(n(t)){w=t;t=b(w.previousSibling)}if(w){s=v.create("li",{style:"list-style-type: none;"});v.split(u,w);v.insertAfter(s,w);s.appendChild(w);s.appendChild(w);u=s.previousSibling}return u}function m(t,s,u){t=a(t,s,u);return o(t,s,u)}function a(u,s,v){var t=b(u.previousSibling);if(t){return h(t,u,s?t:false,v)}else{return u}}function o(u,t,v){var s=i(u.nextSibling);if(s){return h(u,s,t?s:false,v)}else{return u}}function h(u,s,t,v){if(l(u,s,!!t,v)){return f(u,s,t)}else{if(u&&u.tagName==="LI"&&n(s)){u.appendChild(s)}}return s}function l(u,t,s,v){if(!u||!t){return false}else{if(u.tagName==="LI"&&t.tagName==="LI"){return t.style.listStyleType==="none"||j(t)}else{if(n(u)){return(u.tagName===t.tagName&&(s||u.style.listStyleType===t.style.listStyleType))||q(t)}else{if(v&&u.tagName==="P"&&t.tagName==="P"){return true}else{return false}}}}}function q(t){var s=i(t.firstChild),u=b(t.lastChild);return s&&u&&n(t)&&s===u&&(n(s)||s.style.listStyleType==="none"||j(s))}function j(u){var t=i(u.firstChild),s=b(u.lastChild);return t&&s&&t===s&&n(t)}function f(w,v,s){var u=b(w.lastChild),t=i(v.firstChild);if(w.tagName==="P"){w.appendChild(w.ownerDocument.createElement("br"))}while(v.firstChild){w.appendChild(v.firstChild)}if(s){w.style.listStyleType=s.style.listStyleType}v.parentNode.removeChild(v);h(u,t,false);return w}function k(t,u){var s;if(!u.is(t,"li,ol,ul")){s=u.getParent(t,"li");if(s){t=s}}return t}tinymce.create("tinymce.plugins.Lists",{init:function(u,v){var s=false;function y(z){return z.keyCode===9&&(u.queryCommandState("InsertUnorderedList")||u.queryCommandState("InsertOrderedList"))}function w(z,B){var A=z.selection,C;if(B.keyCode===13){C=A.getStart();if(C.tagName=="BR"&&C.parentNode.tagName=="LI"){C=C.parentNode}s=A.isCollapsed()&&C&&C.tagName==="LI"&&(C.childNodes.length===0||(C.firstChild.nodeName=="BR"&&C.childNodes.length===1));return s}}function t(z,A){if(y(A)||w(z,A)){return r.cancel(A)}}function x(C,E){if(!tinymce.isGecko){return}var A=C.selection.getStart();if(E.keyCode!=8||A.tagName!=="IMG"){return}function B(K){var L=K.firstChild;var J=null;do{if(!L){break}if(L.tagName==="LI"){J=L}}while(L=L.nextSibling);return J}function I(K,J){while(K.childNodes.length>0){J.appendChild(K.childNodes[0])}}var F;if(A.parentNode.previousSibling.tagName==="UL"||A.parentNode.previousSibling.tagName==="OL"){F=A.parentNode.previousSibling}else{if(A.parentNode.previousSibling.previousSibling.tagName==="UL"||A.parentNode.previousSibling.previousSibling.tagName==="OL"){F=A.parentNode.previousSibling.previousSibling}else{return}}var H=B(F);var z=C.dom.createRng();z.setStart(H,1);z.setEnd(H,1);C.selection.setRng(z);C.selection.collapse(true);var D=C.selection.getBookmark();var G=A.parentNode.cloneNode(true);if(G.tagName==="P"||G.tagName==="DIV"){I(G,H)}else{H.appendChild(G)}A.parentNode.parentNode.removeChild(A.parentNode);C.selection.moveToBookmark(D)}this.ed=u;u.addCommand("Indent",this.indent,this);u.addCommand("Outdent",this.outdent,this);u.addCommand("InsertUnorderedList",function(){this.applyList("UL","OL")},this);u.addCommand("InsertOrderedList",function(){this.applyList("OL","UL")},this);u.onInit.add(function(){u.editorCommands.addCommands({outdent:function(){var A=u.selection,B=u.dom;function z(C){C=B.getParent(C,B.isBlock);return C&&(parseInt(u.dom.getStyle(C,"margin-left")||0,10)+parseInt(u.dom.getStyle(C,"padding-left")||0,10))>0}return z(A.getStart())||z(A.getEnd())||u.queryCommandState("InsertOrderedList")||u.queryCommandState("InsertUnorderedList")}},"state")});u.onKeyUp.add(function(A,B){var C,z;if(y(B)){A.execCommand(B.shiftKey?"Outdent":"Indent",true,null);return r.cancel(B)}else{if(s&&w(A,B)){if(A.queryCommandState("InsertOrderedList")){A.execCommand("InsertOrderedList")}else{A.execCommand("InsertUnorderedList")}C=A.selection.getStart();if(C&&C.tagName==="LI"){C=A.dom.getParent(C,"ol,ul").nextSibling;if(C&&C.tagName==="P"){if(!C.firstChild){C.appendChild(A.getDoc().createTextNode(""))}z=A.dom.createRng();z.setStart(C.firstChild,1);z.setEnd(C.firstChild,1);A.selection.setRng(z)}}return r.cancel(B)}}});u.onKeyPress.add(t);u.onKeyDown.add(t);u.onKeyDown.add(x)},applyList:function(y,v){var C=this,z=C.ed,I=z.dom,s=[],H=false,u=false,w=false,B,G=z.selection.getSelectedBlocks();function E(t){if(t&&t.tagName==="BR"){I.remove(t)}}function F(M){var N=I.create(y),t;function L(O){if(O.style.marginLeft||O.style.paddingLeft){C.adjustPaddingFunction(false)(O)}}if(M.tagName==="LI"){}else{if(M.tagName==="P"||M.tagName==="DIV"||M.tagName==="BODY"){K(M,function(P,O,Q){J(P,O,M.tagName==="BODY"?null:P.parentNode);t=P.parentNode;L(t);E(O)});if(M.tagName==="P"||G.length>1){I.split(t.parentNode.parentNode,t.parentNode)}m(t.parentNode,true);return}else{t=I.create("li");I.insertAfter(t,M);t.appendChild(M);L(M);M=t}}I.insertAfter(N,M);N.appendChild(M);m(N,true);s.push(M)}function J(Q,L,O){var t,P=Q,N,M;while(!I.isBlock(Q.parentNode)&&Q.parentNode!==I.getRoot()){Q=I.split(Q.parentNode,Q.previousSibling);Q=Q.nextSibling;P=Q}if(O){t=O.cloneNode(true);Q.parentNode.insertBefore(t,Q);while(t.firstChild){I.remove(t.firstChild)}t=I.rename(t,"li")}else{t=I.create("li");Q.parentNode.insertBefore(t,Q)}while(P&&P!=L){N=P.nextSibling;t.appendChild(P);P=N}if(t.childNodes.length===0){t.innerHTML='
'}F(t)}function K(Q,T){var N,R,O=3,L=1,t="br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl";function P(X,U){var V=I.createRng(),W;g.keep=true;z.selection.moveToBookmark(g);g.keep=false;W=z.selection.getRng(true);if(!U){U=X.parentNode.lastChild}V.setStartBefore(X);V.setEndAfter(U);return !(V.compareBoundaryPoints(O,W)>0||V.compareBoundaryPoints(L,W)<=0)}function S(U){if(U.nextSibling){return U.nextSibling}if(!I.isBlock(U.parentNode)&&U.parentNode!==I.getRoot()){return S(U.parentNode)}}N=Q.firstChild;var M=false;e(I.select(t,Q),function(V){var U;if(V.hasAttribute&&V.hasAttribute("_mce_bogus")){return true}if(P(N,V)){I.addClass(V,"_mce_tagged_br");N=S(V)}});M=(N&&P(N,undefined));N=Q.firstChild;e(I.select(t,Q),function(V){var U=S(V);if(V.hasAttribute&&V.hasAttribute("_mce_bogus")){return true}if(I.hasClass(V,"_mce_tagged_br")){T(N,V,R);R=null}else{R=V}N=U});if(M){T(N,undefined,R)}}function D(t){K(t,function(M,L,N){J(M,L);E(L);E(N)})}function A(t){if(tinymce.inArray(s,t)!==-1){return}if(t.parentNode.tagName===v){I.split(t.parentNode,t);F(t);o(t.parentNode,false)}s.push(t)}function x(M){var O,N,L,t;if(tinymce.inArray(s,M)!==-1){return}M=c(M,I);while(I.is(M.parentNode,"ol,ul,li")){I.split(M.parentNode,M)}s.push(M);M=I.rename(M,"p");L=m(M,false,z.settings.force_br_newlines);if(L===M){O=M.firstChild;while(O){if(I.isBlock(O)){O=I.split(O.parentNode,O);t=true;N=O.nextSibling&&O.nextSibling.firstChild}else{N=O.nextSibling;if(t&&O.tagName==="BR"){I.remove(O)}t=false}O=N}}}e(G,function(t){t=k(t,I);if(t.tagName===v||(t.tagName==="LI"&&t.parentNode.tagName===v)){u=true}else{if(t.tagName===y||(t.tagName==="LI"&&t.parentNode.tagName===y)){H=true}else{w=true}}});if(w||u||G.length===0){B={LI:A,H1:F,H2:F,H3:F,H4:F,H5:F,H6:F,P:F,BODY:F,DIV:G.length>1?F:D,defaultAction:D}}else{B={defaultAction:x}}this.process(B)},indent:function(){var u=this.ed,w=u.dom,x=[];function s(z){var y=w.create("li",{style:"list-style-type: none;"});w.insertAfter(y,z);return y}function t(B){var y=s(B),D=w.getParent(B,"ol,ul"),C=D.tagName,E=w.getStyle(D,"list-style-type"),A={},z;if(E!==""){A.style="list-style-type: "+E+";"}z=w.create(C,A);y.appendChild(z);return z}function v(z){if(!d(u,z,x)){z=c(z,w);var y=t(z);y.appendChild(z);m(y.parentNode,false);m(y,false);x.push(z)}}this.process({LI:v,defaultAction:this.adjustPaddingFunction(true)})},outdent:function(){var v=this,u=v.ed,w=u.dom,s=[];function x(t){var z,y,A;if(!d(u,t,s)){if(w.getStyle(t,"margin-left")!==""||w.getStyle(t,"padding-left")!==""){return v.adjustPaddingFunction(false)(t)}A=w.getStyle(t,"text-align",true);if(A==="center"||A==="right"){w.setStyle(t,"text-align","left");return}t=c(t,w);z=t.parentNode;y=t.parentNode.parentNode;if(y.tagName==="P"){w.split(y,t.parentNode)}else{w.split(z,t);if(y.tagName==="LI"){w.split(y,t)}else{if(!w.is(y,"ol,ul")){w.rename(t,"p")}}}s.push(t)}}this.process({LI:x,defaultAction:this.adjustPaddingFunction(false)});e(s,m)},process:function(x){var B=this,v=B.ed.selection,y=B.ed.dom,A,s;function w(t){y.removeClass(t,"_mce_act_on");if(!t||t.nodeType!==1){return}t=k(t,y);var C=x[t.tagName];if(!C){C=x.defaultAction}C(t)}function u(t){B.splitSafeEach(t.childNodes,w)}function z(t,C){return C>=0&&t.hasChildNodes()&&C0){t=s.shift();w.removeClass(t,"_mce_act_on");u(t);s=w.select("._mce_act_on")}},adjustPaddingFunction:function(u){var s,v,t=this.ed;s=t.settings.indentation;v=/[a-z%]+/i.exec(s);s=parseInt(s,10);return function(w){var y,x;y=parseInt(t.dom.getStyle(w,"margin-left")||0,10)+parseInt(t.dom.getStyle(w,"padding-left")||0,10);if(u){x=y+s}else{x=y-s}t.dom.setStyle(w,"padding-left","");t.dom.setStyle(w,"margin-left",x>0?x+v:"")}},getInfo:function(){return{longname:"Lists",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("lists",tinymce.plugins.Lists)}()); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/lists/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/lists/editor_plugin_src.js deleted file mode 100644 index 3952cff40..000000000 --- a/www/javascript/tiny_mce/plugins/lists/editor_plugin_src.js +++ /dev/null @@ -1,688 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2011, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var each = tinymce.each, Event = tinymce.dom.Event, bookmark; - - // Skips text nodes that only contain whitespace since they aren't semantically important. - function skipWhitespaceNodes(e, next) { - while (e && (e.nodeType === 8 || (e.nodeType === 3 && /^[ \t\n\r]*$/.test(e.nodeValue)))) { - e = next(e); - } - return e; - } - - function skipWhitespaceNodesBackwards(e) { - return skipWhitespaceNodes(e, function(e) { return e.previousSibling; }); - } - - function skipWhitespaceNodesForwards(e) { - return skipWhitespaceNodes(e, function(e) { return e.nextSibling; }); - } - - function hasParentInList(ed, e, list) { - return ed.dom.getParent(e, function(p) { - return tinymce.inArray(list, p) !== -1; - }); - } - - function isList(e) { - return e && (e.tagName === 'OL' || e.tagName === 'UL'); - } - - function splitNestedLists(element, dom) { - var tmp, nested, wrapItem; - tmp = skipWhitespaceNodesBackwards(element.lastChild); - while (isList(tmp)) { - nested = tmp; - tmp = skipWhitespaceNodesBackwards(nested.previousSibling); - } - if (nested) { - wrapItem = dom.create('li', { style: 'list-style-type: none;'}); - dom.split(element, nested); - dom.insertAfter(wrapItem, nested); - wrapItem.appendChild(nested); - wrapItem.appendChild(nested); - element = wrapItem.previousSibling; - } - return element; - } - - function attemptMergeWithAdjacent(e, allowDifferentListStyles, mergeParagraphs) { - e = attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs); - return attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs); - } - - function attemptMergeWithPrevious(e, allowDifferentListStyles, mergeParagraphs) { - var prev = skipWhitespaceNodesBackwards(e.previousSibling); - if (prev) { - return attemptMerge(prev, e, allowDifferentListStyles ? prev : false, mergeParagraphs); - } else { - return e; - } - } - - function attemptMergeWithNext(e, allowDifferentListStyles, mergeParagraphs) { - var next = skipWhitespaceNodesForwards(e.nextSibling); - if (next) { - return attemptMerge(e, next, allowDifferentListStyles ? next : false, mergeParagraphs); - } else { - return e; - } - } - - function attemptMerge(e1, e2, differentStylesMasterElement, mergeParagraphs) { - if (canMerge(e1, e2, !!differentStylesMasterElement, mergeParagraphs)) { - return merge(e1, e2, differentStylesMasterElement); - } else if (e1 && e1.tagName === 'LI' && isList(e2)) { - // Fix invalidly nested lists. - e1.appendChild(e2); - } - return e2; - } - - function canMerge(e1, e2, allowDifferentListStyles, mergeParagraphs) { - if (!e1 || !e2) { - return false; - } else if (e1.tagName === 'LI' && e2.tagName === 'LI') { - return e2.style.listStyleType === 'none' || containsOnlyAList(e2); - } else if (isList(e1)) { - return (e1.tagName === e2.tagName && (allowDifferentListStyles || e1.style.listStyleType === e2.style.listStyleType)) || isListForIndent(e2); - } else if (mergeParagraphs && e1.tagName === 'P' && e2.tagName === 'P') { - return true; - } else { - return false; - } - } - - function isListForIndent(e) { - var firstLI = skipWhitespaceNodesForwards(e.firstChild), lastLI = skipWhitespaceNodesBackwards(e.lastChild); - return firstLI && lastLI && isList(e) && firstLI === lastLI && (isList(firstLI) || firstLI.style.listStyleType === 'none' || containsOnlyAList(firstLI)); - } - - function containsOnlyAList(e) { - var firstChild = skipWhitespaceNodesForwards(e.firstChild), lastChild = skipWhitespaceNodesBackwards(e.lastChild); - return firstChild && lastChild && firstChild === lastChild && isList(firstChild); - } - - function merge(e1, e2, masterElement) { - var lastOriginal = skipWhitespaceNodesBackwards(e1.lastChild), firstNew = skipWhitespaceNodesForwards(e2.firstChild); - if (e1.tagName === 'P') { - e1.appendChild(e1.ownerDocument.createElement('br')); - } - while (e2.firstChild) { - e1.appendChild(e2.firstChild); - } - if (masterElement) { - e1.style.listStyleType = masterElement.style.listStyleType; - } - e2.parentNode.removeChild(e2); - attemptMerge(lastOriginal, firstNew, false); - return e1; - } - - function findItemToOperateOn(e, dom) { - var item; - if (!dom.is(e, 'li,ol,ul')) { - item = dom.getParent(e, 'li'); - if (item) { - e = item; - } - } - return e; - } - - tinymce.create('tinymce.plugins.Lists', { - init: function(ed, url) { - var enterDownInEmptyList = false; - - function isTriggerKey(e) { - return e.keyCode === 9 && (ed.queryCommandState('InsertUnorderedList') || ed.queryCommandState('InsertOrderedList')); - }; - - function isEnterInEmptyListItem(ed, e) { - var sel = ed.selection, n; - if (e.keyCode === 13) { - n = sel.getStart(); - - // Get start will return BR if the LI only contains a BR - if (n.tagName == 'BR' && n.parentNode.tagName == 'LI') - n = n.parentNode; - - // Check for empty LI or a LI with just one BR since Gecko and WebKit uses BR elements to place the caret - enterDownInEmptyList = sel.isCollapsed() && n && n.tagName === 'LI' && (n.childNodes.length === 0 || (n.firstChild.nodeName == 'BR' && n.childNodes.length === 1)); - return enterDownInEmptyList; - } - }; - - function cancelKeys(ed, e) { - if (isTriggerKey(e) || isEnterInEmptyListItem(ed, e)) { - return Event.cancel(e); - } - }; - - function imageJoiningListItem(ed, e) { - if (!tinymce.isGecko) - return; - - var n = ed.selection.getStart(); - if (e.keyCode != 8 || n.tagName !== 'IMG') - return; - - function lastLI(node) { - var child = node.firstChild; - var li = null; - do { - if (!child) - break; - - if (child.tagName === 'LI') - li = child; - } while (child = child.nextSibling); - - return li; - } - - function addChildren(parentNode, destination) { - while (parentNode.childNodes.length > 0) - destination.appendChild(parentNode.childNodes[0]); - } - - var ul; - if (n.parentNode.previousSibling.tagName === 'UL' || n.parentNode.previousSibling.tagName === 'OL') - ul = n.parentNode.previousSibling; - else if (n.parentNode.previousSibling.previousSibling.tagName === 'UL' || n.parentNode.previousSibling.previousSibling.tagName === 'OL') - ul = n.parentNode.previousSibling.previousSibling; - else - return; - - var li = lastLI(ul); - - // move the caret to the end of the list item - var rng = ed.dom.createRng(); - rng.setStart(li, 1); - rng.setEnd(li, 1); - ed.selection.setRng(rng); - ed.selection.collapse(true); - - // save a bookmark at the end of the list item - var bookmark = ed.selection.getBookmark(); - - // copy the image an its text to the list item - var clone = n.parentNode.cloneNode(true); - if (clone.tagName === 'P' || clone.tagName === 'DIV') - addChildren(clone, li); - else - li.appendChild(clone); - - // remove the old copy of the image - n.parentNode.parentNode.removeChild(n.parentNode); - - // move the caret where we saved the bookmark - ed.selection.moveToBookmark(bookmark); - } - - this.ed = ed; - ed.addCommand('Indent', this.indent, this); - ed.addCommand('Outdent', this.outdent, this); - ed.addCommand('InsertUnorderedList', function() { - this.applyList('UL', 'OL'); - }, this); - ed.addCommand('InsertOrderedList', function() { - this.applyList('OL', 'UL'); - }, this); - - ed.onInit.add(function() { - ed.editorCommands.addCommands({ - 'outdent': function() { - var sel = ed.selection, dom = ed.dom; - function hasStyleIndent(n) { - n = dom.getParent(n, dom.isBlock); - return n && (parseInt(ed.dom.getStyle(n, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(n, 'padding-left') || 0, 10)) > 0; - } - return hasStyleIndent(sel.getStart()) || hasStyleIndent(sel.getEnd()) || ed.queryCommandState('InsertOrderedList') || ed.queryCommandState('InsertUnorderedList'); - } - }, 'state'); - }); - - ed.onKeyUp.add(function(ed, e) { - var n, rng; - if (isTriggerKey(e)) { - ed.execCommand(e.shiftKey ? 'Outdent' : 'Indent', true, null); - return Event.cancel(e); - } else if (enterDownInEmptyList && isEnterInEmptyListItem(ed, e)) { - if (ed.queryCommandState('InsertOrderedList')) { - ed.execCommand('InsertOrderedList'); - } else { - ed.execCommand('InsertUnorderedList'); - } - n = ed.selection.getStart(); - if (n && n.tagName === 'LI') { - // Fix the caret position on IE since it jumps back up to the previous list item. - n = ed.dom.getParent(n, 'ol,ul').nextSibling; - if (n && n.tagName === 'P') { - if (!n.firstChild) { - n.appendChild(ed.getDoc().createTextNode('')); - } - rng = ed.dom.createRng(); - rng.setStart(n.firstChild, 1); - rng.setEnd(n.firstChild, 1); - ed.selection.setRng(rng); - } - } - return Event.cancel(e); - } - }); - ed.onKeyPress.add(cancelKeys); - ed.onKeyDown.add(cancelKeys); - ed.onKeyDown.add(imageJoiningListItem); - }, - - applyList: function(targetListType, oppositeListType) { - var t = this, ed = t.ed, dom = ed.dom, applied = [], hasSameType = false, hasOppositeType = false, hasNonList = false, actions, - selectedBlocks = ed.selection.getSelectedBlocks(); - - function cleanupBr(e) { - if (e && e.tagName === 'BR') { - dom.remove(e); - } - } - - function makeList(element) { - var list = dom.create(targetListType), li; - function adjustIndentForNewList(element) { - // If there's a margin-left, outdent one level to account for the extra list margin. - if (element.style.marginLeft || element.style.paddingLeft) { - t.adjustPaddingFunction(false)(element); - } - } - - if (element.tagName === 'LI') { - // No change required. - } else if (element.tagName === 'P' || element.tagName === 'DIV' || element.tagName === 'BODY') { - processBrs(element, function(startSection, br, previousBR) { - doWrapList(startSection, br, element.tagName === 'BODY' ? null : startSection.parentNode); - li = startSection.parentNode; - adjustIndentForNewList(li); - cleanupBr(br); - }); - if (element.tagName === 'P' || selectedBlocks.length > 1) { - dom.split(li.parentNode.parentNode, li.parentNode); - } - attemptMergeWithAdjacent(li.parentNode, true); - return; - } else { - // Put the list around the element. - li = dom.create('li'); - dom.insertAfter(li, element); - li.appendChild(element); - adjustIndentForNewList(element); - element = li; - } - dom.insertAfter(list, element); - list.appendChild(element); - attemptMergeWithAdjacent(list, true); - applied.push(element); - } - - function doWrapList(start, end, template) { - var li, n = start, tmp, i; - while (!dom.isBlock(start.parentNode) && start.parentNode !== dom.getRoot()) { - start = dom.split(start.parentNode, start.previousSibling); - start = start.nextSibling; - n = start; - } - if (template) { - li = template.cloneNode(true); - start.parentNode.insertBefore(li, start); - while (li.firstChild) dom.remove(li.firstChild); - li = dom.rename(li, 'li'); - } else { - li = dom.create('li'); - start.parentNode.insertBefore(li, start); - } - while (n && n != end) { - tmp = n.nextSibling; - li.appendChild(n); - n = tmp; - } - if (li.childNodes.length === 0) { - li.innerHTML = '
'; - } - makeList(li); - } - - function processBrs(element, callback) { - var startSection, previousBR, END_TO_START = 3, START_TO_END = 1, - breakElements = 'br,ul,ol,p,div,h1,h2,h3,h4,h5,h6,table,blockquote,address,pre,form,center,dl'; - function isAnyPartSelected(start, end) { - var r = dom.createRng(), sel; - bookmark.keep = true; - ed.selection.moveToBookmark(bookmark); - bookmark.keep = false; - sel = ed.selection.getRng(true); - if (!end) { - end = start.parentNode.lastChild; - } - r.setStartBefore(start); - r.setEndAfter(end); - return !(r.compareBoundaryPoints(END_TO_START, sel) > 0 || r.compareBoundaryPoints(START_TO_END, sel) <= 0); - } - function nextLeaf(br) { - if (br.nextSibling) - return br.nextSibling; - if (!dom.isBlock(br.parentNode) && br.parentNode !== dom.getRoot()) - return nextLeaf(br.parentNode); - } - // Split on BRs within the range and process those. - startSection = element.firstChild; - // First mark the BRs that have any part of the previous section selected. - var trailingContentSelected = false; - each(dom.select(breakElements, element), function(br) { - var b; - if (br.hasAttribute && br.hasAttribute('_mce_bogus')) { - return true; // Skip the bogus Brs that are put in to appease Firefox and Safari. - } - if (isAnyPartSelected(startSection, br)) { - dom.addClass(br, '_mce_tagged_br'); - startSection = nextLeaf(br); - } - }); - trailingContentSelected = (startSection && isAnyPartSelected(startSection, undefined)); - startSection = element.firstChild; - each(dom.select(breakElements, element), function(br) { - // Got a section from start to br. - var tmp = nextLeaf(br); - if (br.hasAttribute && br.hasAttribute('_mce_bogus')) { - return true; // Skip the bogus Brs that are put in to appease Firefox and Safari. - } - if (dom.hasClass(br, '_mce_tagged_br')) { - callback(startSection, br, previousBR); - previousBR = null; - } else { - previousBR = br; - } - startSection = tmp; - }); - if (trailingContentSelected) { - callback(startSection, undefined, previousBR); - } - } - - function wrapList(element) { - processBrs(element, function(startSection, br, previousBR) { - // Need to indent this part - doWrapList(startSection, br); - cleanupBr(br); - cleanupBr(previousBR); - }); - } - - function changeList(element) { - if (tinymce.inArray(applied, element) !== -1) { - return; - } - if (element.parentNode.tagName === oppositeListType) { - dom.split(element.parentNode, element); - makeList(element); - attemptMergeWithNext(element.parentNode, false); - } - applied.push(element); - } - - function convertListItemToParagraph(element) { - var child, nextChild, mergedElement, splitLast; - if (tinymce.inArray(applied, element) !== -1) { - return; - } - element = splitNestedLists(element, dom); - while (dom.is(element.parentNode, 'ol,ul,li')) { - dom.split(element.parentNode, element); - } - // Push the original element we have from the selection, not the renamed one. - applied.push(element); - element = dom.rename(element, 'p'); - mergedElement = attemptMergeWithAdjacent(element, false, ed.settings.force_br_newlines); - if (mergedElement === element) { - // Now split out any block elements that can't be contained within a P. - // Manually iterate to ensure we handle modifications correctly (doesn't work with tinymce.each) - child = element.firstChild; - while (child) { - if (dom.isBlock(child)) { - child = dom.split(child.parentNode, child); - splitLast = true; - nextChild = child.nextSibling && child.nextSibling.firstChild; - } else { - nextChild = child.nextSibling; - if (splitLast && child.tagName === 'BR') { - dom.remove(child); - } - splitLast = false; - } - child = nextChild; - } - } - } - - each(selectedBlocks, function(e) { - e = findItemToOperateOn(e, dom); - if (e.tagName === oppositeListType || (e.tagName === 'LI' && e.parentNode.tagName === oppositeListType)) { - hasOppositeType = true; - } else if (e.tagName === targetListType || (e.tagName === 'LI' && e.parentNode.tagName === targetListType)) { - hasSameType = true; - } else { - hasNonList = true; - } - }); - - if (hasNonList || hasOppositeType || selectedBlocks.length === 0) { - actions = { - 'LI': changeList, - 'H1': makeList, - 'H2': makeList, - 'H3': makeList, - 'H4': makeList, - 'H5': makeList, - 'H6': makeList, - 'P': makeList, - 'BODY': makeList, - 'DIV': selectedBlocks.length > 1 ? makeList : wrapList, - defaultAction: wrapList - }; - } else { - actions = { - defaultAction: convertListItemToParagraph - }; - } - this.process(actions); - }, - - indent: function() { - var ed = this.ed, dom = ed.dom, indented = []; - - function createWrapItem(element) { - var wrapItem = dom.create('li', { style: 'list-style-type: none;'}); - dom.insertAfter(wrapItem, element); - return wrapItem; - } - - function createWrapList(element) { - var wrapItem = createWrapItem(element), - list = dom.getParent(element, 'ol,ul'), - listType = list.tagName, - listStyle = dom.getStyle(list, 'list-style-type'), - attrs = {}, - wrapList; - if (listStyle !== '') { - attrs.style = 'list-style-type: ' + listStyle + ';'; - } - wrapList = dom.create(listType, attrs); - wrapItem.appendChild(wrapList); - return wrapList; - } - - function indentLI(element) { - if (!hasParentInList(ed, element, indented)) { - element = splitNestedLists(element, dom); - var wrapList = createWrapList(element); - wrapList.appendChild(element); - attemptMergeWithAdjacent(wrapList.parentNode, false); - attemptMergeWithAdjacent(wrapList, false); - indented.push(element); - } - } - - this.process({ - 'LI': indentLI, - defaultAction: this.adjustPaddingFunction(true) - }); - - }, - - outdent: function() { - var t = this, ed = t.ed, dom = ed.dom, outdented = []; - - function outdentLI(element) { - var listElement, targetParent, align; - if (!hasParentInList(ed, element, outdented)) { - if (dom.getStyle(element, 'margin-left') !== '' || dom.getStyle(element, 'padding-left') !== '') { - return t.adjustPaddingFunction(false)(element); - } - align = dom.getStyle(element, 'text-align', true); - if (align === 'center' || align === 'right') { - dom.setStyle(element, 'text-align', 'left'); - return; - } - element = splitNestedLists(element, dom); - listElement = element.parentNode; - targetParent = element.parentNode.parentNode; - if (targetParent.tagName === 'P') { - dom.split(targetParent, element.parentNode); - } else { - dom.split(listElement, element); - if (targetParent.tagName === 'LI') { - // Nested list, need to split the LI and go back out to the OL/UL element. - dom.split(targetParent, element); - } else if (!dom.is(targetParent, 'ol,ul')) { - dom.rename(element, 'p'); - } - } - outdented.push(element); - } - } - - this.process({ - 'LI': outdentLI, - defaultAction: this.adjustPaddingFunction(false) - }); - - each(outdented, attemptMergeWithAdjacent); - }, - - process: function(actions) { - var t = this, sel = t.ed.selection, dom = t.ed.dom, selectedBlocks, r; - function processElement(element) { - dom.removeClass(element, '_mce_act_on'); - if (!element || element.nodeType !== 1) { - return; - } - element = findItemToOperateOn(element, dom); - var action = actions[element.tagName]; - if (!action) { - action = actions.defaultAction; - } - action(element); - } - function recurse(element) { - t.splitSafeEach(element.childNodes, processElement); - } - function brAtEdgeOfSelection(container, offset) { - return offset >= 0 && container.hasChildNodes() && offset < container.childNodes.length && - container.childNodes[offset].tagName === 'BR'; - } - selectedBlocks = sel.getSelectedBlocks(); - if (selectedBlocks.length === 0) { - selectedBlocks = [ dom.getRoot() ]; - } - - r = sel.getRng(true); - if (!r.collapsed) { - if (brAtEdgeOfSelection(r.endContainer, r.endOffset - 1)) { - r.setEnd(r.endContainer, r.endOffset - 1); - sel.setRng(r); - } - if (brAtEdgeOfSelection(r.startContainer, r.startOffset)) { - r.setStart(r.startContainer, r.startOffset + 1); - sel.setRng(r); - } - } - bookmark = sel.getBookmark(); - actions.OL = actions.UL = recurse; - t.splitSafeEach(selectedBlocks, processElement); - sel.moveToBookmark(bookmark); - bookmark = null; - // Avoids table or image handles being left behind in Firefox. - t.ed.execCommand('mceRepaint'); - }, - - splitSafeEach: function(elements, f) { - if (tinymce.isGecko && (/Firefox\/[12]\.[0-9]/.test(navigator.userAgent) || - /Firefox\/3\.[0-4]/.test(navigator.userAgent))) { - this.classBasedEach(elements, f); - } else { - each(elements, f); - } - }, - - classBasedEach: function(elements, f) { - var dom = this.ed.dom, nodes, element; - // Mark nodes - each(elements, function(element) { - dom.addClass(element, '_mce_act_on'); - }); - nodes = dom.select('._mce_act_on'); - while (nodes.length > 0) { - element = nodes.shift(); - dom.removeClass(element, '_mce_act_on'); - f(element); - nodes = dom.select('._mce_act_on'); - } - }, - - adjustPaddingFunction: function(isIndent) { - var indentAmount, indentUnits, ed = this.ed; - indentAmount = ed.settings.indentation; - indentUnits = /[a-z%]+/i.exec(indentAmount); - indentAmount = parseInt(indentAmount, 10); - return function(element) { - var currentIndent, newIndentAmount; - currentIndent = parseInt(ed.dom.getStyle(element, 'margin-left') || 0, 10) + parseInt(ed.dom.getStyle(element, 'padding-left') || 0, 10); - if (isIndent) { - newIndentAmount = currentIndent + indentAmount; - } else { - newIndentAmount = currentIndent - indentAmount; - } - ed.dom.setStyle(element, 'padding-left', ''); - ed.dom.setStyle(element, 'margin-left', newIndentAmount > 0 ? newIndentAmount + indentUnits : ''); - }; - }, - - getInfo: function() { - return { - longname : 'Lists', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/lists', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - tinymce.PluginManager.add("lists", tinymce.plugins.Lists); -}()); diff --git a/www/javascript/tiny_mce/plugins/media/css/content.css b/www/javascript/tiny_mce/plugins/media/css/content.css deleted file mode 100644 index 1bf6a7586..000000000 --- a/www/javascript/tiny_mce/plugins/media/css/content.css +++ /dev/null @@ -1,6 +0,0 @@ -.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc;} -.mceItemShockWave {background-image: url(../img/shockwave.gif);} -.mceItemFlash {background-image:url(../img/flash.gif);} -.mceItemQuickTime {background-image:url(../img/quicktime.gif);} -.mceItemWindowsMedia {background-image:url(../img/windowsmedia.gif);} -.mceItemRealMedia {background-image:url(../img/realmedia.gif);} diff --git a/www/javascript/tiny_mce/plugins/media/css/media.css b/www/javascript/tiny_mce/plugins/media/css/media.css deleted file mode 100644 index 0c45c7ff6..000000000 --- a/www/javascript/tiny_mce/plugins/media/css/media.css +++ /dev/null @@ -1,17 +0,0 @@ -#id, #name, #hspace, #vspace, #class_name, #align { width: 100px } -#hspace, #vspace { width: 50px } -#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode { width: 100px } -#flash_base, #flash_flashvars, #html5_altsource1, #html5_altsource2, #html5_poster { width: 240px } -#width, #height { width: 40px } -#src, #media_type { width: 250px } -#class { width: 120px } -#prev { margin: 0; border: 1px solid black; width: 380px; height: 260px; overflow: auto } -.panel_wrapper div.current { height: 420px; overflow: auto } -#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options { display: none } -.mceAddSelectValue { background-color: #DDDDDD } -#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume { width: 70px } -#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume { width: 70px } -#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks { width: 70px } -#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle { width: 90px } -#qt_qtsrc { width: 200px } -iframe {border: 1px solid gray} diff --git a/www/javascript/tiny_mce/plugins/media/editor_plugin.js b/www/javascript/tiny_mce/plugins/media/editor_plugin.js deleted file mode 100644 index edba2aff0..000000000 --- a/www/javascript/tiny_mce/plugins/media/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var d=tinymce.explode("id,name,width,height,style,align,class,hspace,vspace,bgcolor,type"),h=tinymce.makeMap(d.join(",")),b=tinymce.html.Node,f,a,g=tinymce.util.JSON,e;f=[["Flash","d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["ShockWave","166b1bca-3f9c-11cf-8075-444553540000","application/x-director","http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"],["WindowsMedia","6bf52a52-394a-11d3-b153-00c04f79faa6,22d6f312-b0f6-11d0-94ab-0080c74c7e95,05589fa1-c356-11ce-bf01-00aa0055595a","application/x-mplayer2","http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"],["QuickTime","02bf25d5-8c17-4b23-bc80-d3488abddc6b","video/quicktime","http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"],["RealMedia","cfcdaa03-8be4-11cf-b84b-0020afbbccfa","audio/x-pn-realaudio-plugin","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"],["Java","8ad9c840-044e-11d1-b3e9-00805f499d93","application/x-java-applet","http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"],["Silverlight","dfeaf541-f3e1-4c24-acac-99c30715084a","application/x-silverlight-2"],["Iframe"],["Video"]];function c(m){var l,j,k;if(m&&!m.splice){j=[];for(k=0;true;k++){if(m[k]){j[k]=m[k]}else{break}}return j}return m}tinymce.create("tinymce.plugins.MediaPlugin",{init:function(n,j){var r=this,l={},m,p,q,k;function o(i){return i&&i.nodeName==="IMG"&&n.dom.hasClass(i,"mceItemMedia")}r.editor=n;r.url=j;a="";for(m=0;m0){L+=(L?"&":"")+M+"="+escape(N)}});if(L.length){D.params.flashvars=L}I=o.getParam("flash_video_player_params",{allowfullscreen:true,allowscriptaccess:true});tinymce.each(I,function(N,M){D.params[M]=""+N})}}D=x.attr("data-mce-json");if(!D){return}D=g.parse(D);p=this.getType(x.attr("class"));z=x.attr("data-mce-style");if(!z){z=x.attr("style");if(z){z=o.dom.serializeStyle(o.dom.parseStyle(z,"img"))}}if(p.name==="Iframe"){v=new b("iframe",1);tinymce.each(d,function(i){var G=x.attr(i);if(i=="class"&&G){G=G.replace(/mceItem.+ ?/g,"")}if(G&&G.length>0){v.attr(i,G)}});for(F in D.params){v.attr(F,D.params[F])}v.attr({style:z,src:D.params.src});x.replace(v);return}if(this.editor.settings.media_use_script){v=new b("script",1).attr("type","text/javascript");w=new b("#text",3);w.value="write"+p.name+"("+g.serialize(tinymce.extend(D.params,{width:x.attr("width"),height:x.attr("height")}))+");";v.append(w);x.replace(v);return}if(p.name==="Video"&&D.video.sources[0]){A=new b("video",1).attr(tinymce.extend({id:x.attr("id"),width:x.attr("width"),height:x.attr("height"),style:z},D.video.attrs));if(D.video.attrs){l=D.video.attrs.poster}k=D.video.sources=c(D.video.sources);for(y=0;y 0) - flashVarsOutput += (flashVarsOutput ? '&' : '') + name + '=' + escape(value); - }); - - if (flashVarsOutput.length) - data.params.flashvars = flashVarsOutput; - - params = editor.getParam('flash_video_player_params', { - allowfullscreen: true, - allowscriptaccess: true - }); - - tinymce.each(params, function(value, name) { - data.params[name] = "" + value; - }); - } - }; - - data = node.attr('data-mce-json'); - if (!data) - return; - - data = JSON.parse(data); - typeItem = this.getType(node.attr('class')); - - style = node.attr('data-mce-style') - if (!style) { - style = node.attr('style'); - - if (style) - style = editor.dom.serializeStyle(editor.dom.parseStyle(style, 'img')); - } - - // Handle iframe - if (typeItem.name === 'Iframe') { - replacement = new Node('iframe', 1); - - tinymce.each(rootAttributes, function(name) { - var value = node.attr(name); - - if (name == 'class' && value) - value = value.replace(/mceItem.+ ?/g, ''); - - if (value && value.length > 0) - replacement.attr(name, value); - }); - - for (name in data.params) - replacement.attr(name, data.params[name]); - - replacement.attr({ - style: style, - src: data.params.src - }); - - node.replace(replacement); - - return; - } - - // Handle scripts - if (this.editor.settings.media_use_script) { - replacement = new Node('script', 1).attr('type', 'text/javascript'); - - value = new Node('#text', 3); - value.value = 'write' + typeItem.name + '(' + JSON.serialize(tinymce.extend(data.params, { - width: node.attr('width'), - height: node.attr('height') - })) + ');'; - - replacement.append(value); - node.replace(replacement); - - return; - } - - // Add HTML5 video element - if (typeItem.name === 'Video' && data.video.sources[0]) { - // Create new object element - video = new Node('video', 1).attr(tinymce.extend({ - id : node.attr('id'), - width: node.attr('width'), - height: node.attr('height'), - style : style - }, data.video.attrs)); - - // Get poster source and use that for flash fallback - if (data.video.attrs) - posterSrc = data.video.attrs.poster; - - sources = data.video.sources = toArray(data.video.sources); - for (i = 0; i < sources.length; i++) { - if (/\.mp4$/.test(sources[i].src)) - mp4Source = sources[i].src; - } - - if (!sources[0].type) { - video.attr('src', sources[0].src); - sources.splice(0, 1); - } - - for (i = 0; i < sources.length; i++) { - source = new Node('source', 1).attr(sources[i]); - source.shortEnded = true; - video.append(source); - } - - // Create flash fallback for video if we have a mp4 source - if (mp4Source) { - addPlayer(mp4Source, posterSrc); - typeItem = self.getType('flash'); - } else - data.params.src = ''; - } - - // Do we have a params src then we can generate object - if (data.params.src) { - // Is flv movie add player for it - if (/\.flv$/i.test(data.params.src)) - addPlayer(data.params.src, ''); - - if (args && args.force_absolute) - data.params.src = editor.documentBaseURI.toAbsolute(data.params.src); - - // Create new object element - object = new Node('object', 1).attr({ - id : node.attr('id'), - width: node.attr('width'), - height: node.attr('height'), - style : style - }); - - tinymce.each(rootAttributes, function(name) { - if (data[name] && name != 'type') - object.attr(name, data[name]); - }); - - // Add params - for (name in data.params) { - param = new Node('param', 1); - param.shortEnded = true; - value = data.params[name]; - - // Windows media needs to use url instead of src for the media URL - if (name === 'src' && typeItem.name === 'WindowsMedia') - name = 'url'; - - param.attr({name: name, value: value}); - object.append(param); - } - - // Setup add type and classid if strict is disabled - if (this.editor.getParam('media_strict', true)) { - object.attr({ - data: data.params.src, - type: typeItem.mimes[0] - }); - } else { - object.attr({ - classid: "clsid:" + typeItem.clsids[0], - codebase: typeItem.codebase - }); - - embed = new Node('embed', 1); - embed.shortEnded = true; - embed.attr({ - id: node.attr('id'), - width: node.attr('width'), - height: node.attr('height'), - style : style, - type: typeItem.mimes[0] - }); - - for (name in data.params) - embed.attr(name, data.params[name]); - - tinymce.each(rootAttributes, function(name) { - if (data[name] && name != 'type') - embed.attr(name, data[name]); - }); - - object.append(embed); - } - - // Insert raw HTML - if (data.object_html) { - value = new Node('#text', 3); - value.raw = true; - value.value = data.object_html; - object.append(value); - } - - // Append object to video element if it exists - if (video) - video.append(object); - } - - if (video) { - // Insert raw HTML - if (data.video_html) { - value = new Node('#text', 3); - value.raw = true; - value.value = data.video_html; - video.append(value); - } - } - - if (video || object) - node.replace(video || object); - else - node.remove(); - }, - - /** - * Converts a tinymce.html.Node video/object/embed to an img element. - * - * The video/object/embed will be converted into an image placeholder with a JSON data attribute like this: - * - * - * The JSON structure will be like this: - * {'params':{'flashvars':'something','quality':'high','src':'someurl'}, 'video':{'sources':[{src: 'someurl', type: 'video/mp4'}]}} - */ - objectToImg : function(node) { - var object, embed, video, iframe, img, name, id, width, height, style, i, html, - param, params, source, sources, data, type, lookup = this.lookup, - matches, attrs, urlConverter = this.editor.settings.url_converter, - urlConverterScope = this.editor.settings.url_converter_scope; - - function getInnerHTML(node) { - return new tinymce.html.Serializer({ - inner: true, - validate: false - }).serialize(node); - }; - - // If node isn't in document - if (!node.parent) - return; - - // Handle media scripts - if (node.name === 'script') { - if (node.firstChild) - matches = scriptRegExp.exec(node.firstChild.value); - - if (!matches) - return; - - type = matches[1]; - data = {video : {}, params : JSON.parse(matches[2])}; - width = data.params.width; - height = data.params.height; - } - - // Setup data objects - data = data || { - video : {}, - params : {} - }; - - // Setup new image object - img = new Node('img', 1); - img.attr({ - src : this.editor.theme.url + '/img/trans.gif' - }); - - // Video element - name = node.name; - if (name === 'video') { - video = node; - object = node.getAll('object')[0]; - embed = node.getAll('embed')[0]; - width = video.attr('width'); - height = video.attr('height'); - id = video.attr('id'); - data.video = {attrs : {}, sources : []}; - - // Get all video attributes - attrs = data.video.attrs; - for (name in video.attributes.map) - attrs[name] = video.attributes.map[name]; - - source = node.attr('src'); - if (source) - data.video.sources.push({src : urlConverter.call(urlConverterScope, source, 'src', 'video')}); - - // Get all sources - sources = video.getAll("source"); - for (i = 0; i < sources.length; i++) { - source = sources[i].remove(); - - data.video.sources.push({ - src: urlConverter.call(urlConverterScope, source.attr('src'), 'src', 'source'), - type: source.attr('type'), - media: source.attr('media') - }); - } - - // Convert the poster URL - if (attrs.poster) - attrs.poster = urlConverter.call(urlConverterScope, attrs.poster, 'poster', 'video'); - } - - // Object element - if (node.name === 'object') { - object = node; - embed = node.getAll('embed')[0]; - } - - // Embed element - if (node.name === 'embed') - embed = node; - - // Iframe element - if (node.name === 'iframe') { - iframe = node; - type = 'Iframe'; - } - - if (object) { - // Get width/height - width = width || object.attr('width'); - height = height || object.attr('height'); - style = style || object.attr('style'); - id = id || object.attr('id'); - - // Get all object params - params = object.getAll("param"); - for (i = 0; i < params.length; i++) { - param = params[i]; - name = param.remove().attr('name'); - - if (!excludedAttrs[name]) - data.params[name] = param.attr('value'); - } - - data.params.src = data.params.src || object.attr('data'); - } - - if (embed) { - // Get width/height - width = width || embed.attr('width'); - height = height || embed.attr('height'); - style = style || embed.attr('style'); - id = id || embed.attr('id'); - - // Get all embed attributes - for (name in embed.attributes.map) { - if (!excludedAttrs[name] && !data.params[name]) - data.params[name] = embed.attributes.map[name]; - } - } - - if (iframe) { - // Get width/height - width = iframe.attr('width'); - height = iframe.attr('height'); - style = style || iframe.attr('style'); - id = iframe.attr('id'); - - tinymce.each(rootAttributes, function(name) { - img.attr(name, iframe.attr(name)); - }); - - // Get all iframe attributes - for (name in iframe.attributes.map) { - if (!excludedAttrs[name] && !data.params[name]) - data.params[name] = iframe.attributes.map[name]; - } - } - - // Use src not movie - if (data.params.movie) { - data.params.src = data.params.src || data.params.movie; - delete data.params.movie; - } - - // Convert the URL to relative/absolute depending on configuration - if (data.params.src) - data.params.src = urlConverter.call(urlConverterScope, data.params.src, 'src', 'object'); - - if (video) - type = lookup.video.name; - - if (object && !type) - type = (lookup[(object.attr('clsid') || '').toLowerCase()] || lookup[(object.attr('type') || '').toLowerCase()] || {}).name; - - if (embed && !type) - type = (lookup[(embed.attr('type') || '').toLowerCase()] || {}).name; - - // Replace the video/object/embed element with a placeholder image containing the data - node.replace(img); - - // Remove embed - if (embed) - embed.remove(); - - // Serialize the inner HTML of the object element - if (object) { - html = getInnerHTML(object.remove()); - - if (html) - data.object_html = html; - } - - // Serialize the inner HTML of the video element - if (video) { - html = getInnerHTML(video.remove()); - - if (html) - data.video_html = html; - } - - // Set width/height of placeholder - img.attr({ - id : id, - 'class' : 'mceItemMedia mceItem' + (type || 'Flash'), - style : style, - width : width || "320", - height : height || "240", - "data-mce-json" : JSON.serialize(data, "'") - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('media', tinymce.plugins.MediaPlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/media/img/flash.gif b/www/javascript/tiny_mce/plugins/media/img/flash.gif deleted file mode 100644 index cb192e6ceda8d19ad8e7d08dd1cfde0aa72ead2a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 241 zcmVOzlLa+Za}7>m0&NpCfJ0FQc3~F7DE)S%o1)Qi1n@vxX46qnD4hRS-NE*Pw!4UvE=#^N( diff --git a/www/javascript/tiny_mce/plugins/media/img/flv_player.swf b/www/javascript/tiny_mce/plugins/media/img/flv_player.swf deleted file mode 100644 index 042c2ab969e98a6fdbe08848c4a73bd2c41de906..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11668 zcmV;FEo;(4S5pYUVE_PloV|PrTvNvr@V+F3a36As0Rb-#MGjBSfQpD35b>z>Admpj zkkAkitwp@*Rqv`rs-o69lDZ&@y{HKo3{JcK8Rt^ z72Hab0Fi(9n@~bYkV2y_)Fy`HtF#7{J|rojb4e1a7ekY%Jpqu!GtXQ6#>m0qvY zqk05XkPr<=DTomvJ9PBuQB+V+fX0s>j}|Rjgg*T6Llosb@Z|f-K0(8m{He?6zo^!s zgW%o|yBiCa{N=g3_eV+xKc?-B?2)mXBGanczVGz$;(Jq8W!}yB$#d7jwz;Cki@c`f zWnSDHobzK#aT@9u=8^8x_Ib_e#Xl4Y`Zer+8u>-bA6`uVXi-Ep^6uWh%d8KaJS&g= z)KA}qY1=qz((;kczfDdZmcI1pls2gC!tgBV;pBqfKiK7u7MDbR)&C>$gyc05A7uO} zTU6zl(L392O7^D-J^u?tL2G}Nl|dGb6UZS!lq5p+9>gp}0$|zy zkSG#qbPAfg3zp?lIyJ5j#n!UMW{%nE-W&j!ZI})Q-KC5ph&MP(<)Js zTB%fN`{MEmC|{-4pi+ZEZQoGP^zA& zLSxF+rRqEl+hmTqSfx>GRVc3zjiF2!xFY<5N}=@HB8fb_IYAXlu?mZ7o| zrNW>xk}{1xtqwkmRR+Z{LK(lMQ+^9H0Gff% zJX2#B5lWP0dWAs^!o=T2Duogl*TKM!LUG8TsxY9=AQJ=bIZ~7vbc1o5C@Ly0DylPi zB6X=;AxGtErAn8jC@Te$;}vQ{nof_KL}N>PDKwfqMgBNcpw_5zCX}d9MX?4f1q5BH zQjIf;K8tpwpGg@hdc9%-(x|kBAc=g9I)9w8e;9k(1AMm0;^LIo2w|sWvCp)nqQ>Q7OIBoG-c3dwN`BaqJ6M4 zOw%ihS>0nCrK&(trZKR9V0>jIgTY<~VtawF!NoeAp$Mx6j|!@8ZhRE#47wDpaxk_w zZ9bB#483$(tty`=BA>qE(!oTHNMSH2@{4Fs^2!PdRC?S%DtRNC0b9$_Vc`%-0KWsl z4tpyM3N%(xt|-mdt4j=V07SGG+5vUw2tQ$nS`eWC^bEjRP@go6ZIn-bkt%;2?kwgU zO4Mu->COPIH>?q}HbxaOMi1RbgUQ$i;+&MUN@8Pb=p;x%p_xEbqg59ZRT$-mKTO69 z!yNNKBTkW_Sd)Vd6GVm$l)xKwg@qbbTA4-zomHu{D2EgTnM#5}(?In_K|MQ0b&T%O zv0GG-P9IbR152e3=^iR;{1rz?#t z)>Wug`QQd3^L53YQGQveL060kl%kTdQtS=buB4W!HHLm#TBTH%Vl9C#4A_6@i(xPp z0H1>?=P*pb)mTQ;z)w9I8i3J zGPPErptgE+fycR@b$bnIc#*`@ZkZw?a&b6jjeW{^Wky@if#fot%>Nv=VB$=K+nQI}A85~NO@ z;yQJrXo!Rj&atr$y{rUU0DqzfQ5x9-^=WZ&iLR8b!m3t6j%Nl|TsjW-XP^RpW0y9R zhP+-d-V8_q17$oKlV7ICVlALkB!tps zE=VF0Ble%j&I#b{0T@Z_2zhaKCjMnF^;{`HJ&_4XA`*&3d`O3Er%bk5gd~pmH+)It znbiW+kwX*{M7GXJ?zGGS*{0%58U#Gx`7~4m%Z`L)7pW(%aUnJJTn)6*ft2iR7Iw3Z znpPZN@N|_gb3zg~qbxEpv+g2+$k8dl1mz*ez4H_aGEHSIXqm)a$}99Dg(4FOJVoT` zF71o?!4380A$b2cghV3(70zUH=6T58JY;@}r<@RyTD0u*Pmm=98RR|u-!^aAaUUze z8>@VclI3idkLdT(+Lr%Ko{SN}U&;q{HG$&s0FdcqSlJvH{+vyVLnPq?r*F@f zI(GNCT^@`l*P=*lge0iA*jh0`|H2;4^c3_8_W1AAc8TG87F^PSQ{+oVDu`nU;@iG8 z;vq}KLoA|{0}~NhXPUk|O<%OPAYVbc=K!GXi+oKrPI6A?=_HQVB5DyGY*<7n&muwz zb_bqCbdZ{0Y*|FGr9}i=TSTyJiwL%~i2wf{3jYe@=PgD%vZ``2+975(sa(J|3?zK`XS zCPH@M=z<8-?L@qnB$6O^CS9QKQF0gO01Oe$hwvg0F;ZM7;PSCftU5c9FPeN}92aNX zJ)&6AELQYC!iqIZVxz4R>u6(Q%}049n>O|k;1Y;#&B3~48`DlBDA67UcD5!;=cNR~ z5z5oqnHR9%RmAkAw8&i4s#egK;)3&KB;EQFr{9-OUIo1A6c~MXkx0^m^tGpyrtWc4 z5*?grbm+;BQz-F5X2{S`cS$@!iI!UM?vTwXBb|=$7L*zfFd>oFNN7!>)a)~f&L*o# zBu$o*Dpy)1BQ2!#BLIGAnzzNWWgo3FGz<}5Q=3N&Ld)DuR!&)>O6ir2rwgqaGZer$ zPe}GAC4I;C4(UcYG&kSQC*iq$#*dZPR6H|7GI$(EUZqD<)EmqGE z5{9GCc>STP37J;w3t2plEqN#;ZX$qVfse+8N}5XAA?!kung=sUpcxnFfSnvE9|X#A zru!@qgVd-snJs3wr&1dnN0c69OC2_K6w$omI*~OLPg_;d%~Ulrf^z5x8e;N&&^yATxs&TCd(CJ-oKnKR{%vS@4$o+Gkt zxBzVWE=cmaskM=^fMpWID(ZCtJSv+o5Q#sz&X1M_un~|ep=t6M+DfjeoEor#mgiZP z=V$XGsdByxKDJ;t7KwCuW6@0p$F@L-ZHznszqW=~0ey{u*BCkBAx8SrP)!$wW27|5 zHXo#g|1AuYm1L`0VPA?1JoNwH z!O&Q!<|o|V)H|xB{FO2q7z+qVHPmGUurNdj#8o=5l`+x)YkblXKxu} zY1pIn!8U9Xe8ph7G54UWcVpXwuyBQ>l{AyLir$j2H2_niPKMa%IEhA@Ip2e~ql%Cq z3>gTiwx+y>&JL`{1@#X+v2#PHt*JY7mQkGTYr7jPw_4z%rH#E%@WWx~3eH4``?H(? z>9TFkid>wHRwdx)Sg$mT(h^a1FwUH?#3Z4{*;2qOio%A82Acs;1;+W-c$n|4BQynB zW>)?-axt3wM7%6Zvz4a2Bogx+S4|7cGXV%KC2S>9mm7|-Hx!`eydmpUtH}s_so&(B zE2T|s)dAU=h3FEJagx|=hb$_H-SCbWfR779LVWVThoM4#LvFN2y^QAgPT1ez5^!~; zl!+lCA#cKE9)FFQ25~^m1z`(hgN+S}EK?!}zRw1Rz{V`uf&e!;C)O>n;hM$S#sWTS z87K1jZpJeJWW2|7;S(sAvnYeNHM9RLe4ZRvd)NEI@U5|8|ugIm>8*) z%Xx#>#dM|vvCDS@yAV4XKnIFN?mQ9t7p-u2uTI5g!rSAg=0sTaM4%LmVC+_ECIlO^vs4JDBLZ&EVS!{J z#9?oX!&jhCh`|D!%Px{EmMoFHOFEUx69E0k3%VG9WIO3(m4I$`E``xZ`m&5&SP_Z@ z@=P1`%gOZNJ@Xi40aI;j2bT{6FDuwJObgVE`FKMaJ1Z~Novbho|C&T!TR86#cN9cOdLp7vK^BoISnGxtn8HG0&H;#R4W6qxVVEbs z{H+x}c$g1 zpG_0Fp2+tVpg*KBj6CTEJK)phF7v2Ea!<3fS#%hwmFNUApVN~*M#px}TbN-#q9@OR)B3i*0Q?^Cwv)$r*hsAeC%Bl|``w0>2 zQXo(LOr7Nbv;hWhpW1=MeR(JR7~~L+BwBn9`y831_Ay0{0Bc7Nv0osPNOsDpoQS($ zMI0MjC=#%zNQkfdjKF;^H!kgQMQL*5J}6i8g`5UcUePW&jiS7w-SU~-p)!!K2WAHc zPZ5MsAxU6TEu3ioCT^e`kM0=LS8Fq{L3M8t!#5uhW7~Sz@>ejP z3IDH*!`tGFCrshO&}pF=7Ce_)iO1YlxRqRPL=j7o3a|kQAvy}l>Ob~)mQ>;SB|Eor z#91Xi@+81QB$E=l<4t7)PM+7M$)E(1J#-&NBsPa;2Q_O{LYN2Ar4C2p4EGvsO~7sB zh(u(uLLm9Vj0jN^TeI7&M#QUGArfX%YBo)Yk0xNbvLjsC3F(@X4+%qdbjm7_d__c1 zoJ}XP=E2FAJ(o~#)e-bfJCErSUp9k#7yx8jeHd!3lYq2=Mv17SJz*Uk%lnkG1 zvRq(>+w8J{RRtM*afr_=%Cu~Yzjk1Ch``(8uZ}>4;b?`(B+Y}SR{7#Rlt8h6EChRp$6lOftRMFA0$ZuGMvhL!{1Vd4Tsq%M#rM4oAw z9iKIpnk}!>m3x~eZYD)?2uzqsw;en&QKMxDB@J{XKdgB=4P;k@hsT$`6F!RKK!+a3 zr8A#t_WTVyH>G9Y(IYTsW&3TEnRl3&TsPkM+-Hp4=01_{%|?*5)NC7AjFsO!Vw5^J z*E3u6wIEAFM1zzbo(rV=o+2aXPR3A2asW%-_rH|){mt;c-v;mdU!8X&Su^_vJgdKI z5c5E2Cf3Z~H?YV2hw+TK`BUC2ZHyUqo8D*`_V{ShTtv??#=jETnJ*X_MI$|1bXVa5AVDKCif@+*5fHKbb^HrG6?P;jBm9rosSX{-zLOxtv=$mH}G z6p@{UQ{4<9cW?!q!XkIYV zbYN4jadEs{(<1A%-dJmvr;8?@E}HRV#O86vFI#1!m4Cx!KYsddA@y`t>U>C3_U_6* zV06h6lqBwa#8tKtFDF{&>^4`>`2PQuSa3CC!S&y;VBrRhg|Etjj~NR-|BMBCp3b&j z`m@bM@L~K+L)v1=By*W3lE_S3=Qv(qZz|vx{cwSkacP3qTp=OxYIXwt#owX#MXWRC z2I4ic$rOZMx>B<}(HAv2;J%CTl_K!FUhE3bZXyiCuooUAyWx{D_V81SDhLd|?4rFG zijE;@0+GuR>dBh~6`@vD2xS3weSJN0ciGl}>_16wwb}LCM(qXmq6`P_q6`VWD5KtP z9y}eqwYSFCDg{O)>u5$QQ<`O({-1kWbW=~p;X14q7^+7)lR35F$=-NUu zvPRh$+wM{~G~fbyuR10#SEy`oDW84jwe{as4Q$Vh8#nX!vp!!s{l4|b6A)paKYtztc{PL;U2Hrgo-;L}^M>h-(x}{F(}Fl2JvbY2XKe)G zzv1*mBbH=O3;Gl)F$s6?v02LTIevi;rUCD$H9)igjw5AA@{mFI?%e~3xeHOC*PCnS z_s~YpI0VFf0LTmQ-@(LNpkqX8|S(sH6w)^49?S?t6rsux-nX{OQ7xcTjO4 zib5%<6m3C=kQYII>$u&1hb&+- zy1(7NxC#mm*bQeMWeGoN2<(Q+LxtZqxE??i7nlpRZmm$f7jv`LUR9NlgTd!i1uVlP zZcber^Vab9D?*uj@om0tK)DIt2If*N;7$Al!;P&<=!hO{2fV~WO!BjaKp2 zS>ORQX&ovbE<9HP_3;{L$MrHM+5l|a&jOa9&C9uzha0&-E50NBF25k$Cv!cE2_BHS z9zo?BfoIweXpr=AeHHKwv~EMM-}GW`<=W4v;(AKRy4j)l9NaZ;1Y`-z6&sn0xj?pJ zIBw<$Zia~GVHOqz{w7_n0g5?HCtQOv*%goIoeF=mCQI`sf00#FQ{Yapg`Km&7TiZr9a#b62OAn z&e=44;$C9CRG>}9k9ZA2olqp|3@~-k8Y9% z&ST3*L|@&W8^77v86`V(0e}Ex=K(IK;!=LD-;2g%*Bwo5?>1#lxiY!q&yq*8qlKfc z%c@hhj@jt(;rH_|uW>|f2cu8WY$Fi-=VtJqOs@cRQHE$%)}mo^$vUZbq033u@3rRq zULfat0}#$zvVeI^XLJxcV$@knZbuj=$%9)syjFe@Ch(GcSt2FE^S+qcp@yt>)=}+ zp7Rd1*f!OzHYLRWk%PPAzKkx)xrM&N)@G;oJ~=0&(pWs=gcaHA; z^6=hWPd2UUC+}7lTOZrh)HBxq*b~>f!^*r~5Q?`AU0+$>`HzW-Yeq)aO_4SH{pisn z?|V-w67uRUPJdADbpD?A=#PEp9l0&oayDb@`FoY0Uw)oEG|*XGQh%MXuT;JE_L-kV zpI@H$qD{}+L$}->ziZ^=aUb3Zzkj0y^;?`PQH2+l5Hxu`cp5Yt5)bWqGaf=jwKh$-(Q&1N?>7CyW-dc2S zYEg^qP49l)|EhNRIfwI$4nB^lcHVk^od2mJ=Zd6(J8%5`s3QG9-k{s@D_w8D5pW{s z_nV`$$It4$w&9J0Q3rdT3i5We8!~xQ&f1-6ZioIpUGw&By~ErCQy+SKmp|~0>lFz; zes2%Dcjxib+-^1do<0BY>7a-ckE2$fP?t#USFe`-@#mzZDObYI-6+}kJl20+-nOCZ zUMvj^jb14~n-mgXJ>VNhcbEU(>e7SH-b-)$x6j<$N1m)ZfA6&oXTqlMSIquB zE99D;zJB=P%UjQmt$(^}Y^C7NUbi{ab+qG#f3LQD*HK%tQR-vwQUzA?jKOD9j8+pr z_vbA4gU>@8yM^S9ThqEB&2EQB@{~C~i^pj{9dueUHCGipYvZ=zug(2tSep?a);)Ya z-`~5>fx5!C2j(t+^Ycqnf`dydW1FgDPZd?3?^sY*?KX3N>aLN?ChlGJ{e$uuc{>i- zPfMA5Sozm%mx{fkcZ~jc$%FF#ADxewuy^#`6eYH-(&wm0m!KPE&X`1ahru5lNNy4-v#Y4z7m>$4r6*{y5{>$+}`&)$ogkp6{L zb+u1tC}TD~%-(QjU(bLAeU)pj71XWKcqRJGU9vA%<}=ss#|a66*-5L1JuUxoUP95Z z;XUj-9y}n~|M$KNlahvYN#8Y6es)Z#SIN1P(@uAI|5lG*oZ@SaJ-h;@GJM&PJ9nNu zi~h5+e$nfZ%Qr4n_$hOLb?Z?@1DMc%n(qEF@fz6fqV(Pw8_r~hFZH}z`KZh1eYTu^@!PMP zpCT7u{}^f}9gJqu-lmx}IRulqCouYb;$GX~NHaq$WPkwmK^MT9!i?55c;J?lL0*6K z4QMryujzI{$jKq5F--kksSxZ$3G` zt;2~!o6hdKT6g}^xL@lQ$e&znH+;%`;xUom#wDfh&{6Lp10kLLEiw4a}; zIDuAP)Vv)ChJEZIV}o1o=@sDa)R-{;C&PD%3r9w7c-q;^@xr)`%QQgIBU$tI$DsPM~TZtCLia_!cmJ!8M!6F&aStJ$fNQ6HaQG3CS6elc5S##RpqA0r{AvF=pozs2fVM3+IQo9{D96nf>VEXn9-D_xI)gr)#o&!{AM4$5x!LikG@>R3)vx<(x9wr`O?v zx;z`iKeD|p0{m(CIbk`T0D)PFb{oHGI@ASBp z?bn88XucBp)SS8ZN9)RucIyr_x^|#O(#dEf9baN3k(`lq;?@whfRS`2>oa(3w>^U( z8G;NAfP}~s=W@QdScEgR_r8=Nr|fA##%od8G)@eO)q(D5L8z0=5%Cf$d}}2OA|W8X zF^F#iFD=7YsMd=y|B;Sddgd~;u@mCK&?{E!#eo>gnS*i~IQ1m2Esd%G!-QZMSDbiq z%<>2sFFR#h^gzAC82hU|g?s{WV}mbgTK#ceruOOfj6{MDrJ) zV!6^5v~;pVdw6z%X6R-7R7di^MB2Q%&x%H9~#H-8QIUz(Ln45_OAge~rzKY(Z zN$kU;1MVY}0BlLWpOS+YO}Wd789{x0eG|TgoBS|sCOf3TYY$LYg8hB>#s`+_y5EFy z)CP?zNLLVKC{hI#Xv*>By!Zl9Y?VO+bb3{Bkh&x?G7?nZ1~7U8t+<1>X7Cr9P*hA@ zOftB+zizKzKBewZKps5XY6i;Ke4&Bn>%d3@Tm6gZ+=B0g9S(D!OZdT|wxoI+8 z=+X?B&#f8#aj$Jdr=_iXbU1Iv$@eCYi}L&8uYq0s*DpNME6Ba7pw8jFmRg36;}QujUXdwq|5!y7UViX(-j1q2 zCO&6&PS`Pg&$~x%?|G3J=mtUyJTxi2e)?M*&Rl%_>yu~Glc(L^R99CwFDLx=ql49_ zeSLkMV=51<-k$vM;5GI4x;NhV!}+hp7n4G6B~HHC?~~U5@tu31aCUEf*~E$8&FUR; z?a9oyI&W`U-FtGb{9H+o=@2;oY<>5#r{j!=ZqHro>i7MXyK}^XNA^D~_mPOMM+t}3 ze|_=3Wb&TU`%SO6(2ZQZqf&|yfMthy(G*fa6>Yl^Hx8=GtqqH9}^n3 z?n|l4A|t<=x|*Yb?<6<<7TA&>f9U>1dpj5?ep3Zerh8l2F(?MB_nTf-LE=C)bwEc0 zd=pU2pqcEdMpN>MhiCy_w@5%qF4s?{o$NOgP4-e7%Us?WKuxEPeDVi{|B8v^R zB>cGn?UUW+E~#=aaYWFkwhoKc;CAT!w6v!!;h98w>O^~*NS!XbLWOrSlF@Laq(1%H zwQI=TMN<`1aa?+*WrOkuCFk2^oD7pW8IFQy3V04~Lb8bZ?L&=BI^DTJ=v^#E8S4m$fXGF-bTg^FJ?Eia`h^T diff --git a/www/javascript/tiny_mce/plugins/media/img/quicktime.gif b/www/javascript/tiny_mce/plugins/media/img/quicktime.gif deleted file mode 100644 index 3b0499145b16138249f653a1a3f2c80230fb292c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 303 zcmV+~0nq+ONk%w1VGsZi0K^{vH>m7Qv+~s9^fsC5ZpZP=*zu3F=Jxpf8k_5u%JNv6 z=md-84VLU4w)kSE=yI&-yw>b=v+SqE?+kq47pC+YrR?bJ^yu>Zyvpn;hTp*6^mM!O zu+8$^=JX7bb<~J01ZTA{q@86#&8&6~H`Ss{{?p%K!-p%L6P2TpFYz90?pD06UU# BbnE~C diff --git a/www/javascript/tiny_mce/plugins/media/img/realmedia.gif b/www/javascript/tiny_mce/plugins/media/img/realmedia.gif deleted file mode 100644 index fdfe0b9ac05869ae845fdd828eaad97cc0c69dbc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 439 zcmV;o0Z9HwNk%w1VI=?(0K^{vQcz8xz}f&njBB06v9GQ`Jv%NdDHCI&z`wqZw$(Lw zuFTBL!Pe#<92tv>h)9OE1Xh}vnVEHSaeb-GByg#tqM_B*)YRkdSdqTuipLaF8n=^^LJP4|1^gGRdo_Rl+a*grZQ1hw@Zo1ikN$oB{QbRq&z?QIckdq1aE3;Fq_(WV>Kc7gjQtQh+9OrtFhn-)LUqD<|MOIl_!(Ed#pPRE;S)g;ew3>pd zn`Wa(lc2DGa)peFw3f88dp-|`@*)AXj;@(8hwDr|7Sxsp;&YxjN*Y{PBB!TIU|!b7Zgv0OaG5)&Kwi diff --git a/www/javascript/tiny_mce/plugins/media/img/trans.gif b/www/javascript/tiny_mce/plugins/media/img/trans.gif deleted file mode 100644 index 388486517fa8da13ebd150e8f65d5096c3e10c3a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43 ncmZ?wbhEHbWMp7un7{x9ia%KxMSyG_5FaGNz{KRj$Y2csb)f_x diff --git a/www/javascript/tiny_mce/plugins/media/img/windowsmedia.gif b/www/javascript/tiny_mce/plugins/media/img/windowsmedia.gif deleted file mode 100644 index ab50f2d887a0843b116ef598e5a005e5601d18d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 415 zcmV;Q0bu?|Nk%w1VGjTg0M$PL`E^qkEu+z?1&N?x_*pRg{rx~kg!#|I<>uyug^O^t z0hZGrt*x!>$1C!zn`W5@`ts6_uMW)2%<0NUEKIo?SIPPE=}U0}7Z(?JcX!y=*;bF< zCWz-=h7+2ao9)(dOHM;+X=xs9)%!~xc&ICMZdRYdUQ2$^@9y(6X3NCIz{cM7f^Z=Q z1_tQ95kgl8b%R%OiYTIo7LSdE^@}A^8LW002J#EC2ui01p5U000KOz@O0K01zUifeIyT9%!RzMDgehG|mwLz+Eh; z7Z~iE zrX?OfJ^>XeDJK)xJuWOB3_l1N0Ra>g4Gk^=ED0V6LI?>4;Q|6OB{LplLMRLg8U5-E J?0y6R06W6!pgRBn diff --git a/www/javascript/tiny_mce/plugins/media/js/embed.js b/www/javascript/tiny_mce/plugins/media/js/embed.js deleted file mode 100644 index f8dc81052..000000000 --- a/www/javascript/tiny_mce/plugins/media/js/embed.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. - */ - -function writeFlash(p) { - writeEmbed( - 'D27CDB6E-AE6D-11cf-96B8-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'application/x-shockwave-flash', - p - ); -} - -function writeShockWave(p) { - writeEmbed( - '166B1BCA-3F9C-11CF-8075-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', - 'application/x-director', - p - ); -} - -function writeQuickTime(p) { - writeEmbed( - '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', - 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', - 'video/quicktime', - p - ); -} - -function writeRealMedia(p) { - writeEmbed( - 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'audio/x-pn-realaudio-plugin', - p - ); -} - -function writeWindowsMedia(p) { - p.url = p.src; - writeEmbed( - '6BF52A52-394A-11D3-B153-00C04F79FAA6', - 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', - 'application/x-mplayer2', - p - ); -} - -function writeEmbed(cls, cb, mt, p) { - var h = '', n; - - h += ''; - - h += ''); - - function get(id) { - return document.getElementById(id); - } - - function getVal(id) { - var elm = get(id); - - if (elm.nodeName == "SELECT") - return elm.options[elm.selectedIndex].value; - - if (elm.type == "checkbox") - return elm.checked; - - return elm.value; - } - - function setVal(id, value, name) { - if (typeof(value) != 'undefined') { - var elm = get(id); - - if (elm.nodeName == "SELECT") - selectByValue(document.forms[0], id, value); - else if (elm.type == "checkbox") { - if (typeof(value) == 'string') { - value = value.toLowerCase(); - value = (!name && value === 'true') || (name && value === name.toLowerCase()); - } - elm.checked = !!value; - } else - elm.value = value; - } - } - - window.Media = { - init : function() { - var html, editor; - - this.editor = editor = tinyMCEPopup.editor; - - // Setup file browsers and color pickers - get('filebrowsercontainer').innerHTML = getBrowserHTML('filebrowser','src','media','media'); - get('qtsrcfilebrowsercontainer').innerHTML = getBrowserHTML('qtsrcfilebrowser','quicktime_qtsrc','media','media'); - get('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - get('video_altsource1_filebrowser').innerHTML = getBrowserHTML('filebrowser_altsource1','video_altsource1','media','media'); - get('video_altsource2_filebrowser').innerHTML = getBrowserHTML('filebrowser_altsource2','video_altsource2','media','media'); - get('video_poster_filebrowser').innerHTML = getBrowserHTML('filebrowser_poster','video_poster','media','image'); - - html = this.getMediaListHTML('medialist', 'src', 'media', 'media'); - if (html == "") - get("linklistrow").style.display = 'none'; - else - get("linklistcontainer").innerHTML = html; - - if (isVisible('filebrowser')) - get('src').style.width = '230px'; - - if (isVisible('filebrowser_altsource1')) - get('video_altsource1').style.width = '220px'; - - if (isVisible('filebrowser_altsource2')) - get('video_altsource2').style.width = '220px'; - - if (isVisible('filebrowser_poster')) - get('video_poster').style.width = '220px'; - - this.data = tinyMCEPopup.getWindowArg('data'); - this.dataToForm(); - this.preview(); - }, - - insert : function() { - var editor = tinyMCEPopup.editor; - - this.formToData(); - editor.execCommand('mceRepaint'); - tinyMCEPopup.restoreSelection(); - editor.selection.setNode(editor.plugins.media.dataToImg(this.data)); - tinyMCEPopup.close(); - }, - - preview : function() { - get('prev').innerHTML = this.editor.plugins.media.dataToHtml(this.data, true); - }, - - moveStates : function(to_form, field) { - var data = this.data, editor = this.editor, data = this.data, - mediaPlugin = editor.plugins.media, ext, src, typeInfo, defaultStates, src; - - defaultStates = { - // QuickTime - quicktime_autoplay : true, - quicktime_controller : true, - - // Flash - flash_play : true, - flash_loop : true, - flash_menu : true, - - // WindowsMedia - windowsmedia_autostart : true, - windowsmedia_enablecontextmenu : true, - windowsmedia_invokeurls : true, - - // RealMedia - realmedia_autogotourl : true, - realmedia_imagestatus : true - }; - - function parseQueryParams(str) { - var out = {}; - - if (str) { - tinymce.each(str.split('&'), function(item) { - var parts = item.split('='); - - out[unescape(parts[0])] = unescape(parts[1]); - }); - } - - return out; - }; - - function setOptions(type, names) { - var i, name, formItemName, value, list; - - if (type == data.type || type == 'global') { - names = tinymce.explode(names); - for (i = 0; i < names.length; i++) { - name = names[i]; - formItemName = type == 'global' ? name : type + '_' + name; - - if (type == 'global') - list = data; - else if (type == 'video') { - list = data.video.attrs; - - if (!list && !to_form) - data.video.attrs = list = {}; - } else - list = data.params; - - if (list) { - if (to_form) { - setVal(formItemName, list[name], type == 'video' ? name : ''); - } else { - delete list[name]; - - value = getVal(formItemName); - if (type == 'video' && value === true) - value = name; - - if (defaultStates[formItemName]) { - if (value !== defaultStates[formItemName]) { - value = "" + value; - list[name] = value; - } - } else if (value) { - value = "" + value; - list[name] = value; - } - } - } - } - } - } - - if (!to_form) { - data.type = get('media_type').options[get('media_type').selectedIndex].value; - data.width = getVal('width'); - data.height = getVal('height'); - - // Switch type based on extension - src = getVal('src'); - if (field == 'src') { - ext = src.replace(/^.*\.([^.]+)$/, '$1'); - if (typeInfo = mediaPlugin.getType(ext)) - data.type = typeInfo.name.toLowerCase(); - - setVal('media_type', data.type); - } - - if (data.type == "video") { - if (!data.video.sources) - data.video.sources = []; - - data.video.sources[0] = {src: getVal('src')}; - } - } - - // Hide all fieldsets and show the one active - get('video_options').style.display = 'none'; - get('flash_options').style.display = 'none'; - get('quicktime_options').style.display = 'none'; - get('shockwave_options').style.display = 'none'; - get('windowsmedia_options').style.display = 'none'; - get('realmedia_options').style.display = 'none'; - - if (get(data.type + '_options')) - get(data.type + '_options').style.display = 'block'; - - setVal('media_type', data.type); - - setOptions('flash', 'play,loop,menu,swliveconnect,quality,scale,salign,wmode,base,flashvars'); - setOptions('quicktime', 'loop,autoplay,cache,controller,correction,enablejavascript,kioskmode,autohref,playeveryframe,targetcache,scale,starttime,endtime,target,qtsrcchokespeed,volume,qtsrc'); - setOptions('shockwave', 'sound,progress,autostart,swliveconnect,swvolume,swstretchstyle,swstretchhalign,swstretchvalign'); - setOptions('windowsmedia', 'autostart,enabled,enablecontextmenu,fullscreen,invokeurls,mute,stretchtofit,windowlessvideo,balance,baseurl,captioningid,currentmarker,currentposition,defaultframe,playcount,rate,uimode,volume'); - setOptions('realmedia', 'autostart,loop,autogotourl,center,imagestatus,maintainaspect,nojava,prefetch,shuffle,console,controls,numloop,scriptcallbacks'); - setOptions('video', 'poster,autoplay,loop,preload,controls'); - setOptions('global', 'id,name,vspace,hspace,bgcolor,align,width,height'); - - if (to_form) { - if (data.type == 'video') { - if (data.video.sources[0]) - setVal('src', data.video.sources[0].src); - - src = data.video.sources[1]; - if (src) - setVal('video_altsource1', src.src); - - src = data.video.sources[2]; - if (src) - setVal('video_altsource2', src.src); - } else { - // Check flash vars - if (data.type == 'flash') { - tinymce.each(editor.getParam('flash_video_player_flashvars', {url : '$url', poster : '$poster'}), function(value, name) { - if (value == '$url') - data.params.src = parseQueryParams(data.params.flashvars)[name] || data.params.src; - }); - } - - setVal('src', data.params.src); - } - } else { - src = getVal("src"); - - // YouTube - if (src.match(/youtube.com(.+)v=([^&]+)/)) { - data.width = 425; - data.height = 350; - data.params.frameborder = '0'; - data.type = 'iframe'; - src = 'http://www.youtube.com/embed/' + src.match(/v=([^&]+)/)[1]; - setVal('src', src); - setVal('media_type', data.type); - } - - // Google video - if (src.match(/video.google.com(.+)docid=([^&]+)/)) { - data.width = 425; - data.height = 326; - data.type = 'flash'; - src = 'http://video.google.com/googleplayer.swf?docId=' + src.match(/docid=([^&]+)/)[1] + '&hl=en'; - setVal('src', src); - setVal('media_type', data.type); - } - - if (data.type == 'video') { - if (!data.video.sources) - data.video.sources = []; - - data.video.sources[0] = {src : src}; - - src = getVal("video_altsource1"); - if (src) - data.video.sources[1] = {src : src}; - - src = getVal("video_altsource2"); - if (src) - data.video.sources[2] = {src : src}; - } else - data.params.src = src; - - // Set default size - setVal('width', data.width || 320); - setVal('height', data.height || 240); - } - }, - - dataToForm : function() { - this.moveStates(true); - }, - - formToData : function(field) { - if (field == "width" || field == "height") - this.changeSize(field); - - if (field == 'source') { - this.moveStates(false, field); - setVal('source', this.editor.plugins.media.dataToHtml(this.data)); - this.panel = 'source'; - } else { - if (this.panel == 'source') { - this.data = this.editor.plugins.media.htmlToData(getVal('source')); - this.dataToForm(); - this.panel = ''; - } - - this.moveStates(false, field); - this.preview(); - } - }, - - beforeResize : function() { - this.width = parseInt(getVal('width') || "320", 10); - this.height = parseInt(getVal('height') || "240", 10); - }, - - changeSize : function(type) { - var width, height, scale, size; - - if (get('constrain').checked) { - width = parseInt(getVal('width') || "320", 10); - height = parseInt(getVal('height') || "240", 10); - - if (type == 'width') { - this.height = Math.round((width / this.width) * height); - setVal('height', this.height); - } else { - this.width = Math.round((height / this.height) * width); - setVal('width', this.width); - } - } - }, - - getMediaListHTML : function() { - if (typeof(tinyMCEMediaList) != "undefined" && tinyMCEMediaList.length > 0) { - var html = ""; - - html += ''; - - return html; - } - - return ""; - } - }; - - tinyMCEPopup.requireLangPack(); - tinyMCEPopup.onInit.add(function() { - Media.init(); - }); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/media/langs/en_dlg.js b/www/javascript/tiny_mce/plugins/media/langs/en_dlg.js deleted file mode 100644 index 29d26a0d4..000000000 --- a/www/javascript/tiny_mce/plugins/media/langs/en_dlg.js +++ /dev/null @@ -1,109 +0,0 @@ -tinyMCE.addI18n('en.media_dlg',{ -title:"Insert / edit embedded media", -general:"General", -advanced:"Advanced", -file:"File/URL", -list:"List", -size:"Dimensions", -preview:"Preview", -constrain_proportions:"Constrain proportions", -type:"Type", -id:"Id", -name:"Name", -class_name:"Class", -vspace:"V-Space", -hspace:"H-Space", -play:"Auto play", -loop:"Loop", -menu:"Show menu", -quality:"Quality", -scale:"Scale", -align:"Align", -salign:"SAlign", -wmode:"WMode", -bgcolor:"Background", -base:"Base", -flashvars:"Flashvars", -liveconnect:"SWLiveConnect", -autohref:"AutoHREF", -cache:"Cache", -hidden:"Hidden", -controller:"Controller", -kioskmode:"Kiosk mode", -playeveryframe:"Play every frame", -targetcache:"Target cache", -correction:"No correction", -enablejavascript:"Enable JavaScript", -starttime:"Start time", -endtime:"End time", -href:"Href", -qtsrcchokespeed:"Choke speed", -target:"Target", -volume:"Volume", -autostart:"Auto start", -enabled:"Enabled", -fullscreen:"Fullscreen", -invokeurls:"Invoke URLs", -mute:"Mute", -stretchtofit:"Stretch to fit", -windowlessvideo:"Windowless video", -balance:"Balance", -baseurl:"Base URL", -captioningid:"Captioning id", -currentmarker:"Current marker", -currentposition:"Current position", -defaultframe:"Default frame", -playcount:"Play count", -rate:"Rate", -uimode:"UI Mode", -flash_options:"Flash options", -qt_options:"Quicktime options", -wmp_options:"Windows media player options", -rmp_options:"Real media player options", -shockwave_options:"Shockwave options", -autogotourl:"Auto goto URL", -center:"Center", -imagestatus:"Image status", -maintainaspect:"Maintain aspect", -nojava:"No java", -prefetch:"Prefetch", -shuffle:"Shuffle", -console:"Console", -numloop:"Num loops", -controls:"Controls", -scriptcallbacks:"Script callbacks", -swstretchstyle:"Stretch style", -swstretchhalign:"Stretch H-Align", -swstretchvalign:"Stretch V-Align", -sound:"Sound", -progress:"Progress", -qtsrc:"QT Src", -qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..", -align_top:"Top", -align_right:"Right", -align_bottom:"Bottom", -align_left:"Left", -align_center:"Center", -align_top_left:"Top left", -align_top_right:"Top right", -align_bottom_left:"Bottom left", -align_bottom_right:"Bottom right", -flv_options:"Flash video options", -flv_scalemode:"Scale mode", -flv_buffer:"Buffer", -flv_starttime:"Start time", -flv_defaultvolume:"Default volumne", -flv_hiddengui:"Hidden GUI", -flv_autostart:"Auto start", -flv_loop:"Loop", -flv_showscalemodes:"Show scale modes", -flv_smoothvideo:"Smooth video", -flv_jscallback:"JS Callback", -html5_video_options:"HTML5 Video Options", -altsource1:"Alternative source 1", -altsource2:"Alternative source 2", -preload:"Preload", -poster:"Poster", - -source:"Source" -}); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/media/media.htm b/www/javascript/tiny_mce/plugins/media/media.htm deleted file mode 100644 index 807a537dc..000000000 --- a/www/javascript/tiny_mce/plugins/media/media.htm +++ /dev/null @@ -1,812 +0,0 @@ - - - - {#media_dlg.title} - - - - - - - - - -
- - -
-
-
- {#media_dlg.general} - - - - - - - - - - - - - - - - - - -
- -
- - - - - -
 
-
- - - - - - -
x   
-
-
- -
- {#media_dlg.preview} - -
-
- -
-
- {#media_dlg.advanced} - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
 
-
-
- -
- {#media_dlg.html5_video_options} - - - - - - - - - - - - - - - - -
- - - - - -
 
-
- - - - - -
 
-
- - - - - -
 
-
- - - - - - - - - - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-
- -
- {#media_dlg.flash_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - - - - - - - -
-
- -
- {#media_dlg.qt_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-  
- - - - - -
 
-
-
- -
- {#media_dlg.wmp_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-
- -
- {#media_dlg.rmp_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-   -
-
- -
- {#media_dlg.shockwave_options} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - -
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
-
-
- -
-
- {#media_dlg.source} - -
-
-
- -
- - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/media/moxieplayer.swf b/www/javascript/tiny_mce/plugins/media/moxieplayer.swf deleted file mode 100644 index 2a040358df0d1f8eb784d2ec0919626198d6eb47..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33931 zcmV(xK0*ZhFf=CoW0g?C2+$1+GrGCZV z?|I($|NQejx%b?;XU^ zWphSTjoy-@udA!BD$`?eNsS5SN@LlCN%{su0#~g!S9VVl7_lEqm8IH{qbWC*8X~mS zhQ^502#w&MaPusfxm<{7j!QE2*mq)?u_md`WGt^QgE(;@igT4s^De)1> zDz%!A26pY9gmc#=x9u)afH_pSSA9^lI(o7uy4MiRNR2+Zv2x^q>PZ6{HHOUI$%RRj z)pNjsAHLg;QesD5eE#f^C){4^<#kEaoyw>0-McqRE`mxSfj@%|=D-bp|Jm?LQvy_y z!}6l4n!0Mk0Apj7VQ{s6vcW{%^B?3*QScIe-FrgqiD)pG%ur%IBGrki$OuDinX$a8 zwxUPm&|+;uW@OJCcX{_3EC2{uce7=3wIQOayhmhdy~Sdzjf|L7Rc@*55t$5rD-Bf@ zl@_4WA|ouux*n0>mek5y9YmwVY=K;fj40KYO{g##>uW(=vMK_5yN_L8Z#J~W-!^-L zvAVv-P*PvlmKO*jt&JGj{ggwMXv@nn88%8uhmCJn5(83pv=^f5oN||qp3$^l$QJ;TaDF_p%zm;WHBj*6ySzN zTV~OhR)Zf7;sCEmR^u|QF_!a1%EvDlf zN7fx8XZPS*r%0->Oe56mb{TMix64pjWw98{mUei$C-E`=?~;M5vP(K58mi1yE(Ov? zx?C%N+X-uvqeaTv*8 zh_lgJs%i{|YJHvAP!4?q?$bd_lU{~bv#HR0?HzkMkoxMX3g`n!6%ZQGeG;+XR^sfn zMveP+hd@U+4^5EtF}U&Jrq|tES5;dJTHB%ctBra*6lvLxp^t<@;5)XOs`Bz`r%o+{ zK`Cza_Ha@`wK!BzD(E0{oxuS8qA&zV!X2MIaG?_vGWEag2vc!pIRZ*+rR*TKS@628 zp3o6pM|Y^ka!ioodUKCRXFdA|eWODl>GLz3%2d!w{}1+)jx@FEEBWGYGmUL@WvvDS zZF0D_z`8a$S~b45nA&Q0F1?JiV!OCGt7~#5vwoy_4Khl5j$-rX;zPK`z|31ya)Wumu|4$4V z@Z5o)5ZTiRwb`!xQ`#CKwKW%NGsW#Py0+SO8Cx~pc6i%r!{+L$a+iLIFIV2to?3Of zqmZGeYpXr-exS7pjT~Bly{p1~lI!fr+1?%90Ze=N`5K~y{}tuZ=ir9=IGafR# zhbSPOqS_jK{9iJ1=ng{&Y#He(TM0%Lni3~dzoABSRabTJm9Lb;7M48z<;u5$O+zpK zcqKRb6VIOWdW{O`x$fn-rTre;_IUUw{e9nvoaa;USYY1bW54A;*ZDtQ*9R9p^4OZ# z$H!kjtpDcjJIgPQIP=%d9cO-5l$^R&{z|#w>dxg`k9~V(@|oY4T|0I0n`_VPym_); zw&u&MiyeMsvTmLzTjl%xrIk-D8TjxZpU$ zt39S}JNRNs;gD>@guNL{W9IrVe16lU`uaXG`@z|;cR|pzhr5nW+4WxctamEkSv>vo z#a$1}lB*6!|H!dCD{eqr^42@dO7{bn~$8^bf->b`o8y%enINe$By|-I1+H`$=g|HxQ#0|4!Nn{ z^Y{}7e%|wu_4WK!qH@ofS)wmFChmpEeqA{IK~@&R1&n zx@Q`@&p&#qWZEwUp1TL--0Jmr|=l6K_T-^KIGWEK#^r;v)@>EJ-uZ2&XGGVHb|DCiVuV8@U2O)|B0C8U7qUs*Y*xG|NLdk)}niEXXbam z^V8<52VeZW)Ab8qe0AgCjVs3w1XV11=GUrYHxG5pe>}d&@2Aa%J&(J8aiPnTn@{hD zQchZ`YY3Xw=}%*#e&_35);)5kr^G#Yi{I~^=LT=s_I2g7FH4rsxLtK%Vf@HVy=MG% zt77D?X<6sKUzqXj(-&WznX`1IV(NFxr~dqC{LUN4Mvu(zcID~k|2 zAMO+LnP<;GBjzg;p56Rqw%dd=2J;tZZ`4<;>w46Z_#ee{XJ+2pnYi_QzuND&9v^#t z<1?%JE&cpJ((VP*vY&EG-2PhpB=50XwiSP0^6A*U3)dM>n+_z5==c4-vR`jsS%2W% zr}Ni*Kj_wJ|6@0xQH8RuY5A9ckH(P!}c!x;P&M;vwrz_Yhu#Q-+X@EAGiL4 zk0J#G|Vs4O^i>CEnX-<+8H^oab*^!3XoeLHzc$h6vsrDIS15q9?b=LRi#*|;m{ z;?T`yZ=4(K_U)OX5u4NRexN#CS@XxAZfE8kIo@H?x!>!)IQHoF7ecbmKIVI5(V;~r zrw)s|HEC#k&Yl~04sW=*Wz7Zax{0gi9Gc(o#YfjOMPD|he5bJAEQzA`U-g|D=h@@8 z!LkW;n-1mN*$=f;*XO(Wfj>>%Gxk8ljwic*^VJj66Gak*HS6rRchBybdwkCH%Ypf! z^9mMi=(%NlsOhs#OLO18z4X>+CpMPV|8?TI53@|+^qq~|fMZGT6hsdHy79vwR?JU) zc3;@k{++h0`DF2}OF5oLo_@CRub(z^dp{g|>dGV8-+nyD?T6RrhCO@AxLYT_IxcR0 z+@2eOPao&fF25PN@^s_-$Gm=C+Pu~Kou>wmn=nzA|CH#)2{Q1kiuwM_R9QuCclaJgD|MBvg^@%qxh4$KY>%z;mhd*8(^xn;r z6Mg_a_{hkOrJX9`%s$r(3pB~%y!`5w|J|-`(tXB?gqrP132E0(bY3%T?TP_o8_$Z@il-jF zw*9=v$&jO_Q#J1%&HB1e{U_$dF|SVB^!%0N)A!ywzGvOKm4&(!Zs9*a_vF>-ZzXM? ztNQ8eQ1zXApKb|RTlld#bjtpyr@9}mT&}%)2JM-V{qt4#tJ>?<-80Sv{=ReT z_H73~7`o->n7wyrH!c@NLy@nV_S1~PHFML>EG{vAZ8=zH47=F;Q|9~o{3my5e0aP!4nG`FO~slFu>KKyp>+R^Wp-V@zk`~87+ zS2t~&mGQE@j2V|sn*Iz`T&%61f961HQOqK@FV#E8ethp4>!sB> z8Ff9bY#n!T+4#9v#Jj#YSW)qbrElnt>ywY}pLklg{klR`o_zx(ItyB&U7 zJ2~ySfPLbNBT{BAO-)(8Pf+f;XDV_p%snHY_2=}zx|%-!;Fd{ldHUALDA!r}{zyMA}?;Wy%*T)i`XP;KIZv>bEZw^^Gju01_cbDX(Rxnt4r z-`sxbQCgI~;Kh)nxt%U_TQgzF!ONGQ{aO>1w8j725yOnPPDGBb{UG**8!x79?iUd_ z|KzqOibfyYR@69jbgXBo{*eCI>bO59&AG@<`r?JR>T@Se@LipFeRE@MXG6bF#w{u^ zchnB(dHKb!Dvp%tUk-Zgg`-3N9I|m^!qU}pZaUZhPkx5 zA9>#y=cJ!Ia*VxtV!ijvUp)VLe)qY}6~Dgm8U14RHD85PngaR{irnj*dyyZrmcG`>dMk56E=M`@QKMQclNEey{MWo>+?@uTWbxQ zaAkIbeEs;%?+sCZVh)_XH(Wh7TeB!|(qp-MLtaldZi?BwUa zet%)bY3=nMAxlKC|-jePy)q(0=czEs{m2ihNgp`^eOduYOvj z?mBv;;+GX8PRv(*;IJ z8#i23UD>?n-Khzmymc>o><=>*ysnKub!6khhVhH$=F}WfmM#443e#iSh(89bcPq2&6{e=JPAvT}Dw$`+;Xh5aLLd#xVU{XE-!QNpIPzgIrF_kcbsuuvCLbaCG8 z*{{@mxnp$CKVB>OEUE6RsPs)g{963clt0GJIQ#pvj~`Dx`GRQXfz_v`eGWBFyzO-3 z&UsOR2Qo)a%?I)OrXV{Km8vG79$7rj3H>fJ?X zwdd9>Zk4?{YkG@8zYH9Idt~=5tVf48ha4KdM?aUe=(0C!mY?9vBYSRpVzcKL z>FUdmis)g{^Wr{!r^gS&j}BWhw=p(+qsL*<&5+l2Kesmc>SD#4U%yq9Q!sgmy6ekd zytv0aV*jJp*)&`C(r)Y496WSxLBi%$b&%zy;fs#TrtF^nyKmf^vb)>UujDT~xwjbd zEqzJNxu5bk4_GkejB2>__OZF3Aq+DMoE<_Vt*z0?%bF z$hmv-QcP&X^m~iy*4yV!|NqS~i~QF)abkMVA3gWJPLX3Q<=4{KWnlZ=rLt48WTTkb$onyrw5D9yGY5e}T4GOss55z-&$GW#IJn)s}n!e87s}07GrP z2k}r;rpHjCa)Wf>ppv3|P5%O!+2O>Pj7E!`53WxwXO!3JP5K%GEXSE8W)g9aO1*i| zq}stIW1YcdncUHi;t~*Cnxd4XWR)r%AQe^Bma1A2V3WKt>I7Ex_}F8?;(`WvR`A&d zCQpE&N%IE{7~H?0xWI=G2{Y##G49D?@Y0u;6CeGn%pk~MQuG;AU@{p^#8KL3P)Wg% zA%li^2|l&@s%k^I972T=cm33 zq7dGasSjSX#4DZ+2A(mb<@**wI`HrKglCgP;P-k<835ZPynhB4gRiqX_0n7PT7u7G ziVH>*%gde5o{+mReQqIWG^}!Nb36Pae zwiq-flYX)rpUw4_s%o<=&*3VmHq=&FDir_{EC+BLb~nfTt#m%J?gI_D2Gl}D063Kh z8a&P}{3wGrMHY}*BQf(gesRK!)CtHcTyZe+O3p9O6~ofKco?il811pFF_c&7#SPfS zQ*W{8%PO4`y<1m*bM%AbD-@eM5!R=6Fi~qFP#+RN{Q$5|T4f%L*G9`_Rpufv(AOEt z#bh0n8KAdRN^u3iF_o6rn+OV2%vBqWCdOXyCX%U{z~}u3y&g<11vV_ zYt0x<>S1p2C^H)@!w9y|6L6gn$Yh5MZ=##*jRa_m!A(1~e}7O=LkbE8D$4mLNM1+= z4jM8*)8B2tprJ(tp!GDv3KW%)Z4OcL0Y*q0iIkk@888S~uugQa__QvRXcdD|1X2fs z+>CYWaEys`BV=!aiIflSuNhgA-@i|OKexde96X^t1`iojIHaJch<|h+HmLv50r0N3 zW?*4~2mds5F#pnvf9y4A_&~b@PA8vCy8}+2tAmH8SFeIzCB>kwi!~q+rv#U29)WIp zl1E&e{Ie7)OMYclb-4tpBfu`&X^O3LfdN&oXR1IyGk_j7_&O_KA`UJQR~0eTAcMt& zywO|g&3ravutgDpQOX6}g_x9s)ZPZG7#vSet&@}YNxB}=3>XY%VeN}lZnzDbu~q{m zPUvEzMPJSLgyp{Xw+EHnSUUh>kJY54thx$%6#2k{Vw_{eLyO!B1{N0#DbWtm3@C_u zaMQU@teDh)IcZ0HWgsM98ALTzwPFH$6_fQY3BT$O3rCY#th*ua<&Lt@SlVf^E_qN3 zy)A>A*Ztj95|+t;iZ-(xWXqs>OXmlt#I-$0FngcccDP-ehOfy`11r^}bR4}cYj3P> z{5w*++R?|YnzlF}aN}liK~1TlTmt&QRA!KxVPun7S6dNKQc__ou^3Cr4IEKi#@dof zLvF)rOuG# zRat8EbwH=7;gXrbsMX0TxTK}PB{PjtC##d$JfpGNps$68G;m2#0Ygek7E@nUYXK@V zSu(I5l5Aqssp?cFIW;wfNlwd9Gs)?h=}dAaP${Z(6_b*hk-?;8sMJh)W}1r0NXyJ* zGSaisnT(9gWF{jsJww6|N<2xC2*U(-yRzg*3*PsQKa?%rW5q^>Egc*=UIqyH`?6h~ znwBieOiA+>BPFAhC~0YkGF%)JKnJ2=6x=1aYjA9ETyT7Ff-+zEh*Gayh-i1jh*_yj z?xt|}@br2Sv9y>Ku`DBHk&I>JEOKKR50>_1884RcW*Hxr_GKAAmhop9CCdb`OdyMb zSaC3mI>comV%YqQgB(kC;mQk^cnnlShN|AK{$8?zj z$uba&GFc{@WqQbRz_BOGFOAC~FMiu$prKZ^#k%plfhFpGw; zOc9HUSu{*G96XL-(MT4JVwuq_GlpeySfpc_u`E-S}@6)auJ zGF2=yo@FMmOf`#YSV=9*7+F-u`kGnB!ZP(N)4(#5Sf-I>CbP^GmYK>j(^zIY%gkUA zNS?_uO%U*-h?SaHW)_l-g{K6TnS*4HBOvD?R`LYgpG2(R0=O@N=cgdKPXql7{GWyY zbMRjb|L5WV0{o#En3v%H3jCMD|5f%9RP0cSiUm&iqu9PQ=4^d+yytnw&qhz80my`6tLdi45Q?oMo-A-iCIeooKh< z`k_F6ERcHy@)LplR3P^XNUK0L3*=#e{7N8?2;@&TsRg6nyNoH{lFN}?g9$e`LS9iC*c0O&t)axor>lmNAm2<4<%RruXefW=U$3E*NExo70#LwE z4eYN99HF6tP|zR^1sV&C1R;=uUJ&n)4jm|jq%x6JRS3=^kxagl{zYU0ISvrWe4{-qy33^Vcak zB^O}j0<}SOS6eQ23Fd;i5G&V#xM-Snp$;irSl>{j4M$yV`8v8UP2uSGI;@M}BDjwF zNL#^Shp;H(ReRVWDw;eO9(EDc$u7#v1ESQ&s_j5^we_`Xqv19X@`|QunY<%p)gxBb zHIzm@Vk@#XbDg;uu1lqlt=OvV3XDU6QG^-8fN?m_INUbUYVFHVz%`2J8Vy{Gh>?31 z0hi9I8XkKLM0Q6y18S~8Sh&tM&Z>(uplSpm#P^Lum3}ro@43_~kfN-r!>UnK?D1Gt zTn)07>7sEoL!}~{p%4WnXC@?~Bnl}hF$3kB3V~GcQK`6w@=%qn%Gy^#HK~r-#zP>7 z4|8g5GUCISz=u%{5tN9KOg;(x8m%hZL@30Fcc2WtStvs*=LZiyuvg1wDzsUwx|F^t zRAs8I-pZv$Xw#rH8mzi>c<7ssDl=@8t?>i2nczCj%4I~$^;x#*RviF(sLF1(8CI?v zxN5t@>n3E?_JB-$6hZJT4XvaX1V10?a=4r&J^>Kg0;CIf7JW}#?p|)-{4~;KfQ(%5 z`z#u(iK*1soz>&Nv2zkT~7 z{Q%pW*ozwtp#xObeNz2&B zI}YQ9al>^ZxDmv0KlbOvisXtNSZ6$j994HBdJNg?u8DdK*&at$-AG(}q1r%Y!BON! zk?ZKbBgK_k+Y|6ctLw}4<;LW)ST=}T>U7iPO6_jToo-`uWp=kWoNgt#a=Y8xPPcKn zZg#izPB(q7!tS=!=~kNSZg=~@=~kBOVRzd@+;EnZ=X%=R4q!JcXV4eg4)SC_QZiq{ zgT@CdjYHU3%TZmuN0mz#X$>ovPAn&MCxV%r3 z@*Znw<|f1*t27*z(h$@)IM01>#ps4>&RNWO9yN0{Ty6YZw8F-$K@^Y=>h_pXk5W@)8rcT zlWdO)kB!7}^2+G)75XW**))jq7twMB2cnLXT6Gi@;u1t1N4ArYjT!MvaimY7T<@Vs zKh<^?yXoqUH0n>B+>`ss2(3A}5=x1;xo=aO* zU5;Ku%MkShZJSSnKH_FXQ|qv<6BAvR)8NBEY8KFiwx?*U6!_{)7+3O@8q+gZYMT&U zf7JFYmVx;QNAn8pqX_9|A=`7V?lbM~vyp8nEeM>2JUT*HFF06T-@G18uOzadfxX20 z8I6OO&HH(|g&+GHr=K~<_6jg)WAu+B+j3er7jm#0RF%01`qxK;*%wB3GVppM{iHeN^JErUr8 zGa8w)Qg}rMeyTvhc9`9QL!l`uDkv^08B(C>HIi}zYk|RH#^%|{E(SLlmJODjvI(xH zH&~$n%NKEOZH04eoggn;+T;|xv9b&x*cFCW20C~CU40$#cb~b=lYfm7>pVki^PQ() z0pl53oAW%eVVK9*6NbWnVCLv1WOBC_SqRn+#sY>7VmI&npp0%=Fm?lByEd4A5;?Mx z)>aL0m}0}y1Mah|2q7*PTq^eUysTt{_wA2()x>_Yl&rmp&i1=HJn@{$h9N6Mv`k3xki&~Cvxpft}zMN zZz7?SkiuOihG~gB7a9nXQ8J`OZVZCyik5bhAea+rMQ&1rXhzGp$>C9~6}u@AVkBCL zn+HN-R?E71AtaG%rEWf8Es$wtZhp|d5segh)+2X=$b*H3!zzuY*s&;{sf2;H7)i&{ z@sdjV8cg41V@2`OO3^hW6UoOi@$yRM8pOhFtT?;9Dg?Q6G zZy6&B23sFe0&vB*b7Z@6X#Z&&vkU3wBE-?eq_A3AjrU^6LG$G6>n!yqgA~@ojIgjf znFY7u2K@wyfh=k=b@k@Tzh5N1Z+)}N0}_(d+C)uO+w2Wls;#dj>rxKWqzFurs7h3$ zZ?vy@wPoD(YMI376gQW!|LQIBJSt+3Il093+6fDiD$!;#uY6UfD+YH=7CqAT2Sd^NY;VnjiNb07f#R1B| zfIzUF1O*2NhXi*B4h;@d#wim;9*7n(Vu{1nizIK)*Y`Y;y#vqv( zEQTFfrVA^HWj*6%u{6tsv0e$RXAaA?yJ@TVyz zl8)*W-I-it$h9lECL=Fz8BK{qD3|g89U;<#GDV))dISmqG03YI+(cN#IxRn9iAHIi9 zmCm2@SK%R|N*BNdsC3?(H@P?mY+fJ=>*w8mJK&U=*4k7{maAOV={qzMHf#t=OW|{$80rs1x|VSCatDIaX92Q>pjQD3ZsX;?x4o#wE6b>S!sBSC)P^*CK`crfR5o9tr+IDfn%8nJwv9RBC*KL{aHK_l{?IF zzDRCB9cR_h1{BdGsS(*tb4p5XQ(%jN55%a@=3ziq;IVlckWPZF`Pg6=EnlgX!L_f1 z#y)M{W7*D?tj!1BiF9&K&bj3xt%BI={GD#@xwPFa7`tgbAcoL6h&(Ce1?w3&OBqTe z0h_ly!JSp$$FBmOR6Jl9rnH|kPB4lg18_RUZPOxLbwonp9US9qyGx6^aU~ebl~k!p#y6* z-6T^15%gUYbqD!k-NQ3D?G04kKb;Bi0-UpL&>*rB2QZ4Lzg8h6IbJ3Kn9hy?5I5+n z>kUrbEyb$7Kb*3H5~LPm@7{g-6csUKi**|@7UY3dg!B~B5<5zU=;_wM+uz~P-EcSs z{P{3$4s%GJ-XyIxOd@a=9=O6_GzQFI_+ympFcuG!q1>3~JlU78pjv6q? zr_FM)qmOX*I;MgSV3i#~<${rGIaDBcHg{t!!3XkyvY@sKkifuN_J8eQq3t~$!PrU6 z1W1f=!Dtey^mUlA+D1ovwRqhgD4NCRYk-N+4Wp(9>rH_3PG-tY`bjQ8R={53(+)BE z*&Qb8z2O9g{CbnwXp&Z#^mUb0WoB8ap`xl*TUA{x#eRnXvXeE`mSYERV{NgqqN17{ z!ASDwz9E$h-pj4FzJ>s$OorMHZRMaNVfM+p9dm@Sul_X{z&Hq!W9J#HuQgO7gF7BO zV~j8v;yD`ud1__+gklCO#fX+xPhuM+t;Il$6K+N1JPhJr!lP9^cul;Gh8H93thZ zp~ViAojcTXlGS}`%MFbLJ}1Xok&mhZDzo!}hq<~DqcQ*5sTbi)54%~IKTE^@z~_;; zsDGbc1ri?7DRo$g<$^8P1^4JB7=Za8-U)40N(Zd_zN+3DW$I#>C$_5A zy^tVC$oy8oRaY~9*Y+dhqK$|>r*&wpAh3~bNh3VYiXegJ3E({FetDEEQjwXD+|eCJ zt5{f8FxHlvX_X3Pqbg*U@EtWy*?qH%A+WK^Qn>w48Wiq$u#E zre!heG!=kO(=s5`bagUZQsFT@6JBKCOJ+JCN>#}jaLLL7L}^MUlbn?d*wU=5R34$t zq^JSAnv#{OW-zS|X)Vkdz8zv=1l`2Y4O$&rY8(JKtj1GvFb|Mqx&cQJ)fT*d;Ol7vR zRJjHz*COR1M0>TGEqgr*U`d9hB`i%asQ^f&6)f$+B2N}pF%SS!{aD(cEc*ZyHJGJg zb{z@`R9PgFCBpKEilx;ooy>Ztuyh)W(pjG@*0&q$)177VSd`B)y;xMh(mhzF4@>uD zQ9qXM&(Z@}dLT;=V(Gyw{RoDc(nTy?%+f zSH>a(OFPh|bQMdFXXyznUBl7@S4vN0X%kCZSk%CxNi3kvVTMnKuxJ`fPiJWWmCk|$ zKZaN_phm@j8l?d-N&{k)2DB&*Xi>>hxC25|{4)GCtQY{IVgQJW0U#=V9bUnj7+^yY z;6mxu@P8BjfDiS58}5;;5@4d<028Ix!yllcVkt`}vh-$n+6tZkFWZy#*^5}^0mKGa z!9wvB&`05|nWevn+f{J-748YF_jSbj{09FU@V^OMzoQ6ZgrLD(3kz~hEJb@^DyWHt zYZ!hGhiCt!rU;77pv06)olMiintJ5)%+-M50Yj(YeIVU58nM~r%G3Djcu%pgQVvWD zQPTogFAIFyet!<%DRwa!2-xQVf~XovH!VR(MXx}!UIxaID-lG11Tb%B3181 z@q^_Mnie5{DSuab^7nw!T&fa+4ix2qH7-b$59=hs$~>^wg(&j@W!oVjA5gZT0eN7% z3!9Wru_(MzLrGCYCk^F;I>u`#UliF#L;0boV2r+vF2?BFPQx(zwzC-HZeu26+-(h)A8imla9VJHq_6^^FhCF%Ht2nZY&rge*T>onDHN#qba z2*f^O<)k2%k%-(BE3n z8AkK#_E1W!oLq>DsKE!UoUjOl#@WU-!z<2h1;l7&{V|*VFnRO<3#+Y^kl^9U7-Cw@=Rmcs7UJoN(Wos0g?zP{u&fY}W!8Cd zUd>u>1n5f=&wfK#>V0(D^M z_6k67J3(Rq0UO#kl)~Wy+_hBNS>M^V0`4*T7~4v? zb6ujr1g`B01@(sWkw}RJDXWN+HVy>+2S`4}RxVzf0Q`WDO$4_jE-4zlu1y3N0*;jf zR72qbS+D_(P3c^j0_a!B88?UPW^j!G*DcspA)ytD>}zN=wGU_7XGoW-OS65BbZJ}~ zmu@?NNDTmlATd~Dlp)lHzG<{J6>|IwEWw=t2~k+WQ7qv&kwCm>Hgj1H))Sc3LjXhP7aNO<8jR40}=L^Ee0WLpz02f#kkFCY7L-) zBbxGR>^A@eBG62V_*!i~s_bQ32eqzOgHLD32@KNhMJh-EfO(;QfTT@MH!Xm9dAIGn z05cZg12AXOEZsrC`}ltSBvR4j1-0EDgFfCe87b3BSAx`RXvPQ}>Q0lI81n;Qu7Xd>^F(`}H`?OR^j zOf0RN?F?{qYw+;_X&5NmjSm{I&3sl~<(Zoh=I#ObUn{P-nA?U)JGZBu`%j+xQNlgg zb{AL%^W1-7($4K==blBA0+>y>9|2^qm3xHeehia#Zf`sHJf3?F;g;E+02b(fFrxoS zOvXQsyPpL-(_F&D*cQSY=#DVcB2325!%R;>U8ILlD327ZEeOdX)oLzy@(&MGJXlyXg?A7#VQ=|vQU}9?<=(JRobd8#(Gg` z2SXk0fWT$}zRdgLVYA?ihs|n-fv?qqui*|~1U##RB`-w^goVMg1T_nF5Jzbp#I-MO z)PR=7br`#C#3XM1n{YG(9A2F`S-aQm*ehnkFj%|S9hk)8KEPf9va3+U5PbC~xR!lN zH%H6X<1m^5{5=QfN&E{4)342eUNMLfDLj6|6?`|ulHaTH5<O0uSJTmy2W-@{9deOJYfuZuX3Qw=O-V+&JQd!^26T5@a?zdYIF=JVFrYVNa0qGp*BW z^-y81VdoAw-?!s@KjX~zRS2DdsF7VlQtAwCI}1TX#y^Vu%n-zRcqoks0;rAcdrWG} zK-Le0DhKKUhCi2j;f*wxXe%TT6&Rq_|48dNj??0e3O~_SU1cY$XEf?tNmrKIu42Es zDz1tfpBrLtv^FAd0*rsKpx*?~H(X@?0SSP90F6YVP}~-0Kq_vNJd#qkY1>_pL1Nt> zMBIai6aukt5*6BJiAZc}AU3l_*5(2|#Bh#?q$>oNAIBs~*IYv3bj=fybm2C#z~N<) zAm%9%WM&v1?%~emSr~BJ7K2|XBiva(k4bGUhyCVl^>O5h@Q#Hgl%hU^2FAAe0XA}U4+nz4yqW~?QG=;g zU+tEf2p<(oRHv&l(jT&LtY|e+JUYWTDP9v(s zi@x|+1nEGy427dyq>v_Zq>C5%rki1CZ55pGgWrnnXT>kk238OF-S)-yRRb`B^Hok@OmeI!{4dllAryz9J1s5QxrD*MnFDEZ zfych0Xh+Dmw&1o{_HBt9ZQnARtV&4{WhE!e0YWZPik0pG-bx>(cOX)B0=pWRQE65L zTmBWS$b%JmvLY{RB9!>DV!(>}vtl_bQnI2zRus;%9a%}FtRsLfqgYuqE9ngNSqu$B zDpv$NDN-o>0B;Wm3s7>{tOYL^0-5JQ_YpA|MBjzDbVZ(CGAWo8JoI4BfHnmfdO60> z0|3Vp8WR{o7*yV!Mg+wb8MjV&Tfur&Ni9gn5?9}fU}BLc1&`8P59+n86?0@$aj z98NH5m9&h%ll*|Z0*FVudF9zEui8~S|EQpaZmm^P?DYVDK!Cr;*~ew1!=e}*X%h6n z#KY25irS%<10Il4QD$m7qeN1<(vODj60h1ISd4)68XwRdGJnJ)m!S)Vep1pTrf4Z> z1{nQ7H^?YxcTW#5a`h%xUvgCmyP9QeNz@GoO9^54c_c|Zh^B;-9@s!p=A1sBA>^8fJRlhf+{Mfkk`hp&nJIeGu0CfWr+3<@8v9+bi9ng)%T zpAh1R{Ex_i`1F0a_!#T-FohM+);LP`dE5V#M2K9khl?C+RX0{wVDV?2_Q5Kzu$ijvK#^^Iyt=nB+fPM!`p*Ys)dV7{}#b%Xs*BSRALX z;&{lMXR$tHj09=_rV7EC(^-Y4s&X795Au1~e_wf=G9hB(IwM%C9x{m))y7hNb+NHO z22G0x{|iY3c3o^NBm({U1C{gP>|8hu6efg4bugNLNTm#L{fl{ zJX|*E%gO*^T~%6D4V(D^tyu@BoL9ji@sMg?9^2W1BS6zO|Nn64P{I2?oQ3ATIU!6Y zdp}&()EM+;IO?FhH#rI!=g33$nhrr^3lf%-{g4rY9UsoEOfuNh#K-I*t0UyGrp!{W zuP%ZU&jB3&z{$=16MxS>cGEKK7|}y7;MIrhslan0{z&&0##R7cKS(w?fB%2Oe$!%l z=4x0VN91N^q~qPc6$U^vtFwr;9o8+rr506$JiW$-)}EIs%{+^pmb$Mz5g z;LpiSax(Z$P6bm?aw>qNlQV!nIU_w)!q0u+xLZI$1FScNcNoc}0A?A0zR4L9erCX= z0N|OY;bmq@s?;%FXHr#JsSF$yqvp4TGpQ+=Y9=*Roo3&`mYSZP%%sAxx%S;_Olnpt zIAmpHxVISVF=@#FhE9WMd9@yMF==T4mQG8{OqUBI9wsd_H483TYSuo^VA9p8nQ+NW zkvaQ&COs9T0!CXcbM}@@dPZ_8T+-7(oTH~=GE~WMsIMwL)xAZZ!(>1HUx`(56@{Q>qsU5*y*p}LX3ZhcGJH(U557j}fhFxI|1}OWKEWD9NXoFC`>6s3b zq0jxT4k~N1S_;P$BV~fJpK^qBq;eaa_yC9EAT}M=+KBBC4);;82+kh{lsBwR#Ihm) zE2~*iIxFfyu-pA*!;ow^%}PeGl5wo0l$97*Nd+qz&q}ncq>zGKrN;W+hWu z$qZKVC_tzIUM-mme}Gp@7Q!D6=64k7lwGz*S3LgZ~Qn1E5+0fNBYV zsU-lUmaK(8pr<8p$gTtq*=65FvUiaPfHh!Z#7l%Um^uMh45#V1HOVP4tf?c|Qw--> zz>~xquUz;7#rgroDlrv+sX$BxVJa9?A(-lbDcCW~hQS~3(+q&?z@;OmA~A&#s%$i- zI$^3aP?8v+Bwc`#b_Gfr2b3%xC|MFvasab3@?@YyaM~*)N(IU-4Jfw^%$JGzvYWDC zX}^0@H@N1&Rfck#dcsxH)RS@t@Tmk9H1!fmSXR;pAFHG->`i&}1&49{OuY3_AGx}%-^2pZ%g^x3;gXR{`N9|dxgKf%HLk+Z!7uRD*m>bzrDrZ*6_D? z$ZZ{3Z@+J}-#6RuTkZGl2&KXnbx*I1bZ-nBrhM}7I-74EHlq7t*s#bi4`9QLKZXs9 z{V{A<0-$2R#{;NXhNJ)|mLnNJi`|esFpp9ox4?YL9VvqHC=cWwluvmgkKjBw($_OM zpYldtA$b5c_U-^+Cgc;E2Vi60(0l+J`-SBJ*w{ZTAHc@S@H{x`Hy}J8Ajg3b07pSV z5%~Zo3GSE&z~hjP`2alb5Sa(yhtSA;DjbDH2cjMS<;Dg`C0^QcsmlB}W9P-=>XN{3S@DU^v) z@v=iYUUpy@yvU#FSaui)i~MPL*&)@wlt%+#$936(A8E8ePwd4z-T5Jf%iDjs&hLd) z_%N7Q!*@>d@d5sx@NE!NRU=-3C(l&=LybsXVhBS~`@qON89wV%7uWz9fCYGF_p*8uw%+qkevT~3c1egke7y+1i)8=O0KZMm9XeIP&94kTIRr7_ zCjj>Jd$){qbgFYD>+d(5w}HTDbr20N{NH{q$juJxC`m0*@kise7<7usH$)V0d>9Pi z$%p4n_w8N|cVwAMa+6%>ma9lEa0)w;f}koK3k)9os-)Hc+xKDDDr#hThY_$D+CKax zm6%^ybg;o*^ZP1tlIxNIzxo^CSYmY=H~7l=0PirYAZxq$!yIH?d1RZ6WNqL9Z$Jc^ zV)s3&O`a)uCi8$d;M>J+##I8@F|R{ib{(xsFc)@Ht2+^ zxD-wjZak7c!5QD3_7A6j}S%s*g34NGT>u^lh|s2=qi6?dtM;`nPWUZ!oFrb z#BPrt(Xp*Co!mIszu|C|KC+eck?r~=>j{6u;VOMpE9s-!^*ics<30+ns5oaj5$$CJ zmeoE3h_X+&+AIowCWgh313E|4IS`4V&!mS5b~x4L@nZ0l~pn4`y>(KJ1h02P`%} z2qz(_slp$>vsXlC9ys;)1K<_GxZl&1H|T524CVcaB6R3or@g~fqdXAI0f(rxk+!z2 zF>SUE$VOqF#~()krwH6H)3Kf2wcGOR(?-AH%NMmHIb?w1%#Q4~(~L(51V@;iEevg> zoV~+JZ!bO%&Pb-poYKn+4kLEu{tX~J+q~~0^G7vGsR%!fOG*$G7V_BWx2UzuM0f0H6XJkD#s4qY#)l5ngJP~ zlAfLlpKAgvrcB9-{gui9r8I!-ln-E}voYhO^^3<1;)FoQWLE`o!TcF(LR2Q!>lov*TDMgZ0T|ePKg9 z?EjXqKDjK?;LY(2Y>qEreY7mo8-IGqryt7obgHMv@OL@t;`I zvrIYbV_*?{RtdhT1US-K*4xNR>R3M$i!7`USYxKKXgcdN3pS0z6v&qZ@@0WsCXlZPEfpW z(@a-LlooklAh#$N%%KQ%$c2*>0r?q?dSh63Y+NTuJu405Vcp)s(dHHSG~Y@B@D@vD zucBY1cwaMo;i(KCY);LD4>}>ZxYIM?4eV-eKKvD+xaS}YypHfo#rwEDL~{{rY}U~n z%`w=cZ5}FR;=N$=H`x&W1R5*SNr(%Jv=XEj;ZO8{f4n6ec8qt$bi5xYCHGKHx`E%U z4jZF&GET<9X~1sy97Wh64e+ObT%|MI035EEwucL!b|K+5BeHc<$%hM{cCj53!aae* zRg!Q|^Wg@-*If8;&*1b*9N}KV;a+wLH_#bw5Dpi5CqBKfL6d}QL$+UmJ&+IgI)r;e z2={j!ZXgNw4j*n1e4m96_b(i-R4kIpDk1yuw@)IPg5lKW9@Ijb?7xJRvyf4+|B?ym z4LdA#9k>n=zER)=-#!64_E>yRP6~VZy|_>-7p4p6!np{INJ@hk+cR`?gAWu~GY16* zB>^&U^kpK5eg%XFyDmxem(qC8B^Sa+A9h{Zmcb(gjf-nJ?8X#_c&UM0fnA&Rq2&7` zURJJSG___4-n9is3v^sr?*%Ia(NsNr=L^0{LW=V(yl+nKNZuBgI%dP@9wi_`ZXM@&ZN#<$F9x#7}(m!hkFx;3*VID+X&vpXZzD7 z+%C>=yW(&?9pTP`jdr+g&Vmm`!5+IVe7JL9iyz*(XAk!Y*smw+J~l6??d^h-|L{dn_OBYY^@VA>21`xUnSM zH~DbmY;W1aU4z5*afG`8hr7uo-1wH^!d7FxZEm-RyIo{^AK2shaCbnsJB4s}<8b3i zxO*Joeqs-IFAf(V|9n0l!r?Z%gqz?DHxj28HXKW3qoLLvw}*RNWcwP}6ZmjXLb#`e zaKFXjCV0Vk&vuRvH_~<<6S_n$v00l0dZObBXlUQt<8lGV1$HO%ak+-$@(VAGz!H|WQKsMn>Hjmg4HV4^+4UkQ;n?T61Nywoi*vsbF z9B*@M4tF+r`@Sz9;P?AichB_5l0jJez4zIwuBooBs;;W8>;M1%euy5i%kmeLw0X2|aLqlieo?@`tIAfiX@l6*+TP-8zWh8h(miHg>E!Y)b7deX`FDayBu0Q2+kVlPm> zUqPHkWKvF1#QKTOm5t?a#;^r&U%mn5^WP; z0yEnYe)Np>er=LwaxQ>of|XAn6}(;#Yvb|Nc;FE{5UgB46YFE-olLH=K8Snxc!Mhu z_+f3*gHsbcS_s<_>y#Vwv>nrWLWA{g(0WQEgE8yl+Jq>!^;g=&(Si-&1Nfwdx?3va zEtlgZpTkR@WA)N=U}R}z&uP}@wDE~#f%OmC_++x!`aDIhbR)kcBHt#xgviI(OPcjH zMD8oMzK+O!)z&vCauq{kE<(yLi^#W2FT<=HMWbf>9z|HDBJ1;1!9PF@ET2Gn<-!}pGD&(>vtHHQWzs9w54DN#yJ(R_b@L-_JfYKXu|xvm!oO)^+F3|;+CM|g zJ1Hi;{Li)h6%_SOJ8H7R`lZNa!5x-PTItY2&6U27#O!GCC&hF4rAX z$P-P*tlyKT24nai$g={2>N)a+lb2Z*c?z%u`XhOYlO@)FlBYDe$odm`$}tN3SsTan zg^%!mQ$+=>|3mdqP2XS#s^JY(gEgj$wy#I2PmtHVLcHtU`nbB3eqNdE2$Bi>NjIP~ zS!vy;Bb^Y0e7q6Hd_L=@L>I9nMiN`it&zkwb6X^_-P|5YY%#Y8$FZaC+l;ujN#DPa zun=3m3pl?$xVf$YQdPx8W3^xG?uA6!o(x=V4DXS~-0e%Vx}uCEw~Ld0qX zV^+;Tmjm*l21N^l>jAFhka7w75iYo@xq4o(aA8qNe!&7(T)GI`H6pfJN^T`A;S5!D zI&8YgEFC{&1;%&y95CIXM`Mp?_;msDj$dS{?u(8`5(s)qbWhklO^abDNdi4X5GI;QMVL-dy?#|GN73p8!5zu>&=LV1ZsjPxz%)4q5I2IqYQeD>|_ z=z+o@JfDog!8rzCNE|I<6@jxj7=afWL3GFk=y#epxuUCLfci3!yO7)>;V;JdB#13Q zoq*022k#lS|CAVdA3C+oW#-s%7iR3Zq4T8&Vg0;MSW4dj6fo;Xr$ee$B5V_g9z-t` zoe~apz&OhgX1dyJPFpMKgb_6s2+2TeFO+cxaXeajHJk7Ty+`uK^Me?6VAz zxHIDb**s4Jr0)=5uXls5uoUVWuFglpP|s*;bmhn>s2>l_aR{Ad#zO_W-$7GTY_@Ms zX>5t;neh`H4Op>Rqi6P@X>fl|Ua(+6Q6M*;6)prPV5z(aR9TD31>VYR!zOJ1-CC34z;kYP&SB<+X=FO_ zHTLtUKp`#Gfid1YkYdLaK&3l+w>_!;0sVkrw}4*9^qd>S4Iyqm0_zL~qLyq7doKdL z2bkW$S)V;c$Pa}=hZj%Si+w$V0!*GzfH|;x$AMkDJ2!3gkOEww2LmOJ3*N-83R_fZ z>!3Ig`(7r648(dUrY46EjyM_>8AB1*KN;* zTK4ehhT-Hvuo4{f**ErFokJ{9Zm6xg9kB0h-Pn2UMjzy*0ubLeh*HsBd&$|y?Izso zT=!+MGuf{=177@0tbx;^$pxCY(aN{8u7=?Lg67IR=BX!v;eWAAC~s2O7p0qRun-gUTs|on=%+s^=X-U> zq*x=!P+M9R0=vdMsx-DWk>pirZ*6vQ)&cQNVBd|v9*;pc9W!mD#laq*W#yeMNX%Yr zzh$Iuhq2?LQ@_#{jVjUhCLqCJ=@~38g6J_+QiLVwb(pbNgQAKP#VW>9fH+_^U_ct- zKyL#W#^zd87jg~g)xh0e#AQHlF9y&v*FajejO*2$E$4C#mutDag3EQB)pPkW&ccKq zO`y{aT&^N`ZXV@4#(5*>OV*}u?i`t`CcgpfR{OI?~!sk@VD+BikrJ$ z-VoooNw}MZyG6KN!o5nkTZOw#xI2V9$`FFX z8Q}8z1KoIjF&#zZN{g+f6Co)F`B{}AY4nv~K73UZcos4XYgwpw^c5?Fa|doMM?RDt z?ma1TqpTn^sYw_KzYSJ8(dCyxz*Q$0u>gJL55$mDJxY2Rt>?nyiQKMSsZX_5IzHKI z7$@3TGauXTcmZT7v?WmiOcw~9V-*syvv1g6D6%yd(3T|gl7-er#MOXQlzU1+JnYJC zc)v>4m|}Pr0{@{40RHHr+850MpsSJ^tyX~eITff8Ke^8Ekktl;Eo4+g^;-0Ig=LcD zMnVw61uZ$E+9&v<$iQ0dWMQrGKKq%>vu<)1JgZr2#}maNLjS{Q30{wKMHvU=)2At{ zt61$Tv983enq;Zffh*lZwRhTH1xFw2;Uxx1v#dj4<2XN;hb`2%?PAv93n1I!aO#05ro3bkp6qs_`mx zf<5rb!guW^Nn0kdY6v_4_p+R_C~Z@&{aVdFL^;(VdXh3CPxrXE^q^yK>gXGgte{P;Rs_uhi! zYRAnI!VI(qkd}|qBEHcf`e>@8Ap&uh>25#wP=Q3=}`&Zc!oY`MQuxEJ5KSD%9VhXp3baF%htUV8>21lIL zo*mXBh-`Yr#BPVsTz@##yK%0ISi3aN8dj8s7P4uMbiomGVTrx3=j_xS4!4W02j)^b zu^zB<_U7iU38K*!C5klx=`h7wu`Y<&3}^Ne-W7AUg130Zx3Xgg?Rrz14!x|nf;Q_4 z2r;~b=r$XAkSpa}U2H%dNM3@TfbF*g7&W3ifUXRF@&dVV;esOJ77MpTxTV5fw3O~v z3V#*Oj0DrU)&Z>*rb1UC&UD({gIZSyBsnpi>ptwAz;vzy5D~T|%tuogHcgoERIP!! z{aa@+$5-G`kq0bsV2~r_Va{TCRuCt<8rXkrD)K@^q=PGQP7ts(Oh*AT5FsJGaKt%* z?~eiJgLpN4P}SdHvk*17L|)>Y)N@j>teifIX;ek&Na2gzydX)jH?mW@kPyu|6PtFT z^Z(faf~PK4O|LNb^fhW9F3bZ7(7YcnKplD3_I5v9XduouMktM~O>{u37VB6Y%i@3* z%VMlQI1oVvK%$X-#1P;(VZhNsX)aD?i%J%iLH1U$Wbx8Ua;yH^ju>9MuzPzbi`+A? z3NhR}J==SKF2kTWX|U5+<4FUx>FhnScP?puO3#MbA)8EZcg2`~VX+!K$t zwqmqbIgBv@xu^KJVt`QCD5S$$u7eo~+p`kv(478>#XiXm0sz0y%@=NP5&6r6zZ{00 zG|bD`!roE*y8s(?=-X z_KN3h6$*=Y^nCChLdo=s=MT*L4R~YBr4xC-0Z$tA4P;m{y}jBKslnsV{!|=^8c|6K zTYjGGA@$~wJXpW&xNQ($!(pIW9Dj4$wE|BTC{rjJ_4MZo8xF%+LW$MKhBV-T)4{zQ zbDp&5M9^Ja5zA&MLNFqN9n?NobkEJ!xrjR2*3Nw!ugO^4L!thdFrqNvv5hV`UUzH% z$f(@k%MSsBXYZi_U&_Wg9Z6&421Wt$avO*>lOrjdn;joW1*iZHo@IIUX{ z>FXcpl~V(rNo=+EbtnmO9vRFg%?(A=aX zY>r&820PG!Z1nPC&Qzy%38*lFKUz13hGA;r>rI)-BLnDdX%0fCl8KnmF9JnG)da&T zhm|Y(W>SNwd}vr5ffb?(nRqXtHu?_^=4WDe(rQ1tLDNBX$Ccn=BvI?K`&PO~58o`cCkJC~7Cn=G%n6s91YgQK-Y( zpd)YE!QG+A79ZH+4xStsz{uGP+p}IsfdpGBtCl0j_;3pC)RWS$NgdpH?6ADQ8eMT@ zlvU!p1&ES5I(#Ih5}&O$OvbGI<|8Ac{pNArPh`D2%mNyb$vAZncKKplRU6+ka$4M;0*4db75i_QopalqfkdkcbcW_lz27?875F1_zESx1^4zIfrK(T;1>8 z9*^_9HH`@i^NuEFAl;sR0I_EJ{rKK5F^c zalKnW<@@am0oi*bOFct}k6%sr`6Ky)!`ikwii5a1w-;@H4N02_Jmvyk>o+T?cOv?4 zSw4FPHh1~l(%Py3CPx8nsRAGzrL{c*mev@tLX&Vr@Op!bwXJO$O+8SGT0xiE4m6-x zV|#nRGYxYydo6vV=v7t6j} zEw4DgBwtv01@f!f^0P|@zel9m^fK5}xc`@fDTv@?+Dd%;Z14buoG%zDV z1gS<0F&jB+;tJSQn>k;_c?dF@yePuk31>&Sg7eEczmh8*Twlj?HgILLu?3JI$hXV5 z3YIF&*aZI;u3W`)cNjb2huCK~XV-G&I7yLy%I!S&9b7qP z97D`^8SlbT*WJtrF{7U4!Mzs;sW|WAFtFn60aV8Sz#jmAln3z#z#kQWKMMF%Re=7e ze}lhjt^)H%J&oW`F(Zc=AQ9#KGx#HzAHW33pChOrW&l>j_yYbwY{Qj*Vm#+dxPF-# zFCgrr_>Ut{vu**~*yuy3-o_gfk7w=>?C zGv4oHyx+}uzn}3=WV}-u?+-HGS2EtS8SkqZ?+-KHA7{M(mht{9KrR( za7tu2rOGM`BEA7;n_(pbRx{CgD4>LFA&=UZYqgE9Af;~}Ys<9xx)J9eVSm&iBs z!}2=TqX$<&9MkRV=G8q$w^85YuOJo0WT4ZY4H-AiCiAzdcmiWCHLvp`c0BvN(UN?AU&&PWs*|PlnP0O zyOwQf%JgG!0%TEX{FSly>} zt3H)-w7T#vO1xS+S{T9GU4{1+O+Lj@)C#POg@+D2-8spFD#ObGGV4k6Jla(*qUxdTHl5*2;FBV^Mkc zIaa6a!E375T6-tV%P3dGw)Rb=8|35}$QmcZZKvX4R(K_fm>93`(J8=06Hat8pN_Px z15;!|08x0|lz18Nw2|0Ro3fj=TTODSyIb9C_112NO&o^n08zg7xw7artS`lCNfIqs z&n}nxET~^mRp52WegPG5CZG~4D<&f&>mB1$lW}UP zcTM4Wm`>b@Ya2NF#@G}p!l(E&{d-ipdtmfuw~}hN(mh~w-Nx>P8qh(6M$peX#rT+8j8C90;!B9RHTzr$!o1|pcORpy5wFE zl1?V}nfuJ^lQ&r3g#SkKMl+Gz4{}_JLEY?S;iDG$uJE-a4_Mz9RS=+6^Dt@vbfnG) zano7)7N+RE*(-35$*(Z5sfCYEnMr)wpeDtS z+o#NK{P-zz`ufkvLuL4d=)*3PPgjpL z)^pZ6m(CgnvQuX7_=K5qhDp)Y|45-GLJxXF|Kt|t&u(GqC>ij*Kv4JGs!P3U1wQ4TD3n#Tt{z*Pd** zz>+GslIiQeTgKQ2`%2BH8^0$d95TwawQx={b{~d43{5op(d>?Ch%QiI5o2M!bRSvm zrq~`y%meqsi;o&+YO>jn`ABo;qqD&#)8`WyR! zQW031^#J9SdEh?h0kFza-1rcP&D15N18^7@&G06r2T|*>oo2?D+i%2VOXD|#Q&O!)c?UvovK5m zPP3#)y-lS4g-q&gV6YATNJa`@qSWb$bn0!^m*wD#bnhj35*-&U@l`qa84CC&0^9;} zu*?QONTJ`M&=C~m11$V7i;v3j5r&7pD+h0<+v6xBs@R&46GzM=V82~QGvHB1>Sxv@ z$~4lgWj%UDkd~Z3kTI%;Kg8m6hB7%vri+FAIZTY3jeuV)L+O! z6#-zJ4L{Dp@i3;nU&`02)V^S5#i~)o!|~%RbiNGV8KQxs6%A+omR05jR<*ySa2*2fXVy>Mkb)o<*yvv%({*wwNPrrWt+pnK5 zc_Z_`;f?d@{~d3f$Mg7DX=}9iHL*3aEO|1#1%t>VLLcyt@?=QDhx8|eUX>30vj}ao z{!6B1OHjo!@fn&q$uOUWiF52@n6dC}f1EM8e1gez`6N^5@-$OllVQJ4Yrjd_blv1E z{FYGne;uCzt=4ley3=}r6YuS_!T{KMLki#?zK z7XSk&v!{`8@xo;&%=?t_@Mpx9C|n{oSK((I2I#+MC$JsaY`q^3(PLultzww-X!rO5 zN=h@UA1S;asXU5bs27r@i|Nz5om)xOl(n6sy>4dy^kKt0eM9%1%!V#I+sD$`EDFjor^fO^O{!W=Vwx6)?D9|@X z1oa8Lb8s6H`ly}$v!3)@5d754>Hn>hN;(gEPULZ#D)Hk=qFj`+98;PmrnD8Lr1~!G zvZXt*$(FE$(g3NzvETYWonCwjEsog?o2|QWl17IUpF-n?*rych)5@fIMPkGpc~Y4y?&Wuo~;Si^-xC*5?(h#!Y5o3w0lxq9xB%2vd&dIRW~C z=Z?^G_c1lm7?MH~ws-M&Go{Y@f~Txs6#j0tvbHAvS4^#=9DxI|$$CMV#IQ)~1dK4& ziy|7Of@G2Eq#I!)#ldY$Sjz)q4Ybv423Ou`k0TNyN zkBp?&Cl3?WE<~XHL&Kmi;Rw4fmApkgd}O5W&9yx)u!G7ntjWAV1FVaLx(8`n5Q?5q zeQ@+S(o!{7D}ePY5S2Mv4l`L21v4oN9g~>XkgLE1^mLyC(ed8ZIK0-0uG*aP8#__FW66d!2t#*M~0KD zz{yidP1s~%zf~|14p@bgd*ryv>R>oCF}YF0=CugJkD?;OJxFKKcqAkNOR7XF#{n~| zuqtRc^^csf7KfyfSAtkI7}kUZ4ngo+_BA8oXA!q-i2XdH07#rhDf8; z)z-;U$aUhyE`EQev^~mU3uZ`?JBrEy4<6>+6(MI-b^Ct`9^t9UY}IDFCLQhOSlhg5 zH_y>Dnr4+5b=B?ix#Lq)G&0*z2;0O~pI3dk7+_q4Fp;Ie%z1$GT+qHdnxeSiJ6H2{ zp~qY%)R@aFq{Z@*%B5Ay$gQ4Tk9pn^CccN#*q=v3&(LrR%4!ENiKd1JlLPKIq0b3D z7rL7_QcAd{Q$k%z>2B@`ukRZjJ-oW1;kMguTb1k`>Q1c!4sb&(5@~5LL9>9uG`NLP zigElc$&lQmv>5A9Xi&hz>mv`W0kPa+4kpYyc>0|LkZ}WP=Mh0edL^^I03V$Va_ru_ zM6e9rLkkuxmOAGOnjwm@#w`Y_N{4O^u^A1b)S6HS^1=LPcs;Zji=gPS6I@*VW`C+z zps3Ju-pNs3z1meFdh?}?4&^`S06D7=zne?vC_4b{+G!Qk&;$H|(bS&7esFS9wyvt` z4pH0^XNtFf?H<|%-J-#Rp-A??l&!sOuQY`9Ggf}~la2-#sf-;=L1{J5Q!}BqW}jQG z{4LiA?I$Ql4fI2`$n9VG{eyTEP~KYxd;39JSKtEa^Wi%a4L^=6P7!d`Jz?yeMQ zGO#$@NC@IA1=Xq%XbQ3+HbT`&31Qhcy+&qyWvInXkB3&XBByN)d} z48MfUk_Ia+pGsC*9da2~W2}599JyjAmM6;MotlDSN@Gi~7{f9QOEg8rT8PZFJZP-p z{Wx<;5|kpekrXJ({E@=|6|sC$=Q&V9L8R=Lw_pvXTy3qNc%%^7S{o`iTk(W45my+5 zty?C;d02jpoVB{9LgyFYjK;cZaw;UBg5p1JUp+Z#>LGR-*kL0$E8N+wh9b|n=xzAX z{%PCF^qR@=!c&O9dom%{_h_bE{~}}pTDP8*N&I{YXEU;Y9HlrSxYEhQ;zAA zCl~N?Xg2Fu@Flo+q*!<z(8$J%ncq z*C3TUVV)eMpm>m(1yojuSMggrS_noV>n`~5OAXghShzM`$WDdpPMxBZ?y>L5l}}T- zDb`6k*%Hy~PvIh;LXNUEB9g!>(mPwjxB>KB4a?a3SP-)AEU7d}qu)b0LLA-rW%=v! zf`wWU%+z7wjsuetN%2diWYxP!(gKo#m9=^^8sTx0iJb(ppHCt&sliUc^~)b))@e3D z<{i(Hlmb#w@#DUeXM)fjfgm*9b0GY5yUxdPv~hj`-oyF?M2G3l^Ry5EqKm6qKmb`G z+h^#sK*IuDDaUNft)+>jUVFg4B?z-o*=hk^=Ur9I#7*EXFOExF=Q5t9*B3LTiP_Uu z%iWkB^=Dv3z`6npjp5YlnUYv-Qzq;s`Vo5vZ(BReLy8zOFF6%K95N57%tu)SMaw0Z zMev$zxmc6DmG(+ghs;w-X#LG^zf5WFBGHZJCn2=hd?X|~(EKDcPbCuFXg*3LdeXMH z-)i=kpC(_T5nvuuLv77lYN8S6F}3+Dn`q8?E1PK3u1jsxU4rI|8g#yrLXFK&Qlcs6 zE2()am1xBIDb@V6piLP>E$Fd})9uhpE~k??YH#bM_B1=G#tl?bpZjC}QbiHhz5OB* z2@@Haxc)?V0Z=g^k{3W%?Y_4z;!Uiih+X5%V`O2_!!_~!PDi>tQ}Pl!8a2> ze0wGk4DjHGR~wt6p1|wX#@0pzw#C|~u`upcn__K^;Dv8(n|5cP3Yx5T*lsm7O}leF z&Tyj5YI9>W;-x0stKxv92_{|5E#BaLY6~EFh~g~f4ZhyyI|Jugn-gpghH7gx(g>%$ z*xJ97HKAnvPPf#&5~(ZJBZq& zZEny$wY|Bel_=F(^0GS|S)et=E+C^raAQ-NSbau1J*BOsNdvEXm9Me*C;%ds&}kKj zy@1LmFXwCpS77Y5hU~hOPOfa=$|e|cab+77n2W+=u9pp9~jY@Tt+_F&fxTle2dAqgnZycXG$e}3YgHD z8iG%)!T!G%e|7k)N2qog#RLO7lUI^&75N(I87NSxU~G|M;;6n3@EUF4sUvr_a4#3` zTH#(P+z#Qc6YhH9ZWL}@xSNH$MYvZ9cdKx>3wMWbcMA6!;qDgh9^qam+`YoRUbr_1 zHzC~p!o5kjN#XVgw^z8PaQlRNvv6+_?jhk03iq&ZZx!x{aE}Q07|`}Kscwb79@Qf0 z>qu71*ORQ4uaiIz?pu$8MAawg!HspWMAD7*Fht`1^+XTu7xdr(K@T1f^x!#y9y~|T zgXao*a8SmB9z0LbgXal)@ci{e51zk{=)r@69vs?jpa(Ay^xz;W2R%5j5c=h;yTQyu2L5xshy@Cl(WxcZC%|_zMf^ zjL$wSO3ULM2n2CNq)-=HF93XP`R!`=?p)ADactzKzQ%c;L@iz@1@3?gXhOfhD^$@& zNe?CqwZn#DXmFD9tVwOG24M$YD42RvoxoWb>|HNF8yu!$e@2R|0yDtOP#N1tP9uFo zK>zS+d}JXsIO|?t?-84!(Jx9Yv^TQUAhg|Ewr#xT0tFV5tqhOqX0jJT639o=0&nMS z8Yp{}0OmNw*>PlarbvCjuG5l(2Vr}2j2*Y%V1Qs9FrxR#S8vhnx5wel1?j_pcoY(@ zRPX8wYluV=7oD}|(&_>A0}A|*89QmkwV*IPy;(rr1j7pwW=YAcPAm=bMk4nX28gUuj-FPXq)%K$OE27p0zq@_ZD zMVvE06#=;}muq=k&xfWZmkYTJY}o~5vaFVHA5dk>xm@7@%j%_EhVZ3|%ORS`WEdH{ z*s=hYg|4RD#En*?6;`@!+}F+`;Y=DEYNe ze^~(YOW7(KPbi^Sm%;#}T8uGCR$%^1Dl?TfT2koeaSoM~D%&=a4%lHIxeO5%Majt{ z0~v^SY!i)zY!S&oa&5Uto?|Bn^%rT81*OPwx?@!c34v_-&A=FJ)vSLVbt^|bKJkpB^lPYt}{*E6f!$U~De#t3-)xt;AQTVKMf*sdnTbc9c?C{moM9s74!wyo+2UpCwU?UrbdO+YiI7(%5xBGK0 z&#)t5cSPxw)+MKbcUn8w*Kx}+LM6C_r;)d#UXVHY$Zpb$G0i#MBk!Ubv!2M!z@IxsqP0JuT|Pk(3-kT(N|g+jobK7h5c3w`&q=kioGXjDQpuHSqX5*TG!8IW{ll7n4D=|F z+CxN&Ujh7L*a*oicTB^6DSr$`IFLOezELC>mzFFNZkcc^gu6tzONCn{+-1TI33oZB z2~9G5+B#aYYwKyrj)i-A$&TfFddZIEJ1yA>JAhMx1RD$UWtO}IH|#8V%MyNC@~T2U vdgX$LP(+&3GHau36*+=Sl`qa|#b&u}KRR2&juzt#d|6Tl%JhE$aI&Xx7{a|1 diff --git a/www/javascript/tiny_mce/plugins/nonbreaking/editor_plugin.js b/www/javascript/tiny_mce/plugins/nonbreaking/editor_plugin.js deleted file mode 100644 index 73947355f..000000000 --- a/www/javascript/tiny_mce/plugins/nonbreaking/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.Nonbreaking",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceNonBreaking",function(){a.execCommand("mceInsertContent",false,(a.plugins.visualchars&&a.plugins.visualchars.state)?' ':" ")});a.addButton("nonbreaking",{title:"nonbreaking.nonbreaking_desc",cmd:"mceNonBreaking"});if(a.getParam("nonbreaking_force_tab")){a.onKeyDown.add(function(d,f){if(tinymce.isIE&&f.keyCode==9){d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");d.execCommand("mceNonBreaking");tinymce.dom.Event.cancel(f)}})}},getInfo:function(){return{longname:"Nonbreaking space",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("nonbreaking",tinymce.plugins.Nonbreaking)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/nonbreaking/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/nonbreaking/editor_plugin_src.js deleted file mode 100644 index b3ea82ee0..000000000 --- a/www/javascript/tiny_mce/plugins/nonbreaking/editor_plugin_src.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Nonbreaking', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceNonBreaking', function() { - ed.execCommand('mceInsertContent', false, (ed.plugins.visualchars && ed.plugins.visualchars.state) ? ' ' : ' '); - }); - - // Register buttons - ed.addButton('nonbreaking', {title : 'nonbreaking.nonbreaking_desc', cmd : 'mceNonBreaking'}); - - if (ed.getParam('nonbreaking_force_tab')) { - ed.onKeyDown.add(function(ed, e) { - if (tinymce.isIE && e.keyCode == 9) { - ed.execCommand('mceNonBreaking'); - ed.execCommand('mceNonBreaking'); - ed.execCommand('mceNonBreaking'); - tinymce.dom.Event.cancel(e); - } - }); - } - }, - - getInfo : function() { - return { - longname : 'Nonbreaking space', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/nonbreaking', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - - // Private methods - }); - - // Register plugin - tinymce.PluginManager.add('nonbreaking', tinymce.plugins.Nonbreaking); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/noneditable/editor_plugin.js b/www/javascript/tiny_mce/plugins/noneditable/editor_plugin.js deleted file mode 100644 index 2d60138ee..000000000 --- a/www/javascript/tiny_mce/plugins/noneditable/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.dom.Event;tinymce.create("tinymce.plugins.NonEditablePlugin",{init:function(d,e){var f=this,c,b,g;f.editor=d;c=d.getParam("noneditable_editable_class","mceEditable");b=d.getParam("noneditable_noneditable_class","mceNonEditable");d.onNodeChange.addToTop(function(i,h,l){var k,j;k=i.dom.getParent(i.selection.getStart(),function(m){return i.dom.hasClass(m,b)});j=i.dom.getParent(i.selection.getEnd(),function(m){return i.dom.hasClass(m,b)});if(k||j){g=1;f._setDisabled(1);return false}else{if(g==1){f._setDisabled(0);g=0}}})},getInfo:function(){return{longname:"Non editable elements",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_block:function(c,d){var b=d.keyCode;if((b>32&&b<41)||(b>111&&b<124)){return}return a.cancel(d)},_setDisabled:function(d){var c=this,b=c.editor;tinymce.each(b.controlManager.controls,function(e){e.setDisabled(d)});if(d!==c.disabled){if(d){b.onKeyDown.addToTop(c._block);b.onKeyPress.addToTop(c._block);b.onKeyUp.addToTop(c._block);b.onPaste.addToTop(c._block);b.onContextMenu.addToTop(c._block)}else{b.onKeyDown.remove(c._block);b.onKeyPress.remove(c._block);b.onKeyUp.remove(c._block);b.onPaste.remove(c._block);b.onContextMenu.remove(c._block)}c.disabled=d}}});tinymce.PluginManager.add("noneditable",tinymce.plugins.NonEditablePlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/noneditable/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/noneditable/editor_plugin_src.js deleted file mode 100644 index 916dce29c..000000000 --- a/www/javascript/tiny_mce/plugins/noneditable/editor_plugin_src.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var Event = tinymce.dom.Event; - - tinymce.create('tinymce.plugins.NonEditablePlugin', { - init : function(ed, url) { - var t = this, editClass, nonEditClass, state; - - t.editor = ed; - editClass = ed.getParam("noneditable_editable_class", "mceEditable"); - nonEditClass = ed.getParam("noneditable_noneditable_class", "mceNonEditable"); - - ed.onNodeChange.addToTop(function(ed, cm, n) { - var sc, ec; - - // Block if start or end is inside a non editable element - sc = ed.dom.getParent(ed.selection.getStart(), function(n) { - return ed.dom.hasClass(n, nonEditClass); - }); - - ec = ed.dom.getParent(ed.selection.getEnd(), function(n) { - return ed.dom.hasClass(n, nonEditClass); - }); - - // Block or unblock - if (sc || ec) { - state = 1; - t._setDisabled(1); - return false; - } else if (state == 1) { - t._setDisabled(0); - state = 0; - } - }); - }, - - getInfo : function() { - return { - longname : 'Non editable elements', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/noneditable', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - _block : function(ed, e) { - var k = e.keyCode; - - // Don't block arrow keys, pg up/down, and F1-F12 - if ((k > 32 && k < 41) || (k > 111 && k < 124)) - return; - - return Event.cancel(e); - }, - - _setDisabled : function(s) { - var t = this, ed = t.editor; - - tinymce.each(ed.controlManager.controls, function(c) { - c.setDisabled(s); - }); - - if (s !== t.disabled) { - if (s) { - ed.onKeyDown.addToTop(t._block); - ed.onKeyPress.addToTop(t._block); - ed.onKeyUp.addToTop(t._block); - ed.onPaste.addToTop(t._block); - ed.onContextMenu.addToTop(t._block); - } else { - ed.onKeyDown.remove(t._block); - ed.onKeyPress.remove(t._block); - ed.onKeyUp.remove(t._block); - ed.onPaste.remove(t._block); - ed.onContextMenu.remove(t._block); - } - - t.disabled = s; - } - } - }); - - // Register plugin - tinymce.PluginManager.add('noneditable', tinymce.plugins.NonEditablePlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/pagebreak/css/content.css b/www/javascript/tiny_mce/plugins/pagebreak/css/content.css deleted file mode 100644 index c949d58cc..000000000 --- a/www/javascript/tiny_mce/plugins/pagebreak/css/content.css +++ /dev/null @@ -1 +0,0 @@ -.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../img/pagebreak.gif) no-repeat center top;} diff --git a/www/javascript/tiny_mce/plugins/pagebreak/editor_plugin.js b/www/javascript/tiny_mce/plugins/pagebreak/editor_plugin.js deleted file mode 100644 index 35085e8ad..000000000 --- a/www/javascript/tiny_mce/plugins/pagebreak/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='',a="mcePageBreak",c=b.getParam("pagebreak_separator",""),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/pagebreak/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/pagebreak/editor_plugin_src.js deleted file mode 100644 index a094c1916..000000000 --- a/www/javascript/tiny_mce/plugins/pagebreak/editor_plugin_src.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.PageBreakPlugin', { - init : function(ed, url) { - var pb = '', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', ''), pbRE; - - pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); - - // Register commands - ed.addCommand('mcePageBreak', function() { - ed.execCommand('mceInsertContent', 0, pb); - }); - - // Register buttons - ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); - - ed.onInit.add(function() { - if (ed.theme.onResolveName) { - ed.theme.onResolveName.add(function(th, o) { - if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) - o.name = 'pagebreak'; - }); - } - }); - - ed.onClick.add(function(ed, e) { - e = e.target; - - if (e.nodeName === 'IMG' && ed.dom.hasClass(e, cls)) - ed.selection.select(e); - }); - - ed.onNodeChange.add(function(ed, cm, n) { - cm.setActive('pagebreak', n.nodeName === 'IMG' && ed.dom.hasClass(n, cls)); - }); - - ed.onBeforeSetContent.add(function(ed, o) { - o.content = o.content.replace(pbRE, pb); - }); - - ed.onPostProcess.add(function(ed, o) { - if (o.get) - o.content = o.content.replace(/]+>/g, function(im) { - if (im.indexOf('class="mcePageBreak') !== -1) - im = sep; - - return im; - }); - }); - }, - - getInfo : function() { - return { - longname : 'PageBreak', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('pagebreak', tinymce.plugins.PageBreakPlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/pagebreak/img/pagebreak.gif b/www/javascript/tiny_mce/plugins/pagebreak/img/pagebreak.gif deleted file mode 100644 index acdf4085f3068c4c0a1d6855f4b80dae8bac3068..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 325 zcmV-L0lNN2Nk%w1VPpUd0J9GO`>v<{=;ru;boX6P{`2zsmyZ3>&HK5t_;hIbi-G;z z+4`cI{KdfcXj}GCLjV8&A^8LW000jFEC2ui0Av6R000E?@X1N5y*TU5yZ>M)j$|1M z4Ouvb$pHu>IW8BZq|n;U0s@T!VM5~w1_+1X!EiVl!&PITYdjT!ffYfpt{jAfv%qvh zA63WUHSlr7LkeyaV4(pM0f50(II?RD4RtMg4-E+tFhdAy5{3c=0}3Bg9Y8`B2To20 zR%SO62L%9}0H+dzoKB$+2TOwzUrwi{XiBM^4V#>63q3!LsU3u93zH8CdwqY%62;1g z0g8ze$k93lWExp`CUe|K4qOWk17ZeJ0|5pDP6+}};{>bI@lOWj=kf}r2sHp7w9-Ie XK%9UG6W(*AX-vY05F<*&5CH%?Gwy&_ diff --git a/www/javascript/tiny_mce/plugins/pagebreak/img/trans.gif b/www/javascript/tiny_mce/plugins/pagebreak/img/trans.gif deleted file mode 100644 index 388486517fa8da13ebd150e8f65d5096c3e10c3a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43 ncmZ?wbhEHbWMp7un7{x9ia%KxMSyG_5FaGNz{KRj$Y2csb)f_x diff --git a/www/javascript/tiny_mce/plugins/paste/blank.htm b/www/javascript/tiny_mce/plugins/paste/blank.htm deleted file mode 100644 index 47b984ff2..000000000 --- a/www/javascript/tiny_mce/plugins/paste/blank.htm +++ /dev/null @@ -1,21 +0,0 @@ - - -blank_page - - - - - - - - diff --git a/www/javascript/tiny_mce/plugins/paste/css/blank.css b/www/javascript/tiny_mce/plugins/paste/css/blank.css deleted file mode 100644 index 6b16bac25..000000000 --- a/www/javascript/tiny_mce/plugins/paste/css/blank.css +++ /dev/null @@ -1,14 +0,0 @@ -html, body {height:98%} -body { -background-color: #FFFFFF; -font-family: Verdana, Arial, Helvetica, sans-serif; -font-size: 10px; -scrollbar-3dlight-color: #F0F0EE; -scrollbar-arrow-color: #676662; -scrollbar-base-color: #F0F0EE; -scrollbar-darkshadow-color: #DDDDDD; -scrollbar-face-color: #E0E0DD; -scrollbar-highlight-color: #F0F0EE; -scrollbar-shadow-color: #F0F0EE; -scrollbar-track-color: #F5F5F5; -} diff --git a/www/javascript/tiny_mce/plugins/paste/css/pasteword.css b/www/javascript/tiny_mce/plugins/paste/css/pasteword.css deleted file mode 100644 index b3be6270b..000000000 --- a/www/javascript/tiny_mce/plugins/paste/css/pasteword.css +++ /dev/null @@ -1,3 +0,0 @@ -.sourceIframe { - border: 1px solid #808080; -} diff --git a/www/javascript/tiny_mce/plugins/paste/editor_plugin.js b/www/javascript/tiny_mce/plugins/paste/editor_plugin.js deleted file mode 100644 index 9ebc2b2b6..000000000 --- a/www/javascript/tiny_mce/plugins/paste/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"p",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(l,j){var k=d.dom,i;f.onPreProcess.dispatch(f,l);l.node=k.create("div",0,l.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){if(l.node.childNodes.length===1&&/^(p|h[1-6]|pre)$/i.test(l.node.firstChild.nodeName)&&l.content.indexOf("__MCE_ITEM__")===-1){k.remove(l.node.firstChild,true)}}}f.onPostProcess.dispatch(f,l);l.content=d.serializer.serialize(l.node,{getInner:1,forced_root_block:""});if((!j)&&(d.pasteAsPlainText)){f._insertPlainText(d,k,l.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(l.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:r.replace(/\r?\n/g,"
")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort(d.getWin()).y}o.setStyles(l,{position:"absolute",left:tinymce.isGecko?-40:0,top:i-25,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="

"+o.encode(r).replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
")+"

"}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9){d([[/(?:
 [\s\r\n]+|
)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
 [\s\r\n]+|
)*/g,"$1"]]);d([[/

/g,"

"],[/
/g," "],[/

/g,"
"],])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*( )+/gi,/( |]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/

]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"

$1

")}if(b(k,"paste_convert_middot_lists")){d([[//gi,"$&__MCE_ITEM__"],[/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/"/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/]*>/gi,"

"],[/<\/h[1-6][^>]*>/gi,"

"]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/ /g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.( |\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(j,x,v){var t,u,l,k,r,e,p,f,n=j.getWin(),z=j.getDoc(),s=j.selection,m=tinymce.is,y=tinymce.inArray,g=b(j,"paste_text_linebreaktype"),o=b(j,"paste_text_replacements");function q(d){c(d,function(h){if(h.constructor==RegExp){v=v.replace(h,"")}else{v=v.replace(h[0],h[1])}})}if((typeof(v)==="string")&&(v.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(v)){q([/[\n\r]+/g])}else{q([/\r+/g])}q([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/ /gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"],/^\s+|\s+$/g]);v=x.decode(tinymce.html.Entities.encodeRaw(v));if(!s.isCollapsed()){z.execCommand("Delete",false,null)}if(m(o,"array")||(m(o,"array"))){q(o)}else{if(m(o,"string")){q(new RegExp(o,"gi"))}}if(g=="none"){q([[/\n+/g," "]])}else{if(g=="br"){q([[/\n/g,"
"]])}else{q([/^\s+|\s+$/g,[/\n\n/g,"

"],[/\n/g,"
"]])}}if((l=v.indexOf("

"))!=-1){k=v.lastIndexOf("

");r=s.getNode();e=[];do{if(r.nodeType==1){if(r.nodeName=="TD"||r.nodeName=="BODY"){break}e[e.length]=r}}while(r=r.parentNode);if(e.length>0){p=v.substring(0,l);f="";for(t=0,u=e.length;t";f+="<"+e[e.length-t-1].nodeName.toLowerCase()+">"}if(l==k){v=p+f+v.substring(l+7)}else{v=p+v.substring(l+4,k+4)+f+v.substring(k+7)}}}j.execCommand("mceInsertRawHTML",false,v+' ');window.setTimeout(function(){var d=x.get("_plain_text_marker"),A,h,w,i;s.select(d,false);z.execCommand("Delete",false,null);d=null;A=s.getStart();h=x.getViewPort(n);w=x.getPos(A).y;i=A.clientHeight;if((wh.y+h.h)){z.body.scrollTop=w

' + dom.encode(textContent).replace(/\r?\n\r?\n/g, '

').replace(/\r?\n/g, '
') + '

'; - } - - // Remove the nodes - each(dom.select('div.mcePaste'), function(n) { - dom.remove(n); - }); - - // Restore the old selection - if (or) - sel.setRng(or); - - process({content : h}); - - // Unblock events ones we got the contents - dom.unbind(ed.getDoc(), 'mousedown', block); - dom.unbind(ed.getDoc(), 'keydown', block); - }, 0); - } - } - - // Check if we should use the new auto process method - if (getParam(ed, "paste_auto_cleanup_on_paste")) { - // Is it's Opera or older FF use key handler - if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) { - ed.onKeyDown.addToTop(function(ed, e) { - if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) - grabContent(e); - }); - } else { - // Grab contents on paste event on Gecko and WebKit - ed.onPaste.addToTop(function(ed, e) { - return grabContent(e); - }); - } - } - - ed.onInit.add(function() { - ed.controlManager.setActive("pastetext", ed.pasteAsPlainText); - - // Block all drag/drop events - if (getParam(ed, "paste_block_drop")) { - ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) { - e.preventDefault(); - e.stopPropagation(); - - return false; - }); - } - }); - - // Add legacy support - t._legacySupport(); - }, - - getInfo : function() { - return { - longname : 'Paste text/word', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - _preProcess : function(pl, o) { - var ed = this.editor, - h = o.content, - grep = tinymce.grep, - explode = tinymce.explode, - trim = tinymce.trim, - len, stripClass; - - //console.log('Before preprocess:' + o.content); - - function process(items) { - each(items, function(v) { - // Remove or replace - if (v.constructor == RegExp) - h = h.replace(v, ''); - else - h = h.replace(v[0], v[1]); - }); - } - - if (ed.settings.paste_enable_default_filters == false) { - return; - } - - // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser - if (tinymce.isIE && document.documentMode >= 9) { - // IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser - process([[/(?:
 [\s\r\n]+|
)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:
 [\s\r\n]+|
)*/g, '$1']]); - - // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break - process([ - [/

/g, '

'], // Replace multiple BR elements with uppercase BR to keep them intact - [/
/g, ' '], // Replace single br elements with space since they are word wrap BR:s - [/

/g, '
'], // Replace back the double brs but into a single BR - ]); - } - - // Detect Word content and process it more aggressive - if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) { - o.wordContent = true; // Mark the pasted contents as word specific content - //console.log('Word contents detected.'); - - // Process away some basic content - process([ - /^\s*( )+/gi, //   entities at the start of contents - /( |]*>)+\s*$/gi //   entities at the end of contents - ]); - - if (getParam(ed, "paste_convert_headers_to_strong")) { - h = h.replace(/

]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "

$1

"); - } - - if (getParam(ed, "paste_convert_middot_lists")) { - process([ - [//gi, '$&__MCE_ITEM__'], // Convert supportLists to a list item marker - [/(]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'], // Convert mso-list and symbol spans to item markers - [/(]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__'] // Convert mso-list and symbol paragraphs to item markers (FF) - ]); - } - - process([ - // Word comments like conditional comments etc - //gi, - - // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags - /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, - - // Convert into for line-though - [/<(\/?)s>/gi, "<$1strike>"], - - // Replace nsbp entites to char since it's easier to handle - [/ /gi, "\u00a0"] - ]); - - // Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag. - // If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot. - do { - len = h.length; - h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1"); - } while (len != h.length); - - // Remove all spans if no styles is to be retained - if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) { - h = h.replace(/<\/?span[^>]*>/gi, ""); - } else { - // We're keeping styles, so at least clean them up. - // CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx - - process([ - // Convert ___ to string of alternating breaking/non-breaking spaces of same length - [/([\s\u00a0]*)<\/span>/gi, - function(str, spaces) { - return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : ""; - } - ], - - // Examine all styles: delete junk, transform some, and keep the rest - [/(<[a-z][^>]*)\sstyle="([^"]*)"/gi, - function(str, tag, style) { - var n = [], - i = 0, - s = explode(trim(style).replace(/"/gi, "'"), ";"); - - // Examine each style definition within the tag's style attribute - each(s, function(v) { - var name, value, - parts = explode(v, ":"); - - function ensureUnits(v) { - return v + ((v !== "0") && (/\d$/.test(v)))? "px" : ""; - } - - if (parts.length == 2) { - name = parts[0].toLowerCase(); - value = parts[1].toLowerCase(); - - // Translate certain MS Office styles into their CSS equivalents - switch (name) { - case "mso-padding-alt": - case "mso-padding-top-alt": - case "mso-padding-right-alt": - case "mso-padding-bottom-alt": - case "mso-padding-left-alt": - case "mso-margin-alt": - case "mso-margin-top-alt": - case "mso-margin-right-alt": - case "mso-margin-bottom-alt": - case "mso-margin-left-alt": - case "mso-table-layout-alt": - case "mso-height": - case "mso-width": - case "mso-vertical-align-alt": - n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value); - return; - - case "horiz-align": - n[i++] = "text-align:" + value; - return; - - case "vert-align": - n[i++] = "vertical-align:" + value; - return; - - case "font-color": - case "mso-foreground": - n[i++] = "color:" + value; - return; - - case "mso-background": - case "mso-highlight": - n[i++] = "background:" + value; - return; - - case "mso-default-height": - n[i++] = "min-height:" + ensureUnits(value); - return; - - case "mso-default-width": - n[i++] = "min-width:" + ensureUnits(value); - return; - - case "mso-padding-between-alt": - n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value); - return; - - case "text-line-through": - if ((value == "single") || (value == "double")) { - n[i++] = "text-decoration:line-through"; - } - return; - - case "mso-zero-height": - if (value == "yes") { - n[i++] = "display:none"; - } - return; - } - - // Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name - if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) { - return; - } - - // If it reached this point, it must be a valid CSS style - n[i++] = name + ":" + parts[1]; // Lower-case name, but keep value case - } - }); - - // If style attribute contained any valid styles the re-write it; otherwise delete style attribute. - if (i > 0) { - return tag + ' style="' + n.join(';') + '"'; - } else { - return tag; - } - } - ] - ]); - } - } - - // Replace headers with - if (getParam(ed, "paste_convert_headers_to_strong")) { - process([ - [/]*>/gi, "

"], - [/<\/h[1-6][^>]*>/gi, "

"] - ]); - } - - process([ - // Copy paste from Java like Open Office will produce this junk on FF - [/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, ''] - ]); - - // Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso"). - // Note:- paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation. - stripClass = getParam(ed, "paste_strip_class_attributes"); - - if (stripClass !== "none") { - function removeClasses(match, g1) { - if (stripClass === "all") - return ''; - - var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "), - function(v) { - return (/^(?!mso)/i.test(v)); - } - ); - - return cls.length ? ' class="' + cls.join(" ") + '"' : ''; - }; - - h = h.replace(/ class="([^"]+)"/gi, removeClasses); - h = h.replace(/ class=([\-\w]+)/gi, removeClasses); - } - - // Remove spans option - if (getParam(ed, "paste_remove_spans")) { - h = h.replace(/<\/?span[^>]*>/gi, ""); - } - - //console.log('After preprocess:' + h); - - o.content = h; - }, - - /** - * Various post process items. - */ - _postProcess : function(pl, o) { - var t = this, ed = t.editor, dom = ed.dom, styleProps; - - if (ed.settings.paste_enable_default_filters == false) { - return; - } - - if (o.wordContent) { - // Remove named anchors or TOC links - each(dom.select('a', o.node), function(a) { - if (!a.href || a.href.indexOf('#_Toc') != -1) - dom.remove(a, 1); - }); - - if (getParam(ed, "paste_convert_middot_lists")) { - t._convertLists(pl, o); - } - - // Process styles - styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties - - // Process only if a string was specified and not equal to "all" or "*" - if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) { - styleProps = tinymce.explode(styleProps.replace(/^none$/i, "")); - - // Retains some style properties - each(dom.select('*', o.node), function(el) { - var newStyle = {}, npc = 0, i, sp, sv; - - // Store a subset of the existing styles - if (styleProps) { - for (i = 0; i < styleProps.length; i++) { - sp = styleProps[i]; - sv = dom.getStyle(el, sp); - - if (sv) { - newStyle[sp] = sv; - npc++; - } - } - } - - // Remove all of the existing styles - dom.setAttrib(el, 'style', ''); - - if (styleProps && npc > 0) - dom.setStyles(el, newStyle); // Add back the stored subset of styles - else // Remove empty span tags that do not have class attributes - if (el.nodeName == 'SPAN' && !el.className) - dom.remove(el, true); - }); - } - } - - // Remove all style information or only specifically on WebKit to avoid the style bug on that browser - if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) { - each(dom.select('*[style]', o.node), function(el) { - el.removeAttribute('style'); - el.removeAttribute('data-mce-style'); - }); - } else { - if (tinymce.isWebKit) { - // We need to compress the styles on WebKit since if you paste it will become - // Removing the mce_style that contains the real value will force the Serializer engine to compress the styles - each(dom.select('*', o.node), function(el) { - el.removeAttribute('data-mce-style'); - }); - } - } - }, - - /** - * Converts the most common bullet and number formats in Office into a real semantic UL/LI list. - */ - _convertLists : function(pl, o) { - var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html; - - // Convert middot lists into real semantic lists - each(dom.select('p', o.node), function(p) { - var sib, val = '', type, html, idx, parents; - - // Get text node value at beginning of paragraph - for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling) - val += sib.nodeValue; - - val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/ /g, '\u00a0'); - - // Detect unordered lists look for bullets - if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val)) - type = 'ul'; - - // Detect ordered lists 1., a. or ixv. - if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val)) - type = 'ol'; - - // Check if node value matches the list pattern: o   - if (type) { - margin = parseFloat(p.style.marginLeft || 0); - - if (margin > lastMargin) - levels.push(margin); - - if (!listElm || type != lastType) { - listElm = dom.create(type); - dom.insertAfter(listElm, p); - } else { - // Nested list element - if (margin > lastMargin) { - listElm = li.appendChild(dom.create(type)); - } else if (margin < lastMargin) { - // Find parent level based on margin value - idx = tinymce.inArray(levels, margin); - parents = dom.getParents(listElm.parentNode, type); - listElm = parents[parents.length - 1 - idx] || listElm; - } - } - - // Remove middot or number spans if they exists - each(dom.select('span', p), function(span) { - var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, ''); - - // Remove span with the middot or the number - if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html)) - dom.remove(span); - else if (/^__MCE_ITEM__[\s\S]*\w+\.( |\u00a0)*\s*/.test(html)) - dom.remove(span); - }); - - html = p.innerHTML; - - // Remove middot/list items - if (type == 'ul') - html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*( |\u00a0)+\s*/, ''); - else - html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.( |\u00a0)+\s*/, ''); - - // Create li and add paragraph data into the new li - li = listElm.appendChild(dom.create('li', 0, html)); - dom.remove(p); - - lastMargin = margin; - lastType = type; - } else - listElm = lastMargin = 0; // End list element - }); - - // Remove any left over makers - html = o.node.innerHTML; - if (html.indexOf('__MCE_ITEM__') != -1) - o.node.innerHTML = html.replace(/__MCE_ITEM__/g, ''); - }, - - /** - * Inserts the specified contents at the caret position. - */ - _insert : function(h, skip_undo) { - var ed = this.editor, r = ed.selection.getRng(); - - // First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells. - if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer) - ed.getDoc().execCommand('Delete', false, null); - - ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo}); - }, - - /** - * Instead of the old plain text method which tried to re-create a paste operation, the - * new approach adds a plain text mode toggle switch that changes the behavior of paste. - * This function is passed the same input that the regular paste plugin produces. - * It performs additional scrubbing and produces (and inserts) the plain text. - * This approach leverages all of the great existing functionality in the paste - * plugin, and requires minimal changes to add the new functionality. - * Speednet - June 2009 - */ - _insertPlainText : function(ed, dom, h) { - var i, len, pos, rpos, node, breakElms, before, after, - w = ed.getWin(), - d = ed.getDoc(), - sel = ed.selection, - is = tinymce.is, - inArray = tinymce.inArray, - linebr = getParam(ed, "paste_text_linebreaktype"), - rl = getParam(ed, "paste_text_replacements"); - - function process(items) { - each(items, function(v) { - if (v.constructor == RegExp) - h = h.replace(v, ""); - else - h = h.replace(v[0], v[1]); - }); - }; - - if ((typeof(h) === "string") && (h.length > 0)) { - // If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line - if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(h)) { - process([ - /[\n\r]+/g - ]); - } else { - // Otherwise just get rid of carriage returns (only need linefeeds) - process([ - /\r+/g - ]); - } - - process([ - [/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"], // Block tags get a blank line after them - [/]*>|<\/tr>/gi, "\n"], // Single linebreak for
tags and table rows - [/<\/t[dh]>\s*]*>/gi, "\t"], // Table cells get tabs betweem them - /<[a-z!\/?][^>]*>/gi, // Delete all remaining tags - [/ /gi, " "], // Convert non-break spaces to regular spaces (remember, *plain text*) - [/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"], // Cool little RegExp deletes whitespace around linebreak chars. - [/\n{3,}/g, "\n\n"], // Max. 2 consecutive linebreaks - /^\s+|\s+$/g // Trim the front & back - ]); - - h = dom.decode(tinymce.html.Entities.encodeRaw(h)); - - // Delete any highlighted text before pasting - if (!sel.isCollapsed()) { - d.execCommand("Delete", false, null); - } - - // Perform default or custom replacements - if (is(rl, "array") || (is(rl, "array"))) { - process(rl); - } - else if (is(rl, "string")) { - process(new RegExp(rl, "gi")); - } - - // Treat paragraphs as specified in the config - if (linebr == "none") { - process([ - [/\n+/g, " "] - ]); - } - else if (linebr == "br") { - process([ - [/\n/g, "
"] - ]); - } - else { - process([ - /^\s+|\s+$/g, - [/\n\n/g, "

"], - [/\n/g, "
"] - ]); - } - - // This next piece of code handles the situation where we're pasting more than one paragraph of plain - // text, and we are pasting the content into the middle of a block node in the editor. The block - // node gets split at the selection point into "Para A" and "Para B" (for the purposes of explaining). - // The first paragraph of the pasted text is appended to "Para A", and the last paragraph of the - // pasted text is prepended to "Para B". Any other paragraphs of pasted text are placed between - // "Para A" and "Para B". This code solves a host of problems with the original plain text plugin and - // now handles styles correctly. (Pasting plain text into a styled paragraph is supposed to make the - // plain text take the same style as the existing paragraph.) - if ((pos = h.indexOf("

")) != -1) { - rpos = h.lastIndexOf("

"); - node = sel.getNode(); - breakElms = []; // Get list of elements to break - - do { - if (node.nodeType == 1) { - // Don't break tables and break at body - if (node.nodeName == "TD" || node.nodeName == "BODY") { - break; - } - - breakElms[breakElms.length] = node; - } - } while (node = node.parentNode); - - // Are we in the middle of a block node? - if (breakElms.length > 0) { - before = h.substring(0, pos); - after = ""; - - for (i=0, len=breakElms.length; i"; - after += "<" + breakElms[breakElms.length-i-1].nodeName.toLowerCase() + ">"; - } - - if (pos == rpos) { - h = before + after + h.substring(pos+7); - } - else { - h = before + h.substring(pos+4, rpos+4) + after + h.substring(rpos+7); - } - } - } - - // Insert content at the caret, plus add a marker for repositioning the caret - ed.execCommand("mceInsertRawHTML", false, h + ' '); - - // Reposition the caret to the marker, which was placed immediately after the inserted content. - // Needs to be done asynchronously (in window.setTimeout) or else it doesn't work in all browsers. - // The second part of the code scrolls the content up if the caret is positioned off-screen. - // This is only necessary for WebKit browsers, but it doesn't hurt to use for all. - window.setTimeout(function() { - var marker = dom.get('_plain_text_marker'), - elm, vp, y, elmHeight; - - sel.select(marker, false); - d.execCommand("Delete", false, null); - marker = null; - - // Get element, position and height - elm = sel.getStart(); - vp = dom.getViewPort(w); - y = dom.getPos(elm).y; - elmHeight = elm.clientHeight; - - // Is element within viewport if not then scroll it into view - if ((y < vp.y) || (y + elmHeight > vp.y + vp.h)) { - d.body.scrollTop = y < vp.y ? y : y - vp.h + 25; - } - }, 0); - } - }, - - /** - * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine. - */ - _legacySupport : function() { - var t = this, ed = t.editor; - - // Register command(s) for backwards compatibility - ed.addCommand("mcePasteWord", function() { - ed.windowManager.open({ - file: t.url + "/pasteword.htm", - width: parseInt(getParam(ed, "paste_dialog_width")), - height: parseInt(getParam(ed, "paste_dialog_height")), - inline: 1 - }); - }); - - if (getParam(ed, "paste_text_use_dialog")) { - ed.addCommand("mcePasteText", function() { - ed.windowManager.open({ - file : t.url + "/pastetext.htm", - width: parseInt(getParam(ed, "paste_dialog_width")), - height: parseInt(getParam(ed, "paste_dialog_height")), - inline : 1 - }); - }); - } - - // Register button for backwards compatibility - ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"}); - } - }); - - // Register plugin - tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin); -})(); diff --git a/www/javascript/tiny_mce/plugins/paste/js/pastetext.js b/www/javascript/tiny_mce/plugins/paste/js/pastetext.js deleted file mode 100644 index c524f9eb0..000000000 --- a/www/javascript/tiny_mce/plugins/paste/js/pastetext.js +++ /dev/null @@ -1,36 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var PasteTextDialog = { - init : function() { - this.resize(); - }, - - insert : function() { - var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines; - - // Convert linebreaks into paragraphs - if (document.getElementById('linebreaks').checked) { - lines = h.split(/\r?\n/); - if (lines.length > 1) { - h = ''; - tinymce.each(lines, function(row) { - h += '

' + row + '

'; - }); - } - } - - tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h}); - tinyMCEPopup.close(); - }, - - resize : function() { - var vp = tinyMCEPopup.dom.getViewPort(window), el; - - el = document.getElementById('content'); - - el.style.width = (vp.w - 20) + 'px'; - el.style.height = (vp.h - 90) + 'px'; - } -}; - -tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog); diff --git a/www/javascript/tiny_mce/plugins/paste/js/pasteword.js b/www/javascript/tiny_mce/plugins/paste/js/pasteword.js deleted file mode 100644 index a52731c36..000000000 --- a/www/javascript/tiny_mce/plugins/paste/js/pasteword.js +++ /dev/null @@ -1,51 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var PasteWordDialog = { - init : function() { - var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = ''; - - // Create iframe - el.innerHTML = ''; - ifr = document.getElementById('iframe'); - doc = ifr.contentWindow.document; - - // Force absolute CSS urls - css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")]; - css = css.concat(tinymce.explode(ed.settings.content_css) || []); - tinymce.each(css, function(u) { - cssHTML += ''; - }); - - // Write content into iframe - doc.open(); - doc.write('' + cssHTML + ''); - doc.close(); - - doc.designMode = 'on'; - this.resize(); - - window.setTimeout(function() { - ifr.contentWindow.focus(); - }, 10); - }, - - insert : function() { - var h = document.getElementById('iframe').contentWindow.document.body.innerHTML; - - tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true}); - tinyMCEPopup.close(); - }, - - resize : function() { - var vp = tinyMCEPopup.dom.getViewPort(window), el; - - el = document.getElementById('iframe'); - - if (el) { - el.style.width = (vp.w - 20) + 'px'; - el.style.height = (vp.h - 90) + 'px'; - } - } -}; - -tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog); diff --git a/www/javascript/tiny_mce/plugins/paste/langs/en_dlg.js b/www/javascript/tiny_mce/plugins/paste/langs/en_dlg.js deleted file mode 100644 index eeac77896..000000000 --- a/www/javascript/tiny_mce/plugins/paste/langs/en_dlg.js +++ /dev/null @@ -1,5 +0,0 @@ -tinyMCE.addI18n('en.paste_dlg',{ -text_title:"Use CTRL+V on your keyboard to paste the text into the window.", -text_linebreaks:"Keep linebreaks", -word_title:"Use CTRL+V on your keyboard to paste the text into the window." -}); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/paste/pastetext.htm b/www/javascript/tiny_mce/plugins/paste/pastetext.htm deleted file mode 100644 index b65594547..000000000 --- a/www/javascript/tiny_mce/plugins/paste/pastetext.htm +++ /dev/null @@ -1,27 +0,0 @@ - - - {#paste.paste_text_desc} - - - - -
-
{#paste.paste_text_desc}
- -
- -
- -
- -
{#paste_dlg.text_title}
- - - -
- - -
-
- - \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/paste/pasteword.htm b/www/javascript/tiny_mce/plugins/paste/pasteword.htm deleted file mode 100644 index 0f6bb4121..000000000 --- a/www/javascript/tiny_mce/plugins/paste/pasteword.htm +++ /dev/null @@ -1,21 +0,0 @@ - - - {#paste.paste_word_desc} - - - - -
-
{#paste.paste_word_desc}
- -
{#paste_dlg.word_title}
- -
- -
- - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/preview/editor_plugin.js b/www/javascript/tiny_mce/plugins/preview/editor_plugin.js deleted file mode 100644 index 507909c5f..000000000 --- a/www/javascript/tiny_mce/plugins/preview/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.Preview",{init:function(a,b){var d=this,c=tinymce.explode(a.settings.content_css);d.editor=a;tinymce.each(c,function(f,e){c[e]=a.documentBaseURI.toAbsolute(f)});a.addCommand("mcePreview",function(){a.windowManager.open({file:a.getParam("plugin_preview_pageurl",b+"/preview.html"),width:parseInt(a.getParam("plugin_preview_width","550")),height:parseInt(a.getParam("plugin_preview_height","600")),resizable:"yes",scrollbars:"yes",popup_css:c?c.join(","):a.baseURI.toAbsolute("themes/"+a.settings.theme+"/skins/"+a.settings.skin+"/content.css"),inline:a.getParam("plugin_preview_inline",1)},{base:a.documentBaseURI.getURI()})});a.addButton("preview",{title:"preview.preview_desc",cmd:"mcePreview"})},getInfo:function(){return{longname:"Preview",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("preview",tinymce.plugins.Preview)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/preview/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/preview/editor_plugin_src.js deleted file mode 100644 index 80f00f0d9..000000000 --- a/www/javascript/tiny_mce/plugins/preview/editor_plugin_src.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Preview', { - init : function(ed, url) { - var t = this, css = tinymce.explode(ed.settings.content_css); - - t.editor = ed; - - // Force absolute CSS urls - tinymce.each(css, function(u, k) { - css[k] = ed.documentBaseURI.toAbsolute(u); - }); - - ed.addCommand('mcePreview', function() { - ed.windowManager.open({ - file : ed.getParam("plugin_preview_pageurl", url + "/preview.html"), - width : parseInt(ed.getParam("plugin_preview_width", "550")), - height : parseInt(ed.getParam("plugin_preview_height", "600")), - resizable : "yes", - scrollbars : "yes", - popup_css : css ? css.join(',') : ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css"), - inline : ed.getParam("plugin_preview_inline", 1) - }, { - base : ed.documentBaseURI.getURI() - }); - }); - - ed.addButton('preview', {title : 'preview.preview_desc', cmd : 'mcePreview'}); - }, - - getInfo : function() { - return { - longname : 'Preview', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/preview', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('preview', tinymce.plugins.Preview); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/preview/example.html b/www/javascript/tiny_mce/plugins/preview/example.html deleted file mode 100644 index b2c3d90ce..000000000 --- a/www/javascript/tiny_mce/plugins/preview/example.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - -Example of a custom preview page - - - -Editor contents:
-
- -
- - - diff --git a/www/javascript/tiny_mce/plugins/preview/jscripts/embed.js b/www/javascript/tiny_mce/plugins/preview/jscripts/embed.js deleted file mode 100644 index f8dc81052..000000000 --- a/www/javascript/tiny_mce/plugins/preview/jscripts/embed.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * This script contains embed functions for common plugins. This scripts are complety free to use for any purpose. - */ - -function writeFlash(p) { - writeEmbed( - 'D27CDB6E-AE6D-11cf-96B8-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'application/x-shockwave-flash', - p - ); -} - -function writeShockWave(p) { - writeEmbed( - '166B1BCA-3F9C-11CF-8075-444553540000', - 'http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0', - 'application/x-director', - p - ); -} - -function writeQuickTime(p) { - writeEmbed( - '02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', - 'http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0', - 'video/quicktime', - p - ); -} - -function writeRealMedia(p) { - writeEmbed( - 'CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', - 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0', - 'audio/x-pn-realaudio-plugin', - p - ); -} - -function writeWindowsMedia(p) { - p.url = p.src; - writeEmbed( - '6BF52A52-394A-11D3-B153-00C04F79FAA6', - 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701', - 'application/x-mplayer2', - p - ); -} - -function writeEmbed(cls, cb, mt, p) { - var h = '', n; - - h += ''; - - h += ' - - - - - -{#preview.preview_desc} - - - - - diff --git a/www/javascript/tiny_mce/plugins/print/editor_plugin.js b/www/javascript/tiny_mce/plugins/print/editor_plugin.js deleted file mode 100644 index b5b3a55ed..000000000 --- a/www/javascript/tiny_mce/plugins/print/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.Print",{init:function(a,b){a.addCommand("mcePrint",function(){a.getWin().print()});a.addButton("print",{title:"print.print_desc",cmd:"mcePrint"})},getInfo:function(){return{longname:"Print",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("print",tinymce.plugins.Print)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/print/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/print/editor_plugin_src.js deleted file mode 100644 index 3933fe656..000000000 --- a/www/javascript/tiny_mce/plugins/print/editor_plugin_src.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Print', { - init : function(ed, url) { - ed.addCommand('mcePrint', function() { - ed.getWin().print(); - }); - - ed.addButton('print', {title : 'print.print_desc', cmd : 'mcePrint'}); - }, - - getInfo : function() { - return { - longname : 'Print', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/print', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('print', tinymce.plugins.Print); -})(); diff --git a/www/javascript/tiny_mce/plugins/safari/blank.htm b/www/javascript/tiny_mce/plugins/safari/blank.htm deleted file mode 100644 index 266808ce2..000000000 --- a/www/javascript/tiny_mce/plugins/safari/blank.htm +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/safari/editor_plugin.js b/www/javascript/tiny_mce/plugins/safari/editor_plugin.js deleted file mode 100644 index 794477c95..000000000 --- a/www/javascript/tiny_mce/plugins/safari/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.dom.Event,c=tinymce.grep,d=tinymce.each,b=tinymce.inArray;function e(j,i,h){var g,k;g=j.createTreeWalker(i,NodeFilter.SHOW_ALL,null,false);while(k=g.nextNode()){if(h){if(!h(k)){return false}}if(k.nodeType==3&&k.nodeValue&&/[^\s\u00a0]+/.test(k.nodeValue)){return false}if(k.nodeType==1&&/^(HR|IMG|TABLE)$/.test(k.nodeName)){return false}}return true}tinymce.create("tinymce.plugins.Safari",{init:function(f){var g=this,h;if(!tinymce.isWebKit){return}g.editor=f;g.webKitFontSizes=["x-small","small","medium","large","x-large","xx-large","-webkit-xxx-large"];g.namedFontSizes=["xx-small","x-small","small","medium","large","x-large","xx-large"];f.addCommand("CreateLink",function(k,j){var m=f.selection.getNode(),l=f.dom,i;if(m&&(/^(left|right)$/i.test(l.getStyle(m,"float",1))||/^(left|right)$/i.test(l.getAttrib(m,"align")))){i=l.create("a",{href:j},m.cloneNode());m.parentNode.replaceChild(i,m);f.selection.select(i)}else{f.getDoc().execCommand("CreateLink",false,j)}});f.onKeyUp.add(function(j,o){var l,i,m,p,k;if(o.keyCode==46||o.keyCode==8){i=j.getBody();l=i.innerHTML;k=j.selection;if(i.childNodes.length==1&&!/<(img|hr)/.test(l)&&tinymce.trim(l.replace(/<[^>]+>/g,"")).length==0){j.setContent('


',{format:"raw"});p=i.firstChild;m=k.getRng();m.setStart(p,0);m.setEnd(p,0);k.setRng(m)}}});f.addCommand("FormatBlock",function(j,i){var l=f.dom,k=l.getParent(f.selection.getNode(),l.isBlock);if(k){l.replace(l.create(i),k,1)}else{f.getDoc().execCommand("FormatBlock",false,i)}});f.addCommand("mceInsertContent",function(j,i){f.getDoc().execCommand("InsertText",false,"mce_marker");f.getBody().innerHTML=f.getBody().innerHTML.replace(/mce_marker/g,f.dom.processHTML(i)+'XX');f.selection.select(f.dom.get("_mce_tmp"));f.getDoc().execCommand("Delete",false," ")});f.onKeyPress.add(function(o,p){var q,v,r,l,j,k,i,u,m,t,s;if(p.keyCode==13){i=o.selection;q=i.getNode();if(p.shiftKey||o.settings.force_br_newlines&&q.nodeName!="LI"){g._insertBR(o);a.cancel(p)}if(v=h.getParent(q,"LI")){r=h.getParent(v,"OL,UL");u=o.getDoc();s=h.create("p");h.add(s,"br",{mce_bogus:"1"});if(e(u,v)){if(k=h.getParent(r.parentNode,"LI,OL,UL")){return}k=h.getParent(r,"p,h1,h2,h3,h4,h5,h6,div")||r;l=u.createRange();l.setStartBefore(k);l.setEndBefore(v);j=u.createRange();j.setStartAfter(v);j.setEndAfter(k);m=l.cloneContents();t=j.cloneContents();if(!e(u,t)){h.insertAfter(t,k)}h.insertAfter(s,k);if(!e(u,m)){h.insertAfter(m,k)}h.remove(k);k=s.firstChild;l=u.createRange();l.setStartBefore(k);l.setEndBefore(k);i.setRng(l);return a.cancel(p)}}}});f.onExecCommand.add(function(i,k){var j,m,n,l;if(k=="InsertUnorderedList"||k=="InsertOrderedList"){j=i.selection;m=i.dom;if(n=m.getParent(j.getNode(),function(o){return/^(H[1-6]|P|ADDRESS|PRE)$/.test(o.nodeName)})){l=j.getBookmark();m.remove(n,1);j.moveToBookmark(l)}}});f.onClick.add(function(i,j){j=j.target;if(j.nodeName=="IMG"){g.selElm=j;i.selection.select(j)}else{g.selElm=null}});f.onInit.add(function(){g._fixWebKitSpans()});f.onSetContent.add(function(){h=f.dom;d(["strong","b","em","u","strike","sub","sup","a"],function(i){d(c(h.select(i)).reverse(),function(l){var k=l.nodeName.toLowerCase(),j;if(k=="a"){if(l.name){h.replace(h.create("img",{mce_name:"a",name:l.name,"class":"mceItemAnchor"}),l)}return}switch(k){case"b":case"strong":if(k=="b"){k="strong"}j="font-weight: bold;";break;case"em":j="font-style: italic;";break;case"u":j="text-decoration: underline;";break;case"sub":j="vertical-align: sub;";break;case"sup":j="vertical-align: super;";break;case"strike":j="text-decoration: line-through;";break}h.replace(h.create("span",{mce_name:k,style:j,"class":"Apple-style-span"}),l,1)})})});f.onPreProcess.add(function(i,j){h=i.dom;d(c(j.node.getElementsByTagName("span")).reverse(),function(m){var k,l;if(j.get){if(h.hasClass(m,"Apple-style-span")){l=m.style.backgroundColor;switch(h.getAttrib(m,"mce_name")){case"font":if(!i.settings.convert_fonts_to_spans){h.setAttrib(m,"style","")}break;case"strong":case"em":case"sub":case"sup":h.setAttrib(m,"style","");break;case"strike":case"u":if(!i.settings.inline_styles){h.setAttrib(m,"style","")}else{h.setAttrib(m,"mce_name","")}break;default:if(!i.settings.inline_styles){h.setAttrib(m,"style","")}}if(l){m.style.backgroundColor=l}}}if(h.hasClass(m,"mceItemRemoved")){h.remove(m,1)}})});f.onPostProcess.add(function(i,j){j.content=j.content.replace(/
<\/(h[1-6]|div|p|address|pre)>/g,"");j.content=j.content.replace(/ id=\"undefined\"/g,"")})},getInfo:function(){return{longname:"Safari compatibility",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_fixWebKitSpans:function(){var g=this,f=g.editor;a.add(f.getDoc(),"DOMNodeInserted",function(h){h=h.target;if(h&&h.nodeType==1){g._fixAppleSpan(h)}})},_fixAppleSpan:function(l){var g=this.editor,m=g.dom,i=this.webKitFontSizes,f=this.namedFontSizes,j=g.settings,h,k;if(m.getAttrib(l,"mce_fixed")){return}if(l.nodeName=="SPAN"&&l.className=="Apple-style-span"){h=l.style;if(!j.convert_fonts_to_spans){if(h.fontSize){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"size",b(i,h.fontSize)+1)}if(h.fontFamily){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"face",h.fontFamily)}if(h.color){m.setAttrib(l,"mce_name","font");m.setAttrib(l,"color",m.toHex(h.color))}if(h.backgroundColor){m.setAttrib(l,"mce_name","font");m.setStyle(l,"background-color",h.backgroundColor)}}else{if(h.fontSize){m.setStyle(l,"fontSize",f[b(i,h.fontSize)])}}if(h.fontWeight=="bold"){m.setAttrib(l,"mce_name","strong")}if(h.fontStyle=="italic"){m.setAttrib(l,"mce_name","em")}if(h.textDecoration=="underline"){m.setAttrib(l,"mce_name","u")}if(h.textDecoration=="line-through"){m.setAttrib(l,"mce_name","strike")}if(h.verticalAlign=="super"){m.setAttrib(l,"mce_name","sup")}if(h.verticalAlign=="sub"){m.setAttrib(l,"mce_name","sub")}m.setAttrib(l,"mce_fixed","1")}},_insertBR:function(f){var j=f.dom,h=f.selection,i=h.getRng(),g;i.insertNode(g=j.create("br"));i.setStartAfter(g);i.setEndAfter(g);h.setRng(i);if(h.getSel().focusNode==g.previousSibling){h.select(j.insertAfter(j.doc.createTextNode("\u00a0"),g));h.collapse(1)}f.getWin().scrollTo(0,j.getPos(h.getRng().startContainer).y)}});tinymce.PluginManager.add("safari",tinymce.plugins.Safari)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/safari/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/safari/editor_plugin_src.js deleted file mode 100644 index 6667b7c79..000000000 --- a/www/javascript/tiny_mce/plugins/safari/editor_plugin_src.js +++ /dev/null @@ -1,438 +0,0 @@ -/** - * $Id: editor_plugin_src.js 264 2007-04-26 20:53:09Z spocke $ - * - * @author Moxiecode - * @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved. - */ - -(function() { - var Event = tinymce.dom.Event, grep = tinymce.grep, each = tinymce.each, inArray = tinymce.inArray; - - function isEmpty(d, e, f) { - var w, n; - - w = d.createTreeWalker(e, NodeFilter.SHOW_ALL, null, false); - while (n = w.nextNode()) { - // Filter func - if (f) { - if (!f(n)) - return false; - } - - // Non whitespace text node - if (n.nodeType == 3 && n.nodeValue && /[^\s\u00a0]+/.test(n.nodeValue)) - return false; - - // Is non text element byt still content - if (n.nodeType == 1 && /^(HR|IMG|TABLE)$/.test(n.nodeName)) - return false; - } - - return true; - }; - - tinymce.create('tinymce.plugins.Safari', { - init : function(ed) { - var t = this, dom; - - // Ignore on non webkit - if (!tinymce.isWebKit) - return; - - t.editor = ed; - t.webKitFontSizes = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', '-webkit-xxx-large']; - t.namedFontSizes = ['xx-small', 'x-small','small','medium','large','x-large', 'xx-large']; - - // Safari CreateLink command will not work correctly on images that is aligned - ed.addCommand('CreateLink', function(u, v) { - var n = ed.selection.getNode(), dom = ed.dom, a; - - if (n && (/^(left|right)$/i.test(dom.getStyle(n, 'float', 1)) || /^(left|right)$/i.test(dom.getAttrib(n, 'align')))) { - a = dom.create('a', {href : v}, n.cloneNode()); - n.parentNode.replaceChild(a, n); - ed.selection.select(a); - } else - ed.getDoc().execCommand("CreateLink", false, v); - }); - -/* - // WebKit generates spans out of thin air this patch used to remove them but it will also remove styles we want so it's disabled for now - ed.onPaste.add(function(ed, e) { - function removeStyles(e) { - e = e.target; - - if (e.nodeType == 1) { - e.style.cssText = ''; - - each(ed.dom.select('*', e), function(e) { - e.style.cssText = ''; - }); - } - }; - - Event.add(ed.getDoc(), 'DOMNodeInserted', removeStyles); - - window.setTimeout(function() { - Event.remove(ed.getDoc(), 'DOMNodeInserted', removeStyles); - }, 0); - }); -*/ - ed.onKeyUp.add(function(ed, e) { - var h, b, r, n, s; - - // If backspace or delete key - if (e.keyCode == 46 || e.keyCode == 8) { - b = ed.getBody(); - h = b.innerHTML; - s = ed.selection; - - // If there is no text content or images or hr elements then remove everything - if (b.childNodes.length == 1 && !/<(img|hr)/.test(h) && tinymce.trim(h.replace(/<[^>]+>/g, '')).length == 0) { - // Inject paragrah and bogus br - ed.setContent('


', {format : 'raw'}); - - // Move caret before bogus br - n = b.firstChild; - r = s.getRng(); - r.setStart(n, 0); - r.setEnd(n, 0); - s.setRng(r); - } - } - }); - - // Workaround for FormatBlock bug, http://bugs.webkit.org/show_bug.cgi?id=16004 - ed.addCommand('FormatBlock', function(u, v) { - var dom = ed.dom, e = dom.getParent(ed.selection.getNode(), dom.isBlock); - - if (e) - dom.replace(dom.create(v), e, 1); - else - ed.getDoc().execCommand("FormatBlock", false, v); - }); - - // Workaround for InsertHTML bug, http://bugs.webkit.org/show_bug.cgi?id=16382 - ed.addCommand('mceInsertContent', function(u, v) { - ed.getDoc().execCommand("InsertText", false, 'mce_marker'); - ed.getBody().innerHTML = ed.getBody().innerHTML.replace(/mce_marker/g, ed.dom.processHTML(v) + 'XX'); - ed.selection.select(ed.dom.get('_mce_tmp')); - ed.getDoc().execCommand("Delete", false, ' '); - }); - - /* ed.onKeyDown.add(function(ed, e) { - // Ctrl+A select all will fail on WebKit since if you paste the contents you selected it will produce a odd div wrapper - if ((e.ctrlKey || e.metaKey) && e.keyCode == 65) { - ed.selection.select(ed.getBody(), 1); - return Event.cancel(e); - } - });*/ - - ed.onKeyPress.add(function(ed, e) { - var se, li, lic, r1, r2, n, sel, doc, be, af, pa; - - if (e.keyCode == 13) { - sel = ed.selection; - se = sel.getNode(); - - // Workaround for missing shift+enter support, http://bugs.webkit.org/show_bug.cgi?id=16973 - if (e.shiftKey || ed.settings.force_br_newlines && se.nodeName != 'LI') { - t._insertBR(ed); - Event.cancel(e); - } - - // Workaround for DIV elements produced by Safari - if (li = dom.getParent(se, 'LI')) { - lic = dom.getParent(li, 'OL,UL'); - doc = ed.getDoc(); - - pa = dom.create('p'); - dom.add(pa, 'br', {mce_bogus : "1"}); - - if (isEmpty(doc, li)) { - // If list in list then use browser default behavior - if (n = dom.getParent(lic.parentNode, 'LI,OL,UL')) - return; - - n = dom.getParent(lic, 'p,h1,h2,h3,h4,h5,h6,div') || lic; - - // Create range from the start of block element to the list item - r1 = doc.createRange(); - r1.setStartBefore(n); - r1.setEndBefore(li); - - // Create range after the list to the end of block element - r2 = doc.createRange(); - r2.setStartAfter(li); - r2.setEndAfter(n); - - be = r1.cloneContents(); - af = r2.cloneContents(); - - if (!isEmpty(doc, af)) - dom.insertAfter(af, n); - - dom.insertAfter(pa, n); - - if (!isEmpty(doc, be)) - dom.insertAfter(be, n); - - dom.remove(n); - - n = pa.firstChild; - r1 = doc.createRange(); - r1.setStartBefore(n); - r1.setEndBefore(n); - sel.setRng(r1); - - return Event.cancel(e); - } - } - } - }); - - // Safari doesn't place lists outside block elements - ed.onExecCommand.add(function(ed, cmd) { - var sel, dom, bl, bm; - - if (cmd == 'InsertUnorderedList' || cmd == 'InsertOrderedList') { - sel = ed.selection; - dom = ed.dom; - - if (bl = dom.getParent(sel.getNode(), function(n) {return /^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName);})) { - bm = sel.getBookmark(); - dom.remove(bl, 1); - sel.moveToBookmark(bm); - } - } - }); - - // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 - ed.onClick.add(function(ed, e) { - e = e.target; - - if (e.nodeName == 'IMG') { - t.selElm = e; - ed.selection.select(e); - } else - t.selElm = null; - }); - - ed.onInit.add(function() { - t._fixWebKitSpans(); - }); - - ed.onSetContent.add(function() { - dom = ed.dom; - - // Convert strong,b,em,u,strike to spans - each(['strong','b','em','u','strike','sub','sup','a'], function(v) { - each(grep(dom.select(v)).reverse(), function(n) { - var nn = n.nodeName.toLowerCase(), st; - - // Convert anchors into images - if (nn == 'a') { - if (n.name) - dom.replace(dom.create('img', {mce_name : 'a', name : n.name, 'class' : 'mceItemAnchor'}), n); - - return; - } - - switch (nn) { - case 'b': - case 'strong': - if (nn == 'b') - nn = 'strong'; - - st = 'font-weight: bold;'; - break; - - case 'em': - st = 'font-style: italic;'; - break; - - case 'u': - st = 'text-decoration: underline;'; - break; - - case 'sub': - st = 'vertical-align: sub;'; - break; - - case 'sup': - st = 'vertical-align: super;'; - break; - - case 'strike': - st = 'text-decoration: line-through;'; - break; - } - - dom.replace(dom.create('span', {mce_name : nn, style : st, 'class' : 'Apple-style-span'}), n, 1); - }); - }); - }); - - ed.onPreProcess.add(function(ed, o) { - dom = ed.dom; - - each(grep(o.node.getElementsByTagName('span')).reverse(), function(n) { - var v, bg; - - if (o.get) { - if (dom.hasClass(n, 'Apple-style-span')) { - bg = n.style.backgroundColor; - - switch (dom.getAttrib(n, 'mce_name')) { - case 'font': - if (!ed.settings.convert_fonts_to_spans) - dom.setAttrib(n, 'style', ''); - break; - - case 'strong': - case 'em': - case 'sub': - case 'sup': - dom.setAttrib(n, 'style', ''); - break; - - case 'strike': - case 'u': - if (!ed.settings.inline_styles) - dom.setAttrib(n, 'style', ''); - else - dom.setAttrib(n, 'mce_name', ''); - - break; - - default: - if (!ed.settings.inline_styles) - dom.setAttrib(n, 'style', ''); - } - - - if (bg) - n.style.backgroundColor = bg; - } - } - - if (dom.hasClass(n, 'mceItemRemoved')) - dom.remove(n, 1); - }); - }); - - ed.onPostProcess.add(function(ed, o) { - // Safari adds BR at end of all block elements - o.content = o.content.replace(/
<\/(h[1-6]|div|p|address|pre)>/g, ''); - - // Safari adds id="undefined" to HR elements - o.content = o.content.replace(/ id=\"undefined\"/g, ''); - }); - }, - - getInfo : function() { - return { - longname : 'Safari compatibility', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Internal methods - - _fixWebKitSpans : function() { - var t = this, ed = t.editor; - - // Use mutator events on new WebKit - Event.add(ed.getDoc(), 'DOMNodeInserted', function(e) { - e = e.target; - - if (e && e.nodeType == 1) - t._fixAppleSpan(e); - }); - }, - - _fixAppleSpan : function(e) { - var ed = this.editor, dom = ed.dom, fz = this.webKitFontSizes, fzn = this.namedFontSizes, s = ed.settings, st, p; - - if (dom.getAttrib(e, 'mce_fixed')) - return; - - // Handle Apple style spans - if (e.nodeName == 'SPAN' && e.className == 'Apple-style-span') { - st = e.style; - - if (!s.convert_fonts_to_spans) { - if (st.fontSize) { - dom.setAttrib(e, 'mce_name', 'font'); - dom.setAttrib(e, 'size', inArray(fz, st.fontSize) + 1); - } - - if (st.fontFamily) { - dom.setAttrib(e, 'mce_name', 'font'); - dom.setAttrib(e, 'face', st.fontFamily); - } - - if (st.color) { - dom.setAttrib(e, 'mce_name', 'font'); - dom.setAttrib(e, 'color', dom.toHex(st.color)); - } - - if (st.backgroundColor) { - dom.setAttrib(e, 'mce_name', 'font'); - dom.setStyle(e, 'background-color', st.backgroundColor); - } - } else { - if (st.fontSize) - dom.setStyle(e, 'fontSize', fzn[inArray(fz, st.fontSize)]); - } - - if (st.fontWeight == 'bold') - dom.setAttrib(e, 'mce_name', 'strong'); - - if (st.fontStyle == 'italic') - dom.setAttrib(e, 'mce_name', 'em'); - - if (st.textDecoration == 'underline') - dom.setAttrib(e, 'mce_name', 'u'); - - if (st.textDecoration == 'line-through') - dom.setAttrib(e, 'mce_name', 'strike'); - - if (st.verticalAlign == 'super') - dom.setAttrib(e, 'mce_name', 'sup'); - - if (st.verticalAlign == 'sub') - dom.setAttrib(e, 'mce_name', 'sub'); - - dom.setAttrib(e, 'mce_fixed', '1'); - } - }, - - _insertBR : function(ed) { - var dom = ed.dom, s = ed.selection, r = s.getRng(), br; - - // Insert BR element - r.insertNode(br = dom.create('br')); - - // Place caret after BR - r.setStartAfter(br); - r.setEndAfter(br); - s.setRng(r); - - // Could not place caret after BR then insert an nbsp entity and move the caret - if (s.getSel().focusNode == br.previousSibling) { - s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'), br)); - s.collapse(1); - } - - // Scroll to new position, scrollIntoView can't be used due to bug: http://bugs.webkit.org/show_bug.cgi?id=16117 - ed.getWin().scrollTo(0, dom.getPos(s.getRng().startContainer).y); - } - }); - - // Register plugin - tinymce.PluginManager.add('safari', tinymce.plugins.Safari); -})(); - diff --git a/www/javascript/tiny_mce/plugins/save/editor_plugin.js b/www/javascript/tiny_mce/plugins/save/editor_plugin.js deleted file mode 100644 index 8e9399667..000000000 --- a/www/javascript/tiny_mce/plugins/save/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.Save",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceSave",c._save,c);a.addCommand("mceCancel",c._cancel,c);a.addButton("save",{title:"save.save_desc",cmd:"mceSave"});a.addButton("cancel",{title:"save.cancel_desc",cmd:"mceCancel"});a.onNodeChange.add(c._nodeChange,c);a.addShortcut("ctrl+s",a.getLang("save.save_desc"),"mceSave")},getInfo:function(){return{longname:"Save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,c){var b=this.editor;if(b.getParam("save_enablewhendirty")){a.setDisabled("save",!b.isDirty());a.setDisabled("cancel",!b.isDirty())}},_save:function(){var c=this.editor,a,e,d,b;a=tinymce.DOM.get(c.id).form||tinymce.DOM.getParent(c.id,"form");if(c.getParam("save_enablewhendirty")&&!c.isDirty()){return}tinyMCE.triggerSave();if(e=c.getParam("save_onsavecallback")){if(c.execCallback("save_onsavecallback",c)){c.startContent=tinymce.trim(c.getContent({format:"raw"}));c.nodeChanged()}return}if(a){c.isNotDirty=true;if(a.onsubmit==null||a.onsubmit()!=false){a.submit()}c.nodeChanged()}else{c.windowManager.alert("Error: No form element found.")}},_cancel:function(){var a=this.editor,c,b=tinymce.trim(a.startContent);if(c=a.getParam("save_oncancelcallback")){a.execCallback("save_oncancelcallback",a);return}a.setContent(b);a.undoManager.clear();a.nodeChanged()}});tinymce.PluginManager.add("save",tinymce.plugins.Save)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/save/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/save/editor_plugin_src.js deleted file mode 100644 index f5a3de8f5..000000000 --- a/www/javascript/tiny_mce/plugins/save/editor_plugin_src.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.Save', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceSave', t._save, t); - ed.addCommand('mceCancel', t._cancel, t); - - // Register buttons - ed.addButton('save', {title : 'save.save_desc', cmd : 'mceSave'}); - ed.addButton('cancel', {title : 'save.cancel_desc', cmd : 'mceCancel'}); - - ed.onNodeChange.add(t._nodeChange, t); - ed.addShortcut('ctrl+s', ed.getLang('save.save_desc'), 'mceSave'); - }, - - getInfo : function() { - return { - longname : 'Save', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/save', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _nodeChange : function(ed, cm, n) { - var ed = this.editor; - - if (ed.getParam('save_enablewhendirty')) { - cm.setDisabled('save', !ed.isDirty()); - cm.setDisabled('cancel', !ed.isDirty()); - } - }, - - // Private methods - - _save : function() { - var ed = this.editor, formObj, os, i, elementId; - - formObj = tinymce.DOM.get(ed.id).form || tinymce.DOM.getParent(ed.id, 'form'); - - if (ed.getParam("save_enablewhendirty") && !ed.isDirty()) - return; - - tinyMCE.triggerSave(); - - // Use callback instead - if (os = ed.getParam("save_onsavecallback")) { - if (ed.execCallback('save_onsavecallback', ed)) { - ed.startContent = tinymce.trim(ed.getContent({format : 'raw'})); - ed.nodeChanged(); - } - - return; - } - - if (formObj) { - ed.isNotDirty = true; - - if (formObj.onsubmit == null || formObj.onsubmit() != false) - formObj.submit(); - - ed.nodeChanged(); - } else - ed.windowManager.alert("Error: No form element found."); - }, - - _cancel : function() { - var ed = this.editor, os, h = tinymce.trim(ed.startContent); - - // Use callback instead - if (os = ed.getParam("save_oncancelcallback")) { - ed.execCallback('save_oncancelcallback', ed); - return; - } - - ed.setContent(h); - ed.undoManager.clear(); - ed.nodeChanged(); - } - }); - - // Register plugin - tinymce.PluginManager.add('save', tinymce.plugins.Save); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/searchreplace/css/searchreplace.css b/www/javascript/tiny_mce/plugins/searchreplace/css/searchreplace.css deleted file mode 100644 index ecdf58c7b..000000000 --- a/www/javascript/tiny_mce/plugins/searchreplace/css/searchreplace.css +++ /dev/null @@ -1,6 +0,0 @@ -.panel_wrapper {height:85px;} -.panel_wrapper div.current {height:85px;} - -/* IE */ -* html .panel_wrapper {height:100px;} -* html .panel_wrapper div.current {height:100px;} diff --git a/www/javascript/tiny_mce/plugins/searchreplace/editor_plugin.js b/www/javascript/tiny_mce/plugins/searchreplace/editor_plugin.js deleted file mode 100644 index 165bc12df..000000000 --- a/www/javascript/tiny_mce/plugins/searchreplace/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){window.focus();a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/searchreplace/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/searchreplace/editor_plugin_src.js deleted file mode 100644 index 4c87e8fa7..000000000 --- a/www/javascript/tiny_mce/plugins/searchreplace/editor_plugin_src.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.SearchReplacePlugin', { - init : function(ed, url) { - function open(m) { - // Keep IE from writing out the f/r character to the editor - // instance while initializing a new dialog. See: #3131190 - window.focus(); - - ed.windowManager.open({ - file : url + '/searchreplace.htm', - width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)), - height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)), - inline : 1, - auto_focus : 0 - }, { - mode : m, - search_string : ed.selection.getContent({format : 'text'}), - plugin_url : url - }); - }; - - // Register commands - ed.addCommand('mceSearch', function() { - open('search'); - }); - - ed.addCommand('mceReplace', function() { - open('replace'); - }); - - // Register buttons - ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); - ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); - - ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); - }, - - getInfo : function() { - return { - longname : 'Search/Replace', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/searchreplace/js/searchreplace.js b/www/javascript/tiny_mce/plugins/searchreplace/js/searchreplace.js deleted file mode 100644 index 80284b9f3..000000000 --- a/www/javascript/tiny_mce/plugins/searchreplace/js/searchreplace.js +++ /dev/null @@ -1,142 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var SearchReplaceDialog = { - init : function(ed) { - var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); - - t.switchMode(m); - - f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); - - // Focus input field - f[m + '_panel_searchstring'].focus(); - - mcTabs.onChange.add(function(tab_id, panel_id) { - t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); - }); - }, - - switchMode : function(m) { - var f, lm = this.lastMode; - - if (lm != m) { - f = document.forms[0]; - - if (lm) { - f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; - f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; - f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; - f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; - } - - mcTabs.displayTab(m + '_tab', m + '_panel'); - document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; - document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; - this.lastMode = m; - } - }, - - searchNext : function(a) { - var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; - - // Get input - f = document.forms[0]; - s = f[m + '_panel_searchstring'].value; - b = f[m + '_panel_backwardsu'].checked; - ca = f[m + '_panel_casesensitivebox'].checked; - rs = f['replace_panel_replacestring'].value; - - if (tinymce.isIE) { - r = ed.getDoc().selection.createRange(); - } - - if (s == '') - return; - - function fix() { - // Correct Firefox graphics glitches - // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? - r = se.getRng().cloneRange(); - ed.getDoc().execCommand('SelectAll', false, null); - se.setRng(r); - }; - - function replace() { - ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE - }; - - // IE flags - if (ca) - fl = fl | 4; - - switch (a) { - case 'all': - // Move caret to beginning of text - ed.execCommand('SelectAll'); - ed.selection.collapse(true); - - if (tinymce.isIE) { - ed.focus(); - r = ed.getDoc().selection.createRange(); - - while (r.findText(s, b ? -1 : 1, fl)) { - r.scrollIntoView(); - r.select(); - replace(); - fo = 1; - - if (b) { - r.moveEnd("character", -(rs.length)); // Otherwise will loop forever - } - } - - tinyMCEPopup.storeSelection(); - } else { - while (w.find(s, ca, b, false, false, false, false)) { - replace(); - fo = 1; - } - } - - if (fo) - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); - else - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - - return; - - case 'current': - if (!ed.selection.isCollapsed()) - replace(); - - break; - } - - se.collapse(b); - r = se.getRng(); - - // Whats the point - if (!s) - return; - - if (tinymce.isIE) { - ed.focus(); - r = ed.getDoc().selection.createRange(); - - if (r.findText(s, b ? -1 : 1, fl)) { - r.scrollIntoView(); - r.select(); - } else - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - - tinyMCEPopup.storeSelection(); - } else { - if (!w.find(s, ca, b, false, false, false, false)) - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - else - fix(); - } - } -}; - -tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/www/javascript/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/www/javascript/tiny_mce/plugins/searchreplace/langs/en_dlg.js deleted file mode 100644 index 370959afa..000000000 --- a/www/javascript/tiny_mce/plugins/searchreplace/langs/en_dlg.js +++ /dev/null @@ -1,16 +0,0 @@ -tinyMCE.addI18n('en.searchreplace_dlg',{ -searchnext_desc:"Find again", -notfound:"The search has been completed. The search string could not be found.", -search_title:"Find", -replace_title:"Find/Replace", -allreplaced:"All occurrences of the search string were replaced.", -findwhat:"Find what", -replacewith:"Replace with", -direction:"Direction", -up:"Up", -down:"Down", -mcase:"Match case", -findnext:"Find next", -replace:"Replace", -replaceall:"Replace all" -}); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/searchreplace/searchreplace.htm b/www/javascript/tiny_mce/plugins/searchreplace/searchreplace.htm deleted file mode 100644 index 5a22d8aa4..000000000 --- a/www/javascript/tiny_mce/plugins/searchreplace/searchreplace.htm +++ /dev/null @@ -1,100 +0,0 @@ - - - - {#searchreplace_dlg.replace_title} - - - - - - - - -
- - -
-
- - - - - - - - - - - -
- - - - - - - - - -
- - - - - -
-
-
- -
- - - - - - - - - - - - - - - -
- - - - - - - - - -
- - - - - -
-
-
- -
- -
- - - - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/spellchecker/css/content.css b/www/javascript/tiny_mce/plugins/spellchecker/css/content.css deleted file mode 100644 index 24efa0217..000000000 --- a/www/javascript/tiny_mce/plugins/spellchecker/css/content.css +++ /dev/null @@ -1 +0,0 @@ -.mceItemHiddenSpellWord {background:url(../img/wline.gif) repeat-x bottom left; cursor:default;} diff --git a/www/javascript/tiny_mce/plugins/spellchecker/editor_plugin.js b/www/javascript/tiny_mce/plugins/spellchecker/editor_plugin.js deleted file mode 100644 index 0c42739c6..000000000 --- a/www/javascript/tiny_mce/plugins/spellchecker/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.util.JSONRequest,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.SpellcheckerPlugin",{getInfo:function(){return{longname:"Spellchecker",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker",version:tinymce.majorVersion+"."+tinymce.minorVersion}},init:function(e,f){var g=this,d;g.url=f;g.editor=e;g.rpcUrl=e.getParam("spellchecker_rpc_url","{backend}");if(g.rpcUrl=="{backend}"){if(tinymce.isIE){return}g.hasSupport=true;e.onContextMenu.addToTop(function(h,i){if(g.active){return false}})}e.addCommand("mceSpellCheck",function(){if(g.rpcUrl=="{backend}"){g.editor.getBody().spellcheck=g.active=!g.active;return}if(!g.active){e.setProgressState(1);g._sendRPC("checkWords",[g.selectedLang,g._getWords()],function(h){if(h.length>0){g.active=1;g._markWords(h);e.setProgressState(0);e.nodeChanged()}else{e.setProgressState(0);if(e.getParam("spellchecker_report_no_misspellings",true)){e.windowManager.alert("spellchecker.no_mpell")}}})}else{g._done()}});if(e.settings.content_css!==false){e.contentCSS.push(f+"/css/content.css")}e.onClick.add(g._showMenu,g);e.onContextMenu.add(g._showMenu,g);e.onBeforeGetContent.add(function(){if(g.active){g._removeWords()}});e.onNodeChange.add(function(i,h){h.setActive("spellchecker",g.active)});e.onSetContent.add(function(){g._done()});e.onBeforeGetContent.add(function(){g._done()});e.onBeforeExecCommand.add(function(h,i){if(i=="mceFullScreen"){g._done()}});g.languages={};c(e.getParam("spellchecker_languages","+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv","hash"),function(i,h){if(h.indexOf("+")===0){h=h.substring(1);g.selectedLang=i}g.languages[h]=i})},createControl:function(h,d){var f=this,g,e=f.editor;if(h=="spellchecker"){if(f.rpcUrl=="{backend}"){if(f.hasSupport){g=d.createButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f})}return g}g=d.createSplitButton(h,{title:"spellchecker.desc",cmd:"mceSpellCheck",scope:f});g.onRenderMenu.add(function(j,i){i.add({title:"spellchecker.langs","class":"mceMenuItemTitle"}).setDisabled(1);c(f.languages,function(n,m){var p={icon:1},l;p.onclick=function(){if(n==f.selectedLang){return}l.setSelected(1);f.selectedItem.setSelected(0);f.selectedItem=l;f.selectedLang=n};p.title=m;l=i.add(p);l.setSelected(n==f.selectedLang);if(n==f.selectedLang){f.selectedItem=l}})});return g}},_walk:function(i,g){var h=this.editor.getDoc(),e;if(h.createTreeWalker){e=h.createTreeWalker(i,NodeFilter.SHOW_TEXT,null,false);while((i=e.nextNode())!=null){g.call(this,i)}}else{tinymce.walk(i,g,"childNodes")}},_getSeparators:function(){var e="",d,f=this.editor.getParam("spellchecker_word_separator_chars",'\\s!"#$%&()*+,-./:;<=>?@[]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');for(d=0;d$2");while((s=p.indexOf(""))!=-1){o=p.substring(0,s);if(o.length){r=j.createTextNode(f.decode(o));q.appendChild(r)}p=p.substring(s+10);s=p.indexOf("");o=p.substring(0,s);p=p.substring(s+11);q.appendChild(f.create("span",{"class":"mceItemHiddenSpellWord"},o))}if(p.length){r=j.createTextNode(f.decode(p));q.appendChild(r)}}else{q.innerHTML=p.replace(e,'$1$2')}f.replace(q,t)}});h.moveToBookmark(i)},_showMenu:function(h,j){var i=this,h=i.editor,d=i._menu,l,k=h.dom,g=k.getViewPort(h.getWin()),f=j.target;j=0;if(!d){d=h.controlManager.createDropMenu("spellcheckermenu",{"class":"mceNoIcons"});i._menu=d}if(k.hasClass(f,"mceItemHiddenSpellWord")){d.removeAll();d.add({title:"spellchecker.wait","class":"mceMenuItemTitle"}).setDisabled(1);i._sendRPC("getSuggestions",[i.selectedLang,k.decode(f.innerHTML)],function(m){var e;d.removeAll();if(m.length>0){d.add({title:"spellchecker.sug","class":"mceMenuItemTitle"}).setDisabled(1);c(m,function(n){d.add({title:n,onclick:function(){k.replace(h.getDoc().createTextNode(n),f);i._checkDone()}})});d.addSeparator()}else{d.add({title:"spellchecker.no_sug","class":"mceMenuItemTitle"}).setDisabled(1)}e=i.editor.getParam("spellchecker_enable_ignore_rpc","");d.add({title:"spellchecker.ignore_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}}});d.add({title:"spellchecker.ignore_words",onclick:function(){var n=f.innerHTML;i._removeWords(k.decode(n));i._checkDone();if(e){h.setProgressState(1);i._sendRPC("ignoreWords",[i.selectedLang,n],function(o){h.setProgressState(0)})}}});if(i.editor.getParam("spellchecker_enable_learn_rpc")){d.add({title:"spellchecker.learn_word",onclick:function(){var n=f.innerHTML;k.remove(f,1);i._checkDone();h.setProgressState(1);i._sendRPC("learnWord",[i.selectedLang,n],function(o){h.setProgressState(0)})}})}d.update()});l=b.getPos(h.getContentAreaContainer());d.settings.offset_x=l.x;d.settings.offset_y=l.y;h.selection.select(f);l=k.getPos(f);d.showMenu(l.x,l.y+f.offsetHeight-g.y);return tinymce.dom.Event.cancel(j)}else{d.hideMenu()}},_checkDone:function(){var e=this,d=e.editor,g=d.dom,f;c(g.select("span"),function(h){if(h&&g.hasClass(h,"mceItemHiddenSpellWord")){f=true;return false}});if(!f){e._done()}},_done:function(){var d=this,e=d.active;if(d.active){d.active=0;d._removeWords();if(d._menu){d._menu.hideMenu()}if(e){d.editor.nodeChanged()}}},_sendRPC:function(e,g,d){var f=this;a.sendRPC({url:f.rpcUrl,method:e,params:g,success:d,error:function(i,h){f.editor.setProgressState(0);f.editor.windowManager.alert(i.errstr||("Error response: "+h.responseText))}})}});tinymce.PluginManager.add("spellchecker",tinymce.plugins.SpellcheckerPlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/spellchecker/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/spellchecker/editor_plugin_src.js deleted file mode 100644 index ee4df887c..000000000 --- a/www/javascript/tiny_mce/plugins/spellchecker/editor_plugin_src.js +++ /dev/null @@ -1,434 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var JSONRequest = tinymce.util.JSONRequest, each = tinymce.each, DOM = tinymce.DOM; - - tinymce.create('tinymce.plugins.SpellcheckerPlugin', { - getInfo : function() { - return { - longname : 'Spellchecker', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/spellchecker', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - init : function(ed, url) { - var t = this, cm; - - t.url = url; - t.editor = ed; - t.rpcUrl = ed.getParam("spellchecker_rpc_url", "{backend}"); - - if (t.rpcUrl == '{backend}') { - // Sniff if the browser supports native spellchecking (Don't know of a better way) - if (tinymce.isIE) - return; - - t.hasSupport = true; - - // Disable the context menu when spellchecking is active - ed.onContextMenu.addToTop(function(ed, e) { - if (t.active) - return false; - }); - } - - // Register commands - ed.addCommand('mceSpellCheck', function() { - if (t.rpcUrl == '{backend}') { - // Enable/disable native spellchecker - t.editor.getBody().spellcheck = t.active = !t.active; - return; - } - - if (!t.active) { - ed.setProgressState(1); - t._sendRPC('checkWords', [t.selectedLang, t._getWords()], function(r) { - if (r.length > 0) { - t.active = 1; - t._markWords(r); - ed.setProgressState(0); - ed.nodeChanged(); - } else { - ed.setProgressState(0); - - if (ed.getParam('spellchecker_report_no_misspellings', true)) - ed.windowManager.alert('spellchecker.no_mpell'); - } - }); - } else - t._done(); - }); - - if (ed.settings.content_css !== false) - ed.contentCSS.push(url + '/css/content.css'); - - ed.onClick.add(t._showMenu, t); - ed.onContextMenu.add(t._showMenu, t); - ed.onBeforeGetContent.add(function() { - if (t.active) - t._removeWords(); - }); - - ed.onNodeChange.add(function(ed, cm) { - cm.setActive('spellchecker', t.active); - }); - - ed.onSetContent.add(function() { - t._done(); - }); - - ed.onBeforeGetContent.add(function() { - t._done(); - }); - - ed.onBeforeExecCommand.add(function(ed, cmd) { - if (cmd == 'mceFullScreen') - t._done(); - }); - - // Find selected language - t.languages = {}; - each(ed.getParam('spellchecker_languages', '+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv', 'hash'), function(v, k) { - if (k.indexOf('+') === 0) { - k = k.substring(1); - t.selectedLang = v; - } - - t.languages[k] = v; - }); - }, - - createControl : function(n, cm) { - var t = this, c, ed = t.editor; - - if (n == 'spellchecker') { - // Use basic button if we use the native spellchecker - if (t.rpcUrl == '{backend}') { - // Create simple toggle button if we have native support - if (t.hasSupport) - c = cm.createButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); - - return c; - } - - c = cm.createSplitButton(n, {title : 'spellchecker.desc', cmd : 'mceSpellCheck', scope : t}); - - c.onRenderMenu.add(function(c, m) { - m.add({title : 'spellchecker.langs', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - each(t.languages, function(v, k) { - var o = {icon : 1}, mi; - - o.onclick = function() { - if (v == t.selectedLang) { - return; - } - mi.setSelected(1); - t.selectedItem.setSelected(0); - t.selectedItem = mi; - t.selectedLang = v; - }; - - o.title = k; - mi = m.add(o); - mi.setSelected(v == t.selectedLang); - - if (v == t.selectedLang) - t.selectedItem = mi; - }) - }); - - return c; - } - }, - - // Internal functions - - _walk : function(n, f) { - var d = this.editor.getDoc(), w; - - if (d.createTreeWalker) { - w = d.createTreeWalker(n, NodeFilter.SHOW_TEXT, null, false); - - while ((n = w.nextNode()) != null) - f.call(this, n); - } else - tinymce.walk(n, f, 'childNodes'); - }, - - _getSeparators : function() { - var re = '', i, str = this.editor.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c'); - - // Build word separator regexp - for (i=0; i elements content is broken after spellchecking. - // Bug #1408: Preceding whitespace characters are removed - // @TODO: I'm not sure that both are still issues on IE9. - if (tinymce.isIE) { - // Enclose mispelled words with temporal tag - v = v.replace(rx, '$1$2'); - // Loop over the content finding mispelled words - while ((pos = v.indexOf('')) != -1) { - // Add text node for the content before the word - txt = v.substring(0, pos); - if (txt.length) { - node = doc.createTextNode(dom.decode(txt)); - elem.appendChild(node); - } - v = v.substring(pos+10); - pos = v.indexOf(''); - txt = v.substring(0, pos); - v = v.substring(pos+11); - // Add span element for the word - elem.appendChild(dom.create('span', {'class' : 'mceItemHiddenSpellWord'}, txt)); - } - // Add text node for the rest of the content - if (v.length) { - node = doc.createTextNode(dom.decode(v)); - elem.appendChild(node); - } - } else { - // Other browsers preserve whitespace characters on innerHTML usage - elem.innerHTML = v.replace(rx, '$1$2'); - } - - // Finally, replace the node with the container - dom.replace(elem, n); - } - }); - - se.moveToBookmark(b); - }, - - _showMenu : function(ed, e) { - var t = this, ed = t.editor, m = t._menu, p1, dom = ed.dom, vp = dom.getViewPort(ed.getWin()), wordSpan = e.target; - - e = 0; // Fixes IE memory leak - - if (!m) { - m = ed.controlManager.createDropMenu('spellcheckermenu', {'class' : 'mceNoIcons'}); - t._menu = m; - } - - if (dom.hasClass(wordSpan, 'mceItemHiddenSpellWord')) { - m.removeAll(); - m.add({title : 'spellchecker.wait', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - - t._sendRPC('getSuggestions', [t.selectedLang, dom.decode(wordSpan.innerHTML)], function(r) { - var ignoreRpc; - - m.removeAll(); - - if (r.length > 0) { - m.add({title : 'spellchecker.sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - each(r, function(v) { - m.add({title : v, onclick : function() { - dom.replace(ed.getDoc().createTextNode(v), wordSpan); - t._checkDone(); - }}); - }); - - m.addSeparator(); - } else - m.add({title : 'spellchecker.no_sug', 'class' : 'mceMenuItemTitle'}).setDisabled(1); - - ignoreRpc = t.editor.getParam("spellchecker_enable_ignore_rpc", ''); - m.add({ - title : 'spellchecker.ignore_word', - onclick : function() { - var word = wordSpan.innerHTML; - - dom.remove(wordSpan, 1); - t._checkDone(); - - // tell the server if we need to - if (ignoreRpc) { - ed.setProgressState(1); - t._sendRPC('ignoreWord', [t.selectedLang, word], function(r) { - ed.setProgressState(0); - }); - } - } - }); - - m.add({ - title : 'spellchecker.ignore_words', - onclick : function() { - var word = wordSpan.innerHTML; - - t._removeWords(dom.decode(word)); - t._checkDone(); - - // tell the server if we need to - if (ignoreRpc) { - ed.setProgressState(1); - t._sendRPC('ignoreWords', [t.selectedLang, word], function(r) { - ed.setProgressState(0); - }); - } - } - }); - - if (t.editor.getParam("spellchecker_enable_learn_rpc")) { - m.add({ - title : 'spellchecker.learn_word', - onclick : function() { - var word = wordSpan.innerHTML; - - dom.remove(wordSpan, 1); - t._checkDone(); - - ed.setProgressState(1); - t._sendRPC('learnWord', [t.selectedLang, word], function(r) { - ed.setProgressState(0); - }); - } - }); - } - - m.update(); - }); - - p1 = DOM.getPos(ed.getContentAreaContainer()); - m.settings.offset_x = p1.x; - m.settings.offset_y = p1.y; - - ed.selection.select(wordSpan); - p1 = dom.getPos(wordSpan); - m.showMenu(p1.x, p1.y + wordSpan.offsetHeight - vp.y); - - return tinymce.dom.Event.cancel(e); - } else - m.hideMenu(); - }, - - _checkDone : function() { - var t = this, ed = t.editor, dom = ed.dom, o; - - each(dom.select('span'), function(n) { - if (n && dom.hasClass(n, 'mceItemHiddenSpellWord')) { - o = true; - return false; - } - }); - - if (!o) - t._done(); - }, - - _done : function() { - var t = this, la = t.active; - - if (t.active) { - t.active = 0; - t._removeWords(); - - if (t._menu) - t._menu.hideMenu(); - - if (la) - t.editor.nodeChanged(); - } - }, - - _sendRPC : function(m, p, cb) { - var t = this; - - JSONRequest.sendRPC({ - url : t.rpcUrl, - method : m, - params : p, - success : cb, - error : function(e, x) { - t.editor.setProgressState(0); - t.editor.windowManager.alert(e.errstr || ('Error response: ' + x.responseText)); - } - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('spellchecker', tinymce.plugins.SpellcheckerPlugin); -})(); diff --git a/www/javascript/tiny_mce/plugins/spellchecker/img/wline.gif b/www/javascript/tiny_mce/plugins/spellchecker/img/wline.gif deleted file mode 100644 index 7d0a4dbca03cc13177a359a5f175dda819fdf464..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 46 ycmZ?wbhEHbWMN=tXkcXcqowu#|9{1wEQ|~cj0`#qKmd|qU}ANVOOs?}um%7FLkRf* diff --git a/www/javascript/tiny_mce/plugins/style/css/props.css b/www/javascript/tiny_mce/plugins/style/css/props.css deleted file mode 100644 index eb1f26496..000000000 --- a/www/javascript/tiny_mce/plugins/style/css/props.css +++ /dev/null @@ -1,13 +0,0 @@ -#text_font {width:250px;} -#text_size {width:70px;} -.mceAddSelectValue {background:#DDD;} -select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left {width:70px;} -#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex {width:70px;} -#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left {width:70px;} -#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left {width:70px;} -.panel_wrapper div.current {padding-top:10px;height:230px;} -.delim {border-left:1px solid gray;} -.tdelim {border-bottom:1px solid gray;} -#block_display {width:145px;} -#list_type {width:115px;} -.disabled {background:#EEE;} diff --git a/www/javascript/tiny_mce/plugins/style/editor_plugin.js b/www/javascript/tiny_mce/plugins/style/editor_plugin.js deleted file mode 100644 index cab2153c4..000000000 --- a/www/javascript/tiny_mce/plugins/style/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.StylePlugin",{init:function(a,b){a.addCommand("mceStyleProps",function(){a.windowManager.open({file:b+"/props.htm",width:480+parseInt(a.getLang("style.delta_width",0)),height:320+parseInt(a.getLang("style.delta_height",0)),inline:1},{plugin_url:b,style_text:a.selection.getNode().style.cssText})});a.addCommand("mceSetElementStyle",function(d,c){if(e=a.selection.getNode()){a.dom.setAttrib(e,"style",c);a.execCommand("mceRepaint")}});a.onNodeChange.add(function(d,c,f){c.setDisabled("styleprops",f.nodeName==="BODY")});a.addButton("styleprops",{title:"style.desc",cmd:"mceStyleProps"})},getInfo:function(){return{longname:"Style",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("style",tinymce.plugins.StylePlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/style/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/style/editor_plugin_src.js deleted file mode 100644 index 5f7755f18..000000000 --- a/www/javascript/tiny_mce/plugins/style/editor_plugin_src.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.StylePlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceStyleProps', function() { - ed.windowManager.open({ - file : url + '/props.htm', - width : 480 + parseInt(ed.getLang('style.delta_width', 0)), - height : 320 + parseInt(ed.getLang('style.delta_height', 0)), - inline : 1 - }, { - plugin_url : url, - style_text : ed.selection.getNode().style.cssText - }); - }); - - ed.addCommand('mceSetElementStyle', function(ui, v) { - if (e = ed.selection.getNode()) { - ed.dom.setAttrib(e, 'style', v); - ed.execCommand('mceRepaint'); - } - }); - - ed.onNodeChange.add(function(ed, cm, n) { - cm.setDisabled('styleprops', n.nodeName === 'BODY'); - }); - - // Register buttons - ed.addButton('styleprops', {title : 'style.desc', cmd : 'mceStyleProps'}); - }, - - getInfo : function() { - return { - longname : 'Style', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/style', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('style', tinymce.plugins.StylePlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/style/js/props.js b/www/javascript/tiny_mce/plugins/style/js/props.js deleted file mode 100644 index 6800a9a9a..000000000 --- a/www/javascript/tiny_mce/plugins/style/js/props.js +++ /dev/null @@ -1,635 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var defaultFonts = "" + - "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + - "Times New Roman, Times, serif=Times New Roman, Times, serif;" + - "Courier New, Courier, mono=Courier New, Courier, mono;" + - "Times New Roman, Times, serif=Times New Roman, Times, serif;" + - "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + - "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + - "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; - -var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; -var defaultMeasurement = "+pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; -var defaultSpacingMeasurement = "pixels=px;points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;+ems=em;exs=ex;%"; -var defaultIndentMeasurement = "pixels=px;+points=pt;inches=in;centimetres=cm;millimetres=mm;picas=pc;ems=em;exs=ex;%"; -var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; -var defaultTextStyle = "normal;italic;oblique"; -var defaultVariant = "normal;small-caps"; -var defaultLineHeight = "normal"; -var defaultAttachment = "fixed;scroll"; -var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; -var defaultPosH = "left;center;right"; -var defaultPosV = "top;center;bottom"; -var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; -var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; -var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; -var defaultBorderWidth = "thin;medium;thick"; -var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; - -function init() { - var ce = document.getElementById('container'), h; - - ce.style.cssText = tinyMCEPopup.getWindowArg('style_text'); - - h = getBrowserHTML('background_image_browser','background_image','image','advimage'); - document.getElementById("background_image_browser").innerHTML = h; - - document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); - document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); - document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); - document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); - document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); - document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); - - fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); - fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); - fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); - fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); - fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); - fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); - fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); - fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); - fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); - - fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); - fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); - - fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); - fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); - fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); - fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); - fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); - fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); - fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); - fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); - fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); - - fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); - fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); - fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); - fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); - - fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); - fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); - - fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); - fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); - - fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); - fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); - - fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); - - fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); - - fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); - fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); - - TinyMCE_EditableSelects.init(); - setupFormData(); - showDisabledControls(); -} - -function setupFormData() { - var ce = document.getElementById('container'), f = document.forms[0], s, b, i; - - // Setup text fields - - selectByValue(f, 'text_font', ce.style.fontFamily, true, true); - selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); - selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); - selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); - selectByValue(f, 'text_style', ce.style.fontStyle, true, true); - selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); - selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); - selectByValue(f, 'text_case', ce.style.textTransform, true, true); - selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); - f.text_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.color); - updateColor('text_color_pick', 'text_color'); - f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); - f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); - f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); - f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); - - // Setup background fields - - f.background_color.value = tinyMCEPopup.editor.dom.toHex(ce.style.backgroundColor); - updateColor('background_color_pick', 'background_color'); - f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); - selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); - selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); - selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); - selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); - selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); - selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); - - // Setup block fields - - selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); - selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); - selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); - selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); - selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); - selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); - f.block_text_indent.value = getNum(ce.style.textIndent); - selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); - selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); - selectByValue(f, 'block_display', ce.style.display, true, true); - - // Setup box fields - - f.box_width.value = getNum(ce.style.width); - selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); - - f.box_height.value = getNum(ce.style.height); - selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); - selectByValue(f, 'box_float', ce.style.cssFloat || ce.style.styleFloat, true, true); - - selectByValue(f, 'box_clear', ce.style.clear, true, true); - - setupBox(f, ce, 'box_padding', 'padding', ''); - setupBox(f, ce, 'box_margin', 'margin', ''); - - // Setup border fields - - setupBox(f, ce, 'border_style', 'border', 'Style'); - setupBox(f, ce, 'border_width', 'border', 'Width'); - setupBox(f, ce, 'border_color', 'border', 'Color'); - - updateColor('border_color_top_pick', 'border_color_top'); - updateColor('border_color_right_pick', 'border_color_right'); - updateColor('border_color_bottom_pick', 'border_color_bottom'); - updateColor('border_color_left_pick', 'border_color_left'); - - f.elements.border_color_top.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_top.value); - f.elements.border_color_right.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_right.value); - f.elements.border_color_bottom.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_bottom.value); - f.elements.border_color_left.value = tinyMCEPopup.editor.dom.toHex(f.elements.border_color_left.value); - - // Setup list fields - - selectByValue(f, 'list_type', ce.style.listStyleType, true, true); - selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); - f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); - - // Setup box fields - - selectByValue(f, 'positioning_type', ce.style.position, true, true); - selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); - selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); - f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; - - f.positioning_width.value = getNum(ce.style.width); - selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); - - f.positioning_height.value = getNum(ce.style.height); - selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); - - setupBox(f, ce, 'positioning_placement', '', '', ['top', 'right', 'bottom', 'left']); - - s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); - s = s.replace(/,/g, ' '); - - if (!hasEqualValues([getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)])) { - f.positioning_clip_top.value = getNum(getVal(s, 0)); - selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); - f.positioning_clip_right.value = getNum(getVal(s, 1)); - selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); - f.positioning_clip_bottom.value = getNum(getVal(s, 2)); - selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); - f.positioning_clip_left.value = getNum(getVal(s, 3)); - selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); - } else { - f.positioning_clip_top.value = getNum(getVal(s, 0)); - selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); - f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; - } - -// setupBox(f, ce, '', 'border', 'Color'); -} - -function getMeasurement(s) { - return s.replace(/^([0-9.]+)(.*)$/, "$2"); -} - -function getNum(s) { - if (new RegExp('^(?:[0-9.]+)(?:[a-z%]+)$', 'gi').test(s)) - return s.replace(/[^0-9.]/g, ''); - - return s; -} - -function inStr(s, n) { - return new RegExp(n, 'gi').test(s); -} - -function getVal(s, i) { - var a = s.split(' '); - - if (a.length > 1) - return a[i]; - - return ""; -} - -function setValue(f, n, v) { - if (f.elements[n].type == "text") - f.elements[n].value = v; - else - selectByValue(f, n, v, true, true); -} - -function setupBox(f, ce, fp, pr, sf, b) { - if (typeof(b) == "undefined") - b = ['Top', 'Right', 'Bottom', 'Left']; - - if (isSame(ce, pr, sf, b)) { - f.elements[fp + "_same"].checked = true; - - setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); - f.elements[fp + "_top"].disabled = false; - - f.elements[fp + "_right"].value = ""; - f.elements[fp + "_right"].disabled = true; - f.elements[fp + "_bottom"].value = ""; - f.elements[fp + "_bottom"].disabled = true; - f.elements[fp + "_left"].value = ""; - f.elements[fp + "_left"].disabled = true; - - if (f.elements[fp + "_top_measurement"]) { - selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); - f.elements[fp + "_left_measurement"].disabled = true; - f.elements[fp + "_bottom_measurement"].disabled = true; - f.elements[fp + "_right_measurement"].disabled = true; - } - } else { - f.elements[fp + "_same"].checked = false; - - setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); - f.elements[fp + "_top"].disabled = false; - - setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); - f.elements[fp + "_right"].disabled = false; - - setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); - f.elements[fp + "_bottom"].disabled = false; - - setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); - f.elements[fp + "_left"].disabled = false; - - if (f.elements[fp + "_top_measurement"]) { - selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); - selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); - selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); - selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); - f.elements[fp + "_left_measurement"].disabled = false; - f.elements[fp + "_bottom_measurement"].disabled = false; - f.elements[fp + "_right_measurement"].disabled = false; - } - } -} - -function isSame(e, pr, sf, b) { - var a = [], i, x; - - if (typeof(b) == "undefined") - b = ['Top', 'Right', 'Bottom', 'Left']; - - if (typeof(sf) == "undefined" || sf == null) - sf = ""; - - a[0] = e.style[pr + b[0] + sf]; - a[1] = e.style[pr + b[1] + sf]; - a[2] = e.style[pr + b[2] + sf]; - a[3] = e.style[pr + b[3] + sf]; - - for (i=0; i 0 ? s.substring(1) : s; - - if (f.text_none.checked) - s = "none"; - - ce.style.textDecoration = s; - - // Build background styles - - ce.style.backgroundColor = f.background_color.value; - ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; - ce.style.backgroundRepeat = f.background_repeat.value; - ce.style.backgroundAttachment = f.background_attachment.value; - - if (f.background_hpos.value != "") { - s = ""; - s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; - s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); - ce.style.backgroundPosition = s; - } - - // Build block styles - - ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); - ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); - ce.style.verticalAlign = f.block_vertical_alignment.value; - ce.style.textAlign = f.block_text_align.value; - ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); - ce.style.whiteSpace = f.block_whitespace.value; - ce.style.display = f.block_display.value; - - // Build box styles - - ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); - ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); - ce.style.styleFloat = f.box_float.value; - ce.style.cssFloat = f.box_float.value; - - ce.style.clear = f.box_clear.value; - - if (!f.box_padding_same.checked) { - ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); - ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); - ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); - ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); - } else - ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); - - if (!f.box_margin_same.checked) { - ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); - ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); - ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); - ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); - } else - ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); - - // Build border styles - - if (!f.border_style_same.checked) { - ce.style.borderTopStyle = f.border_style_top.value; - ce.style.borderRightStyle = f.border_style_right.value; - ce.style.borderBottomStyle = f.border_style_bottom.value; - ce.style.borderLeftStyle = f.border_style_left.value; - } else - ce.style.borderStyle = f.border_style_top.value; - - if (!f.border_width_same.checked) { - ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); - ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); - ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); - ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); - } else - ce.style.borderWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); - - if (!f.border_color_same.checked) { - ce.style.borderTopColor = f.border_color_top.value; - ce.style.borderRightColor = f.border_color_right.value; - ce.style.borderBottomColor = f.border_color_bottom.value; - ce.style.borderLeftColor = f.border_color_left.value; - } else - ce.style.borderColor = f.border_color_top.value; - - // Build list styles - - ce.style.listStyleType = f.list_type.value; - ce.style.listStylePosition = f.list_position.value; - ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; - - // Build positioning styles - - ce.style.position = f.positioning_type.value; - ce.style.visibility = f.positioning_visibility.value; - - if (ce.style.width == "") - ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); - - if (ce.style.height == "") - ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); - - ce.style.zIndex = f.positioning_zindex.value; - ce.style.overflow = f.positioning_overflow.value; - - if (!f.positioning_placement_same.checked) { - ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); - ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); - ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); - ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); - } else { - s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); - ce.style.top = s; - ce.style.right = s; - ce.style.bottom = s; - ce.style.left = s; - } - - if (!f.positioning_clip_same.checked) { - s = "rect("; - s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; - s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); - s += ")"; - - if (s != "rect(auto auto auto auto)") - ce.style.clip = s; - } else { - s = "rect("; - t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; - s += t + " "; - s += t + " "; - s += t + " "; - s += t + ")"; - - if (s != "rect(auto auto auto auto)") - ce.style.clip = s; - } - - ce.style.cssText = ce.style.cssText; -} - -function isNum(s) { - return new RegExp('[0-9]+', 'g').test(s); -} - -function showDisabledControls() { - var f = document.forms, i, a; - - for (i=0; i 1) { - addSelectValue(f, s, p[0], p[1]); - - if (se) - selectByValue(f, s, p[1]); - } else { - addSelectValue(f, s, p[0], p[0]); - - if (se) - selectByValue(f, s, p[0]); - } - } -} - -function toggleSame(ce, pre) { - var el = document.forms[0].elements, i; - - if (ce.checked) { - el[pre + "_top"].disabled = false; - el[pre + "_right"].disabled = true; - el[pre + "_bottom"].disabled = true; - el[pre + "_left"].disabled = true; - - if (el[pre + "_top_measurement"]) { - el[pre + "_top_measurement"].disabled = false; - el[pre + "_right_measurement"].disabled = true; - el[pre + "_bottom_measurement"].disabled = true; - el[pre + "_left_measurement"].disabled = true; - } - } else { - el[pre + "_top"].disabled = false; - el[pre + "_right"].disabled = false; - el[pre + "_bottom"].disabled = false; - el[pre + "_left"].disabled = false; - - if (el[pre + "_top_measurement"]) { - el[pre + "_top_measurement"].disabled = false; - el[pre + "_right_measurement"].disabled = false; - el[pre + "_bottom_measurement"].disabled = false; - el[pre + "_left_measurement"].disabled = false; - } - } - - showDisabledControls(); -} - -function synch(fr, to) { - var f = document.forms[0]; - - f.elements[to].value = f.elements[fr].value; - - if (f.elements[fr + "_measurement"]) - selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); -} - -tinyMCEPopup.onInit.add(init); diff --git a/www/javascript/tiny_mce/plugins/style/langs/en_dlg.js b/www/javascript/tiny_mce/plugins/style/langs/en_dlg.js deleted file mode 100644 index df0a173c7..000000000 --- a/www/javascript/tiny_mce/plugins/style/langs/en_dlg.js +++ /dev/null @@ -1,70 +0,0 @@ -tinyMCE.addI18n('en.style_dlg',{ -title:"Edit CSS Style", -apply:"Apply", -text_tab:"Text", -background_tab:"Background", -block_tab:"Block", -box_tab:"Box", -border_tab:"Border", -list_tab:"List", -positioning_tab:"Positioning", -text_props:"Text", -text_font:"Font", -text_size:"Size", -text_weight:"Weight", -text_style:"Style", -text_variant:"Variant", -text_lineheight:"Line height", -text_case:"Case", -text_color:"Color", -text_decoration:"Decoration", -text_overline:"overline", -text_underline:"underline", -text_striketrough:"strikethrough", -text_blink:"blink", -text_none:"none", -background_color:"Background color", -background_image:"Background image", -background_repeat:"Repeat", -background_attachment:"Attachment", -background_hpos:"Horizontal position", -background_vpos:"Vertical position", -block_wordspacing:"Word spacing", -block_letterspacing:"Letter spacing", -block_vertical_alignment:"Vertical alignment", -block_text_align:"Text align", -block_text_indent:"Text indent", -block_whitespace:"Whitespace", -block_display:"Display", -box_width:"Width", -box_height:"Height", -box_float:"Float", -box_clear:"Clear", -padding:"Padding", -same:"Same for all", -top:"Top", -right:"Right", -bottom:"Bottom", -left:"Left", -margin:"Margin", -style:"Style", -width:"Width", -height:"Height", -color:"Color", -list_type:"Type", -bullet_image:"Bullet image", -position:"Position", -positioning_type:"Type", -visibility:"Visibility", -zindex:"Z-index", -overflow:"Overflow", -placement:"Placement", -clip:"Clip", -text:"Text", -background:"Background", -block:"Block", -box:"Box", -border:"Border", -list:"List", -position:"Position" -}); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/style/props.htm b/www/javascript/tiny_mce/plugins/style/props.htm deleted file mode 100644 index b5a3d15d9..000000000 --- a/www/javascript/tiny_mce/plugins/style/props.htm +++ /dev/null @@ -1,838 +0,0 @@ - - - - {#style_dlg.title} - - - - - - - - - - -
- - -
-
-
- {#style_dlg.text} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
  - - -
-
- -
- - - -
- - - - - - -
- -   - - -
-
- -
- - - - - -
 
-
{#style_dlg.text_decoration} - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-
- {#style_dlg.background} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
 
-
- - - - -
 
-
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
-
-
- -
-
- {#style_dlg.block} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
- - - - - - -
  - - - -
-
-
-
- -
-
- {#style_dlg.box} - - - - - - - - - - - - - - -
- - - - - - -
  - - -
-
   
- - - - - - -
  - - -
-
   
-
-
- {#style_dlg.padding} - - - - - - - - - - - - - - - - - - - - - - -
 
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
-
-
- -
-
- {#style_dlg.margin} - - - - - - - - - - - - - - - - - - - - - - -
 
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
- - - - - - -
  - - -
-
-
-
-
-
- -
-
- {#style_dlg.border} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  {#style_dlg.style} {#style_dlg.width} {#style_dlg.color}
      
{#style_dlg.top}   - - - - - - -
  - - -
-
  - - - - - -
 
-
{#style_dlg.right}   - - - - - - -
  - - -
-
  - - - - - -
 
-
{#style_dlg.bottom}   - - - - - - -
  - - -
-
  - - - - - -
 
-
{#style_dlg.left}   - - - - - - -
  - - -
-
  - - - - - -
 
-
-
-
- -
-
- {#style_dlg.list} - - - - - - - - - - - - - - - -
-
-
- -
-
- {#style_dlg.position} - - - - - - - - - - - - - - - - - - - - - -
   
- - - - - - -
  - - -
-
   
- - - - - - -
  - - -
-
   
- -
-
- {#style_dlg.placement} - - - - - - - - - - - - - - - - - - - - - - -
 
{#style_dlg.top} - - - - - - -
  - - -
-
{#style_dlg.right} - - - - - - -
  - - -
-
{#style_dlg.bottom} - - - - - - -
  - - -
-
{#style_dlg.left} - - - - - - -
  - - -
-
-
-
- -
-
- {#style_dlg.clip} - - - - - - - - - - - - - - - - - - - - - - -
 
{#style_dlg.top} - - - - - - -
  - - -
-
{#style_dlg.right} - - - - - - -
  - - -
-
{#style_dlg.bottom} - - - - - - -
  - - -
-
{#style_dlg.left} - - - - - - -
  - - -
-
-
-
-
-
- -
- -
- - - -
-
- -
-
-
- - - diff --git a/www/javascript/tiny_mce/plugins/tabfocus/editor_plugin.js b/www/javascript/tiny_mce/plugins/tabfocus/editor_plugin.js deleted file mode 100644 index d18689ddb..000000000 --- a/www/javascript/tiny_mce/plugins/tabfocus/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var c=tinymce.DOM,a=tinymce.dom.Event,d=tinymce.each,b=tinymce.explode;tinymce.create("tinymce.plugins.TabFocusPlugin",{init:function(f,g){function e(i,j){if(j.keyCode===9){return a.cancel(j)}}function h(l,p){var j,m,o,n,k;function q(r){n=c.select(":input:enabled,*[tabindex]");function i(s){return s.type!="hidden"&&s.tabIndex!="-1"&&!(n[m].style.display=="none")&&!(n[m].style.visibility=="hidden")}d(n,function(t,s){if(t.id==l.id){j=s;return false}});if(r>0){for(m=j+1;m=0;m--){if(i(n[m])){return n[m]}}}return null}if(p.keyCode===9){k=b(l.getParam("tab_focus",l.getParam("tabfocus_elements",":prev,:next")));if(k.length==1){k[1]=k[0];k[0]=":prev"}if(p.shiftKey){if(k[0]==":prev"){n=q(-1)}else{n=c.get(k[0])}}else{if(k[1]==":next"){n=q(1)}else{n=c.get(k[1])}}if(n){if(n.id&&(l=tinymce.get(n.id||n.name))){l.focus()}else{window.setTimeout(function(){if(!tinymce.isWebKit){window.focus()}n.focus()},10)}return a.cancel(p)}}}f.onKeyUp.add(e);if(tinymce.isGecko){f.onKeyPress.add(h);f.onKeyDown.add(e)}else{f.onKeyDown.add(h)}},getInfo:function(){return{longname:"Tabfocus",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("tabfocus",tinymce.plugins.TabFocusPlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/tabfocus/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/tabfocus/editor_plugin_src.js deleted file mode 100644 index f4545e167..000000000 --- a/www/javascript/tiny_mce/plugins/tabfocus/editor_plugin_src.js +++ /dev/null @@ -1,114 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, each = tinymce.each, explode = tinymce.explode; - - tinymce.create('tinymce.plugins.TabFocusPlugin', { - init : function(ed, url) { - function tabCancel(ed, e) { - if (e.keyCode === 9) - return Event.cancel(e); - }; - - function tabHandler(ed, e) { - var x, i, f, el, v; - - function find(d) { - el = DOM.select(':input:enabled,*[tabindex]'); - function canSelect(e) { - return e.type != 'hidden' && - e.tabIndex != '-1' && - !(el[i].style.display == "none") && - !(el[i].style.visibility == "hidden"); - } - - each(el, function(e, i) { - if (e.id == ed.id) { - x = i; - return false; - } - }); - - if (d > 0) { - for (i = x + 1; i < el.length; i++) { - if (canSelect(el[i])) - return el[i]; - } - } else { - for (i = x - 1; i >= 0; i--) { - if (canSelect(el[i])) - return el[i]; - } - } - - return null; - }; - - if (e.keyCode === 9) { - v = explode(ed.getParam('tab_focus', ed.getParam('tabfocus_elements', ':prev,:next'))); - - if (v.length == 1) { - v[1] = v[0]; - v[0] = ':prev'; - } - - // Find element to focus - if (e.shiftKey) { - if (v[0] == ':prev') - el = find(-1); - else - el = DOM.get(v[0]); - } else { - if (v[1] == ':next') - el = find(1); - else - el = DOM.get(v[1]); - } - - if (el) { - if (el.id && (ed = tinymce.get(el.id || el.name))) - ed.focus(); - else - window.setTimeout(function() { - if (!tinymce.isWebKit) - window.focus(); - el.focus(); - }, 10); - - return Event.cancel(e); - } - } - }; - - ed.onKeyUp.add(tabCancel); - - if (tinymce.isGecko) { - ed.onKeyPress.add(tabHandler); - ed.onKeyDown.add(tabCancel); - } else - ed.onKeyDown.add(tabHandler); - - }, - - getInfo : function() { - return { - longname : 'Tabfocus', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/tabfocus', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('tabfocus', tinymce.plugins.TabFocusPlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/table/cell.htm b/www/javascript/tiny_mce/plugins/table/cell.htm deleted file mode 100644 index a72a8d697..000000000 --- a/www/javascript/tiny_mce/plugins/table/cell.htm +++ /dev/null @@ -1,180 +0,0 @@ - - - - {#table_dlg.cell_title} - - - - - - - - - -
- - -
-
-
- {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- -
-
-
- -
-
- {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- - - - - -
 
-
- - - - - -
 
-
- - - - - -
 
-
-
-
-
- -
-
- -
- - - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/table/css/cell.css b/www/javascript/tiny_mce/plugins/table/css/cell.css deleted file mode 100644 index a067ecdfe..000000000 --- a/www/javascript/tiny_mce/plugins/table/css/cell.css +++ /dev/null @@ -1,17 +0,0 @@ -/* CSS file for cell dialog in the table plugin */ - -.panel_wrapper div.current { - height: 200px; -} - -.advfield { - width: 200px; -} - -#action { - margin-bottom: 3px; -} - -#class { - width: 150px; -} \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/table/css/row.css b/www/javascript/tiny_mce/plugins/table/css/row.css deleted file mode 100644 index 1f7755daf..000000000 --- a/www/javascript/tiny_mce/plugins/table/css/row.css +++ /dev/null @@ -1,25 +0,0 @@ -/* CSS file for row dialog in the table plugin */ - -.panel_wrapper div.current { - height: 200px; -} - -.advfield { - width: 200px; -} - -#action { - margin-bottom: 3px; -} - -#rowtype,#align,#valign,#class,#height { - width: 150px; -} - -#height { - width: 50px; -} - -.col2 { - padding-left: 20px; -} diff --git a/www/javascript/tiny_mce/plugins/table/css/table.css b/www/javascript/tiny_mce/plugins/table/css/table.css deleted file mode 100644 index d11c3f69c..000000000 --- a/www/javascript/tiny_mce/plugins/table/css/table.css +++ /dev/null @@ -1,13 +0,0 @@ -/* CSS file for table dialog in the table plugin */ - -.panel_wrapper div.current { - height: 245px; -} - -.advfield { - width: 200px; -} - -#class { - width: 150px; -} diff --git a/www/javascript/tiny_mce/plugins/table/editor_plugin.js b/www/javascript/tiny_mce/plugins/table/editor_plugin.js deleted file mode 100644 index 836d156d4..000000000 --- a/www/javascript/tiny_mce/plugins/table/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(c){var d=c.each;function b(f,g){var h=g.ownerDocument,e=h.createRange(),j;e.setStartBefore(g);e.setEnd(f.endContainer,f.endOffset);j=h.createElement("body");j.appendChild(e.cloneContents());return j.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length==0}function a(H,G,K){var f,L,D,o;t();o=G.getParent(K.getStart(),"th,td");if(o){L=F(o);D=I();o=z(L.x,L.y)}function A(N,M){N=N.cloneNode(M);N.removeAttribute("id");return N}function t(){var M=0;f=[];d(["thead","tbody","tfoot"],function(N){var O=G.select("> "+N+" tr",H);d(O,function(P,Q){Q+=M;d(G.select("> td, > th",P),function(W,R){var S,T,U,V;if(f[Q]){while(f[Q][R]){R++}}U=h(W,"rowspan");V=h(W,"colspan");for(T=Q;T'}return false}},"childNodes");M=A(M,false);s(M,"rowSpan",1);s(M,"colSpan",1);if(N){M.appendChild(N)}else{if(!c.isIE){M.innerHTML='
'}}return M}function q(){var M=G.createRng();d(G.select("tr",H),function(N){if(N.cells.length==0){G.remove(N)}});if(G.select("tr",H).length==0){M.setStartAfter(H);M.setEndAfter(H);K.setRng(M);G.remove(H);return}d(G.select("thead,tbody,tfoot",H),function(N){if(N.rows.length==0){G.remove(N)}});t();row=f[Math.min(f.length-1,L.y)];if(row){K.select(row[Math.min(row.length-1,L.x)].elm,true);K.collapse(true)}}function u(S,Q,U,R){var P,N,M,O,T;P=f[Q][S].elm.parentNode;for(M=1;M<=U;M++){P=G.getNext(P,"tr");if(P){for(N=S;N>=0;N--){T=f[Q+M][N].elm;if(T.parentNode==P){for(O=1;O<=R;O++){G.insertAfter(e(T),T)}break}}if(N==-1){for(O=1;O<=R;O++){P.insertBefore(e(P.cells[0]),P.cells[0])}}}}}function C(){d(f,function(M,N){d(M,function(P,O){var S,R,T,Q;if(j(P)){P=P.elm;S=h(P,"colspan");R=h(P,"rowspan");if(S>1||R>1){s(P,"rowSpan",1);s(P,"colSpan",1);for(Q=0;Q1){s(S,"rowSpan",O+1);continue}}else{if(M>0&&f[M-1][R]){V=f[M-1][R].elm;O=h(V,"rowSpan");if(O>1){s(V,"rowSpan",O+1);continue}}}N=e(S);s(N,"colSpan",S.colSpan);U.appendChild(N);P=S}}if(U.hasChildNodes()){if(!Q){G.insertAfter(U,T)}else{T.parentNode.insertBefore(U,T)}}}function g(N){var O,M;d(f,function(P,Q){d(P,function(S,R){if(j(S)){O=R;if(N){return false}}});if(N){return !O}});d(f,function(S,T){var P,Q,R;if(!S[O]){return}P=S[O].elm;if(P!=M){R=h(P,"colspan");Q=h(P,"rowspan");if(R==1){if(!N){G.insertAfter(e(P),P);u(O,T,Q-1,R)}else{P.parentNode.insertBefore(e(P),P);u(O,T,Q-1,R)}}else{s(P,"colSpan",P.colSpan+1)}M=P}})}function n(){var M=[];d(f,function(N,O){d(N,function(Q,P){if(j(Q)&&c.inArray(M,P)===-1){d(f,function(T){var R=T[P].elm,S;S=h(R,"colSpan");if(S>1){s(R,"colSpan",S-1)}else{G.remove(R)}});M.push(P)}})});q()}function m(){var N;function M(Q){var P,R,O;P=G.getNext(Q,"tr");d(Q.cells,function(S){var T=h(S,"rowSpan");if(T>1){s(S,"rowSpan",T-1);R=F(S);u(R.x,R.y,1,1)}});R=F(Q.cells[0]);d(f[R.y],function(S){var T;S=S.elm;if(S!=O){T=h(S,"rowSpan");if(T<=1){G.remove(S)}else{s(S,"rowSpan",T-1)}O=S}})}N=k();d(N.reverse(),function(O){M(O)});q()}function E(){var M=k();G.remove(M);q();return M}function J(){var M=k();d(M,function(O,N){M[N]=A(O,true)});return M}function B(O,N){var P=k(),M=P[N?0:P.length-1],Q=M.cells.length;d(f,function(S){var R;Q=0;d(S,function(U,T){if(U.real){Q+=U.colspan}if(U.elm.parentNode==M){R=1}});if(R){return false}});if(!N){O.reverse()}d(O,function(T){var S=T.cells.length,R;for(i=0;iN){N=R}if(Q>M){M=Q}if(S.real){U=S.colspan-1;T=S.rowspan-1;if(U){if(R+U>N){N=R+U}}if(T){if(Q+T>M){M=Q+T}}}}})});return{x:N,y:M}}function v(S){var P,O,U,T,N,M,Q,R;D=F(S);if(L&&D){P=Math.min(L.x,D.x);O=Math.min(L.y,D.y);U=Math.max(L.x,D.x);T=Math.max(L.y,D.y);N=U;M=T;for(y=O;y<=M;y++){S=f[y][P];if(!S.real){if(P-(S.colspan-1)N){N=x+Q}}if(R){if(y+R>M){M=y+R}}}}}G.removeClass(G.select("td.mceSelected,th.mceSelected"),"mceSelected");for(y=O;y<=M;y++){for(x=P;x<=N;x++){if(f[y][x]){G.addClass(f[y][x].elm,"mceSelected")}}}}}c.extend(this,{deleteTable:r,split:C,merge:p,insertRow:l,insertCol:g,deleteCols:n,deleteRows:m,cutRows:E,copyRows:J,pasteRows:B,getPos:F,setStartCell:w,setEndCell:v})}c.create("tinymce.plugins.TablePlugin",{init:function(f,g){var e,l,h=true;function k(o){var n=f.selection,m=f.dom.getParent(o||n.getNode(),"table");if(m){return new a(m,f.dom,n)}}function j(){f.getBody().style.webkitUserSelect="";if(h){f.dom.removeClass(f.dom.select("td.mceSelected,th.mceSelected"),"mceSelected");h=false}}d([["table","table.desc","mceInsertTable",true],["delete_table","table.del","mceTableDelete"],["delete_col","table.delete_col_desc","mceTableDeleteCol"],["delete_row","table.delete_row_desc","mceTableDeleteRow"],["col_after","table.col_after_desc","mceTableInsertColAfter"],["col_before","table.col_before_desc","mceTableInsertColBefore"],["row_after","table.row_after_desc","mceTableInsertRowAfter"],["row_before","table.row_before_desc","mceTableInsertRowBefore"],["row_props","table.row_desc","mceTableRowProps",true],["cell_props","table.cell_desc","mceTableCellProps",true],["split_cells","table.split_cells_desc","mceTableSplitCells",true],["merge_cells","table.merge_cells_desc","mceTableMergeCells",true]],function(m){f.addButton(m[0],{title:m[1],cmd:m[2],ui:m[3]})});if(!c.isIE){f.onClick.add(function(m,n){n=n.target;if(n.nodeName==="TABLE"){m.selection.select(n);m.nodeChanged()}})}f.onPreProcess.add(function(n,o){var m,p,q,s=n.dom,r;m=s.select("table",o.node);p=m.length;while(p--){q=m[p];s.setAttrib(q,"data-mce-style","");if((r=s.getAttrib(q,"width"))){s.setStyle(q,"width",r);s.setAttrib(q,"width","")}if((r=s.getAttrib(q,"height"))){s.setStyle(q,"height",r);s.setAttrib(q,"height","")}}});f.onNodeChange.add(function(o,m,r){var q;r=o.selection.getStart();q=o.dom.getParent(r,"td,th,caption");m.setActive("table",r.nodeName==="TABLE"||!!q);if(q&&q.nodeName==="CAPTION"){q=0}m.setDisabled("delete_table",!q);m.setDisabled("delete_col",!q);m.setDisabled("delete_table",!q);m.setDisabled("delete_row",!q);m.setDisabled("col_after",!q);m.setDisabled("col_before",!q);m.setDisabled("row_after",!q);m.setDisabled("row_before",!q);m.setDisabled("row_props",!q);m.setDisabled("cell_props",!q);m.setDisabled("split_cells",!q);m.setDisabled("merge_cells",!q)});f.onInit.add(function(p){var m,s,t=p.dom,q;e=p.windowManager;p.onMouseDown.add(function(u,v){if(v.button!=2){j();s=t.getParent(v.target,"td,th");m=t.getParent(s,"table")}});t.bind(p.getDoc(),"mouseover",function(A){var w,v,z=A.target;if(s&&(q||z!=s)&&(z.nodeName=="TD"||z.nodeName=="TH")){v=t.getParent(z,"table");if(v==m){if(!q){q=k(v);q.setStartCell(s);p.getBody().style.webkitUserSelect="none"}q.setEndCell(z);h=true}w=p.selection.getSel();try{if(w.removeAllRanges){w.removeAllRanges()}else{w.empty()}}catch(u){}A.preventDefault()}});p.onMouseUp.add(function(D,E){var v,z=D.selection,F,G=z.getSel(),u,A,w,C;if(s){if(q){D.getBody().style.webkitUserSelect=""}function B(H,J){var I=new c.dom.TreeWalker(H,H);do{if(H.nodeType==3&&c.trim(H.nodeValue).length!=0){if(J){v.setStart(H,0)}else{v.setEnd(H,H.nodeValue.length)}return}if(H.nodeName=="BR"){if(J){v.setStartBefore(H)}else{v.setEndBefore(H)}return}}while(H=(J?I.next():I.prev()))}F=t.select("td.mceSelected,th.mceSelected");if(F.length>0){v=t.createRng();A=F[0];C=F[F.length-1];v.setStartBefore(A);v.setEndAfter(A);B(A,1);u=new c.dom.TreeWalker(A,t.getParent(F[0],"table"));do{if(A.nodeName=="TD"||A.nodeName=="TH"){if(!t.hasClass(A,"mceSelected")){break}w=A}}while(A=u.next());B(w);z.setRng(v)}D.nodeChanged();s=q=m=null}});p.onKeyUp.add(function(u,v){j()});p.onKeyDown.add(function(u,v){n(u)});p.onMouseDown.add(function(u,v){if(v.button!=2){n(u)}});function o(B,v,w,D){var z=3,E=B.dom.getParent(v.startContainer,"TABLE"),A,u,C;if(E){A=E.parentNode}u=v.startContainer.nodeType==z&&v.startOffset==0&&v.endOffset==0&&D&&(w.nodeName=="TR"||w==A);C=(w.nodeName=="TD"||w.nodeName=="TH")&&!D;return u||C}function n(w){if(!c.isWebKit){return}var v=w.selection.getRng();var A=w.selection.getNode();var z=w.dom.getParent(v.startContainer,"TD");if(!o(w,v,A,z)){return}if(!z){z=A}var u=z.lastChild;while(u.lastChild){u=u.lastChild}v.setEnd(u,u.nodeValue.length);w.selection.setRng(v)}p.plugins.table.fixTableCellSelection=n;if(p&&p.plugins.contextmenu){p.plugins.contextmenu.onContextMenu.add(function(w,u,A){var B,z=p.selection,v=z.getNode()||p.getBody();if(p.dom.getParent(A,"td")||p.dom.getParent(A,"th")||p.dom.select("td.mceSelected,th.mceSelected").length){u.removeAll();if(v.nodeName=="A"&&!p.dom.getAttrib(v,"name")){u.add({title:"advanced.link_desc",icon:"link",cmd:p.plugins.advlink?"mceAdvLink":"mceLink",ui:true});u.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"});u.addSeparator()}if(v.nodeName=="IMG"&&v.className.indexOf("mceItem")==-1){u.add({title:"advanced.image_desc",icon:"image",cmd:p.plugins.advimage?"mceAdvImage":"mceImage",ui:true});u.addSeparator()}u.add({title:"table.desc",icon:"table",cmd:"mceInsertTable",value:{action:"insert"}});u.add({title:"table.props_desc",icon:"table_props",cmd:"mceInsertTable"});u.add({title:"table.del",icon:"delete_table",cmd:"mceTableDelete"});u.addSeparator();B=u.addMenu({title:"table.cell"});B.add({title:"table.cell_desc",icon:"cell_props",cmd:"mceTableCellProps"});B.add({title:"table.split_cells_desc",icon:"split_cells",cmd:"mceTableSplitCells"});B.add({title:"table.merge_cells_desc",icon:"merge_cells",cmd:"mceTableMergeCells"});B=u.addMenu({title:"table.row"});B.add({title:"table.row_desc",icon:"row_props",cmd:"mceTableRowProps"});B.add({title:"table.row_before_desc",icon:"row_before",cmd:"mceTableInsertRowBefore"});B.add({title:"table.row_after_desc",icon:"row_after",cmd:"mceTableInsertRowAfter"});B.add({title:"table.delete_row_desc",icon:"delete_row",cmd:"mceTableDeleteRow"});B.addSeparator();B.add({title:"table.cut_row_desc",icon:"cut",cmd:"mceTableCutRow"});B.add({title:"table.copy_row_desc",icon:"copy",cmd:"mceTableCopyRow"});B.add({title:"table.paste_row_before_desc",icon:"paste",cmd:"mceTablePasteRowBefore"}).setDisabled(!l);B.add({title:"table.paste_row_after_desc",icon:"paste",cmd:"mceTablePasteRowAfter"}).setDisabled(!l);B=u.addMenu({title:"table.col"});B.add({title:"table.col_before_desc",icon:"col_before",cmd:"mceTableInsertColBefore"});B.add({title:"table.col_after_desc",icon:"col_after",cmd:"mceTableInsertColAfter"});B.add({title:"table.delete_col_desc",icon:"delete_col",cmd:"mceTableDeleteCol"})}else{u.add({title:"table.desc",icon:"table",cmd:"mceInsertTable"})}})}if(!c.isIE){function r(){var u;for(u=p.getBody().lastChild;u&&u.nodeType==3&&!u.nodeValue.length;u=u.previousSibling){}if(u&&u.nodeName=="TABLE"){p.dom.add(p.getBody(),"p",null,'
')}}if(c.isGecko){p.onKeyDown.add(function(v,z){var u,w,A=v.dom;if(z.keyCode==37||z.keyCode==38){u=v.selection.getRng();w=A.getParent(u.startContainer,"table");if(w&&v.getBody().firstChild==w){if(b(u,w)){u=A.createRng();u.setStartBefore(w);u.setEndBefore(w);v.selection.setRng(u);z.preventDefault()}}}})}p.onKeyUp.add(r);p.onSetContent.add(r);p.onVisualAid.add(r);p.onPreProcess.add(function(u,w){var v=w.node.lastChild;if(v&&v.childNodes.length==1&&v.firstChild.nodeName=="BR"){u.dom.remove(v)}});r()}});d({mceTableSplitCells:function(m){m.split()},mceTableMergeCells:function(n){var o,p,m;m=f.dom.getParent(f.selection.getNode(),"th,td");if(m){o=m.rowSpan;p=m.colSpan}if(!f.dom.select("td.mceSelected,th.mceSelected").length){e.open({url:g+"/merge_cells.htm",width:240+parseInt(f.getLang("table.merge_cells_delta_width",0)),height:110+parseInt(f.getLang("table.merge_cells_delta_height",0)),inline:1},{rows:o,cols:p,onaction:function(q){n.merge(m,q.cols,q.rows)},plugin_url:g})}else{n.merge()}},mceTableInsertRowBefore:function(m){m.insertRow(true)},mceTableInsertRowAfter:function(m){m.insertRow()},mceTableInsertColBefore:function(m){m.insertCol(true)},mceTableInsertColAfter:function(m){m.insertCol()},mceTableDeleteCol:function(m){m.deleteCols()},mceTableDeleteRow:function(m){m.deleteRows()},mceTableCutRow:function(m){l=m.cutRows()},mceTableCopyRow:function(m){l=m.copyRows()},mceTablePasteRowBefore:function(m){m.pasteRows(l,true)},mceTablePasteRowAfter:function(m){m.pasteRows(l)},mceTableDelete:function(m){m.deleteTable()}},function(n,m){f.addCommand(m,function(){var o=k();if(o){n(o);f.execCommand("mceRepaint");j()}})});d({mceInsertTable:function(m){e.open({url:g+"/table.htm",width:400+parseInt(f.getLang("table.table_delta_width",0)),height:320+parseInt(f.getLang("table.table_delta_height",0)),inline:1},{plugin_url:g,action:m?m.action:0})},mceTableRowProps:function(){e.open({url:g+"/row.htm",width:400+parseInt(f.getLang("table.rowprops_delta_width",0)),height:295+parseInt(f.getLang("table.rowprops_delta_height",0)),inline:1},{plugin_url:g})},mceTableCellProps:function(){e.open({url:g+"/cell.htm",width:400+parseInt(f.getLang("table.cellprops_delta_width",0)),height:295+parseInt(f.getLang("table.cellprops_delta_height",0)),inline:1},{plugin_url:g})}},function(n,m){f.addCommand(m,function(o,p){n(p)})})}});c.PluginManager.add("table",c.plugins.TablePlugin)})(tinymce); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/table/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/table/editor_plugin_src.js deleted file mode 100644 index 5059cfd24..000000000 --- a/www/javascript/tiny_mce/plugins/table/editor_plugin_src.js +++ /dev/null @@ -1,1263 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var each = tinymce.each; - - // Checks if the selection/caret is at the start of the specified block element - function isAtStart(rng, par) { - var doc = par.ownerDocument, rng2 = doc.createRange(), elm; - - rng2.setStartBefore(par); - rng2.setEnd(rng.endContainer, rng.endOffset); - - elm = doc.createElement('body'); - elm.appendChild(rng2.cloneContents()); - - // Check for text characters of other elements that should be treated as content - return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0; - }; - - /** - * Table Grid class. - */ - function TableGrid(table, dom, selection) { - var grid, startPos, endPos, selectedCell; - - buildGrid(); - selectedCell = dom.getParent(selection.getStart(), 'th,td'); - if (selectedCell) { - startPos = getPos(selectedCell); - endPos = findEndPos(); - selectedCell = getCell(startPos.x, startPos.y); - } - - function cloneNode(node, children) { - node = node.cloneNode(children); - node.removeAttribute('id'); - - return node; - } - - function buildGrid() { - var startY = 0; - - grid = []; - - each(['thead', 'tbody', 'tfoot'], function(part) { - var rows = dom.select('> ' + part + ' tr', table); - - each(rows, function(tr, y) { - y += startY; - - each(dom.select('> td, > th', tr), function(td, x) { - var x2, y2, rowspan, colspan; - - // Skip over existing cells produced by rowspan - if (grid[y]) { - while (grid[y][x]) - x++; - } - - // Get col/rowspan from cell - rowspan = getSpanVal(td, 'rowspan'); - colspan = getSpanVal(td, 'colspan'); - - // Fill out rowspan/colspan right and down - for (y2 = y; y2 < y + rowspan; y2++) { - if (!grid[y2]) - grid[y2] = []; - - for (x2 = x; x2 < x + colspan; x2++) { - grid[y2][x2] = { - part : part, - real : y2 == y && x2 == x, - elm : td, - rowspan : rowspan, - colspan : colspan - }; - } - } - }); - }); - - startY += rows.length; - }); - }; - - function getCell(x, y) { - var row; - - row = grid[y]; - if (row) - return row[x]; - }; - - function getSpanVal(td, name) { - return parseInt(td.getAttribute(name) || 1); - }; - - function setSpanVal(td, name, val) { - if (td) { - val = parseInt(val); - - if (val === 1) - td.removeAttribute(name, 1); - else - td.setAttribute(name, val, 1); - } - } - - function isCellSelected(cell) { - return cell && (dom.hasClass(cell.elm, 'mceSelected') || cell == selectedCell); - }; - - function getSelectedRows() { - var rows = []; - - each(table.rows, function(row) { - each(row.cells, function(cell) { - if (dom.hasClass(cell, 'mceSelected') || cell == selectedCell.elm) { - rows.push(row); - return false; - } - }); - }); - - return rows; - }; - - function deleteTable() { - var rng = dom.createRng(); - - rng.setStartAfter(table); - rng.setEndAfter(table); - - selection.setRng(rng); - - dom.remove(table); - }; - - function cloneCell(cell) { - var formatNode; - - // Clone formats - tinymce.walk(cell, function(node) { - var curNode; - - if (node.nodeType == 3) { - each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { - node = cloneNode(node, false); - - if (!formatNode) - formatNode = curNode = node; - else if (curNode) - curNode.appendChild(node); - - curNode = node; - }); - - // Add something to the inner node - if (curNode) - curNode.innerHTML = tinymce.isIE ? ' ' : '
'; - - return false; - } - }, 'childNodes'); - - cell = cloneNode(cell, false); - setSpanVal(cell, 'rowSpan', 1); - setSpanVal(cell, 'colSpan', 1); - - if (formatNode) { - cell.appendChild(formatNode); - } else { - if (!tinymce.isIE) - cell.innerHTML = '
'; - } - - return cell; - }; - - function cleanup() { - var rng = dom.createRng(); - - // Empty rows - each(dom.select('tr', table), function(tr) { - if (tr.cells.length == 0) - dom.remove(tr); - }); - - // Empty table - if (dom.select('tr', table).length == 0) { - rng.setStartAfter(table); - rng.setEndAfter(table); - selection.setRng(rng); - dom.remove(table); - return; - } - - // Empty header/body/footer - each(dom.select('thead,tbody,tfoot', table), function(part) { - if (part.rows.length == 0) - dom.remove(part); - }); - - // Restore selection to start position if it still exists - buildGrid(); - - // Restore the selection to the closest table position - row = grid[Math.min(grid.length - 1, startPos.y)]; - if (row) { - selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); - selection.collapse(true); - } - }; - - function fillLeftDown(x, y, rows, cols) { - var tr, x2, r, c, cell; - - tr = grid[y][x].elm.parentNode; - for (r = 1; r <= rows; r++) { - tr = dom.getNext(tr, 'tr'); - - if (tr) { - // Loop left to find real cell - for (x2 = x; x2 >= 0; x2--) { - cell = grid[y + r][x2].elm; - - if (cell.parentNode == tr) { - // Append clones after - for (c = 1; c <= cols; c++) - dom.insertAfter(cloneCell(cell), cell); - - break; - } - } - - if (x2 == -1) { - // Insert nodes before first cell - for (c = 1; c <= cols; c++) - tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); - } - } - } - }; - - function split() { - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan, newCell, i; - - if (isCellSelected(cell)) { - cell = cell.elm; - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan > 1 || rowSpan > 1) { - setSpanVal(cell, 'rowSpan', 1); - setSpanVal(cell, 'colSpan', 1); - - // Insert cells right - for (i = 0; i < colSpan - 1; i++) - dom.insertAfter(cloneCell(cell), cell); - - fillLeftDown(x, y, rowSpan - 1, colSpan); - } - } - }); - }); - }; - - function merge(cell, cols, rows) { - var startX, startY, endX, endY, x, y, startCell, endCell, cell, children, count; - - // Use specified cell and cols/rows - if (cell) { - pos = getPos(cell); - startX = pos.x; - startY = pos.y; - endX = startX + (cols - 1); - endY = startY + (rows - 1); - } else { - // Use selection - startX = startPos.x; - startY = startPos.y; - endX = endPos.x; - endY = endPos.y; - } - - // Find start/end cells - startCell = getCell(startX, startY); - endCell = getCell(endX, endY); - - // Check if the cells exists and if they are of the same part for example tbody = tbody - if (startCell && endCell && startCell.part == endCell.part) { - // Split and rebuild grid - split(); - buildGrid(); - - // Set row/col span to start cell - startCell = getCell(startX, startY).elm; - setSpanVal(startCell, 'colSpan', (endX - startX) + 1); - setSpanVal(startCell, 'rowSpan', (endY - startY) + 1); - - // Remove other cells and add it's contents to the start cell - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - if (!grid[y] || !grid[y][x]) - continue; - - cell = grid[y][x].elm; - - if (cell != startCell) { - // Move children to startCell - children = tinymce.grep(cell.childNodes); - each(children, function(node) { - startCell.appendChild(node); - }); - - // Remove bogus nodes if there is children in the target cell - if (children.length) { - children = tinymce.grep(startCell.childNodes); - count = 0; - each(children, function(node) { - if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) - startCell.removeChild(node); - }); - } - - // Remove cell - dom.remove(cell); - } - } - } - - // Remove empty rows etc and restore caret location - cleanup(); - } - }; - - function insertRow(before) { - var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; - - // Find first/last row - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - cell = cell.elm; - rowElm = cell.parentNode; - newRow = cloneNode(rowElm, false); - posY = y; - - if (before) - return false; - } - }); - - if (before) - return !posY; - }); - - for (x = 0; x < grid[0].length; x++) { - // Cell not found could be because of an invalid table structure - if (!grid[posY][x]) - continue; - - cell = grid[posY][x].elm; - - if (cell != lastCell) { - if (!before) { - rowSpan = getSpanVal(cell, 'rowspan'); - if (rowSpan > 1) { - setSpanVal(cell, 'rowSpan', rowSpan + 1); - continue; - } - } else { - // Check if cell above can be expanded - if (posY > 0 && grid[posY - 1][x]) { - otherCell = grid[posY - 1][x].elm; - rowSpan = getSpanVal(otherCell, 'rowSpan'); - if (rowSpan > 1) { - setSpanVal(otherCell, 'rowSpan', rowSpan + 1); - continue; - } - } - } - - // Insert new cell into new row - newCell = cloneCell(cell); - setSpanVal(newCell, 'colSpan', cell.colSpan); - - newRow.appendChild(newCell); - - lastCell = cell; - } - } - - if (newRow.hasChildNodes()) { - if (!before) - dom.insertAfter(newRow, rowElm); - else - rowElm.parentNode.insertBefore(newRow, rowElm); - } - }; - - function insertCol(before) { - var posX, lastCell; - - // Find first/last column - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - posX = x; - - if (before) - return false; - } - }); - - if (before) - return !posX; - }); - - each(grid, function(row, y) { - var cell, rowSpan, colSpan; - - if (!row[posX]) - return; - - cell = row[posX].elm; - if (cell != lastCell) { - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan == 1) { - if (!before) { - dom.insertAfter(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } else { - cell.parentNode.insertBefore(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } - } else - setSpanVal(cell, 'colSpan', cell.colSpan + 1); - - lastCell = cell; - } - }); - }; - - function deleteCols() { - var cols = []; - - // Get selected column indexes - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell) && tinymce.inArray(cols, x) === -1) { - each(grid, function(row) { - var cell = row[x].elm, colSpan; - - colSpan = getSpanVal(cell, 'colSpan'); - - if (colSpan > 1) - setSpanVal(cell, 'colSpan', colSpan - 1); - else - dom.remove(cell); - }); - - cols.push(x); - } - }); - }); - - cleanup(); - }; - - function deleteRows() { - var rows; - - function deleteRow(tr) { - var nextTr, pos, lastCell; - - nextTr = dom.getNext(tr, 'tr'); - - // Move down row spanned cells - each(tr.cells, function(cell) { - var rowSpan = getSpanVal(cell, 'rowSpan'); - - if (rowSpan > 1) { - setSpanVal(cell, 'rowSpan', rowSpan - 1); - pos = getPos(cell); - fillLeftDown(pos.x, pos.y, 1, 1); - } - }); - - // Delete cells - pos = getPos(tr.cells[0]); - each(grid[pos.y], function(cell) { - var rowSpan; - - cell = cell.elm; - - if (cell != lastCell) { - rowSpan = getSpanVal(cell, 'rowSpan'); - - if (rowSpan <= 1) - dom.remove(cell); - else - setSpanVal(cell, 'rowSpan', rowSpan - 1); - - lastCell = cell; - } - }); - }; - - // Get selected rows and move selection out of scope - rows = getSelectedRows(); - - // Delete all selected rows - each(rows.reverse(), function(tr) { - deleteRow(tr); - }); - - cleanup(); - }; - - function cutRows() { - var rows = getSelectedRows(); - - dom.remove(rows); - cleanup(); - - return rows; - }; - - function copyRows() { - var rows = getSelectedRows(); - - each(rows, function(row, i) { - rows[i] = cloneNode(row, true); - }); - - return rows; - }; - - function pasteRows(rows, before) { - var selectedRows = getSelectedRows(), - targetRow = selectedRows[before ? 0 : selectedRows.length - 1], - targetCellCount = targetRow.cells.length; - - // Calc target cell count - each(grid, function(row) { - var match; - - targetCellCount = 0; - each(row, function(cell, x) { - if (cell.real) - targetCellCount += cell.colspan; - - if (cell.elm.parentNode == targetRow) - match = 1; - }); - - if (match) - return false; - }); - - if (!before) - rows.reverse(); - - each(rows, function(row) { - var cellCount = row.cells.length, cell; - - // Remove col/rowspans - for (i = 0; i < cellCount; i++) { - cell = row.cells[i]; - setSpanVal(cell, 'colSpan', 1); - setSpanVal(cell, 'rowSpan', 1); - } - - // Needs more cells - for (i = cellCount; i < targetCellCount; i++) - row.appendChild(cloneCell(row.cells[cellCount - 1])); - - // Needs less cells - for (i = targetCellCount; i < cellCount; i++) - dom.remove(row.cells[i]); - - // Add before/after - if (before) - targetRow.parentNode.insertBefore(row, targetRow); - else - dom.insertAfter(row, targetRow); - }); - }; - - function getPos(target) { - var pos; - - each(grid, function(row, y) { - each(row, function(cell, x) { - if (cell.elm == target) { - pos = {x : x, y : y}; - return false; - } - }); - - return !pos; - }); - - return pos; - }; - - function setStartCell(cell) { - startPos = getPos(cell); - }; - - function findEndPos() { - var pos, maxX, maxY; - - maxX = maxY = 0; - - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan; - - if (isCellSelected(cell)) { - cell = grid[y][x]; - - if (x > maxX) - maxX = x; - - if (y > maxY) - maxY = y; - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) - maxX = x + colSpan; - } - - if (rowSpan) { - if (y + rowSpan > maxY) - maxY = y + rowSpan; - } - } - } - }); - }); - - return {x : maxX, y : maxY}; - }; - - function setEndCell(cell) { - var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan; - - endPos = getPos(cell); - - if (startPos && endPos) { - // Get start/end positions - startX = Math.min(startPos.x, endPos.x); - startY = Math.min(startPos.y, endPos.y); - endX = Math.max(startPos.x, endPos.x); - endY = Math.max(startPos.y, endPos.y); - - // Expand end positon to include spans - maxX = endX; - maxY = endY; - - // Expand startX - for (y = startY; y <= maxY; y++) { - cell = grid[y][startX]; - - if (!cell.real) { - if (startX - (cell.colspan - 1) < startX) - startX -= cell.colspan - 1; - } - } - - // Expand startY - for (x = startX; x <= maxX; x++) { - cell = grid[startY][x]; - - if (!cell.real) { - if (startY - (cell.rowspan - 1) < startY) - startY -= cell.rowspan - 1; - } - } - - // Find max X, Y - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - cell = grid[y][x]; - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) - maxX = x + colSpan; - } - - if (rowSpan) { - if (y + rowSpan > maxY) - maxY = y + rowSpan; - } - } - } - } - - // Remove current selection - dom.removeClass(dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); - - // Add new selection - for (y = startY; y <= maxY; y++) { - for (x = startX; x <= maxX; x++) { - if (grid[y][x]) - dom.addClass(grid[y][x].elm, 'mceSelected'); - } - } - } - }; - - // Expose to public - tinymce.extend(this, { - deleteTable : deleteTable, - split : split, - merge : merge, - insertRow : insertRow, - insertCol : insertCol, - deleteCols : deleteCols, - deleteRows : deleteRows, - cutRows : cutRows, - copyRows : copyRows, - pasteRows : pasteRows, - getPos : getPos, - setStartCell : setStartCell, - setEndCell : setEndCell - }); - }; - - tinymce.create('tinymce.plugins.TablePlugin', { - init : function(ed, url) { - var winMan, clipboardRows, hasCellSelection = true; // Might be selected cells on reload - - function createTableGrid(node) { - var selection = ed.selection, tblElm = ed.dom.getParent(node || selection.getNode(), 'table'); - - if (tblElm) - return new TableGrid(tblElm, ed.dom, selection); - }; - - function cleanup() { - // Restore selection possibilities - ed.getBody().style.webkitUserSelect = ''; - - if (hasCellSelection) { - ed.dom.removeClass(ed.dom.select('td.mceSelected,th.mceSelected'), 'mceSelected'); - hasCellSelection = false; - } - }; - - // Register buttons - each([ - ['table', 'table.desc', 'mceInsertTable', true], - ['delete_table', 'table.del', 'mceTableDelete'], - ['delete_col', 'table.delete_col_desc', 'mceTableDeleteCol'], - ['delete_row', 'table.delete_row_desc', 'mceTableDeleteRow'], - ['col_after', 'table.col_after_desc', 'mceTableInsertColAfter'], - ['col_before', 'table.col_before_desc', 'mceTableInsertColBefore'], - ['row_after', 'table.row_after_desc', 'mceTableInsertRowAfter'], - ['row_before', 'table.row_before_desc', 'mceTableInsertRowBefore'], - ['row_props', 'table.row_desc', 'mceTableRowProps', true], - ['cell_props', 'table.cell_desc', 'mceTableCellProps', true], - ['split_cells', 'table.split_cells_desc', 'mceTableSplitCells', true], - ['merge_cells', 'table.merge_cells_desc', 'mceTableMergeCells', true] - ], function(c) { - ed.addButton(c[0], {title : c[1], cmd : c[2], ui : c[3]}); - }); - - // Select whole table is a table border is clicked - if (!tinymce.isIE) { - ed.onClick.add(function(ed, e) { - e = e.target; - - if (e.nodeName === 'TABLE') { - ed.selection.select(e); - ed.nodeChanged(); - } - }); - } - - ed.onPreProcess.add(function(ed, args) { - var nodes, i, node, dom = ed.dom, value; - - nodes = dom.select('table', args.node); - i = nodes.length; - while (i--) { - node = nodes[i]; - dom.setAttrib(node, 'data-mce-style', ''); - - if ((value = dom.getAttrib(node, 'width'))) { - dom.setStyle(node, 'width', value); - dom.setAttrib(node, 'width', ''); - } - - if ((value = dom.getAttrib(node, 'height'))) { - dom.setStyle(node, 'height', value); - dom.setAttrib(node, 'height', ''); - } - } - }); - - // Handle node change updates - ed.onNodeChange.add(function(ed, cm, n) { - var p; - - n = ed.selection.getStart(); - p = ed.dom.getParent(n, 'td,th,caption'); - cm.setActive('table', n.nodeName === 'TABLE' || !!p); - - // Disable table tools if we are in caption - if (p && p.nodeName === 'CAPTION') - p = 0; - - cm.setDisabled('delete_table', !p); - cm.setDisabled('delete_col', !p); - cm.setDisabled('delete_table', !p); - cm.setDisabled('delete_row', !p); - cm.setDisabled('col_after', !p); - cm.setDisabled('col_before', !p); - cm.setDisabled('row_after', !p); - cm.setDisabled('row_before', !p); - cm.setDisabled('row_props', !p); - cm.setDisabled('cell_props', !p); - cm.setDisabled('split_cells', !p); - cm.setDisabled('merge_cells', !p); - }); - - ed.onInit.add(function(ed) { - var startTable, startCell, dom = ed.dom, tableGrid; - - winMan = ed.windowManager; - - // Add cell selection logic - ed.onMouseDown.add(function(ed, e) { - if (e.button != 2) { - cleanup(); - - startCell = dom.getParent(e.target, 'td,th'); - startTable = dom.getParent(startCell, 'table'); - } - }); - - dom.bind(ed.getDoc(), 'mouseover', function(e) { - var sel, table, target = e.target; - - if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { - table = dom.getParent(target, 'table'); - if (table == startTable) { - if (!tableGrid) { - tableGrid = createTableGrid(table); - tableGrid.setStartCell(startCell); - - ed.getBody().style.webkitUserSelect = 'none'; - } - - tableGrid.setEndCell(target); - hasCellSelection = true; - } - - // Remove current selection - sel = ed.selection.getSel(); - - try { - if (sel.removeAllRanges) - sel.removeAllRanges(); - else - sel.empty(); - } catch (ex) { - // IE9 might throw errors here - } - - e.preventDefault(); - } - }); - - ed.onMouseUp.add(function(ed, e) { - var rng, sel = ed.selection, selectedCells, nativeSel = sel.getSel(), walker, node, lastNode, endNode; - - // Move selection to startCell - if (startCell) { - if (tableGrid) - ed.getBody().style.webkitUserSelect = ''; - - function setPoint(node, start) { - var walker = new tinymce.dom.TreeWalker(node, node); - - do { - // Text node - if (node.nodeType == 3 && tinymce.trim(node.nodeValue).length != 0) { - if (start) - rng.setStart(node, 0); - else - rng.setEnd(node, node.nodeValue.length); - - return; - } - - // BR element - if (node.nodeName == 'BR') { - if (start) - rng.setStartBefore(node); - else - rng.setEndBefore(node); - - return; - } - } while (node = (start ? walker.next() : walker.prev())); - } - - // Try to expand text selection as much as we can only Gecko supports cell selection - selectedCells = dom.select('td.mceSelected,th.mceSelected'); - if (selectedCells.length > 0) { - rng = dom.createRng(); - node = selectedCells[0]; - endNode = selectedCells[selectedCells.length - 1]; - rng.setStartBefore(node); - rng.setEndAfter(node); - - setPoint(node, 1); - walker = new tinymce.dom.TreeWalker(node, dom.getParent(selectedCells[0], 'table')); - - do { - if (node.nodeName == 'TD' || node.nodeName == 'TH') { - if (!dom.hasClass(node, 'mceSelected')) - break; - - lastNode = node; - } - } while (node = walker.next()); - - setPoint(lastNode); - - sel.setRng(rng); - } - - ed.nodeChanged(); - startCell = tableGrid = startTable = null; - } - }); - - ed.onKeyUp.add(function(ed, e) { - cleanup(); - }); - - ed.onKeyDown.add(function (ed, e) { - fixTableCellSelection(ed); - }); - - ed.onMouseDown.add(function (ed, e) { - if (e.button != 2) { - fixTableCellSelection(ed); - } - }); - function tableCellSelected(ed, rng, n, currentCell) { - // The decision of when a table cell is selected is somewhat involved. The fact that this code is - // required is actually a pointer to the root cause of this bug. A cell is selected when the start - // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases) - // or the parent of the table (in the case of the selection containing the last cell of a table). - var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'), - tableParent, allOfCellSelected, tableCellSelection; - if (table) - tableParent = table.parentNode; - allOfCellSelected =rng.startContainer.nodeType == TEXT_NODE && - rng.startOffset == 0 && - rng.endOffset == 0 && - currentCell && - (n.nodeName=="TR" || n==tableParent); - tableCellSelection = (n.nodeName=="TD"||n.nodeName=="TH")&& !currentCell; - return allOfCellSelected || tableCellSelection; - // return false; - } - - // this nasty hack is here to work around some WebKit selection bugs. - function fixTableCellSelection(ed) { - if (!tinymce.isWebKit) - return; - - var rng = ed.selection.getRng(); - var n = ed.selection.getNode(); - var currentCell = ed.dom.getParent(rng.startContainer, 'TD'); - - if (!tableCellSelected(ed, rng, n, currentCell)) - return; - if (!currentCell) { - currentCell=n; - } - - // Get the very last node inside the table cell - var end = currentCell.lastChild; - while (end.lastChild) - end = end.lastChild; - - // Select the entire table cell. Nothing outside of the table cell should be selected. - rng.setEnd(end, end.nodeValue.length); - ed.selection.setRng(rng); - } - ed.plugins.table.fixTableCellSelection=fixTableCellSelection; - - // Add context menu - if (ed && ed.plugins.contextmenu) { - ed.plugins.contextmenu.onContextMenu.add(function(th, m, e) { - var sm, se = ed.selection, el = se.getNode() || ed.getBody(); - - if (ed.dom.getParent(e, 'td') || ed.dom.getParent(e, 'th') || ed.dom.select('td.mceSelected,th.mceSelected').length) { - m.removeAll(); - - if (el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) { - m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true}); - m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'}); - m.addSeparator(); - } - - if (el.nodeName == 'IMG' && el.className.indexOf('mceItem') == -1) { - m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true}); - m.addSeparator(); - } - - m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable', value : {action : 'insert'}}); - m.add({title : 'table.props_desc', icon : 'table_props', cmd : 'mceInsertTable'}); - m.add({title : 'table.del', icon : 'delete_table', cmd : 'mceTableDelete'}); - m.addSeparator(); - - // Cell menu - sm = m.addMenu({title : 'table.cell'}); - sm.add({title : 'table.cell_desc', icon : 'cell_props', cmd : 'mceTableCellProps'}); - sm.add({title : 'table.split_cells_desc', icon : 'split_cells', cmd : 'mceTableSplitCells'}); - sm.add({title : 'table.merge_cells_desc', icon : 'merge_cells', cmd : 'mceTableMergeCells'}); - - // Row menu - sm = m.addMenu({title : 'table.row'}); - sm.add({title : 'table.row_desc', icon : 'row_props', cmd : 'mceTableRowProps'}); - sm.add({title : 'table.row_before_desc', icon : 'row_before', cmd : 'mceTableInsertRowBefore'}); - sm.add({title : 'table.row_after_desc', icon : 'row_after', cmd : 'mceTableInsertRowAfter'}); - sm.add({title : 'table.delete_row_desc', icon : 'delete_row', cmd : 'mceTableDeleteRow'}); - sm.addSeparator(); - sm.add({title : 'table.cut_row_desc', icon : 'cut', cmd : 'mceTableCutRow'}); - sm.add({title : 'table.copy_row_desc', icon : 'copy', cmd : 'mceTableCopyRow'}); - sm.add({title : 'table.paste_row_before_desc', icon : 'paste', cmd : 'mceTablePasteRowBefore'}).setDisabled(!clipboardRows); - sm.add({title : 'table.paste_row_after_desc', icon : 'paste', cmd : 'mceTablePasteRowAfter'}).setDisabled(!clipboardRows); - - // Column menu - sm = m.addMenu({title : 'table.col'}); - sm.add({title : 'table.col_before_desc', icon : 'col_before', cmd : 'mceTableInsertColBefore'}); - sm.add({title : 'table.col_after_desc', icon : 'col_after', cmd : 'mceTableInsertColAfter'}); - sm.add({title : 'table.delete_col_desc', icon : 'delete_col', cmd : 'mceTableDeleteCol'}); - } else - m.add({title : 'table.desc', icon : 'table', cmd : 'mceInsertTable'}); - }); - } - - // Fixes an issue on Gecko where it's impossible to place the caret behind a table - // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled - if (!tinymce.isIE) { - function fixTableCaretPos() { - var last; - - // Skip empty text nodes form the end - for (last = ed.getBody().lastChild; last && last.nodeType == 3 && !last.nodeValue.length; last = last.previousSibling) ; - - if (last && last.nodeName == 'TABLE') - ed.dom.add(ed.getBody(), 'p', null, '
'); - }; - - // Fixes an bug where it's impossible to place the caret before a table in Gecko - // this fix solves it by detecting when the caret is at the beginning of such a table - // and then manually moves the caret infront of the table - if (tinymce.isGecko) { - ed.onKeyDown.add(function(ed, e) { - var rng, table, dom = ed.dom; - - // On gecko it's not possible to place the caret before a table - if (e.keyCode == 37 || e.keyCode == 38) { - rng = ed.selection.getRng(); - table = dom.getParent(rng.startContainer, 'table'); - - if (table && ed.getBody().firstChild == table) { - if (isAtStart(rng, table)) { - rng = dom.createRng(); - - rng.setStartBefore(table); - rng.setEndBefore(table); - - ed.selection.setRng(rng); - - e.preventDefault(); - } - } - } - }); - } - - ed.onKeyUp.add(fixTableCaretPos); - ed.onSetContent.add(fixTableCaretPos); - ed.onVisualAid.add(fixTableCaretPos); - - ed.onPreProcess.add(function(ed, o) { - var last = o.node.lastChild; - - if (last && last.childNodes.length == 1 && last.firstChild.nodeName == 'BR') - ed.dom.remove(last); - }); - - fixTableCaretPos(); - } - }); - - // Register action commands - each({ - mceTableSplitCells : function(grid) { - grid.split(); - }, - - mceTableMergeCells : function(grid) { - var rowSpan, colSpan, cell; - - cell = ed.dom.getParent(ed.selection.getNode(), 'th,td'); - if (cell) { - rowSpan = cell.rowSpan; - colSpan = cell.colSpan; - } - - if (!ed.dom.select('td.mceSelected,th.mceSelected').length) { - winMan.open({ - url : url + '/merge_cells.htm', - width : 240 + parseInt(ed.getLang('table.merge_cells_delta_width', 0)), - height : 110 + parseInt(ed.getLang('table.merge_cells_delta_height', 0)), - inline : 1 - }, { - rows : rowSpan, - cols : colSpan, - onaction : function(data) { - grid.merge(cell, data.cols, data.rows); - }, - plugin_url : url - }); - } else - grid.merge(); - }, - - mceTableInsertRowBefore : function(grid) { - grid.insertRow(true); - }, - - mceTableInsertRowAfter : function(grid) { - grid.insertRow(); - }, - - mceTableInsertColBefore : function(grid) { - grid.insertCol(true); - }, - - mceTableInsertColAfter : function(grid) { - grid.insertCol(); - }, - - mceTableDeleteCol : function(grid) { - grid.deleteCols(); - }, - - mceTableDeleteRow : function(grid) { - grid.deleteRows(); - }, - - mceTableCutRow : function(grid) { - clipboardRows = grid.cutRows(); - }, - - mceTableCopyRow : function(grid) { - clipboardRows = grid.copyRows(); - }, - - mceTablePasteRowBefore : function(grid) { - grid.pasteRows(clipboardRows, true); - }, - - mceTablePasteRowAfter : function(grid) { - grid.pasteRows(clipboardRows); - }, - - mceTableDelete : function(grid) { - grid.deleteTable(); - } - }, function(func, name) { - ed.addCommand(name, function() { - var grid = createTableGrid(); - - if (grid) { - func(grid); - ed.execCommand('mceRepaint'); - cleanup(); - } - }); - }); - - // Register dialog commands - each({ - mceInsertTable : function(val) { - winMan.open({ - url : url + '/table.htm', - width : 400 + parseInt(ed.getLang('table.table_delta_width', 0)), - height : 320 + parseInt(ed.getLang('table.table_delta_height', 0)), - inline : 1 - }, { - plugin_url : url, - action : val ? val.action : 0 - }); - }, - - mceTableRowProps : function() { - winMan.open({ - url : url + '/row.htm', - width : 400 + parseInt(ed.getLang('table.rowprops_delta_width', 0)), - height : 295 + parseInt(ed.getLang('table.rowprops_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }, - - mceTableCellProps : function() { - winMan.open({ - url : url + '/cell.htm', - width : 400 + parseInt(ed.getLang('table.cellprops_delta_width', 0)), - height : 295 + parseInt(ed.getLang('table.cellprops_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - } - }, function(func, name) { - ed.addCommand(name, function(ui, val) { - func(val); - }); - }); - } - }); - - // Register plugin - tinymce.PluginManager.add('table', tinymce.plugins.TablePlugin); -})(tinymce); diff --git a/www/javascript/tiny_mce/plugins/table/js/cell.js b/www/javascript/tiny_mce/plugins/table/js/cell.js deleted file mode 100644 index d6f329059..000000000 --- a/www/javascript/tiny_mce/plugins/table/js/cell.js +++ /dev/null @@ -1,319 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var ed; - -function init() { - ed = tinyMCEPopup.editor; - tinyMCEPopup.resizeToInnerSize(); - - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') - - var inst = ed; - var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th"); - var formObj = document.forms[0]; - var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); - - // Get table cell data - var celltype = tdElm.nodeName.toLowerCase(); - var align = ed.dom.getAttrib(tdElm, 'align'); - var valign = ed.dom.getAttrib(tdElm, 'valign'); - var width = trimSize(getStyle(tdElm, 'width', 'width')); - var height = trimSize(getStyle(tdElm, 'height', 'height')); - var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); - var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); - var className = ed.dom.getAttrib(tdElm, 'class'); - var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - var id = ed.dom.getAttrib(tdElm, 'id'); - var lang = ed.dom.getAttrib(tdElm, 'lang'); - var dir = ed.dom.getAttrib(tdElm, 'dir'); - var scope = ed.dom.getAttrib(tdElm, 'scope'); - - // Setup form - addClassesToList('class', 'table_cell_styles'); - TinyMCE_EditableSelects.init(); - - if (!ed.dom.hasClass(tdElm, 'mceSelected')) { - formObj.bordercolor.value = bordercolor; - formObj.bgcolor.value = bgcolor; - formObj.backgroundimage.value = backgroundimage; - formObj.width.value = width; - formObj.height.value = height; - formObj.id.value = id; - formObj.lang.value = lang; - formObj.style.value = ed.dom.serializeStyle(st); - selectByValue(formObj, 'align', align); - selectByValue(formObj, 'valign', valign); - selectByValue(formObj, 'class', className, true, true); - selectByValue(formObj, 'celltype', celltype); - selectByValue(formObj, 'dir', dir); - selectByValue(formObj, 'scope', scope); - - // Resize some elements - if (isVisible('backgroundimagebrowser')) - document.getElementById('backgroundimage').style.width = '180px'; - - updateColor('bordercolor_pick', 'bordercolor'); - updateColor('bgcolor_pick', 'bgcolor'); - } else - tinyMCEPopup.dom.hide('action'); -} - -function updateAction() { - var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; - - if (!AutoValidator.validate(formObj)) { - tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.'); - return false; - } - - tinyMCEPopup.restoreSelection(); - el = ed.selection.getStart(); - tdElm = ed.dom.getParent(el, "td,th"); - trElm = ed.dom.getParent(el, "tr"); - tableElm = ed.dom.getParent(el, "table"); - - // Cell is selected - if (ed.dom.hasClass(tdElm, 'mceSelected')) { - // Update all selected sells - tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) { - updateCell(td); - }); - - ed.addVisual(); - ed.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - return; - } - - switch (getSelectValue(formObj, 'action')) { - case "cell": - var celltype = getSelectValue(formObj, 'celltype'); - var scope = getSelectValue(formObj, 'scope'); - - function doUpdate(s) { - if (s) { - updateCell(tdElm); - - ed.addVisual(); - ed.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - } - }; - - if (ed.getParam("accessibility_warnings", 1)) { - if (celltype == "th" && scope == "") - tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); - else - doUpdate(1); - - return; - } - - updateCell(tdElm); - break; - - case "row": - var cell = trElm.firstChild; - - if (cell.nodeName != "TD" && cell.nodeName != "TH") - cell = nextCell(cell); - - do { - cell = updateCell(cell, true); - } while ((cell = nextCell(cell)) != null); - - break; - - case "col": - var curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName("tr"); - - if (cell.nodeName != "TD" && cell.nodeName != "TH") - cell = nextCell(cell); - - do { - if (cell == tdElm) - break; - col += cell.getAttribute("colspan"); - } while ((cell = nextCell(cell)) != null); - - for (var i=0; i 0) { - tinymce.each(tableElm.rows, function(tr) { - var i; - - for (i = 0; i < tr.cells.length; i++) { - if (dom.hasClass(tr.cells[i], 'mceSelected')) { - updateRow(tr, true); - return; - } - } - }); - - inst.addVisual(); - inst.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - return; - } - - switch (action) { - case "row": - updateRow(trElm); - break; - - case "all": - var rows = tableElm.getElementsByTagName("tr"); - - for (var i=0; i colLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); - return false; - } else if (rowLimit && rows > rowLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); - return false; - } else if (cellLimit && cols * rows > cellLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); - return false; - } - - // Update table - if (action == "update") { - dom.setAttrib(elm, 'cellPadding', cellpadding, true); - dom.setAttrib(elm, 'cellSpacing', cellspacing, true); - dom.setAttrib(elm, 'border', border); - dom.setAttrib(elm, 'align', align); - dom.setAttrib(elm, 'frame', frame); - dom.setAttrib(elm, 'rules', rules); - dom.setAttrib(elm, 'class', className); - dom.setAttrib(elm, 'style', style); - dom.setAttrib(elm, 'id', id); - dom.setAttrib(elm, 'summary', summary); - dom.setAttrib(elm, 'dir', dir); - dom.setAttrib(elm, 'lang', lang); - - capEl = inst.dom.select('caption', elm)[0]; - - if (capEl && !caption) - capEl.parentNode.removeChild(capEl); - - if (!capEl && caption) { - capEl = elm.ownerDocument.createElement('caption'); - - if (!tinymce.isIE) - capEl.innerHTML = '
'; - - elm.insertBefore(capEl, elm.firstChild); - } - - if (width && inst.settings.inline_styles) { - dom.setStyle(elm, 'width', width); - dom.setAttrib(elm, 'width', ''); - } else { - dom.setAttrib(elm, 'width', width, true); - dom.setStyle(elm, 'width', ''); - } - - // Remove these since they are not valid XHTML - dom.setAttrib(elm, 'borderColor', ''); - dom.setAttrib(elm, 'bgColor', ''); - dom.setAttrib(elm, 'background', ''); - - if (height && inst.settings.inline_styles) { - dom.setStyle(elm, 'height', height); - dom.setAttrib(elm, 'height', ''); - } else { - dom.setAttrib(elm, 'height', height, true); - dom.setStyle(elm, 'height', ''); - } - - if (background != '') - elm.style.backgroundImage = "url('" + background + "')"; - else - elm.style.backgroundImage = ''; - -/* if (tinyMCEPopup.getParam("inline_styles")) { - if (width != '') - elm.style.width = getCSSSize(width); - }*/ - - if (bordercolor != "") { - elm.style.borderColor = bordercolor; - elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; - elm.style.borderWidth = border == "" ? "1px" : border; - } else - elm.style.borderColor = ''; - - elm.style.backgroundColor = bgcolor; - elm.style.height = getCSSSize(height); - - inst.addVisual(); - - // Fix for stange MSIE align bug - //elm.outerHTML = elm.outerHTML; - - inst.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - - // Repaint if dimensions changed - if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) - inst.execCommand('mceRepaint'); - - tinyMCEPopup.close(); - return true; - } - - // Create new table - html += ''); - - tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { - if (patt) - patt += ','; - - patt += n + ' ._mce_marker'; - }); - - tinymce.each(inst.dom.select(patt), function(n) { - inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); - }); - - dom.setOuterHTML(dom.select('br._mce_marker')[0], html); - } else - inst.execCommand('mceInsertContent', false, html); - - tinymce.each(dom.select('table[data-mce-new]'), function(node) { - var td = dom.select('td', node); - - try { - // IE9 might fail to do this selection - inst.selection.select(td[0], true); - inst.selection.collapse(); - } catch (ex) { - // Ignore - } - - dom.setAttrib(node, 'data-mce-new', ''); - }); - - inst.addVisual(); - inst.execCommand('mceEndUndoLevel'); - - tinyMCEPopup.close(); -} - -function makeAttrib(attrib, value) { - var formObj = document.forms[0]; - var valueElm = formObj.elements[attrib]; - - if (typeof(value) == "undefined" || value == null) { - value = ""; - - if (valueElm) - value = valueElm.value; - } - - if (value == "") - return ""; - - // XML encode it - value = value.replace(/&/g, '&'); - value = value.replace(/\"/g, '"'); - value = value.replace(//g, '>'); - - return ' ' + attrib + '="' + value + '"'; -} - -function init() { - tinyMCEPopup.resizeToInnerSize(); - - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - - var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); - var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; - var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = ""; - var inst = tinyMCEPopup.editor, dom = inst.dom; - var formObj = document.forms[0]; - var elm = dom.getParent(inst.selection.getNode(), "table"); - - action = tinyMCEPopup.getWindowArg('action'); - - if (!action) - action = elm ? "update" : "insert"; - - if (elm && action != "insert") { - var rowsAr = elm.rows; - var cols = 0; - for (var i=0; i cols) - cols = rowsAr[i].cells.length; - - cols = cols; - rows = rowsAr.length; - - st = dom.parseStyle(dom.getAttrib(elm, "style")); - border = trimSize(getStyle(elm, 'border', 'borderWidth')); - cellpadding = dom.getAttrib(elm, 'cellpadding', ""); - cellspacing = dom.getAttrib(elm, 'cellspacing', ""); - width = trimSize(getStyle(elm, 'width', 'width')); - height = trimSize(getStyle(elm, 'height', 'height')); - bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); - bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); - align = dom.getAttrib(elm, 'align', align); - frame = dom.getAttrib(elm, 'frame'); - rules = dom.getAttrib(elm, 'rules'); - className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); - id = dom.getAttrib(elm, 'id'); - summary = dom.getAttrib(elm, 'summary'); - style = dom.serializeStyle(st); - dir = dom.getAttrib(elm, 'dir'); - lang = dom.getAttrib(elm, 'lang'); - background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; - - orgTableWidth = width; - orgTableHeight = height; - - action = "update"; - formObj.insert.value = inst.getLang('update'); - } - - addClassesToList('class', "table_styles"); - TinyMCE_EditableSelects.init(); - - // Update form - selectByValue(formObj, 'align', align); - selectByValue(formObj, 'tframe', frame); - selectByValue(formObj, 'rules', rules); - selectByValue(formObj, 'class', className, true, true); - formObj.cols.value = cols; - formObj.rows.value = rows; - formObj.border.value = border; - formObj.cellpadding.value = cellpadding; - formObj.cellspacing.value = cellspacing; - formObj.width.value = width; - formObj.height.value = height; - formObj.bordercolor.value = bordercolor; - formObj.bgcolor.value = bgcolor; - formObj.id.value = id; - formObj.summary.value = summary; - formObj.style.value = style; - formObj.dir.value = dir; - formObj.lang.value = lang; - formObj.backgroundimage.value = background; - - updateColor('bordercolor_pick', 'bordercolor'); - updateColor('bgcolor_pick', 'bgcolor'); - - // Resize some elements - if (isVisible('backgroundimagebrowser')) - document.getElementById('backgroundimage').style.width = '180px'; - - // Disable some fields in update mode - if (action == "update") { - formObj.cols.disabled = true; - formObj.rows.disabled = true; - } -} - -function changedSize() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - -/* var width = formObj.width.value; - if (width != "") - st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; - else - st['width'] = "";*/ - - var height = formObj.height.value; - if (height != "") - st['height'] = getCSSSize(height); - else - st['height'] = ""; - - formObj.style.value = dom.serializeStyle(st); -} - -function changedBackgroundImage() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; - - formObj.style.value = dom.serializeStyle(st); -} - -function changedBorder() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - // Update border width if the element has a color - if (formObj.border.value != "" && formObj.bordercolor.value != "") - st['border-width'] = formObj.border.value + "px"; - - formObj.style.value = dom.serializeStyle(st); -} - -function changedColor() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - st['background-color'] = formObj.bgcolor.value; - - if (formObj.bordercolor.value != "") { - st['border-color'] = formObj.bordercolor.value; - - // Add border-width if it's missing - if (!st['border-width']) - st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px"; - } - - formObj.style.value = dom.serializeStyle(st); -} - -function changedStyle() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - if (st['background-image']) - formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - else - formObj.backgroundimage.value = ''; - - if (st['width']) - formObj.width.value = trimSize(st['width']); - - if (st['height']) - formObj.height.value = trimSize(st['height']); - - if (st['background-color']) { - formObj.bgcolor.value = st['background-color']; - updateColor('bgcolor_pick','bgcolor'); - } - - if (st['border-color']) { - formObj.bordercolor.value = st['border-color']; - updateColor('bordercolor_pick','bordercolor'); - } -} - -tinyMCEPopup.onInit.add(init); diff --git a/www/javascript/tiny_mce/plugins/table/langs/en_dlg.js b/www/javascript/tiny_mce/plugins/table/langs/en_dlg.js deleted file mode 100644 index 0816efb9c..000000000 --- a/www/javascript/tiny_mce/plugins/table/langs/en_dlg.js +++ /dev/null @@ -1,75 +0,0 @@ -tinyMCE.addI18n('en.table_dlg',{ -general_tab:"General", -advanced_tab:"Advanced", -general_props:"General properties", -advanced_props:"Advanced properties", -rowtype:"Row in table part", -title:"Insert/Modify table", -width:"Width", -height:"Height", -cols:"Columns", -rows:"Rows", -cellspacing:"Cellspacing", -cellpadding:"Cellpadding", -border:"Border", -align:"Alignment", -align_default:"Default", -align_left:"Left", -align_right:"Right", -align_middle:"Center", -row_title:"Table row properties", -cell_title:"Table cell properties", -cell_type:"Cell type", -valign:"Vertical alignment", -align_top:"Top", -align_bottom:"Bottom", -bordercolor:"Border color", -bgcolor:"Background color", -merge_cells_title:"Merge table cells", -id:"Id", -style:"Style", -langdir:"Language direction", -langcode:"Language code", -mime:"Target MIME type", -ltr:"Left to right", -rtl:"Right to left", -bgimage:"Background image", -summary:"Summary", -td:"Data", -th:"Header", -cell_cell:"Update current cell", -cell_row:"Update all cells in row", -cell_col:"Update all cells in column", -cell_all:"Update all cells in table", -row_row:"Update current row", -row_odd:"Update odd rows in table", -row_even:"Update even rows in table", -row_all:"Update all rows in table", -thead:"Table Head", -tbody:"Table Body", -tfoot:"Table Foot", -scope:"Scope", -rowgroup:"Row Group", -colgroup:"Col Group", -col_limit:"You've exceeded the maximum number of columns of {$cols}.", -row_limit:"You've exceeded the maximum number of rows of {$rows}.", -cell_limit:"You've exceeded the maximum number of cells of {$cells}.", -missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", -caption:"Table caption", -frame:"Frame", -frame_none:"none", -frame_groups:"groups", -frame_rows:"rows", -frame_cols:"cols", -frame_all:"all", -rules:"Rules", -rules_void:"void", -rules_above:"above", -rules_below:"below", -rules_hsides:"hsides", -rules_lhs:"lhs", -rules_rhs:"rhs", -rules_vsides:"vsides", -rules_box:"box", -rules_border:"border" -}); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/table/merge_cells.htm b/www/javascript/tiny_mce/plugins/table/merge_cells.htm deleted file mode 100644 index d231090e7..000000000 --- a/www/javascript/tiny_mce/plugins/table/merge_cells.htm +++ /dev/null @@ -1,32 +0,0 @@ - - - - {#table_dlg.merge_cells_title} - - - - - - -
-
- {#table_dlg.merge_cells_title} - - - - - - - - - -
:
:
-
- -
- - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/table/row.htm b/www/javascript/tiny_mce/plugins/table/row.htm deleted file mode 100644 index 1885401f6..000000000 --- a/www/javascript/tiny_mce/plugins/table/row.htm +++ /dev/null @@ -1,158 +0,0 @@ - - - - {#table_dlg.row_title} - - - - - - - - - -
- - -
-
-
- {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
-
-
- -
-
- {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- - - - - -
 
-
- - - - - - -
 
-
-
-
-
-
- -
-
- -
- - - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/table/table.htm b/www/javascript/tiny_mce/plugins/table/table.htm deleted file mode 100644 index 09d3700f7..000000000 --- a/www/javascript/tiny_mce/plugins/table/table.htm +++ /dev/null @@ -1,188 +0,0 @@ - - - - {#table_dlg.title} - - - - - - - - - - -
- - -
-
-
- {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-
- {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - -
 
-
- -
- -
- -
- - - - - -
 
-
- - - - - -
 
-
-
-
-
- -
- - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/template/blank.htm b/www/javascript/tiny_mce/plugins/template/blank.htm deleted file mode 100644 index ecde53fae..000000000 --- a/www/javascript/tiny_mce/plugins/template/blank.htm +++ /dev/null @@ -1,12 +0,0 @@ - - - blank_page - - - - - - - diff --git a/www/javascript/tiny_mce/plugins/template/css/template.css b/www/javascript/tiny_mce/plugins/template/css/template.css deleted file mode 100644 index 2d23a4938..000000000 --- a/www/javascript/tiny_mce/plugins/template/css/template.css +++ /dev/null @@ -1,23 +0,0 @@ -#frmbody { - padding: 10px; - background-color: #FFF; - border: 1px solid #CCC; -} - -.frmRow { - margin-bottom: 10px; -} - -#templatesrc { - border: none; - width: 320px; - height: 240px; -} - -.title { - padding-bottom: 5px; -} - -.mceActionPanel { - padding-top: 5px; -} diff --git a/www/javascript/tiny_mce/plugins/template/editor_plugin.js b/www/javascript/tiny_mce/plugins/template/editor_plugin.js deleted file mode 100644 index ebe3c27d7..000000000 --- a/www/javascript/tiny_mce/plugins/template/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.each;tinymce.create("tinymce.plugins.TemplatePlugin",{init:function(b,c){var d=this;d.editor=b;b.addCommand("mceTemplate",function(e){b.windowManager.open({file:c+"/template.htm",width:b.getParam("template_popup_width",750),height:b.getParam("template_popup_height",600),inline:1},{plugin_url:c})});b.addCommand("mceInsertTemplate",d._insertTemplate,d);b.addButton("template",{title:"template.desc",cmd:"mceTemplate"});b.onPreProcess.add(function(e,g){var f=e.dom;a(f.select("div",g.node),function(h){if(f.hasClass(h,"mceTmpl")){a(f.select("*",h),function(i){if(f.hasClass(i,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){i.innerHTML=d._getDateTime(new Date(),e.getParam("template_mdate_format",e.getLang("template.mdate_format")))}});d._replaceVals(h)}})})},getInfo:function(){return{longname:"Template plugin",author:"Moxiecode Systems AB",authorurl:"http://www.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/template",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_insertTemplate:function(i,j){var k=this,g=k.editor,f,c,d=g.dom,b=g.selection.getContent();f=j.content;a(k.editor.getParam("template_replace_values"),function(l,h){if(typeof(l)!="function"){f=f.replace(new RegExp("\\{\\$"+h+"\\}","g"),l)}});c=d.create("div",null,f);n=d.select(".mceTmpl",c);if(n&&n.length>0){c=d.create("div",null);c.appendChild(n[0].cloneNode(true))}function e(l,h){return new RegExp("\\b"+h+"\\b","g").test(l.className)}a(d.select("*",c),function(h){if(e(h,g.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_cdate_format",g.getLang("template.cdate_format")))}if(e(h,g.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))){h.innerHTML=k._getDateTime(new Date(),g.getParam("template_mdate_format",g.getLang("template.mdate_format")))}if(e(h,g.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))){h.innerHTML=b}});k._replaceVals(c);g.execCommand("mceInsertContent",false,c.innerHTML);g.addVisual()},_replaceVals:function(c){var d=this.editor.dom,b=this.editor.getParam("template_replace_values");a(d.select("*",c),function(f){a(b,function(g,e){if(d.hasClass(f,e)){if(typeof(b[e])=="function"){b[e](f)}}})})},_getDateTime:function(e,b){if(!b){return""}function c(g,d){var f;g=""+g;if(g.length 0) { - el = dom.create('div', null); - el.appendChild(n[0].cloneNode(true)); - } - - function hasClass(n, c) { - return new RegExp('\\b' + c + '\\b', 'g').test(n.className); - }; - - each(dom.select('*', el), function(n) { - // Replace cdate - if (hasClass(n, ed.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) - n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_cdate_format", ed.getLang("template.cdate_format"))); - - // Replace mdate - if (hasClass(n, ed.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) - n.innerHTML = t._getDateTime(new Date(), ed.getParam("template_mdate_format", ed.getLang("template.mdate_format"))); - - // Replace selection - if (hasClass(n, ed.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) - n.innerHTML = sel; - }); - - t._replaceVals(el); - - ed.execCommand('mceInsertContent', false, el.innerHTML); - ed.addVisual(); - }, - - _replaceVals : function(e) { - var dom = this.editor.dom, vl = this.editor.getParam('template_replace_values'); - - each(dom.select('*', e), function(e) { - each(vl, function(v, k) { - if (dom.hasClass(e, k)) { - if (typeof(vl[k]) == 'function') - vl[k](e); - } - }); - }); - }, - - _getDateTime : function(d, fmt) { - if (!fmt) - return ""; - - function addZeros(value, len) { - var i; - - value = "" + value; - - if (value.length < len) { - for (i=0; i<(len-value.length); i++) - value = "0" + value; - } - - return value; - } - - fmt = fmt.replace("%D", "%m/%d/%y"); - fmt = fmt.replace("%r", "%I:%M:%S %p"); - fmt = fmt.replace("%Y", "" + d.getFullYear()); - fmt = fmt.replace("%y", "" + d.getYear()); - fmt = fmt.replace("%m", addZeros(d.getMonth()+1, 2)); - fmt = fmt.replace("%d", addZeros(d.getDate(), 2)); - fmt = fmt.replace("%H", "" + addZeros(d.getHours(), 2)); - fmt = fmt.replace("%M", "" + addZeros(d.getMinutes(), 2)); - fmt = fmt.replace("%S", "" + addZeros(d.getSeconds(), 2)); - fmt = fmt.replace("%I", "" + ((d.getHours() + 11) % 12 + 1)); - fmt = fmt.replace("%p", "" + (d.getHours() < 12 ? "AM" : "PM")); - fmt = fmt.replace("%B", "" + this.editor.getLang("template_months_long").split(',')[d.getMonth()]); - fmt = fmt.replace("%b", "" + this.editor.getLang("template_months_short").split(',')[d.getMonth()]); - fmt = fmt.replace("%A", "" + this.editor.getLang("template_day_long").split(',')[d.getDay()]); - fmt = fmt.replace("%a", "" + this.editor.getLang("template_day_short").split(',')[d.getDay()]); - fmt = fmt.replace("%%", "%"); - - return fmt; - } - }); - - // Register plugin - tinymce.PluginManager.add('template', tinymce.plugins.TemplatePlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/template/js/template.js b/www/javascript/tiny_mce/plugins/template/js/template.js deleted file mode 100644 index bc3045d24..000000000 --- a/www/javascript/tiny_mce/plugins/template/js/template.js +++ /dev/null @@ -1,106 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var TemplateDialog = { - preInit : function() { - var url = tinyMCEPopup.getParam("template_external_list_url"); - - if (url != null) - document.write(''); - }, - - init : function() { - var ed = tinyMCEPopup.editor, tsrc, sel, x, u; - - tsrc = ed.getParam("template_templates", false); - sel = document.getElementById('tpath'); - - // Setup external template list - if (!tsrc && typeof(tinyMCETemplateList) != 'undefined') { - for (x=0, tsrc = []; x'); - }); - }, - - selectTemplate : function(u, ti) { - var d = window.frames['templatesrc'].document, x, tsrc = this.tsrc; - - if (!u) - return; - - d.body.innerHTML = this.templateHTML = this.getFileContents(u); - - for (x=0; x - - {#template_dlg.title} - - - - - -
-
-
{#template_dlg.desc}
-
- -
-
-
-
- {#template_dlg.preview} - -
-
- -
- - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/visualchars/editor_plugin.js b/www/javascript/tiny_mce/plugins/visualchars/editor_plugin.js deleted file mode 100644 index 1a148e8b4..000000000 --- a/www/javascript/tiny_mce/plugins/visualchars/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.VisualChars",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceVisualChars",c._toggleVisualChars,c);a.addButton("visualchars",{title:"visualchars.desc",cmd:"mceVisualChars"});a.onBeforeGetContent.add(function(d,e){if(c.state&&e.format!="raw"&&!e.draft){c.state=true;c._toggleVisualChars(false)}})},getInfo:function(){return{longname:"Visual characters",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_toggleVisualChars:function(m){var p=this,k=p.editor,a,g,j,n=k.getDoc(),o=k.getBody(),l,q=k.selection,e,c,f;p.state=!p.state;k.controlManager.setActive("visualchars",p.state);if(m){f=q.getBookmark()}if(p.state){a=[];tinymce.walk(o,function(b){if(b.nodeType==3&&b.nodeValue&&b.nodeValue.indexOf("\u00a0")!=-1){a.push(b)}},"childNodes");for(g=0;g$1');c=k.dom.create("div",null,l);while(node=c.lastChild){k.dom.insertAfter(node,a[g])}k.dom.remove(a[g])}}else{a=k.dom.select("span.mceItemNbsp",o);for(g=a.length-1;g>=0;g--){k.dom.remove(a[g],1)}}q.moveToBookmark(f)}});tinymce.PluginManager.add("visualchars",tinymce.plugins.VisualChars)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/visualchars/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/visualchars/editor_plugin_src.js deleted file mode 100644 index df985905b..000000000 --- a/www/javascript/tiny_mce/plugins/visualchars/editor_plugin_src.js +++ /dev/null @@ -1,83 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.VisualChars', { - init : function(ed, url) { - var t = this; - - t.editor = ed; - - // Register commands - ed.addCommand('mceVisualChars', t._toggleVisualChars, t); - - // Register buttons - ed.addButton('visualchars', {title : 'visualchars.desc', cmd : 'mceVisualChars'}); - - ed.onBeforeGetContent.add(function(ed, o) { - if (t.state && o.format != 'raw' && !o.draft) { - t.state = true; - t._toggleVisualChars(false); - } - }); - }, - - getInfo : function() { - return { - longname : 'Visual characters', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/visualchars', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - }, - - // Private methods - - _toggleVisualChars : function(bookmark) { - var t = this, ed = t.editor, nl, i, h, d = ed.getDoc(), b = ed.getBody(), nv, s = ed.selection, bo, div, bm; - - t.state = !t.state; - ed.controlManager.setActive('visualchars', t.state); - - if (bookmark) - bm = s.getBookmark(); - - if (t.state) { - nl = []; - tinymce.walk(b, function(n) { - if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1) - nl.push(n); - }, 'childNodes'); - - for (i = 0; i < nl.length; i++) { - nv = nl[i].nodeValue; - nv = nv.replace(/(\u00a0)/g, '$1'); - - div = ed.dom.create('div', null, nv); - while (node = div.lastChild) - ed.dom.insertAfter(node, nl[i]); - - ed.dom.remove(nl[i]); - } - } else { - nl = ed.dom.select('span.mceItemNbsp', b); - - for (i = nl.length - 1; i >= 0; i--) - ed.dom.remove(nl[i], 1); - } - - s.moveToBookmark(bm); - } - }); - - // Register plugin - tinymce.PluginManager.add('visualchars', tinymce.plugins.VisualChars); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/wordcount/editor_plugin.js b/www/javascript/tiny_mce/plugins/wordcount/editor_plugin.js deleted file mode 100644 index e769d09f6..000000000 --- a/www/javascript/tiny_mce/plugins/wordcount/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.WordCount",{block:0,id:null,countre:null,cleanre:null,init:function(a,b){var c=this,d=0;c.countre=a.getParam("wordcount_countregex",/[\w\u2019\'-]+/g);c.cleanre=a.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);c.id=a.id+"-word-count";a.onPostRender.add(function(f,e){var g,h;h=f.getParam("wordcount_target_id");if(!h){g=tinymce.DOM.get(f.id+"_path_row");if(g){tinymce.DOM.add(g.parentNode,"div",{style:"float: right"},f.getLang("wordcount.words","Words: ")+'0')}}else{tinymce.DOM.add(h,"span",{},'0')}});a.onInit.add(function(e){e.selection.onSetContent.add(function(){c._count(e)});c._count(e)});a.onSetContent.add(function(e){c._count(e)});a.onKeyUp.add(function(f,g){if(g.keyCode==d){return}if(13==g.keyCode||8==d||46==d){c._count(f)}d=g.keyCode})},_getCount:function(c){var a=0;var b=c.getContent({format:"raw"});if(b){b=b.replace(/\.\.\./g," ");b=b.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ");b=b.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," ");b=b.replace(this.cleanre,"");var d=b.match(this.countre);if(d){a=d.length}}return a},_count:function(a){var b=this;if(b.block){return}b.block=1;setTimeout(function(){var c=b._getCount(a);tinymce.DOM.setHTML(b.id,c.toString());setTimeout(function(){b.block=0},2000)},1)},getInfo:function(){return{longname:"Word Count plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("wordcount",tinymce.plugins.WordCount)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/wordcount/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/wordcount/editor_plugin_src.js deleted file mode 100644 index 6c9a3ead2..000000000 --- a/www/javascript/tiny_mce/plugins/wordcount/editor_plugin_src.js +++ /dev/null @@ -1,114 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.WordCount', { - block : 0, - id : null, - countre : null, - cleanre : null, - - init : function(ed, url) { - var t = this, last = 0; - - t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’ - t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g); - t.id = ed.id + '-word-count'; - - ed.onPostRender.add(function(ed, cm) { - var row, id; - - // Add it to the specified id or the theme advanced path - id = ed.getParam('wordcount_target_id'); - if (!id) { - row = tinymce.DOM.get(ed.id + '_path_row'); - - if (row) - tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '0'); - } else { - tinymce.DOM.add(id, 'span', {}, '0'); - } - }); - - ed.onInit.add(function(ed) { - ed.selection.onSetContent.add(function() { - t._count(ed); - }); - - t._count(ed); - }); - - ed.onSetContent.add(function(ed) { - t._count(ed); - }); - - ed.onKeyUp.add(function(ed, e) { - if (e.keyCode == last) - return; - - if (13 == e.keyCode || 8 == last || 46 == last) - t._count(ed); - - last = e.keyCode; - }); - }, - - _getCount : function(ed) { - var tc = 0; - var tx = ed.getContent({ format: 'raw' }); - - if (tx) { - tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces - tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars - - // deal with html entities - tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' '); - tx = tx.replace(this.cleanre, ''); // remove numbers and punctuation - - var wordArray = tx.match(this.countre); - if (wordArray) { - tc = wordArray.length; - } - } - - return tc; - }, - - _count : function(ed) { - var t = this; - - // Keep multiple calls from happening at the same time - if (t.block) - return; - - t.block = 1; - - setTimeout(function() { - var tc = t._getCount(ed); - - tinymce.DOM.setHTML(t.id, tc.toString()); - - setTimeout(function() {t.block = 0;}, 2000); - }, 1); - }, - - getInfo: function() { - return { - longname : 'Word Count plugin', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount); -})(); diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/abbr.htm b/www/javascript/tiny_mce/plugins/xhtmlxtras/abbr.htm deleted file mode 100644 index 30a894f7c..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/abbr.htm +++ /dev/null @@ -1,142 +0,0 @@ - - - - {#xhtmlxtras_dlg.title_abbr_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/acronym.htm b/www/javascript/tiny_mce/plugins/xhtmlxtras/acronym.htm deleted file mode 100644 index c10934592..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/acronym.htm +++ /dev/null @@ -1,142 +0,0 @@ - - - - {#xhtmlxtras_dlg.title_acronym_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/attributes.htm b/www/javascript/tiny_mce/plugins/xhtmlxtras/attributes.htm deleted file mode 100644 index e8d606a34..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/attributes.htm +++ /dev/null @@ -1,149 +0,0 @@ - - - - {#xhtmlxtras_dlg.attribs_title} - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.attribute_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
- -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.attribute_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/cite.htm b/www/javascript/tiny_mce/plugins/xhtmlxtras/cite.htm deleted file mode 100644 index 0ac6bdb66..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/cite.htm +++ /dev/null @@ -1,142 +0,0 @@ - - - - {#xhtmlxtras_dlg.title_cite_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/css/attributes.css b/www/javascript/tiny_mce/plugins/xhtmlxtras/css/attributes.css deleted file mode 100644 index 9a6a235c3..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/css/attributes.css +++ /dev/null @@ -1,11 +0,0 @@ -.panel_wrapper div.current { - height: 290px; -} - -#id, #style, #title, #dir, #hreflang, #lang, #classlist, #tabindex, #accesskey { - width: 200px; -} - -#events_panel input { - width: 200px; -} diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/css/popup.css b/www/javascript/tiny_mce/plugins/xhtmlxtras/css/popup.css deleted file mode 100644 index e67114dba..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/css/popup.css +++ /dev/null @@ -1,9 +0,0 @@ -input.field, select.field {width:200px;} -input.picker {width:179px; margin-left: 5px;} -input.disabled {border-color:#F2F2F2;} -img.picker {vertical-align:text-bottom; cursor:pointer;} -h1 {padding: 0 0 5px 0;} -.panel_wrapper div.current {height:160px;} -#xhtmlxtrasdel .panel_wrapper div.current, #xhtmlxtrasins .panel_wrapper div.current {height: 230px;} -a.browse span {display:block; width:20px; height:20px; background:url('../../../themes/advanced/img/icons.gif') -140px -20px;} -#datetime {width:180px;} diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/del.htm b/www/javascript/tiny_mce/plugins/xhtmlxtras/del.htm deleted file mode 100644 index 5f667510f..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/del.htm +++ /dev/null @@ -1,162 +0,0 @@ - - - - {#xhtmlxtras_dlg.title_del_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_general_tab} - - - - - - - - - -
: - - - - - -
-
:
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/editor_plugin.js b/www/javascript/tiny_mce/plugins/xhtmlxtras/editor_plugin.js deleted file mode 100644 index 9b98a5154..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/editor_plugin.js +++ /dev/null @@ -1 +0,0 @@ -(function(){tinymce.create("tinymce.plugins.XHTMLXtrasPlugin",{init:function(a,b){a.addCommand("mceCite",function(){a.windowManager.open({file:b+"/cite.htm",width:350+parseInt(a.getLang("xhtmlxtras.cite_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.cite_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAcronym",function(){a.windowManager.open({file:b+"/acronym.htm",width:350+parseInt(a.getLang("xhtmlxtras.acronym_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.acronym_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAbbr",function(){a.windowManager.open({file:b+"/abbr.htm",width:350+parseInt(a.getLang("xhtmlxtras.abbr_delta_width",0)),height:250+parseInt(a.getLang("xhtmlxtras.abbr_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceDel",function(){a.windowManager.open({file:b+"/del.htm",width:340+parseInt(a.getLang("xhtmlxtras.del_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.del_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceIns",function(){a.windowManager.open({file:b+"/ins.htm",width:340+parseInt(a.getLang("xhtmlxtras.ins_delta_width",0)),height:310+parseInt(a.getLang("xhtmlxtras.ins_delta_height",0)),inline:1},{plugin_url:b})});a.addCommand("mceAttributes",function(){a.windowManager.open({file:b+"/attributes.htm",width:380+parseInt(a.getLang("xhtmlxtras.attr_delta_width",0)),height:370+parseInt(a.getLang("xhtmlxtras.attr_delta_height",0)),inline:1},{plugin_url:b})});a.addButton("cite",{title:"xhtmlxtras.cite_desc",cmd:"mceCite"});a.addButton("acronym",{title:"xhtmlxtras.acronym_desc",cmd:"mceAcronym"});a.addButton("abbr",{title:"xhtmlxtras.abbr_desc",cmd:"mceAbbr"});a.addButton("del",{title:"xhtmlxtras.del_desc",cmd:"mceDel"});a.addButton("ins",{title:"xhtmlxtras.ins_desc",cmd:"mceIns"});a.addButton("attribs",{title:"xhtmlxtras.attribs_desc",cmd:"mceAttributes"});a.onNodeChange.add(function(d,c,f,e){f=d.dom.getParent(f,"CITE,ACRONYM,ABBR,DEL,INS");c.setDisabled("cite",e);c.setDisabled("acronym",e);c.setDisabled("abbr",e);c.setDisabled("del",e);c.setDisabled("ins",e);c.setDisabled("attribs",f&&f.nodeName=="BODY");c.setActive("cite",0);c.setActive("acronym",0);c.setActive("abbr",0);c.setActive("del",0);c.setActive("ins",0);if(f){do{c.setDisabled(f.nodeName.toLowerCase(),0);c.setActive(f.nodeName.toLowerCase(),1)}while(f=f.parentNode)}});a.onPreInit.add(function(){a.dom.create("abbr")})},getInfo:function(){return{longname:"XHTML Xtras Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("xhtmlxtras",tinymce.plugins.XHTMLXtrasPlugin)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js b/www/javascript/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js deleted file mode 100644 index f24057211..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/editor_plugin_src.js +++ /dev/null @@ -1,132 +0,0 @@ -/** - * editor_plugin_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - tinymce.create('tinymce.plugins.XHTMLXtrasPlugin', { - init : function(ed, url) { - // Register commands - ed.addCommand('mceCite', function() { - ed.windowManager.open({ - file : url + '/cite.htm', - width : 350 + parseInt(ed.getLang('xhtmlxtras.cite_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.cite_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceAcronym', function() { - ed.windowManager.open({ - file : url + '/acronym.htm', - width : 350 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.acronym_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceAbbr', function() { - ed.windowManager.open({ - file : url + '/abbr.htm', - width : 350 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_width', 0)), - height : 250 + parseInt(ed.getLang('xhtmlxtras.abbr_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceDel', function() { - ed.windowManager.open({ - file : url + '/del.htm', - width : 340 + parseInt(ed.getLang('xhtmlxtras.del_delta_width', 0)), - height : 310 + parseInt(ed.getLang('xhtmlxtras.del_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceIns', function() { - ed.windowManager.open({ - file : url + '/ins.htm', - width : 340 + parseInt(ed.getLang('xhtmlxtras.ins_delta_width', 0)), - height : 310 + parseInt(ed.getLang('xhtmlxtras.ins_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - ed.addCommand('mceAttributes', function() { - ed.windowManager.open({ - file : url + '/attributes.htm', - width : 380 + parseInt(ed.getLang('xhtmlxtras.attr_delta_width', 0)), - height : 370 + parseInt(ed.getLang('xhtmlxtras.attr_delta_height', 0)), - inline : 1 - }, { - plugin_url : url - }); - }); - - // Register buttons - ed.addButton('cite', {title : 'xhtmlxtras.cite_desc', cmd : 'mceCite'}); - ed.addButton('acronym', {title : 'xhtmlxtras.acronym_desc', cmd : 'mceAcronym'}); - ed.addButton('abbr', {title : 'xhtmlxtras.abbr_desc', cmd : 'mceAbbr'}); - ed.addButton('del', {title : 'xhtmlxtras.del_desc', cmd : 'mceDel'}); - ed.addButton('ins', {title : 'xhtmlxtras.ins_desc', cmd : 'mceIns'}); - ed.addButton('attribs', {title : 'xhtmlxtras.attribs_desc', cmd : 'mceAttributes'}); - - ed.onNodeChange.add(function(ed, cm, n, co) { - n = ed.dom.getParent(n, 'CITE,ACRONYM,ABBR,DEL,INS'); - - cm.setDisabled('cite', co); - cm.setDisabled('acronym', co); - cm.setDisabled('abbr', co); - cm.setDisabled('del', co); - cm.setDisabled('ins', co); - cm.setDisabled('attribs', n && n.nodeName == 'BODY'); - cm.setActive('cite', 0); - cm.setActive('acronym', 0); - cm.setActive('abbr', 0); - cm.setActive('del', 0); - cm.setActive('ins', 0); - - // Activate all - if (n) { - do { - cm.setDisabled(n.nodeName.toLowerCase(), 0); - cm.setActive(n.nodeName.toLowerCase(), 1); - } while (n = n.parentNode); - } - }); - - ed.onPreInit.add(function() { - // Fixed IE issue where it can't handle these elements correctly - ed.dom.create('abbr'); - }); - }, - - getInfo : function() { - return { - longname : 'XHTML Xtras Plugin', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/xhtmlxtras', - version : tinymce.majorVersion + "." + tinymce.minorVersion - }; - } - }); - - // Register plugin - tinymce.PluginManager.add('xhtmlxtras', tinymce.plugins.XHTMLXtrasPlugin); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/ins.htm b/www/javascript/tiny_mce/plugins/xhtmlxtras/ins.htm deleted file mode 100644 index d001ac7c4..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/ins.htm +++ /dev/null @@ -1,162 +0,0 @@ - - - - {#xhtmlxtras_dlg.title_ins_element} - - - - - - - - - - -
- - -
-
-
- {#xhtmlxtras_dlg.fieldset_general_tab} - - - - - - - - - -
: - - - - - -
-
:
-
-
- {#xhtmlxtras_dlg.fieldset_attrib_tab} - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
: - -
:
: - -
: - -
-
-
-
-
- {#xhtmlxtras_dlg.fieldset_events_tab} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
:
:
:
:
:
:
:
:
:
:
:
:
-
-
-
-
- - - -
-
- - diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/js/abbr.js b/www/javascript/tiny_mce/plugins/xhtmlxtras/js/abbr.js deleted file mode 100644 index 4b51a2572..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/js/abbr.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * abbr.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('abbr'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertAbbr() { - SXE.insertElement('abbr'); - tinyMCEPopup.close(); -} - -function removeAbbr() { - SXE.removeElement('abbr'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/js/acronym.js b/www/javascript/tiny_mce/plugins/xhtmlxtras/js/acronym.js deleted file mode 100644 index 6ec2f8871..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/js/acronym.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * acronym.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('acronym'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertAcronym() { - SXE.insertElement('acronym'); - tinyMCEPopup.close(); -} - -function removeAcronym() { - SXE.removeElement('acronym'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/js/attributes.js b/www/javascript/tiny_mce/plugins/xhtmlxtras/js/attributes.js deleted file mode 100644 index 9c99995ad..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/js/attributes.js +++ /dev/null @@ -1,111 +0,0 @@ -/** - * attributes.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - tinyMCEPopup.resizeToInnerSize(); - var inst = tinyMCEPopup.editor; - var dom = inst.dom; - var elm = inst.selection.getNode(); - var f = document.forms[0]; - var onclick = dom.getAttrib(elm, 'onclick'); - - setFormValue('title', dom.getAttrib(elm, 'title')); - setFormValue('id', dom.getAttrib(elm, 'id')); - setFormValue('style', dom.getAttrib(elm, "style")); - setFormValue('dir', dom.getAttrib(elm, 'dir')); - setFormValue('lang', dom.getAttrib(elm, 'lang')); - setFormValue('tabindex', dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : "")); - setFormValue('accesskey', dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : "")); - setFormValue('onfocus', dom.getAttrib(elm, 'onfocus')); - setFormValue('onblur', dom.getAttrib(elm, 'onblur')); - setFormValue('onclick', onclick); - setFormValue('ondblclick', dom.getAttrib(elm, 'ondblclick')); - setFormValue('onmousedown', dom.getAttrib(elm, 'onmousedown')); - setFormValue('onmouseup', dom.getAttrib(elm, 'onmouseup')); - setFormValue('onmouseover', dom.getAttrib(elm, 'onmouseover')); - setFormValue('onmousemove', dom.getAttrib(elm, 'onmousemove')); - setFormValue('onmouseout', dom.getAttrib(elm, 'onmouseout')); - setFormValue('onkeypress', dom.getAttrib(elm, 'onkeypress')); - setFormValue('onkeydown', dom.getAttrib(elm, 'onkeydown')); - setFormValue('onkeyup', dom.getAttrib(elm, 'onkeyup')); - className = dom.getAttrib(elm, 'class'); - - addClassesToList('classlist', 'advlink_styles'); - selectByValue(f, 'classlist', className, true); - - TinyMCE_EditableSelects.init(); -} - -function setFormValue(name, value) { - if(value && document.forms[0].elements[name]){ - document.forms[0].elements[name].value = value; - } -} - -function insertAction() { - var inst = tinyMCEPopup.editor; - var elm = inst.selection.getNode(); - - setAllAttribs(elm); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); -} - -function setAttrib(elm, attrib, value) { - var formObj = document.forms[0]; - var valueElm = formObj.elements[attrib.toLowerCase()]; - var inst = tinyMCEPopup.editor; - var dom = inst.dom; - - if (typeof(value) == "undefined" || value == null) { - value = ""; - - if (valueElm) - value = valueElm.value; - } - - dom.setAttrib(elm, attrib.toLowerCase(), value); -} - -function setAllAttribs(elm) { - var f = document.forms[0]; - - setAttrib(elm, 'title'); - setAttrib(elm, 'id'); - setAttrib(elm, 'style'); - setAttrib(elm, 'class', getSelectValue(f, 'classlist')); - setAttrib(elm, 'dir'); - setAttrib(elm, 'lang'); - setAttrib(elm, 'tabindex'); - setAttrib(elm, 'accesskey'); - setAttrib(elm, 'onfocus'); - setAttrib(elm, 'onblur'); - setAttrib(elm, 'onclick'); - setAttrib(elm, 'ondblclick'); - setAttrib(elm, 'onmousedown'); - setAttrib(elm, 'onmouseup'); - setAttrib(elm, 'onmouseover'); - setAttrib(elm, 'onmousemove'); - setAttrib(elm, 'onmouseout'); - setAttrib(elm, 'onkeypress'); - setAttrib(elm, 'onkeydown'); - setAttrib(elm, 'onkeyup'); - - // Refresh in old MSIE -// if (tinyMCE.isMSIE5) -// elm.outerHTML = elm.outerHTML; -} - -function insertAttribute() { - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); -tinyMCEPopup.requireLangPack(); diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/js/cite.js b/www/javascript/tiny_mce/plugins/xhtmlxtras/js/cite.js deleted file mode 100644 index 009b71546..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/js/cite.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * cite.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('cite'); - if (SXE.currentAction == "update") { - SXE.showRemoveButton(); - } -} - -function insertCite() { - SXE.insertElement('cite'); - tinyMCEPopup.close(); -} - -function removeCite() { - SXE.removeElement('cite'); - tinyMCEPopup.close(); -} - -tinyMCEPopup.onInit.add(init); diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/js/del.js b/www/javascript/tiny_mce/plugins/xhtmlxtras/js/del.js deleted file mode 100644 index 1f957dc78..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/js/del.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * del.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('del'); - if (SXE.currentAction == "update") { - setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); - setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); - SXE.showRemoveButton(); - } -} - -function setElementAttribs(elm) { - setAllCommonAttribs(elm); - setAttrib(elm, 'datetime'); - setAttrib(elm, 'cite'); - elm.removeAttribute('data-mce-new'); -} - -function insertDel() { - var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'DEL'); - - if (elm == null) { - var s = SXE.inst.selection.getContent(); - if(s.length > 0) { - insertInlineElement('del'); - var elementArray = SXE.inst.dom.select('del[data-mce-new]'); - for (var i=0; i 0) { - tagName = element_name; - - insertInlineElement(element_name); - var elementArray = tinymce.grep(SXE.inst.dom.select(element_name)); - for (var i=0; i -1) ? true : false; -} - -SXE.removeClass = function(elm,cl) { - if(elm.className == null || elm.className == "" || !SXE.containsClass(elm,cl)) { - return true; - } - var classNames = elm.className.split(" "); - var newClassNames = ""; - for (var x = 0, cnl = classNames.length; x < cnl; x++) { - if (classNames[x] != cl) { - newClassNames += (classNames[x] + " "); - } - } - elm.className = newClassNames.substring(0,newClassNames.length-1); //removes extra space at the end -} - -SXE.addClass = function(elm,cl) { - if(!SXE.containsClass(elm,cl)) elm.className ? elm.className += " " + cl : elm.className = cl; - return true; -} - -function insertInlineElement(en) { - var ed = tinyMCEPopup.editor, dom = ed.dom; - - ed.getDoc().execCommand('FontName', false, 'mceinline'); - tinymce.each(dom.select('span,font'), function(n) { - if (n.style.fontFamily == 'mceinline' || n.face == 'mceinline') - dom.replace(dom.create(en, {'data-mce-new' : 1}), n, 1); - }); -} diff --git a/www/javascript/tiny_mce/plugins/xhtmlxtras/js/ins.js b/www/javascript/tiny_mce/plugins/xhtmlxtras/js/ins.js deleted file mode 100644 index c4addfb01..000000000 --- a/www/javascript/tiny_mce/plugins/xhtmlxtras/js/ins.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * ins.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -function init() { - SXE.initElementDialog('ins'); - if (SXE.currentAction == "update") { - setFormValue('datetime', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'datetime')); - setFormValue('cite', tinyMCEPopup.editor.dom.getAttrib(SXE.updateElement, 'cite')); - SXE.showRemoveButton(); - } -} - -function setElementAttribs(elm) { - setAllCommonAttribs(elm); - setAttrib(elm, 'datetime'); - setAttrib(elm, 'cite'); - elm.removeAttribute('data-mce-new'); -} - -function insertIns() { - var elm = tinyMCEPopup.editor.dom.getParent(SXE.focusElement, 'INS'); - - if (elm == null) { - var s = SXE.inst.selection.getContent(); - if(s.length > 0) { - insertInlineElement('ins'); - var elementArray = SXE.inst.dom.select('ins[data-mce-new]'); - for (var i=0; i - - - {#advanced_dlg.about_title} - - - - - - - -
-
-

{#advanced_dlg.about_title}

-

Version: ()

-

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL - by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

-

Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

-

For more information about this software visit the TinyMCE website.

- -
- Got Moxie? -
-
- -
-
-

{#advanced_dlg.about_loaded}

- -
-
- -

 

-
-
- -
-
-
-
- -
- -
- - diff --git a/www/javascript/tiny_mce/themes/advanced/anchor.htm b/www/javascript/tiny_mce/themes/advanced/anchor.htm deleted file mode 100644 index 75c93b799..000000000 --- a/www/javascript/tiny_mce/themes/advanced/anchor.htm +++ /dev/null @@ -1,26 +0,0 @@ - - - - {#advanced_dlg.anchor_title} - - - - -
- - - - - - - - -
{#advanced_dlg.anchor_title}
- -
- - -
-
- - diff --git a/www/javascript/tiny_mce/themes/advanced/charmap.htm b/www/javascript/tiny_mce/themes/advanced/charmap.htm deleted file mode 100644 index 2c3b3f27b..000000000 --- a/www/javascript/tiny_mce/themes/advanced/charmap.htm +++ /dev/null @@ -1,51 +0,0 @@ - - - - {#advanced_dlg.charmap_title} - - - - - - - - - - - - - - - -
- - - - - - - - - -
 
 
-
- - - - - - - - - - - - - - - - -
 
 
 
-
- - diff --git a/www/javascript/tiny_mce/themes/advanced/color_picker.htm b/www/javascript/tiny_mce/themes/advanced/color_picker.htm deleted file mode 100644 index ad1bb0f6c..000000000 --- a/www/javascript/tiny_mce/themes/advanced/color_picker.htm +++ /dev/null @@ -1,74 +0,0 @@ - - - - {#advanced_dlg.colorpicker_title} - - - - - - -
- - -
-
-
- {#advanced_dlg.colorpicker_picker_title} -
- - -
- -
- -
-
-
-
- -
-
- {#advanced_dlg.colorpicker_palette_title} -
- -
- -
-
-
- -
-
- {#advanced_dlg.colorpicker_named_title} -
- -
- -
- -
- {#advanced_dlg.colorpicker_name} -
-
-
-
- -
- - -
- -
- -
-
-
- - diff --git a/www/javascript/tiny_mce/themes/advanced/editor_template.js b/www/javascript/tiny_mce/themes/advanced/editor_template.js deleted file mode 100644 index 57e7184a8..000000000 --- a/www/javascript/tiny_mce/themes/advanced/editor_template.js +++ /dev/null @@ -1 +0,0 @@ -(function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);j.forcedHighContrastMode=j.settings.detect_highcontrast&&l._isHighContrast();j.settings.skin=j.forcedHighContrastMode?"highcontrast":j.settings.skin;l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}if(j.settings.content_css!==false){j.contentCSS.push(j.baseURI.toAbsolute(k+"/skins/"+j.settings.skin+"/content.css"))}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l);j.onKeyUp.add(l._updateUndoStatus,l);j.onMouseUp.add(l._updateUndoStatus,l);j.dom.bind(j.dom.getRoot(),"dragend",function(){l._updateUndoStatus(j)})}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},_isHighContrast:function(){var i,j=d.add(d.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});i=(d.getStyle(j,"background-color",true)+"").toLowerCase().replace(/ /g,"");d.remove(j);return i!="rgb(171,239,86)"&&i!="#abef56"},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",attributes:{"class":n["class"]},selector:"*"});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(o){var p,n=[];f(l.items,function(q){n.push(q.value)});i.focus();i.undoManager.add();p=i.formatter.matchAll(n);if(!o||p[0]==o){if(p[0]){i.formatter.remove(p[0])}}else{i.formatter.apply(o)}i.undoManager.add();i.nodeChanged();return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r,selector:"*"});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){var m=k.items[k.selectedIndex];if(!l&&m){i.execCommand("FontName",false,m.value);return}i.execCommand("FontName",false,l);k.select(function(n){return l==n});if(m&&m.value==l){k.select(null)}return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){var o=n.items[n.selectedIndex];if(!i&&o){o=o.value;if(o["class"]){k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}return}if(i["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:i["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,i.fontSize)}n.select(function(p){return i==p});if(o&&(o.value.fontSize==i.fontSize||o.value["class"]==i["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(l){j.editor.execCommand("FormatBlock",false,l);return false}});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;if(r.settings){r.settings.aria_label=w.aria_label+r.getLang("advanced.help_shortcut")}m=j=d.create("span",{role:"application","aria-labelledby":r.id+"_voice",id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});d.add(m,"span",{"class":"mceVoiceLabel",style:"display:none;",id:r.id+"_voice"},w.aria_label);if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{role:"presentation",id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},""),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;r.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){window.focus();v.toolbarGroup.focus();return b.cancel(n)}else{if(n.keyCode===o){d.get(p.id+"_path_row").focus();return b.cancel(n)}}}});r.addShortcut("alt+0","","mceShortcuts",v);return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_ifr");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,m,k){var j=this.editor,l=this.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr");i=Math.max(l.theme_advanced_resizing_min_width||100,i);m=Math.max(l.theme_advanced_resizing_min_height||100,m);i=Math.min(l.theme_advanced_resizing_max_width||65535,i);m=Math.min(l.theme_advanced_resizing_max_height||65535,m);d.setStyle(n,"height","");d.setStyle(o,"height",m);if(l.theme_advanced_resize_horizontal){d.setStyle(n,"width","");d.setStyle(o,"width",i);if(i"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row",role:"group","aria-labelledby":p.id+"_path_voice"});if(w.theme_advanced_path){d.add(k,"span",{id:p.id+"_path_voice"},p.translate("advanced.path"));d.add(k,"span",{},": ")}else{d.add(k,"span",{}," ")}if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}v.resizeTo(n.cw,n.ch)})}p.onPostRender.add(function(){b.add(p.id+"_resize","click",function(n){n.preventDefault()});b.add(p.id+"_resize","mousedown",function(D){var t,r,s,o,C,z,A,F,n,E,x;function y(G){G.preventDefault();n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E)}function B(G){b.remove(d.doc,"mousemove",t);b.remove(p.getDoc(),"mousemove",r);b.remove(d.doc,"mouseup",s);b.remove(p.getDoc(),"mouseup",o);n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E,true)}D.preventDefault();C=D.screenX;z=D.screenY;x=d.get(v.editor.id+"_ifr");A=n=x.clientWidth;F=E=x.clientHeight;t=b.add(d.doc,"mousemove",y);r=b.add(p.getDoc(),"mousemove",y);s=b.add(d.doc,"mouseup",B);o=b.add(p.getDoc(),"mouseup",B)})})}j.deltaHeight-=21;k=m=null},_updateUndoStatus:function(j){var i=j.controlManager,k=j.undoManager;i.setDisabled("undo",!k.hasUndo()&&!k.typing);i.setDisabled("redo",!k.hasRedo())},_nodeChanged:function(m,r,D,q,E){var y=this,C,F=0,x,G,z=y.settings,w,k,u,B,l,j,i;e.each(y.stateControls,function(n){r.setActive(n,m.queryCommandState(y.controls[n][1]))});function o(p){var s,n=E.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s0){y.statusKeyboardNavigation=new e.ui.KeyboardNavigation({root:m.id+"_path_row",items:d.select("a",C),excludeFromTabOrder:true,onCancel:function(){m.focus()}},d)}}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var i=this.editor;i.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce)); \ No newline at end of file diff --git a/www/javascript/tiny_mce/themes/advanced/editor_template_src.js b/www/javascript/tiny_mce/themes/advanced/editor_template_src.js deleted file mode 100644 index d62f497e6..000000000 --- a/www/javascript/tiny_mce/themes/advanced/editor_template_src.js +++ /dev/null @@ -1,1358 +0,0 @@ -/** - * editor_template_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function(tinymce) { - var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode; - - // Tell it to load theme specific language pack(s) - tinymce.ThemeManager.requireLangPack('advanced'); - - tinymce.create('tinymce.themes.AdvancedTheme', { - sizes : [8, 10, 12, 14, 18, 24, 36], - - // Control name lookup, format: title, command - controls : { - bold : ['bold_desc', 'Bold'], - italic : ['italic_desc', 'Italic'], - underline : ['underline_desc', 'Underline'], - strikethrough : ['striketrough_desc', 'Strikethrough'], - justifyleft : ['justifyleft_desc', 'JustifyLeft'], - justifycenter : ['justifycenter_desc', 'JustifyCenter'], - justifyright : ['justifyright_desc', 'JustifyRight'], - justifyfull : ['justifyfull_desc', 'JustifyFull'], - bullist : ['bullist_desc', 'InsertUnorderedList'], - numlist : ['numlist_desc', 'InsertOrderedList'], - outdent : ['outdent_desc', 'Outdent'], - indent : ['indent_desc', 'Indent'], - cut : ['cut_desc', 'Cut'], - copy : ['copy_desc', 'Copy'], - paste : ['paste_desc', 'Paste'], - undo : ['undo_desc', 'Undo'], - redo : ['redo_desc', 'Redo'], - link : ['link_desc', 'mceLink'], - unlink : ['unlink_desc', 'unlink'], - image : ['image_desc', 'mceImage'], - cleanup : ['cleanup_desc', 'mceCleanup'], - help : ['help_desc', 'mceHelp'], - code : ['code_desc', 'mceCodeEditor'], - hr : ['hr_desc', 'InsertHorizontalRule'], - removeformat : ['removeformat_desc', 'RemoveFormat'], - sub : ['sub_desc', 'subscript'], - sup : ['sup_desc', 'superscript'], - forecolor : ['forecolor_desc', 'ForeColor'], - forecolorpicker : ['forecolor_desc', 'mceForeColor'], - backcolor : ['backcolor_desc', 'HiliteColor'], - backcolorpicker : ['backcolor_desc', 'mceBackColor'], - charmap : ['charmap_desc', 'mceCharMap'], - visualaid : ['visualaid_desc', 'mceToggleVisualAid'], - anchor : ['anchor_desc', 'mceInsertAnchor'], - newdocument : ['newdocument_desc', 'mceNewDocument'], - blockquote : ['blockquote_desc', 'mceBlockQuote'] - }, - - stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'], - - init : function(ed, url) { - var t = this, s, v, o; - - t.editor = ed; - t.url = url; - t.onResolveName = new tinymce.util.Dispatcher(this); - - ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast(); - ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin; - - // Default settings - t.settings = s = extend({ - theme_advanced_path : true, - theme_advanced_toolbar_location : 'bottom', - theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect", - theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code", - theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap", - theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6", - theme_advanced_toolbar_align : "center", - theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats", - theme_advanced_more_colors : 1, - theme_advanced_row_height : 23, - theme_advanced_resize_horizontal : 1, - theme_advanced_resizing_use_cookie : 1, - theme_advanced_font_sizes : "1,2,3,4,5,6,7", - theme_advanced_font_selector : "span", - theme_advanced_show_current_color: 0, - readonly : ed.settings.readonly - }, ed.settings); - - // Setup default font_size_style_values - if (!s.font_size_style_values) - s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt"; - - if (tinymce.is(s.theme_advanced_font_sizes, 'string')) { - s.font_size_style_values = tinymce.explode(s.font_size_style_values); - s.font_size_classes = tinymce.explode(s.font_size_classes || ''); - - // Parse string value - o = {}; - ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes; - each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) { - var cl; - - if (k == v && v >= 1 && v <= 7) { - k = v + ' (' + t.sizes[v - 1] + 'pt)'; - cl = s.font_size_classes[v - 1]; - v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt'); - } - - if (/^\s*\./.test(v)) - cl = v.replace(/\./g, ''); - - o[k] = cl ? {'class' : cl} : {fontSize : v}; - }); - - s.theme_advanced_font_sizes = o; - } - - if ((v = s.theme_advanced_path_location) && v != 'none') - s.theme_advanced_statusbar_location = s.theme_advanced_path_location; - - if (s.theme_advanced_statusbar_location == 'none') - s.theme_advanced_statusbar_location = 0; - - if (ed.settings.content_css !== false) - ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css")); - - // Init editor - ed.onInit.add(function() { - if (!ed.settings.readonly) { - ed.onNodeChange.add(t._nodeChanged, t); - ed.onKeyUp.add(t._updateUndoStatus, t); - ed.onMouseUp.add(t._updateUndoStatus, t); - ed.dom.bind(ed.dom.getRoot(), 'dragend', function() { - t._updateUndoStatus(ed); - }); - } - }); - - ed.onSetProgressState.add(function(ed, b, ti) { - var co, id = ed.id, tb; - - if (b) { - t.progressTimer = setTimeout(function() { - co = ed.getContainer(); - co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild); - tb = DOM.get(ed.id + '_tbl'); - - DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}}); - DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}}); - }, ti || 0); - } else { - DOM.remove(id + '_blocker'); - DOM.remove(id + '_progress'); - clearTimeout(t.progressTimer); - } - }); - - DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css"); - - if (s.skin_variant) - DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css"); - }, - - _isHighContrast : function() { - var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'}); - - actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, ''); - DOM.remove(div); - - return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56'; - }, - - createControl : function(n, cf) { - var cd, c; - - if (c = cf.createControl(n)) - return c; - - switch (n) { - case "styleselect": - return this._createStyleSelect(); - - case "formatselect": - return this._createBlockFormats(); - - case "fontselect": - return this._createFontSelect(); - - case "fontsizeselect": - return this._createFontSizeSelect(); - - case "forecolor": - return this._createForeColorMenu(); - - case "backcolor": - return this._createBackColorMenu(); - } - - if ((cd = this.controls[n])) - return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]}); - }, - - execCommand : function(cmd, ui, val) { - var f = this['_' + cmd]; - - if (f) { - f.call(this, ui, val); - return true; - } - - return false; - }, - - _importClasses : function(e) { - var ed = this.editor, ctrl = ed.controlManager.get('styleselect'); - - if (ctrl.getLength() == 0) { - each(ed.dom.getClasses(), function(o, idx) { - var name = 'style_' + idx; - - ed.formatter.register(name, { - inline : 'span', - attributes : {'class' : o['class']}, - selector : '*' - }); - - ctrl.add(o['class'], name); - }); - } - }, - - _createStyleSelect : function(n) { - var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl; - - // Setup style select box - ctrl = ctrlMan.createListBox('styleselect', { - title : 'advanced.style_select', - onselect : function(name) { - var matches, formatNames = []; - - each(ctrl.items, function(item) { - formatNames.push(item.value); - }); - - ed.focus(); - ed.undoManager.add(); - - // Toggle off the current format - matches = ed.formatter.matchAll(formatNames); - if (!name || matches[0] == name) { - if (matches[0]) - ed.formatter.remove(matches[0]); - } else - ed.formatter.apply(name); - - ed.undoManager.add(); - ed.nodeChanged(); - - return false; // No auto select - } - }); - - // Handle specified format - ed.onInit.add(function() { - var counter = 0, formats = ed.getParam('style_formats'); - - if (formats) { - each(formats, function(fmt) { - var name, keys = 0; - - each(fmt, function() {keys++;}); - - if (keys > 1) { - name = fmt.name = fmt.name || 'style_' + (counter++); - ed.formatter.register(name, fmt); - ctrl.add(fmt.title, name); - } else - ctrl.add(fmt.title); - }); - } else { - each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) { - var name; - - if (val) { - name = 'style_' + (counter++); - - ed.formatter.register(name, { - inline : 'span', - classes : val, - selector : '*' - }); - - ctrl.add(t.editor.translate(key), name); - } - }); - } - }); - - // Auto import classes if the ctrl box is empty - if (ctrl.getLength() == 0) { - ctrl.onPostRender.add(function(ed, n) { - if (!ctrl.NativeListBox) { - Event.add(n.id + '_text', 'focus', t._importClasses, t); - Event.add(n.id + '_text', 'mousedown', t._importClasses, t); - Event.add(n.id + '_open', 'focus', t._importClasses, t); - Event.add(n.id + '_open', 'mousedown', t._importClasses, t); - } else - Event.add(n.id, 'focus', t._importClasses, t); - }); - } - - return ctrl; - }, - - _createFontSelect : function() { - var c, t = this, ed = t.editor; - - c = ed.controlManager.createListBox('fontselect', { - title : 'advanced.fontdefault', - onselect : function(v) { - var cur = c.items[c.selectedIndex]; - - if (!v && cur) { - ed.execCommand('FontName', false, cur.value); - return; - } - - ed.execCommand('FontName', false, v); - - // Fake selection, execCommand will fire a nodeChange and update the selection - c.select(function(sv) { - return v == sv; - }); - - if (cur && cur.value == v) { - c.select(null); - } - - return false; // No auto select - } - }); - - if (c) { - each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) { - c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''}); - }); - } - - return c; - }, - - _createFontSizeSelect : function() { - var t = this, ed = t.editor, c, i = 0, cl = []; - - c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) { - var cur = c.items[c.selectedIndex]; - - if (!v && cur) { - cur = cur.value; - - if (cur['class']) { - ed.formatter.toggle('fontsize_class', {value : cur['class']}); - ed.undoManager.add(); - ed.nodeChanged(); - } else { - ed.execCommand('FontSize', false, cur.fontSize); - } - - return; - } - - if (v['class']) { - ed.focus(); - ed.undoManager.add(); - ed.formatter.toggle('fontsize_class', {value : v['class']}); - ed.undoManager.add(); - ed.nodeChanged(); - } else - ed.execCommand('FontSize', false, v.fontSize); - - // Fake selection, execCommand will fire a nodeChange and update the selection - c.select(function(sv) { - return v == sv; - }); - - if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] == v['class'])) { - c.select(null); - } - - return false; // No auto select - }}); - - if (c) { - each(t.settings.theme_advanced_font_sizes, function(v, k) { - var fz = v.fontSize; - - if (fz >= 1 && fz <= 7) - fz = t.sizes[parseInt(fz) - 1] + 'pt'; - - c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))}); - }); - } - - return c; - }, - - _createBlockFormats : function() { - var c, fmts = { - p : 'advanced.paragraph', - address : 'advanced.address', - pre : 'advanced.pre', - h1 : 'advanced.h1', - h2 : 'advanced.h2', - h3 : 'advanced.h3', - h4 : 'advanced.h4', - h5 : 'advanced.h5', - h6 : 'advanced.h6', - div : 'advanced.div', - blockquote : 'advanced.blockquote', - code : 'advanced.code', - dt : 'advanced.dt', - dd : 'advanced.dd', - samp : 'advanced.samp' - }, t = this; - - c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) { - t.editor.execCommand('FormatBlock', false, v); - return false; - }}); - - if (c) { - each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) { - c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v}); - }); - } - - return c; - }, - - _createForeColorMenu : function() { - var c, t = this, s = t.settings, o = {}, v; - - if (s.theme_advanced_more_colors) { - o.more_colors_func = function() { - t._mceColorPicker(0, { - color : c.value, - func : function(co) { - c.setColor(co); - } - }); - }; - } - - if (v = s.theme_advanced_text_colors) - o.colors = v; - - if (s.theme_advanced_default_foreground_color) - o.default_color = s.theme_advanced_default_foreground_color; - - o.title = 'advanced.forecolor_desc'; - o.cmd = 'ForeColor'; - o.scope = this; - - c = t.editor.controlManager.createColorSplitButton('forecolor', o); - - return c; - }, - - _createBackColorMenu : function() { - var c, t = this, s = t.settings, o = {}, v; - - if (s.theme_advanced_more_colors) { - o.more_colors_func = function() { - t._mceColorPicker(0, { - color : c.value, - func : function(co) { - c.setColor(co); - } - }); - }; - } - - if (v = s.theme_advanced_background_colors) - o.colors = v; - - if (s.theme_advanced_default_background_color) - o.default_color = s.theme_advanced_default_background_color; - - o.title = 'advanced.backcolor_desc'; - o.cmd = 'HiliteColor'; - o.scope = this; - - c = t.editor.controlManager.createColorSplitButton('backcolor', o); - - return c; - }, - - renderUI : function(o) { - var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl; - - if (ed.settings) { - ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut'); - } - - // TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for. - // Maybe actually inherit it from the original textara? - n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')}); - DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label); - - if (!DOM.boxModel) - n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'}); - - n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0}); - n = tb = DOM.add(n, 'tbody'); - - switch ((s.theme_advanced_layout_manager || '').toLowerCase()) { - case "rowlayout": - ic = t._rowLayout(s, tb, o); - break; - - case "customlayout": - ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p); - break; - - default: - ic = t._simpleLayout(s, tb, o, p); - } - - n = o.targetNode; - - // Add classes to first and last TRs - nl = sc.rows; - DOM.addClass(nl[0], 'mceFirst'); - DOM.addClass(nl[nl.length - 1], 'mceLast'); - - // Add classes to first and last TDs - each(DOM.select('tr', tb), function(n) { - DOM.addClass(n.firstChild, 'mceFirst'); - DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast'); - }); - - if (DOM.get(s.theme_advanced_toolbar_container)) - DOM.get(s.theme_advanced_toolbar_container).appendChild(p); - else - DOM.insertAfter(p, n); - - Event.add(ed.id + '_path_row', 'click', function(e) { - e = e.target; - - if (e.nodeName == 'A') { - t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1')); - - return Event.cancel(e); - } - }); -/* - if (DOM.get(ed.id + '_path_row')) { - Event.add(ed.id + '_tbl', 'mouseover', function(e) { - var re; - - e = e.target; - - if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) { - re = DOM.get(ed.id + '_path_row'); - t.lastPath = re.innerHTML; - DOM.setHTML(re, e.parentNode.title); - } - }); - - Event.add(ed.id + '_tbl', 'mouseout', function(e) { - if (t.lastPath) { - DOM.setHTML(ed.id + '_path_row', t.lastPath); - t.lastPath = 0; - } - }); - } -*/ - - if (!ed.getParam('accessibility_focus')) - Event.add(DOM.add(p, 'a', {href : '#'}, ''), 'focus', function() {tinyMCE.get(ed.id).focus();}); - - if (s.theme_advanced_toolbar_location == 'external') - o.deltaHeight = 0; - - t.deltaHeight = o.deltaHeight; - o.targetNode = null; - - ed.onKeyDown.add(function(ed, evt) { - var DOM_VK_F10 = 121, DOM_VK_F11 = 122; - - if (evt.altKey) { - if (evt.keyCode === DOM_VK_F10) { - window.focus(); - t.toolbarGroup.focus(); - return Event.cancel(evt); - } else if (evt.keyCode === DOM_VK_F11) { - DOM.get(ed.id + '_path_row').focus(); - return Event.cancel(evt); - } - } - }); - - // alt+0 is the UK recommended shortcut for accessing the list of access controls. - ed.addShortcut('alt+0', '', 'mceShortcuts', t); - - return { - iframeContainer : ic, - editorContainer : ed.id + '_parent', - sizeContainer : sc, - deltaHeight : o.deltaHeight - }; - }, - - getInfo : function() { - return { - longname : 'Advanced theme', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - version : tinymce.majorVersion + "." + tinymce.minorVersion - } - }, - - resizeBy : function(dw, dh) { - var e = DOM.get(this.editor.id + '_ifr'); - - this.resizeTo(e.clientWidth + dw, e.clientHeight + dh); - }, - - resizeTo : function(w, h, store) { - var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr'); - - // Boundery fix box - w = Math.max(s.theme_advanced_resizing_min_width || 100, w); - h = Math.max(s.theme_advanced_resizing_min_height || 100, h); - w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w); - h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h); - - // Resize iframe and container - DOM.setStyle(e, 'height', ''); - DOM.setStyle(ifr, 'height', h); - - if (s.theme_advanced_resize_horizontal) { - DOM.setStyle(e, 'width', ''); - DOM.setStyle(ifr, 'width', w); - - // Make sure that the size is never smaller than the over all ui - if (w < e.clientWidth) { - w = e.clientWidth; - DOM.setStyle(ifr, 'width', e.clientWidth); - } - } - - // Store away the size - if (store && s.theme_advanced_resizing_use_cookie) { - Cookie.setHash("TinyMCE_" + ed.id + "_size", { - cw : w, - ch : h - }); - } - }, - - destroy : function() { - var id = this.editor.id; - - Event.clear(id + '_resize'); - Event.clear(id + '_path_row'); - Event.clear(id + '_external_close'); - }, - - // Internal functions - - _simpleLayout : function(s, tb, o, p) { - var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c; - - if (s.readonly) { - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - return ic; - } - - // Create toolbar container at top - if (lo == 'top') - t._addToolbars(tb, o); - - // Create external toolbar - if (lo == 'external') { - n = c = DOM.create('div', {style : 'position:relative'}); - n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'}); - DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'}); - n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0}); - etb = DOM.add(n, 'tbody'); - - if (p.firstChild.className == 'mceOldBoxModel') - p.firstChild.appendChild(c); - else - p.insertBefore(c, p.firstChild); - - t._addToolbars(etb, o); - - ed.onMouseUp.add(function() { - var e = DOM.get(ed.id + '_external'); - DOM.show(e); - - DOM.hide(lastExtID); - - var f = Event.add(ed.id + '_external_close', 'click', function() { - DOM.hide(ed.id + '_external'); - Event.remove(ed.id + '_external_close', 'click', f); - }); - - DOM.show(e); - DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1); - - // Fixes IE rendering bug - DOM.hide(e); - DOM.show(e); - e.style.filter = ''; - - lastExtID = ed.id + '_external'; - - e = null; - }); - } - - if (sl == 'top') - t._addStatusBar(tb, o); - - // Create iframe container - if (!s.theme_advanced_toolbar_container) { - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - } - - // Create toolbar container at bottom - if (lo == 'bottom') - t._addToolbars(tb, o); - - if (sl == 'bottom') - t._addStatusBar(tb, o); - - return ic; - }, - - _rowLayout : function(s, tb, o) { - var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a; - - dc = s.theme_advanced_containers_default_class || ''; - da = s.theme_advanced_containers_default_align || 'center'; - - each(explode(s.theme_advanced_containers || ''), function(c, i) { - var v = s['theme_advanced_container_' + c] || ''; - - switch (c.toLowerCase()) { - case 'mceeditor': - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'}); - break; - - case 'mceelementpath': - t._addStatusBar(tb, o); - break; - - default: - a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase(); - a = 'mce' + t._ufirst(a); - - n = DOM.add(DOM.add(tb, 'tr'), 'td', { - 'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da - }); - - to = cf.createToolbar("toolbar" + i); - t._addControls(v, to); - DOM.setHTML(n, to.renderHTML()); - o.deltaHeight -= s.theme_advanced_row_height; - } - }); - - return ic; - }, - - _addControls : function(v, tb) { - var t = this, s = t.settings, di, cf = t.editor.controlManager; - - if (s.theme_advanced_disable && !t._disabled) { - di = {}; - - each(explode(s.theme_advanced_disable), function(v) { - di[v] = 1; - }); - - t._disabled = di; - } else - di = t._disabled; - - each(explode(v), function(n) { - var c; - - if (di && di[n]) - return; - - // Compatiblity with 2.x - if (n == 'tablecontrols') { - each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) { - n = t.createControl(n, cf); - - if (n) - tb.add(n); - }); - - return; - } - - c = t.createControl(n, cf); - - if (c) - tb.add(c); - }); - }, - - _addToolbars : function(c, o) { - var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup; - - toolbarGroup = cf.createToolbarGroup('toolbargroup', { - 'name': ed.getLang('advanced.toolbar'), - 'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar') - }); - - t.toolbarGroup = toolbarGroup; - - a = s.theme_advanced_toolbar_align.toLowerCase(); - a = 'mce' + t._ufirst(a); - - n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"}); - - // Create toolbar and add the controls - for (i=1; (v = s['theme_advanced_buttons' + i]); i++) { - tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i}); - - if (s['theme_advanced_buttons' + i + '_add']) - v += ',' + s['theme_advanced_buttons' + i + '_add']; - - if (s['theme_advanced_buttons' + i + '_add_before']) - v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v; - - t._addControls(v, tb); - toolbarGroup.add(tb); - - o.deltaHeight -= s.theme_advanced_row_height; - } - h.push(toolbarGroup.renderHTML()); - h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '')); - DOM.setHTML(n, h.join('')); - }, - - _addStatusBar : function(tb, o) { - var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td; - - n = DOM.add(tb, 'tr'); - n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); - n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'}); - if (s.theme_advanced_path) { - DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path')); - DOM.add(n, 'span', {}, ': '); - } else { - DOM.add(n, 'span', {}, ' '); - } - - - if (s.theme_advanced_resizing) { - DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'}); - - if (s.theme_advanced_resizing_use_cookie) { - ed.onPostRender.add(function() { - var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl'); - - if (!o) - return; - - t.resizeTo(o.cw, o.ch); - }); - } - - ed.onPostRender.add(function() { - Event.add(ed.id + '_resize', 'click', function(e) { - e.preventDefault(); - }); - - Event.add(ed.id + '_resize', 'mousedown', function(e) { - var mouseMoveHandler1, mouseMoveHandler2, - mouseUpHandler1, mouseUpHandler2, - startX, startY, startWidth, startHeight, width, height, ifrElm; - - function resizeOnMove(e) { - e.preventDefault(); - - width = startWidth + (e.screenX - startX); - height = startHeight + (e.screenY - startY); - - t.resizeTo(width, height); - }; - - function endResize(e) { - // Stop listening - Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1); - Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2); - Event.remove(DOM.doc, 'mouseup', mouseUpHandler1); - Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2); - - width = startWidth + (e.screenX - startX); - height = startHeight + (e.screenY - startY); - t.resizeTo(width, height, true); - }; - - e.preventDefault(); - - // Get the current rect size - startX = e.screenX; - startY = e.screenY; - ifrElm = DOM.get(t.editor.id + '_ifr'); - startWidth = width = ifrElm.clientWidth; - startHeight = height = ifrElm.clientHeight; - - // Register envent handlers - mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove); - mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove); - mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize); - mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize); - }); - }); - } - - o.deltaHeight -= 21; - n = tb = null; - }, - - _updateUndoStatus : function(ed) { - var cm = ed.controlManager, um = ed.undoManager; - - cm.setDisabled('undo', !um.hasUndo() && !um.typing); - cm.setDisabled('redo', !um.hasRedo()); - }, - - _nodeChanged : function(ed, cm, n, co, ob) { - var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches; - - tinymce.each(t.stateControls, function(c) { - cm.setActive(c, ed.queryCommandState(t.controls[c][1])); - }); - - function getParent(name) { - var i, parents = ob.parents, func = name; - - if (typeof(name) == 'string') { - func = function(node) { - return node.nodeName == name; - }; - } - - for (i = 0; i < parents.length; i++) { - if (func(parents[i])) - return parents[i]; - } - }; - - cm.setActive('visualaid', ed.hasVisual); - t._updateUndoStatus(ed); - cm.setDisabled('outdent', !ed.queryCommandState('Outdent')); - - p = getParent('A'); - if (c = cm.get('link')) { - if (!p || !p.name) { - c.setDisabled(!p && co); - c.setActive(!!p); - } - } - - if (c = cm.get('unlink')) { - c.setDisabled(!p && co); - c.setActive(!!p && !p.name); - } - - if (c = cm.get('anchor')) { - c.setActive(!co && !!p && p.name); - } - - p = getParent('IMG'); - if (c = cm.get('image')) - c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1); - - if (c = cm.get('styleselect')) { - t._importClasses(); - - formatNames = []; - each(c.items, function(item) { - formatNames.push(item.value); - }); - - matches = ed.formatter.matchAll(formatNames); - c.select(matches[0]); - } - - if (c = cm.get('formatselect')) { - p = getParent(DOM.isBlock); - - if (p) - c.select(p.nodeName.toLowerCase()); - } - - // Find out current fontSize, fontFamily and fontClass - getParent(function(n) { - if (n.nodeName === 'SPAN') { - if (!cl && n.className) - cl = n.className; - } - - if (ed.dom.is(n, s.theme_advanced_font_selector)) { - if (!fz && n.style.fontSize) - fz = n.style.fontSize; - - if (!fn && n.style.fontFamily) - fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase(); - - if (!fc && n.style.color) - fc = n.style.color; - - if (!bc && n.style.backgroundColor) - bc = n.style.backgroundColor; - } - - return false; - }); - - if (c = cm.get('fontselect')) { - c.select(function(v) { - return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn; - }); - } - - // Select font size - if (c = cm.get('fontsizeselect')) { - // Use computed style - if (s.theme_advanced_runtime_fontsize && !fz && !cl) - fz = ed.dom.getStyle(n, 'fontSize', true); - - c.select(function(v) { - if (v.fontSize && v.fontSize === fz) - return true; - - if (v['class'] && v['class'] === cl) - return true; - }); - } - - if (s.theme_advanced_show_current_color) { - function updateColor(controlId, color) { - if (c = cm.get(controlId)) { - if (!color) - color = c.settings.default_color; - if (color !== c.value) { - c.displayColor(color); - } - } - } - updateColor('forecolor', fc); - updateColor('backcolor', bc); - } - - if (s.theme_advanced_show_current_color) { - function updateColor(controlId, color) { - if (c = cm.get(controlId)) { - if (!color) - color = c.settings.default_color; - if (color !== c.value) { - c.displayColor(color); - } - } - }; - - updateColor('forecolor', fc); - updateColor('backcolor', bc); - } - - if (s.theme_advanced_path && s.theme_advanced_statusbar_location) { - p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'}); - - if (t.statusKeyboardNavigation) { - t.statusKeyboardNavigation.destroy(); - t.statusKeyboardNavigation = null; - } - - DOM.setHTML(p, ''); - - getParent(function(n) { - var na = n.nodeName.toLowerCase(), u, pi, ti = ''; - - // Ignore non element and bogus/hidden elements - if (n.nodeType != 1 || na === 'br' || n.getAttribute('data-mce-bogus') || DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')) - return; - - // Handle prefix - if (tinymce.isIE && n.scopeName !== 'HTML') - na = n.scopeName + ':' + na; - - // Remove internal prefix - na = na.replace(/mce\:/g, ''); - - // Handle node name - switch (na) { - case 'b': - na = 'strong'; - break; - - case 'i': - na = 'em'; - break; - - case 'img': - if (v = DOM.getAttrib(n, 'src')) - ti += 'src: ' + v + ' '; - - break; - - case 'a': - if (v = DOM.getAttrib(n, 'name')) { - ti += 'name: ' + v + ' '; - na += '#' + v; - } - - if (v = DOM.getAttrib(n, 'href')) - ti += 'href: ' + v + ' '; - - break; - - case 'font': - if (v = DOM.getAttrib(n, 'face')) - ti += 'font: ' + v + ' '; - - if (v = DOM.getAttrib(n, 'size')) - ti += 'size: ' + v + ' '; - - if (v = DOM.getAttrib(n, 'color')) - ti += 'color: ' + v + ' '; - - break; - - case 'span': - if (v = DOM.getAttrib(n, 'style')) - ti += 'style: ' + v + ' '; - - break; - } - - if (v = DOM.getAttrib(n, 'id')) - ti += 'id: ' + v + ' '; - - if (v = n.className) { - v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '') - - if (v) { - ti += 'class: ' + v + ' '; - - if (DOM.isBlock(n) || na == 'img' || na == 'span') - na += '.' + v; - } - } - - na = na.replace(/(html:)/g, ''); - na = {name : na, node : n, title : ti}; - t.onResolveName.dispatch(t, na); - ti = na.title; - na = na.name; - - //u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');"; - pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na); - - if (p.hasChildNodes()) { - p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild); - p.insertBefore(pi, p.firstChild); - } else - p.appendChild(pi); - }, ed.getBody()); - - if (DOM.select('a', p).length > 0) { - t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({ - root: ed.id + "_path_row", - items: DOM.select('a', p), - excludeFromTabOrder: true, - onCancel: function() { - ed.focus(); - } - }, DOM); - } - } - }, - - // Commands gets called by execCommand - - _sel : function(v) { - this.editor.execCommand('mceSelectNodeDepth', false, v); - }, - - _mceInsertAnchor : function(ui, v) { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/anchor.htm', - width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)), - height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceCharMap : function() { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/charmap.htm', - width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)), - height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceHelp : function() { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/about.htm', - width : 480, - height : 380, - inline : true - }, { - theme_url : this.url - }); - }, - - _mceShortcuts : function() { - var ed = this.editor; - ed.windowManager.open({ - url: this.url + '/shortcuts.htm', - width: 480, - height: 380, - inline: true - }, { - theme_url: this.url - }); - }, - - _mceColorPicker : function(u, v) { - var ed = this.editor; - - v = v || {}; - - ed.windowManager.open({ - url : this.url + '/color_picker.htm', - width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)), - height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)), - close_previous : false, - inline : true - }, { - input_color : v.color, - func : v.func, - theme_url : this.url - }); - }, - - _mceCodeEditor : function(ui, val) { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/source_editor.htm', - width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)), - height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)), - inline : true, - resizable : true, - maximizable : true - }, { - theme_url : this.url - }); - }, - - _mceImage : function(ui, val) { - var ed = this.editor; - - // Internal image object like a flash placeholder - if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1) - return; - - ed.windowManager.open({ - url : this.url + '/image.htm', - width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)), - height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceLink : function(ui, val) { - var ed = this.editor; - - ed.windowManager.open({ - url : this.url + '/link.htm', - width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)), - height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)), - inline : true - }, { - theme_url : this.url - }); - }, - - _mceNewDocument : function() { - var ed = this.editor; - - ed.windowManager.confirm('advanced.newdocument', function(s) { - if (s) - ed.execCommand('mceSetContent', false, ''); - }); - }, - - _mceForeColor : function() { - var t = this; - - this._mceColorPicker(0, { - color: t.fgColor, - func : function(co) { - t.fgColor = co; - t.editor.execCommand('ForeColor', false, co); - } - }); - }, - - _mceBackColor : function() { - var t = this; - - this._mceColorPicker(0, { - color: t.bgColor, - func : function(co) { - t.bgColor = co; - t.editor.execCommand('HiliteColor', false, co); - } - }); - }, - - _ufirst : function(s) { - return s.substring(0, 1).toUpperCase() + s.substring(1); - } - }); - - tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme); -}(tinymce)); diff --git a/www/javascript/tiny_mce/themes/advanced/image.htm b/www/javascript/tiny_mce/themes/advanced/image.htm deleted file mode 100644 index b8ba729f6..000000000 --- a/www/javascript/tiny_mce/themes/advanced/image.htm +++ /dev/null @@ -1,80 +0,0 @@ - - - - {#advanced_dlg.image_title} - - - - - - -
- - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
 
- x -
-
-
- -
- - -
-
- - diff --git a/www/javascript/tiny_mce/themes/advanced/img/colorpicker.jpg b/www/javascript/tiny_mce/themes/advanced/img/colorpicker.jpg deleted file mode 100644 index b1a377aba7784d3a0a0fabb4d22b8114cde25ace..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2584 zcmb7Bc{JPk7XQT-ib;b~B!n)ZQYwihloXMus-;?bMO70&%O72KlgJueK-#swASle5Y5YhT*O%%dE zAkc>z8ik-xeL_Q`VvZfo0TzI`m>5`0R2&QjOGtcPyzrU;Ul*Hn2<045)l;>V5-MK0^|t(rvM}*3>DEeQ&X2g z3ksC~i~iFKh=?B5i-83o3#TV^B0=RA*fOi#-=2VN?CKn!VTTmGv17_PGbp~tmc*?G?Q3b)|K!w2vr zE#B_JH@ru}sZ}~Z&Y(BdJ;w0B<_kXtGuOzs3$vq}6fO9@x%kiyX*#pRnd1k|;ZC9lr#>sh{3$yY|bYY6^>YT3sgsjiaZ zt)366^&;$S^TAwvN^I2ac+hLh>*VqIos|eL+aL&+l(KvNwWYDctNE^CZRyy^Hk}Gm zs%JVikvO#Mk)X?@TXY=wD38V@;t?)q3)?k2YvxLQMV|Z{nbR2g{a11;p-%!QgLK)B zOxbfUi(pzhsbuCxGBk6FDP#0RPN626_I($Qo;ZGhzWMfs%mMoI+aSZnc5a0+bG2w> zdwgm4&zp*i7B>D%H%G$4FMfG12)D3b{1}-HBqY<6w=n2s8b{B_D%uFYtH{l(Gjv9e zWpFy-6fULzp*cl~BJ4!l*}~J{8#NXk`;x5Nxc+^GEA?|AACg+K)(M|zxHsxFUr9^W z8>QdvdWEw!My?R7!O*p>?3Vb|(=N3|J09OD{Yf#{7*(=rbThiBH~Pm^1tz8SQ?S_2 zsL7(bX9dJ9E%uV^(+dSB)^w=MsF&jg*N2Yjo41m`+WsE&JM@CatfiOlPhC?QPlCp7 zkjesJENk4=dSaN^0M0u1TG4#qeAKgyC$GLGD7II&*kr2|#1!BvS`Grg^OIWk%YAqd zvOcmz%SU-HCVg&rbnPaNZ@-T>)?IP3SO z`YKP&>q@U~m`o*wvU{S1o};9b|8*hRw?;H&TJo4a*7;m_)Q!aD3a1rnAWdVgkH=Lu zObSl!m}$JlWj5VNXvuO#F5@@cmhB(M4yEbSXe%Ptp_SH5SxG-pk!2PJGzE6Dd$(C0 z@d~vVd*NT)SU<2GYn`hA?4|dNDwAu?ZjXWSO9CasoBO}LQ2uFAj@4t0$2xTLEHxw3 z9KJCkFq|08Vmgmxahm%mjA%=I%Gs1mlNy$Km`%^o|A2`!bMPtTrP9y*c^+0M7OCcy z*j^fh4AjCI;2fso0|cz3p5Ih7h72bSVc6YE5O%+w*;qWtI~3hL4IzfscqG;j3j4$- zGt%o#6n#5{gEJw#3{=edteC(w|C#XBp!T8k; z1)EnwGqJ26>c-cDOJv5}Snt!0vhVoS>u03BZj_q+20phaQo81-&IAo;URjUJNTP{F zJ1=+YL^+~uVv(VHc>guRDB*Gug-NN7$n25zaX5RGugKeb5qMo|<1CcSE4+{PPcxQG zv3ZU;p_ZeurmcbMiK+xooGWRsM@gr+Dhpr7I*ST8obbMa5|CLQW{h63?CM{F=X{nL zs0Exdc{AnwAx@;9BObf9QiL5^p(iN?W^L~%mn5*ee?M2!d$&oxYIK&9bd1oX&-$gA z3T&To>*_6TDnv)9{*of(wm?U7D)X3u^_3;FijXcEo0S{8x^h(v0jeTdW0Q} zOC0Y|wO&b<-xFprPec9-SKwJYz4Pbz|~nyPrCb5|2|%P;^(%>|XHw4OO3JkE+QD zWRIhqlT(0Yu4KKuvUjKlnW`S~l&?fXH-Bf`2d!J=4UHXDv4xLDnvd2_EWTb3hReh6sXpEI(hmlM{1 gF4ie0tgS$y#z=nxNn#Fpd0bt##g=j86Aowo21S>Ot^fc4 diff --git a/www/javascript/tiny_mce/themes/advanced/img/iframe.gif b/www/javascript/tiny_mce/themes/advanced/img/iframe.gif deleted file mode 100644 index 410c7ad084db698e9f35e3230233aa4040682566..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 600 zcmZ?wbhEHb6krfwcoxm@|NsB$<##6SeDUYszh8g<{{H*-%a7k_-3KZc-T3+YPwBiX zzyAIE^Y`z!U%$Wp{QdX;|FQ*Fw;jIy{pasbUw?o3{yVB>Q_sRgx-G9iegFLZcfrha#d9w;%sU=Zx~6K$tw~$%z4`#O^Y@3Z zKV#~)MpSKh@#b63l#}6=>yq2|{`&JLqwny)|NnC)o%r$l&-Y)yKYjo8?#quSuRaGB zt_&<%`RV)bl#YEr{`~p)?RU|v^Y1_Z`u*?Ux8J`*N>>+5JlMAOZr+qr@y$D{mfVhO z+zt#7208-8pDc_F4ABfaAUi>E!oa?@A-bu#r8Qd6oKeb*Lx9UTz)0QBL@+vxY38ii zvqGa87c5+~h&?)zVa3W-D;=U$88}^qMBJ^ERU|z17!;#97+4%Rd1XcXJq#>t8KR;E z7zr5i6BgH5y=gAD)sAQlGB zh8au?j!n~E(Pks?@!j1fR&j*RWY8GF(-=x H6d0@lT&58X diff --git a/www/javascript/tiny_mce/themes/advanced/img/pagebreak.gif b/www/javascript/tiny_mce/themes/advanced/img/pagebreak.gif deleted file mode 100644 index acdf4085f3068c4c0a1d6855f4b80dae8bac3068..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 325 zcmV-L0lNN2Nk%w1VPpUd0J9GO`>v<{=;ru;boX6P{`2zsmyZ3>&HK5t_;hIbi-G;z z+4`cI{KdfcXj}GCLjV8&A^8LW000jFEC2ui0Av6R000E?@X1N5y*TU5yZ>M)j$|1M z4Ouvb$pHu>IW8BZq|n;U0s@T!VM5~w1_+1X!EiVl!&PITYdjT!ffYfpt{jAfv%qvh zA63WUHSlr7LkeyaV4(pM0f50(II?RD4RtMg4-E+tFhdAy5{3c=0}3Bg9Y8`B2To20 zR%SO62L%9}0H+dzoKB$+2TOwzUrwi{XiBM^4V#>63q3!LsU3u93zH8CdwqY%62;1g z0g8ze$k93lWExp`CUe|K4qOWk17ZeJ0|5pDP6+}};{>bI@lOWj=kf}r2sHp7w9-Ie XK%9UG6W(*AX-vY05F<*&5CH%?Gwy&_ diff --git a/www/javascript/tiny_mce/themes/advanced/img/quicktime.gif b/www/javascript/tiny_mce/themes/advanced/img/quicktime.gif deleted file mode 100644 index 8f10e7aa6b6ab40ee69a1a41a961c092168d6fda..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 301 zcmV+|0n+|QNk%w1VGsZi0Q4UK+~)L6v+~s9^fsC5ZpZP=*zu3F=Jxpf8k_5u%JNv6 z=md-84VLU4w)kSE=yI&-yw>b=v+SqE?+kq47pC+YrR?bJ^yu>Zyvpn;hTp*6^mM!O zu+8!}sO$`q%8%`=C5EEn#1d#z95FHtK5(^#(cp^e+Y!d=4FCrFbY9A3U z4-O0-4kHJPJ2(jk13n5879s!!3Q`V>8VwW`9my3H#|R8ZD+fdx0E-+693cQZ;!k;* diff --git a/www/javascript/tiny_mce/themes/advanced/img/realmedia.gif b/www/javascript/tiny_mce/themes/advanced/img/realmedia.gif deleted file mode 100644 index fdfe0b9ac05869ae845fdd828eaad97cc0c69dbc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 439 zcmV;o0Z9HwNk%w1VI=?(0K^{vQcz8xz}f&njBB06v9GQ`Jv%NdDHCI&z`wqZw$(Lw zuFTBL!Pe#<92tv>h)9OE1Xh}vnVEHSaeb-GByg#tqM_B*)YRkdSdqTu&}n`s(k;lb>H+`#+Q6|3c{>OLTv23;utm>DSfy zuOD3adm!iUuGar)4FAhzel5=UwZ7*6(K(+k@BP_g{o}}@k7u_2k7W2iGwlom!+#Z( z|Hj5w_4MwTo8QaHxm#EFYX1DUOO|}vvgQBb!_ST${rmj+`+Fep|C$j4HGtwz7FGrZ zO$Hs1VIV&_u+2R%#bJV$RKJIcL*N7vss0Y-EsB{gGlSJaTr>sRLKbLj5HMTpyK;)l zJcfpaMYltBZdEK6Kht6+BPy*VtthFMtIoqFC=#Tu$e^eaDXCC7U0vOYOJjNk(;P!VagC#fQ*?7otVO)-#9rK#nB%ry4`E_DHQ Wm01j~^6E13^D1O7+^=wCum%9s<%z=p diff --git a/www/javascript/tiny_mce/themes/advanced/img/trans.gif b/www/javascript/tiny_mce/themes/advanced/img/trans.gif deleted file mode 100644 index 388486517fa8da13ebd150e8f65d5096c3e10c3a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43 ncmZ?wbhEHbWMp7un7{x9ia%KxMSyG_5FaGNz{KRj$Y2csb)f_x diff --git a/www/javascript/tiny_mce/themes/advanced/img/video.gif b/www/javascript/tiny_mce/themes/advanced/img/video.gif deleted file mode 100644 index 3570104077a3b3585f11403c8d4c3fc9351f35d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 597 zcmZ?wbhEHb6krfwc$UTx9v<%P?Ok48Ze?YanwpxCkzrwBk(ZYzB_&l;Qw!gmM(Ep^QBwbzIoSdAh>*2n> zz9l6k0Xw#(?);y5^ls9w|LObxXI*si^YfcEYu3*P8J(S-PEJlaNB-yTd}C^Ax@_69 zzP`Ryt5)S5`=P3;TDk9SbaeFk_3NiTjGA~aFd-pf@}tlxQ>GLb7jM|Gp`oFHlaq7F zk|nvhxjsHV=g+oST3Rl6T(N1>rn0iK*Ed>3MMVn>3vF#}**q!otE>Sy|^jDoRUBoBANRc=wyaJged$+}u3x zK}ld>puWET{||NozXdO-0f3nK$V8iNkVNKl+Guy1NeYie$3 zZB}=&Zex!RYq8YfVwgNdMpdFkN|rU!Fha}0m66q>CDxczOhH^pM9qvxw1p`;Rftzu zQJ&9}g>iErlc2ORw;aC_=l*6UJ=st%r*ISVV2jgDT<)w>rXHGL<21Kdo z#uyug^O^t z0hZGrt*x!>$1C!zn`W5@`ts6_uMW)2%<0NUEKIo?SIPPE=}U0}7Z(?JcX!y=*;bF< zCWz-=h7+2ao9)(dOHM;+X=xs9)%!~xc&ICMZdRYdUQ2$^@9y(6X3NCIz{cM7f^Z=Q z1_tQ95kgl8b%R%OiYTIo7LSdE^@}A^8LW002J#EC2ui01p5U000KOz@O0K01zUifeIyT9%!RzMDgehG|mwLz+Eh; z7Z~iE zrX?OfJ^>XeDJK)xJuWOB3_l1N0Ra>g4Gk^=ED0V6LI?>4;Q|6OB{LplLMRLg8U5-E J?0y6R06W6!pgRBn diff --git a/www/javascript/tiny_mce/themes/advanced/js/about.js b/www/javascript/tiny_mce/themes/advanced/js/about.js deleted file mode 100644 index 5b3584576..000000000 --- a/www/javascript/tiny_mce/themes/advanced/js/about.js +++ /dev/null @@ -1,73 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -function init() { - var ed, tcont; - - tinyMCEPopup.resizeToInnerSize(); - ed = tinyMCEPopup.editor; - - // Give FF some time - window.setTimeout(insertHelpIFrame, 10); - - tcont = document.getElementById('plugintablecontainer'); - document.getElementById('plugins_tab').style.display = 'none'; - - var html = ""; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - - tinymce.each(ed.plugins, function(p, n) { - var info; - - if (!p.getInfo) - return; - - html += ''; - - info = p.getInfo(); - - if (info.infourl != null && info.infourl != '') - html += ''; - else - html += ''; - - if (info.authorurl != null && info.authorurl != '') - html += ''; - else - html += ''; - - html += ''; - html += ''; - - document.getElementById('plugins_tab').style.display = ''; - - }); - - html += ''; - html += '
' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
'; - - tcont.innerHTML = html; - - tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; - tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; -} - -function insertHelpIFrame() { - var html; - - if (tinyMCEPopup.getParam('docs_url')) { - html = ''; - document.getElementById('iframecontainer').innerHTML = html; - document.getElementById('help_tab').style.display = 'block'; - document.getElementById('help_tab').setAttribute("aria-hidden", "false"); - } -} - -tinyMCEPopup.onInit.add(init); diff --git a/www/javascript/tiny_mce/themes/advanced/js/anchor.js b/www/javascript/tiny_mce/themes/advanced/js/anchor.js deleted file mode 100644 index e528e4f42..000000000 --- a/www/javascript/tiny_mce/themes/advanced/js/anchor.js +++ /dev/null @@ -1,42 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var AnchorDialog = { - init : function(ed) { - var action, elm, f = document.forms[0]; - - this.editor = ed; - elm = ed.dom.getParent(ed.selection.getNode(), 'A'); - v = ed.dom.getAttrib(elm, 'name'); - - if (v) { - this.action = 'update'; - f.anchorName.value = v; - } - - f.insert.value = ed.getLang(elm ? 'update' : 'insert'); - }, - - update : function() { - var ed = this.editor, elm, name = document.forms[0].anchorName.value; - - if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { - tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); - return; - } - - tinyMCEPopup.restoreSelection(); - - if (this.action != 'update') - ed.selection.collapse(1); - - elm = ed.dom.getParent(ed.selection.getNode(), 'A'); - if (elm) - elm.name = name; - else - ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '')); - - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); diff --git a/www/javascript/tiny_mce/themes/advanced/js/charmap.js b/www/javascript/tiny_mce/themes/advanced/js/charmap.js deleted file mode 100644 index 1cead6dfe..000000000 --- a/www/javascript/tiny_mce/themes/advanced/js/charmap.js +++ /dev/null @@ -1,355 +0,0 @@ -/** - * charmap.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -tinyMCEPopup.requireLangPack(); - -var charmap = [ - [' ', ' ', true, 'no-break space'], - ['&', '&', true, 'ampersand'], - ['"', '"', true, 'quotation mark'], -// finance - ['¢', '¢', true, 'cent sign'], - ['€', '€', true, 'euro sign'], - ['£', '£', true, 'pound sign'], - ['¥', '¥', true, 'yen sign'], -// signs - ['©', '©', true, 'copyright sign'], - ['®', '®', true, 'registered sign'], - ['™', '™', true, 'trade mark sign'], - ['‰', '‰', true, 'per mille sign'], - ['µ', 'µ', true, 'micro sign'], - ['·', '·', true, 'middle dot'], - ['•', '•', true, 'bullet'], - ['…', '…', true, 'three dot leader'], - ['′', '′', true, 'minutes / feet'], - ['″', '″', true, 'seconds / inches'], - ['§', '§', true, 'section sign'], - ['¶', '¶', true, 'paragraph sign'], - ['ß', 'ß', true, 'sharp s / ess-zed'], -// quotations - ['‹', '‹', true, 'single left-pointing angle quotation mark'], - ['›', '›', true, 'single right-pointing angle quotation mark'], - ['«', '«', true, 'left pointing guillemet'], - ['»', '»', true, 'right pointing guillemet'], - ['‘', '‘', true, 'left single quotation mark'], - ['’', '’', true, 'right single quotation mark'], - ['“', '“', true, 'left double quotation mark'], - ['”', '”', true, 'right double quotation mark'], - ['‚', '‚', true, 'single low-9 quotation mark'], - ['„', '„', true, 'double low-9 quotation mark'], - ['<', '<', true, 'less-than sign'], - ['>', '>', true, 'greater-than sign'], - ['≤', '≤', true, 'less-than or equal to'], - ['≥', '≥', true, 'greater-than or equal to'], - ['–', '–', true, 'en dash'], - ['—', '—', true, 'em dash'], - ['¯', '¯', true, 'macron'], - ['‾', '‾', true, 'overline'], - ['¤', '¤', true, 'currency sign'], - ['¦', '¦', true, 'broken bar'], - ['¨', '¨', true, 'diaeresis'], - ['¡', '¡', true, 'inverted exclamation mark'], - ['¿', '¿', true, 'turned question mark'], - ['ˆ', 'ˆ', true, 'circumflex accent'], - ['˜', '˜', true, 'small tilde'], - ['°', '°', true, 'degree sign'], - ['−', '−', true, 'minus sign'], - ['±', '±', true, 'plus-minus sign'], - ['÷', '÷', true, 'division sign'], - ['⁄', '⁄', true, 'fraction slash'], - ['×', '×', true, 'multiplication sign'], - ['¹', '¹', true, 'superscript one'], - ['²', '²', true, 'superscript two'], - ['³', '³', true, 'superscript three'], - ['¼', '¼', true, 'fraction one quarter'], - ['½', '½', true, 'fraction one half'], - ['¾', '¾', true, 'fraction three quarters'], -// math / logical - ['ƒ', 'ƒ', true, 'function / florin'], - ['∫', '∫', true, 'integral'], - ['∑', '∑', true, 'n-ary sumation'], - ['∞', '∞', true, 'infinity'], - ['√', '√', true, 'square root'], - ['∼', '∼', false,'similar to'], - ['≅', '≅', false,'approximately equal to'], - ['≈', '≈', true, 'almost equal to'], - ['≠', '≠', true, 'not equal to'], - ['≡', '≡', true, 'identical to'], - ['∈', '∈', false,'element of'], - ['∉', '∉', false,'not an element of'], - ['∋', '∋', false,'contains as member'], - ['∏', '∏', true, 'n-ary product'], - ['∧', '∧', false,'logical and'], - ['∨', '∨', false,'logical or'], - ['¬', '¬', true, 'not sign'], - ['∩', '∩', true, 'intersection'], - ['∪', '∪', false,'union'], - ['∂', '∂', true, 'partial differential'], - ['∀', '∀', false,'for all'], - ['∃', '∃', false,'there exists'], - ['∅', '∅', false,'diameter'], - ['∇', '∇', false,'backward difference'], - ['∗', '∗', false,'asterisk operator'], - ['∝', '∝', false,'proportional to'], - ['∠', '∠', false,'angle'], -// undefined - ['´', '´', true, 'acute accent'], - ['¸', '¸', true, 'cedilla'], - ['ª', 'ª', true, 'feminine ordinal indicator'], - ['º', 'º', true, 'masculine ordinal indicator'], - ['†', '†', true, 'dagger'], - ['‡', '‡', true, 'double dagger'], -// alphabetical special chars - ['À', 'À', true, 'A - grave'], - ['Á', 'Á', true, 'A - acute'], - ['Â', 'Â', true, 'A - circumflex'], - ['Ã', 'Ã', true, 'A - tilde'], - ['Ä', 'Ä', true, 'A - diaeresis'], - ['Å', 'Å', true, 'A - ring above'], - ['Æ', 'Æ', true, 'ligature AE'], - ['Ç', 'Ç', true, 'C - cedilla'], - ['È', 'È', true, 'E - grave'], - ['É', 'É', true, 'E - acute'], - ['Ê', 'Ê', true, 'E - circumflex'], - ['Ë', 'Ë', true, 'E - diaeresis'], - ['Ì', 'Ì', true, 'I - grave'], - ['Í', 'Í', true, 'I - acute'], - ['Î', 'Î', true, 'I - circumflex'], - ['Ï', 'Ï', true, 'I - diaeresis'], - ['Ð', 'Ð', true, 'ETH'], - ['Ñ', 'Ñ', true, 'N - tilde'], - ['Ò', 'Ò', true, 'O - grave'], - ['Ó', 'Ó', true, 'O - acute'], - ['Ô', 'Ô', true, 'O - circumflex'], - ['Õ', 'Õ', true, 'O - tilde'], - ['Ö', 'Ö', true, 'O - diaeresis'], - ['Ø', 'Ø', true, 'O - slash'], - ['Œ', 'Œ', true, 'ligature OE'], - ['Š', 'Š', true, 'S - caron'], - ['Ù', 'Ù', true, 'U - grave'], - ['Ú', 'Ú', true, 'U - acute'], - ['Û', 'Û', true, 'U - circumflex'], - ['Ü', 'Ü', true, 'U - diaeresis'], - ['Ý', 'Ý', true, 'Y - acute'], - ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], - ['Þ', 'Þ', true, 'THORN'], - ['à', 'à', true, 'a - grave'], - ['á', 'á', true, 'a - acute'], - ['â', 'â', true, 'a - circumflex'], - ['ã', 'ã', true, 'a - tilde'], - ['ä', 'ä', true, 'a - diaeresis'], - ['å', 'å', true, 'a - ring above'], - ['æ', 'æ', true, 'ligature ae'], - ['ç', 'ç', true, 'c - cedilla'], - ['è', 'è', true, 'e - grave'], - ['é', 'é', true, 'e - acute'], - ['ê', 'ê', true, 'e - circumflex'], - ['ë', 'ë', true, 'e - diaeresis'], - ['ì', 'ì', true, 'i - grave'], - ['í', 'í', true, 'i - acute'], - ['î', 'î', true, 'i - circumflex'], - ['ï', 'ï', true, 'i - diaeresis'], - ['ð', 'ð', true, 'eth'], - ['ñ', 'ñ', true, 'n - tilde'], - ['ò', 'ò', true, 'o - grave'], - ['ó', 'ó', true, 'o - acute'], - ['ô', 'ô', true, 'o - circumflex'], - ['õ', 'õ', true, 'o - tilde'], - ['ö', 'ö', true, 'o - diaeresis'], - ['ø', 'ø', true, 'o slash'], - ['œ', 'œ', true, 'ligature oe'], - ['š', 'š', true, 's - caron'], - ['ù', 'ù', true, 'u - grave'], - ['ú', 'ú', true, 'u - acute'], - ['û', 'û', true, 'u - circumflex'], - ['ü', 'ü', true, 'u - diaeresis'], - ['ý', 'ý', true, 'y - acute'], - ['þ', 'þ', true, 'thorn'], - ['ÿ', 'ÿ', true, 'y - diaeresis'], - ['Α', 'Α', true, 'Alpha'], - ['Β', 'Β', true, 'Beta'], - ['Γ', 'Γ', true, 'Gamma'], - ['Δ', 'Δ', true, 'Delta'], - ['Ε', 'Ε', true, 'Epsilon'], - ['Ζ', 'Ζ', true, 'Zeta'], - ['Η', 'Η', true, 'Eta'], - ['Θ', 'Θ', true, 'Theta'], - ['Ι', 'Ι', true, 'Iota'], - ['Κ', 'Κ', true, 'Kappa'], - ['Λ', 'Λ', true, 'Lambda'], - ['Μ', 'Μ', true, 'Mu'], - ['Ν', 'Ν', true, 'Nu'], - ['Ξ', 'Ξ', true, 'Xi'], - ['Ο', 'Ο', true, 'Omicron'], - ['Π', 'Π', true, 'Pi'], - ['Ρ', 'Ρ', true, 'Rho'], - ['Σ', 'Σ', true, 'Sigma'], - ['Τ', 'Τ', true, 'Tau'], - ['Υ', 'Υ', true, 'Upsilon'], - ['Φ', 'Φ', true, 'Phi'], - ['Χ', 'Χ', true, 'Chi'], - ['Ψ', 'Ψ', true, 'Psi'], - ['Ω', 'Ω', true, 'Omega'], - ['α', 'α', true, 'alpha'], - ['β', 'β', true, 'beta'], - ['γ', 'γ', true, 'gamma'], - ['δ', 'δ', true, 'delta'], - ['ε', 'ε', true, 'epsilon'], - ['ζ', 'ζ', true, 'zeta'], - ['η', 'η', true, 'eta'], - ['θ', 'θ', true, 'theta'], - ['ι', 'ι', true, 'iota'], - ['κ', 'κ', true, 'kappa'], - ['λ', 'λ', true, 'lambda'], - ['μ', 'μ', true, 'mu'], - ['ν', 'ν', true, 'nu'], - ['ξ', 'ξ', true, 'xi'], - ['ο', 'ο', true, 'omicron'], - ['π', 'π', true, 'pi'], - ['ρ', 'ρ', true, 'rho'], - ['ς', 'ς', true, 'final sigma'], - ['σ', 'σ', true, 'sigma'], - ['τ', 'τ', true, 'tau'], - ['υ', 'υ', true, 'upsilon'], - ['φ', 'φ', true, 'phi'], - ['χ', 'χ', true, 'chi'], - ['ψ', 'ψ', true, 'psi'], - ['ω', 'ω', true, 'omega'], -// symbols - ['ℵ', 'ℵ', false,'alef symbol'], - ['ϖ', 'ϖ', false,'pi symbol'], - ['ℜ', 'ℜ', false,'real part symbol'], - ['ϑ','ϑ', false,'theta symbol'], - ['ϒ', 'ϒ', false,'upsilon - hook symbol'], - ['℘', '℘', false,'Weierstrass p'], - ['ℑ', 'ℑ', false,'imaginary part'], -// arrows - ['←', '←', true, 'leftwards arrow'], - ['↑', '↑', true, 'upwards arrow'], - ['→', '→', true, 'rightwards arrow'], - ['↓', '↓', true, 'downwards arrow'], - ['↔', '↔', true, 'left right arrow'], - ['↵', '↵', false,'carriage return'], - ['⇐', '⇐', false,'leftwards double arrow'], - ['⇑', '⇑', false,'upwards double arrow'], - ['⇒', '⇒', false,'rightwards double arrow'], - ['⇓', '⇓', false,'downwards double arrow'], - ['⇔', '⇔', false,'left right double arrow'], - ['∴', '∴', false,'therefore'], - ['⊂', '⊂', false,'subset of'], - ['⊃', '⊃', false,'superset of'], - ['⊄', '⊄', false,'not a subset of'], - ['⊆', '⊆', false,'subset of or equal to'], - ['⊇', '⊇', false,'superset of or equal to'], - ['⊕', '⊕', false,'circled plus'], - ['⊗', '⊗', false,'circled times'], - ['⊥', '⊥', false,'perpendicular'], - ['⋅', '⋅', false,'dot operator'], - ['⌈', '⌈', false,'left ceiling'], - ['⌉', '⌉', false,'right ceiling'], - ['⌊', '⌊', false,'left floor'], - ['⌋', '⌋', false,'right floor'], - ['⟨', '〈', false,'left-pointing angle bracket'], - ['⟩', '〉', false,'right-pointing angle bracket'], - ['◊', '◊', true, 'lozenge'], - ['♠', '♠', true, 'black spade suit'], - ['♣', '♣', true, 'black club suit'], - ['♥', '♥', true, 'black heart suit'], - ['♦', '♦', true, 'black diamond suit'], - [' ', ' ', false,'en space'], - [' ', ' ', false,'em space'], - [' ', ' ', false,'thin space'], - ['‌', '‌', false,'zero width non-joiner'], - ['‍', '‍', false,'zero width joiner'], - ['‎', '‎', false,'left-to-right mark'], - ['‏', '‏', false,'right-to-left mark'], - ['­', '­', false,'soft hyphen'] -]; - -tinyMCEPopup.onInit.add(function() { - tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); - addKeyboardNavigation(); -}); - -function addKeyboardNavigation(){ - var tableElm, cells, settings; - - cells = tinyMCEPopup.dom.select(".charmaplink", "charmapgroup"); - - settings ={ - root: "charmapgroup", - items: cells - }; - - tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); -} - -function renderCharMapHTML() { - var charsPerRow = 20, tdWidth=20, tdHeight=20, i; - var html = '
'+ - ''; - var cols=-1; - - for (i=0; i' - + '' - + charmap[i][1] - + ''; - if ((cols+1) % charsPerRow == 0) - html += ''; - } - } - - if (cols % charsPerRow > 0) { - var padd = charsPerRow - (cols % charsPerRow); - for (var i=0; i '; - } - - html += '
'; - html = html.replace(/<\/tr>/g, ''); - - return html; -} - -function insertChar(chr) { - tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); - - // Refocus in window - if (tinyMCEPopup.isWindow) - window.focus(); - - tinyMCEPopup.editor.focus(); - tinyMCEPopup.close(); -} - -function previewChar(codeA, codeB, codeN) { - var elmA = document.getElementById('codeA'); - var elmB = document.getElementById('codeB'); - var elmV = document.getElementById('codeV'); - var elmN = document.getElementById('codeN'); - - if (codeA=='#160;') { - elmV.innerHTML = '__'; - } else { - elmV.innerHTML = '&' + codeA; - } - - elmB.innerHTML = '&' + codeA; - elmA.innerHTML = '&' + codeB; - elmN.innerHTML = codeN; -} diff --git a/www/javascript/tiny_mce/themes/advanced/js/color_picker.js b/www/javascript/tiny_mce/themes/advanced/js/color_picker.js deleted file mode 100644 index 7decac5b4..000000000 --- a/www/javascript/tiny_mce/themes/advanced/js/color_picker.js +++ /dev/null @@ -1,329 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var detail = 50, strhex = "0123456789ABCDEF", i, isMouseDown = false, isMouseOver = false; - -var colors = [ - "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", - "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", - "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", - "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", - "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", - "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", - "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", - "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", - "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", - "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", - "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", - "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", - "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", - "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", - "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", - "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", - "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", - "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", - "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", - "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", - "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", - "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", - "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", - "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", - "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", - "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", - "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" -]; - -var named = { - '#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', - '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown', - '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue', - '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod', - '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green', - '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue', - '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue', - '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green', - '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey', - '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory', - '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue', - '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green', - '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey', - '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', - '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue', - '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin', - '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid', - '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff', - '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue', - '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver', - '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green', - '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', - '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green' -}; - -var namedLookup = {}; - -function init() { - var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value; - - tinyMCEPopup.resizeToInnerSize(); - - generatePicker(); - generateWebColors(); - generateNamedColors(); - - if (inputColor) { - changeFinalColor(inputColor); - - col = convertHexToRGB(inputColor); - - if (col) - updateLight(col.r, col.g, col.b); - } - - for (key in named) { - value = named[key]; - namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase(); - } -} - -function toHexColor(color) { - var matches, red, green, blue, toInt = parseInt; - - function hex(value) { - value = parseInt(value).toString(16); - - return value.length > 1 ? value : '0' + value; // Padd with leading zero - }; - - color = color.replace(/[\s#]+/g, '').toLowerCase(); - color = namedLookup[color] || color; - matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})|([a-f0-9])([a-f0-9])([a-f0-9])$/.exec(color); - - if (matches) { - if (matches[1]) { - red = toInt(matches[1]); - green = toInt(matches[2]); - blue = toInt(matches[3]); - } else if (matches[4]) { - red = toInt(matches[4], 16); - green = toInt(matches[5], 16); - blue = toInt(matches[6], 16); - } else if (matches[7]) { - red = toInt(matches[7] + matches[7], 16); - green = toInt(matches[8] + matches[8], 16); - blue = toInt(matches[9] + matches[9], 16); - } - - return '#' + hex(red) + hex(green) + hex(blue); - } - - return ''; -} - -function insertAction() { - var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); - - tinyMCEPopup.restoreSelection(); - - if (f) - f(toHexColor(color)); - - tinyMCEPopup.close(); -} - -function showColor(color, name) { - if (name) - document.getElementById("colorname").innerHTML = name; - - document.getElementById("preview").style.backgroundColor = color; - document.getElementById("color").value = color.toUpperCase(); -} - -function convertRGBToHex(col) { - var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); - - if (!col) - return col; - - var rgb = col.replace(re, "$1,$2,$3").split(','); - if (rgb.length == 3) { - r = parseInt(rgb[0]).toString(16); - g = parseInt(rgb[1]).toString(16); - b = parseInt(rgb[2]).toString(16); - - r = r.length == 1 ? '0' + r : r; - g = g.length == 1 ? '0' + g : g; - b = b.length == 1 ? '0' + b : b; - - return "#" + r + g + b; - } - - return col; -} - -function convertHexToRGB(col) { - if (col.indexOf('#') != -1) { - col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); - - r = parseInt(col.substring(0, 2), 16); - g = parseInt(col.substring(2, 4), 16); - b = parseInt(col.substring(4, 6), 16); - - return {r : r, g : g, b : b}; - } - - return null; -} - -function generatePicker() { - var el = document.getElementById('light'), h = '', i; - - for (i = 0; i < detail; i++){ - h += '
'; - } - - el.innerHTML = h; -} - -function generateWebColors() { - var el = document.getElementById('webcolors'), h = '', i; - - if (el.className == 'generated') - return; - - // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. - h += '
' - + ''; - - for (i=0; i' - + ''; - if (tinyMCEPopup.editor.forcedHighContrastMode) { - h += ''; - } - h += ''; - h += ''; - if ((i+1) % 18 == 0) - h += ''; - } - - h += '
'; - - el.innerHTML = h; - el.className = 'generated'; - - paintCanvas(el); - enableKeyboardNavigation(el.firstChild); -} - -function paintCanvas(el) { - tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { - var context; - if (canvas.getContext && (context = canvas.getContext("2d"))) { - context.fillStyle = canvas.getAttribute('data-color'); - context.fillRect(0, 0, 10, 10); - } - }); -} -function generateNamedColors() { - var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; - - if (el.className == 'generated') - return; - - for (n in named) { - v = named[n]; - h += ''; - if (tinyMCEPopup.editor.forcedHighContrastMode) { - h += ''; - } - h += ''; - h += ''; - i++; - } - - el.innerHTML = h; - el.className = 'generated'; - - paintCanvas(el); - enableKeyboardNavigation(el); -} - -function enableKeyboardNavigation(el) { - tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { - root: el, - items: tinyMCEPopup.dom.select('a', el) - }, tinyMCEPopup.dom); -} - -function dechex(n) { - return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); -} - -function computeColor(e) { - var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB; - - x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0); - y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0); - - partWidth = document.getElementById('colors').width / 6; - partDetail = detail / 2; - imHeight = document.getElementById('colors').height; - - r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; - g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); - b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); - - coef = (imHeight - y) / imHeight; - r = 128 + (r - 128) * coef; - g = 128 + (g - 128) * coef; - b = 128 + (b - 128) * coef; - - changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); - updateLight(r, g, b); -} - -function updateLight(r, g, b) { - var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; - - for (i=0; i=0) && (i'); - }, - - init : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor; - - // Setup browse button - document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); - if (isVisible('srcbrowser')) - document.getElementById('src').style.width = '180px'; - - e = ed.selection.getNode(); - - this.fillFileList('image_list', tinyMCEPopup.getParam('external_image_list', 'tinyMCEImageList')); - - if (e.nodeName == 'IMG') { - f.src.value = ed.dom.getAttrib(e, 'src'); - f.alt.value = ed.dom.getAttrib(e, 'alt'); - f.border.value = this.getAttrib(e, 'border'); - f.vspace.value = this.getAttrib(e, 'vspace'); - f.hspace.value = this.getAttrib(e, 'hspace'); - f.width.value = ed.dom.getAttrib(e, 'width'); - f.height.value = ed.dom.getAttrib(e, 'height'); - f.insert.value = ed.getLang('update'); - this.styleVal = ed.dom.getAttrib(e, 'style'); - selectByValue(f, 'image_list', f.src.value); - selectByValue(f, 'align', this.getAttrib(e, 'align')); - this.updateStyle(); - } - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = typeof(l) === 'function' ? l() : window[l]; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - update : function() { - var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; - - tinyMCEPopup.restoreSelection(); - - if (f.src.value === '') { - if (ed.selection.getNode().nodeName == 'IMG') { - ed.dom.remove(ed.selection.getNode()); - ed.execCommand('mceRepaint'); - } - - tinyMCEPopup.close(); - return; - } - - if (!ed.settings.inline_styles) { - args = tinymce.extend(args, { - vspace : nl.vspace.value, - hspace : nl.hspace.value, - border : nl.border.value, - align : getSelectValue(f, 'align') - }); - } else - args.style = this.styleVal; - - tinymce.extend(args, { - src : f.src.value.replace(/ /g, '%20'), - alt : f.alt.value, - width : f.width.value, - height : f.height.value - }); - - el = ed.selection.getNode(); - - if (el && el.nodeName == 'IMG') { - ed.dom.setAttribs(el, args); - tinyMCEPopup.editor.execCommand('mceRepaint'); - tinyMCEPopup.editor.focus(); - } else { - ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); - ed.dom.setAttribs('__mce_tmp', args); - ed.dom.setAttrib('__mce_tmp', 'id', ''); - ed.undoManager.add(); - } - - tinyMCEPopup.close(); - }, - - updateStyle : function() { - var dom = tinyMCEPopup.dom, st, v, f = document.forms[0]; - - if (tinyMCEPopup.editor.settings.inline_styles) { - st = tinyMCEPopup.dom.parseStyle(this.styleVal); - - // Handle align - v = getSelectValue(f, 'align'); - if (v) { - if (v == 'left' || v == 'right') { - st['float'] = v; - delete st['vertical-align']; - } else { - st['vertical-align'] = v; - delete st['float']; - } - } else { - delete st['float']; - delete st['vertical-align']; - } - - // Handle border - v = f.border.value; - if (v || v == '0') { - if (v == '0') - st['border'] = '0'; - else - st['border'] = v + 'px solid black'; - } else - delete st['border']; - - // Handle hspace - v = f.hspace.value; - if (v) { - delete st['margin']; - st['margin-left'] = v + 'px'; - st['margin-right'] = v + 'px'; - } else { - delete st['margin-left']; - delete st['margin-right']; - } - - // Handle vspace - v = f.vspace.value; - if (v) { - delete st['margin']; - st['margin-top'] = v + 'px'; - st['margin-bottom'] = v + 'px'; - } else { - delete st['margin-top']; - delete st['margin-bottom']; - } - - // Merge - st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img'); - this.styleVal = dom.serializeStyle(st, 'img'); - } - }, - - getAttrib : function(e, at) { - var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; - - if (ed.settings.inline_styles) { - switch (at) { - case 'align': - if (v = dom.getStyle(e, 'float')) - return v; - - if (v = dom.getStyle(e, 'vertical-align')) - return v; - - break; - - case 'hspace': - v = dom.getStyle(e, 'margin-left') - v2 = dom.getStyle(e, 'margin-right'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'vspace': - v = dom.getStyle(e, 'margin-top') - v2 = dom.getStyle(e, 'margin-bottom'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'border': - v = 0; - - tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { - sv = dom.getStyle(e, 'border-' + sv + '-width'); - - // False or not the same as prev - if (!sv || (sv != v && v !== 0)) { - v = 0; - return false; - } - - if (sv) - v = sv; - }); - - if (v) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - } - } - - if (v = dom.getAttrib(e, at)) - return v; - - return ''; - }, - - resetImageData : function() { - var f = document.forms[0]; - - f.width.value = f.height.value = ""; - }, - - updateImageData : function() { - var f = document.forms[0], t = ImageDialog; - - if (f.width.value == "") - f.width.value = t.preloadImg.width; - - if (f.height.value == "") - f.height.value = t.preloadImg.height; - }, - - getImageData : function() { - var f = document.forms[0]; - - this.preloadImg = new Image(); - this.preloadImg.onload = this.updateImageData; - this.preloadImg.onerror = this.resetImageData; - this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); - } -}; - -ImageDialog.preInit(); -tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/www/javascript/tiny_mce/themes/advanced/js/link.js b/www/javascript/tiny_mce/themes/advanced/js/link.js deleted file mode 100644 index 53ff409e7..000000000 --- a/www/javascript/tiny_mce/themes/advanced/js/link.js +++ /dev/null @@ -1,153 +0,0 @@ -tinyMCEPopup.requireLangPack(); - -var LinkDialog = { - preInit : function() { - var url; - - if (url = tinyMCEPopup.getParam("external_link_list_url")) - document.write(''); - }, - - init : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor; - - // Setup browse button - document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); - if (isVisible('hrefbrowser')) - document.getElementById('href').style.width = '180px'; - - this.fillClassList('class_list'); - this.fillFileList('link_list', 'tinyMCELinkList'); - this.fillTargetList('target_list'); - - if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { - f.href.value = ed.dom.getAttrib(e, 'href'); - f.linktitle.value = ed.dom.getAttrib(e, 'title'); - f.insert.value = ed.getLang('update'); - selectByValue(f, 'link_list', f.href.value); - selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); - selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); - } - }, - - update : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); - - tinyMCEPopup.restoreSelection(); - e = ed.dom.getParent(ed.selection.getNode(), 'A'); - - // Remove element if there is no href - if (!f.href.value) { - if (e) { - b = ed.selection.getBookmark(); - ed.dom.remove(e, 1); - ed.selection.moveToBookmark(b); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - return; - } - } - - // Create new anchor elements - if (e == null) { - ed.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); - - tinymce.each(ed.dom.select("a"), function(n) { - if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { - e = n; - - ed.dom.setAttribs(e, { - href : href, - title : f.linktitle.value, - target : f.target_list ? getSelectValue(f, "target_list") : null, - 'class' : f.class_list ? getSelectValue(f, "class_list") : null - }); - } - }); - } else { - ed.dom.setAttribs(e, { - href : href, - title : f.linktitle.value, - target : f.target_list ? getSelectValue(f, "target_list") : null, - 'class' : f.class_list ? getSelectValue(f, "class_list") : null - }); - } - - // Don't move caret if selection was image - if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { - ed.focus(); - ed.selection.select(e); - ed.selection.collapse(0); - tinyMCEPopup.storeSelection(); - } - - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - }, - - checkPrefix : function(n) { - if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) - n.value = 'mailto:' + n.value; - - if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) - n.value = 'http://' + n.value; - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = window[l]; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillClassList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { - cl = []; - - tinymce.each(v.split(';'), function(v) { - var p = v.split('='); - - cl.push({'title' : p[0], 'class' : p[1]}); - }); - } else - cl = tinyMCEPopup.editor.dom.getClasses(); - - if (cl.length > 0) { - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - - tinymce.each(cl, function(o) { - lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillTargetList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v; - - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); - - if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { - tinymce.each(v.split(','), function(v) { - v = v.split('='); - lst.options[lst.options.length] = new Option(v[0], v[1]); - }); - } - } -}; - -LinkDialog.preInit(); -tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); diff --git a/www/javascript/tiny_mce/themes/advanced/js/source_editor.js b/www/javascript/tiny_mce/themes/advanced/js/source_editor.js deleted file mode 100644 index 84546ad52..000000000 --- a/www/javascript/tiny_mce/themes/advanced/js/source_editor.js +++ /dev/null @@ -1,56 +0,0 @@ -tinyMCEPopup.requireLangPack(); -tinyMCEPopup.onInit.add(onLoadInit); - -function saveContent() { - tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); - tinyMCEPopup.close(); -} - -function onLoadInit() { - tinyMCEPopup.resizeToInnerSize(); - - // Remove Gecko spellchecking - if (tinymce.isGecko) - document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); - - document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); - - if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { - setWrap('soft'); - document.getElementById('wraped').checked = true; - } - - resizeInputs(); -} - -function setWrap(val) { - var v, n, s = document.getElementById('htmlSource'); - - s.wrap = val; - - if (!tinymce.isIE) { - v = s.value; - n = s.cloneNode(false); - n.setAttribute("wrap", val); - s.parentNode.replaceChild(n, s); - n.value = v; - } -} - -function toggleWordWrap(elm) { - if (elm.checked) - setWrap('soft'); - else - setWrap('off'); -} - -function resizeInputs() { - var vp = tinyMCEPopup.dom.getViewPort(window), el; - - el = document.getElementById('htmlSource'); - - if (el) { - el.style.width = (vp.w - 20) + 'px'; - el.style.height = (vp.h - 65) + 'px'; - } -} diff --git a/www/javascript/tiny_mce/themes/advanced/langs/en.js b/www/javascript/tiny_mce/themes/advanced/langs/en.js deleted file mode 100644 index fbf29893f..000000000 --- a/www/javascript/tiny_mce/themes/advanced/langs/en.js +++ /dev/null @@ -1,68 +0,0 @@ -tinyMCE.addI18n('en.advanced',{ -style_select:"Styles", -font_size:"Font size", -fontdefault:"Font family", -block:"Format", -paragraph:"Paragraph", -div:"Div", -address:"Address", -pre:"Preformatted", -h1:"Heading 1", -h2:"Heading 2", -h3:"Heading 3", -h4:"Heading 4", -h5:"Heading 5", -h6:"Heading 6", -blockquote:"Blockquote", -code:"Code", -samp:"Code sample", -dt:"Definition term ", -dd:"Definition description", -bold_desc:"Bold (Ctrl+B)", -italic_desc:"Italic (Ctrl+I)", -underline_desc:"Underline (Ctrl+U)", -striketrough_desc:"Strikethrough", -justifyleft_desc:"Align left", -justifycenter_desc:"Align center", -justifyright_desc:"Align right", -justifyfull_desc:"Align full", -bullist_desc:"Unordered list", -numlist_desc:"Ordered list", -outdent_desc:"Outdent", -indent_desc:"Indent", -undo_desc:"Undo (Ctrl+Z)", -redo_desc:"Redo (Ctrl+Y)", -link_desc:"Insert/edit link", -unlink_desc:"Unlink", -image_desc:"Insert/edit image", -cleanup_desc:"Cleanup messy code", -code_desc:"Edit HTML Source", -sub_desc:"Subscript", -sup_desc:"Superscript", -hr_desc:"Insert horizontal ruler", -removeformat_desc:"Remove formatting", -custom1_desc:"Your custom description here", -forecolor_desc:"Select text color", -backcolor_desc:"Select background color", -charmap_desc:"Insert custom character", -visualaid_desc:"Toggle guidelines/invisible elements", -anchor_desc:"Insert/edit anchor", -cut_desc:"Cut", -copy_desc:"Copy", -paste_desc:"Paste", -image_props_desc:"Image properties", -newdocument_desc:"New document", -help_desc:"Help", -blockquote_desc:"Blockquote", -clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", -path:"Path", -newdocument:"Are you sure you want clear all contents?", -toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", -more_colors:"More colors", - -// Accessibility Strings -shortcuts_desc:'Accessibility Help', -help_shortcut:'. Press ALT F10 for toolbar. Press ALT 0 for help.', -rich_text_area:"Rich Text Area", -toolbar:"Toolbar" -}); diff --git a/www/javascript/tiny_mce/themes/advanced/langs/en_dlg.js b/www/javascript/tiny_mce/themes/advanced/langs/en_dlg.js deleted file mode 100644 index 0a459beb5..000000000 --- a/www/javascript/tiny_mce/themes/advanced/langs/en_dlg.js +++ /dev/null @@ -1,54 +0,0 @@ -tinyMCE.addI18n('en.advanced_dlg',{ -about_title:"About TinyMCE", -about_general:"About", -about_help:"Help", -about_license:"License", -about_plugins:"Plugins", -about_plugin:"Plugin", -about_author:"Author", -about_version:"Version", -about_loaded:"Loaded plugins", -anchor_title:"Insert/edit anchor", -anchor_name:"Anchor name", -anchor_invalid:"Please specify a valid anchor name.", -code_title:"HTML Source Editor", -code_wordwrap:"Word wrap", -colorpicker_title:"Select a color", -colorpicker_picker_tab:"Picker", -colorpicker_picker_title:"Color picker", -colorpicker_palette_tab:"Palette", -colorpicker_palette_title:"Palette colors", -colorpicker_named_tab:"Named", -colorpicker_named_title:"Named colors", -colorpicker_color:"Color:", -colorpicker_name:"Name:", -charmap_title:"Select custom character", -image_title:"Insert/edit image", -image_src:"Image URL", -image_alt:"Image description", -image_list:"Image list", -image_border:"Border", -image_dimensions:"Dimensions", -image_vspace:"Vertical space", -image_hspace:"Horizontal space", -image_align:"Alignment", -image_align_baseline:"Baseline", -image_align_top:"Top", -image_align_middle:"Middle", -image_align_bottom:"Bottom", -image_align_texttop:"Text top", -image_align_textbottom:"Text bottom", -image_align_left:"Left", -image_align_right:"Right", -link_title:"Insert/edit link", -link_url:"Link URL", -link_target:"Target", -link_target_same:"Open link in the same window", -link_target_blank:"Open link in a new window", -link_titlefield:"Title", -link_is_email:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?", -link_is_external:"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?", -link_list:"Link list", -accessibility_help:"Accessibility Help", -accessibility_usage_title:"General Usage" -}); \ No newline at end of file diff --git a/www/javascript/tiny_mce/themes/advanced/link.htm b/www/javascript/tiny_mce/themes/advanced/link.htm deleted file mode 100644 index 5d9dea9b8..000000000 --- a/www/javascript/tiny_mce/themes/advanced/link.htm +++ /dev/null @@ -1,57 +0,0 @@ - - - - {#advanced_dlg.link_title} - - - - - - - -
- - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - - -
 
-
-
- -
- - -
-
- - diff --git a/www/javascript/tiny_mce/themes/advanced/shortcuts.htm b/www/javascript/tiny_mce/themes/advanced/shortcuts.htm deleted file mode 100644 index 20ec2f5a3..000000000 --- a/www/javascript/tiny_mce/themes/advanced/shortcuts.htm +++ /dev/null @@ -1,47 +0,0 @@ - - - - {#advanced_dlg.accessibility_help} - - - - -

{#advanced_dlg.accessibility_usage_title}

-

Toolbars

-

Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys. - Press enter to activate a button and return focus to the editor. - Press escape to return focus to the editor without performing any actions.

- -

Status Bar

-

To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path. - Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.

- -

Context Menu

-

Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key. - To close submenus press the left arrow key. Press escape to close the context menu.

- -

Keyboard Shortcuts

- - - - - - - - - - - - - - - - - - - - - -
KeystrokeFunction
Control-BBold
Control-IItalic
Control-ZUndo
Control-YRedo
- - diff --git a/www/javascript/tiny_mce/themes/advanced/skins/default/content.css b/www/javascript/tiny_mce/themes/advanced/skins/default/content.css deleted file mode 100644 index 569a3ae8c..000000000 --- a/www/javascript/tiny_mce/themes/advanced/skins/default/content.css +++ /dev/null @@ -1,47 +0,0 @@ -body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} -body {background:#FFF;} -body.mceForceColors {background:#FFF; color:#000;} -body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; -webkit-user-select:all; -webkit-user-modify:read-only; -moz-user-select:all; -moz-user-modify:read-only; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat center center} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -/* IE */ -* html body { -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} - -.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} -.mceItemShockWave {background-image:url(../../img/shockwave.gif)} -.mceItemFlash {background-image:url(../../img/flash.gif)} -.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} -.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} -.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} -.mceItemVideo {background-image:url(../../img/video.gif)} -.mceItemIframe {background-image:url(../../img/iframe.gif)} -.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/www/javascript/tiny_mce/themes/advanced/skins/default/dialog.css b/www/javascript/tiny_mce/themes/advanced/skins/default/dialog.css deleted file mode 100644 index f01222650..000000000 --- a/www/javascript/tiny_mce/themes/advanced/skins/default/dialog.css +++ /dev/null @@ -1,117 +0,0 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDDDDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -background:#F0F0EE; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;} -a:hover {color:#2B6FB6;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;} -input.invalid {border:1px solid #EE0000;} -input {background:#FFF; border:1px solid #CCC;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -border:0; margin:0; padding:0; -font-weight:bold; -width:94px; height:26px; -background:url(img/buttons.png) 0 -26px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#insert {background:url(img/buttons.png) 0 -52px} -#cancel {background:url(img/buttons.png) 0 0; float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} -.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} -.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} -.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} -#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/www/javascript/tiny_mce/themes/advanced/skins/default/img/buttons.png b/www/javascript/tiny_mce/themes/advanced/skins/default/img/buttons.png deleted file mode 100644 index 1e53560e0aa7bb1b9a0373fc2f330acab7d1d51f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3133 zcmV-D48rq?P)gng~>+0yq!tBh% zt0xP1czF2u_k)9j>dM0B$HDja_H1ly_V)Go`1nXjNaW+;^YZfD+t}*M#Nxuc=*Yq1 z;NB`KDhCG#@bK{R@$l@+!)t46+`F{;`ugO=z30fm^Yila^6}@#zv02U-oCc!%EL4? zH23%S=jP<#-rMNs>FMdm#>K$Dy`ivK#l*utK0e&s+{nkq>gea}%)@eWa<{g% z>dL@PO-FDO<;_vP3{r&yS z%gJYFXW`)8?90T9iiya`$o2O1+}hao_x2?vCGqg?<>cY)?CRy@;^N@n=jG#KaTS=D zm+I)|g@uFe?(C6}kHNve?(FOH^YiBA;_dD0_xJVh?(XR4=IY46=jG(~_V(`W?9I*1 z!^6SJF#_`P^4;Ct@9*!-P0sTG012r{L_t(|+O?MXUsG2ahi}PpNZ7ob12ts4 zA_nFqLtjdnoh+!creNnz_KL?&0LP2uu@&_VjZFOf^A4upSXxT<`l7sS>g!pxJp2~b zgUf1h)S;pzug4E}@{1@iQEJjdaP@Ltb^$+T7zI?z4@yu#C-3srtNyDv6^9}$t5I62 z>xb$~{1JaiNl_6V8bd?=JbL9-OZ-DXKO)}#7Xi}+6#OZW7Begij5aQTVUu2>r61l7mL6M%W;u2b1cxN5qol8KVq;TnzZb$VIutgWfp%2Ix?b*q1c zp^rpdy`U!2+}vDCtV5;l-Wsivb|!ywlycE%FI3t1UC}6o*QwN+^e&e(+6tmh&IV$* zwKr1BS*PP_W%O>?$}xn9*J^BNZXP!2n_RA@)&|hpN1XEREc(VbqzbSVA5n4^h7iXM|9ZGb3fK`idO7ys2Lt+`qm~5qe2Y=O=dNx30Fri zO%RZ1g`tQ4_sh%*NOe8@%T1~FFYSIIXUE2k`Uvcx=T}~&aOr7E^L^Zb*nQ}WPrdxk zJ1^$|SWi(Sa_XfVacZGB*KO4MjfcaFIU#(w@qM8&{Po|#YujGmtnxR;Yuh-x-oA6^ zuPW=;|7B_P^k$a3bLVa1+i;_B_~hj6+w(c#_U(fw4-4VUKe^uY^@!eVA}U?3JN zw_3}~%v4||MYYOBD+pBBK=CiB2=GM=ZK74QsnEWGf%6%rzj!7P2v}t?l}eTCl$E#0 zCt|T!SuA#?$iibMaNC?>Kiw?CEKdz7J@m zh=3#=raCG7elLNAKrH)!qKsKt#0a)nOqN=3Ipr#WE9WM;em?(%Xq9ft;&=}b#V3I$ zVj$2nbyH3S@RR!2vy>>^v{Son5CX1CHOG#5ljy)?^FYn1j{`_;M zADPb=ZhIQ? zHi5i*0!a~!kBegd{0P&(I-l?JIeb2!v}MbdD$qi>-D#hIVvMoz@o}r2GQRY`r|cGi z4IOo&281m>pFB3k;xjWdZg>8ChpzV$j-yf?=hiJ*-qPv)1oe0=FyoffUNeFlHkBhs z+(*6MIyZ&4Fl3Y7(s`pD2p`>>vJ*#-;!E?jd#RF4@GUKZ(yrmPyBRG|GN;h~pQ9AL zRR<)g&ZJL&;iwD%4EptL_49PIl6 zhXKmq;2s}=Ev71;4-O8#m(B)@zP`a(n8A(2;9z3Td*z&}zj)?uJLsF9RTO3K;Pmt( z#fu7;o=yjG4h|InKc>^l^z>7oVg8Y(vD*K1`T=t9_6H%ju3Wl%=Hdv~4-CxT{qm2? z%9nTN2L_n_!g<_I&Roe~R<4}E?c_ObC*jPu2RV}+Bik6)ULEP^7@2&Ir`I^IgI%1r zu3>uDTZ~;ASf0c*?dzDlcI_HjMmoOEgmEkX>BA3y$^o$AR^AvsnYoZzejq&=Zp?KX zWwTjxrMKE_f-U@bGbpSq+-wFD3{0>8ZS=G`y!mn1CRl@QXV0$60cX!v2CewRY+Ji( z-@a9AmlJNRq%JMfhVjakqPSAWMx;bBWwWis3mYtrDFB0LnuotKvq<`V`_MU{CtI0? zHj_e^M#Eo`>xYW`2>4Sop9r3$7^9D0|tV3X(>MKmaTjd zTktrvwvFjGojrtexg~ch8%eTiL$?HEDrQFQ(o|zg&NduBtLhIOr!H+##_1SX!$S-& zLZ~82VT&b<_XeVjKkdaT)8&MZn3s6O? z@Gec#kU^Eh>o9787rQi=j4n;`dL2Ex7py*wi-C_@W;tGmM2H0td2k}Eu?UR&MBu6|>VLK7V2WZmcZX6GS zxVhu-27`juJ?VIY96{1iSCn8dt4q`M`ww_PhzNR&E=>uAmgv&rzt*M2LqTW>>P+IH z1N(Ko7y4j=2*o|XK`4oY=fy6~L8&FXv_z1HX=^Bv(Dl0y&{q|&t_}qgctS0PQeCYe z`pYgYR9#&iU!qG3RR?(*S6W@22p-sN=n3pnlmu<&1!%&<&tk3;N5Y%VhNKDTS)3e+ zxYwj#O?s^3If&gM#p`AIphv@~pdjEet2rJm%>~M8L%)0X>M#DVtbDN=Qm(JW=)me_ z<^ZH^(1$aRD>-eOHt8eKM$d&WQn~arrTISYK3<2LI5 XtZb~ra4Vor00000NkvXXu0mjf(5kL( diff --git a/www/javascript/tiny_mce/themes/advanced/skins/default/img/items.gif b/www/javascript/tiny_mce/themes/advanced/skins/default/img/items.gif deleted file mode 100644 index d2f93671ca3090b277e16a67b1aa6cfb6ac4915f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 64 zcmZ?wbhEHbjEB<5wG8q|kKzxu41Cw-5|H{*E`4`XOxxoD9Y}F^Z SLTQbO*E^TJI;F+RU=09Vu@yA{ diff --git a/www/javascript/tiny_mce/themes/advanced/skins/default/img/menu_check.gif b/www/javascript/tiny_mce/themes/advanced/skins/default/img/menu_check.gif deleted file mode 100644 index adfdddccd7cac62a17d68873fa53c248bff8351a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 70 zcmZ?wbhEHb6k!lyXkcUjg8%>jEB<5wG8q|kKzxu41Cwk||H{*E`4`XG(j;}D)%x|1 U%)82UlRJ8EoZ9xTT7&iJhvXcHF*h)T1OnEW1i^?zgDfop1p?usL*#PMGT;HQkSO{q6FlJyb$PWkPf|h*eTST}7h8z$}MF(XD(aQ)ZLZ zM?v0rT<1C4XHn<6PbNA{XL@>1^)apdD_@tcYDrW#m`k#MmslI7p^P;Az74wGs`!SI zLs$GEZHsafXsu1i-WleMzAL(yw$-LK{0hv;6hrx8kx!!4$``dAyBnY9Jz&DqJo2$A z!(L$H=KqBeY~CF_viHPz^tTglc?D97CqEBjzUwH}7GI zapg8YZM~>2Wk%E$d&r@9ly9b4Q zJpM7T@}r63I(OExUlG%Xcjz3MU+9U^r!SkpjNThDtaP)7>j6L5z%o5|^hlVOyI*uY zt^UU6NTuY?(Lb4ZIU2Zb5Vz}Pb7KF%ivf&j^CL>$cDz?rMNTQQ|NqDVD7mhghUp%h zhIA{gi{S8y9YhIIbSv$`B!JiPi!0#4#Jge0)p&YVPHchWcyAn zQhvb8ggXGXs9;k`u9Uq*YB>O+Q3Rq=2hlLFcG{Q3ORH_}JnY8C+r%@}6|%ySP%bWG zV~mA;?P`Q2L_Ss})nrJ{$TmeA9Tt*4=}X5x%RioM@_?ZsKSEST-f+GBv~Ya)xX3O{ z8!d=YthI-13OI;RN~`>|6u5L{z20oBp%9MIj)n$!Aw{Wpq&Rtr4~*_74Gjo@3el>B zz(Rk;;>2lp73<2;d=r*8z%WkdsG=vRuG_fvxO#uN^El|+5Qoz^X!2MfxJ3m}vyi?> zMLLDi8+${Z6YbUg?8GNR>-+SwHKdFyr%HqWcs|X_l*-DAC^bG&KCqWg7-_`UlwQ`EdOp_LJkr`L$mHHs75uP?fSgVfsDjuE#ft2b8HDt0yFt!+;C zEgL=)G9ZFt4wa+N3Xg7FGc0~`&EEt6_%7tyzmnb9B_h1~7~GD4V-Bhx7~QKRkF>&aT>(-!Us@aJxAY@8E?HW$G8g zSz@7Jcp>iCp;lU1ieF6n7!oAa-1E!rS0 zF1lBFVS%G#ZO}b@*+bIk+7@Q|iG60vIDVpV%4tW8rKyzwRo_<25;8*Ky@n z-sX>W*b;M){5lB_Edc@m1`VHy0@dg$PTR9uE$O2&a?KAe?xRlCj&Z$iZYw{QLU)`S|$v@$cX6?dI$1gD3v=j7e% z=;7w$-Rb7w=;hz@@$UBY^8Wt*`uh6+|Nj60000000000000000000000000000000 z00000A^8La001@sEC2ui04xDo06+%+K$1gIC>oE*q;kn@I-k&}bV{vSuh^_MTj5x~ z;IMd1E}PHjw0g~MyWjA*d`_1aD382;&+q&HfPsR8goTEOh>41ejE#C>oB7x?gDgX`C@W6PdRySDAy zxO3~?&AYen-@tu z`Sa-0t6$H)z5Dm@LOZmO%>O00UfxnIvLj zmiZW&W~QkanrgNg7@Ka!Dd(JY)@kRRc;=aq0|XcV`m}aW!rkr-_>81sY;K8V*mTKy$sHUpws;su^>Z`EED(kGY)@tjm zxZYZTYZdhB>#x8DE9|hu7HjOW$R?}ovdlK??6c5DD=oAId~w{h*k-Hkw%m5>?YH2D zEAF`DmTT_0=%%ax?z-w0009Ik#VhZ;^ww+dz4+#<@4o!@>+in+2Q2Ww1Q$$j0U2bV z!NLqT?C`@7M=bHg6jyBV#TaL-@x~l??D5ASdtAVH6qIc8$tb6+^2#i??DESn$1L;A zG}mnN%{b?*GtOJ|?DNk+2QBo_L>Daue_181^wLZ>?ex=7N9~l1I}U2~)mXDawT@YL z?e*83Y@H+6WS1?d*f^T4_Sz?+eIwg&$E~5;Hp*@H-M-LWBi?-X{fgc`1}^yEgcol3 z;X3N6_(2E|;K1UL57dDST1Ia9J29Y8`Q@Cev*hNThaS!eb%|~|J5qvv`s&nRsXFVh zKVw2)vDa=#`|SV?;3e+7Ljz~;z#H>>@Wcl*eDTB|k38_oFVB1P&fgAw^tDe<{q@*q gul@Gickli8;D;~%_~eUY^!ezgum1Y%w;u!mJFYAXt^fc4 diff --git a/www/javascript/tiny_mce/themes/advanced/skins/default/ui.css b/www/javascript/tiny_mce/themes/advanced/skins/default/ui.css deleted file mode 100644 index 2b7c2a59a..000000000 --- a/www/javascript/tiny_mce/themes/advanced/skins/default/ui.css +++ /dev/null @@ -1,214 +0,0 @@ -/* Reset */ -.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} -.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} -.defaultSkin table td {vertical-align:middle} - -/* Containers */ -.defaultSkin table {direction:ltr;background:transparent} -.defaultSkin iframe {display:block;} -.defaultSkin .mceToolbar {height:26px} -.defaultSkin .mceLeft {text-align:left} -.defaultSkin .mceRight {text-align:right} - -/* External */ -.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} -.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} - -/* Layout */ -.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} -.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} -.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} -.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} -.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top} -.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} -.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} -.defaultSkin .mceStatusbar div {float:left; margin:2px} -.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} -.defaultSkin .mceStatusbar a:hover {text-decoration:underline} -.defaultSkin table.mceToolbar {margin-left:3px} -.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} -.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} -.defaultSkin td.mceCenter {text-align:center;} -.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} -.defaultSkin td.mceRight table {margin:0 0 0 auto;} - -/* Button */ -.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} -.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} -.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.defaultSkin .mceButtonLabeled {width:auto} -.defaultSkin .mceButtonLabeled span.mceIcon {float:left} -.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} -.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} - -/* Separator */ -.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} - -/* ListBox */ -.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} -.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} -.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} -.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} -.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} -.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} -.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} -.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} -.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} -.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} - -/* SplitButton */ -.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} -.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} -.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} -.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);} -.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} -.defaultSkin .mceSplitButton span.mceOpen {display:none} -.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} -.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} -.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} - -/* ColorSplitButton */ -.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} -.defaultSkin .mceColorSplitMenu td {padding:2px} -.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} -.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} -.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} -.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} -.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} - -/* Menu */ -.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} -.defaultSkin .mceNoIcons span.mceIcon {width:0;} -.defaultSkin .mceNoIcons a .mceText {padding-left:10px} -.defaultSkin .mceMenu table {background:#FFF} -.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} -.defaultSkin .mceMenu td {height:20px} -.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} -.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} -.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} -.defaultSkin .mceMenu pre.mceText {font-family:Monospace} -.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} -.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} -.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} -.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} -.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} -.defaultSkin .mceMenuItemDisabled .mceText {color:#888} -.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} -.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} -.defaultSkin .mceMenu span.mceMenuLine {display:none} -.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} -.defaultSkin .mceMenuItem td, .defaultSkin .mceMenuItem th {line-height: normal} - -/* Progress,Resize */ -.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} -.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} - -/* Formats */ -.defaultSkin .mce_formatPreview a {font-size:10px} -.defaultSkin .mce_p span.mceText {} -.defaultSkin .mce_address span.mceText {font-style:italic} -.defaultSkin .mce_pre span.mceText {font-family:monospace} -.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} - -/* Theme */ -.defaultSkin span.mce_bold {background-position:0 0} -.defaultSkin span.mce_italic {background-position:-60px 0} -.defaultSkin span.mce_underline {background-position:-140px 0} -.defaultSkin span.mce_strikethrough {background-position:-120px 0} -.defaultSkin span.mce_undo {background-position:-160px 0} -.defaultSkin span.mce_redo {background-position:-100px 0} -.defaultSkin span.mce_cleanup {background-position:-40px 0} -.defaultSkin span.mce_bullist {background-position:-20px 0} -.defaultSkin span.mce_numlist {background-position:-80px 0} -.defaultSkin span.mce_justifyleft {background-position:-460px 0} -.defaultSkin span.mce_justifyright {background-position:-480px 0} -.defaultSkin span.mce_justifycenter {background-position:-420px 0} -.defaultSkin span.mce_justifyfull {background-position:-440px 0} -.defaultSkin span.mce_anchor {background-position:-200px 0} -.defaultSkin span.mce_indent {background-position:-400px 0} -.defaultSkin span.mce_outdent {background-position:-540px 0} -.defaultSkin span.mce_link {background-position:-500px 0} -.defaultSkin span.mce_unlink {background-position:-640px 0} -.defaultSkin span.mce_sub {background-position:-600px 0} -.defaultSkin span.mce_sup {background-position:-620px 0} -.defaultSkin span.mce_removeformat {background-position:-580px 0} -.defaultSkin span.mce_newdocument {background-position:-520px 0} -.defaultSkin span.mce_image {background-position:-380px 0} -.defaultSkin span.mce_help {background-position:-340px 0} -.defaultSkin span.mce_code {background-position:-260px 0} -.defaultSkin span.mce_hr {background-position:-360px 0} -.defaultSkin span.mce_visualaid {background-position:-660px 0} -.defaultSkin span.mce_charmap {background-position:-240px 0} -.defaultSkin span.mce_paste {background-position:-560px 0} -.defaultSkin span.mce_copy {background-position:-700px 0} -.defaultSkin span.mce_cut {background-position:-680px 0} -.defaultSkin span.mce_blockquote {background-position:-220px 0} -.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} -.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} -.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} -.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} - -/* Plugins */ -.defaultSkin span.mce_advhr {background-position:-0px -20px} -.defaultSkin span.mce_ltr {background-position:-20px -20px} -.defaultSkin span.mce_rtl {background-position:-40px -20px} -.defaultSkin span.mce_emotions {background-position:-60px -20px} -.defaultSkin span.mce_fullpage {background-position:-80px -20px} -.defaultSkin span.mce_fullscreen {background-position:-100px -20px} -.defaultSkin span.mce_iespell {background-position:-120px -20px} -.defaultSkin span.mce_insertdate {background-position:-140px -20px} -.defaultSkin span.mce_inserttime {background-position:-160px -20px} -.defaultSkin span.mce_absolute {background-position:-180px -20px} -.defaultSkin span.mce_backward {background-position:-200px -20px} -.defaultSkin span.mce_forward {background-position:-220px -20px} -.defaultSkin span.mce_insert_layer {background-position:-240px -20px} -.defaultSkin span.mce_insertlayer {background-position:-260px -20px} -.defaultSkin span.mce_movebackward {background-position:-280px -20px} -.defaultSkin span.mce_moveforward {background-position:-300px -20px} -.defaultSkin span.mce_media {background-position:-320px -20px} -.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} -.defaultSkin span.mce_pastetext {background-position:-360px -20px} -.defaultSkin span.mce_pasteword {background-position:-380px -20px} -.defaultSkin span.mce_selectall {background-position:-400px -20px} -.defaultSkin span.mce_preview {background-position:-420px -20px} -.defaultSkin span.mce_print {background-position:-440px -20px} -.defaultSkin span.mce_cancel {background-position:-460px -20px} -.defaultSkin span.mce_save {background-position:-480px -20px} -.defaultSkin span.mce_replace {background-position:-500px -20px} -.defaultSkin span.mce_search {background-position:-520px -20px} -.defaultSkin span.mce_styleprops {background-position:-560px -20px} -.defaultSkin span.mce_table {background-position:-580px -20px} -.defaultSkin span.mce_cell_props {background-position:-600px -20px} -.defaultSkin span.mce_delete_table {background-position:-620px -20px} -.defaultSkin span.mce_delete_col {background-position:-640px -20px} -.defaultSkin span.mce_delete_row {background-position:-660px -20px} -.defaultSkin span.mce_col_after {background-position:-680px -20px} -.defaultSkin span.mce_col_before {background-position:-700px -20px} -.defaultSkin span.mce_row_after {background-position:-720px -20px} -.defaultSkin span.mce_row_before {background-position:-740px -20px} -.defaultSkin span.mce_merge_cells {background-position:-760px -20px} -.defaultSkin span.mce_table_props {background-position:-980px -20px} -.defaultSkin span.mce_row_props {background-position:-780px -20px} -.defaultSkin span.mce_split_cells {background-position:-800px -20px} -.defaultSkin span.mce_template {background-position:-820px -20px} -.defaultSkin span.mce_visualchars {background-position:-840px -20px} -.defaultSkin span.mce_abbr {background-position:-860px -20px} -.defaultSkin span.mce_acronym {background-position:-880px -20px} -.defaultSkin span.mce_attribs {background-position:-900px -20px} -.defaultSkin span.mce_cite {background-position:-920px -20px} -.defaultSkin span.mce_del {background-position:-940px -20px} -.defaultSkin span.mce_ins {background-position:-960px -20px} -.defaultSkin span.mce_pagebreak {background-position:0 -40px} -.defaultSkin span.mce_restoredraft {background-position:-20px -40px} -.defaultSkin span.mce_spellchecker {background-position:-540px -20px} diff --git a/www/javascript/tiny_mce/themes/advanced/skins/highcontrast/content.css b/www/javascript/tiny_mce/themes/advanced/skins/highcontrast/content.css deleted file mode 100644 index c2e30c7a2..000000000 --- a/www/javascript/tiny_mce/themes/advanced/skins/highcontrast/content.css +++ /dev/null @@ -1,23 +0,0 @@ -body, td, pre { margin:8px;} -body.mceForceColors {background:#FFF; color:#000;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} diff --git a/www/javascript/tiny_mce/themes/advanced/skins/highcontrast/dialog.css b/www/javascript/tiny_mce/themes/advanced/skins/highcontrast/dialog.css deleted file mode 100644 index b2ed097cd..000000000 --- a/www/javascript/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +++ /dev/null @@ -1,105 +0,0 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -background:#F0F0EE; -color: black; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE; color:#000;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;background-color:transparent;} -a:hover {color:#2B6FB6;background-color:transparent;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;background-color:transparent;} -input.invalid {border:1px solid #EE0000;background-color:transparent;} -input {background:#FFF; border:1px solid #CCC;color:black;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -font-weight:bold; -width:94px; height:23px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#cancel {float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;} -.tabs li.current {font-weight: bold; margin-right:2px;} -.tabs span {float:left; display:block; padding:0px 10px 0 0;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} diff --git a/www/javascript/tiny_mce/themes/advanced/skins/highcontrast/ui.css b/www/javascript/tiny_mce/themes/advanced/skins/highcontrast/ui.css deleted file mode 100644 index a2cfcc393..000000000 --- a/www/javascript/tiny_mce/themes/advanced/skins/highcontrast/ui.css +++ /dev/null @@ -1,102 +0,0 @@ -/* Reset */ -.highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;} -.highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;} -.highcontrastSkin table td {vertical-align:middle} - -.highcontrastSkin .mceIconOnly {display: block !important;} - -/* External */ -.highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;} -.highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;} - -/* Layout */ -.highcontrastSkin table.mceLayout {border: 1px solid;} -.highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid} -.highcontrastSkin .mceStatusbar a:hover {text-decoration:underline} -.highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;} -.highcontrastSkin .mceStatusbar div {float:left} -.highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0} - -.highcontrastSkin .mceToolbar td { display: inline-block; float: left;} -.highcontrastSkin .mceToolbar tr { display: block;} -.highcontrastSkin .mceToolbar table { display: block; } - -/* Button */ - -.highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;} -.highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em} -.highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} -.highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;} - -/* Separator */ -.highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;} - -/* ListBox */ -.highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceListBox .mceText {padding: 5px 6px; line-height: 2em; width: 15ex; overflow: hidden;} -.highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} -.highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} -.highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} -.highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;} -.highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;} - -.highcontrastSkin .mceListBoxMenu {overflow-y:auto} - -/* SplitButton */ -.highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -.highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;} -.highcontrastSkin .mceSplitButton tr { display: table-row; } -.highcontrastSkin table.mceSplitButton { display: table; } -.highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} -.highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} -.highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; } -.highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;} - -/* Menu */ -.highcontrastSkin .mceNoIcons span.mceIcon {width:0;} -.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; } -.highcontrastSkin .mceMenu table {background:white; color: black} -.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px} -.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black} -.highcontrastSkin .mceMenu td {height:2em} -.highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;} -.highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;} -.highcontrastSkin .mceMenu pre.mceText {font-family:Monospace} -.highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;} -.highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px} -.highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid} -.highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px} -.highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";} -.highcontrastSkin .mceMenu span.mceMenuLine {display:none} -.highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"} -.highcontrastSkin .mceMenuItem td, .highcontrastSkin .mceMenuItem th {line-height: normal} - -/* ColorSplitButton */ -.highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000} -.highcontrastSkin .mceColorSplitMenu td {padding:2px} -.highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;} -.highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2} -.highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;} -.highcontrastSkin .mceColorPreview {display:none;} -.highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden} - -/* Progress,Resize */ -.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} -.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} - -/* Formats */ -.highcontrastSkin .mce_p span.mceText {} -.highcontrastSkin .mce_address span.mceText {font-style:italic} -.highcontrastSkin .mce_pre span.mceText {font-family:monospace} -.highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} diff --git a/www/javascript/tiny_mce/themes/advanced/skins/o2k7/content.css b/www/javascript/tiny_mce/themes/advanced/skins/o2k7/content.css deleted file mode 100644 index 4ac4e4dfb..000000000 --- a/www/javascript/tiny_mce/themes/advanced/skins/o2k7/content.css +++ /dev/null @@ -1,46 +0,0 @@ -body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} -body {background:#FFF;} -body.mceForceColors {background:#FFF; color:#000;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -/* IE */ -* html body { -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} - -.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} -.mceItemShockWave {background-image:url(../../img/shockwave.gif)} -.mceItemFlash {background-image:url(../../img/flash.gif)} -.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} -.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} -.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} -.mceItemVideo {background-image:url(../../img/video.gif)} -.mceItemIframe {background-image:url(../../img/iframe.gif)} -.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/www/javascript/tiny_mce/themes/advanced/skins/o2k7/dialog.css b/www/javascript/tiny_mce/themes/advanced/skins/o2k7/dialog.css deleted file mode 100644 index ec0877224..000000000 --- a/www/javascript/tiny_mce/themes/advanced/skins/o2k7/dialog.css +++ /dev/null @@ -1,117 +0,0 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDDDDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -background:#F0F0EE; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;} -a:hover {color:#2B6FB6;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;} -input.invalid {border:1px solid #EE0000;} -input {background:#FFF; border:1px solid #CCC;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -border:0; margin:0; padding:0; -font-weight:bold; -width:94px; height:26px; -background:url(../default/img/buttons.png) 0 -26px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#insert {background:url(../default/img/buttons.png) 0 -52px} -#cancel {background:url(../default/img/buttons.png) 0 0; float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} -.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} -.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} -.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} -#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/www/javascript/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png b/www/javascript/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png deleted file mode 100644 index 13a5cb03097c004f7b37658654a9250748cf073c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2766 zcmd^B`#;nBAK!9c(dCSc_`04XBu+J597MXvt(oeZlcJpHIOSO7atc#AMWG$3$V7)q zNx38nEwRmIE*oapX3E%2Y_rQ}@3ZgU@qIsD@7L?`e7_#g=kxt|zu!N+{|XHbG)7n; zU@(~Rf&KpB+Imzw{S0-qnWxWD!C*SD&>&2J76Jgq`yNnO3$>r8@B|Y69x0pfIh#Ow z)WjyX^8T)+6I-}NwZreI-$r>-HeZJQv#zX#Th_uMwsMIrlO4mNj{|cbX#CdxSrSA1 zi7x6G7Jj7hJB9?EBN7TrO5@0TC%zA`m*~?n<~POISNRA}Ix(kW@s(5astLYgTBw@h z%VrlKo=`C@ST1R1m9LYgOf7Md z%vzvMe5Z_y2DwWEoJHD{xNkz(%My(67Mb6qJc(v%ez|*GL}7^sxZ0gBO!Bo{;Q&WM zV~hKzM04L20BA!600h)@pk@MPCs0oSH5X{4K+yx#GXN3-jT}guz%o@MqX6}sMoQL5 zDbQRgH1}A|FIDkNfw)Q|r2+XcBpuQyW`K$hDQ1Cc9;n4YEdkIH;ALod*EG}Dz-$rp zodRS-8tD*F2^9QBm7ql>XjO|zDiH~iGQlzzD86d`M;8Iw0Wf$N3>*f7!C)X53}FF1 zT0@Toj5C077L3FL<|Sw<4{-A#&RxJIKpX-MAm?_cBlxb#&;M-FLuSz*n4d&h` zXWyvinw0!TAZh`kHX!Z*ViJ&afdz_MOab5f!Qzm5fd-Zs&>|hkCV+ej$T>j02*z+= z>_u@$tA>DwJ(UpDP?lurK+A9mzvO(D-+gFH)8MEW*O2c>3^gu}@HCz3w3$-%Bg0iD72j)nmts zO~01P6^cappH!;k{M1!%*t$nQ=-$~$cX+fEkj^3P+$d^La54PkS=(gpNkdn~8?D*hW^hb50#Qbv(Vr z7mux=@03*OzkBFr1euY0!)>k{MMqGw8F#U zRe``TW;?0PDm5oCUDqnyR2D|VTUKrljh??&VAFx_Y8>n0){SLYN4rN@58&~EY<8F( z0{QSBO|7FRtIxB?ykG0dfo2c-Y&e&zlYMnqkV9vq+=EwnBv2HB%MeBD4xS7LeKIpT_! z`x2_k`zl`LzeQ$W8QpB(KQ+0LVyEJr9M?0CO4qCq-VU);<`uj}<}S1&Q7xSe=5T(8 ziLmqu&AMuP>etg&fo)XY<9~c4ufJu@Ux>Osj0^B-);#sZ?RMt%g}dL*c}ZebdsbpF zCGfuwrDfcoU0*mJ)RD4V;PPr$+Lrfm`b7p-cJd8)xqdLm^ZH#<*JQfYJ~PoB*LK5| zH$C3CzsVSRfseg&M51H8?1)k+yOYwqQqn)B#!aMev)#63aXG;9DDJn_0c)Gxymon< zymu+j@mLckYTb1Up+$oES-Qj(fgx}5+7lCfvmr6-7IAsgPaDgPES=EUr(Q2%O-m}?RmP5S6{I{NuN(T6$1*`X7IJXi>l zhX)mey1{@?Zefvr;ZbWC>l|x544h)bavSVvqawV&>mHYcaIE7arJsyhy0aAZ28%Ea^Z`=aTvh4miaaN0)5vL*wCb?j}Dsf4O@AD!~!zsLr>lt6x7K z3`4aaD)%xv?5(p|tKkpFdnS6dqgrLbo&zQ4gEPu=g5tj(#rWP>nDR~6@jTSz^oix< mOkD9tMJf;J-L)*xtX8`HcJ}PmJwolr6m}pW*#DJZbk@H_2$Vel diff --git a/www/javascript/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png b/www/javascript/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png deleted file mode 100644 index 7fc57f2bc2d63a3ad6fbf98b663f336539f011ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 651 zcmV;60(AX}P)~UV&BV#i#>&vh%+bls)637) z|EoX$u}%N7Q2(@4|Fu{Dw_E?XUjMpc|GQ=Xy=niyZU4b?|HF3w#e4t9fd9#a|I3O0 z&5r-ub^qLY|J{H8--Q3*iT~k_|KpSYd|L3Cr=%)YbtN-h;|LwH@@45f* zzW?&W|MbWI_00eO|F&Wq@&Et;0(4SNQveUqL%#keZfRNo2=jQw7k!se7X^9V1j4iLUp68Z@t=r4G(h~O zNf#5nT>kpvo%+~iMX{n4jABdM%#4?wj5qS!L>wXh2IPsmmi~l5Z*gRt`Huw!S{nag zygxXo!EY-rAUF!s;uNGb)obDTa;U{!asI0iv51EeU)nfId~s{&Jwj9nO>J@7?&+bL86o&f`_+2dMjNDlznHevZxL*5CO3g!A%X+HtoOt*;a#?S#1tH|-{3nqVC~3) z-TZe2lRd$Eg7*aH=fv^j*7(0A*nUqK2MS);6Z}sFFDxvGP0yz zu<#RHZ#1M{S2O^|jk+{4RMd0zG2?zjm17>gsz-r(G{Jg*xXugDJ!hfztM(r#SifJy zyRXgnjO+UeE>|j2E?1-iDrG5Gke9O@^$g@HGRGWpJ=U*9k6I&|U|du0Q$!2__$qTB z!Gf_az%?eUt=*u{Q!oW?qrwFA`rM|&V>jzZjg$#wpx?d_7sf& z8U{&4lFA(t)Q~5rtDL=N4LzKTCYbvp_)5(EBL)lR{t3RY7HeGJOYr>syd)X(^ND1+ zMUrGONmQ=je6j_uf&OTM&3z{3p3FR0uwIjJE#&}F^b9`{S#it!1pPlzWJ1(avR;FV7+1Waz2(|Uc;urnCmH` z!L@zx6WnSxrP*vrv(=JThRQ)R8*>hQYQ71wvFg#UXH>6?^{X=WplEV0ExjMW`9Q(y z{i(G;wl>F@)APzl%kNj^PNyxMPDk494x$C>ZH`GBSan^CCfK|VA>41MV6M?- zyf)x|0tM?efzDYo-?QTb_y5n4(Y||qWEADl6Knb&dIn0kFJKR$f>#3827ZU0Xo>+A zk3p0@aNS6!%7e}(qkdcE!yC*wXVg;Ws5A20GXkl|Xx+&V=g)@1MbTE*L+4Hoo%#y%6mDum^XrA#ikAq_KzC(jyDTxBt>PqC_AX^<0AcU6Jcg6Rxes1igNO1%i#c)FIBO6OJPb zUMpt;rwky#s;&N>Q}AH}tj#g;7CdTvD01zwF{9Z>0dk{;NFGOY5l=Ag%;oRhtd;W# zo_pShT!KNkVAjzaU+~I|$jxat>q)p^Jlg&7iVx`Z6O2cy^y=YE$}@;M-yE~{tj;ZD zR`nwS)S?N#c~RunB{%EUVhF}B2I<_Zz+ZS)}ov59sw54Dg5DWImc)L*zU^%8VwsgeQcZ>32c6;K5Ci z)^Q)u>wT)s&wzpYoY(sNm$~z^;g(b6R$T9&;IKO%}Dcw_FgZ2W#^OdmPN z$XT~wpYBma7Cc%tPqS_C3=E1PSgwC8>2D`Dk-1N-F?tx)JaWF4V-Q(z_RnP(IMpbK z;H$@Emx17@r^@NAX(zIt6hrXnr`JS&eq9i){L&j3gULPiTx7w^UMJk?>Rd4d4}W-C zMi)#}?T}S7#@|21u}O5ngI>wO*OIQx7DMphivt26WgDt~W_#^H=6tOY(G&B?Xrq0~ z$?)do;t6I>ftGN;7*}xPq>HR=x)_2d3Y=WC?_j$Y_f+}v{eXv(1a(F2NHGMbUq2$l z(!-)7b0h9dDTBSS?_f%_PkxIhcr^8dq~AU{2037U5RtH#eRdspa@j?wcy^IhX_f&c2fC1!MwfeDQ2%d1p2CN#-?if+mxdwuxo+{5i;sT#d z7ep}5-6ou^sdG2x3ibiytScZm>Z$Ut2i>%e7eg@5(ZU!_o`c}Hr^<7O+_XO}h+v+r znP+XtS+}WzyPoAiaNJYnKVEio<5V#O4?6EldgB8@9FB7}Mnp}+Ippja>K@kOKBg_5 z^E+1WepL*?TF~8ua*ktDs?Lo$+`(~Am8(acpsyH$DTeT_reNlrGy4B6!6ox_+lGGu z@E*(MsdD{Ak@`zA`cp-qYr-++84ZkH2#$NI+`s7JUpq3|`(J7AF@FQ|kL}L{k<6z6 O0000 - - {#advanced_dlg.code_title} - - - - -
-
- -
- -
- -
- - - -
- - -
-
- - diff --git a/www/javascript/tiny_mce/themes/simple/editor_template.js b/www/javascript/tiny_mce/themes/simple/editor_template.js deleted file mode 100644 index 4b3209cc9..000000000 --- a/www/javascript/tiny_mce/themes/simple/editor_template.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.contentCSS.push(d+"/skins/"+f.skin+"/content.css");c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})})});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/themes/simple/editor_template_src.js b/www/javascript/tiny_mce/themes/simple/editor_template_src.js deleted file mode 100644 index 01ce87c58..000000000 --- a/www/javascript/tiny_mce/themes/simple/editor_template_src.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * editor_template_src.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -(function() { - var DOM = tinymce.DOM; - - // Tell it to load theme specific language pack(s) - tinymce.ThemeManager.requireLangPack('simple'); - - tinymce.create('tinymce.themes.SimpleTheme', { - init : function(ed, url) { - var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings; - - t.editor = ed; - ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css"); - - ed.onInit.add(function() { - ed.onNodeChange.add(function(ed, cm) { - tinymce.each(states, function(c) { - cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c)); - }); - }); - }); - - DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css"); - }, - - renderUI : function(o) { - var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc; - - n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n); - n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'}); - n = tb = DOM.add(n, 'tbody'); - - // Create iframe container - n = DOM.add(tb, 'tr'); - n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'}); - - // Create toolbar container - n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'}); - - // Create toolbar - tb = t.toolbar = cf.createToolbar("tools1"); - tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'})); - tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'})); - tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'})); - tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'})); - tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'})); - tb.add(cf.createSeparator()); - tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'})); - tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'})); - tb.renderTo(n); - - return { - iframeContainer : ic, - editorContainer : ed.id + '_container', - sizeContainer : sc, - deltaHeight : -20 - }; - }, - - getInfo : function() { - return { - longname : 'Simple theme', - author : 'Moxiecode Systems AB', - authorurl : 'http://tinymce.moxiecode.com', - version : tinymce.majorVersion + "." + tinymce.minorVersion - } - } - }); - - tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme); -})(); \ No newline at end of file diff --git a/www/javascript/tiny_mce/themes/simple/img/icons.gif b/www/javascript/tiny_mce/themes/simple/img/icons.gif deleted file mode 100644 index 6fcbcb5dedf16a5fa1d15c2aa127bceb612f1e71..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 806 zcmZ?wbhEHbJi#Es@KuxH{{08bHy>kQU|4+kcV*u?6Yu2z|Nk2X_I-c9E~4fBsnb_x z&7Ngzq1inB@Woqi-rnfiGF7yw9zM z^p;~=3MY4TT)2AY!iC=7fBwej_wPS(UDm1P!}|}9?`#au+qhx#R?Fl=KuakHia%Lc z85lGfbU;Rd{N%v)|G<<24;`ug6HAIt=2*?Yu%d)ZG@><(acbwmDSj%f4MMZ#%vkt3 z%+g~)i8kP^LLB_(WJHBo z)4eilyozQ8a&qqSt%<6xpa0;xA7k;M?mchbzI*>+`RnL~M?L!{MDwZt;o_B2F2$0=pQSpQ!u@RcUGT{(44KaY91N#ws_nDH9G%Qf=ZF z5o_THWH`G~`GwyilS^z$ZvV~I`dh4Lx_8c>?R@8gr-07UIgFjp0y#A&c{B)cE>2kS zL5I1;i$zoEA)6qV`HGJvVWE!{8MZ6ST|PC}d%Kid7{KiD{l18xziSGKuWtj9AkWy-*`}#c~0`Lrjq> z-;O-o=3A#@&dst%_SasuJq0xZW;OwR3vM!diY%Es?;J~Pp}LYununP(i|XxU>#u=* zSvNC^0?cJ=S?=UK4&2DdcCO^BsHxjWc4vR-Z64x&8r#>V9!JMd4O!Z*d@mNrgX=jUy;0|T>ZntHjDU$=-I8y`|tN~Y9 diff --git a/www/javascript/tiny_mce/themes/simple/langs/en.js b/www/javascript/tiny_mce/themes/simple/langs/en.js deleted file mode 100644 index 9f08f102f..000000000 --- a/www/javascript/tiny_mce/themes/simple/langs/en.js +++ /dev/null @@ -1,11 +0,0 @@ -tinyMCE.addI18n('en.simple',{ -bold_desc:"Bold (Ctrl+B)", -italic_desc:"Italic (Ctrl+I)", -underline_desc:"Underline (Ctrl+U)", -striketrough_desc:"Strikethrough", -bullist_desc:"Unordered list", -numlist_desc:"Ordered list", -undo_desc:"Undo (Ctrl+Z)", -redo_desc:"Redo (Ctrl+Y)", -cleanup_desc:"Cleanup messy code" -}); \ No newline at end of file diff --git a/www/javascript/tiny_mce/themes/simple/skins/default/content.css b/www/javascript/tiny_mce/themes/simple/skins/default/content.css deleted file mode 100644 index 2506c807c..000000000 --- a/www/javascript/tiny_mce/themes/simple/skins/default/content.css +++ /dev/null @@ -1,25 +0,0 @@ -body, td, pre { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; -} - -body { - background-color: #FFFFFF; -} - -.mceVisualAid { - border: 1px dashed #BBBBBB; -} - -/* MSIE specific */ - -* html body { - scrollbar-3dlight-color: #F0F0EE; - scrollbar-arrow-color: #676662; - scrollbar-base-color: #F0F0EE; - scrollbar-darkshadow-color: #DDDDDD; - scrollbar-face-color: #E0E0DD; - scrollbar-highlight-color: #F0F0EE; - scrollbar-shadow-color: #F0F0EE; - scrollbar-track-color: #F5F5F5; -} diff --git a/www/javascript/tiny_mce/themes/simple/skins/default/ui.css b/www/javascript/tiny_mce/themes/simple/skins/default/ui.css deleted file mode 100644 index 076fe84e3..000000000 --- a/www/javascript/tiny_mce/themes/simple/skins/default/ui.css +++ /dev/null @@ -1,32 +0,0 @@ -/* Reset */ -.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} - -/* Containers */ -.defaultSimpleSkin {position:relative} -.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;} -.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;} -.defaultSimpleSkin .mceToolbar {height:24px;} - -/* Layout */ -.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px} -.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} - -/* Button */ -.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px} -.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} -.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -/* Separator */ -.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px} - -/* Theme */ -.defaultSimpleSkin span.mce_bold {background-position:0 0} -.defaultSimpleSkin span.mce_italic {background-position:-60px 0} -.defaultSimpleSkin span.mce_underline {background-position:-140px 0} -.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0} -.defaultSimpleSkin span.mce_undo {background-position:-160px 0} -.defaultSimpleSkin span.mce_redo {background-position:-100px 0} -.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0} -.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} -.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/www/javascript/tiny_mce/themes/simple/skins/o2k7/content.css b/www/javascript/tiny_mce/themes/simple/skins/o2k7/content.css deleted file mode 100644 index 595809fa6..000000000 --- a/www/javascript/tiny_mce/themes/simple/skins/o2k7/content.css +++ /dev/null @@ -1,17 +0,0 @@ -body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} - -body {background: #FFF;} -.mceVisualAid {border: 1px dashed #BBB;} - -/* IE */ - -* html body { -scrollbar-3dlight-color: #F0F0EE; -scrollbar-arrow-color: #676662; -scrollbar-base-color: #F0F0EE; -scrollbar-darkshadow-color: #DDDDDD; -scrollbar-face-color: #E0E0DD; -scrollbar-highlight-color: #F0F0EE; -scrollbar-shadow-color: #F0F0EE; -scrollbar-track-color: #F5F5F5; -} diff --git a/www/javascript/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png b/www/javascript/tiny_mce/themes/simple/skins/o2k7/img/button_bg.png deleted file mode 100644 index 527e3495a653e57d76bf7e55316793d17dda497a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5102 zcmd^Ci96I^7ypWw?8;J!C`Gc9QubX!7+c8}rXowpTC!y=vhPca?365N$TIeQ$u=`g z7%`X;V+>~bzVrJ#-t*jZ&pr2fKKGn^&V9~vZo*x2BQEx{>;M38nHcL^F{BiObs@}* z`J{#WLxwovXYBAC060$l$4o$8!D#?sw|K0lclYii-vHm|k9_^aO!V}`{GR!GKKAwi zfM8^yH4JKv6VxCt?&+GwM`W1#S_weJtaOti_){-Si=W`V9WVZ2Ucj=G&%l61xW6Qx zIXOAvt$?KrXCnI?8&>>da`dP8#6ikZ*e9=Xj!Y3TOdSEKH%uWB{D5|7vhEi^+mI=uFz2#0P{IPZ3_WyP0q)8IE|RbRP5}{x z2f1NP!2Jwy0j82vKX1B3cwNuxb$DV7!1VZ0{n)%cIrDj8dcu&mZD20F_l+P$K~x|}=gXx@k6>Qpl6&#z^PNTmmnMl1(^x`y}el%5+)I}ziC z{+nV%ZRP-}B2yQ-P25`SrTJGZPx>e8=e;E=m0n2DO}o-_X%ci_#>h~ZH8IzKuTM0Y z!ct|+A3S80mwAc^uuzL3L4$(Us`#(&g1vdn3IGLcQB-!%*n8~-# z(8-gNhLb*47jZHb`6|X|FQyM5-M#AB)G}nmuJ*sd7Ge=tWvnn(eD^+kp_{h<=L73y zDXYOJx6iEduBxoEdgLhS*nG;fS}6Yj<-3-0Pq*enlU1E%T=^-L7kO$U(SjzXr8OTj zr_MeSdPII)w;u45Zy{6EJbT=3atLR%p1sbz7sSaGD-him50g5Rf12$y>`c(4Pd?@RJM(g;u(Uk1qVh}SVkL(S(PjvmQsHF% zs@Bj(*?Oho#P6&so65qwo7TeCu!>vdah0%gU#QmSa0glfs{`T=!b0z}Wyv?^mDXM{ zj)!Ny2g`_iaaF~>h`iQ)`P<0+%Rp&(4ow7}q)}P%K}}EjwzA!KD`JMH7TZdW|3N{3 z`H3~DvTR~_;v)a{mE|kKUsUe2D0(=0Rc2*p*;g4?SymZswyD1=8NeMVk=#0c zwL3k?%w8Sn54MXzP`_X1ZoC#iX`OsDGL^ zd}qk>_HnP{ip0v(-lx5vF0)=1zieu@VMfTaGHdyA<;$%*x9;?f43B&qnaRDDuc0`r zw3fe?KbwzfcDWaPPo}B7>4%3&J@(!g2SQV;&zpN{4yE=s_a1yVtSPLyGy|`Jm+_Ug zn5Uap70tj9Uw4`Ynkt&ld|jPmMb$PvZF=Pja}$C!_tYW?>22w+e!hA~(_rI@o9C_) zxhE3-yx|%DP1~D`d7}jctyevJSvYx^{TT1qobpQ3si7;~j|;8yr;K1iu$Jf1#Q3BH z)2Jc2Y)!d*;ogP*Htg*HlK+FH&`DBZ{`dSYd^xI)ph|d5h(i|-s}x@;a!`Igj_B9> zW4St^#ZjE8;DxCUx6reQgf*^Rlz%9nYF9J+wYfB?lI*%Iq`9y8tawFpMg97s(xQX& z@b!-7{^lVIgm01a8;suTi=aCg3QhoJ5to=?%n6Y?k@t^L4nkjwwUdtIx9evFG=5F}<%s89tU)Ll=IH%;BxHopOTFHL# z_Gc#)v#$kBp!J?(^pEtj^cVACiWX{hvbV2EYgWoVQAb|?sq#~+SI*O6c-p?u-o)GV zoSK|;t*VdrFANn=j9V^T=2!_6%8~DX;1}{?v}^B8nP7$7Ntv5j+IQm3Z)E(_;gv2I ze0yp4RM4el_K+@-F4zV63Dt@CIXy>dQS)76X|vF@t<=_QArd{xr8286F_IPUTkmk) zS;)UxB$yW{_EbsZW}9MkTIzd$-AZw@^d{H_?5}6wP_@UKdU}sfQnS2hCfk75_xIJu z9c0;?bib@a?@7%{v(>{q>^$2?5(d?>s*0|T;D^5tqTXLG*e(X~C%aBAr8Sktn%c>V z*#B*-exg>d?jM3;UlBNdHP)83TKz|2ll0SRiz>Wbc5QguA2Nw474wy#Qqu4@WO@V~OT7HyJw!rH-DRl6vaGdX8doDVop`xn0#eK|k z(i8W0QMTwlcUEQg-)wFlu6bkw7sj>$Pue#?$!Cv9q2SR?dM%&Y)qk{llnsoI+|q)6 zhVDU+psIw)g+|xe1D^?ka9HcU%GNaMek+-#Iq(Z*!(?MN?K$m1F`;}XYt<%H;tsMX zPao8nKlR7=F;6nn*e-H6&9?lW7Maw5TBXcf-8ACvJO7JbxE&U z7DqmTA&YX|L1m~Wj&x$k!Wr^T@5#LUKGDAfpco~J-X z-67;Q5jyY~iHn*_hwYBNEzB%@6)ty(c0qk?3R`FHAzeeeQ!UTuq`R|_Gutuf4#j1w-pKDw~i7P2D< z&P*4nX)Lr6Lw(6TWD-VjA^e#nZFC4eA0$brX|-r|-qXhG%5n!qvy8Kub*@T zl@KS;Mr77E(PQ*fQVNgW@s!+@p;)fi&7vEcYHG_`&uBPmnckTD*ySQ2`bYXut&pI6 z_`&q%?C3 zL<7Jf$dEVyc%c9Q8!iBFGY0^KeAAqJ3;}={xO)d`z`%eYh#JiuMDNsfW1=$<(dmeo zjP95WM1J$1l2&YH-E;|jIjipXkD;|WEa?w!-}cqFV)$|~e5s^$xdgu0`J3=-Vxw&w z*E+V2nAz@{CUpMB{~E`2PHpwf{u@M-#+S$=3%e74_NG_%k!y$Zf6230(!vG>jXT0@ zQWkKBD|iY9x4*ta!{QHDwhjtf(8ch@lGepy_(H?L@-N2uQ~0)tjbD=+0}K1zvkVjX zeiX51?%&Yje((Ihp1JK2%>KyY?kI*hvwAR%B~LEx&0zP(76>cb^ko8V2~SK&K zhZgtxQ9FG|29P*_-Wgih9Yhf(m-i-?h~t>;(FObndTSO-M6Qvr|LB;_gMJiY5WPLI z%qL(;yWI9`%6K1(3Q7(n;XqFi2emX?T!M z21(7}!4Q3a5TtI4U6L8WDoG=3?&A|zCaLN{(cA-zZgEJoBj3+qz1VjeXFz>+S_q3%Ha5;mvltEk0 z0I@mXY5{${dec;X@b$bxp z9RrC|)SYo~Z-z#k2KN_0G6p0sfm9+m{{oy329Ym8bR>w5rp-swkufx642VghGpsLV zfa_J@<_~aZ7~Go&NhpxA1I~ni(;>9q!Qf0NZ9WD(+@ue@p!NmO2Lh@6FQ{;5TB{2k z@raIiLhE`Aj>gePV!^R^N`noh!Is)&M{TsD!Ck=LIkdTQ5Lr3ckUh|l1I||*p_&en zje`w21K)GDrW!Y=8jp~TjF;a|x}gsMOhAB@xiv%meO2x_!p66W8|!3F z3K<7F$K0Opu&RXCgY0kj(}Md=k40Ax3**GROT%0zW&NB3QY@Ac&kyGl^e-&ALU@lcY9Q}1h&TWo z+k?8hnE8OA{@y=VwBtoF@ihygu@)0b$2x5Lov1td z-k(2Ze}N=k@O+&25t3H|iTZ-W?aUDy#Sicgc12CnBuq5L+a-$MlL@I3Y8rf~(>P;3 z6|)Hzvs3&!*8B$J{E8Z)sCX_~-HCM8E*6rI;^47^s=UobI%jJMp zUEHb>8saG^lr1R4=HWje>a6xd&1c<7%aN7wAskl%AhM|DwH^LGE<~=j0xyL1Sf`8F zffz3*Ycx-kPN=ks(AiKa(byk%<5z5p{T<`)uilX3XZL^m(C70?&g>>B^n3^&aS>j9 z(=a=hH}sEs46p9_z0MHG2c9n8K7X{?dLX>Or_5^-R}=tu3__0%m^4q(9!oU$T2(;h zNEfnimp*HOZcw1o*@LAD3YkNR4wn4n!2NCwOMU}OG@k+IaKgNZV*bJaAt7uzSt@b9 zI%mY~Pg3{HjIBCfO5aNUj=q~RUy9^Of6ie-JM#Qs73~!#+PX12@5|%LBP$yl8|!N} z(<+WeX4cottl1cv*%Xu$t)~l`4PMZ6FIm&W3$-3l_^?6o_l`b`;8X`NC zCSjT;Go-{Vy}Ran$)Ua?Ci?hcquG{?heOssk(AxT=;)W4uiuZYVX$@4afkW;MwkRe zg#{4hP)@|byaFde!CYEWl9lzz>a&*5*_D^tDmPctYVAn%wGT@|gM)()rq-0of86@S zpW$YCMNq)NG9$`LhM%M70yp9Oe27W3YD3n< zV?=oxR(68L_JS3@&Ti7CH)#u-q^YxN7b22`Or8ynbtoJ~GYNN6M}36p0QHtFr;sN(-`SjCLE z^;=~`c}nHAqS=&+**WhTU?amp#_E%kugb=cbTvjcRPdpJo_T*OLJ~E+ z!ioz{$NIZL-zNH7DRMHiRe7{kW|Putvu{sV*4mj)KM`Q#@$FtzjJr`TWl&lobv$g0 zKk0a>J=E{+oZtaA(2AEuGZ)*O-YVuT>7N}ZloloSuk}6lP(mKk+94U@XrwtnRBxAs zm^c~xa2y+x-0}0iUT9JlG=jv-)(>n)f262E!2209 VmjT$ODWe$zObpERYjs_s{s;8{A&me4 diff --git a/www/javascript/tiny_mce/themes/simple/skins/o2k7/ui.css b/www/javascript/tiny_mce/themes/simple/skins/o2k7/ui.css deleted file mode 100644 index cf6c35d10..000000000 --- a/www/javascript/tiny_mce/themes/simple/skins/o2k7/ui.css +++ /dev/null @@ -1,35 +0,0 @@ -/* Reset */ -.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000} - -/* Containers */ -.o2k7SimpleSkin {position:relative} -.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;} -.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;} -.o2k7SimpleSkin .mceToolbar {height:26px;} - -/* Layout */ -.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; } -.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} -.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px} -.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} - -/* Button */ -.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} -.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px} -.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} -.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px} -.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -/* Separator */ -.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} - -/* Theme */ -.o2k7SimpleSkin span.mce_bold {background-position:0 0} -.o2k7SimpleSkin span.mce_italic {background-position:-60px 0} -.o2k7SimpleSkin span.mce_underline {background-position:-140px 0} -.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0} -.o2k7SimpleSkin span.mce_undo {background-position:-160px 0} -.o2k7SimpleSkin span.mce_redo {background-position:-100px 0} -.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0} -.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0} -.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0} diff --git a/www/javascript/tiny_mce/tiny_mce.js b/www/javascript/tiny_mce/tiny_mce.js deleted file mode 100644 index bdaa74d24..000000000 --- a/www/javascript/tiny_mce/tiny_mce.js +++ /dev/null @@ -1 +0,0 @@ -(function(d){var a=/^\s*|\s*$/g,e,c="B".replace(/A(.)|B/,"$1")==="$1";var b={majorVersion:"3",minorVersion:"4.3.2",releaseDate:"2011-06-30",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=d.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);s.isIOS5=s.isIDevice&&g.match(/AppleWebKit\/(\d*)/)[1]>=534;if(d.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m=c.length){for(e=0,b=g.length;e=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(function(){function serialize(o,quote){var i,v,t;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v="[";i0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(i in o){v+=typeof o[i]!="function"?(v.length>1?","+quote:quote)+i+quote+":"+serialize(o[i],quote):""}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(j){var a,g,d,k=/[&<>\"\u007E-\uD7FF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#x|#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':""","'":"'","<":"<",">":">","&":"&"};d={"<":"<",">":">","&":"&",""":'"',"'":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o,m.length===2?16:10);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : \uFEFF".split(" ");for(g=0;g1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(r){var y={},p,n,v,q,u=d.url_converter,x=d.url_converter_scope||this;function o(C,F){var E,B,A,D;E=y[C+"-top"+F];if(!E){return}B=y[C+"-right"+F];if(E!=B){return}A=y[C+"-bottom"+F];if(B!=A){return}D=y[C+"-left"+F];if(A!=D){return}y[C+F]=D;delete y[C+"-top"+F];delete y[C+"-right"+F];delete y[C+"-bottom"+F];delete y[C+"-left"+F]}function t(B){var C=y[B],A;if(!C||C.indexOf(" ")<0){return}C=C.split(" ");A=C.length;while(A--){if(C[A]!==C[0]){return false}}y[B]=C[0];return true}function z(C,B,A,D){if(!t(B)){return}if(!t(A)){return}if(!t(D)){return}y[C]=y[B]+" "+y[A]+" "+y[D];delete y[B];delete y[A];delete y[D]}function s(A){q=true;return a[A]}function i(B,A){if(q){B=B.replace(/\uFEFF[0-9]/g,function(C){return a[C]})}if(!A){B=B.replace(/\\([\'\";:])/g,"$1")}return B}if(r){r=r.replace(/\\[\"\';:\uFEFF]/g,s).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(A){return A.replace(/[;:]/g,s)});while(p=b.exec(r)){n=p[1].replace(l,"").toLowerCase();v=p[2].replace(l,"");if(n&&v.length>0){if(n==="font-weight"&&v==="700"){v="bold"}else{if(n==="color"||n==="background-color"){v=v.toLowerCase()}}v=v.replace(k,c);v=v.replace(h,function(B,A,E,D,F,C){F=F||C;if(F){F=i(F);return"'"+F.replace(/\'/g,"\\'")+"'"}A=i(A||E||D);if(u){A=u.call(x,A,"style")}return"url('"+A.replace(/\'/g,"\\'")+"')"});y[n]=q?i(v,true):v}b.lastIndex=p.index+p[0].length}o("border","");o("border","-width");o("border","-color");o("border","-style");o("padding","");o("margin","");z("border","border-width","border-style","border-color");if(y.border==="medium none"){delete y.border}}return y},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,v;x=f.styles[t];if(x){for(u=0,s=x.length;u0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(r)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(m){var h={},j,l,g,f,c={},b,e,d=m.makeMap,k=m.each;function i(o,n){return o.split(n||",")}function a(r,q){var o,p={};function n(s){return s.replace(/[A-Z]+/g,function(t){return n(r[t])})}for(o in r){if(r.hasOwnProperty(o)){r[o]=n(r[o])}}n(q).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(v,t,s,u){s=i(s,"|");p[t]={attributes:d(s),attributesOrder:s,children:d(u,"|",{"#comment":{}})}});return p}l="h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,noscript,menu,isindex,samp,header,footer,article,section,hgroup";l=d(l,",",d(l.toUpperCase()));h=a({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]");j=d("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,preload,autoplay,loop,controls");g=d("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source");f=m.extend(d("td,th,iframe,video,object"),g);b=d("pre,script,style");e=d("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");m.html.Schema=function(q){var y=this,n={},o={},v=[],p;q=q||{};if(q.verify_html===false){q.valid_elements="*[*]"}if(q.valid_styles){p={};k(q.valid_styles,function(A,z){p[z]=m.explode(A)})}function x(z){return new RegExp("^"+z.replace(/([?+*])/g,".$1")+"$")}function s(G){var F,B,U,Q,V,A,D,P,S,L,T,X,J,E,R,z,N,C,W,Y,K,O,I=/^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,M=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,H=/[*?+]/;if(G){G=i(G);if(n["@"]){N=n["@"].attributes;C=n["@"].attributesOrder}for(F=0,B=G.length;F=0){for(P=l.length-1;P>=Q;P--){O=l[P];if(O.valid){A.end(O.name)}}l.length=Q}}D=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([^\\s\\/<>]+)\\s*((?:[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*)>))","g");h=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;g={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};F=e.getShortEndedElements();z=e.getSelfClosingElements();k=e.getBoolAttrs();x=c.validate;y=c.fix_self_closing;while(f=D.exec(q)){if(m0&&l[l.length-1].name===G){C(G)}if(!x||(I=e.getElementRule(G))){r=true;if(x){J=I.attributes;n=I.attributePatterns}if(o=f[8]){B=[];B.map={};o.replace(h,function(P,O,T,S,R){var U,Q;O=O.toLowerCase();T=O in k?O:v(T||S||R||"");if(x&&O.indexOf("data-")!==0){U=J[O];if(!U&&n){Q=n.length;while(Q--){U=n[Q];if(U.pattern.test(O)){break}}if(Q===-1){U=null}}if(!U){return}if(U.validValues&&!(T in U.validValues)){return}}B.map[O]=T;B.push({name:O,value:T})})}else{B=[];B.map={}}if(x){H=I.attributesRequired;M=I.attributesDefault;L=I.attributesForced;if(L){K=L.length;while(K--){E=L[K];N=E.name;u=E.value;if(u==="{$uid}"){u="mce_"+s++}B.map[N]=u;B.push({name:N,value:u})}}if(M){K=M.length;while(K--){E=M[K];N=E.name;if(!(N in B.map)){u=E.value;if(u==="{$uid}"){u="mce_"+s++}B.map[N]=u;B.push({name:N,value:u})}}}if(H){K=H.length;while(K--){if(H[K] in B.map){break}}if(K===-1){r=false}}if(B.map["data-mce-bogus"]){r=false}}if(r){A.start(G,B,p)}}else{r=false}if(j=g[G]){j.lastIndex=m=f.index+f[0].length;if(f=j.exec(q)){if(r){t=q.substr(m,f.index-m)}m=f.index+f[0].length}else{t=q.substr(m);m=q.length}if(r&&t.length>0){A.text(t,true)}if(r){A.end(G)}D.lastIndex=m;continue}if(!p){if(!o||o.indexOf("/")!=o.length-1){l.push({name:G,valid:r})}else{if(r){A.end(G)}}}}else{if(G=f[1]){A.comment(G)}else{if(G=f[2]){A.cdata(G)}else{if(G=f[3]){A.doctype(G)}else{if(G=f[4]){A.pi(G,f[5])}}}}}}m=f.index+f[0].length}if(m=0;K--){G=l[K];if(G.valid){A.end(G.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t0){N.value=l;N=N.prev}else{L=N.prev;N.remove();N=L}}}n=new b.html.SaxParser({validate:y,fix_self_closing:!y,cdata:function(l){A.append(I("#cdata",4)).value=l},text:function(M,l){var L;if(!s[A.name]){M=M.replace(k," ");if(A.lastChild&&o[A.lastChild.name]){M=M.replace(D,"")}}if(M.length!==0){L=I("#text",3);L.raw=!!l;A.append(L).value=M}},comment:function(l){A.append(I("#comment",8)).value=l},pi:function(l,L){A.append(I(l,7)).value=L;G(A)},doctype:function(L){var l;l=A.append(I("#doctype",10));l.value=L;G(A)},start:function(l,T,M){var R,O,N,L,P,U,S,Q;N=y?h.getElementRule(l):{};if(N){R=I(N.outputName||l,1);R.attributes=T;R.shortEnded=M;A.append(R);Q=p[A.name];if(Q&&p[R.name]&&!Q[R.name]){J.push(R)}O=d.length;while(O--){P=d[O].name;if(P in T.map){E=c[P];if(E){E.push(R)}else{c[P]=[R]}}}if(o[l]){G(R)}if(!M){A=R}}},end:function(l){var P,M,O,L,N;M=y?h.getElementRule(l):{};if(M){if(o[l]){if(!s[A.name]){for(P=A.firstChild;P&&P.type===3;){O=P.value.replace(D,"");if(O.length>0){P.value=O;P=P.next}else{L=P.next;P.remove();P=L}}for(P=A.lastChild;P&&P.type===3;){O=P.value.replace(t,"");if(O.length>0){P.value=O;P=P.prev}else{L=P.prev;P.remove();P=L}}}P=A.prev;if(P&&P.type===3){O=P.value.replace(D,"");if(O.length>0){P.value=O}else{P.remove()}}}if(M.removeEmpty||M.paddEmpty){if(A.isEmpty(u)){if(M.paddEmpty){A.empty().append(new a("#text","3")).value="\u00a0"}else{if(!A.attributes.map.name){N=A.parent;A.empty().remove();A=N;return}}}}A=A.parent}}},h);H=A=new a(m.context||g.root_name,11);n.parse(v);if(y&&J.length){if(!m.context){j(J)}else{m.invalid=true}}if(q&&H.name=="body"){F()}if(!m.invalid){for(K in i){E=e[K];z=i[K];x=z.length;while(x--){if(!z[x].parent){z.splice(x,1)}}for(C=0,B=E.length;C0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("")},comment:function(h){c.push("")},pi:function(h,i){if(i){c.push("")}else{c.push("")}if(a){c.push("\n")}},doctype:function(h){c.push("",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n=8;l.boxModel=!h.isIE||o.compatMode=="CSS1Compat"||l.stdMode;l.hasOuterHTML="outerHTML" in o.createElement("a");l.settings=m=h.extend({keep_values:false,hex_colors:1},m);l.schema=m.schema;l.styles=new h.html.Styles({url_converter:m.url_converter,url_converter_scope:m.url_converter_scope},m.schema);if(h.isIE6){try{o.execCommand("BackgroundImageCache",false,true)}catch(n){l.cssFlicker=true}}if(b&&m.schema){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(p){o.createElement(p)});for(k in m.schema.getCustomElements()){o.createElement(k)}}h.addUnload(l.destroy,l)},getRoot:function(){var j=this,k=j.settings;return(k&&j.get(k.root_element))||j.doc.body},getViewPort:function(k){var l,j;k=!k?this.win:k;l=k.document;j=this.boxModel?l.documentElement:l.body;return{x:k.pageXOffset||j.scrollLeft,y:k.pageYOffset||j.scrollTop,w:k.innerWidth||j.clientWidth,h:k.innerHeight||j.clientHeight}},getRect:function(m){var l,j=this,k;m=j.get(m);l=j.getPos(m);k=j.getSize(m);return{x:l.x,y:l.y,w:k.w,h:k.h}},getSize:function(m){var k=this,j,l;m=k.get(m);j=k.getStyle(m,"width");l=k.getStyle(m,"height");if(j.indexOf("px")===-1){j=0}if(l.indexOf("px")===-1){l=0}return{w:parseInt(j)||m.offsetWidth||m.clientWidth,h:parseInt(l)||m.offsetHeight||m.clientHeight}},getParent:function(l,k,j){return this.getParents(l,k,j,false)},getParents:function(u,p,l,s){var k=this,j,m=k.settings,q=[];u=k.get(u);s=s===undefined;if(m.strict_root){l=l||k.getRoot()}if(e(p,"string")){j=p;if(p==="*"){p=function(o){return o.nodeType==1}}else{p=function(o){return k.is(o,j)}}}while(u){if(u==l||!u.nodeType||u.nodeType===9){break}if(!p||p(u)){if(s){q.push(u)}else{return u}}u=u.parentNode}return s?q:null},get:function(j){var k;if(j&&this.doc&&typeof(j)=="string"){k=j;j=this.doc.getElementById(j);if(j&&j.id!==k){return this.doc.getElementsByName(k)[1]}}return j},getNext:function(k,j){return this._findSib(k,j,"nextSibling")},getPrev:function(k,j){return this._findSib(k,j,"previousSibling")},select:function(l,k){var j=this;return h.dom.Sizzle(l,j.get(k)||j.get(j.settings.root_element)||j.doc,[])},is:function(l,j){var k;if(l.length===undefined){if(j==="*"){return l.nodeType==1}if(a.test(j)){j=j.toLowerCase().split(/,/);l=l.nodeName.toLowerCase();for(k=j.length-1;k>=0;k--){if(j[k]==l){return true}}return false}}return h.dom.Sizzle.matches(j,l.nodeType?[l]:l).length>0},add:function(m,q,j,l,o){var k=this;return this.run(m,function(s){var r,n;r=e(q,"string")?k.doc.createElement(q):q;k.setAttribs(r,j);if(l){if(l.nodeType){r.appendChild(l)}else{k.setHTML(r,l)}}return !o?s.appendChild(r):r})},create:function(l,j,k){return this.add(this.doc.createElement(l),l,j,k,1)},createHTML:function(r,j,p){var q="",m=this,l;q+="<"+r;for(l in j){if(j.hasOwnProperty(l)){q+=" "+l+'="'+m.encode(j[l])+'"'}}if(typeof(p)!="undefined"){return q+">"+p+""}return q+" />"},remove:function(j,k){return this.run(j,function(m){var n,l=m.parentNode;if(!l){return null}if(k){while(n=m.firstChild){if(!h.isIE||n.nodeType!==3||n.nodeValue){l.insertBefore(n,m)}else{m.removeChild(n)}}}return l.removeChild(m)})},setStyle:function(m,j,k){var l=this;return l.run(m,function(p){var o,n;o=p.style;j=j.replace(/-(\D)/g,function(r,q){return q.toUpperCase()});if(l.pixelStyles.test(j)&&(h.is(k,"number")||/^[\-0-9\.]+$/.test(k))){k+="px"}switch(j){case"opacity":if(b){o.filter=k===""?"":"alpha(opacity="+(k*100)+")";if(!m.currentStyle||!m.currentStyle.hasLayout){o.display="inline-block"}}o[j]=o["-moz-opacity"]=o["-khtml-opacity"]=k||"";break;case"float":b?o.styleFloat=k:o.cssFloat=k;break;default:o[j]=k||""}if(l.settings.update_styles){l.setAttrib(p,"data-mce-style")}})},getStyle:function(m,j,l){m=this.get(m);if(!m){return}if(this.doc.defaultView&&l){j=j.replace(/[A-Z]/g,function(n){return"-"+n});try{return this.doc.defaultView.getComputedStyle(m,null).getPropertyValue(j)}catch(k){return null}}j=j.replace(/-(\D)/g,function(o,n){return n.toUpperCase()});if(j=="float"){j=b?"styleFloat":"cssFloat"}if(m.currentStyle&&l){return m.currentStyle[j]}return m.style?m.style[j]:undefined},setStyles:function(m,n){var k=this,l=k.settings,j;j=l.update_styles;l.update_styles=0;f(n,function(o,p){k.setStyle(m,p,o)});l.update_styles=j;if(l.update_styles){k.setAttrib(m,l.cssText)}},removeAllAttribs:function(j){return this.run(j,function(m){var l,k=m.attributes;for(l=k.length-1;l>=0;l--){m.removeAttributeNode(k.item(l))}})},setAttrib:function(l,m,j){var k=this;if(!l||!m){return}if(k.settings.strict){m=m.toLowerCase()}return this.run(l,function(o){var n=k.settings;switch(m){case"style":if(!e(j,"string")){f(j,function(p,q){k.setStyle(o,q,p)});return}if(n.keep_values){if(j&&!k._isRes(j)){o.setAttribute("data-mce-style",j,2)}else{o.removeAttribute("data-mce-style",2)}}o.style.cssText=j;break;case"class":o.className=j||"";break;case"src":case"href":if(n.keep_values){if(n.url_converter){j=n.url_converter.call(n.url_converter_scope||k,j,m,o)}k.setAttrib(o,"data-mce-"+m,j,2)}break;case"shape":o.setAttribute("data-mce-style",j);break}if(e(j)&&j!==null&&j.length!==0){o.setAttribute(m,""+j,2)}else{o.removeAttribute(m,2)}})},setAttribs:function(k,l){var j=this;return this.run(k,function(m){f(l,function(o,p){j.setAttrib(m,p,o)})})},getAttrib:function(o,p,l){var j,k=this,m;o=k.get(o);if(!o||o.nodeType!==1){return l===m?false:l}if(!e(l)){l=""}if(/^(src|href|style|coords|shape)$/.test(p)){j=o.getAttribute("data-mce-"+p);if(j){return j}}if(b&&k.props[p]){j=o[k.props[p]];j=j&&j.nodeValue?j.nodeValue:j}if(!j){j=o.getAttribute(p,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(p)){if(o[k.props[p]]===true&&j===""){return p}return j?p:""}if(o.nodeName==="FORM"&&o.getAttributeNode(p)){return o.getAttributeNode(p).nodeValue}if(p==="style"){j=j||o.style.cssText;if(j){j=k.serializeStyle(k.parseStyle(j),o.nodeName);if(k.settings.keep_values&&!k._isRes(j)){o.setAttribute("data-mce-style",j)}}}if(d&&p==="class"&&j){j=j.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(p){case"rowspan":case"colspan":if(j===1){j=""}break;case"size":if(j==="+0"||j===20||j===0){j=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(j===0){j=""}break;case"hspace":if(j===-1){j=""}break;case"maxlength":case"tabindex":if(j===32768||j===2147483647||j==="32768"){j=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(j===65535){return p}return l;case"shape":j=j.toLowerCase();break;default:if(p.indexOf("on")===0&&j){j=h._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+j)}}}return(j!==m&&j!==null&&j!=="")?""+j:l},getPos:function(s,m){var k=this,j=0,q=0,o,p=k.doc,l;s=k.get(s);m=m||p.body;if(s){if(s.getBoundingClientRect){s=s.getBoundingClientRect();o=k.boxModel?p.documentElement:p.body;j=s.left+(p.documentElement.scrollLeft||p.body.scrollLeft)-o.clientTop;q=s.top+(p.documentElement.scrollTop||p.body.scrollTop)-o.clientLeft;return{x:j,y:q}}l=s;while(l&&l!=m&&l.nodeType){j+=l.offsetLeft||0;q+=l.offsetTop||0;l=l.offsetParent}l=s.parentNode;while(l&&l!=m&&l.nodeType){j-=l.scrollLeft||0;q-=l.scrollTop||0;l=l.parentNode}}return{x:j,y:q}},parseStyle:function(j){return this.styles.parse(j)},serializeStyle:function(k,j){return this.styles.serialize(k,j)},loadCSS:function(j){var l=this,m=l.doc,k;if(!j){j=""}k=l.select("head")[0];f(j.split(","),function(n){var o;if(l.files[n]){return}l.files[n]=true;o=l.create("link",{rel:"stylesheet",href:h._addVer(n)});if(b&&m.documentMode&&m.recalc){o.onload=function(){if(m.recalc){m.recalc()}o.onload=null}}k.appendChild(o)})},addClass:function(j,k){return this.run(j,function(l){var m;if(!k){return 0}if(this.hasClass(l,k)){return l.className}m=this.removeClass(l,k);return l.className=(m!=""?(m+" "):"")+k})},removeClass:function(l,m){var j=this,k;return j.run(l,function(o){var n;if(j.hasClass(o,m)){if(!k){k=new RegExp("(^|\\s+)"+m+"(\\s+|$)","g")}n=o.className.replace(k," ");n=h.trim(n!=" "?n:"");o.className=n;if(!n){o.removeAttribute("class");o.removeAttribute("className")}return n}return o.className})},hasClass:function(k,j){k=this.get(k);if(!k||!j){return false}return(" "+k.className+" ").indexOf(" "+j+" ")!==-1},show:function(j){return this.setStyle(j,"display","block")},hide:function(j){return this.setStyle(j,"display","none")},isHidden:function(j){j=this.get(j);return !j||j.style.display=="none"||this.getStyle(j,"display")=="none"},uniqueId:function(j){return(!j?"mce_":j)+(this.counter++)},setHTML:function(l,k){var j=this;return j.run(l,function(n){if(b){while(n.firstChild){n.removeChild(n.firstChild)}try{n.innerHTML="
"+k;n.removeChild(n.firstChild)}catch(m){n=j.create("div");n.innerHTML="
"+k;f(n.childNodes,function(p,o){if(o){n.appendChild(p)}})}}else{n.innerHTML=k}return k})},getOuterHTML:function(l){var k,j=this;l=j.get(l);if(!l){return null}if(l.nodeType===1&&j.hasOuterHTML){return l.outerHTML}k=(l.ownerDocument||j.doc).createElement("body");k.appendChild(l.cloneNode(true));return k.innerHTML},setOuterHTML:function(m,k,n){var j=this;function l(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){j.insertAfter(s.cloneNode(true),p);s=s.previousSibling}j.remove(p)}return this.run(m,function(p){p=j.get(p);if(p.nodeType==1){n=n||p.ownerDocument||j.doc;if(b){try{if(b&&p.nodeType==1){p.outerHTML=k}else{l(p,k,n)}}catch(o){l(p,k,n)}}else{l(p,k,n)}}})},decode:c.decode,encode:c.encodeAllRaw,insertAfter:function(j,k){k=this.get(k);return this.run(j,function(m){var l,n;l=k.parentNode;n=k.nextSibling;if(n){l.insertBefore(m,n)}else{l.appendChild(m)}return m})},isBlock:function(k){var j=k.nodeType;if(j){return !!(j===1&&g[k.nodeName])}return !!g[k]},replace:function(p,m,j){var l=this;if(e(m,"array")){p=p.cloneNode(true)}return l.run(m,function(k){if(j){f(h.grep(k.childNodes),function(n){p.appendChild(n)})}return k.parentNode.replaceChild(p,k)})},rename:function(m,j){var l=this,k;if(m.nodeName!=j.toUpperCase()){k=l.create(j);f(l.getAttribs(m),function(n){l.setAttrib(k,n.nodeName,l.getAttrib(m,n.nodeName))});l.replace(k,m,1)}return k||m},findCommonAncestor:function(l,j){var m=l,k;while(m){k=j;while(k&&m!=k){k=k.parentNode}if(m==k){break}m=m.parentNode}if(!m&&l.ownerDocument){return l.ownerDocument.documentElement}return m},toHex:function(j){var l=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(j);function k(m){m=parseInt(m).toString(16);return m.length>1?m:"0"+m}if(l){j="#"+k(l[1])+k(l[2])+k(l[3]);return j}return j},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(r){f(r.imports,function(s){q(s)});f(r.cssRules||r.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){f(s.selectorText.split(","),function(t){t=t.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(t)||!/\.[\w\-]+$/.test(t)){return}l=t;t=h._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",t);if(p&&!(t=p(t,l))){return}if(!o[t]){j.push({"class":t});o[t]=1}})}break;case 3:q(s.styleSheet);break}})}try{f(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(m,l,k){var j=this,n;if(j.doc&&typeof(m)==="string"){m=j.get(m)}if(!m){return false}k=k||this;if(!m.nodeType&&(m.length||m.length===0)){n=[];f(m,function(p,o){if(p){if(typeof(p)=="string"){p=j.doc.getElementById(p)}n.push(l.call(k,p,o))}});return n}return l.call(k,m)},getAttribs:function(k){var j;k=this.get(k);if(!k){return[]}if(b){j=[];if(k.nodeName=="OBJECT"){return k.attributes}if(k.nodeName==="OPTION"&&this.getAttrib(k,"selected")){j.push({specified:1,nodeName:"selected"})}k.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(l){j.push({specified:1,nodeName:l})});return j}return k.attributes},isEmpty:function(o,p){var k=this,m,j,n,q,l;o=o.firstChild;if(o){q=new h.dom.TreeWalker(o);p=p||k.schema?k.schema.getNonEmptyElements():null;do{n=o.nodeType;if(n===1){if(o.getAttribute("data-mce-bogus")){continue}if(p&&p[o.nodeName.toLowerCase()]){return false}j=k.getAttribs(o);m=o.attributes.length;while(m--){l=o.attributes[m].nodeName;if(l==="name"||l==="data-mce-bookmark"){return false}}}if((n===3&&!i.test(o.nodeValue))){return false}}while(o=q.next())}return true},destroy:function(k){var j=this;if(j.events){j.events.destroy()}j.win=j.doc=j.root=j.events=null;if(!k){h.removeUnload(j.destroy)}},createRng:function(){var j=this.doc;return j.createRange?j.createRange():new h.dom.Range(this)},nodeIndex:function(n,o){var j=0,l,m,k;if(n){for(l=n.nodeType,n=n.previousSibling,m=n;n;n=n.previousSibling){k=n.nodeType;if(o&&k==3){if(k==l||!n.nodeValue.length){continue}}j++;l=k}}return j},split:function(n,m,q){var s=this,j=s.createRng(),o,l,p;function k(v){var t,r=v.childNodes,u=v.nodeType;if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){k(r[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){if(!s.isBlock(v.parentNode)||h.trim(v.nodeValue).length>0){return}}else{if(u==1){r=v.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(r[0],v)}if(r.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}s.remove(v)}return v}if(n&&m){j.setStart(n.parentNode,s.nodeIndex(n));j.setEnd(m.parentNode,s.nodeIndex(m));o=j.extractContents();j=s.createRng();j.setStart(m.parentNode,s.nodeIndex(m)+1);j.setEnd(n.parentNode,s.nodeIndex(n)+1);l=j.extractContents();p=n.parentNode;p.insertBefore(k(o),n);if(q){p.replaceChild(q,m)}else{p.insertBefore(m,n)}p.insertBefore(k(l),n);s.remove(n);return q||m}},bind:function(n,j,m,l){var k=this;if(!k.events){k.events=new h.dom.EventUtils()}return k.events.add(n,j,m,l||this)},unbind:function(m,j,l){var k=this;if(!k.events){k.events=new h.dom.EventUtils()}return k.events.remove(m,j,l)},_findSib:function(m,j,k){var l=this,n=j;if(m){if(e(n,"string")){n=function(o){return l.is(o,j)}}for(m=m[k];m;m=m[k]){if(n(m)){return m}}}return null},_isRes:function(j){return/^(top|left|bottom|right|width|height)/i.test(j)||/;\s*(top|left|bottom|right|width|height)/i.test(j)}});h.DOM=new h.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(Y,t){var ab=N[h],W=N[U],aa=N[P],V=N[z],Z=t.startContainer,ad=t.startOffset,X=t.endContainer,ac=t.endOffset;if(Y===0){return G(ab,W,Z,ad)}if(Y===1){return G(aa,V,Z,ad)}if(Y===2){return G(aa,V,X,ac)}if(Y===3){return G(ab,W,X,ac)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(d){var b=this,h=d.dom,c=true,f=false;function e(i,j){var k,t=0,q,n,m,l,o,r,p=-1,s;k=i.duplicate();k.collapse(j);s=k.parentElement();if(s.ownerDocument!==d.dom.doc){return}while(s.contentEditable==="false"){s=s.parentNode}if(!s.hasChildNodes()){return{node:s,inside:1}}m=s.children;q=m.length-1;while(t<=q){r=Math.floor((t+q)/2);l=m[r];k.moveToElementText(l);p=k.compareEndPoints(j?"StartToStart":"EndToEnd",i);if(p>0){q=r-1}else{if(p<0){t=r+1}else{return{node:l}}}}if(p<0){if(!l){k.moveToElementText(s);k.collapse(true);l=s;n=true}else{k.collapse(false)}k.setEndPoint(j?"EndToStart":"EndToEnd",i);if(k.compareEndPoints(j?"StartToStart":"StartToEnd",i)>0){k=i.duplicate();k.collapse(j);o=-1;while(s==k.parentElement()){if(k.move("character",-1)==0){break}o++}}o=o||k.text.replace("\r\n"," ").length}else{k.collapse(true);k.setEndPoint(j?"StartToStart":"StartToEnd",i);o=k.text.replace("\r\n"," ").length}return{node:l,position:p,offset:o,inside:n}}function g(){var i=d.getRng(),r=h.createRng(),l,k,p,q,m,j;l=i.item?i.item(0):i.parentElement();if(l.ownerDocument!=h.doc){return r}k=d.isCollapsed();if(i.item){r.setStart(l.parentNode,h.nodeIndex(l));r.setEnd(r.startContainer,r.startOffset+1);return r}function o(A){var u=e(i,A),s,y,z=0,x,v,t;s=u.node;y=u.offset;if(u.inside&&!s.hasChildNodes()){r[A?"setStart":"setEnd"](s,0);return}if(y===v){r[A?"setStartBefore":"setEndAfter"](s);return}if(u.position<0){x=u.inside?s.firstChild:s.nextSibling;if(!x){r[A?"setStartAfter":"setEndAfter"](s);return}if(!y){if(x.nodeType==3){r[A?"setStart":"setEnd"](x,0)}else{r[A?"setStartBefore":"setEndBefore"](x)}return}while(x){t=x.nodeValue;z+=t.length;if(z>=y){s=x;z-=y;z=t.length-z;break}x=x.nextSibling}}else{x=s.previousSibling;if(!x){return r[A?"setStartBefore":"setEndBefore"](s)}if(!y){if(s.nodeType==3){r[A?"setStart":"setEnd"](x,s.nodeValue.length)}else{r[A?"setStartAfter":"setEndAfter"](x)}return}while(x){z+=x.nodeValue.length;if(z>=y){s=x;z-=y;break}x=x.previousSibling}}r[A?"setStart":"setEnd"](s,z)}try{o(true);if(!k){o()}}catch(n){if(n.number==-2147024809){m=b.getBookmark(2);p=i.duplicate();p.collapse(true);l=p.parentElement();if(!k){p=i.duplicate();p.collapse(false);q=p.parentElement();q.innerHTML=q.innerHTML}l.innerHTML=l.innerHTML;b.moveToBookmark(m);i=d.getRng();o(true);if(!k){o()}}else{throw n}}return r}this.getBookmark=function(m){var j=d.getRng(),o,i,l={};function n(u){var u,t,p,s,r,q=[];t=u.parentNode;p=h.getRoot().parentNode;while(t!=p){s=t.children;r=s.length;while(r--){if(u===s[r]){q.push(r);break}}u=t;t=t.parentNode}return q}function k(q){var p;p=e(j,q);if(p){return{position:p.position,offset:p.offset,indexes:n(p.node),inside:p.inside}}}if(m===2){if(!j.item){l.start=k(true);if(!d.isCollapsed()){l.end=k()}}else{l.start={ctrl:true,indexes:n(j.item(0))}}}return l};this.moveToBookmark=function(k){var j,i=h.doc.body;function m(o){var r,q,n,p;r=h.getRoot();for(q=o.length-1;q>=0;q--){p=r.children;n=o[q];if(n<=p.length-1){r=p[n]}}return r}function l(r){var n=k[r?"start":"end"],q,p,o;if(n){q=n.position>0;p=i.createTextRange();p.moveToElementText(m(n.indexes));offset=n.offset;if(offset!==o){p.collapse(n.inside||q);p.moveStart("character",q?-offset:offset)}else{p.collapse(r)}j.setEndPoint(r?"StartToStart":"EndToStart",p);if(r){j.collapse(true)}}}if(k.start){if(k.start.ctrl){j=i.createControlRange();j.addElement(m(k.start.indexes));j.select()}else{j=i.createTextRange();l(true);l();j.select()}}};this.addRange=function(i){var n,l,k,p,s,q,r=d.dom.doc,m=r.body;function j(z){var u,y,t,x,v;t=h.create("a");u=z?k:s;y=z?p:q;x=n.duplicate();if(u==r||u==r.documentElement){u=m;y=0}if(u.nodeType==3){u.parentNode.insertBefore(t,u);x.moveToElementText(t);x.moveStart("character",y);h.remove(t);n.setEndPoint(z?"StartToStart":"EndToEnd",x)}else{v=u.childNodes;if(v.length){if(y>=v.length){h.insertAfter(t,v[v.length-1])}else{u.insertBefore(t,v[y])}x.moveToElementText(t)}else{t=r.createTextNode("\uFEFF");u.appendChild(t);x.moveToElementText(t.parentNode);x.collapse(c)}n.setEndPoint(z?"StartToStart":"EndToEnd",x);h.remove(t)}}k=i.startContainer;p=i.startOffset;s=i.endContainer;q=i.endOffset;n=m.createTextRange();if(k==s&&k.nodeType==1&&p==q-1){if(p==q-1){try{l=m.createControlRange();l.addElement(k.childNodes[p]);l.select();return}catch(o){}}}j(true);j();n.select()};this.getRangeAt=g}tinymce.dom.TridentSelection=a})();(function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,o=false,i=true;[0,0].sort(function(){i=false;return 0});var b=function(v,e,z,A){z=z||[];e=e||document;var C=e;if(e.nodeType!==1&&e.nodeType!==9){return[]}if(!v||typeof v!=="string"){return z}var x=[],s,E,H,r,u=true,t=b.isXML(e),B=v,D,G,F,y;do{p.exec("");s=p.exec(B);if(s){B=s[3];x.push(s[1]);if(s[2]){r=s[3];break}}}while(s);if(x.length>1&&k.exec(v)){if(x.length===2&&f.relative[x[0]]){E=h(x[0]+x[1],e)}else{E=f.relative[x[0]]?[e]:b(x.shift(),e);while(x.length){v=x.shift();if(f.relative[v]){v+=x.shift()}E=h(v,E)}}}else{if(!A&&x.length>1&&e.nodeType===9&&!t&&f.match.ID.test(x[0])&&!f.match.ID.test(x[x.length-1])){D=b.find(x.shift(),e,t);e=D.expr?b.filter(D.expr,D.set)[0]:D.set[0]}if(e){D=A?{expr:x.pop(),set:a(A)}:b.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&e.parentNode?e.parentNode:e,t);E=D.expr?b.filter(D.expr,D.set):D.set;if(x.length>0){H=a(E)}else{u=false}while(x.length){G=x.pop();F=G;if(!f.relative[G]){G=""}else{F=x.pop()}if(F==null){F=e}f.relative[G](H,F,t)}}else{H=x=[]}}if(!H){H=E}if(!H){b.error(G||v)}if(d.call(H)==="[object Array]"){if(!u){z.push.apply(z,H)}else{if(e&&e.nodeType===1){for(y=0;H[y]!=null;y++){if(H[y]&&(H[y]===true||H[y].nodeType===1&&b.contains(e,H[y]))){z.push(E[y])}}}else{for(y=0;H[y]!=null;y++){if(H[y]&&H[y].nodeType===1){z.push(E[y])}}}}}else{a(H,z)}if(r){b(r,C,z,A);b.uniqueSort(z)}return z};b.uniqueSort=function(r){if(c){o=i;r.sort(c);if(o){for(var e=1;e":function(x,r){var u=typeof r==="string",v,s=0,e=x.length;if(u&&!/\W/.test(r)){r=r.toLowerCase();for(;s=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){return r[1].toLowerCase()},CHILD:function(e){if(e[1]==="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]==="even"&&"2n"||e[2]==="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=j++;return e},ATTR:function(u,r,s,e,v,x){var t=u[1].replace(/\\/g,"");if(!x&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if((p.exec(u[3])||"").length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return(/h\d/i).test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toLowerCase()==="button"},input:function(e){return(/input|select|textarea|button/i).test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return re[3]-0},nth:function(s,r,e){return e[3]-0===r},eq:function(s,r,e){return e[3]-0===r}},filter:{PSEUDO:function(s,y,x,z){var e=y[1],r=f.filters[e];if(r){return r(s,x,y,z)}else{if(e==="contains"){return(s.textContent||s.innerText||b.getText([s])||"").indexOf(y[3])>=0}else{if(e==="not"){var t=y[3];for(var v=0,u=t.length;v=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName.toLowerCase()===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),x=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?x===r:u==="*="?x.indexOf(r)>=0:u==="~="?(" "+x+" ").indexOf(r)>=0:!r?x&&e!==false:u==="!="?x!==r:u==="^="?x.indexOf(r)===0:u==="$="?x.substr(x.length-r.length)===r:u==="|="?x===r||x.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var k=f.match.POS,g=function(r,e){return"\\"+(e-0+1)};for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+(/(?![^\[]*\])(?![^\(]*\))/.source));f.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[m].source.replace(/\\(\d+)/g,g))}var a=function(r,e){r=Array.prototype.slice.call(r,0);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes,0)[0].nodeType}catch(l){a=function(u,t){var r=t||[],s=0;if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var e=u.length;s";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(document.getElementById(s)){f.find.ID=function(u,v,x){if(typeof v.getElementById!=="undefined"&&!x){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r);e=r=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="

";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(x,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!b.isXML(v)){try{return a(v.querySelectorAll(x),t)}catch(y){}}return e(x,v,t,u)};for(var r in e){b[r]=e[r]}s=null})()}(function(){var e=document.createElement("div");e.innerHTML="
";if(!e.getElementsByClassName||e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}};e=null})();function n(r,x,v,A,y,z){for(var t=0,s=A.length;t0){u=e;break}}}e=e[r]}A[t]=u}}}b.contains=document.compareDocumentPosition?function(r,e){return !!(r.compareDocumentPosition(e)&16)}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};b.isXML=function(e){var r=(e?e.ownerDocument||e:0).documentElement;return r?r.nodeName!=="HTML":false};var h=function(e,y){var t=[],u="",v,s=y.nodeType?[y]:y;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var x=0,r=s.length;x=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j_';if(f.startContainer==k&&f.endContainer==k){k.body.innerHTML=g}else{f.deleteContents();if(k.body.childNodes.length==0){k.body.innerHTML=g}else{if(f.createContextualFragment){f.insertNode(f.createContextualFragment(g))}else{m=k.createDocumentFragment();l=k.createElement("div");m.appendChild(l);l.outerHTML=g;f.insertNode(m)}}}j=n.dom.get("__caret");f=k.createRange();f.setStartBefore(j);f.setEndBefore(j);n.setRng(f);n.dom.remove("__caret");try{n.setRng(f)}catch(h){}}else{if(f.item){k.execCommand("Delete",false,null);f=n.getRng()}f.pasteHTML(g)}if(!i.no_events){n.onSetContent.dispatch(n,i)}},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(r,s){var v=this,m=v.dom,g,j,i,n,h,o,p,l="\uFEFF",u;function f(x,y){var t=0;d(m.select(x),function(A,z){if(A==y){t=z}});return t}if(r==2){function k(){var x=v.getRng(true),t=m.getRoot(),y={};function z(C,H){var B=C[H?"startContainer":"endContainer"],G=C[H?"startOffset":"endOffset"],A=[],D,F,E=0;if(B.nodeType==3){if(s){for(D=B.previousSibling;D&&D.nodeType==3;D=D.previousSibling){G+=D.nodeValue.length}}A.push(G)}else{F=B.childNodes;if(G>=F.length&&F.length){E=1;G=Math.max(0,F.length-1)}A.push(v.dom.nodeIndex(F[G],s)+E)}for(;B&&B!=t;B=B.parentNode){A.push(v.dom.nodeIndex(B,s))}return A}y.start=z(x,true);if(!v.isCollapsed()){y.end=z(x)}return y}if(v.tridentSel){return v.tridentSel.getBookmark(r)}return k()}if(r){return{rng:v.getRng()}}g=v.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();u="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();try{g.collapse();g.pasteHTML(''+l+"");if(!n){j.collapse(false);g.moveToElementText(j.parentElement());if(g.compareEndPoints("StartToEnd",j)==0){j.move("character",-1)}j.pasteHTML(''+l+"")}}catch(q){return null}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=v.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{"data-mce-type":"bookmark",id:i+"_end",style:u},l))}g.collapse(true);g.insertNode(m.create("span",{"data-mce-type":"bookmark",id:i+"_start",style:u},l))}v.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){y=t[0];for(x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(t[v]>u.length-1){return}x=u[t[v]]}if(x.nodeType===3){y=Math.min(t[0],x.nodeValue.length)}if(x.nodeType===1){y=Math.min(t[0],x.childNodes.length)}if(z){f.setStart(x,y)}else{f.setEnd(x,y)}}return true}if(r.tridentSel){return r.tridentSel.moveToBookmark(n)}if(g(true)&&g()){r.setRng(f)}}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3&&!c.isOpera){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(l.isBlock(t)&&!t.innerHTML){t.innerHTML=!a?'
':" "}return t}k("start");k("end");if(j){f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;if(k){f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g)}return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var h=this,g=h.getRng(),i;if(g.item){i=g.item(0);g=h.win.document.body.createTextRange();g.moveToElementText(i)}g.collapse(!!f);h.setRng(g)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(l){var g=this,h,i,k,j=g.win.document;if(l&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():j.createRange())}}catch(f){}if(c.isIE&&i&&i.setStart&&j.selection.createRange().item){k=j.selection.createRange().item(0);i=j.createRange();i.setStartBefore(k);i.setEndAfter(k)}if(!i){i=j.createRange?j.createRange():j.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;try{h.removeAllRanges()}catch(f){}h.addRange(i);g.selectedRange=h.getRangeAt(0)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var h=this,g=h.getRng(),i=h.getSel(),l,k=g.startContainer,f=g.endContainer;if(!g){return h.dom.getRoot()}if(g.setStart){l=g.commonAncestorContainer;if(!g.collapsed){if(g.startContainer==g.endContainer){if(g.endOffset-g.startOffset<2){if(g.startContainer.hasChildNodes()){l=g.startContainer.childNodes[g.startOffset]}}}if(k.nodeType===3&&f.nodeType===3){function j(p,m){var o=p;while(p&&p.nodeType===3&&p.length===0){p=m?p.nextSibling:p.previousSibling}return p||o}if(k.length===g.startOffset){k=j(k.nextSibling,true)}else{k=k.parentNode}if(g.endOffset===0){f=j(f.previousSibling,false)}else{f=f.parentNode}if(k&&k===f){return k}}}if(l&&l.nodeType==3){return l.parentNode}return l}return g.item?g.item(0):g.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},normalize:function(){var g=this,f,i;if(c.isIE){return}function h(p){var k,o,n,m=g.dom,j=m.getRoot(),l;k=f[(p?"start":"end")+"Container"];o=f[(p?"start":"end")+"Offset"];if(k.nodeType===9){k=k.body;o=0}if(k===j){if(k.hasChildNodes()){k=k.childNodes[Math.min(!p&&o>0?o-1:o,k.childNodes.length-1)];o=0;l=k;n=new c.dom.TreeWalker(k,j);do{if(l.nodeType===3){o=p?0:l.nodeValue.length-1;k=l;break}if(l.nodeName==="BR"){o=m.nodeIndex(l);k=l.parentNode;break}}while(l=(p?n.next():n.prev()));i=true}}if(i){f["set"+(p?"Start":"End")](k,o)}}f=g.getRng();h(true);if(f.collapsed){h()}if(i){g.setRng(f)}},destroy:function(g){var f=this;f.win=null;if(!g){c.removeUnload(f.destroy)}},_fixIESelection:function(){var g=this.dom,m=g.doc,h=m.body,j,n,f;m.documentElement.unselectable=true;function i(o,r){var p=h.createTextRange();try{p.moveToPoint(o,r)}catch(q){p=null}return p}function l(p){var o;if(p.button){o=i(p.x,p.y);if(o){if(o.compareEndPoints("StartToStart",n)>0){o.setEndPoint("StartToStart",n)}else{o.setEndPoint("EndToEnd",n)}o.select()}}else{k()}}function k(){var o=m.selection.createRange();if(n&&!o.item&&o.compareEndPoints("StartToEnd",o)===0){n.select()}g.unbind(m,"mouseup",k);g.unbind(m,"mousemove",l);n=j=0}g.bind(m,["mousedown","contextmenu"],function(o){if(o.target.nodeName==="HTML"){if(j){k()}f=m.documentElement;if(f.scrollHeight>f.clientHeight){return}j=1;n=i(o.x,o.y);if(n){g.bind(m,"mouseup",k);g.bind(m,"mousemove",l);g.win.focus();n.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}e.remove_trailing_brs=true;i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/\s*mce(Item\w+|Selected)\s*/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(\/\/\s*|\]\]>|-->|\]\]-->)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// "}}else{if(o.length>0){n.firstChild.value=""}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(m.getInner?o.innerHTML:a.trim(i.getOuterHTML(o),m),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","previousSibling",e))}};(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,r){var h=d.startContainer,k=d.startOffset,s=d.endContainer,l=d.endOffset,i,f,n,g,q,p,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(t){r([t])});return}function o(v,u,t){var x=[];for(;v&&v!=t;v=v[u]){x.push(v)}return x}function m(u,t){do{if(u.parentNode==t){return u}u=u.parentNode}while(u)}function j(v,u,x){var t=x?"nextSibling":"previousSibling";for(g=v,q=g.parentNode;g&&g!=u;g=q){q=g.parentNode;p=o(g==v?g:g[t],t);if(p.length){if(!x){p.reverse()}r(p)}}}if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[k]}if(s.nodeType==1&&s.hasChildNodes()){s=s.childNodes[Math.min(l-1,s.childNodes.length-1)]}i=c.findCommonAncestor(h,s);if(h==s){return r([h])}for(g=h;g;g=g.parentNode){if(g==s){return j(h,i,true)}if(g==i){break}}for(g=s;g;g=g.parentNode){if(g==h){return j(s,i)}if(g==i){break}}f=m(h,i)||h;n=m(s,i)||s;j(h,f,true);p=o(f==h?f:f.nextSibling,"nextSibling",n==s?n.nextSibling:n);if(p.length){r(p)}j(s,n)}};a.dom.RangeUtils.compareRanges=function(c,b){if(c&&b){if(c.item||c.duplicate){if(c.item&&b.item&&c.item(0)===b.item(0)){return true}if(c.isEqual&&b.isEqual&&b.isEqual(c)){return true}}else{return c.startContainer==b.startContainer&&c.startOffset==b.startOffset}}return false}})(tinymce);(function(b){var a=b.dom.Event,c=b.each;b.create("tinymce.ui.KeyboardNavigation",{KeyboardNavigation:function(e,f){var p=this,m=e.root,l=e.items,n=e.enableUpDown,i=e.enableLeftRight||!e.enableUpDown,k=e.excludeFromTabOrder,j,h,o,d,g;f=f||b.DOM;j=function(q){g=q.target.id};h=function(q){f.setAttrib(q.target.id,"tabindex","-1")};d=function(q){var r=f.get(g);f.setAttrib(r,"tabindex","0");r.focus()};p.focus=function(){f.get(g).focus()};p.destroy=function(){c(l,function(q){f.unbind(f.get(q.id),"focus",j);f.unbind(f.get(q.id),"blur",h)});f.unbind(f.get(m),"focus",d);f.unbind(f.get(m),"keydown",o);l=f=m=p.focus=j=h=o=d=null;p.destroy=function(){}};p.moveFocus=function(u,r){var q=-1,t=p.controls,s;if(!g){return}c(l,function(x,v){if(x.id===g){q=v;return false}});q+=u;if(q<0){q=l.length-1}else{if(q>=l.length){q=0}}s=l[q];f.setAttrib(g,"tabindex","-1");f.setAttrib(s.id,"tabindex","0");f.get(s.id).focus();if(e.actOnFocus){e.onAction(s.id)}if(r){a.cancel(r)}};o=function(y){var u=37,t=39,x=38,z=40,q=27,s=14,r=13,v=32;switch(y.keyCode){case u:if(i){p.moveFocus(-1)}break;case t:if(i){p.moveFocus(1)}break;case x:if(n){p.moveFocus(-1)}break;case z:if(n){p.moveFocus(1)}break;case q:if(e.onCancel){e.onCancel();a.cancel(y)}break;case s:case r:case v:if(e.onAction){e.onAction(g);a.cancel(y)}break}};c(l,function(s,q){var r;if(!s.id){s.id=f.uniqueId("_mce_item_")}if(k){f.bind(s.id,"blur",h);r="-1"}else{r=(q===0?"0":"-1")}f.setAttrib(s.id,"tabindex",r);f.bind(f.get(s.id),"focus",j)});if(l[0]){g=l[0].id}f.setAttrib(m,"tabindex","-1");f.bind(f.get(m),"focus",d);f.bind(f.get(m),"keydown",o)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeightv){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.select("#menu_"+g.id)[0];h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='';if(e.image&&!(this.editor&&this.editor.forcedHighContrastMode)){d+=''+a.encode(e.title)+''+c}else{d+=''+(c?''+c+"":"")}d+='";d+="";return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(i,h,f){var g=this;g.parent(i,h,f);g.items=[];g.onChange=new a(g);g.onPostRender=new a(g);g.onAdd=new a(g);g.onRenderMenu=new d.util.Dispatcher(this);g.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle");c.setAttrib(g.id,"aria-valuenow",i.title)}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null;c.setAttrib(g.id,"aria-valuenow",g.settings.title)}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='';i+="";i+="";i+="";return i},showMenu:function(){var g=this,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(j){if(j.value===g.selectedValue){f.items[j.id].setSelected(1);g.oldID=j.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){c.removeClass(f.id,f.classPrefix+"Selected");if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(function(){g.hideMenu();g.focus()});f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id,"keydown",function(h){if(h.keyCode==32){f.showMenu(h);b.cancel(h)}});b.add(f.id,"focus",function(){if(!f._focused){f.keyDownHandler=b.add(f.id,"keydown",function(h){if(h.keyCode==40){f.showMenu();b.cancel(h)}});f.keyPressHandler=b.add(f.id,"keypress",function(i){var h;if(i.keyCode==13){h=f.selectedValue;f.selectedValue=null;b.cancel(i);f.settings.onselect(h)}})}f._focused=1});b.add(f.id,"blur",function(){b.remove(f.id,"keydown",f.keyDownHandler);b.remove(f.id,"keypress",f.keyPressHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f;this.setAriaProperty("disabled",f)},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox","aria-labelledby":f.id+"_aria"},g);g+=c.createHTML("span",{id:f.id+"_aria",style:"display: none"},f.settings.title);return g},postRender:function(){var g=this,h,i=true;g.rendered=true;function f(k){var j=g.items[k.target.selectedIndex-1];if(j&&(j=j.value)){g.onChange.dispatch(g,j);if(g.settings.onselect){g.settings.onselect(j)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(k){var j;b.remove(g.id,"change",h);i=false;j=b.add(g.id,"blur",function(){if(i){return}i=true;b.add(g.id,"change",f);b.remove(g.id,"blur",j)});if(k.keyCode==13||k.keyCode==32){f(k);return b.cancel(k)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+=""+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'');i+=""+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"";i+="";i=b.createHTML("table",{id:f.id,role:"presentation",tabindex:"0","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("span",{role:"button","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(i){i=i.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");g=c.add(g,"a",{role:"option",href:"javascript:;",style:{backgroundColor:"#"+i},title:p.editor.getLang("colors."+i,i),"data-mce-color":"#"+i});if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+i;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");new d.ui.KeyboardNavigation({root:p.id+"_menu",items:c.select("a",p.id+"_menu"),onCancel:function(){p.hideMenu();p.focus()}});a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return a.cancel(i)});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('
');i.push("");i.push('");j(e,function(h){i.push(h.renderHTML())});i.push("");i.push("
");return i.join("")},focus:function(){this.keyNav.focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,""))}}if(c.stdMode){f+=''+k.renderHTML()+""}else{f+=""+k.renderHTML()+""}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,""))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,""));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},""+f+"")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){if(this.lookup[d]){return this.lookup[d].instance}else{return undefined}},dependencies:function(e){var d;if(this.lookup[e]){d=this.lookup[e].dependencies}return d||[]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(f,e,d){this.items.push(e);this.lookup[f]={instance:e,dependencies:d};this.onAdd.dispatch(this,f,e);return e},createUrl:function(d,e){if(typeof e==="object"){return e}else{return{prefix:d.prefix,resource:e,suffix:d.suffix}}},addComponents:function(f,d){var e=this.urls[f];b.each(d,function(g){b.ScriptLoader.add(e+"/"+g)})},load:function(j,f,d,h){var g=this,e=f;function i(){var k=g.dependencies(j);b.each(k,function(m){var l=g.createUrl(f,m);g.load(l.resource,l,undefined,undefined)});if(d){if(h){d.call(h)}else{d.call(b.ScriptLoader)}}}if(g.urls[j]){return}if(typeof f==="object"){e=f.prefix+f.resource+f.suffix}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}g.urls[j]=e.substring(0,e.lastIndexOf("/"));if(g.lookup[j]){i()}else{b.ScriptLoader.add(e,i,h)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l':"",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:true,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr",validate:true,entity_encoding:"named",url_converter:p.convertURL,url_converter_scope:p,ie7_compat:true},q);p.documentBaseURI=new m.util.URI(q.document_base_url||m.documentBaseURL,{base_uri:tinyMCE.baseURI});p.baseURI=m.baseURI;p.contentCSS=[];p.execCallback("setup",p)},render:function(r){var u=this,v=u.settings,x=u.id,p=m.ScriptLoader;if(!j.domLoaded){j.add(document,"init",function(){u.render()});return}tinyMCE.settings=v;if(!u.getElement()){return}if(m.isIDevice&&!m.isIOS5){return}if(!/TEXTAREA|INPUT/i.test(u.getElement().nodeName)&&v.hidden_input&&n.getParent(x,"form")){n.insertAfter(n.create("input",{type:"hidden",name:x}),x)}if(m.WindowManager){u.windowManager=new m.WindowManager(u)}if(v.encoding=="xml"){u.onGetContent.add(function(s,t){if(t.save){t.content=n.encode(t.content)}})}if(v.add_form_submit_trigger){u.onSubmit.addToTop(function(){if(u.initialized){u.save();u.isNotDirty=1}})}if(v.add_unload_trigger){u._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(u.initialized&&!u.destroyed&&!u.isHidden()){u.save({format:"raw",no_events:true})}})}m.addUnload(u.destroy,u);if(v.submit_patch){u.onBeforeRenderUI.add(function(){var s=u.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){u.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){m.triggerSave();u.isNotDirty=1;return u.formElement._mceOldSubmit(u.formElement)}}s=null})}function q(){if(v.language&&v.language_load!==false){p.add(m.baseURL+"/langs/"+v.language+".js")}if(v.theme&&v.theme.charAt(0)!="-"&&!h.urls[v.theme]){h.load(v.theme,"themes/"+v.theme+"/editor_template"+m.suffix+".js")}i(g(v.plugins),function(t){if(t&&!c.urls[t]){if(t.charAt(0)=="-"){t=t.substr(1,t.length);var s=c.dependencies(t);i(s,function(z){var y={prefix:"plugins/",resource:z,suffix:"/editor_plugin"+m.suffix+".js"};var z=c.createUrl(y,z);c.load(z.resource,z)})}else{if(t=="safari"){return}c.load(t,{prefix:"plugins/",resource:t,suffix:"/editor_plugin"+m.suffix+".js"})}}});p.loadQueue(function(){if(!u.removed){u.init()}})}q()},init:function(){var r,H=this,I=H.settings,E,A,D=H.getElement(),q,p,F,y,C,G,z,v=[];m.add(H);I.aria_label=I.aria_label||n.getAttrib(D,"aria-label",H.getLang("aria.rich_text_area"));if(I.theme){I.theme=I.theme.replace(/-/,"");q=h.get(I.theme);H.theme=new q();if(H.theme.init&&I.init_theme){H.theme.init(H,h.urls[I.theme]||m.documentBaseURL.replace(/\/$/,""))}}function B(J){var K=c.get(J),t=c.urls[J]||m.documentBaseURL.replace(/\/$/,""),s;if(K&&m.inArray(v,J)===-1){i(c.dependencies(J),function(u){B(u)});s=new K(H,t);H.plugins[J]=s;if(s.init){s.init(H,t);v.push(J)}}}i(g(I.plugins.replace(/\-/g,"")),B);if(I.popup_css!==false){if(I.popup_css){I.popup_css=H.documentBaseURI.toAbsolute(I.popup_css)}else{I.popup_css=H.baseURI.toAbsolute("themes/"+I.theme+"/skins/"+I.skin+"/dialog.css")}}if(I.popup_css_add){I.popup_css+=","+H.documentBaseURI.toAbsolute(I.popup_css_add)}H.controlManager=new m.ControlManager(H);if(I.custom_undo_redo){H.onBeforeExecCommand.add(function(t,J,u,K,s){if(J!="Undo"&&J!="Redo"&&J!="mceRepaint"&&(!s||!s.skip_undo)){H.undoManager.beforeChange()}});H.onExecCommand.add(function(t,J,u,K,s){if(J!="Undo"&&J!="Redo"&&J!="mceRepaint"&&(!s||!s.skip_undo)){H.undoManager.add()}})}H.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){H.nodeChanged()}});if(a){function x(s,t){if(!t||!t.initial){H.execCommand("mceRepaint")}}H.onUndo.add(x);H.onRedo.add(x);H.onSetContent.add(x)}H.onBeforeRenderUI.dispatch(H,H.controlManager);if(I.render_ui){E=I.width||D.style.width||D.offsetWidth;A=I.height||D.style.height||D.offsetHeight;H.orgDisplay=D.style.display;G=/^[0-9\.]+(|px)$/i;if(G.test(""+E)){E=Math.max(parseInt(E)+(q.deltaWidth||0),100)}if(G.test(""+A)){A=Math.max(parseInt(A)+(q.deltaHeight||0),100)}q=H.theme.renderUI({targetNode:D,width:E,height:A,deltaWidth:I.delta_width,deltaHeight:I.delta_height});H.editorContainer=q.editorContainer}if(document.domain&&location.hostname!=document.domain){m.relaxedDomain=document.domain}n.setStyles(q.sizeContainer||q.editorContainer,{width:E,height:A});if(I.content_css){m.each(g(I.content_css),function(s){H.contentCSS.push(H.documentBaseURI.toAbsolute(s))})}A=(q.iframeHeight||A)+(typeof(A)=="number"?(q.deltaHeight||0):"");if(A<100){A=100}H.iframeHTML=I.doctype+'';if(I.document_base_url!=m.documentBaseURL){H.iframeHTML+=''}if(I.ie7_compat){H.iframeHTML+=''}else{H.iframeHTML+=''}H.iframeHTML+='';if(!a||!/Firefox\/2/.test(navigator.userAgent)){for(z=0;z'}H.contentCSS=[]}y=I.body_id||"tinymce";if(y.indexOf("=")!=-1){y=H.getParam("body_id","","hash");y=y[H.id]||y}C=I.body_class||"";if(C.indexOf("=")!=-1){C=H.getParam("body_class","","hash");C=C[H.id]||""}H.iframeHTML+='';if(m.relaxedDomain&&(b||(m.isOpera&&parseFloat(opera.version())<11))){F='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+H.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}r=n.add(q.iframeContainer,"iframe",{id:H.id+"_ifr",src:F||'javascript:""',frameBorder:"0",allowTransparency:"true",title:I.aria_label,style:{width:"100%",height:A}});H.contentAreaContainer=q.iframeContainer;n.get(q.editorContainer).style.display=H.orgDisplay;n.get(H.id).style.display="none";n.setAttrib(H.id,"aria-hidden",true);if(!m.relaxedDomain||!F){H.setupIframe()}D=r=q=null},setupIframe:function(x){var q=this,v=q.settings,y=n.get(q.id),z=q.getDoc(),u,p;if((!b||!m.relaxedDomain)&&!x){if(a&&!v.readonly){q.getWin().onload=function(){window.setTimeout(function(){var s=q.getBody(),t;s.innerHTML="
";if(s.contentEditable!==t){s.contentEditable=false;s.contentEditable=true;q.onMouseDown.add(function(A,B){if(B.target.nodeName==="HTML"){s.contentEditable=false;s.contentEditable=true;z.designMode="on";window.setTimeout(function(){z.designMode="off";q.getBody().focus()},1)}})}else{z.designMode="on"}q.setupIframe(true)},1)}}z.open();z.write(q.iframeHTML);z.close();if(m.relaxedDomain){z.domain=m.relaxedDomain}if(a&&!v.readonly){return}}p=q.getBody();p.disabled=true;if(!a&&!v.readonly){p.contentEditable=true}p.disabled=false;q.schema=new m.html.Schema(v);q.dom=new m.dom.DOMUtils(q.getDoc(),{keep_values:true,url_converter:q.convertURL,url_converter_scope:q,hex_colors:v.force_hex_style_colors,class_filter:v.class_filter,update_styles:1,fix_ie_paragraphs:1,schema:q.schema});q.parser=new m.html.DomParser(v,q.schema);if(!q.settings.allow_html_in_named_anchor){q.parser.addAttributeFilter("name",function(s,t){var B=s.length,D,A,C,E;while(B--){E=s[B];if(E.name==="a"&&E.firstChild){C=E.parent;D=E.lastChild;do{A=D.prev;C.insert(D,E);D=A}while(D)}}})}q.parser.addAttributeFilter("src,href,style",function(s,t){var A=s.length,C,E=q.dom,D,B;while(A--){C=s[A];D=C.attr(t);B="data-mce-"+t;if(!C.attributes.map[B]){if(t==="style"){C.attr(B,E.serializeStyle(E.parseStyle(D),C.name))}else{C.attr(B,q.convertURL(D,t,C.name))}}}});q.parser.addNodeFilter("script",function(s,t){var A=s.length;while(A--){s[A].attr("type","mce-text/javascript")}});q.parser.addNodeFilter("#cdata",function(s,t){var A=s.length,B;while(A--){B=s[A];B.type=8;B.name="#comment";B.value="[CDATA["+B.value+"]]"}});q.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t,A){var B=t.length,C,s=q.schema.getNonEmptyElements();while(B--){C=t[B];if(C.isEmpty(s)){C.empty().append(new m.html.Node("br",1)).shortEnded=true}}});q.serializer=new m.dom.Serializer(v,q.dom,q.schema);q.selection=new m.dom.Selection(q.dom,q.getWin(),q.serializer);q.formatter=new m.Formatter(this);q.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img,table",collapsed:false,styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"}},{selector:"img",collapsed:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"}}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){q.formatter.register(s,{block:s,remove:"all"})});q.formatter.register(q.settings.formats);q.undoManager=new m.UndoManager(q);q.undoManager.onAdd.add(function(t,s){if(t.hasUndo()){return q.onChange.dispatch(q,s,t)}});q.undoManager.onUndo.add(function(t,s){return q.onUndo.dispatch(q,s,t)});q.undoManager.onRedo.add(function(t,s){return q.onRedo.dispatch(q,s,t)});q.forceBlocks=new m.ForceBlocks(q,{forced_root_block:v.forced_root_block});q.editorCommands=new m.EditorCommands(q);q.serializer.onPreProcess.add(function(s,t){return q.onPreProcess.dispatch(q,t,s)});q.serializer.onPostProcess.add(function(s,t){return q.onPostProcess.dispatch(q,t,s)});q.onPreInit.dispatch(q);if(!v.gecko_spellcheck){q.getBody().spellcheck=0}if(!v.readonly){q._addEvents()}q.controlManager.onPostRender.dispatch(q,q.controlManager);q.onPostRender.dispatch(q);if(v.directionality){q.getBody().dir=v.directionality}if(v.nowrap){q.getBody().style.whiteSpace="nowrap"}if(v.handle_node_change_callback){q.onNodeChange.add(function(t,s,A){q.execCallback("handle_node_change_callback",q.id,A,-1,-1,true,q.selection.isCollapsed())})}if(v.save_callback){q.onSaveContent.add(function(s,A){var t=q.execCallback("save_callback",q.id,A.content,q.getBody());if(t){A.content=t}})}if(v.onchange_callback){q.onChange.add(function(t,s){q.execCallback("onchange_callback",q,s)})}if(v.protect){q.onBeforeSetContent.add(function(s,t){if(v.protect){i(v.protect,function(A){t.content=t.content.replace(A,function(B){return""})})}})}if(v.convert_newlines_to_brs){q.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"
")}})}if(v.preformatted){q.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='
'+t.content+"
"}})}if(v.verify_css_classes){q.serializer.attribValueFilter=function(C,A){var B,t;if(C=="class"){if(!q.classesRE){t=q.dom.getClasses();if(t.length>0){B="";i(t,function(s){B+=(B?"|":"")+s["class"]});q.classesRE=new RegExp("("+B+")","gi")}}return !q.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(A)||q.classesRE.test(A)?A:""}return A}}if(v.cleanup_callback){q.onBeforeSetContent.add(function(s,t){t.content=q.execCallback("cleanup_callback","insert_to_editor",t.content,t)});q.onPreProcess.add(function(s,t){if(t.set){q.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){q.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});q.onPostProcess.add(function(s,t){if(t.set){t.content=q.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=q.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(v.save_callback){q.onGetContent.add(function(s,t){if(t.save){t.content=q.execCallback("save_callback",q.id,t.content,q.getBody())}})}if(v.handle_event_callback){q.onEvent.add(function(s,t,A){if(q.execCallback("handle_event_callback",t,s,A)===false){j.cancel(t)}})}q.onSetContent.add(function(){q.addVisual(q.getBody())});if(v.padd_empty_editor){q.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
[\r\n]*)$/,"")})}if(a){function r(s,t){i(s.dom.select("a"),function(B){var A=B.parentNode;if(s.dom.isBlock(A)&&A.lastChild===B){s.dom.add(A,"br",{"data-mce-bogus":1})}})}q.onExecCommand.add(function(s,t){if(t==="CreateLink"){r(s)}});q.onSetContent.add(q.selection.onSetContent.add(r))}q.load({initial:true,format:"html"});q.startContent=q.getContent({format:"raw"});q.undoManager.add();q.initialized=true;q.onInit.dispatch(q);q.execCallback("setupcontent_callback",q.id,q.getBody(),q.getDoc());q.execCallback("init_instance_callback",q);q.focus(true);q.nodeChanged({initial:1});i(q.contentCSS,function(s){q.dom.loadCSS(s)});if(v.auto_focus){setTimeout(function(){var s=m.get(v.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getBody().focus();s.getWin().focus()},100)}y=null},focus:function(u){var y,q=this,s=q.selection,x=q.settings.content_editable,r,p,v=q.getDoc();if(!u){r=s.getRng();if(r.item){p=r.item(0)}s.normalize();if(!x){q.getWin().focus()}if(m.isGecko){q.getBody().focus()}if(p&&p.ownerDocument==v){r=v.body.createControlRange();r.addElement(p);r.select()}}if(m.activeEditor!=q){if((y=m.activeEditor)!=null){y.onDeactivate.dispatch(y,q)}q.onActivate.dispatch(q,y)}m._setActive(q)},execCallback:function(u){var p=this,r=p.settings[u],q;if(!r){return}if(p.callbackLookup&&(q=p.callbackLookup[u])){r=q.func;q=q.scope}if(d(r,"string")){q=r.replace(/\.\w+$/,"");q=q?m.resolve(q):0;r=m.resolve(r);p.callbackLookup=p.callbackLookup||{};p.callbackLookup[u]={func:r,scope:q}}return r.apply(q||p,Array.prototype.slice.call(arguments,1))},translate:function(p){var r=this.settings.language||"en",q=m.i18n;if(!p){return""}return q[r+"."+p]||p.replace(/{\#([^}]+)\}/g,function(t,s){return q[r+"."+s]||"{#"+s+"}"})},getLang:function(q,p){return m.i18n[(this.settings.language||"en")+"."+q]||(d(p)?p:"{#"+q+"}")},getParam:function(u,r,p){var s=m.trim,q=d(this.settings[u])?this.settings[u]:r,t;if(p==="hash"){t={};if(d(q,"string")){i(q.indexOf("=")>0?q.split(/[;,](?![^=;,]*(?:[;,]|$))/):q.split(","),function(x){x=x.split("=");if(x.length>1){t[s(x[0])]=s(x[1])}else{t[s(x[0])]=s(x)}})}else{t=q}return t}return q},nodeChanged:function(r){var p=this,q=p.selection,u=q.getStart()||p.getBody();if(p.initialized){r=r||{};u=b&&u.ownerDocument!=p.getDoc()?p.getBody():u;r.parents=[];p.dom.getParent(u,function(s){if(s.nodeName=="BODY"){return true}r.parents.push(s)});p.onNodeChange.dispatch(p,r?r.controlManager||p.controlManager:p.controlManager,u,q.isCollapsed(),r)}},addButton:function(r,q){var p=this;p.buttons=p.buttons||{};p.buttons[r]=q},addCommand:function(p,r,q){this.execCommands[p]={func:r,scope:q||this}},addQueryStateHandler:function(p,r,q){this.queryStateCommands[p]={func:r,scope:q||this}},addQueryValueHandler:function(p,r,q){this.queryValueCommands[p]={func:r,scope:q||this}},addShortcut:function(r,u,p,s){var q=this,v;if(!q.settings.custom_shortcuts){return false}q.shortcuts=q.shortcuts||{};if(d(p,"string")){v=p;p=function(){q.execCommand(v,false,null)}}if(d(p,"object")){v=p;p=function(){q.execCommand(v[0],v[1],v[2])}}i(g(r),function(t){var x={func:p,scope:s||this,desc:u,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});q.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,v,z,p){var r=this,u=0,y,q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!p||!p.skip_focus)){r.focus()}y={};r.onBeforeExecCommand.dispatch(r,x,v,z,y);if(y.terminate){return false}if(r.execCallback("execcommand_callback",r.id,r.selection.getNode(),x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(y=r.execCommands[x]){q=y.func.call(y.scope,v,z);if(q!==true){r.onExecCommand.dispatch(r,x,v,z,p);return q}}i(r.plugins,function(s){if(s.execCommand&&s.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);u=1;return false}});if(u){return true}if(r.theme&&r.theme.execCommand&&r.theme.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(r.editorCommands.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}r.getDoc().execCommand(x,v,z);r.onExecCommand.dispatch(r,x,v,z,p)},queryCommandState:function(u){var q=this,v,r;if(q._isHidden()){return}if(v=q.queryStateCommands[u]){r=v.func.call(v.scope);if(r!==true){return r}}v=q.editorCommands.queryCommandState(u);if(v!==-1){return v}try{return this.getDoc().queryCommandState(u)}catch(p){}},queryCommandValue:function(v){var q=this,u,r;if(q._isHidden()){return}if(u=q.queryValueCommands[v]){r=u.func.call(u.scope);if(r!==true){return r}}u=q.editorCommands.queryCommandValue(v);if(d(u)){return u}try{return this.getDoc().queryCommandValue(v)}catch(p){}},show:function(){var p=this;n.show(p.getContainer());n.hide(p.id);p.load()},hide:function(){var p=this,q=p.getDoc();if(b&&q){q.execCommand("SelectAll")}p.save();n.hide(p.getContainer());n.setStyle(p.id,"display",p.orgDisplay)},isHidden:function(){return !n.isHidden(this.id)},setProgressState:function(p,q,r){this.onSetProgressState.dispatch(this,p,q,r);return p},load:function(s){var p=this,r=p.getElement(),q;if(r){s=s||{};s.load=true;q=p.setContent(d(r.value)?r.value:r.innerHTML,s);s.element=r;if(!s.no_events){p.onLoadContent.dispatch(p,s)}s.element=r=null;return q}},save:function(u){var p=this,s=p.getElement(),q,r;if(!s||!p.initialized){return}u=u||{};u.save=true;if(!u.no_events){p.undoManager.typing=false;p.undoManager.add()}u.element=s;q=u.content=p.getContent(u);if(!u.no_events){p.onSaveContent.dispatch(p,u)}q=u.content;if(!/TEXTAREA|INPUT/i.test(s.nodeName)){s.innerHTML=q;if(r=n.getParent(p.id,"form")){i(r.elements,function(t){if(t.name==p.id){t.value=q;return false}})}}else{s.value=q}u.element=s=null;return q},setContent:function(u,s){var r=this,q,p=r.getBody(),t;s=s||{};s.format=s.format||"html";s.set=true;s.content=u;if(!s.no_events){r.onBeforeSetContent.dispatch(r,s)}u=s.content;if(!m.isIE&&(u.length===0||/^\s+$/.test(u))){t=r.settings.forced_root_block;if(t){u="<"+t+'>
"}else{u='
'}p.innerHTML=u;r.selection.select(p,true);r.selection.collapse(true);return}if(s.format!=="raw"){u=new m.html.Serializer({},r.schema).serialize(r.parser.parse(u))}s.content=m.trim(u);r.dom.setHTML(p,s.content);if(!s.no_events){r.onSetContent.dispatch(r,s)}r.selection.normalize();return s.content},getContent:function(q){var p=this,r;q=q||{};q.format=q.format||"html";q.get=true;if(!q.no_events){p.onBeforeGetContent.dispatch(p,q)}if(q.format=="raw"){r=p.getBody().innerHTML}else{r=p.serializer.serialize(p.getBody(),q)}q.content=m.trim(r);if(!q.no_events){p.onGetContent.dispatch(p,q)}return q.content},isDirty:function(){var p=this;return m.trim(p.startContent)!=m.trim(p.getContent({format:"raw",no_events:1}))&&!p.isNotDirty},getContainer:function(){var p=this;if(!p.container){p.container=n.get(p.editorContainer||p.id+"_parent")}return p.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return n.get(this.settings.content_element||this.id)},getWin:function(){var p=this,q;if(!p.contentWindow){q=n.get(p.id+"_ifr");if(q){p.contentWindow=q.contentWindow}}return p.contentWindow},getDoc:function(){var q=this,p;if(!q.contentDocument){p=q.getWin();if(p){q.contentDocument=p.document}}return q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(p,x,v){var q=this,r=q.settings;if(r.urlconverter_callback){return q.execCallback("urlconverter_callback",p,v,true,x)}if(!r.convert_urls||(v&&v.nodeName=="LINK")||p.indexOf("file:")===0){return p}if(r.relative_urls){return q.documentBaseURI.toRelative(p)}p=q.documentBaseURI.toAbsolute(p,r.remove_script_host);return p},addVisual:function(r){var p=this,q=p.settings;r=r||p.getBody();if(!d(p.hasVisual)){p.hasVisual=q.visual}i(p.dom.select("table,a",r),function(t){var s;switch(t.nodeName){case"TABLE":s=p.dom.getAttrib(t,"border");if(!s||s=="0"){if(p.hasVisual){p.dom.addClass(t,q.visual_table_class)}else{p.dom.removeClass(t,q.visual_table_class)}}return;case"A":s=p.dom.getAttrib(t,"name");if(s){if(p.hasVisual){p.dom.addClass(t,"mceItemAnchor")}else{p.dom.removeClass(t,"mceItemAnchor")}}return}});p.onVisualAid.dispatch(p,r,p.hasVisual)},remove:function(){var p=this,q=p.getContainer();p.removed=1;p.hide();p.execCallback("remove_instance_callback",p);p.onRemove.dispatch(p);p.onExecCommand.listeners=[];m.remove(p);n.remove(q)},destroy:function(q){var p=this;if(p.destroyed){return}if(!q){m.removeUnload(p.destroy);tinyMCE.onBeforeUnload.remove(p._beforeUnload);if(p.theme&&p.theme.destroy){p.theme.destroy()}p.controlManager.destroy();p.selection.destroy();p.dom.destroy();if(!p.settings.content_editable){j.clear(p.getWin());j.clear(p.getDoc())}j.clear(p.getBody());j.clear(p.formElement)}if(p.formElement){p.formElement.submit=p.formElement._mceOldSubmit;p.formElement._mceOldSubmit=null}p.contentAreaContainer=p.formElement=p.container=p.settings.content_element=p.bodyElement=p.contentDocument=p.contentWindow=null;if(p.selection){p.selection=p.selection.win=p.selection.dom=p.selection.dom.doc=null}p.destroyed=1},_addEvents:function(){var B=this,r,C=B.settings,q=B.dom,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function p(t,D){var s=t.type;if(B.removed){return}if(B.onEvent.dispatch(B,t,D)!==false){B[x[t.fakeType||t.type]].dispatch(B,t,D)}}i(x,function(t,s){switch(s){case"contextmenu":q.bind(B.getDoc(),s,p);break;case"paste":q.bind(B.getBody(),s,function(D){p(D)});break;case"submit":case"reset":q.bind(B.getElement().form||n.getParent(B.id,"form"),s,p);break;default:q.bind(C.content_editable?B.getBody():B.getDoc(),s,p)}});q.bind(C.content_editable?B.getBody():(a?B.getDoc():B.getWin()),"focus",function(s){B.focus(true)});if(m.isGecko){q.bind(B.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("data-mce-src"))){t.src=B.documentBaseURI.toAbsolute(s)}})}if(a){function u(){var E=this,G=E.getDoc(),F=E.settings;if(a&&!F.readonly){if(E._isHidden()){try{if(!F.content_editable){G.body.contentEditable=false;G.body.contentEditable=true}}catch(D){}}try{G.execCommand("styleWithCSS",0,false)}catch(D){if(!E._isHidden()){try{G.execCommand("useCSS",0,true)}catch(D){}}}if(!F.table_inline_editing){try{G.execCommand("enableInlineTableEditing",false,false)}catch(D){}}if(!F.object_resizing){try{G.execCommand("enableObjectResizing",false,false)}catch(D){}}}}B.onBeforeExecCommand.add(u);B.onMouseDown.add(u)}B.onClick.add(function(s,t){t=t.target;if(m.isWebKit&&t.nodeName=="IMG"){B.selection.getSel().setBaseAndExtent(t,0,t,1)}if(t.nodeName=="A"&&q.hasClass(t,"mceItemAnchor")){B.selection.select(t)}B.nodeChanged()});B.onMouseUp.add(B.nodeChanged);B.onKeyUp.add(function(s,t){var D=t.keyCode;if((D>=33&&D<=36)||(D>=37&&D<=40)||D==13||D==45||D==46||D==8||(m.isMac&&(D==91||D==93))||t.ctrlKey){B.nodeChanged()}});B.onReset.add(function(){B.setContent(B.startContent,{format:"raw"})});if(C.custom_shortcuts){if(C.custom_undo_redo_keyboard_shortcuts){B.addShortcut("ctrl+z",B.getLang("undo_desc"),"Undo");B.addShortcut("ctrl+y",B.getLang("redo_desc"),"Redo")}B.addShortcut("ctrl+b",B.getLang("bold_desc"),"Bold");B.addShortcut("ctrl+i",B.getLang("italic_desc"),"Italic");B.addShortcut("ctrl+u",B.getLang("underline_desc"),"Underline");for(r=1;r<=6;r++){B.addShortcut("ctrl+"+r,"",["FormatBlock",false,"h"+r])}B.addShortcut("ctrl+7","",["FormatBlock",false,"

"]);B.addShortcut("ctrl+8","",["FormatBlock",false,"

"]);B.addShortcut("ctrl+9","",["FormatBlock",false,"
"]);function v(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(B.shortcuts,function(D){if(m.isMac&&D.ctrl!=t.metaKey){return}else{if(!m.isMac&&D.ctrl!=t.ctrlKey){return}}if(D.alt!=t.altKey){return}if(D.shift!=t.shiftKey){return}if(t.keyCode==D.keyCode||(t.charCode&&t.charCode==D.charCode)){s=D;return false}});return s}B.onKeyUp.add(function(s,t){var D=v(t);if(D){return j.cancel(t)}});B.onKeyPress.add(function(s,t){var D=v(t);if(D){return j.cancel(t)}});B.onKeyDown.add(function(s,t){var D=v(t);if(D){D.func.call(D.scope);return j.cancel(t)}})}if(m.isIE){q.bind(B.getDoc(),"controlselect",function(D){var t=B.resizeInfo,s;D=D.target;if(D.nodeName!=="IMG"){return}if(t){q.unbind(t.node,t.ev,t.cb)}if(!q.hasClass(D,"mceItemNoResize")){ev="resizeend";s=q.bind(D,ev,function(F){var E;F=F.target;if(E=q.getStyle(F,"width")){q.setAttrib(F,"width",E.replace(/[^0-9%]+/g,""));q.setStyle(F,"width","")}if(E=q.getStyle(F,"height")){q.setAttrib(F,"height",E.replace(/[^0-9%]+/g,""));q.setStyle(F,"height","")}})}else{ev="resizestart";s=q.bind(D,"resizestart",j.cancel,j)}t=B.resizeInfo={node:D,ev:ev,cb:s}})}if(m.isOpera){B.onClick.add(function(s,t){j.prevent(t)})}if(C.custom_undo_redo){function y(){B.undoManager.typing=false;B.undoManager.add()}q.bind(B.getDoc(),"focusout",function(s){if(!B.removed&&B.undoManager.typing){y()}});B.dom.bind(B.dom.getRoot(),"dragend",function(s){y()});B.onKeyUp.add(function(s,D){var t=D.keyCode;if((t>=33&&t<=36)||(t>=37&&t<=40)||t==13||t==45||D.ctrlKey){y()}});B.onKeyDown.add(function(s,E){var D=E.keyCode,t;if(D==8){t=B.getDoc().selection;if(t&&t.createRange&&t.createRange().item){B.undoManager.beforeChange();s.dom.remove(t.createRange().item(0));y();return j.cancel(E)}}if((D>=33&&D<=36)||(D>=37&&D<=40)||D==13||D==45){if(m.isIE&&D==13){B.undoManager.beforeChange()}if(B.undoManager.typing){y()}return}if((D<16||D>20)&&D!=224&&D!=91&&!B.undoManager.typing){B.undoManager.beforeChange();B.undoManager.typing=true;B.undoManager.add()}});B.onMouseDown.add(function(){if(B.undoManager.typing){y()}})}if(m.isWebKit){q.bind(B.getDoc(),"selectionchange",function(){if(B.selectionTimer){window.clearTimeout(B.selectionTimer);B.selectionTimer=0}B.selectionTimer=window.setTimeout(function(){B.nodeChanged()},50)})}if(m.isGecko){function A(){var s=B.dom.getAttribs(B.selection.getStart().cloneNode(false));return function(){var t=B.selection.getStart();B.dom.removeAllAttribs(t);i(s,function(D){t.setAttributeNode(D.cloneNode(true))})}}function z(){var t=B.selection;return !t.isCollapsed()&&t.getStart()!=t.getEnd()}B.onKeyPress.add(function(s,D){var t;if((D.keyCode==8||D.keyCode==46)&&z()){t=A();B.getDoc().execCommand("delete",false,null);t();return j.cancel(D)}});B.dom.bind(B.getDoc(),"cut",function(t){var s;if(z()){s=A();B.onKeyUp.addToTop(j.cancel,j);setTimeout(function(){s();B.onKeyUp.remove(j.cancel,j)},0)}})}},_isHidden:function(){var p;if(!a){return 0}p=this.selection.getSel();return(!p||!p.rangeCount||p.rangeCount==0)}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var l=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,o;function q(y,x,v){var u;y=y.toLowerCase();if(u=j.exec[y]){u(y,x,v);return a}return b}function m(v){var u;v=v.toLowerCase();if(u=j.state[v]){return u(v)}return -1}function h(v){var u;v=v.toLowerCase();if(u=j.value[v]){return u(v)}return b}function t(u,v){v=v||"exec";d(u,function(y,x){d(x.toLowerCase().split(","),function(z){j[v][z]=y})})}c.extend(this,{execCommand:q,queryCommandState:m,queryCommandValue:h,addCommands:t});function f(x,v,u){if(v===e){v=b}if(u===e){u=null}return n.getDoc().execCommand(x,v,u)}function s(u){return n.formatter.match(u)}function r(u,v){n.formatter.toggle(u,v?{value:v}:e)}function i(u){o=p.getBookmark(u)}function g(){p.moveToBookmark(o)}t({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(y){var x=n.getDoc(),u;try{f(y)}catch(v){u=a}if(u||!x.queryCommandSupported(y)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(z){if(z){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(u){if(p.isCollapsed()){p.select(p.getNode())}f(u);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){var v=u.substring(7);d("left,center,right,full".split(","),function(x){if(v!=x){n.formatter.remove("align"+x)}});r("align"+v);q("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(x){var u,v;f(x);u=l.getParent(p.getNode(),"ol,ul");if(u){v=u.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(v.nodeName)){i();l.split(v,u);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(u){r(u)},"ForeColor,HiliteColor,FontName":function(x,v,u){r(x,u)},FontSize:function(y,x,v){var u,z;if(v>=1&&v<=7){z=c.explode(k.font_size_style_values);u=c.explode(k.font_size_classes);if(u){v=u[v-1]||v}else{v=z[v-1]||v}}r(y,v)},RemoveFormat:function(u){n.formatter.remove(u)},mceBlockQuote:function(u){r("blockquote")},FormatBlock:function(x,v,u){return r(u||"p")},mceCleanup:function(){var u=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(u)},mceRemoveNode:function(y,x,v){var u=v||p.getNode();if(u!=n.getBody()){i();n.dom.remove(u,a);g()}},mceSelectNodeDepth:function(y,x,v){var u=0;l.getParent(p.getNode(),function(z){if(z.nodeType==1&&u++==v){p.select(z);return b}},n.getBody())},mceSelectNode:function(x,v,u){p.select(u)},mceInsertContent:function(A,H,J){var x,I,D,y,E,F,C,B,K,v,z,L,u,G;x=n.parser;I=new c.html.Serializer({},n.schema);u='\uFEFF';F={content:J,format:"html"};p.onBeforeSetContent.dispatch(p,F);J=F.content;if(J.indexOf("{$caret}")==-1){J+="{$caret}"}J=J.replace(/\{\$caret\}/,u);if(!p.isCollapsed()){n.getDoc().execCommand("Delete",false,null)}D=p.getNode();F={context:D.nodeName.toLowerCase()};E=x.parse(J,F);z=E.lastChild;if(z.attr("id")=="mce_marker"){C=z;for(z=z.prev;z;z=z.walk(true)){if(z.type==3||!l.isBlock(z.name)){z.parent.insert(C,z,z.name==="br");break}}}if(!F.invalid){J=I.serialize(E);z=D.firstChild;L=D.lastChild;if(!z||(z===L&&z.nodeName==="BR")){l.setHTML(D,J)}else{p.setContent(J)}}else{p.setContent(u);D=n.selection.getNode();y=n.getBody();if(D.nodeType==9){D=z=y}else{z=D}while(z!==y){D=z;z=z.parentNode}J=D==y?y.innerHTML:l.getOuterHTML(D);J=I.serialize(x.parse(J.replace(//i,function(){return I.serialize(E)})));if(D==y){l.setHTML(y,J)}else{l.setOuterHTML(D,J)}}C=l.get("mce_marker");B=l.getRect(C);K=l.getViewPort(n.getWin());if((B.y+B.h>K.y+K.h||B.yK.x+K.w||B.x")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(x,v,u){n.execCommand("mceInsertContent",false,u.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(B,A,z){var y=l.getParent(p.getNode(),"a"),v,x,u;if(c.is(z,"string")){z={href:z}}z.href=z.href.replace(" ","%20");if(!y){if(c.isWebKit){v=l.getParent(p.getNode(),"img");if(v){x=v.style.cssText;u=v.className;v.style.cssText=null;v.className=null}}f("CreateLink",b,"javascript:mctmp(0);");if(x){v.style.cssText=x}if(u){v.className=u}d(l.select("a[href='javascript:mctmp(0);']"),function(C){l.setAttribs(C,z)})}else{if(z.href){l.setAttribs(y,z)}else{n.dom.remove(y,a)}}},selectAll:function(){var v=l.getRoot(),u=l.createRng();u.setStart(v,0);u.setEnd(v,v.childNodes.length);n.selection.setRng(u)}});t({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){return s("align"+u.substring(7))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(u){return s(u)},mceBlockQuote:function(){return s("blockquote")},Outdent:function(){var u;if(k.inline_styles){if((u=l.getParent(p.getStart(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}if((u=l.getParent(p.getEnd(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}}return m("InsertUnorderedList")||m("InsertOrderedList")||(!k.inline_styles&&!!l.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(u){return l.getParent(p.getNode(),u=="insertunorderedlist"?"UL":"OL")}},"state");t({"FontSize,FontName":function(x){var v=0,u;if(u=l.getParent(p.getNode(),"span")){if(x=="fontsize"){v=u.style.fontSize}else{v=u.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return v}},"value");if(k.custom_undo_redo){t({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(f){var d,e=0,h=[],c;function g(){return b.trim(f.getContent({format:"raw",no_events:1}))}return d={typing:false,onAdd:new a(d),onUndo:new a(d),onRedo:new a(d),beforeChange:function(){c=f.selection.getBookmark(2,true)},add:function(m){var j,k=f.settings,l;m=m||{};m.content=g();l=h[e];if(l&&l.content==m.content){return null}if(h[e]){h[e].beforeBookmark=c}if(k.custom_undo_redo_levels){if(h.length>k.custom_undo_redo_levels){for(j=0;j0){k=h[--e];f.setContent(k.content,{format:"raw"});f.selection.moveToBookmark(k.beforeBookmark);d.onUndo.dispatch(d,k)}return k},redo:function(){var i;if(e0||this.typing},hasRedo:function(){return e');q.replace(p,m);o.select(p,1)}return g}return d}l.create("tinymce.ForceBlocks",{ForceBlocks:function(m){var n=this,o=m.settings,p;n.editor=m;n.dom=m.dom;p=(o.forced_root_block||"p").toLowerCase();o.element=p.toUpperCase();m.onPreInit.add(n.setup,n)},setup:function(){var n=this,m=n.editor,p=m.settings,u=m.dom,o=m.selection,q=m.schema.getBlockElements();if(p.forced_root_block){function v(){var y=o.getStart(),t=m.getBody(),s,z,D,F,E,x,A,B=-16777215;if(!y||y.nodeType!==1){return}while(y!=t){if(q[y.nodeName]){return}y=y.parentNode}s=o.getRng();if(s.setStart){z=s.startContainer;D=s.startOffset;F=s.endContainer;E=s.endOffset}else{if(s.item){s=m.getDoc().body.createTextRange();s.moveToElementText(s.item(0))}tmpRng=s.duplicate();tmpRng.collapse(true);D=tmpRng.move("character",B)*-1;if(!tmpRng.collapsed){tmpRng=s.duplicate();tmpRng.collapse(false);E=(tmpRng.move("character",B)*-1)-D}}for(y=t.firstChild;y;y){if(y.nodeType===3||(y.nodeType==1&&!q[y.nodeName])){if(!x){x=u.create(p.forced_root_block);y.parentNode.insertBefore(x,y)}A=y;y=y.nextSibling;x.appendChild(A)}else{x=null;y=y.nextSibling}}if(s.setStart){s.setStart(z,D);s.setEnd(F,E);o.setRng(s)}else{try{s=m.getDoc().body.createTextRange();s.moveToElementText(t);s.collapse(true);s.moveStart("character",D);if(E>0){s.moveEnd("character",E)}s.select()}catch(C){}}m.nodeChanged()}m.onKeyUp.add(v);m.onClick.add(v)}if(p.force_br_newlines){if(c){m.onKeyPress.add(function(s,t){var x;if(t.keyCode==13&&o.getNode().nodeName!="LI"){o.setContent('
',{format:"raw"});x=u.get("__");x.removeAttribute("id");o.select(x);o.collapse();return j.cancel(t)}})}}if(p.force_p_newlines){if(!c){m.onKeyPress.add(function(s,t){if(t.keyCode==13&&!t.shiftKey&&!n.insertPara(t)){j.cancel(t)}})}else{l.addUnload(function(){n._previousFormats=0});m.onKeyPress.add(function(s,t){n._previousFormats=0;if(t.keyCode==13&&!t.shiftKey&&s.selection.isCollapsed()&&p.keep_styles){n._previousFormats=k(s.selection.getStart())}});m.onKeyUp.add(function(t,y){if(y.keyCode==13&&!y.shiftKey){var x=t.selection.getStart(),s=n._previousFormats;if(!x.hasChildNodes()&&s){x=u.getParent(x,u.isBlock);if(x&&x.nodeName!="LI"){x.innerHTML="";if(n._previousFormats){x.appendChild(s.wrapper);s.inner.innerHTML="\uFEFF"}else{x.innerHTML="\uFEFF"}o.select(x,1);o.collapse(true);t.getDoc().execCommand("Delete",false,null);n._previousFormats=0}}}})}if(a){m.onKeyDown.add(function(s,t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){n.backspaceDelete(t,t.keyCode==8)}})}}if(l.isWebKit){function r(t){var s=o.getRng(),x,A=u.create("div",null," "),z,y=u.getViewPort(t.getWin()).h;s.insertNode(x=u.create("br"));s.setStartAfter(x);s.setEndAfter(x);o.setRng(s);if(o.getSel().focusNode==x.previousSibling){o.select(u.insertAfter(u.doc.createTextNode("\u00a0"),x));o.collapse(d)}u.insertAfter(A,x);z=u.getPos(A).y;u.remove(A);if(z>y){t.getWin().scrollTo(0,z)}}m.onKeyPress.add(function(s,t){if(t.keyCode==13&&(t.shiftKey||(p.force_br_newlines&&!u.getParent(o.getNode(),"h1,h2,h3,h4,h5,h6,ol,ul")))){r(s);j.cancel(t)}})}if(c){if(p.element!="P"){m.onKeyPress.add(function(s,t){n.lastElm=o.getNode().nodeName});m.onKeyUp.add(function(t,x){var z,y=o.getNode(),s=t.getBody();if(s.childNodes.length===1&&y.nodeName=="P"){y=u.rename(y,p.element);o.select(y);o.collapse();t.nodeChanged()}else{if(x.keyCode==13&&!x.shiftKey&&n.lastElm!="P"){z=u.getParent(y,"p");if(z){u.rename(z,p.element);t.nodeChanged()}}}})}}},getParentBlock:function(o){var m=this.dom;return m.getParent(o,m.isBlock)},insertPara:function(Q){var E=this,v=E.editor,M=v.dom,R=v.getDoc(),V=v.settings,F=v.selection.getSel(),G=F.getRangeAt(0),U=R.body;var J,K,H,O,N,q,o,u,z,m,C,T,p,x,I,L=M.getViewPort(v.getWin()),B,D,A;v.undoManager.beforeChange();J=R.createRange();J.setStart(F.anchorNode,F.anchorOffset);J.collapse(d);K=R.createRange();K.setStart(F.focusNode,F.focusOffset);K.collapse(d);H=J.compareBoundaryPoints(J.START_TO_END,K)<0;O=H?F.anchorNode:F.focusNode;N=H?F.anchorOffset:F.focusOffset;q=H?F.focusNode:F.anchorNode;o=H?F.focusOffset:F.anchorOffset;if(O===q&&/^(TD|TH)$/.test(O.nodeName)){if(O.firstChild.nodeName=="BR"){M.remove(O.firstChild)}if(O.childNodes.length==0){v.dom.add(O,V.element,null,"
");T=v.dom.add(O,V.element,null,"
")}else{I=O.innerHTML;O.innerHTML="";v.dom.add(O,V.element,null,I);T=v.dom.add(O,V.element,null,"
")}G=R.createRange();G.selectNodeContents(T);G.collapse(1);v.selection.setRng(G);return g}if(O==U&&q==U&&U.firstChild&&v.dom.isBlock(U.firstChild)){O=q=O.firstChild;N=o=0;J=R.createRange();J.setStart(O,0);K=R.createRange();K.setStart(q,0)}O=O.nodeName=="HTML"?R.body:O;O=O.nodeName=="BODY"?O.firstChild:O;q=q.nodeName=="HTML"?R.body:q;q=q.nodeName=="BODY"?q.firstChild:q;u=E.getParentBlock(O);z=E.getParentBlock(q);m=u?u.nodeName:V.element;if(I=E.dom.getParent(u,"li,pre")){if(I.nodeName=="LI"){return e(v.selection,E.dom,I)}return d}if(u&&(u.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(M.getStyle(u,"position",1)))){m=V.element;u=null}if(z&&(z.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(M.getStyle(u,"position",1)))){m=V.element;z=null}if(/(TD|TABLE|TH|CAPTION)/.test(m)||(u&&m=="DIV"&&/left|right/gi.test(M.getStyle(u,"float",1)))){m=V.element;u=z=null}C=(u&&u.nodeName==m)?u.cloneNode(0):v.dom.create(m);T=(z&&z.nodeName==m)?z.cloneNode(0):v.dom.create(m);T.removeAttribute("id");if(/^(H[1-6])$/.test(m)&&f(G,u)){T=v.dom.create(V.element)}I=p=O;do{if(I==U||I.nodeType==9||E.dom.isBlock(I)||/(TD|TABLE|TH|CAPTION)/.test(I.nodeName)){break}p=I}while((I=I.previousSibling?I.previousSibling:I.parentNode));I=x=q;do{if(I==U||I.nodeType==9||E.dom.isBlock(I)||/(TD|TABLE|TH|CAPTION)/.test(I.nodeName)){break}x=I}while((I=I.nextSibling?I.nextSibling:I.parentNode));if(p.nodeName==m){J.setStart(p,0)}else{J.setStartBefore(p)}J.setEnd(O,N);C.appendChild(J.cloneContents()||R.createTextNode(""));try{K.setEndAfter(x)}catch(P){}K.setStart(q,o);T.appendChild(K.cloneContents()||R.createTextNode(""));G=R.createRange();if(!p.previousSibling&&p.parentNode.nodeName==m){G.setStartBefore(p.parentNode)}else{if(J.startContainer.nodeName==m&&J.startOffset==0){G.setStartBefore(J.startContainer)}else{G.setStart(J.startContainer,J.startOffset)}}if(!x.nextSibling&&x.parentNode.nodeName==m){G.setEndAfter(x.parentNode)}else{G.setEnd(K.endContainer,K.endOffset)}G.deleteContents();if(b){v.getWin().scrollTo(0,L.y)}if(C.firstChild&&C.firstChild.nodeName==m){C.innerHTML=C.firstChild.innerHTML}if(T.firstChild&&T.firstChild.nodeName==m){T.innerHTML=T.firstChild.innerHTML}function S(y,s){var r=[],X,W,t;y.innerHTML="";if(V.keep_styles){W=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(W.nodeName)){X=W.cloneNode(g);M.setAttrib(X,"id","");r.push(X)}}while(W=W.parentNode)}if(r.length>0){for(t=r.length-1,X=y;t>=0;t--){X=X.appendChild(r[t])}r[0].innerHTML=b?"\u00a0":"
";return r[0]}else{y.innerHTML=b?"\u00a0":"
"}}if(M.isEmpty(C)){S(C,O)}if(M.isEmpty(T)){A=S(T,q)}if(b&&parseFloat(opera.version())<9.5){G.insertNode(C);G.insertNode(T)}else{G.insertNode(T);G.insertNode(C)}T.normalize();C.normalize();v.selection.select(T,true);v.selection.collapse(true);B=v.dom.getPos(T).y;if(BL.y+L.h){v.getWin().scrollTo(0,B1||!F(ap))&&an===0){c.remove(ap,1);return}if(ag.inline||ag.wrapper){if(!ag.exact&&an===1){ap=ao(ap)}O(ab,function(ar){O(c.select(ar.inline,ap),function(au){var at;if(ar.wrap_links===false){at=au.parentNode;do{if(at.nodeName==="A"){return}}while(at=at.parentNode)}U(ar,af,au,ar.exact?au:null)})});if(x(ap.parentNode,Y,af)){c.remove(ap,1);ap=0;return B}if(ag.merge_with_parents){c.getParent(ap.parentNode,function(ar){if(x(ar,Y,af)){c.remove(ap,1);ap=0;return B}})}if(ap){ap=u(C(ap),ap);ap=u(ap,C(ap,B))}}})}if(ag){if(aa){X=c.createRng();X.setStartBefore(aa);X.setEndAfter(aa);ah(o(X,ab))}else{if(!ac||!ag.inline||c.select("td.mceSelected,th.mceSelected").length){var ai=V.selection.getNode();ae=q.getBookmark();ah(o(q.getRng(B),ab));if(ag.styles&&(ag.styles.color||ag.styles.textDecoration)){a.walk(ai,I,"childNodes");I(ai)}q.moveToBookmark(ae);q.setRng(Z(q.getRng(B)));V.nodeChanged()}else{Q("apply",Y,af)}}}}function A(Y,ah,ab){var ac=R(Y),aj=ac[0],ag,af,X;function aa(am){var al=am.startContainer,ar=am.startOffset,aq,ap,an,ao;if(al.nodeType==3&&ar>=al.nodeValue.length-1){al=al.parentNode;ar=s(al)+1}if(al.nodeType==1){an=al.childNodes;al=an[Math.min(ar,an.length-1)];aq=new t(al);if(ar>an.length-1){aq.next()}for(ap=aq.current();ap;ap=aq.next()){if(ap.nodeType==3&&!f(ap)){ao=c.create("a",null,E);ap.parentNode.insertBefore(ao,ap);am.setStart(ap,0);q.setRng(am);c.remove(ao);return}}}}function Z(ao){var an,am,al;an=a.grep(ao.childNodes);for(am=0,al=ac.length;am=0;Z--){if(P.apply[Z].name==Y){return true}}for(Z=P.remove.length-1;Z>=0;Z--){if(P.remove[Z].name==Y){return false}}return W(q.getNode())}aa=q.getNode();if(W(aa)){return B}X=q.getStart();if(X!=aa){if(W(X)){return B}}return S}function v(ad,ac){var aa,ab=[],Z={},Y,X,W;if(q.isCollapsed()){for(X=0;X=0;Y--){W=ad[X];if(P.remove[Y].name==W){Z[W]=true;break}}}for(Y=P.apply.length-1;Y>=0;Y--){for(X=0;X=0;X--){W=ac[X].selector;if(!W){return B}for(ab=Y.length-1;ab>=0;ab--){if(c.is(Y[ab],W)){return B}}}}return S}a.extend(this,{get:R,register:k,apply:T,remove:A,toggle:D,match:j,matchAll:v,matchNode:x,canApply:y});function h(W,X){if(g(W,X.inline)){return B}if(g(W,X.block)){return B}if(X.selector){return c.is(W,X.selector)}}function g(X,W){X=X||"";W=W||"";X=""+(X.nodeName||X);W=""+(W.nodeName||W);return X.toLowerCase()==W.toLowerCase()}function L(X,W){var Y=c.getStyle(X,W);if(W=="color"||W=="backgroundColor"){Y=c.toHex(Y)}if(W=="fontWeight"&&Y==700){Y="bold"}return""+Y}function r(W,X){if(typeof(W)!="string"){W=W(X)}else{if(X){W=W.replace(/%(\w+)/g,function(Z,Y){return X[Y]||Z})}}return W}function f(W){return W&&W.nodeType===3&&/^([\s\r\n]+|)$/.test(W.nodeValue)}function N(Y,X,W){var Z=c.create(X,W);Y.parentNode.insertBefore(Z,Y);Z.appendChild(Y);return Z}function o(W,ag,Z){var Y=W.startContainer,ad=W.startOffset,aj=W.endContainer,ae=W.endOffset,ai,af,ac;function ah(am,an,ak,al){var ao,ap;al=al||c.getRoot();for(;;){ao=am.parentNode;if(ao==al||(!ag[0].block_expand&&F(ao))){return am}for(ai=ao[an];ai&&ai!=am;ai=ai[ak]){if(ai.nodeType==1&&!H(ai)){return am}if(ai.nodeType==3&&!f(ai)){return am}}am=am.parentNode}return am}function ab(ak,al){if(al===p){al=ak.nodeType===3?ak.length:ak.childNodes.length}while(ak&&ak.hasChildNodes()){ak=ak.childNodes[al];if(ak){al=ak.nodeType===3?ak.length:ak.childNodes.length}}return{node:ak,offset:al}}if(Y.nodeType==1&&Y.hasChildNodes()){af=Y.childNodes.length-1;Y=Y.childNodes[ad>af?af:ad];if(Y.nodeType==3){ad=0}}if(aj.nodeType==1&&aj.hasChildNodes()){af=aj.childNodes.length-1;aj=aj.childNodes[ae>af?af:ae-1];if(aj.nodeType==3){ae=aj.nodeValue.length}}if(H(Y.parentNode)){Y=Y.parentNode}if(H(Y)){Y=Y.nextSibling||Y}if(H(aj.parentNode)){ae=c.nodeIndex(aj);aj=aj.parentNode}if(H(aj)&&aj.previousSibling){aj=aj.previousSibling;ae=aj.length}if(ag[0].inline){ac=ab(aj,ae);if(ac.node){while(ac.node&&ac.offset===0&&ac.node.previousSibling){ac=ab(ac.node.previousSibling)}if(ac.node&&ac.offset>0&&ac.node.nodeType===3&&ac.node.nodeValue.charAt(ac.offset-1)===" "){if(ac.offset>1){aj=ac.node;aj.splitText(ac.offset-1)}else{if(ac.node.previousSibling){aj=ac.node.previousSibling}}}}}if(ag[0].inline||ag[0].block_expand){Y=ah(Y,"firstChild","nextSibling");aj=ah(aj,"lastChild","previousSibling")}if(ag[0].selector&&ag[0].expand!==S&&!ag[0].inline){function aa(al,ak){var am,an,ap,ao;if(al.nodeType==3&&al.nodeValue.length==0&&al[ak]){al=al[ak]}am=m(al);for(an=0;anY?Y:Z]}return W}function Q(ab,X,aa){var Y,W=P[ab],ac=P[ab=="apply"?"remove":"apply"];function ad(){return P.apply.length||P.remove.length}function Z(){P.apply=[];P.remove=[]}function ae(af){O(P.apply.reverse(),function(ag){T(ag.name,ag.vars,af);if(ag.name==="forecolor"&&ag.vars.value){I(af.parentNode)}});O(P.remove.reverse(),function(ag){A(ag.name,ag.vars,af)});c.remove(af,1);Z()}for(Y=W.length-1;Y>=0;Y--){if(W[Y].name==X){return}}W.push({name:X,vars:aa});for(Y=ac.length-1;Y>=0;Y--){if(ac[Y].name==X){ac.splice(Y,1)}}if(ad()){V.getDoc().execCommand("FontName",false,"mceinline");P.lastRng=q.getRng();O(c.select("font,span"),function(ag){var af;if(b(ag)){af=q.getBookmark();ae(ag);q.moveToBookmark(af);V.nodeChanged()}});if(!P.isListening&&ad()){P.isListening=true;O("onKeyDown,onKeyUp,onKeyPress,onMouseUp".split(","),function(af){V[af].addToTop(function(ag,ah){if(ad()&&!a.dom.RangeUtils.compareRanges(P.lastRng,q.getRng())){O(c.select("font,span"),function(aj){var ak,ai;if(b(aj)){ak=aj.firstChild;while(ak&&ak.nodeType!=3){ak=ak.firstChild}if(ak){ae(aj);ai=c.createRng();ai.setStart(ak,ak.nodeValue.length);ai.setEnd(ak,ak.nodeValue.length);q.setRng(ai);ag.nodeChanged()}else{c.remove(aj)}}});if(ah.type=="keyup"||ah.type=="mouseup"){Z()}}})})}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_style_values);function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}}); \ No newline at end of file diff --git a/www/javascript/tiny_mce/tiny_mce_popup.js b/www/javascript/tiny_mce/tiny_mce_popup.js deleted file mode 100644 index f859d24e6..000000000 --- a/www/javascript/tiny_mce/tiny_mce_popup.js +++ /dev/null @@ -1,5 +0,0 @@ - -// Uncomment and change this document.domain value if you are loading the script cross subdomains -// document.domain = 'moxiecode.com'; - -var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('