Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_livesearch
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24503/plugins/serendipity_event_livesearch
Modified Files:
serendipity_event_livesearch.js
serendipity_event_livesearch.php
Log Message:
Livesearch: The <script src=...> tag must be within the HEAD section,
otherwise mozilla makes trouble. So I renamed the pagebottom hook to
page_header (which is also better for future plugins).
Embedded blogs need to emit that library call on their own. I documented
that in both NEWS and our wiki-installation page.
Index: serendipity_event_livesearch.js
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_livesearch/serendipity_event_livesearch.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- serendipity_event_livesearch.js 13 Jul 2004 16:25:26 -0000 1.1
+++ serendipity_event_livesearch.js 14 Jul 2004 13:04:09 -0000 1.2
@@ -52,7 +52,6 @@
}
document.getElementById('serendipityQuickSearchTermField').style.border = '1px solid green';
-
}
function liveSearchKeyPress(event) {
@@ -153,6 +152,3 @@
return true;
}
}
-
-// s9y is missing easy onload() adding, so call it from here:
-addLoadEvent(liveSearchInit);
\ No newline at end of file
Index: serendipity_event_livesearch.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_livesearch/serendipity_event_livesearch.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- serendipity_event_livesearch.php 14 Jul 2004 10:23:04 -0000 1.2
+++ serendipity_event_livesearch.php 14 Jul 2004 13:04:09 -0000 1.3
@@ -3,7 +3,7 @@
switch ($serendipity['lang']) {
case 'de':
@define('PLUGIN_EVENT_LIVESEARCH_NAME', 'LiveSearch');
- @define('PLUGIN_EVENT_LIVESEARCH_DESC', 'Erweitert die Suchfunktion mit einer live-aktualisierung mit dem Datenbestand zur sofortigen Anzeige (JavaScript)');
+ @define('PLUGIN_EVENT_LIVESEARCH_DESC', 'Erweitert die Suchfunktion mit einer Live-aktualisierung (JavaScript)');
@define('PLUGIN_EVENT_LIVESEARCH_WAIT', 'Suche aktiviert, bitte warten...');
break;
@@ -12,7 +12,7 @@
case 'es':
default:
@define('PLUGIN_EVENT_LIVESEARCH_NAME', 'LiveSearch');
- @define('PLUGIN_EVENT_LIVESEARCH_DESC', 'Enhances the Search function of your blog with live-updates on keypress (JavaScript)');
+ @define('PLUGIN_EVENT_LIVESEARCH_DESC', 'Enhances the Search function with live-updates on keypress (JavaScript)');
@define('PLUGIN_EVENT_LIVESEARCH_WAIT', 'Wait, sending request...');
break;
}
@@ -27,7 +27,7 @@
$propbag->add('description', PLUGIN_EVENT_LIVESEARCH_DESC);
$propbag->add('event_hooks', array(
'external_plugin' => true,
- 'frontend_pagebottom' => true,
+ 'frontend_header' => true,
'css' => true
));
}
@@ -90,12 +90,17 @@
<?php
break;
- case 'frontend_pagebottom':
+ case 'frontend_header':
+ if (!$serendipity['embed'] || $serendipity['embed'] === 'false' || $serendipity['embed'] === false) {
+ echo '<script type="text/javascript" src="' . $serendipity['baseURL'] . 'plugin/ls-js"></script>';
+ }
+
echo '<script type="text/javascript">
lsbase = "' . $serendipity['baseURL'] . 'plugin/ls";
waittext = "' . PLUGIN_EVENT_LIVESEARCH_WAIT . '";
+ addLoadEvent(liveSearchInit);
</script>';
- echo '<script type="text/javascript" src="' . $serendipity['baseURL'] . 'plugin/ls-js"></script>';
+
break;
case 'external_plugin':
|