diff --git a/wp-includes/css/editor-rtl.css b/wp-includes/css/editor-rtl.css index ae2cab7833..7048883c20 100644 --- a/wp-includes/css/editor-rtl.css +++ b/wp-includes/css/editor-rtl.css @@ -4,6 +4,10 @@ /* TinyMCE widgets/containers */ +.mce-tinymce { + box-shadow: none; +} + .mce-container, .mce-container *, .mce-widget, @@ -25,6 +29,7 @@ opacity: 0.7; filter: alpha(opacity=70); transition: none; + background: #000; } .mce-window { @@ -216,6 +221,7 @@ div.mce-tab:focus { .mce-menu-item { border: none; margin-bottom: 2px; + padding: 6px 12px 6px 15px; } .mce-menu-has-icons i.mce-ico { @@ -410,6 +416,14 @@ div.mce-path { box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.3 ); } +.mce-btn.mce-active, +.mce-btn.mce-active button, +.mce-btn.mce-active:hover button, +.mce-btn.mce-active i, +.mce-btn.mce-active:hover i { + color: inherit; +} + .mce-toolbar .mce-btn-group .mce-btn.mce-active:hover, .mce-toolbar .mce-btn-group .mce-btn.mce-active:focus { border-color: #23282d; @@ -562,12 +576,16 @@ div.mce-path { color: #fff; } -.mce-menu .mce-menu-item-preview.mce-active { - border-right: none; -} - -.mce-menu .mce-menu-item-preview.mce-active .mce-text { - color: #fff; +.mce-menu-item:hover .mce-text, +.mce-menu-item:focus .mce-text, +.mce-menu-item:hover .mce-ico, +.mce-menu-item:focus .mce-ico, +.mce-menu-item:hover .mce-menu-shortcut, +.mce-menu-item:focus .mce-menu-shortcut, +.mce-menu-item.mce-active .mce-menu-shortcut, +.mce-menu-item.mce-disabled:hover .mce-text, +.mce-menu-item.mce-disabled:hover .mce-ico { + color: inherit; } .mce-menu .mce-menu-item.mce-disabled { diff --git a/wp-includes/css/editor-rtl.min.css b/wp-includes/css/editor-rtl.min.css index 2c1ca6b7ee..12e2d34079 100644 --- a/wp-includes/css/editor-rtl.min.css +++ b/wp-includes/css/editor-rtl.min.css @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -#wp-link-wrap,.mce-window{box-shadow:0 3px 6px rgba(0,0,0,.3)}.mce-window .mce-wp-help *,.wp-editor-area{box-sizing:border-box}.mce-container,.mce-container *,.mce-widget,.mce-widget *{color:inherit;font-family:inherit}.mce-container .mce-monospace,.mce-widget .mce-monospace{font-family:Consolas,Monaco,monospace;font-size:13px;line-height:150%}#mce-modal-block,#mce-modal-block.mce-fade{opacity:.7;filter:alpha(opacity=70);transition:none}.mce-window{border-radius:0;-webkit-font-smoothing:subpixel-antialiased;transition:none}.mce-window .mce-container-body.mce-abs-layout{overflow:visible}.mce-window .mce-window-head{background:#fcfcfc;border-bottom:1px solid #ddd;padding:0;min-height:36px}.mce-window .mce-window-head .mce-title{color:#444;font-size:18px;font-weight:600;line-height:36px;margin:0;padding:0 16px 0 36px}.mce-window .mce-window-head .mce-close,.mce-window-head .mce-close .mce-i-remove{color:transparent;top:0;left:0;width:36px;height:36px;padding:0;line-height:36px;text-align:center}.mce-window-head .mce-close .mce-i-remove:before{font:400 20px/36px dashicons;text-align:center;color:#666;width:36px;height:36px;display:block}.mce-window-head .mce-close:focus .mce-i-remove:before,.mce-window-head .mce-close:hover .mce-i-remove:before{color:#00a0d2}.mce-window-head .mce-close:focus .mce-i-remove,div.mce-tab:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.mce-window .mce-window-head .mce-dragh{width:calc(100% - 36px)}.mce-window .mce-foot{border-top:1px solid #ddd}#wp-link .query-results,.mce-checkbox i.mce-i-checkbox,.mce-textbox{border:1px solid #ddd;border-radius:0;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);transition:.05s all ease-in-out}#wp-link .query-results:focus,.mce-checkbox:focus i.mce-i-checkbox,.mce-textbox.mce-focus,.mce-textbox:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8)}.mce-window .mce-wp-help{height:360px;width:460px;overflow:auto}.mce-window .mce-wp-help>.mce-container-body{width:auto!important}.mce-window .wp-editor-help{padding:10px 20px 0 10px}.mce-window .wp-editor-help h2,.mce-window .wp-editor-help p{margin:8px 0;white-space:normal;font-size:14px;font-weight:400}.mce-window .wp-editor-help table{width:100%;margin-bottom:20px}.mce-window .wp-editor-help table.wp-help-single{margin:0 8px 20px}.mce-window .wp-editor-help table.fixed{table-layout:fixed}.mce-window .wp-editor-help table.fixed td:nth-child(odd),.mce-window .wp-editor-help table.fixed th:nth-child(odd){width:12%}.mce-window .wp-editor-help table.fixed td:nth-child(even),.mce-window .wp-editor-help table.fixed th:nth-child(even){width:38%}.mce-window .wp-editor-help table.fixed th:nth-child(odd){padding:5px 0 0}.mce-window .wp-editor-help td,.mce-window .wp-editor-help th{font-size:13px;padding:5px;vertical-align:middle;word-wrap:break-word;white-space:normal}.mce-window .wp-editor-help th{font-weight:600;padding-bottom:0}.mce-window .wp-editor-help kbd{font-family:monospace;padding:2px 7px 3px;font-weight:600;margin:0;background:#eaeaea;background:rgba(0,0,0,.08)}.mce-window .wp-help-th-center td:nth-child(odd),.mce-window .wp-help-th-center th:nth-child(odd){text-align:center}.mce-floatpanel.mce-popover,.mce-menu{border-color:rgba(0,0,0,.15);border-radius:0;box-shadow:0 3px 5px rgba(0,0,0,.2)}.mce-floatpanel.mce-popover.mce-bottom,.mce-menu{margin-top:2px}.mce-floatpanel .mce-arrow{display:none}.mce-menu .mce-container-body{min-width:160px}.mce-menu-item{border:none;margin-bottom:2px}.mce-menu-has-icons i.mce-ico{line-height:20px}div.mce-panel{border:0;background:#fff}.mce-panel.mce-menu{border:1px solid #ddd}div.mce-tab{line-height:13px}div.mce-toolbar-grp{border-bottom:1px solid #ddd;background:#f5f5f5;padding:0;position:relative}div.mce-inline-toolbar-grp{border:1px solid #a0a5aa;border-radius:2px;box-shadow:0 1px 3px rgba(0,0,0,.15);box-sizing:border-box;margin-bottom:8px;position:absolute;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;max-width:98%;z-index:100100}div.mce-inline-toolbar-grp>div.mce-stack-layout{padding:1px}div.mce-inline-toolbar-grp.mce-arrow-up{margin-bottom:0;margin-top:8px}div.mce-inline-toolbar-grp:after,div.mce-inline-toolbar-grp:before{position:absolute;right:50%;display:block;width:0;height:0;border-style:solid;border-color:transparent;content:""}.mce-menu.mce-menu-align .mce-menu-item-normal,.quicktags-toolbar,.wp-editor-tools,.wp-editor-wrap,.wp-switch-editor{position:relative}div.mce-inline-toolbar-grp.mce-arrow-up:before{top:-9px;border-bottom-color:#a0a5aa;border-width:0 9px 9px;margin-right:-9px}div.mce-inline-toolbar-grp.mce-arrow-down:before{bottom:-9px;border-top-color:#a0a5aa;border-width:9px 9px 0;margin-right:-9px}div.mce-inline-toolbar-grp.mce-arrow-up:after{top:-8px;border-bottom-color:#f5f5f5;border-width:0 8px 8px;margin-right:-8px}div.mce-inline-toolbar-grp.mce-arrow-down:after{bottom:-8px;border-top-color:#f5f5f5;border-width:8px 8px 0;margin-right:-8px}div.mce-inline-toolbar-grp.mce-arrow-left:after,div.mce-inline-toolbar-grp.mce-arrow-left:before{margin:0}div.mce-inline-toolbar-grp.mce-arrow-left:before{right:20px}div.mce-inline-toolbar-grp.mce-arrow-left:after{right:21px}div.mce-inline-toolbar-grp.mce-arrow-right:after,div.mce-inline-toolbar-grp.mce-arrow-right:before{right:auto;margin:0}div.mce-inline-toolbar-grp.mce-arrow-right:before{left:20px}div.mce-inline-toolbar-grp.mce-arrow-right:after{left:21px}div.mce-inline-toolbar-grp.mce-arrow-full{left:0}div.mce-inline-toolbar-grp.mce-arrow-full>div{width:100%;overflow-x:auto}div.mce-toolbar-grp>div{padding:3px}.has-dfw div.mce-toolbar-grp .mce-toolbar.mce-first{padding-left:32px}.mce-toolbar .mce-btn-group{margin:0}div.mce-statusbar{border-top:1px solid #e5e5e5}div.mce-path{padding:2px 10px;margin:0}.mce-path,.mce-path .mce-divider,.mce-path-item{font-size:12px}.mce-toolbar .mce-btn,.qt-dfw{border-color:transparent;background:0 0;box-shadow:none;text-shadow:none;cursor:pointer}.mce-btn .mce-txt{direction:inherit;text-align:inherit}.mce-toolbar .mce-btn-group .mce-btn,.qt-dfw{border:1px solid transparent;margin:2px;border-radius:2px}.mce-toolbar .mce-btn-group .mce-btn:focus,.mce-toolbar .mce-btn-group .mce-btn:hover,.qt-dfw:focus,.qt-dfw:hover{background:#fafafa;border-color:#555d66;color:#23282d;box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);outline:0}.mce-toolbar .mce-btn-group .mce-btn.mce-active,.mce-toolbar .mce-btn-group .mce-btn:active,.qt-dfw.active{background:#ebebeb;border-color:#555d66;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.3)}.mce-toolbar .mce-btn-group .mce-btn.mce-active:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-active:hover{border-color:#23282d}.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:hover{color:#a0a5aa;background:0 0;border-color:#ddd;text-shadow:0 1px 0 #fff;box-shadow:none}.mce-menu .mce-menu-item-preview.mce-active .mce-text,.mce-toolbar .mce-btn-group .mce-btn.mce-primary .mce-ico{color:#fff}.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus{border-color:#555d66}.mce-toolbar .mce-btn-group .mce-first,.mce-toolbar .mce-btn-group .mce-last{border-color:transparent}.mce-toolbar .mce-btn button,.qt-dfw{padding:2px 3px;line-height:normal}.mce-toolbar .mce-listbox button{font-size:13px;line-height:20px;padding-right:6px;padding-left:20px}.mce-toolbar .mce-btn i{text-shadow:none}.mce-toolbar .mce-btn-group>div{white-space:normal}.mce-toolbar .mce-colorbutton .mce-open{border-left:0}.mce-toolbar .mce-colorbutton .mce-preview{margin:0;padding:0;top:auto;bottom:2px;right:3px;height:3px;width:20px;background:#555d66}.mce-toolbar .mce-btn-group .mce-btn.mce-primary{min-width:0;background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:none}.mce-toolbar .mce-btn-group .mce-btn.mce-primary button{padding:2px 3px 1px}.mce-toolbar .mce-btn-group .mce-btn.mce-primary:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-primary:hover{background:#008ec2;border-color:#006799;color:#fff}.mce-toolbar .mce-btn-group .mce-btn.mce-primary:focus{box-shadow:0 0 1px 1px #33b3db}.mce-toolbar .mce-btn-group .mce-btn.mce-primary:active{background:#0073aa;border-color:#006799;box-shadow:inset 0 2px 0 #006799}.mce-toolbar .mce-btn-group .mce-btn.mce-listbox{border-radius:0;direction:rtl;background:#fff;border:1px solid #ddd;box-shadow:inset 0 1px 1px -1px rgba(0,0,0,.2)}.mce-toolbar .mce-btn-group .mce-btn.mce-listbox:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-listbox:hover{border-color:#b4b9be}.mce-panel .mce-btn i.mce-caret{border-top:6px solid #555d66;margin-right:2px;margin-left:2px}.mce-listbox i.mce-caret{left:4px}.mce-panel .mce-btn:focus i.mce-caret,.mce-panel .mce-btn:hover i.mce-caret{border-top-color:#23282d}.mce-panel .mce-active i.mce-caret{border-top:0;border-bottom:6px solid #23282d;margin-top:7px}.mce-listbox.mce-active i.mce-caret{margin-top:-3px}.mce-toolbar .mce-splitbtn:hover .mce-open{border-left-color:transparent}.mce-toolbar .mce-splitbtn .mce-open.mce-active{background:0 0;outline:0}.mce-menu .mce-menu-item-normal.mce-active,.mce-menu .mce-menu-item-preview.mce-active,.mce-menu .mce-menu-item.mce-selected,.mce-menu .mce-menu-item:focus,.mce-menu .mce-menu-item:hover{background:#0073aa;color:#fff}.mce-menu .mce-menu-item-preview.mce-active{border-right:none}.mce-menu .mce-menu-item.mce-disabled{cursor:default}.mce-menu .mce-menu-item.mce-disabled:hover{background:#ccc}div.mce-menubar{border-color:#e5e5e5;background:#fff;border-width:0 0 1px}.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus,.mce-menubar .mce-menubtn:hover{border-color:transparent;background:0 0}.mce-menubar .mce-menubtn:focus{color:#124964;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.mce-menu-item-sep:hover,div.mce-menu .mce-menu-item-sep{border-bottom:1px solid #ddd;height:0;margin:5px 0}.mce-menubtn span{margin-left:0;padding-right:3px}.mce-menu-has-icons i.mce-ico:before{margin-right:-2px}.mce-menu.mce-menu-align .mce-menu-shortcut{bottom:.6em;font-size:.9em}.mce-primary button,.mce-primary button i{text-align:center;color:#fff;text-shadow:none;padding:0;line-height:26px}.mce-window .mce-btn{color:#555;background:#f7f7f7;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0;cursor:pointer;border:1px solid #ccc;-webkit-appearance:none;border-radius:3px;white-space:nowrap;box-shadow:0 1px 0 #ccc}.mce-window .mce-btn::-moz-focus-inner{border-width:0;border-style:none;padding:0}.mce-window .mce-btn:focus,.mce-window .mce-btn:hover{background:#fafafa;border-color:#999;color:#23282d}.mce-window .mce-btn:focus{border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8)}.mce-window .mce-btn:active{background:#eee;border-color:#999;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);-webkit-transform:translateY(1px);transform:translateY(1px)}.mce-window .mce-btn.mce-disabled{color:#a0a5aa!important;border-color:#ddd!important;background:#f7f7f7!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default;-webkit-transform:none!important;transform:none!important}.mce-window .mce-btn.mce-primary{background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:0 -1px 1px #006799,-1px 0 1px #006799,0 1px 1px #006799,1px 0 1px #006799}.mce-window .mce-btn.mce-primary:focus,.mce-window .mce-btn.mce-primary:hover{background:#008ec2;border-color:#006799;color:#fff}.mce-window .mce-btn.mce-primary:focus{box-shadow:0 1px 0 #0073aa,0 0 2px 1px #33b3db}.mce-window .mce-btn.mce-primary:active{background:#0073aa;border-color:#006799;box-shadow:inset 0 2px 0 #006799;vertical-align:top}.mce-window .mce-btn.mce-primary.mce-disabled{color:#66c6e4!important;background:#008ec2!important;border-color:#007cb2!important;box-shadow:none!important;text-shadow:0 -1px 0 rgba(0,0,0,.1)!important;cursor:default}.mce-toolbar .mce-ico,.qt-dfw{text-shadow:none;text-align:center}.mce-menubtn.mce-fixed-width span{overflow-x:hidden;text-overflow:ellipsis;width:82px}.mce-charmap{margin:3px}.mce-charmap td{padding:0;border-color:#ddd;cursor:pointer}.mce-charmap td:hover{background:#f3f3f3}.mce-charmap td div{width:18px;height:22px;line-height:22px}.mce-toolbar .mce-btn .mce-open,.qt-dfw{line-height:20px}.mce-tooltip{margin-top:2px}.rtl .mce-tooltip.wp-hide-mce-tooltip{display:none!important}.mce-tooltip-inner{border-radius:3px;box-shadow:0 3px 5px rgba(0,0,0,.2);color:#fff;font-size:12px}.mce-ico{font-family:tinymce,Arial}.mce-btn-small .mce-ico{font-family:tinymce-small,Arial}.mce-toolbar .mce-ico{color:#555d66;line-height:20px;width:20px;height:20px;margin:0;padding:0}.qt-dfw{color:#555d66;width:28px;height:26px}.mce-toolbar .mce-btn.mce-active .mce-open,.mce-toolbar .mce-btn:focus .mce-open,.mce-toolbar .mce-btn:hover .mce-open{border-right-color:#23282d}div.mce-notification{right:10%!important;left:10%}.mce-notification button.mce-close{left:6px;top:3px;font-weight:400;color:#555d66}.mce-notification button.mce-close:focus,.mce-notification button.mce-close:hover{color:#000}i.mce-i-aligncenter,i.mce-i-alignjustify,i.mce-i-alignleft,i.mce-i-alignright,i.mce-i-backcolor,i.mce-i-blockquote,i.mce-i-bold,i.mce-i-bullist,i.mce-i-charmap,i.mce-i-dashicon,i.mce-i-dfw,i.mce-i-forecolor,i.mce-i-fullscreen,i.mce-i-help,i.mce-i-hr,i.mce-i-indent,i.mce-i-italic,i.mce-i-link,i.mce-i-ltr,i.mce-i-numlist,i.mce-i-outdent,i.mce-i-pastetext,i.mce-i-pasteword,i.mce-i-redo,i.mce-i-remove,i.mce-i-removeformat,i.mce-i-spellchecker,i.mce-i-strikethrough,i.mce-i-underline,i.mce-i-undo,i.mce-i-unlink,i.mce-i-wp-media-library,i.mce-i-wp_adv,i.mce-i-wp_code,i.mce-i-wp_fullscreen,i.mce-i-wp_help,i.mce-i-wp_more,i.mce-i-wp_page{font:400 20px/1 dashicons;padding:0 0 0 2px;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-right:-2px}.qt-dfw{font:400 20px/1 dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}i.mce-i-bold:before{content:"\f200"}i.mce-i-italic:before{content:"\f201"}i.mce-i-bullist:before{content:"\f203"}i.mce-i-numlist:before{content:"\f204"}i.mce-i-blockquote:before{content:"\f205"}i.mce-i-alignleft:before{content:"\f206"}i.mce-i-aligncenter:before{content:"\f207"}i.mce-i-alignright:before{content:"\f208"}i.mce-i-link:before{content:"\f103"}i.mce-i-unlink:before{content:"\f225"}i.mce-i-wp_more:before{content:"\f209"}i.mce-i-strikethrough:before{content:"\f224"}i.mce-i-spellchecker:before{content:"\f210"}.qt-dfw:before,i.mce-i-dfw:before,i.mce-i-fullscreen:before,i.mce-i-wp_fullscreen:before{content:"\f211"}i.mce-i-wp_adv:before{content:"\f212"}i.mce-i-underline:before{content:"\f213"}i.mce-i-alignjustify:before{content:"\f214"}i.mce-i-backcolor:before,i.mce-i-forecolor:before{content:"\f215"}i.mce-i-pastetext:before{content:"\f217"}i.mce-i-removeformat:before{content:"\f218"}i.mce-i-charmap:before{content:"\f220"}i.mce-i-outdent:before{content:"\f221"}i.mce-i-indent:before{content:"\f222"}i.mce-i-undo:before{content:"\f171"}i.mce-i-redo:before{content:"\f172"}i.mce-i-help:before,i.mce-i-wp_help:before{content:"\f223"}i.mce-i-wp-media-library:before{content:"\f104"}i.mce-i-ltr:before{content:"\f320"}i.mce-i-wp_page:before{content:"\f105"}i.mce-i-hr:before{content:"\f460"}i.mce-i-remove:before{content:"\f158"}i.mce-i-wp_code:before{content:"\f475"}.rtl i.mce-i-outdent:before{content:"\f222"}.rtl i.mce-i-indent:before{content:"\f221"}.wp-editor-tools{z-index:1}.wp-editor-tools:after{clear:both;content:"";display:table}.wp-editor-container{clear:both;border:1px solid #e5e5e5}.wp-editor-area{font-family:Consolas,Monaco,monospace;font-size:13px;padding:10px;margin:1px 0 0;line-height:150%;border:0;outline:0;display:block;resize:vertical}.rtl .wp-editor-area{font-family:Tahoma,Monaco,monospace}.locale-he-il .wp-editor-area{font-family:Arial,Monaco,monospace}.wp-editor-container textarea.wp-editor-area{width:100%;margin:0;box-shadow:none}.wp-editor-tabs{float:left}.wp-switch-editor{float:right;box-sizing:content-box;top:1px;background:#ebebeb;color:#666;cursor:pointer;font-size:13px;line-height:19px;height:20px;margin:5px 5px 0 0;padding:3px 8px 4px;border:1px solid #e5e5e5}.wp-switch-editor:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:0;color:#23282d}.html-active .switch-html:focus,.tmce-active .switch-tmce:focus,.wp-switch-editor:active{box-shadow:none}.wp-switch-editor:active{background-color:#f5f5f5;box-shadow:none}.js .tmce-active .wp-editor-area{color:#fff}.tmce-active .quicktags-toolbar{display:none}.html-active .switch-html,.tmce-active .switch-tmce{background:#f5f5f5;color:#555;border-bottom-color:#f5f5f5}.wp-media-buttons{float:right}.wp-media-buttons .button{margin-left:5px;margin-bottom:4px;padding-right:7px;padding-left:7px}.wp-media-buttons .button:active{position:relative;top:1px;margin-top:-1px;margin-bottom:1px}.wp-media-buttons .insert-media{padding-right:5px}.wp-media-buttons a{text-decoration:none;color:#444;font-size:12px}.wp-media-buttons img{padding:0 4px;vertical-align:middle}.wp-media-buttons span.wp-media-buttons-icon{display:inline-block;width:18px;height:18px;vertical-align:text-top;margin:0 2px}.wp-media-buttons .add_media span.wp-media-buttons-icon{background:0 0}.wp-media-buttons .add_media span.wp-media-buttons-icon:before{font:400 18px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f104"}.quicktags-toolbar{padding:3px;border-bottom:1px solid #ddd;background:#f5f5f5;min-height:30px}.has-dfw .quicktags-toolbar{padding-left:35px}.wp-core-ui .quicktags-toolbar input.button.button-small{margin:2px}.quicktags-toolbar input[value=link]{text-decoration:underline}.quicktags-toolbar input[value=del]{text-decoration:line-through}.quicktags-toolbar input[value="i"]{font-style:italic}.quicktags-toolbar input[value="b"]{font-weight:600}.mce-toolbar .mce-btn-group .mce-btn.mce-wp-dfw,.qt-dfw{position:absolute;top:0;left:0;margin:5px 0 0 5px}.qt-fullscreen{position:static;margin:2px}@media screen and (max-width:782px){.mce-toolbar .mce-btn button,.qt-dfw{padding:6px 7px}.mce-toolbar .mce-btn-group .mce-btn.mce-primary button{padding:6px 7px 5px}.mce-toolbar .mce-btn-group .mce-btn{margin:1px}.qt-dfw{width:36px;height:34px}.mce-toolbar .mce-btn-group .mce-btn.mce-wp-dfw{margin:4px 0 0 4px}.mce-toolbar .mce-colorbutton .mce-preview{right:8px;bottom:6px}.mce-window .mce-btn{padding:2px 0}.has-dfw .quicktags-toolbar,.has-dfw div.mce-toolbar-grp .mce-toolbar.mce-first{padding-left:40px}}@media screen and (min-width:782px){.wp-core-ui .quicktags-toolbar input.button.button-small{font-size:12px;height:26px;line-height:24px}}#wp_editbtns,#wp_gallerybtns{padding:2px;position:absolute;display:none;z-index:100020}#wp_delgallery,#wp_delimgbtn,#wp_editgallery,#wp_editimgbtn{border-color:#999;background-color:#eee;margin:2px;padding:2px;border-width:1px;border-style:solid;border-radius:3px}#wp_delgallery:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_editimgbtn:hover{border-color:#555;background-color:#ccc}#wp-link-wrap{display:none;background-color:#fff;width:500px;overflow:hidden;margin-right:-250px;position:fixed;top:50%;right:50%;z-index:100105;transition:height .2s,margin-top .2s;height:500px;margin-top:-250px}#wp-link-backdrop{display:none;position:fixed;top:0;right:0;left:0;bottom:0;min-height:360px;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:100100}#wp-link{position:relative;height:100%}#wp-link-wrap .wp-link-text-field{display:none}#wp-link-wrap.has-text-field .wp-link-text-field{display:block}#link-modal-title{background:#fcfcfc;border-bottom:1px solid #ddd;height:36px;font-size:18px;font-weight:600;line-height:36px;margin:0;padding:0 16px 0 36px}#wp-link-close{color:#666;padding:0;position:absolute;top:0;left:0;width:36px;height:36px;text-align:center;background:0 0;border:none;cursor:pointer}#wp-link-close:before{font:400 20px/36px dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:36px;height:36px;content:"\f158"}#wp-link-close:focus,#wp-link-close:hover{color:#00a0d2}#wp-link-close:focus{outline:0;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#wp-link-wrap #link-selector{-webkit-overflow-scrolling:touch;padding:0 16px;position:absolute;top:37px;right:0;left:0;bottom:44px}#wp-link ol,#wp-link ul{list-style:none;margin:0;padding:0}#wp-link input[type=text]{box-sizing:border-box}#wp-link #link-options{padding:8px 0 12px}#wp-link p.howto{margin:3px 0}#wp-link p.howto a{text-decoration:none;color:inherit}#wp-link label input[type=text]{margin-top:5px;width:70%}#wp-link #link-options label span,#wp-link #search-panel label span.search-label{display:inline-block;width:80px;text-align:left;padding-left:5px;max-width:24%;vertical-align:middle;word-wrap:break-word}#wp-link .link-search-field{float:right;width:250px;max-width:70%}#wp-link .link-search-wrapper{margin:5px 0 9px;display:block;overflow:hidden}#wp-link .link-search-wrapper span{float:right;margin-top:4px}#wp-link .link-search-wrapper .spinner{margin-top:5px}#wp-link .link-target{padding:3px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#wp-link .link-target label{max-width:70%}#wp-link .query-results{border:1px solid #dfdfdf;margin:0 0 12px;background:#fff;overflow:auto;position:absolute;right:16px;left:16px;bottom:0;top:166px}.has-text-field #wp-link .query-results{top:200px}#wp-link li{clear:both;margin-bottom:0;border-bottom:1px solid #f1f1f1;color:#32373c;padding:4px 10px 4px 6px;cursor:pointer;position:relative}#wp-link .query-notice,#wp-link li.unselectable{border-bottom:1px solid #dfdfdf}#wp-link .query-notice{padding:0;background-color:#f7fcfe;color:#000}#wp-link .query-notice .query-notice-default,#wp-link .query-notice .query-notice-hint{display:block;padding:6px;border-right:4px solid #00a0d2}#wp-link .unselectable.no-matches-found{padding:0;border-bottom:1px solid #dfdfdf;background-color:#fef7f1}#wp-link .no-matches-found .item-title{display:block;padding:6px;border-right:4px solid #d54e21}#wp-link .query-results em{font-style:normal}#wp-link li:hover{background:#eaf2fa;color:#151515}#wp-link li.unselectable:hover{background:#fff;cursor:auto;color:#32373c}#wp-link li.selected{background:#ddd;color:#32373c}#wp-link li.selected .item-title{font-weight:600}#wp-link li:last-child{border:none}#wp-link .item-title{display:inline-block;width:80%;width:calc(100% - 68px);word-wrap:break-word}#wp-link .item-info{text-transform:uppercase;color:#666;font-size:11px;position:absolute;left:5px;top:5px}#wp-link .river-waiting{display:none;padding:10px 0}#wp-link .submitbox{padding:8px 16px;background:#fcfcfc;border-top:1px solid #ddd;position:absolute;bottom:0;right:0;left:0}#wp-link-cancel{line-height:25px;float:right}#wp-link-update{line-height:23px;float:left}#wp-link-submit{float:left}@media screen and (max-width:782px){#wp-link-wrap{margin-top:-140px}#wp-link-wrap .query-results{top:195px}#wp-link-wrap.has-text-field .query-results{top:235px}#link-selector{padding:0 16px 60px}#wp-link-wrap #link-selector{bottom:52px}#wp-link-cancel{line-height:32px}#wp-link .link-target{padding-top:10px}#wp-link .submitbox .button{margin-bottom:0}}@media screen and (max-width:520px){#wp-link-wrap{width:auto;margin-right:0;right:10px;left:10px;max-width:500px}}@media screen and (max-height:520px){#wp-link-wrap{transition:none;height:auto;margin-top:0;top:10px;bottom:10px}#link-selector{overflow:auto}#search-panel .query-results{position:static}}@media screen and (max-height:290px){#wp-link-wrap{height:auto;margin-top:0;top:10px;bottom:10px}#link-selector{overflow:auto;height:calc(100% - 92px);padding-bottom:2px}#search-panel .query-results{position:static}}div.wp-link-preview{float:right;margin:5px;max-width:694px;overflow:hidden;text-overflow:ellipsis}div.wp-link-preview a{color:#0073aa;text-decoration:underline;transition-property:border,background,color;transition-duration:.05s;transition-timing-function:ease-in-out;cursor:pointer}div.wp-link-preview a.wplink-url-error{color:#dc3232}div.wp-link-input{float:right;margin:2px;max-width:694px}div.wp-link-input input{width:300px;padding:3px;box-sizing:border-box}.mce-toolbar div.wp-link-input~.mce-btn,.mce-toolbar div.wp-link-preview~.mce-btn{margin:2px 1px}.mce-inline-toolbar-grp .mce-btn-group .mce-btn:last-child{margin-left:2px}.ui-autocomplete.wplink-autocomplete{z-index:100110;max-height:200px;overflow-y:auto;padding:0;margin:0;list-style:none;position:absolute;border:1px solid #5b9dd9;box-shadow:0 1px 2px rgba(30,140,190,.8);background-color:#fff}.ui-autocomplete.wplink-autocomplete li{margin-bottom:0;padding:4px 10px;clear:both;white-space:normal;text-align:right}.ui-autocomplete.wplink-autocomplete li .wp-editor-float-right{float:left}.ui-autocomplete.wplink-autocomplete li.ui-state-focus{background-color:#ddd;cursor:pointer}@media screen and (max-width:782px){div.wp-link-input,div.wp-link-preview{max-width:70%;max-width:calc(100% - 86px)}div.wp-link-preview{margin:8px 5px 8px 0}div.wp-link-input{width:300px}div.wp-link-input input{width:100%;font-size:16px;padding:5px}}.mce-fullscreen{z-index:100010}.rtl .quicktags-toolbar input,.rtl .wp-switch-editor{font-family:Tahoma,sans-serif}.mce-rtl .mce-flow-layout .mce-flow-layout-item>div{direction:rtl}.mce-rtl .mce-listbox i.mce-caret{left:6px}html:lang(he-il) .rtl .quicktags-toolbar input,html:lang(he-il) .rtl .wp-switch-editor{font-family:Arial,sans-serif}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.wp-media-buttons .add_media span.wp-media-buttons-icon{background:0 0}} \ No newline at end of file +.mce-window .mce-wp-help *,.wp-editor-area{box-sizing:border-box}.mce-tinymce{box-shadow:none}#wp-link-wrap,.mce-window{box-shadow:0 3px 6px rgba(0,0,0,.3)}.mce-container,.mce-container *,.mce-widget,.mce-widget *{color:inherit;font-family:inherit}.mce-container .mce-monospace,.mce-widget .mce-monospace{font-family:Consolas,Monaco,monospace;font-size:13px;line-height:150%}#mce-modal-block,#mce-modal-block.mce-fade{opacity:.7;filter:alpha(opacity=70);transition:none;background:#000}.mce-window{border-radius:0;-webkit-font-smoothing:subpixel-antialiased;transition:none}.mce-window .mce-container-body.mce-abs-layout{overflow:visible}.mce-window .mce-window-head{background:#fcfcfc;border-bottom:1px solid #ddd;padding:0;min-height:36px}.mce-window .mce-window-head .mce-title{color:#444;font-size:18px;font-weight:600;line-height:36px;margin:0;padding:0 16px 0 36px}.mce-window .mce-window-head .mce-close,.mce-window-head .mce-close .mce-i-remove{color:transparent;top:0;left:0;width:36px;height:36px;padding:0;line-height:36px;text-align:center}.mce-window-head .mce-close .mce-i-remove:before{font:400 20px/36px dashicons;text-align:center;color:#666;width:36px;height:36px;display:block}.mce-window-head .mce-close:focus .mce-i-remove:before,.mce-window-head .mce-close:hover .mce-i-remove:before{color:#00a0d2}.mce-window-head .mce-close:focus .mce-i-remove,div.mce-tab:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.mce-window .mce-window-head .mce-dragh{width:calc(100% - 36px)}.mce-window .mce-foot{border-top:1px solid #ddd}#wp-link .query-results,.mce-checkbox i.mce-i-checkbox,.mce-textbox{border:1px solid #ddd;border-radius:0;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);transition:.05s all ease-in-out}#wp-link .query-results:focus,.mce-checkbox:focus i.mce-i-checkbox,.mce-textbox.mce-focus,.mce-textbox:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8)}.mce-window .mce-wp-help{height:360px;width:460px;overflow:auto}.mce-window .mce-wp-help>.mce-container-body{width:auto!important}.mce-window .wp-editor-help{padding:10px 20px 0 10px}.mce-window .wp-editor-help h2,.mce-window .wp-editor-help p{margin:8px 0;white-space:normal;font-size:14px;font-weight:400}.mce-window .wp-editor-help table{width:100%;margin-bottom:20px}.mce-window .wp-editor-help table.wp-help-single{margin:0 8px 20px}.mce-window .wp-editor-help table.fixed{table-layout:fixed}.mce-window .wp-editor-help table.fixed td:nth-child(odd),.mce-window .wp-editor-help table.fixed th:nth-child(odd){width:12%}.mce-window .wp-editor-help table.fixed td:nth-child(even),.mce-window .wp-editor-help table.fixed th:nth-child(even){width:38%}.mce-window .wp-editor-help table.fixed th:nth-child(odd){padding:5px 0 0}.mce-window .wp-editor-help td,.mce-window .wp-editor-help th{font-size:13px;padding:5px;vertical-align:middle;word-wrap:break-word;white-space:normal}.mce-window .wp-editor-help th{font-weight:600;padding-bottom:0}.mce-window .wp-editor-help kbd{font-family:monospace;padding:2px 7px 3px;font-weight:600;margin:0;background:#eaeaea;background:rgba(0,0,0,.08)}.mce-window .wp-help-th-center td:nth-child(odd),.mce-window .wp-help-th-center th:nth-child(odd){text-align:center}.mce-floatpanel.mce-popover,.mce-menu{border-color:rgba(0,0,0,.15);border-radius:0;box-shadow:0 3px 5px rgba(0,0,0,.2)}.mce-floatpanel.mce-popover.mce-bottom,.mce-menu{margin-top:2px}.mce-floatpanel .mce-arrow{display:none}.mce-menu .mce-container-body{min-width:160px}.mce-menu-item{border:none;margin-bottom:2px;padding:6px 12px 6px 15px}.mce-menu-has-icons i.mce-ico{line-height:20px}div.mce-panel{border:0;background:#fff}.mce-panel.mce-menu{border:1px solid #ddd}div.mce-tab{line-height:13px}div.mce-toolbar-grp{border-bottom:1px solid #ddd;background:#f5f5f5;padding:0;position:relative}div.mce-inline-toolbar-grp{border:1px solid #a0a5aa;border-radius:2px;box-shadow:0 1px 3px rgba(0,0,0,.15);box-sizing:border-box;margin-bottom:8px;position:absolute;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;max-width:98%;z-index:100100}div.mce-inline-toolbar-grp>div.mce-stack-layout{padding:1px}div.mce-inline-toolbar-grp.mce-arrow-up{margin-bottom:0;margin-top:8px}div.mce-inline-toolbar-grp:after,div.mce-inline-toolbar-grp:before{position:absolute;right:50%;display:block;width:0;height:0;border-style:solid;border-color:transparent;content:""}.mce-menu.mce-menu-align .mce-menu-item-normal,.quicktags-toolbar,.wp-editor-tools,.wp-editor-wrap,.wp-switch-editor{position:relative}div.mce-inline-toolbar-grp.mce-arrow-up:before{top:-9px;border-bottom-color:#a0a5aa;border-width:0 9px 9px;margin-right:-9px}div.mce-inline-toolbar-grp.mce-arrow-down:before{bottom:-9px;border-top-color:#a0a5aa;border-width:9px 9px 0;margin-right:-9px}div.mce-inline-toolbar-grp.mce-arrow-up:after{top:-8px;border-bottom-color:#f5f5f5;border-width:0 8px 8px;margin-right:-8px}div.mce-inline-toolbar-grp.mce-arrow-down:after{bottom:-8px;border-top-color:#f5f5f5;border-width:8px 8px 0;margin-right:-8px}div.mce-inline-toolbar-grp.mce-arrow-left:after,div.mce-inline-toolbar-grp.mce-arrow-left:before{margin:0}div.mce-inline-toolbar-grp.mce-arrow-left:before{right:20px}div.mce-inline-toolbar-grp.mce-arrow-left:after{right:21px}div.mce-inline-toolbar-grp.mce-arrow-right:after,div.mce-inline-toolbar-grp.mce-arrow-right:before{right:auto;margin:0}div.mce-inline-toolbar-grp.mce-arrow-right:before{left:20px}div.mce-inline-toolbar-grp.mce-arrow-right:after{left:21px}div.mce-inline-toolbar-grp.mce-arrow-full{left:0}div.mce-inline-toolbar-grp.mce-arrow-full>div{width:100%;overflow-x:auto}div.mce-toolbar-grp>div{padding:3px}.has-dfw div.mce-toolbar-grp .mce-toolbar.mce-first{padding-left:32px}.mce-toolbar .mce-btn-group{margin:0}div.mce-statusbar{border-top:1px solid #e5e5e5}div.mce-path{padding:2px 10px;margin:0}.mce-path,.mce-path .mce-divider,.mce-path-item{font-size:12px}.mce-toolbar .mce-btn,.qt-dfw{border-color:transparent;background:0 0;box-shadow:none;text-shadow:none;cursor:pointer}.mce-btn .mce-txt{direction:inherit;text-align:inherit}.mce-toolbar .mce-btn-group .mce-btn,.qt-dfw{border:1px solid transparent;margin:2px;border-radius:2px}.mce-toolbar .mce-btn-group .mce-btn:focus,.mce-toolbar .mce-btn-group .mce-btn:hover,.qt-dfw:focus,.qt-dfw:hover{background:#fafafa;border-color:#555d66;color:#23282d;box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);outline:0}.mce-toolbar .mce-btn-group .mce-btn.mce-active,.mce-toolbar .mce-btn-group .mce-btn:active,.qt-dfw.active{background:#ebebeb;border-color:#555d66;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.3)}.mce-btn.mce-active,.mce-btn.mce-active button,.mce-btn.mce-active i,.mce-btn.mce-active:hover button,.mce-btn.mce-active:hover i{color:inherit}.mce-toolbar .mce-btn-group .mce-btn.mce-active:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-active:hover{border-color:#23282d}.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:hover{color:#a0a5aa;background:0 0;border-color:#ddd;text-shadow:0 1px 0 #fff;box-shadow:none}.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus{border-color:#555d66}.mce-toolbar .mce-btn-group .mce-first,.mce-toolbar .mce-btn-group .mce-last{border-color:transparent}.mce-toolbar .mce-btn button,.qt-dfw{padding:2px 3px;line-height:normal}.mce-toolbar .mce-listbox button{font-size:13px;line-height:20px;padding-right:6px;padding-left:20px}.mce-toolbar .mce-btn i{text-shadow:none}.mce-toolbar .mce-btn-group>div{white-space:normal}.mce-toolbar .mce-colorbutton .mce-open{border-left:0}.mce-toolbar .mce-colorbutton .mce-preview{margin:0;padding:0;top:auto;bottom:2px;right:3px;height:3px;width:20px;background:#555d66}.mce-toolbar .mce-btn-group .mce-btn.mce-primary{min-width:0;background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:none}.mce-toolbar .mce-btn-group .mce-btn.mce-primary button{padding:2px 3px 1px}.mce-toolbar .mce-btn-group .mce-btn.mce-primary .mce-ico{color:#fff}.mce-toolbar .mce-btn-group .mce-btn.mce-primary:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-primary:hover{background:#008ec2;border-color:#006799;color:#fff}.mce-toolbar .mce-btn-group .mce-btn.mce-primary:focus{box-shadow:0 0 1px 1px #33b3db}.mce-toolbar .mce-btn-group .mce-btn.mce-primary:active{background:#0073aa;border-color:#006799;box-shadow:inset 0 2px 0 #006799}.mce-toolbar .mce-btn-group .mce-btn.mce-listbox{border-radius:0;direction:rtl;background:#fff;border:1px solid #ddd;box-shadow:inset 0 1px 1px -1px rgba(0,0,0,.2)}.mce-toolbar .mce-btn-group .mce-btn.mce-listbox:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-listbox:hover{border-color:#b4b9be}.mce-panel .mce-btn i.mce-caret{border-top:6px solid #555d66;margin-right:2px;margin-left:2px}.mce-listbox i.mce-caret{left:4px}.mce-panel .mce-btn:focus i.mce-caret,.mce-panel .mce-btn:hover i.mce-caret{border-top-color:#23282d}.mce-panel .mce-active i.mce-caret{border-top:0;border-bottom:6px solid #23282d;margin-top:7px}.mce-listbox.mce-active i.mce-caret{margin-top:-3px}.mce-toolbar .mce-splitbtn:hover .mce-open{border-left-color:transparent}.mce-toolbar .mce-splitbtn .mce-open.mce-active{background:0 0;outline:0}.mce-menu .mce-menu-item-normal.mce-active,.mce-menu .mce-menu-item-preview.mce-active,.mce-menu .mce-menu-item.mce-selected,.mce-menu .mce-menu-item:focus,.mce-menu .mce-menu-item:hover{background:#0073aa;color:#fff}.mce-menu-item.mce-active .mce-menu-shortcut,.mce-menu-item.mce-disabled:hover .mce-ico,.mce-menu-item.mce-disabled:hover .mce-text,.mce-menu-item:focus .mce-ico,.mce-menu-item:focus .mce-menu-shortcut,.mce-menu-item:focus .mce-text,.mce-menu-item:hover .mce-ico,.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item:hover .mce-text{color:inherit}.mce-menu .mce-menu-item.mce-disabled{cursor:default}.mce-menu .mce-menu-item.mce-disabled:hover{background:#ccc}div.mce-menubar{border-color:#e5e5e5;background:#fff;border-width:0 0 1px}.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus,.mce-menubar .mce-menubtn:hover{border-color:transparent;background:0 0}.mce-menubar .mce-menubtn:focus{color:#124964;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.mce-menu-item-sep:hover,div.mce-menu .mce-menu-item-sep{border-bottom:1px solid #ddd;height:0;margin:5px 0}.mce-menubtn span{margin-left:0;padding-right:3px}.mce-menu-has-icons i.mce-ico:before{margin-right:-2px}.mce-menu.mce-menu-align .mce-menu-shortcut{bottom:.6em;font-size:.9em}.mce-primary button,.mce-primary button i{text-align:center;color:#fff;text-shadow:none;padding:0;line-height:26px}.mce-window .mce-btn{color:#555;background:#f7f7f7;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0;cursor:pointer;border:1px solid #ccc;-webkit-appearance:none;border-radius:3px;white-space:nowrap;box-shadow:0 1px 0 #ccc}.mce-window .mce-btn::-moz-focus-inner{border-width:0;border-style:none;padding:0}.mce-window .mce-btn:focus,.mce-window .mce-btn:hover{background:#fafafa;border-color:#999;color:#23282d}.mce-window .mce-btn:focus{border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8)}.mce-window .mce-btn:active{background:#eee;border-color:#999;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);-webkit-transform:translateY(1px);transform:translateY(1px)}.mce-window .mce-btn.mce-disabled{color:#a0a5aa!important;border-color:#ddd!important;background:#f7f7f7!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default;-webkit-transform:none!important;transform:none!important}.mce-window .mce-btn.mce-primary{background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:0 -1px 1px #006799,-1px 0 1px #006799,0 1px 1px #006799,1px 0 1px #006799}.mce-window .mce-btn.mce-primary:focus,.mce-window .mce-btn.mce-primary:hover{background:#008ec2;border-color:#006799;color:#fff}.mce-window .mce-btn.mce-primary:focus{box-shadow:0 1px 0 #0073aa,0 0 2px 1px #33b3db}.mce-window .mce-btn.mce-primary:active{background:#0073aa;border-color:#006799;box-shadow:inset 0 2px 0 #006799;vertical-align:top}.mce-window .mce-btn.mce-primary.mce-disabled{color:#66c6e4!important;background:#008ec2!important;border-color:#007cb2!important;box-shadow:none!important;text-shadow:0 -1px 0 rgba(0,0,0,.1)!important;cursor:default}.mce-toolbar .mce-ico,.qt-dfw{text-shadow:none;text-align:center}.mce-menubtn.mce-fixed-width span{overflow-x:hidden;text-overflow:ellipsis;width:82px}.mce-charmap{margin:3px}.mce-charmap td{padding:0;border-color:#ddd;cursor:pointer}.mce-charmap td:hover{background:#f3f3f3}.mce-charmap td div{width:18px;height:22px;line-height:22px}.mce-toolbar .mce-btn .mce-open,.qt-dfw{line-height:20px}.mce-tooltip{margin-top:2px}.rtl .mce-tooltip.wp-hide-mce-tooltip{display:none!important}.mce-tooltip-inner{border-radius:3px;box-shadow:0 3px 5px rgba(0,0,0,.2);color:#fff;font-size:12px}.mce-ico{font-family:tinymce,Arial}.mce-btn-small .mce-ico{font-family:tinymce-small,Arial}.mce-toolbar .mce-ico{color:#555d66;line-height:20px;width:20px;height:20px;margin:0;padding:0}.qt-dfw{color:#555d66;width:28px;height:26px}.mce-toolbar .mce-btn.mce-active .mce-open,.mce-toolbar .mce-btn:focus .mce-open,.mce-toolbar .mce-btn:hover .mce-open{border-right-color:#23282d}div.mce-notification{right:10%!important;left:10%}.mce-notification button.mce-close{left:6px;top:3px;font-weight:400;color:#555d66}.mce-notification button.mce-close:focus,.mce-notification button.mce-close:hover{color:#000}i.mce-i-aligncenter,i.mce-i-alignjustify,i.mce-i-alignleft,i.mce-i-alignright,i.mce-i-backcolor,i.mce-i-blockquote,i.mce-i-bold,i.mce-i-bullist,i.mce-i-charmap,i.mce-i-dashicon,i.mce-i-dfw,i.mce-i-forecolor,i.mce-i-fullscreen,i.mce-i-help,i.mce-i-hr,i.mce-i-indent,i.mce-i-italic,i.mce-i-link,i.mce-i-ltr,i.mce-i-numlist,i.mce-i-outdent,i.mce-i-pastetext,i.mce-i-pasteword,i.mce-i-redo,i.mce-i-remove,i.mce-i-removeformat,i.mce-i-spellchecker,i.mce-i-strikethrough,i.mce-i-underline,i.mce-i-undo,i.mce-i-unlink,i.mce-i-wp-media-library,i.mce-i-wp_adv,i.mce-i-wp_code,i.mce-i-wp_fullscreen,i.mce-i-wp_help,i.mce-i-wp_more,i.mce-i-wp_page{font:400 20px/1 dashicons;padding:0 0 0 2px;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-right:-2px}.qt-dfw{font:400 20px/1 dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}i.mce-i-bold:before{content:"\f200"}i.mce-i-italic:before{content:"\f201"}i.mce-i-bullist:before{content:"\f203"}i.mce-i-numlist:before{content:"\f204"}i.mce-i-blockquote:before{content:"\f205"}i.mce-i-alignleft:before{content:"\f206"}i.mce-i-aligncenter:before{content:"\f207"}i.mce-i-alignright:before{content:"\f208"}i.mce-i-link:before{content:"\f103"}i.mce-i-unlink:before{content:"\f225"}i.mce-i-wp_more:before{content:"\f209"}i.mce-i-strikethrough:before{content:"\f224"}i.mce-i-spellchecker:before{content:"\f210"}.qt-dfw:before,i.mce-i-dfw:before,i.mce-i-fullscreen:before,i.mce-i-wp_fullscreen:before{content:"\f211"}i.mce-i-wp_adv:before{content:"\f212"}i.mce-i-underline:before{content:"\f213"}i.mce-i-alignjustify:before{content:"\f214"}i.mce-i-backcolor:before,i.mce-i-forecolor:before{content:"\f215"}i.mce-i-pastetext:before{content:"\f217"}i.mce-i-removeformat:before{content:"\f218"}i.mce-i-charmap:before{content:"\f220"}i.mce-i-outdent:before{content:"\f221"}i.mce-i-indent:before{content:"\f222"}i.mce-i-undo:before{content:"\f171"}i.mce-i-redo:before{content:"\f172"}i.mce-i-help:before,i.mce-i-wp_help:before{content:"\f223"}i.mce-i-wp-media-library:before{content:"\f104"}i.mce-i-ltr:before{content:"\f320"}i.mce-i-wp_page:before{content:"\f105"}i.mce-i-hr:before{content:"\f460"}i.mce-i-remove:before{content:"\f158"}i.mce-i-wp_code:before{content:"\f475"}.rtl i.mce-i-outdent:before{content:"\f222"}.rtl i.mce-i-indent:before{content:"\f221"}.wp-editor-tools{z-index:1}.wp-editor-tools:after{clear:both;content:"";display:table}.wp-editor-container{clear:both;border:1px solid #e5e5e5}.wp-editor-area{font-family:Consolas,Monaco,monospace;font-size:13px;padding:10px;margin:1px 0 0;line-height:150%;border:0;outline:0;display:block;resize:vertical}.rtl .wp-editor-area{font-family:Tahoma,Monaco,monospace}.locale-he-il .wp-editor-area{font-family:Arial,Monaco,monospace}.wp-editor-container textarea.wp-editor-area{width:100%;margin:0;box-shadow:none}.wp-editor-tabs{float:left}.wp-switch-editor{float:right;box-sizing:content-box;top:1px;background:#ebebeb;color:#666;cursor:pointer;font-size:13px;line-height:19px;height:20px;margin:5px 5px 0 0;padding:3px 8px 4px;border:1px solid #e5e5e5}.wp-switch-editor:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:0;color:#23282d}.html-active .switch-html:focus,.tmce-active .switch-tmce:focus,.wp-switch-editor:active{box-shadow:none}.wp-switch-editor:active{background-color:#f5f5f5;box-shadow:none}.js .tmce-active .wp-editor-area{color:#fff}.tmce-active .quicktags-toolbar{display:none}.html-active .switch-html,.tmce-active .switch-tmce{background:#f5f5f5;color:#555;border-bottom-color:#f5f5f5}.wp-media-buttons{float:right}.wp-media-buttons .button{margin-left:5px;margin-bottom:4px;padding-right:7px;padding-left:7px}.wp-media-buttons .button:active{position:relative;top:1px;margin-top:-1px;margin-bottom:1px}.wp-media-buttons .insert-media{padding-right:5px}.wp-media-buttons a{text-decoration:none;color:#444;font-size:12px}.wp-media-buttons img{padding:0 4px;vertical-align:middle}.wp-media-buttons span.wp-media-buttons-icon{display:inline-block;width:18px;height:18px;vertical-align:text-top;margin:0 2px}.wp-media-buttons .add_media span.wp-media-buttons-icon{background:0 0}.wp-media-buttons .add_media span.wp-media-buttons-icon:before{font:400 18px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f104"}.quicktags-toolbar{padding:3px;border-bottom:1px solid #ddd;background:#f5f5f5;min-height:30px}.has-dfw .quicktags-toolbar{padding-left:35px}.wp-core-ui .quicktags-toolbar input.button.button-small{margin:2px}.quicktags-toolbar input[value=link]{text-decoration:underline}.quicktags-toolbar input[value=del]{text-decoration:line-through}.quicktags-toolbar input[value="i"]{font-style:italic}.quicktags-toolbar input[value="b"]{font-weight:600}.mce-toolbar .mce-btn-group .mce-btn.mce-wp-dfw,.qt-dfw{position:absolute;top:0;left:0;margin:5px 0 0 5px}.qt-fullscreen{position:static;margin:2px}@media screen and (max-width:782px){.mce-toolbar .mce-btn button,.qt-dfw{padding:6px 7px}.mce-toolbar .mce-btn-group .mce-btn.mce-primary button{padding:6px 7px 5px}.mce-toolbar .mce-btn-group .mce-btn{margin:1px}.qt-dfw{width:36px;height:34px}.mce-toolbar .mce-btn-group .mce-btn.mce-wp-dfw{margin:4px 0 0 4px}.mce-toolbar .mce-colorbutton .mce-preview{right:8px;bottom:6px}.mce-window .mce-btn{padding:2px 0}.has-dfw .quicktags-toolbar,.has-dfw div.mce-toolbar-grp .mce-toolbar.mce-first{padding-left:40px}}@media screen and (min-width:782px){.wp-core-ui .quicktags-toolbar input.button.button-small{font-size:12px;height:26px;line-height:24px}}#wp_editbtns,#wp_gallerybtns{padding:2px;position:absolute;display:none;z-index:100020}#wp_delgallery,#wp_delimgbtn,#wp_editgallery,#wp_editimgbtn{border-color:#999;background-color:#eee;margin:2px;padding:2px;border-width:1px;border-style:solid;border-radius:3px}#wp_delgallery:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_editimgbtn:hover{border-color:#555;background-color:#ccc}#wp-link-wrap{display:none;background-color:#fff;width:500px;overflow:hidden;margin-right:-250px;position:fixed;top:50%;right:50%;z-index:100105;transition:height .2s,margin-top .2s;height:500px;margin-top:-250px}#wp-link-backdrop{display:none;position:fixed;top:0;right:0;left:0;bottom:0;min-height:360px;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:100100}#wp-link{position:relative;height:100%}#wp-link-wrap .wp-link-text-field{display:none}#wp-link-wrap.has-text-field .wp-link-text-field{display:block}#link-modal-title{background:#fcfcfc;border-bottom:1px solid #ddd;height:36px;font-size:18px;font-weight:600;line-height:36px;margin:0;padding:0 16px 0 36px}#wp-link-close{color:#666;padding:0;position:absolute;top:0;left:0;width:36px;height:36px;text-align:center;background:0 0;border:none;cursor:pointer}#wp-link-close:before{font:400 20px/36px dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:36px;height:36px;content:"\f158"}#wp-link-close:focus,#wp-link-close:hover{color:#00a0d2}#wp-link-close:focus{outline:0;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#wp-link-wrap #link-selector{-webkit-overflow-scrolling:touch;padding:0 16px;position:absolute;top:37px;right:0;left:0;bottom:44px}#wp-link ol,#wp-link ul{list-style:none;margin:0;padding:0}#wp-link input[type=text]{box-sizing:border-box}#wp-link #link-options{padding:8px 0 12px}#wp-link p.howto{margin:3px 0}#wp-link p.howto a{text-decoration:none;color:inherit}#wp-link label input[type=text]{margin-top:5px;width:70%}#wp-link #link-options label span,#wp-link #search-panel label span.search-label{display:inline-block;width:80px;text-align:left;padding-left:5px;max-width:24%;vertical-align:middle;word-wrap:break-word}#wp-link .link-search-field{float:right;width:250px;max-width:70%}#wp-link .link-search-wrapper{margin:5px 0 9px;display:block;overflow:hidden}#wp-link .link-search-wrapper span{float:right;margin-top:4px}#wp-link .link-search-wrapper .spinner{margin-top:5px}#wp-link .link-target{padding:3px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#wp-link .link-target label{max-width:70%}#wp-link .query-results{border:1px solid #dfdfdf;margin:0 0 12px;background:#fff;overflow:auto;position:absolute;right:16px;left:16px;bottom:0;top:166px}.has-text-field #wp-link .query-results{top:200px}#wp-link li{clear:both;margin-bottom:0;border-bottom:1px solid #f1f1f1;color:#32373c;padding:4px 10px 4px 6px;cursor:pointer;position:relative}#wp-link .query-notice,#wp-link li.unselectable{border-bottom:1px solid #dfdfdf}#wp-link .query-notice{padding:0;background-color:#f7fcfe;color:#000}#wp-link .query-notice .query-notice-default,#wp-link .query-notice .query-notice-hint{display:block;padding:6px;border-right:4px solid #00a0d2}#wp-link .unselectable.no-matches-found{padding:0;border-bottom:1px solid #dfdfdf;background-color:#fef7f1}#wp-link .no-matches-found .item-title{display:block;padding:6px;border-right:4px solid #d54e21}#wp-link .query-results em{font-style:normal}#wp-link li:hover{background:#eaf2fa;color:#151515}#wp-link li.unselectable:hover{background:#fff;cursor:auto;color:#32373c}#wp-link li.selected{background:#ddd;color:#32373c}#wp-link li.selected .item-title{font-weight:600}#wp-link li:last-child{border:none}#wp-link .item-title{display:inline-block;width:80%;width:calc(100% - 68px);word-wrap:break-word}#wp-link .item-info{text-transform:uppercase;color:#666;font-size:11px;position:absolute;left:5px;top:5px}#wp-link .river-waiting{display:none;padding:10px 0}#wp-link .submitbox{padding:8px 16px;background:#fcfcfc;border-top:1px solid #ddd;position:absolute;bottom:0;right:0;left:0}#wp-link-cancel{line-height:25px;float:right}#wp-link-update{line-height:23px;float:left}#wp-link-submit{float:left}@media screen and (max-width:782px){#wp-link-wrap{margin-top:-140px}#wp-link-wrap .query-results{top:195px}#wp-link-wrap.has-text-field .query-results{top:235px}#link-selector{padding:0 16px 60px}#wp-link-wrap #link-selector{bottom:52px}#wp-link-cancel{line-height:32px}#wp-link .link-target{padding-top:10px}#wp-link .submitbox .button{margin-bottom:0}}@media screen and (max-width:520px){#wp-link-wrap{width:auto;margin-right:0;right:10px;left:10px;max-width:500px}}@media screen and (max-height:520px){#wp-link-wrap{transition:none;height:auto;margin-top:0;top:10px;bottom:10px}#link-selector{overflow:auto}#search-panel .query-results{position:static}}@media screen and (max-height:290px){#wp-link-wrap{height:auto;margin-top:0;top:10px;bottom:10px}#link-selector{overflow:auto;height:calc(100% - 92px);padding-bottom:2px}#search-panel .query-results{position:static}}div.wp-link-preview{float:right;margin:5px;max-width:694px;overflow:hidden;text-overflow:ellipsis}div.wp-link-preview a{color:#0073aa;text-decoration:underline;transition-property:border,background,color;transition-duration:.05s;transition-timing-function:ease-in-out;cursor:pointer}div.wp-link-preview a.wplink-url-error{color:#dc3232}div.wp-link-input{float:right;margin:2px;max-width:694px}div.wp-link-input input{width:300px;padding:3px;box-sizing:border-box}.mce-toolbar div.wp-link-input~.mce-btn,.mce-toolbar div.wp-link-preview~.mce-btn{margin:2px 1px}.mce-inline-toolbar-grp .mce-btn-group .mce-btn:last-child{margin-left:2px}.ui-autocomplete.wplink-autocomplete{z-index:100110;max-height:200px;overflow-y:auto;padding:0;margin:0;list-style:none;position:absolute;border:1px solid #5b9dd9;box-shadow:0 1px 2px rgba(30,140,190,.8);background-color:#fff}.ui-autocomplete.wplink-autocomplete li{margin-bottom:0;padding:4px 10px;clear:both;white-space:normal;text-align:right}.ui-autocomplete.wplink-autocomplete li .wp-editor-float-right{float:left}.ui-autocomplete.wplink-autocomplete li.ui-state-focus{background-color:#ddd;cursor:pointer}@media screen and (max-width:782px){div.wp-link-input,div.wp-link-preview{max-width:70%;max-width:calc(100% - 86px)}div.wp-link-preview{margin:8px 5px 8px 0}div.wp-link-input{width:300px}div.wp-link-input input{width:100%;font-size:16px;padding:5px}}.mce-fullscreen{z-index:100010}.rtl .quicktags-toolbar input,.rtl .wp-switch-editor{font-family:Tahoma,sans-serif}.mce-rtl .mce-flow-layout .mce-flow-layout-item>div{direction:rtl}.mce-rtl .mce-listbox i.mce-caret{left:6px}html:lang(he-il) .rtl .quicktags-toolbar input,html:lang(he-il) .rtl .wp-switch-editor{font-family:Arial,sans-serif}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.wp-media-buttons .add_media span.wp-media-buttons-icon{background:0 0}} \ No newline at end of file diff --git a/wp-includes/css/editor.css b/wp-includes/css/editor.css index 51d9a9633e..5ff85570e5 100644 --- a/wp-includes/css/editor.css +++ b/wp-includes/css/editor.css @@ -4,6 +4,10 @@ /* TinyMCE widgets/containers */ +.mce-tinymce { + box-shadow: none; +} + .mce-container, .mce-container *, .mce-widget, @@ -25,6 +29,7 @@ opacity: 0.7; filter: alpha(opacity=70); transition: none; + background: #000; } .mce-window { @@ -216,6 +221,7 @@ div.mce-tab:focus { .mce-menu-item { border: none; margin-bottom: 2px; + padding: 6px 15px 6px 12px; } .mce-menu-has-icons i.mce-ico { @@ -410,6 +416,14 @@ div.mce-path { box-shadow: inset 0 2px 5px -3px rgba( 0, 0, 0, 0.3 ); } +.mce-btn.mce-active, +.mce-btn.mce-active button, +.mce-btn.mce-active:hover button, +.mce-btn.mce-active i, +.mce-btn.mce-active:hover i { + color: inherit; +} + .mce-toolbar .mce-btn-group .mce-btn.mce-active:hover, .mce-toolbar .mce-btn-group .mce-btn.mce-active:focus { border-color: #23282d; @@ -562,12 +576,16 @@ div.mce-path { color: #fff; } -.mce-menu .mce-menu-item-preview.mce-active { - border-left: none; -} - -.mce-menu .mce-menu-item-preview.mce-active .mce-text { - color: #fff; +.mce-menu-item:hover .mce-text, +.mce-menu-item:focus .mce-text, +.mce-menu-item:hover .mce-ico, +.mce-menu-item:focus .mce-ico, +.mce-menu-item:hover .mce-menu-shortcut, +.mce-menu-item:focus .mce-menu-shortcut, +.mce-menu-item.mce-active .mce-menu-shortcut, +.mce-menu-item.mce-disabled:hover .mce-text, +.mce-menu-item.mce-disabled:hover .mce-ico { + color: inherit; } .mce-menu .mce-menu-item.mce-disabled { diff --git a/wp-includes/css/editor.min.css b/wp-includes/css/editor.min.css index 370e5eff7d..ffcfce21ea 100644 --- a/wp-includes/css/editor.min.css +++ b/wp-includes/css/editor.min.css @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -#wp-link-wrap,.mce-window{box-shadow:0 3px 6px rgba(0,0,0,.3)}.mce-window .mce-wp-help *,.wp-editor-area{box-sizing:border-box}.mce-container,.mce-container *,.mce-widget,.mce-widget *{color:inherit;font-family:inherit}.mce-container .mce-monospace,.mce-widget .mce-monospace{font-family:Consolas,Monaco,monospace;font-size:13px;line-height:150%}#mce-modal-block,#mce-modal-block.mce-fade{opacity:.7;filter:alpha(opacity=70);transition:none}.mce-window{border-radius:0;-webkit-font-smoothing:subpixel-antialiased;transition:none}.mce-window .mce-container-body.mce-abs-layout{overflow:visible}.mce-window .mce-window-head{background:#fcfcfc;border-bottom:1px solid #ddd;padding:0;min-height:36px}.mce-window .mce-window-head .mce-title{color:#444;font-size:18px;font-weight:600;line-height:36px;margin:0;padding:0 36px 0 16px}.mce-window .mce-window-head .mce-close,.mce-window-head .mce-close .mce-i-remove{color:transparent;top:0;right:0;width:36px;height:36px;padding:0;line-height:36px;text-align:center}.mce-window-head .mce-close .mce-i-remove:before{font:400 20px/36px dashicons;text-align:center;color:#666;width:36px;height:36px;display:block}.mce-window-head .mce-close:focus .mce-i-remove:before,.mce-window-head .mce-close:hover .mce-i-remove:before{color:#00a0d2}.mce-window-head .mce-close:focus .mce-i-remove,div.mce-tab:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.mce-window .mce-window-head .mce-dragh{width:calc(100% - 36px)}.mce-window .mce-foot{border-top:1px solid #ddd}#wp-link .query-results,.mce-checkbox i.mce-i-checkbox,.mce-textbox{border:1px solid #ddd;border-radius:0;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);transition:.05s all ease-in-out}#wp-link .query-results:focus,.mce-checkbox:focus i.mce-i-checkbox,.mce-textbox.mce-focus,.mce-textbox:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8)}.mce-window .mce-wp-help{height:360px;width:460px;overflow:auto}.mce-window .mce-wp-help>.mce-container-body{width:auto!important}.mce-window .wp-editor-help{padding:10px 10px 0 20px}.mce-window .wp-editor-help h2,.mce-window .wp-editor-help p{margin:8px 0;white-space:normal;font-size:14px;font-weight:400}.mce-window .wp-editor-help table{width:100%;margin-bottom:20px}.mce-window .wp-editor-help table.wp-help-single{margin:0 8px 20px}.mce-window .wp-editor-help table.fixed{table-layout:fixed}.mce-window .wp-editor-help table.fixed td:nth-child(odd),.mce-window .wp-editor-help table.fixed th:nth-child(odd){width:12%}.mce-window .wp-editor-help table.fixed td:nth-child(even),.mce-window .wp-editor-help table.fixed th:nth-child(even){width:38%}.mce-window .wp-editor-help table.fixed th:nth-child(odd){padding:5px 0 0}.mce-window .wp-editor-help td,.mce-window .wp-editor-help th{font-size:13px;padding:5px;vertical-align:middle;word-wrap:break-word;white-space:normal}.mce-window .wp-editor-help th{font-weight:600;padding-bottom:0}.mce-window .wp-editor-help kbd{font-family:monospace;padding:2px 7px 3px;font-weight:600;margin:0;background:#eaeaea;background:rgba(0,0,0,.08)}.mce-window .wp-help-th-center td:nth-child(odd),.mce-window .wp-help-th-center th:nth-child(odd){text-align:center}.mce-floatpanel.mce-popover,.mce-menu{border-color:rgba(0,0,0,.15);border-radius:0;box-shadow:0 3px 5px rgba(0,0,0,.2)}.mce-floatpanel.mce-popover.mce-bottom,.mce-menu{margin-top:2px}.mce-floatpanel .mce-arrow{display:none}.mce-menu .mce-container-body{min-width:160px}.mce-menu-item{border:none;margin-bottom:2px}.mce-menu-has-icons i.mce-ico{line-height:20px}div.mce-panel{border:0;background:#fff}.mce-panel.mce-menu{border:1px solid #ddd}div.mce-tab{line-height:13px}div.mce-toolbar-grp{border-bottom:1px solid #ddd;background:#f5f5f5;padding:0;position:relative}div.mce-inline-toolbar-grp{border:1px solid #a0a5aa;border-radius:2px;box-shadow:0 1px 3px rgba(0,0,0,.15);box-sizing:border-box;margin-bottom:8px;position:absolute;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;max-width:98%;z-index:100100}div.mce-inline-toolbar-grp>div.mce-stack-layout{padding:1px}div.mce-inline-toolbar-grp.mce-arrow-up{margin-bottom:0;margin-top:8px}div.mce-inline-toolbar-grp:after,div.mce-inline-toolbar-grp:before{position:absolute;left:50%;display:block;width:0;height:0;border-style:solid;border-color:transparent;content:""}.mce-menu.mce-menu-align .mce-menu-item-normal,.quicktags-toolbar,.wp-editor-tools,.wp-editor-wrap,.wp-switch-editor{position:relative}div.mce-inline-toolbar-grp.mce-arrow-up:before{top:-9px;border-bottom-color:#a0a5aa;border-width:0 9px 9px;margin-left:-9px}div.mce-inline-toolbar-grp.mce-arrow-down:before{bottom:-9px;border-top-color:#a0a5aa;border-width:9px 9px 0;margin-left:-9px}div.mce-inline-toolbar-grp.mce-arrow-up:after{top:-8px;border-bottom-color:#f5f5f5;border-width:0 8px 8px;margin-left:-8px}div.mce-inline-toolbar-grp.mce-arrow-down:after{bottom:-8px;border-top-color:#f5f5f5;border-width:8px 8px 0;margin-left:-8px}div.mce-inline-toolbar-grp.mce-arrow-left:after,div.mce-inline-toolbar-grp.mce-arrow-left:before{margin:0}div.mce-inline-toolbar-grp.mce-arrow-left:before{left:20px}div.mce-inline-toolbar-grp.mce-arrow-left:after{left:21px}div.mce-inline-toolbar-grp.mce-arrow-right:after,div.mce-inline-toolbar-grp.mce-arrow-right:before{left:auto;margin:0}div.mce-inline-toolbar-grp.mce-arrow-right:before{right:20px}div.mce-inline-toolbar-grp.mce-arrow-right:after{right:21px}div.mce-inline-toolbar-grp.mce-arrow-full{right:0}div.mce-inline-toolbar-grp.mce-arrow-full>div{width:100%;overflow-x:auto}div.mce-toolbar-grp>div{padding:3px}.has-dfw div.mce-toolbar-grp .mce-toolbar.mce-first{padding-right:32px}.mce-toolbar .mce-btn-group{margin:0}div.mce-statusbar{border-top:1px solid #e5e5e5}div.mce-path{padding:2px 10px;margin:0}.mce-path,.mce-path .mce-divider,.mce-path-item{font-size:12px}.mce-toolbar .mce-btn,.qt-dfw{border-color:transparent;background:0 0;box-shadow:none;text-shadow:none;cursor:pointer}.mce-btn .mce-txt{direction:inherit;text-align:inherit}.mce-toolbar .mce-btn-group .mce-btn,.qt-dfw{border:1px solid transparent;margin:2px;border-radius:2px}.mce-toolbar .mce-btn-group .mce-btn:focus,.mce-toolbar .mce-btn-group .mce-btn:hover,.qt-dfw:focus,.qt-dfw:hover{background:#fafafa;border-color:#555d66;color:#23282d;box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);outline:0}.mce-toolbar .mce-btn-group .mce-btn.mce-active,.mce-toolbar .mce-btn-group .mce-btn:active,.qt-dfw.active{background:#ebebeb;border-color:#555d66;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.3)}.mce-toolbar .mce-btn-group .mce-btn.mce-active:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-active:hover{border-color:#23282d}.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:hover{color:#a0a5aa;background:0 0;border-color:#ddd;text-shadow:0 1px 0 #fff;box-shadow:none}.mce-menu .mce-menu-item-preview.mce-active .mce-text,.mce-toolbar .mce-btn-group .mce-btn.mce-primary .mce-ico{color:#fff}.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus{border-color:#555d66}.mce-toolbar .mce-btn-group .mce-first,.mce-toolbar .mce-btn-group .mce-last{border-color:transparent}.mce-toolbar .mce-btn button,.qt-dfw{padding:2px 3px;line-height:normal}.mce-toolbar .mce-listbox button{font-size:13px;line-height:20px;padding-left:6px;padding-right:20px}.mce-toolbar .mce-btn i{text-shadow:none}.mce-toolbar .mce-btn-group>div{white-space:normal}.mce-toolbar .mce-colorbutton .mce-open{border-right:0}.mce-toolbar .mce-colorbutton .mce-preview{margin:0;padding:0;top:auto;bottom:2px;left:3px;height:3px;width:20px;background:#555d66}.mce-toolbar .mce-btn-group .mce-btn.mce-primary{min-width:0;background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:none}.mce-toolbar .mce-btn-group .mce-btn.mce-primary button{padding:2px 3px 1px}.mce-toolbar .mce-btn-group .mce-btn.mce-primary:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-primary:hover{background:#008ec2;border-color:#006799;color:#fff}.mce-toolbar .mce-btn-group .mce-btn.mce-primary:focus{box-shadow:0 0 1px 1px #33b3db}.mce-toolbar .mce-btn-group .mce-btn.mce-primary:active{background:#0073aa;border-color:#006799;box-shadow:inset 0 2px 0 #006799}.mce-toolbar .mce-btn-group .mce-btn.mce-listbox{border-radius:0;direction:ltr;background:#fff;border:1px solid #ddd;box-shadow:inset 0 1px 1px -1px rgba(0,0,0,.2)}.mce-toolbar .mce-btn-group .mce-btn.mce-listbox:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-listbox:hover{border-color:#b4b9be}.mce-panel .mce-btn i.mce-caret{border-top:6px solid #555d66;margin-left:2px;margin-right:2px}.mce-listbox i.mce-caret{right:4px}.mce-panel .mce-btn:focus i.mce-caret,.mce-panel .mce-btn:hover i.mce-caret{border-top-color:#23282d}.mce-panel .mce-active i.mce-caret{border-top:0;border-bottom:6px solid #23282d;margin-top:7px}.mce-listbox.mce-active i.mce-caret{margin-top:-3px}.mce-toolbar .mce-splitbtn:hover .mce-open{border-right-color:transparent}.mce-toolbar .mce-splitbtn .mce-open.mce-active{background:0 0;outline:0}.mce-menu .mce-menu-item-normal.mce-active,.mce-menu .mce-menu-item-preview.mce-active,.mce-menu .mce-menu-item.mce-selected,.mce-menu .mce-menu-item:focus,.mce-menu .mce-menu-item:hover{background:#0073aa;color:#fff}.mce-menu .mce-menu-item-preview.mce-active{border-left:none}.mce-menu .mce-menu-item.mce-disabled{cursor:default}.mce-menu .mce-menu-item.mce-disabled:hover{background:#ccc}div.mce-menubar{border-color:#e5e5e5;background:#fff;border-width:0 0 1px}.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus,.mce-menubar .mce-menubtn:hover{border-color:transparent;background:0 0}.mce-menubar .mce-menubtn:focus{color:#124964;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.mce-menu-item-sep:hover,div.mce-menu .mce-menu-item-sep{border-bottom:1px solid #ddd;height:0;margin:5px 0}.mce-menubtn span{margin-right:0;padding-left:3px}.mce-menu-has-icons i.mce-ico:before{margin-left:-2px}.mce-menu.mce-menu-align .mce-menu-shortcut{bottom:.6em;font-size:.9em}.mce-primary button,.mce-primary button i{text-align:center;color:#fff;text-shadow:none;padding:0;line-height:26px}.mce-window .mce-btn{color:#555;background:#f7f7f7;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0;cursor:pointer;border:1px solid #ccc;-webkit-appearance:none;border-radius:3px;white-space:nowrap;box-shadow:0 1px 0 #ccc}.mce-window .mce-btn::-moz-focus-inner{border-width:0;border-style:none;padding:0}.mce-window .mce-btn:focus,.mce-window .mce-btn:hover{background:#fafafa;border-color:#999;color:#23282d}.mce-window .mce-btn:focus{border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8)}.mce-window .mce-btn:active{background:#eee;border-color:#999;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);-webkit-transform:translateY(1px);transform:translateY(1px)}.mce-window .mce-btn.mce-disabled{color:#a0a5aa!important;border-color:#ddd!important;background:#f7f7f7!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default;-webkit-transform:none!important;transform:none!important}.mce-window .mce-btn.mce-primary{background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799}.mce-window .mce-btn.mce-primary:focus,.mce-window .mce-btn.mce-primary:hover{background:#008ec2;border-color:#006799;color:#fff}.mce-window .mce-btn.mce-primary:focus{box-shadow:0 1px 0 #0073aa,0 0 2px 1px #33b3db}.mce-window .mce-btn.mce-primary:active{background:#0073aa;border-color:#006799;box-shadow:inset 0 2px 0 #006799;vertical-align:top}.mce-window .mce-btn.mce-primary.mce-disabled{color:#66c6e4!important;background:#008ec2!important;border-color:#007cb2!important;box-shadow:none!important;text-shadow:0 -1px 0 rgba(0,0,0,.1)!important;cursor:default}.mce-toolbar .mce-ico,.qt-dfw{text-shadow:none;text-align:center}.mce-menubtn.mce-fixed-width span{overflow-x:hidden;text-overflow:ellipsis;width:82px}.mce-charmap{margin:3px}.mce-charmap td{padding:0;border-color:#ddd;cursor:pointer}.mce-charmap td:hover{background:#f3f3f3}.mce-charmap td div{width:18px;height:22px;line-height:22px}.mce-toolbar .mce-btn .mce-open,.qt-dfw{line-height:20px}.mce-tooltip{margin-top:2px}.rtl .mce-tooltip.wp-hide-mce-tooltip{display:none!important}.mce-tooltip-inner{border-radius:3px;box-shadow:0 3px 5px rgba(0,0,0,.2);color:#fff;font-size:12px}.mce-ico{font-family:tinymce,Arial}.mce-btn-small .mce-ico{font-family:tinymce-small,Arial}.mce-toolbar .mce-ico{color:#555d66;line-height:20px;width:20px;height:20px;margin:0;padding:0}.qt-dfw{color:#555d66;width:28px;height:26px}.mce-toolbar .mce-btn.mce-active .mce-open,.mce-toolbar .mce-btn:focus .mce-open,.mce-toolbar .mce-btn:hover .mce-open{border-left-color:#23282d}div.mce-notification{left:10%!important;right:10%}.mce-notification button.mce-close{right:6px;top:3px;font-weight:400;color:#555d66}.mce-notification button.mce-close:focus,.mce-notification button.mce-close:hover{color:#000}i.mce-i-aligncenter,i.mce-i-alignjustify,i.mce-i-alignleft,i.mce-i-alignright,i.mce-i-backcolor,i.mce-i-blockquote,i.mce-i-bold,i.mce-i-bullist,i.mce-i-charmap,i.mce-i-dashicon,i.mce-i-dfw,i.mce-i-forecolor,i.mce-i-fullscreen,i.mce-i-help,i.mce-i-hr,i.mce-i-indent,i.mce-i-italic,i.mce-i-link,i.mce-i-ltr,i.mce-i-numlist,i.mce-i-outdent,i.mce-i-pastetext,i.mce-i-pasteword,i.mce-i-redo,i.mce-i-remove,i.mce-i-removeformat,i.mce-i-spellchecker,i.mce-i-strikethrough,i.mce-i-underline,i.mce-i-undo,i.mce-i-unlink,i.mce-i-wp-media-library,i.mce-i-wp_adv,i.mce-i-wp_code,i.mce-i-wp_fullscreen,i.mce-i-wp_help,i.mce-i-wp_more,i.mce-i-wp_page{font:400 20px/1 dashicons;padding:0 2px 0 0;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-left:-2px}.qt-dfw{font:400 20px/1 dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}i.mce-i-bold:before{content:"\f200"}i.mce-i-italic:before{content:"\f201"}i.mce-i-bullist:before{content:"\f203"}i.mce-i-numlist:before{content:"\f204"}i.mce-i-blockquote:before{content:"\f205"}i.mce-i-alignleft:before{content:"\f206"}i.mce-i-aligncenter:before{content:"\f207"}i.mce-i-alignright:before{content:"\f208"}i.mce-i-link:before{content:"\f103"}i.mce-i-unlink:before{content:"\f225"}i.mce-i-wp_more:before{content:"\f209"}i.mce-i-strikethrough:before{content:"\f224"}i.mce-i-spellchecker:before{content:"\f210"}.qt-dfw:before,i.mce-i-dfw:before,i.mce-i-fullscreen:before,i.mce-i-wp_fullscreen:before{content:"\f211"}i.mce-i-wp_adv:before{content:"\f212"}i.mce-i-underline:before{content:"\f213"}i.mce-i-alignjustify:before{content:"\f214"}i.mce-i-backcolor:before,i.mce-i-forecolor:before{content:"\f215"}i.mce-i-pastetext:before{content:"\f217"}i.mce-i-removeformat:before{content:"\f218"}i.mce-i-charmap:before{content:"\f220"}i.mce-i-outdent:before{content:"\f221"}i.mce-i-indent:before{content:"\f222"}i.mce-i-undo:before{content:"\f171"}i.mce-i-redo:before{content:"\f172"}i.mce-i-help:before,i.mce-i-wp_help:before{content:"\f223"}i.mce-i-wp-media-library:before{content:"\f104"}i.mce-i-ltr:before{content:"\f320"}i.mce-i-wp_page:before{content:"\f105"}i.mce-i-hr:before{content:"\f460"}i.mce-i-remove:before{content:"\f158"}i.mce-i-wp_code:before{content:"\f475"}.rtl i.mce-i-outdent:before{content:"\f222"}.rtl i.mce-i-indent:before{content:"\f221"}.wp-editor-tools{z-index:1}.wp-editor-tools:after{clear:both;content:"";display:table}.wp-editor-container{clear:both;border:1px solid #e5e5e5}.wp-editor-area{font-family:Consolas,Monaco,monospace;font-size:13px;padding:10px;margin:1px 0 0;line-height:150%;border:0;outline:0;display:block;resize:vertical}.rtl .wp-editor-area{font-family:Tahoma,Monaco,monospace}.locale-he-il .wp-editor-area{font-family:Arial,Monaco,monospace}.wp-editor-container textarea.wp-editor-area{width:100%;margin:0;box-shadow:none}.wp-editor-tabs{float:right}.wp-switch-editor{float:left;box-sizing:content-box;top:1px;background:#ebebeb;color:#666;cursor:pointer;font-size:13px;line-height:19px;height:20px;margin:5px 0 0 5px;padding:3px 8px 4px;border:1px solid #e5e5e5}.wp-switch-editor:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:0;color:#23282d}.html-active .switch-html:focus,.tmce-active .switch-tmce:focus,.wp-switch-editor:active{box-shadow:none}.wp-switch-editor:active{background-color:#f5f5f5;box-shadow:none}.js .tmce-active .wp-editor-area{color:#fff}.tmce-active .quicktags-toolbar{display:none}.html-active .switch-html,.tmce-active .switch-tmce{background:#f5f5f5;color:#555;border-bottom-color:#f5f5f5}.wp-media-buttons{float:left}.wp-media-buttons .button{margin-right:5px;margin-bottom:4px;padding-left:7px;padding-right:7px}.wp-media-buttons .button:active{position:relative;top:1px;margin-top:-1px;margin-bottom:1px}.wp-media-buttons .insert-media{padding-left:5px}.wp-media-buttons a{text-decoration:none;color:#444;font-size:12px}.wp-media-buttons img{padding:0 4px;vertical-align:middle}.wp-media-buttons span.wp-media-buttons-icon{display:inline-block;width:18px;height:18px;vertical-align:text-top;margin:0 2px}.wp-media-buttons .add_media span.wp-media-buttons-icon{background:0 0}.wp-media-buttons .add_media span.wp-media-buttons-icon:before{font:400 18px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f104"}.quicktags-toolbar{padding:3px;border-bottom:1px solid #ddd;background:#f5f5f5;min-height:30px}.has-dfw .quicktags-toolbar{padding-right:35px}.wp-core-ui .quicktags-toolbar input.button.button-small{margin:2px}.quicktags-toolbar input[value=link]{text-decoration:underline}.quicktags-toolbar input[value=del]{text-decoration:line-through}.quicktags-toolbar input[value="i"]{font-style:italic}.quicktags-toolbar input[value="b"]{font-weight:600}.mce-toolbar .mce-btn-group .mce-btn.mce-wp-dfw,.qt-dfw{position:absolute;top:0;right:0;margin:5px 5px 0 0}.qt-fullscreen{position:static;margin:2px}@media screen and (max-width:782px){.mce-toolbar .mce-btn button,.qt-dfw{padding:6px 7px}.mce-toolbar .mce-btn-group .mce-btn.mce-primary button{padding:6px 7px 5px}.mce-toolbar .mce-btn-group .mce-btn{margin:1px}.qt-dfw{width:36px;height:34px}.mce-toolbar .mce-btn-group .mce-btn.mce-wp-dfw{margin:4px 4px 0 0}.mce-toolbar .mce-colorbutton .mce-preview{left:8px;bottom:6px}.mce-window .mce-btn{padding:2px 0}.has-dfw .quicktags-toolbar,.has-dfw div.mce-toolbar-grp .mce-toolbar.mce-first{padding-right:40px}}@media screen and (min-width:782px){.wp-core-ui .quicktags-toolbar input.button.button-small{font-size:12px;height:26px;line-height:24px}}#wp_editbtns,#wp_gallerybtns{padding:2px;position:absolute;display:none;z-index:100020}#wp_delgallery,#wp_delimgbtn,#wp_editgallery,#wp_editimgbtn{border-color:#999;background-color:#eee;margin:2px;padding:2px;border-width:1px;border-style:solid;border-radius:3px}#wp_delgallery:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_editimgbtn:hover{border-color:#555;background-color:#ccc}#wp-link-wrap{display:none;background-color:#fff;width:500px;overflow:hidden;margin-left:-250px;position:fixed;top:50%;left:50%;z-index:100105;transition:height .2s,margin-top .2s;height:500px;margin-top:-250px}#wp-link-backdrop{display:none;position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:100100}#wp-link{position:relative;height:100%}#wp-link-wrap .wp-link-text-field{display:none}#wp-link-wrap.has-text-field .wp-link-text-field{display:block}#link-modal-title{background:#fcfcfc;border-bottom:1px solid #ddd;height:36px;font-size:18px;font-weight:600;line-height:36px;margin:0;padding:0 36px 0 16px}#wp-link-close{color:#666;padding:0;position:absolute;top:0;right:0;width:36px;height:36px;text-align:center;background:0 0;border:none;cursor:pointer}#wp-link-close:before{font:400 20px/36px dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:36px;height:36px;content:"\f158"}#wp-link-close:focus,#wp-link-close:hover{color:#00a0d2}#wp-link-close:focus{outline:0;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#wp-link-wrap #link-selector{-webkit-overflow-scrolling:touch;padding:0 16px;position:absolute;top:37px;left:0;right:0;bottom:44px}#wp-link ol,#wp-link ul{list-style:none;margin:0;padding:0}#wp-link input[type=text]{box-sizing:border-box}#wp-link #link-options{padding:8px 0 12px}#wp-link p.howto{margin:3px 0}#wp-link p.howto a{text-decoration:none;color:inherit}#wp-link label input[type=text]{margin-top:5px;width:70%}#wp-link #link-options label span,#wp-link #search-panel label span.search-label{display:inline-block;width:80px;text-align:right;padding-right:5px;max-width:24%;vertical-align:middle;word-wrap:break-word}#wp-link .link-search-field{float:left;width:250px;max-width:70%}#wp-link .link-search-wrapper{margin:5px 0 9px;display:block;overflow:hidden}#wp-link .link-search-wrapper span{float:left;margin-top:4px}#wp-link .link-search-wrapper .spinner{margin-top:5px}#wp-link .link-target{padding:3px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#wp-link .link-target label{max-width:70%}#wp-link .query-results{border:1px solid #dfdfdf;margin:0 0 12px;background:#fff;overflow:auto;position:absolute;left:16px;right:16px;bottom:0;top:166px}.has-text-field #wp-link .query-results{top:200px}#wp-link li{clear:both;margin-bottom:0;border-bottom:1px solid #f1f1f1;color:#32373c;padding:4px 6px 4px 10px;cursor:pointer;position:relative}#wp-link .query-notice,#wp-link li.unselectable{border-bottom:1px solid #dfdfdf}#wp-link .query-notice{padding:0;background-color:#f7fcfe;color:#000}#wp-link .query-notice .query-notice-default,#wp-link .query-notice .query-notice-hint{display:block;padding:6px;border-left:4px solid #00a0d2}#wp-link .unselectable.no-matches-found{padding:0;border-bottom:1px solid #dfdfdf;background-color:#fef7f1}#wp-link .no-matches-found .item-title{display:block;padding:6px;border-left:4px solid #d54e21}#wp-link .query-results em{font-style:normal}#wp-link li:hover{background:#eaf2fa;color:#151515}#wp-link li.unselectable:hover{background:#fff;cursor:auto;color:#32373c}#wp-link li.selected{background:#ddd;color:#32373c}#wp-link li.selected .item-title{font-weight:600}#wp-link li:last-child{border:none}#wp-link .item-title{display:inline-block;width:80%;width:calc(100% - 68px);word-wrap:break-word}#wp-link .item-info{text-transform:uppercase;color:#666;font-size:11px;position:absolute;right:5px;top:5px}#wp-link .river-waiting{display:none;padding:10px 0}#wp-link .submitbox{padding:8px 16px;background:#fcfcfc;border-top:1px solid #ddd;position:absolute;bottom:0;left:0;right:0}#wp-link-cancel{line-height:25px;float:left}#wp-link-update{line-height:23px;float:right}#wp-link-submit{float:right}@media screen and (max-width:782px){#wp-link-wrap{margin-top:-140px}#wp-link-wrap .query-results{top:195px}#wp-link-wrap.has-text-field .query-results{top:235px}#link-selector{padding:0 16px 60px}#wp-link-wrap #link-selector{bottom:52px}#wp-link-cancel{line-height:32px}#wp-link .link-target{padding-top:10px}#wp-link .submitbox .button{margin-bottom:0}}@media screen and (max-width:520px){#wp-link-wrap{width:auto;margin-left:0;left:10px;right:10px;max-width:500px}}@media screen and (max-height:520px){#wp-link-wrap{transition:none;height:auto;margin-top:0;top:10px;bottom:10px}#link-selector{overflow:auto}#search-panel .query-results{position:static}}@media screen and (max-height:290px){#wp-link-wrap{height:auto;margin-top:0;top:10px;bottom:10px}#link-selector{overflow:auto;height:calc(100% - 92px);padding-bottom:2px}#search-panel .query-results{position:static}}div.wp-link-preview{float:left;margin:5px;max-width:694px;overflow:hidden;text-overflow:ellipsis}div.wp-link-preview a{color:#0073aa;text-decoration:underline;transition-property:border,background,color;transition-duration:.05s;transition-timing-function:ease-in-out;cursor:pointer}div.wp-link-preview a.wplink-url-error{color:#dc3232}div.wp-link-input{float:left;margin:2px;max-width:694px}div.wp-link-input input{width:300px;padding:3px;box-sizing:border-box}.mce-toolbar div.wp-link-input~.mce-btn,.mce-toolbar div.wp-link-preview~.mce-btn{margin:2px 1px}.mce-inline-toolbar-grp .mce-btn-group .mce-btn:last-child{margin-right:2px}.ui-autocomplete.wplink-autocomplete{z-index:100110;max-height:200px;overflow-y:auto;padding:0;margin:0;list-style:none;position:absolute;border:1px solid #5b9dd9;box-shadow:0 1px 2px rgba(30,140,190,.8);background-color:#fff}.ui-autocomplete.wplink-autocomplete li{margin-bottom:0;padding:4px 10px;clear:both;white-space:normal;text-align:left}.ui-autocomplete.wplink-autocomplete li .wp-editor-float-right{float:right}.ui-autocomplete.wplink-autocomplete li.ui-state-focus{background-color:#ddd;cursor:pointer}@media screen and (max-width:782px){div.wp-link-input,div.wp-link-preview{max-width:70%;max-width:calc(100% - 86px)}div.wp-link-preview{margin:8px 0 8px 5px}div.wp-link-input{width:300px}div.wp-link-input input{width:100%;font-size:16px;padding:5px}}.mce-fullscreen{z-index:100010}.rtl .quicktags-toolbar input,.rtl .wp-switch-editor{font-family:Tahoma,sans-serif}.mce-rtl .mce-flow-layout .mce-flow-layout-item>div{direction:rtl}.mce-rtl .mce-listbox i.mce-caret{left:6px}html:lang(he-il) .rtl .quicktags-toolbar input,html:lang(he-il) .rtl .wp-switch-editor{font-family:Arial,sans-serif}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.wp-media-buttons .add_media span.wp-media-buttons-icon{background:0 0}} \ No newline at end of file +.mce-window .mce-wp-help *,.wp-editor-area{box-sizing:border-box}.mce-tinymce{box-shadow:none}#wp-link-wrap,.mce-window{box-shadow:0 3px 6px rgba(0,0,0,.3)}.mce-container,.mce-container *,.mce-widget,.mce-widget *{color:inherit;font-family:inherit}.mce-container .mce-monospace,.mce-widget .mce-monospace{font-family:Consolas,Monaco,monospace;font-size:13px;line-height:150%}#mce-modal-block,#mce-modal-block.mce-fade{opacity:.7;filter:alpha(opacity=70);transition:none;background:#000}.mce-window{border-radius:0;-webkit-font-smoothing:subpixel-antialiased;transition:none}.mce-window .mce-container-body.mce-abs-layout{overflow:visible}.mce-window .mce-window-head{background:#fcfcfc;border-bottom:1px solid #ddd;padding:0;min-height:36px}.mce-window .mce-window-head .mce-title{color:#444;font-size:18px;font-weight:600;line-height:36px;margin:0;padding:0 36px 0 16px}.mce-window .mce-window-head .mce-close,.mce-window-head .mce-close .mce-i-remove{color:transparent;top:0;right:0;width:36px;height:36px;padding:0;line-height:36px;text-align:center}.mce-window-head .mce-close .mce-i-remove:before{font:400 20px/36px dashicons;text-align:center;color:#666;width:36px;height:36px;display:block}.mce-window-head .mce-close:focus .mce-i-remove:before,.mce-window-head .mce-close:hover .mce-i-remove:before{color:#00a0d2}.mce-window-head .mce-close:focus .mce-i-remove,div.mce-tab:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.mce-window .mce-window-head .mce-dragh{width:calc(100% - 36px)}.mce-window .mce-foot{border-top:1px solid #ddd}#wp-link .query-results,.mce-checkbox i.mce-i-checkbox,.mce-textbox{border:1px solid #ddd;border-radius:0;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);transition:.05s all ease-in-out}#wp-link .query-results:focus,.mce-checkbox:focus i.mce-i-checkbox,.mce-textbox.mce-focus,.mce-textbox:focus{border-color:#5b9dd9;box-shadow:0 0 2px rgba(30,140,190,.8)}.mce-window .mce-wp-help{height:360px;width:460px;overflow:auto}.mce-window .mce-wp-help>.mce-container-body{width:auto!important}.mce-window .wp-editor-help{padding:10px 10px 0 20px}.mce-window .wp-editor-help h2,.mce-window .wp-editor-help p{margin:8px 0;white-space:normal;font-size:14px;font-weight:400}.mce-window .wp-editor-help table{width:100%;margin-bottom:20px}.mce-window .wp-editor-help table.wp-help-single{margin:0 8px 20px}.mce-window .wp-editor-help table.fixed{table-layout:fixed}.mce-window .wp-editor-help table.fixed td:nth-child(odd),.mce-window .wp-editor-help table.fixed th:nth-child(odd){width:12%}.mce-window .wp-editor-help table.fixed td:nth-child(even),.mce-window .wp-editor-help table.fixed th:nth-child(even){width:38%}.mce-window .wp-editor-help table.fixed th:nth-child(odd){padding:5px 0 0}.mce-window .wp-editor-help td,.mce-window .wp-editor-help th{font-size:13px;padding:5px;vertical-align:middle;word-wrap:break-word;white-space:normal}.mce-window .wp-editor-help th{font-weight:600;padding-bottom:0}.mce-window .wp-editor-help kbd{font-family:monospace;padding:2px 7px 3px;font-weight:600;margin:0;background:#eaeaea;background:rgba(0,0,0,.08)}.mce-window .wp-help-th-center td:nth-child(odd),.mce-window .wp-help-th-center th:nth-child(odd){text-align:center}.mce-floatpanel.mce-popover,.mce-menu{border-color:rgba(0,0,0,.15);border-radius:0;box-shadow:0 3px 5px rgba(0,0,0,.2)}.mce-floatpanel.mce-popover.mce-bottom,.mce-menu{margin-top:2px}.mce-floatpanel .mce-arrow{display:none}.mce-menu .mce-container-body{min-width:160px}.mce-menu-item{border:none;margin-bottom:2px;padding:6px 15px 6px 12px}.mce-menu-has-icons i.mce-ico{line-height:20px}div.mce-panel{border:0;background:#fff}.mce-panel.mce-menu{border:1px solid #ddd}div.mce-tab{line-height:13px}div.mce-toolbar-grp{border-bottom:1px solid #ddd;background:#f5f5f5;padding:0;position:relative}div.mce-inline-toolbar-grp{border:1px solid #a0a5aa;border-radius:2px;box-shadow:0 1px 3px rgba(0,0,0,.15);box-sizing:border-box;margin-bottom:8px;position:absolute;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;max-width:98%;z-index:100100}div.mce-inline-toolbar-grp>div.mce-stack-layout{padding:1px}div.mce-inline-toolbar-grp.mce-arrow-up{margin-bottom:0;margin-top:8px}div.mce-inline-toolbar-grp:after,div.mce-inline-toolbar-grp:before{position:absolute;left:50%;display:block;width:0;height:0;border-style:solid;border-color:transparent;content:""}.mce-menu.mce-menu-align .mce-menu-item-normal,.quicktags-toolbar,.wp-editor-tools,.wp-editor-wrap,.wp-switch-editor{position:relative}div.mce-inline-toolbar-grp.mce-arrow-up:before{top:-9px;border-bottom-color:#a0a5aa;border-width:0 9px 9px;margin-left:-9px}div.mce-inline-toolbar-grp.mce-arrow-down:before{bottom:-9px;border-top-color:#a0a5aa;border-width:9px 9px 0;margin-left:-9px}div.mce-inline-toolbar-grp.mce-arrow-up:after{top:-8px;border-bottom-color:#f5f5f5;border-width:0 8px 8px;margin-left:-8px}div.mce-inline-toolbar-grp.mce-arrow-down:after{bottom:-8px;border-top-color:#f5f5f5;border-width:8px 8px 0;margin-left:-8px}div.mce-inline-toolbar-grp.mce-arrow-left:after,div.mce-inline-toolbar-grp.mce-arrow-left:before{margin:0}div.mce-inline-toolbar-grp.mce-arrow-left:before{left:20px}div.mce-inline-toolbar-grp.mce-arrow-left:after{left:21px}div.mce-inline-toolbar-grp.mce-arrow-right:after,div.mce-inline-toolbar-grp.mce-arrow-right:before{left:auto;margin:0}div.mce-inline-toolbar-grp.mce-arrow-right:before{right:20px}div.mce-inline-toolbar-grp.mce-arrow-right:after{right:21px}div.mce-inline-toolbar-grp.mce-arrow-full{right:0}div.mce-inline-toolbar-grp.mce-arrow-full>div{width:100%;overflow-x:auto}div.mce-toolbar-grp>div{padding:3px}.has-dfw div.mce-toolbar-grp .mce-toolbar.mce-first{padding-right:32px}.mce-toolbar .mce-btn-group{margin:0}div.mce-statusbar{border-top:1px solid #e5e5e5}div.mce-path{padding:2px 10px;margin:0}.mce-path,.mce-path .mce-divider,.mce-path-item{font-size:12px}.mce-toolbar .mce-btn,.qt-dfw{border-color:transparent;background:0 0;box-shadow:none;text-shadow:none;cursor:pointer}.mce-btn .mce-txt{direction:inherit;text-align:inherit}.mce-toolbar .mce-btn-group .mce-btn,.qt-dfw{border:1px solid transparent;margin:2px;border-radius:2px}.mce-toolbar .mce-btn-group .mce-btn:focus,.mce-toolbar .mce-btn-group .mce-btn:hover,.qt-dfw:focus,.qt-dfw:hover{background:#fafafa;border-color:#555d66;color:#23282d;box-shadow:inset 0 1px 0 #fff,0 1px 0 rgba(0,0,0,.08);outline:0}.mce-toolbar .mce-btn-group .mce-btn.mce-active,.mce-toolbar .mce-btn-group .mce-btn:active,.qt-dfw.active{background:#ebebeb;border-color:#555d66;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.3)}.mce-btn.mce-active,.mce-btn.mce-active button,.mce-btn.mce-active i,.mce-btn.mce-active:hover button,.mce-btn.mce-active:hover i{color:inherit}.mce-toolbar .mce-btn-group .mce-btn.mce-active:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-active:hover{border-color:#23282d}.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:hover{color:#a0a5aa;background:0 0;border-color:#ddd;text-shadow:0 1px 0 #fff;box-shadow:none}.mce-toolbar .mce-btn-group .mce-btn.mce-disabled:focus{border-color:#555d66}.mce-toolbar .mce-btn-group .mce-first,.mce-toolbar .mce-btn-group .mce-last{border-color:transparent}.mce-toolbar .mce-btn button,.qt-dfw{padding:2px 3px;line-height:normal}.mce-toolbar .mce-listbox button{font-size:13px;line-height:20px;padding-left:6px;padding-right:20px}.mce-toolbar .mce-btn i{text-shadow:none}.mce-toolbar .mce-btn-group>div{white-space:normal}.mce-toolbar .mce-colorbutton .mce-open{border-right:0}.mce-toolbar .mce-colorbutton .mce-preview{margin:0;padding:0;top:auto;bottom:2px;left:3px;height:3px;width:20px;background:#555d66}.mce-toolbar .mce-btn-group .mce-btn.mce-primary{min-width:0;background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:none}.mce-toolbar .mce-btn-group .mce-btn.mce-primary button{padding:2px 3px 1px}.mce-toolbar .mce-btn-group .mce-btn.mce-primary .mce-ico{color:#fff}.mce-toolbar .mce-btn-group .mce-btn.mce-primary:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-primary:hover{background:#008ec2;border-color:#006799;color:#fff}.mce-toolbar .mce-btn-group .mce-btn.mce-primary:focus{box-shadow:0 0 1px 1px #33b3db}.mce-toolbar .mce-btn-group .mce-btn.mce-primary:active{background:#0073aa;border-color:#006799;box-shadow:inset 0 2px 0 #006799}.mce-toolbar .mce-btn-group .mce-btn.mce-listbox{border-radius:0;direction:ltr;background:#fff;border:1px solid #ddd;box-shadow:inset 0 1px 1px -1px rgba(0,0,0,.2)}.mce-toolbar .mce-btn-group .mce-btn.mce-listbox:focus,.mce-toolbar .mce-btn-group .mce-btn.mce-listbox:hover{border-color:#b4b9be}.mce-panel .mce-btn i.mce-caret{border-top:6px solid #555d66;margin-left:2px;margin-right:2px}.mce-listbox i.mce-caret{right:4px}.mce-panel .mce-btn:focus i.mce-caret,.mce-panel .mce-btn:hover i.mce-caret{border-top-color:#23282d}.mce-panel .mce-active i.mce-caret{border-top:0;border-bottom:6px solid #23282d;margin-top:7px}.mce-listbox.mce-active i.mce-caret{margin-top:-3px}.mce-toolbar .mce-splitbtn:hover .mce-open{border-right-color:transparent}.mce-toolbar .mce-splitbtn .mce-open.mce-active{background:0 0;outline:0}.mce-menu .mce-menu-item-normal.mce-active,.mce-menu .mce-menu-item-preview.mce-active,.mce-menu .mce-menu-item.mce-selected,.mce-menu .mce-menu-item:focus,.mce-menu .mce-menu-item:hover{background:#0073aa;color:#fff}.mce-menu-item.mce-active .mce-menu-shortcut,.mce-menu-item.mce-disabled:hover .mce-ico,.mce-menu-item.mce-disabled:hover .mce-text,.mce-menu-item:focus .mce-ico,.mce-menu-item:focus .mce-menu-shortcut,.mce-menu-item:focus .mce-text,.mce-menu-item:hover .mce-ico,.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item:hover .mce-text{color:inherit}.mce-menu .mce-menu-item.mce-disabled{cursor:default}.mce-menu .mce-menu-item.mce-disabled:hover{background:#ccc}div.mce-menubar{border-color:#e5e5e5;background:#fff;border-width:0 0 1px}.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus,.mce-menubar .mce-menubtn:hover{border-color:transparent;background:0 0}.mce-menubar .mce-menubtn:focus{color:#124964;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}.mce-menu-item-sep:hover,div.mce-menu .mce-menu-item-sep{border-bottom:1px solid #ddd;height:0;margin:5px 0}.mce-menubtn span{margin-right:0;padding-left:3px}.mce-menu-has-icons i.mce-ico:before{margin-left:-2px}.mce-menu.mce-menu-align .mce-menu-shortcut{bottom:.6em;font-size:.9em}.mce-primary button,.mce-primary button i{text-align:center;color:#fff;text-shadow:none;padding:0;line-height:26px}.mce-window .mce-btn{color:#555;background:#f7f7f7;text-decoration:none;font-size:13px;line-height:26px;height:28px;margin:0;padding:0;cursor:pointer;border:1px solid #ccc;-webkit-appearance:none;border-radius:3px;white-space:nowrap;box-shadow:0 1px 0 #ccc}.mce-window .mce-btn::-moz-focus-inner{border-width:0;border-style:none;padding:0}.mce-window .mce-btn:focus,.mce-window .mce-btn:hover{background:#fafafa;border-color:#999;color:#23282d}.mce-window .mce-btn:focus{border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8)}.mce-window .mce-btn:active{background:#eee;border-color:#999;box-shadow:inset 0 2px 5px -3px rgba(0,0,0,.5);-webkit-transform:translateY(1px);transform:translateY(1px)}.mce-window .mce-btn.mce-disabled{color:#a0a5aa!important;border-color:#ddd!important;background:#f7f7f7!important;box-shadow:none!important;text-shadow:0 1px 0 #fff!important;cursor:default;-webkit-transform:none!important;transform:none!important}.mce-window .mce-btn.mce-primary{background:#0085ba;border-color:#0073aa #006799 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799}.mce-window .mce-btn.mce-primary:focus,.mce-window .mce-btn.mce-primary:hover{background:#008ec2;border-color:#006799;color:#fff}.mce-window .mce-btn.mce-primary:focus{box-shadow:0 1px 0 #0073aa,0 0 2px 1px #33b3db}.mce-window .mce-btn.mce-primary:active{background:#0073aa;border-color:#006799;box-shadow:inset 0 2px 0 #006799;vertical-align:top}.mce-window .mce-btn.mce-primary.mce-disabled{color:#66c6e4!important;background:#008ec2!important;border-color:#007cb2!important;box-shadow:none!important;text-shadow:0 -1px 0 rgba(0,0,0,.1)!important;cursor:default}.mce-toolbar .mce-ico,.qt-dfw{text-shadow:none;text-align:center}.mce-menubtn.mce-fixed-width span{overflow-x:hidden;text-overflow:ellipsis;width:82px}.mce-charmap{margin:3px}.mce-charmap td{padding:0;border-color:#ddd;cursor:pointer}.mce-charmap td:hover{background:#f3f3f3}.mce-charmap td div{width:18px;height:22px;line-height:22px}.mce-toolbar .mce-btn .mce-open,.qt-dfw{line-height:20px}.mce-tooltip{margin-top:2px}.rtl .mce-tooltip.wp-hide-mce-tooltip{display:none!important}.mce-tooltip-inner{border-radius:3px;box-shadow:0 3px 5px rgba(0,0,0,.2);color:#fff;font-size:12px}.mce-ico{font-family:tinymce,Arial}.mce-btn-small .mce-ico{font-family:tinymce-small,Arial}.mce-toolbar .mce-ico{color:#555d66;line-height:20px;width:20px;height:20px;margin:0;padding:0}.qt-dfw{color:#555d66;width:28px;height:26px}.mce-toolbar .mce-btn.mce-active .mce-open,.mce-toolbar .mce-btn:focus .mce-open,.mce-toolbar .mce-btn:hover .mce-open{border-left-color:#23282d}div.mce-notification{left:10%!important;right:10%}.mce-notification button.mce-close{right:6px;top:3px;font-weight:400;color:#555d66}.mce-notification button.mce-close:focus,.mce-notification button.mce-close:hover{color:#000}i.mce-i-aligncenter,i.mce-i-alignjustify,i.mce-i-alignleft,i.mce-i-alignright,i.mce-i-backcolor,i.mce-i-blockquote,i.mce-i-bold,i.mce-i-bullist,i.mce-i-charmap,i.mce-i-dashicon,i.mce-i-dfw,i.mce-i-forecolor,i.mce-i-fullscreen,i.mce-i-help,i.mce-i-hr,i.mce-i-indent,i.mce-i-italic,i.mce-i-link,i.mce-i-ltr,i.mce-i-numlist,i.mce-i-outdent,i.mce-i-pastetext,i.mce-i-pasteword,i.mce-i-redo,i.mce-i-remove,i.mce-i-removeformat,i.mce-i-spellchecker,i.mce-i-strikethrough,i.mce-i-underline,i.mce-i-undo,i.mce-i-unlink,i.mce-i-wp-media-library,i.mce-i-wp_adv,i.mce-i-wp_code,i.mce-i-wp_fullscreen,i.mce-i-wp_help,i.mce-i-wp_more,i.mce-i-wp_page{font:400 20px/1 dashicons;padding:0 2px 0 0;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-left:-2px}.qt-dfw{font:400 20px/1 dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}i.mce-i-bold:before{content:"\f200"}i.mce-i-italic:before{content:"\f201"}i.mce-i-bullist:before{content:"\f203"}i.mce-i-numlist:before{content:"\f204"}i.mce-i-blockquote:before{content:"\f205"}i.mce-i-alignleft:before{content:"\f206"}i.mce-i-aligncenter:before{content:"\f207"}i.mce-i-alignright:before{content:"\f208"}i.mce-i-link:before{content:"\f103"}i.mce-i-unlink:before{content:"\f225"}i.mce-i-wp_more:before{content:"\f209"}i.mce-i-strikethrough:before{content:"\f224"}i.mce-i-spellchecker:before{content:"\f210"}.qt-dfw:before,i.mce-i-dfw:before,i.mce-i-fullscreen:before,i.mce-i-wp_fullscreen:before{content:"\f211"}i.mce-i-wp_adv:before{content:"\f212"}i.mce-i-underline:before{content:"\f213"}i.mce-i-alignjustify:before{content:"\f214"}i.mce-i-backcolor:before,i.mce-i-forecolor:before{content:"\f215"}i.mce-i-pastetext:before{content:"\f217"}i.mce-i-removeformat:before{content:"\f218"}i.mce-i-charmap:before{content:"\f220"}i.mce-i-outdent:before{content:"\f221"}i.mce-i-indent:before{content:"\f222"}i.mce-i-undo:before{content:"\f171"}i.mce-i-redo:before{content:"\f172"}i.mce-i-help:before,i.mce-i-wp_help:before{content:"\f223"}i.mce-i-wp-media-library:before{content:"\f104"}i.mce-i-ltr:before{content:"\f320"}i.mce-i-wp_page:before{content:"\f105"}i.mce-i-hr:before{content:"\f460"}i.mce-i-remove:before{content:"\f158"}i.mce-i-wp_code:before{content:"\f475"}.rtl i.mce-i-outdent:before{content:"\f222"}.rtl i.mce-i-indent:before{content:"\f221"}.wp-editor-tools{z-index:1}.wp-editor-tools:after{clear:both;content:"";display:table}.wp-editor-container{clear:both;border:1px solid #e5e5e5}.wp-editor-area{font-family:Consolas,Monaco,monospace;font-size:13px;padding:10px;margin:1px 0 0;line-height:150%;border:0;outline:0;display:block;resize:vertical}.rtl .wp-editor-area{font-family:Tahoma,Monaco,monospace}.locale-he-il .wp-editor-area{font-family:Arial,Monaco,monospace}.wp-editor-container textarea.wp-editor-area{width:100%;margin:0;box-shadow:none}.wp-editor-tabs{float:right}.wp-switch-editor{float:left;box-sizing:content-box;top:1px;background:#ebebeb;color:#666;cursor:pointer;font-size:13px;line-height:19px;height:20px;margin:5px 0 0 5px;padding:3px 8px 4px;border:1px solid #e5e5e5}.wp-switch-editor:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:0;color:#23282d}.html-active .switch-html:focus,.tmce-active .switch-tmce:focus,.wp-switch-editor:active{box-shadow:none}.wp-switch-editor:active{background-color:#f5f5f5;box-shadow:none}.js .tmce-active .wp-editor-area{color:#fff}.tmce-active .quicktags-toolbar{display:none}.html-active .switch-html,.tmce-active .switch-tmce{background:#f5f5f5;color:#555;border-bottom-color:#f5f5f5}.wp-media-buttons{float:left}.wp-media-buttons .button{margin-right:5px;margin-bottom:4px;padding-left:7px;padding-right:7px}.wp-media-buttons .button:active{position:relative;top:1px;margin-top:-1px;margin-bottom:1px}.wp-media-buttons .insert-media{padding-left:5px}.wp-media-buttons a{text-decoration:none;color:#444;font-size:12px}.wp-media-buttons img{padding:0 4px;vertical-align:middle}.wp-media-buttons span.wp-media-buttons-icon{display:inline-block;width:18px;height:18px;vertical-align:text-top;margin:0 2px}.wp-media-buttons .add_media span.wp-media-buttons-icon{background:0 0}.wp-media-buttons .add_media span.wp-media-buttons-icon:before{font:400 18px/1 dashicons;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f104"}.quicktags-toolbar{padding:3px;border-bottom:1px solid #ddd;background:#f5f5f5;min-height:30px}.has-dfw .quicktags-toolbar{padding-right:35px}.wp-core-ui .quicktags-toolbar input.button.button-small{margin:2px}.quicktags-toolbar input[value=link]{text-decoration:underline}.quicktags-toolbar input[value=del]{text-decoration:line-through}.quicktags-toolbar input[value="i"]{font-style:italic}.quicktags-toolbar input[value="b"]{font-weight:600}.mce-toolbar .mce-btn-group .mce-btn.mce-wp-dfw,.qt-dfw{position:absolute;top:0;right:0;margin:5px 5px 0 0}.qt-fullscreen{position:static;margin:2px}@media screen and (max-width:782px){.mce-toolbar .mce-btn button,.qt-dfw{padding:6px 7px}.mce-toolbar .mce-btn-group .mce-btn.mce-primary button{padding:6px 7px 5px}.mce-toolbar .mce-btn-group .mce-btn{margin:1px}.qt-dfw{width:36px;height:34px}.mce-toolbar .mce-btn-group .mce-btn.mce-wp-dfw{margin:4px 4px 0 0}.mce-toolbar .mce-colorbutton .mce-preview{left:8px;bottom:6px}.mce-window .mce-btn{padding:2px 0}.has-dfw .quicktags-toolbar,.has-dfw div.mce-toolbar-grp .mce-toolbar.mce-first{padding-right:40px}}@media screen and (min-width:782px){.wp-core-ui .quicktags-toolbar input.button.button-small{font-size:12px;height:26px;line-height:24px}}#wp_editbtns,#wp_gallerybtns{padding:2px;position:absolute;display:none;z-index:100020}#wp_delgallery,#wp_delimgbtn,#wp_editgallery,#wp_editimgbtn{border-color:#999;background-color:#eee;margin:2px;padding:2px;border-width:1px;border-style:solid;border-radius:3px}#wp_delgallery:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_editimgbtn:hover{border-color:#555;background-color:#ccc}#wp-link-wrap{display:none;background-color:#fff;width:500px;overflow:hidden;margin-left:-250px;position:fixed;top:50%;left:50%;z-index:100105;transition:height .2s,margin-top .2s;height:500px;margin-top:-250px}#wp-link-backdrop{display:none;position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:100100}#wp-link{position:relative;height:100%}#wp-link-wrap .wp-link-text-field{display:none}#wp-link-wrap.has-text-field .wp-link-text-field{display:block}#link-modal-title{background:#fcfcfc;border-bottom:1px solid #ddd;height:36px;font-size:18px;font-weight:600;line-height:36px;margin:0;padding:0 36px 0 16px}#wp-link-close{color:#666;padding:0;position:absolute;top:0;right:0;width:36px;height:36px;text-align:center;background:0 0;border:none;cursor:pointer}#wp-link-close:before{font:400 20px/36px dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:36px;height:36px;content:"\f158"}#wp-link-close:focus,#wp-link-close:hover{color:#00a0d2}#wp-link-close:focus{outline:0;box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8)}#wp-link-wrap #link-selector{-webkit-overflow-scrolling:touch;padding:0 16px;position:absolute;top:37px;left:0;right:0;bottom:44px}#wp-link ol,#wp-link ul{list-style:none;margin:0;padding:0}#wp-link input[type=text]{box-sizing:border-box}#wp-link #link-options{padding:8px 0 12px}#wp-link p.howto{margin:3px 0}#wp-link p.howto a{text-decoration:none;color:inherit}#wp-link label input[type=text]{margin-top:5px;width:70%}#wp-link #link-options label span,#wp-link #search-panel label span.search-label{display:inline-block;width:80px;text-align:right;padding-right:5px;max-width:24%;vertical-align:middle;word-wrap:break-word}#wp-link .link-search-field{float:left;width:250px;max-width:70%}#wp-link .link-search-wrapper{margin:5px 0 9px;display:block;overflow:hidden}#wp-link .link-search-wrapper span{float:left;margin-top:4px}#wp-link .link-search-wrapper .spinner{margin-top:5px}#wp-link .link-target{padding:3px 0 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#wp-link .link-target label{max-width:70%}#wp-link .query-results{border:1px solid #dfdfdf;margin:0 0 12px;background:#fff;overflow:auto;position:absolute;left:16px;right:16px;bottom:0;top:166px}.has-text-field #wp-link .query-results{top:200px}#wp-link li{clear:both;margin-bottom:0;border-bottom:1px solid #f1f1f1;color:#32373c;padding:4px 6px 4px 10px;cursor:pointer;position:relative}#wp-link .query-notice,#wp-link li.unselectable{border-bottom:1px solid #dfdfdf}#wp-link .query-notice{padding:0;background-color:#f7fcfe;color:#000}#wp-link .query-notice .query-notice-default,#wp-link .query-notice .query-notice-hint{display:block;padding:6px;border-left:4px solid #00a0d2}#wp-link .unselectable.no-matches-found{padding:0;border-bottom:1px solid #dfdfdf;background-color:#fef7f1}#wp-link .no-matches-found .item-title{display:block;padding:6px;border-left:4px solid #d54e21}#wp-link .query-results em{font-style:normal}#wp-link li:hover{background:#eaf2fa;color:#151515}#wp-link li.unselectable:hover{background:#fff;cursor:auto;color:#32373c}#wp-link li.selected{background:#ddd;color:#32373c}#wp-link li.selected .item-title{font-weight:600}#wp-link li:last-child{border:none}#wp-link .item-title{display:inline-block;width:80%;width:calc(100% - 68px);word-wrap:break-word}#wp-link .item-info{text-transform:uppercase;color:#666;font-size:11px;position:absolute;right:5px;top:5px}#wp-link .river-waiting{display:none;padding:10px 0}#wp-link .submitbox{padding:8px 16px;background:#fcfcfc;border-top:1px solid #ddd;position:absolute;bottom:0;left:0;right:0}#wp-link-cancel{line-height:25px;float:left}#wp-link-update{line-height:23px;float:right}#wp-link-submit{float:right}@media screen and (max-width:782px){#wp-link-wrap{margin-top:-140px}#wp-link-wrap .query-results{top:195px}#wp-link-wrap.has-text-field .query-results{top:235px}#link-selector{padding:0 16px 60px}#wp-link-wrap #link-selector{bottom:52px}#wp-link-cancel{line-height:32px}#wp-link .link-target{padding-top:10px}#wp-link .submitbox .button{margin-bottom:0}}@media screen and (max-width:520px){#wp-link-wrap{width:auto;margin-left:0;left:10px;right:10px;max-width:500px}}@media screen and (max-height:520px){#wp-link-wrap{transition:none;height:auto;margin-top:0;top:10px;bottom:10px}#link-selector{overflow:auto}#search-panel .query-results{position:static}}@media screen and (max-height:290px){#wp-link-wrap{height:auto;margin-top:0;top:10px;bottom:10px}#link-selector{overflow:auto;height:calc(100% - 92px);padding-bottom:2px}#search-panel .query-results{position:static}}div.wp-link-preview{float:left;margin:5px;max-width:694px;overflow:hidden;text-overflow:ellipsis}div.wp-link-preview a{color:#0073aa;text-decoration:underline;transition-property:border,background,color;transition-duration:.05s;transition-timing-function:ease-in-out;cursor:pointer}div.wp-link-preview a.wplink-url-error{color:#dc3232}div.wp-link-input{float:left;margin:2px;max-width:694px}div.wp-link-input input{width:300px;padding:3px;box-sizing:border-box}.mce-toolbar div.wp-link-input~.mce-btn,.mce-toolbar div.wp-link-preview~.mce-btn{margin:2px 1px}.mce-inline-toolbar-grp .mce-btn-group .mce-btn:last-child{margin-right:2px}.ui-autocomplete.wplink-autocomplete{z-index:100110;max-height:200px;overflow-y:auto;padding:0;margin:0;list-style:none;position:absolute;border:1px solid #5b9dd9;box-shadow:0 1px 2px rgba(30,140,190,.8);background-color:#fff}.ui-autocomplete.wplink-autocomplete li{margin-bottom:0;padding:4px 10px;clear:both;white-space:normal;text-align:left}.ui-autocomplete.wplink-autocomplete li .wp-editor-float-right{float:right}.ui-autocomplete.wplink-autocomplete li.ui-state-focus{background-color:#ddd;cursor:pointer}@media screen and (max-width:782px){div.wp-link-input,div.wp-link-preview{max-width:70%;max-width:calc(100% - 86px)}div.wp-link-preview{margin:8px 0 8px 5px}div.wp-link-input{width:300px}div.wp-link-input input{width:100%;font-size:16px;padding:5px}}.mce-fullscreen{z-index:100010}.rtl .quicktags-toolbar input,.rtl .wp-switch-editor{font-family:Tahoma,sans-serif}.mce-rtl .mce-flow-layout .mce-flow-layout-item>div{direction:rtl}.mce-rtl .mce-listbox i.mce-caret{left:6px}html:lang(he-il) .rtl .quicktags-toolbar input,html:lang(he-il) .rtl .wp-switch-editor{font-family:Arial,sans-serif}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.wp-media-buttons .add_media span.wp-media-buttons-icon{background:0 0}} \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/charmap/plugin.js b/wp-includes/js/tinymce/plugins/charmap/plugin.js index 3e947c7b58..8098d5e13d 100644 --- a/wp-includes/js/tinymce/plugins/charmap/plugin.js +++ b/wp-includes/js/tinymce/plugins/charmap/plugin.js @@ -1,617 +1,1275 @@ (function () { +var charmap = (function () { + 'use strict'; -var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)} + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); -// Used when there is no 'main' module. -// The name is probably (hopefully) unique so minification removes for releases. -var register_3795 = function (id) { - var module = dem(id); - var fragments = id.split('.'); - var target = Function('return this;')(); - for (var i = 0; i < fragments.length - 1; ++i) { - if (target[fragments[i]] === undefined) - target[fragments[i]] = {}; - target = target[fragments[i]]; - } - target[fragments[fragments.length - 1]] = module; -}; - -var instantiate = function (id) { - var actual = defs[id]; - var dependencies = actual.deps; - var definition = actual.defn; - var len = dependencies.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances[i] = dem(dependencies[i]); - var defResult = definition.apply(null, instances); - if (defResult === undefined) - throw 'module [' + id + '] returned undefined'; - actual.instance = defResult; -}; - -var def = function (id, dependencies, definition) { - if (typeof id !== 'string') - throw 'module id must be a string'; - else if (dependencies === undefined) - throw 'no dependencies for ' + id; - else if (definition === undefined) - throw 'no definition function for ' + id; - defs[id] = { - deps: dependencies, - defn: definition, - instance: undefined + var fireInsertCustomChar = function (editor, chr) { + return editor.fire('insertCustomChar', { chr: chr }); }; -}; + var $_j6jbo95jfuw8onk = { fireInsertCustomChar: fireInsertCustomChar }; -var dem = function (id) { - var actual = defs[id]; - if (actual === undefined) - throw 'module [' + id + '] was undefined'; - else if (actual.instance === undefined) - instantiate(id); - return actual.instance; -}; + var insertChar = function (editor, chr) { + var evtChr = $_j6jbo95jfuw8onk.fireInsertCustomChar(editor, chr).chr; + editor.execCommand('mceInsertContent', false, evtChr); + }; + var $_apbezv94jfuw8onj = { insertChar: insertChar }; -var req = function (ids, callback) { - var len = ids.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances.push(dem(ids[i])); - callback.apply(null, callback); -}; + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); -var ephox = {}; + var getCharMap = function (editor) { + return editor.settings.charmap; + }; + var getCharMapAppend = function (editor) { + return editor.settings.charmap_append; + }; + var $_ae555o98jfuw8onx = { + getCharMap: getCharMap, + getCharMapAppend: getCharMapAppend + }; -ephox.bolt = { - module: { - api: { - define: def, - require: req, - demand: dem + var isArray = global$1.isArray; + var getDefaultCharMap = function () { + return [ + [ + '160', + 'no-break space' + ], + [ + '173', + 'soft hyphen' + ], + [ + '34', + 'quotation mark' + ], + [ + '162', + 'cent sign' + ], + [ + '8364', + 'euro sign' + ], + [ + '163', + 'pound sign' + ], + [ + '165', + 'yen sign' + ], + [ + '169', + 'copyright sign' + ], + [ + '174', + 'registered sign' + ], + [ + '8482', + 'trade mark sign' + ], + [ + '8240', + 'per mille sign' + ], + [ + '181', + 'micro sign' + ], + [ + '183', + 'middle dot' + ], + [ + '8226', + 'bullet' + ], + [ + '8230', + 'three dot leader' + ], + [ + '8242', + 'minutes / feet' + ], + [ + '8243', + 'seconds / inches' + ], + [ + '167', + 'section sign' + ], + [ + '182', + 'paragraph sign' + ], + [ + '223', + 'sharp s / ess-zed' + ], + [ + '8249', + 'single left-pointing angle quotation mark' + ], + [ + '8250', + 'single right-pointing angle quotation mark' + ], + [ + '171', + 'left pointing guillemet' + ], + [ + '187', + 'right pointing guillemet' + ], + [ + '8216', + 'left single quotation mark' + ], + [ + '8217', + 'right single quotation mark' + ], + [ + '8220', + 'left double quotation mark' + ], + [ + '8221', + 'right double quotation mark' + ], + [ + '8218', + 'single low-9 quotation mark' + ], + [ + '8222', + 'double low-9 quotation mark' + ], + [ + '60', + 'less-than sign' + ], + [ + '62', + 'greater-than sign' + ], + [ + '8804', + 'less-than or equal to' + ], + [ + '8805', + 'greater-than or equal to' + ], + [ + '8211', + 'en dash' + ], + [ + '8212', + 'em dash' + ], + [ + '175', + 'macron' + ], + [ + '8254', + 'overline' + ], + [ + '164', + 'currency sign' + ], + [ + '166', + 'broken bar' + ], + [ + '168', + 'diaeresis' + ], + [ + '161', + 'inverted exclamation mark' + ], + [ + '191', + 'turned question mark' + ], + [ + '710', + 'circumflex accent' + ], + [ + '732', + 'small tilde' + ], + [ + '176', + 'degree sign' + ], + [ + '8722', + 'minus sign' + ], + [ + '177', + 'plus-minus sign' + ], + [ + '247', + 'division sign' + ], + [ + '8260', + 'fraction slash' + ], + [ + '215', + 'multiplication sign' + ], + [ + '185', + 'superscript one' + ], + [ + '178', + 'superscript two' + ], + [ + '179', + 'superscript three' + ], + [ + '188', + 'fraction one quarter' + ], + [ + '189', + 'fraction one half' + ], + [ + '190', + 'fraction three quarters' + ], + [ + '402', + 'function / florin' + ], + [ + '8747', + 'integral' + ], + [ + '8721', + 'n-ary sumation' + ], + [ + '8734', + 'infinity' + ], + [ + '8730', + 'square root' + ], + [ + '8764', + 'similar to' + ], + [ + '8773', + 'approximately equal to' + ], + [ + '8776', + 'almost equal to' + ], + [ + '8800', + 'not equal to' + ], + [ + '8801', + 'identical to' + ], + [ + '8712', + 'element of' + ], + [ + '8713', + 'not an element of' + ], + [ + '8715', + 'contains as member' + ], + [ + '8719', + 'n-ary product' + ], + [ + '8743', + 'logical and' + ], + [ + '8744', + 'logical or' + ], + [ + '172', + 'not sign' + ], + [ + '8745', + 'intersection' + ], + [ + '8746', + 'union' + ], + [ + '8706', + 'partial differential' + ], + [ + '8704', + 'for all' + ], + [ + '8707', + 'there exists' + ], + [ + '8709', + 'diameter' + ], + [ + '8711', + 'backward difference' + ], + [ + '8727', + 'asterisk operator' + ], + [ + '8733', + 'proportional to' + ], + [ + '8736', + 'angle' + ], + [ + '180', + 'acute accent' + ], + [ + '184', + 'cedilla' + ], + [ + '170', + 'feminine ordinal indicator' + ], + [ + '186', + 'masculine ordinal indicator' + ], + [ + '8224', + 'dagger' + ], + [ + '8225', + 'double dagger' + ], + [ + '192', + 'A - grave' + ], + [ + '193', + 'A - acute' + ], + [ + '194', + 'A - circumflex' + ], + [ + '195', + 'A - tilde' + ], + [ + '196', + 'A - diaeresis' + ], + [ + '197', + 'A - ring above' + ], + [ + '256', + 'A - macron' + ], + [ + '198', + 'ligature AE' + ], + [ + '199', + 'C - cedilla' + ], + [ + '200', + 'E - grave' + ], + [ + '201', + 'E - acute' + ], + [ + '202', + 'E - circumflex' + ], + [ + '203', + 'E - diaeresis' + ], + [ + '274', + 'E - macron' + ], + [ + '204', + 'I - grave' + ], + [ + '205', + 'I - acute' + ], + [ + '206', + 'I - circumflex' + ], + [ + '207', + 'I - diaeresis' + ], + [ + '298', + 'I - macron' + ], + [ + '208', + 'ETH' + ], + [ + '209', + 'N - tilde' + ], + [ + '210', + 'O - grave' + ], + [ + '211', + 'O - acute' + ], + [ + '212', + 'O - circumflex' + ], + [ + '213', + 'O - tilde' + ], + [ + '214', + 'O - diaeresis' + ], + [ + '216', + 'O - slash' + ], + [ + '332', + 'O - macron' + ], + [ + '338', + 'ligature OE' + ], + [ + '352', + 'S - caron' + ], + [ + '217', + 'U - grave' + ], + [ + '218', + 'U - acute' + ], + [ + '219', + 'U - circumflex' + ], + [ + '220', + 'U - diaeresis' + ], + [ + '362', + 'U - macron' + ], + [ + '221', + 'Y - acute' + ], + [ + '376', + 'Y - diaeresis' + ], + [ + '562', + 'Y - macron' + ], + [ + '222', + 'THORN' + ], + [ + '224', + 'a - grave' + ], + [ + '225', + 'a - acute' + ], + [ + '226', + 'a - circumflex' + ], + [ + '227', + 'a - tilde' + ], + [ + '228', + 'a - diaeresis' + ], + [ + '229', + 'a - ring above' + ], + [ + '257', + 'a - macron' + ], + [ + '230', + 'ligature ae' + ], + [ + '231', + 'c - cedilla' + ], + [ + '232', + 'e - grave' + ], + [ + '233', + 'e - acute' + ], + [ + '234', + 'e - circumflex' + ], + [ + '235', + 'e - diaeresis' + ], + [ + '275', + 'e - macron' + ], + [ + '236', + 'i - grave' + ], + [ + '237', + 'i - acute' + ], + [ + '238', + 'i - circumflex' + ], + [ + '239', + 'i - diaeresis' + ], + [ + '299', + 'i - macron' + ], + [ + '240', + 'eth' + ], + [ + '241', + 'n - tilde' + ], + [ + '242', + 'o - grave' + ], + [ + '243', + 'o - acute' + ], + [ + '244', + 'o - circumflex' + ], + [ + '245', + 'o - tilde' + ], + [ + '246', + 'o - diaeresis' + ], + [ + '248', + 'o slash' + ], + [ + '333', + 'o macron' + ], + [ + '339', + 'ligature oe' + ], + [ + '353', + 's - caron' + ], + [ + '249', + 'u - grave' + ], + [ + '250', + 'u - acute' + ], + [ + '251', + 'u - circumflex' + ], + [ + '252', + 'u - diaeresis' + ], + [ + '363', + 'u - macron' + ], + [ + '253', + 'y - acute' + ], + [ + '254', + 'thorn' + ], + [ + '255', + 'y - diaeresis' + ], + [ + '563', + 'y - macron' + ], + [ + '913', + 'Alpha' + ], + [ + '914', + 'Beta' + ], + [ + '915', + 'Gamma' + ], + [ + '916', + 'Delta' + ], + [ + '917', + 'Epsilon' + ], + [ + '918', + 'Zeta' + ], + [ + '919', + 'Eta' + ], + [ + '920', + 'Theta' + ], + [ + '921', + 'Iota' + ], + [ + '922', + 'Kappa' + ], + [ + '923', + 'Lambda' + ], + [ + '924', + 'Mu' + ], + [ + '925', + 'Nu' + ], + [ + '926', + 'Xi' + ], + [ + '927', + 'Omicron' + ], + [ + '928', + 'Pi' + ], + [ + '929', + 'Rho' + ], + [ + '931', + 'Sigma' + ], + [ + '932', + 'Tau' + ], + [ + '933', + 'Upsilon' + ], + [ + '934', + 'Phi' + ], + [ + '935', + 'Chi' + ], + [ + '936', + 'Psi' + ], + [ + '937', + 'Omega' + ], + [ + '945', + 'alpha' + ], + [ + '946', + 'beta' + ], + [ + '947', + 'gamma' + ], + [ + '948', + 'delta' + ], + [ + '949', + 'epsilon' + ], + [ + '950', + 'zeta' + ], + [ + '951', + 'eta' + ], + [ + '952', + 'theta' + ], + [ + '953', + 'iota' + ], + [ + '954', + 'kappa' + ], + [ + '955', + 'lambda' + ], + [ + '956', + 'mu' + ], + [ + '957', + 'nu' + ], + [ + '958', + 'xi' + ], + [ + '959', + 'omicron' + ], + [ + '960', + 'pi' + ], + [ + '961', + 'rho' + ], + [ + '962', + 'final sigma' + ], + [ + '963', + 'sigma' + ], + [ + '964', + 'tau' + ], + [ + '965', + 'upsilon' + ], + [ + '966', + 'phi' + ], + [ + '967', + 'chi' + ], + [ + '968', + 'psi' + ], + [ + '969', + 'omega' + ], + [ + '8501', + 'alef symbol' + ], + [ + '982', + 'pi symbol' + ], + [ + '8476', + 'real part symbol' + ], + [ + '978', + 'upsilon - hook symbol' + ], + [ + '8472', + 'Weierstrass p' + ], + [ + '8465', + 'imaginary part' + ], + [ + '8592', + 'leftwards arrow' + ], + [ + '8593', + 'upwards arrow' + ], + [ + '8594', + 'rightwards arrow' + ], + [ + '8595', + 'downwards arrow' + ], + [ + '8596', + 'left right arrow' + ], + [ + '8629', + 'carriage return' + ], + [ + '8656', + 'leftwards double arrow' + ], + [ + '8657', + 'upwards double arrow' + ], + [ + '8658', + 'rightwards double arrow' + ], + [ + '8659', + 'downwards double arrow' + ], + [ + '8660', + 'left right double arrow' + ], + [ + '8756', + 'therefore' + ], + [ + '8834', + 'subset of' + ], + [ + '8835', + 'superset of' + ], + [ + '8836', + 'not a subset of' + ], + [ + '8838', + 'subset of or equal to' + ], + [ + '8839', + 'superset of or equal to' + ], + [ + '8853', + 'circled plus' + ], + [ + '8855', + 'circled times' + ], + [ + '8869', + 'perpendicular' + ], + [ + '8901', + 'dot operator' + ], + [ + '8968', + 'left ceiling' + ], + [ + '8969', + 'right ceiling' + ], + [ + '8970', + 'left floor' + ], + [ + '8971', + 'right floor' + ], + [ + '9001', + 'left-pointing angle bracket' + ], + [ + '9002', + 'right-pointing angle bracket' + ], + [ + '9674', + 'lozenge' + ], + [ + '9824', + 'black spade suit' + ], + [ + '9827', + 'black club suit' + ], + [ + '9829', + 'black heart suit' + ], + [ + '9830', + 'black diamond suit' + ], + [ + '8194', + 'en space' + ], + [ + '8195', + 'em space' + ], + [ + '8201', + 'thin space' + ], + [ + '8204', + 'zero width non-joiner' + ], + [ + '8205', + 'zero width joiner' + ], + [ + '8206', + 'left-to-right mark' + ], + [ + '8207', + 'right-to-left mark' + ] + ]; + }; + var charmapFilter = function (charmap) { + return global$1.grep(charmap, function (item) { + return isArray(item) && item.length === 2; + }); + }; + var getCharsFromSetting = function (settingValue) { + if (isArray(settingValue)) { + return [].concat(charmapFilter(settingValue)); } - } -}; + if (typeof settingValue === 'function') { + return settingValue(); + } + return []; + }; + var extendCharMap = function (editor, charmap) { + var userCharMap = $_ae555o98jfuw8onx.getCharMap(editor); + if (userCharMap) { + charmap = getCharsFromSetting(userCharMap); + } + var userCharMapAppend = $_ae555o98jfuw8onx.getCharMapAppend(editor); + if (userCharMapAppend) { + return [].concat(charmap).concat(getCharsFromSetting(userCharMapAppend)); + } + return charmap; + }; + var getCharMap$1 = function (editor) { + return extendCharMap(editor, getDefaultCharMap()); + }; + var $_a0v8qq96jfuw8onl = { getCharMap: getCharMap$1 }; -var define = def; -var require = req; -var demand = dem; -// this helps with minificiation when using a lot of global references -var defineGlobal = function (id, ref) { - define(id, [], function () { return ref; }); -}; -/*jsc -["tinymce.plugins.charmap.Plugin","tinymce.core.PluginManager","tinymce.core.util.Tools","global!tinymce.util.Tools.resolve"] -jsc*/ -defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve); -/** - * ResolveGlobal.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 - */ + var get = function (editor) { + var getCharMap = function () { + return $_a0v8qq96jfuw8onl.getCharMap(editor); + }; + var insertChar = function (chr) { + $_apbezv94jfuw8onj.insertChar(editor, chr); + }; + return { + getCharMap: getCharMap, + insertChar: insertChar + }; + }; + var $_bi5zpv93jfuw8oni = { get: get }; -define( - 'tinymce.core.PluginManager', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.PluginManager'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.Tools', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.Tools'); - } -); - -/** - * 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 - */ - -/** - * This class contains all core logic for the charmap plugin. - * - * @class tinymce.charmap.Plugin - * @private - */ -define( - 'tinymce.plugins.charmap.Plugin', - [ - 'tinymce.core.PluginManager', - 'tinymce.core.util.Tools' - ], - function (PluginManager, Tools) { - PluginManager.add('charmap', function (editor) { - var isArray = Tools.isArray; - - function getDefaultCharMap() { - return [ - ['160', 'no-break space'], - ['173', 'soft hyphen'], - ['34', 'quotation mark'], - // finance - ['162', 'cent sign'], - ['8364', 'euro sign'], - ['163', 'pound sign'], - ['165', 'yen sign'], - // signs - ['169', 'copyright sign'], - ['174', 'registered sign'], - ['8482', 'trade mark sign'], - ['8240', 'per mille sign'], - ['181', 'micro sign'], - ['183', 'middle dot'], - ['8226', 'bullet'], - ['8230', 'three dot leader'], - ['8242', 'minutes / feet'], - ['8243', 'seconds / inches'], - ['167', 'section sign'], - ['182', 'paragraph sign'], - ['223', 'sharp s / ess-zed'], - // quotations - ['8249', 'single left-pointing angle quotation mark'], - ['8250', 'single right-pointing angle quotation mark'], - ['171', 'left pointing guillemet'], - ['187', 'right pointing guillemet'], - ['8216', 'left single quotation mark'], - ['8217', 'right single quotation mark'], - ['8220', 'left double quotation mark'], - ['8221', 'right double quotation mark'], - ['8218', 'single low-9 quotation mark'], - ['8222', 'double low-9 quotation mark'], - ['60', 'less-than sign'], - ['62', 'greater-than sign'], - ['8804', 'less-than or equal to'], - ['8805', 'greater-than or equal to'], - ['8211', 'en dash'], - ['8212', 'em dash'], - ['175', 'macron'], - ['8254', 'overline'], - ['164', 'currency sign'], - ['166', 'broken bar'], - ['168', 'diaeresis'], - ['161', 'inverted exclamation mark'], - ['191', 'turned question mark'], - ['710', 'circumflex accent'], - ['732', 'small tilde'], - ['176', 'degree sign'], - ['8722', 'minus sign'], - ['177', 'plus-minus sign'], - ['247', 'division sign'], - ['8260', 'fraction slash'], - ['215', 'multiplication sign'], - ['185', 'superscript one'], - ['178', 'superscript two'], - ['179', 'superscript three'], - ['188', 'fraction one quarter'], - ['189', 'fraction one half'], - ['190', 'fraction three quarters'], - // math / logical - ['402', 'function / florin'], - ['8747', 'integral'], - ['8721', 'n-ary sumation'], - ['8734', 'infinity'], - ['8730', 'square root'], - ['8764', 'similar to'], - ['8773', 'approximately equal to'], - ['8776', 'almost equal to'], - ['8800', 'not equal to'], - ['8801', 'identical to'], - ['8712', 'element of'], - ['8713', 'not an element of'], - ['8715', 'contains as member'], - ['8719', 'n-ary product'], - ['8743', 'logical and'], - ['8744', 'logical or'], - ['172', 'not sign'], - ['8745', 'intersection'], - ['8746', 'union'], - ['8706', 'partial differential'], - ['8704', 'for all'], - ['8707', 'there exists'], - ['8709', 'diameter'], - ['8711', 'backward difference'], - ['8727', 'asterisk operator'], - ['8733', 'proportional to'], - ['8736', 'angle'], - // undefined - ['180', 'acute accent'], - ['184', 'cedilla'], - ['170', 'feminine ordinal indicator'], - ['186', 'masculine ordinal indicator'], - ['8224', 'dagger'], - ['8225', 'double dagger'], - // alphabetical special chars - ['192', 'A - grave'], - ['193', 'A - acute'], - ['194', 'A - circumflex'], - ['195', 'A - tilde'], - ['196', 'A - diaeresis'], - ['197', 'A - ring above'], - ['256', 'A - macron'], - ['198', 'ligature AE'], - ['199', 'C - cedilla'], - ['200', 'E - grave'], - ['201', 'E - acute'], - ['202', 'E - circumflex'], - ['203', 'E - diaeresis'], - ['274', 'E - macron'], - ['204', 'I - grave'], - ['205', 'I - acute'], - ['206', 'I - circumflex'], - ['207', 'I - diaeresis'], - ['298', 'I - macron'], - ['208', 'ETH'], - ['209', 'N - tilde'], - ['210', 'O - grave'], - ['211', 'O - acute'], - ['212', 'O - circumflex'], - ['213', 'O - tilde'], - ['214', 'O - diaeresis'], - ['216', 'O - slash'], - ['332', 'O - macron'], - ['338', 'ligature OE'], - ['352', 'S - caron'], - ['217', 'U - grave'], - ['218', 'U - acute'], - ['219', 'U - circumflex'], - ['220', 'U - diaeresis'], - ['362', 'U - macron'], - ['221', 'Y - acute'], - ['376', 'Y - diaeresis'], - ['562', 'Y - macron'], - ['222', 'THORN'], - ['224', 'a - grave'], - ['225', 'a - acute'], - ['226', 'a - circumflex'], - ['227', 'a - tilde'], - ['228', 'a - diaeresis'], - ['229', 'a - ring above'], - ['257', 'a - macron'], - ['230', 'ligature ae'], - ['231', 'c - cedilla'], - ['232', 'e - grave'], - ['233', 'e - acute'], - ['234', 'e - circumflex'], - ['235', 'e - diaeresis'], - ['275', 'e - macron'], - ['236', 'i - grave'], - ['237', 'i - acute'], - ['238', 'i - circumflex'], - ['239', 'i - diaeresis'], - ['299', 'i - macron'], - ['240', 'eth'], - ['241', 'n - tilde'], - ['242', 'o - grave'], - ['243', 'o - acute'], - ['244', 'o - circumflex'], - ['245', 'o - tilde'], - ['246', 'o - diaeresis'], - ['248', 'o slash'], - ['333', 'o macron'], - ['339', 'ligature oe'], - ['353', 's - caron'], - ['249', 'u - grave'], - ['250', 'u - acute'], - ['251', 'u - circumflex'], - ['252', 'u - diaeresis'], - ['363', 'u - macron'], - ['253', 'y - acute'], - ['254', 'thorn'], - ['255', 'y - diaeresis'], - ['563', 'y - macron'], - ['913', 'Alpha'], - ['914', 'Beta'], - ['915', 'Gamma'], - ['916', 'Delta'], - ['917', 'Epsilon'], - ['918', 'Zeta'], - ['919', 'Eta'], - ['920', 'Theta'], - ['921', 'Iota'], - ['922', 'Kappa'], - ['923', 'Lambda'], - ['924', 'Mu'], - ['925', 'Nu'], - ['926', 'Xi'], - ['927', 'Omicron'], - ['928', 'Pi'], - ['929', 'Rho'], - ['931', 'Sigma'], - ['932', 'Tau'], - ['933', 'Upsilon'], - ['934', 'Phi'], - ['935', 'Chi'], - ['936', 'Psi'], - ['937', 'Omega'], - ['945', 'alpha'], - ['946', 'beta'], - ['947', 'gamma'], - ['948', 'delta'], - ['949', 'epsilon'], - ['950', 'zeta'], - ['951', 'eta'], - ['952', 'theta'], - ['953', 'iota'], - ['954', 'kappa'], - ['955', 'lambda'], - ['956', 'mu'], - ['957', 'nu'], - ['958', 'xi'], - ['959', 'omicron'], - ['960', 'pi'], - ['961', 'rho'], - ['962', 'final sigma'], - ['963', 'sigma'], - ['964', 'tau'], - ['965', 'upsilon'], - ['966', 'phi'], - ['967', 'chi'], - ['968', 'psi'], - ['969', 'omega'], - // symbols - ['8501', 'alef symbol'], - ['982', 'pi symbol'], - ['8476', 'real part symbol'], - ['978', 'upsilon - hook symbol'], - ['8472', 'Weierstrass p'], - ['8465', 'imaginary part'], - // arrows - ['8592', 'leftwards arrow'], - ['8593', 'upwards arrow'], - ['8594', 'rightwards arrow'], - ['8595', 'downwards arrow'], - ['8596', 'left right arrow'], - ['8629', 'carriage return'], - ['8656', 'leftwards double arrow'], - ['8657', 'upwards double arrow'], - ['8658', 'rightwards double arrow'], - ['8659', 'downwards double arrow'], - ['8660', 'left right double arrow'], - ['8756', 'therefore'], - ['8834', 'subset of'], - ['8835', 'superset of'], - ['8836', 'not a subset of'], - ['8838', 'subset of or equal to'], - ['8839', 'superset of or equal to'], - ['8853', 'circled plus'], - ['8855', 'circled times'], - ['8869', 'perpendicular'], - ['8901', 'dot operator'], - ['8968', 'left ceiling'], - ['8969', 'right ceiling'], - ['8970', 'left floor'], - ['8971', 'right floor'], - ['9001', 'left-pointing angle bracket'], - ['9002', 'right-pointing angle bracket'], - ['9674', 'lozenge'], - ['9824', 'black spade suit'], - ['9827', 'black club suit'], - ['9829', 'black heart suit'], - ['9830', 'black diamond suit'], - ['8194', 'en space'], - ['8195', 'em space'], - ['8201', 'thin space'], - ['8204', 'zero width non-joiner'], - ['8205', 'zero width joiner'], - ['8206', 'left-to-right mark'], - ['8207', 'right-to-left mark'] - ]; - } - - function charmapFilter(charmap) { - return Tools.grep(charmap, function (item) { - return isArray(item) && item.length == 2; - }); - } - - function getCharsFromSetting(settingValue) { - if (isArray(settingValue)) { - return [].concat(charmapFilter(settingValue)); + var getHtml = function (charmap) { + var gridHtml, x, y; + var width = Math.min(charmap.length, 25); + var height = Math.ceil(charmap.length / width); + gridHtml = ''; + for (y = 0; y < height; y++) { + gridHtml += ''; + for (x = 0; x < width; x++) { + var index = y * width + x; + if (index < charmap.length) { + var chr = charmap[index]; + var charCode = parseInt(chr[0], 10); + var chrText = chr ? String.fromCharCode(charCode) : ' '; + gridHtml += ''; + } else { + gridHtml += ''; + } + gridHtml += ''; + return gridHtml; + }; + var $_gbsfov9bjfuw8oo2 = { getHtml: getHtml }; - function extendCharMap(charmap) { - var settings = editor.settings; - - if (settings.charmap) { - charmap = getCharsFromSetting(settings.charmap); - } - - if (settings.charmap_append) { - return [].concat(charmap).concat(getCharsFromSetting(settings.charmap_append)); - } - - return charmap; + var getParentTd = function (elm) { + while (elm) { + if (elm.nodeName === 'TD') { + return elm; } - - function getCharMap() { - return extendCharMap(getDefaultCharMap()); - } - - function insertChar(chr) { - editor.fire('insertCustomChar', { chr: chr }).chr; - editor.execCommand('mceInsertContent', false, chr); - } - - function showDialog() { - var gridHtml, x, y, win; - - function getParentTd(elm) { - while (elm) { - if (elm.nodeName == 'TD') { - return elm; + elm = elm.parentNode; + } + }; + var open = function (editor) { + var win; + var charMapPanel = { + type: 'container', + html: $_gbsfov9bjfuw8oo2.getHtml($_a0v8qq96jfuw8onl.getCharMap(editor)), + onclick: function (e) { + var target = e.target; + if (/^(TD|DIV)$/.test(target.nodeName)) { + var charDiv = getParentTd(target).firstChild; + if (charDiv && charDiv.hasAttribute('data-chr')) { + var charCodeString = charDiv.getAttribute('data-chr'); + var charCode = parseInt(charCodeString, 10); + if (!isNaN(charCode)) { + $_apbezv94jfuw8onj.insertChar(editor, String.fromCharCode(charCode)); } - - elm = elm.parentNode; - } - } - - gridHtml = ''; - - var charmap = getCharMap(); - var width = Math.min(charmap.length, 25); - var height = Math.ceil(charmap.length / width); - for (y = 0; y < height; y++) { - gridHtml += ''; - - for (x = 0; x < width; x++) { - var index = y * width + x; - if (index < charmap.length) { - var chr = charmap[index]; - var chrText = chr ? String.fromCharCode(parseInt(chr[0], 10)) : ' '; - - gridHtml += ( - '' - ); - } else { - gridHtml += ''; } - - gridHtml += ''; - - var charMapPanel = { + }, + onmouseover: function (e) { + var td = getParentTd(e.target); + if (td && td.firstChild) { + win.find('#preview').text(td.firstChild.firstChild.data); + win.find('#previewTitle').text(td.title); + } else { + win.find('#preview').text(' '); + win.find('#previewTitle').text(' '); + } + } + }; + win = editor.windowManager.open({ + title: 'Special character', + spacing: 10, + padding: 10, + items: [ + charMapPanel, + { type: 'container', - html: gridHtml, - onclick: function (e) { - var target = e.target; - - if (/^(TD|DIV)$/.test(target.nodeName)) { - var charDiv = getParentTd(target).firstChild; - if (charDiv && charDiv.hasAttribute('data-chr')) { - insertChar(charDiv.getAttribute('data-chr')); - - if (!e.ctrlKey) { - win.close(); - } - } - } - }, - onmouseover: function (e) { - var td = getParentTd(e.target); - - if (td && td.firstChild) { - win.find('#preview').text(td.firstChild.firstChild.data); - win.find('#previewTitle').text(td.title); - } else { - win.find('#preview').text(' '); - win.find('#previewTitle').text(' '); - } - } - }; - - win = editor.windowManager.open({ - title: "Special character", - spacing: 10, - padding: 10, + layout: 'flex', + direction: 'column', + align: 'center', + spacing: 5, + minWidth: 160, + minHeight: 160, items: [ - charMapPanel, { - type: 'container', - layout: 'flex', - direction: 'column', - align: 'center', - spacing: 5, - minWidth: 160, - minHeight: 160, - items: [ - { - type: 'label', - name: 'preview', - text: ' ', - style: 'font-size: 40px; text-align: center', - border: 1, - minWidth: 140, - minHeight: 80 - }, - { - type: 'spacer', - minHeight: 20 - }, - { - type: 'label', - name: 'previewTitle', - text: ' ', - style: 'white-space: pre-wrap;', - border: 1, - minWidth: 140 - } - ] - } - ], - buttons: [ + type: 'label', + name: 'preview', + text: ' ', + style: 'font-size: 40px; text-align: center', + border: 1, + minWidth: 140, + minHeight: 80 + }, { - text: "Close", onclick: function () { - win.close(); - } + type: 'spacer', + minHeight: 20 + }, + { + type: 'label', + name: 'previewTitle', + text: ' ', + style: 'white-space: pre-wrap;', + border: 1, + minWidth: 140 } ] - }); - } - - editor.addCommand('mceShowCharmap', showDialog); - - editor.addButton('charmap', { - icon: 'charmap', - tooltip: 'Special character', - cmd: 'mceShowCharmap' - }); - - editor.addMenuItem('charmap', { - icon: 'charmap', - text: 'Special character', - cmd: 'mceShowCharmap', - context: 'insert' - }); - - return { - getCharMap: getCharMap, - insertChar: insertChar - }; + } + ], + buttons: [{ + text: 'Close', + onclick: function () { + win.close(); + } + }] }); + }; + var $_apxwbz9ajfuw8oo0 = { open: open }; - return function () { }; + var register = function (editor) { + editor.addCommand('mceShowCharmap', function () { + $_apxwbz9ajfuw8oo0.open(editor); + }); + }; + var $_21ao9599jfuw8ony = { register: register }; + + var register$1 = function (editor) { + editor.addButton('charmap', { + icon: 'charmap', + tooltip: 'Special character', + cmd: 'mceShowCharmap' + }); + editor.addMenuItem('charmap', { + icon: 'charmap', + text: 'Special character', + cmd: 'mceShowCharmap', + context: 'insert' + }); + }; + var $_9qh4i09cjfuw8oo4 = { register: register$1 }; + + global.add('charmap', function (editor) { + $_21ao9599jfuw8ony.register(editor); + $_9qh4i09cjfuw8oo4.register(editor); + return $_bi5zpv93jfuw8oni.get(editor); + }); + function Plugin () { } -); -dem('tinymce.plugins.charmap.Plugin')(); + + return Plugin; + +}()); })(); diff --git a/wp-includes/js/tinymce/plugins/charmap/plugin.min.js b/wp-includes/js/tinymce/plugins/charmap/plugin.min.js index 3fd9e23d5d..9ea3f75751 100644 --- a/wp-includes/js/tinymce/plugins/charmap/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/charmap/plugin.min.js @@ -1 +1 @@ -!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i",d=0;d
'+n+"
"}else c+=""}c+=""}c+="";var o={type:"container",html:c,onclick:function(a){var c=a.target;if(/^(TD|DIV)$/.test(c.nodeName)){var d=b(c).firstChild;d&&d.hasAttribute("data-chr")&&(h(d.getAttribute("data-chr")),a.ctrlKey||f.close())}},onmouseover:function(a){var c=b(a.target);c&&c.firstChild?(f.find("#preview").text(c.firstChild.firstChild.data),f.find("#previewTitle").text(c.title)):(f.find("#preview").text(" "),f.find("#previewTitle").text(" "))}};f=a.windowManager.open({title:"Special character",spacing:10,padding:10,items:[o,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"spacer",minHeight:20},{type:"label",name:"previewTitle",text:" ",style:"white-space: pre-wrap;",border:1,minWidth:140}]}],buttons:[{text:"Close",onclick:function(){f.close()}}]})}var j=b.isArray;return a.addCommand("mceShowCharmap",i),a.addButton("charmap",{icon:"charmap",tooltip:"Special character",cmd:"mceShowCharmap"}),a.addMenuItem("charmap",{icon:"charmap",text:"Special character",cmd:"mceShowCharmap",context:"insert"}),{getCharMap:g,insertChar:h}}),function(){}}),d("0")()}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e,t){return e.fire("insertCustomChar",{chr:t})},l=function(e,t){var a=i(e,t).chr;e.execCommand("mceInsertContent",!1,a)},a=tinymce.util.Tools.resolve("tinymce.util.Tools"),r=function(e){return e.settings.charmap},n=function(e){return e.settings.charmap_append},o=a.isArray,c=function(e){return o(e)?[].concat((t=e,a.grep(t,function(e){return o(e)&&2===e.length}))):"function"==typeof e?e():[];var t},s=function(e){return function(e,t){var a=r(e);a&&(t=c(a));var i=n(e);return i?[].concat(t).concat(c(i)):t}(e,[["160","no-break space"],["173","soft hyphen"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["256","A - macron"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["274","E - macron"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["298","I - macron"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["332","O - macron"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["362","U - macron"],["221","Y - acute"],["376","Y - diaeresis"],["562","Y - macron"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["257","a - macron"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["275","e - macron"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["299","i - macron"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["333","o macron"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["363","u - macron"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["563","y - macron"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"]])},t=function(t){return{getCharMap:function(){return s(t)},insertChar:function(e){l(t,e)}}},u=function(e){var t,a,i,r=Math.min(e.length,25),n=Math.ceil(e.length/r);for(t='',i=0;i",a=0;a
'+s+"
"}else t+="
"}return t+=""},d=function(e){for(;e;){if("TD"===e.nodeName)return e;e=e.parentNode}},m=function(n){var o,e={type:"container",html:u(s(n)),onclick:function(e){var t=e.target;if(/^(TD|DIV)$/.test(t.nodeName)){var a=d(t).firstChild;if(a&&a.hasAttribute("data-chr")){var i=a.getAttribute("data-chr"),r=parseInt(i,10);isNaN(r)||l(n,String.fromCharCode(r)),e.ctrlKey||o.close()}}},onmouseover:function(e){var t=d(e.target);t&&t.firstChild?(o.find("#preview").text(t.firstChild.firstChild.data),o.find("#previewTitle").text(t.title)):(o.find("#preview").text(" "),o.find("#previewTitle").text(" "))}};o=n.windowManager.open({title:"Special character",spacing:10,padding:10,items:[e,{type:"container",layout:"flex",direction:"column",align:"center",spacing:5,minWidth:160,minHeight:160,items:[{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:140,minHeight:80},{type:"spacer",minHeight:20},{type:"label",name:"previewTitle",text:" ",style:"white-space: pre-wrap;",border:1,minWidth:140}]}],buttons:[{text:"Close",onclick:function(){o.close()}}]})},g=function(e){e.addCommand("mceShowCharmap",function(){m(e)})},p=function(e){e.addButton("charmap",{icon:"charmap",tooltip:"Special character",cmd:"mceShowCharmap"}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",cmd:"mceShowCharmap",context:"insert"})};e.add("charmap",function(e){return g(e),p(e),t(e)})}(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/colorpicker/plugin.js b/wp-includes/js/tinymce/plugins/colorpicker/plugin.js index 2f4954f215..63d2dd87b4 100644 --- a/wp-includes/js/tinymce/plugins/colorpicker/plugin.js +++ b/wp-includes/js/tinymce/plugins/colorpicker/plugin.js @@ -1,255 +1,126 @@ (function () { +var colorpicker = (function () { + 'use strict'; -var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)} + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); -// Used when there is no 'main' module. -// The name is probably (hopefully) unique so minification removes for releases. -var register_3795 = function (id) { - var module = dem(id); - var fragments = id.split('.'); - var target = Function('return this;')(); - for (var i = 0; i < fragments.length - 1; ++i) { - if (target[fragments[i]] === undefined) - target[fragments[i]] = {}; - target = target[fragments[i]]; - } - target[fragments[fragments.length - 1]] = module; -}; + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Color'); -var instantiate = function (id) { - var actual = defs[id]; - var dependencies = actual.deps; - var definition = actual.defn; - var len = dependencies.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances[i] = dem(dependencies[i]); - var defResult = definition.apply(null, instances); - if (defResult === undefined) - throw 'module [' + id + '] returned undefined'; - actual.instance = defResult; -}; - -var def = function (id, dependencies, definition) { - if (typeof id !== 'string') - throw 'module id must be a string'; - else if (dependencies === undefined) - throw 'no dependencies for ' + id; - else if (definition === undefined) - throw 'no definition function for ' + id; - defs[id] = { - deps: dependencies, - defn: definition, - instance: undefined + var showPreview = function (win, hexColor) { + win.find('#preview')[0].getEl().style.background = hexColor; }; -}; - -var dem = function (id) { - var actual = defs[id]; - if (actual === undefined) - throw 'module [' + id + '] was undefined'; - else if (actual.instance === undefined) - instantiate(id); - return actual.instance; -}; - -var req = function (ids, callback) { - var len = ids.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances.push(dem(ids[i])); - callback.apply(null, callback); -}; - -var ephox = {}; - -ephox.bolt = { - module: { - api: { - define: def, - require: req, - demand: dem - } - } -}; - -var define = def; -var require = req; -var demand = dem; -// this helps with minificiation when using a lot of global references -var defineGlobal = function (id, ref) { - define(id, [], function () { return ref; }); -}; -/*jsc -["tinymce.plugins.colorpicker.Plugin","tinymce.core.PluginManager","tinymce.core.util.Color","global!tinymce.util.Tools.resolve"] -jsc*/ -defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve); -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.PluginManager', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.PluginManager'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.Color', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.Color'); - } -); - -/** - * 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 - */ - -/** - * This class contains all core logic for the colorpicker plugin. - * - * @class tinymce.colorpicker.Plugin - * @private - */ -define( - 'tinymce.plugins.colorpicker.Plugin', - [ - 'tinymce.core.PluginManager', - 'tinymce.core.util.Color' - ], - function (PluginManager, Color) { - PluginManager.add('colorpicker', function (editor) { - function colorPickerCallback(callback, value) { - function setColor(value) { - var color = new Color(value), rgb = color.toRgb(); - - win.fromJSON({ - r: rgb.r, - g: rgb.g, - b: rgb.b, - hex: color.toHex().substr(1) - }); - - showPreview(color.toHex()); - } - - function showPreview(hexColor) { - win.find('#preview')[0].getEl().style.background = hexColor; - } - - var win = editor.windowManager.open({ - title: 'Color', - items: { - type: 'container', - layout: 'flex', - direction: 'row', - align: 'stretch', - padding: 5, - spacing: 10, + var setColor = function (win, value) { + var color = global$1(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: [ { - 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(this.value()); - } - } + name: 'r', + label: 'R', + autofocus: 1 }, { - 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(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(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 } - ] + name: 'g', + label: 'G' + }, + { + name: 'b', + label: 'B' + }, + { + name: 'hex', + label: '#', + value: '000000' + }, + { + name: 'preview', + type: 'container', + border: 1 } ] - }, - onSubmit: function () { - callback('#' + this.toJSON().hex); } - }); - - setColor(value); - } - - if (!editor.settings.color_picker_callback) { - editor.settings.color_picker_callback = colorPickerCallback; + ] + }, + onSubmit: function () { + callback('#' + win.toJSON().hex); } }); + setColor(win, value); + }; + var $_3y7nz6a1jfuw8osh = { open: open }; - return function () { }; + global.add('colorpicker', function (editor) { + if (!editor.settings.color_picker_callback) { + editor.settings.color_picker_callback = function (callback, value) { + $_3y7nz6a1jfuw8osh.open(editor, callback, value); + }; + } + }); + function Plugin () { } -); -dem('tinymce.plugins.colorpicker.Plugin')(); + + return Plugin; + +}()); })(); diff --git a/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js b/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js index 35bfea2141..10317a5f6f 100644 --- a/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/colorpicker/plugin.min.js @@ -1 +1 @@ -!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i.on"+d+".add(..)"),a.on(d,j,i);var k={original:b,patched:j};return g.push(k),j},this.addToTop=function(a,b){this.add(a,b,!0)},this.remove=function(b){return g.forEach(function(c,e){if(c.original===b)return g.splice(e,1),a.off(d,c.patched)}),a.off(d,b)},void(this.dispatch=function(){return a.fire(d),!0})):void(this.add=this.addToTop=this.remove=this.dispatch=b)}function e(e){function f(b){var c=e.settings.language||"en",d=[c,b].join("."),f=a.i18n.translate(d);return d!==f?f:a.i18n.translate(b)}function g(b,c){a.each(b.split(" "),function(a){e["on"+a]=new d(e,a,c)})}function h(a,b,c){return[b.level,c]}function i(a){return function(b,c){if(!c.selection&&!a||c.selection==a)return[c]}}function j(){function b(){return j()}var d={},e="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";return c("editor.controlManager.*"),a.each(e.split(" "),function(a){d[a]=b}),d}if(!e.controlManager){e.controlManager={buttons:{},setDisabled:function(a,b){c("controlManager.setDisabled(..)"),this.buttons[a]&&this.buttons[a].disabled(b)},setActive:function(a,b){c("controlManager.setActive(..)"),this.buttons[a]&&this.buttons[a].active(b)},onAdd:new d,onPostRender:new d,add:function(a){return a},createButton:j,createColorSplitButton:j,createControl:j,createDropMenu:j,createListBox:j,createMenuButton:j,createSeparator:j,createSplitButton:j,createToolbar:j,createToolbarGroup:j,destroy:b,get:b,setControlType:j},g("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate","editor"),g("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset"),g("BeforeExecCommand ExecCommand","command ui value args"),g("PreProcess PostProcess LoadContent SaveContent Change"),g("BeforeSetContent BeforeGetContent SetContent GetContent",i(!1)),g("SetProgressState","state time"),g("VisualAid","element hasVisual"),g("Undo Redo",h),g("NodeChange",function(a,b){return[e.controlManager,b.element,e.selection.isCollapsed(),b]});var k=e.addButton;e.addButton=function(a,b){function c(){if(e.controlManager.buttons[a]=this,d)return d.apply(this,arguments)}var d;for(var g in b)"onpostrender"===g.toLowerCase()&&(d=b[g],b.onPostRender=c);return d||(b.onPostRender=c),b.title&&(b.title=f(b.title)),k.call(this,a,b)},e.on("init",function(){var a=e.undoManager,b=e.selection;a.onUndo=new d(e,"Undo",h,null,a),a.onRedo=new d(e,"Redo",h,null,a),a.onBeforeAdd=new d(e,"BeforeAddUndo",null,a),a.onAdd=new d(e,"AddUndo",null,a),b.onBeforeGetContent=new d(e,"BeforeGetContent",i(!0),b),b.onGetContent=new d(e,"GetContent",i(!0),b),b.onBeforeSetContent=new d(e,"BeforeSetContent",i(!0),b),b.onSetContent=new d(e,"SetContent",i(!0),b)}),e.on("BeforeRenderUI",function(){var b=e.windowManager;b.onOpen=new d,b.onClose=new d,b.createInstance=function(b,d,e,f,g,h){c("windowManager.createInstance(..)");var i=a.resolve(b);return new i(d,e,f,g,h)}})}}var f;a.util.Dispatcher=d,a.onBeforeUnload=new d(a,"BeforeUnload"),a.onAddEditor=new d(a,"AddEditor","editor"),a.onRemoveEditor=new d(a,"RemoveEditor","editor"),a.util.Cookie={get:b,getHash:b,remove:b,set:b,setHash:b},a.on("SetupEditor",e),a.PluginManager.add("compat3x",e),a.addI18n=function(b,c){var d=a.util.I18n,e=a.each;return"string"==typeof b&&b.indexOf(".")===-1?void d.add(b,c):void(a.is(b,"string")?e(c,function(a,c){d.data[b+"."+c]=a}):e(b,function(a,b){e(a,function(a,c){e(a,function(a,e){"common"===c?d.data[b+"."+e]=a:d.data[b+"."+c+"."+e]=a})})}))}}(tinymce); \ No newline at end of file +!function(u){var t;function l(){}function f(e){!t&&window&&window.console&&(t=!0,console.log("Deprecated TinyMCE API call: "+e))}function i(i,a,d,s){i=i||this;var c=[];a?(this.add=function(o,r,e){function t(e){var t=[];if("string"==typeof d&&(d=d.split(" ")),d&&"function"!=typeof d)for(var n=0;n.on"+a+".add(..)"),i.on(a,t,e);var n={original:o,patched:t};return c.push(n),t},this.addToTop=function(e,t){this.add(e,t,!0)},this.remove=function(n){return c.forEach(function(e,t){if(e.original===n)return c.splice(t,1),i.off(a,e.patched)}),i.off(a,n)},this.dispatch=function(){return i.fire(a),!0}):this.add=this.addToTop=this.remove=this.dispatch=l}function n(s){function e(e,t){u.each(e.split(" "),function(e){s["on"+e]=new i(s,e,t)})}function n(e,t,n){return[t.level,n]}function o(n){return function(e,t){if(!t.selection&&!n||t.selection==n)return[t]}}if(!s.controlManager){s.controlManager={buttons:{},setDisabled:function(e,t){f("controlManager.setDisabled(..)"),this.buttons[e]&&this.buttons[e].disabled(t)},setActive:function(e,t){f("controlManager.setActive(..)"),this.buttons[e]&&this.buttons[e].active(t)},onAdd:new i,onPostRender:new i,add:function(e){return e},createButton:r,createColorSplitButton:r,createControl:r,createDropMenu:r,createListBox:r,createMenuButton:r,createSeparator:r,createSplitButton:r,createToolbar:r,createToolbarGroup:r,destroy:l,get:l,setControlType:r},e("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate","editor"),e("Click MouseUp MouseDown DblClick KeyDown KeyUp KeyPress ContextMenu Paste Submit Reset"),e("BeforeExecCommand ExecCommand","command ui value args"),e("PreProcess PostProcess LoadContent SaveContent Change"),e("BeforeSetContent BeforeGetContent SetContent GetContent",o(!1)),e("SetProgressState","state time"),e("VisualAid","element hasVisual"),e("Undo Redo",n),e("NodeChange",function(e,t){return[s.controlManager,t.element,s.selection.isCollapsed(),t]});var c=s.addButton;s.addButton=function(e,t){var n,o,r,i;function a(){if(s.controlManager.buttons[e]=this,n)return n.apply(this,arguments)}for(var d in t)"onpostrender"===d.toLowerCase()&&(n=t[d],t.onPostRender=a);return n||(t.onPostRender=a),t.title&&(t.title=(o=t.title,r=[s.settings.language||"en",o].join("."),i=u.i18n.translate(r),r!==i?i:u.i18n.translate(o))),c.call(this,e,t)},s.on("init",function(){var e=s.undoManager,t=s.selection;e.onUndo=new i(s,"Undo",n,null,e),e.onRedo=new i(s,"Redo",n,null,e),e.onBeforeAdd=new i(s,"BeforeAddUndo",null,e),e.onAdd=new i(s,"AddUndo",null,e),t.onBeforeGetContent=new i(s,"BeforeGetContent",o(!0),t),t.onGetContent=new i(s,"GetContent",o(!0),t),t.onBeforeSetContent=new i(s,"BeforeSetContent",o(!0),t),t.onSetContent=new i(s,"SetContent",o(!0),t)}),s.on("BeforeRenderUI",function(){var e=s.windowManager;e.onOpen=new i,e.onClose=new i,e.createInstance=function(e,t,n,o,r,i){return f("windowManager.createInstance(..)"),new(u.resolve(e))(t,n,o,r,i)}})}function r(){var t={};function n(){return r()}return f("editor.controlManager.*"),u.each("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".split(" "),function(e){t[e]=n}),t}}u.util.Dispatcher=i,u.onBeforeUnload=new i(u,"BeforeUnload"),u.onAddEditor=new i(u,"AddEditor","editor"),u.onRemoveEditor=new i(u,"RemoveEditor","editor"),u.util.Cookie={get:l,getHash:l,remove:l,set:l,setHash:l},u.on("SetupEditor",function(e){n(e.editor)}),u.PluginManager.add("compat3x",n),u.addI18n=function(n,e){var r=u.util.I18n,t=u.each;"string"!=typeof n||-1!==n.indexOf(".")?u.is(n,"string")?t(e,function(e,t){r.data[n+"."+t]=e}):t(n,function(e,o){t(e,function(e,n){t(e,function(e,t){"common"===n?r.data[o+"."+t]=e:r.data[o+"."+n+"."+t]=e})})}):r.add(n,e)}}(tinymce); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/directionality/plugin.js b/wp-includes/js/tinymce/plugins/directionality/plugin.js index 74b85b5193..73edbfbdbf 100644 --- a/wp-includes/js/tinymce/plugins/directionality/plugin.js +++ b/wp-includes/js/tinymce/plugins/directionality/plugin.js @@ -1,207 +1,66 @@ (function () { +var directionality = (function () { + 'use strict'; -var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)} + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); -// Used when there is no 'main' module. -// The name is probably (hopefully) unique so minification removes for releases. -var register_3795 = function (id) { - var module = dem(id); - var fragments = id.split('.'); - var target = Function('return this;')(); - for (var i = 0; i < fragments.length - 1; ++i) { - if (target[fragments[i]] === undefined) - target[fragments[i]] = {}; - target = target[fragments[i]]; - } - target[fragments[fragments.length - 1]] = module; -}; + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); -var instantiate = function (id) { - var actual = defs[id]; - var dependencies = actual.deps; - var definition = actual.defn; - var len = dependencies.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances[i] = dem(dependencies[i]); - var defResult = definition.apply(null, instances); - if (defResult === undefined) - throw 'module [' + id + '] returned undefined'; - actual.instance = defResult; -}; - -var def = function (id, dependencies, definition) { - if (typeof id !== 'string') - throw 'module id must be a string'; - else if (dependencies === undefined) - throw 'no dependencies for ' + id; - else if (definition === undefined) - throw 'no definition function for ' + id; - defs[id] = { - deps: dependencies, - defn: definition, - instance: undefined - }; -}; - -var dem = function (id) { - var actual = defs[id]; - if (actual === undefined) - throw 'module [' + id + '] was undefined'; - else if (actual.instance === undefined) - instantiate(id); - return actual.instance; -}; - -var req = function (ids, callback) { - var len = ids.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances.push(dem(ids[i])); - callback.apply(null, callback); -}; - -var ephox = {}; - -ephox.bolt = { - module: { - api: { - define: def, - require: req, - demand: dem - } - } -}; - -var define = def; -var require = req; -var demand = dem; -// this helps with minificiation when using a lot of global references -var defineGlobal = function (id, ref) { - define(id, [], function () { return ref; }); -}; -/*jsc -["tinymce.plugins.directionality.Plugin","tinymce.core.PluginManager","tinymce.core.util.Tools","global!tinymce.util.Tools.resolve"] -jsc*/ -defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve); -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.PluginManager', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.PluginManager'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.Tools', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.Tools'); - } -); - -/** - * 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 - */ - -/** - * This class contains all core logic for the directionality plugin. - * - * @class tinymce.directionality.Plugin - * @private - */ -define( - 'tinymce.plugins.directionality.Plugin', - [ - 'tinymce.core.PluginManager', - 'tinymce.core.util.Tools' - ], - function (PluginManager, Tools) { - PluginManager.add('directionality', function (editor) { - function setDir(dir) { - var dom = editor.dom, curDir, blocks = editor.selection.getSelectedBlocks(); - - if (blocks.length) { - curDir = dom.getAttrib(blocks[0], "dir"); - - Tools.each(blocks, function (block) { - // Add dir to block if the parent block doesn't already have that dir - if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) { - if (curDir != dir) { - dom.setAttrib(block, "dir", dir); - } else { - dom.setAttrib(block, "dir", null); - } - } - }); - - editor.nodeChanged(); + 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'); + global$1.each(blocks, function (block) { + if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) { + dom.setAttrib(block, 'dir', curDir !== dir ? dir : null); } - } - - function generateSelector(dir) { - var selector = []; - - Tools.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function (name) { - selector.push(name + '[dir=' + dir + ']'); - }); - - return selector.join(','); - } - - editor.addCommand('mceDirectionLTR', function () { - setDir("ltr"); }); + editor.nodeChanged(); + } + }; + var $_3zbk8naijfuw8otk = { setDir: setDir }; - editor.addCommand('mceDirectionRTL', function () { - setDir("rtl"); - }); - - 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 register = function (editor) { + editor.addCommand('mceDirectionLTR', function () { + $_3zbk8naijfuw8otk.setDir(editor, 'ltr'); }); + editor.addCommand('mceDirectionRTL', function () { + $_3zbk8naijfuw8otk.setDir(editor, 'rtl'); + }); + }; + var $_eltqhvahjfuw8otj = { register: register }; - return function () { }; + var generateSelector = function (dir) { + var selector = []; + global$1.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 $_g7lfqakjfuw8otn = { register: register$1 }; + + global.add('directionality', function (editor) { + $_eltqhvahjfuw8otj.register(editor); + $_g7lfqakjfuw8otn.register(editor); + }); + function Plugin () { } -); -dem('tinymce.plugins.directionality.Plugin')(); + + return Plugin; + +}()); })(); diff --git a/wp-includes/js/tinymce/plugins/directionality/plugin.min.js b/wp-includes/js/tinymce/plugins/directionality/plugin.min.js index 226c641aa9..bb48bcf941 100644 --- a/wp-includes/js/tinymce/plugins/directionality/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/directionality/plugin.min.js @@ -1 +1 @@ -!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i {dependencies, definition, instance (possibly undefined)} - -// Used when there is no 'main' module. -// The name is probably (hopefully) unique so minification removes for releases. -var register_3795 = function (id) { - var module = dem(id); - var fragments = id.split('.'); - var target = Function('return this;')(); - for (var i = 0; i < fragments.length - 1; ++i) { - if (target[fragments[i]] === undefined) - target[fragments[i]] = {}; - target = target[fragments[i]]; - } - target[fragments[fragments.length - 1]] = module; -}; - -var instantiate = function (id) { - var actual = defs[id]; - var dependencies = actual.deps; - var definition = actual.defn; - var len = dependencies.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances[i] = dem(dependencies[i]); - var defResult = definition.apply(null, instances); - if (defResult === undefined) - throw 'module [' + id + '] returned undefined'; - actual.instance = defResult; -}; - -var def = function (id, dependencies, definition) { - if (typeof id !== 'string') - throw 'module id must be a string'; - else if (dependencies === undefined) - throw 'no dependencies for ' + id; - else if (definition === undefined) - throw 'no definition function for ' + id; - defs[id] = { - deps: dependencies, - defn: definition, - instance: undefined + 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 dem = function (id) { - var actual = defs[id]; - if (actual === undefined) - throw 'module [' + id + '] was undefined'; - else if (actual.instance === undefined) - instantiate(id); - return actual.instance; -}; + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); -var req = function (ids, callback) { - var len = ids.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances.push(dem(ids[i])); - callback.apply(null, callback); -}; + var get = function (fullscreenState) { + return { + isFullscreen: function () { + return fullscreenState.get() !== null; + } + }; + }; + var $_2d5qbdbsjfuw8ozh = { get: get }; -var ephox = {}; + var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); -ephox.bolt = { - module: { - api: { - define: def, - require: req, - demand: dem + var fireFullscreenStateChanged = function (editor, state) { + editor.fire('FullscreenStateChanged', { state: state }); + }; + var $_6m5hhtbwjfuw8ozm = { fireFullscreenStateChanged: fireFullscreenStateChanged }; + + var DOM = global$1.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; } - } -}; - -var define = def; -var require = req; -var demand = dem; -// this helps with minificiation when using a lot of global references -var defineGlobal = function (id, ref) { - define(id, [], function () { return ref; }); -}; -/*jsc -["tinymce.plugins.fullscreen.Plugin","tinymce.core.dom.DOMUtils","tinymce.core.PluginManager","global!tinymce.util.Tools.resolve"] -jsc*/ -defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve); -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.dom.DOMUtils', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.dom.DOMUtils'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.PluginManager', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.PluginManager'); - } -); - -/** - * 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 - */ - -/** - * This class contains all core logic for the fullscreen plugin. - * - * @class tinymce.fullscreen.Plugin - * @private - */ -define( - 'tinymce.plugins.fullscreen.Plugin', - [ - 'tinymce.core.dom.DOMUtils', - 'tinymce.core.PluginManager' - ], - function (DOMUtils, PluginManager) { - var DOM = DOMUtils.DOM; - - PluginManager.add('fullscreen', function (editor) { - var fullscreenState = false, iframeWidth, iframeHeight, resizeHandler; - var containerWidth, containerHeight, scrollPos; - - if (editor.settings.inline) { - return; - } - - function getWindowSize() { - var w, h, win = window, doc = document; - var body = doc.body; - - // Old IE - if (body.offsetWidth) { - w = body.offsetWidth; - h = body.offsetHeight; - } - - // Modern browsers - if (win.innerWidth && win.innerHeight) { - w = win.innerWidth; - h = win.innerHeight; - } - - return { w: w, h: h }; - } - - function getScrollPos() { - var vp = DOM.getViewPort(); - - return { - x: vp.x, - y: vp.y - }; - } - - function setScrollPos(pos) { - window.scrollTo(pos.x, pos.y); - } - - function toggleFullscreen() { - var body = document.body, documentElement = document.documentElement, editorContainerStyle; - var editorContainer, iframe, iframeStyle; - - function resize() { - DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight)); - } - - fullscreenState = !fullscreenState; - - editorContainer = editor.getContainer(); - editorContainerStyle = editorContainer.style; - iframe = editor.getContentAreaContainer().firstChild; - iframeStyle = iframe.style; - - if (fullscreenState) { - scrollPos = getScrollPos(); - iframeWidth = iframeStyle.width; - iframeHeight = iframeStyle.height; - iframeStyle.width = iframeStyle.height = '100%'; - containerWidth = editorContainerStyle.width; - containerHeight = editorContainerStyle.height; - editorContainerStyle.width = editorContainerStyle.height = ''; - - DOM.addClass(body, 'mce-fullscreen'); - DOM.addClass(documentElement, 'mce-fullscreen'); - DOM.addClass(editorContainer, 'mce-fullscreen'); - - DOM.bind(window, 'resize', resize); - resize(); - resizeHandler = resize; - } else { - iframeStyle.width = iframeWidth; - iframeStyle.height = iframeHeight; - - if (containerWidth) { - editorContainerStyle.width = containerWidth; - } - - if (containerHeight) { - editorContainerStyle.height = containerHeight; - } - - DOM.removeClass(body, 'mce-fullscreen'); - DOM.removeClass(documentElement, 'mce-fullscreen'); - DOM.removeClass(editorContainer, 'mce-fullscreen'); - DOM.unbind(window, 'resize', resizeHandler); - setScrollPos(scrollPos); - } - - editor.fire('FullscreenStateChanged', { state: fullscreenState }); - } - - editor.on('init', function () { - editor.addShortcut('Ctrl+Shift+F', '', toggleFullscreen); - }); - - editor.on('remove', function () { - if (resizeHandler) { - DOM.unbind(window, 'resize', resizeHandler); - } - }); - - editor.addCommand('mceFullScreen', toggleFullscreen); - - editor.addMenuItem('fullscreen', { - text: 'Fullscreen', - shortcut: 'Ctrl+Shift+F', - selectable: true, - onClick: function () { - toggleFullscreen(); - editor.focus(); - }, - onPostRender: function () { - var self = this; - - editor.on('FullscreenStateChanged', function (e) { - self.active(e.state); - }); - }, - context: 'view' - }); - - editor.addButton('fullscreen', { - tooltip: 'Fullscreen', - shortcut: 'Ctrl+Shift+F', - onClick: toggleFullscreen, - onPostRender: function () { - var self = this; - - editor.on('FullscreenStateChanged', function (e) { - self.active(e.state); - }); - } - }); - - return { - isFullscreen: function () { - return fullscreenState; - } + 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); + $_6m5hhtbwjfuw8ozm.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); + $_6m5hhtbwjfuw8ozm.fireFullscreenStateChanged(editor, false); + } + }; + var $_e74zxhbujfuw8ozj = { toggleFullscreen: toggleFullscreen }; - return function () { }; + var register = function (editor, fullscreenState) { + editor.addCommand('mceFullScreen', function () { + $_e74zxhbujfuw8ozj.toggleFullscreen(editor, fullscreenState); + }); + }; + var $_j53v2btjfuw8ozi = { 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 $_3ge8trbxjfuw8ozn = { register: register$1 }; + + global.add('fullscreen', function (editor) { + var fullscreenState = Cell(null); + if (editor.settings.inline) { + return $_2d5qbdbsjfuw8ozh.get(fullscreenState); + } + $_j53v2btjfuw8ozi.register(editor, fullscreenState); + $_3ge8trbxjfuw8ozn.register(editor); + editor.addShortcut('Ctrl+Shift+F', '', 'mceFullScreen'); + return $_2d5qbdbsjfuw8ozh.get(fullscreenState); + }); + function Plugin () { } -); -dem('tinymce.plugins.fullscreen.Plugin')(); + + return Plugin; + +}()); })(); diff --git a/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js b/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js index 3db2176572..cd4eb5ed47 100644 --- a/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/fullscreen/plugin.min.js @@ -1 +1 @@ -!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i {dependencies, definition, instance (possibly undefined)} + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); -// Used when there is no 'main' module. -// The name is probably (hopefully) unique so minification removes for releases. -var register_3795 = function (id) { - var module = dem(id); - var fragments = id.split('.'); - var target = Function('return this;')(); - for (var i = 0; i < fragments.length - 1; ++i) { - if (target[fragments[i]] === undefined) - target[fragments[i]] = {}; - target = target[fragments[i]]; - } - target[fragments[fragments.length - 1]] = module; -}; - -var instantiate = function (id) { - var actual = defs[id]; - var dependencies = actual.deps; - var definition = actual.defn; - var len = dependencies.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances[i] = dem(dependencies[i]); - var defResult = definition.apply(null, instances); - if (defResult === undefined) - throw 'module [' + id + '] returned undefined'; - actual.instance = defResult; -}; - -var def = function (id, dependencies, definition) { - if (typeof id !== 'string') - throw 'module id must be a string'; - else if (dependencies === undefined) - throw 'no dependencies for ' + id; - else if (definition === undefined) - throw 'no definition function for ' + id; - defs[id] = { - deps: dependencies, - defn: definition, - instance: undefined - }; -}; - -var dem = function (id) { - var actual = defs[id]; - if (actual === undefined) - throw 'module [' + id + '] was undefined'; - else if (actual.instance === undefined) - instantiate(id); - return actual.instance; -}; - -var req = function (ids, callback) { - var len = ids.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances.push(dem(ids[i])); - callback.apply(null, callback); -}; - -var ephox = {}; - -ephox.bolt = { - module: { - api: { - define: def, - require: req, - demand: dem - } - } -}; - -var define = def; -var require = req; -var demand = dem; -// this helps with minificiation when using a lot of global references -var defineGlobal = function (id, ref) { - define(id, [], function () { return ref; }); -}; -/*jsc -["tinymce.plugins.hr.Plugin","tinymce.core.PluginManager","global!tinymce.util.Tools.resolve"] -jsc*/ -defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve); -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.PluginManager', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.PluginManager'); - } -); - -/** - * 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 - */ - -/** - * This class contains all core logic for the hr plugin. - * - * @class tinymce.hr.Plugin - * @private - */ -define( - 'tinymce.plugins.hr.Plugin', - [ - 'tinymce.core.PluginManager' - ], - function (PluginManager) { - PluginManager.add('hr', function (editor) { - editor.addCommand('InsertHorizontalRule', function () { - editor.execCommand('mceInsertContent', false, '
'); - }); - - editor.addButton('hr', { - icon: 'hr', - tooltip: 'Horizontal line', - cmd: 'InsertHorizontalRule' - }); - - editor.addMenuItem('hr', { - icon: 'hr', - text: 'Horizontal line', - cmd: 'InsertHorizontalRule', - context: 'insert' - }); + var register = function (editor) { + editor.addCommand('InsertHorizontalRule', function () { + editor.execCommand('mceInsertContent', false, '
'); }); + }; + var $_598wgdc0jfuw8p00 = { register: register }; - return function () { }; + 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 $_7oq7jyc1jfuw8p02 = { register: register$1 }; + + global.add('hr', function (editor) { + $_598wgdc0jfuw8p00.register(editor); + $_7oq7jyc1jfuw8p02.register(editor); + }); + function Plugin () { } -); -dem('tinymce.plugins.hr.Plugin')(); + + return Plugin; + +}()); })(); diff --git a/wp-includes/js/tinymce/plugins/hr/plugin.min.js b/wp-includes/js/tinymce/plugins/hr/plugin.min.js index 6c0dfa4478..72bc2cabd1 100644 --- a/wp-includes/js/tinymce/plugins/hr/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/hr/plugin.min.js @@ -1 +1 @@ -!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i")}),a.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),a.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})}),function(){}}),d("0")()}(); \ No newline at end of file +!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"
")})},o=function(n){n.addButton("hr",{icon:"hr",tooltip:"Horizontal line",cmd:"InsertHorizontalRule"}),n.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",context:"insert"})};n.add("hr",function(n){t(n),o(n)})}(); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/image/plugin.js b/wp-includes/js/tinymce/plugins/image/plugin.js index 3395ec69b7..9fe18bb996 100644 --- a/wp-includes/js/tinymce/plugins/image/plugin.js +++ b/wp-includes/js/tinymce/plugins/image/plugin.js @@ -1,1159 +1,1337 @@ (function () { +var image = (function () { + 'use strict'; -var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)} + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); -// Used when there is no 'main' module. -// The name is probably (hopefully) unique so minification removes for releases. -var register_3795 = function (id) { - var module = dem(id); - var fragments = id.split('.'); - var target = Function('return this;')(); - for (var i = 0; i < fragments.length - 1; ++i) { - if (target[fragments[i]] === undefined) - target[fragments[i]] = {}; - target = target[fragments[i]]; - } - target[fragments[fragments.length - 1]] = module; -}; - -var instantiate = function (id) { - var actual = defs[id]; - var dependencies = actual.deps; - var definition = actual.defn; - var len = dependencies.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances[i] = dem(dependencies[i]); - var defResult = definition.apply(null, instances); - if (defResult === undefined) - throw 'module [' + id + '] returned undefined'; - actual.instance = defResult; -}; - -var def = function (id, dependencies, definition) { - if (typeof id !== 'string') - throw 'module id must be a string'; - else if (dependencies === undefined) - throw 'no dependencies for ' + id; - else if (definition === undefined) - throw 'no definition function for ' + id; - defs[id] = { - deps: dependencies, - defn: definition, - instance: undefined + 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 $_9cq6y3c6jfuw8p0n = { + 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 dem = function (id) { - var actual = defs[id]; - if (actual === undefined) - throw 'module [' + id + '] was undefined'; - else if (actual.instance === undefined) - instantiate(id); - return actual.instance; -}; + var global$1 = typeof window !== 'undefined' ? window : Function('return this;')(); -var req = function (ids, callback) { - var len = ids.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances.push(dem(ids[i])); - callback.apply(null, callback); -}; + var path = function (parts, scope) { + var o = scope !== undefined && scope !== null ? scope : global$1; + 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$1; + 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 $_5mb36jcajfuw8p19 = { + path: path, + resolve: resolve, + forge: forge, + namespace: namespace + }; -var ephox = {}; + var unsafe = function (name, scope) { + return $_5mb36jcajfuw8p19.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 $_ba69mec9jfuw8p15 = { getOrDie: getOrDie }; -ephox.bolt = { - module: { - api: { - define: def, - require: req, - demand: dem + function FileReader () { + var f = $_ba69mec9jfuw8p15.getOrDie('FileReader'); + return new f(); + } + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$4 = 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 + }); } - } -}; - -var define = def; -var require = req; -var demand = dem; -// this helps with minificiation when using a lot of global references -var defineGlobal = function (id, ref) { - define(id, [], function () { return ref; }); -}; -/*jsc -["tinymce.plugins.image.Plugin","tinymce.core.PluginManager","tinymce.core.util.Tools","tinymce.plugins.image.ui.Dialog","global!tinymce.util.Tools.resolve","global!document","global!Math","global!RegExp","tinymce.core.Env","tinymce.core.ui.Factory","tinymce.core.util.JSON","tinymce.core.util.XHR","tinymce.plugins.image.core.Uploader","tinymce.plugins.image.core.Utils","tinymce.core.util.Promise"] -jsc*/ -defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve); -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.PluginManager', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.PluginManager'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.Tools', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.Tools'); - } -); - -defineGlobal("global!document", document); -defineGlobal("global!Math", Math); -defineGlobal("global!RegExp", RegExp); -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.Env', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.Env'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.ui.Factory', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.ui.Factory'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.JSON', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.JSON'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.XHR', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.XHR'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.Promise', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.Promise'); - } -); - -/** - * Uploader.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 - */ - -/** - * This is basically cut down version of tinymce.core.file.Uploader, which we could use directly - * if it wasn't marked as private. - * - * @class tinymce.image.core.Uploader - * @private - */ -define( - 'tinymce.plugins.image.core.Uploader', - [ - 'tinymce.core.util.Promise', - 'tinymce.core.util.Tools', - 'global!document' - ], - function (Promise, Tools, document) { - return function (settings) { - var noop = function () {}; - - function pathJoin(path1, path2) { - if (path1) { - return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, ''); + 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 || []; + global$3.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); } - - return path2; + 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]; } - - function defaultHandler(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); + delete css.margin; + } + return css; + }; + var createImageList = function (editor, callback) { + var imageList = $_9cq6y3c6jfuw8p0n.getImageList(editor); + if (typeof imageList === 'string') { + global$4.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(); } - - function uploadBlob(blobInfo, handler) { - return new Promise(function (resolve, reject) { - try { - handler(blobInfo, resolve, reject, noop); - } catch (ex) { - reject(ex.message); - } + } + imgElm.onload = function () { + if (!data.width && !data.height && $_9cq6y3c6jfuw8p0n.hasDimensions(editor)) { + editor.dom.setAttribs(imgElm, { + width: imgElm.clientWidth, + height: imgElm.clientHeight }); } - - function isDefaultHandler(handler) { - return handler === defaultHandler; - } - - function upload(blobInfo) { - return (!settings.url && isDefaultHandler(settings.handler)) ? Promise.reject("Upload url missng from the settings.") : uploadBlob(blobInfo, settings.handler); - } - - settings = Tools.extend({ - credentials: false, - handler: defaultHandler - }, settings); - - return { - upload: upload + selectImage(); + }; + imgElm.onerror = selectImage; + }; + var blobToDataUri = function (blob) { + return new global$2(function (resolve, reject) { + var reader = new FileReader(); + reader.onload = function () { + resolve(reader.result); }; - }; - } -); -/** - * Utils.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 - */ - -/** - * @class tinymce.image.core.Utils - * @private - */ -define( - 'tinymce.plugins.image.core.Utils', - [ - 'tinymce.core.util.Tools', - 'global!Math', - 'global!document' - ], - function (Tools, Math, document) { - - 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 () { - done(Math.max(img.width, img.clientWidth), Math.max(img.height, img.clientHeight)); + reader.onerror = function () { + reject(FileReader.error.message); }; - - img.onerror = function () { - done(); - }; - - var style = img.style; - style.visibility = 'hidden'; - style.position = 'fixed'; - style.bottom = style.left = 0; - 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: //margin: toprightbottomleft; - 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: //margin: topbottom rightleft; - 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: //margin: top rightleft bottom; - 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: //margin: top right bottom left; - 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; - }; - - return { - getImageSize: getImageSize, - buildListItems: buildListItems, - removePixelSuffix: removePixelSuffix, - addPixelSuffix: addPixelSuffix, - mergeMargins: mergeMargins - }; - } -); - -/** - * Dialog.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 - */ - -/** - * @class tinymce.image.ui.Dialog - * @private - */ -define( - 'tinymce.plugins.image.ui.Dialog', - [ - 'global!document', - 'global!Math', - 'global!RegExp', - 'tinymce.core.Env', - 'tinymce.core.ui.Factory', - 'tinymce.core.util.JSON', - 'tinymce.core.util.Tools', - 'tinymce.core.util.XHR', - 'tinymce.plugins.image.core.Uploader', - 'tinymce.plugins.image.core.Utils' - ], - function (document, Math, RegExp, Env, Factory, JSON, Tools, XHR, Uploader, Utils) { - - return function (editor) { - function createImageList(callback) { - var imageList = editor.settings.image_list; - - 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); - } - } - - function showDialog(imageList) { - var win, data = {}, imgElm, figureElm, dom = editor.dom, settings = editor.settings; - var width, height, imageListCtrl, classListCtrl, imageDimensions = settings.image_dimensions !== false; - - - function onFileInput() { - var Throbber = Factory.get('Throbber'); - var throbber = new Throbber(win.getEl()); - var file = this.value(); - - var uploader = new Uploader({ - url: settings.images_upload_url, - basePath: settings.images_upload_base_path, - credentials: settings.images_upload_credentials, - handler: settings.images_upload_handler - }); - - // we do not need to add this to editors blobCache, so we fake bare minimum - var blobInfo = editor.editorUpload.blobCache.create({ - blob: file, - name: file.name ? file.name.replace(/\.[^\.]+$/, '') : null, // strip extension - base64: 'data:image/fake;base64,=' // without this create() will throw exception - }); - - var finalize = function () { - throbber.hide(); - URL.revokeObjectURL(blobInfo.blobUri()); // in theory we could fake blobUri too, but until it's legitimate, we have too revoke it manually - }; - - throbber.show(); - - return uploader.upload(blobInfo).then(function (url) { - var src = win.find('#src'); - src.value(url); - win.find('tabpanel')[0].activateTab(0); // switch to General tab - src.fire('change'); // this will invoke onSrcChange (and any other handlers, if any). - finalize(); - return url; - }, function (err) { - editor.windowManager.alert(err); - finalize(); - }); - } - - function isTextBlock(node) { - return editor.schema.getTextBlockElements()[node.nodeName]; - } - - function recalcSize() { - var widthCtrl, heightCtrl, newWidth, newHeight; - - widthCtrl = win.find('#width')[0]; - heightCtrl = win.find('#height')[0]; - - if (!widthCtrl || !heightCtrl) { - return; - } - - newWidth = widthCtrl.value(); - newHeight = heightCtrl.value(); - - if (win.find('#constrain')[0].checked() && width && height && newWidth && newHeight) { - if (width != newWidth) { - newHeight = Math.round((newWidth / width) * newHeight); - - if (!isNaN(newHeight)) { - heightCtrl.value(newHeight); - } - } else { - newWidth = Math.round((newHeight / height) * newWidth); - - if (!isNaN(newWidth)) { - widthCtrl.value(newWidth); - } - } - } - - width = newWidth; - height = newHeight; - } - - function updateStyle() { - if (!editor.settings.image_advtab) { - return; - } - - var data = win.toJSON(), - css = dom.parseStyle(data.style); - - css = Utils.mergeMargins(css); - - if (data.vspace) { - css['margin-top'] = css['margin-bottom'] = Utils.addPixelSuffix(data.vspace); - } - if (data.hspace) { - css['margin-left'] = css['margin-right'] = Utils.addPixelSuffix(data.hspace); - } - if (data.border) { - css['border-width'] = Utils.addPixelSuffix(data.border); - } - - win.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css)))); - } - - function updateVSpaceHSpaceBorder() { - if (!editor.settings.image_advtab) { - return; - } - - var data = win.toJSON(), - css = dom.parseStyle(data.style); - - win.find('#vspace').value(""); - win.find('#hspace').value(""); - - css = Utils.mergeMargins(css); - - //Move opposite equal margins to vspace/hspace field - if ((css['margin-top'] && css['margin-bottom']) || (css['margin-right'] && css['margin-left'])) { - if (css['margin-top'] === css['margin-bottom']) { - win.find('#vspace').value(Utils.removePixelSuffix(css['margin-top'])); - } else { - win.find('#vspace').value(''); - } - if (css['margin-right'] === css['margin-left']) { - win.find('#hspace').value(Utils.removePixelSuffix(css['margin-right'])); - } else { - win.find('#hspace').value(''); - } - } - - //Move border-width - if (css['border-width']) { - win.find('#border').value(Utils.removePixelSuffix(css['border-width'])); - } - - win.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css)))); - } - - function waitLoad(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 && imageDimensions) { - dom.setAttribs(imgElm, { - width: imgElm.clientWidth, - height: imgElm.clientHeight - }); - } - - selectImage(); - }; - - imgElm.onerror = selectImage; - } - - function onSubmitForm() { - var figureElm, oldImg; - - updateStyle(); - recalcSize(); - - 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; - } - - // Setup new data excluding style properties - /*eslint dot-notation: 0*/ - 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.setAttrib(imgElm, 'contenteditable', null); - dom.insertAfter(imgElm, figureElm); - dom.remove(figureElm); - editor.selection.select(imgElm); - editor.nodeChanged(); - } - } - - if (data.caption === true) { - if (!dom.is(imgElm.parentNode, 'figure.image')) { - oldImg = imgElm; - imgElm = imgElm.cloneNode(true); - imgElm.contentEditable = 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, isTextBlock); - if (textBlock) { - dom.split(textBlock, oldImg, figureElm); - } else { - dom.replace(figureElm, oldImg); - } - - editor.selection.select(figureElm); - } - - return; - } - - waitLoad(imgElm); - }); - } - - function onSrcChange(e) { - var srcURL, prependURL, absoluteURLPattern, meta = e.meta || {}; - - if (imageListCtrl) { - imageListCtrl.value(editor.convertURL(this.value(), 'src')); - } - - Tools.each(meta, function (value, key) { - win.find('#' + key).value(value); - }); - - if (!meta.width && !meta.height) { - srcURL = editor.convertURL(this.value(), 'src'); - - // Pattern test the src url and make sure we haven't already prepended the url - prependURL = editor.settings.image_prepend_url; - absoluteURLPattern = new RegExp('^(?:[a-z]+:)?//', 'i'); - if (prependURL && !absoluteURLPattern.test(srcURL) && srcURL.substring(0, prependURL.length) !== prependURL) { - srcURL = prependURL + srcURL; - } - - this.value(srcURL); - - Utils.getImageSize(editor.documentBaseURI.toAbsolute(this.value()), function (data) { - if (data.width && data.height && imageDimensions) { - width = data.width; - height = data.height; - - win.find('#width').value(width); - win.find('#height').value(height); - } - }); - } - } - - function onBeforeCall(e) { - e.meta = win.toJSON(); - } - - 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) { - width = dom.getAttrib(imgElm, 'width'); - height = dom.getAttrib(imgElm, 'height'); - - data = { - src: dom.getAttrib(imgElm, 'src'), - alt: dom.getAttrib(imgElm, 'alt'), - title: dom.getAttrib(imgElm, 'title'), - "class": dom.getAttrib(imgElm, 'class'), - width: width, - height: height, - caption: !!figureElm - }; - } - - if (imageList) { - imageListCtrl = { - type: 'listbox', - label: 'Image list', - values: Utils.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 () { - /*eslint consistent-this: 0*/ - imageListCtrl = this; - } - }; - } - - if (editor.settings.image_class_list) { - classListCtrl = { - name: 'class', - type: 'listbox', - label: 'Class', - values: Utils.buildListItems( - editor.settings.image_class_list, - function (item) { - if (item.value) { - item.textStyle = function () { - return editor.formatter.getCssText({ inline: 'img', classes: [item.value] }); - }; - } - } - ) - }; - } - - // General settings shared between simple and advanced dialogs - var generalFormItems = [ - { - name: 'src', - type: 'filepicker', - filetype: 'image', - label: 'Source', - autofocus: true, - onchange: onSrcChange, - onbeforecall: onBeforeCall - }, - imageListCtrl - ]; - - if (editor.settings.image_description !== false) { - generalFormItems.push({ name: 'alt', type: 'textbox', label: 'Image description' }); - } - - if (editor.settings.image_title) { - generalFormItems.push({ name: 'title', type: 'textbox', label: 'Image Title' }); - } - - if (imageDimensions) { - generalFormItems.push({ - type: 'container', - label: 'Dimensions', - layout: 'flex', - direction: 'row', - align: 'center', - spacing: 5, - items: [ - { name: 'width', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Width' }, - { type: 'label', text: 'x' }, - { name: 'height', type: 'textbox', maxLength: 5, size: 3, onchange: recalcSize, ariaLabel: 'Height' }, - { name: 'constrain', type: 'checkbox', checked: true, text: 'Constrain proportions' } - ] - }); - } - - generalFormItems.push(classListCtrl); - - if (editor.settings.image_caption && Env.ceFalse) { - generalFormItems.push({ name: 'caption', type: 'checkbox', label: 'Caption' }); - } - - if (editor.settings.image_advtab || editor.settings.images_upload_url) { - var body = [ - { - title: 'General', - type: 'form', - items: generalFormItems - } - ]; - - if (editor.settings.image_advtab) { - // Parse styles from img - if (imgElm) { - if (imgElm.style.marginLeft && imgElm.style.marginRight && imgElm.style.marginLeft === imgElm.style.marginRight) { - data.hspace = Utils.removePixelSuffix(imgElm.style.marginLeft); - } - if (imgElm.style.marginTop && imgElm.style.marginBottom && imgElm.style.marginTop === imgElm.style.marginBottom) { - data.vspace = Utils.removePixelSuffix(imgElm.style.marginTop); - } - if (imgElm.style.borderWidth) { - data.border = Utils.removePixelSuffix(imgElm.style.borderWidth); - } - - data.style = editor.dom.serializeStyle(editor.dom.parseStyle(editor.dom.getAttrib(imgElm, 'style'))); - } - - body.push({ - title: 'Advanced', - type: 'form', - pack: 'start', - items: [ - { - label: 'Style', - name: 'style', - type: 'textbox', - onchange: updateVSpaceHSpaceBorder - }, - { - type: 'form', - layout: 'grid', - packV: 'start', - columns: 2, - padding: 0, - alignH: ['left', 'right'], - defaults: { - type: 'textbox', - maxWidth: 50, - onchange: updateStyle - }, - items: [ - { label: 'Vertical space', name: 'vspace' }, - { label: 'Horizontal space', name: 'hspace' }, - { label: 'Border', name: 'border' } - ] - } - ] - }); - } - - if (editor.settings.images_upload_url) { - var acceptExts = '.jpg,.jpeg,.png,.gif'; - - var uploadTab = { - 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 - }, - { - text: 'OR', - type: 'label' - } - ] - }, - { - text: "Drop an image here", - type: 'dropzone', - accept: acceptExts, - height: 100, - onchange: onFileInput - } - ] - }; - - body.push(uploadTab); - } - - // Advanced dialog shows general+advanced tabs - win = editor.windowManager.open({ - title: 'Insert/edit image', - data: data, - bodyType: 'tabpanel', - body: body, - onSubmit: onSubmitForm - }); - } else { - // Simple default dialog - win = editor.windowManager.open({ - title: 'Insert/edit image', - data: data, - body: generalFormItems, - onSubmit: onSubmitForm - }); - } - } - - function open() { - createImageList(showDialog); - } - - return { - open: open - }; - }; - } -); - -/** - * 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 - */ - -/** - * This class contains all core logic for the image plugin. - * - * @class tinymce.image.Plugin - * @private - */ -define( - 'tinymce.plugins.image.Plugin', - [ - 'tinymce.core.PluginManager', - 'tinymce.core.util.Tools', - 'tinymce.plugins.image.ui.Dialog' - ], - function (PluginManager, Tools, Dialog) { - PluginManager.add('image', function (editor) { - - editor.on('preInit', function () { - function hasImageClass(node) { - var className = node.attr('class'); - return className && /\bimage\b/.test(className); - } - - function toggleContentEditableState(state) { - return function (nodes) { - var i = nodes.length, node; - - function toggleContentEditable(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); - Tools.each(node.getAll('img'), toggleContentEditable); - } - } - }; - } - - editor.parser.addNodeFilter('figure', toggleContentEditableState(true)); - editor.serializer.addNodeFilter('figure', toggleContentEditableState(false)); - }); - - 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 - }); - - editor.addCommand('mceImage', Dialog(editor).open); + reader.readAsDataURL(blob); }); + }; + var $_7v7yldc7jfuw8p0q = { + getImageSize: getImageSize, + buildListItems: buildListItems, + removePixelSuffix: removePixelSuffix, + addPixelSuffix: addPixelSuffix, + mergeMargins: mergeMargins, + createImageList: createImageList, + waitLoadImage: waitLoadImage, + blobToDataUri: blobToDataUri + }; - return function () { }; + var global$5 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var typeOf = function (x) { + if (x === null) + return 'null'; + var t = typeof x; + if (t === 'object' && Array.prototype.isPrototypeOf(x)) + return 'array'; + if (t === 'object' && String.prototype.isPrototypeOf(x)) + return 'string'; + return t; + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var $_rbqovckjfuw8p27 = { + isString: isType('string'), + isObject: isType('object'), + isArray: isType('array'), + isNull: isType('null'), + isBoolean: isType('boolean'), + isUndefined: isType('undefined'), + isFunction: isType('function'), + isNumber: isType('number') + }; + + var shallow = function (old, nu) { + return nu; + }; + var deep = function (old, nu) { + var bothObjects = $_rbqovckjfuw8p27.isObject(old) && $_rbqovckjfuw8p27.isObject(nu); + return bothObjects ? deepMerge(old, nu) : nu; + }; + var baseMerge = function (merger) { + return function () { + var objects = new Array(arguments.length); + for (var i = 0; i < objects.length; i++) + objects[i] = arguments[i]; + if (objects.length === 0) + throw new Error('Can\'t merge zero objects'); + var ret = {}; + for (var j = 0; j < objects.length; j++) { + var curObject = objects[j]; + for (var key in curObject) + if (curObject.hasOwnProperty(key)) { + ret[key] = merger(ret[key], curObject[key]); + } + } + return ret; + }; + }; + var deepMerge = baseMerge(deep); + var merge = baseMerge(shallow); + var $_ajpvnqcjjfuw8p25 = { + deepMerge: deepMerge, + merge: merge + }; + + var DOM = global$5.DOM; + var getHspace = function (image) { + if (image.style.marginLeft && image.style.marginRight && image.style.marginLeft === image.style.marginRight) { + return $_7v7yldc7jfuw8p0q.removePixelSuffix(image.style.marginLeft); + } else { + return ''; + } + }; + var getVspace = function (image) { + if (image.style.marginTop && image.style.marginBottom && image.style.marginTop === image.style.marginBottom) { + return $_7v7yldc7jfuw8p0q.removePixelSuffix(image.style.marginTop); + } else { + return ''; + } + }; + var getBorder = function (image) { + if (image.style.borderWidth) { + return $_7v7yldc7jfuw8p0q.removePixelSuffix(image.style.borderWidth); + } else { + return ''; + } + }; + var getAttrib = function (image, name) { + if (image.hasAttribute(name)) { + return image.getAttribute(name); + } else { + return ''; + } + }; + var getStyle = function (image, name) { + return image.style[name] ? image.style[name] : ''; + }; + var hasCaption = function (image) { + return image.parentNode !== null && image.parentNode.nodeName === 'FIGURE'; + }; + var setAttrib = function (image, name, value) { + image.setAttribute(name, value); + }; + var wrapInFigure = function (image) { + var figureElm = DOM.create('figure', { class: 'image' }); + DOM.insertAfter(figureElm, image); + figureElm.appendChild(image); + figureElm.appendChild(DOM.create('figcaption', { contentEditable: true }, 'Caption')); + figureElm.contentEditable = 'false'; + }; + var removeFigure = function (image) { + var figureElm = image.parentNode; + DOM.insertAfter(image, figureElm); + DOM.remove(figureElm); + }; + var toggleCaption = function (image) { + if (hasCaption(image)) { + removeFigure(image); + } else { + wrapInFigure(image); + } + }; + var normalizeStyle = function (image, normalizeCss) { + var attrValue = image.getAttribute('style'); + var value = normalizeCss(attrValue !== null ? attrValue : ''); + if (value.length > 0) { + image.setAttribute('style', value); + image.setAttribute('data-mce-style', value); + } else { + image.removeAttribute('style'); + } + }; + var setSize = function (name, normalizeCss) { + return function (image, name, value) { + if (image.style[name]) { + image.style[name] = $_7v7yldc7jfuw8p0q.addPixelSuffix(value); + normalizeStyle(image, normalizeCss); + } else { + setAttrib(image, name, value); + } + }; + }; + var getSize = function (image, name) { + if (image.style[name]) { + return $_7v7yldc7jfuw8p0q.removePixelSuffix(image.style[name]); + } else { + return getAttrib(image, name); + } + }; + var setHspace = function (image, value) { + var pxValue = $_7v7yldc7jfuw8p0q.addPixelSuffix(value); + image.style.marginLeft = pxValue; + image.style.marginRight = pxValue; + }; + var setVspace = function (image, value) { + var pxValue = $_7v7yldc7jfuw8p0q.addPixelSuffix(value); + image.style.marginTop = pxValue; + image.style.marginBottom = pxValue; + }; + var setBorder = function (image, value) { + var pxValue = $_7v7yldc7jfuw8p0q.addPixelSuffix(value); + image.style.borderWidth = pxValue; + }; + var setBorderStyle = function (image, value) { + image.style.borderStyle = value; + }; + var getBorderStyle = function (image) { + return getStyle(image, 'borderStyle'); + }; + var isFigure = function (elm) { + return elm.nodeName === 'FIGURE'; + }; + var defaultData = function () { + return { + src: '', + alt: '', + title: '', + width: '', + height: '', + class: '', + style: '', + caption: false, + hspace: '', + vspace: '', + border: '', + borderStyle: '' + }; + }; + var getStyleValue = function (normalizeCss, data) { + var image = document.createElement('img'); + setAttrib(image, 'style', data.style); + if (getHspace(image) || data.hspace !== '') { + setHspace(image, data.hspace); + } + if (getVspace(image) || data.vspace !== '') { + setVspace(image, data.vspace); + } + if (getBorder(image) || data.border !== '') { + setBorder(image, data.border); + } + if (getBorderStyle(image) || data.borderStyle !== '') { + setBorderStyle(image, data.borderStyle); + } + return normalizeCss(image.getAttribute('style')); + }; + var create = function (normalizeCss, data) { + var image = document.createElement('img'); + write(normalizeCss, $_ajpvnqcjjfuw8p25.merge(data, { caption: false }), image); + setAttrib(image, 'alt', data.alt); + if (data.caption) { + var figure = DOM.create('figure', { class: 'image' }); + figure.appendChild(image); + figure.appendChild(DOM.create('figcaption', { contentEditable: true }, 'Caption')); + figure.contentEditable = 'false'; + return figure; + } else { + return image; + } + }; + var read = function (normalizeCss, image) { + return { + src: getAttrib(image, 'src'), + alt: getAttrib(image, 'alt'), + title: getAttrib(image, 'title'), + width: getSize(image, 'width'), + height: getSize(image, 'height'), + class: getAttrib(image, 'class'), + style: normalizeCss(getAttrib(image, 'style')), + caption: hasCaption(image), + hspace: getHspace(image), + vspace: getVspace(image), + border: getBorder(image), + borderStyle: getStyle(image, 'borderStyle') + }; + }; + var updateProp = function (image, oldData, newData, name, set) { + if (newData[name] !== oldData[name]) { + set(image, name, newData[name]); + } + }; + var normalized = function (set, normalizeCss) { + return function (image, name, value) { + set(image, value); + normalizeStyle(image, normalizeCss); + }; + }; + var write = function (normalizeCss, newData, image) { + var oldData = read(normalizeCss, image); + updateProp(image, oldData, newData, 'caption', function (image, _name, _value) { + return toggleCaption(image); + }); + updateProp(image, oldData, newData, 'src', setAttrib); + updateProp(image, oldData, newData, 'alt', setAttrib); + updateProp(image, oldData, newData, 'title', setAttrib); + updateProp(image, oldData, newData, 'width', setSize('width', normalizeCss)); + updateProp(image, oldData, newData, 'height', setSize('height', normalizeCss)); + updateProp(image, oldData, newData, 'class', setAttrib); + updateProp(image, oldData, newData, 'style', normalized(function (image, value) { + return setAttrib(image, 'style', value); + }, normalizeCss)); + updateProp(image, oldData, newData, 'hspace', normalized(setHspace, normalizeCss)); + updateProp(image, oldData, newData, 'vspace', normalized(setVspace, normalizeCss)); + updateProp(image, oldData, newData, 'border', normalized(setBorder, normalizeCss)); + updateProp(image, oldData, newData, 'borderStyle', normalized(setBorderStyle, normalizeCss)); + }; + + var normalizeCss = function (editor, cssText) { + var css = editor.dom.styles.parse(cssText); + var mergedCss = $_7v7yldc7jfuw8p0q.mergeMargins(css); + var compressed = editor.dom.styles.parse(editor.dom.styles.serialize(mergedCss)); + return editor.dom.styles.serialize(compressed); + }; + var getSelectedImage = function (editor) { + var imgElm = editor.selection.getNode(); + var figureElm = editor.dom.getParent(imgElm, 'figure.image'); + if (figureElm) { + return editor.dom.select('img', figureElm)[0]; + } + if (imgElm && (imgElm.nodeName !== 'IMG' || imgElm.getAttribute('data-mce-object') || imgElm.getAttribute('data-mce-placeholder'))) { + return null; + } + return imgElm; + }; + var splitTextBlock = function (editor, figure) { + var dom = editor.dom; + var textBlock = dom.getParent(figure.parentNode, function (node) { + return editor.schema.getTextBlockElements()[node.nodeName]; + }); + if (textBlock) { + return dom.split(textBlock, figure); + } else { + return figure; + } + }; + var readImageDataFromSelection = function (editor) { + var image = getSelectedImage(editor); + return image ? read(function (css) { + return normalizeCss(editor, css); + }, image) : defaultData(); + }; + var insertImageAtCaret = function (editor, data) { + var elm = create(function (css) { + return normalizeCss(editor, css); + }, data); + editor.dom.setAttrib(elm, 'data-mce-id', '__mcenew'); + editor.focus(); + editor.selection.setContent(elm.outerHTML); + var insertedElm = editor.dom.select('*[data-mce-id="__mcenew"]')[0]; + editor.dom.setAttrib(insertedElm, 'data-mce-id', null); + if (isFigure(insertedElm)) { + var figure = splitTextBlock(editor, insertedElm); + editor.selection.select(figure); + } else { + editor.selection.select(insertedElm); + } + }; + var syncSrcAttr = function (editor, image) { + editor.dom.setAttrib(image, 'src', image.getAttribute('src')); + }; + var deleteImage = function (editor, image) { + if (image) { + var elm = editor.dom.is(image.parentNode, 'figure.image') ? image.parentNode : image; + editor.dom.remove(elm); + editor.focus(); + editor.nodeChanged(); + if (editor.dom.isEmpty(editor.getBody())) { + editor.setContent(''); + editor.selection.setCursorLocation(); + } + } + }; + var writeImageDataToSelection = function (editor, data) { + var image = getSelectedImage(editor); + write(function (css) { + return normalizeCss(editor, css); + }, data, image); + syncSrcAttr(editor, image); + if (isFigure(image.parentNode)) { + var figure = image.parentNode; + splitTextBlock(editor, figure); + editor.selection.select(image.parentNode); + } else { + editor.selection.select(image); + $_7v7yldc7jfuw8p0q.waitLoadImage(editor, data, image); + } + }; + var insertOrUpdateImage = function (editor, data) { + var image = getSelectedImage(editor); + if (image) { + if (data.src) { + writeImageDataToSelection(editor, data); + } else { + deleteImage(editor, image); + } + } else if (data.src) { + insertImageAtCaret(editor, data); + } + }; + + var updateVSpaceHSpaceBorder = function (editor) { + return function (evt) { + var dom = editor.dom; + var rootControl = evt.control.rootControl; + if (!$_9cq6y3c6jfuw8p0n.hasAdvTab(editor)) { + return; + } + var data = rootControl.toJSON(); + var css = dom.parseStyle(data.style); + rootControl.find('#vspace').value(''); + rootControl.find('#hspace').value(''); + css = $_7v7yldc7jfuw8p0q.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($_7v7yldc7jfuw8p0q.removePixelSuffix(css['margin-top'])); + } else { + rootControl.find('#vspace').value(''); + } + if (css['margin-right'] === css['margin-left']) { + rootControl.find('#hspace').value($_7v7yldc7jfuw8p0q.removePixelSuffix(css['margin-right'])); + } else { + rootControl.find('#hspace').value(''); + } + } + if (css['border-width']) { + rootControl.find('#border').value($_7v7yldc7jfuw8p0q.removePixelSuffix(css['border-width'])); + } else { + rootControl.find('#border').value(''); + } + if (css['border-style']) { + rootControl.find('#borderStyle').value(css['border-style']); + } else { + rootControl.find('#borderStyle').value(''); + } + rootControl.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css)))); + }; + }; + var updateStyle = function (editor, win) { + win.find('#style').each(function (ctrl) { + var value = getStyleValue(function (css) { + return normalizeCss(editor, css); + }, $_ajpvnqcjjfuw8p25.merge(defaultData(), win.toJSON())); + ctrl.value(value); + }); + }; + var makeTab = function (editor) { + 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, + defaults: { + type: 'textbox', + maxWidth: 50, + onchange: function (evt) { + updateStyle(editor, evt.control.rootControl); + } + }, + items: [ + { + label: 'Vertical space', + name: 'vspace' + }, + { + label: 'Border width', + name: 'border' + }, + { + label: 'Horizontal space', + name: 'hspace' + }, + { + label: 'Border style', + type: 'listbox', + name: 'borderStyle', + width: 90, + maxWidth: 90, + onselect: function (evt) { + updateStyle(editor, evt.control.rootControl); + }, + values: [ + { + text: 'Select...', + value: '' + }, + { + text: 'Solid', + value: 'solid' + }, + { + text: 'Dotted', + value: 'dotted' + }, + { + text: 'Dashed', + value: 'dashed' + }, + { + text: 'Double', + value: 'double' + }, + { + text: 'Groove', + value: 'groove' + }, + { + text: 'Ridge', + value: 'ridge' + }, + { + text: 'Inset', + value: 'inset' + }, + { + text: 'Outset', + value: 'outset' + }, + { + text: 'None', + value: 'none' + }, + { + text: 'Hidden', + value: 'hidden' + } + ] + } + ] + } + ] + }; + }; + var $_dlliegcfjfuw8p1m = { 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 $_1ahiincmjfuw8p2c = { + 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')); + } + global$3.each(meta, function (value, key) { + rootControl.find('#' + key).value(value); + }); + if (!meta.width && !meta.height) { + srcURL = editor.convertURL(control.value(), 'src'); + prependURL = $_9cq6y3c6jfuw8p0n.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); + $_7v7yldc7jfuw8p0q.getImageSize(editor.documentBaseURI.toAbsolute(control.value()), function (data) { + if (data.width && data.height && $_9cq6y3c6jfuw8p0n.hasDimensions(editor)) { + rootControl.find('#width').value(data.width); + rootControl.find('#height').value(data.height); + $_1ahiincmjfuw8p2c.syncSize(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 ($_9cq6y3c6jfuw8p0n.hasDescription(editor)) { + generalFormItems.push({ + name: 'alt', + type: 'textbox', + label: 'Image description' + }); + } + if ($_9cq6y3c6jfuw8p0n.hasImageTitle(editor)) { + generalFormItems.push({ + name: 'title', + type: 'textbox', + label: 'Image Title' + }); + } + if ($_9cq6y3c6jfuw8p0n.hasDimensions(editor)) { + generalFormItems.push($_1ahiincmjfuw8p2c.createUi()); + } + if ($_9cq6y3c6jfuw8p0n.getClassList(editor)) { + generalFormItems.push({ + name: 'class', + type: 'listbox', + label: 'Class', + values: $_7v7yldc7jfuw8p0q.buildListItems($_9cq6y3c6jfuw8p0n.getClassList(editor), function (item) { + if (item.value) { + item.textStyle = function () { + return editor.formatter.getCssText({ + inline: 'img', + classes: [item.value] + }); + }; + } + }) + }); + } + if ($_9cq6y3c6jfuw8p0n.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 $_e4gxykcljfuw8p29 = { + makeTab: makeTab$1, + getGeneralItems: getGeneralItems + }; + + var url = function () { + return $_ba69mec9jfuw8p15.getOrDie('URL'); + }; + var createObjectURL = function (blob) { + return url().createObjectURL(blob); + }; + var revokeObjectURL = function (u) { + url().revokeObjectURL(u); + }; + var $_52xhfhcojfuw8p2i = { + createObjectURL: createObjectURL, + revokeObjectURL: revokeObjectURL + }; + + var global$6 = tinymce.util.Tools.resolve('tinymce.ui.Factory'); + + function XMLHttpRequest () { + var f = $_ba69mec9jfuw8p15.getOrDie('XMLHttpRequest'); + return new f(); } -); -dem('tinymce.plugins.image.Plugin')(); + + 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 global$2(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) ? global$2.reject('Upload url missing from the settings.') : uploadBlob(blobInfo, settings.handler); + }; + settings = global$3.extend({ + credentials: false, + handler: defaultHandler + }, settings); + return { upload: upload }; + } + + var onFileInput = function (editor) { + return function (evt) { + var Throbber = global$6.get('Throbber'); + var rootControl = evt.control.rootControl; + var throbber = new Throbber(rootControl.getEl()); + var file = evt.control.value(); + var blobUri = $_52xhfhcojfuw8p2i.createObjectURL(file); + var uploader = Uploader({ + url: $_9cq6y3c6jfuw8p0n.getUploadUrl(editor), + basePath: $_9cq6y3c6jfuw8p0n.getUploadBasePath(editor), + credentials: $_9cq6y3c6jfuw8p0n.getUploadCredentials(editor), + handler: $_9cq6y3c6jfuw8p0n.getUploadHandler(editor) + }); + var finalize = function () { + throbber.hide(); + $_52xhfhcojfuw8p2i.revokeObjectURL(blobUri); + }; + throbber.show(); + return $_7v7yldc7jfuw8p0q.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 $_9k5u99cnjfuw8p2f = { makeTab: makeTab$2 }; + + var noop$1 = function () { + var x = []; + for (var _i = 0; _i < arguments.length; _i++) { + x[_i] = arguments[_i]; + } + }; + var noarg = function (f) { + return function () { + var x = []; + for (var _i = 0; _i < arguments.length; _i++) { + x[_i] = arguments[_i]; + } + return f(); + }; + }; + var compose = function (fa, fb) { + return function () { + var x = []; + for (var _i = 0; _i < arguments.length; _i++) { + x[_i] = arguments[_i]; + } + return fa(fb.apply(null, arguments)); + }; + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var identity = function (x) { + return x; + }; + var tripleEquals = function (a, b) { + return a === b; + }; + var curry = function (f) { + var x = []; + for (var _i = 1; _i < arguments.length; _i++) { + x[_i - 1] = arguments[_i]; + } + var args = new Array(arguments.length - 1); + for (var i = 1; i < arguments.length; i++) + args[i - 1] = arguments[i]; + return function () { + var x = []; + for (var _i = 0; _i < arguments.length; _i++) { + x[_i] = arguments[_i]; + } + var newArgs = new Array(arguments.length); + for (var j = 0; j < newArgs.length; j++) + newArgs[j] = arguments[j]; + var all = args.concat(newArgs); + return f.apply(null, all); + }; + }; + var not = function (f) { + return function () { + var x = []; + for (var _i = 0; _i < arguments.length; _i++) { + x[_i] = arguments[_i]; + } + return !f.apply(null, arguments); + }; + }; + var die = function (msg) { + return function () { + throw new Error(msg); + }; + }; + var apply = function (f) { + return f(); + }; + var call = function (f) { + f(); + }; + var never = constant(false); + var always = constant(true); + var $_ajqvh7csjfuw8p2q = { + noop: noop$1, + noarg: noarg, + compose: compose, + constant: constant, + identity: identity, + tripleEquals: tripleEquals, + curry: curry, + not: not, + die: die, + apply: apply, + call: call, + never: never, + always: always + }; + + var submitForm = function (editor, evt) { + var win = evt.control.getRoot(); + $_1ahiincmjfuw8p2c.updateSize(win); + editor.undoManager.transact(function () { + var data = $_ajpvnqcjjfuw8p25.merge(readImageDataFromSelection(editor), win.toJSON()); + insertOrUpdateImage(editor, data); + }); + editor.editorUpload.uploadImagesAuto(); + }; + function Dialog (editor) { + function showDialog(imageList) { + var data = readImageDataFromSelection(editor); + var win, imageListCtrl; + if (imageList) { + imageListCtrl = { + type: 'listbox', + label: 'Image list', + name: 'image-list', + values: $_7v7yldc7jfuw8p0q.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 ($_9cq6y3c6jfuw8p0n.hasAdvTab(editor) || $_9cq6y3c6jfuw8p0n.hasUploadUrl(editor) || $_9cq6y3c6jfuw8p0n.hasUploadHandler(editor)) { + var body = [$_e4gxykcljfuw8p29.makeTab(editor, imageListCtrl)]; + if ($_9cq6y3c6jfuw8p0n.hasAdvTab(editor)) { + body.push($_dlliegcfjfuw8p1m.makeTab(editor)); + } + if ($_9cq6y3c6jfuw8p0n.hasUploadUrl(editor) || $_9cq6y3c6jfuw8p0n.hasUploadHandler(editor)) { + body.push($_9k5u99cnjfuw8p2f.makeTab(editor)); + } + win = editor.windowManager.open({ + title: 'Insert/edit image', + data: data, + bodyType: 'tabpanel', + body: body, + onSubmit: $_ajqvh7csjfuw8p2q.curry(submitForm, editor) + }); + } else { + win = editor.windowManager.open({ + title: 'Insert/edit image', + data: data, + body: $_e4gxykcljfuw8p29.getGeneralItems(editor, imageListCtrl), + onSubmit: $_ajqvh7csjfuw8p2q.curry(submitForm, editor) + }); + } + $_1ahiincmjfuw8p2c.syncSize(win); + } + function open() { + $_7v7yldc7jfuw8p0q.createImageList(editor, showDialog); + } + return { open: open }; + } + + var register = function (editor) { + editor.addCommand('mceImage', Dialog(editor).open); + }; + var $_cbuvmdc4jfuw8p0d = { 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); + global$3.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 $_191db6ctjfuw8p2t = { 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 $_9nl4e0cujfuw8p2v = { register: register$1 }; + + global.add('image', function (editor) { + $_191db6ctjfuw8p2t.setup(editor); + $_9nl4e0cujfuw8p2v.register(editor); + $_cbuvmdc4jfuw8p0d.register(editor); + }); + function Plugin () { + } + + return Plugin; + +}()); })(); diff --git a/wp-includes/js/tinymce/plugins/image/plugin.min.js b/wp-includes/js/tinymce/plugins/image/plugin.min.js index dc5369e5e4..40b2929557 100644 --- a/wp-includes/js/tinymce/plugins/image/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/image/plugin.min.js @@ -1 +1 @@ -!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i=300?void e("HTTP Error: "+g.status):(a=JSON.parse(g.responseText),a&&"string"==typeof a.location?void b(d(c.basePath,a.location)):void e("Invalid JSON: "+g.responseText))},h=new FormData,h.append("file",a.blob(),a.filename()),g.send(h)}function f(b,c){return new a(function(a,d){try{c(b,a,d,i)}catch(a){d(a.message)}})}function g(a){return a===e}function h(b){return!c.url&&g(c.handler)?a.reject("Upload url missng from the settings."):f(b,c.handler)}var i=function(){};return c=b.extend({credentials:!1,handler:e},c),{upload:h}}}),g("d",["2","6","5"],function(a,b,c){var d=function(a,d){function e(a,b){f.parentNode&&f.parentNode.removeChild(f),d({width:a,height:b})}var f=c.createElement("img");f.onload=function(){e(b.max(f.width,f.clientWidth),b.max(f.height,f.clientHeight))},f.onerror=function(){e()};var g=f.style;g.visibility="hidden",g.position="fixed",g.bottom=g.left=0,g.width=g.height="auto",c.body.appendChild(f),f.src=a},e=function(b,c,d){function e(b,d){return d=d||[],a.each(b,function(a){var b={text:a.text||a.title};a.menu?b.menu=e(a.menu):(b.value=a.value,c(b)),d.push(b)}),d}return e(b,d||[])},f=function(a){return a&&(a=a.replace(/px$/,"")),a},g=function(a){return a.length>0&&/^[0-9]+$/.test(a)&&(a+="px"),a},h=function(a){if(a.margin){var b=a.margin.split(" ");switch(b.length){case 1:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[0],a["margin-bottom"]=a["margin-bottom"]||b[0],a["margin-left"]=a["margin-left"]||b[0];break;case 2:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[0],a["margin-left"]=a["margin-left"]||b[1];break;case 3:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[2],a["margin-left"]=a["margin-left"]||b[1];break;case 4:a["margin-top"]=a["margin-top"]||b[0],a["margin-right"]=a["margin-right"]||b[1],a["margin-bottom"]=a["margin-bottom"]||b[2],a["margin-left"]=a["margin-left"]||b[3]}delete a.margin}return a};return{getImageSize:d,buildListItems:e,removePixelSuffix:f,addPixelSuffix:g,mergeMargins:h}}),g("3",["5","6","7","8","9","a","2","b","c","d"],function(a,b,c,d,e,f,g,h,i,j){return function(a){function k(b){var c=a.settings.image_list;"string"==typeof c?h.send({url:c,success:function(a){b(f.parse(a))}}):"function"==typeof c?c(b):b(c)}function l(f){function h(){var b=e.get("Throbber"),c=new b(s.getEl()),d=this.value(),f=new i({url:B.images_upload_url,basePath:B.images_upload_base_path,credentials:B.images_upload_credentials,handler:B.images_upload_handler}),g=a.editorUpload.blobCache.create({blob:d,name:d.name?d.name.replace(/\.[^\.]+$/,""):null,base64:"data:image/fake;base64,="}),h=function(){c.hide(),URL.revokeObjectURL(g.blobUri())};return c.show(),f.upload(g).then(function(a){var b=s.find("#src");return b.value(a),s.find("tabpanel")[0].activateTab(0),b.fire("change"),h(),a},function(b){a.windowManager.alert(b),h()})}function k(b){return a.schema.getTextBlockElements()[b.nodeName]}function l(){var a,c,d,e;a=s.find("#width")[0],c=s.find("#height")[0],a&&c&&(d=a.value(),e=c.value(),s.find("#constrain")[0].checked()&&v&&w&&d&&e&&(v!=d?(e=b.round(d/v*e),isNaN(e)||c.value(e)):(d=b.round(e/w*d),isNaN(d)||a.value(d))),v=d,w=e)}function m(){if(a.settings.image_advtab){var b=s.toJSON(),c=A.parseStyle(b.style);c=j.mergeMargins(c),b.vspace&&(c["margin-top"]=c["margin-bottom"]=j.addPixelSuffix(b.vspace)),b.hspace&&(c["margin-left"]=c["margin-right"]=j.addPixelSuffix(b.hspace)),b.border&&(c["border-width"]=j.addPixelSuffix(b.border)),s.find("#style").value(A.serializeStyle(A.parseStyle(A.serializeStyle(c))))}}function n(){if(a.settings.image_advtab){var b=s.toJSON(),c=A.parseStyle(b.style);s.find("#vspace").value(""),s.find("#hspace").value(""),c=j.mergeMargins(c),(c["margin-top"]&&c["margin-bottom"]||c["margin-right"]&&c["margin-left"])&&(c["margin-top"]===c["margin-bottom"]?s.find("#vspace").value(j.removePixelSuffix(c["margin-top"])):s.find("#vspace").value(""),c["margin-right"]===c["margin-left"]?s.find("#hspace").value(j.removePixelSuffix(c["margin-right"])):s.find("#hspace").value("")),c["border-width"]&&s.find("#border").value(j.removePixelSuffix(c["border-width"])),s.find("#style").value(A.serializeStyle(A.parseStyle(A.serializeStyle(c))))}}function o(b){function c(){b.onload=b.onerror=null,a.selection&&(a.selection.select(b),a.nodeChanged())}b.onload=function(){z.width||z.height||!C||A.setAttribs(b,{width:b.clientWidth,height:b.clientHeight}),c()},b.onerror=c}function p(){var b,c;m(),l(),z=g.extend(z,s.toJSON()),z.alt||(z.alt=""),z.title||(z.title=""),""===z.width&&(z.width=null),""===z.height&&(z.height=null),z.style||(z.style=null),z={src:z.src,alt:z.alt,title:z.title,width:z.width,height:z.height,style:z.style,caption:z.caption,"class":z["class"]},a.undoManager.transact(function(){if(z.src){if(""===z.title&&(z.title=null),t?A.setAttribs(t,z):(z.id="__mcenew",a.focus(),a.selection.setContent(A.createHTML("img",z)),t=A.get("__mcenew"),A.setAttrib(t,"id",null)),a.editorUpload.uploadImagesAuto(),z.caption===!1&&A.is(t.parentNode,"figure.image")&&(b=t.parentNode,A.setAttrib(t,"contenteditable",null),A.insertAfter(t,b),A.remove(b),a.selection.select(t),a.nodeChanged()),z.caption!==!0)o(t);else if(!A.is(t.parentNode,"figure.image")){c=t,t=t.cloneNode(!0),t.contentEditable=!0,b=A.create("figure",{"class":"image"}),b.appendChild(t),b.appendChild(A.create("figcaption",{contentEditable:!0},"Caption")),b.contentEditable=!1;var d=A.getParent(c,k);d?A.split(d,c,b):A.replace(b,c),a.selection.select(b)}}else if(t){var e=A.is(t.parentNode,"figure.image")?t.parentNode:t;A.remove(e),a.focus(),a.nodeChanged(),A.isEmpty(a.getBody())&&(a.setContent(""),a.selection.setCursorLocation())}})}function q(b){var d,e,f,h=b.meta||{};x&&x.value(a.convertURL(this.value(),"src")),g.each(h,function(a,b){s.find("#"+b).value(a)}),h.width||h.height||(d=a.convertURL(this.value(),"src"),e=a.settings.image_prepend_url,f=new c("^(?:[a-z]+:)?//","i"),e&&!f.test(d)&&d.substring(0,e.length)!==e&&(d=e+d),this.value(d),j.getImageSize(a.documentBaseURI.toAbsolute(this.value()),function(a){a.width&&a.height&&C&&(v=a.width,w=a.height,s.find("#width").value(v),s.find("#height").value(w))}))}function r(a){a.meta=s.toJSON()}var s,t,u,v,w,x,y,z={},A=a.dom,B=a.settings,C=B.image_dimensions!==!1;t=a.selection.getNode(),u=A.getParent(t,"figure.image"),u&&(t=A.select("img",u)[0]),t&&("IMG"!=t.nodeName||t.getAttribute("data-mce-object")||t.getAttribute("data-mce-placeholder"))&&(t=null),t&&(v=A.getAttrib(t,"width"),w=A.getAttrib(t,"height"),z={src:A.getAttrib(t,"src"),alt:A.getAttrib(t,"alt"),title:A.getAttrib(t,"title"),"class":A.getAttrib(t,"class"),width:v,height:w,caption:!!u}),f&&(x={type:"listbox",label:"Image list",values:j.buildListItems(f,function(b){b.value=a.convertURL(b.value||b.url,"src")},[{text:"None",value:""}]),value:z.src&&a.convertURL(z.src,"src"),onselect:function(a){var b=s.find("#alt");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),s.find("#src").value(a.control.value()).fire("change")},onPostRender:function(){x=this}}),a.settings.image_class_list&&(y={name:"class",type:"listbox",label:"Class",values:j.buildListItems(a.settings.image_class_list,function(b){b.value&&(b.textStyle=function(){return a.formatter.getCssText({inline:"img",classes:[b.value]})})})});var D=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:q,onbeforecall:r},x];if(a.settings.image_description!==!1&&D.push({name:"alt",type:"textbox",label:"Image description"}),a.settings.image_title&&D.push({name:"title",type:"textbox",label:"Image Title"}),C&&D.push({type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:l,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:l,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}),D.push(y),a.settings.image_caption&&d.ceFalse&&D.push({name:"caption",type:"checkbox",label:"Caption"}),a.settings.image_advtab||a.settings.images_upload_url){var E=[{title:"General",type:"form",items:D}];if(a.settings.image_advtab&&(t&&(t.style.marginLeft&&t.style.marginRight&&t.style.marginLeft===t.style.marginRight&&(z.hspace=j.removePixelSuffix(t.style.marginLeft)),t.style.marginTop&&t.style.marginBottom&&t.style.marginTop===t.style.marginBottom&&(z.vspace=j.removePixelSuffix(t.style.marginTop)),t.style.borderWidth&&(z.border=j.removePixelSuffix(t.style.borderWidth)),z.style=a.dom.serializeStyle(a.dom.parseStyle(a.dom.getAttrib(t,"style")))),E.push({title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:n},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:m},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]})),a.settings.images_upload_url){var F=".jpg,.jpeg,.png,.gif",G={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:F,onchange:h},{text:"OR",type:"label"}]},{text:"Drop an image here",type:"dropzone",accept:F,height:100,onchange:h}]};E.push(G)}s=a.windowManager.open({title:"Insert/edit image",data:z,bodyType:"tabpanel",body:E,onSubmit:p})}else s=a.windowManager.open({title:"Insert/edit image",data:z,body:D,onSubmit:p})}function m(){k(l)}return{open:m}}}),g("0",["1","2","3"],function(a,b,c){return a.add("image",function(a){a.on("preInit",function(){function c(a){var b=a.attr("class");return b&&/\bimage\b/.test(b)}function d(a){return function(d){function e(b){b.attr("contenteditable",a?"true":null)}for(var f,g=d.length;g--;)f=d[g],c(f)&&(f.attr("contenteditable",a?"false":null),b.each(f.getAll("figcaption"),e),b.each(f.getAll("img"),e))}}a.parser.addNodeFilter("figure",d(!0)),a.serializer.addNodeFilter("figure",d(!1))}),a.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:c(a).open,stateSelector:"img:not([data-mce-object],[data-mce-placeholder]),figure.image"}),a.addMenuItem("image",{icon:"image",text:"Image",onclick:c(a).open,context:"insert",prependToContext:!0}),a.addCommand("mceImage",c(a).open)}),function(){}}),d("0")()}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d={hasDimensions:function(e){return!1!==e.settings.image_dimensions},hasAdvTab:function(e){return!0===e.settings.image_advtab},getPrependUrl:function(e){return e.getParam("image_prepend_url","")},getClassList:function(e){return e.getParam("image_class_list")},hasDescription:function(e){return!1!==e.settings.image_description},hasImageTitle:function(e){return!0===e.settings.image_title},hasImageCaption:function(e){return!0===e.settings.image_caption},getImageList:function(e){return e.getParam("image_list",!1)},hasUploadUrl:function(e){return e.getParam("images_upload_url",!1)},hasUploadHandler:function(e){return e.getParam("images_upload_handler",!1)},getUploadUrl:function(e){return e.getParam("images_upload_url")},getUploadHandler:function(e){return e.getParam("images_upload_handler")},getUploadBasePath:function(e){return e.getParam("images_upload_base_path")},getUploadCredentials:function(e){return e.getParam("images_upload_credentials")}},a="undefined"!=typeof window?window:Function("return this;")(),r=function(e,t){for(var n=t!==undefined&&null!==t?t:a,r=0;r {dependencies, definition, instance (possibly undefined)} + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); -// Used when there is no 'main' module. -// The name is probably (hopefully) unique so minification removes for releases. -var register_3795 = function (id) { - var module = dem(id); - var fragments = id.split('.'); - var target = Function('return this;')(); - for (var i = 0; i < fragments.length - 1; ++i) { - if (target[fragments[i]] === undefined) - target[fragments[i]] = {}; - target = target[fragments[i]]; - } - target[fragments[fragments.length - 1]] = module; -}; + var global$1 = tinymce.util.Tools.resolve('tinymce.util.VK'); -var instantiate = function (id) { - var actual = defs[id]; - var dependencies = actual.deps; - var definition = actual.defn; - var len = dependencies.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances[i] = dem(dependencies[i]); - var defResult = definition.apply(null, instances); - if (defResult === undefined) - throw 'module [' + id + '] returned undefined'; - actual.instance = defResult; -}; - -var def = function (id, dependencies, definition) { - if (typeof id !== 'string') - throw 'module id must be a string'; - else if (dependencies === undefined) - throw 'no dependencies for ' + id; - else if (definition === undefined) - throw 'no definition function for ' + id; - defs[id] = { - deps: dependencies, - defn: definition, - instance: undefined + 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 $_ae1yh4f3jfuw8pj4 = { + 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 dem = function (id) { - var actual = defs[id]; - if (actual === undefined) - throw 'module [' + id + '] was undefined'; - else if (actual.instance === undefined) - instantiate(id); - return actual.instance; -}; + var global$2 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); -var req = function (ids, callback) { - var len = ids.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances.push(dem(ids[i])); - callback.apply(null, callback); -}; + var global$3 = tinymce.util.Tools.resolve('tinymce.Env'); -var ephox = {}; - -ephox.bolt = { - module: { - api: { - define: def, - require: req, - demand: dem + var appendClickRemove = function (link, evt) { + document.body.appendChild(link); + link.dispatchEvent(evt); + document.body.removeChild(link); + }; + var open = function (url) { + if (!global$3.ie || global$3.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(''); + doc.close(); + } } - } -}; + }; + var $_2ksejbf4jfuw8pj6 = { open: open }; -var define = def; -var require = req; -var demand = dem; -// this helps with minificiation when using a lot of global references -var defineGlobal = function (id, ref) { - define(id, [], function () { return ref; }); -}; -/*jsc -["tinymce.plugins.link.Plugin","tinymce.core.PluginManager","tinymce.plugins.link.core.Actions","tinymce.plugins.link.ui.Controls","global!tinymce.util.Tools.resolve","tinymce.core.util.VK","tinymce.plugins.link.ui.Dialog","tinymce.plugins.link.core.OpenUrl","tinymce.plugins.link.core.Utils","tinymce.plugins.link.core.Settings","tinymce.core.util.Delay","tinymce.core.util.Tools","tinymce.core.util.XHR","global!RegExp","tinymce.core.dom.DOMUtils","tinymce.core.Env"] -jsc*/ -defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve); -/** - * ResolveGlobal.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 - */ + var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools'); -define( - 'tinymce.core.PluginManager', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.PluginManager'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.VK', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.VK'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.Delay', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.Delay'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.Tools', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.Tools'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.XHR', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.XHR'); - } -); - -define( - 'tinymce.plugins.link.core.Settings', - [ - - ], - function () { - var assumeExternalTargets = function (editorSettings) { - return typeof editorSettings.link_assume_external_targets === 'boolean' ? editorSettings.link_assume_external_targets : false; + var toggleTargetRules = function (rel, isUnsafe) { + var rules = ['noopener']; + var newRel = rel ? rel.split(/\s+/) : []; + var toString = function (rel) { + return global$4.trim(rel.sort().join(' ')); }; - - var hasContextToolbar = function (editorSettings) { - return typeof editorSettings.link_context_toolbar === 'boolean' ? editorSettings.link_context_toolbar : false; + var addTargetRules = function (rel) { + rel = removeTargetRules(rel); + return rel.length ? rel.concat(rules) : rules; }; - - var getLinkList = function (editorSettings) { - return editorSettings.link_list; + var removeTargetRules = function (rel) { + return rel.filter(function (val) { + return global$4.inArray(rules, val) === -1; + }); }; - - 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; - }; - - return { - 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 - }; - } -); - -defineGlobal("global!RegExp", RegExp); -/** - * Utils.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 - */ - -define( - 'tinymce.plugins.link.core.Utils', - [ - 'tinymce.core.util.Tools', - 'tinymce.plugins.link.core.Settings', - 'global!RegExp' - ], - function (Tools, Settings, RegExp) { - - 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.getStart(); - if (isImageFigure(selectedElm)) { - // for an image conained in a figure we look for a link inside the selected element - 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) { - // Partial html and not a fully selected anchor element - if (/]+>[^<]+<\/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 (!Settings.hasRelList(editor.settings) && Settings.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))); + 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 global$4.grep(elements, isLink).length > 0; + }; + var isOnlyTextSelected = function (html) { + if (/]+>[^<]+<\/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 (!$_ae1yh4f3jfuw8pj4.hasRelList(editor.settings) && $_ae1yh4f3jfuw8pj4.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 { - editor.execCommand('mceInsertLink', false, linkAttrs); + anchorElm.textContent = data.text; } } - }); - }; - }; - - - var unlink = function (editor) { - return function () { - editor.undoManager.transact(function () { - var node = editor.selection.getNode(); - if (isImageFigure(node)) { - unlinkImageFigure(editor, node); + 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('unlink'); + editor.execCommand('mceInsertLink', false, linkAttrs); } - }); - }; - }; - - - 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); - } - }; - - return { - link: link, - unlink: unlink, - isLink: isLink, - hasLinks: hasLinks, - isOnlyTextSelected: isOnlyTextSelected, - getAnchorElement: getAnchorElement, - getAnchorText: getAnchorText, - toggleTargetRules: toggleTargetRules - }; - } -); -/** - * Dialog.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 - */ - -define( - 'tinymce.plugins.link.ui.Dialog', - [ - 'tinymce.core.util.Delay', - 'tinymce.core.util.Tools', - 'tinymce.core.util.XHR', - 'tinymce.plugins.link.core.Utils', - 'tinymce.plugins.link.core.Settings' - ], - function (Delay, Tools, XHR, Utils, Settings) { - var attachState = {}; - - var createLinkList = function (editor, callback) { - var linkList = Settings.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 || []); - }; - - // Delay confirm since onSubmit will move focus - 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 = {}, selection = editor.selection, dom = editor.dom, 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 = Utils.isOnlyTextSelected(selection.getContent()); - anchorElm = Utils.getAnchorElement(editor); - - data.text = initialText = Utils.getAnchorText(editor.selection, anchorElm); - data.href = anchorElm ? dom.getAttrib(anchorElm, 'href') : ''; - - if (anchorElm) { - data.target = dom.getAttrib(anchorElm, 'target'); - } else if (Settings.hasDefaultLinkTarget(editor.settings)) { - data.target = Settings.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 () { - /*eslint consistent-this:0*/ - linkListCtrl = this; - } - }; - } - - if (Settings.shouldShowTargetList(editor.settings)) { - if (Settings.getTargetList(editor.settings) === undefined) { - Settings.setTargetList(editor, [ - { text: 'None', value: '' }, - { text: 'New window', value: '_blank' } - ]); - } - - targetListCtrl = { - name: 'target', - type: 'listbox', - label: 'Target', - values: buildListItems(Settings.getTargetList(editor.settings)) - }; - } - - if (Settings.hasRelList(editor.settings)) { - relListCtrl = { - name: 'rel', - type: 'listbox', - label: 'Rel', - values: buildListItems( - Settings.getRelList(editor.settings), - function (item) { - if (Settings.allowUnsafeLinkTarget(editor.settings) === false) { - item.value = Utils.toggleTargetRules(item.value, data.target === '_blank'); - } - } - ) - }; - } - - if (Settings.hasLinkClassList(editor.settings)) { - classListCtrl = { - name: 'class', - type: 'listbox', - label: 'Class', - values: buildListItems( - Settings.getLinkClassList(editor.settings), - function (item) { - if (item.value) { - item.textStyle = function () { - return editor.formatter.getCssText({ inline: 'a', classes: [item.value] }); - }; - } - } - ) - }; - } - - if (Settings.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 = Settings.assumeExternalTargets(editor.settings); - var insertLink = Utils.link(editor, attachState); - var removeLink = Utils.unlink(editor); - - var resultData = Tools.extend({}, data, e.data); - /*eslint dot-notation: 0*/ - var href = resultData.href; - - if (!href) { - removeLink(); - return; - } - - if (!onlyText || resultData.text === initialText) { - delete resultData.text; - } - - // Is email and not //user@domain.com - 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; - } - - // Is not protocol prefixed - 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 = function (editor) { - createLinkList(editor, showDialog); - }; - - return { - open: open - }; - } -); -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.dom.DOMUtils', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.dom.DOMUtils'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.Env', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.Env'); - } -); - -/** - * OpenUrl.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 - */ - -define( - 'tinymce.plugins.link.core.OpenUrl', - [ - 'tinymce.core.dom.DOMUtils', - 'tinymce.core.Env' - ], - function (DOMUtils, Env) { - var appendClickRemove = function (link, evt) { - document.body.appendChild(link); - link.dispatchEvent(evt); - document.body.removeChild(link); - }; - - var open = function (url) { - // Chrome and Webkit has implemented noopener and works correctly with/without popup blocker - // Firefox has it implemented noopener but when the popup blocker is activated it doesn't work - // Edge has only implemented noreferrer and it seems to remove opener as well - // Older IE versions pre IE 11 falls back to a window.open approach - 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(''); - doc.close(); + }; + 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'); } - } + }); }; - - return { - open: open - }; - } -); -/** - * Actions.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 - */ - -define( - 'tinymce.plugins.link.core.Actions', - [ - 'tinymce.core.util.VK', - 'tinymce.plugins.link.ui.Dialog', - 'tinymce.plugins.link.core.OpenUrl', - 'tinymce.plugins.link.core.Utils', - 'tinymce.plugins.link.core.Settings' - ], - function (VK, Dialog, OpenUrl, Utils, Settings) { - 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) { - // Returns the real href value not the resolved a.href value - 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) { + }; + 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) { - var href = getHref(a); - if (/^#/.test(href)) { - var targetEl = editor.$(href); - if (targetEl.length) { - editor.selection.scrollIntoView(targetEl[0], true); + 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 $_fs5xf5f7jfuw8pjf = { + link: link, + unlink: unlink, + isLink: isLink, + hasLinks: hasLinks, + isOnlyTextSelected: isOnlyTextSelected, + getAnchorElement: getAnchorElement, + getAnchorText: getAnchorText, + toggleTargetRules: toggleTargetRules + }; + + var global$5 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var global$6 = tinymce.util.Tools.resolve('tinymce.util.XHR'); + + var attachState = {}; + var createLinkList = function (editor, callback) { + var linkList = $_ae1yh4f3jfuw8pj4.getLinkList(editor.settings); + if (typeof linkList === 'string') { + global$6.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 || []; + global$4.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(); + global$5.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 = []; + global$4.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')); + } + global$4.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 { - OpenUrl.open(a.href); + inp.value(value); } + }); + if (meta.attach) { + attachState = { + href: this.value(), + attach: meta.attach + }; + } + if (!meta.text) { + updateText.call(this); } }; - - var openDialog = function (editor) { - return function () { - Dialog.open(editor); - }; + var onBeforeCall = function (e) { + e.meta = win.toJSON(); }; - - var gotoSelectedLink = function (editor) { - return function () { - gotoLink(editor, getSelectedLink(editor)); + onlyText = $_fs5xf5f7jfuw8pjf.isOnlyTextSelected(selection.getContent()); + anchorElm = $_fs5xf5f7jfuw8pjf.getAnchorElement(editor); + data.text = initialText = $_fs5xf5f7jfuw8pjf.getAnchorText(editor.selection, anchorElm); + data.href = anchorElm ? dom.getAttrib(anchorElm, 'href') : ''; + if (anchorElm) { + data.target = dom.getAttrib(anchorElm, 'target'); + } else if ($_ae1yh4f3jfuw8pj4.hasDefaultLinkTarget(editor.settings)) { + data.target = $_ae1yh4f3jfuw8pj4.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(); + } }; - }; - - var leftClickedOnAHref = function (editor) { - return function (elm) { - var sel, rng, node; - if (Settings.hasContextToolbar(editor.settings) && !isContextMenuVisible(editor) && Utils.isLink(elm)) { - sel = editor.selection; - rng = sel.getRng(); - node = rng.startContainer; - // ignore cursor positions at the beginning/end (to make context toolbar less noisy) - if (node.nodeType == 3 && sel.isCollapsed() && rng.startOffset > 0 && rng.startOffset < node.data.length) { - return true; + } + 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 ($_ae1yh4f3jfuw8pj4.shouldShowTargetList(editor.settings)) { + if ($_ae1yh4f3jfuw8pj4.getTargetList(editor.settings) === undefined) { + $_ae1yh4f3jfuw8pj4.setTargetList(editor, [ + { + text: 'None', + value: '' + }, + { + text: 'New window', + value: '_blank' } - } - return false; + ]); + } + targetListCtrl = { + name: 'target', + type: 'listbox', + label: 'Target', + values: buildListItems($_ae1yh4f3jfuw8pj4.getTargetList(editor.settings)) }; + } + if ($_ae1yh4f3jfuw8pj4.hasRelList(editor.settings)) { + relListCtrl = { + name: 'rel', + type: 'listbox', + label: 'Rel', + values: buildListItems($_ae1yh4f3jfuw8pj4.getRelList(editor.settings), function (item) { + if ($_ae1yh4f3jfuw8pj4.allowUnsafeLinkTarget(editor.settings) === false) { + item.value = $_fs5xf5f7jfuw8pjf.toggleTargetRules(item.value, data.target === '_blank'); + } + }) + }; + } + if ($_ae1yh4f3jfuw8pj4.hasLinkClassList(editor.settings)) { + classListCtrl = { + name: 'class', + type: 'listbox', + label: 'Class', + values: buildListItems($_ae1yh4f3jfuw8pj4.getLinkClassList(editor.settings), function (item) { + if (item.value) { + item.textStyle = function () { + return editor.formatter.getCssText({ + inline: 'a', + classes: [item.value] + }); + }; + } + }) + }; + } + if ($_ae1yh4f3jfuw8pj4.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, + onpaste: updateText, + onbeforecall: onBeforeCall + }, + textListCtrl, + linkTitleCtrl, + buildAnchorListControl(data.href), + linkListCtrl, + relListCtrl, + targetListCtrl, + classListCtrl + ], + onSubmit: function (e) { + var assumeExternalTargets = $_ae1yh4f3jfuw8pj4.assumeExternalTargets(editor.settings); + var insertLink = $_fs5xf5f7jfuw8pjf.link(editor, attachState); + var removeLink = $_fs5xf5f7jfuw8pjf.unlink(editor); + var resultData = global$4.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 $_3kgdixf9jfuw8pjm = { 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 { + $_2ksejbf4jfuw8pj6.open(a.href); + } + } + }; + var openDialog = function (editor) { + return function () { + $_3kgdixf9jfuw8pjm.open(editor); }; - - 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 gotoSelectedLink = function (editor) { + return function () { + gotoLink(editor, getSelectedLink(editor)); + }; + }; + var leftClickedOnAHref = function (editor) { + return function (elm) { + var sel, rng, node; + if ($_ae1yh4f3jfuw8pj4.hasContextToolbar(editor.settings) && !isContextMenuVisible(editor) && $_fs5xf5f7jfuw8pjf.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 && global$1.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 && !!$_fs5xf5f7jfuw8pjf.getAnchorElement(editor, e.element)); }); }; - - var toggleActiveState = function (editor) { - return function () { - var self = this; - editor.on('nodechange', function (e) { - self.active(!editor.readonly && !!Utils.getAnchorElement(editor, e.element)); - }); - }; - }; - - var toggleViewLinkState = function (editor) { - return function () { - var self = this; - - var toggleVisibility = function (e) { - if (Utils.hasLinks(e.parents)) { - self.show(); - } else { - self.hide(); - } - }; - - if (!Utils.hasLinks(editor.dom.getParents(editor.selection.getStart()))) { + }; + var toggleViewLinkState = function (editor) { + return function () { + var self = this; + var toggleVisibility = function (e) { + if ($_fs5xf5f7jfuw8pjf.hasLinks(e.parents)) { + self.show(); + } else { self.hide(); } - - editor.on('nodechange', toggleVisibility); - - self.on('remove', function () { - editor.off('nodechange', toggleVisibility); - }); }; - }; - - return { - openDialog: openDialog, - gotoSelectedLink: gotoSelectedLink, - leftClickedOnAHref: leftClickedOnAHref, - setupGotoLinks: setupGotoLinks, - toggleActiveState: toggleActiveState, - toggleViewLinkState: toggleViewLinkState - }; - } -); -/** - * Controls.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 - */ - -define( - 'tinymce.plugins.link.ui.Controls', - [ - 'tinymce.plugins.link.core.Actions', - 'tinymce.plugins.link.core.Utils' - ], - function (Actions, Utils) { - - var setupButtons = function (editor) { - editor.addButton('link', { - icon: 'link', - tooltip: 'Insert/edit link', - shortcut: 'Meta+K', - onclick: Actions.openDialog(editor), - onpostrender: Actions.toggleActiveState(editor) - }); - - editor.addButton('unlink', { - icon: 'unlink', - tooltip: 'Remove link', - onclick: Utils.unlink(editor), - onpostrender: Actions.toggleActiveState(editor) - }); - - if (editor.addContextToolbar) { - editor.addButton('openlink', { - icon: 'newtab', - tooltip: 'Open link', - onclick: Actions.gotoSelectedLink(editor) - }); + if (!$_fs5xf5f7jfuw8pjf.hasLinks(editor.dom.getParents(editor.selection.getStart()))) { + self.hide(); } - }; - - var setupMenuItems = function (editor) { - editor.addMenuItem('openlink', { - text: 'Open link', - icon: 'newtab', - onclick: Actions.gotoSelectedLink(editor), - onPostRender: Actions.toggleViewLinkState(editor), - prependToContext: true - }); - - editor.addMenuItem('link', { - icon: 'link', - text: 'Link', - shortcut: 'Meta+K', - onclick: Actions.openDialog(editor), - stateSelector: 'a[href]', - context: 'insert', - prependToContext: true + editor.on('nodechange', toggleVisibility); + self.on('remove', function () { + editor.off('nodechange', toggleVisibility); }); }; + }; + var $_auu7ckf1jfuw8pj0 = { + openDialog: openDialog, + gotoSelectedLink: gotoSelectedLink, + leftClickedOnAHref: leftClickedOnAHref, + setupGotoLinks: setupGotoLinks, + toggleActiveState: toggleActiveState, + toggleViewLinkState: toggleViewLinkState + }; - var setupContextToolbars = function (editor) { - if (editor.addContextToolbar) { - editor.addContextToolbar( - Actions.leftClickedOnAHref(editor), - 'openlink | link unlink' - ); - } - }; + var register = function (editor) { + editor.addCommand('mceLink', $_auu7ckf1jfuw8pj0.openDialog(editor)); + }; + var $_4bbs70f0jfuw8piz = { register: register }; - return { - setupButtons: setupButtons, - setupMenuItems: setupMenuItems, - setupContextToolbars: setupContextToolbars - }; - } -); -/** - * 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 - */ + var setup = function (editor) { + editor.addShortcut('Meta+K', '', $_auu7ckf1jfuw8pj0.openDialog(editor)); + }; + var $_7rlm6qfcjfuw8pjt = { setup: setup }; -define( - 'tinymce.plugins.link.Plugin', - [ - 'tinymce.core.PluginManager', - 'tinymce.plugins.link.core.Actions', - 'tinymce.plugins.link.ui.Controls' - ], - function (PluginManager, Actions, Controls) { - PluginManager.add('link', function (editor) { - Controls.setupButtons(editor); - Controls.setupMenuItems(editor); - Controls.setupContextToolbars(editor); - Actions.setupGotoLinks(editor); - editor.addShortcut('Meta+K', '', Actions.openDialog(editor)); - editor.addCommand('mceLink', Actions.openDialog(editor)); + var setupButtons = function (editor) { + editor.addButton('link', { + active: false, + icon: 'link', + tooltip: 'Insert/edit link', + onclick: $_auu7ckf1jfuw8pj0.openDialog(editor), + onpostrender: $_auu7ckf1jfuw8pj0.toggleActiveState(editor) }); + editor.addButton('unlink', { + active: false, + icon: 'unlink', + tooltip: 'Remove link', + onclick: $_fs5xf5f7jfuw8pjf.unlink(editor), + onpostrender: $_auu7ckf1jfuw8pj0.toggleActiveState(editor) + }); + if (editor.addContextToolbar) { + editor.addButton('openlink', { + icon: 'newtab', + tooltip: 'Open link', + onclick: $_auu7ckf1jfuw8pj0.gotoSelectedLink(editor) + }); + } + }; + var setupMenuItems = function (editor) { + editor.addMenuItem('openlink', { + text: 'Open link', + icon: 'newtab', + onclick: $_auu7ckf1jfuw8pj0.gotoSelectedLink(editor), + onPostRender: $_auu7ckf1jfuw8pj0.toggleViewLinkState(editor), + prependToContext: true + }); + editor.addMenuItem('link', { + icon: 'link', + text: 'Link', + shortcut: 'Meta+K', + onclick: $_auu7ckf1jfuw8pj0.openDialog(editor), + stateSelector: 'a[href]', + context: 'insert', + prependToContext: true + }); + editor.addMenuItem('unlink', { + icon: 'unlink', + text: 'Remove link', + onclick: $_fs5xf5f7jfuw8pjf.unlink(editor), + stateSelector: 'a[href]' + }); + }; + var setupContextToolbars = function (editor) { + if (editor.addContextToolbar) { + editor.addContextToolbar($_auu7ckf1jfuw8pj0.leftClickedOnAHref(editor), 'openlink | link unlink'); + } + }; + var $_dz7svyfdjfuw8pju = { + setupButtons: setupButtons, + setupMenuItems: setupMenuItems, + setupContextToolbars: setupContextToolbars + }; - return function () { }; + global.add('link', function (editor) { + $_dz7svyfdjfuw8pju.setupButtons(editor); + $_dz7svyfdjfuw8pju.setupMenuItems(editor); + $_dz7svyfdjfuw8pju.setupContextToolbars(editor); + $_auu7ckf1jfuw8pj0.setupGotoLinks(editor); + $_4bbs70f0jfuw8piz.register(editor); + $_7rlm6qfcjfuw8pjt.setup(editor); + }); + function Plugin () { } -); -dem('tinymce.plugins.link.Plugin')(); + + return Plugin; + +}()); })(); diff --git a/wp-includes/js/tinymce/plugins/link/plugin.min.js b/wp-includes/js/tinymce/plugins/link/plugin.min.js index dcd9d4369f..ebd4165e89 100644 --- a/wp-includes/js/tinymce/plugins/link/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/link/plugin.min.js @@ -1 +1 @@ -!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i0},j=function(a){return!(/]+>[^<]+<\/a>$/.test(a)||a.indexOf("href=")==-1))},k=function(a){return a&&"FIGURE"===a.nodeName&&/\bimage\b/i.test(a.className)},l=function(a,c){return function(e){a.undoManager.transact(function(){var g=a.selection.getNode(),h=f(a,g),i={href:e.href,target:e.target?e.target:null,rel:e.rel?e.rel:null,"class":e["class"]?e["class"]:null,title:e.title?e.title:null};b.hasRelList(a.settings)||b.allowUnsafeLinkTarget(a.settings)!==!1||(i.rel=d(i.rel,"_blank"==i.target)),e.href===c.href&&(c.attach(),c={}),h?(a.focus(),e.hasOwnProperty("text")&&("innerText"in h?h.innerText=e.text:h.textContent=e.text),a.dom.setAttribs(h,i),a.selection.select(h),a.undoManager.add()):k(g)?o(a,g,i):e.hasOwnProperty("text")?a.insertContent(a.dom.createHTML("a",i,a.dom.encode(e.text))):a.execCommand("mceInsertLink",!1,i)})}},m=function(a){return function(){a.undoManager.transact(function(){var b=a.selection.getNode();k(b)?n(a,b):a.execCommand("unlink")})}},n=function(a,b){var c,d;d=a.dom.select("img",b)[0],d&&(c=a.dom.getParents(d,"a[href]",b)[0],c&&(c.parentNode.insertBefore(d,c),a.dom.remove(c)))},o=function(a,b,c){var d,e;e=a.dom.select("img",b)[0],e&&(d=a.dom.create("a",c),e.parentNode.insertBefore(d,e),d.appendChild(e))};return{link:l,unlink:m,isLink:h,hasLinks:i,isOnlyTextSelected:j,getAnchorElement:f,getAnchorText:g,toggleTargetRules:d}}),g("6",["a","b","c","8","9"],function(a,b,c,d,e){var f={},g=function(a,b){var d=e.getLinkList(a.settings);"string"==typeof d?c.send({url:d,success:function(c){b(a,JSON.parse(c))}}):"function"==typeof d?d(function(c){b(a,c)}):b(a,d)},h=function(a,c,d){var e=function(a,d){return d=d||[],b.each(a,function(a){var b={text:a.text||a.title};a.menu?b.menu=e(a.menu):(b.value=a.value,c&&c(b)),d.push(b)}),d};return e(a,d||[])},i=function(b,c,d){var e=b.selection.getRng();a.setEditorTimeout(b,function(){b.windowManager.confirm(c,function(a){b.selection.setRng(e),d(a)})})},j=function(a,c){var g,j,k,l,m,n,o,p,q,r,s,t={},u=a.selection,v=a.dom,w=function(a){var b=k.find("#text");(!b.value()||a.lastControl&&b.value()==a.lastControl.text())&&b.value(a.control.text()),k.find("#href").value(a.control.value())},x=function(c){var d=[];if(b.each(a.dom.select("a:not([href])"),function(a){var b=a.name||a.id;b&&d.push({text:b,value:"#"+b,selected:c.indexOf("#"+b)!=-1})}),d.length)return d.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:d,onselect:w}},y=function(){j||!l||t.text||this.parent().parent().find("#text")[0].value(this.value())},z=function(c){var d=c.meta||{};n&&n.value(a.convertURL(this.value(),"href")),b.each(c.meta,function(a,b){var c=k.find("#"+b);"text"===b?0===j.length&&(c.value(a),t.text=a):c.value(a)}),d.attach&&(f={href:this.value(),attach:d.attach}),d.text||y.call(this)},A=function(a){a.meta=k.toJSON()};l=d.isOnlyTextSelected(u.getContent()),g=d.getAnchorElement(a),t.text=j=d.getAnchorText(a.selection,g),t.href=g?v.getAttrib(g,"href"):"",g?t.target=v.getAttrib(g,"target"):e.hasDefaultLinkTarget(a.settings)&&(t.target=e.getDefaultLinkTarget(a.settings)),(s=v.getAttrib(g,"rel"))&&(t.rel=s),(s=v.getAttrib(g,"class"))&&(t["class"]=s),(s=v.getAttrib(g,"title"))&&(t.title=s),l&&(m={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){t.text=this.value()}}),c&&(n={type:"listbox",label:"Link list",values:h(c,function(b){b.value=a.convertURL(b.value||b.url,"href")},[{text:"None",value:""}]),onselect:w,value:a.convertURL(t.href,"href"),onPostRender:function(){n=this}}),e.shouldShowTargetList(a.settings)&&(void 0===e.getTargetList(a.settings)&&e.setTargetList(a,[{text:"None",value:""},{text:"New window",value:"_blank"}]),p={name:"target",type:"listbox",label:"Target",values:h(e.getTargetList(a.settings))}),e.hasRelList(a.settings)&&(o={name:"rel",type:"listbox",label:"Rel",values:h(e.getRelList(a.settings),function(b){e.allowUnsafeLinkTarget(a.settings)===!1&&(b.value=d.toggleTargetRules(b.value,"_blank"===t.target))})}),e.hasLinkClassList(a.settings)&&(q={name:"class",type:"listbox",label:"Class",values:h(e.getLinkClassList(a.settings),function(b){b.value&&(b.textStyle=function(){return a.formatter.getCssText({inline:"a",classes:[b.value]})})})}),e.shouldShowLinkTitle(a.settings)&&(r={name:"title",type:"textbox",label:"Title",value:t.title}),k=a.windowManager.open({title:"Insert link",data:t,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:z,onkeyup:y,onbeforecall:A},m,r,x(t.href),n,o,p,q],onSubmit:function(c){var g=e.assumeExternalTargets(a.settings),h=d.link(a,f),k=d.unlink(a),m=b.extend({},t,c.data),n=m.href;return n?(l&&m.text!==j||delete m.text,n.indexOf("@")>0&&n.indexOf("//")==-1&&n.indexOf("mailto:")==-1?void i(a,"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(a){a&&(m.href="mailto:"+n),h(m)}):g===!0&&!/^\w+:/i.test(n)||g===!1&&/^\s*www[\.|\d\.]/i.test(n)?void i(a,"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(a){a&&(m.href="http://"+n),h(m)}):void h(m)):void k()}})},k=function(a){g(a,j)};return{open:k}}),g("e",["4"],function(a){return a("tinymce.dom.DOMUtils")}),g("f",["4"],function(a){return a("tinymce.Env")}),g("7",["e","f"],function(a,b){var c=function(a,b){document.body.appendChild(a),a.dispatchEvent(b),document.body.removeChild(a)},d=function(d){if(!b.ie||b.ie>10){var e=document.createElement("a");e.target="_blank",e.href=d,e.rel="noreferrer noopener";var f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),c(e,f)}else{var g=window.open("","_blank");if(g){g.opener=null;var h=g.document;h.open(),h.write(''),h.close()}}};return{open:d}}),g("2",["5","6","7","8","9"],function(a,b,c,d,e){var f=function(a,b){return a.dom.getParent(b,"a[href]")},g=function(a){return f(a,a.selection.getStart())},h=function(a){var b=a.getAttribute("data-mce-href");return b?b:a.getAttribute("href")},i=function(a){var b=a.plugins.contextmenu;return!!b&&b.isContextMenuVisible()},j=function(a){return a.altKey===!0&&a.shiftKey===!1&&a.ctrlKey===!1&&a.metaKey===!1},k=function(a,b){if(b){var d=h(b);if(/^#/.test(d)){var e=a.$(d);e.length&&a.selection.scrollIntoView(e[0],!0)}else c.open(b.href)}},l=function(a){return function(){b.open(a)}},m=function(a){return function(){k(a,g(a))}},n=function(a){return function(b){var c,f,g;return!!(e.hasContextToolbar(a.settings)&&!i(a)&&d.isLink(b)&&(c=a.selection,f=c.getRng(),g=f.startContainer,3==g.nodeType&&c.isCollapsed()&&f.startOffset>0&&f.startOffset'),i.close()}}var r,a},A=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=function(t,e){var n,o,i=["noopener"],r=t?t.split(/\s+/):[],a=function(t){return t.filter(function(t){return-1===A.inArray(i,t)})};return(r=e?(n=a(n=r)).length?n.concat(i):i:a(r)).length?(o=r,A.trim(o.sort().join(" "))):null},f=function(t,e){return e=e||t.selection.getNode(),m(e)?t.dom.select("a[href]",e)[0]:t.dom.getParent(e,"a[href]")},d=function(t){return t&&"A"===t.nodeName&&t.href},m=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},v=function(t,e){var n,o;(o=t.dom.select("img",e)[0])&&(n=t.dom.getParents(o,"a[href]",e)[0])&&(n.parentNode.insertBefore(o,n),t.dom.remove(n))},g=function(t,e,n){var o,i;(i=t.dom.select("img",e)[0])&&(o=t.dom.create("a",n),i.parentNode.insertBefore(o,i),o.appendChild(i))},L=function(i,r){return function(o){i.undoManager.transact(function(){var t=i.selection.getNode(),e=f(i,t),n={href:o.href,target:o.target?o.target:null,rel:o.rel?o.rel:null,"class":o["class"]?o["class"]:null,title:o.title?o.title:null};C(i.settings)||!1!==N(i.settings)||(n.rel=s(n.rel,"_blank"===n.target)),o.href===r.href&&(r.attach(),r={}),e?(i.focus(),o.hasOwnProperty("text")&&("innerText"in e?e.innerText=o.text:e.textContent=o.text),i.dom.setAttribs(e,n),i.selection.select(e),i.undoManager.add()):m(t)?g(i,t,n):o.hasOwnProperty("text")?i.insertContent(i.dom.createHTML("a",n,i.dom.encode(o.text))):i.execCommand("mceInsertLink",!1,n)})}},P=function(e){return function(){e.undoManager.transact(function(){var t=e.selection.getNode();m(t)?v(e,t):e.execCommand("unlink")})}},h=d,x=function(t){return 0]+>[^<]+<\/a>$/.test(t)||-1===t.indexOf("href=")))},S=f,I=function(t,e){var n=e?e.innerText||e.textContent:t.getContent({format:"text"});return n.replace(/\uFEFF/g,"")},K=s,U=tinymce.util.Tools.resolve("tinymce.util.Delay"),D=tinymce.util.Tools.resolve("tinymce.util.XHR"),B={},F=function(t,o,e){var i=function(t,n){return n=n||[],A.each(t,function(t){var e={text:t.text||t.title};t.menu?e.menu=i(t.menu):(e.value=t.value,o&&o(e)),n.push(e)}),n};return i(t,e||[])},q=function(e,t,n){var o=e.selection.getRng();U.setEditorTimeout(e,function(){e.windowManager.confirm(t,function(t){e.selection.setRng(o),n(t)})})},V=function(a,t){var e,l,o,u,n,i,r,c,s,f,d,m={},v=a.selection,g=a.dom,h=function(t){var e=o.find("#text");(!e.value()||t.lastControl&&e.value()===t.lastControl.text())&&e.value(t.control.text()),o.find("#href").value(t.control.value())},x=function(){l||!u||m.text||this.parent().parent().find("#text")[0].value(this.value())};u=E(v.getContent()),e=S(a),m.text=l=I(a.selection,e),m.href=e?g.getAttrib(e,"href"):"",e?m.target=g.getAttrib(e,"target"):k(a.settings)&&(m.target=y(a.settings)),(d=g.getAttrib(e,"rel"))&&(m.rel=d),(d=g.getAttrib(e,"class"))&&(m["class"]=d),(d=g.getAttrib(e,"title"))&&(m.title=d),u&&(n={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){m.text=this.value()}}),t&&(i={type:"listbox",label:"Link list",values:F(t,function(t){t.value=a.convertURL(t.value||t.url,"href")},[{text:"None",value:""}]),onselect:h,value:a.convertURL(m.href,"href"),onPostRender:function(){i=this}}),w(a.settings)&&(b(a.settings)===undefined&&_(a,[{text:"None",value:""},{text:"New window",value:"_blank"}]),c={name:"target",type:"listbox",label:"Target",values:F(b(a.settings))}),C(a.settings)&&(r={name:"rel",type:"listbox",label:"Rel",values:F(T(a.settings),function(t){!1===N(a.settings)&&(t.value=K(t.value,"_blank"===m.target))})}),O(a.settings)&&(s={name:"class",type:"listbox",label:"Class",values:F(M(a.settings),function(t){t.value&&(t.textStyle=function(){return a.formatter.getCssText({inline:"a",classes:[t.value]})})})}),R(a.settings)&&(f={name:"title",type:"textbox",label:"Title",value:m.title}),o=a.windowManager.open({title:"Insert link",data:m,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:function(t){var e=t.meta||{};i&&i.value(a.convertURL(this.value(),"href")),A.each(t.meta,function(t,e){var n=o.find("#"+e);"text"===e?0===l.length&&(n.value(t),m.text=t):n.value(t)}),e.attach&&(B={href:this.value(),attach:e.attach}),e.text||x.call(this)},onkeyup:x,onpaste:x,onbeforecall:function(t){t.meta=o.toJSON()}},n,f,function(n){var o=[];if(A.each(a.dom.select("a:not([href])"),function(t){var e=t.name||t.id;e&&o.push({text:e,value:"#"+e,selected:-1!==n.indexOf("#"+e)})}),o.length)return o.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:o,onselect:h}}(m.href),i,r,c,s],onSubmit:function(t){var e=p(a.settings),n=L(a,B),o=P(a),i=A.extend({},m,t.data),r=i.href;r?(u&&i.text!==l||delete i.text,0 {dependencies, definition, instance (possibly undefined)} + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); -// Used when there is no 'main' module. -// The name is probably (hopefully) unique so minification removes for releases. -var register_3795 = function (id) { - var module = dem(id); - var fragments = id.split('.'); - var target = Function('return this;')(); - for (var i = 0; i < fragments.length - 1; ++i) { - if (target[fragments[i]] === undefined) - target[fragments[i]] = {}; - target = target[fragments[i]]; - } - target[fragments[fragments.length - 1]] = module; -}; + var global$1 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils'); -var instantiate = function (id) { - var actual = defs[id]; - var dependencies = actual.deps; - var definition = actual.defn; - var len = dependencies.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances[i] = dem(dependencies[i]); - var defResult = definition.apply(null, instances); - if (defResult === undefined) - throw 'module [' + id + '] returned undefined'; - actual.instance = defResult; -}; + var global$2 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker'); -var def = function (id, dependencies, definition) { - if (typeof id !== 'string') - throw 'module id must be a string'; - else if (dependencies === undefined) - throw 'no dependencies for ' + id; - else if (definition === undefined) - throw 'no definition function for ' + id; - defs[id] = { - deps: dependencies, - defn: definition, - instance: undefined + var global$3 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + var global$4 = tinymce.util.Tools.resolve('tinymce.dom.BookmarkManager'); + + var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$6 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var isTextNode = function (node) { + return node && node.nodeType === 3; }; -}; - -var dem = function (id) { - var actual = defs[id]; - if (actual === undefined) - throw 'module [' + id + '] was undefined'; - else if (actual.instance === undefined) - instantiate(id); - return actual.instance; -}; - -var req = function (ids, callback) { - var len = ids.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances.push(dem(ids[i])); - callback.apply(null, callback); -}; - -var ephox = {}; - -ephox.bolt = { - module: { - api: { - define: def, - require: req, - demand: dem + var isListNode = function (node) { + return node && /^(OL|UL|DL)$/.test(node.nodeName); + }; + var isListItemNode = function (node) { + return node && /^(LI|DT|DD)$/.test(node.nodeName); + }; + var isTableCellNode = function (node) { + return node && /^(TH|TD)$/.test(node.nodeName); + }; + var isBr = function (node) { + return node && node.nodeName === 'BR'; + }; + var isFirstChild = function (node) { + return node.parentNode.firstChild === node; + }; + var isLastChild = function (node) { + return node.parentNode.lastChild === node; + }; + var isTextBlock = function (editor, node) { + return node && !!editor.schema.getTextBlockElements()[node.nodeName]; + }; + var isBlock = function (node, blockElements) { + return node && node.nodeName in blockElements; + }; + var isBogusBr = function (dom, node) { + if (!isBr(node)) { + return false; } - } -}; - -var define = def; -var require = req; -var demand = dem; -// this helps with minificiation when using a lot of global references -var defineGlobal = function (id, ref) { - define(id, [], function () { return ref; }); -}; -/*jsc -["tinymce.plugins.lists.Plugin","tinymce.core.PluginManager","tinymce.core.util.Tools","tinymce.core.util.VK","tinymce.plugins.lists.actions.Indent","tinymce.plugins.lists.actions.Outdent","tinymce.plugins.lists.actions.ToggleList","tinymce.plugins.lists.core.Delete","tinymce.plugins.lists.core.NodeType","tinymce.plugins.lists.core.Selection","global!tinymce.util.Tools.resolve","tinymce.core.dom.DOMUtils","tinymce.plugins.lists.core.Bookmark","tinymce.core.dom.DomQuery","tinymce.plugins.lists.core.NormalizeLists","tinymce.plugins.lists.core.SplitList","tinymce.plugins.lists.core.TextBlock","tinymce.core.dom.BookmarkManager","tinymce.core.dom.RangeUtils","tinymce.core.dom.TreeWalker","tinymce.plugins.lists.core.Range","tinymce.core.Env"] -jsc*/ -defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve); -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.PluginManager', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.PluginManager'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.Tools', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.Tools'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.VK', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.VK'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.dom.DOMUtils', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.dom.DOMUtils'); - } -); - -/** - * NodeType.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 - */ - -define( - 'tinymce.plugins.lists.core.NodeType', - [ - ], - function () { - var isTextNode = function (node) { - return node && node.nodeType === 3; - }; - - var isListNode = function (node) { - return node && (/^(OL|UL|DL)$/).test(node.nodeName); - }; - - var isListItemNode = function (node) { - return node && /^(LI|DT|DD)$/.test(node.nodeName); - }; - - var isBr = function (node) { - return node && node.nodeName === 'BR'; - }; - - var isFirstChild = function (node) { - return node.parentNode.firstChild === node; - }; - - var isLastChild = function (node) { - return node.parentNode.lastChild === node; - }; - - var isTextBlock = function (editor, node) { - return node && !!editor.schema.getTextBlockElements()[node.nodeName]; - }; - - var isBlock = function (node, blockElements) { - return node && node.nodeName in blockElements; - }; - - var isBogusBr = function (dom, node) { - if (!isBr(node)) { - return false; - } - - if (dom.isBlock(node.nextSibling) && !isBr(node.previousSibling)) { - return true; - } - - return false; - }; - - var isEmpty = function (dom, elm, keepBookmarks) { - var empty = dom.isEmpty(elm); - - if (keepBookmarks && dom.select('span[data-mce-type=bookmark]', elm).length > 0) { - return false; - } - - return empty; - }; - - var isChildOfBody = function (dom, elm) { - return dom.isChildOf(elm, dom.getRoot()); - }; - - return { - isTextNode: isTextNode, - isListNode: isListNode, - isListItemNode: isListItemNode, - isBr: isBr, - isFirstChild: isFirstChild, - isLastChild: isLastChild, - isTextBlock: isTextBlock, - isBlock: isBlock, - isBogusBr: isBogusBr, - isEmpty: isEmpty, - isChildOfBody: isChildOfBody - }; - } -); - - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.dom.RangeUtils', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.dom.RangeUtils'); - } -); - -/** - * Range.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 - */ - -define( - 'tinymce.plugins.lists.core.Range', - [ - 'tinymce.core.dom.RangeUtils', - 'tinymce.plugins.lists.core.NodeType' - ], - function (RangeUtils, NodeType) { - var getNormalizedEndPoint = function (container, offset) { - var node = RangeUtils.getNode(container, offset); - - if (NodeType.isListItemNode(container) && NodeType.isTextNode(node)) { - var textNodeOffset = offset >= container.childNodes.length ? node.data.length : 0; - return { container: node, offset: textNodeOffset }; - } - - return { container: container, offset: offset }; - }; - - var normalizeRange = function (rng) { - var outRng = rng.cloneRange(); - - var rangeStart = getNormalizedEndPoint(rng.startContainer, rng.startOffset); - outRng.setStart(rangeStart.container, rangeStart.offset); - - var rangeEnd = getNormalizedEndPoint(rng.endContainer, rng.endOffset); - outRng.setEnd(rangeEnd.container, rangeEnd.offset); - - return outRng; - }; - - return { - getNormalizedEndPoint: getNormalizedEndPoint, - normalizeRange: normalizeRange - }; - } -); - - -/** - * Bookmark.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 - */ - -define( - 'tinymce.plugins.lists.core.Bookmark', - [ - 'tinymce.core.dom.DOMUtils', - 'tinymce.plugins.lists.core.NodeType', - 'tinymce.plugins.lists.core.Range' - ], - function (DOMUtils, NodeType, Range) { - var DOM = DOMUtils.DOM; - - /** - * Returns a range bookmark. This will convert indexed bookmarks into temporary span elements with - * index 0 so that they can be restored properly after the DOM has been modified. Text bookmarks will not have spans - * added to them since they can be restored after a dom operation. - * - * So this:

||

- * becomes:

||

- * - * @param {DOMRange} rng DOM Range to get bookmark on. - * @return {Object} Bookmark object. - */ - var createBookmark = function (rng) { - var bookmark = {}; - - var setupEndPoint = function (start) { - var offsetNode, container, offset; - - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - - if (container.nodeType === 1) { - offsetNode = DOM.create('span', { 'data-mce-type': 'bookmark' }); - - if (container.hasChildNodes()) { - offset = Math.min(offset, container.childNodes.length - 1); - - if (start) { - container.insertBefore(offsetNode, container.childNodes[offset]); - } else { - DOM.insertAfter(offsetNode, container.childNodes[offset]); - } - } else { - container.appendChild(offsetNode); - } - - container = offsetNode; - offset = 0; - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - }; - - setupEndPoint(true); - - if (!rng.collapsed) { - setupEndPoint(); - } - - return bookmark; - }; - - var resolveBookmark = function (bookmark) { - function restoreEndPoint(start) { - var container, offset, node; - - var nodeIndex = function (container) { - var node = container.parentNode.firstChild, idx = 0; - - while (node) { - if (node === container) { - return idx; - } - - // Skip data-mce-type=bookmark nodes - if (node.nodeType !== 1 || node.getAttribute('data-mce-type') !== 'bookmark') { - idx++; - } - - node = node.nextSibling; - } - - return -1; - }; - - container = node = bookmark[start ? 'startContainer' : 'endContainer']; - offset = bookmark[start ? 'startOffset' : 'endOffset']; - - if (!container) { - return; - } - - if (container.nodeType === 1) { - offset = nodeIndex(container); - container = container.parentNode; - DOM.remove(node); - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - restoreEndPoint(true); - restoreEndPoint(); - - var rng = DOM.createRng(); - - rng.setStart(bookmark.startContainer, bookmark.startOffset); - - if (bookmark.endContainer) { - rng.setEnd(bookmark.endContainer, bookmark.endOffset); - } - - return Range.normalizeRange(rng); - }; - - return { - createBookmark: createBookmark, - resolveBookmark: resolveBookmark - }; - } -); - - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.dom.DomQuery', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.dom.DomQuery'); - } -); - -/** - * Selection.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 - */ - -define( - 'tinymce.plugins.lists.core.Selection', - [ - 'tinymce.core.dom.DomQuery', - 'tinymce.core.util.Tools', - 'tinymce.plugins.lists.core.NodeType' - ], - function (DomQuery, Tools, NodeType) { - var getParentList = function (editor) { - return editor.dom.getParent(editor.selection.getStart(true), 'OL,UL,DL'); - }; - - var getSelectedSubLists = function (editor) { - var parentList = getParentList(editor); - return Tools.grep(editor.selection.getSelectedBlocks(), function (elm) { - return NodeType.isListNode(elm) && parentList !== elm; - }); - }; - - var findParentListItemsNodes = function (editor, elms) { - var listItemsElms = Tools.map(elms, function (elm) { - var parentLi = editor.dom.getParent(elm, 'li,dd,dt', editor.getBody()); - - return parentLi ? parentLi : elm; - }); - - return DomQuery.unique(listItemsElms); - }; - - var getSelectedListItems = function (editor) { - var selectedBlocks = editor.selection.getSelectedBlocks(); - return Tools.grep(findParentListItemsNodes(editor, selectedBlocks), function (block) { - return NodeType.isListItemNode(block); - }); - }; - - return { - getParentList: getParentList, - getSelectedSubLists: getSelectedSubLists, - getSelectedListItems: getSelectedListItems - }; - } -); - - -/** - * Indent.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 - */ - -define( - 'tinymce.plugins.lists.actions.Indent', - [ - 'tinymce.core.dom.DOMUtils', - 'tinymce.plugins.lists.core.Bookmark', - 'tinymce.plugins.lists.core.NodeType', - 'tinymce.plugins.lists.core.Selection' - ], - function (DOMUtils, Bookmark, NodeType, Selection) { - var DOM = DOMUtils.DOM; - - var mergeLists = function (from, to) { - var node; - - if (NodeType.isListNode(from)) { - while ((node = from.firstChild)) { - to.appendChild(node); - } - - DOM.remove(from); - } - }; - - var indent = function (li) { - var sibling, newList, listStyle; - - if (li.nodeName === 'DT') { - DOM.rename(li, 'DD'); - return true; - } - - sibling = li.previousSibling; - - if (sibling && NodeType.isListNode(sibling)) { - sibling.appendChild(li); - return true; - } - - if (sibling && sibling.nodeName === 'LI' && NodeType.isListNode(sibling.lastChild)) { - sibling.lastChild.appendChild(li); - mergeLists(li.lastChild, sibling.lastChild); - return true; - } - - sibling = li.nextSibling; - - if (sibling && NodeType.isListNode(sibling)) { - sibling.insertBefore(li, sibling.firstChild); - return true; - } - - /*if (sibling && sibling.nodeName === 'LI' && isListNode(li.lastChild)) { - return false; - }*/ - - sibling = li.previousSibling; - if (sibling && sibling.nodeName === 'LI') { - newList = DOM.create(li.parentNode.nodeName); - listStyle = DOM.getStyle(li.parentNode, 'listStyleType'); - if (listStyle) { - DOM.setStyle(newList, 'listStyleType', listStyle); - } - sibling.appendChild(newList); - newList.appendChild(li); - mergeLists(li.lastChild, newList); - return true; - } - - return false; - }; - - var indentSelection = function (editor) { - var listElements = Selection.getSelectedListItems(editor); - - if (listElements.length) { - var bookmark = Bookmark.createBookmark(editor.selection.getRng(true)); - - for (var i = 0; i < listElements.length; i++) { - if (!indent(listElements[i]) && i === 0) { - break; - } - } - - editor.selection.setRng(Bookmark.resolveBookmark(bookmark)); - editor.nodeChanged(); - - return true; - } - }; - - return { - indentSelection: indentSelection - }; - } -); - - -/** - * NormalizeLists.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 - */ - -define( - 'tinymce.plugins.lists.core.NormalizeLists', - [ - 'tinymce.core.dom.DOMUtils', - 'tinymce.core.util.Tools', - 'tinymce.plugins.lists.core.NodeType' - ], - function (DOMUtils, Tools, NodeType) { - var DOM = DOMUtils.DOM; - - var normalizeList = function (dom, ul) { - var sibling, parentNode = ul.parentNode; - - // Move UL/OL to previous LI if it's the only child of a LI - if (parentNode.nodeName === 'LI' && parentNode.firstChild === ul) { - sibling = parentNode.previousSibling; - if (sibling && sibling.nodeName === 'LI') { - sibling.appendChild(ul); - - if (NodeType.isEmpty(dom, parentNode)) { - DOM.remove(parentNode); - } - } else { - DOM.setStyle(parentNode, 'listStyleType', 'none'); - } - } - - // Append OL/UL to previous LI if it's in a parent OL/UL i.e. old HTML4 - if (NodeType.isListNode(parentNode)) { - sibling = parentNode.previousSibling; - if (sibling && sibling.nodeName === 'LI') { - sibling.appendChild(ul); - } - } - }; - - var normalizeLists = function (dom, element) { - Tools.each(Tools.grep(dom.select('ol,ul', element)), function (ul) { - normalizeList(dom, ul); - }); - }; - - return { - normalizeList: normalizeList, - normalizeLists: normalizeLists - }; - } -); - - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.Env', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.Env'); - } -); - -/** - * TextBlock.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 - */ - -define( - 'tinymce.plugins.lists.core.TextBlock', - [ - 'tinymce.core.dom.DOMUtils', - 'tinymce.core.Env', - 'tinymce.plugins.lists.core.NodeType' - ], - function (DOMUtils, Env, NodeType) { - var DOM = DOMUtils.DOM; - - var createNewTextBlock = function (editor, contentNode, blockName) { - var node, textBlock, fragment = DOM.createFragment(), hasContentNode; - var blockElements = editor.schema.getBlockElements(); - - if (editor.settings.forced_root_block) { - blockName = blockName || editor.settings.forced_root_block; - } - - if (blockName) { - textBlock = DOM.create(blockName); - - if (textBlock.tagName === editor.settings.forced_root_block) { - DOM.setAttribs(textBlock, editor.settings.forced_root_block_attrs); - } - - if (!NodeType.isBlock(contentNode.firstChild, blockElements)) { - fragment.appendChild(textBlock); - } - } - - if (contentNode) { - while ((node = contentNode.firstChild)) { - var nodeName = node.nodeName; - - if (!hasContentNode && (nodeName !== 'SPAN' || node.getAttribute('data-mce-type') !== 'bookmark')) { - hasContentNode = true; - } - - if (NodeType.isBlock(node, blockElements)) { - fragment.appendChild(node); - textBlock = null; - } else { - if (blockName) { - if (!textBlock) { - textBlock = DOM.create(blockName); - fragment.appendChild(textBlock); - } - - textBlock.appendChild(node); - } else { - fragment.appendChild(node); - } - } - } - } - - if (!editor.settings.forced_root_block) { - fragment.appendChild(DOM.create('br')); - } else { - // BR is needed in empty blocks on non IE browsers - if (!hasContentNode && (!Env.ie || Env.ie > 10)) { - textBlock.appendChild(DOM.create('br', { 'data-mce-bogus': '1' })); - } - } - - return fragment; - }; - - return { - createNewTextBlock: createNewTextBlock - }; - } -); - -/** - * SplitList.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 - */ - -define( - 'tinymce.plugins.lists.core.SplitList', - [ - 'tinymce.core.dom.DOMUtils', - 'tinymce.plugins.lists.core.NodeType', - 'tinymce.plugins.lists.core.TextBlock', - 'tinymce.core.util.Tools' - ], - function (DOMUtils, NodeType, TextBlock, Tools) { - var DOM = DOMUtils.DOM; - - var splitList = function (editor, ul, li, newBlock) { - var tmpRng, fragment, bookmarks, node; - - var removeAndKeepBookmarks = function (targetNode) { - Tools.each(bookmarks, function (node) { - targetNode.parentNode.insertBefore(node, li.parentNode); - }); - - DOM.remove(targetNode); - }; - - bookmarks = DOM.select('span[data-mce-type="bookmark"]', ul); - newBlock = newBlock || TextBlock.createNewTextBlock(editor, li); - tmpRng = DOM.createRng(); - tmpRng.setStartAfter(li); - tmpRng.setEndAfter(ul); - fragment = tmpRng.extractContents(); - - for (node = fragment.firstChild; node; node = node.firstChild) { - if (node.nodeName === 'LI' && editor.dom.isEmpty(node)) { - DOM.remove(node); - break; - } - } - - if (!editor.dom.isEmpty(fragment)) { - DOM.insertAfter(fragment, ul); - } - - DOM.insertAfter(newBlock, ul); - - if (NodeType.isEmpty(editor.dom, li.parentNode)) { - removeAndKeepBookmarks(li.parentNode); - } - - DOM.remove(li); - - if (NodeType.isEmpty(editor.dom, ul)) { - DOM.remove(ul); - } - }; - - return { - splitList: splitList - }; - } -); - - -/** - * Outdent.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 - */ - -define( - 'tinymce.plugins.lists.actions.Outdent', - [ - 'tinymce.core.dom.DOMUtils', - 'tinymce.plugins.lists.core.Bookmark', - 'tinymce.plugins.lists.core.NodeType', - 'tinymce.plugins.lists.core.NormalizeLists', - 'tinymce.plugins.lists.core.Selection', - 'tinymce.plugins.lists.core.SplitList', - 'tinymce.plugins.lists.core.TextBlock' - ], - function (DOMUtils, Bookmark, NodeType, NormalizeLists, Selection, SplitList, TextBlock) { - var DOM = DOMUtils.DOM; - - var removeEmptyLi = function (dom, li) { - if (NodeType.isEmpty(dom, li)) { - DOM.remove(li); - } - }; - - var outdent = function (editor, li) { - var ul = li.parentNode, ulParent = ul.parentNode, newBlock; - - if (ul === editor.getBody()) { - return true; - } - - if (li.nodeName === 'DD') { - DOM.rename(li, 'DT'); - return true; - } - - if (NodeType.isFirstChild(li) && NodeType.isLastChild(li)) { - if (ulParent.nodeName === "LI") { - DOM.insertAfter(li, ulParent); - removeEmptyLi(editor.dom, ulParent); - DOM.remove(ul); - } else if (NodeType.isListNode(ulParent)) { - DOM.remove(ul, true); - } else { - ulParent.insertBefore(TextBlock.createNewTextBlock(editor, li), ul); - DOM.remove(ul); - } - - return true; - } else if (NodeType.isFirstChild(li)) { - if (ulParent.nodeName === "LI") { - DOM.insertAfter(li, ulParent); - li.appendChild(ul); - removeEmptyLi(editor.dom, ulParent); - } else if (NodeType.isListNode(ulParent)) { - ulParent.insertBefore(li, ul); - } else { - ulParent.insertBefore(TextBlock.createNewTextBlock(editor, li), ul); - DOM.remove(li); - } - - return true; - } else if (NodeType.isLastChild(li)) { - if (ulParent.nodeName === "LI") { - DOM.insertAfter(li, ulParent); - } else if (NodeType.isListNode(ulParent)) { - DOM.insertAfter(li, ul); - } else { - DOM.insertAfter(TextBlock.createNewTextBlock(editor, li), ul); - DOM.remove(li); - } - - return true; - } - - if (ulParent.nodeName === 'LI') { - ul = ulParent; - newBlock = TextBlock.createNewTextBlock(editor, li, 'LI'); - } else if (NodeType.isListNode(ulParent)) { - newBlock = TextBlock.createNewTextBlock(editor, li, 'LI'); - } else { - newBlock = TextBlock.createNewTextBlock(editor, li); - } - - SplitList.splitList(editor, ul, li, newBlock); - NormalizeLists.normalizeLists(editor.dom, ul.parentNode); - + if (dom.isBlock(node.nextSibling) && !isBr(node.previousSibling)) { return true; - }; - - var outdentSelection = function (editor) { - var listElements = Selection.getSelectedListItems(editor); - - if (listElements.length) { - var bookmark = Bookmark.createBookmark(editor.selection.getRng(true)); - var i, y, root = editor.getBody(); - - i = listElements.length; - while (i--) { - var node = listElements[i].parentNode; - - while (node && node !== root) { - y = listElements.length; - while (y--) { - if (listElements[y] === node) { - listElements.splice(i, 1); - break; - } - } - - node = node.parentNode; - } - } - - for (i = 0; i < listElements.length; i++) { - if (!outdent(editor, listElements[i]) && i === 0) { - break; - } - } - - editor.selection.setRng(Bookmark.resolveBookmark(bookmark)); - editor.nodeChanged(); - - return true; - } - }; + } + return false; + }; + var isEmpty = function (dom, elm, keepBookmarks) { + var empty = dom.isEmpty(elm); + if (keepBookmarks && dom.select('span[data-mce-type=bookmark]', elm).length > 0) { + return false; + } + return empty; + }; + var isChildOfBody = function (dom, elm) { + return dom.isChildOf(elm, dom.getRoot()); + }; + var $_fmlqy7fsjfuw8plr = { + isTextNode: isTextNode, + isListNode: isListNode, + isListItemNode: isListItemNode, + isTableCellNode: isTableCellNode, + isBr: isBr, + isFirstChild: isFirstChild, + isLastChild: isLastChild, + isTextBlock: isTextBlock, + isBlock: isBlock, + isBogusBr: isBogusBr, + isEmpty: isEmpty, + isChildOfBody: isChildOfBody + }; + var getNormalizedEndPoint = function (container, offset) { + var node = global$1.getNode(container, offset); + if ($_fmlqy7fsjfuw8plr.isListItemNode(container) && $_fmlqy7fsjfuw8plr.isTextNode(node)) { + var textNodeOffset = offset >= container.childNodes.length ? node.data.length : 0; + return { + container: node, + offset: textNodeOffset + }; + } return { - outdent: outdent, - outdentSelection: outdentSelection + container: container, + offset: offset }; - } -); - - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.dom.BookmarkManager', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.dom.BookmarkManager'); - } -); - -/** - * ToggleList.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 - */ - -define( - 'tinymce.plugins.lists.actions.ToggleList', - [ - 'tinymce.core.dom.BookmarkManager', - 'tinymce.core.util.Tools', - 'tinymce.plugins.lists.actions.Outdent', - 'tinymce.plugins.lists.core.Bookmark', - 'tinymce.plugins.lists.core.NodeType', - 'tinymce.plugins.lists.core.NormalizeLists', - 'tinymce.plugins.lists.core.Selection', - 'tinymce.plugins.lists.core.SplitList' - ], - function (BookmarkManager, Tools, Outdent, Bookmark, NodeType, NormalizeLists, Selection, SplitList) { - var updateListStyle = function (dom, el, detail) { - var type = detail['list-style-type'] ? detail['list-style-type'] : null; - dom.setStyle(el, 'list-style-type', type); - }; - - var setAttribs = function (elm, attrs) { - Tools.each(attrs, function (value, key) { - elm.setAttribute(key, value); - }); - }; - - var updateListAttrs = function (dom, el, detail) { - setAttribs(el, detail['list-attributes']); - Tools.each(dom.select('li', el), function (li) { - setAttribs(li, detail['list-item-attributes']); - }); - }; - - var updateListWithDetails = function (dom, el, detail) { - updateListStyle(dom, el, detail); - updateListAttrs(dom, el, detail); - }; - - var getEndPointNode = function (editor, rng, start) { - var container, offset, root = editor.getBody(); + }; + var normalizeRange = function (rng) { + var outRng = rng.cloneRange(); + var rangeStart = getNormalizedEndPoint(rng.startContainer, rng.startOffset); + outRng.setStart(rangeStart.container, rangeStart.offset); + var rangeEnd = getNormalizedEndPoint(rng.endContainer, rng.endOffset); + outRng.setEnd(rangeEnd.container, rangeEnd.offset); + return outRng; + }; + var $_14fh94frjfuw8plp = { + getNormalizedEndPoint: getNormalizedEndPoint, + normalizeRange: normalizeRange + }; + var DOM = global$6.DOM; + var createBookmark = function (rng) { + var bookmark = {}; + var setupEndPoint = function (start) { + var offsetNode, container, offset; container = rng[start ? 'startContainer' : 'endContainer']; offset = rng[start ? 'startOffset' : 'endOffset']; - - // Resolve node index if (container.nodeType === 1) { - container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; - } - - while (container.parentNode !== root) { - if (NodeType.isTextBlock(editor, container)) { - return container; + offsetNode = DOM.create('span', { 'data-mce-type': 'bookmark' }); + if (container.hasChildNodes()) { + offset = Math.min(offset, container.childNodes.length - 1); + if (start) { + container.insertBefore(offsetNode, container.childNodes[offset]); + } else { + DOM.insertAfter(offsetNode, container.childNodes[offset]); + } + } else { + container.appendChild(offsetNode); } - - if (/^(TD|TH)$/.test(container.parentNode.nodeName)) { - return container; - } - - container = container.parentNode; + container = offsetNode; + offset = 0; } - - return container; + bookmark[start ? 'startContainer' : 'endContainer'] = container; + bookmark[start ? 'startOffset' : 'endOffset'] = offset; }; + setupEndPoint(true); + if (!rng.collapsed) { + setupEndPoint(); + } + return bookmark; + }; + var resolveBookmark = function (bookmark) { + function restoreEndPoint(start) { + var container, offset, node; + var nodeIndex = function (container) { + var node = container.parentNode.firstChild, idx = 0; + while (node) { + if (node === container) { + return idx; + } + if (node.nodeType !== 1 || node.getAttribute('data-mce-type') !== 'bookmark') { + idx++; + } + node = node.nextSibling; + } + return -1; + }; + container = node = bookmark[start ? 'startContainer' : 'endContainer']; + offset = bookmark[start ? 'startOffset' : 'endOffset']; + if (!container) { + return; + } + if (container.nodeType === 1) { + offset = nodeIndex(container); + container = container.parentNode; + DOM.remove(node); + if (!container.hasChildNodes() && DOM.isBlock(container)) { + container.appendChild(DOM.create('br')); + } + } + bookmark[start ? 'startContainer' : 'endContainer'] = container; + bookmark[start ? 'startOffset' : 'endOffset'] = offset; + } + restoreEndPoint(true); + restoreEndPoint(); + var rng = DOM.createRng(); + rng.setStart(bookmark.startContainer, bookmark.startOffset); + if (bookmark.endContainer) { + rng.setEnd(bookmark.endContainer, bookmark.endOffset); + } + return $_14fh94frjfuw8plp.normalizeRange(rng); + }; + var $_3byghwfqjfuw8pln = { + createBookmark: createBookmark, + resolveBookmark: resolveBookmark + }; - var getSelectedTextBlocks = function (editor, rng) { - var textBlocks = [], root = editor.getBody(), dom = editor.dom; + var DOM$1 = global$6.DOM; + var normalizeList = function (dom, ul) { + var sibling; + var parentNode = ul.parentNode; + if (parentNode.nodeName === 'LI' && parentNode.firstChild === ul) { + sibling = parentNode.previousSibling; + if (sibling && sibling.nodeName === 'LI') { + sibling.appendChild(ul); + if ($_fmlqy7fsjfuw8plr.isEmpty(dom, parentNode)) { + DOM$1.remove(parentNode); + } + } else { + DOM$1.setStyle(parentNode, 'listStyleType', 'none'); + } + } + if ($_fmlqy7fsjfuw8plr.isListNode(parentNode)) { + sibling = parentNode.previousSibling; + if (sibling && sibling.nodeName === 'LI') { + sibling.appendChild(ul); + } + } + }; + var normalizeLists = function (dom, element) { + global$5.each(global$5.grep(dom.select('ol,ul', element)), function (ul) { + normalizeList(dom, ul); + }); + }; + var $_7p90zmftjfuw8plu = { + normalizeList: normalizeList, + normalizeLists: normalizeLists + }; - var startNode = getEndPointNode(editor, rng, true); - var endNode = getEndPointNode(editor, rng, false); - var block, siblings = []; + var global$7 = tinymce.util.Tools.resolve('tinymce.dom.DomQuery'); - for (var node = startNode; node; node = node.nextSibling) { - siblings.push(node); + var getParentList = function (editor) { + var selectionStart = editor.selection.getStart(true); + return editor.dom.getParent(selectionStart, 'OL,UL,DL', getClosestListRootElm(editor, selectionStart)); + }; + var isParentListSelected = function (parentList, selectedBlocks) { + return parentList && selectedBlocks.length === 1 && selectedBlocks[0] === parentList; + }; + var findSubLists = function (parentList) { + return global$5.grep(parentList.querySelectorAll('ol,ul,dl'), function (elm) { + return $_fmlqy7fsjfuw8plr.isListNode(elm); + }); + }; + var getSelectedSubLists = function (editor) { + var parentList = getParentList(editor); + var selectedBlocks = editor.selection.getSelectedBlocks(); + if (isParentListSelected(parentList, selectedBlocks)) { + return findSubLists(parentList); + } else { + return global$5.grep(selectedBlocks, function (elm) { + return $_fmlqy7fsjfuw8plr.isListNode(elm) && parentList !== elm; + }); + } + }; + var findParentListItemsNodes = function (editor, elms) { + var listItemsElms = global$5.map(elms, function (elm) { + var parentLi = editor.dom.getParent(elm, 'li,dd,dt', getClosestListRootElm(editor, elm)); + return parentLi ? parentLi : elm; + }); + return global$7.unique(listItemsElms); + }; + var getSelectedListItems = function (editor) { + var selectedBlocks = editor.selection.getSelectedBlocks(); + return global$5.grep(findParentListItemsNodes(editor, selectedBlocks), function (block) { + return $_fmlqy7fsjfuw8plr.isListItemNode(block); + }); + }; + var getClosestListRootElm = function (editor, elm) { + var parentTableCell = editor.dom.getParents(elm, 'TD,TH'); + var root = parentTableCell.length > 0 ? parentTableCell[0] : editor.getBody(); + return root; + }; + var $_2bncsnfujfuw8plw = { + getParentList: getParentList, + getSelectedSubLists: getSelectedSubLists, + getSelectedListItems: getSelectedListItems, + getClosestListRootElm: getClosestListRootElm + }; - if (node === endNode) { + var global$8 = tinymce.util.Tools.resolve('tinymce.Env'); + + var DOM$2 = global$6.DOM; + var createNewTextBlock = function (editor, contentNode, blockName) { + var node, textBlock; + var fragment = DOM$2.createFragment(); + var hasContentNode; + var blockElements = editor.schema.getBlockElements(); + if (editor.settings.forced_root_block) { + blockName = blockName || editor.settings.forced_root_block; + } + if (blockName) { + textBlock = DOM$2.create(blockName); + if (textBlock.tagName === editor.settings.forced_root_block) { + DOM$2.setAttribs(textBlock, editor.settings.forced_root_block_attrs); + } + if (!$_fmlqy7fsjfuw8plr.isBlock(contentNode.firstChild, blockElements)) { + fragment.appendChild(textBlock); + } + } + if (contentNode) { + while (node = contentNode.firstChild) { + var nodeName = node.nodeName; + if (!hasContentNode && (nodeName !== 'SPAN' || node.getAttribute('data-mce-type') !== 'bookmark')) { + hasContentNode = true; + } + if ($_fmlqy7fsjfuw8plr.isBlock(node, blockElements)) { + fragment.appendChild(node); + textBlock = null; + } else { + if (blockName) { + if (!textBlock) { + textBlock = DOM$2.create(blockName); + fragment.appendChild(textBlock); + } + textBlock.appendChild(node); + } else { + fragment.appendChild(node); + } + } + } + } + if (!editor.settings.forced_root_block) { + fragment.appendChild(DOM$2.create('br')); + } else { + if (!hasContentNode && (!global$8.ie || global$8.ie > 10)) { + textBlock.appendChild(DOM$2.create('br', { 'data-mce-bogus': '1' })); + } + } + return fragment; + }; + var $_3c0i4zfxjfuw8pm1 = { createNewTextBlock: createNewTextBlock }; + + var DOM$3 = global$6.DOM; + var splitList = function (editor, ul, li, newBlock) { + var tmpRng, fragment, bookmarks, node; + var removeAndKeepBookmarks = function (targetNode) { + global$5.each(bookmarks, function (node) { + targetNode.parentNode.insertBefore(node, li.parentNode); + }); + DOM$3.remove(targetNode); + }; + bookmarks = DOM$3.select('span[data-mce-type="bookmark"]', ul); + newBlock = newBlock || $_3c0i4zfxjfuw8pm1.createNewTextBlock(editor, li); + tmpRng = DOM$3.createRng(); + tmpRng.setStartAfter(li); + tmpRng.setEndAfter(ul); + fragment = tmpRng.extractContents(); + for (node = fragment.firstChild; node; node = node.firstChild) { + if (node.nodeName === 'LI' && editor.dom.isEmpty(node)) { + DOM$3.remove(node); + break; + } + } + if (!editor.dom.isEmpty(fragment)) { + DOM$3.insertAfter(fragment, ul); + } + DOM$3.insertAfter(newBlock, ul); + if ($_fmlqy7fsjfuw8plr.isEmpty(editor.dom, li.parentNode)) { + removeAndKeepBookmarks(li.parentNode); + } + DOM$3.remove(li); + if ($_fmlqy7fsjfuw8plr.isEmpty(editor.dom, ul)) { + DOM$3.remove(ul); + } + }; + var $_dbkw03fwjfuw8plz = { splitList: splitList }; + + var DOM$4 = global$6.DOM; + var removeEmptyLi = function (dom, li) { + if ($_fmlqy7fsjfuw8plr.isEmpty(dom, li)) { + DOM$4.remove(li); + } + }; + var outdent = function (editor, li) { + var ul = li.parentNode; + var ulParent, newBlock; + if (ul) { + ulParent = ul.parentNode; + } else { + removeEmptyLi(editor.dom, li); + return true; + } + if (ul === editor.getBody()) { + return true; + } + if (li.nodeName === 'DD') { + DOM$4.rename(li, 'DT'); + return true; + } + if ($_fmlqy7fsjfuw8plr.isFirstChild(li) && $_fmlqy7fsjfuw8plr.isLastChild(li)) { + if (ulParent.nodeName === 'LI') { + DOM$4.insertAfter(li, ulParent); + removeEmptyLi(editor.dom, ulParent); + DOM$4.remove(ul); + } else if ($_fmlqy7fsjfuw8plr.isListNode(ulParent)) { + DOM$4.remove(ul, true); + } else { + ulParent.insertBefore($_3c0i4zfxjfuw8pm1.createNewTextBlock(editor, li), ul); + DOM$4.remove(ul); + } + return true; + } else if ($_fmlqy7fsjfuw8plr.isFirstChild(li)) { + if (ulParent.nodeName === 'LI') { + DOM$4.insertAfter(li, ulParent); + li.appendChild(ul); + removeEmptyLi(editor.dom, ulParent); + } else if ($_fmlqy7fsjfuw8plr.isListNode(ulParent)) { + ulParent.insertBefore(li, ul); + } else { + ulParent.insertBefore($_3c0i4zfxjfuw8pm1.createNewTextBlock(editor, li), ul); + DOM$4.remove(li); + } + return true; + } else if ($_fmlqy7fsjfuw8plr.isLastChild(li)) { + if (ulParent.nodeName === 'LI') { + DOM$4.insertAfter(li, ulParent); + } else if ($_fmlqy7fsjfuw8plr.isListNode(ulParent)) { + DOM$4.insertAfter(li, ul); + } else { + DOM$4.insertAfter($_3c0i4zfxjfuw8pm1.createNewTextBlock(editor, li), ul); + DOM$4.remove(li); + } + return true; + } + if (ulParent.nodeName === 'LI') { + ul = ulParent; + newBlock = $_3c0i4zfxjfuw8pm1.createNewTextBlock(editor, li, 'LI'); + } else if ($_fmlqy7fsjfuw8plr.isListNode(ulParent)) { + newBlock = $_3c0i4zfxjfuw8pm1.createNewTextBlock(editor, li, 'LI'); + } else { + newBlock = $_3c0i4zfxjfuw8pm1.createNewTextBlock(editor, li); + } + $_dbkw03fwjfuw8plz.splitList(editor, ul, li, newBlock); + $_7p90zmftjfuw8plu.normalizeLists(editor.dom, ul.parentNode); + return true; + }; + var outdentSelection = function (editor) { + var listElements = $_2bncsnfujfuw8plw.getSelectedListItems(editor); + if (listElements.length) { + var bookmark = $_3byghwfqjfuw8pln.createBookmark(editor.selection.getRng()); + var i = void 0, y = void 0; + var root = $_2bncsnfujfuw8plw.getClosestListRootElm(editor, editor.selection.getStart(true)); + i = listElements.length; + while (i--) { + var node = listElements[i].parentNode; + while (node && node !== root) { + y = listElements.length; + while (y--) { + if (listElements[y] === node) { + listElements.splice(i, 1); + break; + } + } + node = node.parentNode; + } + } + for (i = 0; i < listElements.length; i++) { + if (!outdent(editor, listElements[i]) && i === 0) { break; } } + editor.selection.setRng($_3byghwfqjfuw8pln.resolveBookmark(bookmark)); + editor.nodeChanged(); + return true; + } + }; + var $_b067pwfojfuw8plj = { + outdent: outdent, + outdentSelection: outdentSelection + }; - Tools.each(siblings, function (node) { - if (NodeType.isTextBlock(editor, node)) { - textBlocks.push(node); - block = null; - return; - } - - if (dom.isBlock(node) || NodeType.isBr(node)) { - if (NodeType.isBr(node)) { - dom.remove(node); - } - - block = null; - return; - } - - var nextSibling = node.nextSibling; - if (BookmarkManager.isBookmarkNode(node)) { - if (NodeType.isTextBlock(editor, nextSibling) || (!nextSibling && node.parentNode === root)) { - block = null; - return; - } - } - - if (!block) { - block = dom.create('p'); - node.parentNode.insertBefore(block, node); - textBlocks.push(block); - } - - block.appendChild(node); - }); - - return textBlocks; - }; - - var applyList = function (editor, listName, detail) { - var rng = editor.selection.getRng(true), bookmark, listItemName = 'LI'; - var dom = editor.dom; - - detail = detail ? detail : {}; - - if (dom.getContentEditable(editor.selection.getNode()) === "false") { + var updateListStyle = function (dom, el, detail) { + var type = detail['list-style-type'] ? detail['list-style-type'] : null; + dom.setStyle(el, 'list-style-type', type); + }; + var setAttribs = function (elm, attrs) { + global$5.each(attrs, function (value, key) { + elm.setAttribute(key, value); + }); + }; + var updateListAttrs = function (dom, el, detail) { + setAttribs(el, detail['list-attributes']); + global$5.each(dom.select('li', el), function (li) { + setAttribs(li, detail['list-item-attributes']); + }); + }; + var updateListWithDetails = function (dom, el, detail) { + updateListStyle(dom, el, detail); + updateListAttrs(dom, el, detail); + }; + var removeStyles = function (dom, element, styles) { + global$5.each(styles, function (style) { + return dom.setStyle(element, (_a = {}, _a[style] = '', _a)); + var _a; + }); + }; + var getEndPointNode = function (editor, rng, start, root) { + var container, offset; + container = rng[start ? 'startContainer' : 'endContainer']; + offset = rng[start ? 'startOffset' : 'endOffset']; + if (container.nodeType === 1) { + container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; + } + if (!start && $_fmlqy7fsjfuw8plr.isBr(container.nextSibling)) { + container = container.nextSibling; + } + while (container.parentNode !== root) { + if ($_fmlqy7fsjfuw8plr.isTextBlock(editor, container)) { + return container; + } + if (/^(TD|TH)$/.test(container.parentNode.nodeName)) { + return container; + } + container = container.parentNode; + } + return container; + }; + var getSelectedTextBlocks = function (editor, rng, root) { + var textBlocks = [], dom = editor.dom; + var startNode = getEndPointNode(editor, rng, true, root); + var endNode = getEndPointNode(editor, rng, false, root); + var block; + var siblings = []; + for (var node = startNode; node; node = node.nextSibling) { + siblings.push(node); + if (node === endNode) { + break; + } + } + global$5.each(siblings, function (node) { + if ($_fmlqy7fsjfuw8plr.isTextBlock(editor, node)) { + textBlocks.push(node); + block = null; return; } - - listName = listName.toUpperCase(); - - if (listName === 'DL') { - listItemName = 'DT'; - } - - bookmark = Bookmark.createBookmark(rng); - - Tools.each(getSelectedTextBlocks(editor, rng), function (block) { - var listBlock, sibling; - - var hasCompatibleStyle = function (sib) { - var sibStyle = dom.getStyle(sib, 'list-style-type'); - var detailStyle = detail ? detail['list-style-type'] : ''; - - detailStyle = detailStyle === null ? '' : detailStyle; - - return sibStyle === detailStyle; - }; - - sibling = block.previousSibling; - if (sibling && NodeType.isListNode(sibling) && sibling.nodeName === listName && hasCompatibleStyle(sibling)) { - listBlock = sibling; - block = dom.rename(block, listItemName); - sibling.appendChild(block); - } else { - listBlock = dom.create(listName); - block.parentNode.insertBefore(listBlock, block); - listBlock.appendChild(block); - block = dom.rename(block, listItemName); + if (dom.isBlock(node) || $_fmlqy7fsjfuw8plr.isBr(node)) { + if ($_fmlqy7fsjfuw8plr.isBr(node)) { + dom.remove(node); } - - updateListWithDetails(dom, listBlock, detail); - mergeWithAdjacentLists(editor.dom, listBlock); - }); - - editor.selection.setRng(Bookmark.resolveBookmark(bookmark)); - }; - - var removeList = function (editor) { - var bookmark = Bookmark.createBookmark(editor.selection.getRng(true)), root = editor.getBody(); - var listItems = Selection.getSelectedListItems(editor); - var emptyListItems = Tools.grep(listItems, function (li) { - return editor.dom.isEmpty(li); - }); - - listItems = Tools.grep(listItems, function (li) { - return !editor.dom.isEmpty(li); - }); - - Tools.each(emptyListItems, function (li) { - if (NodeType.isEmpty(editor.dom, li)) { - Outdent.outdent(editor, li); + block = null; + return; + } + var nextSibling = node.nextSibling; + if (global$4.isBookmarkNode(node)) { + if ($_fmlqy7fsjfuw8plr.isTextBlock(editor, nextSibling) || !nextSibling && node.parentNode === root) { + block = null; return; } - }); - - Tools.each(listItems, function (li) { - var node, rootList; - - if (li.parentNode === editor.getBody()) { - return; - } - - for (node = li; node && node !== root; node = node.parentNode) { - if (NodeType.isListNode(node)) { - rootList = node; - } - } - - SplitList.splitList(editor, rootList, li); - NormalizeLists.normalizeLists(editor.dom, rootList.parentNode); - }); - - editor.selection.setRng(Bookmark.resolveBookmark(bookmark)); - }; - - var isValidLists = function (list1, list2) { - return list1 && list2 && NodeType.isListNode(list1) && list1.nodeName === list2.nodeName; - }; - - var hasSameListStyle = function (dom, list1, list2) { - var targetStyle = dom.getStyle(list1, 'list-style-type', true); - var style = dom.getStyle(list2, 'list-style-type', true); - return targetStyle === style; - }; - - var hasSameClasses = function (elm1, elm2) { - return elm1.className === elm2.className; - }; - - var shouldMerge = function (dom, list1, list2) { - return isValidLists(list1, list2) && hasSameListStyle(dom, list1, list2) && hasSameClasses(list1, list2); - }; - - var mergeWithAdjacentLists = function (dom, listBlock) { - var sibling, node; - - sibling = listBlock.nextSibling; - if (shouldMerge(dom, listBlock, sibling)) { - while ((node = sibling.firstChild)) { - listBlock.appendChild(node); - } - - dom.remove(sibling); } - - sibling = listBlock.previousSibling; - if (shouldMerge(dom, listBlock, sibling)) { - while ((node = sibling.lastChild)) { - listBlock.insertBefore(node, listBlock.firstChild); - } - - dom.remove(sibling); + if (!block) { + block = dom.create('p'); + node.parentNode.insertBefore(block, node); + textBlocks.push(block); } - }; - - var updateList = function (dom, list, listName, detail) { - if (list.nodeName !== listName) { - var newList = dom.rename(list, listName); - updateListWithDetails(dom, newList, detail); + block.appendChild(node); + }); + return textBlocks; + }; + var hasCompatibleStyle = function (dom, sib, detail) { + var sibStyle = dom.getStyle(sib, 'list-style-type'); + var detailStyle = detail ? detail['list-style-type'] : ''; + detailStyle = detailStyle === null ? '' : detailStyle; + return sibStyle === detailStyle; + }; + var applyList = function (editor, listName, detail) { + if (detail === void 0) { + detail = {}; + } + var rng = editor.selection.getRng(true); + var bookmark; + var listItemName = 'LI'; + var root = $_2bncsnfujfuw8plw.getClosestListRootElm(editor, editor.selection.getStart(true)); + var dom = editor.dom; + if (dom.getContentEditable(editor.selection.getNode()) === 'false') { + return; + } + listName = listName.toUpperCase(); + if (listName === 'DL') { + listItemName = 'DT'; + } + bookmark = $_3byghwfqjfuw8pln.createBookmark(rng); + global$5.each(getSelectedTextBlocks(editor, rng, root), function (block) { + var listBlock, sibling; + sibling = block.previousSibling; + if (sibling && $_fmlqy7fsjfuw8plr.isListNode(sibling) && sibling.nodeName === listName && hasCompatibleStyle(dom, sibling, detail)) { + listBlock = sibling; + block = dom.rename(block, listItemName); + sibling.appendChild(block); } else { - updateListWithDetails(dom, list, detail); + listBlock = dom.create(listName); + block.parentNode.insertBefore(listBlock, block); + listBlock.appendChild(block); + block = dom.rename(block, listItemName); } - }; - - var toggleMultipleLists = function (editor, parentList, lists, listName, detail) { + removeStyles(dom, block, [ + 'margin', + 'margin-right', + 'margin-bottom', + 'margin-left', + 'margin-top', + 'padding', + 'padding-right', + 'padding-bottom', + 'padding-left', + 'padding-top' + ]); + updateListWithDetails(dom, listBlock, detail); + mergeWithAdjacentLists(editor.dom, listBlock); + }); + editor.selection.setRng($_3byghwfqjfuw8pln.resolveBookmark(bookmark)); + }; + var removeList = function (editor) { + var bookmark = $_3byghwfqjfuw8pln.createBookmark(editor.selection.getRng(true)); + var root = $_2bncsnfujfuw8plw.getClosestListRootElm(editor, editor.selection.getStart(true)); + var listItems = $_2bncsnfujfuw8plw.getSelectedListItems(editor); + var emptyListItems = global$5.grep(listItems, function (li) { + return editor.dom.isEmpty(li); + }); + listItems = global$5.grep(listItems, function (li) { + return !editor.dom.isEmpty(li); + }); + global$5.each(emptyListItems, function (li) { + if ($_fmlqy7fsjfuw8plr.isEmpty(editor.dom, li)) { + $_b067pwfojfuw8plj.outdent(editor, li); + return; + } + }); + global$5.each(listItems, function (li) { + var node, rootList; + if (li.parentNode === editor.getBody()) { + return; + } + for (node = li; node && node !== root; node = node.parentNode) { + if ($_fmlqy7fsjfuw8plr.isListNode(node)) { + rootList = node; + } + } + $_dbkw03fwjfuw8plz.splitList(editor, rootList, li); + $_7p90zmftjfuw8plu.normalizeLists(editor.dom, rootList.parentNode); + }); + editor.selection.setRng($_3byghwfqjfuw8pln.resolveBookmark(bookmark)); + }; + var isValidLists = function (list1, list2) { + return list1 && list2 && $_fmlqy7fsjfuw8plr.isListNode(list1) && list1.nodeName === list2.nodeName; + }; + var hasSameListStyle = function (dom, list1, list2) { + var targetStyle = dom.getStyle(list1, 'list-style-type', true); + var style = dom.getStyle(list2, 'list-style-type', true); + return targetStyle === style; + }; + var hasSameClasses = function (elm1, elm2) { + return elm1.className === elm2.className; + }; + var shouldMerge = function (dom, list1, list2) { + return isValidLists(list1, list2) && hasSameListStyle(dom, list1, list2) && hasSameClasses(list1, list2); + }; + var mergeWithAdjacentLists = function (dom, listBlock) { + var sibling, node; + sibling = listBlock.nextSibling; + if (shouldMerge(dom, listBlock, sibling)) { + while (node = sibling.firstChild) { + listBlock.appendChild(node); + } + dom.remove(sibling); + } + sibling = listBlock.previousSibling; + if (shouldMerge(dom, listBlock, sibling)) { + while (node = sibling.lastChild) { + listBlock.insertBefore(node, listBlock.firstChild); + } + dom.remove(sibling); + } + }; + var updateList = function (dom, list, listName, detail) { + if (list.nodeName !== listName) { + var newList = dom.rename(list, listName); + updateListWithDetails(dom, newList, detail); + } else { + updateListWithDetails(dom, list, detail); + } + }; + var toggleMultipleLists = function (editor, parentList, lists, listName, detail) { + if (parentList.nodeName === listName && !hasListStyleDetail(detail)) { + removeList(editor); + } else { + var bookmark = $_3byghwfqjfuw8pln.createBookmark(editor.selection.getRng(true)); + global$5.each([parentList].concat(lists), function (elm) { + updateList(editor.dom, elm, listName, detail); + }); + editor.selection.setRng($_3byghwfqjfuw8pln.resolveBookmark(bookmark)); + } + }; + var hasListStyleDetail = function (detail) { + return 'list-style-type' in detail; + }; + var toggleSingleList = function (editor, parentList, listName, detail) { + if (parentList === editor.getBody()) { + return; + } + if (parentList) { if (parentList.nodeName === listName && !hasListStyleDetail(detail)) { - removeList(editor, listName); + removeList(editor); } else { - var bookmark = Bookmark.createBookmark(editor.selection.getRng(true)); - - Tools.each([parentList].concat(lists), function (elm) { - updateList(editor.dom, elm, listName, detail); - }); - - editor.selection.setRng(Bookmark.resolveBookmark(bookmark)); + var bookmark = $_3byghwfqjfuw8pln.createBookmark(editor.selection.getRng(true)); + updateListWithDetails(editor.dom, parentList, detail); + mergeWithAdjacentLists(editor.dom, editor.dom.rename(parentList, listName)); + editor.selection.setRng($_3byghwfqjfuw8pln.resolveBookmark(bookmark)); } - }; + } else { + applyList(editor, listName, detail); + } + }; + var toggleList = function (editor, listName, detail) { + var parentList = $_2bncsnfujfuw8plw.getParentList(editor); + var selectedSubLists = $_2bncsnfujfuw8plw.getSelectedSubLists(editor); + detail = detail ? detail : {}; + if (parentList && selectedSubLists.length > 0) { + toggleMultipleLists(editor, parentList, selectedSubLists, listName, detail); + } else { + toggleSingleList(editor, parentList, listName, detail); + } + }; + var $_8qbnsrfljfuw8plb = { + toggleList: toggleList, + removeList: removeList, + mergeWithAdjacentLists: mergeWithAdjacentLists + }; - var hasListStyleDetail = function (detail) { - return 'list-style-type' in detail; - }; - - var toggleSingleList = function (editor, parentList, listName, detail) { - if (parentList === editor.getBody()) { - return; + var findNextCaretContainer = function (editor, rng, isForward, root) { + var node = rng.startContainer; + var offset = rng.startOffset; + var nonEmptyBlocks, walker; + if (node.nodeType === 3 && (isForward ? offset < node.data.length : offset > 0)) { + return node; + } + nonEmptyBlocks = editor.schema.getNonEmptyElements(); + if (node.nodeType === 1) { + node = global$1.getNode(node, offset); + } + walker = new global$2(node, root); + if (isForward) { + if ($_fmlqy7fsjfuw8plr.isBogusBr(editor.dom, node)) { + walker.next(); } - - if (parentList) { - if (parentList.nodeName === listName && !hasListStyleDetail(detail)) { - removeList(editor, listName); - } else { - var bookmark = Bookmark.createBookmark(editor.selection.getRng(true)); - updateListWithDetails(editor.dom, parentList, detail); - mergeWithAdjacentLists(editor.dom, editor.dom.rename(parentList, listName)); - editor.selection.setRng(Bookmark.resolveBookmark(bookmark)); - } - } else { - applyList(editor, listName, detail); - } - }; - - var toggleList = function (editor, listName, detail) { - var parentList = Selection.getParentList(editor); - var selectedSubLists = Selection.getSelectedSubLists(editor); - - detail = detail ? detail : {}; - - if (parentList && selectedSubLists.length > 0) { - toggleMultipleLists(editor, parentList, selectedSubLists, listName, detail); - } else { - toggleSingleList(editor, parentList, listName, detail); - } - }; - - return { - toggleList: toggleList, - removeList: removeList, - mergeWithAdjacentLists: mergeWithAdjacentLists - }; - } -); - - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.dom.TreeWalker', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.dom.TreeWalker'); - } -); - -/** - * Delete.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 - */ - -define( - 'tinymce.plugins.lists.core.Delete', - [ - 'tinymce.core.dom.RangeUtils', - 'tinymce.core.dom.TreeWalker', - 'tinymce.core.util.VK', - 'tinymce.plugins.lists.actions.ToggleList', - 'tinymce.plugins.lists.core.Bookmark', - 'tinymce.plugins.lists.core.NodeType', - 'tinymce.plugins.lists.core.NormalizeLists', - 'tinymce.plugins.lists.core.Range', - 'tinymce.plugins.lists.core.Selection' - ], - function (RangeUtils, TreeWalker, VK, ToggleList, Bookmark, NodeType, NormalizeLists, Range, Selection) { - var findNextCaretContainer = function (editor, rng, isForward) { - var node = rng.startContainer, offset = rng.startOffset; - var nonEmptyBlocks, walker; - - if (node.nodeType === 3 && (isForward ? offset < node.data.length : offset > 0)) { + } + while (node = walker[isForward ? 'next' : 'prev2']()) { + if (node.nodeName === 'LI' && !node.hasChildNodes()) { return node; } - - nonEmptyBlocks = editor.schema.getNonEmptyElements(); - if (node.nodeType === 1) { - node = RangeUtils.getNode(node, offset); + if (nonEmptyBlocks[node.nodeName]) { + return node; } - - walker = new TreeWalker(node, editor.getBody()); - - // Delete at
  • |
  • then jump over the bogus br - if (isForward) { - if (NodeType.isBogusBr(editor.dom, node)) { - walker.next(); - } + if (node.nodeType === 3 && node.data.length > 0) { + return node; } - - while ((node = walker[isForward ? 'next' : 'prev2']())) { - if (node.nodeName === 'LI' && !node.hasChildNodes()) { - return node; - } - - if (nonEmptyBlocks[node.nodeName]) { - return node; - } - - if (node.nodeType === 3 && node.data.length > 0) { - return node; - } + } + }; + var hasOnlyOneBlockChild = function (dom, elm) { + var childNodes = elm.childNodes; + return childNodes.length === 1 && !$_fmlqy7fsjfuw8plr.isListNode(childNodes[0]) && dom.isBlock(childNodes[0]); + }; + var unwrapSingleBlockChild = function (dom, elm) { + if (hasOnlyOneBlockChild(dom, elm)) { + dom.remove(elm.firstChild, true); + } + }; + var moveChildren = function (dom, fromElm, toElm) { + var node, targetElm; + targetElm = hasOnlyOneBlockChild(dom, toElm) ? toElm.firstChild : toElm; + unwrapSingleBlockChild(dom, fromElm); + if (!$_fmlqy7fsjfuw8plr.isEmpty(dom, fromElm, true)) { + while (node = fromElm.firstChild) { + targetElm.appendChild(node); } - }; - - var hasOnlyOneBlockChild = function (dom, elm) { - var childNodes = elm.childNodes; - return childNodes.length === 1 && !NodeType.isListNode(childNodes[0]) && dom.isBlock(childNodes[0]); - }; - - var unwrapSingleBlockChild = function (dom, elm) { - if (hasOnlyOneBlockChild(dom, elm)) { - dom.remove(elm.firstChild, true); + } + }; + var mergeLiElements = function (dom, fromElm, toElm) { + var node, listNode; + var ul = fromElm.parentNode; + if (!$_fmlqy7fsjfuw8plr.isChildOfBody(dom, fromElm) || !$_fmlqy7fsjfuw8plr.isChildOfBody(dom, toElm)) { + return; + } + if ($_fmlqy7fsjfuw8plr.isListNode(toElm.lastChild)) { + listNode = toElm.lastChild; + } + if (ul === toElm.lastChild) { + if ($_fmlqy7fsjfuw8plr.isBr(ul.previousSibling)) { + dom.remove(ul.previousSibling); } - }; - - var moveChildren = function (dom, fromElm, toElm) { - var node, targetElm; - - targetElm = hasOnlyOneBlockChild(dom, toElm) ? toElm.firstChild : toElm; - unwrapSingleBlockChild(dom, fromElm); - - if (!NodeType.isEmpty(dom, fromElm, true)) { - while ((node = fromElm.firstChild)) { - targetElm.appendChild(node); - } - } - }; - - var mergeLiElements = function (dom, fromElm, toElm) { - var node, listNode, ul = fromElm.parentNode; - - if (!NodeType.isChildOfBody(dom, fromElm) || !NodeType.isChildOfBody(dom, toElm)) { - return; - } - - if (NodeType.isListNode(toElm.lastChild)) { - listNode = toElm.lastChild; - } - - if (ul === toElm.lastChild) { - if (NodeType.isBr(ul.previousSibling)) { - dom.remove(ul.previousSibling); - } - } - - node = toElm.lastChild; - if (node && NodeType.isBr(node) && fromElm.hasChildNodes()) { - dom.remove(node); - } - - if (NodeType.isEmpty(dom, toElm, true)) { - dom.$(toElm).empty(); - } - - moveChildren(dom, fromElm, toElm); - - if (listNode) { - toElm.appendChild(listNode); - } - - dom.remove(fromElm); - - if (NodeType.isEmpty(dom, ul) && ul !== dom.getRoot()) { - dom.remove(ul); - } - }; - - var mergeIntoEmptyLi = function (editor, fromLi, toLi) { - editor.dom.$(toLi).empty(); - mergeLiElements(editor.dom, fromLi, toLi); - editor.selection.setCursorLocation(toLi); - }; - - var mergeForward = function (editor, rng, fromLi, toLi) { - var dom = editor.dom; - - if (dom.isEmpty(toLi)) { - mergeIntoEmptyLi(editor, fromLi, toLi); - } else { - var bookmark = Bookmark.createBookmark(rng); - mergeLiElements(dom, fromLi, toLi); - editor.selection.setRng(Bookmark.resolveBookmark(bookmark)); - } - }; - - var mergeBackward = function (editor, rng, fromLi, toLi) { - var bookmark = Bookmark.createBookmark(rng); - mergeLiElements(editor.dom, fromLi, toLi); - editor.selection.setRng(Bookmark.resolveBookmark(bookmark)); - }; - - var backspaceDeleteFromListToListCaret = function (editor, isForward) { - var dom = editor.dom, selection = editor.selection; - var li = dom.getParent(selection.getStart(), 'LI'), ul, rng, otherLi; - - if (li) { - ul = li.parentNode; - if (ul === editor.getBody() && NodeType.isEmpty(dom, ul)) { - return true; - } - - rng = Range.normalizeRange(selection.getRng(true)); - otherLi = dom.getParent(findNextCaretContainer(editor, rng, isForward), 'LI'); - - if (otherLi && otherLi !== li) { - if (isForward) { - mergeForward(editor, rng, otherLi, li); - } else { - mergeBackward(editor, rng, li, otherLi); - } - - return true; - } else if (!otherLi) { - if (!isForward && ToggleList.removeList(editor, ul.nodeName)) { - return true; - } - } - } - - return false; - }; - - var removeBlock = function (dom, block) { - var parentBlock = dom.getParent(block.parentNode, dom.isBlock); - - dom.remove(block); - if (parentBlock && dom.isEmpty(parentBlock)) { - dom.remove(parentBlock); - } - }; - - var backspaceDeleteIntoListCaret = function (editor, isForward) { - var dom = editor.dom; - var block = dom.getParent(editor.selection.getStart(), dom.isBlock); - - if (block && dom.isEmpty(block)) { - var rng = Range.normalizeRange(editor.selection.getRng(true)); - var otherLi = dom.getParent(findNextCaretContainer(editor, rng, isForward), 'LI'); - - if (otherLi) { - editor.undoManager.transact(function () { - removeBlock(dom, block); - ToggleList.mergeWithAdjacentLists(dom, otherLi.parentNode); - editor.selection.select(otherLi, true); - editor.selection.collapse(isForward); - }); - - return true; - } - } - - return false; - }; - - var backspaceDeleteCaret = function (editor, isForward) { - return backspaceDeleteFromListToListCaret(editor, isForward) || backspaceDeleteIntoListCaret(editor, isForward); - }; - - var backspaceDeleteRange = function (editor) { - var startListParent = editor.dom.getParent(editor.selection.getStart(), 'LI,DT,DD'); - - if (startListParent || Selection.getSelectedListItems(editor).length > 0) { - editor.undoManager.transact(function () { - editor.execCommand('Delete'); - NormalizeLists.normalizeLists(editor.dom, editor.getBody()); - }); - + } + node = toElm.lastChild; + if (node && $_fmlqy7fsjfuw8plr.isBr(node) && fromElm.hasChildNodes()) { + dom.remove(node); + } + if ($_fmlqy7fsjfuw8plr.isEmpty(dom, toElm, true)) { + dom.$(toElm).empty(); + } + moveChildren(dom, fromElm, toElm); + if (listNode) { + toElm.appendChild(listNode); + } + dom.remove(fromElm); + if ($_fmlqy7fsjfuw8plr.isEmpty(dom, ul) && ul !== dom.getRoot()) { + dom.remove(ul); + } + }; + var mergeIntoEmptyLi = function (editor, fromLi, toLi) { + editor.dom.$(toLi).empty(); + mergeLiElements(editor.dom, fromLi, toLi); + editor.selection.setCursorLocation(toLi); + }; + var mergeForward = function (editor, rng, fromLi, toLi) { + var dom = editor.dom; + if (dom.isEmpty(toLi)) { + mergeIntoEmptyLi(editor, fromLi, toLi); + } else { + var bookmark = $_3byghwfqjfuw8pln.createBookmark(rng); + mergeLiElements(dom, fromLi, toLi); + editor.selection.setRng($_3byghwfqjfuw8pln.resolveBookmark(bookmark)); + } + }; + var mergeBackward = function (editor, rng, fromLi, toLi) { + var bookmark = $_3byghwfqjfuw8pln.createBookmark(rng); + mergeLiElements(editor.dom, fromLi, toLi); + var resolvedBookmark = $_3byghwfqjfuw8pln.resolveBookmark(bookmark); + editor.selection.setRng(resolvedBookmark); + }; + var backspaceDeleteFromListToListCaret = function (editor, isForward) { + var dom = editor.dom, selection = editor.selection; + var selectionStartElm = selection.getStart(); + var root = $_2bncsnfujfuw8plw.getClosestListRootElm(editor, selectionStartElm); + var li = dom.getParent(selection.getStart(), 'LI', root); + var ul, rng, otherLi; + if (li) { + ul = li.parentNode; + if (ul === editor.getBody() && $_fmlqy7fsjfuw8plr.isEmpty(dom, ul)) { return true; } - - return false; - }; - - var backspaceDelete = function (editor, isForward) { - return editor.selection.isCollapsed() ? backspaceDeleteCaret(editor, isForward) : backspaceDeleteRange(editor); - }; - - var setup = function (editor) { - editor.on('keydown', function (e) { - if (e.keyCode === VK.BACKSPACE) { - if (backspaceDelete(editor, false)) { - e.preventDefault(); - } - } else if (e.keyCode === VK.DELETE) { - if (backspaceDelete(editor, true)) { - e.preventDefault(); - } + rng = $_14fh94frjfuw8plp.normalizeRange(selection.getRng(true)); + otherLi = dom.getParent(findNextCaretContainer(editor, rng, isForward, root), 'LI', root); + if (otherLi && otherLi !== li) { + if (isForward) { + mergeForward(editor, rng, otherLi, li); + } else { + mergeBackward(editor, rng, li, otherLi); } - }); - }; - - return { - setup: setup, - backspaceDelete: backspaceDelete - }; - } -); - - -/** - * 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 - */ - -define( - 'tinymce.plugins.lists.Plugin', - [ - 'tinymce.core.PluginManager', - 'tinymce.core.util.Tools', - 'tinymce.core.util.VK', - 'tinymce.plugins.lists.actions.Indent', - 'tinymce.plugins.lists.actions.Outdent', - 'tinymce.plugins.lists.actions.ToggleList', - 'tinymce.plugins.lists.core.Delete', - 'tinymce.plugins.lists.core.NodeType', - 'tinymce.plugins.lists.core.Selection' - ], - function (PluginManager, Tools, VK, Indent, Outdent, ToggleList, Delete, NodeType, Selection) { - var queryListCommandState = function (editor, listName) { - return function () { - var parentList = editor.dom.getParent(editor.selection.getStart(), 'UL,OL,DL'); - return parentList && parentList.nodeName === listName; - }; - }; - - var setupCommands = function (editor) { - editor.on('BeforeExecCommand', function (e) { - var cmd = e.command.toLowerCase(), isHandled; - - if (cmd === "indent") { - if (Indent.indentSelection(editor)) { - isHandled = true; - } - } else if (cmd === "outdent") { - if (Outdent.outdentSelection(editor)) { - isHandled = true; - } - } - - if (isHandled) { - editor.fire('ExecCommand', { command: e.command }); - e.preventDefault(); + return true; + } else if (!otherLi) { + if (!isForward && $_8qbnsrfljfuw8plb.removeList(editor)) { return true; } - }); - - editor.addCommand('InsertUnorderedList', function (ui, detail) { - ToggleList.toggleList(editor, 'UL', detail); - }); - - editor.addCommand('InsertOrderedList', function (ui, detail) { - ToggleList.toggleList(editor, 'OL', detail); - }); - - editor.addCommand('InsertDefinitionList', function (ui, detail) { - ToggleList.toggleList(editor, 'DL', detail); - }); - }; - - var setupStateHandlers = function (editor) { - editor.addQueryStateHandler('InsertUnorderedList', queryListCommandState(editor, 'UL')); - editor.addQueryStateHandler('InsertOrderedList', queryListCommandState(editor, 'OL')); - editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState(editor, 'DL')); - }; - - var setupTabKey = function (editor) { - editor.on('keydown', function (e) { - // Check for tab but not ctrl/cmd+tab since it switches browser tabs - if (e.keyCode !== 9 || VK.metaKeyPressed(e)) { - return; - } - - if (editor.dom.getParent(editor.selection.getStart(), 'LI,DT,DD')) { - e.preventDefault(); - - if (e.shiftKey) { - Outdent.outdentSelection(editor); - } else { - Indent.indentSelection(editor); - } - } - }); - }; - - var setupUi = function (editor) { - var listState = function (listName) { - return function () { - var self = this; - - editor.on('NodeChange', function (e) { - var lists = Tools.grep(e.parents, NodeType.isListNode); - self.active(lists.length > 0 && lists[0].nodeName === listName); - }); - }; - }; - - var hasPlugin = function (editor, plugin) { - var plugins = editor.settings.plugins ? editor.settings.plugins : ''; - return Tools.inArray(plugins.split(/[ ,]/), plugin) !== -1; - }; - - if (!hasPlugin(editor, 'advlist')) { - editor.addButton('numlist', { - title: 'Numbered list', - cmd: 'InsertOrderedList', - onPostRender: listState('OL') - }); - - editor.addButton('bullist', { - title: 'Bullet list', - cmd: 'InsertUnorderedList', - onPostRender: listState('UL') - }); } - - editor.addButton('indent', { - icon: 'indent', - title: 'Increase indent', - cmd: 'Indent', - onPostRender: function (e) { - var ctrl = e.control; - - editor.on('nodechange', function () { - var listItemBlocks = Selection.getSelectedListItems(editor); - var disable = listItemBlocks.length > 0 && NodeType.isFirstChild(listItemBlocks[0]); - ctrl.disabled(disable); - }); + } + return false; + }; + var removeBlock = function (dom, block, root) { + var parentBlock = dom.getParent(block.parentNode, dom.isBlock, root); + dom.remove(block); + if (parentBlock && dom.isEmpty(parentBlock)) { + dom.remove(parentBlock); + } + }; + var backspaceDeleteIntoListCaret = function (editor, isForward) { + var dom = editor.dom; + var selectionStartElm = editor.selection.getStart(); + var root = $_2bncsnfujfuw8plw.getClosestListRootElm(editor, selectionStartElm); + var block = dom.getParent(selectionStartElm, dom.isBlock, root); + if (block && dom.isEmpty(block)) { + var rng = $_14fh94frjfuw8plp.normalizeRange(editor.selection.getRng(true)); + var otherLi_1 = dom.getParent(findNextCaretContainer(editor, rng, isForward, root), 'LI', root); + if (otherLi_1) { + editor.undoManager.transact(function () { + removeBlock(dom, block, root); + $_8qbnsrfljfuw8plb.mergeWithAdjacentLists(dom, otherLi_1.parentNode); + editor.selection.select(otherLi_1, true); + editor.selection.collapse(isForward); + }); + return true; + } + } + return false; + }; + var backspaceDeleteCaret = function (editor, isForward) { + return backspaceDeleteFromListToListCaret(editor, isForward) || backspaceDeleteIntoListCaret(editor, isForward); + }; + var backspaceDeleteRange = function (editor) { + var selectionStartElm = editor.selection.getStart(); + var root = $_2bncsnfujfuw8plw.getClosestListRootElm(editor, selectionStartElm); + var startListParent = editor.dom.getParent(selectionStartElm, 'LI,DT,DD', root); + if (startListParent || $_2bncsnfujfuw8plw.getSelectedListItems(editor).length > 0) { + editor.undoManager.transact(function () { + editor.execCommand('Delete'); + $_7p90zmftjfuw8plu.normalizeLists(editor.dom, editor.getBody()); + }); + return true; + } + return false; + }; + var backspaceDelete = function (editor, isForward) { + return editor.selection.isCollapsed() ? backspaceDeleteCaret(editor, isForward) : backspaceDeleteRange(editor); + }; + var setup = function (editor) { + editor.on('keydown', function (e) { + if (e.keyCode === global$3.BACKSPACE) { + if (backspaceDelete(editor, false)) { + e.preventDefault(); } + } else if (e.keyCode === global$3.DELETE) { + if (backspaceDelete(editor, true)) { + e.preventDefault(); + } + } + }); + }; + var $_6qu3vpfhjfuw8pl2 = { + setup: setup, + backspaceDelete: backspaceDelete + }; + + var get = function (editor) { + return { + backspaceDelete: function (isForward) { + $_6qu3vpfhjfuw8pl2.backspaceDelete(editor, isForward); + } + }; + }; + var $_bgmttlfgjfuw8pl0 = { get: get }; + + var DOM$5 = global$6.DOM; + var mergeLists = function (from, to) { + var node; + if ($_fmlqy7fsjfuw8plr.isListNode(from)) { + while (node = from.firstChild) { + to.appendChild(node); + } + DOM$5.remove(from); + } + }; + var indent = function (li) { + var sibling, newList, listStyle; + if (li.nodeName === 'DT') { + DOM$5.rename(li, 'DD'); + return true; + } + sibling = li.previousSibling; + if (sibling && $_fmlqy7fsjfuw8plr.isListNode(sibling)) { + sibling.appendChild(li); + return true; + } + if (sibling && sibling.nodeName === 'LI' && $_fmlqy7fsjfuw8plr.isListNode(sibling.lastChild)) { + sibling.lastChild.appendChild(li); + mergeLists(li.lastChild, sibling.lastChild); + return true; + } + sibling = li.nextSibling; + if (sibling && $_fmlqy7fsjfuw8plr.isListNode(sibling)) { + sibling.insertBefore(li, sibling.firstChild); + return true; + } + sibling = li.previousSibling; + if (sibling && sibling.nodeName === 'LI') { + newList = DOM$5.create(li.parentNode.nodeName); + listStyle = DOM$5.getStyle(li.parentNode, 'listStyleType'); + if (listStyle) { + DOM$5.setStyle(newList, 'listStyleType', listStyle); + } + sibling.appendChild(newList); + newList.appendChild(li); + mergeLists(li.lastChild, newList); + return true; + } + return false; + }; + var indentSelection = function (editor) { + var listElements = $_2bncsnfujfuw8plw.getSelectedListItems(editor); + if (listElements.length) { + var bookmark = $_3byghwfqjfuw8pln.createBookmark(editor.selection.getRng(true)); + for (var i = 0; i < listElements.length; i++) { + if (!indent(listElements[i]) && i === 0) { + break; + } + } + editor.selection.setRng($_3byghwfqjfuw8pln.resolveBookmark(bookmark)); + editor.nodeChanged(); + return true; + } + }; + var $_4zf6mug0jfuw8pm7 = { indentSelection: indentSelection }; + + var queryListCommandState = function (editor, listName) { + return function () { + var parentList = editor.dom.getParent(editor.selection.getStart(), 'UL,OL,DL'); + return parentList && parentList.nodeName === listName; + }; + }; + var register = function (editor) { + editor.on('BeforeExecCommand', function (e) { + var cmd = e.command.toLowerCase(); + var isHandled; + if (cmd === 'indent') { + if ($_4zf6mug0jfuw8pm7.indentSelection(editor)) { + isHandled = true; + } + } else if (cmd === 'outdent') { + if ($_b067pwfojfuw8plj.outdentSelection(editor)) { + isHandled = true; + } + } + if (isHandled) { + editor.fire('ExecCommand', { command: e.command }); + e.preventDefault(); + return true; + } + }); + editor.addCommand('InsertUnorderedList', function (ui, detail) { + $_8qbnsrfljfuw8plb.toggleList(editor, 'UL', detail); + }); + editor.addCommand('InsertOrderedList', function (ui, detail) { + $_8qbnsrfljfuw8plb.toggleList(editor, 'OL', detail); + }); + editor.addCommand('InsertDefinitionList', function (ui, detail) { + $_8qbnsrfljfuw8plb.toggleList(editor, 'DL', detail); + }); + editor.addQueryStateHandler('InsertUnorderedList', queryListCommandState(editor, 'UL')); + editor.addQueryStateHandler('InsertOrderedList', queryListCommandState(editor, 'OL')); + editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState(editor, 'DL')); + }; + var $_ci56e3fzjfuw8pm5 = { register: register }; + + var shouldIndentOnTab = function (editor) { + return editor.getParam('lists_indent_on_tab', true); + }; + var $_e85xmvg2jfuw8pmc = { shouldIndentOnTab: shouldIndentOnTab }; + + var setupTabKey = function (editor) { + editor.on('keydown', function (e) { + if (e.keyCode !== global$3.TAB || global$3.metaKeyPressed(e)) { + return; + } + if (editor.dom.getParent(editor.selection.getStart(), 'LI,DT,DD')) { + e.preventDefault(); + if (e.shiftKey) { + $_b067pwfojfuw8plj.outdentSelection(editor); + } else { + $_4zf6mug0jfuw8pm7.indentSelection(editor); + } + } + }); + }; + var setup$1 = function (editor) { + if ($_e85xmvg2jfuw8pmc.shouldIndentOnTab(editor)) { + setupTabKey(editor); + } + $_6qu3vpfhjfuw8pl2.setup(editor); + }; + var $_1iz32kg1jfuw8pma = { setup: setup$1 }; + + 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, $_fmlqy7fsjfuw8plr.isTableCellNode); + var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents; + var lists = global$5.grep(parents, $_fmlqy7fsjfuw8plr.isListNode); + ctrl.active(lists.length > 0 && lists[0].nodeName === listName); }); }; - - PluginManager.add('lists', function (editor) { - setupUi(editor); - Delete.setup(editor); - - editor.on('init', function () { - setupCommands(editor); - setupStateHandlers(editor); - if (editor.getParam('lists_indent_on_tab', true)) { - setupTabKey(editor); - } + }; + var indentPostRender = function (editor) { + return function (e) { + var ctrl = e.control; + editor.on('nodechange', function () { + var listItemBlocks = $_2bncsnfujfuw8plw.getSelectedListItems(editor); + var disable = listItemBlocks.length > 0 && $_fmlqy7fsjfuw8plr.isFirstChild(listItemBlocks[0]); + ctrl.disabled(disable); }); - - return { - backspaceDelete: function (isForward) { - Delete.backspaceDelete(editor, isForward); - } - }; + }; + }; + var register$1 = function (editor) { + var hasPlugin = function (editor, plugin) { + var plugins = editor.settings.plugins ? editor.settings.plugins : ''; + return global$5.inArray(plugins.split(/[ ,]/), plugin) !== -1; + }; + if (!hasPlugin(editor, 'advlist')) { + editor.addButton('numlist', { + active: false, + title: 'Numbered list', + cmd: 'InsertOrderedList', + onPostRender: listState(editor, 'OL') + }); + editor.addButton('bullist', { + active: false, + title: 'Bullet list', + cmd: 'InsertUnorderedList', + onPostRender: listState(editor, 'UL') + }); + } + editor.addButton('indent', { + icon: 'indent', + title: 'Increase indent', + cmd: 'Indent', + onPostRender: indentPostRender(editor) }); + }; + var $_fizi9xg3jfuw8pmd = { register: register$1 }; - return function () { }; + global.add('lists', function (editor) { + $_1iz32kg1jfuw8pma.setup(editor); + $_fizi9xg3jfuw8pmd.register(editor); + $_ci56e3fzjfuw8pm5.register(editor); + return $_bgmttlfgjfuw8pl0.get(editor); + }); + function Plugin () { } -); + return Plugin; -dem('tinymce.plugins.lists.Plugin')(); +}()); })(); diff --git a/wp-includes/js/tinymce/plugins/lists/plugin.min.js b/wp-includes/js/tinymce/plugins/lists/plugin.min.js index b25d33bf1c..68a1bae4a0 100644 --- a/wp-includes/js/tinymce/plugins/lists/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/lists/plugin.min.js @@ -1 +1 @@ -!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i0)&&d},k=function(a,b){return a.isChildOf(b,a.getRoot())};return{isTextNode:a,isListNode:b,isListItemNode:c,isBr:d,isFirstChild:e,isLastChild:f,isTextBlock:g,isBlock:h,isBogusBr:i,isEmpty:j,isChildOfBody:k}}),g("i",["a"],function(a){return a("tinymce.dom.RangeUtils")}),g("k",["i","8"],function(a,b){var c=function(c,d){var e=a.getNode(c,d);if(b.isListItemNode(c)&&b.isTextNode(e)){var f=d>=c.childNodes.length?e.data.length:0;return{container:e,offset:f}}return{container:c,offset:d}},d=function(a){var b=a.cloneRange(),d=c(a.startContainer,a.startOffset);b.setStart(d.container,d.offset);var e=c(a.endContainer,a.endOffset);return b.setEnd(e.container,e.offset),b};return{getNormalizedEndPoint:c,normalizeRange:d}}),g("c",["b","8","k"],function(a,b,c){var d=a.DOM,e=function(a){var b={},c=function(c){var e,f,g;f=a[c?"startContainer":"endContainer"],g=a[c?"startOffset":"endOffset"],1===f.nodeType&&(e=d.create("span",{"data-mce-type":"bookmark"}),f.hasChildNodes()?(g=Math.min(g,f.childNodes.length-1),c?f.insertBefore(e,f.childNodes[g]):d.insertAfter(e,f.childNodes[g])):f.appendChild(e),f=e,g=0),b[c?"startContainer":"endContainer"]=f,b[c?"startOffset":"endOffset"]=g};return c(!0),a.collapsed||c(),b},f=function(a){function b(b){var c,e,f,g=function(a){for(var b=a.parentNode.firstChild,c=0;b;){if(b===a)return c;1===b.nodeType&&"bookmark"===b.getAttribute("data-mce-type")||c++,b=b.nextSibling}return-1};c=f=a[b?"startContainer":"endContainer"],e=a[b?"startOffset":"endOffset"],c&&(1===c.nodeType&&(e=g(c),c=c.parentNode,d.remove(f)),a[b?"startContainer":"endContainer"]=c,a[b?"startOffset":"endOffset"]=e)}b(!0),b();var e=d.createRng();return e.setStart(a.startContainer,a.startOffset),a.endContainer&&e.setEnd(a.endContainer,a.endOffset),c.normalizeRange(e)};return{createBookmark:e,resolveBookmark:f}}),g("d",["a"],function(a){return a("tinymce.dom.DomQuery")}),g("9",["d","2","8"],function(a,b,c){var d=function(a){return a.dom.getParent(a.selection.getStart(!0),"OL,UL,DL")},e=function(a){var e=d(a);return b.grep(a.selection.getSelectedBlocks(),function(a){return c.isListNode(a)&&e!==a})},f=function(c,d){var e=b.map(d,function(a){var b=c.dom.getParent(a,"li,dd,dt",c.getBody());return b?b:a});return a.unique(e)},g=function(a){var d=a.selection.getSelectedBlocks();return b.grep(f(a,d),function(a){return c.isListItemNode(a)})};return{getParentList:d,getSelectedSubLists:e,getSelectedListItems:g}}),g("4",["b","c","8","9"],function(a,b,c,d){var e=a.DOM,f=function(a,b){var d;if(c.isListNode(a)){for(;d=a.firstChild;)b.appendChild(d);e.remove(a)}},g=function(a){var b,d,g;return"DT"===a.nodeName?(e.rename(a,"DD"),!0):(b=a.previousSibling,b&&c.isListNode(b)?(b.appendChild(a),!0):b&&"LI"===b.nodeName&&c.isListNode(b.lastChild)?(b.lastChild.appendChild(a),f(a.lastChild,b.lastChild),!0):(b=a.nextSibling,b&&c.isListNode(b)?(b.insertBefore(a,b.firstChild),!0):(b=a.previousSibling,!(!b||"LI"!==b.nodeName)&&(d=e.create(a.parentNode.nodeName),g=e.getStyle(a.parentNode,"listStyleType"),g&&e.setStyle(d,"listStyleType",g),b.appendChild(d),d.appendChild(a),f(a.lastChild,d),!0))))},h=function(a){var c=d.getSelectedListItems(a);if(c.length){for(var e=b.createBookmark(a.selection.getRng(!0)),f=0;f10)||h.appendChild(d.create("br",{"data-mce-bogus":"1"})):j.appendChild(d.create("br")),j};return{createNewTextBlock:e}}),g("f",["b","8","g","2"],function(a,b,c,d){var e=a.DOM,f=function(a,f,g,h){var i,j,k,l,m=function(a){d.each(k,function(b){a.parentNode.insertBefore(b,g.parentNode)}),e.remove(a)};for(k=e.select('span[data-mce-type="bookmark"]',f),h=h||c.createNewTextBlock(a,g),i=e.createRng(),i.setStartAfter(g),i.setEndAfter(f),j=i.extractContents(),l=j.firstChild;l;l=l.firstChild)if("LI"===l.nodeName&&a.dom.isEmpty(l)){e.remove(l);break}a.dom.isEmpty(j)||e.insertAfter(j,f),e.insertAfter(h,f),b.isEmpty(a.dom,g.parentNode)&&m(g.parentNode),e.remove(g),b.isEmpty(a.dom,f)&&e.remove(f)};return{splitList:f}}),g("5",["b","c","8","e","9","f","g"],function(a,b,c,d,e,f,g){var h=a.DOM,i=function(a,b){c.isEmpty(a,b)&&h.remove(b)},j=function(a,b){var e,j=b.parentNode,k=j.parentNode;return j===a.getBody()||("DD"===b.nodeName?(h.rename(b,"DT"),!0):c.isFirstChild(b)&&c.isLastChild(b)?("LI"===k.nodeName?(h.insertAfter(b,k),i(a.dom,k),h.remove(j)):c.isListNode(k)?h.remove(j,!0):(k.insertBefore(g.createNewTextBlock(a,b),j),h.remove(j)),!0):c.isFirstChild(b)?("LI"===k.nodeName?(h.insertAfter(b,k),b.appendChild(j),i(a.dom,k)):c.isListNode(k)?k.insertBefore(b,j):(k.insertBefore(g.createNewTextBlock(a,b),j),h.remove(b)),!0):c.isLastChild(b)?("LI"===k.nodeName?h.insertAfter(b,k):c.isListNode(k)?h.insertAfter(b,j):(h.insertAfter(g.createNewTextBlock(a,b),j),h.remove(b)),!0):("LI"===k.nodeName?(j=k,e=g.createNewTextBlock(a,b,"LI")):e=c.isListNode(k)?g.createNewTextBlock(a,b,"LI"):g.createNewTextBlock(a,b),f.splitList(a,j,b,e),d.normalizeLists(a.dom,j.parentNode),!0))},k=function(a){var c=e.getSelectedListItems(a);if(c.length){var d,f,g=b.createBookmark(a.selection.getRng(!0)),h=a.getBody();for(d=c.length;d--;)for(var i=c[d].parentNode;i&&i!==h;){for(f=c.length;f--;)if(c[f]===i){c.splice(d,1);break}i=i.parentNode}for(d=0;d0?w(a,d,e,b,c):y(a,d,b,c)};return{toggleList:z,removeList:p,mergeWithAdjacentLists:u}}),g("j",["a"],function(a){return a("tinymce.dom.TreeWalker")}),g("7",["i","j","3","6","c","8","e","k","9"],function(a,b,c,d,e,f,g,h,i){var j=function(c,d,e){var g,h,i=d.startContainer,j=d.startOffset;if(3===i.nodeType&&(e?j0))return i;for(g=c.schema.getNonEmptyElements(),1===i.nodeType&&(i=a.getNode(i,j)),h=new b(i,c.getBody()),e&&f.isBogusBr(c.dom,i)&&h.next();i=h[e?"next":"prev2"]();){if("LI"===i.nodeName&&!i.hasChildNodes())return i;if(g[i.nodeName])return i;if(3===i.nodeType&&i.data.length>0)return i}},k=function(a,b){var c=b.childNodes;return 1===c.length&&!f.isListNode(c[0])&&a.isBlock(c[0])},l=function(a,b){k(a,b)&&a.remove(b.firstChild,!0)},m=function(a,b,c){var d,e;if(e=k(a,c)?c.firstChild:c,l(a,b),!f.isEmpty(a,b,!0))for(;d=b.firstChild;)e.appendChild(d)},n=function(a,b,c){var d,e,g=b.parentNode;f.isChildOfBody(a,b)&&f.isChildOfBody(a,c)&&(f.isListNode(c.lastChild)&&(e=c.lastChild),g===c.lastChild&&f.isBr(g.previousSibling)&&a.remove(g.previousSibling),d=c.lastChild,d&&f.isBr(d)&&b.hasChildNodes()&&a.remove(d),f.isEmpty(a,c,!0)&&a.$(c).empty(),m(a,b,c),e&&c.appendChild(e),a.remove(b),f.isEmpty(a,g)&&g!==a.getRoot()&&a.remove(g))},o=function(a,b,c){a.dom.$(c).empty(),n(a.dom,b,c),a.selection.setCursorLocation(c)},p=function(a,b,c,d){var f=a.dom;if(f.isEmpty(d))o(a,c,d);else{var g=e.createBookmark(b);n(f,c,d),a.selection.setRng(e.resolveBookmark(g))}},q=function(a,b,c,d){var f=e.createBookmark(b);n(a.dom,c,d),a.selection.setRng(e.resolveBookmark(f))},r=function(a,b){var c,e,g,i=a.dom,k=a.selection,l=i.getParent(k.getStart(),"LI");if(l){if(c=l.parentNode,c===a.getBody()&&f.isEmpty(i,c))return!0;if(e=h.normalizeRange(k.getRng(!0)),g=i.getParent(j(a,e,b),"LI"),g&&g!==l)return b?p(a,e,g,l):q(a,e,l,g),!0;if(!g&&!b&&d.removeList(a,c.nodeName))return!0}return!1},s=function(a,b){var c=a.getParent(b.parentNode,a.isBlock);a.remove(b),c&&a.isEmpty(c)&&a.remove(c)},t=function(a,b){var c=a.dom,e=c.getParent(a.selection.getStart(),c.isBlock);if(e&&c.isEmpty(e)){var f=h.normalizeRange(a.selection.getRng(!0)),g=c.getParent(j(a,f,b),"LI");if(g)return a.undoManager.transact(function(){s(c,e),d.mergeWithAdjacentLists(c,g.parentNode),a.selection.select(g,!0),a.selection.collapse(b)}),!0}return!1},u=function(a,b){return r(a,b)||t(a,b)},v=function(a){var b=a.dom.getParent(a.selection.getStart(),"LI,DT,DD");return!!(b||i.getSelectedListItems(a).length>0)&&(a.undoManager.transact(function(){a.execCommand("Delete"),g.normalizeLists(a.dom,a.getBody())}),!0)},w=function(a,b){return a.selection.isCollapsed()?u(a,b):v(a)},x=function(a){a.on("keydown",function(b){b.keyCode===c.BACKSPACE?w(a,!1)&&b.preventDefault():b.keyCode===c.DELETE&&w(a,!0)&&b.preventDefault()})};return{setup:x,backspaceDelete:w}}),g("0",["1","2","3","4","5","6","7","8","9"],function(a,b,c,d,e,f,g,h,i){var j=function(a,b){return function(){var c=a.dom.getParent(a.selection.getStart(),"UL,OL,DL");return c&&c.nodeName===b}},k=function(a){a.on("BeforeExecCommand",function(b){var c,f=b.command.toLowerCase();if("indent"===f?d.indentSelection(a)&&(c=!0):"outdent"===f&&e.outdentSelection(a)&&(c=!0),c)return a.fire("ExecCommand",{command:b.command}),b.preventDefault(),!0}),a.addCommand("InsertUnorderedList",function(b,c){f.toggleList(a,"UL",c)}),a.addCommand("InsertOrderedList",function(b,c){f.toggleList(a,"OL",c)}),a.addCommand("InsertDefinitionList",function(b,c){f.toggleList(a,"DL",c)})},l=function(a){a.addQueryStateHandler("InsertUnorderedList",j(a,"UL")),a.addQueryStateHandler("InsertOrderedList",j(a,"OL")),a.addQueryStateHandler("InsertDefinitionList",j(a,"DL"))},m=function(a){a.on("keydown",function(b){9!==b.keyCode||c.metaKeyPressed(b)||a.dom.getParent(a.selection.getStart(),"LI,DT,DD")&&(b.preventDefault(),b.shiftKey?e.outdentSelection(a):d.indentSelection(a))})},n=function(a){var c=function(c){return function(){var d=this;a.on("NodeChange",function(a){var e=b.grep(a.parents,h.isListNode);d.active(e.length>0&&e[0].nodeName===c)})}},d=function(a,c){var d=a.settings.plugins?a.settings.plugins:"";return b.inArray(d.split(/[ ,]/),c)!==-1};d(a,"advlist")||(a.addButton("numlist",{title:"Numbered list",cmd:"InsertOrderedList",onPostRender:c("OL")}),a.addButton("bullist",{title:"Bullet list",cmd:"InsertUnorderedList",onPostRender:c("UL")})),a.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:function(b){var c=b.control;a.on("nodechange",function(){var b=i.getSelectedListItems(a),d=b.length>0&&h.isFirstChild(b[0]);c.disabled(d)})}})};return a.add("lists",function(a){return n(a),g.setup(a),a.on("init",function(){k(a),l(a),a.getParam("lists_indent_on_tab",!0)&&m(a)}),{backspaceDelete:function(b){g.backspaceDelete(a,b)}}}),function(){}}),d("0")()}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),l=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),n=tinymce.util.Tools.resolve("tinymce.util.VK"),p=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=function(e){return e&&"BR"===e.nodeName},r=function(e){return e&&3===e.nodeType},h=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},i=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},a=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},C=o,s=function(e){return e.parentNode.firstChild===e},c=function(e){return e.parentNode.lastChild===e},y=function(e,t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]},f=function(e,t){return e&&e.nodeName in t},u=function(e,t){return!!o(t)&&!(!e.isBlock(t.nextSibling)||o(t.previousSibling))},m=function(e,t,n){var o=e.isEmpty(t);return!(n&&0=e.childNodes.length?n.data.length:0}:{container:e,offset:t}},L=function(e){var t=e.cloneRange(),n=N(e.startContainer,e.startOffset);t.setStart(n.container,n.offset);var o=N(e.endContainer,e.endOffset);return t.setEnd(o.container,o.offset),t},S=t.DOM,b=function(r){var i={},e=function(e){var t,n,o;n=r[e?"startContainer":"endContainer"],o=r[e?"startOffset":"endOffset"],1===n.nodeType&&(t=S.create("span",{"data-mce-type":"bookmark"}),n.hasChildNodes()?(o=Math.min(o,n.childNodes.length-1),e?n.insertBefore(t,n.childNodes[o]):S.insertAfter(t,n.childNodes[o])):n.appendChild(t),n=t,o=0),i[e?"startContainer":"endContainer"]=n,i[e?"startOffset":"endOffset"]=o};return e(!0),r.collapsed||e(),i},D=function(r){function e(e){var t,n,o;t=o=r[e?"startContainer":"endContainer"],n=r[e?"startOffset":"endOffset"],t&&(1===t.nodeType&&(n=function(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t===e)return n;1===t.nodeType&&"bookmark"===t.getAttribute("data-mce-type")||n++,t=t.nextSibling}return-1}(t),t=t.parentNode,S.remove(o),!t.hasChildNodes()&&S.isBlock(t)&&t.appendChild(S.create("br"))),r[e?"startContainer":"endContainer"]=t,r[e?"startOffset":"endOffset"]=n)}e(!0),e();var t=S.createRng();return t.setStart(r.startContainer,r.startOffset),r.endContainer&&t.setEnd(r.endContainer,r.endOffset),L(t)},k=t.DOM,T=function(e,t){var n,o=t.parentNode;"LI"===o.nodeName&&o.firstChild===t&&((n=o.previousSibling)&&"LI"===n.nodeName?(n.appendChild(t),m(e,o)&&k.remove(o)):k.setStyle(o,"listStyleType","none")),h(o)&&(n=o.previousSibling)&&"LI"===n.nodeName&&n.appendChild(t)},I=function(t,e){v.each(v.grep(t.select("ol,ul",e)),function(e){T(t,e)})},B=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),R=function(e){var t=e.selection.getStart(!0);return e.dom.getParent(t,"OL,UL,DL",O(e,t))},O=function(e,t){var n=e.dom.getParents(t,"TD,TH");return 0 {dependencies, definition, instance (possibly undefined)} + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); -// Used when there is no 'main' module. -// The name is probably (hopefully) unique so minification removes for releases. -var register_3795 = function (id) { - var module = dem(id); - var fragments = id.split('.'); - var target = Function('return this;')(); - for (var i = 0; i < fragments.length - 1; ++i) { - if (target[fragments[i]] === undefined) - target[fragments[i]] = {}; - target = target[fragments[i]]; - } - target[fragments[fragments.length - 1]] = module; -}; + var global$1 = tinymce.util.Tools.resolve('tinymce.Env'); -var instantiate = function (id) { - var actual = defs[id]; - var dependencies = actual.deps; - var definition = actual.defn; - var len = dependencies.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances[i] = dem(dependencies[i]); - var defResult = definition.apply(null, instances); - if (defResult === undefined) - throw 'module [' + id + '] returned undefined'; - actual.instance = defResult; -}; + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools'); -var def = function (id, dependencies, definition) { - if (typeof id !== 'string') - throw 'module id must be a string'; - else if (dependencies === undefined) - throw 'no dependencies for ' + id; - else if (definition === undefined) - throw 'no definition function for ' + id; - defs[id] = { - deps: dependencies, - defn: definition, - instance: undefined + var getScripts = function (editor) { + return editor.getParam('media_scripts'); + }; + var getAudioTemplateCallback = function (editor) { + return editor.getParam('audio_template_callback'); + }; + var getVideoTemplateCallback = function (editor) { + return editor.getParam('video_template_callback'); + }; + var hasLiveEmbeds = function (editor) { + return editor.getParam('media_live_embeds', true); + }; + var shouldFilterHtml = function (editor) { + return editor.getParam('media_filter_html', true); + }; + var getUrlResolver = function (editor) { + return editor.getParam('media_url_resolver'); + }; + var hasAltSource = function (editor) { + return editor.getParam('media_alt_source', true); + }; + var hasPoster = function (editor) { + return editor.getParam('media_poster', true); + }; + var hasDimensions = function (editor) { + return editor.getParam('media_dimensions', true); + }; + var $_bmkzfegajfuw8pol = { + getScripts: getScripts, + getAudioTemplateCallback: getAudioTemplateCallback, + getVideoTemplateCallback: getVideoTemplateCallback, + hasLiveEmbeds: hasLiveEmbeds, + shouldFilterHtml: shouldFilterHtml, + getUrlResolver: getUrlResolver, + hasAltSource: hasAltSource, + hasPoster: hasPoster, + hasDimensions: hasDimensions }; -}; -var dem = function (id) { - var actual = defs[id]; - if (actual === undefined) - throw 'module [' + id + '] was undefined'; - else if (actual.instance === undefined) - instantiate(id); - return actual.instance; -}; + var global$3 = tinymce.util.Tools.resolve('tinymce.html.SaxParser'); -var req = function (ids, callback) { - var len = ids.length; - var instances = new Array(len); - for (var i = 0; i < len; ++i) - instances.push(dem(ids[i])); - callback.apply(null, callback); -}; + var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); -var ephox = {}; - -ephox.bolt = { - module: { - api: { - define: def, - require: req, - demand: dem - } - } -}; - -var define = def; -var require = req; -var demand = dem; -// this helps with minificiation when using a lot of global references -var defineGlobal = function (id, ref) { - define(id, [], function () { return ref; }); -}; -/*jsc -["tinymce.plugins.media.Plugin","tinymce.core.html.Node","tinymce.core.PluginManager","tinymce.core.util.Tools","tinymce.plugins.media.core.Nodes","tinymce.plugins.media.core.Sanitize","tinymce.plugins.media.core.UpdateHtml","tinymce.plugins.media.ui.Dialog","global!tinymce.util.Tools.resolve","tinymce.core.html.Writer","tinymce.core.html.SaxParser","tinymce.core.html.Schema","tinymce.plugins.media.core.VideoScript","tinymce.core.Env","tinymce.core.dom.DOMUtils","tinymce.plugins.media.core.Size","tinymce.core.util.Delay","tinymce.plugins.media.core.HtmlToData","tinymce.plugins.media.core.Service","tinymce.plugins.media.ui.SizeManager","tinymce.plugins.media.core.DataToHtml","tinymce.core.util.Promise","tinymce.plugins.media.core.Mime","tinymce.plugins.media.core.UrlPatterns"] -jsc*/ -defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve); -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.html.Node', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.html.Node'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.PluginManager', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.PluginManager'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.Tools', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.Tools'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.html.Writer', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.html.Writer'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.html.SaxParser', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.html.SaxParser'); - } -); - -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.html.Schema', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.html.Schema'); - } -); - -/** - * Sanitize.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 - */ - -define( - 'tinymce.plugins.media.core.Sanitize', - [ - 'tinymce.core.util.Tools', - 'tinymce.core.html.Writer', - 'tinymce.core.html.SaxParser', - 'tinymce.core.html.Schema' - ], - function (Tools, Writer, SaxParser, Schema) { - var sanitize = function (editor, html) { - if (editor.settings.media_filter_html === false) { - return html; + var getVideoScriptMatch = function (prefixes, src) { + if (prefixes) { + for (var i = 0; i < prefixes.length; i++) { + if (src.indexOf(prefixes[i].filter) !== -1) { + return prefixes[i]; + } } + } + }; + var $_9fg1sigejfuw8poq = { getVideoScriptMatch: getVideoScriptMatch }; - var writer = new Writer(); - var blocked; + var trimPx = function (value) { + return value.replace(/px$/, ''); + }; + var addPx = function (value) { + return /^[0-9.]+$/.test(value) ? value + 'px' : value; + }; + var getSize = function (name) { + return function (elm) { + return elm ? trimPx(elm.style[name]) : ''; + }; + }; + var setSize = function (name) { + return function (elm, value) { + if (elm) { + elm.style[name] = addPx(value); + } + }; + }; + var $_7rx1rygfjfuw8por = { + getMaxWidth: getSize('maxWidth'), + getMaxHeight: getSize('maxHeight'), + setMaxWidth: setSize('maxWidth'), + setMaxHeight: setSize('maxHeight') + }; - new SaxParser({ - validate: false, - allow_conditional_comments: false, - special: 'script,noscript', - - comment: function (text) { - writer.comment(text); - }, - - cdata: function (text) { - writer.cdata(text); - }, - - text: function (text, raw) { - writer.text(text, raw); - }, - - start: function (name, attrs, empty) { - blocked = true; - - if (name === 'script' || name === 'noscript') { + var DOM = global$4.DOM; + var getEphoxEmbedIri = function (elm) { + return DOM.getAttrib(elm, 'data-ephox-embed-iri'); + }; + var isEphoxEmbed = function (html) { + var fragment = DOM.createFragment(html); + return getEphoxEmbedIri(fragment.firstChild) !== ''; + }; + var htmlToDataSax = function (prefixes, html) { + var data = {}; + global$3({ + validate: false, + allow_conditional_comments: true, + special: 'script,noscript', + start: function (name, attrs) { + if (!data.source1 && name === 'param') { + data.source1 = attrs.map.movie; + } + if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') { + if (!data.type) { + data.type = name; + } + data = global$2.extend(attrs.map, data); + } + if (name === 'script') { + var videoScript = $_9fg1sigejfuw8poq.getVideoScriptMatch(prefixes, attrs.map.src); + if (!videoScript) { return; } + data = { + type: 'script', + source1: attrs.map.src, + width: videoScript.width, + height: videoScript.height + }; + } + if (name === 'source') { + if (!data.source1) { + data.source1 = attrs.map.src; + } else if (!data.source2) { + data.source2 = attrs.map.src; + } + } + if (name === 'img' && !data.poster) { + data.poster = attrs.map.src; + } + } + }).parse(html); + data.source1 = data.source1 || data.src || data.data; + data.source2 = data.source2 || ''; + data.poster = data.poster || ''; + return data; + }; + var ephoxEmbedHtmlToData = function (html) { + var fragment = DOM.createFragment(html); + var div = fragment.firstChild; + return { + type: 'ephox-embed-iri', + source1: getEphoxEmbedIri(div), + source2: '', + poster: '', + width: $_7rx1rygfjfuw8por.getMaxWidth(div), + height: $_7rx1rygfjfuw8por.getMaxHeight(div) + }; + }; + var htmlToData = function (prefixes, html) { + return isEphoxEmbed(html) ? ephoxEmbedHtmlToData(html) : htmlToDataSax(prefixes, html); + }; + var $_g969ozgbjfuw8pom = { htmlToData: htmlToData }; - for (var i = 0; i < attrs.length; i++) { - if (attrs[i].name.indexOf('on') === 0) { + var global$5 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var guess = function (url) { + var mimes = { + mp3: 'audio/mpeg', + wav: 'audio/wav', + mp4: 'video/mp4', + webm: 'video/webm', + ogg: 'video/ogg', + swf: 'application/x-shockwave-flash' + }; + var fileEnd = url.toLowerCase().split('.').pop(); + var mime = mimes[fileEnd]; + return mime ? mime : ''; + }; + var $_dq3p76gjjfuw8poy = { guess: guess }; + + var global$6 = tinymce.util.Tools.resolve('tinymce.html.Writer'); + + var global$7 = tinymce.util.Tools.resolve('tinymce.html.Schema'); + + var DOM$1 = global$4.DOM; + var setAttributes = function (attrs, updatedAttrs) { + var name; + var i; + var value; + var attr; + for (name in updatedAttrs) { + value = '' + updatedAttrs[name]; + if (attrs.map[name]) { + i = attrs.length; + while (i--) { + attr = attrs[i]; + if (attr.name === name) { + if (value) { + attrs.map[name] = value; + attr.value = value; + } else { + delete attrs.map[name]; + attrs.splice(i, 1); + } + } + } + } else if (value) { + attrs.push({ + name: name, + value: value + }); + attrs.map[name] = value; + } + } + }; + var normalizeHtml = function (html) { + var writer = global$6(); + var parser = global$3(writer); + parser.parse(html); + return writer.getContent(); + }; + var updateHtmlSax = function (html, data, updateAll) { + var writer = global$6(); + var sourceCount = 0; + var hasImage; + global$3({ + validate: false, + allow_conditional_comments: true, + special: 'script,noscript', + comment: function (text) { + writer.comment(text); + }, + cdata: function (text) { + writer.cdata(text); + }, + text: function (text, raw) { + writer.text(text, raw); + }, + start: function (name, attrs, empty) { + switch (name) { + case 'video': + case 'object': + case 'embed': + case 'img': + case 'iframe': + if (data.height !== undefined && data.width !== undefined) { + setAttributes(attrs, { + width: data.width, + height: data.height + }); + } + break; + } + if (updateAll) { + switch (name) { + case 'video': + setAttributes(attrs, { + poster: data.poster, + src: '' + }); + if (data.source2) { + setAttributes(attrs, { src: '' }); + } + break; + case 'iframe': + setAttributes(attrs, { src: data.source1 }); + break; + case 'source': + sourceCount++; + if (sourceCount <= 2) { + setAttributes(attrs, { + src: data['source' + sourceCount], + type: data['source' + sourceCount + 'mime'] + }); + if (!data['source' + sourceCount]) { + return; + } + } + break; + case 'img': + if (!data.poster) { return; } - - if (attrs[i].name === 'style') { - attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name); + hasImage = true; + break; + } + } + writer.start(name, attrs, empty); + }, + end: function (name) { + if (name === 'video' && updateAll) { + for (var index = 1; index <= 2; index++) { + if (data['source' + index]) { + var attrs = []; + attrs.map = {}; + if (sourceCount < index) { + setAttributes(attrs, { + src: data['source' + index], + type: data['source' + index + 'mime'] + }); + writer.start('source', attrs, true); + } } } + } + if (data.poster && name === 'object' && updateAll && !hasImage) { + var imgAttrs = []; + imgAttrs.map = {}; + setAttributes(imgAttrs, { + src: data.poster, + width: data.width, + height: data.height + }); + writer.start('img', imgAttrs, true); + } + writer.end(name); + } + }, global$7({})).parse(html); + return writer.getContent(); + }; + var isEphoxEmbed$1 = function (html) { + var fragment = DOM$1.createFragment(html); + return DOM$1.getAttrib(fragment.firstChild, 'data-ephox-embed-iri') !== ''; + }; + var updateEphoxEmbed = function (html, data) { + var fragment = DOM$1.createFragment(html); + var div = fragment.firstChild; + $_7rx1rygfjfuw8por.setMaxWidth(div, data.width); + $_7rx1rygfjfuw8por.setMaxHeight(div, data.height); + return normalizeHtml(div.outerHTML); + }; + var updateHtml = function (html, data, updateAll) { + return isEphoxEmbed$1(html) ? updateEphoxEmbed(html, data) : updateHtmlSax(html, data, updateAll); + }; + var $_9oq1mlgkjfuw8pp0 = { updateHtml: updateHtml }; - writer.start(name, attrs, empty); - blocked = false; + var urlPatterns = [ + { + regex: /youtu\.be\/([\w\-_\?&=.]+)/i, + type: 'iframe', + w: 560, + h: 314, + url: '//www.youtube.com/embed/$1', + allowFullscreen: true + }, + { + regex: /youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i, + type: 'iframe', + w: 560, + h: 314, + url: '//www.youtube.com/embed/$2?$4', + allowFullscreen: true + }, + { + regex: /youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i, + type: 'iframe', + w: 560, + h: 314, + url: '//www.youtube.com/embed/$1', + allowFullscreen: true + }, + { + regex: /vimeo\.com\/([0-9]+)/, + type: 'iframe', + w: 425, + h: 350, + url: '//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc', + allowFullscreen: true + }, + { + regex: /vimeo\.com\/(.*)\/([0-9]+)/, + type: 'iframe', + w: 425, + h: 350, + url: '//player.vimeo.com/video/$2?title=0&byline=0', + allowFullscreen: true + }, + { + regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, + type: 'iframe', + w: 425, + h: 350, + url: '//maps.google.com/maps/ms?msid=$2&output=embed"', + allowFullscreen: false + }, + { + regex: /dailymotion\.com\/video\/([^_]+)/, + type: 'iframe', + w: 480, + h: 270, + url: '//www.dailymotion.com/embed/video/$1', + allowFullscreen: true + }, + { + regex: /dai\.ly\/([^_]+)/, + type: 'iframe', + w: 480, + h: 270, + url: '//www.dailymotion.com/embed/video/$1', + allowFullscreen: true + } + ]; + var getUrl = function (pattern, url) { + var match = pattern.regex.exec(url); + var newUrl = pattern.url; + var _loop_1 = function (i) { + newUrl = newUrl.replace('$' + i, function () { + return match[i] ? match[i] : ''; + }); + }; + for (var i = 0; i < match.length; i++) { + _loop_1(i); + } + return newUrl.replace(/\?$/, ''); + }; + var matchPattern = function (url) { + var pattern = urlPatterns.filter(function (pattern) { + return pattern.regex.test(url); + }); + if (pattern.length > 0) { + return global$2.extend({}, pattern[0], { url: getUrl(pattern[0], url) }); + } else { + return null; + } + }; + + var getIframeHtml = function (data) { + var allowFullscreen = data.allowFullscreen ? ' allowFullscreen="1"' : ''; + return ''; + }; + var getFlashHtml = function (data) { + var html = ''; + if (data.poster) { + html += ''; + } + html += ''; + return html; + }; + var getAudioHtml = function (data, audioTemplateCallback) { + if (audioTemplateCallback) { + return audioTemplateCallback(data); + } else { + return ''; + } + }; + var getVideoHtml = function (data, videoTemplateCallback) { + if (videoTemplateCallback) { + return videoTemplateCallback(data); + } else { + return ''; + } + }; + var getScriptHtml = function (data) { + return ''; + }; + var dataToHtml = function (editor, dataIn) { + var data = global$2.extend({}, dataIn); + if (!data.source1) { + global$2.extend(data, $_g969ozgbjfuw8pom.htmlToData($_bmkzfegajfuw8pol.getScripts(editor), data.embed)); + if (!data.source1) { + return ''; + } + } + if (!data.source2) { + data.source2 = ''; + } + if (!data.poster) { + data.poster = ''; + } + data.source1 = editor.convertURL(data.source1, 'source'); + data.source2 = editor.convertURL(data.source2, 'source'); + data.source1mime = $_dq3p76gjjfuw8poy.guess(data.source1); + data.source2mime = $_dq3p76gjjfuw8poy.guess(data.source2); + data.poster = editor.convertURL(data.poster, 'poster'); + var pattern = matchPattern(data.source1); + if (pattern) { + data.source1 = pattern.url; + data.type = pattern.type; + data.allowFullscreen = pattern.allowFullscreen; + data.width = data.width || pattern.w; + data.height = data.height || pattern.h; + } + if (data.embed) { + return $_9oq1mlgkjfuw8pp0.updateHtml(data.embed, data, true); + } else { + var videoScript = $_9fg1sigejfuw8poq.getVideoScriptMatch($_bmkzfegajfuw8pol.getScripts(editor), data.source1); + if (videoScript) { + data.type = 'script'; + data.width = videoScript.width; + data.height = videoScript.height; + } + var audioTemplateCallback = $_bmkzfegajfuw8pol.getAudioTemplateCallback(editor); + var videoTemplateCallback = $_bmkzfegajfuw8pol.getVideoTemplateCallback(editor); + data.width = data.width || 300; + data.height = data.height || 150; + global$2.each(data, function (value, key) { + data[key] = editor.dom.encode(value); + }); + if (data.type === 'iframe') { + return getIframeHtml(data); + } else if (data.source1mime === 'application/x-shockwave-flash') { + return getFlashHtml(data); + } else if (data.source1mime.indexOf('audio') !== -1) { + return getAudioHtml(data, audioTemplateCallback); + } else if (data.type === 'script') { + return getScriptHtml(data); + } else { + return getVideoHtml(data, videoTemplateCallback); + } + } + }; + var $_ekbiypgijfuw8pov = { dataToHtml: dataToHtml }; + + var cache = {}; + var embedPromise = function (data, dataToHtml, handler) { + return new global$5(function (res, rej) { + var wrappedResolve = function (response) { + if (response.html) { + cache[data.source1] = response; + } + return res({ + url: data.source1, + html: response.html ? response.html : dataToHtml(data) + }); + }; + if (cache[data.source1]) { + wrappedResolve(cache[data.source1]); + } else { + handler({ url: data.source1 }, wrappedResolve, rej); + } + }); + }; + var defaultPromise = function (data, dataToHtml) { + return new global$5(function (res) { + res({ + html: dataToHtml(data), + url: data.source1 + }); + }); + }; + var loadedData = function (editor) { + return function (data) { + return $_ekbiypgijfuw8pov.dataToHtml(editor, data); + }; + }; + var getEmbedHtml = function (editor, data) { + var embedHandler = $_bmkzfegajfuw8pol.getUrlResolver(editor); + return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor)); + }; + var isCached = function (url) { + return cache.hasOwnProperty(url); + }; + var $_6v4rhbggjfuw8pos = { + getEmbedHtml: getEmbedHtml, + isCached: isCached + }; + + 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 (onChange) { + var recalcSize = function () { + onChange(function (win) { + updateSize(win); + }); + }; + 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 $_32c8argojfuw8ppe = { + createUi: createUi, + syncSize: syncSize, + updateSize: updateSize + }; - end: function (name) { - if (blocked) { + var embedChange = global$1.ie && global$1.ie <= 8 ? 'onChange' : 'onInput'; + var handleError = function (editor) { + return function (error) { + var errorMessage = error && error.msg ? 'Media embed handler error: ' + error.msg : 'Media embed handler threw unknown error.'; + editor.notificationManager.open({ + type: 'error', + text: errorMessage + }); + }; + }; + var getData = function (editor) { + var element = editor.selection.getNode(); + var dataEmbed = element.getAttribute('data-ephox-embed-iri'); + if (dataEmbed) { + return { + 'source1': dataEmbed, + 'data-ephox-embed-iri': dataEmbed, + 'width': $_7rx1rygfjfuw8por.getMaxWidth(element), + 'height': $_7rx1rygfjfuw8por.getMaxHeight(element) + }; + } + return element.getAttribute('data-mce-object') ? $_g969ozgbjfuw8pom.htmlToData($_bmkzfegajfuw8pol.getScripts(editor), editor.serializer.serialize(element, { selection: true })) : {}; + }; + var getSource = function (editor) { + var elm = editor.selection.getNode(); + if (elm.getAttribute('data-mce-object') || elm.getAttribute('data-ephox-embed-iri')) { + return editor.selection.getContent(); + } + }; + var addEmbedHtml = function (win, editor) { + return function (response) { + var html = response.html; + var embed = win.find('#embed')[0]; + var data = global$2.extend($_g969ozgbjfuw8pom.htmlToData($_bmkzfegajfuw8pol.getScripts(editor), html), { source1: response.url }); + win.fromJSON(data); + if (embed) { + embed.value(html); + $_32c8argojfuw8ppe.updateSize(win); + } + }; + }; + var selectPlaceholder = function (editor, beforeObjects) { + var i; + var y; + var afterObjects = editor.dom.select('img[data-mce-object]'); + for (i = 0; i < beforeObjects.length; i++) { + for (y = afterObjects.length - 1; y >= 0; y--) { + if (beforeObjects[i] === afterObjects[y]) { + afterObjects.splice(y, 1); + } + } + } + editor.selection.select(afterObjects[0]); + }; + var handleInsert = function (editor, html) { + var beforeObjects = editor.dom.select('img[data-mce-object]'); + editor.insertContent(html); + selectPlaceholder(editor, beforeObjects); + editor.nodeChanged(); + }; + var submitForm = function (win, editor) { + var data = win.toJSON(); + data.embed = $_9oq1mlgkjfuw8pp0.updateHtml(data.embed, data); + if (data.embed && $_6v4rhbggjfuw8pos.isCached(data.source1)) { + handleInsert(editor, data.embed); + } else { + $_6v4rhbggjfuw8pos.getEmbedHtml(editor, data).then(function (response) { + handleInsert(editor, response.html); + }).catch(handleError(editor)); + } + }; + var populateMeta = function (win, meta) { + global$2.each(meta, function (value, key) { + win.find('#' + key).value(value); + }); + }; + var showDialog = function (editor) { + var win; + var data; + var generalFormItems = [{ + name: 'source1', + type: 'filepicker', + filetype: 'media', + size: 40, + autofocus: true, + label: 'Source', + onpaste: function () { + setTimeout(function () { + $_6v4rhbggjfuw8pos.getEmbedHtml(editor, win.toJSON()).then(addEmbedHtml(win, editor)).catch(handleError(editor)); + }, 1); + }, + onchange: function (e) { + $_6v4rhbggjfuw8pos.getEmbedHtml(editor, win.toJSON()).then(addEmbedHtml(win, editor)).catch(handleError(editor)); + populateMeta(win, e.meta); + }, + onbeforecall: function (e) { + e.meta = win.toJSON(); + } + }]; + var advancedFormItems = []; + var reserialise = function (update) { + update(win); + data = win.toJSON(); + win.find('#embed').value($_9oq1mlgkjfuw8pp0.updateHtml(data.embed, data)); + }; + if ($_bmkzfegajfuw8pol.hasAltSource(editor)) { + advancedFormItems.push({ + name: 'source2', + type: 'filepicker', + filetype: 'media', + size: 40, + label: 'Alternative source' + }); + } + if ($_bmkzfegajfuw8pol.hasPoster(editor)) { + advancedFormItems.push({ + name: 'poster', + type: 'filepicker', + filetype: 'image', + size: 40, + label: 'Poster' + }); + } + if ($_bmkzfegajfuw8pol.hasDimensions(editor)) { + var control = $_32c8argojfuw8ppe.createUi(reserialise); + generalFormItems.push(control); + } + data = getData(editor); + var embedTextBox = { + id: 'mcemediasource', + type: 'textbox', + flex: 1, + name: 'embed', + value: getSource(editor), + multiline: true, + rows: 5, + label: 'Source' + }; + var updateValueOnChange = function () { + data = global$2.extend({}, $_g969ozgbjfuw8pom.htmlToData($_bmkzfegajfuw8pol.getScripts(editor), this.value())); + this.parent().parent().fromJSON(data); + }; + embedTextBox[embedChange] = updateValueOnChange; + var body = [ + { + title: 'General', + type: 'form', + items: generalFormItems + }, + { + title: 'Embed', + type: 'container', + layout: 'flex', + direction: 'column', + align: 'stretch', + padding: 10, + spacing: 10, + items: [ + { + type: 'label', + text: 'Paste your embed code below:', + forId: 'mcemediasource' + }, + embedTextBox + ] + } + ]; + if (advancedFormItems.length > 0) { + body.push({ + title: 'Advanced', + type: 'form', + items: advancedFormItems + }); + } + win = editor.windowManager.open({ + title: 'Insert/edit media', + data: data, + bodyType: 'tabpanel', + body: body, + onSubmit: function () { + $_32c8argojfuw8ppe.updateSize(win); + submitForm(win, editor); + } + }); + $_32c8argojfuw8ppe.syncSize(win); + }; + var $_92htb0g7jfuw8pog = { showDialog: showDialog }; + + var get = function (editor) { + var showDialog = function () { + $_92htb0g7jfuw8pog.showDialog(editor); + }; + return { showDialog: showDialog }; + }; + var $_4zi4sfg6jfuw8poe = { get: get }; + + var register = function (editor) { + var showDialog = function () { + $_92htb0g7jfuw8pog.showDialog(editor); + }; + editor.addCommand('mceMedia', showDialog); + }; + var $_1si9ufgpjfuw8ppg = { register: register }; + + var global$8 = tinymce.util.Tools.resolve('tinymce.html.Node'); + + var sanitize = function (editor, html) { + if ($_bmkzfegajfuw8pol.shouldFilterHtml(editor) === false) { + return html; + } + var writer = global$6(); + var blocked; + global$3({ + validate: false, + allow_conditional_comments: false, + special: 'script,noscript', + comment: function (text) { + writer.comment(text); + }, + cdata: function (text) { + writer.cdata(text); + }, + text: function (text, raw) { + writer.text(text, raw); + }, + start: function (name, attrs, empty) { + blocked = true; + if (name === 'script' || name === 'noscript') { + return; + } + for (var i = 0; i < attrs.length; i++) { + if (attrs[i].name.indexOf('on') === 0) { return; } - - writer.end(name); + if (attrs[i].name === 'style') { + attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name); + } } - }, new Schema({})).parse(html); + writer.start(name, attrs, empty); + blocked = false; + }, + end: function (name) { + if (blocked) { + return; + } + writer.end(name); + } + }, global$7({})).parse(html); + return writer.getContent(); + }; + var $_77d5ybgtjfuw8ppp = { sanitize: sanitize }; - return writer.getContent(); - }; - - return { - sanitize: sanitize - }; - } -); -/** - * VideoScript.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 - */ - -define( - 'tinymce.plugins.media.core.VideoScript', - [ - ], - function () { - var getVideoScriptMatch = function (prefixes, src) { - // var prefixes = editor.settings.media_scripts; - if (prefixes) { - for (var i = 0; i < prefixes.length; i++) { - if (src.indexOf(prefixes[i].filter) !== -1) { - return prefixes[i]; + var createPlaceholderNode = function (editor, node) { + var placeHolder; + var name = node.name; + placeHolder = new global$8('img', 1); + placeHolder.shortEnded = true; + retainAttributesAndInnerHtml(editor, node, placeHolder); + placeHolder.attr({ + 'width': node.attr('width') || '300', + 'height': node.attr('height') || (name === 'audio' ? '30' : '150'), + 'style': node.attr('style'), + 'src': global$1.transparentSrc, + 'data-mce-object': name, + 'class': 'mce-object mce-object-' + name + }); + return placeHolder; + }; + var createPreviewIframeNode = function (editor, node) { + var previewWrapper; + var previewNode; + var shimNode; + var name = node.name; + previewWrapper = new global$8('span', 1); + previewWrapper.attr({ + 'contentEditable': 'false', + 'style': node.attr('style'), + 'data-mce-object': name, + 'class': 'mce-preview-object mce-object-' + name + }); + retainAttributesAndInnerHtml(editor, node, previewWrapper); + previewNode = new global$8(name, 1); + previewNode.attr({ + src: node.attr('src'), + allowfullscreen: node.attr('allowfullscreen'), + style: node.attr('style'), + class: node.attr('class'), + width: node.attr('width'), + height: node.attr('height'), + frameborder: '0' + }); + shimNode = new global$8('span', 1); + shimNode.attr('class', 'mce-shim'); + previewWrapper.append(previewNode); + previewWrapper.append(shimNode); + return previewWrapper; + }; + var retainAttributesAndInnerHtml = function (editor, sourceNode, targetNode) { + var attrName; + var attrValue; + var attribs; + var ai; + var innerHtml; + attribs = sourceNode.attributes; + ai = attribs.length; + while (ai--) { + attrName = attribs[ai].name; + attrValue = attribs[ai].value; + if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style') { + if (attrName === 'data' || attrName === 'src') { + attrValue = editor.convertURL(attrValue, attrName); + } + targetNode.attr('data-mce-p-' + attrName, attrValue); + } + } + innerHtml = sourceNode.firstChild && sourceNode.firstChild.value; + if (innerHtml) { + targetNode.attr('data-mce-html', escape($_77d5ybgtjfuw8ppp.sanitize(editor, innerHtml))); + targetNode.firstChild = null; + } + }; + var isWithinEphoxEmbed = function (node) { + while (node = node.parent) { + if (node.attr('data-ephox-embed-iri')) { + return true; + } + } + return false; + }; + var placeHolderConverter = function (editor) { + return function (nodes) { + var i = nodes.length; + var node; + var videoScript; + while (i--) { + node = nodes[i]; + if (!node.parent) { + continue; + } + if (node.parent.attr('data-mce-object')) { + continue; + } + if (node.name === 'script') { + videoScript = $_9fg1sigejfuw8poq.getVideoScriptMatch($_bmkzfegajfuw8pol.getScripts(editor), node.attr('src')); + if (!videoScript) { + continue; + } + } + if (videoScript) { + if (videoScript.width) { + node.attr('width', videoScript.width.toString()); + } + if (videoScript.height) { + node.attr('height', videoScript.height.toString()); + } + } + if (node.name === 'iframe' && $_bmkzfegajfuw8pol.hasLiveEmbeds(editor) && global$1.ceFalse) { + if (!isWithinEphoxEmbed(node)) { + node.replace(createPreviewIframeNode(editor, node)); + } + } else { + if (!isWithinEphoxEmbed(node)) { + node.replace(createPlaceholderNode(editor, node)); } } } }; + }; + var $_bp9pftgsjfuw8ppl = { + createPreviewIframeNode: createPreviewIframeNode, + createPlaceholderNode: createPlaceholderNode, + placeHolderConverter: placeHolderConverter + }; - return { - getVideoScriptMatch: getVideoScriptMatch - }; - } -); -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.Env', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.Env'); - } -); - -/** - * Nodes.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 - */ - -define( - 'tinymce.plugins.media.core.Nodes', - [ - 'tinymce.plugins.media.core.Sanitize', - 'tinymce.plugins.media.core.VideoScript', - 'tinymce.core.html.Node', - 'tinymce.core.Env' - ], - function (Sanitize, VideoScript, Node, Env) { - var createPlaceholderNode = function (editor, node) { - var placeHolder; - var name = node.name; - - placeHolder = new Node('img', 1); - placeHolder.shortEnded = true; - - retainAttributesAndInnerHtml(editor, node, placeHolder); - - placeHolder.attr({ - width: node.attr('width') || "300", - height: node.attr('height') || (name === "audio" ? "30" : "150"), - style: node.attr('style'), - src: Env.transparentSrc, - "data-mce-object": name, - "class": "mce-object mce-object-" + name + var setup = function (editor) { + editor.on('preInit', function () { + var specialElements = editor.schema.getSpecialElements(); + global$2.each('video audio iframe object'.split(' '), function (name) { + specialElements[name] = new RegExp(']*>', 'gi'); }); - - return placeHolder; - }; - - var createPreviewIframeNode = function (editor, node) { - var previewWrapper; - var previewNode; - var shimNode; - var name = node.name; - - previewWrapper = new Node('span', 1); - previewWrapper.attr({ - contentEditable: 'false', - style: node.attr('style'), - "data-mce-object": name, - "class": "mce-preview-object mce-object-" + name + var boolAttrs = editor.schema.getBoolAttrs(); + global$2.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function (name) { + boolAttrs[name] = {}; }); - - retainAttributesAndInnerHtml(editor, node, previewWrapper); - - previewNode = new Node(name, 1); - previewNode.attr({ - src: node.attr('src'), - allowfullscreen: node.attr('allowfullscreen'), - width: node.attr('width') || "300", - height: node.attr('height') || (name === "audio" ? "30" : "150"), - frameborder: '0' - }); - - shimNode = new Node('span', 1); - shimNode.attr('class', 'mce-shim'); - - previewWrapper.append(previewNode); - previewWrapper.append(shimNode); - - return previewWrapper; - }; - - var retainAttributesAndInnerHtml = function (editor, sourceNode, targetNode) { - var attrName; - var attrValue; - var attribs; - var ai; - var innerHtml; - - // Prefix all attributes except width, height and style since we - // will add these to the placeholder - attribs = sourceNode.attributes; - ai = attribs.length; - while (ai--) { - attrName = attribs[ai].name; - attrValue = attribs[ai].value; - - if (attrName !== "width" && attrName !== "height" && attrName !== "style") { - if (attrName === "data" || attrName === "src") { - attrValue = editor.convertURL(attrValue, attrName); - } - - targetNode.attr('data-mce-p-' + attrName, attrValue); - } - } - - // Place the inner HTML contents inside an escaped attribute - // This enables us to copy/paste the fake object - innerHtml = sourceNode.firstChild && sourceNode.firstChild.value; - if (innerHtml) { - targetNode.attr("data-mce-html", escape(Sanitize.sanitize(editor, innerHtml))); - targetNode.firstChild = null; - } - }; - - var isWithinEphoxEmbed = function (node) { - while ((node = node.parent)) { - if (node.attr('data-ephox-embed-iri')) { - return true; - } - } - - return false; - }; - - var placeHolderConverter = function (editor) { - return function (nodes) { + editor.parser.addNodeFilter('iframe,video,audio,object,embed,script', $_bp9pftgsjfuw8ppl.placeHolderConverter(editor)); + editor.serializer.addAttributeFilter('data-mce-object', function (nodes, name) { var i = nodes.length; var node; - var videoScript; - + var realElm; + var ai; + var attribs; + var innerHtml; + var innerNode; + var realElmName; + var className; while (i--) { node = nodes[i]; if (!node.parent) { continue; } - - if (node.parent.attr('data-mce-object')) { - continue; - } - - if (node.name === 'script') { - videoScript = VideoScript.getVideoScriptMatch(editor.settings.media_scripts, node.attr('src')); - if (!videoScript) { - continue; + realElmName = node.attr(name); + realElm = new global$8(realElmName, 1); + if (realElmName !== 'audio' && realElmName !== 'script') { + className = node.attr('class'); + if (className && className.indexOf('mce-preview-object') !== -1) { + realElm.attr({ + width: node.firstChild.attr('width'), + height: node.firstChild.attr('height') + }); + } else { + realElm.attr({ + width: node.attr('width'), + height: node.attr('height') + }); } } - - if (videoScript) { - if (videoScript.width) { - node.attr('width', videoScript.width.toString()); - } - - if (videoScript.height) { - node.attr('height', videoScript.height.toString()); + realElm.attr({ style: node.attr('style') }); + attribs = node.attributes; + ai = attribs.length; + while (ai--) { + var attrName = attribs[ai].name; + if (attrName.indexOf('data-mce-p-') === 0) { + realElm.attr(attrName.substr(11), attribs[ai].value); } } - - if (node.name === 'iframe' && editor.settings.media_live_embeds !== false && Env.ceFalse) { - if (!isWithinEphoxEmbed(node)) { - node.replace(createPreviewIframeNode(editor, node)); - } - } else { - if (!isWithinEphoxEmbed(node)) { - node.replace(createPlaceholderNode(editor, node)); - } + if (realElmName === 'script') { + realElm.attr('type', 'text/javascript'); } + innerHtml = node.attr('data-mce-html'); + if (innerHtml) { + innerNode = new global$8('#text', 3); + innerNode.raw = true; + innerNode.value = $_77d5ybgtjfuw8ppp.sanitize(editor, unescape(innerHtml)); + realElm.append(innerNode); + } + node.replace(realElm); } - }; - }; - - return { - createPreviewIframeNode: createPreviewIframeNode, - createPlaceholderNode: createPlaceholderNode, - placeHolderConverter: placeHolderConverter - }; - } -); -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.dom.DOMUtils', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.dom.DOMUtils'); - } -); - -/** - * Size.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 - */ - -define( - 'tinymce.plugins.media.core.Size', - [ - ], - function () { - var trimPx = function (value) { - return value.replace(/px$/, ''); - }; - - var addPx = function (value) { - return /^[0-9.]+$/.test(value) ? (value + 'px') : value; - }; - - var getSize = function (name) { - return function (elm) { - return elm ? trimPx(elm.style[name]) : ''; - }; - }; - - var setSize = function (name) { - return function (elm, value) { - if (elm) { - elm.style[name] = addPx(value); + }); + }); + editor.on('setContent', function () { + editor.$('span.mce-preview-object').each(function (index, elm) { + var $elm = editor.$(elm); + if ($elm.find('span.mce-shim', elm).length === 0) { + $elm.append(''); } - }; - }; + }); + }); + }; + var $_7xjmklgqjfuw8pph = { setup: setup }; - return { - getMaxWidth: getSize('maxWidth'), - getMaxHeight: getSize('maxHeight'), - setMaxWidth: setSize('maxWidth'), - setMaxHeight: setSize('maxHeight') - }; - } -); -/** - * UpdateHtml.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 - */ - -define( - 'tinymce.plugins.media.core.UpdateHtml', - [ - 'tinymce.core.html.Writer', - 'tinymce.core.html.SaxParser', - 'tinymce.core.html.Schema', - 'tinymce.core.dom.DOMUtils', - 'tinymce.plugins.media.core.Size' - ], - function (Writer, SaxParser, Schema, DOMUtils, Size) { - var DOM = DOMUtils.DOM; - - var setAttributes = function (attrs, updatedAttrs) { + var setup$1 = function (editor) { + editor.on('ResolveName', function (e) { var name; - var i; - var value; - var attr; + if (e.target.nodeType === 1 && (name = e.target.getAttribute('data-mce-object'))) { + e.name = name; + } + }); + }; + var $_8fr4logujfuw8ppr = { setup: setup$1 }; - for (name in updatedAttrs) { - value = "" + updatedAttrs[name]; - - if (attrs.map[name]) { - i = attrs.length; - while (i--) { - attr = attrs[i]; - - if (attr.name === name) { - if (value) { - attrs.map[name] = value; - attr.value = value; - } else { - delete attrs.map[name]; - attrs.splice(i, 1); - } - } - } - } else if (value) { - attrs.push({ - name: name, - value: value - }); - - attrs.map[name] = value; + var setup$2 = function (editor) { + editor.on('click keyup', function () { + var selectedNode = editor.selection.getNode(); + if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) { + if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) { + selectedNode.setAttribute('data-mce-selected', '2'); } } - }; - - var normalizeHtml = function (html) { - var writer = new Writer(); - var parser = new SaxParser(writer); - parser.parse(html); - return writer.getContent(); - }; - - var updateHtmlSax = function (html, data, updateAll) { - var writer = new Writer(); - var sourceCount = 0; - var hasImage; - - new SaxParser({ - validate: false, - allow_conditional_comments: true, - special: 'script,noscript', - - comment: function (text) { - writer.comment(text); - }, - - cdata: function (text) { - writer.cdata(text); - }, - - text: function (text, raw) { - writer.text(text, raw); - }, - - start: function (name, attrs, empty) { - switch (name) { - case "video": - case "object": - case "embed": - case "img": - case "iframe": - if (data.height !== undefined && data.width !== undefined) { - setAttributes(attrs, { - width: data.width, - height: data.height - }); - } - break; - } - - if (updateAll) { - switch (name) { - case "video": - setAttributes(attrs, { - poster: data.poster, - src: "" - }); - - if (data.source2) { - setAttributes(attrs, { - src: "" - }); - } - break; - - case "iframe": - setAttributes(attrs, { - src: data.source1 - }); - break; - - case "source": - sourceCount++; - - if (sourceCount <= 2) { - setAttributes(attrs, { - src: data["source" + sourceCount], - type: data["source" + sourceCount + "mime"] - }); - - if (!data["source" + sourceCount]) { - return; - } - } - break; - - case "img": - if (!data.poster) { - return; - } - - hasImage = true; - break; - } - } - - writer.start(name, attrs, empty); - }, - - end: function (name) { - if (name === "video" && updateAll) { - for (var index = 1; index <= 2; index++) { - if (data["source" + index]) { - var attrs = []; - attrs.map = {}; - - if (sourceCount < index) { - setAttributes(attrs, { - src: data["source" + index], - type: data["source" + index + "mime"] - }); - - writer.start("source", attrs, true); - } - } - } - } - - if (data.poster && name === "object" && updateAll && !hasImage) { - var imgAttrs = []; - imgAttrs.map = {}; - - setAttributes(imgAttrs, { - src: data.poster, - width: data.width, - height: data.height - }); - - writer.start("img", imgAttrs, true); - } - - writer.end(name); + }); + editor.on('ObjectSelected', function (e) { + var objectType = e.target.getAttribute('data-mce-object'); + if (objectType === 'audio' || objectType === 'script') { + e.preventDefault(); + } + }); + editor.on('objectResized', function (e) { + var target = e.target; + var html; + if (target.getAttribute('data-mce-object')) { + html = target.getAttribute('data-mce-html'); + if (html) { + html = unescape(html); + target.setAttribute('data-mce-html', escape($_9oq1mlgkjfuw8pp0.updateHtml(html, { + width: e.width, + height: e.height + }))); } - }, new Schema({})).parse(html); + } + }); + }; + var $_b7skwpgvjfuw8pps = { setup: setup$2 }; - return writer.getContent(); - }; + var register$1 = function (editor) { + editor.addButton('media', { + tooltip: 'Insert/edit media', + cmd: 'mceMedia', + stateSelector: [ + 'img[data-mce-object]', + 'span[data-mce-object]', + 'div[data-ephox-embed-iri]' + ] + }); + editor.addMenuItem('media', { + icon: 'media', + text: 'Media', + cmd: 'mceMedia', + context: 'insert', + prependToContext: true + }); + }; + var $_7zyd29gwjfuw8ppt = { register: register$1 }; - var isEphoxEmbed = function (html) { - var fragment = DOM.createFragment(html); - return DOM.getAttrib(fragment.firstChild, 'data-ephox-embed-iri') !== ''; - }; - - var updateEphoxEmbed = function (html, data) { - var fragment = DOM.createFragment(html); - var div = fragment.firstChild; - - Size.setMaxWidth(div, data.width); - Size.setMaxHeight(div, data.height); - - return normalizeHtml(div.outerHTML); - }; - - var updateHtml = function (html, data, updateAll) { - return isEphoxEmbed(html) ? updateEphoxEmbed(html, data) : updateHtmlSax(html, data, updateAll); - }; - - return { - updateHtml: updateHtml - }; + global.add('media', function (editor) { + $_1si9ufgpjfuw8ppg.register(editor); + $_7zyd29gwjfuw8ppt.register(editor); + $_8fr4logujfuw8ppr.setup(editor); + $_7xjmklgqjfuw8pph.setup(editor); + $_b7skwpgvjfuw8pps.setup(editor); + return $_4zi4sfg6jfuw8poe.get(editor); + }); + function Plugin () { } -); -/** - * ResolveGlobal.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 - */ -define( - 'tinymce.core.util.Delay', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.Delay'); - } -); + return Plugin; -/** - * HtmlToData.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 - */ - -define( - 'tinymce.plugins.media.core.HtmlToData', - [ - 'tinymce.core.util.Tools', - 'tinymce.core.html.SaxParser', - 'tinymce.core.html.Schema', - 'tinymce.core.dom.DOMUtils', - 'tinymce.plugins.media.core.VideoScript', - 'tinymce.plugins.media.core.Size' - ], - function (Tools, SaxParser, Schema, DOMUtils, VideoScript, Size) { - var DOM = DOMUtils.DOM; - - var getEphoxEmbedIri = function (elm) { - return DOM.getAttrib(elm, 'data-ephox-embed-iri'); - }; - - var isEphoxEmbed = function (html) { - var fragment = DOM.createFragment(html); - return getEphoxEmbedIri(fragment.firstChild) !== ''; - }; - - var htmlToDataSax = function (prefixes, html) { - var data = {}; - - new SaxParser({ - validate: false, - allow_conditional_comments: true, - special: 'script,noscript', - start: function (name, attrs) { - if (!data.source1 && name === "param") { - data.source1 = attrs.map.movie; - } - - if (name === "iframe" || name === "object" || name === "embed" || name === "video" || name === "audio") { - if (!data.type) { - data.type = name; - } - - data = Tools.extend(attrs.map, data); - } - - if (name === "script") { - var videoScript = VideoScript.getVideoScriptMatch(prefixes, attrs.map.src); - if (!videoScript) { - return; - } - - data = { - type: "script", - source1: attrs.map.src, - width: videoScript.width, - height: videoScript.height - }; - } - - if (name === "source") { - if (!data.source1) { - data.source1 = attrs.map.src; - } else if (!data.source2) { - data.source2 = attrs.map.src; - } - } - - if (name === "img" && !data.poster) { - data.poster = attrs.map.src; - } - } - }).parse(html); - - data.source1 = data.source1 || data.src || data.data; - data.source2 = data.source2 || ''; - data.poster = data.poster || ''; - - return data; - }; - - var ephoxEmbedHtmlToData = function (html) { - var fragment = DOM.createFragment(html); - var div = fragment.firstChild; - - return { - type: 'ephox-embed-iri', - source1: getEphoxEmbedIri(div), - source2: '', - poster: '', - width: Size.getMaxWidth(div), - height: Size.getMaxHeight(div) - }; - }; - - var htmlToData = function (prefixes, html) { - return isEphoxEmbed(html) ? ephoxEmbedHtmlToData(html) : htmlToDataSax(prefixes, html); - }; - - return { - htmlToData: htmlToData - }; - } -); -/** - * Mime.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 - */ - -define( - 'tinymce.plugins.media.core.Mime', - [ - ], - function () { - var guess = function (url) { - var mimes = { - 'mp3': 'audio/mpeg', - 'wav': 'audio/wav', - 'mp4': 'video/mp4', - 'webm': 'video/webm', - 'ogg': 'video/ogg', - 'swf': 'application/x-shockwave-flash' - }; - var fileEnd = url.toLowerCase().split('.').pop(); - var mime = mimes[fileEnd]; - - return mime ? mime : ''; - }; - - return { - guess: guess - }; - } -); -/** - * UrlPatterns.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 - */ - -define( - 'tinymce.plugins.media.core.UrlPatterns', - [ - ], - function () { - var urlPatterns = [ - { - regex: /youtu\.be\/([\w\-.]+)/, - type: 'iframe', w: 560, h: 314, - url: '//www.youtube.com/embed/$1', - allowFullscreen: true - }, - { - regex: /youtube\.com(.+)v=([^&]+)/, - type: 'iframe', w: 560, h: 314, - url: '//www.youtube.com/embed/$2', - allowFullscreen: true - }, - { - regex: /youtube.com\/embed\/([a-z0-9\-_]+(?:\?.+)?)/i, - type: 'iframe', w: 560, h: 314, - url: '//www.youtube.com/embed/$1', - allowFullscreen: true - }, - { - regex: /vimeo\.com\/([0-9]+)/, - type: 'iframe', w: 425, h: 350, - url: '//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc', - allowfullscreen: true - }, - { - regex: /vimeo\.com\/(.*)\/([0-9]+)/, - type: "iframe", w: 425, h: 350, - url: "//player.vimeo.com/video/$2?title=0&byline=0", - allowfullscreen: true - }, - { - regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/, - type: 'iframe', w: 425, h: 350, - url: '//maps.google.com/maps/ms?msid=$2&output=embed"', - allowFullscreen: false - }, - { - regex: /dailymotion\.com\/video\/([^_]+)/, - type: 'iframe', w: 480, h: 270, - url: '//www.dailymotion.com/embed/video/$1', - allowFullscreen: true - } - ]; - - return { - urlPatterns: urlPatterns - }; - } -); -/** - * DataToHtml.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 - */ - -define( - 'tinymce.plugins.media.core.DataToHtml', - [ - 'tinymce.plugins.media.core.Mime', - 'tinymce.plugins.media.core.HtmlToData', - 'tinymce.plugins.media.core.UrlPatterns', - 'tinymce.plugins.media.core.VideoScript', - 'tinymce.plugins.media.core.UpdateHtml', - 'tinymce.core.util.Tools' - ], - function (Mime, HtmlToData, UrlPatterns, VideoScript, UpdateHtml, Tools) { - var dataToHtml = function (editor, dataIn) { - var html = ''; - var data = Tools.extend({}, dataIn); - - if (!data.source1) { - Tools.extend(data, HtmlToData.htmlToData(editor.settings.media_scripts, data.embed)); - if (!data.source1) { - return ''; - } - } - - if (!data.source2) { - data.source2 = ''; - } - - if (!data.poster) { - data.poster = ''; - } - - data.source1 = editor.convertURL(data.source1, "source"); - data.source2 = editor.convertURL(data.source2, "source"); - data.source1mime = Mime.guess(data.source1); - data.source2mime = Mime.guess(data.source2); - data.poster = editor.convertURL(data.poster, "poster"); - - Tools.each(UrlPatterns.urlPatterns, function (pattern) { - var i; - var url; - - var match = pattern.regex.exec(data.source1); - - if (match) { - url = pattern.url; - - for (i = 0; match[i]; i++) { - /*jshint loopfunc:true*/ - /*eslint no-loop-func:0 */ - url = url.replace('$' + i, function () { - return match[i]; - }); - } - - data.source1 = url; - data.type = pattern.type; - data.allowFullscreen = pattern.allowFullscreen; - data.width = data.width || pattern.w; - data.height = data.height || pattern.h; - } - }); - - if (data.embed) { - html = UpdateHtml.updateHtml(data.embed, data, true); - } else { - var videoScript = VideoScript.getVideoScriptMatch(editor.settings.media_scripts, data.source1); - if (videoScript) { - data.type = 'script'; - data.width = videoScript.width; - data.height = videoScript.height; - } - - data.width = data.width || 300; - data.height = data.height || 150; - - Tools.each(data, function (value, key) { - data[key] = editor.dom.encode(value); - }); - - if (data.type === "iframe") { - var allowFullscreen = data.allowFullscreen ? ' allowFullscreen="1"' : ''; - html += - ''; - } else if (data.source1mime === "application/x-shockwave-flash") { - html += - ''; - - if (data.poster) { - html += ''; - } - - html += ''; - } else if (data.source1mime.indexOf('audio') !== -1) { - if (editor.settings.audio_template_callback) { - html = editor.settings.audio_template_callback(data); - } else { - html += ( - '' - ); - } - } else if (data.type === "script") { - html += ''; - } else { - if (editor.settings.video_template_callback) { - html = editor.settings.video_template_callback(data); - } else { - html = ( - '' - ); - } - } - } - - return html; - }; - - return { - dataToHtml: dataToHtml - }; - } -); -/** - * ResolveGlobal.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 - */ - -define( - 'tinymce.core.util.Promise', - [ - 'global!tinymce.util.Tools.resolve' - ], - function (resolve) { - return resolve('tinymce.util.Promise'); - } -); - -/** - * Service.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 - */ - -define( - 'tinymce.plugins.media.core.Service', - [ - 'tinymce.plugins.media.core.DataToHtml', - 'tinymce.core.util.Promise' - ], - function (DataToHtml, Promise) { - var embedPromise = function (data, dataToHtml, handler) { - var cache = {}; - return new Promise(function (res, rej) { - var wrappedResolve = function (response) { - if (response.html) { - cache[data.source1] = response; - } - return res({ - url: data.source1, - html: response.html ? response.html : dataToHtml(data) - }); - }; - if (cache[data.source1]) { - wrappedResolve(cache[data.source1]); - } else { - handler({ url: data.source1 }, wrappedResolve, rej); - } - }); - }; - - var defaultPromise = function (data, dataToHtml) { - return new Promise(function (res) { - res({ html: dataToHtml(data), url: data.source1 }); - }); - }; - - var loadedData = function (editor) { - return function (data) { - return DataToHtml.dataToHtml(editor, data); - }; - }; - - var getEmbedHtml = function (editor, data) { - var embedHandler = editor.settings.media_url_resolver; - - return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor)); - }; - - return { - getEmbedHtml: getEmbedHtml - }; - } -); -/** - * SizeManager.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 - */ - -define( - 'tinymce.plugins.media.ui.SizeManager', - [ - ], - function () { - 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 (onChange) { - var recalcSize = function () { - onChange(function (win) { - updateSize(win); - }); - }; - - 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' } - ] - }; - }; - - return { - createUi: createUi, - syncSize: syncSize, - updateSize: updateSize - }; - } -); -/** - * Dialog.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 - */ - -define( - 'tinymce.plugins.media.ui.Dialog', - [ - 'tinymce.core.util.Delay', - 'tinymce.plugins.media.core.HtmlToData', - 'tinymce.plugins.media.core.UpdateHtml', - 'tinymce.plugins.media.core.Service', - 'tinymce.plugins.media.core.Size', - 'tinymce.core.util.Tools', - 'tinymce.core.Env', - 'tinymce.plugins.media.ui.SizeManager' - ], - function (Delay, HtmlToData, UpdateHtml, Service, Size, Tools, Env, SizeManager) { - var embedChange = (Env.ie && Env.ie <= 8) ? 'onChange' : 'onInput'; - - var handleError = function (editor) { - return function (error) { - var errorMessage = error && error.msg ? - 'Media embed handler error: ' + error.msg : - 'Media embed handler threw unknown error.'; - editor.notificationManager.open({ type: 'error', text: errorMessage }); - }; - }; - - var getData = function (editor) { - var element = editor.selection.getNode(); - var dataEmbed = element.getAttribute('data-ephox-embed-iri'); - - if (dataEmbed) { - return { - source1: dataEmbed, - 'data-ephox-embed-iri': dataEmbed, - width: Size.getMaxWidth(element), - height: Size.getMaxHeight(element) - }; - } - - return element.getAttribute('data-mce-object') ? - HtmlToData.htmlToData(editor.settings.media_scripts, editor.serializer.serialize(element, { selection: true })) : - {}; - }; - - var getSource = function (editor) { - var elm = editor.selection.getNode(); - - if (elm.getAttribute('data-mce-object') || elm.getAttribute('data-ephox-embed-iri')) { - return editor.selection.getContent(); - } - }; - - var addEmbedHtml = function (win, editor) { - return function (response) { - var html = response.html; - var embed = win.find('#embed')[0]; - var data = Tools.extend(HtmlToData.htmlToData(editor.settings.media_scripts, html), { source1: response.url }); - win.fromJSON(data); - - if (embed) { - embed.value(html); - SizeManager.updateSize(win); - } - }; - }; - - var selectPlaceholder = function (editor, beforeObjects) { - var i; - var y; - var afterObjects = editor.dom.select('img[data-mce-object]'); - - // Find new image placeholder so we can select it - for (i = 0; i < beforeObjects.length; i++) { - for (y = afterObjects.length - 1; y >= 0; y--) { - if (beforeObjects[i] === afterObjects[y]) { - afterObjects.splice(y, 1); - } - } - } - - editor.selection.select(afterObjects[0]); - }; - - var handleInsert = function (editor, html) { - var beforeObjects = editor.dom.select('img[data-mce-object]'); - - editor.insertContent(html); - selectPlaceholder(editor, beforeObjects); - editor.nodeChanged(); - }; - - var submitForm = function (win, editor) { - var data = win.toJSON(); - - data.embed = UpdateHtml.updateHtml(data.embed, data); - - if (data.embed) { - handleInsert(editor, data.embed); - } else { - Service.getEmbedHtml(editor, data) - .then(function (response) { - handleInsert(editor, response.html); - })["catch"](handleError(editor)); - } - }; - - var populateMeta = function (win, meta) { - Tools.each(meta, function (value, key) { - win.find('#' + key).value(value); - }); - }; - - var showDialog = function (editor) { - var win; - var data; - - var generalFormItems = [ - { - name: 'source1', - type: 'filepicker', - filetype: 'media', - size: 40, - autofocus: true, - label: 'Source', - onpaste: function () { - setTimeout(function () { - Service.getEmbedHtml(editor, win.toJSON()) - .then( - addEmbedHtml(win, editor) - )["catch"](handleError(editor)); - }, 1); - }, - onchange: function (e) { - Service.getEmbedHtml(editor, win.toJSON()) - .then( - addEmbedHtml(win, editor) - )["catch"](handleError(editor)); - - populateMeta(win, e.meta); - }, - onbeforecall: function (e) { - e.meta = win.toJSON(); - } - } - ]; - - var advancedFormItems = []; - - var reserialise = function (update) { - update(win); - data = win.toJSON(); - win.find('#embed').value(UpdateHtml.updateHtml(data.embed, data)); - }; - - if (editor.settings.media_alt_source !== false) { - advancedFormItems.push({ name: 'source2', type: 'filepicker', filetype: 'media', size: 40, label: 'Alternative source' }); - } - - if (editor.settings.media_poster !== false) { - advancedFormItems.push({ name: 'poster', type: 'filepicker', filetype: 'image', size: 40, label: 'Poster' }); - } - - if (editor.settings.media_dimensions !== false) { - var control = SizeManager.createUi(reserialise); - generalFormItems.push(control); - } - - data = getData(editor); - - var embedTextBox = { - id: 'mcemediasource', - type: 'textbox', - flex: 1, - name: 'embed', - value: getSource(editor), - multiline: true, - rows: 5, - label: 'Source' - }; - - var updateValueOnChange = function () { - data = Tools.extend({}, HtmlToData.htmlToData(editor.settings.media_scripts, this.value())); - this.parent().parent().fromJSON(data); - }; - - embedTextBox[embedChange] = updateValueOnChange; - - win = editor.windowManager.open({ - title: 'Insert/edit media', - data: data, - bodyType: 'tabpanel', - body: [ - { - title: 'General', - type: "form", - items: generalFormItems - }, - - { - title: 'Embed', - type: "container", - layout: 'flex', - direction: 'column', - align: 'stretch', - padding: 10, - spacing: 10, - items: [ - { - type: 'label', - text: 'Paste your embed code below:', - forId: 'mcemediasource' - }, - embedTextBox - ] - }, - - { - title: 'Advanced', - type: "form", - items: advancedFormItems - } - ], - onSubmit: function () { - SizeManager.updateSize(win); - submitForm(win, editor); - } - }); - - SizeManager.syncSize(win); - }; - - return { - showDialog: showDialog - }; - } -); -/** - * 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 - */ - -define( - 'tinymce.plugins.media.Plugin', - [ - 'tinymce.core.html.Node', - 'tinymce.core.PluginManager', - 'tinymce.core.util.Tools', - 'tinymce.plugins.media.core.Nodes', - 'tinymce.plugins.media.core.Sanitize', - 'tinymce.plugins.media.core.UpdateHtml', - 'tinymce.plugins.media.ui.Dialog' - ], - function (Node, PluginManager, Tools, Nodes, Sanitize, UpdateHtml, Dialog) { - var Plugin = function (editor) { - editor.on('ResolveName', function (e) { - var name; - - if (e.target.nodeType === 1 && (name = e.target.getAttribute("data-mce-object"))) { - e.name = name; - } - }); - - editor.on('preInit', function () { - // Make sure that any messy HTML is retained inside these - var specialElements = editor.schema.getSpecialElements(); - Tools.each('video audio iframe object'.split(' '), function (name) { - specialElements[name] = new RegExp('<\/' + name + '[^>]*>', 'gi'); - }); - - // Allow elements - //editor.schema.addValidElements( - // 'object[id|style|width|height|classid|codebase|*],embed[id|style|width|height|type|src|*],video[*],audio[*]' - //); - - // Set allowFullscreen attribs as boolean - var boolAttrs = editor.schema.getBoolAttrs(); - Tools.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function (name) { - boolAttrs[name] = {}; - }); - - // Converts iframe, video etc into placeholder images - editor.parser.addNodeFilter('iframe,video,audio,object,embed,script', - Nodes.placeHolderConverter(editor)); - - // Replaces placeholder images with real elements for video, object, iframe etc - editor.serializer.addAttributeFilter('data-mce-object', function (nodes, name) { - var i = nodes.length; - var node; - var realElm; - var ai; - var attribs; - var innerHtml; - var innerNode; - var realElmName; - var className; - - while (i--) { - node = nodes[i]; - if (!node.parent) { - continue; - } - - realElmName = node.attr(name); - realElm = new Node(realElmName, 1); - - // Add width/height to everything but audio - if (realElmName !== "audio" && realElmName !== "script") { - className = node.attr('class'); - if (className && className.indexOf('mce-preview-object') !== -1) { - realElm.attr({ - width: node.firstChild.attr('width'), - height: node.firstChild.attr('height') - }); - } else { - realElm.attr({ - width: node.attr('width'), - height: node.attr('height') - }); - } - } - - realElm.attr({ - style: node.attr('style') - }); - - // Unprefix all placeholder attributes - attribs = node.attributes; - ai = attribs.length; - while (ai--) { - var attrName = attribs[ai].name; - - if (attrName.indexOf('data-mce-p-') === 0) { - realElm.attr(attrName.substr(11), attribs[ai].value); - } - } - - if (realElmName === "script") { - realElm.attr('type', 'text/javascript'); - } - - // Inject innerhtml - innerHtml = node.attr('data-mce-html'); - if (innerHtml) { - innerNode = new Node('#text', 3); - innerNode.raw = true; - innerNode.value = Sanitize.sanitize(editor, unescape(innerHtml)); - realElm.append(innerNode); - } - - node.replace(realElm); - } - }); - }); - - editor.on('click keyup', function () { - var selectedNode = editor.selection.getNode(); - - if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) { - if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) { - selectedNode.setAttribute('data-mce-selected', '2'); - } - } - }); - - editor.on('ObjectSelected', function (e) { - var objectType = e.target.getAttribute('data-mce-object'); - - if (objectType === "audio" || objectType === "script") { - e.preventDefault(); - } - }); - - editor.on('objectResized', function (e) { - var target = e.target; - var html; - - if (target.getAttribute('data-mce-object')) { - html = target.getAttribute('data-mce-html'); - if (html) { - html = unescape(html); - target.setAttribute('data-mce-html', escape( - UpdateHtml.updateHtml(html, { - width: e.width, - height: e.height - }) - )); - } - } - }); - - this.showDialog = function () { - Dialog.showDialog(editor); - }; - - editor.addButton('media', { - tooltip: 'Insert/edit media', - onclick: this.showDialog, - stateSelector: ['img[data-mce-object]', 'span[data-mce-object]', 'div[data-ephox-embed-iri]'] - }); - - editor.addMenuItem('media', { - icon: 'media', - text: 'Media', - onclick: this.showDialog, - context: 'insert', - prependToContext: true - }); - - editor.on('setContent', function () { - // TODO: This shouldn't be needed there should be a way to mark bogus - // elements so they are never removed except external save - editor.$('span.mce-preview-object').each(function (index, elm) { - var $elm = editor.$(elm); - - if ($elm.find('span.mce-shim', elm).length === 0) { - $elm.append(''); - } - }); - }); - - editor.addCommand('mceMedia', this.showDialog); - }; - - PluginManager.add('media', Plugin); - - return function () { }; - } -); - - -dem('tinymce.plugins.media.Plugin')(); +}()); })(); diff --git a/wp-includes/js/tinymce/plugins/media/plugin.min.js b/wp-includes/js/tinymce/plugins/media/plugin.min.js index 8373a00088..0dd06ba681 100644 --- a/wp-includes/js/tinymce/plugins/media/plugin.min.js +++ b/wp-includes/js/tinymce/plugins/media/plugin.min.js @@ -1 +1 @@ -!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i"}else"application/x-shockwave-flash"===j.source1mime?(i+='',j.poster&&(i+=''),i+=""):j.source1mime.indexOf("audio")!==-1?g.settings.audio_template_callback?i=g.settings.audio_template_callback(j):i+='":"script"===j.type?i+='':i=g.settings.video_template_callback?g.settings.video_template_callback(j):'"}return i};return{dataToHtml:g}}),g("l",["8"],function(a){return a("tinymce.util.Promise")}),g("i",["k","l"],function(a,b){var c=function(a,c,d){var e={};return new b(function(b,f){var g=function(d){return d.html&&(e[a.source1]=d),b({url:a.source1,html:d.html?d.html:c(a)})};e[a.source1]?g(e[a.source1]):d({url:a.source1},g,f)})},d=function(a,c){return new b(function(b){b({html:c(a),url:a.source1})})},e=function(b){return function(c){return a.dataToHtml(b,c)}},f=function(a,b){var f=a.settings.media_url_resolver;return f?c(b,e(a),f):d(b,e(a))};return{getEmbedHtml:f}}),g("j",[],function(){var a=function(a,b){a.state.set("oldVal",a.value()),b.state.set("oldVal",b.value())},b=function(a,b){var c=a.find("#width")[0],d=a.find("#height")[0],e=a.find("#constrain")[0];c&&d&&e&&b(c,d,e.checked())},c=function(b,c,d){var e=b.state.get("oldVal"),f=c.state.get("oldVal"),g=b.value(),h=c.value();d&&e&&f&&g&&h&&(g!==e?(h=Math.round(g/e*h),isNaN(h)||c.value(h)):(g=Math.round(h/f*g),isNaN(g)||b.value(g))),a(b,c)},d=function(c){b(c,a)},e=function(a){b(a,c)},f=function(a){var b=function(){a(function(a){e(a)})};return{type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:5,onchange:b,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:5,onchange:b,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}};return{createUi:f,syncSize:d,updateSize:e}}),g("7",["g","h","6","i","f","3","d","j"],function(a,b,c,d,e,f,g,h){var i=g.ie&&g.ie<=8?"onChange":"onInput",j=function(a){return function(b){var c=b&&b.msg?"Media embed handler error: "+b.msg:"Media embed handler threw unknown error.";a.notificationManager.open({type:"error",text:c})}},k=function(a){var c=a.selection.getNode(),d=c.getAttribute("data-ephox-embed-iri");return d?{source1:d,"data-ephox-embed-iri":d,width:e.getMaxWidth(c),height:e.getMaxHeight(c)}:c.getAttribute("data-mce-object")?b.htmlToData(a.settings.media_scripts,a.serializer.serialize(c,{selection:!0})):{}},l=function(a){var b=a.selection.getNode();if(b.getAttribute("data-mce-object")||b.getAttribute("data-ephox-embed-iri"))return a.selection.getContent()},m=function(a,c){return function(d){var e=d.html,g=a.find("#embed")[0],i=f.extend(b.htmlToData(c.settings.media_scripts,e),{source1:d.url});a.fromJSON(i),g&&(g.value(e),h.updateSize(a))}},n=function(a,b){var c,d,e=a.dom.select("img[data-mce-object]");for(c=0;c=0;d--)b[c]===e[d]&&e.splice(d,1);a.selection.select(e[0])},o=function(a,b){var c=a.dom.select("img[data-mce-object]");a.insertContent(b),n(a,c),a.nodeChanged()},p=function(a,b){var e=a.toJSON();e.embed=c.updateHtml(e.embed,e),e.embed?o(b,e.embed):d.getEmbedHtml(b,e).then(function(a){o(b,a.html)})["catch"](j(b))},q=function(a,b){f.each(b,function(b,c){a.find("#"+c).value(b)})},r=function(a){var e,g,n=[{name:"source1",type:"filepicker",filetype:"media",size:40,autofocus:!0,label:"Source",onpaste:function(){setTimeout(function(){d.getEmbedHtml(a,e.toJSON()).then(m(e,a))["catch"](j(a))},1)},onchange:function(b){d.getEmbedHtml(a,e.toJSON()).then(m(e,a))["catch"](j(a)),q(e,b.meta)},onbeforecall:function(a){a.meta=e.toJSON()}}],o=[],r=function(a){a(e),g=e.toJSON(),e.find("#embed").value(c.updateHtml(g.embed,g))};if(a.settings.media_alt_source!==!1&&o.push({name:"source2",type:"filepicker",filetype:"media",size:40,label:"Alternative source"}),a.settings.media_poster!==!1&&o.push({name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"}),a.settings.media_dimensions!==!1){var s=h.createUi(r);n.push(s)}g=k(a);var t={id:"mcemediasource",type:"textbox",flex:1,name:"embed",value:l(a),multiline:!0,rows:5,label:"Source"},u=function(){g=f.extend({},b.htmlToData(a.settings.media_scripts,this.value())),this.parent().parent().fromJSON(g)};t[i]=u,e=a.windowManager.open({title:"Insert/edit media",data:g,bodyType:"tabpanel",body:[{title:"General",type:"form",items:n},{title:"Embed",type:"container",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,items:[{type:"label",text:"Paste your embed code below:",forId:"mcemediasource"},t]},{title:"Advanced",type:"form",items:o}],onSubmit:function(){h.updateSize(e),p(e,a)}}),h.syncSize(e)};return{showDialog:r}}),g("0",["1","2","3","4","5","6","7"],function(a,b,c,d,e,f,g){var h=function(b){b.on("ResolveName",function(a){var b;1===a.target.nodeType&&(b=a.target.getAttribute("data-mce-object"))&&(a.name=b)}),b.on("preInit",function(){var f=b.schema.getSpecialElements();c.each("video audio iframe object".split(" "),function(a){f[a]=new RegExp("]*>","gi")});var g=b.schema.getBoolAttrs();c.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(a){g[a]={}}),b.parser.addNodeFilter("iframe,video,audio,object,embed,script",d.placeHolderConverter(b)),b.serializer.addAttributeFilter("data-mce-object",function(c,d){for(var f,g,h,i,j,k,l,m,n=c.length;n--;)if(f=c[n],f.parent){for(l=f.attr(d),g=new a(l,1),"audio"!==l&&"script"!==l&&(m=f.attr("class"),m&&m.indexOf("mce-preview-object")!==-1?g.attr({width:f.firstChild.attr("width"),height:f.firstChild.attr("height")}):g.attr({width:f.attr("width"),height:f.attr("height")})),g.attr({style:f.attr("style")}),i=f.attributes,h=i.length;h--;){var o=i[h].name;0===o.indexOf("data-mce-p-")&&g.attr(o.substr(11),i[h].value)}"script"===l&&g.attr("type","text/javascript"),j=f.attr("data-mce-html"),j&&(k=new a("#text",3),k.raw=!0,k.value=e.sanitize(b,unescape(j)),g.append(k)),f.replace(g)}})}),b.on("click keyup",function(){var a=b.selection.getNode();a&&b.dom.hasClass(a,"mce-preview-object")&&b.dom.getAttrib(a,"data-mce-selected")&&a.setAttribute("data-mce-selected","2")}),b.on("ObjectSelected",function(a){var b=a.target.getAttribute("data-mce-object");"audio"!==b&&"script"!==b||a.preventDefault()}),b.on("objectResized",function(a){var b,c=a.target;c.getAttribute("data-mce-object")&&(b=c.getAttribute("data-mce-html"),b&&(b=unescape(b),c.setAttribute("data-mce-html",escape(f.updateHtml(b,{width:a.width,height:a.height})))))}),this.showDialog=function(){g.showDialog(b)},b.addButton("media",{tooltip:"Insert/edit media",onclick:this.showDialog,stateSelector:["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"]}),b.addMenuItem("media",{icon:"media",text:"Media",onclick:this.showDialog,context:"insert",prependToContext:!0}),b.on("setContent",function(){b.$("span.mce-preview-object").each(function(a,c){var d=b.$(c);0===d.find("span.mce-shim",c).length&&d.append('')})}),b.addCommand("mceMedia",this.showDialog)};return b.add("media",h),function(){}}),d("0")()}(); \ No newline at end of file +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.Env"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),w=function(e){return e.getParam("media_scripts")},b=function(e){return e.getParam("audio_template_callback")},y=function(e){return e.getParam("video_template_callback")},n=function(e){return e.getParam("media_live_embeds",!0)},t=function(e){return e.getParam("media_filter_html",!0)},s=function(e){return e.getParam("media_url_resolver")},m=function(e){return e.getParam("media_alt_source",!0)},d=function(e){return e.getParam("media_poster",!0)},h=function(e){return e.getParam("media_dimensions",!0)},p=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),r=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),x=function(e,t){if(e)for(var r=0;r"):"application/x-shockwave-flash"===i.source1mime?(d='',m.poster&&(d+=''),d+=""):-1!==i.source1mime.indexOf("audio")?(u=i,(l=f)?l(u):'"):"script"===i.type?'