upgrade freetag for 2.0

This commit is contained in:
Ian 2014-03-14 15:18:56 +01:00
parent a8bda77bd1
commit 22834c80b1
4 changed files with 44 additions and 56 deletions

View file

@ -1,3 +1,6 @@
3.51: update jquery.autocomplete.min.js and css v.2.4.4 which removed $.browser
removed jquery-migrate-1.1.1.js because of that again
3.50: Optimize autocomplete for 2.0, fixes 3.50: Optimize autocomplete for 2.0, fixes
3.49: Repair autocomplete for 2.0 3.49: Repair autocomplete for 2.0

View file

@ -1,48 +1,38 @@
.ac_results { /**
* @fileOverview CSS for jquery-autocomplete, the jQuery Autocompleter
* @author <a href="mailto:dylan@dyve.net">Dylan Verheul</a>
* @license MIT | GPL | Apache 2.0, see LICENSE.txt
* @see https://github.com/dyve/jquery-autocomplete
*/
.acResults {
padding: 0px; padding: 0px;
border: 1px solid black; border: 1px solid WindowFrame;
background-color: white; background-color: Window;
overflow: hidden; overflow: hidden;
z-index: 99999;
} }
.ac_results ul { .acResults ul {
width: 100%; margin: 0px;
padding: 0px;
list-style-position: outside; list-style-position: outside;
list-style: none; list-style: none;
padding: 0;
margin: 0;
} }
.ac_results li { .acResults ul li {
margin: 0px; margin: 0px;
padding: 2px 5px; padding: 2px 5px;
cursor: default; cursor: pointer;
display: block; display: block;
/*
if width will be 100% horizontal scrollbar will apear
when scroll mode will be used
*/
/*width: 100%;*/
font: menu; font: menu;
font-size: 12px; font-size: 12px;
/*
it is very important, if line-height not setted or setted
in relative units scroll will be broken in firefox
*/
line-height: 16px;
overflow: hidden; overflow: hidden;
} }
.ac_loading { .acLoading {
background: white url('indicator.gif') right center no-repeat; background : url('indicator.gif') right center no-repeat;
} }
.ac_odd { .acSelect {
background-color: #eee; background-color: Highlight;
} color: HighlightText;
.ac_over {
background-color: #0A246A;
color: white;
} }

File diff suppressed because one or more lines are too long

View file

@ -72,7 +72,7 @@ class serendipity_event_freetag extends serendipity_event
'smarty' => '2.6.7', 'smarty' => '2.6.7',
'php' => '4.1.0' 'php' => '4.1.0'
)); ));
$propbag->add('version', '3.50'); $propbag->add('version', '3.51');
$propbag->add('event_hooks', array( $propbag->add('event_hooks', array(
'frontend_fetchentries' => true, 'frontend_fetchentries' => true,
'frontend_fetchentry' => true, 'frontend_fetchentry' => true,
@ -875,16 +875,17 @@ class serendipity_event_freetag extends serendipity_event
// autocomplete with serendipity 2.0 // autocomplete with serendipity 2.0
if ($this->get_config('admin_ftayt')) { if ($this->get_config('admin_ftayt')) {
echo ' echo '
function enableAutocomplete() { function enableAutocomplete() {
$("#properties_freetag_tagList").autocomplete(tags, { $("#properties_freetag_tagList").autocomplete(tags, {
minChars: 0, minChars: 0,
multiple: true, multiple: true,
scrollHeight: 200, scrollHeight: 200,
matchContains: "word", matchContains: "word",
autoFill: false autoFill: false
})}; })
};
addLoadEvent(enableAutocomplete); addLoadEvent(enableAutocomplete);
'; ';
} }
break; break;
@ -921,13 +922,11 @@ class serendipity_event_freetag extends serendipity_event
foreach ($taglist as $k => $v) { foreach ($taglist as $k => $v) {
$wicktags[] = '\'' . addslashes($k) . '\''; $wicktags[] = '\'' . addslashes($k) . '\'';
} }
// jQuery Migrate is used due to $.browser of autocomplete plugin not being available in jquery 1.9+
echo ' echo '
' . ($serendipity['version'][0] == 1 ? '<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>' : '') . ' ' . ($serendipity['version'][0] == 1 ? '<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>' : '') . '
<link rel="stylesheet" type="text/css" href="' . $serendipity['baseURL'] . 'plugins/serendipity_event_freetag/jquery.autocomplete.css" /> <link rel="stylesheet" type="text/css" href="' . $serendipity['baseURL'] . 'plugins/serendipity_event_freetag/jquery.autocomplete.css" />
<script src="https://code.jquery.com/jquery-migrate-1.1.1.js"></script> <script type="text/javascript" src="' . $serendipity['baseURL'] . 'plugins/serendipity_event_freetag/jquery.autocomplete.min.js"></script>
<script type="text/javascript" language="Javascript" src="' . $serendipity['baseURL'] . 'plugins/serendipity_event_freetag/jquery.autocomplete.min.js"></script> <script type="text/javascript">
<script type="text/javascript" language="Javascript">
var tags = [' . implode(',', $wicktags) . ']; var tags = [' . implode(',', $wicktags) . '];
' . ($serendipity['version'][0] == 1 ? ' ' . ($serendipity['version'][0] == 1 ? '
function enableAutocomplete() { function enableAutocomplete() {