diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..40b878d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/Application/Core/ViewConfig.php b/Application/Core/ViewConfig.php new file mode 100644 index 0000000..3b27b28 --- /dev/null +++ b/Application/Core/ViewConfig.php @@ -0,0 +1,299 @@ + + */ + +namespace VanillaThunder\TinymceModule\Application\Core; +use \OxidEsales\Eshop\Core\Registry; +/** + * ViewConfig class wrapper for TinyMCE module. + * + * @mixin \OxidEsales\Eshop\Core\ViewConfig + */ +class ViewConfig extends ViewConfig_parent +{ + public function loadTinyMce() + { + $cfg = Registry::getConfig(); + $oLang = Registry::getLang(); + if (!in_array($this->getActiveClassName(), $cfg->getConfigParam("aTinyMCE_classes"))) { + return false; + } + + $aPlainCmsPages = $cfg->getConfigParam("aTinyMCE_plaincms"); + $oEditObject = $cfg->getActiveView()->getViewDataElement("edit"); + $sCoreTableName = $oEditObject->getCoreTableName(); + if ($sCoreTableName === "oxcontents" && !in_array($oEditObject->getLoadUd(), $aPlainCmsPages)) { + return $oLang->translateString("BLA_TINYMCE_PLAINCMS"); + } + + $blFilemanager = false; //$cfg->getConfigParam("blTinyMCE_filemanager"); + // @todo: $blFilemanager wiederherstellen + + // processing editor config & other stuff + $sLang = $oLang->getLanguageAbbr($oLang->getTplLanguage()); + // array to assign shop lang abbreviations to lang file names of tinymce: shopLang => langfile (without .js ) + $aLang = array( + "cs" => "cs", + "da" => "da", + "de" => "de", + "fr" => "fr_FR", + "it" => "it", + "nl" => "nl", + "ru" => "ru" + ); + + // default config + $aConfig = array( + 'force_br_newlines' => 'false', + 'force_p_newlines' => 'false', + 'forced_root_block' => '""', + 'selector' => '"textarea:not(.mceNoEditor)"', + 'language' => '"' . (in_array($sLang, $aLang) ? $aLang[$sLang] : 'en') . '"', + //'spellchecker_language' => '"' . (in_array($sLang, $aLang) ? $aLang[$sLang] : 'en') . '"', + 'nowrap' => 'false', + 'entity_encoding' => '"raw"', + // http://www.tinymce.com/wiki.php/Configuration:entity_encoding + 'height' => 300, + 'menubar' => 'false', + 'document_base_url' => '"' . $this->getBaseDir() . '"', + // http://www.tinymce.com/wiki.php/Configuration:document_base_url + 'relative_urls' => 'false', + // http://www.tinymce.com/wiki.php/Configuration:relative_urls + 'plugin_preview_width' => 'window.innerWidth', + 'plugin_preview_height' => 'window.innerHeight-90', + 'code_dialog_width' => 'window.innerWidth-50', + 'code_dialog_height' => 'window.innerHeight-130', + 'image_advtab' => 'true', + 'imagetools_toolbar' => '"rotateleft rotateright | flipv fliph | editimage imageoptions"', + 'moxiemanager_fullscreen' => 'true', + 'insertdatetime_formats' => '[ "%d.%m.%Y", "%H:%M" ]', + 'nonbreaking_force_tab' => 'true', + // http://www.tinymce.com/wiki.php/Plugin:nonbreaking + 'autoresize_max_height' => '400', + 'urlconverter_callback' => '"urlconverter"', + 'filemanager_access_key' => '"' . md5($_SERVER['DOCUMENT_ROOT']) . '"', + 'tinymcehelper' => '"' . $this->getSelfActionLink() . 'renderPartial=1"' + ); + + if ($blFilemanager) { + $aDefaultConfig['external_filemanager_path'] = '"../modules/bla/bla-tinymce/fileman/"'; + $aDefaultConfig['filemanager_access_key'] = '"' . md5($_SERVER['HTTP_HOST']) . '"'; + $oUS = Registry::get("oxUtilsServer"); + $oUS->setOxCookie("filemanagerkey", md5($_SERVER['DOCUMENT_ROOT'] . $oUS->getOxCookie("admin_sid"))); + } + + //merging with onfig override + $aOverrideCfg = $this->_getTinyCustConfig(); + if (!empty($aOverrideCfg) && is_array($aOverrideCfg)) { + $aConfig = array_merge($aConfig, $aOverrideCfg); + } + + + // default plugins and their buttons + $aPlugins = array( + 'advlist' => '', // '' = plugin has no buttons + 'anchor' => 'anchor', + 'autolink' => '', + 'autoresize' => '', + 'charmap' => 'charmap', + 'code' => 'code', + 'colorpicker' => '', + 'hr' => 'hr', + 'image' => 'image', + 'imagetools' => '', + 'insertdatetime' => 'insertdatetime', + 'link' => 'link unlink', + 'lists' => '', + 'media' => 'media', + 'nonbreaking' => 'nonbreaking', + 'pagebreak' => 'pagebreak', + 'paste' => 'pastetext', + 'preview' => 'preview', + 'searchreplace' => 'searchreplace', + 'table' => 'table', + 'textcolor' => 'forecolor backcolor', + 'visualblocks' => '', + //'visualchars' => 'visualchars', + 'wordcount' => '', + 'oxfullscreen' => 'fullscreen', //custom fullscreen plugin + //'oxwidget' => 'widget' + //'oxgetseourl' => 'yolo' //custom seo url plugin // wip + ); + + // plugins for newsletter emails + if ($this->getActiveClassName() == "newsletter_main") { + $aPlugins["legacyoutput"] = "false"; + $aPlugins["fullpage"] = "fullpage"; + } + + + // override for active plugins + $aOverridePlgns = $cfg->getConfigParam("aTinyMCE_plugins"); + if (!empty($aOverridePlgns) && is_array($aOverridePlgns)) { + $aPlugins = array_merge($aPlugins, $aOverridePlgns); + } + $aPlugins = array_filter($aPlugins, function ($value) { + return $value !== "false"; + }); + + // array keys von $aPlugins enthalten aktive plugins + $aConfig['plugins'] = '"' . implode(' ', array_keys($aPlugins)) . '"'; + + // external plugins + $aConfig['external_plugins'] = '{ "oxfullscreen":"' . $this->getModuleUrl( + 'vt-tinymce', + 'out/plugins/oxfullscreen/plugin.js' + ) . '" '; + //$aConfig['external_plugins'] .= ', "oxwidget":"' . $this->getModuleUrl('bla-tinymce', 'plugins/oxwidget/plugin.js') . '" '; + if ($blFilemanager) { + $aConfig['external_plugins'] .= ',"roxy":"' . $this->getModuleUrl( + 'vt-tinymce', + 'out/plugins/roxy/plugin.js' + ) . '" '; + } + + $blN1ED = false; + if ($blN1ED) { + $aConfig['apiKey'] = "'MK2RDFLT'"; + $aConfig['external_plugins'] .= ',"n1ed":"' . $this->getModuleUrl( + 'vt-tinymce', + 'out/plugins/n1ed/plugin.js' + ) . '" '; + } + + //$aConfig['external_plugins'] .= ',"oxgetseourl":"' . $this->getModuleUrl('bla-tinymce', 'plugins/oxgetseourl/plugin.js') . '" '; + + $aExtPlugins = $this->_getTinyExtPlugins(); + if (!empty($aExtPlugins) && is_array($aExtPlugins)) { + foreach ($aExtPlugins as $plugin => $file) { + $aConfig['external_plugins'] .= ', "' . $plugin . '": "' . $file . '" '; + } + } + $aConfig['external_plugins'] .= ' }'; + + // default toolbar buttons + $aDefaultButtons = array( + "undo redo |", + //"cut copy paste", + "bold italic underline strikethrough", + "alignleft aligncenter alignright alignjustify", + "bullist numlist", + "outdent indent", + "blockquote", + "subscript", + "superscript", + "formatselect", + //"fontselect", + "fontsizeselect", + "removeformat" + ); + $aOverrideButtons = Registry::getConfig()->getConfigParam("aTinyMCE_buttons"); + $aButtons = (empty($aOverrideButtons) || !is_array($aOverrideButtons)) ? $aDefaultButtons : $aOverrideButtons; + + // plugin buttons + $aPluginButtons = array_filter($aPlugins); + + // zusätzliche buttons + $aCustomButtons = $this->_getTinyToolbarControls(); + + $aButtons = array_merge(array_filter($aButtons), [" | "], array_filter($aPluginButtons), array_filter($aCustomButtons)); + $aConfig['toolbar'] = '["' . implode(" ", $aButtons) . '"]'; + + + // compile the whole config stuff + $sConfig = ''; + foreach ($aConfig as $param => $value) { + $sConfig .= "$param: $value, "; + } + + // add init script + $sInit = 'tinymce.init({ ' . $sConfig . ' });'; + + $sCopyLongDescFromTinyMCE = 'function copyLongDescFromTinyMCE(sIdent) { + var editor = tinymce.get("editor_"+sIdent); + var content = (editor && !editor.isHidden()) ? editor.getContent() : document.getElementById("editor_"+sIdent).value; + document.getElementsByName("editval[" + sIdent + "]").item(0).value = content.replace(/\[{([^\]]*?)}\]/g, function(m) { return m.replace(/>/g, ">").replace(/</g, "<").replace(/&/g, "&") }); + return true; +} + +var origCopyLongDesc = copyLongDesc; +copyLongDesc = function(sIdent) { + if ( copyLongDescFromTinyMCE( sIdent ) ) return; + console.log("tinymce disabled, copy content from regular textarea"); + origCopyLongDesc( sIdent ); +}'; + $sUrlConverter = 'function urlconverter(url, node, on_save) { + console.log(tinyMCE.activeEditor); + if(url.indexOf("[{") == 0) return url; + return (tinyMCE.activeEditor.settings.relative_urls) ? tinyMCE.activeEditor.documentBaseURI.toRelative(url) : tinyMCE.activeEditor.documentBaseURI.toAbsolute(url); +}'; + + // adding scripts to template + $smarty = Registry::get("oxUtilsView")->getSmarty(); + $sSufix = ($smarty->_tpl_vars["__oxid_include_dynamic"]) ? '_dynamic' : ''; + + $aScript = (array)$cfg->getGlobalParameter('scripts' . $sSufix); + $aScript[] = $sCopyLongDescFromTinyMCE; + $aScript[] = $sUrlConverter; + $aScript[] = $sInit; + $cfg->setGlobalParameter('scripts' . $sSufix, $aScript); + + $aInclude = (array)$cfg->getGlobalParameter('includes' . $sSufix); + + $aExtjs = $cfg->getConfigParam('aTinyMCE_extjs'); + if (!empty($aExtjs) && is_array($aExtjs)) { + foreach ($aExtjs as $key => $js) { + $aInclude[3][] = $js; + } + } + + $aInclude[3][] = $this->getModuleUrl('vt-tinymce', 'out/tinymce/tinymce.min.js'); + $cfg->setGlobalParameter('includes' . $sSufix, $aInclude); + + return '
'; + // javascript:tinymce.execCommand(\'mceToggleEditor\',false,\'editor1\'); + } + + protected function _getTinyToolbarControls() + { + $aControls = (method_exists( + get_parent_class(__CLASS__), + __FUNCTION__ + )) ? parent::_getTinyToolbarControls() : array(); + return $aControls; + } + + protected function _getTinyExtPlugins() + { + $aPlugins = Registry::getConfig()->getConfigParam("aTinyMCE_external_plugins"); + if (method_exists(get_parent_class(__CLASS__), __FUNCTION__)) { + $aPlugins = array_merge(parent::_getTinyExtPlugins(), $aPlugins); + } + return $aPlugins; + } + + protected function _getTinyCustConfig() + { + //$oModCfg = ContainerFactory::getInstance()->getContainer()->get(ModuleSettingBridgeInterface::class); + //$oModCfg->get('setting-name', 'module-id'); + + $aConfig = Registry::getConfig()->getConfigParam("aTinyMCE_config"); + if (method_exists(get_parent_class(__CLASS__), __FUNCTION__)) { + $aConfig = array_merge(parent::_getTinyCustConfig(), $aConfig); + } + return $aConfig; + } +} diff --git a/copy_this/modules/bla/bla-tinymce/application/core/security.inc.php b/Application/Core/security.inc.php old mode 100755 new mode 100644 similarity index 100% rename from copy_this/modules/bla/bla-tinymce/application/core/security.inc.php rename to Application/Core/security.inc.php diff --git a/copy_this/modules/bla/bla-tinymce/application/controllers/admin/tinymcehelper.php b/Application/controllers/admin/tinymcehelper.php old mode 100755 new mode 100644 similarity index 100% rename from copy_this/modules/bla/bla-tinymce/application/controllers/admin/tinymcehelper.php rename to Application/controllers/admin/tinymcehelper.php diff --git a/copy_this/modules/bla/bla-tinymce/application/views/admin/cs/module_options.php b/Application/views/admin/cs/module_options.php old mode 100755 new mode 100644 similarity index 100% rename from copy_this/modules/bla/bla-tinymce/application/views/admin/cs/module_options.php rename to Application/views/admin/cs/module_options.php diff --git a/copy_this/modules/bla/bla-tinymce/application/views/admin/da/module_options.php b/Application/views/admin/da/module_options.php old mode 100755 new mode 100644 similarity index 100% rename from copy_this/modules/bla/bla-tinymce/application/views/admin/da/module_options.php rename to Application/views/admin/da/module_options.php diff --git a/copy_this/modules/bla/bla-tinymce/application/views/admin/de/module_options.php b/Application/views/admin/de/module_options.php old mode 100755 new mode 100644 similarity index 100% rename from copy_this/modules/bla/bla-tinymce/application/views/admin/de/module_options.php rename to Application/views/admin/de/module_options.php diff --git a/copy_this/modules/bla/bla-tinymce/application/views/admin/en/module_options.php b/Application/views/admin/en/module_options.php old mode 100755 new mode 100644 similarity index 100% rename from copy_this/modules/bla/bla-tinymce/application/views/admin/en/module_options.php rename to Application/views/admin/en/module_options.php diff --git a/copy_this/modules/bla/bla-tinymce/application/views/admin/fr/module_options.php b/Application/views/admin/fr/module_options.php old mode 100755 new mode 100644 similarity index 100% rename from copy_this/modules/bla/bla-tinymce/application/views/admin/fr/module_options.php rename to Application/views/admin/fr/module_options.php diff --git a/copy_this/modules/bla/bla-tinymce/application/views/admin/it/module_options.php b/Application/views/admin/it/module_options.php old mode 100755 new mode 100644 similarity index 100% rename from copy_this/modules/bla/bla-tinymce/application/views/admin/it/module_options.php rename to Application/views/admin/it/module_options.php diff --git a/copy_this/modules/bla/bla-tinymce/application/views/admin/nl/module_options.php b/Application/views/admin/nl/module_options.php old mode 100755 new mode 100644 similarity index 100% rename from copy_this/modules/bla/bla-tinymce/application/views/admin/nl/module_options.php rename to Application/views/admin/nl/module_options.php diff --git a/copy_this/modules/bla/bla-tinymce/application/views/admin/ru/module_options.php b/Application/views/admin/ru/module_options.php old mode 100755 new mode 100644 similarity index 100% rename from copy_this/modules/bla/bla-tinymce/application/views/admin/ru/module_options.php rename to Application/views/admin/ru/module_options.php diff --git a/copy_this/modules/bla/bla-tinymce/application/views/admin/tinymcehelper.tpl b/Application/views/admin/tinymcehelper.tpl old mode 100755 new mode 100644 similarity index 100% rename from copy_this/modules/bla/bla-tinymce/application/views/admin/tinymcehelper.tpl rename to Application/views/admin/tinymcehelper.tpl diff --git a/copy_this/modules/bla/bla-tinymce/application/views/blocks/admin/bottomnaviitem_admin_bottomnaviitem.tpl b/Application/views/blocks/admin/bottomnaviitem_admin_bottomnaviitem.tpl old mode 100755 new mode 100644 similarity index 100% rename from copy_this/modules/bla/bla-tinymce/application/views/blocks/admin/bottomnaviitem_admin_bottomnaviitem.tpl rename to Application/views/blocks/admin/bottomnaviitem_admin_bottomnaviitem.tpl diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/build/.jshintrc b/build/.jshintrc new file mode 100644 index 0000000..8a54807 --- /dev/null +++ b/build/.jshintrc @@ -0,0 +1,5 @@ +{ + "esversion": 6, + "node": true, + "curly": false +} \ No newline at end of file diff --git a/build/3_build.js b/build/3_build.js new file mode 100644 index 0000000..822deb0 --- /dev/null +++ b/build/3_build.js @@ -0,0 +1,74 @@ +/*jslint node:true, curly:false */ +"use strict"; + +var fs = require('fs-extra'), + oxmodule = require('./package.json'), + replace = require('replace'); + + + +// cleanup +fs.moveSync('_module','__module'); +fs.mkdirSync('_module'); +fs.moveSync('__module/.git','_module/.git'); +fs.removeSync('__module'); +fs.emptyDirSync('_master/copy_this/modules/'+ oxmodule.vendor + '/' + oxmodule.name); + +console.log(""); +console.log(" cleanup finished"); + +// copy files +try { + fs.copySync('application', '_module/application'); + fs.copySync('fileman', '_module/fileman'); + fs.copySync('plugins', '_module/plugins'); + fs.copySync('tinymce', '_module/tinymce'); + fs.copySync('LICENSE', '_module/LICENSE'); + fs.copySync('metadata.php', '_module/metadata.php'); + fs.copySync('README.md', '_module/README.md'); + fs.copySync('tinymce.png', '_module/tinymce.png'); + console.log(" new files copied"); +} catch (err) { + console.log(err); +} +// compile some files +var replaces = { + 'empalte': 'emplate', + 'NAME': oxmodule.name, + 'DESCRIPTION': oxmodule.description, + 'VERSION': oxmodule.version + ' ( ' + new Date().toISOString().split('T')[0] + ' )', + 'AUTHOR': oxmodule.author, + 'VENDOR': oxmodule.vendor, + 'COMPANY': oxmodule.company, + 'EMAIL': oxmodule.email, + 'URL': oxmodule.url, + 'YEAR': new Date().getFullYear() +}; + +for (var x in replaces) { + if (!replaces.hasOwnProperty(x)) continue; + replace({ + regex: "___" + x + "___", + replacement: replaces[x], + paths: ['./_module'], + recursive: true, + silent: true + }); +} + +process.on('exit', function (code) { + console.log(" replacing complete"); + // copy module to master + try { + fs.mkdirsSync('_master/copy_this/modules/' + oxmodule.vendor); + fs.copySync('_module', '_master/copy_this/modules/' + oxmodule.vendor + '/' + oxmodule.name); + fs.removeSync('_master/copy_this/modules/' + oxmodule.vendor + '/' + oxmodule.name + '/.git'); + fs.copySync('_module/README.md', '_master/README.md'); + fs.copySync('LICENSE', '_master/LICENSE'); + console.log(""); + console.log(" build complete! made my day!"); + console.log(""); + } catch (err) { + console.log(err); + } +}); \ No newline at end of file diff --git a/build/4_publish.js b/build/4_publish.js new file mode 100644 index 0000000..212e658 --- /dev/null +++ b/build/4_publish.js @@ -0,0 +1,26 @@ +/*jslint node:true, curly:false */ +"use strict"; + +var runner = require('child_process'); + +var msg = ( process.argv[2] ? process.argv[2] : "updates"); + +console.log(""); +runner.exec("git add . && git commit -m '"+msg+"' && git push", {cwd: './_master/'}, + function (err, stdout, stderr) { + if(err) console.log(err); + else if(stderr) console.log(stderr); + else console.log("master branch updated"); + } +); +runner.exec("git add . && git commit -m '"+msg+"' && git push", {cwd: './_module/'}, + function (err, stdout, stderr) { + if(err) console.log(err); + else if(stderr) console.log(stderr); + else console.log("module branch updated"); + } +); + +process.on('exit', function (code) { + console.log('publishing finished'); +}); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/README.md b/build/README.md old mode 100755 new mode 100644 similarity index 90% rename from copy_this/modules/bla/bla-tinymce/README.md rename to build/README.md index 794d024..5d701d1 --- a/copy_this/modules/bla/bla-tinymce/README.md +++ b/build/README.md @@ -1,7 +1,7 @@ -## TinyMCE Editor for OXID eShop CE -by Marat Bedoev, bestlife AG]*>/gi,"[quote]"),c(/<\/blockquote>/gi,"[/quote]"),c(/
/gi,"\n"),c(/
/gi,"\n"),c(/
/gi,"\n"),c(//gi,""),c(/<\/p>/gi,"\n"),c(/ |\u00a0/gi," "),c(/"/gi,'"'),c(/</gi,"<"),c(/>/gi,">"),c(/&/gi,"&"),a},_punbb_bbcode2html:function(a){function c(b,c){a=a.replace(b,c)}return a=b.trim(a),c(/\n/gi,"
"),c(/\[b\]/gi,""),c(/\[\/b\]/gi,""),c(/\[i\]/gi,""),c(/\[\/i\]/gi,""),c(/\[u\]/gi,""),c(/\[\/u\]/gi,""),c(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2'),c(/\[url\](.*?)\[\/url\]/gi,'$1'),c(/\[img\](.*?)\[\/img\]/gi,''),c(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2'),c(/\[code\](.*?)\[\/code\]/gi,'$1 '),c(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),a}}}),function(){}}),d("0")()}(); \ No newline at end of file diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/charmap/plugin.min.js b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/charmap/plugin.min.js deleted file mode 100644 index 3fd9e23..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/charmap/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -!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';var i=g(),j=Math.min(i.length,25),k=Math.ceil(i.length/j);for(e=0;e ",d=0;d ";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 diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/code/plugin.min.js b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/code/plugin.min.js deleted file mode 100644 index 7a0437e..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/code/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -!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 '+n+""}else c+=""}c+=""}c+=" code[class*="language-"], -pre[class*="language-"] { - background: #f5f2f0; -} - -/* Inline code */ -:not(pre) > code[class*="language-"] { - padding: .1em; - border-radius: .3em; -} - -.token.comment, -.token.prolog, -.token.doctype, -.token.cdata { - color: slategray; -} - -.token.punctuation { - color: #999; -} - -.namespace { - opacity: .7; -} - -.token.property, -.token.tag, -.token.boolean, -.token.number, -.token.constant, -.token.symbol, -.token.deleted { - color: #905; -} - -.token.selector, -.token.attr-name, -.token.string, -.token.char, -.token.builtin, -.token.inserted { - color: #690; -} - -.token.operator, -.token.entity, -.token.url, -.language-css .token.string, -.style .token.string { - color: #a67f59; - background: hsla(0, 0%, 100%, .5); -} - -.token.atrule, -.token.attr-value, -.token.keyword { - color: #07a; -} - -.token.function { - color: #DD4A68; -} - -.token.regex, -.token.important, -.token.variable { - color: #e90; -} - -.token.important, -.token.bold { - font-weight: bold; -} -.token.italic { - font-style: italic; -} - -.token.entity { - cursor: help; -} - diff --git a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/codesample/plugin.min.js b/copy_this/modules/bla/bla-tinymce/tinymce/plugins/codesample/plugin.min.js deleted file mode 100644 index a0285ed..0000000 --- a/copy_this/modules/bla/bla-tinymce/tinymce/plugins/codesample/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -!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.length)break a;if(!(q instanceof e)){k.lastIndex=0;var r=k.exec(q);if(r){m&&(n=r[1].length);var s=r.index-1+n,r=r[0].slice(n),t=r.length,u=s+t,v=q.slice(0,s+1),w=q.slice(u+1),x=[p,1];v&&x.push(v);var y=new e(h,l?c.tokenize(r,l):r,o);x.push(y),w&&x.push(w),Array.prototype.splice.apply(f,x)}}}}}return f},hooks:{all:{},add:function(a,b){var d=c.hooks.all;d[a]=d[a]||[],d[a].push(b)},run:function(a,b){var d=c.hooks.all[a];if(d&&d.length)for(var e,f=0;e=d[f++];)e(b)}}},d=c.Token=function(a,b,c){this.type=a,this.content=b,this.alias=c};if(d.stringify=function(a,b,e){if("string"==typeof a)return a;if("Array"===c.util.type(a))return a.map(function(c){return d.stringify(c,b,a)}).join("");var f={type:a.type,content:d.stringify(a.content,b,e),tag:"span",classes:["token",a.type],attributes:{},language:b,parent:e};if("comment"==f.type&&(f.attributes.spellcheck="true"),a.alias){var g="Array"===c.util.type(a.alias)?a.alias:[a.alias];Array.prototype.push.apply(f.classes,g)}c.hooks.run("wrap",f);var h="";for(var i in f.attributes)h+=(h?" ":"")+i+'="'+(f.attributes[i]||"")+'"';return"<"+f.tag+' class="'+f.classes.join(" ")+'" '+h+">"+f.content+""+f.tag+">"},!b.document)return b.addEventListener?(b.addEventListener("message",function(a){var d=JSON.parse(a.data),e=d.language,f=d.code,g=d.immediateClose;b.postMessage(c.highlight(f,c.languages[e],e)),g&&b.close()},!1),b.Prism):b.Prism}();return"undefined"!=typeof module&&module.exports&&(module.exports=c),"undefined"!=typeof global&&(global.Prism=c),c.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://,cdata://i,tag:{pattern:/<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},c.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),c.languages.xml=c.languages.markup,c.languages.html=c.languages.markup,c.languages.mathml=c.languages.markup,c.languages.svg=c.languages.markup,c.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},c.languages.css.atrule.inside.rest=c.util.clone(c.languages.css),c.languages.markup&&(c.languages.insertBefore("markup","tag",{style:{pattern:/");var o=t.getParam("content_css_cors",!1,"boolean")?' crossorigin="anonymous"':"";l.each(t.contentCSS,function(e){n+='"});var r=t.settings.body_id||"tinymce";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_id","","hash"))[t.id]||r);var a=t.settings.body_class||"";-1!==a.indexOf("=")&&(a=(a=t.getParam("body_class","","hash"))[t.id]||"");var c='