080600
This commit is contained in:
@@ -1,215 +1,215 @@
|
||||
/*
|
||||
* Edited for compatibility with old TinyMCE 3.x plugins in WordPress.
|
||||
* More info: https://core.trac.wordpress.org/ticket/31596#comment:10
|
||||
*/
|
||||
|
||||
/* Generic */
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
font-size:13px;
|
||||
background:#fcfcfc;
|
||||
padding:0;
|
||||
margin:8px 8px 0 8px;
|
||||
}
|
||||
|
||||
textarea {resize:none;outline:none;}
|
||||
|
||||
a:link, a:hover {
|
||||
color: #2B6FB6;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #3C2BB6;
|
||||
}
|
||||
|
||||
.nowrap {white-space: nowrap}
|
||||
|
||||
/* Forms */
|
||||
form {margin: 0;}
|
||||
fieldset {margin:0; padding:4px; border:1px solid #dfdfdf; font-family:Verdana, Arial; font-size:10px;}
|
||||
legend {color:#2B6FB6; font-weight:bold;}
|
||||
label.msg {display:none;}
|
||||
label.invalid {color:#EE0000; display:inline;}
|
||||
input.invalid {border:1px solid #EE0000;}
|
||||
input {background:#FFF; border:1px solid #dfdfdf;}
|
||||
input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
|
||||
input, select, textarea {border:1px solid #dfdfdf;}
|
||||
input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
|
||||
input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
|
||||
.input_noborder {border:0;}
|
||||
|
||||
/* Buttons */
|
||||
#insert,
|
||||
#cancel,
|
||||
#apply,
|
||||
.mceActionPanel .button,
|
||||
input.mceButton,
|
||||
.updateButton {
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
border: 1px solid #adadad;
|
||||
margin: 0;
|
||||
padding: 0 10px 1px;
|
||||
font-size: 13px;
|
||||
height: 24px;
|
||||
line-height: 22px;
|
||||
color: #333;
|
||||
cursor: pointer;
|
||||
-webkit-border-radius: 3px;
|
||||
-webkit-appearance: none;
|
||||
border-radius: 3px;
|
||||
white-space: nowrap;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
background: #fafafa;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fafafa), to(#e9e9e9));
|
||||
background-image: -webkit-linear-gradient(top, #fafafa, #e9e9e9);
|
||||
background-image: -moz-linear-gradient(top, #fafafa, #e9e9e9);
|
||||
background-image: -o-linear-gradient(top, #fafafa, #e9e9e9);
|
||||
background-image: linear-gradient(to bottom, #fafafa, #e9e9e9);
|
||||
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
-webkit-box-shadow: inset 0 1px 0 #fff;
|
||||
-moz-box-shadow: inset 0 1px 0 #fff;
|
||||
box-shadow: inset 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
#insert {
|
||||
background: #2ea2cc;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#2ea2cc), to(#1e8cbe));
|
||||
background: -webkit-linear-gradient(top, #2ea2cc 0%,#1e8cbe 100%);
|
||||
background: linear-gradient(top, #2ea2cc 0%,#1e8cbe 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2ea2cc', endColorstr='#1e8cbe',GradientType=0 );
|
||||
border-color: #0074a2;
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
||||
box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
text-shadow: 0 1px 0 rgba(0,86,132,0.7);
|
||||
}
|
||||
|
||||
#cancel:hover,
|
||||
input.mceButton:hover,
|
||||
.updateButton:hover,
|
||||
#cancel:focus,
|
||||
input.mceButton:focus,
|
||||
.updateButton:focus {
|
||||
background: #f3f3f3;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f3f3f3));
|
||||
background-image: -webkit-linear-gradient(top, #fff, #f3f3f3);
|
||||
background-image: -moz-linear-gradient(top, #fff, #f3f3f3);
|
||||
background-image: -ms-linear-gradient(top, #fff, #f3f3f3);
|
||||
background-image: -o-linear-gradient(top, #fff, #f3f3f3);
|
||||
background-image: linear-gradient(to bottom, #fff, #f3f3f3);
|
||||
border-color: #999;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
#insert:hover,
|
||||
#insert:focus {
|
||||
background: #1e8cbe;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#1e8cbe), to(#0074a2));
|
||||
background: -webkit-linear-gradient(top, #1e8cbe 0%,#0074a2 100%);
|
||||
background: linear-gradient(top, #1e8cbe 0%,#0074a2 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e8cbe', endColorstr='#0074a2',GradientType=0 );
|
||||
border-color: #0074a2;
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
|
||||
box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.mceActionPanel #insert {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* Browse */
|
||||
a.pickcolor, a.browse {text-decoration:none}
|
||||
a.browse span {display:block; width:20px; height:18px; border:1px solid #FFF; margin-left:1px;}
|
||||
.mceOldBoxModel a.browse span {width:22px; height:20px;}
|
||||
a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
|
||||
a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30);}
|
||||
a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
|
||||
a.pickcolor span {display:block; width:20px; height:16px; margin-left:2px;}
|
||||
.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
|
||||
a.pickcolor:hover span {background-color:#B2BBD0;}
|
||||
div.iframecontainer {background: #fff;}
|
||||
|
||||
/* Charmap */
|
||||
table.charmap {border:1px solid #AAA; text-align:center}
|
||||
td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
|
||||
#charmap a {display:block; color:#000; text-decoration:none; border:0}
|
||||
#charmap a:hover {background:#CCC;color:#2B6FB6}
|
||||
#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
|
||||
#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
|
||||
#charmap #charmapView {background-color:#fff;}
|
||||
|
||||
/* Source */
|
||||
.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
|
||||
.mceActionPanel {margin-top:5px;}
|
||||
|
||||
/* Tabs classes */
|
||||
.tabs {width:100%; height:19px; line-height:normal; border-bottom: 1px solid #aaa;}
|
||||
.tabs ul {margin:0; padding:0; list-style:none;}
|
||||
.tabs li {float:left; border: 1px solid #aaa; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
|
||||
.tabs li.current {border-bottom: 1px solid #fff; margin-right:2px;}
|
||||
.tabs span {float:left; display:block; padding:0px 10px 0 0;}
|
||||
.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
|
||||
.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
|
||||
|
||||
.wp-core-ui #tabs {
|
||||
padding-bottom: 5px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.wp-core-ui #tabs a {
|
||||
padding: 6px 10px;
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
/* Panels */
|
||||
.panel_wrapper div.panel {display:none;}
|
||||
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
|
||||
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
|
||||
|
||||
/* Columns */
|
||||
.column {float:left;}
|
||||
.properties {width:100%;}
|
||||
.properties .column1 {}
|
||||
.properties .column2 {text-align:left;}
|
||||
|
||||
/* Titles */
|
||||
h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
|
||||
h3 {font-size:14px;}
|
||||
.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
|
||||
|
||||
/* Dialog specific */
|
||||
#link .panel_wrapper, #link div.current {height:125px;}
|
||||
#image .panel_wrapper, #image div.current {height:200px;}
|
||||
#plugintable thead {font-weight:bold; background:#DDD;}
|
||||
#plugintable, #about #plugintable td {border:1px solid #919B9C;}
|
||||
#plugintable {width:96%; margin-top:10px;}
|
||||
#pluginscontainer {height:290px; overflow:auto;}
|
||||
#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px}
|
||||
#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline}
|
||||
#colorpicker #preview_wrapper {text-align:center; padding-top:4px; white-space: nowrap; float: right;}
|
||||
#colorpicker #insert, #colorpicker #cancel {width: 90px}
|
||||
#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
|
||||
#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
|
||||
#colorpicker #light div {overflow:hidden;}
|
||||
#colorpicker .panel_wrapper div.current {height:175px;}
|
||||
#colorpicker #namedcolors {width:150px;}
|
||||
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
|
||||
#colorpicker #colornamecontainer {margin-top:5px;}
|
||||
#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
|
||||
|
||||
|
||||
/* Localization */
|
||||
|
||||
body[dir="rtl"],
|
||||
body[dir="rtl"] fieldset,
|
||||
body[dir="rtl"] input, body[dir="rtl"] select, body[dir="rtl"] textarea,
|
||||
body[dir="rtl"] #charmap #codeN,
|
||||
body[dir="rtl"] .tabs a {
|
||||
font-family: Tahoma, sans-serif;
|
||||
}
|
||||
/*
|
||||
* Edited for compatibility with old TinyMCE 3.x plugins in WordPress.
|
||||
* More info: https://core.trac.wordpress.org/ticket/31596#comment:10
|
||||
*/
|
||||
|
||||
/* Generic */
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
font-size:13px;
|
||||
background:#fcfcfc;
|
||||
padding:0;
|
||||
margin:8px 8px 0 8px;
|
||||
}
|
||||
|
||||
textarea {resize:none;outline:none;}
|
||||
|
||||
a:link, a:hover {
|
||||
color: #2B6FB6;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #3C2BB6;
|
||||
}
|
||||
|
||||
.nowrap {white-space: nowrap}
|
||||
|
||||
/* Forms */
|
||||
form {margin: 0;}
|
||||
fieldset {margin:0; padding:4px; border:1px solid #dfdfdf; font-family:Verdana, Arial; font-size:10px;}
|
||||
legend {color:#2B6FB6; font-weight:bold;}
|
||||
label.msg {display:none;}
|
||||
label.invalid {color:#EE0000; display:inline;}
|
||||
input.invalid {border:1px solid #EE0000;}
|
||||
input {background:#FFF; border:1px solid #dfdfdf;}
|
||||
input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
|
||||
input, select, textarea {border:1px solid #dfdfdf;}
|
||||
input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
|
||||
input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
|
||||
.input_noborder {border:0;}
|
||||
|
||||
/* Buttons */
|
||||
#insert,
|
||||
#cancel,
|
||||
#apply,
|
||||
.mceActionPanel .button,
|
||||
input.mceButton,
|
||||
.updateButton {
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
border: 1px solid #adadad;
|
||||
margin: 0;
|
||||
padding: 0 10px 1px;
|
||||
font-size: 13px;
|
||||
height: 24px;
|
||||
line-height: 22px;
|
||||
color: #333;
|
||||
cursor: pointer;
|
||||
-webkit-border-radius: 3px;
|
||||
-webkit-appearance: none;
|
||||
border-radius: 3px;
|
||||
white-space: nowrap;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
background: #fafafa;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fafafa), to(#e9e9e9));
|
||||
background-image: -webkit-linear-gradient(top, #fafafa, #e9e9e9);
|
||||
background-image: -moz-linear-gradient(top, #fafafa, #e9e9e9);
|
||||
background-image: -o-linear-gradient(top, #fafafa, #e9e9e9);
|
||||
background-image: linear-gradient(to bottom, #fafafa, #e9e9e9);
|
||||
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
-webkit-box-shadow: inset 0 1px 0 #fff;
|
||||
-moz-box-shadow: inset 0 1px 0 #fff;
|
||||
box-shadow: inset 0 1px 0 #fff;
|
||||
}
|
||||
|
||||
#insert {
|
||||
background: #2ea2cc;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#2ea2cc), to(#1e8cbe));
|
||||
background: -webkit-linear-gradient(top, #2ea2cc 0%,#1e8cbe 100%);
|
||||
background: linear-gradient(top, #2ea2cc 0%,#1e8cbe 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#2ea2cc', endColorstr='#1e8cbe',GradientType=0 );
|
||||
border-color: #0074a2;
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
||||
box-shadow: inset 0 1px 0 rgba(120,200,230,0.5);
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
text-shadow: 0 1px 0 rgba(0,86,132,0.7);
|
||||
}
|
||||
|
||||
#cancel:hover,
|
||||
input.mceButton:hover,
|
||||
.updateButton:hover,
|
||||
#cancel:focus,
|
||||
input.mceButton:focus,
|
||||
.updateButton:focus {
|
||||
background: #f3f3f3;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f3f3f3));
|
||||
background-image: -webkit-linear-gradient(top, #fff, #f3f3f3);
|
||||
background-image: -moz-linear-gradient(top, #fff, #f3f3f3);
|
||||
background-image: -ms-linear-gradient(top, #fff, #f3f3f3);
|
||||
background-image: -o-linear-gradient(top, #fff, #f3f3f3);
|
||||
background-image: linear-gradient(to bottom, #fff, #f3f3f3);
|
||||
border-color: #999;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
#insert:hover,
|
||||
#insert:focus {
|
||||
background: #1e8cbe;
|
||||
background: -webkit-gradient(linear, left top, left bottom, from(#1e8cbe), to(#0074a2));
|
||||
background: -webkit-linear-gradient(top, #1e8cbe 0%,#0074a2 100%);
|
||||
background: linear-gradient(top, #1e8cbe 0%,#0074a2 100%);
|
||||
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e8cbe', endColorstr='#0074a2',GradientType=0 );
|
||||
border-color: #0074a2;
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
|
||||
box-shadow: inset 0 1px 0 rgba(120,200,230,0.6);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.mceActionPanel #insert {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* Browse */
|
||||
a.pickcolor, a.browse {text-decoration:none}
|
||||
a.browse span {display:block; width:20px; height:18px; border:1px solid #FFF; margin-left:1px;}
|
||||
.mceOldBoxModel a.browse span {width:22px; height:20px;}
|
||||
a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
|
||||
a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30);}
|
||||
a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
|
||||
a.pickcolor span {display:block; width:20px; height:16px; margin-left:2px;}
|
||||
.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
|
||||
a.pickcolor:hover span {background-color:#B2BBD0;}
|
||||
div.iframecontainer {background: #fff;}
|
||||
|
||||
/* Charmap */
|
||||
table.charmap {border:1px solid #AAA; text-align:center}
|
||||
td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
|
||||
#charmap a {display:block; color:#000; text-decoration:none; border:0}
|
||||
#charmap a:hover {background:#CCC;color:#2B6FB6}
|
||||
#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
|
||||
#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
|
||||
#charmap #charmapView {background-color:#fff;}
|
||||
|
||||
/* Source */
|
||||
.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
|
||||
.mceActionPanel {margin-top:5px;}
|
||||
|
||||
/* Tabs classes */
|
||||
.tabs {width:100%; height:19px; line-height:normal; border-bottom: 1px solid #aaa;}
|
||||
.tabs ul {margin:0; padding:0; list-style:none;}
|
||||
.tabs li {float:left; border: 1px solid #aaa; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
|
||||
.tabs li.current {border-bottom: 1px solid #fff; margin-right:2px;}
|
||||
.tabs span {float:left; display:block; padding:0px 10px 0 0;}
|
||||
.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
|
||||
.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
|
||||
|
||||
.wp-core-ui #tabs {
|
||||
padding-bottom: 5px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.wp-core-ui #tabs a {
|
||||
padding: 6px 10px;
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
/* Panels */
|
||||
.panel_wrapper div.panel {display:none;}
|
||||
.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
|
||||
.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
|
||||
|
||||
/* Columns */
|
||||
.column {float:left;}
|
||||
.properties {width:100%;}
|
||||
.properties .column1 {}
|
||||
.properties .column2 {text-align:left;}
|
||||
|
||||
/* Titles */
|
||||
h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
|
||||
h3 {font-size:14px;}
|
||||
.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
|
||||
|
||||
/* Dialog specific */
|
||||
#link .panel_wrapper, #link div.current {height:125px;}
|
||||
#image .panel_wrapper, #image div.current {height:200px;}
|
||||
#plugintable thead {font-weight:bold; background:#DDD;}
|
||||
#plugintable, #about #plugintable td {border:1px solid #919B9C;}
|
||||
#plugintable {width:96%; margin-top:10px;}
|
||||
#pluginscontainer {height:290px; overflow:auto;}
|
||||
#colorpicker #preview {display:inline-block; padding-left:40px; height:14px; border:1px solid black; margin-left:5px; margin-right: 5px}
|
||||
#colorpicker #previewblock {position: relative; top: -3px; padding-left:5px; padding-top: 0px; display:inline}
|
||||
#colorpicker #preview_wrapper {text-align:center; padding-top:4px; white-space: nowrap; float: right;}
|
||||
#colorpicker #insert, #colorpicker #cancel {width: 90px}
|
||||
#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
|
||||
#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
|
||||
#colorpicker #light div {overflow:hidden;}
|
||||
#colorpicker .panel_wrapper div.current {height:175px;}
|
||||
#colorpicker #namedcolors {width:150px;}
|
||||
#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
|
||||
#colorpicker #colornamecontainer {margin-top:5px;}
|
||||
#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
|
||||
|
||||
|
||||
/* Localization */
|
||||
|
||||
body[dir="rtl"],
|
||||
body[dir="rtl"] fieldset,
|
||||
body[dir="rtl"] input, body[dir="rtl"] select, body[dir="rtl"] textarea,
|
||||
body[dir="rtl"] #charmap #codeN,
|
||||
body[dir="rtl"] .tabs a {
|
||||
font-family: Tahoma, sans-serif;
|
||||
}
|
||||
|
||||
@@ -1,322 +1,322 @@
|
||||
/**
|
||||
* plugin.js
|
||||
*
|
||||
* Released under LGPL License.
|
||||
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
/*global tinymce:true, console:true */
|
||||
/*eslint no-console:0, new-cap:0 */
|
||||
|
||||
/**
|
||||
* This plugin adds missing events form the 4.x API back. Not every event is
|
||||
* properly supported but most things should work.
|
||||
*
|
||||
* Unsupported things:
|
||||
* - No editor.onEvent
|
||||
* - Can't cancel execCommands with beforeExecCommand
|
||||
*/
|
||||
(function (tinymce) {
|
||||
var reported;
|
||||
|
||||
function noop() {
|
||||
}
|
||||
|
||||
function log(apiCall) {
|
||||
if (!reported && window && window.console) {
|
||||
reported = true;
|
||||
console.log("Deprecated TinyMCE API call: " + apiCall);
|
||||
}
|
||||
}
|
||||
|
||||
function Dispatcher(target, newEventName, argsMap, defaultScope) {
|
||||
target = target || this;
|
||||
var cbs = [];
|
||||
|
||||
if (!newEventName) {
|
||||
this.add = this.addToTop = this.remove = this.dispatch = noop;
|
||||
return;
|
||||
}
|
||||
|
||||
this.add = function (callback, scope, prepend) {
|
||||
log('<target>.on' + newEventName + ".add(..)");
|
||||
|
||||
// Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2)
|
||||
function patchedEventCallback(e) {
|
||||
var callbackArgs = [];
|
||||
|
||||
if (typeof argsMap == "string") {
|
||||
argsMap = argsMap.split(" ");
|
||||
}
|
||||
|
||||
if (argsMap && typeof argsMap !== "function") {
|
||||
for (var i = 0; i < argsMap.length; i++) {
|
||||
callbackArgs.push(e[argsMap[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof argsMap == "function") {
|
||||
callbackArgs = argsMap(newEventName, e, target);
|
||||
if (!callbackArgs) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!argsMap) {
|
||||
callbackArgs = [e];
|
||||
}
|
||||
|
||||
callbackArgs.unshift(defaultScope || target);
|
||||
|
||||
if (callback.apply(scope || defaultScope || target, callbackArgs) === false) {
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
}
|
||||
|
||||
target.on(newEventName, patchedEventCallback, prepend);
|
||||
|
||||
var handlers = {
|
||||
original: callback,
|
||||
patched: patchedEventCallback
|
||||
};
|
||||
|
||||
cbs.push(handlers);
|
||||
return patchedEventCallback;
|
||||
};
|
||||
|
||||
this.addToTop = function (callback, scope) {
|
||||
this.add(callback, scope, true);
|
||||
};
|
||||
|
||||
this.remove = function (callback) {
|
||||
cbs.forEach(function (item, i) {
|
||||
if (item.original === callback) {
|
||||
cbs.splice(i, 1);
|
||||
return target.off(newEventName, item.patched);
|
||||
}
|
||||
});
|
||||
|
||||
return target.off(newEventName, callback);
|
||||
};
|
||||
|
||||
this.dispatch = function () {
|
||||
target.fire(newEventName);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
tinymce.util.Dispatcher = Dispatcher;
|
||||
tinymce.onBeforeUnload = new Dispatcher(tinymce, "BeforeUnload");
|
||||
tinymce.onAddEditor = new Dispatcher(tinymce, "AddEditor", "editor");
|
||||
tinymce.onRemoveEditor = new Dispatcher(tinymce, "RemoveEditor", "editor");
|
||||
|
||||
tinymce.util.Cookie = {
|
||||
get: noop, getHash: noop, remove: noop, set: noop, setHash: noop
|
||||
};
|
||||
|
||||
function patchEditor(editor) {
|
||||
|
||||
function translate(str) {
|
||||
var prefix = editor.settings.language || "en";
|
||||
var prefixedStr = [prefix, str].join('.');
|
||||
var translatedStr = tinymce.i18n.translate(prefixedStr);
|
||||
|
||||
return prefixedStr !== translatedStr ? translatedStr : tinymce.i18n.translate(str);
|
||||
}
|
||||
|
||||
function patchEditorEvents(oldEventNames, argsMap) {
|
||||
tinymce.each(oldEventNames.split(" "), function (oldName) {
|
||||
editor["on" + oldName] = new Dispatcher(editor, oldName, argsMap);
|
||||
});
|
||||
}
|
||||
|
||||
function convertUndoEventArgs(type, event, target) {
|
||||
return [
|
||||
event.level,
|
||||
target
|
||||
];
|
||||
}
|
||||
|
||||
function filterSelectionEvents(needsSelection) {
|
||||
return function (type, e) {
|
||||
if ((!e.selection && !needsSelection) || e.selection == needsSelection) {
|
||||
return [e];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (editor.controlManager) {
|
||||
return;
|
||||
}
|
||||
|
||||
function cmNoop() {
|
||||
var obj = {}, methods = 'add addMenu addSeparator collapse createMenu destroy displayColor expand focus ' +
|
||||
'getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark ' +
|
||||
'postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex ' +
|
||||
'setActive setAriaProperty setColor setDisabled setSelected setState showMenu update';
|
||||
|
||||
log('editor.controlManager.*');
|
||||
|
||||
function _noop() {
|
||||
return cmNoop();
|
||||
}
|
||||
|
||||
tinymce.each(methods.split(' '), function (method) {
|
||||
obj[method] = _noop;
|
||||
});
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
editor.controlManager = {
|
||||
buttons: {},
|
||||
|
||||
setDisabled: function (name, state) {
|
||||
log("controlManager.setDisabled(..)");
|
||||
|
||||
if (this.buttons[name]) {
|
||||
this.buttons[name].disabled(state);
|
||||
}
|
||||
},
|
||||
|
||||
setActive: function (name, state) {
|
||||
log("controlManager.setActive(..)");
|
||||
|
||||
if (this.buttons[name]) {
|
||||
this.buttons[name].active(state);
|
||||
}
|
||||
},
|
||||
|
||||
onAdd: new Dispatcher(),
|
||||
onPostRender: new Dispatcher(),
|
||||
|
||||
add: function (obj) {
|
||||
return obj;
|
||||
},
|
||||
createButton: cmNoop,
|
||||
createColorSplitButton: cmNoop,
|
||||
createControl: cmNoop,
|
||||
createDropMenu: cmNoop,
|
||||
createListBox: cmNoop,
|
||||
createMenuButton: cmNoop,
|
||||
createSeparator: cmNoop,
|
||||
createSplitButton: cmNoop,
|
||||
createToolbar: cmNoop,
|
||||
createToolbarGroup: cmNoop,
|
||||
destroy: noop,
|
||||
get: noop,
|
||||
setControlType: cmNoop
|
||||
};
|
||||
|
||||
patchEditorEvents("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate", "editor");
|
||||
patchEditorEvents("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset");
|
||||
patchEditorEvents("BeforeExecCommand ExecCommand", "command ui value args"); // args.terminate not supported
|
||||
patchEditorEvents("PreProcess PostProcess LoadContent SaveContent Change");
|
||||
patchEditorEvents("BeforeSetContent BeforeGetContent SetContent GetContent", filterSelectionEvents(false));
|
||||
patchEditorEvents("SetProgressState", "state time");
|
||||
patchEditorEvents("VisualAid", "element hasVisual");
|
||||
patchEditorEvents("Undo Redo", convertUndoEventArgs);
|
||||
|
||||
patchEditorEvents("NodeChange", function (type, e) {
|
||||
return [
|
||||
editor.controlManager,
|
||||
e.element,
|
||||
editor.selection.isCollapsed(),
|
||||
e
|
||||
];
|
||||
});
|
||||
|
||||
var originalAddButton = editor.addButton;
|
||||
editor.addButton = function (name, settings) {
|
||||
var originalOnPostRender;
|
||||
|
||||
function patchedPostRender() {
|
||||
editor.controlManager.buttons[name] = this;
|
||||
|
||||
if (originalOnPostRender) {
|
||||
return originalOnPostRender.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
for (var key in settings) {
|
||||
if (key.toLowerCase() === "onpostrender") {
|
||||
originalOnPostRender = settings[key];
|
||||
settings.onPostRender = patchedPostRender;
|
||||
}
|
||||
}
|
||||
|
||||
if (!originalOnPostRender) {
|
||||
settings.onPostRender = patchedPostRender;
|
||||
}
|
||||
|
||||
if (settings.title) {
|
||||
settings.title = translate(settings.title);
|
||||
}
|
||||
|
||||
return originalAddButton.call(this, name, settings);
|
||||
};
|
||||
|
||||
editor.on('init', function () {
|
||||
var undoManager = editor.undoManager, selection = editor.selection;
|
||||
|
||||
undoManager.onUndo = new Dispatcher(editor, "Undo", convertUndoEventArgs, null, undoManager);
|
||||
undoManager.onRedo = new Dispatcher(editor, "Redo", convertUndoEventArgs, null, undoManager);
|
||||
undoManager.onBeforeAdd = new Dispatcher(editor, "BeforeAddUndo", null, undoManager);
|
||||
undoManager.onAdd = new Dispatcher(editor, "AddUndo", null, undoManager);
|
||||
|
||||
selection.onBeforeGetContent = new Dispatcher(editor, "BeforeGetContent", filterSelectionEvents(true), selection);
|
||||
selection.onGetContent = new Dispatcher(editor, "GetContent", filterSelectionEvents(true), selection);
|
||||
selection.onBeforeSetContent = new Dispatcher(editor, "BeforeSetContent", filterSelectionEvents(true), selection);
|
||||
selection.onSetContent = new Dispatcher(editor, "SetContent", filterSelectionEvents(true), selection);
|
||||
});
|
||||
|
||||
editor.on('BeforeRenderUI', function () {
|
||||
var windowManager = editor.windowManager;
|
||||
|
||||
windowManager.onOpen = new Dispatcher();
|
||||
windowManager.onClose = new Dispatcher();
|
||||
windowManager.createInstance = function (className, a, b, c, d, e) {
|
||||
log("windowManager.createInstance(..)");
|
||||
|
||||
var constr = tinymce.resolve(className);
|
||||
return new constr(a, b, c, d, e);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
tinymce.on('SetupEditor', function (e) {
|
||||
patchEditor(e.editor);
|
||||
});
|
||||
|
||||
tinymce.PluginManager.add("compat3x", patchEditor);
|
||||
|
||||
tinymce.addI18n = function (prefix, o) {
|
||||
var I18n = tinymce.util.I18n, each = tinymce.each;
|
||||
|
||||
if (typeof prefix == "string" && prefix.indexOf('.') === -1) {
|
||||
I18n.add(prefix, o);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!tinymce.is(prefix, 'string')) {
|
||||
each(prefix, function (o, lc) {
|
||||
each(o, function (o, g) {
|
||||
each(o, function (o, k) {
|
||||
if (g === 'common') {
|
||||
I18n.data[lc + '.' + k] = o;
|
||||
} else {
|
||||
I18n.data[lc + '.' + g + '.' + k] = o;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
each(o, function (o, k) {
|
||||
I18n.data[prefix + '.' + k] = o;
|
||||
});
|
||||
}
|
||||
};
|
||||
})(tinymce);
|
||||
/**
|
||||
* plugin.js
|
||||
*
|
||||
* Released under LGPL License.
|
||||
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
/*global tinymce:true, console:true */
|
||||
/*eslint no-console:0, new-cap:0 */
|
||||
|
||||
/**
|
||||
* This plugin adds missing events form the 4.x API back. Not every event is
|
||||
* properly supported but most things should work.
|
||||
*
|
||||
* Unsupported things:
|
||||
* - No editor.onEvent
|
||||
* - Can't cancel execCommands with beforeExecCommand
|
||||
*/
|
||||
(function (tinymce) {
|
||||
var reported;
|
||||
|
||||
function noop() {
|
||||
}
|
||||
|
||||
function log(apiCall) {
|
||||
if (!reported && window && window.console) {
|
||||
reported = true;
|
||||
console.log("Deprecated TinyMCE API call: " + apiCall);
|
||||
}
|
||||
}
|
||||
|
||||
function Dispatcher(target, newEventName, argsMap, defaultScope) {
|
||||
target = target || this;
|
||||
var cbs = [];
|
||||
|
||||
if (!newEventName) {
|
||||
this.add = this.addToTop = this.remove = this.dispatch = noop;
|
||||
return;
|
||||
}
|
||||
|
||||
this.add = function (callback, scope, prepend) {
|
||||
log('<target>.on' + newEventName + ".add(..)");
|
||||
|
||||
// Convert callback({arg1:x, arg2:x}) -> callback(arg1, arg2)
|
||||
function patchedEventCallback(e) {
|
||||
var callbackArgs = [];
|
||||
|
||||
if (typeof argsMap == "string") {
|
||||
argsMap = argsMap.split(" ");
|
||||
}
|
||||
|
||||
if (argsMap && typeof argsMap !== "function") {
|
||||
for (var i = 0; i < argsMap.length; i++) {
|
||||
callbackArgs.push(e[argsMap[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof argsMap == "function") {
|
||||
callbackArgs = argsMap(newEventName, e, target);
|
||||
if (!callbackArgs) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!argsMap) {
|
||||
callbackArgs = [e];
|
||||
}
|
||||
|
||||
callbackArgs.unshift(defaultScope || target);
|
||||
|
||||
if (callback.apply(scope || defaultScope || target, callbackArgs) === false) {
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
}
|
||||
|
||||
target.on(newEventName, patchedEventCallback, prepend);
|
||||
|
||||
var handlers = {
|
||||
original: callback,
|
||||
patched: patchedEventCallback
|
||||
};
|
||||
|
||||
cbs.push(handlers);
|
||||
return patchedEventCallback;
|
||||
};
|
||||
|
||||
this.addToTop = function (callback, scope) {
|
||||
this.add(callback, scope, true);
|
||||
};
|
||||
|
||||
this.remove = function (callback) {
|
||||
cbs.forEach(function (item, i) {
|
||||
if (item.original === callback) {
|
||||
cbs.splice(i, 1);
|
||||
return target.off(newEventName, item.patched);
|
||||
}
|
||||
});
|
||||
|
||||
return target.off(newEventName, callback);
|
||||
};
|
||||
|
||||
this.dispatch = function () {
|
||||
target.fire(newEventName);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
tinymce.util.Dispatcher = Dispatcher;
|
||||
tinymce.onBeforeUnload = new Dispatcher(tinymce, "BeforeUnload");
|
||||
tinymce.onAddEditor = new Dispatcher(tinymce, "AddEditor", "editor");
|
||||
tinymce.onRemoveEditor = new Dispatcher(tinymce, "RemoveEditor", "editor");
|
||||
|
||||
tinymce.util.Cookie = {
|
||||
get: noop, getHash: noop, remove: noop, set: noop, setHash: noop
|
||||
};
|
||||
|
||||
function patchEditor(editor) {
|
||||
|
||||
function translate(str) {
|
||||
var prefix = editor.settings.language || "en";
|
||||
var prefixedStr = [prefix, str].join('.');
|
||||
var translatedStr = tinymce.i18n.translate(prefixedStr);
|
||||
|
||||
return prefixedStr !== translatedStr ? translatedStr : tinymce.i18n.translate(str);
|
||||
}
|
||||
|
||||
function patchEditorEvents(oldEventNames, argsMap) {
|
||||
tinymce.each(oldEventNames.split(" "), function (oldName) {
|
||||
editor["on" + oldName] = new Dispatcher(editor, oldName, argsMap);
|
||||
});
|
||||
}
|
||||
|
||||
function convertUndoEventArgs(type, event, target) {
|
||||
return [
|
||||
event.level,
|
||||
target
|
||||
];
|
||||
}
|
||||
|
||||
function filterSelectionEvents(needsSelection) {
|
||||
return function (type, e) {
|
||||
if ((!e.selection && !needsSelection) || e.selection == needsSelection) {
|
||||
return [e];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (editor.controlManager) {
|
||||
return;
|
||||
}
|
||||
|
||||
function cmNoop() {
|
||||
var obj = {}, methods = 'add addMenu addSeparator collapse createMenu destroy displayColor expand focus ' +
|
||||
'getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark ' +
|
||||
'postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex ' +
|
||||
'setActive setAriaProperty setColor setDisabled setSelected setState showMenu update';
|
||||
|
||||
log('editor.controlManager.*');
|
||||
|
||||
function _noop() {
|
||||
return cmNoop();
|
||||
}
|
||||
|
||||
tinymce.each(methods.split(' '), function (method) {
|
||||
obj[method] = _noop;
|
||||
});
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
editor.controlManager = {
|
||||
buttons: {},
|
||||
|
||||
setDisabled: function (name, state) {
|
||||
log("controlManager.setDisabled(..)");
|
||||
|
||||
if (this.buttons[name]) {
|
||||
this.buttons[name].disabled(state);
|
||||
}
|
||||
},
|
||||
|
||||
setActive: function (name, state) {
|
||||
log("controlManager.setActive(..)");
|
||||
|
||||
if (this.buttons[name]) {
|
||||
this.buttons[name].active(state);
|
||||
}
|
||||
},
|
||||
|
||||
onAdd: new Dispatcher(),
|
||||
onPostRender: new Dispatcher(),
|
||||
|
||||
add: function (obj) {
|
||||
return obj;
|
||||
},
|
||||
createButton: cmNoop,
|
||||
createColorSplitButton: cmNoop,
|
||||
createControl: cmNoop,
|
||||
createDropMenu: cmNoop,
|
||||
createListBox: cmNoop,
|
||||
createMenuButton: cmNoop,
|
||||
createSeparator: cmNoop,
|
||||
createSplitButton: cmNoop,
|
||||
createToolbar: cmNoop,
|
||||
createToolbarGroup: cmNoop,
|
||||
destroy: noop,
|
||||
get: noop,
|
||||
setControlType: cmNoop
|
||||
};
|
||||
|
||||
patchEditorEvents("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate", "editor");
|
||||
patchEditorEvents("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset");
|
||||
patchEditorEvents("BeforeExecCommand ExecCommand", "command ui value args"); // args.terminate not supported
|
||||
patchEditorEvents("PreProcess PostProcess LoadContent SaveContent Change");
|
||||
patchEditorEvents("BeforeSetContent BeforeGetContent SetContent GetContent", filterSelectionEvents(false));
|
||||
patchEditorEvents("SetProgressState", "state time");
|
||||
patchEditorEvents("VisualAid", "element hasVisual");
|
||||
patchEditorEvents("Undo Redo", convertUndoEventArgs);
|
||||
|
||||
patchEditorEvents("NodeChange", function (type, e) {
|
||||
return [
|
||||
editor.controlManager,
|
||||
e.element,
|
||||
editor.selection.isCollapsed(),
|
||||
e
|
||||
];
|
||||
});
|
||||
|
||||
var originalAddButton = editor.addButton;
|
||||
editor.addButton = function (name, settings) {
|
||||
var originalOnPostRender;
|
||||
|
||||
function patchedPostRender() {
|
||||
editor.controlManager.buttons[name] = this;
|
||||
|
||||
if (originalOnPostRender) {
|
||||
return originalOnPostRender.apply(this, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
for (var key in settings) {
|
||||
if (key.toLowerCase() === "onpostrender") {
|
||||
originalOnPostRender = settings[key];
|
||||
settings.onPostRender = patchedPostRender;
|
||||
}
|
||||
}
|
||||
|
||||
if (!originalOnPostRender) {
|
||||
settings.onPostRender = patchedPostRender;
|
||||
}
|
||||
|
||||
if (settings.title) {
|
||||
settings.title = translate(settings.title);
|
||||
}
|
||||
|
||||
return originalAddButton.call(this, name, settings);
|
||||
};
|
||||
|
||||
editor.on('init', function () {
|
||||
var undoManager = editor.undoManager, selection = editor.selection;
|
||||
|
||||
undoManager.onUndo = new Dispatcher(editor, "Undo", convertUndoEventArgs, null, undoManager);
|
||||
undoManager.onRedo = new Dispatcher(editor, "Redo", convertUndoEventArgs, null, undoManager);
|
||||
undoManager.onBeforeAdd = new Dispatcher(editor, "BeforeAddUndo", null, undoManager);
|
||||
undoManager.onAdd = new Dispatcher(editor, "AddUndo", null, undoManager);
|
||||
|
||||
selection.onBeforeGetContent = new Dispatcher(editor, "BeforeGetContent", filterSelectionEvents(true), selection);
|
||||
selection.onGetContent = new Dispatcher(editor, "GetContent", filterSelectionEvents(true), selection);
|
||||
selection.onBeforeSetContent = new Dispatcher(editor, "BeforeSetContent", filterSelectionEvents(true), selection);
|
||||
selection.onSetContent = new Dispatcher(editor, "SetContent", filterSelectionEvents(true), selection);
|
||||
});
|
||||
|
||||
editor.on('BeforeRenderUI', function () {
|
||||
var windowManager = editor.windowManager;
|
||||
|
||||
windowManager.onOpen = new Dispatcher();
|
||||
windowManager.onClose = new Dispatcher();
|
||||
windowManager.createInstance = function (className, a, b, c, d, e) {
|
||||
log("windowManager.createInstance(..)");
|
||||
|
||||
var constr = tinymce.resolve(className);
|
||||
return new constr(a, b, c, d, e);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
tinymce.on('SetupEditor', function (e) {
|
||||
patchEditor(e.editor);
|
||||
});
|
||||
|
||||
tinymce.PluginManager.add("compat3x", patchEditor);
|
||||
|
||||
tinymce.addI18n = function (prefix, o) {
|
||||
var I18n = tinymce.util.I18n, each = tinymce.each;
|
||||
|
||||
if (typeof prefix == "string" && prefix.indexOf('.') === -1) {
|
||||
I18n.add(prefix, o);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!tinymce.is(prefix, 'string')) {
|
||||
each(prefix, function (o, lc) {
|
||||
each(o, function (o, g) {
|
||||
each(o, function (o, k) {
|
||||
if (g === 'common') {
|
||||
I18n.data[lc + '.' + k] = o;
|
||||
} else {
|
||||
I18n.data[lc + '.' + g + '.' + k] = o;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
each(o, function (o, k) {
|
||||
I18n.data[prefix + '.' + k] = o;
|
||||
});
|
||||
}
|
||||
};
|
||||
})(tinymce);
|
||||
|
||||
Reference in New Issue
Block a user