Merge develop into 1901_autocomplete
authorrabuzarus <trebor@central-unit>
Sat, 30 Jan 2016 15:57:54 +0000 (16:57 +0100)
committerrabuzarus <trebor@central-unit>
Sat, 30 Jan 2016 15:57:54 +0000 (16:57 +0100)
52 files changed:
include/acl_selectors.php
include/dir_fns.php [new file with mode: 0644]
include/nav.php
js/autocomplete.js [new file with mode: 0644]
js/fk.autocomplete.js
js/main.js
library/jquery-textcomplete/LICENSE [new file with mode: 0644]
library/jquery-textcomplete/jquery.textcomplete.js [new file with mode: 0644]
library/jquery_ac/README [deleted file]
library/jquery_ac/friendica.complete.js [deleted file]
library/jquery_ac/friendica.complete.min.js [deleted file]
library/jquery_ac/jquery-1.3.2.min.js [deleted file]
library/jquery_ac/jquery.autocomplete-min.js [deleted file]
library/jquery_ac/jquery.autocomplete.js [deleted file]
library/jquery_ac/shadow.png [deleted file]
library/jquery_ac/styles.css [deleted file]
view/global.css
view/templates/contacts-head.tpl
view/templates/display-head.tpl
view/templates/head.tpl
view/templates/jot-header.tpl
view/templates/message-head.tpl
view/templates/msg-header.tpl
view/templates/nav_head.tpl [new file with mode: 0644]
view/templates/poke_head.tpl
view/templates/wallmsg-header.tpl
view/theme/duepuntozero/style.css
view/theme/frost-mobile/js/main.js
view/theme/frost-mobile/js/theme.js
view/theme/frost-mobile/style.css
view/theme/frost-mobile/templates/contacts-end.tpl
view/theme/frost-mobile/templates/end.tpl
view/theme/frost-mobile/templates/message-end.tpl
view/theme/frost/js/main.js
view/theme/frost/js/theme.js
view/theme/frost/style.css
view/theme/frost/templates/contacts-end.tpl
view/theme/frost/templates/end.tpl
view/theme/frost/templates/message-end.tpl
view/theme/quattro/dark/style.css
view/theme/quattro/green/style.css
view/theme/quattro/lilac/style.css
view/theme/quattro/quattro.less
view/theme/smoothly/style.css
view/theme/smoothly/templates/jot-header.tpl
view/theme/vier/breathe.css
view/theme/vier/narrow.css
view/theme/vier/plus.css
view/theme/vier/shadow.css
view/theme/vier/style.css
view/theme/vier/templates/nav.tpl
view/theme/vier/templates/nav_head.tpl [new file with mode: 0644]

index 69181b7..46f737e 100644 (file)
@@ -1,13 +1,15 @@
 <?php
 
+/**
+ * @file include/acl_selectors.php
+ */
+
 require_once("include/contact_selectors.php");
 require_once("include/contact_widgets.php");
+require_once("include/dir_fns.php");
 require_once("include/features.php");
 require_once("mod/proxy.php");
 
-/**
- *
- */
 
 /**
  * @package acl_selectors
@@ -257,7 +259,7 @@ function prune_deadguys($arr) {
        if(! $arr)
                return $arr;
        $str = dbesc(implode(',',$arr));
-       $r = q("select id from contact where id in ( " . $str . ") and blocked = 0 and pending = 0 and archive = 0 ");
+       $r = q("SELECT `id` FROM `contact` WHERE `id` IN ( " . $str . ") AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0 ");
        if($r) {
                $ret = array();
                foreach($r as $rr)
@@ -399,7 +401,7 @@ function acl_lookup(&$a, $out_type = 'json') {
        $type = (x($_REQUEST,'type')?$_REQUEST['type']:"");
        $conv_id = (x($_REQUEST,'conversation')?$_REQUEST['conversation']:null);
 
-       // For use with jquery.autocomplete for private mail completion
+       // For use with jquery.textcomplete for private mail completion
 
        if(x($_REQUEST,'query') && strlen($_REQUEST['query'])) {
                if(! $type)
@@ -428,6 +430,7 @@ function acl_lookup(&$a, $out_type = 'json') {
 
        $sql_extra2 .= " ".unavailable_networks();
 
+       // autocomplete for editor mentions
        if ($type=='' || $type=='c'){
                $r = q("SELECT COUNT(*) AS c FROM `contact`
                                WHERE `uid` = %d AND `self` = 0
@@ -476,7 +479,7 @@ function acl_lookup(&$a, $out_type = 'json') {
 
        if ($type=='' || $type=='g'){
 
-               $r = q("SELECT `group`.`id`, `group`.`name`, GROUP_CONCAT(DISTINCT `group_member`.`contact-id` SEPARATOR ',') as uids
+               $r = q("SELECT `group`.`id`, `group`.`name`, GROUP_CONCAT(DISTINCT `group_member`.`contact-id` SEPARATOR ',') AS uids
                                FROM `group`,`group_member`
                                WHERE `group`.`deleted` = 0 AND `group`.`uid` = %d
                                        AND `group_member`.`gid`=`group`.`id`
@@ -505,7 +508,7 @@ function acl_lookup(&$a, $out_type = 'json') {
 
        if ($type==''){
 
-               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, forum FROM `contact`
+               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `forum` FROM `contact`
                        WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0 AND `notify` != ''
                        AND NOT (`network` IN ('%s', '%s'))
                        $sql_extra2
@@ -516,7 +519,7 @@ function acl_lookup(&$a, $out_type = 'json') {
        }
        elseif ($type=='c'){
 
-               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, forum FROM `contact`
+               $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `forum` FROM `contact`
                        WHERE `uid` = %d AND `self` = 0 AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0 AND `notify` != ''
                        AND NOT (`network` IN ('%s'))
                        $sql_extra2
@@ -545,28 +548,30 @@ function acl_lookup(&$a, $out_type = 'json') {
                        intval(local_user())
                );
        }
-       else
-               $r = array();
-
-
-       if($type == 'm' || $type == 'a') {
-               $x = array();
-               $x['query'] = $search;
-               $x['photos'] = array();
-               $x['links'] = array();
-               $x['suggestions'] = array();
-               $x['data'] = array();
-               if(count($r)) {
+       elseif($type == 'x') {
+               // autocomplete for global contact search (e.g. navbar search)
+               $r = navbar_complete($a);
+               $contacts = array();
+               if($r) {
                        foreach($r as $g) {
-                               $x['photos'][] = proxy_url($g['micro'], false, PROXY_SIZE_MICRO);
-                               $x['links'][] = $g['url'];
-                               $x['suggestions'][] = htmlentities($g['name']);
-                               $x['data'][] = intval($g['id']);
+                               $contacts[] = array(
+                                       "photo"    => $g['photo'],
+                                       "name"     => $g['name'],
+                                       "nick"     => (x($g['addr']) ? $g['addr'] : $g['url']),
+                               );
                        }
                }
-               echo json_encode($x);
+               $o = array(
+                       'start' => $start,
+                       'count' => $count,
+                       'items' => $contacts,
+               );
+               echo json_encode($o);
                killme();
        }
+       else
+               $r = array();
+
 
        if(count($r)) {
                foreach($r as $g){
@@ -591,14 +596,10 @@ function acl_lookup(&$a, $out_type = 'json') {
                function _contact_link($i){ return dbesc($i['link']); }
                $known_contacts = array_map(_contact_link, $contacts);
                $unknow_contacts=array();
-               $r = q("select
-                                       `author-avatar`,`author-name`,`author-link`
-                               from item where parent=%d
-                               and (
-                                       `author-name` LIKE '%%%s%%' OR
-                                       `author-link` LIKE '%%%s%%'
-                               ) and
-                               `author-link` NOT IN ('%s')
+               $r = q("SELECT `author-avatar`,`author-name`,`author-link`
+                               FROM `item` WHERE `parent` = %d
+                                       AND (`author-name` LIKE '%%%s%%' OR `author-link` LIKE '%%%s%%')
+                                       AND `author-link` NOT IN ('%s')
                                GROUP BY `author-link`
                                ORDER BY `author-name` ASC
                                ",
@@ -654,4 +655,48 @@ function acl_lookup(&$a, $out_type = 'json') {
 
        killme();
 }
+/**
+ * @brief Searching for global contacts for autocompletion
+ * 
+ * @param App $a
+ * @return type
+ */
+function navbar_complete(&$a) {
+
+//     logger('navbar_complete');
+
+       if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
+               return;
+       }
+
+       // check if searching in the local global contact table is enabled
+       $localsearch = get_config('system','poco_local_search');
+
+       $search = $prefix.notags(trim($_REQUEST['search']));
+
+       // don't search if search term has less than 2 characters
+       if(! $search || mb_strlen($search) < 2)
+               return array();
 
+       if(substr($search,0,1) === '@')
+               $search = substr($search,1);
+
+       if($localsearch) {
+               $x = dirsearch_global_by_name($search);
+               return $x;
+       }
+
+       if(! $localsearch) {
+               $p = (($a->pager['page'] != 1) ? '&p=' . $a->pager['page'] : '');
+
+               $x = z_fetch_url(get_server().'/lsearch?f=' . $p .  '&search=' . urlencode($search));
+               if($x['success']) {
+                       $t = 0;
+                       $j = json_decode($x['body'],true);
+                       if($j && $j['results']) {
+                               return $j['results'];
+                       }
+               }
+       }
+       return;
+}
\ No newline at end of file
diff --git a/include/dir_fns.php b/include/dir_fns.php
new file mode 100644 (file)
index 0000000..2e39e7d
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * @file include/dir_fns.php
+ * @brief Functions for directory
+ */
+
+/**
+ * @brief Search global contact table by nick or name
+ *  * 
+ * @param string $search
+ * @return array
+ */
+function dirsearch_global_by_name($search) {
+
+       if($search) {
+               // check supported networks
+               if (get_config('system','diaspora_enabled'))
+                       $diaspora = NETWORK_DIASPORA;
+               else
+                       $diaspora = NETWORK_DFRN;
+
+               if (!get_config('system','ostatus_disabled'))
+                       $ostatus = NETWORK_OSTATUS;
+               else
+                       $ostatus = NETWORK_DFRN;
+
+               $results = q("SELECT `contact`.`id` AS `cid`, `gcontact`.`url`, `gcontact`.`name`, `gcontact`.`nick`, `gcontact`.`photo`,
+                                               `gcontact`.`network`, `gcontact`.`keywords`, `gcontact`.`addr`
+                                       FROM `gcontact`
+                                       LEFT JOIN `contact` ON `contact`.`nurl` = `gcontact`.`nurl`
+                                               AND `contact`.`uid` = %d AND NOT `contact`.`blocked`
+                                               AND NOT `contact`.`pending` AND `contact`.`rel` IN ('%s', '%s')
+                                       WHERE (`contact`.`id` > 0 OR (NOT `gcontact`.`hide` AND `gcontact`.`network` IN ('%s', '%s', '%s') AND
+                                       ((`gcontact`.`last_contact` >= `gcontact`.`last_failure`) OR (`gcontact`.`updated` >= `gcontact`.`last_failure`)))) AND
+                                       (`gcontact`.`url` REGEXP '%s' OR `gcontact`.`name` REGEXP '%s' OR `gcontact`.`nick` REGEXP '%s'
+                                               ) 
+                                               GROUP BY `gcontact`.`nurl`
+                                               ORDER BY `gcontact`.`updated` DESC ",
+                                       intval(local_user()), dbesc(CONTACT_IS_SHARING), dbesc(CONTACT_IS_FRIEND),
+                                       dbesc(NETWORK_DFRN), dbesc($ostatus), dbesc($diaspora),
+                                       dbesc(escape_tags($search)), dbesc(escape_tags($search)), dbesc(escape_tags($search)));
+               return $results;
+       }
+               
+}
\ No newline at end of file
index 6512d35..a90e850 100644 (file)
@@ -2,7 +2,7 @@
 
 function nav(&$a) {
 
-       /**
+       /*
         *
         * Build page header and site navigation bars
         *
@@ -11,7 +11,9 @@ function nav(&$a) {
        if(!(x($a->page,'nav')))
                $a->page['nav'] = '';
 
-       /**
+       $a->page['htmlhead'] .= replace_macros(get_markup_template('nav_head.tpl'), array());
+
+       /*
         * Placeholder div for popup panel
         */
 
@@ -19,7 +21,7 @@ function nav(&$a) {
 
        $nav_info = nav_info($a);
 
-       /**
+       /*
         * Build the page
         */
 
@@ -29,12 +31,13 @@ function nav(&$a) {
                '$baseurl' => $a->get_baseurl(),
                '$sitelocation' => $nav_info['sitelocation'],
                '$nav' => $nav_info['nav'],
-               '$banner' =>  $nav_info['banner'],
+               '$banner' => $nav_info['banner'],
                '$emptynotifications' => t('Nothing new here'),
                '$userinfo' => $nav_info['userinfo'],
-               '$sel' =>       $a->nav_sel,
+               '$sel' =>  $a->nav_sel,
                '$apps' => $a->apps,
-               '$clear_notifs' => t('Clear notifications')
+               '$clear_notifs' => t('Clear notifications'),
+               '$search_hint' => t('@name, !forum, #tags, content')
        ));
 
        call_hooks('page_header', $a->page['nav']);
@@ -45,7 +48,7 @@ function nav_info(&$a) {
 
        $ssl_state = ((local_user()) ? true : false);
 
-       /**
+       /*
         *
         * Our network is distributed, and as you visit friends some of the
         * sites look exactly the same - it isn't always easy to know where you are.
@@ -61,7 +64,7 @@ function nav_info(&$a) {
        // nav links: array of array('href', 'text', 'extra css classes', 'title')
        $nav = Array();
 
-       /**
+       /*
         * Display login or logout
         */
 
@@ -92,7 +95,7 @@ function nav_info(&$a) {
        }
 
 
-       /**
+       /*
         * "Home" should also take you home from an authenticated remote profile connection
         */
 
@@ -143,7 +146,7 @@ function nav_info(&$a) {
 
        $nav['about'] = Array('friendica', t('Information'), "", t('Information about this friendica instance'));
 
-       /**
+       /*
         *
         * The following nav links are only show to logged in users
         *
@@ -187,7 +190,7 @@ function nav_info(&$a) {
                $nav['contacts'] = array('contacts', t('Contacts'),"", t('Manage/edit friends and contacts'));
        }
 
-       /**
+       /*
         * Admin page
         */
         if (is_site_admin()){
@@ -198,7 +201,7 @@ function nav_info(&$a) {
         $nav['navigation'] = array('navigation/', t('Navigation'), "", t('Site map'));
 
 
-       /**
+       /*
         *
         * Provide a banner/logo/whatever
         *
@@ -221,26 +224,26 @@ function nav_info(&$a) {
 }
 
 
-/*
+/**
  * Set a menu item in navbar as selected
  *
  */
 function nav_set_selected($item){
        $a = get_app();
-    $a->nav_sel = array(
+       $a->nav_sel = array(
                'community'     => null,
-               'network'               => null,
-               'home'                  => null,
-               'profiles'              => null,
+               'network'       => null,
+               'home'          => null,
+               'profiles'      => null,
                'introductions' => null,
                'notifications' => null,
-               'messages'              => null,
-               'directory'         => null,
-               'settings'              => null,
-               'contacts'              => null,
-               'manage'        => null,
-               'events'        => null,
-               'register'      => null,
+               'messages'      => null,
+               'directory'     => null,
+               'settings'      => null,
+               'contacts'      => null,
+               'manage'        => null,
+               'events'        => null,
+               'register'      => null,
        );
        $a->nav_sel[$item] = 'selected';
 }
diff --git a/js/autocomplete.js b/js/autocomplete.js
new file mode 100644 (file)
index 0000000..1f7df01
--- /dev/null
@@ -0,0 +1,359 @@
+/**
+ * Friendica people autocomplete
+ *
+ * require jQuery, jquery.textcomplete
+ */
+function contact_search(term, callback, backend_url, type) {
+
+       // Check if there is a conversation id to include the unkonwn contacts of the conversation
+       var conv_id = document.activeElement.id.match(/\d+$/);
+
+
+       // Check if there is a cached result that contains the same information we would get with a full server-side search
+       var bt = backend_url+type;
+       if(!(bt in contact_search.cache)) contact_search.cache[bt] = {};
+
+       var lterm = term.toLowerCase(); // Ignore case
+       for(var t in contact_search.cache[bt]) {
+               if(lterm.indexOf(t) >= 0) { // A more broad search has been performed already, so use those results
+                       // Filter old results locally
+                       var matching = contact_search.cache[bt][t].filter(function (x) { return (x.name.toLowerCase().indexOf(lterm) >= 0 || (typeof x.nick !== 'undefined' && x.nick.toLowerCase().indexOf(lterm) >= 0)); }); // Need to check that nick exists because groups don't have one
+                       matching.unshift({taggable:false, text: term, replace: term});
+                       setTimeout(function() { callback(matching); } , 1); // Use "pseudo-thread" to avoid some problems
+                       return;
+               }
+       }
+
+       var postdata = {
+               start:0,
+               count:100,
+               search:term,
+               type:type,
+       };
+
+       if(conv_id !== null)
+               postdata['conversation'] = conv_id[0];
+
+
+       $.ajax({
+               type:'POST',
+               url: backend_url,
+               data: postdata,
+               dataType: 'json',
+               success: function(data){
+                       // Cache results if we got them all (more information would not improve results)
+                       // data.count represents the maximum number of items
+                       if(data.items.length -1 < data.count) {
+                               contact_search.cache[bt][lterm] = data.items;
+                       }
+                       var items = data.items.slice(0);
+                       items.unshift({taggable:false, text: term, replace: term});
+                       callback(items);
+               },
+       }).fail(function () {callback([]); }); // Callback must be invoked even if something went wrong.
+}
+contact_search.cache = {};
+
+
+function contact_format(item) {
+       // Show contact information if not explicitly told to show something else
+       if(typeof item.text === 'undefined') {
+               var desc = ((item.label) ? item.nick + ' ' + item.label : item.nick);
+               if(typeof desc === 'undefined') desc = '';
+               if(desc) desc = ' ('+desc+')';
+               return "<div class='{0}' title='{4}'><img class='acpopup-img' src='{1}'><span class='acpopup-contactname'>{2}</span><span class='acpopup-sub-text'>{3}</span><div class='clear'></div></div>".format(item.taggable, item.photo, item.name, desc, item.link);
+       }
+       else
+               return "<div>" + item.text + "</div>";
+}
+
+function editor_replace(item) {
+       if(typeof item.replace !== 'undefined') {
+               return '$1$2' + item.replace;
+       }
+
+       // $2 ensures that prefix (@,@!) is preserved
+       var id = item.id;
+        // 16 chars of hash should be enough. Full hash could be used if it can be done in a visually appealing way.
+       // 16 chars is also the minimum length in the backend (otherwise it's interpreted as a local id).
+       if(id.length > 16) 
+               id = item.id.substring(0,16);
+
+       return '$1$2' + item.nick.replace(' ', '') + '+' + id + ' ';
+}
+
+function basic_replace(item) {
+       if(typeof item.replace !== 'undefined')
+               return '$1'+item.replace;
+
+       return '$1'+item.name+' ';
+}
+
+function trim_replace(item) {
+       if(typeof item.replace !== 'undefined')
+               return '$1'+item.replace;
+
+       return '$1'+item.name;
+}
+
+
+function submit_form(e) {
+       $(e).parents('form').submit();
+}
+
+/**
+ * jQuery plugin 'editor_autocomplete'
+ */
+(function( $ ) {
+       $.fn.editor_autocomplete = function(backend_url) {
+
+               // Autocomplete contacts
+               contacts = {
+                       match: /(^|\s)(@\!*)([^ \n]+)$/,
+                       index: 3,
+                       search: function(term, callback) { contact_search(term, callback, backend_url, 'c'); },
+                       replace: editor_replace,
+                       template: contact_format,
+               };
+
+               smilies = {
+                       match: /(^|\s)(:[a-z]{2,})$/,
+                       index: 2,
+                       search: function(term, callback) { $.getJSON('/smilies/json').done(function(data) { callback($.map(data, function(entry) { return entry.text.indexOf(term) === 0 ? entry : null; })); }); },
+                       template: function(item) { return item.icon + item.text; },
+                       replace: function(item) { return "$1" + item.text + ' '; },
+               };
+               this.attr('autocomplete','off');
+               this.textcomplete([contacts,smilies], {className:'acpopup', zIndex:1020});
+       };
+})( jQuery );
+
+/**
+ * jQuery plugin 'search_autocomplete'
+ */
+(function( $ ) {
+       $.fn.search_autocomplete = function(backend_url) {
+               // Autocomplete contacts
+               contacts = {
+                       match: /(^@)([^\n]{2,})$/,
+                       index: 2,
+                       search: function(term, callback) { contact_search(term, callback, backend_url, 'x'); },
+                       replace: basic_replace,
+                       template: contact_format,
+               };
+               this.attr('autocomplete', 'off');
+               var a = this.textcomplete([contacts], {className:'acpopup', maxCount:100, zIndex: 1020, appendTo:'nav'});
+               a.on('textComplete:select', function(e, value, strategy) { submit_form(this); });
+       };
+})( jQuery );
+
+(function( $ ) {
+       $.fn.contact_autocomplete = function(backend_url, typ, autosubmit, onselect) {
+               if(typeof typ === 'undefined') typ = '';
+               if(typeof autosubmit === 'undefined') autosubmit = false;
+
+               // Autocomplete contacts
+               contacts = {
+                       match: /(^)([^\n]+)$/,
+                       index: 2,
+                       search: function(term, callback) { contact_search(term, callback, backend_url, typ); },
+                       replace: basic_replace,
+                       template: contact_format,
+               };
+
+               this.attr('autocomplete','off');
+               var a = this.textcomplete([contacts], {className:'acpopup', zIndex:1020});
+
+               if(autosubmit)
+                       a.on('textComplete:select', function(e,value,strategy) { submit_form(this); });
+
+               if(typeof onselect !== 'undefined')
+                       a.on('textComplete:select', function(e, value, strategy) { onselect(value); });
+       };
+})( jQuery );
+
+
+(function( $ ) {
+       $.fn.name_autocomplete = function(backend_url, typ, autosubmit, onselect) {
+               if(typeof typ === 'undefined') typ = '';
+               if(typeof autosubmit === 'undefined') autosubmit = false;
+
+               // Autocomplete contacts
+               names = {
+                       match: /(^)([^\n]+)$/,
+                       index: 2,
+                       search: function(term, callback) { contact_search(term, callback, backend_url, typ); },
+                       replace: trim_replace,
+                       template: contact_format,
+               };
+
+               this.attr('autocomplete','off');
+               var a = this.textcomplete([names], {className:'acpopup', zIndex:1020});
+
+               if(autosubmit)
+                       a.on('textComplete:select', function(e,value,strategy) { submit_form(this); });
+
+               if(typeof onselect !== 'undefined')
+                       a.on('textComplete:select', function(e, value, strategy) { onselect(value); });
+       };
+})( jQuery );
+
+
+/**
+ * Friendica people autocomplete legacy
+ * code which is needed for tinymce
+ *
+ * require jQuery, jquery.textareas
+ */
+
+function ACPopup(elm,backend_url){
+       this.idsel=-1;
+       this.element = elm;
+       this.searchText="";
+       this.ready=true;
+       this.kp_timer = false;
+       this.url = backend_url;
+
+       this.conversation_id = null;
+       var conv_id = this.element.id.match(/\d+$/);
+       if (conv_id) this.conversation_id = conv_id[0];
+       console.log("ACPopup elm id",this.element.id,"conversation",this.conversation_id);
+
+       var w = 530;
+       var h = 130;
+
+
+       if(tinyMCE.activeEditor == null) {
+               style = $(elm).offset();
+               w = $(elm).width();
+               h = $(elm).height();
+       }
+       else {
+               // I can't find an "official" way to get the element who get all
+               // this fraking thing that is tinyMCE.
+               // This code will broke again at some point...
+               var container = $(tinyMCE.activeEditor.getContainer()).find("table");
+               style = $(container).offset();
+               w = $(container).width();
+               h = $(container).height();
+       }
+
+       style.top=style.top+h;
+       style.width = w;
+       style.position = 'absolute';
+       /*      style['max-height'] = '150px';
+               style.border = '1px solid red';
+               style.background = '#cccccc';
+
+               style.overflow = 'auto';
+               style['z-index'] = '100000';
+       */
+       style.display = 'none';
+
+       this.cont = $("<div class='acpopup-mce'></div>");
+       this.cont.css(style);
+
+       $("body").append(this.cont);
+    }
+
+ACPopup.prototype.close = function(){
+       $(this.cont).remove();
+       this.ready=false;
+}
+ACPopup.prototype.search = function(text){
+       var that = this;
+       this.searchText=text;
+       if (this.kp_timer) clearTimeout(this.kp_timer);
+       this.kp_timer = setTimeout( function(){that._search();}, 500);
+}
+
+ACPopup.prototype._search = function(){
+       console.log("_search");
+       var that = this;
+       var postdata = {
+               start:0,
+               count:100,
+               search:this.searchText,
+               type:'c',
+               conversation: this.conversation_id,
+       }
+
+       $.ajax({
+               type:'POST',
+               url: this.url,
+               data: postdata,
+               dataType: 'json',
+               success:function(data){
+                       that.cont.html("");
+                       if (data.tot>0){
+                               that.cont.show();
+                               $(data.items).each(function(){
+                                       var html = "<img src='{0}' height='16px' width='16px'>{1} ({2})".format(this.photo, this.name, this.nick);
+                                       var nick = this.nick.replace(' ','');
+                                       if (this.id!=='')  nick += '+' + this.id;
+                                       that.add(html, nick + ' - ' + this.link);
+                               });
+                       } else {
+                               that.cont.hide();
+                       }
+               }
+       });
+
+}
+
+ACPopup.prototype.add = function(label, value){
+       var that=this;
+       var elm = $("<div class='acpopupitem' title='"+value+"'>"+label+"</div>");
+       elm.click(function(e){
+               t = $(this).attr('title').replace(new RegExp(' \- .*'),'');
+               if(typeof(that.element.container) === "undefined") {
+                       el=$(that.element);
+                       sel = el.getSelection();
+                       sel.start = sel.start- that.searchText.length;
+                       el.setSelection(sel.start,sel.end).replaceSelectedText(t+' ').collapseSelection(false);
+                       that.close();
+               }
+               else {
+                       txt = tinyMCE.activeEditor.getContent();
+                       //                      alert(that.searchText + ':' + t);
+                       newtxt = txt.replace('@' + that.searchText,'@' + t +' ');
+                       tinyMCE.activeEditor.setContent(newtxt);
+                       tinyMCE.activeEditor.focus();
+                       that.close();
+               }
+       });
+       $(this.cont).append(elm);
+}
+
+ACPopup.prototype.onkey = function(event){
+       if (event.keyCode == '13') {
+               if(this.idsel>-1) {
+                       this.cont.children()[this.idsel].click();
+                       event.preventDefault();
+               }
+               else
+                       this.close();
+       }
+       if (event.keyCode == '38') { //cursor up
+               cmax = this.cont.children().size()-1;
+               this.idsel--;
+               if (this.idsel<0) this.idsel=cmax;
+               event.preventDefault();
+       }
+       if (event.keyCode == '40' || event.keyCode == '9') { //cursor down
+               cmax = this.cont.children().size()-1;
+               this.idsel++;
+               if (this.idsel>cmax) this.idsel=0;
+               event.preventDefault();
+       }
+
+       if (event.keyCode == '38' || event.keyCode == '40' || event.keyCode == '9') {
+               this.cont.children().removeClass('selected');
+               $(this.cont.children()[this.idsel]).addClass('selected');
+       }
+
+       if (event.keyCode == '27') { //ESC
+               this.close();
+       }
+}
+
index 6010578..d7c8127 100644 (file)
@@ -86,7 +86,7 @@ ACPopup.prototype._search = function(){
                        if (data.tot>0){
                                that.cont.show();
                                $(data.items).each(function(){
-                                       var html = "<img src='{0}' height='16px' width='16px'>{1} ({2})".format(this.photo, this.name, this.nick);
+                                       var html = "<img class='acpopup-img' src='{0}' height='16px' width='16px'> <span class='acpopup-name'>{1}</span> <span class='acpopup-addr'>({2})</span>".format(this.photo, this.name, this.addr);
                                        var nick = this.nick.replace(' ','');
                                        if (this.id!=='')  nick += '+' + this.id;
                                        that.add(html, nick + ' - ' + this.link);
index d1fd376..01dcb98 100644 (file)
                                $('body').css('cursor', 'auto');
                        }
                        /* autocomplete @nicknames */
-                       $(".comment-edit-form  textarea").contact_autocomplete(baseurl+"/acl");
+                       $(".comment-edit-form  textarea").editor_autocomplete(baseurl+"/acl");
 
                        // setup videos, since VideoJS won't take care of any loaded via AJAX
                        if(typeof videojs != 'undefined') videojs.autoSetup();
diff --git a/library/jquery-textcomplete/LICENSE b/library/jquery-textcomplete/LICENSE
new file mode 100644 (file)
index 0000000..4848bd6
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2013-2014 Yuku Takahashi
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/library/jquery-textcomplete/jquery.textcomplete.js b/library/jquery-textcomplete/jquery.textcomplete.js
new file mode 100644 (file)
index 0000000..2003101
--- /dev/null
@@ -0,0 +1,1227 @@
+(function (factory) {
+  if (typeof define === 'function' && define.amd) {
+    // AMD. Register as an anonymous module.
+    define(['jquery'], factory);
+  } else if (typeof module === "object" && module.exports) {
+    var $ = require('jquery');
+    module.exports = factory($);
+  } else {
+    // Browser globals
+    factory(jQuery);
+  }
+}(function (jQuery) {
+
+/*!
+ * jQuery.textcomplete
+ *
+ * Repository: https://github.com/yuku-t/jquery-textcomplete
+ * License:    MIT (https://github.com/yuku-t/jquery-textcomplete/blob/master/LICENSE)
+ * Author:     Yuku Takahashi
+ */
+
+if (typeof jQuery === 'undefined') {
+  throw new Error('jQuery.textcomplete requires jQuery');
+}
+
++function ($) {
+  'use strict';
+
+  var warn = function (message) {
+    if (console.warn) { console.warn(message); }
+  };
+
+  var id = 1;
+
+  $.fn.textcomplete = function (strategies, option) {
+    var args = Array.prototype.slice.call(arguments);
+    return this.each(function () {
+      var self = this;
+      var $this = $(this);
+      var completer = $this.data('textComplete');
+      if (!completer) {
+        option || (option = {});
+        option._oid = id++;  // unique object id
+        completer = new $.fn.textcomplete.Completer(this, option);
+        $this.data('textComplete', completer);
+      }
+      if (typeof strategies === 'string') {
+        if (!completer) return;
+        args.shift()
+        completer[strategies].apply(completer, args);
+        if (strategies === 'destroy') {
+          $this.removeData('textComplete');
+        }
+      } else {
+        // For backward compatibility.
+        // TODO: Remove at v0.4
+        $.each(strategies, function (obj) {
+          $.each(['header', 'footer', 'placement', 'maxCount'], function (name) {
+            if (obj[name]) {
+              completer.option[name] = obj[name];
+              warn(name + 'as a strategy param is deprecated. Use option.');
+              delete obj[name];
+            }
+          });
+        });
+        completer.register($.fn.textcomplete.Strategy.parse(strategies, {
+          el: self,
+          $el: $this
+        }));
+      }
+    });
+  };
+
+}(jQuery);
+
++function ($) {
+  'use strict';
+
+  // Exclusive execution control utility.
+  //
+  // func - The function to be locked. It is executed with a function named
+  //        `free` as the first argument. Once it is called, additional
+  //        execution are ignored until the free is invoked. Then the last
+  //        ignored execution will be replayed immediately.
+  //
+  // Examples
+  //
+  //   var lockedFunc = lock(function (free) {
+  //     setTimeout(function { free(); }, 1000); // It will be free in 1 sec.
+  //     console.log('Hello, world');
+  //   });
+  //   lockedFunc();  // => 'Hello, world'
+  //   lockedFunc();  // none
+  //   lockedFunc();  // none
+  //   // 1 sec past then
+  //   // => 'Hello, world'
+  //   lockedFunc();  // => 'Hello, world'
+  //   lockedFunc();  // none
+  //
+  // Returns a wrapped function.
+  var lock = function (func) {
+    var locked, queuedArgsToReplay;
+
+    return function () {
+      // Convert arguments into a real array.
+      var args = Array.prototype.slice.call(arguments);
+      if (locked) {
+        // Keep a copy of this argument list to replay later.
+        // OK to overwrite a previous value because we only replay
+        // the last one.
+        queuedArgsToReplay = args;
+        return;
+      }
+      locked = true;
+      var self = this;
+      args.unshift(function replayOrFree() {
+        if (queuedArgsToReplay) {
+          // Other request(s) arrived while we were locked.
+          // Now that the lock is becoming available, replay
+          // the latest such request, then call back here to
+          // unlock (or replay another request that arrived
+          // while this one was in flight).
+          var replayArgs = queuedArgsToReplay;
+          queuedArgsToReplay = undefined;
+          replayArgs.unshift(replayOrFree);
+          func.apply(self, replayArgs);
+        } else {
+          locked = false;
+        }
+      });
+      func.apply(this, args);
+    };
+  };
+
+  var isString = function (obj) {
+    return Object.prototype.toString.call(obj) === '[object String]';
+  };
+
+  var isFunction = function (obj) {
+    return Object.prototype.toString.call(obj) === '[object Function]';
+  };
+
+  var uniqueId = 0;
+
+  function Completer(element, option) {
+    this.$el        = $(element);
+    this.id         = 'textcomplete' + uniqueId++;
+    this.strategies = [];
+    this.views      = [];
+    this.option     = $.extend({}, Completer._getDefaults(), option);
+
+    if (!this.$el.is('input[type=text]') && !this.$el.is('textarea') && !element.isContentEditable && element.contentEditable != 'true') {
+      throw new Error('textcomplete must be called on a Textarea or a ContentEditable.');
+    }
+
+    if (element === document.activeElement) {
+      // element has already been focused. Initialize view objects immediately.
+      this.initialize()
+    } else {
+      // Initialize view objects lazily.
+      var self = this;
+      this.$el.one('focus.' + this.id, function () { self.initialize(); });
+    }
+  }
+
+  Completer._getDefaults = function () {
+    if (!Completer.DEFAULTS) {
+      Completer.DEFAULTS = {
+        appendTo: $('body'),
+        zIndex: '100'
+      };
+    }
+
+    return Completer.DEFAULTS;
+  }
+
+  $.extend(Completer.prototype, {
+    // Public properties
+    // -----------------
+
+    id:         null,
+    option:     null,
+    strategies: null,
+    adapter:    null,
+    dropdown:   null,
+    $el:        null,
+
+    // Public methods
+    // --------------
+
+    initialize: function () {
+      var element = this.$el.get(0);
+      // Initialize view objects.
+      this.dropdown = new $.fn.textcomplete.Dropdown(element, this, this.option);
+      var Adapter, viewName;
+      if (this.option.adapter) {
+        Adapter = this.option.adapter;
+      } else {
+        if (this.$el.is('textarea') || this.$el.is('input[type=text]')) {
+          viewName = typeof element.selectionEnd === 'number' ? 'Textarea' : 'IETextarea';
+        } else {
+          viewName = 'ContentEditable';
+        }
+        Adapter = $.fn.textcomplete[viewName];
+      }
+      this.adapter = new Adapter(element, this, this.option);
+    },
+
+    destroy: function () {
+      this.$el.off('.' + this.id);
+      if (this.adapter) {
+        this.adapter.destroy();
+      }
+      if (this.dropdown) {
+        this.dropdown.destroy();
+      }
+      this.$el = this.adapter = this.dropdown = null;
+    },
+
+    // Invoke textcomplete.
+    trigger: function (text, skipUnchangedTerm) {
+      if (!this.dropdown) { this.initialize(); }
+      text != null || (text = this.adapter.getTextFromHeadToCaret());
+      var searchQuery = this._extractSearchQuery(text);
+      if (searchQuery.length) {
+        var term = searchQuery[1];
+        // Ignore shift-key, ctrl-key and so on.
+        if (skipUnchangedTerm && this._term === term) { return; }
+        this._term = term;
+        this._search.apply(this, searchQuery);
+      } else {
+        this._term = null;
+        this.dropdown.deactivate();
+      }
+    },
+
+    fire: function (eventName) {
+      var args = Array.prototype.slice.call(arguments, 1);
+      this.$el.trigger(eventName, args);
+      return this;
+    },
+
+    register: function (strategies) {
+      Array.prototype.push.apply(this.strategies, strategies);
+    },
+
+    // Insert the value into adapter view. It is called when the dropdown is clicked
+    // or selected.
+    //
+    // value    - The selected element of the array callbacked from search func.
+    // strategy - The Strategy object.
+    // e        - Click or keydown event object.
+    select: function (value, strategy, e) {
+      this._term = null;
+      this.adapter.select(value, strategy, e);
+      this.fire('change').fire('textComplete:select', value, strategy);
+      this.adapter.focus();
+    },
+
+    // Private properties
+    // ------------------
+
+    _clearAtNext: true,
+    _term:        null,
+
+    // Private methods
+    // ---------------
+
+    // Parse the given text and extract the first matching strategy.
+    //
+    // Returns an array including the strategy, the query term and the match
+    // object if the text matches an strategy; otherwise returns an empty array.
+    _extractSearchQuery: function (text) {
+      for (var i = 0; i < this.strategies.length; i++) {
+        var strategy = this.strategies[i];
+        var context = strategy.context(text);
+        if (context || context === '') {
+          var matchRegexp = isFunction(strategy.match) ? strategy.match(text) : strategy.match;
+          if (isString(context)) { text = context; }
+          var match = text.match(matchRegexp);
+          if (match) { return [strategy, match[strategy.index], match]; }
+        }
+      }
+      return []
+    },
+
+    // Call the search method of selected strategy..
+    _search: lock(function (free, strategy, term, match) {
+      var self = this;
+      strategy.search(term, function (data, stillSearching) {
+        if (!self.dropdown.shown) {
+          self.dropdown.activate();
+        }
+        if (self._clearAtNext) {
+          // The first callback in the current lock.
+          self.dropdown.clear();
+          self._clearAtNext = false;
+        }
+        self.dropdown.setPosition(self.adapter.getCaretPosition());
+        self.dropdown.render(self._zip(data, strategy, term));
+        if (!stillSearching) {
+          // The last callback in the current lock.
+          free();
+          self._clearAtNext = true; // Call dropdown.clear at the next time.
+        }
+      }, match);
+    }),
+
+    // Build a parameter for Dropdown#render.
+    //
+    // Examples
+    //
+    //  this._zip(['a', 'b'], 's');
+    //  //=> [{ value: 'a', strategy: 's' }, { value: 'b', strategy: 's' }]
+    _zip: function (data, strategy, term) {
+      return $.map(data, function (value) {
+        return { value: value, strategy: strategy, term: term };
+      });
+    }
+  });
+
+  $.fn.textcomplete.Completer = Completer;
+}(jQuery);
+
++function ($) {
+  'use strict';
+
+  var $window = $(window);
+
+  var include = function (zippedData, datum) {
+    var i, elem;
+    var idProperty = datum.strategy.idProperty
+    for (i = 0; i < zippedData.length; i++) {
+      elem = zippedData[i];
+      if (elem.strategy !== datum.strategy) continue;
+      if (idProperty) {
+        if (elem.value[idProperty] === datum.value[idProperty]) return true;
+      } else {
+        if (elem.value === datum.value) return true;
+      }
+    }
+    return false;
+  };
+
+  var dropdownViews = {};
+  $(document).on('click', function (e) {
+    var id = e.originalEvent && e.originalEvent.keepTextCompleteDropdown;
+    $.each(dropdownViews, function (key, view) {
+      if (key !== id) { view.deactivate(); }
+    });
+  });
+
+  var commands = {
+    SKIP_DEFAULT: 0,
+    KEY_UP: 1,
+    KEY_DOWN: 2,
+    KEY_ENTER: 3,
+    KEY_PAGEUP: 4,
+    KEY_PAGEDOWN: 5,
+    KEY_ESCAPE: 6
+  };
+
+  // Dropdown view
+  // =============
+
+  // Construct Dropdown object.
+  //
+  // element - Textarea or contenteditable element.
+  function Dropdown(element, completer, option) {
+    this.$el       = Dropdown.createElement(option);
+    this.completer = completer;
+    this.id        = completer.id + 'dropdown';
+    this._data     = []; // zipped data.
+    this.$inputEl  = $(element);
+    this.option    = option;
+
+    // Override setPosition method.
+    if (option.listPosition) { this.setPosition = option.listPosition; }
+    if (option.height) { this.$el.height(option.height); }
+    var self = this;
+    $.each(['maxCount', 'placement', 'footer', 'header', 'noResultsMessage', 'className'], function (_i, name) {
+      if (option[name] != null) { self[name] = option[name]; }
+    });
+    this._bindEvents(element);
+    dropdownViews[this.id] = this;
+  }
+
+  $.extend(Dropdown, {
+    // Class methods
+    // -------------
+
+    createElement: function (option) {
+      var $parent = option.appendTo;
+      if (!($parent instanceof $)) { $parent = $($parent); }
+      var $el = $('<ul></ul>')
+        .addClass('dropdown-menu textcomplete-dropdown')
+        .attr('id', 'textcomplete-dropdown-' + option._oid)
+        .css({
+          display: 'none',
+          left: 0,
+          position: 'absolute',
+          zIndex: option.zIndex
+        })
+        .appendTo($parent);
+      return $el;
+    }
+  });
+
+  $.extend(Dropdown.prototype, {
+    // Public properties
+    // -----------------
+
+    $el:       null,  // jQuery object of ul.dropdown-menu element.
+    $inputEl:  null,  // jQuery object of target textarea.
+    completer: null,
+    footer:    null,
+    header:    null,
+    id:        null,
+    maxCount:  10,
+    placement: '',
+    shown:     false,
+    data:      [],     // Shown zipped data.
+    className: '',
+
+    // Public methods
+    // --------------
+
+    destroy: function () {
+      // Don't remove $el because it may be shared by several textcompletes.
+      this.deactivate();
+
+      this.$el.off('.' + this.id);
+      this.$inputEl.off('.' + this.id);
+      this.clear();
+      this.$el = this.$inputEl = this.completer = null;
+      delete dropdownViews[this.id]
+    },
+
+    render: function (zippedData) {
+      var contentsHtml = this._buildContents(zippedData);
+      var unzippedData = $.map(this.data, function (d) { return d.value; });
+      if (this.data.length) {
+        this._renderHeader(unzippedData);
+        this._renderFooter(unzippedData);
+        if (contentsHtml) {
+          this._renderContents(contentsHtml);
+          this._fitToBottom();
+          this._activateIndexedItem();
+        }
+        this._setScroll();
+      } else if (this.noResultsMessage) {
+        this._renderNoResultsMessage(unzippedData);
+      } else if (this.shown) {
+        this.deactivate();
+      }
+    },
+
+    setPosition: function (pos) {
+      this.$el.css(this._applyPlacement(pos));
+
+      // Make the dropdown fixed if the input is also fixed
+      // This can't be done during init, as textcomplete may be used on multiple elements on the same page
+      // Because the same dropdown is reused behind the scenes, we need to recheck every time the dropdown is showed
+      var position = 'absolute';
+      // Check if input or one of its parents has positioning we need to care about
+      this.$inputEl.add(this.$inputEl.parents()).each(function() {
+        if($(this).css('position') === 'absolute') // The element has absolute positioning, so it's all OK
+          return false;
+        if($(this).css('position') === 'fixed') {
+          position = 'fixed';
+          return false;
+        }
+      });
+      this.$el.css({ position: position }); // Update positioning
+
+      return this;
+    },
+
+    clear: function () {
+      this.$el.html('');
+      this.data = [];
+      this._index = 0;
+      this._$header = this._$footer = this._$noResultsMessage = null;
+    },
+
+    activate: function () {
+      if (!this.shown) {
+        this.clear();
+        this.$el.show();
+        if (this.className) { this.$el.addClass(this.className); }
+        this.completer.fire('textComplete:show');
+        this.shown = true;
+      }
+      return this;
+    },
+
+    deactivate: function () {
+      if (this.shown) {
+        this.$el.hide();
+        if (this.className) { this.$el.removeClass(this.className); }
+        this.completer.fire('textComplete:hide');
+        this.shown = false;
+      }
+      return this;
+    },
+
+    isUp: function (e) {
+      return e.keyCode === 38 || (e.ctrlKey && e.keyCode === 80);  // UP, Ctrl-P
+    },
+
+    isDown: function (e) {
+      return e.keyCode === 40 || (e.ctrlKey && e.keyCode === 78);  // DOWN, Ctrl-N
+    },
+
+    isEnter: function (e) {
+      var modifiers = e.ctrlKey || e.altKey || e.metaKey || e.shiftKey;
+      return !modifiers && (e.keyCode === 13 || e.keyCode === 9 || (this.option.completeOnSpace === true && e.keyCode === 32))  // ENTER, TAB
+    },
+
+    isPageup: function (e) {
+      return e.keyCode === 33;  // PAGEUP
+    },
+
+    isPagedown: function (e) {
+      return e.keyCode === 34;  // PAGEDOWN
+    },
+
+    isEscape: function (e) {
+      return e.keyCode === 27;  // ESCAPE
+    },
+
+    // Private properties
+    // ------------------
+
+    _data:    null,  // Currently shown zipped data.
+    _index:   null,
+    _$header: null,
+    _$noResultsMessage: null,
+    _$footer: null,
+
+    // Private methods
+    // ---------------
+
+    _bindEvents: function () {
+      this.$el.on('mousedown.' + this.id, '.textcomplete-item', $.proxy(this._onClick, this));
+      this.$el.on('touchstart.' + this.id, '.textcomplete-item', $.proxy(this._onClick, this));
+      this.$el.on('mouseover.' + this.id, '.textcomplete-item', $.proxy(this._onMouseover, this));
+      this.$inputEl.on('keydown.' + this.id, $.proxy(this._onKeydown, this));
+    },
+
+    _onClick: function (e) {
+      var $el = $(e.target);
+      e.preventDefault();
+      e.originalEvent.keepTextCompleteDropdown = this.id;
+      if (!$el.hasClass('textcomplete-item')) {
+        $el = $el.closest('.textcomplete-item');
+      }
+      var datum = this.data[parseInt($el.data('index'), 10)];
+      this.completer.select(datum.value, datum.strategy, e);
+      var self = this;
+      // Deactive at next tick to allow other event handlers to know whether
+      // the dropdown has been shown or not.
+      setTimeout(function () {
+        self.deactivate();
+        if (e.type === 'touchstart') {
+          self.$inputEl.focus();
+        }
+      }, 0);
+    },
+
+    // Activate hovered item.
+    _onMouseover: function (e) {
+      var $el = $(e.target);
+      e.preventDefault();
+      if (!$el.hasClass('textcomplete-item')) {
+        $el = $el.closest('.textcomplete-item');
+      }
+      this._index = parseInt($el.data('index'), 10);
+      this._activateIndexedItem();
+    },
+
+    _onKeydown: function (e) {
+      if (!this.shown) { return; }
+
+      var command;
+
+      if ($.isFunction(this.option.onKeydown)) {
+        command = this.option.onKeydown(e, commands);
+      }
+
+      if (command == null) {
+        command = this._defaultKeydown(e);
+      }
+
+      switch (command) {
+        case commands.KEY_UP:
+          e.preventDefault();
+          this._up();
+          break;
+        case commands.KEY_DOWN:
+          e.preventDefault();
+          this._down();
+          break;
+        case commands.KEY_ENTER:
+          e.preventDefault();
+          this._enter(e);
+          break;
+        case commands.KEY_PAGEUP:
+          e.preventDefault();
+          this._pageup();
+          break;
+        case commands.KEY_PAGEDOWN:
+          e.preventDefault();
+          this._pagedown();
+          break;
+        case commands.KEY_ESCAPE:
+          e.preventDefault();
+          this.deactivate();
+          break;
+      }
+    },
+
+    _defaultKeydown: function (e) {
+      if (this.isUp(e)) {
+        return commands.KEY_UP;
+      } else if (this.isDown(e)) {
+        return commands.KEY_DOWN;
+      } else if (this.isEnter(e)) {
+        return commands.KEY_ENTER;
+      } else if (this.isPageup(e)) {
+        return commands.KEY_PAGEUP;
+      } else if (this.isPagedown(e)) {
+        return commands.KEY_PAGEDOWN;
+      } else if (this.isEscape(e)) {
+        return commands.KEY_ESCAPE;
+      }
+    },
+
+    _up: function () {
+      if (this._index === 0) {
+        this._index = this.data.length - 1;
+      } else {
+        this._index -= 1;
+      }
+      this._activateIndexedItem();
+      this._setScroll();
+    },
+
+    _down: function () {
+      if (this._index === this.data.length - 1) {
+        this._index = 0;
+      } else {
+        this._index += 1;
+      }
+      this._activateIndexedItem();
+      this._setScroll();
+    },
+
+    _enter: function (e) {
+      var datum = this.data[parseInt(this._getActiveElement().data('index'), 10)];
+      this.completer.select(datum.value, datum.strategy, e);
+      this.deactivate();
+    },
+
+    _pageup: function () {
+      var target = 0;
+      var threshold = this._getActiveElement().position().top - this.$el.innerHeight();
+      this.$el.children().each(function (i) {
+        if ($(this).position().top + $(this).outerHeight() > threshold) {
+          target = i;
+          return false;
+        }
+      });
+      this._index = target;
+      this._activateIndexedItem();
+      this._setScroll();
+    },
+
+    _pagedown: function () {
+      var target = this.data.length - 1;
+      var threshold = this._getActiveElement().position().top + this.$el.innerHeight();
+      this.$el.children().each(function (i) {
+        if ($(this).position().top > threshold) {
+          target = i;
+          return false
+        }
+      });
+      this._index = target;
+      this._activateIndexedItem();
+      this._setScroll();
+    },
+
+    _activateIndexedItem: function () {
+      this.$el.find('.textcomplete-item.active').removeClass('active');
+      this._getActiveElement().addClass('active');
+    },
+
+    _getActiveElement: function () {
+      return this.$el.children('.textcomplete-item:nth(' + this._index + ')');
+    },
+
+    _setScroll: function () {
+      var $activeEl = this._getActiveElement();
+      var itemTop = $activeEl.position().top;
+      var itemHeight = $activeEl.outerHeight();
+      var visibleHeight = this.$el.innerHeight();
+      var visibleTop = this.$el.scrollTop();
+      if (this._index === 0 || this._index == this.data.length - 1 || itemTop < 0) {
+        this.$el.scrollTop(itemTop + visibleTop);
+      } else if (itemTop + itemHeight > visibleHeight) {
+        this.$el.scrollTop(itemTop + itemHeight + visibleTop - visibleHeight);
+      }
+    },
+
+    _buildContents: function (zippedData) {
+      var datum, i, index;
+      var html = '';
+      for (i = 0; i < zippedData.length; i++) {
+        if (this.data.length === this.maxCount) break;
+        datum = zippedData[i];
+        if (include(this.data, datum)) { continue; }
+        index = this.data.length;
+        this.data.push(datum);
+        html += '<li class="textcomplete-item" data-index="' + index + '"><a>';
+        html +=   datum.strategy.template(datum.value, datum.term);
+        html += '</a></li>';
+      }
+      return html;
+    },
+
+    _renderHeader: function (unzippedData) {
+      if (this.header) {
+        if (!this._$header) {
+          this._$header = $('<li class="textcomplete-header"></li>').prependTo(this.$el);
+        }
+        var html = $.isFunction(this.header) ? this.header(unzippedData) : this.header;
+        this._$header.html(html);
+      }
+    },
+
+    _renderFooter: function (unzippedData) {
+      if (this.footer) {
+        if (!this._$footer) {
+          this._$footer = $('<li class="textcomplete-footer"></li>').appendTo(this.$el);
+        }
+        var html = $.isFunction(this.footer) ? this.footer(unzippedData) : this.footer;
+        this._$footer.html(html);
+      }
+    },
+
+    _renderNoResultsMessage: function (unzippedData) {
+      if (this.noResultsMessage) {
+        if (!this._$noResultsMessage) {
+          this._$noResultsMessage = $('<li class="textcomplete-no-results-message"></li>').appendTo(this.$el);
+        }
+        var html = $.isFunction(this.noResultsMessage) ? this.noResultsMessage(unzippedData) : this.noResultsMessage;
+        this._$noResultsMessage.html(html);
+      }
+    },
+
+    _renderContents: function (html) {
+      if (this._$footer) {
+        this._$footer.before(html);
+      } else {
+        this.$el.append(html);
+      }
+    },
+
+    _fitToBottom: function() {
+      var windowScrollBottom = $window.scrollTop() + $window.height();
+      var height = this.$el.height();
+      if ((this.$el.position().top + height) > windowScrollBottom) {
+        this.$el.offset({top: windowScrollBottom - height});
+      }
+    },
+
+    _applyPlacement: function (position) {
+      // If the 'placement' option set to 'top', move the position above the element.
+      if (this.placement.indexOf('top') !== -1) {
+        // Overwrite the position object to set the 'bottom' property instead of the top.
+        position = {
+          top: 'auto',
+          bottom: this.$el.parent().height() - position.top + position.lineHeight,
+          left: position.left
+        };
+      } else {
+        position.bottom = 'auto';
+        delete position.lineHeight;
+      }
+      if (this.placement.indexOf('absleft') !== -1) {
+        position.left = 0;
+      } else if (this.placement.indexOf('absright') !== -1) {
+        position.right = 0;
+        position.left = 'auto';
+      }
+      return position;
+    }
+  });
+
+  $.fn.textcomplete.Dropdown = Dropdown;
+  $.extend($.fn.textcomplete, commands);
+}(jQuery);
+
++function ($) {
+  'use strict';
+
+  // Memoize a search function.
+  var memoize = function (func) {
+    var memo = {};
+    return function (term, callback) {
+      if (memo[term]) {
+        callback(memo[term]);
+      } else {
+        func.call(this, term, function (data) {
+          memo[term] = (memo[term] || []).concat(data);
+          callback.apply(null, arguments);
+        });
+      }
+    };
+  };
+
+  function Strategy(options) {
+    $.extend(this, options);
+    if (this.cache) { this.search = memoize(this.search); }
+  }
+
+  Strategy.parse = function (strategiesArray, params) {
+    return $.map(strategiesArray, function (strategy) {
+      var strategyObj = new Strategy(strategy);
+      strategyObj.el = params.el;
+      strategyObj.$el = params.$el;
+      return strategyObj;
+    });
+  };
+
+  $.extend(Strategy.prototype, {
+    // Public properties
+    // -----------------
+
+    // Required
+    match:      null,
+    replace:    null,
+    search:     null,
+
+    // Optional
+    cache:      false,
+    context:    function () { return true; },
+    index:      2,
+    template:   function (obj) { return obj; },
+    idProperty: null
+  });
+
+  $.fn.textcomplete.Strategy = Strategy;
+
+}(jQuery);
+
++function ($) {
+  'use strict';
+
+  var now = Date.now || function () { return new Date().getTime(); };
+
+  // Returns a function, that, as long as it continues to be invoked, will not
+  // be triggered. The function will be called after it stops being called for
+  // `wait` msec.
+  //
+  // This utility function was originally implemented at Underscore.js.
+  var debounce = function (func, wait) {
+    var timeout, args, context, timestamp, result;
+    var later = function () {
+      var last = now() - timestamp;
+      if (last < wait) {
+        timeout = setTimeout(later, wait - last);
+      } else {
+        timeout = null;
+        result = func.apply(context, args);
+        context = args = null;
+      }
+    };
+
+    return function () {
+      context = this;
+      args = arguments;
+      timestamp = now();
+      if (!timeout) {
+        timeout = setTimeout(later, wait);
+      }
+      return result;
+    };
+  };
+
+  function Adapter () {}
+
+  $.extend(Adapter.prototype, {
+    // Public properties
+    // -----------------
+
+    id:        null, // Identity.
+    completer: null, // Completer object which creates it.
+    el:        null, // Textarea element.
+    $el:       null, // jQuery object of the textarea.
+    option:    null,
+
+    // Public methods
+    // --------------
+
+    initialize: function (element, completer, option) {
+      this.el        = element;
+      this.$el       = $(element);
+      this.id        = completer.id + this.constructor.name;
+      this.completer = completer;
+      this.option    = option;
+
+      if (this.option.debounce) {
+        this._onKeyup = debounce(this._onKeyup, this.option.debounce);
+      }
+
+      this._bindEvents();
+    },
+
+    destroy: function () {
+      this.$el.off('.' + this.id); // Remove all event handlers.
+      this.$el = this.el = this.completer = null;
+    },
+
+    // Update the element with the given value and strategy.
+    //
+    // value    - The selected object. It is one of the item of the array
+    //            which was callbacked from the search function.
+    // strategy - The Strategy associated with the selected value.
+    select: function (/* value, strategy */) {
+      throw new Error('Not implemented');
+    },
+
+    // Returns the caret's relative coordinates from body's left top corner.
+    //
+    // FIXME: Calculate the left top corner of `this.option.appendTo` element.
+    getCaretPosition: function () {
+      var position = this._getCaretRelativePosition();
+      var offset = this.$el.offset();
+      position.top += offset.top;
+      position.left += offset.left;
+      return position;
+    },
+
+    // Focus on the element.
+    focus: function () {
+      this.$el.focus();
+    },
+
+    // Private methods
+    // ---------------
+
+    _bindEvents: function () {
+      this.$el.on('keyup.' + this.id, $.proxy(this._onKeyup, this));
+    },
+
+    _onKeyup: function (e) {
+      if (this._skipSearch(e)) { return; }
+      this.completer.trigger(this.getTextFromHeadToCaret(), true);
+    },
+
+    // Suppress searching if it returns true.
+    _skipSearch: function (clickEvent) {
+      switch (clickEvent.keyCode) {
+        case 13: // ENTER
+        case 40: // DOWN
+        case 38: // UP
+          return true;
+      }
+      if (clickEvent.ctrlKey) switch (clickEvent.keyCode) {
+        case 78: // Ctrl-N
+        case 80: // Ctrl-P
+          return true;
+      }
+    }
+  });
+
+  $.fn.textcomplete.Adapter = Adapter;
+}(jQuery);
+
++function ($) {
+  'use strict';
+
+  // Textarea adapter
+  // ================
+  //
+  // Managing a textarea. It doesn't know a Dropdown.
+  function Textarea(element, completer, option) {
+    this.initialize(element, completer, option);
+  }
+
+  Textarea.DIV_PROPERTIES = {
+    left: -9999,
+    position: 'absolute',
+    top: 0,
+    whiteSpace: 'pre-wrap'
+  }
+
+  Textarea.COPY_PROPERTIES = [
+    'border-width', 'font-family', 'font-size', 'font-style', 'font-variant',
+    'font-weight', 'height', 'letter-spacing', 'word-spacing', 'line-height',
+    'text-decoration', 'text-align', 'width', 'padding-top', 'padding-right',
+    'padding-bottom', 'padding-left', 'margin-top', 'margin-right',
+    'margin-bottom', 'margin-left', 'border-style', 'box-sizing', 'tab-size'
+  ];
+
+  $.extend(Textarea.prototype, $.fn.textcomplete.Adapter.prototype, {
+    // Public methods
+    // --------------
+
+    // Update the textarea with the given value and strategy.
+    select: function (value, strategy, e) {
+      var pre = this.getTextFromHeadToCaret();
+      var post = this.el.value.substring(this.el.selectionEnd);
+      var newSubstr = strategy.replace(value, e);
+      if (typeof newSubstr !== 'undefined') {
+        if ($.isArray(newSubstr)) {
+          post = newSubstr[1] + post;
+          newSubstr = newSubstr[0];
+        }
+        pre = pre.replace(strategy.match, newSubstr);
+        this.$el.val(pre + post);
+        this.el.selectionStart = this.el.selectionEnd = pre.length;
+      }
+    },
+
+    // Private methods
+    // ---------------
+
+    // Returns the caret's relative coordinates from textarea's left top corner.
+    //
+    // Browser native API does not provide the way to know the position of
+    // caret in pixels, so that here we use a kind of hack to accomplish
+    // the aim. First of all it puts a dummy div element and completely copies
+    // the textarea's style to the element, then it inserts the text and a
+    // span element into the textarea.
+    // Consequently, the span element's position is the thing what we want.
+    _getCaretRelativePosition: function () {
+      var dummyDiv = $('<div></div>').css(this._copyCss())
+        .text(this.getTextFromHeadToCaret());
+      var span = $('<span></span>').text('.').appendTo(dummyDiv);
+      this.$el.before(dummyDiv);
+      var position = span.position();
+      position.top += span.height() - this.$el.scrollTop();
+      position.lineHeight = span.height();
+      dummyDiv.remove();
+      return position;
+    },
+
+    _copyCss: function () {
+      return $.extend({
+        // Set 'scroll' if a scrollbar is being shown; otherwise 'auto'.
+        overflow: this.el.scrollHeight > this.el.offsetHeight ? 'scroll' : 'auto'
+      }, Textarea.DIV_PROPERTIES, this._getStyles());
+    },
+
+    _getStyles: (function ($) {
+      var color = $('<div></div>').css(['color']).color;
+      if (typeof color !== 'undefined') {
+        return function () {
+          return this.$el.css(Textarea.COPY_PROPERTIES);
+        };
+      } else { // jQuery < 1.8
+        return function () {
+          var $el = this.$el;
+          var styles = {};
+          $.each(Textarea.COPY_PROPERTIES, function (i, property) {
+            styles[property] = $el.css(property);
+          });
+          return styles;
+        };
+      }
+    })($),
+
+    getTextFromHeadToCaret: function () {
+      return this.el.value.substring(0, this.el.selectionEnd);
+    }
+  });
+
+  $.fn.textcomplete.Textarea = Textarea;
+}(jQuery);
+
++function ($) {
+  'use strict';
+
+  var sentinelChar = '吶';
+
+  function IETextarea(element, completer, option) {
+    this.initialize(element, completer, option);
+    $('<span>' + sentinelChar + '</span>').css({
+      position: 'absolute',
+      top: -9999,
+      left: -9999
+    }).insertBefore(element);
+  }
+
+  $.extend(IETextarea.prototype, $.fn.textcomplete.Textarea.prototype, {
+    // Public methods
+    // --------------
+
+    select: function (value, strategy, e) {
+      var pre = this.getTextFromHeadToCaret();
+      var post = this.el.value.substring(pre.length);
+      var newSubstr = strategy.replace(value, e);
+      if (typeof newSubstr !== 'undefined') {
+        if ($.isArray(newSubstr)) {
+          post = newSubstr[1] + post;
+          newSubstr = newSubstr[0];
+        }
+        pre = pre.replace(strategy.match, newSubstr);
+        this.$el.val(pre + post);
+        this.el.focus();
+        var range = this.el.createTextRange();
+        range.collapse(true);
+        range.moveEnd('character', pre.length);
+        range.moveStart('character', pre.length);
+        range.select();
+      }
+    },
+
+    getTextFromHeadToCaret: function () {
+      this.el.focus();
+      var range = document.selection.createRange();
+      range.moveStart('character', -this.el.value.length);
+      var arr = range.text.split(sentinelChar)
+      return arr.length === 1 ? arr[0] : arr[1];
+    }
+  });
+
+  $.fn.textcomplete.IETextarea = IETextarea;
+}(jQuery);
+
+// NOTE: TextComplete plugin has contenteditable support but it does not work
+//       fine especially on old IEs.
+//       Any pull requests are REALLY welcome.
+
++function ($) {
+  'use strict';
+
+  // ContentEditable adapter
+  // =======================
+  //
+  // Adapter for contenteditable elements.
+  function ContentEditable (element, completer, option) {
+    this.initialize(element, completer, option);
+  }
+
+  $.extend(ContentEditable.prototype, $.fn.textcomplete.Adapter.prototype, {
+    // Public methods
+    // --------------
+
+    // Update the content with the given value and strategy.
+    // When an dropdown item is selected, it is executed.
+    select: function (value, strategy, e) {
+      var pre = this.getTextFromHeadToCaret();
+      var sel = window.getSelection()
+      var range = sel.getRangeAt(0);
+      var selection = range.cloneRange();
+      selection.selectNodeContents(range.startContainer);
+      var content = selection.toString();
+      var post = content.substring(range.startOffset);
+      var newSubstr = strategy.replace(value, e);
+      if (typeof newSubstr !== 'undefined') {
+        if ($.isArray(newSubstr)) {
+          post = newSubstr[1] + post;
+          newSubstr = newSubstr[0];
+        }
+        pre = pre.replace(strategy.match, newSubstr);
+        range.selectNodeContents(range.startContainer);
+        range.deleteContents();
+        var node = document.createTextNode(pre + post);
+        range.insertNode(node);
+        range.setStart(node, pre.length);
+        range.collapse(true);
+        sel.removeAllRanges();
+        sel.addRange(range);
+      }
+    },
+
+    // Private methods
+    // ---------------
+
+    // Returns the caret's relative position from the contenteditable's
+    // left top corner.
+    //
+    // Examples
+    //
+    //   this._getCaretRelativePosition()
+    //   //=> { top: 18, left: 200, lineHeight: 16 }
+    //
+    // Dropdown's position will be decided using the result.
+    _getCaretRelativePosition: function () {
+      var range = window.getSelection().getRangeAt(0).cloneRange();
+      var node = document.createElement('span');
+      range.insertNode(node);
+      range.selectNodeContents(node);
+      range.deleteContents();
+      var $node = $(node);
+      var position = $node.offset();
+      position.left -= this.$el.offset().left;
+      position.top += $node.height() - this.$el.offset().top;
+      position.lineHeight = $node.height();
+      $node.remove();
+      return position;
+    },
+
+    // Returns the string between the first character and the caret.
+    // Completer will be triggered with the result for start autocompleting.
+    //
+    // Example
+    //
+    //   // Suppose the html is '<b>hello</b> wor|ld' and | is the caret.
+    //   this.getTextFromHeadToCaret()
+    //   // => ' wor'  // not '<b>hello</b> wor'
+    getTextFromHeadToCaret: function () {
+      var range = window.getSelection().getRangeAt(0);
+      var selection = range.cloneRange();
+      selection.selectNodeContents(range.startContainer);
+      return selection.toString().substring(0, range.startOffset);
+    }
+  });
+
+  $.fn.textcomplete.ContentEditable = ContentEditable;
+}(jQuery);
+
+return jQuery;
+}));
diff --git a/library/jquery_ac/README b/library/jquery_ac/README
deleted file mode 100644 (file)
index 422e3d7..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-This is jquery.autocomplete from
-
-http://www.devbridge.com/projects/autocomplete/jquery/
-
diff --git a/library/jquery_ac/friendica.complete.js b/library/jquery_ac/friendica.complete.js
deleted file mode 100644 (file)
index 81eba56..0000000
+++ /dev/null
@@ -1,395 +0,0 @@
-/**\r
-*  Ajax Autocomplete for jQuery, version 1.1.3\r
-*  (c) 2010 Tomas Kirda\r
-*\r
-*  Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.\r
-*  For details, see the web site: http://www.devbridge.com/projects/autocomplete/jquery/\r
-*\r
-*  Last Review: 04/19/2010\r
-*  Heavily modified for contact completion in Friendica (add photos, hover tips. etc.) 11-May-2012 mike@macgirvin.com\r
-*/\r
-\r
-/*jslint onevar: true, evil: true, nomen: true, eqeqeq: true, bitwise: true, regexp: true, newcap: true, immed: true */\r
-/*global window: true, document: true, clearInterval: true, setInterval: true, jQuery: true */\r
-\r
-(function($) {\r
-\r
-  var reEscape = new RegExp('(\\' + ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'].join('|\\') + ')', 'g');\r
-\r
-  function fnFormatResult(value, data, currentValue) {\r
-    var pattern = '(' + currentValue.replace(reEscape, '\\$1') + ')';\r
-    return value.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');\r
-  }\r
-\r
-  function Autocomplete(el, options) {\r
-    this.el = $(el);\r
-    this.el.attr('autocomplete', 'off');\r
-    this.suggestions = [];\r
-    this.data = [];\r
-    this.badQueries = [];\r
-    this.selectedIndex = -1;\r
-    this.currentValue = this.el.val();\r
-    this.intervalId = 0;\r
-    this.cachedResponse = [];\r
-    this.onChangeInterval = null;\r
-    this.ignoreValueChange = false;\r
-    this.serviceUrl = options.serviceUrl;\r
-    this.isLocal = false;\r
-    this.options = {\r
-      autoSubmit: false,\r
-      minChars: 1,\r
-      maxHeight: 300,\r
-      deferRequestBy: 0,\r
-      width: 0,\r
-      highlight: true,\r
-      params: {},\r
-      fnFormatResult: fnFormatResult,\r
-      delimiter: null,\r
-      zIndex: 9999\r
-    };\r
-    this.initialize();\r
-    this.setOptions(options);\r
-  }\r
-  \r
-  $.fn.autocomplete = function(options) {\r
-    return new Autocomplete(this.get(0)||$('<input />'), options);\r
-  };\r
-\r
-\r
-  Autocomplete.prototype = {\r
-\r
-    killerFn: null,\r
-\r
-    initialize: function() {\r
-\r
-      var me, uid, autocompleteElId;\r
-      me = this;\r
-      uid = Math.floor(Math.random()*0x100000).toString(16);\r
-      autocompleteElId = 'Autocomplete_' + uid;\r
-\r
-      this.killerFn = function(e) {\r
-        if ($(e.target).parents('.autocomplete').size() === 0) {\r
-          me.killSuggestions();\r
-          me.disableKillerFn();\r
-        }\r
-      };\r
-\r
-      if (!this.options.width) { this.options.width = this.el.width(); }\r
-      this.mainContainerId = 'AutocompleteContainter_' + uid;\r
-\r
-      $('<div id="' + this.mainContainerId + '" style="position:absolute;z-index:9999;"><div class="autocomplete-w1"><div class="autocomplete" id="' + autocompleteElId + '" style="display:none; width:300px;"></div></div></div>').appendTo('body');\r
-\r
-      this.container = $('#' + autocompleteElId);\r
-      this.fixPosition();\r
-      if (window.opera) {\r
-        this.el.keypress(function(e) { me.onKeyPress(e); });\r
-      } else {\r
-        this.el.keydown(function(e) { me.onKeyPress(e); });\r
-      }\r
-      this.el.keyup(function(e) { me.onKeyUp(e); });\r
-      this.el.blur(function() { me.enableKillerFn(); });\r
-      this.el.focus(function() { me.fixPosition(); });\r
-    },\r
-    \r
-    setOptions: function(options){\r
-      var o = this.options;\r
-      $.extend(o, options);\r
-      if(o.lookup){\r
-        this.isLocal = true;\r
-        if($.isArray(o.lookup)){ o.lookup = { suggestions:o.lookup, data:[] }; }\r
-      }\r
-      $('#'+this.mainContainerId).css({ zIndex:o.zIndex });\r
-      this.container.css({ maxHeight: o.maxHeight + 'px', width:o.width });\r
-    },\r
-    \r
-    clearCache: function(){\r
-      this.cachedResponse = [];\r
-      this.badQueries = [];\r
-    },\r
-    \r
-    disable: function(){\r
-      this.disabled = true;\r
-    },\r
-    \r
-    enable: function(){\r
-      this.disabled = false;\r
-    },\r
-\r
-    fixPosition: function() {\r
-      var offset = this.el.offset();\r
-      $('#' + this.mainContainerId).css({ top: (offset.top + this.el.innerHeight()) + 'px', left: offset.left + 'px' });\r
-    },\r
-\r
-    enableKillerFn: function() {\r
-      var me = this;\r
-      $(document).bind('click', me.killerFn);\r
-    },\r
-\r
-    disableKillerFn: function() {\r
-      var me = this;\r
-      $(document).unbind('click', me.killerFn);\r
-    },\r
-\r
-    killSuggestions: function() {\r
-      var me = this;\r
-      this.stopKillSuggestions();\r
-      this.intervalId = window.setInterval(function() { me.hide(); me.stopKillSuggestions(); }, 300);\r
-    },\r
-\r
-    stopKillSuggestions: function() {\r
-      window.clearInterval(this.intervalId);\r
-    },\r
-\r
-    onKeyPress: function(e) {\r
-      if (this.disabled || !this.enabled) { return; }\r
-      // return will exit the function\r
-      // and event will not be prevented\r
-      switch (e.keyCode) {\r
-        case 27: //KEY_ESC:\r
-          this.el.val(this.currentValue);\r
-          this.hide();\r
-          break;\r
-        case 9: //KEY_TAB:\r
-        case 13: //KEY_RETURN:\r
-          if (this.selectedIndex === -1) {\r
-            this.hide();\r
-            return;\r
-          }\r
-          this.select(this.selectedIndex);\r
-          if(e.keyCode === 9){ return; }\r
-          break;\r
-        case 38: //KEY_UP:\r
-          this.moveUp();\r
-          break;\r
-        case 40: //KEY_DOWN:\r
-          this.moveDown();\r
-          break;\r
-        default:\r
-          return;\r
-      }\r
-      e.stopImmediatePropagation();\r
-      e.preventDefault();\r
-    },\r
-\r
-    onKeyUp: function(e) {\r
-      if(this.disabled){ return; }\r
-      switch (e.keyCode) {\r
-        case 38: //KEY_UP:\r
-        case 40: //KEY_DOWN:\r
-          return;\r
-      }\r
-      clearInterval(this.onChangeInterval);\r
-      if (this.currentValue !== this.el.val()) {\r
-        if (this.options.deferRequestBy > 0) {\r
-          // Defer lookup in case when value changes very quickly:\r
-          var me = this;\r
-          this.onChangeInterval = setInterval(function() { me.onValueChange(); }, this.options.deferRequestBy);\r
-        } else {\r
-          this.onValueChange();\r
-        }\r
-      }\r
-    },\r
-\r
-    onValueChange: function() {\r
-      clearInterval(this.onChangeInterval);\r
-      this.currentValue = this.el.val();\r
-      var q = this.getQuery(this.currentValue);\r
-      this.selectedIndex = -1;\r
-      if (this.ignoreValueChange) {\r
-        this.ignoreValueChange = false;\r
-        return;\r
-      }\r
-      if (q === '' || q.length < this.options.minChars) {\r
-        this.hide();\r
-      } else {\r
-        this.getSuggestions(q);\r
-      }\r
-    },\r
-\r
-    getQuery: function(val) {\r
-      var d, arr;\r
-      d = this.options.delimiter;\r
-      if (!d) { return $.trim(val); }\r
-      arr = val.split(d);\r
-      return $.trim(arr[arr.length - 1]);\r
-    },\r
-\r
-    getSuggestionsLocal: function(q) {\r
-      var ret, arr, len, val, i;\r
-      arr = this.options.lookup;\r
-      len = arr.suggestions.length;\r
-      ret = { suggestions:[], data:[] };\r
-      q = q.toLowerCase();\r
-      for(i=0; i< len; i++){\r
-        val = arr.suggestions[i];\r
-        if(val.toLowerCase().indexOf(q) === 0){\r
-          ret.suggestions.push(val);\r
-          ret.data.push(arr.data[i]);\r
-        }\r
-      }\r
-      return ret;\r
-    },\r
-    \r
-    getSuggestions: function(q) {\r
-      var cr, me;\r
-      cr = this.isLocal ? this.getSuggestionsLocal(q) : this.cachedResponse[q];\r
-      if (cr && $.isArray(cr.suggestions)) {\r
-        this.suggestions = cr.suggestions;\r
-        this.data = cr.data;\r
-        this.suggest();\r
-      } else if (!this.isBadQuery(q)) {\r
-        me = this;\r
-        me.options.params.query = q;\r
-        $.get(this.serviceUrl, me.options.params, function(txt) { me.processResponse(txt); }, 'text');\r
-      }\r
-    },\r
-\r
-    isBadQuery: function(q) {\r
-      var i = this.badQueries.length;\r
-      while (i--) {\r
-        if (q.indexOf(this.badQueries[i]) === 0) { return true; }\r
-      }\r
-      return false;\r
-    },\r
-\r
-    hide: function() {\r
-      this.enabled = false;\r
-      this.selectedIndex = -1;\r
-      this.container.hide();\r
-    },\r
-\r
-    suggest: function() {\r
-      if (this.suggestions.length === 0) {\r
-        this.hide();\r
-        return;\r
-      }\r
-\r
-      var me, len, div, f, v, i, s, mOver, mClick, l, img;\r
-      me = this;\r
-      len = this.suggestions.length;\r
-      f = this.options.fnFormatResult;\r
-      v = this.getQuery(this.currentValue);\r
-      mOver = function(xi) { return function() { me.activate(xi); }; };\r
-      mClick = function(xi) { return function() { me.select(xi); }; };\r
-      this.container.hide().empty();\r
-      for (i = 0; i < len; i++) {\r
-        s = this.suggestions[i];\r
-               l = this.links[i];\r
-               img = '<img height="24" width="24" src="' + this.photos[i] + '" alt="' + s + '" />&nbsp;';\r
-        div = $((me.selectedIndex === i ? '<div class="selected"' : '<div') + ' title="' + l + '">' + img + f(s, this.data[i], v) + '</div>');\r
-        div.mouseover(mOver(i));\r
-        div.click(mClick(i));\r
-        this.container.append(div);\r
-      }\r
-      this.enabled = true;\r
-      this.container.show();\r
-    },\r
-\r
-    processResponse: function(text) {\r
-      var response;\r
-      try {\r
-        response = eval('(' + text + ')');\r
-      } catch (err) { return; }\r
-      if (!$.isArray(response.data)) { response.data = []; }\r
-      if(!this.options.noCache){\r
-        this.cachedResponse[response.query] = response;\r
-        if (response.suggestions.length === 0) { this.badQueries.push(response.query); }\r
-      }\r
-      if (response.query === this.getQuery(this.currentValue)) {\r
-               this.photos = response.photos;\r
-               this.links = response.links;\r
-        this.suggestions = response.suggestions;\r
-        this.data = response.data;\r
-        this.suggest(); \r
-      }\r
-    },\r
-\r
-    activate: function(index) {\r
-      var divs, activeItem;\r
-      divs = this.container.children();\r
-      // Clear previous selection:\r
-      if (this.selectedIndex !== -1 && divs.length > this.selectedIndex) {\r
-        $(divs.get(this.selectedIndex)).removeClass();\r
-      }\r
-      this.selectedIndex = index;\r
-      if (this.selectedIndex !== -1 && divs.length > this.selectedIndex) {\r
-        activeItem = divs.get(this.selectedIndex);\r
-        $(activeItem).addClass('selected');\r
-      }\r
-      return activeItem;\r
-    },\r
-\r
-    deactivate: function(div, index) {\r
-      div.className = '';\r
-      if (this.selectedIndex === index) { this.selectedIndex = -1; }\r
-    },\r
-\r
-    select: function(i) {\r
-      var selectedValue, f;\r
-      selectedValue = this.suggestions[i];\r
-      if (selectedValue) {\r
-        this.el.val(selectedValue);\r
-        if (this.options.autoSubmit) {\r
-          f = this.el.parents('form');\r
-          if (f.length > 0) { f.get(0).submit(); }\r
-        }\r
-        this.ignoreValueChange = true;\r
-        this.hide();\r
-        this.onSelect(i);\r
-      }\r
-    },\r
-\r
-    moveUp: function() {\r
-      if (this.selectedIndex === -1) { return; }\r
-      if (this.selectedIndex === 0) {\r
-        this.container.children().get(0).className = '';\r
-        this.selectedIndex = -1;\r
-        this.el.val(this.currentValue);\r
-        return;\r
-      }\r
-      this.adjustScroll(this.selectedIndex - 1);\r
-    },\r
-\r
-    moveDown: function() {\r
-      if (this.selectedIndex === (this.suggestions.length - 1)) { return; }\r
-      this.adjustScroll(this.selectedIndex + 1);\r
-    },\r
-\r
-    adjustScroll: function(i) {\r
-      var activeItem, offsetTop, upperBound, lowerBound;\r
-      activeItem = this.activate(i);\r
-      offsetTop = activeItem.offsetTop;\r
-      upperBound = this.container.scrollTop();\r
-      lowerBound = upperBound + this.options.maxHeight - 25;\r
-      if (offsetTop < upperBound) {\r
-        this.container.scrollTop(offsetTop);\r
-      } else if (offsetTop > lowerBound) {\r
-        this.container.scrollTop(offsetTop - this.options.maxHeight + 25);\r
-      }\r
-      this.el.val(this.getValue(this.suggestions[i]));\r
-    },\r
-\r
-    onSelect: function(i) {\r
-      var me, fn, s, d;\r
-      me = this;\r
-      fn = me.options.onSelect;\r
-      s = me.suggestions[i];\r
-      d = me.data[i];\r
-      me.el.val(me.getValue(s));\r
-      if ($.isFunction(fn)) { fn(s, d, me.el); }\r
-    },\r
-    \r
-    getValue: function(value){\r
-        var del, currVal, arr, me;\r
-        me = this;\r
-        del = me.options.delimiter;\r
-        if (!del) { return value; }\r
-        currVal = me.currentValue;\r
-        arr = currVal.split(del);\r
-        if (arr.length === 1) { return value; }\r
-        return currVal.substr(0, currVal.length - arr[arr.length - 1].length) + value;\r
-    }\r
-\r
-  };\r
-\r
-}(jQuery));\r
diff --git a/library/jquery_ac/friendica.complete.min.js b/library/jquery_ac/friendica.complete.min.js
deleted file mode 100644 (file)
index c879832..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
-*  Ajax Autocomplete for jQuery, version 1.1.3
-*  (c) 2010 Tomas Kirda
-*
-*  Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
-*  For details, see the web site: http://www.devbridge.com/projects/autocomplete/jquery/
-*
-*  Last Review: 04/19/2010
-*  Heavily modified for contact completion in Friendica (add photos, hover tips. etc.) 11-May-2012 mike@macgirvin.com
-*//*jslint onevar: true, evil: true, nomen: true, eqeqeq: true, bitwise: true, regexp: true, newcap: true, immed: true *//*global window: true, document: true, clearInterval: true, setInterval: true, jQuery: true */(function($){function fnFormatResult(value,data,currentValue){var pattern="("+currentValue.replace(reEscape,"\\$1")+")";return value.replace(new RegExp(pattern,"gi"),"<strong>$1</strong>")}function Autocomplete(el,options){this.el=$(el),this.el.attr("autocomplete","off"),this.suggestions=[],this.data=[],this.badQueries=[],this.selectedIndex=-1,this.currentValue=this.el.val(),this.intervalId=0,this.cachedResponse=[],this.onChangeInterval=null,this.ignoreValueChange=!1,this.serviceUrl=options.serviceUrl,this.isLocal=!1,this.options={autoSubmit:!1,minChars:1,maxHeight:300,deferRequestBy:0,width:0,highlight:!0,params:{},fnFormatResult:fnFormatResult,delimiter:null,zIndex:9999},this.initialize(),this.setOptions(options)}var reEscape=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g");$.fn.autocomplete=function(options){return new Autocomplete(this.get(0)||$("<input />"),options)},Autocomplete.prototype={killerFn:null,initialize:function(){var me,uid,autocompleteElId;me=this,uid=Math.floor(Math.random()*1048576).toString(16),autocompleteElId="Autocomplete_"+uid,this.killerFn=function(e){$(e.target).parents(".autocomplete").size()===0&&(me.killSuggestions(),me.disableKillerFn())},this.options.width||(this.options.width=this.el.width()),this.mainContainerId="AutocompleteContainter_"+uid,$('<div id="'+this.mainContainerId+'" style="position:absolute;z-index:9999;"><div class="autocomplete-w1"><div class="autocomplete" id="'+autocompleteElId+'" style="display:none; width:300px;"></div></div></div>').appendTo("body"),this.container=$("#"+autocompleteElId),this.fixPosition(),window.opera?this.el.keypress(function(e){me.onKeyPress(e)}):this.el.keydown(function(e){me.onKeyPress(e)}),this.el.keyup(function(e){me.onKeyUp(e)}),this.el.blur(function(){me.enableKillerFn()}),this.el.focus(function(){me.fixPosition()})},setOptions:function(options){var o=this.options;$.extend(o,options),o.lookup&&(this.isLocal=!0,$.isArray(o.lookup)&&(o.lookup={suggestions:o.lookup,data:[]})),$("#"+this.mainContainerId).css({zIndex:o.zIndex}),this.container.css({maxHeight:o.maxHeight+"px",width:o.width})},clearCache:function(){this.cachedResponse=[],this.badQueries=[]},disable:function(){this.disabled=!0},enable:function(){this.disabled=!1},fixPosition:function(){var offset=this.el.offset();$("#"+this.mainContainerId).css({top:offset.top+this.el.innerHeight()+"px",left:offset.left+"px"})},enableKillerFn:function(){var me=this;$(document).bind("click",me.killerFn)},disableKillerFn:function(){var me=this;$(document).unbind("click",me.killerFn)},killSuggestions:function(){var me=this;this.stopKillSuggestions(),this.intervalId=window.setInterval(function(){me.hide(),me.stopKillSuggestions()},300)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},onKeyPress:function(e){if(this.disabled||!this.enabled)return;switch(e.keyCode){case 27:this.el.val(this.currentValue),this.hide();break;case 9:case 13:if(this.selectedIndex===-1){this.hide();return}this.select(this.selectedIndex);if(e.keyCode===9)return;break;case 38:this.moveUp();break;case 40:this.moveDown();break;default:return}e.stopImmediatePropagation(),e.preventDefault()},onKeyUp:function(e){if(this.disabled)return;switch(e.keyCode){case 38:case 40:return}clearInterval(this.onChangeInterval);if(this.currentValue!==this.el.val())if(this.options.deferRequestBy>0){var me=this;this.onChangeInterval=setInterval(function(){me.onValueChange()},this.options.deferRequestBy)}else this.onValueChange()},onValueChange:function(){clearInterval(this.onChangeInterval),this.currentValue=this.el.val();var q=this.getQuery(this.currentValue);this.selectedIndex=-1;if(this.ignoreValueChange){this.ignoreValueChange=!1;return}q===""||q.length<this.options.minChars?this.hide():this.getSuggestions(q)},getQuery:function(val){var d,arr;return d=this.options.delimiter,d?(arr=val.split(d),$.trim(arr[arr.length-1])):$.trim(val)},getSuggestionsLocal:function(q){var ret,arr,len,val,i;arr=this.options.lookup,len=arr.suggestions.length,ret={suggestions:[],data:[]},q=q.toLowerCase();for(i=0;i<len;i++)val=arr.suggestions[i],val.toLowerCase().indexOf(q)===0&&(ret.suggestions.push(val),ret.data.push(arr.data[i]));return ret},getSuggestions:function(q){var cr,me;cr=this.isLocal?this.getSuggestionsLocal(q):this.cachedResponse[q],cr&&$.isArray(cr.suggestions)?(this.suggestions=cr.suggestions,this.data=cr.data,this.suggest()):this.isBadQuery(q)||(me=this,me.options.params.query=q,$.get(this.serviceUrl,me.options.params,function(txt){me.processResponse(txt)},"text"))},isBadQuery:function(q){var i=this.badQueries.length;while(i--)if(q.indexOf(this.badQueries[i])===0)return!0;return!1},hide:function(){this.enabled=!1,this.selectedIndex=-1,this.container.hide()},suggest:function(){if(this.suggestions.length===0){this.hide();return}var me,len,div,f,v,i,s,mOver,mClick,l,img;me=this,len=this.suggestions.length,f=this.options.fnFormatResult,v=this.getQuery(this.currentValue),mOver=function(xi){return function(){me.activate(xi)}},mClick=function(xi){return function(){me.select(xi)}},this.container.hide().empty();for(i=0;i<len;i++)s=this.suggestions[i],l=this.links[i],img='<img height="24" width="24" src="'+this.photos[i]+'" alt="'+s+'" />&nbsp;',div=$((me.selectedIndex===i?'<div class="selected"':"<div")+' title="'+l+'">'+img+f(s,this.data[i],v)+"</div>"),div.mouseover(mOver(i)),div.click(mClick(i)),this.container.append(div);this.enabled=!0,this.container.show()},processResponse:function(text){var response;try{response=eval("("+text+")")}catch(err){return}$.isArray(response.data)||(response.data=[]),this.options.noCache||(this.cachedResponse[response.query]=response,response.suggestions.length===0&&this.badQueries.push(response.query)),response.query===this.getQuery(this.currentValue)&&(this.photos=response.photos,this.links=response.links,this.suggestions=response.suggestions,this.data=response.data,this.suggest())},activate:function(index){var divs,activeItem;return divs=this.container.children(),this.selectedIndex!==-1&&divs.length>this.selectedIndex&&$(divs.get(this.selectedIndex)).removeClass(),this.selectedIndex=index,this.selectedIndex!==-1&&divs.length>this.selectedIndex&&(activeItem=divs.get(this.selectedIndex),$(activeItem).addClass("selected")),activeItem},deactivate:function(div,index){div.className="",this.selectedIndex===index&&(this.selectedIndex=-1)},select:function(i){var selectedValue,f;selectedValue=this.suggestions[i],selectedValue&&(this.el.val(selectedValue),this.options.autoSubmit&&(f=this.el.parents("form"),f.length>0&&f.get(0).submit()),this.ignoreValueChange=!0,this.hide(),this.onSelect(i))},moveUp:function(){if(this.selectedIndex===-1)return;if(this.selectedIndex===0){this.container.children().get(0).className="",this.selectedIndex=-1,this.el.val(this.currentValue);return}this.adjustScroll(this.selectedIndex-1)},moveDown:function(){if(this.selectedIndex===this.suggestions.length-1)return;this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(i){var activeItem,offsetTop,upperBound,lowerBound;activeItem=this.activate(i),offsetTop=activeItem.offsetTop,upperBound=this.container.scrollTop(),lowerBound=upperBound+this.options.maxHeight-25,offsetTop<upperBound?this.container.scrollTop(offsetTop):offsetTop>lowerBound&&this.container.scrollTop(offsetTop-this.options.maxHeight+25),this.el.val(this.getValue(this.suggestions[i]))},onSelect:function(i){var me,fn,s,d;me=this,fn=me.options.onSelect,s=me.suggestions[i],d=me.data[i],me.el.val(me.getValue(s)),$.isFunction(fn)&&fn(s,d,me.el)},getValue:function(value){var del,currVal,arr,me;return me=this,del=me.options.delimiter,del?(currVal=me.currentValue,arr=currVal.split(del),arr.length===1?value:currVal.substr(0,currVal.length-arr[arr.length-1].length)+value):value}}})(jQuery);
\ No newline at end of file
diff --git a/library/jquery_ac/jquery-1.3.2.min.js b/library/jquery_ac/jquery-1.3.2.min.js
deleted file mode 100644 (file)
index b1ae21d..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * jQuery JavaScript Library v1.3.2
- * http://jquery.com/
- *
- * Copyright (c) 2009 John Resig
- * Dual licensed under the MIT and GPL licenses.
- * http://docs.jquery.com/License
- *
- * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
- * Revision: 6246
- */
-(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
-/*
- * Sizzle CSS Selector Engine - v0.9.3
- *  Copyright 2009, The Dojo Foundation
- *  Released under the MIT, BSD, and GPL Licenses.
- *  More information: http://sizzlejs.com/
- */
-(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();
\ No newline at end of file
diff --git a/library/jquery_ac/jquery.autocomplete-min.js b/library/jquery_ac/jquery.autocomplete-min.js
deleted file mode 100644 (file)
index 7018fd0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/**\r
-*  Ajax Autocomplete for jQuery, version 1.1.3\r
-*  (c) 2010 Tomas Kirda\r
-*\r
-*  Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.\r
-*  For details, see the web site: http://www.devbridge.com/projects/autocomplete/jquery/\r
-*\r
-*  Last Review: 04/19/2010\r
-*/\r
-\r
-(function(d){function l(b,a,c){a="("+c.replace(m,"\\$1")+")";return b.replace(new RegExp(a,"gi"),"<strong>$1</strong>")}function i(b,a){this.el=d(b);this.el.attr("autocomplete","off");this.suggestions=[];this.data=[];this.badQueries=[];this.selectedIndex=-1;this.currentValue=this.el.val();this.intervalId=0;this.cachedResponse=[];this.onChangeInterval=null;this.ignoreValueChange=false;this.serviceUrl=a.serviceUrl;this.isLocal=false;this.options={autoSubmit:false,minChars:1,maxHeight:300,deferRequestBy:0, width:0,highlight:true,params:{},fnFormatResult:l,delimiter:null,zIndex:9999};this.initialize();this.setOptions(a)}var m=new RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\)","g");d.fn.autocomplete=function(b){return new i(this.get(0)||d("<input />"),b)};i.prototype={killerFn:null,initialize:function(){var b,a,c;b=this;a=Math.floor(Math.random()*1048576).toString(16);c="Autocomplete_"+a;this.killerFn=function(e){if(d(e.target).parents(".autocomplete").size()===0){b.killSuggestions(); b.disableKillerFn()}};if(!this.options.width)this.options.width=this.el.width();this.mainContainerId="AutocompleteContainter_"+a;d('<div id="'+this.mainContainerId+'" style="position:absolute;z-index:9999;"><div class="autocomplete-w1"><div class="autocomplete" id="'+c+'" style="display:none; width:300px;"></div></div></div>').appendTo("body");this.container=d("#"+c);this.fixPosition();window.opera?this.el.keypress(function(e){b.onKeyPress(e)}):this.el.keydown(function(e){b.onKeyPress(e)});this.el.keyup(function(e){b.onKeyUp(e)}); this.el.blur(function(){b.enableKillerFn()});this.el.focus(function(){b.fixPosition()})},setOptions:function(b){var a=this.options;d.extend(a,b);if(a.lookup){this.isLocal=true;if(d.isArray(a.lookup))a.lookup={suggestions:a.lookup,data:[]}}d("#"+this.mainContainerId).css({zIndex:a.zIndex});this.container.css({maxHeight:a.maxHeight+"px",width:a.width})},clearCache:function(){this.cachedResponse=[];this.badQueries=[]},disable:function(){this.disabled=true},enable:function(){this.disabled=false},fixPosition:function(){var b= this.el.offset();d("#"+this.mainContainerId).css({top:b.top+this.el.innerHeight()+"px",left:b.left+"px"})},enableKillerFn:function(){d(document).bind("click",this.killerFn)},disableKillerFn:function(){d(document).unbind("click",this.killerFn)},killSuggestions:function(){var b=this;this.stopKillSuggestions();this.intervalId=window.setInterval(function(){b.hide();b.stopKillSuggestions()},300)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},onKeyPress:function(b){if(!(this.disabled|| !this.enabled)){switch(b.keyCode){case 27:this.el.val(this.currentValue);this.hide();break;case 9:case 13:if(this.selectedIndex===-1){this.hide();return}this.select(this.selectedIndex);if(b.keyCode===9)return;break;case 38:this.moveUp();break;case 40:this.moveDown();break;default:return}b.stopImmediatePropagation();b.preventDefault()}},onKeyUp:function(b){if(!this.disabled){switch(b.keyCode){case 38:case 40:return}clearInterval(this.onChangeInterval);if(this.currentValue!==this.el.val())if(this.options.deferRequestBy> 0){var a=this;this.onChangeInterval=setInterval(function(){a.onValueChange()},this.options.deferRequestBy)}else this.onValueChange()}},onValueChange:function(){clearInterval(this.onChangeInterval);this.currentValue=this.el.val();var b=this.getQuery(this.currentValue);this.selectedIndex=-1;if(this.ignoreValueChange)this.ignoreValueChange=false;else b===""||b.length<this.options.minChars?this.hide():this.getSuggestions(b)},getQuery:function(b){var a;a=this.options.delimiter;if(!a)return d.trim(b);b= b.split(a);return d.trim(b[b.length-1])},getSuggestionsLocal:function(b){var a,c,e,g,f;c=this.options.lookup;e=c.suggestions.length;a={suggestions:[],data:[]};b=b.toLowerCase();for(f=0;f<e;f++){g=c.suggestions[f];if(g.toLowerCase().indexOf(b)===0){a.suggestions.push(g);a.data.push(c.data[f])}}return a},getSuggestions:function(b){var a,c;if((a=this.isLocal?this.getSuggestionsLocal(b):this.cachedResponse[b])&&d.isArray(a.suggestions)){this.suggestions=a.suggestions;this.data=a.data;this.suggest()}else if(!this.isBadQuery(b)){c= this;c.options.params.query=b;d.get(this.serviceUrl,c.options.params,function(e){c.processResponse(e)},"text")}},isBadQuery:function(b){for(var a=this.badQueries.length;a--;)if(b.indexOf(this.badQueries[a])===0)return true;return false},hide:function(){this.enabled=false;this.selectedIndex=-1;this.container.hide()},suggest:function(){if(this.suggestions.length===0)this.hide();else{var b,a,c,e,g,f,j,k;b=this;a=this.suggestions.length;e=this.options.fnFormatResult;g=this.getQuery(this.currentValue); j=function(h){return function(){b.activate(h)}};k=function(h){return function(){b.select(h)}};this.container.hide().empty();for(f=0;f<a;f++){c=this.suggestions[f];c=d((b.selectedIndex===f?'<div class="selected"':"<div")+' title="'+c+'">'+e(c,this.data[f],g)+"</div>");c.mouseover(j(f));c.click(k(f));this.container.append(c)}this.enabled=true;this.container.show()}},processResponse:function(b){var a;try{a=eval("("+b+")")}catch(c){return}if(!d.isArray(a.data))a.data=[];if(!this.options.noCache){this.cachedResponse[a.query]= a;a.suggestions.length===0&&this.badQueries.push(a.query)}if(a.query===this.getQuery(this.currentValue)){this.suggestions=a.suggestions;this.data=a.data;this.suggest()}},activate:function(b){var a,c;a=this.container.children();this.selectedIndex!==-1&&a.length>this.selectedIndex&&d(a.get(this.selectedIndex)).removeClass();this.selectedIndex=b;if(this.selectedIndex!==-1&&a.length>this.selectedIndex){c=a.get(this.selectedIndex);d(c).addClass("selected")}return c},deactivate:function(b,a){b.className= "";if(this.selectedIndex===a)this.selectedIndex=-1},select:function(b){var a;if(a=this.suggestions[b]){this.el.val(a);if(this.options.autoSubmit){a=this.el.parents("form");a.length>0&&a.get(0).submit()}this.ignoreValueChange=true;this.hide();this.onSelect(b)}},moveUp:function(){if(this.selectedIndex!==-1)if(this.selectedIndex===0){this.container.children().get(0).className="";this.selectedIndex=-1;this.el.val(this.currentValue)}else this.adjustScroll(this.selectedIndex-1)},moveDown:function(){this.selectedIndex!== this.suggestions.length-1&&this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(b){var a,c,e;a=this.activate(b).offsetTop;c=this.container.scrollTop();e=c+this.options.maxHeight-25;if(a<c)this.container.scrollTop(a);else a>e&&this.container.scrollTop(a-this.options.maxHeight+25);this.el.val(this.getValue(this.suggestions[b]))},onSelect:function(b){var a,c;a=this.options.onSelect;c=this.suggestions[b];b=this.data[b];this.el.val(this.getValue(c));d.isFunction(a)&&a(c,b,this.el)},getValue:function(b){var a, c;a=this.options.delimiter;if(!a)return b;c=this.currentValue;a=c.split(a);if(a.length===1)return b;return c.substr(0,c.length-a[a.length-1].length)+b}}})(jQuery);
\ No newline at end of file
diff --git a/library/jquery_ac/jquery.autocomplete.js b/library/jquery_ac/jquery.autocomplete.js
deleted file mode 100644 (file)
index 6a7ce87..0000000
+++ /dev/null
@@ -1,390 +0,0 @@
-/**\r
-*  Ajax Autocomplete for jQuery, version 1.1.3\r
-*  (c) 2010 Tomas Kirda\r
-*\r
-*  Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.\r
-*  For details, see the web site: http://www.devbridge.com/projects/autocomplete/jquery/\r
-*\r
-*  Last Review: 04/19/2010\r
-*/\r
-\r
-/*jslint onevar: true, evil: true, nomen: true, eqeqeq: true, bitwise: true, regexp: true, newcap: true, immed: true */\r
-/*global window: true, document: true, clearInterval: true, setInterval: true, jQuery: true */\r
-\r
-(function($) {\r
-\r
-  var reEscape = new RegExp('(\\' + ['/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\'].join('|\\') + ')', 'g');\r
-\r
-  function fnFormatResult(value, data, currentValue) {\r
-    var pattern = '(' + currentValue.replace(reEscape, '\\$1') + ')';\r
-    return value.replace(new RegExp(pattern, 'gi'), '<strong>$1<\/strong>');\r
-  }\r
-\r
-  function Autocomplete(el, options) {\r
-    this.el = $(el);\r
-    this.el.attr('autocomplete', 'off');\r
-    this.suggestions = [];\r
-    this.data = [];\r
-    this.badQueries = [];\r
-    this.selectedIndex = -1;\r
-    this.currentValue = this.el.val();\r
-    this.intervalId = 0;\r
-    this.cachedResponse = [];\r
-    this.onChangeInterval = null;\r
-    this.ignoreValueChange = false;\r
-    this.serviceUrl = options.serviceUrl;\r
-    this.isLocal = false;\r
-    this.options = {\r
-      autoSubmit: false,\r
-      minChars: 1,\r
-      maxHeight: 300,\r
-      deferRequestBy: 0,\r
-      width: 0,\r
-      highlight: true,\r
-      params: {},\r
-      fnFormatResult: fnFormatResult,\r
-      delimiter: null,\r
-      zIndex: 9999\r
-    };\r
-    this.initialize();\r
-    this.setOptions(options);\r
-  }\r
-  \r
-  $.fn.autocomplete = function(options) {\r
-    return new Autocomplete(this.get(0)||$('<input />'), options);\r
-  };\r
-\r
-\r
-  Autocomplete.prototype = {\r
-\r
-    killerFn: null,\r
-\r
-    initialize: function() {\r
-\r
-      var me, uid, autocompleteElId;\r
-      me = this;\r
-      uid = Math.floor(Math.random()*0x100000).toString(16);\r
-      autocompleteElId = 'Autocomplete_' + uid;\r
-\r
-      this.killerFn = function(e) {\r
-        if ($(e.target).parents('.autocomplete').size() === 0) {\r
-          me.killSuggestions();\r
-          me.disableKillerFn();\r
-        }\r
-      };\r
-\r
-      if (!this.options.width) { this.options.width = this.el.width(); }\r
-      this.mainContainerId = 'AutocompleteContainter_' + uid;\r
-\r
-      $('<div id="' + this.mainContainerId + '" style="position:absolute;z-index:9999;"><div class="autocomplete-w1"><div class="autocomplete" id="' + autocompleteElId + '" style="display:none; width:300px;"></div></div></div>').appendTo('body');\r
-\r
-      this.container = $('#' + autocompleteElId);\r
-      this.fixPosition();\r
-      if (window.opera) {\r
-        this.el.keypress(function(e) { me.onKeyPress(e); });\r
-      } else {\r
-        this.el.keydown(function(e) { me.onKeyPress(e); });\r
-      }\r
-      this.el.keyup(function(e) { me.onKeyUp(e); });\r
-      this.el.blur(function() { me.enableKillerFn(); });\r
-      this.el.focus(function() { me.fixPosition(); });\r
-    },\r
-    \r
-    setOptions: function(options){\r
-      var o = this.options;\r
-      $.extend(o, options);\r
-      if(o.lookup){\r
-        this.isLocal = true;\r
-        if($.isArray(o.lookup)){ o.lookup = { suggestions:o.lookup, data:[] }; }\r
-      }\r
-      $('#'+this.mainContainerId).css({ zIndex:o.zIndex });\r
-      this.container.css({ maxHeight: o.maxHeight + 'px', width:o.width });\r
-    },\r
-    \r
-    clearCache: function(){\r
-      this.cachedResponse = [];\r
-      this.badQueries = [];\r
-    },\r
-    \r
-    disable: function(){\r
-      this.disabled = true;\r
-    },\r
-    \r
-    enable: function(){\r
-      this.disabled = false;\r
-    },\r
-\r
-    fixPosition: function() {\r
-      var offset = this.el.offset();\r
-      $('#' + this.mainContainerId).css({ top: (offset.top + this.el.innerHeight()) + 'px', left: offset.left + 'px' });\r
-    },\r
-\r
-    enableKillerFn: function() {\r
-      var me = this;\r
-      $(document).bind('click', me.killerFn);\r
-    },\r
-\r
-    disableKillerFn: function() {\r
-      var me = this;\r
-      $(document).unbind('click', me.killerFn);\r
-    },\r
-\r
-    killSuggestions: function() {\r
-      var me = this;\r
-      this.stopKillSuggestions();\r
-      this.intervalId = window.setInterval(function() { me.hide(); me.stopKillSuggestions(); }, 300);\r
-    },\r
-\r
-    stopKillSuggestions: function() {\r
-      window.clearInterval(this.intervalId);\r
-    },\r
-\r
-    onKeyPress: function(e) {\r
-      if (this.disabled || !this.enabled) { return; }\r
-      // return will exit the function\r
-      // and event will not be prevented\r
-      switch (e.keyCode) {\r
-        case 27: //KEY_ESC:\r
-          this.el.val(this.currentValue);\r
-          this.hide();\r
-          break;\r
-        case 9: //KEY_TAB:\r
-        case 13: //KEY_RETURN:\r
-          if (this.selectedIndex === -1) {\r
-            this.hide();\r
-            return;\r
-          }\r
-          this.select(this.selectedIndex);\r
-          if(e.keyCode === 9){ return; }\r
-          break;\r
-        case 38: //KEY_UP:\r
-          this.moveUp();\r
-          break;\r
-        case 40: //KEY_DOWN:\r
-          this.moveDown();\r
-          break;\r
-        default:\r
-          return;\r
-      }\r
-      e.stopImmediatePropagation();\r
-      e.preventDefault();\r
-    },\r
-\r
-    onKeyUp: function(e) {\r
-      if(this.disabled){ return; }\r
-      switch (e.keyCode) {\r
-        case 38: //KEY_UP:\r
-        case 40: //KEY_DOWN:\r
-          return;\r
-      }\r
-      clearInterval(this.onChangeInterval);\r
-      if (this.currentValue !== this.el.val()) {\r
-        if (this.options.deferRequestBy > 0) {\r
-          // Defer lookup in case when value changes very quickly:\r
-          var me = this;\r
-          this.onChangeInterval = setInterval(function() { me.onValueChange(); }, this.options.deferRequestBy);\r
-        } else {\r
-          this.onValueChange();\r
-        }\r
-      }\r
-    },\r
-\r
-    onValueChange: function() {\r
-      clearInterval(this.onChangeInterval);\r
-      this.currentValue = this.el.val();\r
-      var q = this.getQuery(this.currentValue);\r
-      this.selectedIndex = -1;\r
-      if (this.ignoreValueChange) {\r
-        this.ignoreValueChange = false;\r
-        return;\r
-      }\r
-      if (q === '' || q.length < this.options.minChars) {\r
-        this.hide();\r
-      } else {\r
-        this.getSuggestions(q);\r
-      }\r
-    },\r
-\r
-    getQuery: function(val) {\r
-      var d, arr;\r
-      d = this.options.delimiter;\r
-      if (!d) { return $.trim(val); }\r
-      arr = val.split(d);\r
-      return $.trim(arr[arr.length - 1]);\r
-    },\r
-\r
-    getSuggestionsLocal: function(q) {\r
-      var ret, arr, len, val, i;\r
-      arr = this.options.lookup;\r
-      len = arr.suggestions.length;\r
-      ret = { suggestions:[], data:[] };\r
-      q = q.toLowerCase();\r
-      for(i=0; i< len; i++){\r
-        val = arr.suggestions[i];\r
-        if(val.toLowerCase().indexOf(q) === 0){\r
-          ret.suggestions.push(val);\r
-          ret.data.push(arr.data[i]);\r
-        }\r
-      }\r
-      return ret;\r
-    },\r
-    \r
-    getSuggestions: function(q) {\r
-      var cr, me;\r
-      cr = this.isLocal ? this.getSuggestionsLocal(q) : this.cachedResponse[q];\r
-      if (cr && $.isArray(cr.suggestions)) {\r
-        this.suggestions = cr.suggestions;\r
-        this.data = cr.data;\r
-        this.suggest();\r
-      } else if (!this.isBadQuery(q)) {\r
-        me = this;\r
-        me.options.params.query = q;\r
-        $.get(this.serviceUrl, me.options.params, function(txt) { me.processResponse(txt); }, 'text');\r
-      }\r
-    },\r
-\r
-    isBadQuery: function(q) {\r
-      var i = this.badQueries.length;\r
-      while (i--) {\r
-        if (q.indexOf(this.badQueries[i]) === 0) { return true; }\r
-      }\r
-      return false;\r
-    },\r
-\r
-    hide: function() {\r
-      this.enabled = false;\r
-      this.selectedIndex = -1;\r
-      this.container.hide();\r
-    },\r
-\r
-    suggest: function() {\r
-      if (this.suggestions.length === 0) {\r
-        this.hide();\r
-        return;\r
-      }\r
-\r
-      var me, len, div, f, v, i, s, mOver, mClick;\r
-      me = this;\r
-      len = this.suggestions.length;\r
-      f = this.options.fnFormatResult;\r
-      v = this.getQuery(this.currentValue);\r
-      mOver = function(xi) { return function() { me.activate(xi); }; };\r
-      mClick = function(xi) { return function() { me.select(xi); }; };\r
-      this.container.hide().empty();\r
-      for (i = 0; i < len; i++) {\r
-        s = this.suggestions[i];\r
-        div = $((me.selectedIndex === i ? '<div class="selected"' : '<div') + ' title="' + s + '">' + f(s, this.data[i], v) + '</div>');\r
-        div.mouseover(mOver(i));\r
-        div.click(mClick(i));\r
-        this.container.append(div);\r
-      }\r
-      this.enabled = true;\r
-      this.container.show();\r
-    },\r
-\r
-    processResponse: function(text) {\r
-      var response;\r
-      try {\r
-        response = eval('(' + text + ')');\r
-      } catch (err) { return; }\r
-      if (!$.isArray(response.data)) { response.data = []; }\r
-      if(!this.options.noCache){\r
-        this.cachedResponse[response.query] = response;\r
-        if (response.suggestions.length === 0) { this.badQueries.push(response.query); }\r
-      }\r
-      if (response.query === this.getQuery(this.currentValue)) {\r
-        this.suggestions = response.suggestions;\r
-        this.data = response.data;\r
-        this.suggest(); \r
-      }\r
-    },\r
-\r
-    activate: function(index) {\r
-      var divs, activeItem;\r
-      divs = this.container.children();\r
-      // Clear previous selection:\r
-      if (this.selectedIndex !== -1 && divs.length > this.selectedIndex) {\r
-        $(divs.get(this.selectedIndex)).removeClass();\r
-      }\r
-      this.selectedIndex = index;\r
-      if (this.selectedIndex !== -1 && divs.length > this.selectedIndex) {\r
-        activeItem = divs.get(this.selectedIndex);\r
-        $(activeItem).addClass('selected');\r
-      }\r
-      return activeItem;\r
-    },\r
-\r
-    deactivate: function(div, index) {\r
-      div.className = '';\r
-      if (this.selectedIndex === index) { this.selectedIndex = -1; }\r
-    },\r
-\r
-    select: function(i) {\r
-      var selectedValue, f;\r
-      selectedValue = this.suggestions[i];\r
-      if (selectedValue) {\r
-        this.el.val(selectedValue);\r
-        if (this.options.autoSubmit) {\r
-          f = this.el.parents('form');\r
-          if (f.length > 0) { f.get(0).submit(); }\r
-        }\r
-        this.ignoreValueChange = true;\r
-        this.hide();\r
-        this.onSelect(i);\r
-      }\r
-    },\r
-\r
-    moveUp: function() {\r
-      if (this.selectedIndex === -1) { return; }\r
-      if (this.selectedIndex === 0) {\r
-        this.container.children().get(0).className = '';\r
-        this.selectedIndex = -1;\r
-        this.el.val(this.currentValue);\r
-        return;\r
-      }\r
-      this.adjustScroll(this.selectedIndex - 1);\r
-    },\r
-\r
-    moveDown: function() {\r
-      if (this.selectedIndex === (this.suggestions.length - 1)) { return; }\r
-      this.adjustScroll(this.selectedIndex + 1);\r
-    },\r
-\r
-    adjustScroll: function(i) {\r
-      var activeItem, offsetTop, upperBound, lowerBound;\r
-      activeItem = this.activate(i);\r
-      offsetTop = activeItem.offsetTop;\r
-      upperBound = this.container.scrollTop();\r
-      lowerBound = upperBound + this.options.maxHeight - 25;\r
-      if (offsetTop < upperBound) {\r
-        this.container.scrollTop(offsetTop);\r
-      } else if (offsetTop > lowerBound) {\r
-        this.container.scrollTop(offsetTop - this.options.maxHeight + 25);\r
-      }\r
-      this.el.val(this.getValue(this.suggestions[i]));\r
-    },\r
-\r
-    onSelect: function(i) {\r
-      var me, fn, s, d;\r
-      me = this;\r
-      fn = me.options.onSelect;\r
-      s = me.suggestions[i];\r
-      d = me.data[i];\r
-      me.el.val(me.getValue(s));\r
-      if ($.isFunction(fn)) { fn(s, d, me.el); }\r
-    },\r
-    \r
-    getValue: function(value){\r
-        var del, currVal, arr, me;\r
-        me = this;\r
-        del = me.options.delimiter;\r
-        if (!del) { return value; }\r
-        currVal = me.currentValue;\r
-        arr = currVal.split(del);\r
-        if (arr.length === 1) { return value; }\r
-        return currVal.substr(0, currVal.length - arr[arr.length - 1].length) + value;\r
-    }\r
-\r
-  };\r
-\r
-}(jQuery));\r
diff --git a/library/jquery_ac/shadow.png b/library/jquery_ac/shadow.png
deleted file mode 100644 (file)
index a2561df..0000000
Binary files a/library/jquery_ac/shadow.png and /dev/null differ
diff --git a/library/jquery_ac/styles.css b/library/jquery_ac/styles.css
deleted file mode 100644 (file)
index e056d5c..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-\r
-.autocomplete-w1 { background:url(img/shadow.png) no-repeat bottom right; position:absolute; top:0px; left:0px; margin:8px 0 0 6px; /* IE6 fix: */ _background:none; _margin:0; }\r
-.autocomplete { border:1px solid #999; background:#FFF; cursor:default; text-align:left; max-height:350px; overflow:auto; margin:-6px 6px 6px -6px; /* IE6 specific: */ _height:350px;  _margin:0; _overflow-x:hidden; }\r
-.autocomplete .selected { background:#F0F0F0; }\r
-.autocomplete div { padding:2px 5px; white-space:nowrap; }\r
-.autocomplete strong { font-weight:normal; color:#3399FF; }\r
index 8646bf8..7fa9947 100644 (file)
@@ -177,12 +177,65 @@ key { display: inline; background-color: #eee; color: #666; padding:0.2em; font-
 
 /* fields help text */
 .field .field_help {
-    clear: left;
+  clear: left;
 }
 
 /* notifications unseen */
 .notify-unseen { background-color: #cceeFF; }
 
+/* autocomplete popup */
+ul.acpopup {
+  list-style: none;
+  float: left;
+  min-width: 160px;
+  padding: 5px 0;
+  margin: 2px 0 0;
+}
+nav .acpopup {
+  width: 290px;
+  max-height: 450px;
+  max-width: 300px;
+  overflow-y: auto;
+  overflow-x: hidden;
+  margin-top: 0px;
+}
+img.acpopup-img {
+  float: left;
+  width: 36px;
+  height: 36px;
+  margin-right: 5px;
+  vertical-align: middle;
+}
+.acpopup-contactname {
+  padding-top: 2px;
+  font-weight: bold;
+  line-height: 1em;
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: block;
+}
+.acpopup-sub-text {
+  color: #777;
+  font-size: 0.833em;
+  line-height: 1em;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  display: block;
+}
+.textcomplete-item a {
+  color: inherit;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  clear: both;
+  white-space: nowrap;
+  padding: 3px 20px;
+  display: block;
+}
+.textcomplete-item a:hover {
+  text-decoration: none;
+}
+
 /* plain text editor upload/select popup */
 
 .fbrowser .path a { padding: 5px; }
index f054fdc..25055d4 100644 (file)
@@ -1,18 +1,19 @@
 
-
-<script src="{{$baseurl}}/library/jquery_ac/friendica.complete.js" ></script>
-
 <script>
-$(document).ready(function() { 
-       var a; 
-       a = $("#contacts-search").autocomplete({ 
-               serviceUrl: '{{$base}}/acl',
-               minChars: 2,
-               width: 350,
-       });
-       a.setOptions({ params: { type: 'a' }});
-
-}); 
+$(document).ready(function() {
+       $("#contacts-search").contact_autocomplete(baseurl + '/acl', 'a', true);
 
+       $("#contacts-search").keyup(function(event){
+               if(event.keyCode == 13){
+                       $("#contacts-search").click();
+               }
+       });
+       $(".autocomplete-w1 .selected").keyup(function(event){
+               if(event.keyCode == 13){
+                       $("#contacts-search").click();
+               }
+       });
+});
 </script>
 
index 2050cde..9a96a23 100644 (file)
@@ -1,9 +1,9 @@
 
 <script>
 $(document).ready(function() {
-       $(".comment-edit-wrapper textarea").contact_autocomplete(baseurl+"/acl");
+       $(".comment-edit-wrapper textarea").editor_autocomplete(baseurl+"/acl");
        // make auto-complete work in more places
-       $(".wall-item-comment-wrapper textarea").contact_autocomplete(baseurl+"/acl");
+       $(".wall-item-comment-wrapper textarea").editor_autocomplete(baseurl+"/acl");
 });
 </script>
 
index 17c459c..afb7c1d 100644 (file)
@@ -33,7 +33,8 @@
 <!-- <script type="text/javascript" src="{{$baseurl}}/js/jquery-migrate.js" ></script>-->
 <script type="text/javascript" src="{{$baseurl}}/js/jquery-migrate.js" ></script>
 <script type="text/javascript" src="{{$baseurl}}/js/jquery.textinputs.js" ></script>
-<script type="text/javascript" src="{{$baseurl}}/js/fk.autocomplete.js" ></script>
+<script type="text/javascript" src="{{$baseurl}}/library/jquery-textcomplete/jquery.textcomplete.js" ></script>
+<script type="text/javascript" src="{{$baseurl}}/js/autocomplete.js" ></script>
 <script type="text/javascript" src="{{$baseurl}}/library/colorbox/jquery.colorbox-min.js"></script>
 <script type="text/javascript" src="{{$baseurl}}/library/jgrowl/jquery.jgrowl_minimized.js"></script>
 <script type="text/javascript" src="{{$baseurl}}/library/datetimepicker/jquery.datetimepicker.js"></script>
index 647f261..84ce88a 100644 (file)
@@ -12,7 +12,7 @@ function initEditor(cb){
                if(plaintext == 'none') {
                        $("#profile-jot-text-loading").hide();
                        $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
-                       $("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
+                       $("#profile-jot-text").editor_autocomplete(baseurl+"/acl");
                        editor = true;
                        $("a#jot-perms-icon").colorbox({
                                'inline' : true,
index 8756646..3fabebc 100644 (file)
@@ -1,18 +1,8 @@
 
-<script src="{{$baseurl}}/library/jquery_ac/friendica.complete.js" ></script>
-
-<script>$(document).ready(function() { 
-       var a; 
-       a = $("#recip").autocomplete({ 
-               serviceUrl: '{{$base}}/acl',
-               minChars: 2,
-               width: 350,
-               onSelect: function(value,data) {
-                       $("#recip-complete").val(data);
-               }                       
+<script>
+$(document).ready(function() {
+       $("#recip").name_autocomplete(baseurl + '/acl', 'm', false, function(data) {
+               $("#recip-complete").val(data.id);
        });
-
-}); 
-
+});
 </script>
-
index 86598bb..9b1a92e 100644 (file)
@@ -44,7 +44,7 @@ if(plaintext != 'none') {
        });
 }
 else
-       $("#prvmail-text").contact_autocomplete(baseurl+"/acl");
+       $("#prvmail-text").editor_autocomplete(baseurl+"/acl");
 
 
 </script>
diff --git a/view/templates/nav_head.tpl b/view/templates/nav_head.tpl
new file mode 100644 (file)
index 0000000..e69de29
index 6e30eb7..7de98d2 100644 (file)
@@ -1,18 +1,8 @@
-<script src="{{$baseurl}}/library/jquery_ac/friendica.complete.js" ></script>
 
-<script>$(document).ready(function() {
-       var a;
-       a = $("#poke-recip").autocomplete({
-               serviceUrl: '{{$base}}/acl',
-               minChars: 2,
-               width: 350,
-               onSelect: function(value,data) {
-                       $("#poke-recip-complete").val(data);
-               }
+<script>
+$(document).ready(function() {
+       $("#poke-recip").name_autocomplete(baseurl + '/acl', 'a', true, function(data) {
+               $("#poke-recip-complete").val(data.id);
        });
-       a.setOptions({ params: { type: 'a' }});
-
-
 });
-
-</script>
\ No newline at end of file
+</script>
index f03f496..2d4cd23 100644 (file)
@@ -44,7 +44,7 @@ if(plaintext != 'none') {
        });
 }
 else
-       $("#prvmail-text").contact_autocomplete(baseurl+"/acl");
+       $("#prvmail-text").editor_autocomplete(baseurl+"/acl");
 
 
 </script>
index c004eb5..e5cc390 100644 (file)
@@ -144,7 +144,7 @@ nav #banner #logo-text a:hover { text-decoration: none; }
     height: 15px;
        margin-top: 67px;
        margin-right: 2px;
-       //padding: 6px 10px;
+       /*padding: 6px 10px;*/
        padding: 6px 3px;
        float: left;
        bottom: 140px;
@@ -244,7 +244,7 @@ section {
        display:block;
        float:left;
        padding: 0.4em;
-       //margin-right: 1em;
+       /*margin-right: 1em;*/
        margin-right: 3px ;
 }
 .tab.active {
@@ -3288,6 +3288,12 @@ aside input[type='text'] {
 
 /* autocomplete popup */
 .acpopup {
+       background-color:#ffffff;
+       overflow:auto;
+       z-index:100000;
+       border:1px solid #cccccc;
+}
+.acpopup-mce {
        max-height:150px;
        background-color:#ffffff;
        overflow:auto;
@@ -3306,6 +3312,12 @@ aside input[type='text'] {
 .acpopupitem.selected {
        color: #FFFFFF; background: #3465A4;
 }
+.textcomplete-item.active {
+       color: #FFFFFF; background: #3465A4;
+}
+.active a .acpopup-sub-text {
+       color: #fff;
+}
 
 /* popup notifications */
 div.jGrowl div.notice {
index 9eac71b..d24e41e 100644 (file)
                                $('body').css('cursor', 'auto');
                        }
                        /* autocomplete @nicknames */
-                       $(".comment-edit-form  textarea").contact_autocomplete(baseurl+"/acl");
+                       $(".comment-edit-form  textarea").editor_autocomplete(baseurl+"/acl");
 
                        // setup videos, since VideoJS won't take care of any loaded via AJAX
                        if(typeof videojs != 'undefined') videojs.autoSetup();
index 8133c60..7d7e825 100644 (file)
@@ -103,25 +103,27 @@ $(document).ready(function() {
 
        switch(window.autocompleteType) {
                case 'msg-header':
-                       var a = $("#recip").autocomplete({ 
-                               serviceUrl: baseurl + '/acl',
-                               minChars: 2,
-                               width: 350,
-                               onSelect: function(value,data) {
-                                       $("#recip-complete").val(data);
-                               }                       
+                       $("#recip").name_autocomplete(baseurl + '/acl', '', false, function(data) {
+                                       $("#recip-complete").val(data.id);
                        });
                        break;
                case 'contacts-head':
-                       var a = $("#contacts-search").autocomplete({ 
-                               serviceUrl: baseurl + '/acl',
-                               minChars: 2,
-                               width: 350,
+                       $("#contacts-search").contact_autocomplete(baseurl + '/acl', 'a', true);
+
+
+                       $("#contacts-search").keyup(function(event){
+                               if(event.keyCode == 13){
+                                       $("#contacts-search").click();
+                               }
+                       });
+                       $(".autocomplete-w1 .selected").keyup(function(event){
+                               if(event.keyCode == 13){
+                                       $("#contacts-search").click();
+                               }
                        });
-                       a.setOptions({ params: { type: 'a' }});
                        break;
                case 'display-head':
-                       $(".comment-wwedit-wrapper textarea").contact_autocomplete(baseurl+"/acl");
+                       $(".comment-wwedit-wrapper textarea").editor_autocomplete(baseurl+"/acl");
                        break;
                default:
                        break;
@@ -286,7 +288,7 @@ function initEditor(cb){
                if(plaintext == 'none') {
 //                     $("#profile-jot-text-loading").hide();
                        $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
-                       $("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
+                       $("#profile-jot-text").editor_autocomplete(baseurl+"/acl");
                        editor = true;
 /*                     $("a#jot-perms-icon").colorbox({
                                'inline' : true,
index 400b23c..24373ed 100644 (file)
@@ -4160,6 +4160,64 @@ aside input[type='text'] {
 .acpopupitem.selected {\r
        color: #FFFFFF; background: #3465A4;\r
 }\r
+ul.acpopup {\r
+       list-style: none;\r
+       float: left;\r
+       min-width: 160px;\r
+       padding: 5px 0;\r
+       margin: 2px 0 0;\r
+}\r
+nav .acpopup {\r
+       width: 290px;\r
+       margin-left: -35px;\r
+       max-height: 450px;\r
+       max-width: 300px;\r
+       overflow-y: auto;\r
+       overflow-x: hidden;\r
+       margin-top: 0px;\r
+}\r
+img.acpopup-img {\r
+       float: left;\r
+       width: 36px;\r
+       height: 36px;\r
+       margin-right: 5px;\r
+       vertical-align: middle;\r
+}\r
+.acpopup-contactname {\r
+       padding-top: 2px;\r
+       font-weight: bold;\r
+       line-height: 1em;\r
+       white-space: nowrap;\r
+       overflow: hidden;\r
+       text-overflow: ellipsis;\r
+       display: block;\r
+}\r
+.acpopup-sub-text {\r
+       color: #777;\r
+       font-size: 0.833em;\r
+       line-height: 1em;\r
+       overflow: hidden;\r
+       text-overflow: ellipsis;\r
+       display: block;\r
+}\r
+.textcomplete-item a {\r
+       color: inherit;\r
+       overflow: hidden;\r
+       text-overflow: ellipsis;\r
+       clear: both;\r
+       white-space: nowrap;\r
+       padding: 3px 20px;\r
+       display: block;\r
+}\r
+.textcomplete-item a:hover {\r
+       text-decoration: none;\r
+}\r
+.textcomplete-item.active {\r
+       color: #FFFFFF; background: #3465A4;\r
+}\r
+.active a .acpopup-sub-text {\r
+       color: #fff;\r
+}\r
 \r
 /* popup notifications */\r
 div.jGrowl div.notice {\r
index 5416f87..139597f 100644 (file)
@@ -1,5 +1,2 @@
 
 
-<script src="{{$baseurl}}/library/jquery_ac/friendica.complete.min.js" ></script>
-
-
index 8d4b26b..c1acbfb 100644 (file)
@@ -7,7 +7,8 @@
 <script type="text/javascript" src="{{$baseurl}}/library/jgrowl/jquery.jgrowl_minimized.js"></script>
 <script type="text/javascript" src="{{$baseurl}}/library/datetimepicker/jquery.datetimepicker.js"></script>
 
-<script type="text/javascript" src="{{$baseurl}}/js/fk.autocomplete.js" ></script>
+<script type="text/javascript" src="{{$baseurl}}/library/jquery-textcomplete/jquery.textcomplete.js" ></script>
+<script type="text/javascript" src="{{$baseurl}}/js/autocomplete.js" ></script>
 <script type="text/javascript" src="{{$baseurl}}/view/theme/frost-mobile/js/acl.js" ></script>
 <script type="text/javascript" src="{{$baseurl}}/js/webtoolkit.base64.js" ></script>
 <script type="text/javascript" src="{{$baseurl}}/view/theme/frost-mobile/js/main.js" ></script>
index 5416f87..139597f 100644 (file)
@@ -1,5 +1,2 @@
 
 
-<script src="{{$baseurl}}/library/jquery_ac/friendica.complete.min.js" ></script>
-
-
index 5483ad6..733064b 100644 (file)
                                $('body').css('cursor', 'auto');
                        }
                        /* autocomplete @nicknames */
-                       $(".comment-edit-form  textarea").contact_autocomplete(baseurl+"/acl");
+                       $(".comment-edit-form  textarea").editor_autocomplete(baseurl+"/acl");
                
                        collapseHeight();
 
index a14a034..fc1bb64 100644 (file)
@@ -214,25 +214,27 @@ $(document).ready(function() {
 
        switch(window.autocompleteType) {
                case 'msg-header':
-                       var a = $("#recip").autocomplete({ 
-                               serviceUrl: baseurl + '/acl',
-                               minChars: 2,
-                               width: 350,
-                               onSelect: function(value,data) {
-                                       $("#recip-complete").val(data);
-                               }                       
+                       $("#recip").name_autocomplete(baseurl + '/acl', '', false, function(data) {
+                                       $("#recip-complete").val(data.id);
                        });
                        break;
                case 'contacts-head':
-                       var a = $("#contacts-search").autocomplete({ 
-                               serviceUrl: baseurl + '/acl',
-                               minChars: 2,
-                               width: 350,
+                       $("#contacts-search").contact_autocomplete(baseurl + '/acl', 'a', true);
+
+
+                       $("#contacts-search").keyup(function(event){
+                               if(event.keyCode == 13){
+                                       $("#contacts-search").click();
+                               }
+                       });
+                       $(".autocomplete-w1 .selected").keyup(function(event){
+                               if(event.keyCode == 13){
+                                       $("#contacts-search").click();
+                               }
                        });
-                       a.setOptions({ params: { type: 'a' }});
                        break;
                case 'display-head':
-                       $(".comment-wwedit-wrapper textarea").contact_autocomplete(baseurl+"/acl");
+                       $(".comment-wwedit-wrapper textarea").editor_autocomplete(baseurl+"/acl");
                        break;
                default:
                        break;
@@ -587,7 +589,7 @@ function initEditor(cb){
                        plaintextFn : function() {
                                $("#profile-jot-text-loading").hide();
                                $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
-                               $("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
+                               $("#profile-jot-text").editor_autocomplete(baseurl+"/acl");
                                $(".jothidden").show();
                                if (typeof cb!="undefined") cb();
                        }
@@ -660,7 +662,7 @@ function msgInitEditor() {
                        });
                },
                plaintextFn : function() {
-                       $("#prvmail-text").contact_autocomplete(baseurl+"/acl");
+                       $("#prvmail-text").editor_autocomplete(baseurl+"/acl");
                }
        }
        InitMCEEditor(editorData);
index 3dd400c..fe07ad2 100644 (file)
@@ -4010,13 +4010,15 @@ aside input[type='text'] {
 
 
 /* autocomplete popup */
-.acpopup {
-       max-height:150px;
+.acpopup, .acpopup-mce {
        background-color:#ffffff;
        overflow:auto;
        z-index:100000;
        border:1px solid #cccccc;
 }
+.acpopup-mce {
+       max-height:150px;
+}
 .acpopupitem {
        background-color:#ffffff; padding: 4px;
        clear:left;
@@ -4030,6 +4032,65 @@ aside input[type='text'] {
        color: #FFFFFF; background: #3465A4;
 }
 
+ul.acpopup {
+       list-style: none;
+       float: left;
+       min-width: 160px;
+       padding: 5px 0;
+       margin: 2px 0 0;
+}
+nav .acpopup {
+       width: 290px;
+       margin-left: -35px;
+       max-height: 450px;
+       max-width: 300px;
+       overflow-y: auto;
+       overflow-x: hidden;
+       margin-top: 0px;
+}
+img.acpopup-img {
+       float: left;
+       width: 36px;
+       height: 36px;
+       margin-right: 5px;
+       vertical-align: middle;
+}
+.acpopup-contactname {
+       padding-top: 2px;
+       font-weight: bold;
+       line-height: 1em;
+       white-space: nowrap;
+       overflow: hidden;
+       text-overflow: ellipsis;
+       display: block;
+}
+.acpopup-sub-text {
+       color: #777;
+       font-size: 0.833em;
+       line-height: 1em;
+       overflow: hidden;
+       text-overflow: ellipsis;
+       display: block;
+}
+.textcomplete-item a {
+       color: inherit;
+       overflow: hidden;
+       text-overflow: ellipsis;
+       clear: both;
+       white-space: nowrap;
+       padding: 3px 20px;
+       display: block;
+}
+.textcomplete-item a:hover {
+       text-decoration: none;
+}
+.textcomplete-item.active {
+       color: #FFFFFF; background: #3465A4;
+}
+.active a .acpopup-sub-text {
+       color: #fff;
+}
+
 /* popup notifications */
 div.jGrowl div.notice {
   background: #511919 url("../../../images/icons/48/notice.png") no-repeat 5px center;
index 5416f87..139597f 100644 (file)
@@ -1,5 +1,2 @@
 
 
-<script src="{{$baseurl}}/library/jquery_ac/friendica.complete.min.js" ></script>
-
-
index 4242f80..e864a94 100644 (file)
@@ -19,7 +19,8 @@
 
 <script type="text/javascript" src="{{$baseurl}}/view/theme/frost/js/acl.js" ></script>
 <script type="text/javascript" src="{{$baseurl}}/js/webtoolkit.base64.js" ></script>
-<script type="text/javascript" src="{{$baseurl}}/js/fk.autocomplete.js" ></script>
+<script type="text/javascript" src="{{$baseurl}}/library/jquery-textcomplete/jquery.textcomplete.js" ></script>
+<script type="text/javascript" src="{{$baseurl}}/js/autocomplete.js" ></script>
 <script type="text/javascript" src="{{$baseurl}}/view/theme/frost/js/main.js" ></script>
 <script type="text/javascript" src="{{$baseurl}}/view/theme/frost/js/theme.js"></script>
 
index 5416f87..139597f 100644 (file)
@@ -1,5 +1,2 @@
 
 
-<script src="{{$baseurl}}/library/jquery_ac/friendica.complete.min.js" ></script>
-
-
index 847017e..04e7a2a 100644 (file)
@@ -463,7 +463,7 @@ a:hover {
   text-decoration: underline;
 }
 blockquote {
-  background: #FFFFFF;
+  background: #ffffff;
   padding: 1em;
   margin-left: 1em;
   border-left: 1em solid #e6e6e6;
@@ -744,8 +744,12 @@ ul.menu-popup .toolbar a:hover {
 }
 /* autocomplete popup */
 .autocomplete,
-.acpopup {
+.acpopup-mce {
   max-height: 150px;
+}
+.autocomplete,
+.acpopup-mce,
+.acpopup {
   background-color: #ffffff;
   color: #2d2d2d;
   border: 1px solid #364e59;
@@ -774,6 +778,15 @@ ul.menu-popup .toolbar a:hover {
 .acpopupitem.selected {
   background-color: #bdcdd4;
 }
+.textcomplete-item {
+  color: #2d2d2d;
+}
+.textcomplete-item a:hover {
+  color: #2d2d2d;
+}
+.textcomplete-item.active {
+  background-color: #bdcdd4;
+}
 #nav-notifications-menu {
   width: 400px;
   max-height: 550px;
index 4cfcb59..13f328d 100644 (file)
@@ -463,7 +463,7 @@ a:hover {
   text-decoration: underline;
 }
 blockquote {
-  background: #FFFFFF;
+  background: #ffffff;
   padding: 1em;
   margin-left: 1em;
   border-left: 1em solid #e6e6e6;
@@ -744,8 +744,12 @@ ul.menu-popup .toolbar a:hover {
 }
 /* autocomplete popup */
 .autocomplete,
-.acpopup {
+.acpopup-mce {
   max-height: 150px;
+}
+.autocomplete,
+.acpopup-mce,
+.acpopup {
   background-color: #ffffff;
   color: #2d2d2d;
   border: 1px solid #364e59;
@@ -774,6 +778,15 @@ ul.menu-popup .toolbar a:hover {
 .acpopupitem.selected {
   background-color: #ccff42;
 }
+.textcomplete-item {
+  color: #2d2d2d;
+}
+.textcomplete-item a:hover {
+  color: #2d2d2d;
+}
+.textcomplete-item.active {
+  background-color: #ccff42;
+}
 #nav-notifications-menu {
   width: 400px;
   max-height: 550px;
index 2ff7cfc..5ad7e20 100644 (file)
 body {
   font-family: Liberation Sans, helvetica, arial, clean, sans-serif;
   font-size: 11px;
-  background-color: #F6ECF9;
+  background-color: #f6ecf9;
   color: #2d2d2d;
   margin: 50px 0 0 0;
   display: table;
@@ -463,7 +463,7 @@ a:hover {
   text-decoration: underline;
 }
 blockquote {
-  background: #FFFFFF;
+  background: #ffffff;
   padding: 1em;
   margin-left: 1em;
   border-left: 1em solid #e6e6e6;
@@ -744,8 +744,12 @@ ul.menu-popup .toolbar a:hover {
 }
 /* autocomplete popup */
 .autocomplete,
-.acpopup {
+.acpopup-mce {
   max-height: 150px;
+}
+.autocomplete,
+.acpopup-mce,
+.acpopup {
   background-color: #ffffff;
   color: #2d2d2d;
   border: 1px solid #364e59;
@@ -774,6 +778,15 @@ ul.menu-popup .toolbar a:hover {
 .acpopupitem.selected {
   background-color: #c0a3c7;
 }
+.textcomplete-item {
+  color: #2d2d2d;
+}
+.textcomplete-item a:hover {
+  color: #2d2d2d;
+}
+.textcomplete-item.active {
+  background-color: #c0a3c7;
+}
 #nav-notifications-menu {
   width: 400px;
   max-height: 550px;
@@ -1753,7 +1766,7 @@ span[id^="showmore-wrap"] {
   height: 20px;
   width: 500px;
   font-weight: bold;
-  border: 1px solid #F6ECF9;
+  border: 1px solid #f6ecf9;
 }
 #jot #jot-title:-webkit-input-placeholder {
   font-weight: normal;
@@ -1780,7 +1793,7 @@ span[id^="showmore-wrap"] {
   margin: 0;
   height: 20px;
   width: 200px;
-  border: 1px solid #F6ECF9;
+  border: 1px solid #f6ecf9;
 }
 #jot #jot-category:hover {
   border: 1px solid #999999;
index 681cfcc..3360ce3 100644 (file)
@@ -265,9 +265,10 @@ ul.menu-popup {
 }
 
 /* autocomplete popup */
+.autocomplete, .acpopup-mce { max-height:150px; }
 .autocomplete,
+.acpopup-mce,
 .acpopup {
-       max-height:150px;
        background-color:@MenuBg;
        color: @Menu;
        border:1px solid @MenuBorder;
@@ -291,6 +292,15 @@ ul.menu-popup {
                background-color: @MenuItemHoverBg;
        }
 }
+.textcomplete-item {
+       color: @MenuItem;
+       a:hover{
+               color: @MenuItem;
+       }
+       &.active{
+               background-color: @MenuItemHoverBg;
+       }
+}
 
 
 #nav-notifications-menu {
index b9f0949..1415949 100644 (file)
@@ -4353,8 +4353,7 @@ ul.menu-popup {
 }
 
 /* autocomplete popup */
-.acpopup {
-       max-height: 150px;
+.acpopup, acpopup-mce {
        overflow: auto;
        z-index: 100000;
        color: #2e3436;
@@ -4371,6 +4370,10 @@ ul.menu-popup {
                -webkit-box-shadow: 0 0 8px #BDBDBD;
 }
 
+.acpopup-mce {
+       max-height: 150px;
+}
+
 .acpopupitem {
        color: #2e3436;
        padding: 4px;
@@ -4381,7 +4384,7 @@ ul.menu-popup {
        margin-right: 4px;
 }
 
-.acpopupitem.selected {
+.acpopupitem.selected, .textcomplete-item.active {
        color: #efefef;
        background: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #1873a2), color-stop(1, #6da6c4) );
        background: -moz-linear-gradient( center top, #1873a2 5%, #6da6c4 100% );
@@ -4390,6 +4393,10 @@ ul.menu-popup {
        order-bottom: none;
 }
 
+.textcomplete-item a:hover, .textcomplete-item a:hover .acpopup-sub-text, .textcomplete-item.active a .acpopup-sub-text {
+       color: #efefef;
+}
+
 .qcomment {
        opacity: 0.8;
        filter: alpha(opacity=0);
index f096d25..8b2666f 100644 (file)
@@ -12,7 +12,7 @@ function initEditor(cb){
                if(plaintext == 'none') {
                        $("#profile-jot-text-loading").hide();
                        $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
-                       $("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
+                       $("#profile-jot-text").editor_autocomplete(baseurl+"/acl");
                        $(".jothidden").show();
                        editor = true;
                        $("a#jot-perms-icon").colorbox({
index 5a36de0..ec6d91a 100644 (file)
@@ -43,7 +43,7 @@ nav a {
   color: #737373;
 }
 
-nav #search-box #search-text {
+nav #nav-search-box #nav-search-text {
   border-radius: 5px;
 }
 
index 09f0e2f..ae289af 100644 (file)
@@ -7,6 +7,6 @@ nav ul li .menu-popup {
   right: 0px;
 }
 
-nav #search-box #search-text {
+nav #nav-search-box #nav-search-text {
   width: 100px;
 }
index 8e1865a..a8cf4d2 100644 (file)
@@ -159,7 +159,7 @@ section {
   top: 44px;
 }
 
-nav #search-box #search-text {
+nav #nav-search-box #nav-search-text {
   background-color: initial;
   border-style: solid;
   border-width: 1px;
index 2f0bd9c..918f880 100644 (file)
@@ -24,7 +24,7 @@ nav .nav-notify {
   padding: 1px 3px;
   border-radius: 5px 5px 5px 5px;
 }
-// -----
+
 nav .nav-menu-icon .nav-notify {
   top: 0px;
 }
@@ -146,7 +146,7 @@ section {
   top: 44px;
 }
 
-nav #search-box #search-text {
+nav #nav-search-box #nav-search-text {
   background-color: initial;
   border-style: solid;
   border-width: 1px;
index 16685e5..a7b15c5 100644 (file)
@@ -24,69 +24,69 @@ img {
 }
 
 #pending-update {
-        float:right;
-        color: #ffffff;
-        font-weight: bold;
-        background-color: #FF0000;
-        padding: 0em 0.3em;
+       float:right;
+       color: #ffffff;
+       font-weight: bold;
+       background-color: #FF0000;
+       padding: 0em 0.3em;
 }
 
 .admin.linklist {
-        border: 0px;
+       border: 0px;
        padding: 0px;
        list-style: none;
        margin-top: 0px;
 }
 
 .admin.link {
-        list-style-position: inside;
-        font-size: 1em;
+       list-style-position: inside;
+       font-size: 1em;
 /*        padding-left: 5px;
-        margin: 5px; */
+       margin: 5px; */
 }
 
 #adminpage dl {
-        clear: left;
-        margin-bottom: 2px;
-        padding-bottom: 2px;
-        border-bottom: 1px solid black;
+       clear: left;
+       margin-bottom: 2px;
+       padding-bottom: 2px;
+       border-bottom: 1px solid black;
 }
 
 #adminpage dt {
-        width: 200px;
-        float: left;
-        font-weight: bold;
+       width: 200px;
+       float: left;
+       font-weight: bold;
 }
 
 #adminpage dd {
-        margin-left: 200px;
+       margin-left: 200px;
 }
 #adminpage h3 {
-        border-bottom: 1px solid #898989;
-        margin-bottom: 5px;
-        margin-top: 10px;
+       border-bottom: 1px solid #898989;
+       margin-bottom: 5px;
+       margin-top: 10px;
 }
 
 #adminpage .submit {
-        clear:left;
+       clear:left;
 }
 
 #adminpage #pluginslist {
-        margin: 0px; padding: 0px;
+       margin: 0px; padding: 0px;
 }
 
 #adminpage .plugin {
-        list-style: none;
-        display: block;
+       list-style: none;
+       display: block;
        /* border: 1px solid #888888; */
-        padding: 1em;
-        margin-bottom: 5px;
-        clear: left;
+       padding: 1em;
+       margin-bottom: 5px;
+       clear: left;
 }
 
 #adminpage .toggleplugin {
-        float:left;
-        margin-right: 1em;
+       float:left;
+       margin-right: 1em;
 }
 
 #adminpage table {width:100%; border-bottom: 1p solid #000000; margin: 5px 0px;}
@@ -430,7 +430,7 @@ code {
 .sidebar-group-li:hover, #sidebar-new-group:hover, #sidebar-edit-groups:hover,#forum-widget-collapse:hover,
 #sidebar-ungrouped:hover, .side-link:hover, .nets-ul li:hover, #forumlist-sidebar li:hover, #forumlist-sidebar-right li:hover,
 .nets-all:hover, .saved-search-li:hover, li.tool:hover, .admin.link:hover, aside h4 a:hover, right_aside h4 a:hover, #message-new:hover,
-#sidebar-photos-albums li:hover, .photos-upload-link:hover {
+#sidebar-photos-albums li:hover, .photos-upload-link:hover, .textcomplete-item.active {
   /* background-color: #ddd; */
 /*  background-color: #e5e5e5; */
   background-color: #F5F5F5;
@@ -642,7 +642,7 @@ nav ul li .menu-popup {
   right: auto;
 }
 
-nav #search-box #search-text {
+nav #nav-search-box #nav-search-text {
   /*background-image:  url('icons/lupe.png');
   background-repeat:no-repeat; */
   padding-left:0px;
@@ -900,15 +900,22 @@ ul.menu-popup .empty {
   color: #9eabb0;
 }
 /* autocomplete popup */
-.acpopup {
-  max-height: 150px;
+
+.acpopup, .acpopup-mce {
   background-color: #ffffff;
-  color: #2d2d2d;
   border: 1px solid #MenuBorder;
   overflow: auto;
   z-index: 100000;
   box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7);
 }
+acpopup-mce {
+  color: #2d2d2d;
+  max-height: 150px;
+}
+nav .acpopup {
+  top: 31px !important;
+  margin-left: -23px
+}
 .acpopupitem {
   color: #2d2d2d;
   padding: 4px;
@@ -921,6 +928,16 @@ ul.menu-popup .empty {
 .acpopupitem.selected {
   background-color: #bdcdd4;
 }
+.textcomplete-item {
+  float: none;
+}
+.textcomplete-item a {
+  color: #737373;
+}
+.textcomplete-item a:hover {
+  padding: 3px 20px;
+}
+
 #nav-notifications-menu {
   width: 400px;
   max-height: 550px;
index d2b2838..281714e 100644 (file)
@@ -80,9 +80,9 @@
                {{/if}}
 
                {{if $nav.search}}
-                       <li role="search" id="search-box">
+                       <li role="search" id="nav-search-box">
                                <form method="get" action="{{$nav.search.0}}">
-                                       <input accesskey="s" id="search-text" class="nav-menu-search" type="text" value="" name="search">
+                                       <input accesskey="s" id="nav-search-text" class="nav-menu-search" type="text" value="" name="search" placeholder=" {{$search_hint}}">
                                        <select name="search-option">
                                                <option value="fulltext">{{$nav.searchoption.0}}</option>
                                                <option value="tags">{{$nav.searchoption.1}}</option>
diff --git a/view/theme/vier/templates/nav_head.tpl b/view/theme/vier/templates/nav_head.tpl
new file mode 100644 (file)
index 0000000..ff1b96f
--- /dev/null
@@ -0,0 +1,6 @@
+
+<script>
+$(document).ready(function() {
+       $("#nav-search-text").search_autocomplete(baseurl + '/acl');
+});
+</script>