ckeditor config.protectedSource不适用于editor.insertHtml上的html元素属性(ckeditor config.protectedSource dont work for html element attributes on editor.insertHtml)
我已经将ckeditor从4.0更新到4.5.4,现在我的插件不像以前那样工作了。
在我的config.js我有
config.protectedSource.push( /\{[\s\S]*?\}/g );
所以我不想在编辑模式下保护所有{}(聪明的东西)。
接下来是对话框按钮中的代码。
onOk: function () { var currentTabId = this._.currentTabId; var link = ''; var OXID = this.getContentElement(currentTabId, 'OXID').getValue(); link += "{assign var=\"aSb_cms_data\" value=$oViewConf->sb_cms_getCategorieData('" + OXID + "')}"; link += "<a href='{$aSb_cms_data.link}'"; title = "{$aSb_cms_data.title}"; link += 'title="' + title + '">' + title; link += "</a>" console.log(link); // editor.insertHtml(link); }
console.log(link)将输出:
{assign var="aSb_cms_data" value=$oViewConf->sb_cms_getCategorieData('testid')}<a href='{$aSb_cms_data.link}'title="{$aSb_cms_data.title}">{$aSb_cms_data.title}</a>
这就是我想要的源代码。
但是在源代码(ckeditor)中现在是:
{assign var="aSb_cms_data" value=$oViewConf->sb_cms_getCategorieData('testid')}<a href="<!--{cke_protected}%7B%24aSb_cms_data.link%7D-->" title="<!--{cke_protected}%7B%24aSb_cms_data.title%7D-->">{$aSb_cms_data.title}</a>
所有“a”属性都与cke_protected东西搞混了......在V4.0中,源代码等于console.log输出。
我该如何解决这个问题?
I've updated ckeditor from 4.0 to 4.5.4 and now my plugin dont work as before.
In my config.js i have
config.protectedSource.push( /\{[\s\S]*?\}/g );
So i wan't to protect all {} (smarty stuff) in the edit mode.
Next is my Code from the dialog button.
onOk: function () { var currentTabId = this._.currentTabId; var link = ''; var OXID = this.getContentElement(currentTabId, 'OXID').getValue(); link += "{assign var=\"aSb_cms_data\" value=$oViewConf->sb_cms_getCategorieData('" + OXID + "')}"; link += "<a href='{$aSb_cms_data.link}'"; title = "{$aSb_cms_data.title}"; link += 'title="' + title + '">' + title; link += "</a>" console.log(link); // editor.insertHtml(link); }
console.log(link) will output:
{assign var="aSb_cms_data" value=$oViewConf->sb_cms_getCategorieData('testid')}<a href='{$aSb_cms_data.link}'title="{$aSb_cms_data.title}">{$aSb_cms_data.title}</a>
That's what i want in the source code.
But in the Source Code(ckeditor) is now:
{assign var="aSb_cms_data" value=$oViewConf->sb_cms_getCategorieData('testid')}<a href="<!--{cke_protected}%7B%24aSb_cms_data.link%7D-->" title="<!--{cke_protected}%7B%24aSb_cms_data.title%7D-->">{$aSb_cms_data.title}</a>
All "a" attributes are messed up with cke_protected stuff... at V4.0 the sourcecode was equal to the console.log output.
How can i fix that?
原文:https://stackoverflow.com/questions/33011111
最满意答案
根据http://www.gnu.org/licenses/gpl-howto.html
该声明应该接近每个源文件的开头,接近版权声明。 使用较小的GPL时,在所有三个地方的“常规”之前插入“较小”一词。 使用GNU AGPL时,在所有三个地方的“常规”之前插入“Affero”一词。
“此声明”是您在原始问题中发布的GPL小通知。
According to http://www.gnu.org/licenses/gpl-howto.html
This statement should go near the beginning of every source file, close to the copyright notices. When using the Lesser GPL, insert the word “Lesser” before “General” in all three places. When using the GNU AGPL, insert the word “Affero” before “General” in all three places.
where "this statement" is the GPL small notice posted in your original question.
相关问答
更多-
我何时才能发布依赖于LGPL库的GPL软件?(When exactly can I release GPL software relying on LGPL libraries? [closed])[2023-08-14]
http://en.wikipedia.org/wiki/GNU_General_Public_License#Compatibility_and_multi-licensing ...在其他许可证下许可的代码可以与GPL下的程序结合使用而不会发生冲突,只要该组合具有适用于整体的GPL即可。 [...]许多最常见的免费软件许可证,如原始的MIT / X许可证,BSD许可证(目前的3分条款)和LGPL,均为“GPL兼容” 我希望这意味着将LGPL lib链接到GPL1或GPL2程序是可以的。 http://e ... -
我认为你提出的分配很好。 要遵守LGPL,您的应用程序用户必须可以删除自己的otherlib.so版本并使用此版本运行您的应用程序。 假设此要求仅涵盖二进制兼容的更改,则在您的情况下,通过仅包含应用程序的二进制版本的分发来满足要求。 I think your proposed distribution is fine. To comply with LGPL it must be possible for users of your application to drop their own version ...
-
GPL / LGPL下的图书馆可以用于商业软件吗?(Can library under GPL/LGPL be used in the commercial software? [closed])[2021-12-14]
GPL并不禁止您销售基于GPL代码的程序,但它确实要求如果您将程序交给任何人(包括出售它),则必须将它们的源代码也提供给他们,并且在GPL下获得许可,以便他们可以修改它并在需要时重新分发它。 任何购买你的程序的人都可以免费将其重新分配给其他人。 LGPL不要求您分发与LGPL库链接的程序源代码,因此您可以在封闭源代码应用程序中使用它们。 (如果你自己发布LGPL库,你仍然需要为你的客户提供源代码。) 这是一个简化。 详情请阅读执照本身,和/或与律师交谈。 The GPL doesn't forbid you ... -
关于LGPL的问题[关闭](Can I enhance one LGPL library based of implementation of another? [closed])[2023-03-26]
没有许可证可以使用您自己的代码实现函数是非法的。 GPL项目定期将其代码基于其他实现,例如GCJ(java编译器)和免费的Flash播放器。 我无法想象任何GPL'会因为创建具有类似功能的库而冒犯。 另一方面, 专利是一个不同的故事 - 保护代码背后的想法。 也许,这就是你的想法。 版权保护该特定代码实例。 如果您链接到他们的图书馆,那么您将不得不遵守他们的许可证。 此外,GPL项目可以在您保留许可证时获得并且很长。 因此,如果您愿意,可以直接链接到他们的库 - 只需为您的项目保留相同的许可。 No lic ... -
LGPL允许您在不释放源代码的情况下链接到代码,所以是的,您可以这样做。 LGPL allows you to link to the code without releasing your source, so yes, you can do it.
-
GPL,LGPL许可[关闭](GPL, LGPL licencing [closed])[2024-01-23]
是一场热门辩论。 具体来说,如果程序提供的API用于转发呼叫,则插件基本上在逻辑上依赖于所述库,因此被一些人认为受GPL约束。 至少必须合理地确定所述插件可以“自己”/“独立地”运行并且不依赖于代码 - 从法律角度而不是技术角度。 难以制定,IANAL等,最佳做法不是留在灰色地带; 更好的发布代码:比律师便宜,让用户也开心。 如果所述插件合理地独立于所使用的库(参见第1点),您可以选择您喜欢的任何许可证。 你不能真实地阻止有人为你的程序编写一个与非免费服务接口的插件。 您可以通过使用数字签名等技术措施来阻止 ... -
LGPL许可下“分发”含义的范围是什么?(What are the extents of the meaning of “distributing” under the LGPL license? [closed])[2021-11-16]
是的,它确实。 GPL首先出现的原因之一是为了防止有人拥有二进制文件的情况,但没有任何消息来源。 IANAL,所以我不能谈论咨询 - 客户关系是否会构成一个漏洞,你可以用它来避免传递源代码,但这肯定违背了许可证的意图去做你的建议。 Yes it does. One of the reasons the GPL came into being in the first place was to prevent the situation where somebody had a binary, but no ... -
LGPL小通知?(LGPL small notice? [closed])[2022-03-09]
根据http://www.gnu.org/licenses/gpl-howto.html 该声明应该接近每个源文件的开头,接近版权声明。 使用较小的GPL时,在所有三个地方的“常规”之前插入“较小”一词。 使用GNU AGPL时,在所有三个地方的“常规”之前插入“Affero”一词。 “此声明”是您在原始问题中发布的GPL小通知。 According to http://www.gnu.org/licenses/gpl-howto.html This statement should go near the ... -
如果您是从头开始编写应用程序,则可以根据需要对其进行许可。 如果你想为插件的GPL做一个例外,那就有先例。 您正在寻找GPL链接异常 (例如Classpath Exception)。 If you are writing your application from scratch, you can license it however you want. If you want to make an exception to the GPL for plugins, there is precedent. ...
-
如果您使用的是GPL库,则必须使用GPL。 我现在找不到它,但它是在GNU页面上。 You must use GPL if you are using libraries that are GPL. I can't find it now, but it was on GNU page.