From 44ea050a13bf836be4e8f34186e88164da7720eb Mon Sep 17 00:00:00 2001 From: Ian Date: Sat, 15 Mar 2014 17:35:37 +0100 Subject: [PATCH] fix virtual js --- templates/2k11/config.inc.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/templates/2k11/config.inc.php b/templates/2k11/config.inc.php index d48f31af..90b32472 100644 --- a/templates/2k11/config.inc.php +++ b/templates/2k11/config.inc.php @@ -122,14 +122,18 @@ function serendipity_plugin_api_pre_event_hook($event, &$bag, &$eventData, &$add echo serendipity_smarty_show('admin/serendipity_editor.js.tpl', $data); break; } + break; + case 'js': - echo "jQuery(function() { - jQuery('input[type=\"url\"]').change(function() { - if (this.value != '' && ! (this.value.substr(0,7) == 'http://' || this.value.substr(0,8) == 'https://')) { - this.value = 'http://' + this.value; - } - }); - })\n\n"; + // alway add \n\n for the next and start at line Col 1, to populate the (virtual) serendipity.js file + echo " +jQuery(function() { + jQuery('input[type=\"url\"]').change(function() { + if (this.value != '' && ! (this.value.substr(0,7) == 'http://' || this.value.substr(0,8) == 'https://')) { + this.value = 'http://' + this.value; + } + }); +})\n\n"; break; return true;