editor.path="/sites/default/modules/bueditor/";editor.buttons=[ [ "Insert/edit image", "js:\nvar M = E.getSelection().match(new RegExp(\'^\\\\[img(?:=(\\\\d+)x(\\\\d+))?](.+)\\\\[/img]$\')) || [\'\', \'\', \'\', \'\'];\nvar form = [\n {name: \'src\', title: \'URL\', value: M[3]},\n {name: \'width\', value: M[1]},\n {name: \'height\', value: M[2]}\n];\neDefTagDialog(\'img\', form, \'Insert/edit image\', \'OK\', \'bbcImgProcess\');\n\nbbcImgProcess = function(tag, form) {\n  var src = form.elements[\'attr_src\'].value;\n  var width = form.elements[\'attr_width\'].value;\n  var height = form.elements[\'attr_height\'].value;\n  var str = \'[img\'+ (width ? (\'=\'+ width +\'x\'+ height) : \'\') +\']\'+ src +\'[/img]\';\n  editor.dialog.close();\n  if (src) editor.active.replaceSelection(str);\n}", "image.png", "M" ], [ "Insert/edit link", "js:\nvar S = E.getSelection();\nvar M = S.match(new RegExp(\'^\\\\[url(?:=([^\\\\]]*))?]((?:.|[\\r\\n])*)\\\\[/url]$\')) || [\'\', \'\', \'\'];\nvar form = [\n {name: \'href\', title: \'URL\', value: M[1] ? M[1] : M[2] },\n {name: \'text\', value: M[1] ? M[2] : (M[0] ? \'\' : S)}\n];\neDefTagDialog(\'a\', form, \'Insert/edit link\', \'OK\', \'bbcUrlProcess\');\n\nbbcUrlProcess = function(tag, form) {\n  var url = form.elements[\'attr_href\'].value;\n  var text = form.elements[\'attr_text\'].value;\n  var str = \'[url\'+ (text ? (\'=\'+ url) : \'\') +\']\'+ (text ? text : url) +\'[/url]\';\n  editor.dialog.close();\n  if (url) editor.active.replaceSelection(str);\n}", "link.png", "L" ], [ "Bold. ", "[b]%TEXT%[/b]", "bold.png", "B" ], [ "Italic", "[i]%TEXT%[/i]", "italic.png", "I" ], [ "Ordered list. Converts selected lines to a numbered list.", "js: eDefSelProcessLines(\'[list=1]\\n\', \' [*]\', \'\', \'\\n[/list]\');", "ol.png", "O" ], [ "Unordered list. Converts selected lines to a bulleted list.", "js: eDefSelProcessLines(\'[list]\\n\', \' [*]\', \'\', \'\\n[/list]\');", "ul.png", "U" ], [ "Insert List Item.", "[*]%TEXT%", "[*]", "" ], [ "Quote", "[quote]%TEXT%[/quote]", "Quote", "" ], [ "Preview", "js:\nfunction BBC2HTML(S) {\nif (S.indexOf(\'[\') \x3c 0) return S;\n\nfunction X(p, f) {return new RegExp(p, f)}\nfunction D(s) {return rD.exec(s)}\nfunction R(s) {return s.replace(rB, P)}\nfunction A(s, p) {for (var i in p) s = s.replace(X(i, \'g\'), p[i]); return s;}\n\nfunction P($0, $1, $2, $3) {\n  if ($3 \x26\x26 $3.indexOf(\'[\') \x3e -1) $3 = R($3);\n  switch ($1) {\n    case \'url\':case \'anchor\':case \'email\': return \'\x3ca \'+ L[$1] + ($2||$3) +\'\"\x3e\'+ $3 +\'\x3c/a\x3e\';\n    case \'img\': var d = D($2); return \'\x3cimg src=\"\'+ $3 +\'\"\'+ (d ? \' width=\"\'+ d[1] +\'\" height=\"\'+ d[2] +\'\"\' : \'\') +\' alt=\"\'+ (d ? \'\' : $2) +\'\" /\x3e\';\n    case \'flash\':case \'youtube\': var d = D($2)||[0, 425, 366]; return \'\x3cobject type=\"application/x-shockwave-flash\" data=\"\'+ Y[$1] + $3 +\'\" width=\"\'+ d[1] +\'\" height=\"\'+ d[2] +\'\"\x3e\x3cparam name=\"movie\" value=\"\'+ Y[$1] + $3 +\'\" /\x3e\x3c/object\x3e\';\n    case \'float\': return \'\x3cspan style=\"float: \'+ $2 +\'\"\x3e\'+ $3 +\'\x3c/span\x3e\';\n    case \'left\':case \'right\':case \'center\':case \'justify\': return \'\x3cdiv style=\"text-align: \'+ $1 +\'\"\x3e\'+ $3 +\'\x3c/div\x3e\';\n    case \'google\':case \'wikipedia\': return \'\x3ca href=\"\'+ G[$1] + $3 +\'\"\x3e\'+ $3 +\'\x3c/a\x3e\';\n    case \'b\':case \'i\':case \'u\':case \'s\':case \'sup\':case \'sub\':case \'h1\':case \'h2\':case \'h3\':case \'h4\':case \'h5\':case \'h6\':case \'table\':case \'tr\':case \'th\':case \'td\': return \'\x3c\'+ $1 +\'\x3e\'+ $3 +\'\x3c/\'+ $1 +\'\x3e\';\n    case \'row\': case \'r\':case \'header\':case \'head\':case \'h\':case \'col\':case \'c\': return \'\x3c\'+ T[$1] +\'\x3e\'+ $3 +\'\x3c/\'+ T[$1] +\'\x3e\';\n    case \'acronym\':case \'abbr\': return \'\x3c\'+ $1 +\' title=\"\'+ $2 +\'\"\x3e\'+ $3 +\'\x3c/\'+ $1 +\'\x3e\';\n  }\n  return \'[\'+ $1 + ($2 ? \'=\'+ $2 : \'\') +\']\'+ $3 +\'[/\'+ $1 +\']\';\n}\n\nvar rB = X(\'\\\\[([a-z][a-z0-9]*)(?:=([^\\\\]]+))?]((?:.|[\\r\\n])*?)\\\\[/\\\\1]\', \'g\'), rD = X(\'^(\\\\d+)x(\\\\d+)$\');\nvar L = {url: \'href=\"\', \'anchor\': \'name=\"\', email: \'href=\"mailto: \'};\nvar G = {google: \'http://www.google.com/search?q=\', wikipedia: \'http://www.wikipedia.org/wiki/\'};\nvar Y = {youtube: \'http://www.youtube.com/v/\', flash: \'\'};\nvar T = {row: \'tr\', r: \'tr\', header: \'th\', head: \'th\', h: \'th\', col: \'td\', c: \'td\'};\nvar C = {notag: [{\'\\\\[\': \'\x26#91;\', \']\': \'\x26#93;\'}, \'\', \'\'], code: [{\'\x3c\': \'\x26lt;\'}, \'\x3ccode\x3e\x3cpre\x3e\', \'\x3c/pre\x3e\x3c/code\x3e\']};\nC.php = [C.code[0], C.code[1]+ \'\x26lt;?php \', \'?\x3e\'+ C.code[2]];\nvar F = {font: \'font-family:$1\', size: \'font-size:$1px\', color: \'color:$1\'};\nvar U = {c: \'circle\', d: \'disc\', s: \'square\', \'1\': \'decimal\', a: \'lower-alpha\', A: \'upper-alpha\', i: \'lower-roman\', I: \'upper-roman\'};\nvar I = {}, B = {};\n\nfor (var i in C) I[\'\\\\[(\'+ i +\')]((?:.|[\\r\\n])*?)\\\\[/\\\\1]\'] = function($0, $1, $2) {return C[$1][1] + A($2, C[$1][0]) + C[$1][2]};\nfor (var i in F) {B[\'\\\\[\'+ i +\'=([^\\\\]]+)]\'] = \'\x3cspan style=\"\'+ F[i] +\'\"\x3e\'; B[\'\\\\[/\'+ i +\']\'] = \'\x3c/span\x3e\';}\nB[\'\\\\[list]\'] = \'\x3cul\x3e\'; B[\'\\\\[list=(\\\\w)]\'] = function($0, $1) {return \'\x3cul style=\"list-style-type: \'+ (U[$1]||\'disc\') +\'\"\x3e\'}; B[\'\\\\[/list]\'] = \'\x3c/ul\x3e\'; B[\'\\\\[\\\\*]\'] = \'\x3cli\x3e\';\nB[\'\\\\[quote(?:=([^\\\\]]+))?]\'] = function($0, $1) {return \'\x3cdiv class=\"bb-quote\"\x3e\'+ ($1 ? $1 +\' wrote\' : \'Quote\') +\':\x3cblockquote\x3e\'}; B[\'\\\\[/quote]\'] = \'\x3c/blockquote\x3e\x3c/div\x3e\';\nB[\'\\\\[(hr|br)]\'] = \'\x3c$1 /\x3e\'; B[\'\\\\[sp]\'] = \'\x26nbsp;\';\nreturn R(A(A(S, I), B));\n}\nE.preview \x26\x26 $(E.preview).css(\'display\') != \'none\' ? E.setContent(E.oriCnt) : E.setContent(BBC2HTML(E.oriCnt = E.getContent()));\neDefPreview();", "preview.png", "P" ], [ "Help", "js: eDefHelp();", "help.png", "F" ] ]
