Lines Matching +full:style +full:. +full:local +full:. +full:ini

2 if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../../').'/');
3 if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
4 require_once(DOKU_PLUGIN.'action.php');
7 $default_english_file = DOKU_PLUGIN . 'fckg/action/lang/en.php';
11 $default_lang_file = DOKU_PLUGIN . 'fckg/action/lang/' . $conf['lang'] . '.php';
18 * @license GNU GPLv2 version 2 or later (http://www.gnu.org/licenses/gpl.html)
21 * @author Myron Turner <turnermm02@shaw.ca>
87 * @author Myron Turner <turnermm02@shaw.ca>
100 * @author Pierre Spring <pierre.spring@liip.ch>
121 'src'=>DOKU_BASE.'lib/plugins/fckg/' .$this->fck_location. '/fckeditor.js'
129 'src'=>DOKU_BASE.'lib/plugins/fckg/scripts/vki_kb.js'
134 echo "\n" . '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />' ."\n";
142 * @author Pierre Spring <pierre.spring@liip.ch>
164 …vent Dokuwiki normal processing of $ACT (it would clean the variable and destroy our 'index' value.
172 * @author Myron Turner <turnermm02@shaw.ca>
210 $new_addr = $_SERVER['SERVER_NAME'] . DOKU_BASE;
211 …$text=preg_replace("#(?<=http://)(.*?)(?=lib/plugins/fckg/fckeditor/editor/images/smiley/msn)#s", …
214 $text = preg_replace_callback('/\[\[\w+>.*?\]\]/ms',
229 "/<(nowiki|code|file)>(.*?)<\/(nowiki|code|file)/ms",
238 "/(?<!nowiki>)%%(.*?)%%/ms",
240 return '<nowiki>' . $matches[1] . '</nowiki>';
250 '/(\n )((?![\*\-]).*?)(\n)(?!\s)/ms',
266 '/(<nowiki>)(.*?)(<\/nowiki>)/ms',
269 '$needles = array("[","]", "/", ".", "*", "_","\'","<",">","%", "{", "}", "\\\");
272 return $matches[1] . $matches[2] . $matches[3];'
278 '/<(code|file)(.*?)(>)(.*?)(<\/\1>)/ms',
299 … return "<" . $matches[1] . $matches[2] . $matches[3] . $matches[4] . $matches[5];'
311 '/(\|\s*)(<code>|<file>)(.*?)(<\/code>|<\/file>)\n_fckg_NPBBR_(?=.*?\|)/ms',
319 … return $matches[1] . $matches[2] . trim($matches[3]) . $matches[4];'
329 $text = preg_replace_callback('/<plugin(.*?)(?=<\/plugin>)/ms',
344 $ins = "FNoteINSert" . $count;
352 $text = preg_replace('/(={3,}.*?)(\{\{.*?\}\})(.*?={3,})/',"$1$3\n$2",$text);
353 $email_regex = '/\/\/\<\/\/(.*?@.*?)>/';
356 $text = preg_replace('/{{(.*)\.swf(\s*)}}/ms',"SWF$1.swf$2FWS",$text);
372 '/(TPRE_CODE|TPRE_FILE)(.*?)(TPRE_CLOSE)/ms',
379 return $matches[1] . $matches[2] . $matches[3];'
386 '/(<pre)(.*?)(>)(.*?)(<\/pre>)/ms',
390 … return $matches[1] . $matches[2] . $matches[3] . $matches[4] . $matches[5];'
395 $cname = getCacheName($INFO['client'].$ID,'.draft.fckl');
399 preg_match_all("/<\/(.*?)\>/", $cdata['text'],$matches);
424 if(!isset($dw_edit_display))return ""; //version 0.
431 return ' style = "display:none"; ';
475 fck.BasePath = "'.DOKU_BASE.'lib/plugins/fckg/'.$this->fck_location.'/";
476 fck.ToolbarSet = "DokuwikiNoGuest";
477 fck.ReplaceTextarea();'
484 fck.BasePath = "'.DOKU_BASE.'lib/plugins/fckg/'.$this->fck_location.'/";
485 fck.ToolbarSet = "DokuwikiGuest";
486 fck.ReplaceTextarea();'
493 fck.BasePath = "'.DOKU_BASE.'lib/plugins/fckg/'.$this->fck_location.'/";
494 fck.ToolbarSet = "Dokuwiki";
495 fck.ReplaceTextarea();'
520 …php echo $ro?> cols="80" rows="10" class="edit" tabindex="1"><?php echo "\n".$this->xhtml?></texta…
554 <div id = "fck_size__ctl" style="display: none">
556 <img src = "<?php echo DOKU_BASE ?>lib/images/smaller.gif"
560 <img src = "<?php echo DOKU_BASE ?>lib/images/larger.gif"
567 … <input type="checkbox" name="fckg" value="fckg" checked="checked" style="display: none"/>
580 style = "font-size: 100%;"
585 <input type="checkbox" name="fckg" value="fckg" style="display: none"/>
590 style = "font-size: 100%;"
591 … onclick ="setDWEditCookie(2, this);parse_wikitext('edbtn__save');this.form.submit();"
612 style = "font-size: 100%;"
624 style = 'display:<?php echo $inline ?>;'
631 style = "background-color: yellow"
664 <div id = "backup_msg" class="backup_msg" style=" display:none;">
676 style = 'display:none'
680 style = 'display:none'>Disable editor time-out messsages </span>
686 …abel'> <?php echo $fckg_lang['complex_tables'];?> (<a href="https://www.dokuwiki.org/plugin:fckgli…
689 <input style="display:none;" class="button" id="edbtn__save" type="submit" name="do[save]"
696 <input type="button" id='edbtn__preview' style="display: none"/>
699 <div id='saved_wiki_html' style = 'display:none;' ></div>
700 <div id='fckg_draft_html' style = 'display:none;' >
708 <?php echo 'var backup_empty = "' . $fckg_lang['backup_empty'] .'";'; ?>
712 …window.open( DURL + "/lib/plugins/fckg/fckeditor/aspell.php?dw_conf_lang=<?php global $conf; echo …
719 var height = parseInt(document.getElementById('wiki__text___Frame').style.height);
726 document.getElementById('wiki__text___Frame').style.height = height + 'px';
743 document.getElementById('complex_tables').click();
746 document.getElementById('complex_tables').disabled = true;
768 echo "fckgLPluginPatterns.push({'pat': '$pat[0]', 'orig': '$pat[1]' });\n";
776 echo "fckLImmutables.push('$fckLImmutables[$i]');\n";
787 echo "var doku_base = '" . DOKU_BASE ."'";
795 var draft = dom.innerHTML;
796 var dw_text = oDokuWiki_FCKEditorInstance.GetData( true );
797 oInst = oDokuWiki_FCKEditorInstance.get_FCK();
798 oInst =oInst.EditorDocument.body;
799 oInst.innerHTML = draft;
800 dom.innerHTML = dw_text;
802 var tmp = btn.value;
803 btn.value = fckg_draft_btn;
806 btn.title = fckg_draft_btn_title;
813 …if(oDokuWiki_FCKEditorInstance.dwiki_fnencode && oDokuWiki_FCKEditorInstance.dwiki_fnencode == 'sa…
826 if(value.match(/%25/ && value.match(/%25[a-z0-9]/))) {
827 value = value.replace(/%25/g,"%");
830 echo 'value = value.replace(/%5D/g,"]");';
841 RegExp.escape = function(str)
843 var specials = new RegExp("[.*+?|()\\[\\]{}\\\\]", "g"); // .*+?|()[]{}\
844 return str.replace(specials, "\\$&");
862 for(var i=0; i < rows.length; i++) {
865 for(var col=0; col<rows[i].length; col++) {
867 str+= "text="+rows[i][col].text + " ";
868 str+=" type="+rows[i][col].type + " ";
869 str+= " rowspan=" +rows[i][col].rowspan + " ";
870 str+= " colspan=" +rows[i][col].colspan + " ";
879 for(var i=0; i < rows.length; i++) {
880 for(var col=0; col<rows[i].length; col++) {
881 str+= "|"+rows[i][col].text + " ";
895 +", rowspans:"+ rows[row][col].rowspan
896 +", colspans:"+ rows[row][col].colspan
897 +", text:"+rows[row][col].text,
905 function check_rowspans(rows,start_row, ini) {
907 for(var i=start_row; i < rows.length; i++) {
908 for(var col=0; col<rows[i].length; col++) {
909 if(rows[i][col].rowspan > 0) {
910 … var _text = rows[i][col].text;
911 … tmp.push({row:i,column:col, spans: rows[i][col].rowspan,text:_text});
912 if(!ini) break;
921 var prev_colspans = rows[row][col].colspan ? rows[row][col].colspan: 0;
922 rows[row][col].rowspan = 0;
925 …rows[++row].splice(col, 0,{type:'td', rowspan:0,colspan:prev_colspans,prev_colspan:prev_colspans,t…
934 var num_spans = tmp_start.length;
938 var row = tmp_start[0].row;
939 var col = tmp_start[0].column;
940 insert_rowspan(row,col,tmp_start[0].spans,rows);
946 if(tmp.length) {
947 insert_rowspan(tmp[0].row,tmp[0].column,tmp[0].spans,rows);
956 for(var i=0; i<rows.length;i++) {
961 for(var i=0; i < rows.length; i++) {
963 for(var col=0; col<rows[i].length; col++) {
964 var type = rows[i][col].type == 'td'? '|': '^';
966 … var align = rows[i][col].align ? rows[i][col].align : false;
971 results += rows[i][col].text;
976 if(rows[i][col].colspan) {
977 for(var n=0; n < rows[i][col].colspan-1; n++) {
989 window.dwfckTextChanged = false;
1036 String.frasl = new RegExp("⁄\|&frasl;\|&#8260;\|&#x2044;",'g');
1039 HTMLParser(oDokuWiki_FCKEditorInstance.GetData( true ), {
1087 var c1_inx = results.lastIndexOf(c1); // start position of chars to delete
1088 var c2_inx = results.indexOf(c2,c1_inx); // position of expected next character
1090 if(c1.length + c2_inx == c2_inx) {
1091 var left_side = results.substring(0,c1_inx); //from 0 up to but not including c1
1092 var right_side = results.substring(c2_inx); //from c2 to end of string
1100 this_debug = this.dbg;
1102 if(format_chars[tag] && this.in_link) {
1103 this.link_formats.push(tag);
1106 if(format_chars[tag] && this.in_font) {
1114 this.prev_list_level = this.list_level;
1115 this.list_level++;
1116 if(this.list_level == 1) this.list_started = false;
1117 if(this.list_started) this.prev_li.push(markup['li']) ;
1122 else if(!this.list_level) {
1124 this.prev_li = new Array();
1131 var style = false;
1135 this.is_smiley = false;
1136 this.in_link = false;
1142 this.xcl_markup = false; // set to false in end() as well, double sure
1143 this.in_link = true;
1144 this.link_pos = results.length;
1145 this.link_formats = new Array();
1146 this.footnote = false;
1148 this.id = "";
1149 this.external_mime = false;
1151 this.export_code = false;
1152 this.code_snippet = false;
1153 this.downloadable_file = "";
1155 this.link_only = false;
1157 this.interwiki=false;
1158 this.bottom_url=false;
1159 this.link_class="";
1163 this.in_link = false;
1164 if(this.in_table) {
1178 this.td_no = 0;
1179 this.tr_no = 0;
1180 this.in_table = true;
1181 this.is_rowspan = false;
1182 this.row=-1;
1183 this.rows = new Array();
1184 CurrentTable = this.rows;
1185 this.table_start = results.length;
1188 this.tr_no++;
1189 this.td_no = 0;
1190 this.col=-1;
1191 this.row++;
1192 this.rows[this.row] = new Array();
1193 this.current_row = this.rows[this.row];
1196 this.td_no++;
1197 this.col++;
1198 this.current_row[this.col] = {type:tag, rowspan:0,colspan:0,text:""};
1199 this.cell_start = results.length;
1200 this.current_cell = this.current_row[this.col];
1201 if(this.td_rowspan && this.rowspan_col == this.td_no && this.td_no != this.last_column) {
1202 this.is_rowspan = true;
1203 this.td_rowspan --;
1206 this.is_rowspan = false;
1214 this.attr=false;
1215 this.format_tag = false;
1217 if(format_chars[tag])this.format_tag = true;
1220 for ( var i = 0; i < attrs.length; i++ ) {
1222 // if(!confirm(tag + ' ' + attrs[i].name + '="' + attrs[i].escaped + '"')) exit;
1224 // if(!confirm(tag + ' ' + attrs[i].name + '="' + attrs[i].escaped + '"')) exit;
1225 if(attrs[i].name =='colspan') {
1226 this.current_row[this.col].colspan = attrs[i].value;
1228 if(attrs[i].name =='class') {
1229 if((matches=attrs[i].value.match(/(left|center|right)/))) {
1230 this.current_row[this.col].align = matches[1];
1233 if(attrs[i].name == 'rowspan') {
1234 this.current_row[this.col].rowspan= attrs[i].value
1237 if(attrs[i].escaped == 'u' && tag == 'em' ) {
1239 this.attr='u'
1244 if(attrs[i].name == 'class' && attrs[i].value == 'footnotes') {
1246 this.in_endnotes = true;
1250 … if(tag == 'dl' && attrs[i].name == 'class' && attrs[i].value == 'file') {
1251 this.downloadable_code = true;
1255 if(tag == 'span' && attrs[i].name == 'class') {
1256 if(attrs[i].value == 'np_break') return;
1259 if(tag == 'span' && attrs[i].name == 'class') {
1260 if(attrs[i].value =='curid') {
1261 this.curid = true;
1264 if(attrs[i].value == 'multi_p_open') {
1265 this.in_multi_plugin = true;
1269 if(attrs[i].value == 'multi_p_close') {
1270 this.in_multi_plugin = false;
1273 if(attrs[i].value.match(geshi_classes)) {
1275 this.geshi = true;
1280 if(tag == 'span' && attrs[i].name == 'id') {
1281 if((matches= attrs[i].value.match(/imm_(\d+)/))) {
1282 this.immutable_plugin = fckLImmutables[matches[1]];
1286 if(attrs[i].name == 'face') {
1287 this.in_font=true;
1288 font_family = attrs[i].value;
1290 if(attrs[i].name == 'style') {
1291 matches = attrs[i].value.match(/font-size:\s*(\d+(\w+|%))/);
1295 matches = attrs[i].value.match(/font-weight:\s*(\w+)/);
1299 … matches = attrs[i].value.match(/[^\-]color:\s*([#\w\s\d,\(\)]+);?/);
1304 matches = attrs[i].value.match(/background[-]color:\s*([#\w\s\d,\(\)]+);?/i);
1309 else if(attrs[i].name == 'color') {
1310 font_color = attrs[i].value;
1315 results = results.replace(/\^$/,'|');
1317 this.in_td = true;
1318 if(attrs[i].name == 'align') {
1319 this.td_align =attrs[i].escaped;
1322 else if(attrs[i].name == 'class') {
1323 matches = attrs[i].value.match(/\s+(\w+)align/);
1325 this.td_align = matches[1];
1328 else if(attrs[i].name == 'colspan') {
1330 this.td_colspan =attrs[i].escaped;
1332 else if(attrs[i].name == 'rowspan') {
1333 this.td_rowspan =attrs[i].escaped-1;
1334 this.rowspan_col = this.td_no;
1342 if(attrs[i].name == 'title') {
1343 this.link_title = attrs[i].escaped;
1344 this.link_title = this.link_title.replace(/\s*\(.*$/,"") ;
1346 else if(attrs[i].name == 'class') {
1347 if(attrs[i].value.match(/fn_top/)) {
1348 this.footnote = true;
1350 else if(attrs[i].value.match(/fn_bot/)) {
1353 else if(attrs[i].value.match(/mf_(png|gif|jpg|jpeg)/i)) {
1354 this.link_only=true;
1357 this.link_class= attrs[i].escaped;
1358 media_class = this.link_class.match(/mediafile/);
1360 else if(attrs[i].name == 'id') {
1361 this.id = attrs[i].value;
1363 else if(attrs[i].name == 'type') {
1364 type = attrs[i].value;
1367 else if(attrs[i].name == 'href' && !this.code_type) {
1368 var http = attrs[i].escaped.match(/https*:\/\//) ? true : false;
1369 if(http) save_url = attrs[i].escaped;
1370 if(attrs[i].escaped.match(/\/lib\/exe\/detail.php/)) {
1371 this.image_link_type = 'detail';
1373 else if(attrs[i].escaped.match(/exe\/fetch.php/)) {
1374 this.image_link_type = 'direct';
1376 else { // nice urls using .htaccess
1378 if(attrs[i].escaped.match(regex)) {
1379 this.image_link_type = 'detail';
1385 … var media_type = attrs[i].escaped.match(/fetch\.php.*?media=.*?\.(png|gif|jpg|jpeg)$/i);
1388 if(attrs[i].escaped.match(/^https*:/)) {
1389 this.attr = attrs[i].escaped;
1392 if(attrs[i].escaped.match(/^ftp:/)) {
1393 this.attr = attrs[i].escaped;
1396 else if(attrs[i].escaped.match(/do=export_code/)) {
1397 this.export_code = true;
1399 else if(attrs[i].escaped.match(/^nntp:/)) {
1400 this.attr = attrs[i].escaped;
1403 else if(attrs[i].escaped.match(/^mailto:/)) {
1404 this.attr = attrs[i].escaped.replace(/mailto:/,"");
1407 else if(attrs[i].escaped.match(/^file:/)) { //samba share
1408 var url= attrs[i].value.replace(/file:[\/]+/,"");
1409 url = url.replace(/[\/]/g,'\\');
1411 this.attr = url;
1415 … else if(http && !media_type && (matches = attrs[i].escaped.match(/fetch\.php(.*)/)) ) {
1416 if(matches[1].match(/media=/)) {
1417 elems = matches[1].split(/=/);
1418 this.attr = elems[1];
1421 matches[1] = matches[1].replace(/^\//,"");
1422 this.attr = matches[1];
1426 …this.attr = decodeURIComponent ? decodeURIComponent(this.attr) : unescape(this.attr); …
1427 if(!this.attr.match(/^:/)) {
1428 this.attr = ':' +this.attr;
1430 this.external_mime = true;
1436 matches = attrs[i].escaped.match(/doku.php\?id=(.*)/);
1439 matches = attrs[i].escaped.match(/doku.php\/(.*)/);
1442 requires initial ? to be recognized by DW. In Anteater and later */
1444 if(!matches[1].match(/\?/) && matches[1].match(/&amp;/)) {
1446 matches[1] = matches[1].replace(/&amp;/,'?')
1450 if(!matches[1].match(/^:/)) {
1451 this.attr = ':' + matches[1];
1454 this.attr = matches[1];
1457 if(this.attr.match(/\.\w+$/)) { // external mime's first access
1459 this.external_mime = true;
1462 for(var n = i+1; n < attrs.length; n++) {
1463 if(attrs[n].value.match(/other_mime/))
1464 this.external_mime = true;
1473 matches = attrs[i].value.match(/\\\\/); // Windows share
1475 this.attr = attrs[i].escaped;
1481 if(this.link_class == 'media') {
1482 if(attrs[i].value.match(/http:/)) {
1487 if(!this.attr && this.link_title) {
1488 if(this.link_class == 'media') {
1489 this.attr=this.link_title;
1494 …if(this.attr.match && this.attr.match(/%[a-fA-F0-9]{2}/) && (matches = this.attr.match(/userfiles…
1495 matches[1] = matches[1].replace(/\//g,':');
1496 if(!matches[1].match(/^:/)) {
1499 …this.attr = decodeURIComponent ? decodeURIComponent(matches[1]) : unescape(matches[1]); …
1500 … this.attr = decodeURIComponent ? decodeURIComponent(this.attr) : unescape(this.attr);
1501 this.external_mime = true;
1505 …// alert('title: ' + this.link_title + ' class: ' + this.link_class + ' export: ' +this.export_co…
1506 if(this.link_title.match(/Snippet/)) this.code_snippet = true;
1509 if(attrs[i].value.match(/^#/) && this.link_class.match(/wikilink/)) {
1510 this.attr = attrs[i].value;
1511 this.link_title = false;
1515 if(this.link_class.match(/wikilink/) && this.link_title) {
1516 this.external_mime = false;
1517 if(!this.attr){
1518 this.attr = this.link_title;
1520 if(!this.attr.match(/^:/)) {
1521 this.attr = ':' + this.attr;
1523 if(this.attr.match(/\?.*?=/)){
1524 var elems = this.attr.split(/\?/);
1525 elems[0] = elems[0].replace(/\//g,':');
1526 this.attr = elems[0] + '?' + elems[1];
1529 this.attr = this.attr.replace(/\//g,':');
1532 /* catch query strings attached to internal links for .htacess nice urls */
1533 if(!qs_set && attrs[i].name == 'href') {
1534 if(!this.attr.match(/\?.*?=/) && !attrs[i].value.match(/doku.php/)) {
1535 var qs = attrs[i].value.match(/(\?.*)$/);
1536 if(qs && qs[1]) this.attr += qs[1];
1541 else if(this.link_class.match(/mediafile/) && this.link_title && !this.attr) {
1542 this.attr = this.link_title;
1543 this.external_mime = true;
1545 if(!this.attr.match(/^:/)) {
1546 this.attr = ':' + this.attr;
1549 else if(this.link_class.match(/interwiki/)) {
1550 var iw_type = this.link_class.match(/iw_(\w+)/);
1551 var iw_title = this.link_title.split(/\//);
1552 var interwiki_label = iw_title[iw_title.length-1];
1553 interwiki_label = interwiki_label.replace(String.frasl,"\/");
1554 this.attr = iw_type[1] + '>' + interwiki_label;
1555 this.interwiki=true;
1558 if(this.link_class == 'urlextern') {
1559 this.attr = save_url;
1560 …this.external_mime=false; // prevents external links to images from being converted to image links
1562 if(this.in_endnotes) {
1563 if(this.link_title) {
1564 this.bottom_url= this.link_title; //save for bottom urls
1566 else if(this.attr) {
1567 this.bottom_url= this.attr;
1570 this.link_title = "";
1571 this.link_class= "";
1579 if(attrs[i].name == 'title') {
1580 this.attr = ' title="' + attrs[i].escaped + '" ';
1586 if(attrs[i].name == 'class') {
1587 matches = attrs[i].value.split(/\s+/);
1589 this.attr = matches[0];
1591 if(oDokuWiki_FCKEditorInstance.oinsertHtmlCodeObj.notes[matches[1]]) {
1592 … dwfck_note = '(('+ oDokuWiki_FCKEditorInstance.oinsertHtmlCodeObj.notes[matches[1]] + '))';
1600 if(attrs[i].name == 'class') {
1602 var elems = attrs[i].escaped.split(/\s+/);
1603 if(elems.length > 1) {
1604 this.attr = attrs[i].value;
1605 this.code_type = elems[0];
1608 this.attr = attrs[i].escaped;
1609 this.code_type = this.attr;
1611 if(this.downloadable_code) {
1612 this.attr = this.attr.replace(/\s*code\s*/,"");
1613 this.code_type='file';
1616 if(this.in_table) tag = 'pre_td';
1623 if(attrs[i].name == 'alt') {
1624 alt=attrs[i].value;
1626 if(attrs[i].name == 'type') {
1627 this.image_link_type = attrs[i].value;
1630 if(attrs[i].name == 'src') {
1631 …// alert(attrs[i].name + ' = ' + attrs[i].value + ', fnencode=' + oDokuWiki_FCKEditorInstance.dw…
1634 // fetched by fetch.php
1635 if(matches = attrs[i].escaped.match(/fetch\.php.*?(media=.*)/)) {
1636 var elems = matches[1].split('=');
1638 if(matches = attrs[i].escaped.match(/(media.*)/)) {
1639 var elems = matches[1].split('=');
1643 if(!src.match(/https?:/) && !src.match(/^:/)) src = ':' + src;
1645 else if(attrs[i].escaped.match(/https?:\/\//)){
1646 src = attrs[i].escaped;
1647 src = src.replace(/\?.*?$/,"");
1650 … else if(matches = attrs[i].escaped.match(/\/_media\/(.*)/)) {
1651 var elems = matches[1].split(/\?/);
1653 src = src.replace(/\//g,':');
1654 if(!src.match(/^:/)) src = ':' + src;
1657 else if(matches = attrs[i].escaped.match(/\/lib\/exe\/fetch.php\/(.*)/)) {
1658 var elems = matches[1].split(/\?/);
1660 if(!src.match(/^:/)) src = ':' + src;
1665 matches = attrs[i].escaped.match(/^.*?\/userfiles\/image\/(.*)/);
1667 if(!matches) { // windows style
1669 regex = regex.replace(/([\/\\])/g, "\\$1");
1670 regex = '^.*?' + regex + '(.*)';
1672 matches = attrs[i].escaped.match(regex);
1675 src = matches[1].replace(/\//g, ':');
1680 …src = decodeURIComponent ? decodeURIComponent(attrs[i].escaped) : unescape(attrs[i].escaped); …
1681 if(src.search(/data:image.*?;base64/) > -1) {
1685 if(src.match(/lib\/images\/smileys/)) {
1686 // src = 'http://' + window.location.host + src;
1687 this.is_smiley = true;
1691 this.attr = src;
1692 …if(this.attr.match && this.attr.match(/%[a-fA-F0-9]{2}/)) { …
1693 … this.attr = decodeURIComponent ? decodeURIComponent(this.attr) : unescape(this.attr);
1694 …this.attr = decodeURIComponent ? decodeURIComponent(this.attr) : unescape(this.attr); …
1701 else if (attrs[i].name == 'width' && !style) {
1702 width=attrs[i].value;
1705 else if (attrs[i].name == 'height' && !style) {
1706 height=attrs[i].value;
1708 else if(attrs[i].name == 'style') {
1709 var match = attrs[i].escaped.match(/width:\s*(\d+)/);
1712 var match = attrs[i].escaped.match(/height:\s*(\d+)/);
1716 else if(attrs[i].name == 'align' || attrs[i].name == 'class') {
1717 if(attrs[i].escaped.match(/(center|middle)/)) {
1720 else if(attrs[i].escaped.match(/right/)) {
1723 else if(attrs[i].escaped.match(/left/)) {
1733 if(this.is_smiley) {
1738 this.is_smiley = false;
1741 if(this.link_only) tag = 'img';
1743 if(this.in_multi_plugin) {
1748 if(!this.code_type) {
1751 else if(this.code_type) {
1756 if(this.in_table) {
1760 if(this.list_started) {
1768 else if(tag.match(/^h(\d+|r)/)) {
1769 var str_len = results.length;
1770 if(tag.match(/h(\d+)/)) {
1771 this.in_header = true;
1774 if(results.charCodeAt(str_len -1) == 32) {
1775 results = results.replace(/\x20+$/,"");
1779 else if(this.last_col_pipes) {
1788 if(tag == 'b' || tag == 'i' && this.list_level) {
1789 if(results.match(/(\/\/|\*)(\x20)+/)) {
1790 results = results.replace(/(\/\/|\*)(\x20+)\-/,"$1\n"+"$2-");
1794 if(tag == 'li' && this.list_level) {
1795 if(this.list_level == 1 & !this.list_started) {
1797 this.list_started = true;
1799 results = results.replace(/[\x20]+$/,"");
1801 for(var s=0; s < this.list_level; s++) {
1803 if(results.match(/_FORMAT_SPACE_\s*$/)) {
1804 results = results.replace(/_FORMAT_SPACE_\s*$/,"\n");
1809 if(this.prev_list_level > 0 && markup['li'] == markup['ol']) {
1810 this.prev_list_level = -1;
1815 this.xcl_markup = true;
1818 else if(tag == 'a' && (this.export_code || this.code_snippet)) {
1821 else if (tag == 'a' && this.footnote) {
1825 HTMLParserTopNotes.push(this.id);
1827 else if(tag == 'a' && this.external_mime) {
1828 if(this.in_endnotes) {
1829 this.link_class = 'media';
1833 if(this.attr) {
1834 results += this.attr + '|';
1838 else if(this.in_font || tag == 'font') {
1843 if(font_color) font_color = font_color.replace(/\s+/g,"");
1844 if(font_bgcolor) font_bgcolor = font_bgcolor.replace(/\s+/g,"");
1857 if(this.in_endnotes && tag == 'a') return;
1858 if(this.code_type && tag == 'span') tag = 'blank';
1861 if(tag == 'td' || tag == 'th' || (this.last_col_pipes && this.td_align == 'center')) {
1862 if(this.is_rowspan) {
1864 this.is_rowspan = false;
1866 if(this.td_align == 'center' || this.td_align == 'right') {
1871 else if(tag == 'a' && this.attr) {
1872 this.attr = this.attr.replace(/%25/gm,'%');
1873 this.attr = this.attr.replace(/%25/gm,'%');
1874 this.attr = this.attr.replace(/%7c/,'%257c');
1875 results += this.attr + '|';
1878 var link_type = this.image_link_type;
1879 this.image_link_type="";
1880 if(this.link_only) link_type = 'link_only';
1906 this.attr += img_size;
1908 this.attr += ' ';
1911 results += this.attr + '}}';
1912 this.attr = 'src';
1915 if(this.downloadable_file) this.attr += ' ' + this.downloadable_file;
1916 if(!this.attr) this.attr = 'code';
1917 results += this.attr + '>';
1918 this.downloadable_file = "";
1919 this.downloadable_code = false;
1927 if(format_chars[tag] && this.in_font) {
1931 if(this.in_endnotes && tag == 'a') return;
1932 if(this.link_only){
1933 this.link_only=false;
1938 if(tag == 'sup' && this.attr == 'dwfcknote') {
1941 if(this.is_smiley) {
1942 this.is_smiley = false;
1945 if(tag == 'span' && this.in_font) {
1947 this.in_font=false;
1949 if(tag == 'span' && this.curid) {
1950 this.curid = false;
1953 if(tag == 'dl' && this.downloadable_code) {
1954 this.downloadable_code = false;
1958 this.current_cell.text = results.substring(this.cell_start);
1959 this.current_cell.text = this.current_cell.text.replace(/:::/gm,"");
1960 this.current_cell.text = this.current_cell.text.replace(/^[\s\|\^]+/,"");
1962 if(tag == 'a' && (this.export_code || this.code_snippet)) {
1963 this.export_code = false;
1964 this.code_snippet = false;
1968 if(this.code_type && tag == 'span') tag = 'blank';
1970 if(this.footnote) {
1972 this.footnote = false;
1974 else if(tag == 'a' && this.xcl_markup) {
1975 this.xcl_markup = false;
1979 this.in_table = false;
1981 results = results.substring(0, this.table_start);
1982 insert_table(this.rows);
1986 if(tag == 'p' && this.in_table) {
1990 if(this.geshi) {
1991 this.geshi = false;
1995 if(tag == 'code' && ! this.list_started) { // empty code markup corrupts results
1996 if(results.match(/''\s*$/m)) {
1997 results = results.replace(/''\s*$/, "\n");
2003 else if(tag == 'a' && this.attr == 'src') {
2004 // if local image without link content, as in <a . . .></a>, delete link markup
2005 if(this.backup('\[\[', '\{')) return;
2009 this.list_level--;
2010 if(!this.list_level) this.format_in_list = false;
2011 if(this.prev_li.length) {
2012 markup['li']= this.prev_li.pop();
2016 else if(tag == 'a' && this.external_mime) {
2018 this.external_mime = false;
2022 if(this.code_type) {
2023 tag += this.code_type + ">";
2026 var codeinx = results.lastIndexOf('code');
2027 var fileinx = results.lastIndexOf('file');
2029 this.code_type = 'file';
2031 else this.code_type = 'code';
2032 tag += this.code_type + ">";
2034 this.code_type = false;
2040 else if(this.attr == 'u' && tag == 'em' ) {
2050 if(this.last_col_pipes) {
2052 this.last_col_pipes = "";
2056 if(this.td_rowspan && this.rowspan_col == this.td_no+1) {
2057 this.is_rowspan = false;
2058 this.last_column = this.td_no;
2059 this.td_rowspan --;
2064 this.last_col_pipes = "";
2065 this.in_td = false;
2068 else if (current_tag.match(/h\d+/)) {
2069 this.in_header = false;
2075 if(results.match(/\n$/)) {
2081 if(this.in_link && format_chars[current_tag] && this.link_formats.length) {
2088 if(this.list_level) {
2089 this.format_in_list = true;
2095 this.last_tag = current_tag;
2097 if(this.td_colspan && !useComplexTables) {
2098 if(this.td_align == 'center') results += ' ';
2103 for(var i=1; i < this.td_colspan; i++) {
2106 this.last_col_pipes = colspan;
2108 this.td_colspan = false;
2110 else if(this.td_align == 'center') {
2112 this.td_align = '';
2115 if(current_tag == 'a' && this.link_formats.length) {
2116 var end_str = results.substring(this.link_pos);
2117 var start_str = results.substring(0,this.link_pos);
2120 for(var i=0; i < this.link_formats.length; i++) {
2121 var fmt = markup[this.link_formats[i]];
2122 … var endfmt = markup_end[this.link_formats[i]] ? markup_end[this.link_formats[i]]: fmt;
2123 start_format += markup[this.link_formats[i]];
2130 this.link_formats = new Array();
2131 this.in_link = false;
2134 this.link_formats = new Array();
2135 this.in_link = false;
2139 this.immutable_plugin = false;
2146 if(this.interwiki && results.match(/>\w+\s*\|$/)) {
2147 text = text.replace(String.frasl,"\/");
2148 this.interwiki=false;
2149 if(this.attr) {
2153 results=results.replace(/>\w+\s*\|$/,'>'+text);
2157 else if(this.interwiki) {
2158 text = text.replace(String.frasl,"\/");
2160 text = text.replace(/^(&gt;)+/,function(match,quotes) {
2161 return(match.replace(/(&gt;)/g, "\__QUOTE__")) ;
2165 results=results.replace(/([\/\*_])_FORMAT_SPACE_([\/\*_]{2})_FORMAT_SPACE_$/,"$1$2");
2166 if(text.match(/^&\w+;/)) {
2167 …results=results.replace(/_FORMAT_SPACE_\s*$/,""); // remove unwanted space after character entity
2170 if(this.link_only) {
2173 results = results.replace(/\}\}\s*$/,replacement);
2177 if(!this.code_type) {
2178 if(! this.last_col_pipes) {
2179 text = text.replace(/\x20{6,}/, " ");
2180 text = text.replace(/^(&nbsp;)+\s*$/, '_FCKG_BLANK_TD_');
2181 text = text.replace(/(&nbsp;)+/, ' ');
2183 if(this.immutable_plugin) {
2184 text = this.immutable_plugin;
2185 text = text.replace(/\/\/<\/\//g,'<');
2186 this.immutable_plugin = false;
2188 if(this.format_tag) {
2189 if(!this.list_started || this.in_table) text = text.replace(/^\s+/, '@@_SP_@@');
2191 else if(this.last_tag=='a') {
2192 text=text.replace(/^\s{2,}/," ");
2194 else text = text.replace(/^\s+/, '');
2196 if(text.match(/nowiki&gt;/)) {
2200 if(this.is_acronym) {
2201 this.is_acronym = false;
2203 if(this.format_in_list ) {
2204 text = text.replace(/^[\n\s]+$/g, '');
2207 if(this.in_td && !text) {
2209 this.in_td = false;
2213 text = text.replace(/&lt;\s/g, '<');
2214 text = text.replace(/\s&gt;/g, '>');
2217 if(this.attr && this.attr == 'dwfcknote') {
2218 if(text.match(/fckgL\d+/)) {
2221 if(text.match(/^[\-,:;!_]/)) {
2232 if(this.downloadable_code && (this.export_code || this.code_snippet)) {
2233 this.downloadable_file = text;
2238 if(this.last_tag == 'a' && text.match(/^[\.,;\:\!]/)) {
2239 results=results.replace(/\s$/,"");
2242 if(this.in_header) {
2243 text = text.replace(/---/g,'&mdash;');
2244 text = text.replace(/--/g,'&ndash;');
2246 if(this.list_started) {
2247 results=results.replace(/_LIST_EOFL_\s*L_BR_K\s*$/, '_LIST_EOFL_');
2249 if(!this.code_type) { // keep special character literals outside of code block
2251 if(!results.match(/\[\[\\\\.*?\|$/) && !text.match(/\w:(\\(\w?))+/ ))
2253 text = text.replace(/([\*\\])/g, '%%$1%%');
2258 if(this.in_endnotes && HTMLParserTopNotes.length) {
2260 if(text.match(/\w/) && ! text.match(/^\s*\d\)\s*$/)) {
2261 text= text.replace(/\)\s*$/, "_FN_PAREN_C_");
2262 var index = HTMLParserTopNotes.length-1;
2263 if(this.bottom_url) {
2264 if(this.link_class && this.link_class == 'media') {
2265 text = '{{' + this.bottom_url + '|' +text +'}}';
2267 else text = '[[' + this.bottom_url + '|' +text +']]';
2276 this.bottom_url = false;
2282 if(results.match(/>\s*<\/plugin>\s*$/)) {
2283 results = results.replace(/\s*<\/plugin>\s*$/, text + '<\/plugin>');
2287 if(text && text.length) {
2291 results=results.replace(/(&\w+;)\s*([\*\/_]{2})_FORMAT_SPACE_(\w+)/,"$1$2$3");
2293 if(this.list_level && this.list_level > 1) {
2294 results = results.replace(/(\[\[.*?\]\])([ ]+[\*\-].*)$/," $1\n$2");
2298 …var regex = new RegExp('([\*\/\_]{2,})_FORMAT_SPACE_([\*\/\_]{2,})(' + RegExp.escape(text) + ')$')…
2299 if(results.match(regex)) {
2301 results = results.replace(regex,"$1$2$3");
2306 if(text.match(/&lt;/)) {
2318 if(text.replace) {
2319 text = text.replace(/^\s+/g,"");
2320 text = text.replace(/^\n$/g,"");
2334 for(var i=0; i < fckgLPluginPatterns.length; i++) {
2335 fckgLPluginPatterns[i].pat = fckgLPluginPatterns[i].pat.replace(/\|/g,"\\|");
2336 …fckgLPluginPatterns[i].pat = fckgLPluginPatterns[i].pat.replace(/([\(\)\{\}\.\?\[\]])/g, "\\$1"); …
2337 var pattern = new RegExp(fckgLPluginPatterns[i].pat,"gm");
2338 results = results.replace(pattern, fckgLPluginPatterns[i].orig);
2345 results = results.replace(/(\[\[\\\\)(.*?)\]\]/gm, function(match,brackets,block) {
2346 block=block.replace(/\\/g,"_SMB_");
2350 results = results.replace(/%*\\%*([^\w]{1})%*\\%*/g, "$1");
2351 results=results.replace(/_SMB_/g, "\\");
2356 results = results.replace(/\{ \{ rss&gt;Feed:/mg,'{{rss&gt;http://');
2359 … results =results.replace(/\s*([\|\^]+)((\W\W_FORMAT_SPACE_)+)/gm,function(match,pipes,format) {
2360 format = format.replace(/_FORMAT_SPACE_/g,"");
2364 results = results.replace(/&quot;/g,'"');
2366 results = results.replace(regex," $1");
2369 results = results.replace(regex,"$1$2$3");
2372 results = results.replace(regex,' ');
2375 results=results.replace(/([\*\/_]{2})@@_SP_@@(&\w+;)/g,"$1 $2");
2377 results = results.replace(/\n@@_SP_@@\n/g,'');
2378 results = results.replace(/@@_SP_@@\n/g,'');
2379 results = results.replace(/@@_SP_@@/g,'');
2381 …var regex = new RegExp(HTMLParser_FORMAT_SPACE + '([^\\)\\]\\}\\{\\-\\.,;:\\!\?"\x94\x92\u201D\u20…
2382 results = results.replace(regex," $1");
2384 results = results.replace(regex,'');
2388 results = results.replace(/(\s+[\-\*_]\s*)([\*\/_\']{2})(.*?)(\2)([^\n]*)\n+/gm,
2398 results = results.replace(/(L_BR_K)+/g,line_break_final);
2399 results = results.replace(/L_BR_K/gm, line_break_final) ;
2400 results = results.replace(/(\\\\)\s+/gm, "$1 \n");
2404 results = results.replace(/\s+<\/(code|file)>/g, "\n</" + "$1" + ">");
2406 results = results.replace(/\s+;/mg, ";");
2407 results = results.replace(/&lt;\s+/mg, "<");
2408 results = results.replace(/\s+&gt;/mg, ">");
2416 results = results.replace(regex, ' ' +line_break_final + ' ');
2419 results = results.replace(/(\||\^)[ ]+(\||\^)\s$/g, "$1\n");
2420 results = results.replace(/(\||\^)[ ]+(\||\^)/g, "$1");
2423 //results = results.replace(/_FCKG_BLANK_TD_/g, " ");
2427 results = results.replace(/_FCKG_BLANK_TD_/g, " ");
2429 results = results.replace(/\/\/&lt;\/\/\s*/g,'&lt;');
2431 if(HTMLParserTopNotes.length) {
2432 results = results.replace(/\(\(+(\d+)\)\)+/,"(($1))");
2434 var matches = i.match(/_(\d+)/);
2436 …results = results.replace(pattern,'((' + HTMLParserBottomNotes[i].replace(/_FN_PAREN_C_/g, ") ") +…
2438 results = results.replace(/<sup><\/sup>/g, "");
2441 results = results.replace(/(={3,}.*?)(\{\{.*?\}\})(.*?={3,})/g,"$1$3\n\n$2");
2443 results = results.replace(/(<sup>)*\s*\[\[\s*\]\]\s*(<\/sup>)*\n*/g,"");
2446 results = results.replace(/<\s+/g, '<');
2447 results = results.replace(/&lt;\s+/g, '<');
2452 <char> is restored in save.php
2457 results=results.replace(/(&lt;nowiki&gt;)(.*?)(&lt;\/nowiki&gt;)/mg,
2459 mid = mid.replace(/%%(.)%%/mg,"NOWIKI_$1_");
2460 return start + mid.replace(regex,"NOWIKI_$1_") + close;
2464 results = results.replace(/SWF(\s*)\[*/g,"{{$1");
2465 results = results.replace(/\|.*?\]*(\s*)FWS/g,"$1}}");
2466 results = results.replace(/(\s*)FWS/g,"$1}}");
2467 results = results.replace(/\n{3,}/g,'\n\n');
2468 results = results.replace(/_LIST_EOFL_/gm, " " + line_break_final + " ");
2471 if(results.indexOf('~~COMPLEX_TABLES~~') == -1) {
2484 dwform.elements.fck_wikitext.value = results;
2492 dom.click();
2507 var w = window.open();
2508 w.document.write('<pre>' + HTMLParser_DEBUG + '</pre>');
2509 w.document.close();
2515 $url = DOKU_BASE . 'lib/plugins/fckg/scripts/script-cmpr.js';
2517 // $safe_url = DOKU_URL . 'lib/plugins/fckg/scripts/safeFN_cmpr.js';
2531 if(window.DWikifnEncode && window.DWikifnEncode == 'safe') {
2532 LoadScript(DOKU_BASE + 'lib/plugins/fckg/scripts/safeFN_cmpr.js' );
2562 *@author Myron Turner <turnermm02@shaw.ca>
2582 'return "(" . preg_quote($k,"/") . ")";'
2592 '/(' . $s_keys_regex . ')/ms',
2605 $file = DOKU_INC."inc/parser/$mode.php";
2631 $text = preg_replace_callback('/(<code|file.*?>)(.*?)(<\/code>)/ms',
2636 return $matches[1] . $quot . $matches[3];'
2643 …$instructions = p_get_instructions("=== header ==="); // loads DOKU_PLUGINS array --M.T. Dec 22 20…
2648 $text = preg_replace_callback('/('. $regexes .')/',
2662 $text = preg_replace_callback('/'. $xcl . '/',
2671 …return "<span id=\'imm_" . "$index\' title=\'imm_" . "$index\' >" . str_replace("//<//", "<", $mat…
2679 … if(preg_match('/(?=MULTI_PLUGIN_OPEN)(.*?)(?<=MULTI_PLUGIN_CLOSE)/ms', $text, $matches)) {
2680 //file_put_contents('multi_text-2.txt',$matches[1]);
2712 … $xhtml = preg_replace('/MULTI_PLUGIN_OPEN.*?MULTI_PLUGIN_CLOSE/ms', $multi_block, $xhtml);
2714 '|MULTI_PLUGIN_OPEN.*?MULTI_PLUGIN_CLOSE|ms',
2747 '/(' . $s_values_regex . ')/ms',
2760 '/(?<=<a )(href=\".*?\")(\s+\w+=\".*?\")(.*?)(?=>)/sm',
2763 '$ret_str = " " . trim($matches[3]) . " " . trim($matches[2]) . " " . trim($matches[1]) ;
2775 $handle = fopen("edit_php.txt", "a");
2781 * @author Myron Turner <turnermm02@shaw.ca>
2793 * @author Myron Turner <turnermm02@shaw.ca>
2804 //$regex .= "|\{\{rss>http:\/\/.*?\}\}";
2814 $plugin = 'plugin_' . $plugin;
2818 $plugin = '_' . $plugin;
2825 $labels[] = "$index: " . $patterns[$index];
2828 $regex .= "|$pattern";
2838 $plugin = 'plugin_' . $plugin;
2842 $plugin = '_' . $plugin;