aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorMichael <icarus@dabo.de>2012-02-26 21:47:47 +0100
committerMichael <icarus@dabo.de>2012-02-26 21:47:47 +0100
commit437e18d7a7433ea5a9e3388c39ba32c7fe25eb18 (patch)
tree747449ae089f3dd3f6bb55afdf93fa79081bd564 /library
parentedc44933a4f57c09ee1cfb93615d052a2b125d99 (diff)
parent2081e6d507d5983f802c1024cf1e38c6d06d6067 (diff)
downloadvolse-hubzilla-437e18d7a7433ea5a9e3388c39ba32c7fe25eb18.tar.gz
volse-hubzilla-437e18d7a7433ea5a9e3388c39ba32c7fe25eb18.tar.bz2
volse-hubzilla-437e18d7a7433ea5a9e3388c39ba32c7fe25eb18.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'library')
-rwxr-xr-xlibrary/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js73
1 files changed, 65 insertions, 8 deletions
diff --git a/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js
index e5f716b29..44d1473a9 100755
--- a/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js
+++ b/library/tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js
@@ -44,9 +44,35 @@
_dfrn_html2bbcode : function(s) {
s = tinymce.trim(s);
- function rep(re, str) {
- s = s.replace(re, str);
- };
+ function rep(re, str) {
+
+ //modify code to keep stuff intact within [code][/code] blocks
+ //Waitman Gobble NO WARRANTY
+
+
+ var o = new Array();
+ var x = s.split("[code]");
+ var i = 0;
+
+ var si = "";
+ si = x.shift();
+ si = si.replace(re,str);
+ o.push(si);
+
+ for (i = 0; i < x.length; i++) {
+ var no = new Array();
+ var j = x.shift();
+ var g = j.split("[/code]");
+ no.push(g.shift());
+ si = g.shift();
+ si = si.replace(re,str);
+ no.push(si);
+ o.push(no.join("[/code]"));
+ }
+
+ s = o.join("[code]");
+
+ };
@@ -123,11 +149,42 @@
// BBCode -> HTML from DFRN dialect
_dfrn_bbcode2html : function(s) {
s = tinymce.trim(s);
-
- function rep(re, str) {
- s = s.replace(re, str);
- };
-
+
+
+ function rep(re, str) {
+
+ //modify code to keep stuff intact within [code][/code] blocks
+ //Waitman Gobble NO WARRANTY
+
+
+ var o = new Array();
+ var x = s.split("[code]");
+ var i = 0;
+
+ var si = "";
+ si = x.shift();
+ si = si.replace(re,str);
+ o.push(si);
+
+ for (i = 0; i < x.length; i++) {
+ var no = new Array();
+ var j = x.shift();
+ var g = j.split("[/code]");
+ no.push(g.shift());
+ si = g.shift();
+ si = si.replace(re,str);
+ no.push(si);
+ o.push(no.join("[/code]"));
+ }
+
+ s = o.join("[code]");
+
+ };
+
+
+
+
+
// example: [b] to <strong>
rep(/\n/gi,"<br />");
rep(/\[b\]/gi,"<strong>");