From 9e731506c2ccc05cf1eab98868d5c1bdbd0967ba Mon Sep 17 00:00:00 2001
From: friendica (.*?)<\/ul>/gi,"[list]$1[/list]");
- rep(/
(.*?)<\/ul>/gi,"[list=]$1[/list]");
- rep(/
(.*?)<\/ul>/gi,"[list=1]$1[/list]");
- rep(/
(.*?)<\/ul>/gi,"[list=i]$1[/list]");
- rep(/
(.*?)<\/ul>/gi,"[list=I]$1[/list]");
- rep(/
(.*?)<\/ul>/gi,"[list=a]$1[/list]");
- rep(/
(.*?)<\/ul>/gi,"[list=A]$1[/list]");
- rep(/
(.*?)<\/ul>/gi,"[list]$1[/list]");
+ rep(/
(.*?)<\/ul>/gi,"[list=]$1[/list]");
+ rep(/
(.*?)<\/ul>/gi,"[list=1]$1[/list]");
+ rep(/
(.*?)<\/ul>/gi,"[list=i]$1[/list]");
+ rep(/
(.*?)<\/ul>/gi,"[list=I]$1[/list]");
+ rep(/
(.*?)<\/ul>/gi,"[list=a]$1[/list]");
+ rep(/
(.*?)<\/ul>/gi,"[list=A]$1[/list]");
+ rep(/
(.*?)<\/code>/gi,"[code]$1[/code]");
rep(/<\/(strong|b)>/gi,"[/b]");
rep(/<(strong|b)>/gi,"[b]");
@@ -168,40 +124,9 @@
_dfrn_bbcode2html : function(s) {
s = tinymce.trim(s);
-
- 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]");
-
- };
-
-
-
-
+ function rep(re, str) {
+ s = s.replace(re, str);
+ };
// example: [b] to
rep(/\n/gi,"
");
@@ -211,43 +136,43 @@
rep(/\[\/i\]/gi,"");
rep(/\[u\]/gi,"");
rep(/\[\/u\]/gi,"");
- rep(/\[hr\]/gi,"
");
+ rep(/\[hr\]/gi,"
");
rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,"$2");
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2");
rep(/\[url\](.*?)\[\/url\]/gi,"$1");
rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"");
rep(/\[img\](.*?)\[\/img\]/gi,"");
-
- rep(/\[list\](.*?)\[\/list\]/gi, '$1
');
- rep(/\[list=\](.*?)\[\/list\]/gi, '$1
');
- rep(/\[list=1\](.*?)\[\/list\]/gi, '$1
');
- rep(/\[list=i\](.*?)\[\/list\]/gi,'$1
');
- rep(/\[list=I\](.*?)\[\/list\]/gi, '$1
');
- rep(/\[list=a\](.*?)\[\/list\]/gi, '$1
');
- rep(/\[list=A\](.*?)\[\/list\]/gi, '$1
');
- rep(/\[li\](.*?)\[\/li\]/gi, '$1
');
+ rep(/\[list=\](.*?)\[\/list\]/gi, '$1
');
+ rep(/\[list=1\](.*?)\[\/list\]/gi, '$1
');
+ rep(/\[list=i\](.*?)\[\/list\]/gi,'$1
');
+ rep(/\[list=I\](.*?)\[\/list\]/gi, '$1
');
+ rep(/\[list=a\](.*?)\[\/list\]/gi, '$1
');
+ rep(/\[list=A\](.*?)\[\/list\]/gi, '$1
');
+ rep(/\[li\](.*?)\[\/li\]/gi, '$1
");
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1
");
-
- /* oembed */
- function _b2h_cb(match, url) {
- url = bin2hex(url);
- function s_b2h(data) {
- match = data;
- }
- $.ajax({
- url: 'oembed/b2h?url=' + url,
- async: false,
- success: s_b2h,
- dataType: 'html'
- });
- return match;
- }
- s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb);
-
- /* /oembed */
+
+ /* oembed */
+ function _b2h_cb(match, url) {
+ url = bin2hex(url);
+ function s_b2h(data) {
+ match = data;
+ }
+ $.ajax({
+ url: 'oembed/b2h?url=' + url,
+ async: false,
+ success: s_b2h,
+ dataType: 'html'
+ });
+ return match;
+ }
+ s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb);
+
+ /* /oembed */
return s;
}
--
cgit v1.2.3
From 4bb280bc2f7068f0c1199e9f8119e25278aa3bcb Mon Sep 17 00:00:00 2001
From: friendica (.*?)<\/ul>/gi,"[list]$1[/list]");
- rep(/
(.*?)<\/ul>/gi,"[list=]$1[/list]");
- rep(/
(.*?)<\/ul>/gi,"[list=1]$1[/list]");
- rep(/
(.*?)<\/ul>/gi,"[list=i]$1[/list]");
- rep(/
(.*?)<\/ul>/gi,"[list=I]$1[/list]");
- rep(/
(.*?)<\/ul>/gi,"[list=a]$1[/list]");
- rep(/
(.*?)<\/ul>/gi,"[list=A]$1[/list]");
- rep(/
(.*?)<\/ul>/gi,"[list]$1[/list]");
+ rep(/
(.*?)<\/ul>/gi,"[list=]$1[/list]");
+ rep(/
(.*?)<\/ul>/gi,"[list=1]$1[/list]");
+ rep(/
(.*?)<\/ul>/gi,"[list=i]$1[/list]");
+ rep(/
(.*?)<\/ul>/gi,"[list=I]$1[/list]");
+ rep(/
(.*?)<\/ul>/gi,"[list=a]$1[/list]");
+ rep(/
(.*?)<\/ul>/gi,"[list=A]$1[/list]");
+ rep(/
(.*?)<\/code>/gi,"[code]$1[/code]");
rep(/<\/(strong|b)>/gi,"[/b]");
rep(/<(strong|b)>/gi,"[b]");
@@ -124,9 +168,40 @@
_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
rep(/\n/gi,"
");
@@ -136,43 +211,43 @@
rep(/\[\/i\]/gi,"");
rep(/\[u\]/gi,"");
rep(/\[\/u\]/gi,"");
- rep(/\[hr\]/gi,"
");
+ rep(/\[hr\]/gi,"
");
rep(/\[bookmark=([^\]]+)\](.*?)\[\/bookmark\]/gi,"$2");
rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2");
rep(/\[url\](.*?)\[\/url\]/gi,"$1");
rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"");
rep(/\[img\](.*?)\[\/img\]/gi,"");
-
- rep(/\[list\](.*?)\[\/list\]/gi, '$1
');
- rep(/\[list=\](.*?)\[\/list\]/gi, '$1
');
- rep(/\[list=1\](.*?)\[\/list\]/gi, '$1
');
- rep(/\[list=i\](.*?)\[\/list\]/gi,'$1
');
- rep(/\[list=I\](.*?)\[\/list\]/gi, '$1
');
- rep(/\[list=a\](.*?)\[\/list\]/gi, '$1
');
- rep(/\[list=A\](.*?)\[\/list\]/gi, '$1
');
- rep(/\[li\](.*?)\[\/li\]/gi, '$1
');
+ rep(/\[list=\](.*?)\[\/list\]/gi, '$1
');
+ rep(/\[list=1\](.*?)\[\/list\]/gi, '$1
');
+ rep(/\[list=i\](.*?)\[\/list\]/gi,'$1
');
+ rep(/\[list=I\](.*?)\[\/list\]/gi, '$1
');
+ rep(/\[list=a\](.*?)\[\/list\]/gi, '$1
');
+ rep(/\[list=A\](.*?)\[\/list\]/gi, '$1
');
+ rep(/\[li\](.*?)\[\/li\]/gi, '$1
");
rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1
");
-
- /* oembed */
- function _b2h_cb(match, url) {
- url = bin2hex(url);
- function s_b2h(data) {
- match = data;
- }
- $.ajax({
- url: 'oembed/b2h?url=' + url,
- async: false,
- success: s_b2h,
- dataType: 'html'
- });
- return match;
- }
- s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb);
-
- /* /oembed */
+
+ /* oembed */
+ function _b2h_cb(match, url) {
+ url = bin2hex(url);
+ function s_b2h(data) {
+ match = data;
+ }
+ $.ajax({
+ url: 'oembed/b2h?url=' + url,
+ async: false,
+ success: s_b2h,
+ dataType: 'html'
+ });
+ return match;
+ }
+ s = s.replace(/\[embed\](.*?)\[\/embed\]/gi, _b2h_cb);
+
+ /* /oembed */
return s;
}
--
cgit v1.2.3
From f55779fd831029f764c885bf1fd026a7e94f08eb Mon Sep 17 00:00:00 2001
From: friendica
\n'}h.head+=d.getParam("fullpage_default_doctype",'');h.head+="\n\n
\n
\n";if(g=d.getParam("fullpage_default_encoding")){h.head+='\n'}if(g=d.getParam("fullpage_default_font_family")){i+="font-family: "+g+";"}if(g=d.getParam("fullpage_default_font_size")){i+="font-size: "+g+";"}if(g=d.getParam("fullpage_default_text_color")){i+="color: "+g+";"}h.head+="\n
\n