@ -0,0 +1,10 @@ |
|||
|
|||
RewriteEngine On |
|||
|
|||
Rewritebase /ADMIN/ |
|||
|
|||
RewriteCond %{REQUEST_FILENAME} !-f |
|||
RewriteCond %{REQUEST_FILENAME} !-d |
|||
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] |
|||
|
|||
|
@ -0,0 +1,31 @@ |
|||
|
|||
<header> |
|||
<div class="container main"> |
|||
<div class="row"> |
|||
<div class="col-2 col-md-4"></div> |
|||
<img class="logo" src="<?php echo $BASE_URLs;?>/images/header.png"> |
|||
|
|||
<div class="topmenu"> |
|||
<ul> |
|||
<li><a href="<?php echo $BASE_URLs;?>/home">Home</a></li> |
|||
<li><a href="<?php echo $BASE_URLs;?>/consiglio-direttivo">Consiglio</a></li> |
|||
<li><a href="<?php echo $BASE_URLs;?>/albo">Albo</a></li> |
|||
<li><a href="<?php echo $BASE_URLs;?>/farmacie">Farmacie</a></li> |
|||
<li><a href="<?php echo $BASE_URLs;?>/parafarmacie">Parafarmacie</a></li> |
|||
<li class="d-sm-none "><a href="<?php echo $BASE_URLs;?>/notizie">Notizie</a></li> |
|||
<li><a href="<?php echo $BASE_URLs;?>/contatti">Contatti</a></li> |
|||
</ul> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
|
|||
<div class="breadcrumb"> |
|||
<div class="container"> |
|||
<div class="crumbs"> |
|||
<span class="d-none d-sm-block">Ordine dei Farmacisti della Provincia di Salerno <i class="fa fa-angle-right"></i></span> <a href="">Home</a> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</header> |
@ -0,0 +1,70 @@ |
|||
<?php |
|||
|
|||
session_start(); |
|||
|
|||
@include '../cgi-bin/conn.conn'; |
|||
@include '../cgi-bin/functions.inc'; |
|||
@include '../cgi-bin/params.inc'; |
|||
|
|||
$GLOBALS['getQ'][0]="home"; |
|||
$GLOBALS['conn']; |
|||
|
|||
$conn=@mysqli_connect($DATAhst,$DATAusr,$DATApwd,$DATAdtb)or die("CONNECTION ERROR"); |
|||
mysqli_set_charset($conn, "utf8"); |
|||
|
|||
if(@$_GET['q']){ |
|||
$GLOBALS['getQ']=explode("/",$_GET['q']); |
|||
} |
|||
|
|||
?> |
|||
|
|||
|
|||
|
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
|
|||
<title>ADMIN | Ordine dei Farmacisti della Provincia di Salerno</title> |
|||
|
|||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
|||
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'> |
|||
|
|||
<base href="<?php echo $BASE_URL;?>/"> |
|||
|
|||
<link href="<?php echo $BASE_URL;?>/css/styles.css" rel="stylesheet" type="text/css"/> |
|||
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'> |
|||
|
|||
</head> |
|||
<body class="admin"> |
|||
|
|||
<?php |
|||
@include 'header.php'; |
|||
@include 'menu.php'; |
|||
?> |
|||
<section> |
|||
<div id="MainContent" class="container"> |
|||
<div class="row"> |
|||
<div class="col"> |
|||
<?php |
|||
|
|||
@include $getQ[0].'.php'; |
|||
?> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<script type="text/javascript" src="<?php echo $BASE_URL;?>/node_modules/jquery/dist/jquery.min.js"></script> |
|||
<script type="text/javascript" src="<?php echo $BASE_URL;?>/node_modules/jquery-colorbox/jquery.colorbox-min.js"></script> |
|||
<script type="text/javascript" src="<?php echo $BASE_URL;?>/node_modules/tinymce/tinymce.min.js"></script> |
|||
|
|||
<script type="text/javascript" src="<?php echo $BASE_URL;?>/ADMIN/js/scripts.js"></script> |
|||
|
|||
|
|||
</body> |
|||
</html> |
|||
|
|||
|
|||
<?php |
|||
mysqli_close($conn); |
|||
?> |
@ -0,0 +1,20 @@ |
|||
tinymce.init({ |
|||
selector: '.mce', |
|||
height: 200, |
|||
theme: 'modern', |
|||
menubar: false, |
|||
language: 'it', |
|||
forced_root_block : '', |
|||
force_br_newlines : true, |
|||
plugins: [ |
|||
'advlist autolink lists link image charmap print preview anchor textcolor', |
|||
'searchreplace visualblocks code fullscreen', |
|||
'insertdatetime media table contextmenu paste code' |
|||
], |
|||
toolbar: 'bold italic | alignleft aligncenter alignright alignjustify | link bullist numlist outdent indent | removeformat', |
|||
image_advtab: false, |
|||
content_css: [ |
|||
'//fonts.googleapis.com/css?family=Lato:300,300i,400,400i', |
|||
'//www.tinymce.com/css/codepen.min.css' |
|||
] |
|||
}); |
@ -0,0 +1,33 @@ |
|||
|
|||
|
|||
<form method="post"> |
|||
|
|||
Title |
|||
<input type="text" name="title"> |
|||
<br><br> |
|||
|
|||
Text |
|||
<textarea class="mce" name="text"></textarea> |
|||
<br><br> |
|||
|
|||
section |
|||
<input type="text" name="section" value="<?= $_POST['section'];?>"> |
|||
<br><br> |
|||
|
|||
<input type="submit"> |
|||
|
|||
</form> |
|||
|
|||
|
|||
<?php |
|||
|
|||
if(sizeof($_POST)){ |
|||
|
|||
$query = "INSERT INTO links VALUES(0, '".$_POST['title']."', '".$_POST['text']."', '".$_POST['section']."')"; |
|||
$q = mysqli_query($conn, $query); |
|||
|
|||
echo $query; |
|||
|
|||
} |
|||
|
|||
?> |
@ -0,0 +1,21 @@ |
|||
{ |
|||
"name": "tinymce", |
|||
"description": "Web based JavaScript HTML WYSIWYG editor control.", |
|||
"license": "LGPL-2.1", |
|||
"keywords": [ |
|||
"editor", |
|||
"wysiwyg", |
|||
"tinymce", |
|||
"richtext", |
|||
"javascript", |
|||
"html" |
|||
], |
|||
"homepage": "http://www.tinymce.com", |
|||
"ignore": [ |
|||
"readme.md", |
|||
"composer.json", |
|||
"package.json", |
|||
".npmignore", |
|||
"changelog.txt" |
|||
] |
|||
} |
@ -0,0 +1,877 @@ |
|||
Version 4.7.6 (2018-01-29) |
|||
Fixed a bug in the jquery integration where it threw an error saying that "global is not defined". |
|||
Fixed a bug where deleting a table cell whose previous sibling was set to contenteditable false would create a corrupted table. |
|||
Fixed a bug where highlighting text in an unfocused editor did not work correctly in IE11/Edge. |
|||
Fixed a bug where the table resize handles were not being repositioned when activating the Fullscreen Plugin. |
|||
Fixed a bug where the Imagetools Plugin dialog didn't honor editor RTL settings. |
|||
Fixed a bug where block elements weren't being merged correctly if you deleted from after a contenteditable false element to the beginning of another block element. |
|||
Fixed a bug where TinyMCE didn't work with module loaders like webpack. |
|||
Version 4.7.5 (2018-01-22) |
|||
Fixed bug with the Codesample Plugin where it wasn't possible to edit codesamples when the editor was in inline mode. |
|||
Fixed bug where focusing on the status bar broke the keyboard navigation functionality. |
|||
Fixed bug where an error would be thrown on Edge by the Table Plugin when pasting using the PowerPaste Plugin. |
|||
Fixed bug in the Table Plugin where selecting row border style from the dropdown menu in advanced row properties would throw an error. |
|||
Fixed bug with icons being rendered incorrectly on Chrome on Mac OS. |
|||
Fixed bug in the Textcolor Plugin where the font color and background color buttons wouldn't trigger an ExecCommand event. |
|||
Fixed bug in the Link Plugin where the url field wasn't forced LTR. |
|||
Fixed bug where the Nonbreaking Plugin incorrectly inserted spaces into tables. |
|||
Fixed bug with the inline theme where the toolbar wasn't repositioned on window resize. |
|||
Version 4.7.4 (2017-12-05) |
|||
Fixed bug in the Nonbreaking Plugin where the nonbreaking_force_tab setting was being ignored. |
|||
Fixed bug in the Table Plugin where changing row height incorrectly converted column widths to pixels. |
|||
Fixed bug in the Table Plugin on Edge and IE11 where resizing the last column after resizing the table would cause invalid column heights. |
|||
Fixed bug in the Table Plugin where keyboard navigation was not normalized between browsers. |
|||
Fixed bug in the Table Plugin where the colorpicker button would show even without defining the colorpicker_callback. |
|||
Fixed bug in the Table Plugin where it wasn't possible to set the cell background color. |
|||
Fixed bug where Firefox would throw an error when intialising an editor on an element that is hidden or not yet added to the DOM. |
|||
Fixed bug where Firefox would throw an error when intialising an editor inside of a hidden iframe. |
|||
Version 4.7.3 (2017-11-23) |
|||
Added functionality to open the Codesample Plugin dialog when double clicking on a codesample. Patch contributed by dakuzen. |
|||
Fixed bug where undo/redo didn't work correctly with some formats and caret positions. |
|||
Fixed bug where the color picker didn't show up in Table Plugin dialogs. |
|||
Fixed bug where it wasn't possible to change the width of a table through the Table Plugin dialog. |
|||
Fixed bug where the Charmap Plugin couldn't insert some special characters. |
|||
Fixed bug where editing a newly inserted link would not actually edit the link but insert a new link next to it. |
|||
Fixed bug where deleting all content in a table cell made it impossible to place the caret into it. |
|||
Fixed bug where the vertical alignment field in the Table Plugin cell properties dialog didn't do anything. |
|||
Fixed bug where an image with a caption showed two sets of resize handles in IE11. |
|||
Fixed bug where pressing the enter button inside of an h1 with contenteditable set to true would sometimes produce a p tag. |
|||
Fixed bug with backspace not working as expected before a noneditable element. |
|||
Fixed bug where operating on tables with invalid rowspans would cause an error to be thrown. |
|||
Fixed so a real base64 representation of the image is available on the blobInfo that the images_upload_handler gets called with. |
|||
Fixed so the image upload tab is available when the images_upload_handler is defined (and not only when the images_upload_url is defined). |
|||
Version 4.7.2 (2017-11-07) |
|||
Added newly rewritten Table Plugin. |
|||
Added support for attributes with colon in valid_elements and addValidElements. |
|||
Added support for dailymotion short url in the Media Plugin. Patch contributed by maat8. |
|||
Added support for converting to half pt when converting font size from px to pt. Patch contributed by danny6514. |
|||
Added support for location hash to the Autosave plugin to make it work better with SPAs using hash routing. |
|||
Added support for merging table cells when pasting a table into another table. |
|||
Changed so the language packs are only loaded once. Patch contributed by 0xor1. |
|||
Simplified the css for inline boundaries selection by switching to an attribute selector. |
|||
Fixed bug where an error would be thrown on editor initialization if the window.getSelection() returned null. |
|||
Fixed bug where holding down control or alt keys made the keyboard navigation inside an inline boundary not work as expected. |
|||
Fixed bug where applying formats in IE11 produced extra, empty paragraphs in the editor. |
|||
Fixed bug where the Word Count Plugin didn't count some mathematical operators correctly. |
|||
Fixed bug where removing an inline editor removed the element that the editor had been initialized on. |
|||
Fixed bug where setting the selection to the end of an editable container caused some formatting problems. |
|||
Fixed bug where an error would be thrown sometimes when an editor was removed because of the selection bookmark was being stored asynchronously. |
|||
Fixed a bug where an editor initialized on an empty list did not contain any valid cursor positions. |
|||
Fixed a bug with the Context Menu Plugin and webkit browsers on Mac where right-clicking inside a table would produce an incorrect selection. |
|||
Fixed bug where the Image Plugin constrain proportions setting wasn't working as expected. |
|||
Fixed bug where deleting the last character in a span with decorations produced an incorrect element when typing. |
|||
Fixed bug where focusing on inline editors made the toolbar flicker when moving between elements quickly. |
|||
Fixed bug where the selection would be stored incorrectly in inline editors when the mouseup event was fired outside the editor body. |
|||
Fixed bug where toggling bold at the end of an inline boundary would toggle off the whole word. |
|||
Fixed bug where setting the skin to false would not stop the loading of some skin css files. |
|||
Fixed bug in mobile theme where pinch-to-zoom would break after exiting the editor. |
|||
Fixed bug where sublists of a fully selected list would not be switched correctly when changing list style. |
|||
Fixed bug where inserting media by source would break the UndoManager. |
|||
Fixed bug where inserting some content into the editor with a specific selection would replace some content incorrectly. |
|||
Fixed bug where selecting all content with ctrl+a in IE11 caused problems with untoggling some formatting. |
|||
Fixed bug where the Search and Replace Plugin left some marker spans in the editor when undoing and redoing after replacing some content. |
|||
Fixed bug where the editor would not get a scrollbar when using the Fullscreen and Autoresize plugins together. |
|||
Fixed bug where the font selector would stop working correctly after selecting fonts three times. |
|||
Fixed so pressing the enter key inside of an inline boundary inserts a br after the inline boundary element. |
|||
Fixed a bug where it wasn't possible to use tab navigation inside of a table that was inside of a list. |
|||
Fixed bug where end_container_on_empty_block would incorrectly remove elements. |
|||
Fixed bug where content_styles weren't added to the Preview Plugin iframe. |
|||
Fixed so the beforeSetContent/beforeGetContent events are preventable. |
|||
Fixed bug where changing height value in Table Plugin advanced tab didn't do anything. |
|||
Fixed bug where it wasn't possible to remove formatting from content in beginning of table cell. |
|||
Version 4.7.1 (2017-10-09) |
|||
Fixed bug where theme set to false on an inline editor produced an extra div element after the target element. |
|||
Fixed bug where the editor drag icon was misaligned with the branding set to false. |
|||
Fixed bug where doubled menu items were not being removed as expected with the removed_menuitems setting. |
|||
Fixed bug where the Table of contents plugin threw an error when initialized. |
|||
Fixed bug where it wasn't possible to add inline formats to text selected right to left. |
|||
Fixed bug where the paste from plain text mode did not work as expected. |
|||
Fixed so the style previews do not set color and background color when selected. |
|||
Fixed bug where the Autolink plugin didn't work as expected with some formats applied on an empty editor. |
|||
Fixed bug where the Textpattern plugin were throwing errors on some patterns. |
|||
Fixed bug where the Save plugin saved all editors instead of only the active editor. Patch contributed by dannoe. |
|||
Version 4.7.0 (2017-10-03) |
|||
Added new mobile ui that is specifically designed for mobile devices. |
|||
Updated the default skin to be more modern and white since white is preferred by most implementations. |
|||
Restructured the default menus to be more similar to common office suites like Google Docs. |
|||
Fixed so theme can be set to false on both inline and iframe editor modes. |
|||
Fixed bug where inline editor would add/remove the visualblocks css multiple times. |
|||
Fixed bug where selection wouldn't be properly restored when editor lost focus and commands where invoked. |
|||
Fixed bug where toc plugin would generate id:s for headers even though a toc wasn't inserted into the content. |
|||
Fixed bug where is wasn't possible to drag/drop contents within the editor if paste_data_images where set to true. |
|||
Fixed bug where getParam and close in WindowManager would get the first opened window instead of the last opened window. |
|||
Fixed bug where delete would delete between cells inside a table in Firefox. |
|||
Version 4.6.7 (2017-09-18) |
|||
Fixed bug where paste wasn't working in IOS. |
|||
Fixed bug where the Word Count Plugin didn't count some mathematical operators correctly. |
|||
Fixed bug where inserting a list in a table caused the cell to expand in height. |
|||
Fixed bug where pressing enter in a list located inside of a table deleted list items instead of inserting new list item. |
|||
Fixed bug where copy and pasting table cells produced inconsistent results. |
|||
Fixed bug where initializing an editor with an ID of 'length' would throw an exception. |
|||
Fixed bug where it was possible to split a non merged table cell. |
|||
Fixed bug where copy and pasting a list with a very specific selection into another list would produce a nested list. |
|||
Fixed bug where copy and pasting ordered lists sometimes produced unordered lists. |
|||
Fixed bug where padded elements inside other elements would be treated as empty. |
|||
Added some missing translations to Image, Link and Help plugins. |
|||
Fixed so you can resize images inside a figure element. |
|||
Fixed bug where an inline TinyMCE editor initialized on a table did not set selection on load in Chrome. |
|||
Fixed the positioning of the inlite toolbar when the target element wasn't big enough to fit the toolbar. |
|||
Version 4.6.6 (2017-08-30) |
|||
Fixed so that notifications wrap long text content instead of bleeding outside the notification element. |
|||
Fixed so the content_style css is added after the skin and custom stylesheets. |
|||
Fixed bug where it wasn't possible to remove a table with the Cut button. |
|||
Fixed bug where the center format wasn't getting the same font size as the other formats in the format preview. |
|||
Fixed bug where the wordcount plugin wasn't counting hyphenated words correctly. |
|||
Fixed bug where all content pasted into the editor was added to the end of the editor. |
|||
Fixed bug where enter keydown on list item selection only deleted content and didn't create a new line. |
|||
Fixed bug where destroying the editor while the content css was still loading caused error notifications on Firefox. |
|||
Fixed bug where undoing cut operation in IE11 left some unwanted html in the editor content. |
|||
Fixed bug where enter keydown would throw an error in IE11. |
|||
Fixed bug where duplicate instances of an editor were added to the editors array when using the createEditor API. |
|||
Fixed bug where the formatter applied formats on the wrong content when spellchecker was activated. |
|||
Fixed bug where switching formats would reset font size on child nodes. |
|||
Fixed bug where the table caption element weren't always the first descendant to the table tag. |
|||
Fixed bug where pasting some content into the editor on chrome some newlines were removed. |
|||
Fixed bug where it wasn't possible to remove a list if a list item was a table element. |
|||
Fixed bug where copy/pasting partial selections of tables wouldn't produce a proper table. |
|||
Fixed bug where the searchreplace plugin could not find consecutive spaces. |
|||
Fixed bug where background color wasn't applied correctly on some partially selected contents. |
|||
Version 4.6.5 (2017-08-02) |
|||
Added new inline_boundaries_selector that allows you to specify the elements that should have boundaries. |
|||
Added new local upload feature this allows the user to upload images directly from the image dialog. |
|||
Added a new api for providing meta data for plugins. It will show up in the help dialog if it's provided. |
|||
Fixed so that the notifications created by the notification manager are more screen reader accessible. |
|||
Fixed bug where changing the list format on multiple selected lists didn't change all of the lists. |
|||
Fixed bug where the nonbreaking plugin would insert multiple undo levels when pressing the tab key. |
|||
Fixed bug where delete/backspace wouldn't render a caret when all editor contents where deleted. |
|||
Fixed bug where delete/backspace wouldn't render a caret if the deleted element was a single contentEditable false element. |
|||
Fixed bug where the wordcount plugin wouldn't count words correctly if word where typed after applying a style format. |
|||
Fixed bug where the wordcount plugin would count mathematical formulas as multiple words for example 1+1=2. |
|||
Fixed bug where formatting of triple clicked blocks on Chrome/Safari would result in styles being added outside the visual selection. |
|||
Fixed bug where paste would add the contents to the end of the editor area when inline mode was used. |
|||
Fixed bug where toggling off bold formatting on text entered in a new paragraph would add an extra line break. |
|||
Fixed bug where autolink plugin would only produce a link on every other consecutive link on Firefox. |
|||
Fixed bug where it wasn't possible to select all contents if the content only had one pre element. |
|||
Fixed bug where sizzle would produce lagging behavior on some sites due to repaints caused by feature detection. |
|||
Fixed bug where toggling off inline formats wouldn't include the space on selected contents with leading or trailing spaces. |
|||
Fixed bug where the cut operation in UI wouldn't work in Chrome. |
|||
Fixed bug where some legacy editor initialization logic would throw exceptions about editor settings not being defined. |
|||
Fixed bug where it wasn't possible to apply text color to links if they where part of a non collapsed selection. |
|||
Fixed bug where an exception would be thrown if the user selected a video element and then moved the focus outside the editor. |
|||
Fixed bug where list operations didn't work if there where block elements inside the list items. |
|||
Fixed bug where applying block formats to lists wrapped in block elements would apply to all elements in that wrapped block. |
|||
Version 4.6.4 (2017-06-13) |
|||
Fixed bug where the editor would move the caret when clicking on the scrollbar next to a content editable false block. |
|||
Fixed bug where the text color select dropdowns wasn't placed correctly when they didn't fit the width of the screen. |
|||
Fixed bug where the default editor line height wasn't working for mixed font size contents. |
|||
Fixed bug where the content css files for inline editors were loaded multiple times for multiple editor instances. |
|||
Fixed bug where the initial value of the font size/font family dropdowns wasn't displayed. |
|||
Fixed bug where the I18n api was not supporting arrays as the translation replacement values. |
|||
Fixed bug where chrome would display "The given range isn't in document." errors for invalid ranges passed to setRng. |
|||
Fixed bug where the compat3x plugin wasn't working since the global tinymce references wasn't resolved correctly. |
|||
Fixed bug where the preview plugin wasn't encoding the base url passed into the iframe contents producing a xss bug. |
|||
Fixed bug where the dom parser/serializer wasn't handling some special elements like noframes, title and xmp. |
|||
Fixed bug where the dom parser/serializer wasn't handling cdata sections with comments inside. |
|||
Fixed bug where the editor would scroll to the top of the editable area if a dialog was closed in inline mode. |
|||
Fixed bug where the link dialog would not display the right rel value if rel_list was configured. |
|||
Fixed bug where the context menu would select images on some platforms but not others. |
|||
Fixed bug where the filenames of images were not retained on dragged and drop into the editor from the desktop. |
|||
Fixed bug where the paste plugin would misrepresent newlines when pasting plain text and having forced_root_block configured. |
|||
Fixed so that the error messages for the imagetools plugin is more human readable. |
|||
Fixed so the internal validate setting for the parser/serializer can't be set from editor initialization settings. |
|||
Version 4.6.3 (2017-05-30) |
|||
Fixed bug where the arrow keys didn't work correctly when navigating on nested inline boundary elements. |
|||
Fixed bug where delete/backspace didn't work correctly on nested inline boundary elements. |
|||
Fixed bug where image editing didn't work on subsequent edits of the same image. |
|||
Fixed bug where charmap descriptions wouldn't properly wrap if they exceeded the width of the box. |
|||
Fixed bug where the default image upload handler only accepted 200 as a valid http status code. |
|||
Fixed so rel on target=_blank links gets forced with only noopener instead of both noopener and noreferrer. |
|||
Version 4.6.2 (2017-05-23) |
|||
Fixed bug where the SaxParser would run out of memory on very large documents. |
|||
Fixed bug with formatting like font size wasn't applied to del elements. |
|||
Fixed bug where various api calls would be throwing exceptions if they where invoked on a removed editor instance. |
|||
Fixed bug where the branding position would be incorrect if the editor was inside a hidden tab and then later showed. |
|||
Fixed bug where the color levels feature in the imagetools dialog wasn't working properly. |
|||
Fixed bug where imagetools dialog wouldn't pre-load images from CORS domains, before trying to prepare them for editing. |
|||
Fixed bug where the tab key would move the caret to the next table cell if being pressed inside a list inside a table. |
|||
Fixed bug where the cut/copy operations would loose parent context like the current format etc. |
|||
Fixed bug with format preview not working on invalid elements excluded by valid_elements. |
|||
Fixed bug where blocks would be merged in incorrect order on backspace/delete. |
|||
Fixed bug where zero length text nodes would cause issues with the undo logic if there where iframes present. |
|||
Fixed bug where the font size/family select lists would throw errors if the first node was a comment. |
|||
Fixed bug with csp having to allow local script evaluation since it was used to detect global scope. |
|||
Fixed bug where CSP required a relaxed option for javascript: URLs in unsupported legacy browsers. |
|||
Fixed bug where a fake caret would be rendered for td with the contenteditable=false. |
|||
Fixed bug where typing would be blocked on IE 11 when within a nested contenteditable=true/false structure. |
|||
Version 4.6.1 (2017-05-10) |
|||
Added configuration option to list plugin to disable tab indentation. |
|||
Fixed bug where format change on very specific content could cause the selection to change. |
|||
Fixed bug where TinyMCE could not be lazyloaded through jquery integration. |
|||
Fixed bug where entities in style attributes weren't decoded correctly on paste in webkit. |
|||
Fixed bug where fontsize_formats option had been renamed incorrectly. |
|||
Fixed bug with broken backspace/delete behaviour between contenteditable=false blocks. |
|||
Fixed bug where it wasn't possible to backspace to the previous line with the inline boundaries functionality turned on. |
|||
Fixed bug where is wasn't possible to move caret left and right around a linked image with the inline boundaries functionality turned on. |
|||
Fixed bug where pressing enter after/before hr element threw exception. Patch contributed bradleyke. |
|||
Fixed so the CSS in the visualblocks plugin doesn't overwrite background color. Patch contributed by Christian Rank. |
|||
Fixed bug where multibyte characters weren't encoded correctly. Patch contributed by James Tarkenton. |
|||
Fixed bug where shift-click to select within contenteditable=true fields wasn't working. |
|||
Version 4.6.0 (2017-05-04) |
|||
Dropped support for IE 8-10 due to market share and lack of support from Microsoft. See tinymce docs for details. |
|||
Added an inline boundary caret position feature that makes it easier to type at the beginning/end of links/code elements. |
|||
Added a help plugin that adds a button and a dialog showing the editor shortcuts and loaded plugins. |
|||
Added an inline_boundaries option that allows you to disable the inline boundary feature if it's not desired. |
|||
Added a new ScrollIntoView event that allows you to override the default scroll to element behavior. |
|||
Added role and aria- attributes as valid elements in the default valid elements config. |
|||
Added new internal flag for PastePreProcess/PastePostProcess this is useful to know if the paste was coming from an external source. |
|||
Added new ignore function to UndoManager this works similar to transact except that it doesn't add an undo level by default. |
|||
Fixed so that urls gets retained for images when being edited. This url is then passed on to the upload handler. |
|||
Fixed so that the editors would be initialized on readyState interactive instead of complete. |
|||
Fixed so that the init event of the editor gets fired once all contentCSS files have been properly loaded. |
|||
Fixed so that width/height of the editor gets taken from the textarea element if it's explicitly specified in styles. |
|||
Fixed so that keep_styles set to false no longer clones class/style from the previous paragraph on enter. |
|||
Fixed so that the default line-height is 1.2em to avoid zwnbsp characters from producing text rendering glitches on Windows. |
|||
Fixed so that loading errors of content css gets presented by a notification message. |
|||
Fixed so figure image elements can be linked when selected this wraps the figure image in a anchor element. |
|||
Fixed bug where it wasn't possible to copy/paste rows with colspans by using the table copy/paste feature. |
|||
Fixed bug where the protect setting wasn't properly applied to header/footer parts when using the fullpage plugin. |
|||
Fixed bug where custom formats that specified upper case element names where not applied correctly. |
|||
Fixed bug where some screen readers weren't reading buttons due to an aria specific fix for IE 8. |
|||
Fixed bug where cut wasn't working correctly on iOS due to it's clipboard API not working correctly. |
|||
Fixed bug where Edge would paste div elements instead of paragraphs when pasting plain text. |
|||
Fixed bug where the textpattern plugin wasn't dealing with trailing punctuations correctly. |
|||
Fixed bug where image editing would some times change the image format from jpg to png. |
|||
Fixed bug where some UI elements could be inserted into the toolbar even if they where not registered. |
|||
Fixed bug where it was possible to click the TD instead of the character in the character map and that caused an exception. |
|||
Fixed bug where the font size/font family dropdowns would sometimes show an incorrect value due to css not being loaded in time. |
|||
Fixed bug with the media plugin inserting undefined instead of retaining size when media_dimensions was set to false. |
|||
Fixed bug with deleting images when forced_root_blocks where set to false. |
|||
Fixed bug where input focus wasn't properly handled on nested content editable elements. |
|||
Fixed bug where Chrome/Firefox would throw an exception when selecting images due to recent change of setBaseAndExtent support. |
|||
Fixed bug where malformed blobs would throw exceptions now they are simply ignored. |
|||
Fixed bug where backspace/delete wouldn't work properly in some cases where all contents was selected in WebKit. |
|||
Fixed bug with Angular producing errors since it was expecting events objects to be patched with their custom properties. |
|||
Fixed bug where the formatter would apply formatting to spellchecker errors now all bogus elements are excluded. |
|||
Fixed bug with backspace/delete inside table caption elements wouldn't behave properly on IE 11. |
|||
Fixed bug where typing after a contenteditable false inline element could move the caret to the end of that element. |
|||
Fixed bug where backspace before/after contenteditable false blocks wouldn't properly remove the right element. |
|||
Fixed bug where backspace before/after contenteditable false inline elements wouldn't properly empty the current block element. |
|||
Fixed bug where vertical caret navigation with a custom line-height would sometimes match incorrect positions. |
|||
Fixed bug with paste on Edge where character encoding wasn't handled properly due to a browser bug. |
|||
Fixed bug with paste on Edge where extra fragment data was inserted into the contents when pasting. |
|||
Fixed bug with pasting contents when having a whole block element selected on WebKit could cause WebKit spans to appear. |
|||
Fixed bug where the visualchars plugin wasn't working correctly showing invisible nbsp characters. |
|||
Fixed bug where browsers would hang if you tried to load some malformed html contents. |
|||
Fixed bug where the init call promise wouldn't resolve if the specified selector didn't find any matching elements. |
|||
Fixed bug where the Schema isValidChild function was case sensitive. |
|||
Version 4.5.3 (2017-02-01) |
|||
Added keyboard navigation for menu buttons when the menu is in focus. |
|||
Added api to the list plugin for setting custom classes/attributes on lists. |
|||
Added validation for the anchor plugin input field according to W3C id naming specifications. |
|||
Fixed bug where media placeholders were removed after resize with the forced_root_block setting set to false. |
|||
Fixed bug where deleting selections with similar sibling nodes sometimes deleted the whole document. |
|||
Fixed bug with inlite theme where several toolbars would appear scrolling when more than one instance of the editor was in use. |
|||
Fixed bug where the editor would throw error with the fontselect plugin on hidden editor instances in Firefox. |
|||
Fixed bug where the background color would not stretch to the font size. |
|||
Fixed bug where font size would be removed when changing background color. |
|||
Fixed bug where the undomanager trimmed away whitespace between nodes on undo/redo. |
|||
Fixed bug where media_dimensions=false in media plugin caused the editor to throw an error. |
|||
Fixed bug where IE was producing font/u elements within links on paste. |
|||
Fixed bug where some button tooltips were broken when compat3x was in use. |
|||
Fixed bug where backspace/delete/typeover would remove the caption element. |
|||
Fixed bug where powerspell failed to function when compat3x was enabled. |
|||
Fixed bug where it wasn't possible to apply sub/sup on text with large font size. |
|||
Fixed bug where pre tags with spaces weren't treated as content. |
|||
Fixed bug where Meta+A would select the entire document instead of all contents in nested ce=true elements. |
|||
Version 4.5.2 (2017-01-04) |
|||
Added missing keyboard shortcut description for the underline menu item in the format menu. |
|||
Fixed bug where external blob urls wasn't properly handled by editor upload logic. Patch contributed by David Oviedo. |
|||
Fixed bug where urls wasn't treated as a single word by the wordcount plugin. |
|||
Fixed bug where nbsp characters wasn't treated as word delimiters by the wordcount plugin. |
|||
Fixed bug where editor instance wasn't properly passed to the format preview logic. Patch contributed by NullQuery. |
|||
Fixed bug where the fake caret wasn't hidden when you moved selection to a cE=false element. |
|||
Fixed bug where it wasn't possible to edit existing code sample blocks. |
|||
Fixed bug where it wasn't possible to delete editor contents if the selection included an empty block. |
|||
Fixed bug where the formatter wasn't expanding words on some international characters. Patch contributed by Martin Larochelle. |
|||
Fixed bug where the open link feature wasn't working correctly on IE 11. |
|||
Fixed bug where enter before/after a cE=false block wouldn't properly padd the paragraph with an br element. |
|||
Fixed so font size and font family select boxes always displays a value by using the runtime style as a fallback. |
|||
Fixed so missing plugins will be logged to console as warnings rather than halting the initialization of the editor. |
|||
Fixed so splitbuttons become normal buttons in advlist plugin if styles are empty. Patch contributed by René Schleusner. |
|||
Fixed so you can multi insert rows/cols by selecting table cells and using insert rows/columns. |
|||
Version 4.5.1 (2016-12-07) |
|||
Fixed bug where the lists plugin wouldn't initialize without the advlist plugins if served from cdn. |
|||
Fixed bug where selectors with "*" would cause the style format preview to throw an error. |
|||
Fixed bug with toggling lists off on lists with empty list items would throw an error. |
|||
Fixed bug where editing images would produce non existing blob uris. |
|||
Fixed bug where the offscreen toc selection would be treated as the real toc element. |
|||
Fixed bug where the aria level attribute for element path would have an incorrect start index. |
|||
Fixed bug where the offscreen selection of cE=false that where very wide would be shown onscreen. Patch contributed by Steven Bufton. |
|||
Fixed so the default_link_target gets applied to links created by the autolink plugin. |
|||
Fixed so that the name attribute gets removed by the anchor plugin if editing anchors. |
|||
Version 4.5.0 (2016-11-23) |
|||
Added new toc plugin allows you to insert table of contents based on editor headings. |
|||
Added new auto complete menu to all url fields. Adds history, link to anchors etc. |
|||
Added new sidebar api that allows you to add custom sidebar panels and buttons to toggle these. |
|||
Added new insert menu button that allows you to have multiple insert functions under the same menu button. |
|||
Added new open link feature to ctrl+click, alt+enter and context menu. |
|||
Added new media_embed_handler option to allow the media plugin to be populated with custom embeds. |
|||
Added new support for editing transparent images using the image tools dialog. |
|||
Added new images_reuse_filename option to allow filenames of images to be retained for upload. |
|||
Added new security feature where links with target="_blank" will by default get rel="noopener noreferrer". |
|||
Added new allow_unsafe_link_target to allow you to opt-out of the target="_blank" security feature. |
|||
Added new style_formats_autohide option to automatically hide styles based on context. |
|||
Added new codesample_content_css option to specify where the code sample prism css is loaded from. |
|||
Added new support for Japanese/Chinese word count following the unicode standards on this. |
|||
Added new fragmented undo levels this dramatically reduces flicker on contents with iframes. |
|||
Added new live previews for complex elements like table or lists. |
|||
Fixed bug where it wasn't possible to properly tab between controls in a dialog with a disabled form item control. |
|||
Fixed bug where firefox would generate a rectangle on elements produced after/before a cE=false elements. |
|||
Fixed bug with advlist plugin not switching list element format properly in some edge cases. |
|||
Fixed bug where col/rowspans wasn't correctly computed by the table plugin in some cases. |
|||
Fixed bug where the table plugin would thrown an error if object_resizing was disabled. |
|||
Fixed bug where some invalid markup would cause issues when running in XHTML mode. Patch contributed by Charles Bourasseau. |
|||
Fixed bug where the fullscreen class wouldn't be removed properly when closing dialogs. |
|||
Fixed bug where the PastePlainTextToggle event wasn't fired by the paste plugin when the state changed. |
|||
Fixed bug where table the row type wasn't properly updated in table row dialog. Patch contributed by Matthias Balmer. |
|||
Fixed bug where select all and cut wouldn't place caret focus back to the editor in WebKit. Patch contributed by Daniel Jalkut. |
|||
Fixed bug where applying cell/row properties to multiple cells/rows would reset other unchanged properties. |
|||
Fixed bug where some elements in the schema would have redundant/incorrect children. |
|||
Fixed bug where selector and target options would cause issues if used together. |
|||
Fixed bug where drag/drop of images from desktop on chrome would thrown an error. |
|||
Fixed bug where cut on WebKit/Blink wouldn't add an undo level. |
|||
Fixed bug where IE 11 would scroll to the cE=false elements when they where selected. |
|||
Fixed bug where keys like F5 wouldn't work when a cE=false element was selected. |
|||
Fixed bug where the undo manager wouldn't stop the typing state when commands where executed. |
|||
Fixed bug where unlink on wrapped links wouldn't work properly. |
|||
Fixed bug with drag/drop of images on WebKit where the image would be deleted form the source editor. |
|||
Fixed bug where the visual characters mode would be disabled when contents was extracted from the editor. |
|||
Fixed bug where some browsers would toggle of formats applied to the caret when clicking in the editor toolbar. |
|||
Fixed bug where the custom theme function wasn't working correctly. |
|||
Fixed bug where image option for custom buttons required you to have icon specified as well. |
|||
Fixed bug where the context menu and contextual toolbars would be visible at the same time and sometimes overlapping. |
|||
Fixed bug where the noneditable plugin would double wrap elements when using the noneditable_regexp option. |
|||
Fixed bug where tables would get padding instead of margin when you used the indent button. |
|||
Fixed bug where the charmap plugin wouldn't properly insert non breaking spaces. |
|||
Fixed bug where the color previews in color input boxes wasn't properly updated. |
|||
Fixed bug where the list items of previous lists wasn't merged in the right order. |
|||
Fixed bug where it wasn't possible to drag/drop inline-block cE=false elements on IE 11. |
|||
Fixed bug where some table cell merges would produce incorrect rowspan/colspan. |
|||
Fixed so the font size of the editor defaults to 14px instead of 11px this can be overridden by custom css. |
|||
Fixed so wordcount is debounced to reduce cpu hogging on larger texts. |
|||
Fixed so tinymce global gets properly exported as a module when used with some module bundlers. |
|||
Fixed so it's possible to specify what css properties you want to preview on specific formats. |
|||
Fixed so anchors are contentEditable=false while within the editor. |
|||
Fixed so selected contents gets wrapped in a inline code element by the codesample plugin. |
|||
Fixed so conditional comments gets properly stripped independent of case. Patch contributed by Georgii Dolzhykov. |
|||
Fixed so some escaped css sequences gets properly handled. Patch contributed by Georgii Dolzhykov. |
|||
Fixed so notifications with the same message doesn't get displayed at the same time. |
|||
Fixed so F10 can be used as an alternative key to focus to the toolbar. |
|||
Fixed various api documentation issues and typos. |
|||
Removed layer plugin since it wasn't really ported from 3.x and there doesn't seem to be much use for it. |
|||
Removed moxieplayer.swf from the media plugin since it wasn't used by the media plugin. |
|||
Removed format state from the advlist plugin to be more consistent with common word processors. |
|||
Version 4.4.3 (2016-09-01) |
|||
Fixed bug where copy would produce an exception on Chrome. |
|||
Fixed bug where deleting lists on IE 11 would merge in correct text nodes. |
|||
Fixed bug where deleting partial lists with indentation wouldn't cause proper normalization. |
|||
Version 4.4.2 (2016-08-25) |
|||
Added new importcss_exclusive option to disable unique selectors per group. |
|||
Added new group specific selector_converter option to importcss plugin. |
|||
Added new codesample_languages option to apply custom languages to codesample plugin. |
|||
Added new codesample_dialog_width/codesample_dialog_height options. |
|||
Fixed bug where fullscreen button had an incorrect keyboard shortcut. |
|||
Fixed bug where backspace/delete wouldn't work correctly from a block to a cE=false element. |
|||
Fixed bug where smartpaste wasn't detecting links with special characters in them like tilde. |
|||
Fixed bug where the editor wouldn't get proper focus if you clicked on a cE=false element. |
|||
Fixed bug where it wasn't possible to copy/paste table rows that had merged cells. |
|||
Fixed bug where merging cells could some times produce invalid col/rowspan attibute values. |
|||
Fixed bug where getBody would sometimes thrown an exception now it just returns null if the iframe is clobbered. |
|||
Fixed bug where drag/drop of cE=false element wasn't properly constrained to viewport. |
|||
Fixed bug where contextmenu on Mac would collapse any selection to a caret. |
|||
Fixed bug where rtl mode wasn't rendered properly when loading a language pack with the rtl flag. |
|||
Fixed bug where Kamer word bounderies would be stripped from contents. |
|||
Fixed bug where lists would sometimes render two dots or numbers on the same line. |
|||
Fixed bug where the skin_url wasn't used by the inlite theme. |
|||
Fixed so data attributes are ignored when comparing formats in the formatter. |
|||
Fixed so it's possible to disable inline toolbars in the inlite theme. |
|||
Fixed so template dialog gets resized if it doesn't fit the window viewport. |
|||
Version 4.4.1 (2016-07-26) |
|||
Added smart_paste option to paste plugin to allow disabling the paste behavior if needed. |
|||
Fixed bug where png urls wasn't properly detected by the smart paste logic. |
|||
Fixed bug where the element path wasn't working properly when multiple editor instances where used. |
|||
Fixed bug with creating lists out of multiple paragraphs would just create one list item instead of multiple. |
|||
Fixed bug where scroll position wasn't properly handled by the inlite theme to place the toolbar properly. |
|||
Fixed bug where multiple instances of the editor using the inlite theme didn't render the toolbar properly. |
|||
Fixed bug where the shortcut label for fullscreen mode didn't match the actual shortcut key. |
|||
Fixed bug where it wasn't possible to select cE=false blocks using touch devices on for example iOS. |
|||
Fixed bug where it was possible to select the child image within a cE=false on IE 11. |
|||
Fixed so inserts of html containing lists doesn't merge with any existing lists unless it's a paste operation. |
|||
Version 4.4.0 (2016-06-30) |
|||
Added new inlite theme this is a more lightweight inline UI. |
|||
Added smarter paste logic that auto detects urls in the clipboard and inserts images/links based on that. |
|||
Added a better image resize algorithm for better image quality in the imagetools plugin. |
|||
Fixed bug where it wasn't possible to drag/dropping cE=false elements on FF. |
|||
Fixed bug where backspace/delete before/after a cE=false block would produce a new paragraph. |
|||
Fixed bug where list style type css property wasn't preserved when indenting lists. |
|||
Fixed bug where merging of lists where done even if the list style type was different. |
|||
Fixed bug where the image_dataimg_filter function wasn't used when pasting images. |
|||
Fixed bug where nested editable within a non editable element would cause scroll on focus in Chrome. |
|||
Fixed so invalid targets for inline mode is blocked on initialization. We only support elements that can have children. |
|||
Version 4.3.13 (2016-06-08) |
|||
Added characters with a diacritical mark to charmap plugin. Patch contributed by Dominik Schilling. |
|||
Added better error handling if the image proxy service would produce errors. |
|||
Fixed issue with pasting list items into list items would produce nested list rather than a merged list. |
|||
Fixed bug where table selection could get stuck in selection mode for inline editors. |
|||
Fixed bug where it was possible to place the caret inside the resize grid elements. |
|||
Fixed bug where it wasn't possible to place in elements horizontally adjacent cE=false blocks. |
|||
Fixed bug where multiple notifications wouldn't be properly placed on screen. |
|||
Fixed bug where multiple editor instance of the same id could be produces in some specific integrations. |
|||
Version 4.3.12 (2016-05-10) |
|||
Fixed bug where focus calls couldn't be made inside the editors PostRender event handler. |
|||
Fixed bug where some translations wouldn't work as expected due to a bug in editor.translate. |
|||
Fixed bug where the node change event could fire with a node out side the root of the editor. |
|||
Fixed bug where Chrome wouldn't properly present the keyboard paste clipboard details when paste was clicked. |
|||
Fixed bug where merged cells in tables couldn't be selected from right to left. |
|||
Fixed bug where insert row wouldn't properly update a merged cells rowspan property. |
|||
Fixed bug where the color input boxes preview field wasn't properly set on initialization. |
|||
Fixed bug where IME composition inside table cells wouldn't work as expected on IE 11. |
|||
Fixed so all shadow dom support is under and experimental flag due to flaky browser support. |
|||
Version 4.3.11 (2016-04-25) |
|||
Fixed bug where it wasn't possible to insert empty blocks though the API unless they where padded. |
|||
Fixed bug where you couldn't type the Euro character on Windows. |
|||
Fixed bug where backspace/delete from a cE=false element to a text block didn't work properly. |
|||
Fixed bug where the text color default grid would render incorrectly. |
|||
Fixed bug where the codesample plugin wouldn't load the css in the editor for multiple editors. |
|||
Fixed so the codesample plugin textarea gets focused by default. |
|||
Version 4.3.10 (2016-04-12) |
|||
Fixed bug where the key "y" on WebKit couldn't be entered due to conflict with keycode for F10 on keypress. |
|||
Version 4.3.9 (2016-04-12) |
|||
Added support for focusing the contextual toolbars using keyboard. |
|||
Added keyboard support for slider UI controls. You can no increase/decrease using arrow keys. |
|||
Added url pattern matching for Dailymotion to media plugin. Patch contributed by Bertrand Darbon. |
|||
Added body_class to template plugin preview. Patch contributed by Milen Petrinski. |
|||
Added options to better override textcolor pickers with custom colors. Patch contributed by Xavier Boubert. |
|||
Added visual arrows to inline contextual toolbars so that they point to the element being active. |
|||
Fixed so toolbars for tables or other larger elements get better positioned below the scrollable viewport. |
|||
Fixed bug where it was possible to click links inside cE=false blocks. |
|||
Fixed bug where event targets wasn't properly handled in Safari Technical Preview. |
|||
Fixed bug where drag/drop text in FF 45 would make the editor caret invisible. |
|||
Fixed bug where the remove state wasn't properly set on editor instances when detected as clobbered. |
|||
Fixed bug where offscreen selection of some cE=false elements would render onscreen. Patch contributed by Steven Bufton |
|||
Fixed bug where enter would clone styles out side the root on editors inside a span. Patch contributed by ChristophKaser. |
|||
Fixed bug where drag/drop of images into the editor didn't work correctly in FF. |
|||
Fixed so the first item in panels for the imagetools dialog gets proper keyboard focus. |
|||
Changed the Meta+Shift+F shortcut to Ctrl+Shift+F since Czech, Slovak, Polish languages used the first one for input. |
|||
Version 4.3.8 (2016-03-15) |
|||
Fixed bug where inserting HR at the end of a block element would produce an extra empty block. |
|||
Fixed bug where links would be clickable when readonly mode was enabled. |
|||
Fixed bug where the formatter would normalize to the wrong node on very specific content. |
|||
Fixed bug where some nested list items couldn't be indented properly. |
|||
Fixed bug where links where clickable in the preview dialog. |
|||
Fixed so the alt attribute doesn't get padded with an empty value by default. |
|||
Fixed so nested alignment works more correctly. You will now alter the alignment to the closest block parent. |
|||
Version 4.3.7 (2016-03-02) |
|||
Fixed bug where incorrect icons would be rendered for imagetools edit and color levels. |
|||
Fixed bug where navigation using arrow keys inside a SelectBox didn't move up/down. |
|||
Fixed bug where the visualblocks plugin would render borders round internal UI elements. |
|||
Version 4.3.6 (2016-03-01) |
|||
Added new paste_remember_plaintext_info option to allow a global disable of the plain text mode notification. |
|||
Added new PastePlainTextToggle event that fires when plain text mode toggles on/off. |
|||
Fixed bug where it wasn't possible to select media elements since the drag logic would snap it to mouse cursor. |
|||
Fixed bug where it was hard to place the caret inside nested cE=true elements when the outer cE=false element was focused. |
|||
Fixed bug where editors wouldn't properly initialize if both selector and mode where used. |
|||
Fixed bug where IME input inside table cells would switch the IME off. |
|||
Fixed bug where selection inside the first table cell would cause the whole table cell to get selected. |
|||
Fixed bug where error handling of images being uploaded wouldn't properly handle faulty statuses. |
|||
Fixed bug where inserting contents before a HR would cause an exception to be thrown. |
|||
Fixed bug where copy/paste of Excel data would be inserted as an image. |
|||
Fixed caret position issues with copy/paste of inline block cE=false elements. |
|||
Fixed issues with various menu item focus bugs in Chrome. Where the focused menu bar item wasn't properly blurred. |
|||
Fixed so the notifications have a solid background since it would be hard to read if there where text under it. |
|||
Fixed so notifications gets animated similar to the ones used by dialogs. |
|||
Fixed so larger images that gets pasted is handled better. |
|||
Fixed so the window close button is more uniform on various platform and also increased it's hit area. |
|||
Version 4.3.5 (2016-02-11) |
|||
Npm version bump due to package not being fully updated. |
|||
Version 4.3.4 (2016-02-11) |
|||
Added new OpenWindow/CloseWindow events that gets fired when windows open/close. |
|||
Added new NewCell/NewRow events that gets fired when table cells/rows are created. |
|||
Added new Promise return value to tinymce.init makes it easier to handle initialization. |
|||
Removed the jQuery version the jQuery plugin is now moved into the main package. |
|||
Removed jscs from build process since eslint can now handle code style checking. |
|||
Fixed various bugs with drag/drop of contentEditable:false elements. |
|||
Fixed bug where deleting of very specific nested list items would result in an odd list. |
|||
Fixed bug where lists would get merged with adjacent lists outside the editable inline root. |
|||
Fixed bug where MS Edge would crash when closing a dialog then clicking a menu item. |
|||
Fixed bug where table cell selection would add undo levels. |
|||
Fixed bug where table cell selection wasn't removed when inline editor where removed. |
|||
Fixed bug where table cell selection wouldn't work properly on nested tables. |
|||
Fixed bug where table merge menu would be available when merging between thead and tbody. |
|||
Fixed bug where table row/column resize wouldn't get properly removed when the editor was removed. |
|||
Fixed bug where Chrome would scroll to the editor if there where a empty hash value in document url. |
|||
Fixed bug where the cache suffix wouldn't work correctly with the importcss plugin. |
|||
Fixed bug where selection wouldn't work properly on MS Edge on Windows Phone 10. |
|||
Fixed so adjacent pre blocks gets joined into one pre block since that seems like the user intent. |
|||
Fixed so events gets properly dispatched in shadow dom. Patch provided by Nazar Mokrynskyi. |
|||
Version 4.3.3 (2016-01-14) |
|||
Added new table_resize_bars configuration setting. This setting allows you to disable the table resize bars. |
|||
Added new beforeInitialize event to tinymce.util.XHR lets you modify XHR properties before open. Patch contributed by Brent Clintel. |
|||
Added new autolink_pattern setting to autolink plugin. Enables you to override the default autolink formats. Patch contributed by Ben Tiedt. |
|||
Added new charmap option that lets you override the default charmap of the charmap plugin. |
|||
Added new charmap_append option that lets you add new characters to the default charmap of the charmap plugin. |
|||
Added new insertCustomChar event that gets fired when a character is inserted by the charmap plugin. |
|||
Fixed bug where table cells started with a superfluous in IE10+. |
|||
Fixed bug where table plugin would retain all BR tags when cells were merged. |
|||
Fixed bug where media plugin would strip underscores from youtube urls. |
|||
Fixed bug where IME input would fail on IE 11 if you typed within a table. |
|||
Fixed bug where double click selection of a word would remove the space before the word on insert contents. |
|||
Fixed bug where table plugin would produce exceptions when hovering tables with invalid structure. |
|||
Fixed bug where fullscreen wouldn't scroll back to it's original position when untoggled. |
|||
Fixed so the template plugins templates setting can be a function that gets a callback that can provide templates. |
|||
Version 4.3.2 (2015-12-14) |
|||
Fixed bug where the resize bars for table cells were not affected by the object_resizing property. |
|||
Fixed bug where the contextual table toolbar would appear incorrectly if TinyMCE was initialized inline inside a table. |
|||
Fixed bug where resizing table cells did not fire a node change event or add an undo level. |
|||
Fixed bug where double click selection of text on IE 11 wouldn't work properly. |
|||
Fixed bug where codesample plugin would incorrectly produce br elements inside code elements. |
|||
Fixed bug where media plugin would strip dashes from youtube urls. |
|||
Fixed bug where it was possible to move the caret into the table resize bars. |
|||
Fixed bug where drag/drop into a cE=false element was possible on IE. |
|||
Version 4.3.1 (2015-11-30) |
|||
Fixed so it's possible to disable the table inline toolbar by setting it to false or an empty string. |
|||
Fixed bug where it wasn't possible to resize some tables using the drag handles. |
|||
Fixed bug where unique id:s would clash for multiple editor instances and cE=false selections. |
|||
Fixed bug where the same plugin could be initialized multiple times. |
|||
Fixed bug where the table inline toolbars would be displayed at the same time as the image toolbars. |
|||
Fixed bug where the table selection rect wouldn't be removed when selecting another control element. |
|||
Version 4.3.0 (2015-11-23) |
|||
Added new table column/row resize support. Makes it a lot more easy to resize the columns/rows in a table. |
|||
Added new table inline toolbar. Makes it easier to for example add new rows or columns to a table. |
|||
Added new notification API. Lets you display floating notifications to the end user. |
|||
Added new codesample plugin that lets you insert syntax highlighted pre elements into the editor. |
|||
Added new image_caption to images. Lets you create images with captions using a HTML5 figure/figcaption elements. |
|||
Added new live previews of embeded videos. Lets you play the video right inside the editor. |
|||
Added new setDirty method and "dirty" event to the editor. Makes it easier to track the dirty state change. |
|||
Added new setMode method to Editor instances that lets you dynamically switch between design/readonly. |
|||
Added new core support for contentEditable=false elements within the editor overrides the browsers broken behavior. |
|||
Rewrote the noneditable plugin to use the new contentEditable false core logic. |
|||
Fixed so the dirty state doesn't set to false automatically when the undo index is set to 0. |
|||
Fixed the Selection.placeCaretAt so it works better on IE when the coordinate is between paragraphs. |
|||
Fixed bug where data-mce-bogus="all" element contents where counted by the word count plugin. |
|||
Fixed bug where contentEditable=false elements would be indented by the indent buttons. |
|||
Fixed bug where images within contentEditable=false would be selected in WebKit on mouse click. |
|||
Fixed bug in DOMUntils split method where the replacement parameter wouldn't work on specific cases. |
|||
Fixed bug where the importcss plugin would import classes from the skin content css file. |
|||
Fixed so all button variants have a wrapping span for it's text to make it easier to skin. |
|||
Fixed so it's easier to exit pre block using the arrow keys. |
|||
Fixed bug where listboxes with fix widths didn't render correctly. |
|||
Version 4.2.8 (2015-11-13) |
|||
Fixed bug where it was possible to delete tables as the inline root element if all columns where selected. |
|||
Fixed bug where the UI buttons active state wasn't properly updated due to recent refactoring of that logic. |
|||
Version 4.2.7 (2015-10-27) |
|||
Fixed bug where backspace/delete would remove all formats on the last paragraph character in WebKit/Blink. |
|||
Fixed bug where backspace within a inline format element with a bogus caret container would move the caret. |
|||
Fixed bug where backspace/delete on selected table cells wouldn't add an undo level. |
|||
Fixed bug where script tags embedded within the editor could sometimes get a mce- prefix prepended to them |
|||
Fixed bug where validate: false option could produce an error to be thrown from the Serialization step. |
|||
Fixed bug where inline editing of a table as the root element could let the user delete that table. |
|||
Fixed bug where inline editing of a table as the root element wouldn't properly handle enter key. |
|||
Fixed bug where inline editing of a table as the root element would normalize the selection incorrectly. |
|||
Fixed bug where inline editing of a list as the root element could let the user delete that list. |
|||
Fixed bug where inline editing of a list as the root element could let the user split that list. |
|||
Fixed bug where resize handles would be rendered on editable root elements such as table. |
|||
Version 4.2.6 (2015-09-28) |
|||
Added capability to set request headers when using XHRs. |
|||
Added capability to upload local images automatically default delay is set to 30 seconds after editing images. |
|||
Added commands ids mceEditImage, mceAchor and mceMedia to be avaiable from execCommand. |
|||
Added Edge browser to saucelabs grunt task. Patch contributed by John-David Dalton. |
|||
Fixed bug where blob uris not produced by tinymce would produce HTML invalid markup. |
|||
Fixed bug where selection of contents of a nearly empty editor in Edge would sometimes fail. |
|||
Fixed bug where color styles woudln't be retained on copy/paste in Blink/Webkit. |
|||
Fixed bug where the table plugin would throw an error when inserting rows after a child table. |
|||
Fixed bug where the template plugin wouldn't handle functions as variable replacements. |
|||
Fixed bug where undo/redo sometimes wouldn't work properly when applying formatting collapsed ranges. |
|||
Fixed bug where shift+delete wouldn't do a cut operation on Blink/WebKit. |
|||
Fixed bug where cut action wouldn't properly store the before selection bookmark for the undo level. |
|||
Fixed bug where backspace in side an empty list element on IE would loose editor focus. |
|||
Fixed bug where the save plugin wouldn't enable the buttons when a change occurred. |
|||
Fixed bug where Edge wouldn't initialize the editor if a document.domain was specified. |
|||
Fixed bug where enter key before nested images would sometimes not properly expand the previous block. |
|||
Fixed bug where the inline toolbars wouldn't get properly hidden when blurring the editor instance. |
|||
Fixed bug where Edge would paste Chinese characters on some Windows 10 installations. |
|||
Fixed bug where IME would loose focus on IE 11 due to the double trailing br bug fix. |
|||
Fixed bug where the proxy url in imagetools was incorrect. Patch contributed by Wong Ho Wang. |
|||
Version 4.2.5 (2015-08-31) |
|||
Added fullscreen capability to embedded youtube and vimeo videos. |
|||
Fixed bug where the uploadImages call didn't work on IE 10. |
|||
Fixed bug where image place holders would be uploaded by uploadImages call. |
|||
Fixed bug where images marked with bogus would be uploaded by the uploadImages call. |
|||
Fixed bug where multiple calls to uploadImages would result in decreased performance. |
|||
Fixed bug where pagebreaks were editable to imagetools patch contributed by Rasmus Wallin. |
|||
Fixed bug where the element path could cause too much recursion exception. |
|||
Fixed bug for domains containing ".min". Patch contributed by Loïc Février. |
|||
Fixed so validation of external links to accept a number after www. Patch contributed by Victor Carvalho. |
|||
Fixed so the charmap is exposed though execCommand. Patch contributed by Matthew Will. |
|||
Fixed so that the image uploads are concurrent for improved performance. |
|||
Fixed various grammar problems in inline documentation. Patches provided by nikolas. |
|||
Version 4.2.4 (2015-08-17) |
|||
Added picture as a valid element to the HTML 5 schema. Patch contributed by Adam Taylor. |
|||
Fixed bug where contents would be duplicated on drag/drop within the same editor. |
|||
Fixed bug where floating/alignment of images on Edge wouldn't work properly. |
|||
Fixed bug where it wasn't possible to drag images on IE 11. |
|||
Fixed bug where image selection on Edge would sometimes fail. |
|||
Fixed bug where contextual toolbars icons wasn't rendered properly when using the toolbar_items_size. |
|||
Fixed bug where searchreplace dialog doesn't get prefilled with the selected text. |
|||
Fixed bug where fragmented matches wouldn't get properly replaced by the searchreplace plugin. |
|||
Fixed bug where enter key wouldn't place the caret if was after a trailing space within an inline element. |
|||
Fixed bug where the autolink plugin could produce multiple links for the same text on Gecko. |
|||
Fixed bug where EditorUpload could sometimes throw an exception if the blob wasn't found. |
|||
Fixed xss issues with media plugin not properly filtering out some script attributes. |
|||
Version 4.2.3 (2015-07-30) |
|||
Fixed bug where image selection wasn't possible on Edge due to incompatible setBaseAndExtend API. |
|||
Fixed bug where image blobs urls where not properly destroyed by the imagetools plugin. |
|||
Fixed bug where keyboard shortcuts wasn't working correctly on IE 8. |
|||
Fixed skin issue where the borders of panels where not visible on IE 8. |
|||
Version 4.2.2 (2015-07-22) |
|||
Fixed bug where float panels were not being hidden on inline editor blur when fixed_toolbar_container config option was in use. |
|||
Fixed bug where combobox states wasn't properly updated if contents where updated without keyboard. |
|||
Fixed bug where pasting into textbox or combobox would move the caret to the end of text. |
|||
Fixed bug where removal of bogus span elements before block elements would remove whitespace between nodes. |
|||
Fixed bug where repositioning of inline toolbars where async and producing errors if the editor was removed from DOM to early. Patch by iseulde. |
|||
Fixed bug where element path wasn't working correctly. Patch contributed by iseulde. |
|||
Fixed bug where menus wasn't rendered correctly when custom images where added to a menu. Patch contributed by Naim Hammadi. |
|||
Version 4.2.1 (2015-06-29) |
|||
Fixed bug where back/forward buttons in the browser would render blob images as broken images. |
|||
Fixed bug where Firefox would throw regexp to big error when replacing huge base64 chunks. |
|||
Fixed bug rendering issues with resize and context toolbars not being placed properly until next animation frame. |
|||
Fixed bug where the rendering of the image while cropping would some times not be centered correctly. |
|||
Fixed bug where listbox items with submenus would me selected as active. |
|||
Fixed bug where context menu where throwing an error when rendering. |
|||
Fixed bug where resize both option wasn't working due to resent addClass API change. Patch contributed by Jogai. |
|||
Fixed bug where a hideAll call for container rendered inline toolbars would throw an error. |
|||
Fixed bug where onclick event handler on combobox could cause issues if element.id was a function by some polluting libraries. |
|||
Fixed bug where listboxes wouldn't get proper selected sub menu item when using link_list or image_list. |
|||
Fixed so the UI controls are as wide as 4.1.x to avoid wrapping controls in toolbars. |
|||
Fixed so the imagetools dialog is adaptive for smaller screen sizes. |
|||
Version 4.2.0 (2015-06-25) |
|||
Added new flat default skin to make the UI more modern. |
|||
Added new imagetools plugin, lets you crop/resize and apply filters to images. |
|||
Added new contextual toolbars support to the API lets you add floating toolbars for specific CSS selectors. |
|||
Added new promise feature fill as tinymce.util.Promise. |
|||
Added new built in image upload feature lets you upload any base64 encoded image within the editor as files. |
|||
Fixed bug where resize handles would appear in the right position in the wrong editor when switching between resizable content in different inline editors. |
|||
Fixed bug where tables would not be inserted in inline mode due to previous float panel fix. |
|||
Fixed bug where floating panels would remain open when focus was lost on inline editors. |
|||
Fixed bug where cut command on Chrome would thrown a browser security exception. |
|||
Fixed bug where IE 11 sometimes would report an incorrect size for images in the image dialog. |
|||
Fixed bug where it wasn't possible to remove inline formatting at the end of block elements. |
|||
Fixed bug where it wasn't possible to delete table cell contents when cell selection was vertical. |
|||
Fixed bug where table cell wasn't emptied from block elements if delete/backspace where pressed in empty cell. |
|||
Fixed bug where cmd+shift+arrow didn't work correctly on Firefox mac when selecting to start/end of line. |
|||
Fixed bug where removal of bogus elements would sometimes remove whitespace between nodes. |
|||
Fixed bug where the resize handles wasn't updated when the main window was resized. |
|||
Fixed so script elements gets removed by default to prevent possible XSS issues in default config implementations. |
|||
Fixed so the UI doesn't need manual reflows when using non native layout managers. |
|||
Fixed so base64 encoded images doesn't slow down the editor on modern browsers while editing. |
|||
Fixed so all UI elements uses touch events to improve mobile device support. |
|||
Removed the touch click quirks patch for iOS since it did more harm than good. |
|||
Removed the non proportional resize handles since. Unproportional resize can still be done by holding the shift key. |
|||
Version 4.1.10 (2015-05-05) |
|||
Fixed bug where plugins loaded with compat3x would sometimes throw errors when loading using the jQuery version. |
|||
Fixed bug where extra empty paragraphs would get deleted in WebKit/Blink due to recent Quriks fix. |
|||
Fixed bug where the editor wouldn't work properly on IE 12 due to some required browser sniffing. |
|||
Fixed bug where formatting shortcut keys where interfering with Mac OS X screenshot keys. |
|||
Fixed bug where the caret wouldn't move to the next/previous line boundary on Cmd+Left/Right on Gecko. |
|||
Fixed bug where it wasn't possible to remove formats from very specific nested contents. |
|||
Fixed bug where undo levels wasn't produced when typing letters using the shift or alt+ctrl modifiers. |
|||
Fixed bug where the dirty state wasn't properly updated when typing using the shift or alt+ctrl modifiers. |
|||
Fixed bug where an error would be thrown if an autofocused editor was destroyed quickly after its initialization. Patch provided by thorn0. |
|||
Fixed issue with dirty state not being properly updated on redo operation. |
|||
Fixed issue with entity decoder not handling incorrectly written numeric entities. |
|||
Fixed issue where some PI element values wouldn't be properly encoded. |
|||
Version 4.1.9 (2015-03-10) |
|||
Fixed bug where indentation wouldn't work properly for non list elements. |
|||
Fixed bug with image plugin not pulling the image dimensions out correctly if a custom document_base_url was used. |
|||
Fixed bug where ctrl+alt+[1-9] would conflict with the AltGr+[1-9] on Windows. New shortcuts is ctrl+shift+[1-9]. |
|||
Fixed bug with removing formatting on nodes in inline mode would sometimes include nodes outside the editor body. |
|||
Fixed bug where extra nbsp:s would be inserted when you replaced a word surrounded by spaces using insertContent. |
|||
Fixed bug with pasting from Google Docs would produce extra strong elements and line feeds. |
|||
Version 4.1.8 (2015-03-05) |
|||
Added new html5 sizes attribute to img elements used together with srcset. |
|||
Added new elementpath option that makes it possible to disable the element path but keep the statusbar. |
|||
Added new option table_style_by_css for the table plugin to set table styling with css rather than table attributes. |
|||
Added new link_assume_external_targets option to prompt the user to prepend http:// prefix if the supplied link does not contain a protocol prefix. |
|||
Added new image_prepend_url option to allow a custom base path/url to be added to images. |
|||
Added new table_appearance_options option to make it possible to disable some options. |
|||
Added new image_title option to make it possible to alter the title of the image, disabled by default. |
|||
Fixed bug where selection starting from out side of the body wouldn't produce a proper selection range on IE 11. |
|||
Fixed bug where pressing enter twice before a table moves the cursor in the table and causes a javascript error. |
|||
Fixed bug where advanced image styles were not respected. |
|||
Fixed bug where the less common Shift+Delete didn't produce a proper cut operation on WebKit browsers. |
|||
Fixed bug where image/media size constrain logic would produce NaN when handling non number values. |
|||
Fixed bug where internal classes where removed by the removeformat command. |
|||
Fixed bug with creating links table cell contents with a specific selection would throw a exceptions on WebKit/Blink. |
|||
Fixed bug where valid_classes option didn't work as expected according to docs. Patch provided by thorn0. |
|||
Fixed bug where jQuery plugin would patch the internal methods multiple times. Patch provided by Drew Martin. |
|||
Fixed bug where backspace key wouldn't delete the current selection of newly formatted content. |
|||
Fixed bug where type over of inline formatting elements wouldn't properly keep the format on WebKit/Blink. |
|||
Fixed bug where selection needed to be properly normalized on modern IE versions. |
|||
Fixed bug where Command+Backspace didn't properly delete the whole line of text but the previous word. |
|||
Fixed bug where UI active states wheren't properly updated on IE if you placed caret within the current range. |
|||
Fixed bug where delete/backspace on WebKit/Blink would remove span elements created by the user. |
|||
Fixed bug where delete/backspace would produce incorrect results when deleting between two text blocks with br elements. |
|||
Fixed bug where captions where removed when pasting from MS Office. |
|||
Fixed bug where lists plugin wouldn't properly remove fully selected nested lists. |
|||
Fixed bug where the ttf font used for icons would throw an warning message on Gecko on Mac OS X. |
|||
Fixed a bug where applying a color to text did not update the undo/redo history. |
|||
Fixed so shy entities gets displayed when using the visualchars plugin. |
|||
Fixed so removeformat removes ins/del by default since these might be used for strikethough. |
|||
Fixed so multiple language packs can be loaded and added to the global I18n data structure. |
|||
Fixed so transparent color selection gets treated as a normal color selection. Patch contributed by Alexander Hofbauer. |
|||
Fixed so it's possible to disable autoresize_overflow_padding, autoresize_bottom_margin options by setting them to false. |
|||
Fixed so the charmap plugin shows the description of the character in the dialog. Patch contributed by Jelle Hissink. |
|||
Removed address from the default list of block formats since it tends to be missused. |
|||
Fixed so the pre block format is called preformatted to make it more verbose. |
|||
Fixed so it's possible to context scope translation strings this isn't needed most of the time. |
|||
Fixed so the max length of the width/height input fields of the media dialog is 5 instead of 3. |
|||
Fixed so drag/dropped contents gets properly processed by paste plugin since it's basically a paste. Patch contributed by Greg Fairbanks. |
|||
Fixed so shortcut keys for headers is ctrl+alt+[1-9] instead of ctrl+[1-9] since these are for switching tabs in the browsers. |
|||
Fixed so "u" doesn't get converted into a span element by the legacy input filter. Since this is now a valid HTML5 element. |
|||
Fixed font families in order to provide appropriate web-safe fonts. |
|||
Version 4.1.7 (2014-11-27) |
|||
Added HTML5 schema support for srcset, source and picture. Patch contributed by mattheu. |
|||
Added new cache_suffix setting to enable cache busting by producing unique urls. |
|||
Added new paste_convert_word_fake_lists option to enable users to disable the fake lists convert logic. |
|||
Fixed so advlist style changes adds undo levels for each change. |
|||
Fixed bug where WebKit would sometimes produce an exception when the autolink plugin where looking for URLs. |
|||
Fixed bug where IE 7 wouldn't be rendered properly due to aggressive css compression. |
|||
Fixed bug where DomQuery wouldn't accept window as constructor element. |
|||
Fixed bug where the color picker in 3.x dialogs wouldn't work properly. Patch contributed by Callidior. |
|||
Fixed bug where the image plugin wouldn't respect the document_base_url. |
|||
Fixed bug where the jQuery plugin would fail to append to elements named array prototype names. |
|||
Version 4.1.6 (2014-10-08) |
|||
Fixed bug with clicking on the scrollbar of the iframe would cause a JS error to be thrown. |
|||
Fixed bug where null would produce an exception if you passed it to selection.setRng. |
|||
Fixed bug where Ctrl/Cmd+Tab would indent the current list item if you switched tabs in the browser. |
|||
Fixed bug where pasting empty cells from Excel would result in a broken table. |
|||
Fixed bug where it wasn't possible to switch back to default list style type. |
|||
Fixed issue where the select all quirk fix would fire for other modifiers than Ctrl/Cmd combinations. |
|||
Replaced jake with grunt since it is more mainstream and has better plugin support. |
|||
Version 4.1.5 (2014-09-09) |
|||
Fixed bug where sometimes the resize rectangles wouldn't properly render on images on WebKit/Blink. |
|||
Fixed bug in list plugin where delete/backspace would merge empty LI elements in lists incorrectly. |
|||
Fixed bug where empty list elements would result in empty LI elements without it's parent container. |
|||
Fixed bug where backspace in empty caret formatted element could produce an type error exception of Gecko. |
|||
Fixed bug where lists pasted from word with a custom start index above 9 wouldn't be properly handled. |
|||
Fixed bug where tabfocus plugin would tab out of the editor instance even if the default action was prevented. |
|||
Fixed bug where tabfocus wouldn't tab properly to other adjacent editor instances. |
|||
Fixed bug where the DOMUtils setStyles wouldn't properly removed or update the data-mce-style attribute. |
|||
Fixed bug where dialog select boxes would be placed incorrectly if document.body wasn't statically positioned. |
|||
Fixed bug where pasting would sometimes scroll to the top of page if the user was using the autoresize plugin. |
|||
Fixed bug where caret wouldn't be properly rendered by Chrome when clicking on the iframes documentElement. |
|||
Fixed so custom images for menubutton/splitbutton can be provided. Patch contributed by Naim Hammadi. |
|||
Fixed so the default action of windows closing can be prevented by blocking the default action of the close event. |
|||
Fixed so nodeChange and focus of the editor isn't automatically performed when opening sub dialogs. |
|||
Version 4.1.4 (2014-08-21) |
|||
Added new media_filter_html option to media plugin that blocks any conditional comments, scripts etc within a video element. |
|||
Added new content_security_policy option allows you to set custom policy for iframe contents. Patch contributed by Francois Chagnon. |
|||
Fixed bug where activate/deactivate events wasn't firing properly when switching between editors. |
|||
Fixed bug where placing the caret on iOS was difficult due to a WebKit bug with touch events. |
|||
Fixed bug where the resize helper wouldn't render properly on older IE versions. |
|||
Fixed bug where resizing images inside tables on older IE versions would sometimes fail depending mouse position. |
|||
Fixed bug where editor.insertContent would produce an exception when inserting select/option elements. |
|||
Fixed bug where extra empty paragraphs would be produced if block elements where inserted inside span elements. |
|||
Fixed bug where the spellchecker menu item wouldn't be properly checked if spell checking was started before it was rendered. |
|||
Fixed bug where the DomQuery filter function wouldn't remove non elements from collection. |
|||
Fixed bug where document with custom document.domain wouldn't properly render the editor. |
|||
Fixed bug where IE 8 would throw exception when trying to enter invalid color values into colorboxes. |
|||
Fixed bug where undo manager could incorrectly add an extra undo level when custom resize handles was removed. |
|||
Fixed bug where it wouldn't be possible to alter cell properties properly on table cells on IE 8. |
|||
Fixed so the color picker button in table dialog isn't shown unless you include the colorpicker plugin or add your own custom color picker. |
|||
Fixed so activate/deactivate events fire when windowManager opens a window since. |
|||
Fixed so the table advtab options isn't separated by an underscore to normalize naming with image_advtab option. |
|||
Fixed so the table cell dialog has proper padding when the advanced tab in disabled. |
|||
Version 4.1.3 (2014-07-29) |
|||
Added event binding logic to tinymce.util.XHR making it possible to override headers and settings before any request is made. |
|||
Fixed bug where drag events wasn't fireing properly on older IE versions since the event handlers where bound to document. |
|||
Fixed bug where drag/dropping contents within the editor on IE would force the contents into plain text mode even if it was internal content. |
|||
Fixed bug where IE 7 wouldn't open menus properly due to a resize bug in the browser auto closing them immediately. |
|||
Fixed bug where the DOMUtils getPos logic wouldn't produce a valid coordinate inside the body if the body was positioned non static. |
|||
Fixed bug where the element path and format state wasn't properly updated if you had the wordcount plugin enabled. |
|||
Fixed bug where a comment at the beginning of source would produce an exception in the formatter logic. |
|||
Fixed bug where setAttrib/getAttrib on null would throw exception together with any hooked attributes like style. |
|||
Fixed bug where table sizes wasn't properly retained when copy/pasting on WebKit/Blink. |
|||
Fixed bug where WebKit/Blink would produce colors in RGB format instead of the forced HEX format when deleting contents. |
|||
Fixed bug where the width attribute wasn't updated on tables if you changed the size inside the table dialog. |
|||
Fixed bug where control selection wasn't properly handled when the caret was placed directly after an image. |
|||
Fixed bug where selecting the contents of table cells using the selection.select method wouldn't place the caret properly. |
|||
Fixed bug where the selection state for images wasn't removed when placing the caret right after an image on WebKit/Blink. |
|||
Fixed bug where all events wasn't properly unbound when and editor instance was removed or destroyed by some external innerHTML call. |
|||
Fixed bug where it wasn't possible or very hard to select images on iOS when the onscreen keyboard was visible. |
|||
Fixed so auto_focus can take a boolean argument this will auto focus the last initialized editor might be useful for single inits. |
|||
Fixed so word auto detect lists logic works better for faked lists that doesn't have specific markup. |
|||
Fixed so nodeChange gets fired on mouseup as it used to before 4.1.1 we optimized that event to fire less often. |
|||
Removed the finish menu item from spellchecker menu since it's redundant you can stop spellchecking by toggling menu item or button. |
|||
Version 4.1.2 (2014-07-15) |
|||
Added offset/grep to DomQuery class works basically the same as it's jQuery equivalent. |
|||
Fixed bug where backspace/delete or setContent with an empty string would remove header data when using the fullpage plugin. |
|||
Fixed bug where tinymce.remove with a selector not matching any editors would remove all editors. |
|||
Fixed bug where resizing of the editor didn't work since the theme was calling setStyles instead of setStyle. |
|||
Fixed bug where IE 7 would fail to append html fragments to iframe document when using DomQuery. |
|||
Fixed bug where the getStyle DOMUtils method would produce an exception if it was called with null as it's element. |
|||
Fixed bug where the paste plugin would remove the element if the none of the paste_webkit_styles rules matched the current style. |
|||
Fixed bug where contextmenu table items wouldn't work properly on IE since it would some times fire an incorrect selection change. |
|||
Fixed bug where the padding/border values wasn't used in the size calculation for the body size when using autoresize. Patch contributed by Matt Whelan. |
|||
Fixed bug where conditional word comments wouldn't be properly removed when pasting plain text. |
|||
Fixed bug where resizing would sometime fail on IE 11 when the mouseup occurred inside the resizable element. |
|||
Fixed so the iframe gets initialized without any inline event handlers for better CSP support. Patch contributed by Matt Whelan. |
|||
Fixed so the tinymce.dom.Sizzle is the latest version of sizzle this resolves the document context bug. |
|||
Version 4.1.1 (2014-07-08) |
|||
Fixed bug where pasting plain text on some WebKit versions would result in an empty line. |
|||
Fixed bug where resizing images inside tables on IE 11 wouldn't work properly. |
|||
Fixed bug where IE 11 would sometimes throw "Invalid argument" exception when editor contents was set to an empty string. |
|||
Fixed bug where document.activeElement would throw exceptions on IE 9 when that element was hidden or removed from dom. |
|||
Fixed bug where WebKit/Blink sometimes produced br elements with the Apple-interchange-newline class. |
|||
Fixed bug where table cell selection wasn't properly removed when copy/pasting table cells. |
|||
Fixed bug where pasting nested list items from Word wouldn't produce proper semantic nested lists. |
|||
Fixed bug where right clicking using the contextmenu plugin on WebKit/Blink on Mac OS X would select the target current word or line. |
|||
Fixed bug where it wasn't possible to alter table cell properties on IE 8 using the context menu. |
|||
Fixed bug where the resize helper wouldn't be correctly positioned on older IE versions. |
|||
Fixed bug where fullpage plugin would produce an error if you didn't specify a doctype encoding. |
|||
Fixed bug where anchor plugin would get the name/id of the current element even if it wasn't anchor element. |
|||
Fixed bug where visual aids for tables wouldn't be properly disabled when changing the border size. |
|||
Fixed bug where some control selection events wasn't properly fired on older IE versions. |
|||
Fixed bug where table cell selection on older IE versions would prevent resizing of images. |
|||
Fixed bug with paste_data_images paste option not working properly on modern IE versions. |
|||
Fixed bug where custom elements with underscores in the name wasn't properly parsed/serialized. |
|||
Fixed bug where applying inline formats to nested list elements would produce an incorrect formatting result. |
|||
Fixed so it's possible to hide items from elements path by using preventDefault/stopPropagation. |
|||
Fixed so inline mode toolbar gets rendered right aligned if the editable element positioned to the documents right edge. |
|||
Fixed so empty inline elements inside empty block elements doesn't get removed if configured to be kept intact. |
|||
Fixed so DomQuery parentsUntil/prevUntil/nextUntil supports selectors/elements/filters etc. |
|||
Fixed so legacyoutput plugin overrides fontselect and fontsizeselect controls and handles font elements properly. |
|||
Version 4.1.0 (2014-06-18) |
|||
Added new file_picker_callback option to replace the old file_browser_callback the latter will still work though. |
|||
Added new custom colors to textcolor plugin will be displayed if a color picker is provided also shows the latest colors. |
|||
Added new color_picker_callback option to enable you to add custom color pickers to the editor. |
|||
Added new advanced tabs to table/cell/row dialogs to enable you to select colors for border/background. |
|||
Added new colorpicker plugin that lets you select colors from a hsv color picker. |
|||
Added new tinymce.util.Color class to handle color parsing and converting. |
|||
Added new colorpicker UI widget element lets you add a hsv color picker to any form/window. |
|||
Added new textpattern plugin that allows you to use markdown like text patterns to format contents. |
|||
Added new resize helper element that shows the current width & height while resizing. |
|||
Added new "once" method to Editor and EventDispatcher enables since callback execution events. |
|||
Added new jQuery like class under tinymce.dom.DomQuery it's exposed on editor instances (editor.$) and globally under (tinymce.$). |
|||
Fixed so the default resize method for images are proportional shift/ctrl can be used to make an unproportional size. |
|||
Fixed bug where the image_dimensions option of the image plugin would cause exceptions when it tried to update the size. |
|||
Fixed bug where table cell dialog class field wasn't properly updated when editing an a table cell with an existing class. |
|||
Fixed bug where Safari on Mac would produce webkit-fake-url for pasted images so these are now removed. |
|||
Fixed bug where the nodeChange event would get fired before the selection was changed when clicking inside the current selection range. |
|||
Fixed bug where valid_classes option would cause exception when it removed internal prefixed classes like mce-item-. |
|||
Fixed bug where backspace would cause navigation in IE 8 on an inline element and after a caret formatting was applied. |
|||
Fixed so placeholder images produced by the media plugin gets selected when inserted/edited. |
|||
Fixed so it's possible to drag in images when the paste_data_images option is enabled. Might be useful for mail clients. |
|||
Fixed so images doesn't get a width/height applied if the image_dimensions option is set to false useful for responsive contents. |
|||
Fixed so it's possible to pass in an optional arguments object for the nodeChanged function to be passed to all nodechange event listeners. |
|||
Fixed bug where media plugin embed code didn't update correctly. |
@ -0,0 +1,42 @@ |
|||
{ |
|||
"name": "tinymce/tinymce", |
|||
"version": "4.7.6", |
|||
"description": "Web based JavaScript HTML WYSIWYG editor control.", |
|||
"license": [ |
|||
"LGPL-2.1" |
|||
], |
|||
"keywords": [ |
|||
"editor", |
|||
"wysiwyg", |
|||
"tinymce", |
|||
"richtext", |
|||
"javascript", |
|||
"html" |
|||
], |
|||
"homepage": "http://www.tinymce.com", |
|||
"type": "component", |
|||
"extra": { |
|||
"component": { |
|||
"scripts": [ |
|||
"tinymce.js", |
|||
"plugins/*/plugin.js", |
|||
"themes/*/theme.js" |
|||
], |
|||
"files": [ |
|||
"tinymce.min.js", |
|||
"plugins/*/plugin.min.js", |
|||
"themes/*/theme.min.js", |
|||
"skins/**" |
|||
] |
|||
} |
|||
}, |
|||
"archive": { |
|||
"exclude": [ |
|||
"readme.md", |
|||
"bower.js", |
|||
"package.json", |
|||
".npmignore", |
|||
"changelog.txt" |
|||
] |
|||
} |
|||
} |
@ -0,0 +1 @@ |
|||
!function(){var e,t,n,i,r,a=[];r="undefined"!=typeof global?global:window;var c=function(){return r.tinymce};(i=r.jQuery).fn.tinymce=function(e){var l,u,s,f=this,p="";if(!f.length)return f;if(!e)return c()?c().get(f[0].id):null;f.css("visibility","hidden");var d=function(){var t=[],r=0;n||(o(),n=!0),f.each(function(n,i){var a,o=i.id,l=e.oninit;o||(i.id=o=c().DOM.uniqueId()),c().get(o)||(a=c().createEditor(o,e),t.push(a),a.on("init",function(){var e,n=l;f.css("visibility",""),l&&++r==t.length&&("string"==typeof n&&(e=-1===n.indexOf(".")?null:c().resolve(n.replace(/\.\w+$/,"")),n=c().resolve(n)),n.apply(e||c(),t))}))}),i.each(t,function(e,t){t.render()})};if(r.tinymce||t||!(l=e.script_url))1===t?a.push(d):d();else{t=1,u=l.substring(0,l.lastIndexOf("/")),-1!=l.indexOf(".min")&&(p=".min"),r.tinymce=r.tinyMCEPreInit||{base:u,suffix:p},-1!=l.indexOf("gzip")&&(s=e.language||"en",l=l+(/\?/.test(l)?"&":"?")+"js=true&core=true&suffix="+escape(p)+"&themes="+escape(e.theme||"modern")+"&plugins="+escape(e.plugins||"")+"&languages="+(s||""),r.tinyMCE_GZ||(r.tinyMCE_GZ={start:function(){var t=function(e){c().ScriptLoader.markDone(c().baseURI.toAbsolute(e))};t("langs/"+s+".js"),t("themes/"+e.theme+"/theme"+p+".js"),t("themes/"+e.theme+"/langs/"+s+".js"),i.each(e.plugins.split(","),function(e,n){n&&(t("plugins/"+n+"/plugin"+p+".js"),t("plugins/"+n+"/langs/"+s+".js"))})},end:function(){}}));var v=document.createElement("script");v.type="text/javascript",v.onload=v.onreadystatechange=function(n){n=n||window.event,2===t||"load"!=n.type&&!/complete|loaded/.test(v.readyState)||(c().dom.Event.domLoaded=1,t=2,e.script_loaded&&e.script_loaded(),d(),i.each(a,function(e,t){t()}))},v.src=l,document.body.appendChild(v)}return f},i.extend(i.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in r&&(t=c().get(e.id))&&t.editorManager===c())}});var o=function(){var t=function(e){"remove"===e&&this.each(function(e,t){var n=a(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=c().get(t.id.replace(/_parent$/,""));n&&n.remove()})},n=function(e){var n,i=this;if(null!=e)t.call(i),i.each(function(t,n){var i;(i=c().get(n.id))&&i.setContent(e)});else if(i.length>0&&(n=c().get(i[0].id)))return n.getContent()},a=function(e){var t=null;return e&&e.id&&r.tinymce&&(t=c().get(e.id)),t},o=function(e){return!!(e&&e.length&&r.tinymce&&e.is(":tinymce"))},l={};i.each(["text","html","val"],function(t,r){var c=l[r]=i.fn[r],u="text"===r;i.fn[r]=function(t){var r=this;if(!o(r))return c.apply(r,arguments);if(t!==e)return n.call(r.filter(":tinymce"),t),c.apply(r.not(":tinymce"),arguments),r;var l="",s=arguments;return(u?r:r.eq(0)).each(function(e,t){var n=a(t);l+=n?u?n.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):n.getContent({save:!0}):c.apply(i(t),s)}),l}}),i.each(["append","prepend"],function(t,n){var r=l[n]=i.fn[n],c="prepend"===n;i.fn[n]=function(t){var n=this;return o(n)?t!==e?("string"==typeof t&&n.filter(":tinymce").each(function(e,n){var i=a(n);i&&i.setContent(c?t+i.getContent():i.getContent()+t)}),r.apply(n.not(":tinymce"),arguments),n):void 0:r.apply(n,arguments)}}),i.each(["remove","replaceWith","replaceAll","empty"],function(e,n){var r=l[n]=i.fn[n];i.fn[n]=function(){return t.call(this,n),r.apply(this,arguments)}}),l.attr=i.fn.attr,i.fn.attr=function(t,r){var c=this,u=arguments;if(!t||"value"!==t||!o(c))return l.attr.apply(c,u);if(r!==e)return n.call(c.filter(":tinymce"),r),l.attr.apply(c.not(":tinymce"),u),c;var s=c[0],f=a(s);return f?f.getContent({save:!0}):l.attr.apply(i(s),u)}}}(); |
@ -0,0 +1 @@ |
|||
!function(){var e,t,n,i,r,a=[];r="undefined"!=typeof global?global:window;var c=function(){return r.tinymce};(i=r.jQuery).fn.tinymce=function(e){var l,u,s,f=this,p="";if(!f.length)return f;if(!e)return c()?c().get(f[0].id):null;f.css("visibility","hidden");var d=function(){var t=[],r=0;n||(o(),n=!0),f.each(function(n,i){var a,o=i.id,l=e.oninit;o||(i.id=o=c().DOM.uniqueId()),c().get(o)||(a=c().createEditor(o,e),t.push(a),a.on("init",function(){var e,n=l;f.css("visibility",""),l&&++r==t.length&&("string"==typeof n&&(e=-1===n.indexOf(".")?null:c().resolve(n.replace(/\.\w+$/,"")),n=c().resolve(n)),n.apply(e||c(),t))}))}),i.each(t,function(e,t){t.render()})};if(r.tinymce||t||!(l=e.script_url))1===t?a.push(d):d();else{t=1,u=l.substring(0,l.lastIndexOf("/")),-1!=l.indexOf(".min")&&(p=".min"),r.tinymce=r.tinyMCEPreInit||{base:u,suffix:p},-1!=l.indexOf("gzip")&&(s=e.language||"en",l=l+(/\?/.test(l)?"&":"?")+"js=true&core=true&suffix="+escape(p)+"&themes="+escape(e.theme||"modern")+"&plugins="+escape(e.plugins||"")+"&languages="+(s||""),r.tinyMCE_GZ||(r.tinyMCE_GZ={start:function(){var t=function(e){c().ScriptLoader.markDone(c().baseURI.toAbsolute(e))};t("langs/"+s+".js"),t("themes/"+e.theme+"/theme"+p+".js"),t("themes/"+e.theme+"/langs/"+s+".js"),i.each(e.plugins.split(","),function(e,n){n&&(t("plugins/"+n+"/plugin"+p+".js"),t("plugins/"+n+"/langs/"+s+".js"))})},end:function(){}}));var v=document.createElement("script");v.type="text/javascript",v.onload=v.onreadystatechange=function(n){n=n||window.event,2===t||"load"!=n.type&&!/complete|loaded/.test(v.readyState)||(c().dom.Event.domLoaded=1,t=2,e.script_loaded&&e.script_loaded(),d(),i.each(a,function(e,t){t()}))},v.src=l,document.body.appendChild(v)}return f},i.extend(i.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in r&&(t=c().get(e.id))&&t.editorManager===c())}});var o=function(){var t=function(e){"remove"===e&&this.each(function(e,t){var n=a(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=c().get(t.id.replace(/_parent$/,""));n&&n.remove()})},n=function(e){var n,i=this;if(null!=e)t.call(i),i.each(function(t,n){var i;(i=c().get(n.id))&&i.setContent(e)});else if(i.length>0&&(n=c().get(i[0].id)))return n.getContent()},a=function(e){var t=null;return e&&e.id&&r.tinymce&&(t=c().get(e.id)),t},o=function(e){return!!(e&&e.length&&r.tinymce&&e.is(":tinymce"))},l={};i.each(["text","html","val"],function(t,r){var c=l[r]=i.fn[r],u="text"===r;i.fn[r]=function(t){var r=this;if(!o(r))return c.apply(r,arguments);if(t!==e)return n.call(r.filter(":tinymce"),t),c.apply(r.not(":tinymce"),arguments),r;var l="",s=arguments;return(u?r:r.eq(0)).each(function(e,t){var n=a(t);l+=n?u?n.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):n.getContent({save:!0}):c.apply(i(t),s)}),l}}),i.each(["append","prepend"],function(t,n){var r=l[n]=i.fn[n],c="prepend"===n;i.fn[n]=function(t){var n=this;return o(n)?t!==e?("string"==typeof t&&n.filter(":tinymce").each(function(e,n){var i=a(n);i&&i.setContent(c?t+i.getContent():i.getContent()+t)}),r.apply(n.not(":tinymce"),arguments),n):void 0:r.apply(n,arguments)}}),i.each(["remove","replaceWith","replaceAll","empty"],function(e,n){var r=l[n]=i.fn[n];i.fn[n]=function(){return t.call(this,n),r.apply(this,arguments)}}),l.attr=i.fn.attr,i.fn.attr=function(t,r){var c=this,u=arguments;if(!t||"value"!==t||!o(c))return l.attr.apply(c,u);if(r!==e)return n.call(c.filter(":tinymce"),r),l.attr.apply(c.not(":tinymce"),u),c;var s=c[0],f=a(s);return f?f.getContent({save:!0}):l.attr.apply(i(s),u)}}}(); |
@ -0,0 +1,260 @@ |
|||
tinymce.addI18n('it',{ |
|||
"Redo": "Ripeti", |
|||
"Undo": "Indietro", |
|||
"Cut": "Taglia", |
|||
"Copy": "Copia", |
|||
"Paste": "Incolla", |
|||
"Select all": "Seleziona Tutto", |
|||
"New document": "Nuovo Documento", |
|||
"Ok": "Ok", |
|||
"Cancel": "Annulla", |
|||
"Visual aids": "Elementi Visivi", |
|||
"Bold": "Grassetto", |
|||
"Italic": "Corsivo", |
|||
"Underline": "Sottolineato", |
|||
"Strikethrough": "Barrato", |
|||
"Superscript": "Apice", |
|||
"Subscript": "Pedice", |
|||
"Clear formatting": "Cancella Formattazione", |
|||
"Align left": "Allinea a Sinistra", |
|||
"Align center": "Allinea al Cento", |
|||
"Align right": "Allinea a Destra", |
|||
"Justify": "Giustifica", |
|||
"Bullet list": "Elenchi Puntati", |
|||
"Numbered list": "Elenchi Numerati", |
|||
"Decrease indent": "Riduci Rientro", |
|||
"Increase indent": "Aumenta Rientro", |
|||
"Close": "Chiudi", |
|||
"Formats": "Formattazioni", |
|||
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Il tuo browser non supporta l'accesso diretto negli Appunti. Per favore usa i tasti di scelta rapida Ctrl+X\/C\/V.", |
|||
"Headers": "Intestazioni", |
|||
"Header 1": "Intestazione 1", |
|||
"Header 2": "Header 2", |
|||
"Header 3": "Intestazione 3", |
|||
"Header 4": "Intestazione 4", |
|||
"Header 5": "Intestazione 5", |
|||
"Header 6": "Intestazione 6", |
|||
"Headings": "Intestazioni", |
|||
"Heading 1": "Intestazione 1", |
|||
"Heading 2": "Intestazione 2", |
|||
"Heading 3": "Intestazione 3", |
|||
"Heading 4": "Intestazione 4", |
|||
"Heading 5": "Intestazione 5", |
|||
"Heading 6": "Intestazione 6", |
|||
"Div": "Div", |
|||
"Pre": "Pre", |
|||
"Code": "Codice", |
|||
"Paragraph": "Paragrafo", |
|||
"Blockquote": "Blockquote", |
|||
"Inline": "Inlinea", |
|||
"Blocks": "Blocchi", |
|||
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Incolla \u00e8 in modalit\u00e0 testo normale. I contenuti sono incollati come testo normale se non disattivi l'opzione.", |
|||
"Font Family": "Famiglia font", |
|||
"Font Sizes": "Dimensioni font", |
|||
"Class": "Classe", |
|||
"Browse for an image": "Scegli un'immagine", |
|||
"OR": "o", |
|||
"Drop an image here": "Incolla un'immagine qui", |
|||
"Upload": "Carica", |
|||
"Block": "Blocco", |
|||
"Align": "Allinea", |
|||
"Default": "Default", |
|||
"Circle": "Cerchio", |
|||
"Disc": "Disco", |
|||
"Square": "Quadrato", |
|||
"Lower Alpha": "Alpha Minore", |
|||
"Lower Greek": "Greek Minore", |
|||
"Lower Roman": "Roman Minore", |
|||
"Upper Alpha": "Alpha Superiore", |
|||
"Upper Roman": "Roman Superiore", |
|||
"Anchor": "Fissa", |
|||
"Name": "Nome", |
|||
"Id": "Id", |
|||
"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "L'id dovrebbe cominciare con una lettera, seguito solo da lettere, numeri, linee, punti, virgole.", |
|||
"You have unsaved changes are you sure you want to navigate away?": "Non hai salvato delle modifiche, sei sicuro di andartene?", |
|||
"Restore last draft": "Ripristina l'ultima bozza.", |
|||
"Special character": "Carattere Speciale", |
|||
"Source code": "Codice Sorgente", |
|||
"Insert\/Edit code sample": "Inserisci\/Modifica esempio di codice", |
|||
"Language": "Lingua", |
|||
"Code sample": "Esempio di codice", |
|||
"Color": "Colore", |
|||
"R": "R", |
|||
"G": "G", |
|||
"B": "B", |
|||
"Left to right": "Da Sinistra a Destra", |
|||
"Right to left": "Da Destra a Sinistra", |
|||
"Emoticons": "Emoction", |
|||
"Document properties": "Propriet\u00e0 Documento", |
|||
"Title": "Titolo", |
|||
"Keywords": "Parola Chiave", |
|||
"Description": "Descrizione", |
|||
"Robots": "Robot", |
|||
"Author": "Autore", |
|||
"Encoding": "Codifica", |
|||
"Fullscreen": "Schermo Intero", |
|||
"Action": "Action", |
|||
"Shortcut": "Shortcut", |
|||
"Help": "Help", |
|||
"Address": "Address", |
|||
"Focus to menubar": "Focus to menubar", |
|||
"Focus to toolbar": "Focus to toolbar", |
|||
"Focus to element path": "Focus to element path", |
|||
"Focus to contextual toolbar": "Focus to contextual toolbar", |
|||
"Insert link (if link plugin activated)": "Insert link (if link plugin activated)", |
|||
"Save (if save plugin activated)": "Save (if save plugin activated)", |
|||
"Find (if searchreplace plugin activated)": "Find (if searchreplace plugin activated)", |
|||
"Plugins installed ({0}):": "Plugins installed ({0}):", |
|||
"Premium plugins:": "Premium plugins:", |
|||
"Learn more...": "Learn more...", |
|||
"You are using {0}": "You are using {0}", |
|||
"Plugins": "Plugins", |
|||
"Handy Shortcuts": "Handy Shortcuts", |
|||
"Horizontal line": "Linea Orizzontale", |
|||
"Insert\/edit image": "Aggiungi\/Modifica Immagine", |
|||
"Image description": "Descrizione Immagine", |
|||
"Source": "Fonte", |
|||
"Dimensions": "Dimenzioni", |
|||
"Constrain proportions": "Mantieni Proporzioni", |
|||
"General": "Generale", |
|||
"Advanced": "Avanzato", |
|||
"Style": "Stile", |
|||
"Vertical space": "Spazio Verticale", |
|||
"Horizontal space": "Spazio Orizzontale", |
|||
"Border": "Bordo", |
|||
"Insert image": "Inserisci immagine", |
|||
"Image": "Immagine", |
|||
"Image list": "Image list", |
|||
"Rotate counterclockwise": "Ruota in senso antiorario", |
|||
"Rotate clockwise": "Ruota in senso orario", |
|||
"Flip vertically": "Rifletti verticalmente", |
|||
"Flip horizontally": "Rifletti orizzontalmente", |
|||
"Edit image": "Modifica immagine", |
|||
"Image options": "Opzioni immagine", |
|||
"Zoom in": "Ingrandisci", |
|||
"Zoom out": "Rimpicciolisci", |
|||
"Crop": "Taglia", |
|||
"Resize": "Ridimensiona", |
|||
"Orientation": "Orientamento", |
|||
"Brightness": "Luminosit\u00e0", |
|||
"Sharpen": "Contrasta", |
|||
"Contrast": "Contrasto", |
|||
"Color levels": "Livelli colore", |
|||
"Gamma": "Gamma", |
|||
"Invert": "Inverti", |
|||
"Apply": "Applica", |
|||
"Back": "Indietro", |
|||
"Insert date\/time": "Inserisci Data\/Ora", |
|||
"Date\/time": "Data\/Ora", |
|||
"Insert link": "Inserisci il Link", |
|||
"Insert\/edit link": "Inserisci\/Modifica Link", |
|||
"Text to display": "Testo da Visualizzare", |
|||
"Url": "Url", |
|||
"Target": "Target", |
|||
"None": "No", |
|||
"New window": "Nuova Finestra", |
|||
"Remove link": "Rimuovi link", |
|||
"Anchors": "Anchors", |
|||
"Link": "Collegamento", |
|||
"Paste or type a link": "Incolla o digita un collegamento", |
|||
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "L'URL inserito sembra essere un indirizzo email. Vuoi aggiungere il prefisso necessario mailto:?", |
|||
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "L'URL inserito sembra essere un collegamento esterno. Vuoi aggiungere il prefisso necessario http:\/\/?", |
|||
"Link list": "Elenco link", |
|||
"Insert video": "Inserisci Video", |
|||
"Insert\/edit video": "Inserisci\/Modifica Video", |
|||
"Insert\/edit media": "Inserisci\/Modifica Media", |
|||
"Alternative source": "Alternativo", |
|||
"Poster": "Anteprima", |
|||
"Paste your embed code below:": "Incolla il codice d'incorporamento qui:", |
|||
"Embed": "Incorporare", |
|||
"Media": "Media", |
|||
"Nonbreaking space": "Spazio unificatore", |
|||
"Page break": "Interruzione di pagina", |
|||
"Paste as text": "incolla come testo", |
|||
"Preview": "Anteprima", |
|||
"Print": "Stampa", |
|||
"Save": "Salva", |
|||
"Find": "Trova", |
|||
"Replace with": "Sostituisci Con", |
|||
"Replace": "Sostituisci", |
|||
"Replace all": "Sostituisci Tutto", |
|||
"Prev": "Precedente", |
|||
"Next": "Successivo", |
|||
"Find and replace": "Trova e Sostituisci", |
|||
"Could not find the specified string.": "Impossibile trovare la parola specifica.", |
|||
"Match case": "Maiuscole\/Minuscole ", |
|||
"Whole words": "Parole Sbagliate", |
|||
"Spellcheck": "Controllo ortografico", |
|||
"Ignore": "Ignora", |
|||
"Ignore all": "Ignora Tutto", |
|||
"Finish": "Termina", |
|||
"Add to Dictionary": "Aggiungi al Dizionario", |
|||
"Insert table": "Inserisci Tabella", |
|||
"Table properties": "Propiet\u00e0 della Tabella", |
|||
"Delete table": "Cancella Tabella", |
|||
"Cell": "Cella", |
|||
"Row": "Riga", |
|||
"Column": "Colonna", |
|||
"Cell properties": "Propiet\u00e0 della Cella", |
|||
"Merge cells": "Unisci Cella", |
|||
"Split cell": "Dividi Cella", |
|||
"Insert row before": "Inserisci una Riga Prima", |
|||
"Insert row after": "Inserisci una Riga Dopo", |
|||
"Delete row": "Cancella Riga", |
|||
"Row properties": "Propriet\u00e0 della Riga", |
|||
"Cut row": "Taglia Riga", |
|||
"Copy row": "Copia Riga", |
|||
"Paste row before": "Incolla una Riga Prima", |
|||
"Paste row after": "Incolla una Riga Dopo", |
|||
"Insert column before": "Inserisci una Colonna Prima", |
|||
"Insert column after": "Inserisci una Colonna Dopo", |
|||
"Delete column": "Cancella Colonna", |
|||
"Cols": "Colonne", |
|||
"Rows": "Righe", |
|||
"Width": "Larghezza", |
|||
"Height": "Altezza", |
|||
"Cell spacing": "Spaziatura della Cella", |
|||
"Cell padding": "Padding della Cella", |
|||
"Caption": "Didascalia", |
|||
"Left": "Sinistra", |
|||
"Center": "Centro", |
|||
"Right": "Destra", |
|||
"Cell type": "Tipo di Cella", |
|||
"Scope": "Campo", |
|||
"Alignment": "Allineamento", |
|||
"H Align": "Allineamento H", |
|||
"V Align": "Allineamento V", |
|||
"Top": "In alto", |
|||
"Middle": "In mezzo", |
|||
"Bottom": "In fondo", |
|||
"Header cell": "cella d'intestazione", |
|||
"Row group": "Gruppo di Righe", |
|||
"Column group": "Gruppo di Colonne", |
|||
"Row type": "Tipo di Riga", |
|||
"Header": "Header", |
|||
"Body": "Body", |
|||
"Footer": "Footer", |
|||
"Border color": "Colore bordo", |
|||
"Insert template": "Inserisci Template", |
|||
"Templates": "Template", |
|||
"Template": "Modello", |
|||
"Text color": "Colore Testo", |
|||
"Background color": "Colore Background", |
|||
"Custom...": "Personalizzato...", |
|||
"Custom color": "Colore personalizzato", |
|||
"No color": "Nessun colore", |
|||
"Table of Contents": "Tabella dei contenuti", |
|||
"Show blocks": "Mostra Blocchi", |
|||
"Show invisible characters": "Mostra Caratteri Invisibili", |
|||
"Words: {0}": "Parole: {0}", |
|||
"{0} words": "{0} parole", |
|||
"File": "File", |
|||
"Edit": "Modifica", |
|||
"Insert": "Inserisci", |
|||
"View": "Visualiza", |
|||
"Format": "Formato", |
|||
"Table": "Tabella", |
|||
"Tools": "Strumenti", |
|||
"Powered by {0}": "Powered by {0}", |
|||
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Rich Text Area. Premi ALT-F9 per il men\u00f9. Premi ALT-F10 per la barra degli strumenti. Premi ALT-0 per l'aiuto." |
|||
}); |
@ -0,0 +1,504 @@ |
|||
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. |
|||
|
|||
<one line to give the library's name and a brief idea of what it does.> |
|||
Copyright (C) <year> <name of author> |
|||
|
|||
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. |
|||
|
|||
<signature of Ty Coon>, 1 April 1990 |
|||
Ty Coon, President of Vice |
|||
|
|||
That's all there is to it! |
|||
|
|||
|
@ -0,0 +1,47 @@ |
|||
{ |
|||
"_from": "tinymce", |
|||
"_id": "tinymce@4.7.6", |
|||
"_inBundle": false, |
|||
"_integrity": "sha512-mdbeMvCOO0ws0HXiZO9L8mDGFA9/VmDHltlt+/9qV0Fl1EWKWoPIRURHFtiFYuLKo9yjYUvYucwiZ1XfCT/91Q==", |
|||
"_location": "/tinymce", |
|||
"_phantomChildren": {}, |
|||
"_requested": { |
|||
"type": "tag", |
|||
"registry": true, |
|||
"raw": "tinymce", |
|||
"name": "tinymce", |
|||
"escapedName": "tinymce", |
|||
"rawSpec": "", |
|||
"saveSpec": null, |
|||
"fetchSpec": "latest" |
|||
}, |
|||
"_requiredBy": [ |
|||
"#USER", |
|||
"/" |
|||
], |
|||
"_resolved": "https://registry.npmjs.org/tinymce/-/tinymce-4.7.6.tgz", |
|||
"_shasum": "6c70931d3308a8ff4ba20e5ee82379b46714eb5c", |
|||
"_spec": "tinymce", |
|||
"_where": "/var/www/htdocs/ordine", |
|||
"author": { |
|||
"name": "Ephox Corporation" |
|||
}, |
|||
"bugs": { |
|||
"url": "https://github.com/tinymce/tinymce/issues" |
|||
}, |
|||
"bundleDependencies": false, |
|||
"deprecated": false, |
|||
"description": "Web based JavaScript HTML WYSIWYG editor control.", |
|||
"keywords": [ |
|||
"editor", |
|||
"wysiwyg", |
|||
"tinymce", |
|||
"richtext", |
|||
"javascript", |
|||
"html" |
|||
], |
|||
"license": "LGPL-2.1", |
|||
"main": "tinymce.js", |
|||
"name": "tinymce", |
|||
"version": "4.7.6" |
|||
} |
@ -0,0 +1,7 @@ |
|||
// Exports the "advlist" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/advlist')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/advlist'
|
|||
require('./plugin.js'); |
@ -0,0 +1,160 @@ |
|||
(function () { |
|||
var advlist = (function () { |
|||
'use strict'; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools'); |
|||
|
|||
var applyListFormat = function (editor, listName, styleValue) { |
|||
var cmd = listName === 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList'; |
|||
editor.execCommand(cmd, false, styleValue === false ? null : { 'list-style-type': styleValue }); |
|||
}; |
|||
var $_2ukoh57fjd09evh2 = { applyListFormat: applyListFormat }; |
|||
|
|||
var register = function (editor) { |
|||
editor.addCommand('ApplyUnorderedListStyle', function (ui, value) { |
|||
$_2ukoh57fjd09evh2.applyListFormat(editor, 'UL', value['list-style-type']); |
|||
}); |
|||
editor.addCommand('ApplyOrderedListStyle', function (ui, value) { |
|||
$_2ukoh57fjd09evh2.applyListFormat(editor, 'OL', value['list-style-type']); |
|||
}); |
|||
}; |
|||
var $_8u1klp7ejd09evh1 = { register: register }; |
|||
|
|||
var getNumberStyles = function (editor) { |
|||
var styles = editor.getParam('advlist_number_styles', 'default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman'); |
|||
return styles ? styles.split(/[ ,]/) : []; |
|||
}; |
|||
var getBulletStyles = function (editor) { |
|||
var styles = editor.getParam('advlist_bullet_styles', 'default,circle,disc,square'); |
|||
return styles ? styles.split(/[ ,]/) : []; |
|||
}; |
|||
var $_b1sklw7hjd09evh7 = { |
|||
getNumberStyles: getNumberStyles, |
|||
getBulletStyles: getBulletStyles |
|||
}; |
|||
|
|||
var isChildOfBody = function (editor, elm) { |
|||
return editor.$.contains(editor.getBody(), elm); |
|||
}; |
|||
var isTableCellNode = function (node) { |
|||
return node && /^(TH|TD)$/.test(node.nodeName); |
|||
}; |
|||
var isListNode = function (editor) { |
|||
return function (node) { |
|||
return node && /^(OL|UL|DL)$/.test(node.nodeName) && isChildOfBody(editor, node); |
|||
}; |
|||
}; |
|||
var getSelectedStyleType = function (editor) { |
|||
var listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul'); |
|||
return editor.dom.getStyle(listElm, 'listStyleType') || ''; |
|||
}; |
|||
var $_2pd0fc7ijd09evh8 = { |
|||
isTableCellNode: isTableCellNode, |
|||
isListNode: isListNode, |
|||
getSelectedStyleType: getSelectedStyleType |
|||
}; |
|||
|
|||
var styleValueToText = function (styleValue) { |
|||
return styleValue.replace(/\-/g, ' ').replace(/\b\w/g, function (chr) { |
|||
return chr.toUpperCase(); |
|||
}); |
|||
}; |
|||
var toMenuItems = function (styles) { |
|||
return Tools.map(styles, function (styleValue) { |
|||
var text = styleValueToText(styleValue); |
|||
var data = styleValue === 'default' ? '' : styleValue; |
|||
return { |
|||
text: text, |
|||
data: data |
|||
}; |
|||
}); |
|||
}; |
|||
var $_9kcql57jjd09evh9 = { toMenuItems: toMenuItems }; |
|||
|
|||
var findIndex = function (list, predicate) { |
|||
for (var index = 0; index < list.length; index++) { |
|||
var element = list[index]; |
|||
if (predicate(element)) { |
|||
return index; |
|||
} |
|||
} |
|||
return -1; |
|||
}; |
|||
var listState = function (editor, listName) { |
|||
return function (e) { |
|||
var ctrl = e.control; |
|||
editor.on('NodeChange', function (e) { |
|||
var tableCellIndex = findIndex(e.parents, $_2pd0fc7ijd09evh8.isTableCellNode); |
|||
var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents; |
|||
var lists = Tools.grep(parents, $_2pd0fc7ijd09evh8.isListNode(editor)); |
|||
ctrl.active(lists.length > 0 && lists[0].nodeName === listName); |
|||
}); |
|||
}; |
|||
}; |
|||
var updateSelection = function (editor) { |
|||
return function (e) { |
|||
var listStyleType = $_2pd0fc7ijd09evh8.getSelectedStyleType(editor); |
|||
e.control.items().each(function (ctrl) { |
|||
ctrl.active(ctrl.settings.data === listStyleType); |
|||
}); |
|||
}; |
|||
}; |
|||
var addSplitButton = function (editor, id, tooltip, cmd, nodeName, styles) { |
|||
editor.addButton(id, { |
|||
active: false, |
|||
type: 'splitbutton', |
|||
tooltip: tooltip, |
|||
menu: $_9kcql57jjd09evh9.toMenuItems(styles), |
|||
onPostRender: listState(editor, nodeName), |
|||
onshow: updateSelection(editor), |
|||
onselect: function (e) { |
|||
$_2ukoh57fjd09evh2.applyListFormat(editor, nodeName, e.control.settings.data); |
|||
}, |
|||
onclick: function () { |
|||
editor.execCommand(cmd); |
|||
} |
|||
}); |
|||
}; |
|||
var addButton = function (editor, id, tooltip, cmd, nodeName, styles) { |
|||
editor.addButton(id, { |
|||
active: false, |
|||
type: 'button', |
|||
tooltip: tooltip, |
|||
onPostRender: listState(editor, nodeName), |
|||
onclick: function () { |
|||
editor.execCommand(cmd); |
|||
} |
|||
}); |
|||
}; |
|||
var addControl = function (editor, id, tooltip, cmd, nodeName, styles) { |
|||
if (styles.length > 0) { |
|||
addSplitButton(editor, id, tooltip, cmd, nodeName, styles); |
|||
} else { |
|||
addButton(editor, id, tooltip, cmd, nodeName, styles); |
|||
} |
|||
}; |
|||
var register$1 = function (editor) { |
|||
addControl(editor, 'numlist', 'Numbered list', 'InsertOrderedList', 'OL', $_b1sklw7hjd09evh7.getNumberStyles(editor)); |
|||
addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', 'UL', $_b1sklw7hjd09evh7.getBulletStyles(editor)); |
|||
}; |
|||
var $_5ivpfe7gjd09evh4 = { register: register$1 }; |
|||
|
|||
PluginManager.add('advlist', function (editor) { |
|||
var hasPlugin = function (editor, plugin) { |
|||
var plugins = editor.settings.plugins ? editor.settings.plugins : ''; |
|||
return Tools.inArray(plugins.split(/[ ,]/), plugin) !== -1; |
|||
}; |
|||
if (hasPlugin(editor, 'lists')) { |
|||
$_5ivpfe7gjd09evh4.register(editor); |
|||
$_8u1klp7ejd09evh1.register(editor); |
|||
} |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(t,e,n){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";t.execCommand(r,!1,!1===n?null:{"list-style-type":n})},r=function(t){t.addCommand("ApplyUnorderedListStyle",function(e,r){n(t,"UL",r["list-style-type"])}),t.addCommand("ApplyOrderedListStyle",function(e,r){n(t,"OL",r["list-style-type"])})},o=function(t){var e=t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return e?e.split(/[ ,]/):[]},i=function(t){var e=t.getParam("advlist_bullet_styles","default,circle,disc,square");return e?e.split(/[ ,]/):[]},l=function(t){return t&&/^(TH|TD)$/.test(t.nodeName)},a=function(t){return function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)&&(r=e,(n=t).$.contains(n.getBody(),r));var n,r}},s=function(t){var e=t.dom.getParent(t.selection.getNode(),"ol,ul");return t.dom.getStyle(e,"listStyleType")||""},u=function(t){return e.map(t,function(t){return{text:t.replace(/\-/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()}),data:"default"===t?"":t}})},c=function(t,n){return function(r){var o=r.control;t.on("NodeChange",function(r){var i=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1}(r.parents,l),s=-1!==i?r.parents.slice(0,i):r.parents,u=e.grep(s,a(t));o.active(u.length>0&&u[0].nodeName===n)})}},d=function(t,e,r,o,i,l){var a;t.addButton(e,{active:!1,type:"splitbutton",tooltip:r,menu:u(l),onPostRender:c(t,i),onshow:(a=t,function(t){var e=s(a);t.control.items().each(function(t){t.active(t.settings.data===e)})}),onselect:function(e){n(t,i,e.control.settings.data)},onclick:function(){t.execCommand(o)}})},p=function(t,e,n,r,o,i){var l,a,s,u,p;i.length>0?d(t,e,n,r,o,i):(a=e,s=n,u=r,p=o,(l=t).addButton(a,{active:!1,type:"button",tooltip:s,onPostRender:c(l,p),onclick:function(){l.execCommand(u)}}))},f=function(t){p(t,"numlist","Numbered list","InsertOrderedList","OL",o(t)),p(t,"bullist","Bullet list","InsertUnorderedList","UL",i(t))};t.add("advlist",function(t){var n,o,i;o="lists",i=(n=t).settings.plugins?n.settings.plugins:"",-1!==e.inArray(i.split(/[ ,]/),o)&&(f(t),r(t))})}(); |
@ -0,0 +1,7 @@ |
|||
// Exports the "anchor" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/anchor')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/anchor'
|
|||
require('./plugin.js'); |
@ -0,0 +1,117 @@ |
|||
(function () { |
|||
var anchor = (function () { |
|||
'use strict'; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var isValidId = function (id) { |
|||
return /^[A-Za-z][A-Za-z0-9\-:._]*$/.test(id); |
|||
}; |
|||
var getId = function (editor) { |
|||
var selectedNode = editor.selection.getNode(); |
|||
var isAnchor = selectedNode.tagName === 'A' && editor.dom.getAttrib(selectedNode, 'href') === ''; |
|||
return isAnchor ? selectedNode.id || selectedNode.name : ''; |
|||
}; |
|||
var insert = function (editor, id) { |
|||
var selectedNode = editor.selection.getNode(); |
|||
var isAnchor = selectedNode.tagName === 'A' && editor.dom.getAttrib(selectedNode, 'href') === ''; |
|||
if (isAnchor) { |
|||
selectedNode.removeAttribute('name'); |
|||
selectedNode.id = id; |
|||
} else { |
|||
editor.focus(); |
|||
editor.selection.collapse(true); |
|||
editor.execCommand('mceInsertContent', false, editor.dom.createHTML('a', { id: id })); |
|||
} |
|||
}; |
|||
var $_c1hrip7ojd09evi3 = { |
|||
isValidId: isValidId, |
|||
getId: getId, |
|||
insert: insert |
|||
}; |
|||
|
|||
var insertAnchor = function (editor, newId) { |
|||
if (!$_c1hrip7ojd09evi3.isValidId(newId)) { |
|||
editor.windowManager.alert('Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.'); |
|||
return true; |
|||
} else { |
|||
$_c1hrip7ojd09evi3.insert(editor, newId); |
|||
return false; |
|||
} |
|||
}; |
|||
var open = function (editor) { |
|||
var currentId = $_c1hrip7ojd09evi3.getId(editor); |
|||
editor.windowManager.open({ |
|||
title: 'Anchor', |
|||
body: { |
|||
type: 'textbox', |
|||
name: 'id', |
|||
size: 40, |
|||
label: 'Id', |
|||
value: currentId |
|||
}, |
|||
onsubmit: function (e) { |
|||
var newId = e.data.id; |
|||
if (insertAnchor(editor, newId)) { |
|||
e.preventDefault(); |
|||
} |
|||
} |
|||
}); |
|||
}; |
|||
var $_drw1km7njd09evi2 = { open: open }; |
|||
|
|||
var register = function (editor) { |
|||
editor.addCommand('mceAnchor', function () { |
|||
$_drw1km7njd09evi2.open(editor); |
|||
}); |
|||
}; |
|||
var $_5zyao7mjd09evi1 = { register: register }; |
|||
|
|||
var isAnchorNode = function (node) { |
|||
return !node.attr('href') && (node.attr('id') || node.attr('name')) && !node.firstChild; |
|||
}; |
|||
var setContentEditable = function (state) { |
|||
return function (nodes) { |
|||
for (var i = 0; i < nodes.length; i++) { |
|||
if (isAnchorNode(nodes[i])) { |
|||
nodes[i].attr('contenteditable', state); |
|||
} |
|||
} |
|||
}; |
|||
}; |
|||
var setup = function (editor) { |
|||
editor.on('PreInit', function () { |
|||
editor.parser.addNodeFilter('a', setContentEditable('false')); |
|||
editor.serializer.addNodeFilter('a', setContentEditable(null)); |
|||
}); |
|||
}; |
|||
var $_mx9k67pjd09evi5 = { setup: setup }; |
|||
|
|||
var register$1 = function (editor) { |
|||
editor.addButton('anchor', { |
|||
icon: 'anchor', |
|||
tooltip: 'Anchor', |
|||
cmd: 'mceAnchor', |
|||
stateSelector: 'a:not([href])' |
|||
}); |
|||
editor.addMenuItem('anchor', { |
|||
icon: 'anchor', |
|||
text: 'Anchor', |
|||
context: 'insert', |
|||
cmd: 'mceAnchor' |
|||
}); |
|||
}; |
|||
var $_581fcg7qjd09evi7 = { register: register$1 }; |
|||
|
|||
PluginManager.add('anchor', function (editor) { |
|||
$_mx9k67pjd09evi5.setup(editor); |
|||
$_5zyao7mjd09evi1.register(editor); |
|||
$_581fcg7qjd09evi7.register(editor); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var t=function(t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)},e=function(t){var e=t.selection.getNode();return"A"===e.tagName&&""===t.dom.getAttrib(e,"href")?e.id||e.name:""},n=function(t,e){var n=t.selection.getNode();"A"===n.tagName&&""===t.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=e):(t.focus(),t.selection.collapse(!0),t.execCommand("mceInsertContent",!1,t.dom.createHTML("a",{id:e})))},o=function(o){var r=e(o);o.windowManager.open({title:"Anchor",body:{type:"textbox",name:"id",size:40,label:"Id",value:r},onsubmit:function(e){var r,a,i=e.data.id;r=o,(t(a=i)?(n(r,a),0):(r.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))&&e.preventDefault()}})},r=function(t){t.addCommand("mceAnchor",function(){o(t)})},a=function(t){return function(e){for(var n=0;n<e.length;n++)(o=e[n]).attr("href")||!o.attr("id")&&!o.attr("name")||o.firstChild||e[n].attr("contenteditable",t);var o}},i=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("a",a("false")),t.serializer.addNodeFilter("a",a(null))})},c=function(t){t.addButton("anchor",{icon:"anchor",tooltip:"Anchor",cmd:"mceAnchor",stateSelector:"a:not([href])"}),t.addMenuItem("anchor",{icon:"anchor",text:"Anchor",context:"insert",cmd:"mceAnchor"})};tinymce.util.Tools.resolve("tinymce.PluginManager").add("anchor",function(t){i(t),r(t),c(t)})}(); |
@ -0,0 +1,7 @@ |
|||
// Exports the "autolink" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/autolink')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/autolink'
|
|||
require('./plugin.js'); |
@ -0,0 +1,180 @@ |
|||
(function () { |
|||
var autolink = (function () { |
|||
'use strict'; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var Env = tinymce.util.Tools.resolve('tinymce.Env'); |
|||
|
|||
var getAutoLinkPattern = function (editor) { |
|||
return editor.getParam('autolink_pattern', /^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i); |
|||
}; |
|||
var getDefaultLinkTarget = function (editor) { |
|||
return editor.getParam('default_link_target', ''); |
|||
}; |
|||
var $_1u3gta7vjd09evip = { |
|||
getAutoLinkPattern: getAutoLinkPattern, |
|||
getDefaultLinkTarget: getDefaultLinkTarget |
|||
}; |
|||
|
|||
var rangeEqualsDelimiterOrSpace = function (rangeString, delimiter) { |
|||
return rangeString === delimiter || rangeString === ' ' || rangeString.charCodeAt(0) === 160; |
|||
}; |
|||
var handleEclipse = function (editor) { |
|||
parseCurrentLine(editor, -1, '('); |
|||
}; |
|||
var handleSpacebar = function (editor) { |
|||
parseCurrentLine(editor, 0, ''); |
|||
}; |
|||
var handleEnter = function (editor) { |
|||
parseCurrentLine(editor, -1, ''); |
|||
}; |
|||
var scopeIndex = function (container, index) { |
|||
if (index < 0) { |
|||
index = 0; |
|||
} |
|||
if (container.nodeType === 3) { |
|||
var len = container.data.length; |
|||
if (index > len) { |
|||
index = len; |
|||
} |
|||
} |
|||
return index; |
|||
}; |
|||
var setStart = function (rng, container, offset) { |
|||
if (container.nodeType !== 1 || container.hasChildNodes()) { |
|||
rng.setStart(container, scopeIndex(container, offset)); |
|||
} else { |
|||
rng.setStartBefore(container); |
|||
} |
|||
}; |
|||
var setEnd = function (rng, container, offset) { |
|||
if (container.nodeType !== 1 || container.hasChildNodes()) { |
|||
rng.setEnd(container, scopeIndex(container, offset)); |
|||
} else { |
|||
rng.setEndAfter(container); |
|||
} |
|||
}; |
|||
var parseCurrentLine = function (editor, endOffset, delimiter) { |
|||
var rng, end, start, endContainer, bookmark, text, matches, prev, len, rngText; |
|||
var autoLinkPattern = $_1u3gta7vjd09evip.getAutoLinkPattern(editor); |
|||
var defaultLinkTarget = $_1u3gta7vjd09evip.getDefaultLinkTarget(editor); |
|||
if (editor.selection.getNode().tagName === 'A') { |
|||
return; |
|||
} |
|||
rng = editor.selection.getRng(true).cloneRange(); |
|||
if (rng.startOffset < 5) { |
|||
prev = rng.endContainer.previousSibling; |
|||
if (!prev) { |
|||
if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) { |
|||
return; |
|||
} |
|||
prev = rng.endContainer.firstChild.nextSibling; |
|||
} |
|||
len = prev.length; |
|||
setStart(rng, prev, len); |
|||
setEnd(rng, prev, len); |
|||
if (rng.endOffset < 5) { |
|||
return; |
|||
} |
|||
end = rng.endOffset; |
|||
endContainer = prev; |
|||
} else { |
|||
endContainer = rng.endContainer; |
|||
if (endContainer.nodeType !== 3 && endContainer.firstChild) { |
|||
while (endContainer.nodeType !== 3 && endContainer.firstChild) { |
|||
endContainer = endContainer.firstChild; |
|||
} |
|||
if (endContainer.nodeType === 3) { |
|||
setStart(rng, endContainer, 0); |
|||
setEnd(rng, endContainer, endContainer.nodeValue.length); |
|||
} |
|||
} |
|||
if (rng.endOffset === 1) { |
|||
end = 2; |
|||
} else { |
|||
end = rng.endOffset - 1 - endOffset; |
|||
} |
|||
} |
|||
start = end; |
|||
do { |
|||
setStart(rng, endContainer, end >= 2 ? end - 2 : 0); |
|||
setEnd(rng, endContainer, end >= 1 ? end - 1 : 0); |
|||
end -= 1; |
|||
rngText = rng.toString(); |
|||
} while (rngText !== ' ' && rngText !== '' && rngText.charCodeAt(0) !== 160 && end - 2 >= 0 && rngText !== delimiter); |
|||
if (rangeEqualsDelimiterOrSpace(rng.toString(), delimiter)) { |
|||
setStart(rng, endContainer, end); |
|||
setEnd(rng, endContainer, start); |
|||
end += 1; |
|||
} else if (rng.startOffset === 0) { |
|||
setStart(rng, endContainer, 0); |
|||
setEnd(rng, endContainer, start); |
|||
} else { |
|||
setStart(rng, endContainer, end); |
|||
setEnd(rng, endContainer, start); |
|||
} |
|||
text = rng.toString(); |
|||
if (text.charAt(text.length - 1) === '.') { |
|||
setEnd(rng, endContainer, start - 1); |
|||
} |
|||
text = rng.toString().trim(); |
|||
matches = text.match(autoLinkPattern); |
|||
if (matches) { |
|||
if (matches[1] === 'www.') { |
|||
matches[1] = 'http://www.'; |
|||
} else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) { |
|||
matches[1] = 'mailto:' + matches[1]; |
|||
} |
|||
bookmark = editor.selection.getBookmark(); |
|||
editor.selection.setRng(rng); |
|||
editor.execCommand('createlink', false, matches[1] + matches[2]); |
|||
if (defaultLinkTarget) { |
|||
editor.dom.setAttrib(editor.selection.getNode(), 'target', defaultLinkTarget); |
|||
} |
|||
editor.selection.moveToBookmark(bookmark); |
|||
editor.nodeChanged(); |
|||
} |
|||
}; |
|||
var setup = function (editor) { |
|||
var autoUrlDetectState; |
|||
editor.on('keydown', function (e) { |
|||
if (e.keyCode === 13) { |
|||
return handleEnter(editor); |
|||
} |
|||
}); |
|||
if (Env.ie) { |
|||
editor.on('focus', function () { |
|||
if (!autoUrlDetectState) { |
|||
autoUrlDetectState = true; |
|||
try { |
|||
editor.execCommand('AutoUrlDetect', false, true); |
|||
} catch (ex) { |
|||
} |
|||
} |
|||
}); |
|||
return; |
|||
} |
|||
editor.on('keypress', function (e) { |
|||
if (e.keyCode === 41) { |
|||
return handleEclipse(editor); |
|||
} |
|||
}); |
|||
editor.on('keyup', function (e) { |
|||
if (e.keyCode === 32) { |
|||
return handleSpacebar(editor); |
|||
} |
|||
}); |
|||
}; |
|||
var $_df67k7tjd09evik = { setup: setup }; |
|||
|
|||
PluginManager.add('autolink', function (editor) { |
|||
$_df67k7tjd09evik.setup(editor); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),n=function(e){return e.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i)},i=function(e){return e.getParam("default_link_target","")},o=function(e,t){if(t<0&&(t=0),3===e.nodeType){var n=e.data.length;t>n&&(t=n)}return t},r=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setStart(t,o(t,n)):e.setStartBefore(t)},a=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setEnd(t,o(t,n)):e.setEndAfter(t)},d=function(e,t,o){var d,f,s,l,c,u,g,h,C,m,y=n(e),k=i(e);if("A"!==e.selection.getNode().tagName){if((d=e.selection.getRng(!0).cloneRange()).startOffset<5){if(!(h=d.endContainer.previousSibling)){if(!d.endContainer.firstChild||!d.endContainer.firstChild.nextSibling)return;h=d.endContainer.firstChild.nextSibling}if(C=h.length,r(d,h,C),a(d,h,C),d.endOffset<5)return;f=d.endOffset,l=h}else{if(3!==(l=d.endContainer).nodeType&&l.firstChild){for(;3!==l.nodeType&&l.firstChild;)l=l.firstChild;3===l.nodeType&&(r(d,l,0),a(d,l,l.nodeValue.length))}f=1===d.endOffset?2:d.endOffset-1-t}s=f;do{r(d,l,f>=2?f-2:0),a(d,l,f>=1?f-1:0),f-=1,m=d.toString()}while(" "!==m&&""!==m&&160!==m.charCodeAt(0)&&f-2>=0&&m!==o);var p;(p=d.toString())===o||" "===p||160===p.charCodeAt(0)?(r(d,l,f),a(d,l,s),f+=1):0===d.startOffset?(r(d,l,0),a(d,l,s)):(r(d,l,f),a(d,l,s)),"."===(u=d.toString()).charAt(u.length-1)&&a(d,l,s-1),(g=(u=d.toString().trim()).match(y))&&("www."===g[1]?g[1]="http://www.":/@$/.test(g[1])&&!/^mailto:/.test(g[1])&&(g[1]="mailto:"+g[1]),c=e.selection.getBookmark(),e.selection.setRng(d),e.execCommand("createlink",!1,g[1]+g[2]),k&&e.dom.setAttrib(e.selection.getNode(),"target",k),e.selection.moveToBookmark(c),e.nodeChanged())}},f=function(e){var n;e.on("keydown",function(t){13!==t.keyCode||d(e,-1,"")}),t.ie?e.on("focus",function(){if(!n){n=!0;try{e.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}}):(e.on("keypress",function(t){41!==t.keyCode||d(e,-1,"(")}),e.on("keyup",function(t){32!==t.keyCode||d(e,0,"")}))};e.add("autolink",function(e){f(e)})}(); |
@ -0,0 +1,7 @@ |
|||
// Exports the "autoresize" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/autoresize')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/autoresize'
|
|||
require('./plugin.js'); |
@ -0,0 +1,169 @@ |
|||
(function () { |
|||
var autoresize = (function () { |
|||
'use strict'; |
|||
|
|||
var Cell = function (initial) { |
|||
var value = initial; |
|||
var get = function () { |
|||
return value; |
|||
}; |
|||
var set = function (v) { |
|||
value = v; |
|||
}; |
|||
var clone = function () { |
|||
return Cell(get()); |
|||
}; |
|||
return { |
|||
get: get, |
|||
set: set, |
|||
clone: clone |
|||
}; |
|||
}; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var Env = tinymce.util.Tools.resolve('tinymce.Env'); |
|||
|
|||
var Delay = tinymce.util.Tools.resolve('tinymce.util.Delay'); |
|||
|
|||
var getAutoResizeMinHeight = function (editor) { |
|||
return parseInt(editor.getParam('autoresize_min_height', editor.getElement().offsetHeight), 10); |
|||
}; |
|||
var getAutoResizeMaxHeight = function (editor) { |
|||
return parseInt(editor.getParam('autoresize_max_height', 0), 10); |
|||
}; |
|||
var getAutoResizeOverflowPadding = function (editor) { |
|||
return editor.getParam('autoresize_overflow_padding', 1); |
|||
}; |
|||
var getAutoResizeBottomMargin = function (editor) { |
|||
return editor.getParam('autoresize_bottom_margin', 50); |
|||
}; |
|||
var shouldAutoResizeOnInit = function (editor) { |
|||
return editor.getParam('autoresize_on_init', true); |
|||
}; |
|||
var $_1ycf0883jd09evjc = { |
|||
getAutoResizeMinHeight: getAutoResizeMinHeight, |
|||
getAutoResizeMaxHeight: getAutoResizeMaxHeight, |
|||
getAutoResizeOverflowPadding: getAutoResizeOverflowPadding, |
|||
getAutoResizeBottomMargin: getAutoResizeBottomMargin, |
|||
shouldAutoResizeOnInit: shouldAutoResizeOnInit |
|||
}; |
|||
|
|||
var isFullscreen = function (editor) { |
|||
return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen(); |
|||
}; |
|||
var wait = function (editor, oldSize, times, interval, callback) { |
|||
Delay.setEditorTimeout(editor, function () { |
|||
resize(editor, oldSize); |
|||
if (times--) { |
|||
wait(editor, oldSize, times, interval, callback); |
|||
} else if (callback) { |
|||
callback(); |
|||
} |
|||
}, interval); |
|||
}; |
|||
var toggleScrolling = function (editor, state) { |
|||
var body = editor.getBody(); |
|||
if (body) { |
|||
body.style.overflowY = state ? '' : 'hidden'; |
|||
if (!state) { |
|||
body.scrollTop = 0; |
|||
} |
|||
} |
|||
}; |
|||
var resize = function (editor, oldSize) { |
|||
var deltaSize, doc, body, resizeHeight, myHeight; |
|||
var marginTop, marginBottom, paddingTop, paddingBottom, borderTop, borderBottom; |
|||
var dom = editor.dom; |
|||
doc = editor.getDoc(); |
|||
if (!doc) { |
|||
return; |
|||
} |
|||
if (isFullscreen(editor)) { |
|||
toggleScrolling(editor, true); |
|||
return; |
|||
} |
|||
body = doc.body; |
|||
resizeHeight = $_1ycf0883jd09evjc.getAutoResizeMinHeight(editor); |
|||
marginTop = dom.getStyle(body, 'margin-top', true); |
|||
marginBottom = dom.getStyle(body, 'margin-bottom', true); |
|||
paddingTop = dom.getStyle(body, 'padding-top', true); |
|||
paddingBottom = dom.getStyle(body, 'padding-bottom', true); |
|||
borderTop = dom.getStyle(body, 'border-top-width', true); |
|||
borderBottom = dom.getStyle(body, 'border-bottom-width', true); |
|||
myHeight = body.offsetHeight + parseInt(marginTop, 10) + parseInt(marginBottom, 10) + parseInt(paddingTop, 10) + parseInt(paddingBottom, 10) + parseInt(borderTop, 10) + parseInt(borderBottom, 10); |
|||
if (isNaN(myHeight) || myHeight <= 0) { |
|||
myHeight = Env.ie ? body.scrollHeight : Env.webkit && body.clientHeight === 0 ? 0 : body.offsetHeight; |
|||
} |
|||
if (myHeight > $_1ycf0883jd09evjc.getAutoResizeMinHeight(editor)) { |
|||
resizeHeight = myHeight; |
|||
} |
|||
var maxHeight = $_1ycf0883jd09evjc.getAutoResizeMaxHeight(editor); |
|||
if (maxHeight && myHeight > maxHeight) { |
|||
resizeHeight = maxHeight; |
|||
toggleScrolling(editor, true); |
|||
} else { |
|||
toggleScrolling(editor, false); |
|||
} |
|||
if (resizeHeight !== oldSize.get()) { |
|||
deltaSize = resizeHeight - oldSize.get(); |
|||
dom.setStyle(editor.iframeElement, 'height', resizeHeight + 'px'); |
|||
oldSize.set(resizeHeight); |
|||
if (Env.webkit && deltaSize < 0) { |
|||
resize(editor, oldSize); |
|||
} |
|||
} |
|||
}; |
|||
var setup = function (editor, oldSize) { |
|||
editor.on('init', function () { |
|||
var overflowPadding, bottomMargin; |
|||
var dom = editor.dom; |
|||
overflowPadding = $_1ycf0883jd09evjc.getAutoResizeOverflowPadding(editor); |
|||
bottomMargin = $_1ycf0883jd09evjc.getAutoResizeBottomMargin(editor); |
|||
if (overflowPadding !== false) { |
|||
dom.setStyles(editor.getBody(), { |
|||
paddingLeft: overflowPadding, |
|||
paddingRight: overflowPadding |
|||
}); |
|||
} |
|||
if (bottomMargin !== false) { |
|||
dom.setStyles(editor.getBody(), { paddingBottom: bottomMargin }); |
|||
} |
|||
}); |
|||
editor.on('nodechange setcontent keyup FullscreenStateChanged', function (e) { |
|||
resize(editor, oldSize); |
|||
}); |
|||
if ($_1ycf0883jd09evjc.shouldAutoResizeOnInit(editor)) { |
|||
editor.on('init', function () { |
|||
wait(editor, oldSize, 20, 100, function () { |
|||
wait(editor, oldSize, 5, 1000); |
|||
}); |
|||
}); |
|||
} |
|||
}; |
|||
var $_5npi1y80jd09evj8 = { |
|||
setup: setup, |
|||
resize: resize |
|||
}; |
|||
|
|||
var register = function (editor, oldSize) { |
|||
editor.addCommand('mceAutoResize', function () { |
|||
$_5npi1y80jd09evj8.resize(editor, oldSize); |
|||
}); |
|||
}; |
|||
var $_6ijtil7zjd09evj7 = { register: register }; |
|||
|
|||
PluginManager.add('autoresize', function (editor) { |
|||
if (!editor.inline) { |
|||
var oldSize = Cell(0); |
|||
$_6ijtil7zjd09evj7.register(editor, oldSize); |
|||
$_5npi1y80jd09evj8.setup(editor, oldSize); |
|||
} |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var t=function(e){var n=e,i=function(){return n};return{get:i,set:function(t){n=t},clone:function(){return t(i())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.Env"),i=tinymce.util.Tools.resolve("tinymce.util.Delay"),o=function(t){return parseInt(t.getParam("autoresize_min_height",t.getElement().offsetHeight),10)},r=function(t){return parseInt(t.getParam("autoresize_max_height",0),10)},a=function(t){return t.getParam("autoresize_overflow_padding",1)},u=function(t){return t.getParam("autoresize_bottom_margin",50)},s=function(t){return t.getParam("autoresize_on_init",!0)},l=function(t,e,n,o,r){i.setEditorTimeout(t,function(){c(t,e),n--?l(t,e,n,o,r):r&&r()},o)},g=function(t,e){var n=t.getBody();n&&(n.style.overflowY=e?"":"hidden",e||(n.scrollTop=0))},c=function(t,e){var i,a,u,s,l,f,d,m,p,y,h,v=t.dom;if(a=t.getDoc())if((S=t).plugins.fullscreen&&S.plugins.fullscreen.isFullscreen())g(t,!0);else{var S;u=a.body,s=o(t),f=v.getStyle(u,"margin-top",!0),d=v.getStyle(u,"margin-bottom",!0),m=v.getStyle(u,"padding-top",!0),p=v.getStyle(u,"padding-bottom",!0),y=v.getStyle(u,"border-top-width",!0),h=v.getStyle(u,"border-bottom-width",!0),l=u.offsetHeight+parseInt(f,10)+parseInt(d,10)+parseInt(m,10)+parseInt(p,10)+parseInt(y,10)+parseInt(h,10),(isNaN(l)||l<=0)&&(l=n.ie?u.scrollHeight:n.webkit&&0===u.clientHeight?0:u.offsetHeight),l>o(t)&&(s=l);var _=r(t);_&&l>_?(s=_,g(t,!0)):g(t,!1),s!==e.get()&&(i=s-e.get(),v.setStyle(t.iframeElement,"height",s+"px"),e.set(s),n.webkit&&i<0&&c(t,e))}},f={setup:function(t,e){t.on("init",function(){var e,n,i=t.dom;e=a(t),n=u(t),!1!==e&&i.setStyles(t.getBody(),{paddingLeft:e,paddingRight:e}),!1!==n&&i.setStyles(t.getBody(),{paddingBottom:n})}),t.on("nodechange setcontent keyup FullscreenStateChanged",function(n){c(t,e)}),s(t)&&t.on("init",function(){l(t,e,20,100,function(){l(t,e,5,1e3)})})},resize:c},d=function(t,e){t.addCommand("mceAutoResize",function(){f.resize(t,e)})};e.add("autoresize",function(e){if(!e.inline){var n=t(0);d(e,n),f.setup(e,n)}})}(); |
@ -0,0 +1,7 @@ |
|||
// Exports the "autosave" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/autosave')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/autosave'
|
|||
require('./plugin.js'); |
@ -0,0 +1,226 @@ |
|||
(function () { |
|||
var autosave = (function () { |
|||
'use strict'; |
|||
|
|||
var Cell = function (initial) { |
|||
var value = initial; |
|||
var get = function () { |
|||
return value; |
|||
}; |
|||
var set = function (v) { |
|||
value = v; |
|||
}; |
|||
var clone = function () { |
|||
return Cell(get()); |
|||
}; |
|||
return { |
|||
get: get, |
|||
set: set, |
|||
clone: clone |
|||
}; |
|||
}; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var LocalStorage = tinymce.util.Tools.resolve('tinymce.util.LocalStorage'); |
|||
|
|||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools'); |
|||
|
|||
var fireRestoreDraft = function (editor) { |
|||
return editor.fire('RestoreDraft'); |
|||
}; |
|||
var fireStoreDraft = function (editor) { |
|||
return editor.fire('StoreDraft'); |
|||
}; |
|||
var fireRemoveDraft = function (editor) { |
|||
return editor.fire('RemoveDraft'); |
|||
}; |
|||
var $_9oiz9v8bjd09evjx = { |
|||
fireRestoreDraft: fireRestoreDraft, |
|||
fireStoreDraft: fireStoreDraft, |
|||
fireRemoveDraft: fireRemoveDraft |
|||
}; |
|||
|
|||
var parse = function (time, defaultTime) { |
|||
var multiples = { |
|||
s: 1000, |
|||
m: 60000 |
|||
}; |
|||
time = /^(\d+)([ms]?)$/.exec('' + (time || defaultTime)); |
|||
return (time[2] ? multiples[time[2]] : 1) * parseInt(time, 10); |
|||
}; |
|||
var $_acnp9w8djd09evk0 = { parse: parse }; |
|||
|
|||
var shouldAskBeforeUnload = function (editor) { |
|||
return editor.getParam('autosave_ask_before_unload', true); |
|||
}; |
|||
var getAutoSavePrefix = function (editor) { |
|||
var prefix = editor.getParam('autosave_prefix', 'tinymce-autosave-{path}{query}{hash}-{id}-'); |
|||
prefix = prefix.replace(/\{path\}/g, document.location.pathname); |
|||
prefix = prefix.replace(/\{query\}/g, document.location.search); |
|||
prefix = prefix.replace(/\{hash\}/g, document.location.hash); |
|||
prefix = prefix.replace(/\{id\}/g, editor.id); |
|||
return prefix; |
|||
}; |
|||
var shouldRestoreWhenEmpty = function (editor) { |
|||
return editor.getParam('autosave_restore_when_empty', false); |
|||
}; |
|||
var getAutoSaveInterval = function (editor) { |
|||
return $_acnp9w8djd09evk0.parse(editor.settings.autosave_interval, '30s'); |
|||
}; |
|||
var getAutoSaveRetention = function (editor) { |
|||
return $_acnp9w8djd09evk0.parse(editor.settings.autosave_retention, '20m'); |
|||
}; |
|||
var $_fnrt778cjd09evjy = { |
|||
shouldAskBeforeUnload: shouldAskBeforeUnload, |
|||
getAutoSavePrefix: getAutoSavePrefix, |
|||
shouldRestoreWhenEmpty: shouldRestoreWhenEmpty, |
|||
getAutoSaveInterval: getAutoSaveInterval, |
|||
getAutoSaveRetention: getAutoSaveRetention |
|||
}; |
|||
|
|||
var isEmpty = function (editor, html) { |
|||
var forcedRootBlockName = editor.settings.forced_root_block; |
|||
html = Tools.trim(typeof html === 'undefined' ? editor.getBody().innerHTML : html); |
|||
return html === '' || new RegExp('^<' + forcedRootBlockName + '[^>]*>((\xA0| |[ \t]|<br[^>]*>)+?|)</' + forcedRootBlockName + '>|<br>$', 'i').test(html); |
|||
}; |
|||
var hasDraft = function (editor) { |
|||
var time = parseInt(LocalStorage.getItem($_fnrt778cjd09evjy.getAutoSavePrefix(editor) + 'time'), 10) || 0; |
|||
if (new Date().getTime() - time > $_fnrt778cjd09evjy.getAutoSaveRetention(editor)) { |
|||
removeDraft(editor, false); |
|||
return false; |
|||
} |
|||
return true; |
|||
}; |
|||
var removeDraft = function (editor, fire) { |
|||
var prefix = $_fnrt778cjd09evjy.getAutoSavePrefix(editor); |
|||
LocalStorage.removeItem(prefix + 'draft'); |
|||
LocalStorage.removeItem(prefix + 'time'); |
|||
if (fire !== false) { |
|||
$_9oiz9v8bjd09evjx.fireRemoveDraft(editor); |
|||
} |
|||
}; |
|||
var storeDraft = function (editor) { |
|||
var prefix = $_fnrt778cjd09evjy.getAutoSavePrefix(editor); |
|||
if (!isEmpty(editor) && editor.isDirty()) { |
|||
LocalStorage.setItem(prefix + 'draft', editor.getContent({ |
|||
format: 'raw', |
|||
no_events: true |
|||
})); |
|||
LocalStorage.setItem(prefix + 'time', new Date().getTime().toString()); |
|||
$_9oiz9v8bjd09evjx.fireStoreDraft(editor); |
|||
} |
|||
}; |
|||
var restoreDraft = function (editor) { |
|||
var prefix = $_fnrt778cjd09evjy.getAutoSavePrefix(editor); |
|||
if (hasDraft(editor)) { |
|||
editor.setContent(LocalStorage.getItem(prefix + 'draft'), { format: 'raw' }); |
|||
$_9oiz9v8bjd09evjx.fireRestoreDraft(editor); |
|||
} |
|||
}; |
|||
var startStoreDraft = function (editor, started) { |
|||
var interval = $_fnrt778cjd09evjy.getAutoSaveInterval(editor); |
|||
if (!started.get()) { |
|||
setInterval(function () { |
|||
if (!editor.removed) { |
|||
storeDraft(editor); |
|||
} |
|||
}, interval); |
|||
started.set(true); |
|||
} |
|||
}; |
|||
var restoreLastDraft = function (editor) { |
|||
editor.undoManager.transact(function () { |
|||
restoreDraft(editor); |
|||
removeDraft(editor); |
|||
}); |
|||
editor.focus(); |
|||
}; |
|||
var $_9ciimi88jd09evju = { |
|||
isEmpty: isEmpty, |
|||
hasDraft: hasDraft, |
|||
removeDraft: removeDraft, |
|||
storeDraft: storeDraft, |
|||
restoreDraft: restoreDraft, |
|||
startStoreDraft: startStoreDraft, |
|||
restoreLastDraft: restoreLastDraft |
|||
}; |
|||
|
|||
var curry = function (f, editor) { |
|||
return function () { |
|||
var args = Array.prototype.slice.call(arguments); |
|||
return f.apply(null, [editor].concat(args)); |
|||
}; |
|||
}; |
|||
var get = function (editor) { |
|||
return { |
|||
hasDraft: curry($_9ciimi88jd09evju.hasDraft, editor), |
|||
storeDraft: curry($_9ciimi88jd09evju.storeDraft, editor), |
|||
restoreDraft: curry($_9ciimi88jd09evju.restoreDraft, editor), |
|||
removeDraft: curry($_9ciimi88jd09evju.removeDraft, editor), |
|||
isEmpty: curry($_9ciimi88jd09evju.isEmpty, editor) |
|||
}; |
|||
}; |
|||
var $_esnacr87jd09evjt = { get: get }; |
|||
|
|||
var EditorManager = tinymce.util.Tools.resolve('tinymce.EditorManager'); |
|||
|
|||
EditorManager._beforeUnloadHandler = function () { |
|||
var msg; |
|||
Tools.each(EditorManager.get(), function (editor) { |
|||
if (editor.plugins.autosave) { |
|||
editor.plugins.autosave.storeDraft(); |
|||
} |
|||
if (!msg && editor.isDirty() && $_fnrt778cjd09evjy.shouldAskBeforeUnload(editor)) { |
|||
msg = editor.translate('You have unsaved changes are you sure you want to navigate away?'); |
|||
} |
|||
}); |
|||
return msg; |
|||
}; |
|||
var setup = function (editor) { |
|||
window.onbeforeunload = EditorManager._beforeUnloadHandler; |
|||
}; |
|||
var $_8ixviu8ejd09evk9 = { setup: setup }; |
|||
|
|||
var postRender = function (editor, started) { |
|||
return function (e) { |
|||
var ctrl = e.control; |
|||
ctrl.disabled(!$_9ciimi88jd09evju.hasDraft(editor)); |
|||
editor.on('StoreDraft RestoreDraft RemoveDraft', function () { |
|||
ctrl.disabled(!$_9ciimi88jd09evju.hasDraft(editor)); |
|||
}); |
|||
$_9ciimi88jd09evju.startStoreDraft(editor, started); |
|||
}; |
|||
}; |
|||
var register = function (editor, started) { |
|||
editor.addButton('restoredraft', { |
|||
title: 'Restore last draft', |
|||
onclick: function () { |
|||
$_9ciimi88jd09evju.restoreLastDraft(editor); |
|||
}, |
|||
onPostRender: postRender(editor, started) |
|||
}); |
|||
editor.addMenuItem('restoredraft', { |
|||
text: 'Restore last draft', |
|||
onclick: function () { |
|||
$_9ciimi88jd09evju.restoreLastDraft(editor); |
|||
}, |
|||
onPostRender: postRender(editor, started), |
|||
context: 'file' |
|||
}); |
|||
}; |
|||
var $_fcm8fu8gjd09evkb = { register: register }; |
|||
|
|||
PluginManager.add('autosave', function (editor) { |
|||
var started = Cell(false); |
|||
$_8ixviu8ejd09evk9.setup(editor); |
|||
$_fcm8fu8gjd09evkb.register(editor, started); |
|||
return $_esnacr87jd09evjt.get(editor); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var t=function(e){var r=e,n=function(){return r};return{get:n,set:function(t){r=t},clone:function(){return t(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),n=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(t){return t.fire("RestoreDraft")},o=function(t){return t.fire("StoreDraft")},i=function(t){return t.fire("RemoveDraft")},s=function(t,e){return((t=/^(\d+)([ms]?)$/.exec(""+(t||e)))[2]?{s:1e3,m:6e4}[t[2]]:1)*parseInt(t,10)},u=function(t){return t.getParam("autosave_ask_before_unload",!0)},f=function(t){var e=t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-");return e=(e=(e=(e=e.replace(/\{path\}/g,document.location.pathname)).replace(/\{query\}/g,document.location.search)).replace(/\{hash\}/g,document.location.hash)).replace(/\{id\}/g,t.id)},c=function(t){return s(t.settings.autosave_interval,"30s")},l=function(t){return s(t.settings.autosave_retention,"20m")},m=function(t,e){var r=t.settings.forced_root_block;return""===(e=n.trim(void 0===e?t.getBody().innerHTML:e))||new RegExp("^<"+r+"[^>]*>((\xa0| |[ \t]|<br[^>]*>)+?|)</"+r+">|<br>$","i").test(e)},v=function(t){var e=parseInt(r.getItem(f(t)+"time"),10)||0;return!((new Date).getTime()-e>l(t)&&(d(t,!1),1))},d=function(t,e){var n=f(t);r.removeItem(n+"draft"),r.removeItem(n+"time"),!1!==e&&i(t)},D=function(t){var e=f(t);!m(t)&&t.isDirty()&&(r.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),r.setItem(e+"time",(new Date).getTime().toString()),o(t))},g=function(t){var e=f(t);v(t)&&(t.setContent(r.getItem(e+"draft"),{format:"raw"}),a(t))},y={isEmpty:m,hasDraft:v,removeDraft:d,storeDraft:D,restoreDraft:g,startStoreDraft:function(t,e){var r=c(t);e.get()||(setInterval(function(){t.removed||D(t)},r),e.set(!0))},restoreLastDraft:function(t){t.undoManager.transact(function(){g(t),d(t)}),t.focus()}},p=function(t,e){return function(){var r=Array.prototype.slice.call(arguments);return t.apply(null,[e].concat(r))}},h=function(t){return{hasDraft:p(y.hasDraft,t),storeDraft:p(y.storeDraft,t),restoreDraft:p(y.restoreDraft,t),removeDraft:p(y.removeDraft,t),isEmpty:p(y.isEmpty,t)}},_=tinymce.util.Tools.resolve("tinymce.EditorManager");_._beforeUnloadHandler=function(){var t;return n.each(_.get(),function(e){e.plugins.autosave&&e.plugins.autosave.storeDraft(),!t&&e.isDirty()&&u(e)&&(t=e.translate("You have unsaved changes are you sure you want to navigate away?"))}),t};var b=function(t){window.onbeforeunload=_._beforeUnloadHandler},I=function(t,e){return function(r){var n=r.control;n.disabled(!y.hasDraft(t)),t.on("StoreDraft RestoreDraft RemoveDraft",function(){n.disabled(!y.hasDraft(t))}),y.startStoreDraft(t,e)}},w=function(t,e){t.addButton("restoredraft",{title:"Restore last draft",onclick:function(){y.restoreLastDraft(t)},onPostRender:I(t,e)}),t.addMenuItem("restoredraft",{text:"Restore last draft",onclick:function(){y.restoreLastDraft(t)},onPostRender:I(t,e),context:"file"})};e.add("autosave",function(e){var r=t(!1);return b(e),w(e,r),h(e)})}(); |
@ -0,0 +1,7 @@ |
|||
// Exports the "bbcode" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/bbcode')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/bbcode'
|
|||
require('./plugin.js'); |
@ -0,0 +1,101 @@ |
|||
(function () { |
|||
var bbcode = (function () { |
|||
'use strict'; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools'); |
|||
|
|||
var html2bbcode = function (s) { |
|||
s = Tools.trim(s); |
|||
var rep = function (re, str) { |
|||
s = s.replace(re, str); |
|||
}; |
|||
rep(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi, '[url=$1]$2[/url]'); |
|||
rep(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi, '[code][color=$1]$2[/color][/code]'); |
|||
rep(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi, '[quote][color=$1]$2[/color][/quote]'); |
|||
rep(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, '[code][color=$1]$2[/color][/code]'); |
|||
rep(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, '[quote][color=$1]$2[/color][/quote]'); |
|||
rep(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi, '[color=$1]$2[/color]'); |
|||
rep(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi, '[color=$1]$2[/color]'); |
|||
rep(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi, '[size=$1]$2[/size]'); |
|||
rep(/<font>(.*?)<\/font>/gi, '$1'); |
|||
rep(/<img.*?src=\"(.*?)\".*?\/>/gi, '[img]$1[/img]'); |
|||
rep(/<span class=\"codeStyle\">(.*?)<\/span>/gi, '[code]$1[/code]'); |
|||
rep(/<span class=\"quoteStyle\">(.*?)<\/span>/gi, '[quote]$1[/quote]'); |
|||
rep(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi, '[code][b]$1[/b][/code]'); |
|||
rep(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi, '[quote][b]$1[/b][/quote]'); |
|||
rep(/<em class=\"codeStyle\">(.*?)<\/em>/gi, '[code][i]$1[/i][/code]'); |
|||
rep(/<em class=\"quoteStyle\">(.*?)<\/em>/gi, '[quote][i]$1[/i][/quote]'); |
|||
rep(/<u class=\"codeStyle\">(.*?)<\/u>/gi, '[code][u]$1[/u][/code]'); |
|||
rep(/<u class=\"quoteStyle\">(.*?)<\/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 style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi, '[u]$1[/u]'); |
|||
rep(/<u>/gi, '[u]'); |
|||
rep(/<blockquote[^>]*>/gi, '[quote]'); |
|||
rep(/<\/blockquote>/gi, '[/quote]'); |
|||
rep(/<br \/>/gi, '\n'); |
|||
rep(/<br\/>/gi, '\n'); |
|||
rep(/<br>/gi, '\n'); |
|||
rep(/<p>/gi, ''); |
|||
rep(/<\/p>/gi, '\n'); |
|||
rep(/ |\u00a0/gi, ' '); |
|||
rep(/"/gi, '"'); |
|||
rep(/</gi, '<'); |
|||
rep(/>/gi, '>'); |
|||
rep(/&/gi, '&'); |
|||
return s; |
|||
}; |
|||
var bbcode2html = function (s) { |
|||
s = Tools.trim(s); |
|||
var rep = function (re, str) { |
|||
s = s.replace(re, str); |
|||
}; |
|||
rep(/\n/gi, '<br />'); |
|||
rep(/\[b\]/gi, '<strong>'); |
|||
rep(/\[\/b\]/gi, '</strong>'); |
|||
rep(/\[i\]/gi, '<em>'); |
|||
rep(/\[\/i\]/gi, '</em>'); |
|||
rep(/\[u\]/gi, '<u>'); |
|||
rep(/\[\/u\]/gi, '</u>'); |
|||
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi, '<a href="$1">$2</a>'); |
|||
rep(/\[url\](.*?)\[\/url\]/gi, '<a href="$1">$1</a>'); |
|||
rep(/\[img\](.*?)\[\/img\]/gi, '<img src="$1" />'); |
|||
rep(/\[color=(.*?)\](.*?)\[\/color\]/gi, '<font color="$1">$2</font>'); |
|||
rep(/\[code\](.*?)\[\/code\]/gi, '<span class="codeStyle">$1</span> '); |
|||
rep(/\[quote.*?\](.*?)\[\/quote\]/gi, '<span class="quoteStyle">$1</span> '); |
|||
return s; |
|||
}; |
|||
var $_3znyhe8jjd09evkt = { |
|||
html2bbcode: html2bbcode, |
|||
bbcode2html: bbcode2html |
|||
}; |
|||
|
|||
PluginManager.add('bbcode', function () { |
|||
return { |
|||
init: function (editor) { |
|||
editor.on('beforeSetContent', function (e) { |
|||
e.content = $_3znyhe8jjd09evkt.bbcode2html(e.content); |
|||
}); |
|||
editor.on('postProcess', function (e) { |
|||
if (e.set) { |
|||
e.content = $_3znyhe8jjd09evkt.bbcode2html(e.content); |
|||
} |
|||
if (e.get) { |
|||
e.content = $_3znyhe8jjd09evkt.html2bbcode(e.content); |
|||
} |
|||
}); |
|||
} |
|||
}; |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=function(o){o=t.trim(o);var e=function(t,e){o=o.replace(t,e)};return e(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),e(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),e(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),e(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),e(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),e(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),e(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),e(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),e(/<font>(.*?)<\/font>/gi,"$1"),e(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),e(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),e(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),e(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),e(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),e(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),e(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),e(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),e(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),e(/<\/(strong|b)>/gi,"[/b]"),e(/<(strong|b)>/gi,"[b]"),e(/<\/(em|i)>/gi,"[/i]"),e(/<(em|i)>/gi,"[i]"),e(/<\/u>/gi,"[/u]"),e(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),e(/<u>/gi,"[u]"),e(/<blockquote[^>]*>/gi,"[quote]"),e(/<\/blockquote>/gi,"[/quote]"),e(/<br \/>/gi,"\n"),e(/<br\/>/gi,"\n"),e(/<br>/gi,"\n"),e(/<p>/gi,""),e(/<\/p>/gi,"\n"),e(/ |\u00a0/gi," "),e(/"/gi,'"'),e(/</gi,"<"),e(/>/gi,">"),e(/&/gi,"&"),o},i=function(o){o=t.trim(o);var e=function(t,e){o=o.replace(t,e)};return e(/\n/gi,"<br />"),e(/\[b\]/gi,"<strong>"),e(/\[\/b\]/gi,"</strong>"),e(/\[i\]/gi,"<em>"),e(/\[\/i\]/gi,"</em>"),e(/\[u\]/gi,"<u>"),e(/\[\/u\]/gi,"</u>"),e(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),e(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),e(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),e(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),e(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span> '),e(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> '),o};o.add("bbcode",function(){return{init:function(o){o.on("beforeSetContent",function(o){o.content=i(o.content)}),o.on("postProcess",function(o){o.set&&(o.content=i(o.content)),o.get&&(o.content=e(o.content))})}}})}(); |
@ -0,0 +1,7 @@ |
|||
// Exports the "charmap" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/charmap')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/charmap'
|
|||
require('./plugin.js'); |
@ -0,0 +1,7 @@ |
|||
// Exports the "code" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/code')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/code'
|
|||
require('./plugin.js'); |
@ -0,0 +1,94 @@ |
|||
(function () { |
|||
var code = (function () { |
|||
'use strict'; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var DOMUtils = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); |
|||
|
|||
var getMinWidth = function (editor) { |
|||
return editor.getParam('code_dialog_width', 600); |
|||
}; |
|||
var getMinHeight = function (editor) { |
|||
return editor.getParam('code_dialog_height', Math.min(DOMUtils.DOM.getViewPort().h - 200, 500)); |
|||
}; |
|||
var $_fr6uym91jd09evml = { |
|||
getMinWidth: getMinWidth, |
|||
getMinHeight: getMinHeight |
|||
}; |
|||
|
|||
var setContent = function (editor, html) { |
|||
editor.focus(); |
|||
editor.undoManager.transact(function () { |
|||
editor.setContent(html); |
|||
}); |
|||
editor.selection.setCursorLocation(); |
|||
editor.nodeChanged(); |
|||
}; |
|||
var getContent = function (editor) { |
|||
return editor.getContent({ source_view: true }); |
|||
}; |
|||
var $_8uqjeh93jd09evmm = { |
|||
setContent: setContent, |
|||
getContent: getContent |
|||
}; |
|||
|
|||
var open = function (editor) { |
|||
var minWidth = $_fr6uym91jd09evml.getMinWidth(editor); |
|||
var minHeight = $_fr6uym91jd09evml.getMinHeight(editor); |
|||
var win = editor.windowManager.open({ |
|||
title: 'Source code', |
|||
body: { |
|||
type: 'textbox', |
|||
name: 'code', |
|||
multiline: true, |
|||
minWidth: minWidth, |
|||
minHeight: minHeight, |
|||
spellcheck: false, |
|||
style: 'direction: ltr; text-align: left' |
|||
}, |
|||
onSubmit: function (e) { |
|||
$_8uqjeh93jd09evmm.setContent(editor, e.data.code); |
|||
} |
|||
}); |
|||
win.find('#code').value($_8uqjeh93jd09evmm.getContent(editor)); |
|||
}; |
|||
var $_6y34fq90jd09evmj = { open: open }; |
|||
|
|||
var register = function (editor) { |
|||
editor.addCommand('mceCodeEditor', function () { |
|||
$_6y34fq90jd09evmj.open(editor); |
|||
}); |
|||
}; |
|||
var $_5cbnc58zjd09evmi = { register: register }; |
|||
|
|||
var register$1 = function (editor) { |
|||
editor.addButton('code', { |
|||
icon: 'code', |
|||
tooltip: 'Source code', |
|||
onclick: function () { |
|||
$_6y34fq90jd09evmj.open(editor); |
|||
} |
|||
}); |
|||
editor.addMenuItem('code', { |
|||
icon: 'code', |
|||
text: 'Source code', |
|||
onclick: function () { |
|||
$_6y34fq90jd09evmj.open(editor); |
|||
} |
|||
}); |
|||
}; |
|||
var $_fo0ike94jd09evmn = { register: register$1 }; |
|||
|
|||
PluginManager.add('code', function (editor) { |
|||
$_5cbnc58zjd09evmi.register(editor); |
|||
$_fo0ike94jd09evmn.register(editor); |
|||
return {}; |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),e=function(t){return t.getParam("code_dialog_width",600)},o=function(t){return t.getParam("code_dialog_height",Math.min(n.DOM.getViewPort().h-200,500))},i=function(t,n){t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged()},c=function(t){return t.getContent({source_view:!0})},d=function(t){var n=e(t),d=o(t);t.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:n,minHeight:d,spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(n){i(t,n.data.code)}}).find("#code").value(c(t))},u=function(t){t.addCommand("mceCodeEditor",function(){d(t)})},a=function(t){t.addButton("code",{icon:"code",tooltip:"Source code",onclick:function(){d(t)}}),t.addMenuItem("code",{icon:"code",text:"Source code",onclick:function(){d(t)}})};t.add("code",function(t){return u(t),a(t),{}})}(); |
@ -0,0 +1,138 @@ |
|||
/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */ |
|||
/** |
|||
* prism.js default theme for JavaScript, CSS and HTML |
|||
* Based on dabblet (http://dabblet.com) |
|||
* @author Lea Verou |
|||
*/ |
|||
|
|||
code[class*="language-"], |
|||
pre[class*="language-"] { |
|||
color: black; |
|||
text-shadow: 0 1px white; |
|||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; |
|||
direction: ltr; |
|||
text-align: left; |
|||
white-space: pre; |
|||
word-spacing: normal; |
|||
word-break: normal; |
|||
word-wrap: normal; |
|||
line-height: 1.5; |
|||
|
|||
-moz-tab-size: 4; |
|||
-o-tab-size: 4; |
|||
tab-size: 4; |
|||
|
|||
-webkit-hyphens: none; |
|||
-moz-hyphens: none; |
|||
-ms-hyphens: none; |
|||
hyphens: none; |
|||
} |
|||
|
|||
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, |
|||
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { |
|||
text-shadow: none; |
|||
background: #b3d4fc; |
|||
} |
|||
|
|||
pre[class*="language-"]::selection, pre[class*="language-"] ::selection, |
|||
code[class*="language-"]::selection, code[class*="language-"] ::selection { |
|||
text-shadow: none; |
|||
background: #b3d4fc; |
|||
} |
|||
|
|||
@media print { |
|||
code[class*="language-"], |
|||
pre[class*="language-"] { |
|||
text-shadow: none; |
|||
} |
|||
} |
|||
|
|||
/* Code blocks */ |
|||
pre[class*="language-"] { |
|||
padding: 1em; |
|||
margin: .5em 0; |
|||
overflow: auto; |
|||
} |
|||
|
|||
:not(pre) > code[class*="language-"], |
|||
pre[class*="language-"] { |
|||
background: #f5f2f0; |
|||
} |
|||
|
|||
/* Inline code */ |
|||
:not(pre) > code[class*="language-"] { |
|||
padding: .1em; |
|||
border-radius: .3em; |
|||
} |
|||
|
|||
.token.comment, |
|||
.token.prolog, |
|||
.token.doctype, |
|||
.token.cdata { |
|||
color: slategray; |
|||
} |
|||
|
|||
.token.punctuation { |
|||
color: #999; |
|||
} |
|||
|
|||
.namespace { |
|||
opacity: .7; |
|||
} |
|||
|
|||
.token.property, |
|||
.token.tag, |
|||
.token.boolean, |
|||
.token.number, |
|||
.token.constant, |
|||
.token.symbol, |
|||
.token.deleted { |
|||
color: #905; |
|||
} |
|||
|
|||
.token.selector, |
|||
.token.attr-name, |
|||
.token.string, |
|||
.token.char, |
|||
.token.builtin, |
|||
.token.inserted { |
|||
color: #690; |
|||
} |
|||
|
|||
.token.operator, |
|||
.token.entity, |
|||
.token.url, |
|||
.language-css .token.string, |
|||
.style .token.string { |
|||
color: #a67f59; |
|||
background: hsla(0, 0%, 100%, .5); |
|||
} |
|||
|
|||
.token.atrule, |
|||
.token.attr-value, |
|||
.token.keyword { |
|||
color: #07a; |
|||
} |
|||
|
|||
.token.function { |
|||
color: #DD4A68; |
|||
} |
|||
|
|||
.token.regex, |
|||
.token.important, |
|||
.token.variable { |
|||
color: #e90; |
|||
} |
|||
|
|||
.token.important, |
|||
.token.bold { |
|||
font-weight: bold; |
|||
} |
|||
.token.italic { |
|||
font-style: italic; |
|||
} |
|||
|
|||
.token.entity { |
|||
cursor: help; |
|||
} |
|||
|
@ -0,0 +1,7 @@ |
|||
// Exports the "codesample" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/codesample')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/codesample'
|
|||
require('./plugin.js'); |
@ -0,0 +1,969 @@ |
|||
(function () { |
|||
var codesample = (function () { |
|||
'use strict'; |
|||
|
|||
var Cell = function (initial) { |
|||
var value = initial; |
|||
var get = function () { |
|||
return value; |
|||
}; |
|||
var set = function (v) { |
|||
value = v; |
|||
}; |
|||
var clone = function () { |
|||
return Cell(get()); |
|||
}; |
|||
return { |
|||
get: get, |
|||
set: set, |
|||
clone: clone |
|||
}; |
|||
}; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var DOMUtils = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); |
|||
|
|||
var getContentCss = function (editor) { |
|||
return editor.settings.codesample_content_css; |
|||
}; |
|||
var getLanguages = function (editor) { |
|||
return editor.settings.codesample_languages; |
|||
}; |
|||
var getDialogMinWidth = function (editor) { |
|||
return Math.min(DOMUtils.DOM.getViewPort().w, editor.getParam('codesample_dialog_width', 800)); |
|||
}; |
|||
var getDialogMinHeight = function (editor) { |
|||
return Math.min(DOMUtils.DOM.getViewPort().w, editor.getParam('codesample_dialog_height', 650)); |
|||
}; |
|||
var $_3zfvka9ajd09evn3 = { |
|||
getContentCss: getContentCss, |
|||
getLanguages: getLanguages, |
|||
getDialogMinWidth: getDialogMinWidth, |
|||
getDialogMinHeight: getDialogMinHeight |
|||
}; |
|||
|
|||
var window = {}; |
|||
var _self = typeof window !== 'undefined' ? window : typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self : {}; |
|||
var Prism = function () { |
|||
var lang = /\blang(?:uage)?-(?!\*)(\w+)\b/i; |
|||
var _ = _self.Prism = { |
|||
util: { |
|||
encode: function (tokens) { |
|||
if (tokens instanceof Token) { |
|||
return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias); |
|||
} else if (_.util.type(tokens) === 'Array') { |
|||
return tokens.map(_.util.encode); |
|||
} else { |
|||
return tokens.replace(/&/g, '&').replace(/</g, '<').replace(/\u00a0/g, ' '); |
|||
} |
|||
}, |
|||
type: function (o) { |
|||
return Object.prototype.toString.call(o).match(/\[object (\w+)\]/)[1]; |
|||
}, |
|||
clone: function (o) { |
|||
var type = _.util.type(o); |
|||
switch (type) { |
|||
case 'Object': |
|||
var clone = {}; |
|||
for (var key in o) { |
|||
if (o.hasOwnProperty(key)) { |
|||
clone[key] = _.util.clone(o[key]); |
|||
} |
|||
} |
|||
return clone; |
|||
case 'Array': |
|||
return o.map && o.map(function (v) { |
|||
return _.util.clone(v); |
|||
}); |
|||
} |
|||
return o; |
|||
} |
|||
}, |
|||
languages: { |
|||
extend: function (id, redef) { |
|||
var lang = _.util.clone(_.languages[id]); |
|||
for (var key in redef) { |
|||
lang[key] = redef[key]; |
|||
} |
|||
return lang; |
|||
}, |
|||
insertBefore: function (inside, before, insert, root) { |
|||
root = root || _.languages; |
|||
var grammar = root[inside]; |
|||
if (arguments.length === 2) { |
|||
insert = arguments[1]; |
|||
for (var newToken in insert) { |
|||
if (insert.hasOwnProperty(newToken)) { |
|||
grammar[newToken] = insert[newToken]; |
|||
} |
|||
} |
|||
return grammar; |
|||
} |
|||
var ret = {}; |
|||
for (var token in grammar) { |
|||
if (grammar.hasOwnProperty(token)) { |
|||
if (token === before) { |
|||
for (var newToken in insert) { |
|||
if (insert.hasOwnProperty(newToken)) { |
|||
ret[newToken] = insert[newToken]; |
|||
} |
|||
} |
|||
} |
|||
ret[token] = grammar[token]; |
|||
} |
|||
} |
|||
_.languages.DFS(_.languages, function (key, value) { |
|||
if (value === root[inside] && key !== inside) { |
|||
this[key] = ret; |
|||
} |
|||
}); |
|||
return root[inside] = ret; |
|||
}, |
|||
DFS: function (o, callback, type) { |
|||
for (var i in o) { |
|||
if (o.hasOwnProperty(i)) { |
|||
callback.call(o, i, o[i], type || i); |
|||
if (_.util.type(o[i]) === 'Object') { |
|||
_.languages.DFS(o[i], callback); |
|||
} else if (_.util.type(o[i]) === 'Array') { |
|||
_.languages.DFS(o[i], callback, i); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
plugins: {}, |
|||
highlightAll: function (async, callback) { |
|||
var elements = document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'); |
|||
for (var i = 0, element = void 0; element = elements[i++];) { |
|||
_.highlightElement(element, async === true, callback); |
|||
} |
|||
}, |
|||
highlightElement: function (element, async, callback) { |
|||
var language, grammar, parent = element; |
|||
while (parent && !lang.test(parent.className)) { |
|||
parent = parent.parentNode; |
|||
} |
|||
if (parent) { |
|||
language = (parent.className.match(lang) || [ |
|||
, |
|||
'' |
|||
])[1]; |
|||
grammar = _.languages[language]; |
|||
} |
|||
element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; |
|||
parent = element.parentNode; |
|||
if (/pre/i.test(parent.nodeName)) { |
|||
parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; |
|||
} |
|||
var code = element.textContent; |
|||
var env = { |
|||
element: element, |
|||
language: language, |
|||
grammar: grammar, |
|||
code: code |
|||
}; |
|||
if (!code || !grammar) { |
|||
_.hooks.run('complete', env); |
|||
return; |
|||
} |
|||
_.hooks.run('before-highlight', env); |
|||
if (async && _self.Worker) { |
|||
var worker = new Worker(_.filename); |
|||
worker.onmessage = function (evt) { |
|||
env.highlightedCode = evt.data; |
|||
_.hooks.run('before-insert', env); |
|||
env.element.innerHTML = env.highlightedCode; |
|||
if (callback) { |
|||
callback.call(env.element); |
|||
} |
|||
_.hooks.run('after-highlight', env); |
|||
_.hooks.run('complete', env); |
|||
}; |
|||
worker.postMessage(JSON.stringify({ |
|||
language: env.language, |
|||
code: env.code, |
|||
immediateClose: true |
|||
})); |
|||
} else { |
|||
env.highlightedCode = _.highlight(env.code, env.grammar, env.language); |
|||
_.hooks.run('before-insert', env); |
|||
env.element.innerHTML = env.highlightedCode; |
|||
if (callback) { |
|||
callback.call(element); |
|||
} |
|||
_.hooks.run('after-highlight', env); |
|||
_.hooks.run('complete', env); |
|||
} |
|||
}, |
|||
highlight: function (text, grammar, language) { |
|||
var tokens = _.tokenize(text, grammar); |
|||
return Token.stringify(_.util.encode(tokens), language); |
|||
}, |
|||
tokenize: function (text, grammar, language) { |
|||
var Token = _.Token; |
|||
var strarr = [text]; |
|||
var rest = grammar.rest; |
|||
if (rest) { |
|||
for (var token in rest) { |
|||
grammar[token] = rest[token]; |
|||
} |
|||
delete grammar.rest; |
|||
} |
|||
tokenloop: |
|||
for (var token in grammar) { |
|||
if (!grammar.hasOwnProperty(token) || !grammar[token]) { |
|||
continue; |
|||
} |
|||
var patterns = grammar[token]; |
|||
patterns = _.util.type(patterns) === 'Array' ? patterns : [patterns]; |
|||
for (var j = 0; j < patterns.length; ++j) { |
|||
var pattern = patterns[j]; |
|||
var inside = pattern.inside; |
|||
var lookbehind = !!pattern.lookbehind; |
|||
var lookbehindLength = 0; |
|||
var alias = pattern.alias; |
|||
pattern = pattern.pattern || pattern; |
|||
for (var i = 0; i < strarr.length; i++) { |
|||
var str = strarr[i]; |
|||
if (strarr.length > text.length) { |
|||
break tokenloop; |
|||
} |
|||
if (str instanceof Token) { |
|||
continue; |
|||
} |
|||
pattern.lastIndex = 0; |
|||
var match = pattern.exec(str); |
|||
if (match) { |
|||
if (lookbehind) { |
|||
lookbehindLength = match[1].length; |
|||
} |
|||
var from = match.index - 1 + lookbehindLength; |
|||
match = match[0].slice(lookbehindLength); |
|||
var len = match.length, to = from + len, before = str.slice(0, from + 1), after = str.slice(to + 1); |
|||
var args = [ |
|||
i, |
|||
1 |
|||
]; |
|||
if (before) { |
|||
args.push(before); |
|||
} |
|||
var wrapped = new Token(token, inside ? _.tokenize(match, inside) : match, alias); |
|||
args.push(wrapped); |
|||
if (after) { |
|||
args.push(after); |
|||
} |
|||
Array.prototype.splice.apply(strarr, args); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
return strarr; |
|||
}, |
|||
hooks: { |
|||
all: {}, |
|||
add: function (name, callback) { |
|||
var hooks = _.hooks.all; |
|||
hooks[name] = hooks[name] || []; |
|||
hooks[name].push(callback); |
|||
}, |
|||
run: function (name, env) { |
|||
var callbacks = _.hooks.all[name]; |
|||
if (!callbacks || !callbacks.length) { |
|||
return; |
|||
} |
|||
for (var i = 0, callback = void 0; callback = callbacks[i++];) { |
|||
callback(env); |
|||
} |
|||
} |
|||
} |
|||
}; |
|||
var Token = _.Token = function (type, content, alias) { |
|||
this.type = type; |
|||
this.content = content; |
|||
this.alias = alias; |
|||
}; |
|||
Token.stringify = function (o, language, parent) { |
|||
if (typeof o === 'string') { |
|||
return o; |
|||
} |
|||
if (_.util.type(o) === 'Array') { |
|||
return o.map(function (element) { |
|||
return Token.stringify(element, language, o); |
|||
}).join(''); |
|||
} |
|||
var env = { |
|||
type: o.type, |
|||
content: Token.stringify(o.content, language, parent), |
|||
tag: 'span', |
|||
classes: [ |
|||
'token', |
|||
o.type |
|||
], |
|||
attributes: {}, |
|||
language: language, |
|||
parent: parent |
|||
}; |
|||
if (env.type === 'comment') { |
|||
env.attributes.spellcheck = 'true'; |
|||
} |
|||
if (o.alias) { |
|||
var aliases = _.util.type(o.alias) === 'Array' ? o.alias : [o.alias]; |
|||
Array.prototype.push.apply(env.classes, aliases); |
|||
} |
|||
_.hooks.run('wrap', env); |
|||
var attributes = ''; |
|||
for (var name_1 in env.attributes) { |
|||
attributes += (attributes ? ' ' : '') + name_1 + '="' + (env.attributes[name_1] || '') + '"'; |
|||
} |
|||
return '<' + env.tag + ' class="' + env.classes.join(' ') + '" ' + attributes + '>' + env.content + '</' + env.tag + '>'; |
|||
}; |
|||
if (!_self.document) { |
|||
if (!_self.addEventListener) { |
|||
return _self.Prism; |
|||
} |
|||
_self.addEventListener('message', function (evt) { |
|||
var message = JSON.parse(evt.data), lang = message.language, code = message.code, immediateClose = message.immediateClose; |
|||
_self.postMessage(_.highlight(code, _.languages[lang], lang)); |
|||
if (immediateClose) { |
|||
_self.close(); |
|||
} |
|||
}, false); |
|||
return _self.Prism; |
|||
} |
|||
}(); |
|||
if (typeof module !== 'undefined' && module.exports) { |
|||
module.exports = Prism; |
|||
} |
|||
if (typeof global !== 'undefined') { |
|||
global.Prism = Prism; |
|||
} |
|||
Prism.languages.markup = { |
|||
comment: /<!--[\w\W]*?-->/, |
|||
prolog: /<\?[\w\W]+?\?>/, |
|||
doctype: /<!DOCTYPE[\w\W]+?>/, |
|||
cdata: /<!\[CDATA\[[\w\W]*?]]>/i, |
|||
tag: { |
|||
pattern: /<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i, |
|||
inside: { |
|||
'tag': { |
|||
pattern: /^<\/?[^\s>\/]+/i, |
|||
inside: { |
|||
punctuation: /^<\/?/, |
|||
namespace: /^[^\s>\/:]+:/ |
|||
} |
|||
}, |
|||
'attr-value': { |
|||
pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i, |
|||
inside: { punctuation: /[=>"']/ } |
|||
}, |
|||
'punctuation': /\/?>/, |
|||
'attr-name': { |
|||
pattern: /[^\s>\/]+/, |
|||
inside: { namespace: /^[^\s>\/:]+:/ } |
|||
} |
|||
} |
|||
}, |
|||
entity: /&#?[\da-z]{1,8};/i |
|||
}; |
|||
Prism.hooks.add('wrap', function (env) { |
|||
if (env.type === 'entity') { |
|||
env.attributes.title = env.content.replace(/&/, '&'); |
|||
} |
|||
}); |
|||
Prism.languages.xml = Prism.languages.markup; |
|||
Prism.languages.html = Prism.languages.markup; |
|||
Prism.languages.mathml = Prism.languages.markup; |
|||
Prism.languages.svg = Prism.languages.markup; |
|||
Prism.languages.css = { |
|||
comment: /\/\*[\w\W]*?\*\//, |
|||
atrule: { |
|||
pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i, |
|||
inside: { rule: /@[\w-]+/ } |
|||
}, |
|||
url: /url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i, |
|||
selector: /[^\{\}\s][^\{\};]*?(?=\s*\{)/, |
|||
string: /("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/, |
|||
property: /(\b|\B)[\w-]+(?=\s*:)/i, |
|||
important: /\B!important\b/i, |
|||
function: /[-a-z0-9]+(?=\()/i, |
|||
punctuation: /[(){};:]/ |
|||
}; |
|||
Prism.languages.css.atrule.inside.rest = Prism.util.clone(Prism.languages.css); |
|||
if (Prism.languages.markup) { |
|||
Prism.languages.insertBefore('markup', 'tag', { |
|||
style: { |
|||
pattern: /<style[\w\W]*?>[\w\W]*?<\/style>/i, |
|||
inside: { |
|||
tag: { |
|||
pattern: /<style[\w\W]*?>|<\/style>/i, |
|||
inside: Prism.languages.markup.tag.inside |
|||
}, |
|||
rest: Prism.languages.css |
|||
}, |
|||
alias: 'language-css' |
|||
} |
|||
}); |
|||
Prism.languages.insertBefore('inside', 'attr-value', { |
|||
'style-attr': { |
|||
pattern: /\s*style=("|').*?\1/i, |
|||
inside: { |
|||
'attr-name': { |
|||
pattern: /^\s*style/i, |
|||
inside: Prism.languages.markup.tag.inside |
|||
}, |
|||
'punctuation': /^\s*=\s*['"]|['"]\s*$/, |
|||
'attr-value': { |
|||
pattern: /.+/i, |
|||
inside: Prism.languages.css |
|||
} |
|||
}, |
|||
alias: 'language-css' |
|||
} |
|||
}, Prism.languages.markup.tag); |
|||
} |
|||
Prism.languages.clike = { |
|||
'comment': [ |
|||
{ |
|||
pattern: /(^|[^\\])\/\*[\w\W]*?\*\//, |
|||
lookbehind: true |
|||
}, |
|||
{ |
|||
pattern: /(^|[^\\:])\/\/.*/, |
|||
lookbehind: true |
|||
} |
|||
], |
|||
'string': /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, |
|||
'class-name': { |
|||
pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i, |
|||
lookbehind: true, |
|||
inside: { punctuation: /(\.|\\)/ } |
|||
}, |
|||
'keyword': /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, |
|||
'boolean': /\b(true|false)\b/, |
|||
'function': /[a-z0-9_]+(?=\()/i, |
|||
'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i, |
|||
'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/, |
|||
'punctuation': /[{}[\];(),.:]/ |
|||
}; |
|||
Prism.languages.javascript = Prism.languages.extend('clike', { |
|||
keyword: /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/, |
|||
number: /\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/, |
|||
function: /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i |
|||
}); |
|||
Prism.languages.insertBefore('javascript', 'keyword', { |
|||
regex: { |
|||
pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/, |
|||
lookbehind: true |
|||
} |
|||
}); |
|||
Prism.languages.insertBefore('javascript', 'class-name', { |
|||
'template-string': { |
|||
pattern: /`(?:\\`|\\?[^`])*`/, |
|||
inside: { |
|||
interpolation: { |
|||
pattern: /\$\{[^}]+\}/, |
|||
inside: { |
|||
'interpolation-punctuation': { |
|||
pattern: /^\$\{|\}$/, |
|||
alias: 'punctuation' |
|||
}, |
|||
'rest': Prism.languages.javascript |
|||
} |
|||
}, |
|||
string: /[\s\S]+/ |
|||
} |
|||
} |
|||
}); |
|||
if (Prism.languages.markup) { |
|||
Prism.languages.insertBefore('markup', 'tag', { |
|||
script: { |
|||
pattern: /<script[\w\W]*?>[\w\W]*?<\/script>/i, |
|||
inside: { |
|||
tag: { |
|||
pattern: /<script[\w\W]*?>|<\/script>/i, |
|||
inside: Prism.languages.markup.tag.inside |
|||
}, |
|||
rest: Prism.languages.javascript |
|||
}, |
|||
alias: 'language-javascript' |
|||
} |
|||
}); |
|||
} |
|||
Prism.languages.js = Prism.languages.javascript; |
|||
Prism.languages.c = Prism.languages.extend('clike', { |
|||
keyword: /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/, |
|||
operator: /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/, |
|||
number: /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i |
|||
}); |
|||
Prism.languages.insertBefore('c', 'string', { |
|||
macro: { |
|||
pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im, |
|||
lookbehind: true, |
|||
alias: 'property', |
|||
inside: { |
|||
string: { |
|||
pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/, |
|||
lookbehind: true |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
delete Prism.languages.c['class-name']; |
|||
delete Prism.languages.c.boolean; |
|||
Prism.languages.csharp = Prism.languages.extend('clike', { |
|||
keyword: /\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/, |
|||
string: [ |
|||
/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/, |
|||
/("|')(\\?.)*?\1/ |
|||
], |
|||
number: /\b-?(0x[\da-f]+|\d*\.?\d+)\b/i |
|||
}); |
|||
Prism.languages.insertBefore('csharp', 'keyword', { |
|||
preprocessor: { |
|||
pattern: /(^\s*)#.*/m, |
|||
lookbehind: true |
|||
} |
|||
}); |
|||
Prism.languages.cpp = Prism.languages.extend('c', { |
|||
keyword: /\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, |
|||
boolean: /\b(true|false)\b/, |
|||
operator: /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/ |
|||
}); |
|||
Prism.languages.insertBefore('cpp', 'keyword', { |
|||
'class-name': { |
|||
pattern: /(class\s+)[a-z0-9_]+/i, |
|||
lookbehind: true |
|||
} |
|||
}); |
|||
Prism.languages.java = Prism.languages.extend('clike', { |
|||
keyword: /\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/, |
|||
number: /\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i, |
|||
operator: { |
|||
pattern: /(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m, |
|||
lookbehind: true |
|||
} |
|||
}); |
|||
Prism.languages.php = Prism.languages.extend('clike', { |
|||
keyword: /\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i, |
|||
constant: /\b[A-Z0-9_]{2,}\b/, |
|||
comment: { |
|||
pattern: /(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/, |
|||
lookbehind: true |
|||
} |
|||
}); |
|||
Prism.languages.insertBefore('php', 'class-name', { |
|||
'shell-comment': { |
|||
pattern: /(^|[^\\])#.*/, |
|||
lookbehind: true, |
|||
alias: 'comment' |
|||
} |
|||
}); |
|||
Prism.languages.insertBefore('php', 'keyword', { |
|||
delimiter: /\?>|<\?(?:php)?/i, |
|||
variable: /\$\w+\b/i, |
|||
package: { |
|||
pattern: /(\\|namespace\s+|use\s+)[\w\\]+/, |
|||
lookbehind: true, |
|||
inside: { punctuation: /\\/ } |
|||
} |
|||
}); |
|||
Prism.languages.insertBefore('php', 'operator', { |
|||
property: { |
|||
pattern: /(->)[\w]+/, |
|||
lookbehind: true |
|||
} |
|||
}); |
|||
if (Prism.languages.markup) { |
|||
Prism.hooks.add('before-highlight', function (env) { |
|||
if (env.language !== 'php') { |
|||
return; |
|||
} |
|||
env.tokenStack = []; |
|||
env.backupCode = env.code; |
|||
env.code = env.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/ig, function (match) { |
|||
env.tokenStack.push(match); |
|||
return '{{{PHP' + env.tokenStack.length + '}}}'; |
|||
}); |
|||
}); |
|||
Prism.hooks.add('before-insert', function (env) { |
|||
if (env.language === 'php') { |
|||
env.code = env.backupCode; |
|||
delete env.backupCode; |
|||
} |
|||
}); |
|||
Prism.hooks.add('after-highlight', function (env) { |
|||
if (env.language !== 'php') { |
|||
return; |
|||
} |
|||
for (var i = 0, t = void 0; t = env.tokenStack[i]; i++) { |
|||
env.highlightedCode = env.highlightedCode.replace('{{{PHP' + (i + 1) + '}}}', Prism.highlight(t, env.grammar, 'php').replace(/\$/g, '$$$$')); |
|||
} |
|||
env.element.innerHTML = env.highlightedCode; |
|||
}); |
|||
Prism.hooks.add('wrap', function (env) { |
|||
if (env.language === 'php' && env.type === 'markup') { |
|||
env.content = env.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g, '<span class="token php">$1</span>'); |
|||
} |
|||
}); |
|||
Prism.languages.insertBefore('php', 'comment', { |
|||
markup: { |
|||
pattern: /<[^?]\/?(.*?)>/, |
|||
inside: Prism.languages.markup |
|||
}, |
|||
php: /\{\{\{PHP[0-9]+\}\}\}/ |
|||
}); |
|||
} |
|||
Prism.languages.python = { |
|||
'comment': { |
|||
pattern: /(^|[^\\])#.*/, |
|||
lookbehind: true |
|||
}, |
|||
'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/, |
|||
'function': { |
|||
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g, |
|||
lookbehind: true |
|||
}, |
|||
'class-name': { |
|||
pattern: /(\bclass\s+)[a-z0-9_]+/i, |
|||
lookbehind: true |
|||
}, |
|||
'keyword': /\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/, |
|||
'boolean': /\b(?:True|False)\b/, |
|||
'number': /\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i, |
|||
'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/, |
|||
'punctuation': /[{}[\];(),.:]/ |
|||
}; |
|||
(function (Prism) { |
|||
Prism.languages.ruby = Prism.languages.extend('clike', { |
|||
comment: /#(?!\{[^\r\n]*?\}).*/, |
|||
keyword: /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/ |
|||
}); |
|||
var interpolation = { |
|||
pattern: /#\{[^}]+\}/, |
|||
inside: { |
|||
delimiter: { |
|||
pattern: /^#\{|\}$/, |
|||
alias: 'tag' |
|||
}, |
|||
rest: Prism.util.clone(Prism.languages.ruby) |
|||
} |
|||
}; |
|||
Prism.languages.insertBefore('ruby', 'keyword', { |
|||
regex: [ |
|||
{ |
|||
pattern: /%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/, |
|||
inside: { interpolation: interpolation } |
|||
}, |
|||
{ |
|||
pattern: /%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/, |
|||
inside: { interpolation: interpolation } |
|||
}, |
|||
{ |
|||
pattern: /%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/, |
|||
inside: { interpolation: interpolation } |
|||
}, |
|||
{ |
|||
pattern: /%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/, |
|||
inside: { interpolation: interpolation } |
|||
}, |
|||
{ |
|||
pattern: /%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/, |
|||
inside: { interpolation: interpolation } |
|||
}, |
|||
{ |
|||
pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/, |
|||
lookbehind: true |
|||
} |
|||
], |
|||
variable: /[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/, |
|||
symbol: /:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/ |
|||
}); |
|||
Prism.languages.insertBefore('ruby', 'number', { |
|||
builtin: /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/, |
|||
constant: /\b[A-Z][a-zA-Z_0-9]*(?:[?!]|\b)/ |
|||
}); |
|||
Prism.languages.ruby.string = [ |
|||
{ |
|||
pattern: /%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/, |
|||
inside: { interpolation: interpolation } |
|||
}, |
|||
{ |
|||
pattern: /%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/, |
|||
inside: { interpolation: interpolation } |
|||
}, |
|||
{ |
|||
pattern: /%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/, |
|||
inside: { interpolation: interpolation } |
|||
}, |
|||
{ |
|||
pattern: /%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/, |
|||
inside: { interpolation: interpolation } |
|||
}, |
|||
{ |
|||
pattern: /%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/, |
|||
inside: { interpolation: interpolation } |
|||
}, |
|||
{ |
|||
pattern: /("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/, |
|||
inside: { interpolation: interpolation } |
|||
} |
|||
]; |
|||
}(Prism)); |
|||
|
|||
function isCodeSample(elm) { |
|||
return elm && elm.nodeName === 'PRE' && elm.className.indexOf('language-') !== -1; |
|||
} |
|||
function trimArg(predicateFn) { |
|||
return function (arg1, arg2) { |
|||
return predicateFn(arg2); |
|||
}; |
|||
} |
|||
var $_7l8l6j9ejd09evo3 = { |
|||
isCodeSample: isCodeSample, |
|||
trimArg: trimArg |
|||
}; |
|||
|
|||
var getSelectedCodeSample = function (editor) { |
|||
var node = editor.selection.getNode(); |
|||
if ($_7l8l6j9ejd09evo3.isCodeSample(node)) { |
|||
return node; |
|||
} |
|||
return null; |
|||
}; |
|||
var insertCodeSample = function (editor, language, code) { |
|||
editor.undoManager.transact(function () { |
|||
var node = getSelectedCodeSample(editor); |
|||
code = DOMUtils.DOM.encode(code); |
|||
if (node) { |
|||
editor.dom.setAttrib(node, 'class', 'language-' + language); |
|||
node.innerHTML = code; |
|||
Prism.highlightElement(node); |
|||
editor.selection.select(node); |
|||
} else { |
|||
editor.insertContent('<pre id="__new" class="language-' + language + '">' + code + '</pre>'); |
|||
editor.selection.select(editor.$('#__new').removeAttr('id')[0]); |
|||
} |
|||
}); |
|||
}; |
|||
var getCurrentCode = function (editor) { |
|||
var node = getSelectedCodeSample(editor); |
|||
if (node) { |
|||
return node.textContent; |
|||
} |
|||
return ''; |
|||
}; |
|||
var $_7a7usu9cjd09evn5 = { |
|||
getSelectedCodeSample: getSelectedCodeSample, |
|||
insertCodeSample: insertCodeSample, |
|||
getCurrentCode: getCurrentCode |
|||
}; |
|||
|
|||
var getLanguages$1 = function (editor) { |
|||
var defaultLanguages = [ |
|||
{ |
|||
text: 'HTML/XML', |
|||
value: 'markup' |
|||
}, |
|||
{ |
|||
text: 'JavaScript', |
|||
value: 'javascript' |
|||
}, |
|||
{ |
|||
text: 'CSS', |
|||
value: 'css' |
|||
}, |
|||
{ |
|||
text: 'PHP', |
|||
value: 'php' |
|||
}, |
|||
{ |
|||
text: 'Ruby', |
|||
value: 'ruby' |
|||
}, |
|||
{ |
|||
text: 'Python', |
|||
value: 'python' |
|||
}, |
|||
{ |
|||
text: 'Java', |
|||
value: 'java' |
|||
}, |
|||
{ |
|||
text: 'C', |
|||
value: 'c' |
|||
}, |
|||
{ |
|||
text: 'C#', |
|||
value: 'csharp' |
|||
}, |
|||
{ |
|||
text: 'C++', |
|||
value: 'cpp' |
|||
} |
|||
]; |
|||
var customLanguages = $_3zfvka9ajd09evn3.getLanguages(editor); |
|||
return customLanguages ? customLanguages : defaultLanguages; |
|||
}; |
|||
var getCurrentLanguage = function (editor) { |
|||
var matches; |
|||
var node = $_7a7usu9cjd09evn5.getSelectedCodeSample(editor); |
|||
if (node) { |
|||
matches = node.className.match(/language-(\w+)/); |
|||
return matches ? matches[1] : ''; |
|||
} |
|||
return ''; |
|||
}; |
|||
var $_cofyz49fjd09evo4 = { |
|||
getLanguages: getLanguages$1, |
|||
getCurrentLanguage: getCurrentLanguage |
|||
}; |
|||
|
|||
var $_4inqkk99jd09evn2 = { |
|||
open: function (editor) { |
|||
var minWidth = $_3zfvka9ajd09evn3.getDialogMinWidth(editor); |
|||
var minHeight = $_3zfvka9ajd09evn3.getDialogMinHeight(editor); |
|||
var currentLanguage = $_cofyz49fjd09evo4.getCurrentLanguage(editor); |
|||
var currentLanguages = $_cofyz49fjd09evo4.getLanguages(editor); |
|||
var currentCode = $_7a7usu9cjd09evn5.getCurrentCode(editor); |
|||
editor.windowManager.open({ |
|||
title: 'Insert/Edit code sample', |
|||
minWidth: minWidth, |
|||
minHeight: minHeight, |
|||
layout: 'flex', |
|||
direction: 'column', |
|||
align: 'stretch', |
|||
body: [ |
|||
{ |
|||
type: 'listbox', |
|||
name: 'language', |
|||
label: 'Language', |
|||
maxWidth: 200, |
|||
value: currentLanguage, |
|||
values: currentLanguages |
|||
}, |
|||
{ |
|||
type: 'textbox', |
|||
name: 'code', |
|||
multiline: true, |
|||
spellcheck: false, |
|||
ariaLabel: 'Code view', |
|||
flex: 1, |
|||
style: 'direction: ltr; text-align: left', |
|||
classes: 'monospace', |
|||
value: currentCode, |
|||
autofocus: true |
|||
} |
|||
], |
|||
onSubmit: function (e) { |
|||
$_7a7usu9cjd09evn5.insertCodeSample(editor, e.data.language, e.data.code); |
|||
} |
|||
}); |
|||
} |
|||
}; |
|||
|
|||
var register = function (editor) { |
|||
editor.addCommand('codesample', function () { |
|||
var node = editor.selection.getNode(); |
|||
if (editor.selection.isCollapsed() || $_7l8l6j9ejd09evo3.isCodeSample(node)) { |
|||
$_4inqkk99jd09evn2.open(editor); |
|||
} else { |
|||
editor.formatter.toggle('code'); |
|||
} |
|||
}); |
|||
}; |
|||
var $_91w40j98jd09evn1 = { register: register }; |
|||
|
|||
var setup = function (editor) { |
|||
var $ = editor.$; |
|||
editor.on('PreProcess', function (e) { |
|||
$('pre[contenteditable=false]', e.node).filter($_7l8l6j9ejd09evo3.trimArg($_7l8l6j9ejd09evo3.isCodeSample)).each(function (idx, elm) { |
|||
var $elm = $(elm), code = elm.textContent; |
|||
$elm.attr('class', $.trim($elm.attr('class'))); |
|||
$elm.removeAttr('contentEditable'); |
|||
$elm.empty().append($('<code></code>').each(function () { |
|||
this.textContent = code; |
|||
})); |
|||
}); |
|||
}); |
|||
editor.on('SetContent', function () { |
|||
var unprocessedCodeSamples = $('pre').filter($_7l8l6j9ejd09evo3.trimArg($_7l8l6j9ejd09evo3.isCodeSample)).filter(function (idx, elm) { |
|||
return elm.contentEditable !== 'false'; |
|||
}); |
|||
if (unprocessedCodeSamples.length) { |
|||
editor.undoManager.transact(function () { |
|||
unprocessedCodeSamples.each(function (idx, elm) { |
|||
$(elm).find('br').each(function (idx, elm) { |
|||
elm.parentNode.replaceChild(editor.getDoc().createTextNode('\n'), elm); |
|||
}); |
|||
elm.contentEditable = false; |
|||
elm.innerHTML = editor.dom.encode(elm.textContent); |
|||
Prism.highlightElement(elm); |
|||
elm.className = $.trim(elm.className); |
|||
}); |
|||
}); |
|||
} |
|||
}); |
|||
}; |
|||
var $_cenwwq9gjd09evo6 = { setup: setup }; |
|||
|
|||
var loadCss = function (editor, pluginUrl, addedInlineCss, addedCss) { |
|||
var linkElm; |
|||
var contentCss = $_3zfvka9ajd09evn3.getContentCss(editor); |
|||
if (editor.inline && addedInlineCss.get()) { |
|||
return; |
|||
} |
|||
if (!editor.inline && addedCss.get()) { |
|||
return; |
|||
} |
|||
if (editor.inline) { |
|||
addedInlineCss.set(true); |
|||
} else { |
|||
addedCss.set(true); |
|||
} |
|||
if (contentCss !== false) { |
|||
linkElm = editor.dom.create('link', { |
|||
rel: 'stylesheet', |
|||
href: contentCss ? contentCss : pluginUrl + '/css/prism.css' |
|||
}); |
|||
editor.getDoc().getElementsByTagName('head')[0].appendChild(linkElm); |
|||
} |
|||
}; |
|||
var $_1w66ds9hjd09evo9 = { loadCss: loadCss }; |
|||
|
|||
var register$1 = function (editor) { |
|||
editor.addButton('codesample', { |
|||
cmd: 'codesample', |
|||
title: 'Insert/Edit code sample' |
|||
}); |
|||
editor.addMenuItem('codesample', { |
|||
cmd: 'codesample', |
|||
text: 'Code sample', |
|||
icon: 'codesample' |
|||
}); |
|||
}; |
|||
var $_6mprvg9ijd09evoa = { register: register$1 }; |
|||
|
|||
var addedInlineCss = Cell(false); |
|||
PluginManager.add('codesample', function (editor, pluginUrl) { |
|||
var addedCss = Cell(false); |
|||
$_cenwwq9gjd09evo6.setup(editor); |
|||
$_6mprvg9ijd09evoa.register(editor); |
|||
$_91w40j98jd09evn1.register(editor); |
|||
editor.on('init', function () { |
|||
$_1w66ds9hjd09evo9.loadCss(editor, pluginUrl, addedInlineCss, addedCss); |
|||
}); |
|||
editor.on('dblclick', function (ev) { |
|||
if ($_7l8l6j9ejd09evo3.isCodeSample(ev.target)) { |
|||
$_4inqkk99jd09evn2.open(editor); |
|||
} |
|||
}); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1,7 @@ |
|||
// Exports the "colorpicker" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/colorpicker')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/colorpicker'
|
|||
require('./plugin.js'); |
@ -0,0 +1,126 @@ |
|||
(function () { |
|||
var colorpicker = (function () { |
|||
'use strict'; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var Color = tinymce.util.Tools.resolve('tinymce.util.Color'); |
|||
|
|||
var showPreview = function (win, hexColor) { |
|||
win.find('#preview')[0].getEl().style.background = hexColor; |
|||
}; |
|||
var setColor = function (win, value) { |
|||
var color = Color(value), rgb = color.toRgb(); |
|||
win.fromJSON({ |
|||
r: rgb.r, |
|||
g: rgb.g, |
|||
b: rgb.b, |
|||
hex: color.toHex().substr(1) |
|||
}); |
|||
showPreview(win, color.toHex()); |
|||
}; |
|||
var open = function (editor, callback, value) { |
|||
var win = editor.windowManager.open({ |
|||
title: 'Color', |
|||
items: { |
|||
type: 'container', |
|||
layout: 'flex', |
|||
direction: 'row', |
|||
align: 'stretch', |
|||
padding: 5, |
|||
spacing: 10, |
|||
items: [ |
|||
{ |
|||
type: 'colorpicker', |
|||
value: value, |
|||
onchange: function () { |
|||
var rgb = this.rgb(); |
|||
if (win) { |
|||
win.find('#r').value(rgb.r); |
|||
win.find('#g').value(rgb.g); |
|||
win.find('#b').value(rgb.b); |
|||
win.find('#hex').value(this.value().substr(1)); |
|||
showPreview(win, this.value()); |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
type: 'form', |
|||
padding: 0, |
|||
labelGap: 5, |
|||
defaults: { |
|||
type: 'textbox', |
|||
size: 7, |
|||
value: '0', |
|||
flex: 1, |
|||
spellcheck: false, |
|||
onchange: function () { |
|||
var colorPickerCtrl = win.find('colorpicker')[0]; |
|||
var name, value; |
|||
name = this.name(); |
|||
value = this.value(); |
|||
if (name === 'hex') { |
|||
value = '#' + value; |
|||
setColor(win, value); |
|||
colorPickerCtrl.value(value); |
|||
return; |
|||
} |
|||
value = { |
|||
r: win.find('#r').value(), |
|||
g: win.find('#g').value(), |
|||
b: win.find('#b').value() |
|||
}; |
|||
colorPickerCtrl.value(value); |
|||
setColor(win, value); |
|||
} |
|||
}, |
|||
items: [ |
|||
{ |
|||
name: 'r', |
|||
label: 'R', |
|||
autofocus: 1 |
|||
}, |
|||
{ |
|||
name: 'g', |
|||
label: 'G' |
|||
}, |
|||
{ |
|||
name: 'b', |
|||
label: 'B' |
|||
}, |
|||
{ |
|||
name: 'hex', |
|||
label: '#', |
|||
value: '000000' |
|||
}, |
|||
{ |
|||
name: 'preview', |
|||
type: 'container', |
|||
border: 1 |
|||
} |
|||
] |
|||
} |
|||
] |
|||
}, |
|||
onSubmit: function () { |
|||
callback('#' + win.toJSON().hex); |
|||
} |
|||
}); |
|||
setColor(win, value); |
|||
}; |
|||
var $_2hbjx89ljd09evps = { open: open }; |
|||
|
|||
PluginManager.add('colorpicker', function (editor) { |
|||
if (!editor.settings.color_picker_callback) { |
|||
editor.settings.color_picker_callback = function (callback, value) { |
|||
$_2hbjx89ljd09evps.open(editor, callback, value); |
|||
}; |
|||
} |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.Color"),i=function(e,n){e.find("#preview")[0].getEl().style.background=n},t=function(e,t){var l=n(t),a=l.toRgb();e.fromJSON({r:a.r,g:a.g,b:a.b,hex:l.toHex().substr(1)}),i(e,l.toHex())},l=function(e,n,l){var a=e.windowManager.open({title:"Color",items:{type:"container",layout:"flex",direction:"row",align:"stretch",padding:5,spacing:10,items:[{type:"colorpicker",value:l,onchange:function(){var e=this.rgb();a&&(a.find("#r").value(e.r),a.find("#g").value(e.g),a.find("#b").value(e.b),a.find("#hex").value(this.value().substr(1)),i(a,this.value()))}},{type:"form",padding:0,labelGap:5,defaults:{type:"textbox",size:7,value:"0",flex:1,spellcheck:!1,onchange:function(){var e,n,i=a.find("colorpicker")[0];if(e=this.name(),n=this.value(),"hex"===e)return t(a,n="#"+n),void i.value(n);n={r:a.find("#r").value(),g:a.find("#g").value(),b:a.find("#b").value()},i.value(n),t(a,n)}},items:[{name:"r",label:"R",autofocus:1},{name:"g",label:"G"},{name:"b",label:"B"},{name:"hex",label:"#",value:"000000"},{name:"preview",type:"container",border:1}]}]},onSubmit:function(){n("#"+a.toJSON().hex)}});t(a,l)};e.add("colorpicker",function(e){e.settings.color_picker_callback||(e.settings.color_picker_callback=function(n,i){l(e,n,i)})})}(); |
@ -0,0 +1,7 @@ |
|||
// Exports the "contextmenu" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/contextmenu')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/contextmenu'
|
|||
require('./plugin.js'); |
@ -0,0 +1,167 @@ |
|||
(function () { |
|||
var contextmenu = (function () { |
|||
'use strict'; |
|||
|
|||
var Cell = function (initial) { |
|||
var value = initial; |
|||
var get = function () { |
|||
return value; |
|||
}; |
|||
var set = function (v) { |
|||
value = v; |
|||
}; |
|||
var clone = function () { |
|||
return Cell(get()); |
|||
}; |
|||
return { |
|||
get: get, |
|||
set: set, |
|||
clone: clone |
|||
}; |
|||
}; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var get = function (visibleState) { |
|||
var isContextMenuVisible = function () { |
|||
return visibleState.get(); |
|||
}; |
|||
return { isContextMenuVisible: isContextMenuVisible }; |
|||
}; |
|||
var $_8dippc9qjd09evqc = { get: get }; |
|||
|
|||
var shouldNeverUseNative = function (editor) { |
|||
return editor.settings.contextmenu_never_use_native; |
|||
}; |
|||
var getContextMenu = function (editor) { |
|||
return editor.getParam('contextmenu', 'link openlink image inserttable | cell row column deletetable'); |
|||
}; |
|||
var $_ov1mf9sjd09evqf = { |
|||
shouldNeverUseNative: shouldNeverUseNative, |
|||
getContextMenu: getContextMenu |
|||
}; |
|||
|
|||
var Env = tinymce.util.Tools.resolve('tinymce.Env'); |
|||
|
|||
var DOMUtils = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); |
|||
|
|||
var nu = function (x, y) { |
|||
return { |
|||
x: x, |
|||
y: y |
|||
}; |
|||
}; |
|||
var transpose = function (pos, dx, dy) { |
|||
return nu(pos.x + dx, pos.y + dy); |
|||
}; |
|||
var fromPageXY = function (e) { |
|||
return nu(e.pageX, e.pageY); |
|||
}; |
|||
var fromClientXY = function (e) { |
|||
return nu(e.clientX, e.clientY); |
|||
}; |
|||
var transposeUiContainer = function (element, pos) { |
|||
if (element && DOMUtils.DOM.getStyle(element, 'position', true) !== 'static') { |
|||
var containerPos = DOMUtils.DOM.getPos(element); |
|||
var dx = containerPos.x - element.scrollLeft; |
|||
var dy = containerPos.y - element.scrollTop; |
|||
return transpose(pos, -dx, -dy); |
|||
} else { |
|||
return transpose(pos, 0, 0); |
|||
} |
|||
}; |
|||
var transposeContentAreaContainer = function (element, pos) { |
|||
var containerPos = DOMUtils.DOM.getPos(element); |
|||
return transpose(pos, containerPos.x, containerPos.y); |
|||
}; |
|||
var getUiContainer = function (editor) { |
|||
return Env.container; |
|||
}; |
|||
var getPos = function (editor, e) { |
|||
if (editor.inline) { |
|||
return transposeUiContainer(getUiContainer(editor), fromPageXY(e)); |
|||
} else { |
|||
var iframePos = transposeContentAreaContainer(editor.getContentAreaContainer(), fromClientXY(e)); |
|||
return transposeUiContainer(getUiContainer(editor), iframePos); |
|||
} |
|||
}; |
|||
var $_jtb59tjd09evqi = { getPos: getPos }; |
|||
|
|||
var Factory = tinymce.util.Tools.resolve('tinymce.ui.Factory'); |
|||
|
|||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools'); |
|||
|
|||
var renderMenu = function (editor, visibleState) { |
|||
var menu, contextmenu; |
|||
var items = []; |
|||
contextmenu = $_ov1mf9sjd09evqf.getContextMenu(editor); |
|||
Tools.each(contextmenu.split(/[ ,]/), function (name) { |
|||
var item = editor.menuItems[name]; |
|||
if (name === '|') { |
|||
item = { text: name }; |
|||
} |
|||
if (item) { |
|||
item.shortcut = ''; |
|||
items.push(item); |
|||
} |
|||
}); |
|||
for (var i = 0; i < items.length; i++) { |
|||
if (items[i].text === '|') { |
|||
if (i === 0 || i === items.length - 1) { |
|||
items.splice(i, 1); |
|||
} |
|||
} |
|||
} |
|||
menu = Factory.create('menu', { |
|||
items: items, |
|||
context: 'contextmenu', |
|||
classes: 'contextmenu' |
|||
}).renderTo(); |
|||
menu.on('hide', function (e) { |
|||
if (e.control === this) { |
|||
visibleState.set(false); |
|||
} |
|||
}); |
|||
editor.on('remove', function () { |
|||
menu.remove(); |
|||
menu = null; |
|||
}); |
|||
return menu; |
|||
}; |
|||
var show = function (editor, pos, visibleState, menu) { |
|||
if (menu.get() === null) { |
|||
menu.set(renderMenu(editor, visibleState)); |
|||
} else { |
|||
menu.get().show(); |
|||
} |
|||
menu.get().moveTo(pos.x, pos.y); |
|||
visibleState.set(true); |
|||
}; |
|||
var $_br9ypx9wjd09evql = { show: show }; |
|||
|
|||
var isNativeOverrideKeyEvent = function (editor, e) { |
|||
return e.ctrlKey && !$_ov1mf9sjd09evqf.shouldNeverUseNative(editor); |
|||
}; |
|||
var setup = function (editor, visibleState, menu) { |
|||
editor.on('contextmenu', function (e) { |
|||
if (isNativeOverrideKeyEvent(editor, e)) { |
|||
return; |
|||
} |
|||
e.preventDefault(); |
|||
$_br9ypx9wjd09evql.show(editor, $_jtb59tjd09evqi.getPos(editor, e), visibleState, menu); |
|||
}); |
|||
}; |
|||
var $_4xypji9rjd09evqe = { setup: setup }; |
|||
|
|||
PluginManager.add('contextmenu', function (editor) { |
|||
var menu = Cell(null), visibleState = Cell(false); |
|||
$_4xypji9rjd09evqe.setup(editor, visibleState, menu); |
|||
return $_8dippc9qjd09evqc.get(visibleState); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var t=function(n){var e=n,o=function(){return e};return{get:o,set:function(t){e=t},clone:function(){return t(o())}}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(t){return{isContextMenuVisible:function(){return t.get()}}},o=function(t){return t.settings.contextmenu_never_use_native},r=function(t){return t.getParam("contextmenu","link openlink image inserttable | cell row column deletetable")},i=tinymce.util.Tools.resolve("tinymce.Env"),u=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=function(t,n){return{x:t,y:n}},l=function(t,n,e){return c(t.x+n,t.y+e)},s=function(t,n){if(t&&"static"!==u.DOM.getStyle(t,"position",!0)){var e=u.DOM.getPos(t),o=e.x-t.scrollLeft,r=e.y-t.scrollTop;return l(n,-o,-r)}return l(n,0,0)},a=function(t){return i.container},f=function(t,n){if(t.inline)return s(a(),c((f=n).pageX,f.pageY));var e,o,r,i,f,m=(e=t.getContentAreaContainer(),o=c((i=n).clientX,i.clientY),r=u.DOM.getPos(e),l(o,r.x,r.y));return s(a(),m)},m=tinymce.util.Tools.resolve("tinymce.ui.Factory"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=function(t,n,e,o){null===o.get()?o.set(function(t,n){var e,o,i=[];o=r(t),v.each(o.split(/[ ,]/),function(n){var e=t.menuItems[n];"|"===n&&(e={text:n}),e&&(e.shortcut="",i.push(e))});for(var u=0;u<i.length;u++)"|"===i[u].text&&(0!==u&&u!==i.length-1||i.splice(u,1));return(e=m.create("menu",{items:i,context:"contextmenu",classes:"contextmenu"}).renderTo()).on("hide",function(t){t.control===this&&n.set(!1)}),t.on("remove",function(){e.remove(),e=null}),e}(t,e)):o.get().show(),o.get().moveTo(n.x,n.y),e.set(!0)},y=function(t,n,e){t.on("contextmenu",function(r){var i;i=t,(!r.ctrlKey||o(i))&&(r.preventDefault(),g(t,f(t,r),n,e))})};n.add("contextmenu",function(n){var o=t(null),r=t(!1);return y(n,r,o),e(r)})}(); |
@ -0,0 +1,7 @@ |
|||
// Exports the "directionality" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/directionality')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/directionality'
|
|||
require('./plugin.js'); |
@ -0,0 +1,66 @@ |
|||
(function () { |
|||
var directionality = (function () { |
|||
'use strict'; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools'); |
|||
|
|||
var setDir = function (editor, dir) { |
|||
var dom = editor.dom; |
|||
var curDir; |
|||
var blocks = editor.selection.getSelectedBlocks(); |
|||
if (blocks.length) { |
|||
curDir = dom.getAttrib(blocks[0], 'dir'); |
|||
Tools.each(blocks, function (block) { |
|||
if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) { |
|||
dom.setAttrib(block, 'dir', curDir !== dir ? dir : null); |
|||
} |
|||
}); |
|||
editor.nodeChanged(); |
|||
} |
|||
}; |
|||
var $_ddklpa2jd09evr9 = { setDir: setDir }; |
|||
|
|||
var register = function (editor) { |
|||
editor.addCommand('mceDirectionLTR', function () { |
|||
$_ddklpa2jd09evr9.setDir(editor, 'ltr'); |
|||
}); |
|||
editor.addCommand('mceDirectionRTL', function () { |
|||
$_ddklpa2jd09evr9.setDir(editor, 'rtl'); |
|||
}); |
|||
}; |
|||
var $_1otbxha1jd09evr6 = { register: register }; |
|||
|
|||
var generateSelector = function (dir) { |
|||
var selector = []; |
|||
Tools.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function (name) { |
|||
selector.push(name + '[dir=' + dir + ']'); |
|||
}); |
|||
return selector.join(','); |
|||
}; |
|||
var register$1 = function (editor) { |
|||
editor.addButton('ltr', { |
|||
title: 'Left to right', |
|||
cmd: 'mceDirectionLTR', |
|||
stateSelector: generateSelector('ltr') |
|||
}); |
|||
editor.addButton('rtl', { |
|||
title: 'Right to left', |
|||
cmd: 'mceDirectionRTL', |
|||
stateSelector: generateSelector('rtl') |
|||
}); |
|||
}; |
|||
var $_48h3zwa4jd09evrd = { register: register$1 }; |
|||
|
|||
PluginManager.add('directionality', function (editor) { |
|||
$_1otbxha1jd09evr6.register(editor); |
|||
$_48h3zwa4jd09evrd.register(editor); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(t,i){var n,o=t.dom,c=t.selection.getSelectedBlocks();c.length&&(n=o.getAttrib(c[0],"dir"),e.each(c,function(t){o.getParent(t.parentNode,'*[dir="'+i+'"]',o.getRoot())||o.setAttrib(t,"dir",n!==i?i:null)}),t.nodeChanged())},n=function(t){t.addCommand("mceDirectionLTR",function(){i(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){i(t,"rtl")})},o=function(t){var i=[];return e.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(e){i.push(e+"[dir="+t+"]")}),i.join(",")},c=function(t){t.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:o("ltr")}),t.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:o("rtl")})};t.add("directionality",function(t){n(t),c(t)})}(); |
After Width: | Height: | Size: 354 B |
After Width: | Height: | Size: 329 B |
After Width: | Height: | Size: 331 B |
After Width: | Height: | Size: 342 B |
After Width: | Height: | Size: 340 B |
After Width: | Height: | Size: 336 B |
After Width: | Height: | Size: 338 B |
After Width: | Height: | Size: 343 B |
After Width: | Height: | Size: 321 B |
After Width: | Height: | Size: 323 B |
After Width: | Height: | Size: 344 B |
After Width: | Height: | Size: 338 B |
After Width: | Height: | Size: 328 B |
After Width: | Height: | Size: 337 B |
After Width: | Height: | Size: 350 B |
After Width: | Height: | Size: 336 B |
@ -0,0 +1,7 @@ |
|||
// Exports the "emoticons" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/emoticons')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/emoticons'
|
|||
require('./plugin.js'); |
@ -0,0 +1,87 @@ |
|||
(function () { |
|||
var emoticons = (function () { |
|||
'use strict'; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools'); |
|||
|
|||
var emoticons = [ |
|||
[ |
|||
'cool', |
|||
'cry', |
|||
'embarassed', |
|||
'foot-in-mouth' |
|||
], |
|||
[ |
|||
'frown', |
|||
'innocent', |
|||
'kiss', |
|||
'laughing' |
|||
], |
|||
[ |
|||
'money-mouth', |
|||
'sealed', |
|||
'smile', |
|||
'surprised' |
|||
], |
|||
[ |
|||
'tongue-out', |
|||
'undecided', |
|||
'wink', |
|||
'yell' |
|||
] |
|||
]; |
|||
var getHtml = function (pluginUrl) { |
|||
var emoticonsHtml; |
|||
emoticonsHtml = '<table role="list" class="mce-grid">'; |
|||
Tools.each(emoticons, function (row) { |
|||
emoticonsHtml += '<tr>'; |
|||
Tools.each(row, function (icon) { |
|||
var emoticonUrl = pluginUrl + '/img/smiley-' + icon + '.gif'; |
|||
emoticonsHtml += '<td><a href="#" data-mce-url="' + emoticonUrl + '" data-mce-alt="' + icon + '" tabindex="-1" ' + 'role="option" aria-label="' + icon + '"><img src="' + emoticonUrl + '" style="width: 18px; height: 18px" role="presentation" /></a></td>'; |
|||
}); |
|||
emoticonsHtml += '</tr>'; |
|||
}); |
|||
emoticonsHtml += '</table>'; |
|||
return emoticonsHtml; |
|||
}; |
|||
var $_3gkq0ga8jd09evrp = { getHtml: getHtml }; |
|||
|
|||
var insertEmoticon = function (editor, src, alt) { |
|||
editor.insertContent(editor.dom.createHTML('img', { |
|||
src: src, |
|||
alt: alt |
|||
})); |
|||
}; |
|||
var register = function (editor, pluginUrl) { |
|||
var panelHtml = $_3gkq0ga8jd09evrp.getHtml(pluginUrl); |
|||
editor.addButton('emoticons', { |
|||
type: 'panelbutton', |
|||
panel: { |
|||
role: 'application', |
|||
autohide: true, |
|||
html: panelHtml, |
|||
onclick: function (e) { |
|||
var linkElm = editor.dom.getParent(e.target, 'a'); |
|||
if (linkElm) { |
|||
insertEmoticon(editor, linkElm.getAttribute('data-mce-url'), linkElm.getAttribute('data-mce-alt')); |
|||
this.hide(); |
|||
} |
|||
} |
|||
}, |
|||
tooltip: 'Emoticons' |
|||
}); |
|||
}; |
|||
var $_9tmk0ga7jd09evro = { register: register }; |
|||
|
|||
PluginManager.add('emoticons', function (editor, pluginUrl) { |
|||
$_9tmk0ga7jd09evro.register(editor, pluginUrl); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]],o=function(t){var o;return o='<table role="list" class="mce-grid">',e.each(i,function(i){o+="<tr>",e.each(i,function(e){var i=t+"/img/smiley-"+e+".gif";o+='<td><a href="#" data-mce-url="'+i+'" data-mce-alt="'+e+'" tabindex="-1" role="option" aria-label="'+e+'"><img src="'+i+'" style="width: 18px; height: 18px" role="presentation" /></a></td>'}),o+="</tr>"}),o+="</table>"},n=function(t,e){var i=o(e);t.addButton("emoticons",{type:"panelbutton",panel:{role:"application",autohide:!0,html:i,onclick:function(e){var i,o,n,a=t.dom.getParent(e.target,"a");a&&(i=t,o=a.getAttribute("data-mce-url"),n=a.getAttribute("data-mce-alt"),i.insertContent(i.dom.createHTML("img",{src:o,alt:n})),this.hide())}},tooltip:"Emoticons"})};t.add("emoticons",function(t,e){n(t,e)})}(); |
@ -0,0 +1,7 @@ |
|||
// Exports the "fullpage" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/fullpage')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/fullpage'
|
|||
require('./plugin.js'); |
@ -0,0 +1,519 @@ |
|||
(function () { |
|||
var fullpage = (function () { |
|||
'use strict'; |
|||
|
|||
var Cell = function (initial) { |
|||
var value = initial; |
|||
var get = function () { |
|||
return value; |
|||
}; |
|||
var set = function (v) { |
|||
value = v; |
|||
}; |
|||
var clone = function () { |
|||
return Cell(get()); |
|||
}; |
|||
return { |
|||
get: get, |
|||
set: set, |
|||
clone: clone |
|||
}; |
|||
}; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools'); |
|||
|
|||
var DomParser = tinymce.util.Tools.resolve('tinymce.html.DomParser'); |
|||
|
|||
var Node = tinymce.util.Tools.resolve('tinymce.html.Node'); |
|||
|
|||
var Serializer = tinymce.util.Tools.resolve('tinymce.html.Serializer'); |
|||
|
|||
var shouldHideInSourceView = function (editor) { |
|||
return editor.getParam('fullpage_hide_in_source_view'); |
|||
}; |
|||
var getDefaultXmlPi = function (editor) { |
|||
return editor.getParam('fullpage_default_xml_pi'); |
|||
}; |
|||
var getDefaultEncoding = function (editor) { |
|||
return editor.getParam('fullpage_default_encoding'); |
|||
}; |
|||
var getDefaultFontFamily = function (editor) { |
|||
return editor.getParam('fullpage_default_font_family'); |
|||
}; |
|||
var getDefaultFontSize = function (editor) { |
|||
return editor.getParam('fullpage_default_font_size'); |
|||
}; |
|||
var getDefaultTextColor = function (editor) { |
|||
return editor.getParam('fullpage_default_text_color'); |
|||
}; |
|||
var getDefaultTitle = function (editor) { |
|||
return editor.getParam('fullpage_default_title'); |
|||
}; |
|||
var getDefaultDocType = function (editor) { |
|||
return editor.getParam('fullpage_default_doctype', '<!DOCTYPE html>'); |
|||
}; |
|||
var $_anyw30b4jd09evvn = { |
|||
shouldHideInSourceView: shouldHideInSourceView, |
|||
getDefaultXmlPi: getDefaultXmlPi, |
|||
getDefaultEncoding: getDefaultEncoding, |
|||
getDefaultFontFamily: getDefaultFontFamily, |
|||
getDefaultFontSize: getDefaultFontSize, |
|||
getDefaultTextColor: getDefaultTextColor, |
|||
getDefaultTitle: getDefaultTitle, |
|||
getDefaultDocType: getDefaultDocType |
|||
}; |
|||
|
|||
var parseHeader = function (head) { |
|||
return DomParser({ |
|||
validate: false, |
|||
root_name: '#document' |
|||
}).parse(head); |
|||
}; |
|||
var htmlToData = function (editor, head) { |
|||
var headerFragment = parseHeader(head); |
|||
var data = {}; |
|||
var elm, matches; |
|||
function getAttr(elm, name) { |
|||
var value = elm.attr(name); |
|||
return value || ''; |
|||
} |
|||
data.fontface = $_anyw30b4jd09evvn.getDefaultFontFamily(editor); |
|||
data.fontsize = $_anyw30b4jd09evvn.getDefaultFontSize(editor); |
|||
elm = headerFragment.firstChild; |
|||
if (elm.type === 7) { |
|||
data.xml_pi = true; |
|||
matches = /encoding="([^"]+)"/.exec(elm.value); |
|||
if (matches) { |
|||
data.docencoding = matches[1]; |
|||
} |
|||
} |
|||
elm = headerFragment.getAll('#doctype')[0]; |
|||
if (elm) { |
|||
data.doctype = '<!DOCTYPE' + elm.value + '>'; |
|||
} |
|||
elm = headerFragment.getAll('title')[0]; |
|||
if (elm && elm.firstChild) { |
|||
data.title = elm.firstChild.value; |
|||
} |
|||
Tools.each(headerFragment.getAll('meta'), function (meta) { |
|||
var name = meta.attr('name'); |
|||
var httpEquiv = meta.attr('http-equiv'); |
|||
var matches; |
|||
if (name) { |
|||
data[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]; |
|||
} |
|||
} |
|||
}); |
|||
elm = headerFragment.getAll('html')[0]; |
|||
if (elm) { |
|||
data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); |
|||
} |
|||
data.stylesheets = []; |
|||
Tools.each(headerFragment.getAll('link'), function (link) { |
|||
if (link.attr('rel') === 'stylesheet') { |
|||
data.stylesheets.push(link.attr('href')); |
|||
} |
|||
}); |
|||
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; |
|||
}; |
|||
var dataToHtml = function (editor, data, head) { |
|||
var headerFragment, headElement, html, elm, value; |
|||
var dom = 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 = parseHeader(head); |
|||
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); |
|||
} |
|||
} |
|||
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(); |
|||
} |
|||
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(); |
|||
} |
|||
elm = null; |
|||
Tools.each(headerFragment.getAll('meta'), function (meta) { |
|||
if (meta.attr('http-equiv') === 'Content-Type') { |
|||
elm = meta; |
|||
} |
|||
}); |
|||
if (data.docencoding) { |
|||
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); |
|||
} else if (elm) { |
|||
elm.remove(); |
|||
} |
|||
elm = headerFragment.getAll('title')[0]; |
|||
if (data.title) { |
|||
if (!elm) { |
|||
elm = new Node('title', 1); |
|||
addHeadNode(elm); |
|||
} else { |
|||
elm.empty(); |
|||
} |
|||
elm.append(new Node('#text', 3)).value = data.title; |
|||
} else if (elm) { |
|||
elm.remove(); |
|||
} |
|||
Tools.each('keywords,description,author,copyright,robots'.split(','), function (name) { |
|||
var nodes = headerFragment.getAll('meta'); |
|||
var i, meta; |
|||
var value = data[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); |
|||
} |
|||
}); |
|||
var currentStyleSheetsMap = {}; |
|||
Tools.each(headerFragment.getAll('link'), function (stylesheet) { |
|||
if (stylesheet.attr('rel') === 'stylesheet') { |
|||
currentStyleSheetsMap[stylesheet.attr('href')] = stylesheet; |
|||
} |
|||
}); |
|||
Tools.each(data.stylesheets, function (stylesheet) { |
|||
if (!currentStyleSheetsMap[stylesheet]) { |
|||
elm = new Node('link', 1); |
|||
elm.attr({ |
|||
rel: 'stylesheet', |
|||
text: 'text/css', |
|||
href: stylesheet |
|||
}); |
|||
elm.shortEnded = true; |
|||
addHeadNode(elm); |
|||
} |
|||
delete currentStyleSheetsMap[stylesheet]; |
|||
}); |
|||
Tools.each(currentStyleSheetsMap, function (stylesheet) { |
|||
stylesheet.remove(); |
|||
}); |
|||
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); |
|||
dom.setAttribs(editor.getBody(), { |
|||
style: data.style, |
|||
dir: data.dir, |
|||
vLink: data.visited_color, |
|||
link: data.link_color, |
|||
aLink: data.active_color |
|||
}); |
|||
} |
|||
elm = headerFragment.getAll('html')[0]; |
|||
if (elm) { |
|||
setAttr(elm, 'lang', data.langcode); |
|||
setAttr(elm, 'xml:lang', data.langcode); |
|||
} |
|||
if (!headElement.firstChild) { |
|||
headElement.remove(); |
|||
} |
|||
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); |
|||
return html.substring(0, html.indexOf('</body>')); |
|||
}; |
|||
var $_8p8gcgb0jd09evv7 = { |
|||
parseHeader: parseHeader, |
|||
htmlToData: htmlToData, |
|||
dataToHtml: dataToHtml |
|||
}; |
|||
|
|||
var open = function (editor, headState) { |
|||
var data = $_8p8gcgb0jd09evv7.htmlToData(editor, headState.get()); |
|||
editor.windowManager.open({ |
|||
title: 'Document properties', |
|||
data: data, |
|||
defaults: { |
|||
type: 'textbox', |
|||
size: 40 |
|||
}, |
|||
body: [ |
|||
{ |
|||
name: 'title', |
|||
label: 'Title' |
|||
}, |
|||
{ |
|||
name: 'keywords', |
|||
label: 'Keywords' |
|||
}, |
|||
{ |
|||
name: 'description', |
|||
label: 'Description' |
|||
}, |
|||
{ |
|||
name: 'robots', |
|||
label: 'Robots' |
|||
}, |
|||
{ |
|||
name: 'author', |
|||
label: 'Author' |
|||
}, |
|||
{ |
|||
name: 'docencoding', |
|||
label: 'Encoding' |
|||
} |
|||
], |
|||
onSubmit: function (e) { |
|||
var headHtml = $_8p8gcgb0jd09evv7.dataToHtml(editor, Tools.extend(data, e.data), headState.get()); |
|||
headState.set(headHtml); |
|||
} |
|||
}); |
|||
}; |
|||
var $_69rv5vayjd09evv4 = { open: open }; |
|||
|
|||
var register = function (editor, headState) { |
|||
editor.addCommand('mceFullPageProperties', function () { |
|||
$_69rv5vayjd09evv4.open(editor, headState); |
|||
}); |
|||
}; |
|||
var $_24ypkzaxjd09evv3 = { register: register }; |
|||
|
|||
var protectHtml = function (protect, html) { |
|||
Tools.each(protect, function (pattern) { |
|||
html = html.replace(pattern, function (str) { |
|||
return '<!--mce:protected ' + escape(str) + '-->'; |
|||
}); |
|||
}); |
|||
return html; |
|||
}; |
|||
var unprotectHtml = function (html) { |
|||
return html.replace(/<!--mce:protected ([\s\S]*?)-->/g, function (a, m) { |
|||
return unescape(m); |
|||
}); |
|||
}; |
|||
var $_g0nxp5b6jd09evvu = { |
|||
protectHtml: protectHtml, |
|||
unprotectHtml: unprotectHtml |
|||
}; |
|||
|
|||
var each = Tools.each; |
|||
var low = function (s) { |
|||
return s.replace(/<\/?[A-Z]+/g, function (a) { |
|||
return a.toLowerCase(); |
|||
}); |
|||
}; |
|||
var handleSetContent = function (editor, headState, footState, evt) { |
|||
var startPos, endPos, content, headerFragment, styles = ''; |
|||
var dom = editor.dom; |
|||
var elm; |
|||
if (evt.selection) { |
|||
return; |
|||
} |
|||
content = $_g0nxp5b6jd09evvu.protectHtml(editor.settings.protect, evt.content); |
|||
if (evt.format === 'raw' && headState.get()) { |
|||
return; |
|||
} |
|||
if (evt.source_view && $_anyw30b4jd09evvn.shouldHideInSourceView(editor)) { |
|||
return; |
|||
} |
|||
if (content.length === 0 && !evt.source_view) { |
|||
content = Tools.trim(headState.get()) + '\n' + Tools.trim(content) + '\n' + Tools.trim(footState.get()); |
|||
} |
|||
content = content.replace(/<(\/?)BODY/gi, '<$1body'); |
|||
startPos = content.indexOf('<body'); |
|||
if (startPos !== -1) { |
|||
startPos = content.indexOf('>', startPos); |
|||
headState.set(low(content.substring(0, startPos + 1))); |
|||
endPos = content.indexOf('</body', startPos); |
|||
if (endPos === -1) { |
|||
endPos = content.length; |
|||
} |
|||
evt.content = Tools.trim(content.substring(startPos + 1, endPos)); |
|||
footState.set(low(content.substring(endPos))); |
|||
} else { |
|||
headState.set(getDefaultHeader(editor)); |
|||
footState.set('\n</body>\n</html>'); |
|||
} |
|||
headerFragment = $_8p8gcgb0jd09evv7.parseHeader(headState.get()); |
|||
each(headerFragment.getAll('style'), function (node) { |
|||
if (node.firstChild) { |
|||
styles += node.firstChild.value; |
|||
} |
|||
}); |
|||
elm = headerFragment.getAll('body')[0]; |
|||
if (elm) { |
|||
dom.setAttribs(editor.getBody(), { |
|||
style: elm.attr('style') || '', |
|||
dir: elm.attr('dir') || '', |
|||
vLink: elm.attr('vlink') || '', |
|||
link: elm.attr('link') || '', |
|||
aLink: elm.attr('alink') || '' |
|||
}); |
|||
} |
|||
dom.remove('fullpage_styles'); |
|||
var headElm = editor.getDoc().getElementsByTagName('head')[0]; |
|||
if (styles) { |
|||
dom.add(headElm, 'style', { id: 'fullpage_styles' }, styles); |
|||
elm = dom.get('fullpage_styles'); |
|||
if (elm.styleSheet) { |
|||
elm.styleSheet.cssText = styles; |
|||
} |
|||
} |
|||
var currentStyleSheetsMap = {}; |
|||
Tools.each(headElm.getElementsByTagName('link'), function (stylesheet) { |
|||
if (stylesheet.rel === 'stylesheet' && stylesheet.getAttribute('data-mce-fullpage')) { |
|||
currentStyleSheetsMap[stylesheet.href] = stylesheet; |
|||
} |
|||
}); |
|||
Tools.each(headerFragment.getAll('link'), function (stylesheet) { |
|||
var href = stylesheet.attr('href'); |
|||
if (!href) { |
|||
return true; |
|||
} |
|||
if (!currentStyleSheetsMap[href] && stylesheet.attr('rel') === 'stylesheet') { |
|||
dom.add(headElm, 'link', { |
|||
'rel': 'stylesheet', |
|||
'text': 'text/css', |
|||
'href': href, |
|||
'data-mce-fullpage': '1' |
|||
}); |
|||
} |
|||
delete currentStyleSheetsMap[href]; |
|||
}); |
|||
Tools.each(currentStyleSheetsMap, function (stylesheet) { |
|||
stylesheet.parentNode.removeChild(stylesheet); |
|||
}); |
|||
}; |
|||
var getDefaultHeader = function (editor) { |
|||
var header = '', value, styles = ''; |
|||
if ($_anyw30b4jd09evvn.getDefaultXmlPi(editor)) { |
|||
var piEncoding = $_anyw30b4jd09evvn.getDefaultEncoding(editor); |
|||
header += '<?xml version="1.0" encoding="' + (piEncoding ? piEncoding : 'ISO-8859-1') + '" ?>\n'; |
|||
} |
|||
header += $_anyw30b4jd09evvn.getDefaultDocType(editor); |
|||
header += '\n<html>\n<head>\n'; |
|||
if (value = $_anyw30b4jd09evvn.getDefaultTitle(editor)) { |
|||
header += '<title>' + value + '</title>\n'; |
|||
} |
|||
if (value = $_anyw30b4jd09evvn.getDefaultEncoding(editor)) { |
|||
header += '<meta http-equiv="Content-Type" content="text/html; charset=' + value + '" />\n'; |
|||
} |
|||
if (value = $_anyw30b4jd09evvn.getDefaultFontFamily(editor)) { |
|||
styles += 'font-family: ' + value + ';'; |
|||
} |
|||
if (value = $_anyw30b4jd09evvn.getDefaultFontSize(editor)) { |
|||
styles += 'font-size: ' + value + ';'; |
|||
} |
|||
if (value = $_anyw30b4jd09evvn.getDefaultTextColor(editor)) { |
|||
styles += 'color: ' + value + ';'; |
|||
} |
|||
header += '</head>\n<body' + (styles ? ' style="' + styles + '"' : '') + '>\n'; |
|||
return header; |
|||
}; |
|||
var handleGetContent = function (editor, head, foot, evt) { |
|||
if (!evt.selection && (!evt.source_view || !$_anyw30b4jd09evvn.shouldHideInSourceView(editor))) { |
|||
evt.content = $_g0nxp5b6jd09evvu.unprotectHtml(Tools.trim(head) + '\n' + Tools.trim(evt.content) + '\n' + Tools.trim(foot)); |
|||
} |
|||
}; |
|||
var setup = function (editor, headState, footState) { |
|||
editor.on('BeforeSetContent', function (evt) { |
|||
handleSetContent(editor, headState, footState, evt); |
|||
}); |
|||
editor.on('GetContent', function (evt) { |
|||
handleGetContent(editor, headState.get(), footState.get(), evt); |
|||
}); |
|||
}; |
|||
var $_fe5sfdb5jd09evvp = { setup: setup }; |
|||
|
|||
var register$1 = function (editor) { |
|||
editor.addButton('fullpage', { |
|||
title: 'Document properties', |
|||
cmd: 'mceFullPageProperties' |
|||
}); |
|||
editor.addMenuItem('fullpage', { |
|||
text: 'Document properties', |
|||
cmd: 'mceFullPageProperties', |
|||
context: 'file' |
|||
}); |
|||
}; |
|||
var $_52c7czb7jd09evvv = { register: register$1 }; |
|||
|
|||
PluginManager.add('fullpage', function (editor) { |
|||
var headState = Cell(''), footState = Cell(''); |
|||
$_24ypkzaxjd09evv3.register(editor, headState); |
|||
$_52c7czb7jd09evvv.register(editor); |
|||
$_fe5sfdb5jd09evvp.setup(editor, headState, footState); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1,7 @@ |
|||
// Exports the "fullscreen" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/fullscreen')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/fullscreen'
|
|||
require('./plugin.js'); |
@ -0,0 +1,174 @@ |
|||
(function () { |
|||
var fullscreen = (function () { |
|||
'use strict'; |
|||
|
|||
var Cell = function (initial) { |
|||
var value = initial; |
|||
var get = function () { |
|||
return value; |
|||
}; |
|||
var set = function (v) { |
|||
value = v; |
|||
}; |
|||
var clone = function () { |
|||
return Cell(get()); |
|||
}; |
|||
return { |
|||
get: get, |
|||
set: set, |
|||
clone: clone |
|||
}; |
|||
}; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var get = function (fullscreenState) { |
|||
return { |
|||
isFullscreen: function () { |
|||
return fullscreenState.get() !== null; |
|||
} |
|||
}; |
|||
}; |
|||
var $_dmb2mrbbjd09evwu = { get: get }; |
|||
|
|||
var DOMUtils = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); |
|||
|
|||
var fireFullscreenStateChanged = function (editor, state) { |
|||
editor.fire('FullscreenStateChanged', { state: state }); |
|||
}; |
|||
var $_5ri4j0bfjd09evxa = { fireFullscreenStateChanged: fireFullscreenStateChanged }; |
|||
|
|||
var DOM = DOMUtils.DOM; |
|||
var getWindowSize = function () { |
|||
var w; |
|||
var h; |
|||
var win = window; |
|||
var doc = document; |
|||
var body = doc.body; |
|||
if (body.offsetWidth) { |
|||
w = body.offsetWidth; |
|||
h = body.offsetHeight; |
|||
} |
|||
if (win.innerWidth && win.innerHeight) { |
|||
w = win.innerWidth; |
|||
h = win.innerHeight; |
|||
} |
|||
return { |
|||
w: w, |
|||
h: h |
|||
}; |
|||
}; |
|||
var getScrollPos = function () { |
|||
var vp = DOM.getViewPort(); |
|||
return { |
|||
x: vp.x, |
|||
y: vp.y |
|||
}; |
|||
}; |
|||
var setScrollPos = function (pos) { |
|||
window.scrollTo(pos.x, pos.y); |
|||
}; |
|||
var toggleFullscreen = function (editor, fullscreenState) { |
|||
var body = document.body; |
|||
var documentElement = document.documentElement; |
|||
var editorContainerStyle; |
|||
var editorContainer, iframe, iframeStyle; |
|||
var fullscreenInfo = fullscreenState.get(); |
|||
var resize = function () { |
|||
DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight)); |
|||
}; |
|||
var removeResize = function () { |
|||
DOM.unbind(window, 'resize', resize); |
|||
}; |
|||
editorContainer = editor.getContainer(); |
|||
editorContainerStyle = editorContainer.style; |
|||
iframe = editor.getContentAreaContainer().firstChild; |
|||
iframeStyle = iframe.style; |
|||
if (!fullscreenInfo) { |
|||
var newFullScreenInfo = { |
|||
scrollPos: getScrollPos(), |
|||
containerWidth: editorContainerStyle.width, |
|||
containerHeight: editorContainerStyle.height, |
|||
iframeWidth: iframeStyle.width, |
|||
iframeHeight: iframeStyle.height, |
|||
resizeHandler: resize, |
|||
removeHandler: removeResize |
|||
}; |
|||
iframeStyle.width = iframeStyle.height = '100%'; |
|||
editorContainerStyle.width = editorContainerStyle.height = ''; |
|||
DOM.addClass(body, 'mce-fullscreen'); |
|||
DOM.addClass(documentElement, 'mce-fullscreen'); |
|||
DOM.addClass(editorContainer, 'mce-fullscreen'); |
|||
DOM.bind(window, 'resize', resize); |
|||
editor.on('remove', removeResize); |
|||
resize(); |
|||
fullscreenState.set(newFullScreenInfo); |
|||
$_5ri4j0bfjd09evxa.fireFullscreenStateChanged(editor, true); |
|||
} else { |
|||
iframeStyle.width = fullscreenInfo.iframeWidth; |
|||
iframeStyle.height = fullscreenInfo.iframeHeight; |
|||
if (fullscreenInfo.containerWidth) { |
|||
editorContainerStyle.width = fullscreenInfo.containerWidth; |
|||
} |
|||
if (fullscreenInfo.containerHeight) { |
|||
editorContainerStyle.height = fullscreenInfo.containerHeight; |
|||
} |
|||
DOM.removeClass(body, 'mce-fullscreen'); |
|||
DOM.removeClass(documentElement, 'mce-fullscreen'); |
|||
DOM.removeClass(editorContainer, 'mce-fullscreen'); |
|||
setScrollPos(fullscreenInfo.scrollPos); |
|||
DOM.unbind(window, 'resize', fullscreenInfo.resizeHandler); |
|||
editor.off('remove', fullscreenInfo.removeHandler); |
|||
fullscreenState.set(null); |
|||
$_5ri4j0bfjd09evxa.fireFullscreenStateChanged(editor, false); |
|||
} |
|||
}; |
|||
var $_fpoonjbdjd09evwz = { toggleFullscreen: toggleFullscreen }; |
|||
|
|||
var register = function (editor, fullscreenState) { |
|||
editor.addCommand('mceFullScreen', function () { |
|||
$_fpoonjbdjd09evwz.toggleFullscreen(editor, fullscreenState); |
|||
}); |
|||
}; |
|||
var $_cit2ggbcjd09evwx = { register: register }; |
|||
|
|||
var postRender = function (editor) { |
|||
return function (e) { |
|||
var ctrl = e.control; |
|||
editor.on('FullscreenStateChanged', function (e) { |
|||
ctrl.active(e.state); |
|||
}); |
|||
}; |
|||
}; |
|||
var register$1 = function (editor) { |
|||
editor.addMenuItem('fullscreen', { |
|||
text: 'Fullscreen', |
|||
shortcut: 'Ctrl+Shift+F', |
|||
selectable: true, |
|||
cmd: 'mceFullScreen', |
|||
onPostRender: postRender(editor), |
|||
context: 'view' |
|||
}); |
|||
editor.addButton('fullscreen', { |
|||
active: false, |
|||
tooltip: 'Fullscreen', |
|||
cmd: 'mceFullScreen', |
|||
onPostRender: postRender(editor) |
|||
}); |
|||
}; |
|||
var $_c38toibgjd09evxb = { register: register$1 }; |
|||
|
|||
PluginManager.add('fullscreen', function (editor) { |
|||
var fullscreenState = Cell(null); |
|||
$_cit2ggbcjd09evwx.register(editor, fullscreenState); |
|||
$_c38toibgjd09evxb.register(editor); |
|||
editor.addShortcut('Ctrl+Shift+F', '', 'mceFullScreen'); |
|||
return $_dmb2mrbbjd09evwu.get(fullscreenState); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var e=function(t){var n=t,i=function(){return n};return{get:i,set:function(e){n=e},clone:function(){return e(i())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return{isFullscreen:function(){return null!==e.get()}}},i=function(e,t){e.fire("FullscreenStateChanged",{state:t})},r=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils").DOM,l=function(e,t){var n,l,o,c,s,u,d=document.body,a=document.documentElement,h=t.get(),f=function(){var e,t,n,i;r.setStyle(o,"height",(n=window,i=document.body,i.offsetWidth&&(e=i.offsetWidth,t=i.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}).h-(l.clientHeight-o.clientHeight))},m=function(){r.unbind(window,"resize",f)};if(n=(l=e.getContainer()).style,c=(o=e.getContentAreaContainer().firstChild).style,h)c.width=h.iframeWidth,c.height=h.iframeHeight,h.containerWidth&&(n.width=h.containerWidth),h.containerHeight&&(n.height=h.containerHeight),r.removeClass(d,"mce-fullscreen"),r.removeClass(a,"mce-fullscreen"),r.removeClass(l,"mce-fullscreen"),s=h.scrollPos,window.scrollTo(s.x,s.y),r.unbind(window,"resize",h.resizeHandler),e.off("remove",h.removeHandler),t.set(null),i(e,!1);else{var g={scrollPos:(u=r.getViewPort(),{x:u.x,y:u.y}),containerWidth:n.width,containerHeight:n.height,iframeWidth:c.width,iframeHeight:c.height,resizeHandler:f,removeHandler:m};c.width=c.height="100%",n.width=n.height="",r.addClass(d,"mce-fullscreen"),r.addClass(a,"mce-fullscreen"),r.addClass(l,"mce-fullscreen"),r.bind(window,"resize",f),e.on("remove",m),f(),t.set(g),i(e,!0)}},o=function(e,t){e.addCommand("mceFullScreen",function(){l(e,t)})},c=function(e){return function(t){var n=t.control;e.on("FullscreenStateChanged",function(e){n.active(e.state)})}},s=function(e){e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Shift+F",selectable:!0,cmd:"mceFullScreen",onPostRender:c(e),context:"view"}),e.addButton("fullscreen",{active:!1,tooltip:"Fullscreen",cmd:"mceFullScreen",onPostRender:c(e)})};t.add("fullscreen",function(t){var i=e(null);return o(t,i),s(t),t.addShortcut("Ctrl+Shift+F","","mceFullScreen"),n(i)})}(); |
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,7 @@ |
|||
// Exports the "help" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/help')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/help'
|
|||
require('./plugin.js'); |
@ -0,0 +1,7 @@ |
|||
// Exports the "hr" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/hr')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/hr'
|
|||
require('./plugin.js'); |
@ -0,0 +1,39 @@ |
|||
(function () { |
|||
var hr = (function () { |
|||
'use strict'; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var register = function (editor) { |
|||
editor.addCommand('InsertHorizontalRule', function () { |
|||
editor.execCommand('mceInsertContent', false, '<hr />'); |
|||
}); |
|||
}; |
|||
var $_817bcvbjjd09evxv = { register: register }; |
|||
|
|||
var register$1 = function (editor) { |
|||
editor.addButton('hr', { |
|||
icon: 'hr', |
|||
tooltip: 'Horizontal line', |
|||
cmd: 'InsertHorizontalRule' |
|||
}); |
|||
editor.addMenuItem('hr', { |
|||
icon: 'hr', |
|||
text: 'Horizontal line', |
|||
cmd: 'InsertHorizontalRule', |
|||
context: 'insert' |
|||
}); |
|||
}; |
|||
var $_f0wf0vbkjd09evxw = { register: register$1 }; |
|||
|
|||
PluginManager.add('hr', function (editor) { |
|||
$_817bcvbjjd09evxv.register(editor); |
|||
$_f0wf0vbkjd09evxw.register(editor); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var n=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")})},t=function(n){n.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),n.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})};tinymce.util.Tools.resolve("tinymce.PluginManager").add("hr",function(o){n(o),t(o)})}(); |
@ -0,0 +1,7 @@ |
|||
// Exports the "image" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/image')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/image'
|
|||
require('./plugin.js'); |
@ -0,0 +1,952 @@ |
|||
(function () { |
|||
var image = (function () { |
|||
'use strict'; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools'); |
|||
|
|||
var hasDimensions = function (editor) { |
|||
return editor.settings.image_dimensions === false ? false : true; |
|||
}; |
|||
var hasAdvTab = function (editor) { |
|||
return editor.settings.image_advtab === true ? true : false; |
|||
}; |
|||
var getPrependUrl = function (editor) { |
|||
return editor.getParam('image_prepend_url', ''); |
|||
}; |
|||
var getClassList = function (editor) { |
|||
return editor.getParam('image_class_list'); |
|||
}; |
|||
var hasDescription = function (editor) { |
|||
return editor.settings.image_description === false ? false : true; |
|||
}; |
|||
var hasImageTitle = function (editor) { |
|||
return editor.settings.image_title === true ? true : false; |
|||
}; |
|||
var hasImageCaption = function (editor) { |
|||
return editor.settings.image_caption === true ? true : false; |
|||
}; |
|||
var getImageList = function (editor) { |
|||
return editor.getParam('image_list', false); |
|||
}; |
|||
var hasUploadUrl = function (editor) { |
|||
return editor.getParam('images_upload_url', false); |
|||
}; |
|||
var hasUploadHandler = function (editor) { |
|||
return editor.getParam('images_upload_handler', false); |
|||
}; |
|||
var getUploadUrl = function (editor) { |
|||
return editor.getParam('images_upload_url'); |
|||
}; |
|||
var getUploadHandler = function (editor) { |
|||
return editor.getParam('images_upload_handler'); |
|||
}; |
|||
var getUploadBasePath = function (editor) { |
|||
return editor.getParam('images_upload_base_path'); |
|||
}; |
|||
var getUploadCredentials = function (editor) { |
|||
return editor.getParam('images_upload_credentials'); |
|||
}; |
|||
var $_7gt9p3bqjd09evyc = { |
|||
hasDimensions: hasDimensions, |
|||
hasAdvTab: hasAdvTab, |
|||
getPrependUrl: getPrependUrl, |
|||
getClassList: getClassList, |
|||
hasDescription: hasDescription, |
|||
hasImageTitle: hasImageTitle, |
|||
hasImageCaption: hasImageCaption, |
|||
getImageList: getImageList, |
|||
hasUploadUrl: hasUploadUrl, |
|||
hasUploadHandler: hasUploadHandler, |
|||
getUploadUrl: getUploadUrl, |
|||
getUploadHandler: getUploadHandler, |
|||
getUploadBasePath: getUploadBasePath, |
|||
getUploadCredentials: getUploadCredentials |
|||
}; |
|||
|
|||
var global = typeof window !== 'undefined' ? window : Function('return this;')(); |
|||
|
|||
var path = function (parts, scope) { |
|||
var o = scope !== undefined && scope !== null ? scope : global; |
|||
for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) |
|||
o = o[parts[i]]; |
|||
return o; |
|||
}; |
|||
var resolve = function (p, scope) { |
|||
var parts = p.split('.'); |
|||
return path(parts, scope); |
|||
}; |
|||
var step = function (o, part) { |
|||
if (o[part] === undefined || o[part] === null) |
|||
o[part] = {}; |
|||
return o[part]; |
|||
}; |
|||
var forge = function (parts, target) { |
|||
var o = target !== undefined ? target : global; |
|||
for (var i = 0; i < parts.length; ++i) |
|||
o = step(o, parts[i]); |
|||
return o; |
|||
}; |
|||
var namespace = function (name, target) { |
|||
var parts = name.split('.'); |
|||
return forge(parts, target); |
|||
}; |
|||
var $_9x72nsbujd09evyo = { |
|||
path: path, |
|||
resolve: resolve, |
|||
forge: forge, |
|||
namespace: namespace |
|||
}; |
|||
|
|||
var unsafe = function (name, scope) { |
|||
return $_9x72nsbujd09evyo.resolve(name, scope); |
|||
}; |
|||
var getOrDie = function (name, scope) { |
|||
var actual = unsafe(name, scope); |
|||
if (actual === undefined || actual === null) |
|||
throw name + ' not available on this browser'; |
|||
return actual; |
|||
}; |
|||
var $_8gjv21btjd09evyl = { getOrDie: getOrDie }; |
|||
|
|||
function FileReader () { |
|||
var f = $_8gjv21btjd09evyl.getOrDie('FileReader'); |
|||
return new f(); |
|||
} |
|||
|
|||
var Promise = tinymce.util.Tools.resolve('tinymce.util.Promise'); |
|||
|
|||
var XHR = tinymce.util.Tools.resolve('tinymce.util.XHR'); |
|||
|
|||
var parseIntAndGetMax = function (val1, val2) { |
|||
return Math.max(parseInt(val1, 10), parseInt(val2, 10)); |
|||
}; |
|||
var getImageSize = function (url, callback) { |
|||
var img = document.createElement('img'); |
|||
function done(width, height) { |
|||
if (img.parentNode) { |
|||
img.parentNode.removeChild(img); |
|||
} |
|||
callback({ |
|||
width: width, |
|||
height: height |
|||
}); |
|||
} |
|||
img.onload = function () { |
|||
var width = parseIntAndGetMax(img.width, img.clientWidth); |
|||
var height = parseIntAndGetMax(img.height, img.clientHeight); |
|||
done(width, height); |
|||
}; |
|||
img.onerror = function () { |
|||
done(0, 0); |
|||
}; |
|||
var style = img.style; |
|||
style.visibility = 'hidden'; |
|||
style.position = 'fixed'; |
|||
style.bottom = style.left = '0px'; |
|||
style.width = style.height = 'auto'; |
|||
document.body.appendChild(img); |
|||
img.src = url; |
|||
}; |
|||
var buildListItems = function (inputList, itemCallback, startItems) { |
|||
function appendItems(values, output) { |
|||
output = output || []; |
|||
Tools.each(values, function (item) { |
|||
var menuItem = { text: item.text || item.title }; |
|||
if (item.menu) { |
|||
menuItem.menu = appendItems(item.menu); |
|||
} else { |
|||
menuItem.value = item.value; |
|||
itemCallback(menuItem); |
|||
} |
|||
output.push(menuItem); |
|||
}); |
|||
return output; |
|||
} |
|||
return appendItems(inputList, startItems || []); |
|||
}; |
|||
var removePixelSuffix = function (value) { |
|||
if (value) { |
|||
value = value.replace(/px$/, ''); |
|||
} |
|||
return value; |
|||
}; |
|||
var addPixelSuffix = function (value) { |
|||
if (value.length > 0 && /^[0-9]+$/.test(value)) { |
|||
value += 'px'; |
|||
} |
|||
return value; |
|||
}; |
|||
var mergeMargins = function (css) { |
|||
if (css.margin) { |
|||
var splitMargin = css.margin.split(' '); |
|||
switch (splitMargin.length) { |
|||
case 1: |
|||
css['margin-top'] = css['margin-top'] || splitMargin[0]; |
|||
css['margin-right'] = css['margin-right'] || splitMargin[0]; |
|||
css['margin-bottom'] = css['margin-bottom'] || splitMargin[0]; |
|||
css['margin-left'] = css['margin-left'] || splitMargin[0]; |
|||
break; |
|||
case 2: |
|||
css['margin-top'] = css['margin-top'] || splitMargin[0]; |
|||
css['margin-right'] = css['margin-right'] || splitMargin[1]; |
|||
css['margin-bottom'] = css['margin-bottom'] || splitMargin[0]; |
|||
css['margin-left'] = css['margin-left'] || splitMargin[1]; |
|||
break; |
|||
case 3: |
|||
css['margin-top'] = css['margin-top'] || splitMargin[0]; |
|||
css['margin-right'] = css['margin-right'] || splitMargin[1]; |
|||
css['margin-bottom'] = css['margin-bottom'] || splitMargin[2]; |
|||
css['margin-left'] = css['margin-left'] || splitMargin[1]; |
|||
break; |
|||
case 4: |
|||
css['margin-top'] = css['margin-top'] || splitMargin[0]; |
|||
css['margin-right'] = css['margin-right'] || splitMargin[1]; |
|||
css['margin-bottom'] = css['margin-bottom'] || splitMargin[2]; |
|||
css['margin-left'] = css['margin-left'] || splitMargin[3]; |
|||
} |
|||
delete css.margin; |
|||
} |
|||
return css; |
|||
}; |
|||
var createImageList = function (editor, callback) { |
|||
var imageList = $_7gt9p3bqjd09evyc.getImageList(editor); |
|||
if (typeof imageList === 'string') { |
|||
XHR.send({ |
|||
url: imageList, |
|||
success: function (text) { |
|||
callback(JSON.parse(text)); |
|||
} |
|||
}); |
|||
} else if (typeof imageList === 'function') { |
|||
imageList(callback); |
|||
} else { |
|||
callback(imageList); |
|||
} |
|||
}; |
|||
var waitLoadImage = function (editor, data, imgElm) { |
|||
function selectImage() { |
|||
imgElm.onload = imgElm.onerror = null; |
|||
if (editor.selection) { |
|||
editor.selection.select(imgElm); |
|||
editor.nodeChanged(); |
|||
} |
|||
} |
|||
imgElm.onload = function () { |
|||
if (!data.width && !data.height && $_7gt9p3bqjd09evyc.hasDimensions(editor)) { |
|||
editor.dom.setAttribs(imgElm, { |
|||
width: imgElm.clientWidth, |
|||
height: imgElm.clientHeight |
|||
}); |
|||
} |
|||
selectImage(); |
|||
}; |
|||
imgElm.onerror = selectImage; |
|||
}; |
|||
var blobToDataUri = function (blob) { |
|||
return new Promise(function (resolve, reject) { |
|||
var reader = new FileReader(); |
|||
reader.onload = function () { |
|||
resolve(reader.result); |
|||
}; |
|||
reader.onerror = function () { |
|||
reject(FileReader.error.message); |
|||
}; |
|||
reader.readAsDataURL(blob); |
|||
}); |
|||
}; |
|||
var $_8r0kc6brjd09evyf = { |
|||
getImageSize: getImageSize, |
|||
buildListItems: buildListItems, |
|||
removePixelSuffix: removePixelSuffix, |
|||
addPixelSuffix: addPixelSuffix, |
|||
mergeMargins: mergeMargins, |
|||
createImageList: createImageList, |
|||
waitLoadImage: waitLoadImage, |
|||
blobToDataUri: blobToDataUri |
|||
}; |
|||
|
|||
var updateVSpaceHSpaceBorder = function (editor) { |
|||
return function (evt) { |
|||
var dom = editor.dom; |
|||
var rootControl = evt.control.rootControl; |
|||
if (!$_7gt9p3bqjd09evyc.hasAdvTab(editor)) { |
|||
return; |
|||
} |
|||
var data = rootControl.toJSON(); |
|||
var css = dom.parseStyle(data.style); |
|||
rootControl.find('#vspace').value(''); |
|||
rootControl.find('#hspace').value(''); |
|||
css = $_8r0kc6brjd09evyf.mergeMargins(css); |
|||
if (css['margin-top'] && css['margin-bottom'] || css['margin-right'] && css['margin-left']) { |
|||
if (css['margin-top'] === css['margin-bottom']) { |
|||
rootControl.find('#vspace').value($_8r0kc6brjd09evyf.removePixelSuffix(css['margin-top'])); |
|||
} else { |
|||
rootControl.find('#vspace').value(''); |
|||
} |
|||
if (css['margin-right'] === css['margin-left']) { |
|||
rootControl.find('#hspace').value($_8r0kc6brjd09evyf.removePixelSuffix(css['margin-right'])); |
|||
} else { |
|||
rootControl.find('#hspace').value(''); |
|||
} |
|||
} |
|||
if (css['border-width']) { |
|||
rootControl.find('#border').value($_8r0kc6brjd09evyf.removePixelSuffix(css['border-width'])); |
|||
} |
|||
rootControl.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css)))); |
|||
}; |
|||
}; |
|||
var makeTab = function (editor, updateStyle) { |
|||
return { |
|||
title: 'Advanced', |
|||
type: 'form', |
|||
pack: 'start', |
|||
items: [ |
|||
{ |
|||
label: 'Style', |
|||
name: 'style', |
|||
type: 'textbox', |
|||
onchange: updateVSpaceHSpaceBorder(editor) |
|||
}, |
|||
{ |
|||
type: 'form', |
|||
layout: 'grid', |
|||
packV: 'start', |
|||
columns: 2, |
|||
padding: 0, |
|||
alignH: [ |
|||
'left', |
|||
'right' |
|||
], |
|||
defaults: { |
|||
type: 'textbox', |
|||
maxWidth: 50, |
|||
onchange: function (evt) { |
|||
updateStyle(editor, evt.control.rootControl); |
|||
} |
|||
}, |
|||
items: [ |
|||
{ |
|||
label: 'Vertical space', |
|||
name: 'vspace' |
|||
}, |
|||
{ |
|||
label: 'Horizontal space', |
|||
name: 'hspace' |
|||
}, |
|||
{ |
|||
label: 'Border', |
|||
name: 'border' |
|||
} |
|||
] |
|||
} |
|||
] |
|||
}; |
|||
}; |
|||
var $_9eockpbyjd09evyr = { makeTab: makeTab }; |
|||
|
|||
var doSyncSize = function (widthCtrl, heightCtrl) { |
|||
widthCtrl.state.set('oldVal', widthCtrl.value()); |
|||
heightCtrl.state.set('oldVal', heightCtrl.value()); |
|||
}; |
|||
var doSizeControls = function (win, f) { |
|||
var widthCtrl = win.find('#width')[0]; |
|||
var heightCtrl = win.find('#height')[0]; |
|||
var constrained = win.find('#constrain')[0]; |
|||
if (widthCtrl && heightCtrl && constrained) { |
|||
f(widthCtrl, heightCtrl, constrained.checked()); |
|||
} |
|||
}; |
|||
var doUpdateSize = function (widthCtrl, heightCtrl, isContrained) { |
|||
var oldWidth = widthCtrl.state.get('oldVal'); |
|||
var oldHeight = heightCtrl.state.get('oldVal'); |
|||
var newWidth = widthCtrl.value(); |
|||
var newHeight = heightCtrl.value(); |
|||
if (isContrained && oldWidth && oldHeight && newWidth && newHeight) { |
|||
if (newWidth !== oldWidth) { |
|||
newHeight = Math.round(newWidth / oldWidth * newHeight); |
|||
if (!isNaN(newHeight)) { |
|||
heightCtrl.value(newHeight); |
|||
} |
|||
} else { |
|||
newWidth = Math.round(newHeight / oldHeight * newWidth); |
|||
if (!isNaN(newWidth)) { |
|||
widthCtrl.value(newWidth); |
|||
} |
|||
} |
|||
} |
|||
doSyncSize(widthCtrl, heightCtrl); |
|||
}; |
|||
var syncSize = function (win) { |
|||
doSizeControls(win, doSyncSize); |
|||
}; |
|||
var updateSize = function (win) { |
|||
doSizeControls(win, doUpdateSize); |
|||
}; |
|||
var createUi = function () { |
|||
var recalcSize = function (evt) { |
|||
updateSize(evt.control.rootControl); |
|||
}; |
|||
return { |
|||
type: 'container', |
|||
label: 'Dimensions', |
|||
layout: 'flex', |
|||
align: 'center', |
|||
spacing: 5, |
|||
items: [ |
|||
{ |
|||
name: 'width', |
|||
type: 'textbox', |
|||
maxLength: 5, |
|||
size: 5, |
|||
onchange: recalcSize, |
|||
ariaLabel: 'Width' |
|||
}, |
|||
{ |
|||
type: 'label', |
|||
text: 'x' |
|||
}, |
|||
{ |
|||
name: 'height', |
|||
type: 'textbox', |
|||
maxLength: 5, |
|||
size: 5, |
|||
onchange: recalcSize, |
|||
ariaLabel: 'Height' |
|||
}, |
|||
{ |
|||
name: 'constrain', |
|||
type: 'checkbox', |
|||
checked: true, |
|||
text: 'Constrain proportions' |
|||
} |
|||
] |
|||
}; |
|||
}; |
|||
var $_4wfur4c0jd09evyx = { |
|||
createUi: createUi, |
|||
syncSize: syncSize, |
|||
updateSize: updateSize |
|||
}; |
|||
|
|||
var onSrcChange = function (evt, editor) { |
|||
var srcURL, prependURL, absoluteURLPattern; |
|||
var meta = evt.meta || {}; |
|||
var control = evt.control; |
|||
var rootControl = control.rootControl; |
|||
var imageListCtrl = rootControl.find('#image-list')[0]; |
|||
if (imageListCtrl) { |
|||
imageListCtrl.value(editor.convertURL(control.value(), 'src')); |
|||
} |
|||
Tools.each(meta, function (value, key) { |
|||
rootControl.find('#' + key).value(value); |
|||
}); |
|||
if (!meta.width && !meta.height) { |
|||
srcURL = editor.convertURL(control.value(), 'src'); |
|||
prependURL = $_7gt9p3bqjd09evyc.getPrependUrl(editor); |
|||
absoluteURLPattern = new RegExp('^(?:[a-z]+:)?//', 'i'); |
|||
if (prependURL && !absoluteURLPattern.test(srcURL) && srcURL.substring(0, prependURL.length) !== prependURL) { |
|||
srcURL = prependURL + srcURL; |
|||
} |
|||
control.value(srcURL); |
|||
$_8r0kc6brjd09evyf.getImageSize(editor.documentBaseURI.toAbsolute(control.value()), function (data) { |
|||
if (data.width && data.height && $_7gt9p3bqjd09evyc.hasDimensions(editor)) { |
|||
rootControl.find('#width').value(data.width); |
|||
rootControl.find('#height').value(data.height); |
|||
$_4wfur4c0jd09evyx.updateSize(rootControl); |
|||
} |
|||
}); |
|||
} |
|||
}; |
|||
var onBeforeCall = function (evt) { |
|||
evt.meta = evt.control.rootControl.toJSON(); |
|||
}; |
|||
var getGeneralItems = function (editor, imageListCtrl) { |
|||
var generalFormItems = [ |
|||
{ |
|||
name: 'src', |
|||
type: 'filepicker', |
|||
filetype: 'image', |
|||
label: 'Source', |
|||
autofocus: true, |
|||
onchange: function (evt) { |
|||
onSrcChange(evt, editor); |
|||
}, |
|||
onbeforecall: onBeforeCall |
|||
}, |
|||
imageListCtrl |
|||
]; |
|||
if ($_7gt9p3bqjd09evyc.hasDescription(editor)) { |
|||
generalFormItems.push({ |
|||
name: 'alt', |
|||
type: 'textbox', |
|||
label: 'Image description' |
|||
}); |
|||
} |
|||
if ($_7gt9p3bqjd09evyc.hasImageTitle(editor)) { |
|||
generalFormItems.push({ |
|||
name: 'title', |
|||
type: 'textbox', |
|||
label: 'Image Title' |
|||
}); |
|||
} |
|||
if ($_7gt9p3bqjd09evyc.hasDimensions(editor)) { |
|||
generalFormItems.push($_4wfur4c0jd09evyx.createUi()); |
|||
} |
|||
if ($_7gt9p3bqjd09evyc.getClassList(editor)) { |
|||
generalFormItems.push({ |
|||
name: 'class', |
|||
type: 'listbox', |
|||
label: 'Class', |
|||
values: $_8r0kc6brjd09evyf.buildListItems($_7gt9p3bqjd09evyc.getClassList(editor), function (item) { |
|||
if (item.value) { |
|||
item.textStyle = function () { |
|||
return editor.formatter.getCssText({ |
|||
inline: 'img', |
|||
classes: [item.value] |
|||
}); |
|||
}; |
|||
} |
|||
}) |
|||
}); |
|||
} |
|||
if ($_7gt9p3bqjd09evyc.hasImageCaption(editor)) { |
|||
generalFormItems.push({ |
|||
name: 'caption', |
|||
type: 'checkbox', |
|||
label: 'Caption' |
|||
}); |
|||
} |
|||
return generalFormItems; |
|||
}; |
|||
var makeTab$1 = function (editor, imageListCtrl) { |
|||
return { |
|||
title: 'General', |
|||
type: 'form', |
|||
items: getGeneralItems(editor, imageListCtrl) |
|||
}; |
|||
}; |
|||
var $_3ni2wpbzjd09evyu = { |
|||
makeTab: makeTab$1, |
|||
getGeneralItems: getGeneralItems |
|||
}; |
|||
|
|||
var url = function () { |
|||
return $_8gjv21btjd09evyl.getOrDie('URL'); |
|||
}; |
|||
var createObjectURL = function (blob) { |
|||
return url().createObjectURL(blob); |
|||
}; |
|||
var revokeObjectURL = function (u) { |
|||
url().revokeObjectURL(u); |
|||
}; |
|||
var $_9s3gltc2jd09evz2 = { |
|||
createObjectURL: createObjectURL, |
|||
revokeObjectURL: revokeObjectURL |
|||
}; |
|||
|
|||
var Factory = tinymce.util.Tools.resolve('tinymce.ui.Factory'); |
|||
|
|||
function XMLHttpRequest () { |
|||
var f = $_8gjv21btjd09evyl.getOrDie('XMLHttpRequest'); |
|||
return new f(); |
|||
} |
|||
|
|||
var noop = function () { |
|||
}; |
|||
var pathJoin = function (path1, path2) { |
|||
if (path1) { |
|||
return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, ''); |
|||
} |
|||
return path2; |
|||
}; |
|||
function Uploader (settings) { |
|||
var defaultHandler = function (blobInfo, success, failure, progress) { |
|||
var xhr, formData; |
|||
xhr = new XMLHttpRequest(); |
|||
xhr.open('POST', settings.url); |
|||
xhr.withCredentials = settings.credentials; |
|||
xhr.upload.onprogress = function (e) { |
|||
progress(e.loaded / e.total * 100); |
|||
}; |
|||
xhr.onerror = function () { |
|||
failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status); |
|||
}; |
|||
xhr.onload = function () { |
|||
var json; |
|||
if (xhr.status < 200 || xhr.status >= 300) { |
|||
failure('HTTP Error: ' + xhr.status); |
|||
return; |
|||
} |
|||
json = JSON.parse(xhr.responseText); |
|||
if (!json || typeof json.location !== 'string') { |
|||
failure('Invalid JSON: ' + xhr.responseText); |
|||
return; |
|||
} |
|||
success(pathJoin(settings.basePath, json.location)); |
|||
}; |
|||
formData = new FormData(); |
|||
formData.append('file', blobInfo.blob(), blobInfo.filename()); |
|||
xhr.send(formData); |
|||
}; |
|||
var uploadBlob = function (blobInfo, handler) { |
|||
return new Promise(function (resolve, reject) { |
|||
try { |
|||
handler(blobInfo, resolve, reject, noop); |
|||
} catch (ex) { |
|||
reject(ex.message); |
|||
} |
|||
}); |
|||
}; |
|||
var isDefaultHandler = function (handler) { |
|||
return handler === defaultHandler; |
|||
}; |
|||
var upload = function (blobInfo) { |
|||
return !settings.url && isDefaultHandler(settings.handler) ? Promise.reject('Upload url missing from the settings.') : uploadBlob(blobInfo, settings.handler); |
|||
}; |
|||
settings = Tools.extend({ |
|||
credentials: false, |
|||
handler: defaultHandler |
|||
}, settings); |
|||
return { upload: upload }; |
|||
} |
|||
|
|||
var onFileInput = function (editor) { |
|||
return function (evt) { |
|||
var Throbber = Factory.get('Throbber'); |
|||
var rootControl = evt.control.rootControl; |
|||
var throbber = new Throbber(rootControl.getEl()); |
|||
var file = evt.control.value(); |
|||
var blobUri = $_9s3gltc2jd09evz2.createObjectURL(file); |
|||
var uploader = Uploader({ |
|||
url: $_7gt9p3bqjd09evyc.getUploadUrl(editor), |
|||
basePath: $_7gt9p3bqjd09evyc.getUploadBasePath(editor), |
|||
credentials: $_7gt9p3bqjd09evyc.getUploadCredentials(editor), |
|||
handler: $_7gt9p3bqjd09evyc.getUploadHandler(editor) |
|||
}); |
|||
var finalize = function () { |
|||
throbber.hide(); |
|||
$_9s3gltc2jd09evz2.revokeObjectURL(blobUri); |
|||
}; |
|||
throbber.show(); |
|||
return $_8r0kc6brjd09evyf.blobToDataUri(file).then(function (dataUrl) { |
|||
var blobInfo = editor.editorUpload.blobCache.create({ |
|||
blob: file, |
|||
blobUri: blobUri, |
|||
name: file.name ? file.name.replace(/\.[^\.]+$/, '') : null, |
|||
base64: dataUrl.split(',')[1] |
|||
}); |
|||
return uploader.upload(blobInfo).then(function (url) { |
|||
var src = rootControl.find('#src'); |
|||
src.value(url); |
|||
rootControl.find('tabpanel')[0].activateTab(0); |
|||
src.fire('change'); |
|||
finalize(); |
|||
return url; |
|||
}); |
|||
}).catch(function (err) { |
|||
editor.windowManager.alert(err); |
|||
finalize(); |
|||
}); |
|||
}; |
|||
}; |
|||
var acceptExts = '.jpg,.jpeg,.png,.gif'; |
|||
var makeTab$2 = function (editor) { |
|||
return { |
|||
title: 'Upload', |
|||
type: 'form', |
|||
layout: 'flex', |
|||
direction: 'column', |
|||
align: 'stretch', |
|||
padding: '20 20 20 20', |
|||
items: [ |
|||
{ |
|||
type: 'container', |
|||
layout: 'flex', |
|||
direction: 'column', |
|||
align: 'center', |
|||
spacing: 10, |
|||
items: [ |
|||
{ |
|||
text: 'Browse for an image', |
|||
type: 'browsebutton', |
|||
accept: acceptExts, |
|||
onchange: onFileInput(editor) |
|||
}, |
|||
{ |
|||
text: 'OR', |
|||
type: 'label' |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
text: 'Drop an image here', |
|||
type: 'dropzone', |
|||
accept: acceptExts, |
|||
height: 100, |
|||
onchange: onFileInput(editor) |
|||
} |
|||
] |
|||
}; |
|||
}; |
|||
var $_ajlcp2c1jd09evz0 = { makeTab: makeTab$2 }; |
|||
|
|||
function Dialog (editor) { |
|||
var updateStyle = function (editor, rootControl) { |
|||
if (!$_7gt9p3bqjd09evyc.hasAdvTab(editor)) { |
|||
return; |
|||
} |
|||
var dom = editor.dom; |
|||
var data = rootControl.toJSON(); |
|||
var css = dom.parseStyle(data.style); |
|||
css = $_8r0kc6brjd09evyf.mergeMargins(css); |
|||
if (data.vspace) { |
|||
css['margin-top'] = css['margin-bottom'] = $_8r0kc6brjd09evyf.addPixelSuffix(data.vspace); |
|||
} |
|||
if (data.hspace) { |
|||
css['margin-left'] = css['margin-right'] = $_8r0kc6brjd09evyf.addPixelSuffix(data.hspace); |
|||
} |
|||
if (data.border) { |
|||
css['border-width'] = $_8r0kc6brjd09evyf.addPixelSuffix(data.border); |
|||
} |
|||
rootControl.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css)))); |
|||
}; |
|||
function showDialog(imageList) { |
|||
var win, data = {}, imgElm, figureElm; |
|||
var dom = editor.dom; |
|||
var imageListCtrl; |
|||
function onSubmitForm() { |
|||
var figureElm, oldImg; |
|||
$_4wfur4c0jd09evyx.updateSize(win); |
|||
updateStyle(editor, win); |
|||
data = Tools.extend(data, win.toJSON()); |
|||
if (!data.alt) { |
|||
data.alt = ''; |
|||
} |
|||
if (!data.title) { |
|||
data.title = ''; |
|||
} |
|||
if (data.width === '') { |
|||
data.width = null; |
|||
} |
|||
if (data.height === '') { |
|||
data.height = null; |
|||
} |
|||
if (!data.style) { |
|||
data.style = null; |
|||
} |
|||
data = { |
|||
src: data.src, |
|||
alt: data.alt, |
|||
title: data.title, |
|||
width: data.width, |
|||
height: data.height, |
|||
style: data.style, |
|||
caption: data.caption, |
|||
class: data.class |
|||
}; |
|||
editor.undoManager.transact(function () { |
|||
if (!data.src) { |
|||
if (imgElm) { |
|||
var elm = dom.is(imgElm.parentNode, 'figure.image') ? imgElm.parentNode : imgElm; |
|||
dom.remove(elm); |
|||
editor.focus(); |
|||
editor.nodeChanged(); |
|||
if (dom.isEmpty(editor.getBody())) { |
|||
editor.setContent(''); |
|||
editor.selection.setCursorLocation(); |
|||
} |
|||
} |
|||
return; |
|||
} |
|||
if (data.title === '') { |
|||
data.title = null; |
|||
} |
|||
if (!imgElm) { |
|||
data.id = '__mcenew'; |
|||
editor.focus(); |
|||
editor.selection.setContent(dom.createHTML('img', data)); |
|||
imgElm = dom.get('__mcenew'); |
|||
dom.setAttrib(imgElm, 'id', null); |
|||
} else { |
|||
dom.setAttribs(imgElm, data); |
|||
} |
|||
editor.editorUpload.uploadImagesAuto(); |
|||
if (data.caption === false) { |
|||
if (dom.is(imgElm.parentNode, 'figure.image')) { |
|||
figureElm = imgElm.parentNode; |
|||
dom.insertAfter(imgElm, figureElm); |
|||
dom.remove(figureElm); |
|||
} |
|||
} |
|||
if (data.caption === true) { |
|||
if (!dom.is(imgElm.parentNode, 'figure.image')) { |
|||
oldImg = imgElm; |
|||
imgElm = imgElm.cloneNode(true); |
|||
figureElm = dom.create('figure', { class: 'image' }); |
|||
figureElm.appendChild(imgElm); |
|||
figureElm.appendChild(dom.create('figcaption', { contentEditable: true }, 'Caption')); |
|||
figureElm.contentEditable = false; |
|||
var textBlock = dom.getParent(oldImg, function (node) { |
|||
return editor.schema.getTextBlockElements()[node.nodeName]; |
|||
}); |
|||
if (textBlock) { |
|||
dom.split(textBlock, oldImg, figureElm); |
|||
} else { |
|||
dom.replace(figureElm, oldImg); |
|||
} |
|||
editor.selection.select(figureElm); |
|||
} |
|||
return; |
|||
} |
|||
$_8r0kc6brjd09evyf.waitLoadImage(editor, data, imgElm); |
|||
}); |
|||
} |
|||
imgElm = editor.selection.getNode(); |
|||
figureElm = dom.getParent(imgElm, 'figure.image'); |
|||
if (figureElm) { |
|||
imgElm = dom.select('img', figureElm)[0]; |
|||
} |
|||
if (imgElm && (imgElm.nodeName !== 'IMG' || imgElm.getAttribute('data-mce-object') || imgElm.getAttribute('data-mce-placeholder'))) { |
|||
imgElm = null; |
|||
} |
|||
if (imgElm) { |
|||
data = { |
|||
src: dom.getAttrib(imgElm, 'src'), |
|||
alt: dom.getAttrib(imgElm, 'alt'), |
|||
title: dom.getAttrib(imgElm, 'title'), |
|||
class: dom.getAttrib(imgElm, 'class'), |
|||
width: dom.getAttrib(imgElm, 'width'), |
|||
height: dom.getAttrib(imgElm, 'height'), |
|||
caption: !!figureElm |
|||
}; |
|||
} |
|||
if (imageList) { |
|||
imageListCtrl = { |
|||
type: 'listbox', |
|||
label: 'Image list', |
|||
name: 'image-list', |
|||
values: $_8r0kc6brjd09evyf.buildListItems(imageList, function (item) { |
|||
item.value = editor.convertURL(item.value || item.url, 'src'); |
|||
}, [{ |
|||
text: 'None', |
|||
value: '' |
|||
}]), |
|||
value: data.src && editor.convertURL(data.src, 'src'), |
|||
onselect: function (e) { |
|||
var altCtrl = win.find('#alt'); |
|||
if (!altCtrl.value() || e.lastControl && altCtrl.value() === e.lastControl.text()) { |
|||
altCtrl.value(e.control.text()); |
|||
} |
|||
win.find('#src').value(e.control.value()).fire('change'); |
|||
}, |
|||
onPostRender: function () { |
|||
imageListCtrl = this; |
|||
} |
|||
}; |
|||
} |
|||
if ($_7gt9p3bqjd09evyc.hasAdvTab(editor) || $_7gt9p3bqjd09evyc.hasUploadUrl(editor) || $_7gt9p3bqjd09evyc.hasUploadHandler(editor)) { |
|||
var body = [$_3ni2wpbzjd09evyu.makeTab(editor, imageListCtrl)]; |
|||
if ($_7gt9p3bqjd09evyc.hasAdvTab(editor)) { |
|||
if (imgElm) { |
|||
if (imgElm.style.marginLeft && imgElm.style.marginRight && imgElm.style.marginLeft === imgElm.style.marginRight) { |
|||
data.hspace = $_8r0kc6brjd09evyf.removePixelSuffix(imgElm.style.marginLeft); |
|||
} |
|||
if (imgElm.style.marginTop && imgElm.style.marginBottom && imgElm.style.marginTop === imgElm.style.marginBottom) { |
|||
data.vspace = $_8r0kc6brjd09evyf.removePixelSuffix(imgElm.style.marginTop); |
|||
} |
|||
if (imgElm.style.borderWidth) { |
|||
data.border = $_8r0kc6brjd09evyf.removePixelSuffix(imgElm.style.borderWidth); |
|||
} |
|||
data.style = editor.dom.serializeStyle(editor.dom.parseStyle(editor.dom.getAttrib(imgElm, 'style'))); |
|||
} |
|||
body.push($_9eockpbyjd09evyr.makeTab(editor, updateStyle)); |
|||
} |
|||
if ($_7gt9p3bqjd09evyc.hasUploadUrl(editor) || $_7gt9p3bqjd09evyc.hasUploadHandler(editor)) { |
|||
body.push($_ajlcp2c1jd09evz0.makeTab(editor)); |
|||
} |
|||
win = editor.windowManager.open({ |
|||
title: 'Insert/edit image', |
|||
data: data, |
|||
bodyType: 'tabpanel', |
|||
body: body, |
|||
onSubmit: onSubmitForm |
|||
}); |
|||
} else { |
|||
win = editor.windowManager.open({ |
|||
title: 'Insert/edit image', |
|||
data: data, |
|||
body: $_3ni2wpbzjd09evyu.getGeneralItems(editor, imageListCtrl), |
|||
onSubmit: onSubmitForm |
|||
}); |
|||
} |
|||
$_4wfur4c0jd09evyx.syncSize(win); |
|||
} |
|||
function open() { |
|||
$_8r0kc6brjd09evyf.createImageList(editor, showDialog); |
|||
} |
|||
return { open: open }; |
|||
} |
|||
|
|||
var register = function (editor) { |
|||
editor.addCommand('mceImage', Dialog(editor).open); |
|||
}; |
|||
var $_869gjibnjd09evy3 = { register: register }; |
|||
|
|||
var hasImageClass = function (node) { |
|||
var className = node.attr('class'); |
|||
return className && /\bimage\b/.test(className); |
|||
}; |
|||
var toggleContentEditableState = function (state) { |
|||
return function (nodes) { |
|||
var i = nodes.length, node; |
|||
var toggleContentEditable = function (node) { |
|||
node.attr('contenteditable', state ? 'true' : null); |
|||
}; |
|||
while (i--) { |
|||
node = nodes[i]; |
|||
if (hasImageClass(node)) { |
|||
node.attr('contenteditable', state ? 'false' : null); |
|||
Tools.each(node.getAll('figcaption'), toggleContentEditable); |
|||
} |
|||
} |
|||
}; |
|||
}; |
|||
var setup = function (editor) { |
|||
editor.on('preInit', function () { |
|||
editor.parser.addNodeFilter('figure', toggleContentEditableState(true)); |
|||
editor.serializer.addNodeFilter('figure', toggleContentEditableState(false)); |
|||
}); |
|||
}; |
|||
var $_fv2j0zc6jd09evz8 = { setup: setup }; |
|||
|
|||
var register$1 = function (editor) { |
|||
editor.addButton('image', { |
|||
icon: 'image', |
|||
tooltip: 'Insert/edit image', |
|||
onclick: Dialog(editor).open, |
|||
stateSelector: 'img:not([data-mce-object],[data-mce-placeholder]),figure.image' |
|||
}); |
|||
editor.addMenuItem('image', { |
|||
icon: 'image', |
|||
text: 'Image', |
|||
onclick: Dialog(editor).open, |
|||
context: 'insert', |
|||
prependToContext: true |
|||
}); |
|||
}; |
|||
var $_3ld2r1c7jd09evza = { register: register$1 }; |
|||
|
|||
PluginManager.add('image', function (editor) { |
|||
$_fv2j0zc6jd09evz8.setup(editor); |
|||
$_3ld2r1c7jd09evza.register(editor); |
|||
$_869gjibnjd09evy3.register(editor); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1,7 @@ |
|||
// Exports the "imagetools" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/imagetools')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/imagetools'
|
|||
require('./plugin.js'); |
@ -0,0 +1,7 @@ |
|||
// Exports the "importcss" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/importcss')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/importcss'
|
|||
require('./plugin.js'); |
@ -0,0 +1,264 @@ |
|||
(function () { |
|||
var importcss = (function () { |
|||
'use strict'; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var DOMUtils = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); |
|||
|
|||
var EditorManager = tinymce.util.Tools.resolve('tinymce.EditorManager'); |
|||
|
|||
var Env = tinymce.util.Tools.resolve('tinymce.Env'); |
|||
|
|||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools'); |
|||
|
|||
var shouldMergeClasses = function (editor) { |
|||
return editor.getParam('importcss_merge_classes'); |
|||
}; |
|||
var shouldImportExclusive = function (editor) { |
|||
return editor.getParam('importcss_exclusive'); |
|||
}; |
|||
var getSelectorConverter = function (editor) { |
|||
return editor.getParam('importcss_selector_converter'); |
|||
}; |
|||
var getSelectorFilter = function (editor) { |
|||
return editor.getParam('importcss_selector_filter'); |
|||
}; |
|||
var getCssGroups = function (editor) { |
|||
return editor.getParam('importcss_groups'); |
|||
}; |
|||
var shouldAppend = function (editor) { |
|||
return editor.getParam('importcss_append'); |
|||
}; |
|||
var getFileFilter = function (editor) { |
|||
return editor.getParam('importcss_file_filter'); |
|||
}; |
|||
var $_fb9djdwjd09ewd1 = { |
|||
shouldMergeClasses: shouldMergeClasses, |
|||
shouldImportExclusive: shouldImportExclusive, |
|||
getSelectorConverter: getSelectorConverter, |
|||
getSelectorFilter: getSelectorFilter, |
|||
getCssGroups: getCssGroups, |
|||
shouldAppend: shouldAppend, |
|||
getFileFilter: getFileFilter |
|||
}; |
|||
|
|||
var removeCacheSuffix = function (url) { |
|||
var cacheSuffix = Env.cacheSuffix; |
|||
if (typeof url === 'string') { |
|||
url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, ''); |
|||
} |
|||
return url; |
|||
}; |
|||
var isSkinContentCss = function (editor, href) { |
|||
var settings = editor.settings, skin = settings.skin !== false ? settings.skin || 'lightgray' : false; |
|||
if (skin) { |
|||
var skinUrl = settings.skin_url ? editor.documentBaseURI.toAbsolute(settings.skin_url) : EditorManager.baseURL + '/skins/' + skin; |
|||
return href === skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css'; |
|||
} |
|||
return false; |
|||
}; |
|||
var compileFilter = function (filter) { |
|||
if (typeof filter === 'string') { |
|||
return function (value) { |
|||
return value.indexOf(filter) !== -1; |
|||
}; |
|||
} else if (filter instanceof RegExp) { |
|||
return function (value) { |
|||
return filter.test(value); |
|||
}; |
|||
} |
|||
return filter; |
|||
}; |
|||
var getSelectors = function (editor, doc, fileFilter) { |
|||
var selectors = [], contentCSSUrls = {}; |
|||
function append(styleSheet, imported) { |
|||
var href = styleSheet.href, rules; |
|||
href = removeCacheSuffix(href); |
|||
if (!href || !fileFilter(href, imported) || isSkinContentCss(editor, href)) { |
|||
return; |
|||
} |
|||
Tools.each(styleSheet.imports, function (styleSheet) { |
|||
append(styleSheet, true); |
|||
}); |
|||
try { |
|||
rules = styleSheet.cssRules || styleSheet.rules; |
|||
} catch (e) { |
|||
} |
|||
Tools.each(rules, function (cssRule) { |
|||
if (cssRule.styleSheet) { |
|||
append(cssRule.styleSheet, true); |
|||
} else if (cssRule.selectorText) { |
|||
Tools.each(cssRule.selectorText.split(','), function (selector) { |
|||
selectors.push(Tools.trim(selector)); |
|||
}); |
|||
} |
|||
}); |
|||
} |
|||
Tools.each(editor.contentCSS, function (url) { |
|||
contentCSSUrls[url] = true; |
|||
}); |
|||
if (!fileFilter) { |
|||
fileFilter = function (href, imported) { |
|||
return imported || contentCSSUrls[href]; |
|||
}; |
|||
} |
|||
try { |
|||
Tools.each(doc.styleSheets, function (styleSheet) { |
|||
append(styleSheet); |
|||
}); |
|||
} catch (e) { |
|||
} |
|||
return selectors; |
|||
}; |
|||
var defaultConvertSelectorToFormat = function (editor, selectorText) { |
|||
var format; |
|||
var selector = /^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(selectorText); |
|||
if (!selector) { |
|||
return; |
|||
} |
|||
var elementName = selector[1]; |
|||
var classes = selector[2].substr(1).split('.').join(' '); |
|||
var inlineSelectorElements = Tools.makeMap('a,img'); |
|||
if (selector[1]) { |
|||
format = { title: selectorText }; |
|||
if (editor.schema.getTextBlockElements()[elementName]) { |
|||
format.block = elementName; |
|||
} else if (editor.schema.getBlockElements()[elementName] || inlineSelectorElements[elementName.toLowerCase()]) { |
|||
format.selector = elementName; |
|||
} else { |
|||
format.inline = elementName; |
|||
} |
|||
} else if (selector[2]) { |
|||
format = { |
|||
inline: 'span', |
|||
title: selectorText.substr(1), |
|||
classes: classes |
|||
}; |
|||
} |
|||
if ($_fb9djdwjd09ewd1.shouldMergeClasses(editor) !== false) { |
|||
format.classes = classes; |
|||
} else { |
|||
format.attributes = { class: classes }; |
|||
} |
|||
return format; |
|||
}; |
|||
var getGroupsBySelector = function (groups, selector) { |
|||
return Tools.grep(groups, function (group) { |
|||
return !group.filter || group.filter(selector); |
|||
}); |
|||
}; |
|||
var compileUserDefinedGroups = function (groups) { |
|||
return Tools.map(groups, function (group) { |
|||
return Tools.extend({}, group, { |
|||
original: group, |
|||
selectors: {}, |
|||
filter: compileFilter(group.filter), |
|||
item: { |
|||
text: group.title, |
|||
menu: [] |
|||
} |
|||
}); |
|||
}); |
|||
}; |
|||
var isExclusiveMode = function (editor, group) { |
|||
return group === null || $_fb9djdwjd09ewd1.shouldImportExclusive(editor) !== false; |
|||
}; |
|||
var isUniqueSelector = function (editor, selector, group, globallyUniqueSelectors) { |
|||
return !(isExclusiveMode(editor, group) ? selector in globallyUniqueSelectors : selector in group.selectors); |
|||
}; |
|||
var markUniqueSelector = function (editor, selector, group, globallyUniqueSelectors) { |
|||
if (isExclusiveMode(editor, group)) { |
|||
globallyUniqueSelectors[selector] = true; |
|||
} else { |
|||
group.selectors[selector] = true; |
|||
} |
|||
}; |
|||
var convertSelectorToFormat = function (editor, plugin, selector, group) { |
|||
var selectorConverter; |
|||
if (group && group.selector_converter) { |
|||
selectorConverter = group.selector_converter; |
|||
} else if ($_fb9djdwjd09ewd1.getSelectorConverter(editor)) { |
|||
selectorConverter = $_fb9djdwjd09ewd1.getSelectorConverter(editor); |
|||
} else { |
|||
selectorConverter = function () { |
|||
return defaultConvertSelectorToFormat(editor, selector); |
|||
}; |
|||
} |
|||
return selectorConverter.call(plugin, selector, group); |
|||
}; |
|||
var setup = function (editor) { |
|||
editor.on('renderFormatsMenu', function (e) { |
|||
var globallyUniqueSelectors = {}; |
|||
var selectorFilter = compileFilter($_fb9djdwjd09ewd1.getSelectorFilter(editor)), ctrl = e.control; |
|||
var groups = compileUserDefinedGroups($_fb9djdwjd09ewd1.getCssGroups(editor)); |
|||
var processSelector = function (selector, group) { |
|||
if (isUniqueSelector(editor, selector, group, globallyUniqueSelectors)) { |
|||
markUniqueSelector(editor, selector, group, globallyUniqueSelectors); |
|||
var format = convertSelectorToFormat(editor, editor.plugins.importcss, selector, group); |
|||
if (format) { |
|||
var formatName = format.name || DOMUtils.DOM.uniqueId(); |
|||
editor.formatter.register(formatName, format); |
|||
return Tools.extend({}, ctrl.settings.itemDefaults, { |
|||
text: format.title, |
|||
format: formatName |
|||
}); |
|||
} |
|||
} |
|||
return null; |
|||
}; |
|||
if (!$_fb9djdwjd09ewd1.shouldAppend(editor)) { |
|||
ctrl.items().remove(); |
|||
} |
|||
Tools.each(getSelectors(editor, e.doc || editor.getDoc(), compileFilter($_fb9djdwjd09ewd1.getFileFilter(editor))), function (selector) { |
|||
if (selector.indexOf('.mce-') === -1) { |
|||
if (!selectorFilter || selectorFilter(selector)) { |
|||
var selectorGroups = getGroupsBySelector(groups, selector); |
|||
if (selectorGroups.length > 0) { |
|||
Tools.each(selectorGroups, function (group) { |
|||
var menuItem = processSelector(selector, group); |
|||
if (menuItem) { |
|||
group.item.menu.push(menuItem); |
|||
} |
|||
}); |
|||
} else { |
|||
var menuItem = processSelector(selector, null); |
|||
if (menuItem) { |
|||
ctrl.add(menuItem); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
Tools.each(groups, function (group) { |
|||
if (group.item.menu.length > 0) { |
|||
ctrl.add(group.item); |
|||
} |
|||
}); |
|||
e.control.renderNew(); |
|||
}); |
|||
}; |
|||
var $_2ll1badrjd09ewcv = { |
|||
defaultConvertSelectorToFormat: defaultConvertSelectorToFormat, |
|||
setup: setup |
|||
}; |
|||
|
|||
var get = function (editor) { |
|||
var convertSelectorToFormat = function (selectorText) { |
|||
return $_2ll1badrjd09ewcv.defaultConvertSelectorToFormat(editor, selectorText); |
|||
}; |
|||
return { convertSelectorToFormat: convertSelectorToFormat }; |
|||
}; |
|||
var $_6z3rqddqjd09ewcs = { get: get }; |
|||
|
|||
PluginManager.add('importcss', function (editor) { |
|||
$_2ll1badrjd09ewcv.setup(editor); |
|||
return $_6z3rqddqjd09ewcs.get(editor); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),n=tinymce.util.Tools.resolve("tinymce.EditorManager"),r=tinymce.util.Tools.resolve("tinymce.Env"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(e){return e.getParam("importcss_merge_classes")},o=function(e){return e.getParam("importcss_exclusive")},s=function(e){return e.getParam("importcss_selector_converter")},u=function(e){return e.getParam("importcss_selector_filter")},l=function(e){return e.getParam("importcss_groups")},a=function(e){return e.getParam("importcss_append")},f=function(e){return e.getParam("importcss_file_filter")},m=function(e){var t=r.cacheSuffix;return"string"==typeof e&&(e=e.replace("?"+t,"").replace("&"+t,"")),e},g=function(e,t){var r=e.settings,i=!1!==r.skin&&(r.skin||"lightgray");return!!i&&t===(r.skin_url?e.documentBaseURI.toAbsolute(r.skin_url):n.baseURL+"/skins/"+i)+"/content"+(e.inline?".inline":"")+".min.css"},p=function(e){return"string"==typeof e?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e},v=function(e,t,n){var r=[],c={};i.each(e.contentCSS,function(e){c[e]=!0}),n||(n=function(e,t){return t||c[e]});try{i.each(t.styleSheets,function(t){!function c(t,o){var s,u=t.href;if((u=m(u))&&n(u,o)&&!g(e,u)){i.each(t.imports,function(e){c(e,!0)});try{s=t.cssRules||t.rules}catch(l){}i.each(s,function(e){e.styleSheet?c(e.styleSheet,!0):e.selectorText&&i.each(e.selectorText.split(","),function(e){r.push(i.trim(e))})})}}(t)})}catch(o){}return r},h=function(e,t){var n,r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(t);if(r){var o=r[1],s=r[2].substr(1).split(".").join(" "),u=i.makeMap("a,img");return r[1]?(n={title:t},e.schema.getTextBlockElements()[o]?n.block=o:e.schema.getBlockElements()[o]||u[o.toLowerCase()]?n.selector=o:n.inline=o):r[2]&&(n={inline:"span",title:t.substr(1),classes:s}),!1!==c(e)?n.classes=s:n.attributes={"class":s},n}},d=function(e,t){return null===t||!1!==o(e)},y=h,_=function(e){e.on("renderFormatsMenu",function(n){var r,c={},o=p(u(e)),m=n.control,g=(r=l(e),i.map(r,function(e){return i.extend({},e,{original:e,selectors:{},filter:p(e.filter),item:{text:e.title,menu:[]}})})),y=function(n,r){if(_=n,T=c,!(d(e,x=r)?_ in T:_ in x.selectors)){p=n,y=c,d(e,v=r)?y[p]=!0:v.selectors[p]=!0;var o=(l=e,a=e.plugins.importcss,f=n,((g=r)&&g.selector_converter?g.selector_converter:s(l)?s(l):function(){return h(l,f)}).call(a,f,g));if(o){var u=o.name||t.DOM.uniqueId();return e.formatter.register(u,o),i.extend({},m.settings.itemDefaults,{text:o.title,format:u})}}var l,a,f,g,p,v,y,_,x,T;return null};a(e)||m.items().remove(),i.each(v(e,n.doc||e.getDoc(),p(f(e))),function(e){if(-1===e.indexOf(".mce-")&&(!o||o(e))){var t=(r=g,c=e,i.grep(r,function(e){return!e.filter||e.filter(c)}));if(t.length>0)i.each(t,function(t){var n=y(e,t);n&&t.item.menu.push(n)});else{var n=y(e,null);n&&m.add(n)}}var r,c}),i.each(g,function(e){e.item.menu.length>0&&m.add(e.item)}),n.control.renderNew()})},x=function(e){return{convertSelectorToFormat:function(t){return y(e,t)}}};e.add("importcss",function(e){return _(e),x(e)})}(); |
@ -0,0 +1,7 @@ |
|||
// Exports the "insertdatetime" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/insertdatetime')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/insertdatetime'
|
|||
require('./plugin.js'); |
@ -0,0 +1,173 @@ |
|||
(function () { |
|||
var insertdatetime = (function () { |
|||
'use strict'; |
|||
|
|||
var Cell = function (initial) { |
|||
var value = initial; |
|||
var get = function () { |
|||
return value; |
|||
}; |
|||
var set = function (v) { |
|||
value = v; |
|||
}; |
|||
var clone = function () { |
|||
return Cell(get()); |
|||
}; |
|||
return { |
|||
get: get, |
|||
set: set, |
|||
clone: clone |
|||
}; |
|||
}; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var getDateFormat = function (editor) { |
|||
return editor.getParam('insertdatetime_dateformat', editor.translate('%Y-%m-%d')); |
|||
}; |
|||
var getTimeFormat = function (editor) { |
|||
return editor.getParam('insertdatetime_timeformat', editor.translate('%H:%M:%S')); |
|||
}; |
|||
var getFormats = function (editor) { |
|||
return editor.getParam('insertdatetime_formats', [ |
|||
'%H:%M:%S', |
|||
'%Y-%m-%d', |
|||
'%I:%M:%S %p', |
|||
'%D' |
|||
]); |
|||
}; |
|||
var getDefaultDateTime = function (editor) { |
|||
var formats = getFormats(editor); |
|||
return formats.length > 0 ? formats[0] : getTimeFormat(editor); |
|||
}; |
|||
var shouldInsertTimeElement = function (editor) { |
|||
return editor.getParam('insertdatetime_element', false); |
|||
}; |
|||
var $_1ldynpe1jd09ewdq = { |
|||
getDateFormat: getDateFormat, |
|||
getTimeFormat: getTimeFormat, |
|||
getFormats: getFormats, |
|||
getDefaultDateTime: getDefaultDateTime, |
|||
shouldInsertTimeElement: shouldInsertTimeElement |
|||
}; |
|||
|
|||
var daysShort = 'Sun Mon Tue Wed Thu Fri Sat Sun'.split(' '); |
|||
var daysLong = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split(' '); |
|||
var monthsShort = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '); |
|||
var monthsLong = 'January February March April May June July August September October November December'.split(' '); |
|||
var addZeros = function (value, len) { |
|||
value = '' + value; |
|||
if (value.length < len) { |
|||
for (var i = 0; i < len - value.length; i++) { |
|||
value = '0' + value; |
|||
} |
|||
} |
|||
return value; |
|||
}; |
|||
var getDateTime = function (editor, fmt, date) { |
|||
date = date || new Date(); |
|||
fmt = fmt.replace('%D', '%m/%d/%Y'); |
|||
fmt = fmt.replace('%r', '%I:%M:%S %p'); |
|||
fmt = fmt.replace('%Y', '' + date.getFullYear()); |
|||
fmt = fmt.replace('%y', '' + date.getYear()); |
|||
fmt = fmt.replace('%m', addZeros(date.getMonth() + 1, 2)); |
|||
fmt = fmt.replace('%d', addZeros(date.getDate(), 2)); |
|||
fmt = fmt.replace('%H', '' + addZeros(date.getHours(), 2)); |
|||
fmt = fmt.replace('%M', '' + addZeros(date.getMinutes(), 2)); |
|||
fmt = fmt.replace('%S', '' + addZeros(date.getSeconds(), 2)); |
|||
fmt = fmt.replace('%I', '' + ((date.getHours() + 11) % 12 + 1)); |
|||
fmt = fmt.replace('%p', '' + (date.getHours() < 12 ? 'AM' : 'PM')); |
|||
fmt = fmt.replace('%B', '' + editor.translate(monthsLong[date.getMonth()])); |
|||
fmt = fmt.replace('%b', '' + editor.translate(monthsShort[date.getMonth()])); |
|||
fmt = fmt.replace('%A', '' + editor.translate(daysLong[date.getDay()])); |
|||
fmt = fmt.replace('%a', '' + editor.translate(daysShort[date.getDay()])); |
|||
fmt = fmt.replace('%%', '%'); |
|||
return fmt; |
|||
}; |
|||
var updateElement = function (editor, timeElm, computerTime, userTime) { |
|||
var newTimeElm = editor.dom.create('time', { datetime: computerTime }, userTime); |
|||
timeElm.parentNode.insertBefore(newTimeElm, timeElm); |
|||
editor.dom.remove(timeElm); |
|||
editor.selection.select(newTimeElm, true); |
|||
editor.selection.collapse(false); |
|||
}; |
|||
var insertDateTime = function (editor, format) { |
|||
if ($_1ldynpe1jd09ewdq.shouldInsertTimeElement(editor)) { |
|||
var userTime = getDateTime(editor, format); |
|||
var computerTime = void 0; |
|||
if (/%[HMSIp]/.test(format)) { |
|||
computerTime = getDateTime(editor, '%Y-%m-%dT%H:%M'); |
|||
} else { |
|||
computerTime = getDateTime(editor, '%Y-%m-%d'); |
|||
} |
|||
var timeElm = editor.dom.getParent(editor.selection.getStart(), 'time'); |
|||
if (timeElm) { |
|||
updateElement(editor, timeElm, computerTime, userTime); |
|||
} else { |
|||
editor.insertContent('<time datetime="' + computerTime + '">' + userTime + '</time>'); |
|||
} |
|||
} else { |
|||
editor.insertContent(getDateTime(editor, format)); |
|||
} |
|||
}; |
|||
var $_42zp2ke2jd09ewds = { |
|||
insertDateTime: insertDateTime, |
|||
getDateTime: getDateTime |
|||
}; |
|||
|
|||
var register = function (editor) { |
|||
editor.addCommand('mceInsertDate', function () { |
|||
$_42zp2ke2jd09ewds.insertDateTime(editor, $_1ldynpe1jd09ewdq.getDateFormat(editor)); |
|||
}); |
|||
editor.addCommand('mceInsertTime', function () { |
|||
$_42zp2ke2jd09ewds.insertDateTime(editor, $_1ldynpe1jd09ewdq.getTimeFormat(editor)); |
|||
}); |
|||
}; |
|||
var $_fbteh8e0jd09ewdp = { register: register }; |
|||
|
|||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools'); |
|||
|
|||
var createMenuItems = function (editor, lastFormatState) { |
|||
var formats = $_1ldynpe1jd09ewdq.getFormats(editor); |
|||
return Tools.map(formats, function (fmt) { |
|||
return { |
|||
text: $_42zp2ke2jd09ewds.getDateTime(editor, fmt), |
|||
onclick: function () { |
|||
lastFormatState.set(fmt); |
|||
$_42zp2ke2jd09ewds.insertDateTime(editor, fmt); |
|||
} |
|||
}; |
|||
}); |
|||
}; |
|||
var register$1 = function (editor, lastFormatState) { |
|||
var menuItems = createMenuItems(editor, lastFormatState); |
|||
editor.addButton('insertdatetime', { |
|||
type: 'splitbutton', |
|||
title: 'Insert date/time', |
|||
menu: menuItems, |
|||
onclick: function () { |
|||
var lastFormat = lastFormatState.get(); |
|||
$_42zp2ke2jd09ewds.insertDateTime(editor, lastFormat ? lastFormat : $_1ldynpe1jd09ewdq.getDefaultDateTime(editor)); |
|||
} |
|||
}); |
|||
editor.addMenuItem('insertdatetime', { |
|||
icon: 'date', |
|||
text: 'Date/time', |
|||
menu: menuItems, |
|||
context: 'insert' |
|||
}); |
|||
}; |
|||
var $_2j104oe3jd09ewdv = { register: register$1 }; |
|||
|
|||
PluginManager.add('insertdatetime', function (editor) { |
|||
var lastFormatState = Cell(null); |
|||
$_fbteh8e0jd09ewdp.register(editor); |
|||
$_2j104oe3jd09ewdv.register(editor, lastFormatState); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var e=function(t){var n=t,r=function(){return n};return{get:r,set:function(e){n=e},clone:function(){return e(r())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},r=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},a=function(e){return e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d"))},i=n,o=r,u=function(e){var t=r(e);return t.length>0?t[0]:n(e)},c=function(e){return e.getParam("insertdatetime_element",!1)},l="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),m="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),s="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),d="January February March April May June July August September October November December".split(" "),p=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},f=function(e,t,n){return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",p(n.getMonth()+1,2))).replace("%d",p(n.getDate(),2))).replace("%H",""+p(n.getHours(),2))).replace("%M",""+p(n.getMinutes(),2))).replace("%S",""+p(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(d[n.getMonth()]))).replace("%b",""+e.translate(s[n.getMonth()]))).replace("%A",""+e.translate(m[n.getDay()]))).replace("%a",""+e.translate(l[n.getDay()]))).replace("%%","%")},g=function(e,t){if(c(e)){var n=f(e,t),r=void 0;r=/%[HMSIp]/.test(t)?f(e,"%Y-%m-%dT%H:%M"):f(e,"%Y-%m-%d");var a=e.dom.getParent(e.selection.getStart(),"time");a?(o=a,u=r,l=n,m=(i=e).dom.create("time",{datetime:u},l),o.parentNode.insertBefore(m,o),i.dom.remove(o),i.selection.select(m,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")}else e.insertContent(f(e,t));var i,o,u,l,m},y=f,M=function(e){e.addCommand("mceInsertDate",function(){g(e,a(e))}),e.addCommand("mceInsertTime",function(){g(e,i(e))})},v=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(e,t){var n,r,a,i=(r=t,a=o(n=e),v.map(a,function(e){return{text:y(n,e),onclick:function(){r.set(e),g(n,e)}}}));e.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",menu:i,onclick:function(){var n=t.get();g(e,n||u(e))}}),e.addMenuItem("insertdatetime",{icon:"date",text:"Date/time",menu:i,context:"insert"})};t.add("insertdatetime",function(t){var n=e(null);M(t),S(t,n)})}(); |
@ -0,0 +1,7 @@ |
|||
// Exports the "legacyoutput" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/legacyoutput')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/legacyoutput'
|
|||
require('./plugin.js'); |
@ -0,0 +1,220 @@ |
|||
(function () { |
|||
var legacyoutput = (function () { |
|||
'use strict'; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools'); |
|||
|
|||
var overrideFormats = function (editor) { |
|||
var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', fontSizes = Tools.explode(editor.settings.font_size_style_values), schema = editor.schema; |
|||
editor.formatter.register({ |
|||
alignleft: { |
|||
selector: alignElements, |
|||
attributes: { align: 'left' } |
|||
}, |
|||
aligncenter: { |
|||
selector: alignElements, |
|||
attributes: { align: 'center' } |
|||
}, |
|||
alignright: { |
|||
selector: alignElements, |
|||
attributes: { align: 'right' } |
|||
}, |
|||
alignjustify: { |
|||
selector: alignElements, |
|||
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 (vars) { |
|||
return Tools.inArray(fontSizes, vars.value) + 1; |
|||
} |
|||
} |
|||
}, |
|||
forecolor: { |
|||
inline: 'font', |
|||
attributes: { color: '%value' } |
|||
}, |
|||
hilitecolor: { |
|||
inline: 'font', |
|||
styles: { backgroundColor: '%value' } |
|||
} |
|||
}); |
|||
Tools.each('b,i,u,strike'.split(','), function (name) { |
|||
schema.addValidElements(name + '[*]'); |
|||
}); |
|||
if (!schema.getElementRule('font')) { |
|||
schema.addValidElements('font[face|size|color|style]'); |
|||
} |
|||
Tools.each(alignElements.split(','), function (name) { |
|||
var rule = schema.getElementRule(name); |
|||
if (rule) { |
|||
if (!rule.attributes.align) { |
|||
rule.attributes.align = {}; |
|||
rule.attributesOrder.push('align'); |
|||
} |
|||
} |
|||
}); |
|||
}; |
|||
var setup = function (editor) { |
|||
editor.settings.inline_styles = false; |
|||
editor.on('init', function () { |
|||
overrideFormats(editor); |
|||
}); |
|||
}; |
|||
var $_76s7zbe7jd09ewea = { setup: setup }; |
|||
|
|||
var register = function (editor) { |
|||
editor.addButton('fontsizeselect', function () { |
|||
var items = [], defaultFontsizeFormats = '8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7'; |
|||
var fontsizeFormats = editor.settings.fontsizeFormats || defaultFontsizeFormats; |
|||
editor.$.each(fontsizeFormats.split(' '), function (i, item) { |
|||
var text = item, value = item; |
|||
var values = item.split('='); |
|||
if (values.length > 1) { |
|||
text = values[0]; |
|||
value = values[1]; |
|||
} |
|||
items.push({ |
|||
text: text, |
|||
value: value |
|||
}); |
|||
}); |
|||
return { |
|||
type: 'listbox', |
|||
text: 'Font Sizes', |
|||
tooltip: 'Font Sizes', |
|||
values: items, |
|||
fixedWidth: true, |
|||
onPostRender: function () { |
|||
var self = this; |
|||
editor.on('NodeChange', function () { |
|||
var fontElm; |
|||
fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); |
|||
if (fontElm) { |
|||
self.value(fontElm.size); |
|||
} else { |
|||
self.value(''); |
|||
} |
|||
}); |
|||
}, |
|||
onclick: function (e) { |
|||
if (e.control.settings.value) { |
|||
editor.execCommand('FontSize', false, e.control.settings.value); |
|||
} |
|||
} |
|||
}; |
|||
}); |
|||
editor.addButton('fontselect', function () { |
|||
function createFormats(formats) { |
|||
formats = formats.replace(/;$/, '').split(';'); |
|||
var i = formats.length; |
|||
while (i--) { |
|||
formats[i] = formats[i].split('='); |
|||
} |
|||
return formats; |
|||
} |
|||
var defaultFontsFormats = 'Andale Mono=andale mono,monospace;' + 'Arial=arial,helvetica,sans-serif;' + 'Arial Black=arial black,sans-serif;' + 'Book Antiqua=book antiqua,palatino,serif;' + 'Comic Sans MS=comic sans ms,sans-serif;' + 'Courier New=courier new,courier,monospace;' + 'Georgia=georgia,palatino,serif;' + 'Helvetica=helvetica,arial,sans-serif;' + 'Impact=impact,sans-serif;' + 'Symbol=symbol;' + 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 'Terminal=terminal,monaco,monospace;' + 'Times New Roman=times new roman,times,serif;' + 'Trebuchet MS=trebuchet ms,geneva,sans-serif;' + 'Verdana=verdana,geneva,sans-serif;' + 'Webdings=webdings;' + 'Wingdings=wingdings,zapf dingbats'; |
|||
var items = [], fonts = createFormats(editor.settings.font_formats || defaultFontsFormats); |
|||
editor.$.each(fonts, function (i, font) { |
|||
items.push({ |
|||
text: { raw: font[0] }, |
|||
value: font[1], |
|||
textStyle: font[1].indexOf('dings') === -1 ? 'font-family:' + font[1] : '' |
|||
}); |
|||
}); |
|||
return { |
|||
type: 'listbox', |
|||
text: 'Font Family', |
|||
tooltip: 'Font Family', |
|||
values: items, |
|||
fixedWidth: true, |
|||
onPostRender: function () { |
|||
var self = this; |
|||
editor.on('NodeChange', function () { |
|||
var fontElm; |
|||
fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); |
|||
if (fontElm) { |
|||
self.value(fontElm.face); |
|||
} else { |
|||
self.value(''); |
|||
} |
|||
}); |
|||
}, |
|||
onselect: function (e) { |
|||
if (e.control.settings.value) { |
|||
editor.execCommand('FontName', false, e.control.settings.value); |
|||
} |
|||
} |
|||
}; |
|||
}); |
|||
}; |
|||
var $_c9xtzue9jd09ewed = { register: register }; |
|||
|
|||
PluginManager.add('legacyoutput', function (editor) { |
|||
$_76s7zbe7jd09ewea.setup(editor); |
|||
$_c9xtzue9jd09ewed.register(editor); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |
@ -0,0 +1 @@ |
|||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(e){e.settings.inline_styles=!1,e.on("init",function(){var n,i,a,o;n=e,i="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",a=t.explode(n.settings.font_size_style_values),o=n.schema,n.formatter.register({alignleft:{selector:i,attributes:{align:"left"}},aligncenter:{selector:i,attributes:{align:"center"}},alignright:{selector:i,attributes:{align:"right"}},alignjustify:{selector:i,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:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(e){return t.inArray(a,e.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),t.each("b,i,u,strike".split(","),function(e){o.addValidElements(e+"[*]")}),o.getElementRule("font")||o.addValidElements("font[face|size|color|style]"),t.each(i.split(","),function(e){var t=o.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})},i=function(e){e.addButton("fontsizeselect",function(){var t=[],n=e.settings.fontsizeFormats||"8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7";return e.$.each(n.split(" "),function(e,n){var i=n,a=n,o=n.split("=");o.length>1&&(i=o[0],a=o[1]),t.push({text:i,value:a})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:function(){var t=this;e.on("NodeChange",function(){var n;(n=e.dom.getParent(e.selection.getNode(),"font"))?t.value(n.size):t.value("")})},onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addButton("fontselect",function(){var t=[],n=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(e.settings.font_formats||"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats");return e.$.each(n,function(e,n){t.push({text:{raw:n[0]},value:n[1],textStyle:-1===n[1].indexOf("dings")?"font-family:"+n[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:t,fixedWidth:!0,onPostRender:function(){var t=this;e.on("NodeChange",function(){var n;(n=e.dom.getParent(e.selection.getNode(),"font"))?t.value(n.face):t.value("")})},onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}})};e.add("legacyoutput",function(e){n(e),i(e)})}(); |
@ -0,0 +1,7 @@ |
|||
// Exports the "link" plugin for usage with module loaders
|
|||
// Usage:
|
|||
// CommonJS:
|
|||
// require('tinymce/plugins/link')
|
|||
// ES2015:
|
|||
// import 'tinymce/plugins/link'
|
|||
require('./plugin.js'); |
@ -0,0 +1,706 @@ |
|||
(function () { |
|||
var link = (function () { |
|||
'use strict'; |
|||
|
|||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager'); |
|||
|
|||
var VK = tinymce.util.Tools.resolve('tinymce.util.VK'); |
|||
|
|||
var assumeExternalTargets = function (editorSettings) { |
|||
return typeof editorSettings.link_assume_external_targets === 'boolean' ? editorSettings.link_assume_external_targets : false; |
|||
}; |
|||
var hasContextToolbar = function (editorSettings) { |
|||
return typeof editorSettings.link_context_toolbar === 'boolean' ? editorSettings.link_context_toolbar : false; |
|||
}; |
|||
var getLinkList = function (editorSettings) { |
|||
return editorSettings.link_list; |
|||
}; |
|||
var hasDefaultLinkTarget = function (editorSettings) { |
|||
return typeof editorSettings.default_link_target === 'string'; |
|||
}; |
|||
var getDefaultLinkTarget = function (editorSettings) { |
|||
return editorSettings.default_link_target; |
|||
}; |
|||
var getTargetList = function (editorSettings) { |
|||
return editorSettings.target_list; |
|||
}; |
|||
var setTargetList = function (editor, list) { |
|||
editor.settings.target_list = list; |
|||
}; |
|||
var shouldShowTargetList = function (editorSettings) { |
|||
return getTargetList(editorSettings) !== false; |
|||
}; |
|||
var getRelList = function (editorSettings) { |
|||
return editorSettings.rel_list; |
|||
}; |
|||
var hasRelList = function (editorSettings) { |
|||
return getRelList(editorSettings) !== undefined; |
|||
}; |
|||
var getLinkClassList = function (editorSettings) { |
|||
return editorSettings.link_class_list; |
|||
}; |
|||
var hasLinkClassList = function (editorSettings) { |
|||
return getLinkClassList(editorSettings) !== undefined; |
|||
}; |
|||
var shouldShowLinkTitle = function (editorSettings) { |
|||
return editorSettings.link_title !== false; |
|||
}; |
|||
var allowUnsafeLinkTarget = function (editorSettings) { |
|||
return typeof editorSettings.allow_unsafe_link_target === 'boolean' ? editorSettings.allow_unsafe_link_target : false; |
|||
}; |
|||
var $_azkw9efjd09ewex = { |
|||
assumeExternalTargets: assumeExternalTargets, |
|||
hasContextToolbar: hasContextToolbar, |
|||
getLinkList: getLinkList, |
|||
hasDefaultLinkTarget: hasDefaultLinkTarget, |
|||
getDefaultLinkTarget: getDefaultLinkTarget, |
|||
getTargetList: getTargetList, |
|||
setTargetList: setTargetList, |
|||
shouldShowTargetList: shouldShowTargetList, |
|||
getRelList: getRelList, |
|||
hasRelList: hasRelList, |
|||
getLinkClassList: getLinkClassList, |
|||
hasLinkClassList: hasLinkClassList, |
|||
shouldShowLinkTitle: shouldShowLinkTitle, |
|||
allowUnsafeLinkTarget: allowUnsafeLinkTarget |
|||
}; |
|||
|
|||
var DOMUtils = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); |
|||
|
|||
var Env = tinymce.util.Tools.resolve('tinymce.Env'); |
|||
|
|||
var appendClickRemove = function (link, evt) { |
|||
document.body.appendChild(link); |
|||
link.dispatchEvent(evt); |
|||
document.body.removeChild(link); |
|||
}; |
|||
var open = function (url) { |
|||
if (!Env.ie || Env.ie > 10) { |
|||
var link = document.createElement('a'); |
|||
link.target = '_blank'; |
|||
link.href = url; |
|||
link.rel = 'noreferrer noopener'; |
|||
var evt = document.createEvent('MouseEvents'); |
|||
evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); |
|||
appendClickRemove(link, evt); |
|||
} else { |
|||
var win = window.open('', '_blank'); |
|||
if (win) { |
|||
win.opener = null; |
|||
var doc = win.document; |
|||
doc.open(); |
|||
doc.write('<meta http-equiv="refresh" content="0; url=' + DOMUtils.DOM.encode(url) + '">'); |
|||
doc.close(); |
|||
} |
|||
} |
|||
}; |
|||
var $_50aixnegjd09ewey = { open: open }; |
|||
|
|||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools'); |
|||
|
|||
var toggleTargetRules = function (rel, isUnsafe) { |
|||
var rules = ['noopener']; |
|||
var newRel = rel ? rel.split(/\s+/) : []; |
|||
var toString = function (rel) { |
|||
return Tools.trim(rel.sort().join(' ')); |
|||
}; |
|||
var addTargetRules = function (rel) { |
|||
rel = removeTargetRules(rel); |
|||
return rel.length ? rel.concat(rules) : rules; |
|||
}; |
|||
var removeTargetRules = function (rel) { |
|||
return rel.filter(function (val) { |
|||
return Tools.inArray(rules, val) === -1; |
|||
}); |
|||
}; |
|||
newRel = isUnsafe ? addTargetRules(newRel) : removeTargetRules(newRel); |
|||
return newRel.length ? toString(newRel) : null; |
|||
}; |
|||
var trimCaretContainers = function (text) { |
|||
return text.replace(/\uFEFF/g, ''); |
|||
}; |
|||
var getAnchorElement = function (editor, selectedElm) { |
|||
selectedElm = selectedElm || editor.selection.getNode(); |
|||
if (isImageFigure(selectedElm)) { |
|||
return editor.dom.select('a[href]', selectedElm)[0]; |
|||
} else { |
|||
return editor.dom.getParent(selectedElm, 'a[href]'); |
|||
} |
|||
}; |
|||
var getAnchorText = function (selection, anchorElm) { |
|||
var text = anchorElm ? anchorElm.innerText || anchorElm.textContent : selection.getContent({ format: 'text' }); |
|||
return trimCaretContainers(text); |
|||
}; |
|||
var isLink = function (elm) { |
|||
return elm && elm.nodeName === 'A' && elm.href; |
|||
}; |
|||
var hasLinks = function (elements) { |
|||
return Tools.grep(elements, isLink).length > 0; |
|||
}; |
|||
var isOnlyTextSelected = function (html) { |
|||
if (/</.test(html) && (!/^<a [^>]+>[^<]+<\/a>$/.test(html) || html.indexOf('href=') === -1)) { |
|||
return false; |
|||
} |
|||
return true; |
|||
}; |
|||
var isImageFigure = function (node) { |
|||
return node && node.nodeName === 'FIGURE' && /\bimage\b/i.test(node.className); |
|||
}; |
|||
var link = function (editor, attachState) { |
|||
return function (data) { |
|||
editor.undoManager.transact(function () { |
|||
var selectedElm = editor.selection.getNode(); |
|||
var anchorElm = getAnchorElement(editor, selectedElm); |
|||
var linkAttrs = { |
|||
href: data.href, |
|||
target: data.target ? data.target : null, |
|||
rel: data.rel ? data.rel : null, |
|||
class: data.class ? data.class : null, |
|||
title: data.title ? data.title : null |
|||
}; |
|||
if (!$_azkw9efjd09ewex.hasRelList(editor.settings) && $_azkw9efjd09ewex.allowUnsafeLinkTarget(editor.settings) === false) { |
|||
linkAttrs.rel = toggleTargetRules(linkAttrs.rel, linkAttrs.target === '_blank'); |
|||
} |
|||
if (data.href === attachState.href) { |
|||
attachState.attach(); |
|||
attachState = {}; |
|||
} |
|||
if (anchorElm) { |
|||
editor.focus(); |
|||
if (data.hasOwnProperty('text')) { |
|||
if ('innerText' in anchorElm) { |
|||
anchorElm.innerText = data.text; |
|||
} else { |
|||
anchorElm.textContent = data.text; |
|||
} |
|||
} |
|||
editor.dom.setAttribs(anchorElm, linkAttrs); |
|||
editor.selection.select(anchorElm); |
|||
editor.undoManager.add(); |
|||
} else { |
|||
if (isImageFigure(selectedElm)) { |
|||
linkImageFigure(editor, selectedElm, linkAttrs); |
|||
} else if (data.hasOwnProperty('text')) { |
|||
editor.insertContent(editor.dom.createHTML('a', linkAttrs, editor.dom.encode(data.text))); |
|||
} else { |
|||
editor.execCommand('mceInsertLink', false, linkAttrs); |
|||
} |
|||
} |
|||
}); |
|||
}; |
|||
}; |
|||
var unlink = function (editor) { |
|||
return function () { |
|||
editor.undoManager.transact(function () { |
|||
var node = editor.selection.getNode(); |
|||
if (isImageFigure(node)) { |
|||
unlinkImageFigure(editor, node); |
|||
} else { |
|||
editor.execCommand('unlink'); |
|||
} |
|||
}); |
|||
}; |
|||
}; |
|||
var unlinkImageFigure = function (editor, fig) { |
|||
var a, img; |
|||
img = editor.dom.select('img', fig)[0]; |
|||
if (img) { |
|||
a = editor.dom.getParents(img, 'a[href]', fig)[0]; |
|||
if (a) { |
|||
a.parentNode.insertBefore(img, a); |
|||
editor.dom.remove(a); |
|||
} |
|||
} |
|||
}; |
|||
var linkImageFigure = function (editor, fig, attrs) { |
|||
var a, img; |
|||
img = editor.dom.select('img', fig)[0]; |
|||
if (img) { |
|||
a = editor.dom.create('a', attrs); |
|||
img.parentNode.insertBefore(a, img); |
|||
a.appendChild(img); |
|||
} |
|||
}; |
|||
var $_dple5hejjd09ewf1 = { |
|||
link: link, |
|||
unlink: unlink, |
|||
isLink: isLink, |
|||
hasLinks: hasLinks, |
|||
isOnlyTextSelected: isOnlyTextSelected, |
|||
getAnchorElement: getAnchorElement, |
|||
getAnchorText: getAnchorText, |
|||
toggleTargetRules: toggleTargetRules |
|||
}; |
|||
|
|||
var Delay = tinymce.util.Tools.resolve('tinymce.util.Delay'); |
|||
|
|||
var XHR = tinymce.util.Tools.resolve('tinymce.util.XHR'); |
|||
|
|||
var attachState = {}; |
|||
var createLinkList = function (editor, callback) { |
|||
var linkList = $_azkw9efjd09ewex.getLinkList(editor.settings); |
|||
if (typeof linkList === 'string') { |
|||
XHR.send({ |
|||
url: linkList, |
|||
success: function (text) { |
|||
callback(editor, JSON.parse(text)); |
|||
} |
|||
}); |
|||
} else if (typeof linkList === 'function') { |
|||
linkList(function (list) { |
|||
callback(editor, list); |
|||
}); |
|||
} else { |
|||
callback(editor, linkList); |
|||
} |
|||
}; |
|||
var buildListItems = function (inputList, itemCallback, startItems) { |
|||
var appendItems = function (values, output) { |
|||
output = output || []; |
|||
Tools.each(values, function (item) { |
|||
var menuItem = { text: item.text || item.title }; |
|||
if (item.menu) { |
|||
menuItem.menu = appendItems(item.menu); |
|||
} else { |
|||
menuItem.value = item.value; |
|||
if (itemCallback) { |
|||
itemCallback(menuItem); |
|||
} |
|||
} |
|||
output.push(menuItem); |
|||
}); |
|||
return output; |
|||
}; |
|||
return appendItems(inputList, startItems || []); |
|||
}; |
|||
var delayedConfirm = function (editor, message, callback) { |
|||
var rng = editor.selection.getRng(); |
|||
Delay.setEditorTimeout(editor, function () { |
|||
editor.windowManager.confirm(message, function (state) { |
|||
editor.selection.setRng(rng); |
|||
callback(state); |
|||
}); |
|||
}); |
|||
}; |
|||
var showDialog = function (editor, linkList) { |
|||
var data = {}; |
|||
var selection = editor.selection; |
|||
var dom = editor.dom; |
|||
var anchorElm, initialText; |
|||
var win, onlyText, textListCtrl, linkListCtrl, relListCtrl, targetListCtrl, classListCtrl, linkTitleCtrl, value; |
|||
var linkListChangeHandler = function (e) { |
|||
var textCtrl = win.find('#text'); |
|||
if (!textCtrl.value() || e.lastControl && textCtrl.value() === e.lastControl.text()) { |
|||
textCtrl.value(e.control.text()); |
|||
} |
|||
win.find('#href').value(e.control.value()); |
|||
}; |
|||
var buildAnchorListControl = function (url) { |
|||
var anchorList = []; |
|||
Tools.each(editor.dom.select('a:not([href])'), function (anchor) { |
|||
var id = anchor.name || anchor.id; |
|||
if (id) { |
|||
anchorList.push({ |
|||
text: id, |
|||
value: '#' + id, |
|||
selected: url.indexOf('#' + id) !== -1 |
|||
}); |
|||
} |
|||
}); |
|||
if (anchorList.length) { |
|||
anchorList.unshift({ |
|||
text: 'None', |
|||
value: '' |
|||
}); |
|||
return { |
|||
name: 'anchor', |
|||
type: 'listbox', |
|||
label: 'Anchors', |
|||
values: anchorList, |
|||
onselect: linkListChangeHandler |
|||
}; |
|||
} |
|||
}; |
|||
var updateText = function () { |
|||
if (!initialText && onlyText && !data.text) { |
|||
this.parent().parent().find('#text')[0].value(this.value()); |
|||
} |
|||
}; |
|||
var urlChange = function (e) { |
|||
var meta = e.meta || {}; |
|||
if (linkListCtrl) { |
|||
linkListCtrl.value(editor.convertURL(this.value(), 'href')); |
|||
} |
|||
Tools.each(e.meta, function (value, key) { |
|||
var inp = win.find('#' + key); |
|||
if (key === 'text') { |
|||
if (initialText.length === 0) { |
|||
inp.value(value); |
|||
data.text = value; |
|||
} |
|||
} else { |
|||
inp.value(value); |
|||
} |
|||
}); |
|||
if (meta.attach) { |
|||
attachState = { |
|||
href: this.value(), |
|||
attach: meta.attach |
|||
}; |
|||
} |
|||
if (!meta.text) { |
|||
updateText.call(this); |
|||
} |
|||
}; |
|||
var onBeforeCall = function (e) { |
|||
e.meta = win.toJSON(); |
|||
}; |
|||
onlyText = $_dple5hejjd09ewf1.isOnlyTextSelected(selection.getContent()); |
|||
anchorElm = $_dple5hejjd09ewf1.getAnchorElement(editor); |
|||
data.text = initialText = $_dple5hejjd09ewf1.getAnchorText(editor.selection, anchorElm); |
|||
data.href = anchorElm ? dom.getAttrib(anchorElm, 'href') : ''; |
|||
if (anchorElm) { |
|||
data.target = dom.getAttrib(anchorElm, 'target'); |
|||
} else if ($_azkw9efjd09ewex.hasDefaultLinkTarget(editor.settings)) { |
|||
data.target = $_azkw9efjd09ewex.getDefaultLinkTarget(editor.settings); |
|||
} |
|||
if (value = dom.getAttrib(anchorElm, 'rel')) { |
|||
data.rel = value; |
|||
} |
|||
if (value = dom.getAttrib(anchorElm, 'class')) { |
|||
data.class = value; |
|||
} |
|||
if (value = dom.getAttrib(anchorElm, 'title')) { |
|||
data.title = value; |
|||
} |
|||
if (onlyText) { |
|||
textListCtrl = { |
|||
name: 'text', |
|||
type: 'textbox', |
|||
size: 40, |
|||
label: 'Text to display', |
|||
onchange: function () { |
|||
data.text = this.value(); |
|||
} |
|||
}; |
|||
} |
|||
if (linkList) { |
|||
linkListCtrl = { |
|||
type: 'listbox', |
|||
label: 'Link list', |
|||
values: buildListItems(linkList, function (item) { |
|||
item.value = editor.convertURL(item.value || item.url, 'href'); |
|||
}, [{ |
|||
text: 'None', |
|||
value: '' |
|||
}]), |
|||
onselect: linkListChangeHandler, |
|||
value: editor.convertURL(data.href, 'href'), |
|||
onPostRender: function () { |
|||
linkListCtrl = this; |
|||
} |
|||
}; |
|||
} |
|||
if ($_azkw9efjd09ewex.shouldShowTargetList(editor.settings)) { |
|||
if ($_azkw9efjd09ewex.getTargetList(editor.settings) === undefined) { |
|||
$_azkw9efjd09ewex.setTargetList(editor, [ |
|||
{ |
|||
text: 'None', |
|||
value: '' |
|||
}, |
|||
{ |
|||
text: 'New window', |
|||
value: '_blank' |
|||
} |
|||
]); |
|||
} |
|||
targetListCtrl = { |
|||
name: 'target', |
|||
type: 'listbox', |
|||
label: 'Target', |
|||
values: buildListItems($_azkw9efjd09ewex.getTargetList(editor.settings)) |
|||
}; |
|||
} |
|||
if ($_azkw9efjd09ewex.hasRelList(editor.settings)) { |
|||
relListCtrl = { |
|||
name: 'rel', |
|||
type: 'listbox', |
|||
label: 'Rel', |
|||
values: buildListItems($_azkw9efjd09ewex.getRelList(editor.settings), function (item) { |
|||
if ($_azkw9efjd09ewex.allowUnsafeLinkTarget(editor.settings) === false) { |
|||
item.value = $_dple5hejjd09ewf1.toggleTargetRules(item.value, data.target === '_blank'); |
|||
} |
|||
}) |
|||
}; |
|||
} |
|||
if ($_azkw9efjd09ewex.hasLinkClassList(editor.settings)) { |
|||
classListCtrl = { |
|||
name: 'class', |
|||
type: 'listbox', |
|||
label: 'Class', |
|||
values: buildListItems($_azkw9efjd09ewex.getLinkClassList(editor.settings), function (item) { |
|||
if (item.value) { |
|||
item.textStyle = function () { |
|||
return editor.formatter.getCssText({ |
|||
inline: 'a', |
|||
classes: [item.value] |
|||
}); |
|||
}; |
|||
} |
|||
}) |
|||
}; |
|||
} |
|||
if ($_azkw9efjd09ewex.shouldShowLinkTitle(editor.settings)) { |
|||
linkTitleCtrl = { |
|||
name: 'title', |
|||
type: 'textbox', |
|||
label: 'Title', |
|||
value: data.title |
|||
}; |
|||
} |
|||
win = editor.windowManager.open({ |
|||
title: 'Insert link', |
|||
data: data, |
|||
body: [ |
|||
{ |
|||
name: 'href', |
|||
type: 'filepicker', |
|||
filetype: 'file', |
|||
size: 40, |
|||
autofocus: true, |
|||
label: 'Url', |
|||
onchange: urlChange, |
|||
onkeyup: updateText, |
|||
onbeforecall: onBeforeCall |
|||
}, |
|||
textListCtrl, |
|||
linkTitleCtrl, |
|||
buildAnchorListControl(data.href), |
|||
linkListCtrl, |
|||
relListCtrl, |
|||
targetListCtrl, |
|||
classListCtrl |
|||
], |
|||
onSubmit: function (e) { |
|||
var assumeExternalTargets = $_azkw9efjd09ewex.assumeExternalTargets(editor.settings); |
|||
var insertLink = $_dple5hejjd09ewf1.link(editor, attachState); |
|||
var removeLink = $_dple5hejjd09ewf1.unlink(editor); |
|||
var resultData = Tools.extend({}, data, e.data); |
|||
var href = resultData.href; |
|||
if (!href) { |
|||
removeLink(); |
|||
return; |
|||
} |
|||
if (!onlyText || resultData.text === initialText) { |
|||
delete resultData.text; |
|||
} |
|||
if (href.indexOf('@') > 0 && href.indexOf('//') === -1 && href.indexOf('mailto:') === -1) { |
|||
delayedConfirm(editor, 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?', function (state) { |
|||
if (state) { |
|||
resultData.href = 'mailto:' + href; |
|||
} |
|||
insertLink(resultData); |
|||
}); |
|||
return; |
|||
} |
|||
if (assumeExternalTargets === true && !/^\w+:/i.test(href) || assumeExternalTargets === false && /^\s*www[\.|\d\.]/i.test(href)) { |
|||
delayedConfirm(editor, 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?', function (state) { |
|||
if (state) { |
|||
resultData.href = 'http://' + href; |
|||
} |
|||
insertLink(resultData); |
|||
}); |
|||
return; |
|||
} |
|||
insertLink(resultData); |
|||
} |
|||
}); |
|||
}; |
|||
var open$1 = function (editor) { |
|||
createLinkList(editor, showDialog); |
|||
}; |
|||
var $_3jnvzteljd09ewf7 = { open: open$1 }; |
|||
|
|||
var getLink = function (editor, elm) { |
|||
return editor.dom.getParent(elm, 'a[href]'); |
|||
}; |
|||
var getSelectedLink = function (editor) { |
|||
return getLink(editor, editor.selection.getStart()); |
|||
}; |
|||
var getHref = function (elm) { |
|||
var href = elm.getAttribute('data-mce-href'); |
|||
return href ? href : elm.getAttribute('href'); |
|||
}; |
|||
var isContextMenuVisible = function (editor) { |
|||
var contextmenu = editor.plugins.contextmenu; |
|||
return contextmenu ? contextmenu.isContextMenuVisible() : false; |
|||
}; |
|||
var hasOnlyAltModifier = function (e) { |
|||
return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false; |
|||
}; |
|||
var gotoLink = function (editor, a) { |
|||
if (a) { |
|||
var href = getHref(a); |
|||
if (/^#/.test(href)) { |
|||
var targetEl = editor.$(href); |
|||
if (targetEl.length) { |
|||
editor.selection.scrollIntoView(targetEl[0], true); |
|||
} |
|||
} else { |
|||
$_50aixnegjd09ewey.open(a.href); |
|||
} |
|||
} |
|||
}; |
|||
var openDialog = function (editor) { |
|||
return function () { |
|||
$_3jnvzteljd09ewf7.open(editor); |
|||
}; |
|||
}; |
|||
var gotoSelectedLink = function (editor) { |
|||
return function () { |
|||
gotoLink(editor, getSelectedLink(editor)); |
|||
}; |
|||
}; |
|||
var leftClickedOnAHref = function (editor) { |
|||
return function (elm) { |
|||
var sel, rng, node; |
|||
if ($_azkw9efjd09ewex.hasContextToolbar(editor.settings) && !isContextMenuVisible(editor) && $_dple5hejjd09ewf1.isLink(elm)) { |
|||
sel = editor.selection; |
|||
rng = sel.getRng(); |
|||
node = rng.startContainer; |
|||
if (node.nodeType === 3 && sel.isCollapsed() && rng.startOffset > 0 && rng.startOffset < node.data.length) { |
|||
return true; |
|||
} |
|||
} |
|||
return false; |
|||
}; |
|||
}; |
|||
var setupGotoLinks = function (editor) { |
|||
editor.on('click', function (e) { |
|||
var link = getLink(editor, e.target); |
|||
if (link && VK.metaKeyPressed(e)) { |
|||
e.preventDefault(); |
|||
gotoLink(editor, link); |
|||
} |
|||
}); |
|||
editor.on('keydown', function (e) { |
|||
var link = getSelectedLink(editor); |
|||
if (link && e.keyCode === 13 && hasOnlyAltModifier(e)) { |
|||
e.preventDefault(); |
|||
gotoLink(editor, link); |
|||
} |
|||
}); |
|||
}; |
|||
var toggleActiveState = function (editor) { |
|||
return function () { |
|||
var self = this; |
|||
editor.on('nodechange', function (e) { |
|||
self.active(!editor.readonly && !!$_dple5hejjd09ewf1.getAnchorElement(editor, e.element)); |
|||
}); |
|||
}; |
|||
}; |
|||
var toggleViewLinkState = function (editor) { |
|||
return function () { |
|||
var self = this; |
|||
var toggleVisibility = function (e) { |
|||
if ($_dple5hejjd09ewf1.hasLinks(e.parents)) { |
|||
self.show(); |
|||
} else { |
|||
self.hide(); |
|||
} |
|||
}; |
|||
if (!$_dple5hejjd09ewf1.hasLinks(editor.dom.getParents(editor.selection.getStart()))) { |
|||
self.hide(); |
|||
} |
|||
editor.on('nodechange', toggleVisibility); |
|||
self.on('remove', function () { |
|||
editor.off('nodechange', toggleVisibility); |
|||
}); |
|||
}; |
|||
}; |
|||
var $_48403vedjd09ewet = { |
|||
openDialog: openDialog, |
|||
gotoSelectedLink: gotoSelectedLink, |
|||
leftClickedOnAHref: leftClickedOnAHref, |
|||
setupGotoLinks: setupGotoLinks, |
|||
toggleActiveState: toggleActiveState, |
|||
toggleViewLinkState: toggleViewLinkState |
|||
}; |
|||
|
|||
var register = function (editor) { |
|||
editor.addCommand('mceLink', $_48403vedjd09ewet.openDialog(editor)); |
|||
}; |
|||
var $_8rg1d0ecjd09ewes = { register: register }; |
|||
|
|||
var setup = function (editor) { |
|||
editor.addShortcut('Meta+K', '', $_48403vedjd09ewet.openDialog(editor)); |
|||
}; |
|||
var $_cvgudbeojd09ewfk = { setup: setup }; |
|||
|
|||
var setupButtons = function (editor) { |
|||
editor.addButton('link', { |
|||
active: false, |
|||
icon: 'link', |
|||
tooltip: 'Insert/edit link', |
|||
onclick: $_48403vedjd09ewet.openDialog(editor), |
|||
onpostrender: $_48403vedjd09ewet.toggleActiveState(editor) |
|||
}); |
|||
editor.addButton('unlink', { |
|||
active: false, |
|||
icon: 'unlink', |
|||
tooltip: 'Remove link', |
|||
onclick: $_dple5hejjd09ewf1.unlink(editor), |
|||
onpostrender: $_48403vedjd09ewet.toggleActiveState(editor) |
|||
}); |
|||
if (editor.addContextToolbar) { |
|||
editor.addButton('openlink', { |
|||
icon: 'newtab', |
|||
tooltip: 'Open link', |
|||
onclick: $_48403vedjd09ewet.gotoSelectedLink(editor) |
|||
}); |
|||
} |
|||
}; |
|||
var setupMenuItems = function (editor) { |
|||
editor.addMenuItem('openlink', { |
|||
text: 'Open link', |
|||
icon: 'newtab', |
|||
onclick: $_48403vedjd09ewet.gotoSelectedLink(editor), |
|||
onPostRender: $_48403vedjd09ewet.toggleViewLinkState(editor), |
|||
prependToContext: true |
|||
}); |
|||
editor.addMenuItem('link', { |
|||
icon: 'link', |
|||
text: 'Link', |
|||
shortcut: 'Meta+K', |
|||
onclick: $_48403vedjd09ewet.openDialog(editor), |
|||
stateSelector: 'a[href]', |
|||
context: 'insert', |
|||
prependToContext: true |
|||
}); |
|||
}; |
|||
var setupContextToolbars = function (editor) { |
|||
if (editor.addContextToolbar) { |
|||
editor.addContextToolbar($_48403vedjd09ewet.leftClickedOnAHref(editor), 'openlink | link unlink'); |
|||
} |
|||
}; |
|||
var $_br8eaoepjd09ewfl = { |
|||
setupButtons: setupButtons, |
|||
setupMenuItems: setupMenuItems, |
|||
setupContextToolbars: setupContextToolbars |
|||
}; |
|||
|
|||
PluginManager.add('link', function (editor) { |
|||
$_br8eaoepjd09ewfl.setupButtons(editor); |
|||
$_br8eaoepjd09ewfl.setupMenuItems(editor); |
|||
$_br8eaoepjd09ewfl.setupContextToolbars(editor); |
|||
$_48403vedjd09ewet.setupGotoLinks(editor); |
|||
$_8rg1d0ecjd09ewes.register(editor); |
|||
$_cvgudbeojd09ewfk.setup(editor); |
|||
}); |
|||
function Plugin () { |
|||
} |
|||
|
|||
return Plugin; |
|||
|
|||
}()); |
|||
})() |