first commit
This commit is contained in:
19
components/com_jce/editor/tiny_mce/plugins/noneditable/config.php
vendored
Normal file
19
components/com_jce/editor/tiny_mce/plugins/noneditable/config.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @copyright Copyright (c) 2009-2022 Ryan Demmer. All rights reserved
|
||||
* @license GNU/GPL 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* JCE is free software. This version may have been modified pursuant
|
||||
* to the GNU General Public License, and as distributed it includes or
|
||||
* is derivative of works licensed under the GNU General Public License or
|
||||
* other free or open source software licenses
|
||||
*/
|
||||
class WFNoneditablePluginConfig
|
||||
{
|
||||
public static function getConfig(&$settings)
|
||||
{
|
||||
$wf = WFApplication::getInstance();
|
||||
$settings['noneditable_editable_class'] = $wf->getParam('noneditable.editable_class', '');
|
||||
$settings['noneditable_noneditable_class'] = $wf->getParam('noneditable.noneditable_class', '');
|
||||
}
|
||||
}
|
||||
2
components/com_jce/editor/tiny_mce/plugins/noneditable/editor_plugin.js
vendored
Normal file
2
components/com_jce/editor/tiny_mce/plugins/noneditable/editor_plugin.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/* jce - 2.9.32 | 2022-11-01 | https://www.joomlacontenteditor.net | Copyright (C) 2006 - 2022 Ryan Demmer. All rights reserved | GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html */
|
||||
!function(){tinymce.PluginManager.add("noneditable",function(editor){function hasClass(checkClassName){return function(node){return(" "+node.attr("class")+" ").indexOf(checkClassName)!==-1}}function convertRegExpsToNonEditable(e){function replaceMatchWithSpan(match){var args=arguments,index=args[args.length-2],prevChar=index>0?content.charAt(index-1):"";if('"'===prevChar)return match;if(">"===prevChar){var findStartTagIndex=content.lastIndexOf("<",index);if(findStartTagIndex!==-1){var tagHtml=content.substring(findStartTagIndex,index);if(tagHtml.indexOf('contenteditable="false"')!==-1)return match}}return'<span class="'+cls+'" data-mce-content="'+editor.dom.encode(args[0])+'">'+editor.dom.encode("string"==typeof args[1]?args[1]:args[0])+"</span>"}var i=nonEditableRegExps.length,content=e.content,cls=tinymce.trim(nonEditClass);if("raw"!=e.format){for(;i--;)content=content.replace(nonEditableRegExps[i],replaceMatchWithSpan);e.content=content}}var nonEditableRegExps,contentEditableAttrName="contenteditable",editClass=tinymce.trim(editor.getParam("noneditable_editable_class","mceEditable")),nonEditClass=tinymce.trim(editor.getParam("noneditable_noneditable_class","mceNonEditable")),hasEditClass=hasClass(editClass),hasNonEditClass=hasClass(nonEditClass);nonEditableRegExps=editor.getParam("noneditable_regexp"),nonEditableRegExps&&!nonEditableRegExps.length&&(nonEditableRegExps=[nonEditableRegExps]),editor.onPreInit.add(function(){editor.formatter.register("noneditable",{block:"div",wrapper:!0,onformat:function(elm,fmt,vars){tinymce.each(vars,function(value,key){editor.dom.setAttrib(elm,key,value)})}}),nonEditableRegExps&&editor.onBeforeSetContent.add(function(ed,e){convertRegExpsToNonEditable(e)}),editor.parser.addAttributeFilter("class",function(nodes){for(var node,i=nodes.length;i--;)node=nodes[i],hasEditClass(node)?node.attr(contentEditableAttrName,"true"):hasNonEditClass(node)&&node.attr(contentEditableAttrName,"false")}),editor.serializer.addAttributeFilter(contentEditableAttrName,function(nodes){for(var node,i=nodes.length;i--;)node=nodes[i],(hasEditClass(node)||hasNonEditClass(node))&&(nonEditableRegExps&&node.attr("data-mce-content")?(node.name="#text",node.type=3,node.raw=!0,node.value=node.attr("data-mce-content")):node.attr(contentEditableAttrName,null))})})})}();
|
||||
1
components/com_jce/editor/tiny_mce/plugins/noneditable/index.html
vendored
Normal file
1
components/com_jce/editor/tiny_mce/plugins/noneditable/index.html
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
||||
22
components/com_jce/editor/tiny_mce/plugins/noneditable/noneditable.xml
vendored
Normal file
22
components/com_jce/editor/tiny_mce/plugins/noneditable/noneditable.xml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" ?>
|
||||
<extension version="3.6" type="plugin" group="jce" method="upgrade">
|
||||
<name>JCE - Noneditable</name>
|
||||
<version>1.0.0</version>
|
||||
<creationDate>July 2019</creationDate>
|
||||
<author>Ryan Demmer</author>
|
||||
<authorEmail>info@joomlacontenteditor.net</authorEmail>
|
||||
<authorUrl>https://www.joomlacontenteditor.net/</authorUrl>
|
||||
<copyright>Copyright (C) 2006 - 2020 Ryan Demmer. All rights reserved</copyright>
|
||||
<license>GNU/GPL Version 2 - http://www.gnu.org/licenses/gpl-2.0.html</license>
|
||||
<description>Noneditable elements for JCE</description>
|
||||
<icon></icon>
|
||||
<files></files>
|
||||
<fields name="noneditable">
|
||||
<fieldset name="config">
|
||||
<field name="noneditable_class" type="text" default="" hint="mceNonEditable" label="WF_NONEDITABLE_NONEDITABLE_CLASS" description="WF_NONEDITABLE_NONEDITABLE_CLASS_DESC" />
|
||||
<field name="editable_class" type="text" default="" hint="mceEditable" label="WF_NONEDITABLE_EDITABLE_CLASS" description="WF_NONEDITABLE_EDITABLE_CLASS_DESC" />
|
||||
</fieldset>
|
||||
</fields>
|
||||
<languages></languages>
|
||||
<help></help>
|
||||
</extension>
|
||||
Reference in New Issue
Block a user