Changeset 1694 in ExiteCMS
- Timestamp:
- 08/25/08 18:57:16 (3 years ago)
- Location:
- branches/PLi-Fusion/includes/jscripts/hoteditor-4.2
- Files:
-
- 2 edited
-
editor.js (modified) (19 diffs)
-
show_it.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/PLi-Fusion/includes/jscripts/hoteditor-4.2/editor.js
r1666 r1694 34 34 | The ExiteCMS team decoded the original obfusicated code in order to make changes to 35 35 | the way some BBcodes were parsed. We didn't tamper with the copyright en credit code 36 | in any way. We hope this doesn't violate the author's wishes. 36 | in any way. We hope this doesn't violate the author's wishes, as the licencing 37 | conditions of the free version aren't exactly clear. 37 38 | 38 39 +-------------------------------------------------------------------------- … … 64 65 //---------------- FOR WYSIWYG EDITOR (BBCODE EDITOR) ---------------- 65 66 66 var TitleText = " ExiteCMS -Rich Text Editor";67 var TitleText = "Rich Text Editor"; 67 68 var iframe_meta_tag = "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\n"; 68 69 var iframe_style = "BODY{font-family:Verdana,Arial,Sans-Serif,Tahoma;font-size:12px;color: black;}"; … … 96 97 //---------------- FOR BBCODE EDITOR ---------------- 97 98 98 var TitleText_Texarea =" ExiteCMS -BBCode Editor";99 var TitleText_Texarea ="BBCode Editor"; 99 100 100 101 var textarea_toolbar1 ="SPACE,btFont_Name,btFont_Size,btFont_Color,btHighlight,btRemove_Format,SPACE,btBold,btItalic,btUnderline"; … … 376 377 b = b.replace(/[\n\r]/gi, ""); 377 378 b = HTMLToBBCode(b); 378 b = b.replace(/\[table\]\n+/gi, "[ TABLE]");379 b = b.replace(/\n+\[td\]/gi, "[ TD]");380 b = b.replace(/\n+\[\/table\]/gi, "[/ TABLE]");381 b = b.replace(/\n+\[\/td\]/gi, "[/ TD]");382 b = b.replace(/\n+\[tr\]/gi, "[ TR]");383 b = b.replace(/\n+\[\/tr\]/gi, "[/ TR]");379 b = b.replace(/\[table\]\n+/gi, "[table]"); 380 b = b.replace(/\n+\[td\]/gi, "[td]"); 381 b = b.replace(/\n+\[\/table\]/gi, "[/table]"); 382 b = b.replace(/\n+\[\/td\]/gi, "[/td]"); 383 b = b.replace(/\n+\[tr\]/gi, "[tr]"); 384 b = b.replace(/\n+\[\/tr\]/gi, "[/tr]"); 384 385 document.getElementById("hoteditor_bbcode_ouput_" + a).value = b; 385 386 document.getElementById("hoteditor_html_ouput_" + a).value = BBCodeToHTML(b); … … 394 395 document.getElementById("hoteditor_html_ouput_" + a).value = b; 395 396 b = HTMLToBBCode(b); 396 b = b.replace(/\[table\]\n+/gi, "[ TABLE]");397 b = b.replace(/\n+\[td\]/gi, "[ TD]");398 b = b.replace(/\n+\[\/table\]/gi, "[/ TABLE]");399 b = b.replace(/\n+\[\/td\]/gi, "[/ TD]");400 b = b.replace(/\n+\[tr\]/gi, "[ TR]");401 b = b.replace(/\n+\[\/tr\]/gi, "[/ TR]");397 b = b.replace(/\[table\]\n+/gi, "[table]"); 398 b = b.replace(/\n+\[td\]/gi, "[td]"); 399 b = b.replace(/\n+\[\/table\]/gi, "[/table]"); 400 b = b.replace(/\n+\[\/td\]/gi, "[/td]"); 401 b = b.replace(/\n+\[tr\]/gi, "[tr]"); 402 b = b.replace(/\n+\[\/tr\]/gi, "[/tr]"); 402 403 document.getElementById("hoteditor_bbcode_ouput_" + a).value = b; 403 404 } … … 1295 1296 n = flash_height_number_default; 1296 1297 } 1297 var o = "[" + b.to UpperCase() + "=" + m + "," + n + "]" + l + "[/" + b.toUpperCase() + "]";1298 var o = "[" + b.toLowerCase() + "=" + m + "," + n + "]" + l + "[/" + b.toLowerCase() + "]"; 1298 1299 if (isIE) { 1299 1300 d.document.execCommand("removeformat", false, ""); … … 1323 1324 WriteHTML(r, a); 1324 1325 } 1325 } else if (b == "youtube" || b == "google" || b == "yahoo") { 1326 if (b == "youtube") { 1327 var l = prompt(promptYouTube, URLDefaultYouTube); 1328 if (l != null) { 1329 l = l.replace(/watch\?v=/gi, "v/"); 1330 } 1331 } else if (b == "google") { 1332 var l = prompt(promptGoogle, URLDefaultGoogle); 1333 if (l != null) { 1334 l = l.replace(/videoplay/i, "googleplayer.swf"); 1335 l = l.replace(/\&hl=en/i, ""); 1336 } 1337 } else if (b == "yahoo") { 1338 var l = prompt(promptYahoo, URLDefaultYahoo); 1339 if (l != null) { 1340 l.match(/flashvars='id=(.*?)&emailUrl=(.*?)'/i); 1341 l = "http://us.i1.yimg.com/cosmos.bcst.yahoo.com/player/media/swf/FLVVideoSolo.swf?id=" + RegExp.$1; 1342 } 1343 } 1326 } else if (b == "youtube") { 1327 var l = prompt(promptYouTube, URLDefaultYouTube); 1344 1328 if (l != null) { 1345 var o = "[" + bbFlash.toUpperCase() + "=" + flash_width_number_default + "," + flash_height_number_default + "]" + l + "[/" + bbFlash.toUpperCase() + "]"; 1329 l = l.replace(/watch\?v=/gi, "v/"); 1330 } 1331 if (l != null) { 1332 var o = "[" + b.toLowerCase() + "]" + l + "[/" + b.toLowerCase() + "]"; 1346 1333 if (isIE) { 1347 1334 d.document.execCommand("removeformat", false, ""); … … 1355 1342 } 1356 1343 } 1344 } else if (b == "google" || b == "yahoo") { 1345 if (b == "google") { 1346 var l = prompt(promptGoogle, URLDefaultGoogle); 1347 if (l != null) { 1348 l = l.replace(/videoplay/i, "googleplayer.swf"); 1349 l = l.replace(/\&hl=en/i, ""); 1350 } 1351 } else if (b == "yahoo") { 1352 var l = prompt(promptYahoo, URLDefaultYahoo); 1353 if (l != null) { 1354 l.match(/flashvars='id=(.*?)&emailUrl=(.*?)'/i); 1355 l = "http://us.i1.yimg.com/cosmos.bcst.yahoo.com/player/media/swf/FLVVideoSolo.swf?id=" + RegExp.$1; 1356 } 1357 } 1358 if (l != null) { 1359 var o = "[" + bbFlash.toLowerCase() + "=" + flash_width_number_default + "," + flash_height_number_default + "]" + l + "[/" + bbFlash.toLowerCase() + "]"; 1360 if (isIE) { 1361 d.document.execCommand("removeformat", false, ""); 1362 rng.pasteHTML(""); 1363 rng.pasteHTML(o); 1364 } else if (isSafari) { 1365 d.document.execCommand("InsertText", false, o); 1366 } else { 1367 d.focus(); 1368 d.document.execCommand("InsertHTML", false, o); 1369 } 1370 } 1357 1371 } else if (b == "quote" || b == "code" || b == "php" || b == "html") { 1358 b = b.to UpperCase();1372 b = b.toLowerCase(); 1359 1373 var u = ""; 1360 1374 if (isIE) { … … 1367 1381 } 1368 1382 } 1369 if (b == "code" || b == "php" || b == "html") { 1370 u = u.replace(/[\n\r]/gi, ""); 1371 u = u.replace(/<(br|p|div|li).*?>/gi, "[br/]"); 1372 u = u.replace(/<\/(p|div).*?>/gi, ""); 1373 u = u.replace(/(<([^>]+)>)/gi, ""); 1374 u = u.replace(/\[br\/\]/gi, "<br>"); 1375 } 1376 u = "[" + b + "]" + u + "[/" + b + "]"; 1383 // ExiteCMS: don't tamper with the contents of a code block! 1384 // if (b == "code" || b == "php" || b == "html") { 1385 // u = u.replace(/[\n\r]/gi, ""); 1386 // u = u.replace(/<(br|p|div|li).*?>/gi, "[br/]"); 1387 // u = u.replace(/<\/(p|div).*?>/gi, ""); 1388 // u = u.replace(/(<([^>]+)>)/gi, ""); 1389 // u = u.replace(/\[br\/\]/gi, "<br>"); 1390 // } 1391 if (b == "quote" && hoteditor_reply_to != "") { 1392 u = "[" + b + "=" + hoteditor_reply_to + "]" + u + "[/" + b + "]"; 1393 } else { 1394 u = "[" + b + "]" + u + "[/" + b + "]"; 1395 } 1377 1396 WriteHTML(u, a); 1378 1397 } else if (b == "symbol") { … … 1487 1506 } else { 1488 1507 try { 1489 d.document.execCommand("Unlink", false, null); 1490 d.document.execCommand("CreateLink", false, l); 1508 // ExiteCMS: no text selected, then use the link itself as text 1509 if (rng == null) { 1510 WriteHTML("<a href='" + l + "'>" + l +"</a>", a); 1511 } else { 1512 d.document.execCommand("Unlink", false, null); 1513 d.document.execCommand("CreateLink", false, l); 1514 } 1491 1515 } catch (e) { 1492 1516 } … … 2275 2299 a = a.replace(/\[font=(.*?)\]/gi, "<font face=\"$1\">"); 2276 2300 a = a.replace(/\[color=(.*?)\]/gi, "<font color=\"$1\">"); 2277 a = a.replace(/\[size=(.*?)\]/gi, "<font s ize=\"$1\">");2301 a = a.replace(/\[size=(.*?)\]/gi, "<font style=\"font-size:$1px\">"); 2278 2302 a = a.replace(/\[\/(font|color|size)\]/gi, "</font>"); 2279 2303 a = a.replace(/\[highlight=(.*?)\]/gi, "<span style=\"background-color:$1\">"); … … 2308 2332 } 2309 2333 } 2334 2310 2335 if (isOpera9 || isIE) { 2311 2336 a = a.replace(/<li>/gi, "</li><li>"); … … 2343 2368 c += "[list=a]"; 2344 2369 } else if (f == "text-align") { 2345 g = g.to UpperCase();2370 g = g.toLowerCase(); 2346 2371 c += "[" + g + "]"; 2347 2372 } else if (f == "margin-left" || f == "margin-right") { … … 2425 2450 a = htmlentities(a); 2426 2451 } 2452 var px = new Array(0, 6, 8,10,12,14,18,24,28); 2427 2453 var b = a.split("<"); 2428 2454 var c = new Array; … … 2556 2582 } 2557 2583 } else if (k.align) { 2558 m = "[" + k.align.to UpperCase() + "]" + "[list=1]";2584 m = "[" + k.align.toLowerCase() + "]" + "[list=1]"; 2559 2585 } else { 2560 2586 m = "[list=1]"; … … 2564 2590 m = AnalyzeHTMLBlock(g, k) + "[list]"; 2565 2591 } else if (k.align) { 2566 m = "[" + k.align.to UpperCase() + "]" + "[list=1]";2592 m = "[" + k.align.toLowerCase() + "]" + "[list=1]"; 2567 2593 } else { 2568 2594 m = "[list]"; 2569 2595 } 2570 } else if (g == "font" || 2571 g == "h1" || 2572 g == "h2" || 2573 g == "h3" || g == "h4" || g == "h5" || g == "h6") { 2596 } else if (g == "h1" || g == "h2" || g == "h3" || g == "h4" || g == "h5" || g == "h6") { 2597 m += "[size=" + px[8 - g.substr(1)] + "]"; 2598 } else if (g == "font") { 2574 2599 if (j.length > 0) { 2575 2600 for (var r in k) { … … 2579 2604 } else if (r == "size") { 2580 2605 if (isNaN(parseInt(k.size))) { 2581 k.size = 2;2606 k.size = 3; 2582 2607 } 2583 var px = new Array(0, 6, 8,10,12,14,18,24,36); 2584 if (k.size > 7) { 2608 if (k.size > 8) { 2585 2609 m += "[size=" + k.size + "]"; 2586 2610 } else { 2587 m += "[size=" + px[ k.size] + "]";2611 m += "[size=" + px[(k.size+1)] + "]"; 2588 2612 } 2589 2613 } else if (r == "face") { … … 2598 2622 m = AnalyzeHTMLBlock(g, k); 2599 2623 } else if (k.align) { 2600 m = "[" + k.align.to UpperCase() + "]";2624 m = "[" + k.align.toLowerCase() + "]"; 2601 2625 } else { 2602 2626 m = "[HOTEDITOR_NEW_LINE]"; … … 2704 2728 C = C.replace(/\[\/tr\]/gi, "\n[/tr]"); 2705 2729 C = C.replace(/\[tr\]/gi, "\n[tr]"); 2706 C = C.replace(/\[td\]/gi, "\n[ rd]");2730 C = C.replace(/\[td\]/gi, "\n[td]"); 2707 2731 C = C.replace(/\[\/table\]/gi, "\n[/table]"); 2708 2732 C = C.replace(/\[\/table\]$/gi, "[/table]\n"); -
branches/PLi-Fusion/includes/jscripts/hoteditor-4.2/show_it.php
r1666 r1694 211 211 <script language=javascript> 212 212 var my_what ="$what"; 213 if(my_what=="smiley s"){213 if(my_what=="smiley"){ 214 214 self.parent.Set_smiles_path("$script_url?step=1&what=$what"); 215 215 } … … 353 353 354 354 var my_what ="$what"; 355 if(my_what=="smiley s"){355 if(my_what=="smiley"){ 356 356 my_document.Set_smiles_path("$script_url?$q_string"); 357 357 } … … 374 374 } 375 375 else{ 376 if(my_what =="smiley s"){376 if(my_what =="smiley"){ 377 377 my_document.InsertSymbol("<img border=0 src='" + data + "'> "); 378 378 }
Note: See TracChangeset
for help on using the changeset viewer.
