Permalink
Browse files

Fixed some config options.

git-svn-id: http://punymce.googlecode.com/svn/trunk@28 bac5f1eb-4f33-0410-b5f2-5fb0db2f108a
  • Loading branch information...
1 parent 909a585 commit 6d82db018be79d09bbc06d531d2705406782564f @spocke committed Jan 21, 2008
Showing with 15 additions and 21 deletions.
  1. +8 −14 examples/full.html
  2. +1 −1 js/punymce/plugins/protect.js
  3. +5 −5 js/punymce/plugins/protect_src.js
  4. +1 −1 js/punymce/puny_mce_full.js
View
@@ -30,7 +30,7 @@ <h3>Full featured example</h3>
<p>Textarea converted into editor with all plugins enabled including the BBCode plugin.</p>
<textarea id="content2" name="content2" style="width:320px;height:70px">
- Some basic &lt;strong&gt;contents&lt;/strong&gt;. :) ;)
+ Some basic &lt;strong&gt;contents&lt;/strong&gt;. :) ;)<script>fsdfsd</script>
</textarea>
<div>
@@ -76,19 +76,13 @@ <h3>Full featured example</h3>
});
var editor2 = new punymce.Editor({
- id : 'content2',
- toolbar : 'bold,italic,underline,strike,increasefontsize,decreasefontsize,ul,ol,indent,outdent,left,center,right,style,textcolor,removeformat,link,unlink,image,emoticons,editsource',
- plugins : 'BBCode,Paste,Image,Emoticons,Link,Protect,TextColor,EditSource,Safari2x',
- min_width : 400,
- entities : 'numeric',
- styles : [
- { title : 'Code', cls : 'pre', cmd : 'FormatBlock', val : '<pre>' },
- { title : 'Quote', cls : 'quote', cmd : 'mceSetClass', val : 'quote'},
- { title : 'Unquote', cls : 'quote', cmd : 'mceSetClass', val : ''}
- ],
- emoticons : {
- auto_convert : 1
- }
+ id : 'content2',
+ plugins : 'Protect',
+ protect : {
+ list : [
+ /<(script|noscript|style)[\u0000-\uFFFF]*?<\/(script|noscript|style)>/g
+ ]
+ }
});
</script>

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,17 +1,17 @@
punymce.plugins.Protect = function(ed) {
- var pr = [], s;
+ var pr = [], s, p;
// Default settings
- s = ed.settings;
- if (!s.protect) {
- s.protect = [
+ p = ed.settings.protect || {};
+ if (!p.list) {
+ p.list = [
/<(script|noscript|style)[\u0000-\uFFFF]*?<\/(script|noscript|style)>/g
];
}
// Store away things to protect
ed.onSetContent.add(function(ed, o) {
- punymce.each(s.protect, function(re) {
+ punymce.each(p.list, function(re) {
o.content = o.content.replace(re, function(a) {
pr.push(a);
return '<!-- pro:' + (pr.length-1) + ' -->';

Large diffs are not rendered by default.

Oops, something went wrong.

0 comments on commit 6d82db0

Please sign in to comment.