From c90142080f0da74c8c327117ab942547e120b7f6 Mon Sep 17 00:00:00 2001 From: Ian Date: Sun, 9 Dec 2012 14:58:59 +0100 Subject: [PATCH] outsourced comments scripting to serendipity_editor.js --- include/admin/tpl/comments.inc.tpl | 57 ++------------------------ include/admin/tplold/comments.inc.tpl | 58 ++------------------------- serendipity_editor.js | 52 ++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 108 deletions(-) diff --git a/include/admin/tpl/comments.inc.tpl b/include/admin/tpl/comments.inc.tpl index 6558f46d..b2f62987 100644 --- a/include/admin/tpl/comments.inc.tpl +++ b/include/admin/tpl/comments.inc.tpl @@ -4,61 +4,12 @@ {if !empty($errormsg)} {$errormsg} {/if} -{* Smarty 3 has a new auto literal option which is enabled by default. - When the { is followed by a space it's not interpreted as smarty delimiter but literal. *} - +

{$CONST.COMMENTS}

diff --git a/include/admin/tplold/comments.inc.tpl b/include/admin/tplold/comments.inc.tpl index 7008b05e..45fe3455 100644 --- a/include/admin/tplold/comments.inc.tpl +++ b/include/admin/tplold/comments.inc.tpl @@ -2,63 +2,11 @@

{$errormsg}

{/if} -{* -Smarty 3 has a new auto literal option which is enabled by default. -When the { is followed by a space it's not interpreted as smarty delimiter but literal. -*} +
{$formtoken} diff --git a/serendipity_editor.js b/serendipity_editor.js index 5afe7662..a93afd14 100644 --- a/serendipity_editor.js +++ b/serendipity_editor.js @@ -648,5 +648,57 @@ function fillInput(source, target) { } +/* outsourced from comments.inc.tpl */ +function FT_toggle(id) { + if ( document.getElementById(id + '_full').style.display == '' ) { + document.getElementById(id + '_full').style.display='none'; + document.getElementById(id + '_summary').style.display=''; + document.getElementById(id + '_text').innerHTML = view_full; + } else { + document.getElementById(id + '_full').style.display=''; + document.getElementById(id + '_summary').style.display='none'; + document.getElementById(id + '_text').innerHTML = view_hide; + } + return false; +} +function invertSelection() { + var f = document.formMultiDelete; + for (var i = 0; i < f.elements.length; i++) { + if( f.elements[i].type == 'checkbox' ) { + f.elements[i].checked = !(f.elements[i].checked); + f.elements[i].onclick(); + } + } +} + +var origborder = ''; +var origwidth = ''; + +function highlightComment(id, checkvalue) { + var comment = document.getElementById(id); + + if (origborder == '') { + origborder = comment.style.borderColor; + if (origborder == '') { + origborder = '#FFFFFF'; + } + } + + if (origwidth == '') { + origwidth = comment.style.borderWidth; + if (origwidth == '' || origwidth == 0) { + origwidth = 1; + } + } + + if (checkvalue) { + comment.style.borderColor = '#FF0000'; + comment.style.borderWidth = origwidth; + } else { + comment.style.borderColor = ''; + comment.style.borderWidth = origwidth; + } +} + // -->