From a49272d448d75a6ab74515352345d8baacb96f1f Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 30 Jul 2009 00:20:13 +0000 Subject: Add new Foreign_link col to store OAuth access token --- classes/Foreign_link.php | 1 + classes/laconica.ini | 1 + db/laconica.sql | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/classes/Foreign_link.php b/classes/Foreign_link.php index c0b356ece..a3a159eb5 100644 --- a/classes/Foreign_link.php +++ b/classes/Foreign_link.php @@ -14,6 +14,7 @@ class Foreign_link extends Memcached_DataObject public $foreign_id; // bigint(8) primary_key not_null unsigned public $service; // int(4) primary_key not_null public $credentials; // varchar(255) + public $token; // varchar(255) public $noticesync; // tinyint(1) not_null default_1 public $friendsync; // tinyint(1) not_null default_2 public $profilesync; // tinyint(1) not_null default_1 diff --git a/classes/laconica.ini b/classes/laconica.ini index 766bed75d..85d5f528d 100644 --- a/classes/laconica.ini +++ b/classes/laconica.ini @@ -127,6 +127,7 @@ user_id = 129 foreign_id = 129 service = 129 credentials = 2 +token = 2 noticesync = 145 friendsync = 145 profilesync = 145 diff --git a/db/laconica.sql b/db/laconica.sql index 2c04f680a..8b1152cbd 100644 --- a/db/laconica.sql +++ b/db/laconica.sql @@ -291,7 +291,8 @@ create table foreign_link ( user_id int comment 'link to user on this system, if exists' references user (id), foreign_id bigint unsigned comment 'link to user on foreign service, if exists' references foreign_user(id), service int not null comment 'foreign key to service' references foreign_service(id), - credentials varchar(255) comment 'authc credentials, typically a password', + credentials varchar(255) comment 'auth credentials, typically a password or token secret', + token varchar(255) comment 'access token', noticesync tinyint not null default 1 comment 'notice synchronization, bit 1 = sync outgoing, bit 2 = sync incoming, bit 3 = filter local replies', friendsync tinyint not null default 2 comment 'friend synchronization, bit 1 = sync outgoing, bit 2 = sync incoming', profilesync tinyint not null default 1 comment 'profile synchronization, bit 1 = sync outgoing, bit 2 = sync incoming', -- cgit v1.2.3-54-g00ecf From 6f4b2f0ac2f235332c850b050d9e4563fc71f89d Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sat, 1 Aug 2009 08:20:44 +0000 Subject: Twitter OAuth server dance working --- actions/twitterauthorization.php | 136 +++++++++++++++++++++++++++++++++++++++ actions/twittersettings.php | 111 ++++++++++++++------------------ lib/common.php | 3 + lib/router.php | 4 ++ lib/twitteroauthclient.php | 109 +++++++++++++++++++++++++++++++ 5 files changed, 302 insertions(+), 61 deletions(-) create mode 100644 actions/twitterauthorization.php create mode 100644 lib/twitteroauthclient.php diff --git a/actions/twitterauthorization.php b/actions/twitterauthorization.php new file mode 100644 index 000000000..f19cd7f65 --- /dev/null +++ b/actions/twitterauthorization.php @@ -0,0 +1,136 @@ +. + * + * @category TwitterauthorizationAction + * @package Laconica + * @author Zach Copely + * @copyright 2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +class TwitterauthorizationAction extends Action +{ + + function prepare($args) + { + parent::prepare($args); + + $this->oauth_token = $this->arg('oauth_token'); + + return true; + } + + function handle($args) + { + parent::handle($args); + + if (!common_logged_in()) { + $this->clientError(_('Not logged in.'), 403); + } + + $user = common_current_user(); + $flink = Foreign_link::getByUserID($user->id, TWITTER_SERVICE); + + // If there's already a foreign link record, it means we already + // have an access token, and this is unecessary. So go back. + + if (isset($flink)) { + common_redirect(common_local_url('twittersettings')); + } + + // $this->oauth_token is only populated once Twitter authorizes our + // request token. If it's empty we're at the beginning of the auth + // process + + if (empty($this->oauth_token)) { + + // Get a new request token and authorize it + + $client = new TwitterOAuthClient(); + $req_tok = $client->getRequestToken(); + + // Sock the request token away in the session temporarily + + $_SESSION['twitter_request_token'] = $req_tok->key; + $_SESSION['twitter_request_token_secret'] = $req_tok->key; + + $auth_link = $client->getAuthorizeLink($req_tok); + common_redirect($auth_link); + + } else { + + // Check to make sure Twitter sent us the same request token we sent + + if ($_SESSION['twitter_request_token'] != $this->oauth_token) { + $this->serverError(_('Couldn\'t link your Twitter account.')); + } + + $client = new TwitterOAuthClient($_SESSION['twitter_request_token'], + $_SESSION['twitter_request_token_secret']); + + // Exchange the request token for an access token + + $atok = $client->getAccessToken(); + + // Save the access token and Twitter user info + + $client = new TwitterOAuthClient($atok->key, $atok->secret); + + $twitter_user = $client->verify_credentials(); + + $user = common_current_user(); + + $flink = new Foreign_link(); + + $flink->user_id = $user->id; + $flink->foreign_id = $twitter_user->id; + $flink->service = TWITTER_SERVICE; + $flink->token = $atok->key; + $flink->credentials = $atok->secret; + $flink->created = common_sql_now(); + + $flink->set_flags(true, false, false, false); + + $flink_id = $flink->insert(); + + if (empty($flink_id)) { + common_log_db_error($flink, 'INSERT', __FILE__); + $this->serverError(_('Couldn\'t link your Twitter account.')); + } + + save_twitter_user($twitter_user->id, $twitter_user->screen_name); + + // clean up the the mess we made in the session + + unset($_SESSION['twitter_request_token']); + unset($_SESSION['twitter_request_token_secret']); + + common_redirect(common_local_url('twittersettings')); + } + } + +} + diff --git a/actions/twittersettings.php b/actions/twittersettings.php index 2b742788e..acc9fb935 100644 --- a/actions/twittersettings.php +++ b/actions/twittersettings.php @@ -69,9 +69,8 @@ class TwittersettingsAction extends ConnectSettingsAction function getInstructions() { - return _('Add your Twitter account to automatically send '. - ' your notices to Twitter, ' . - 'and subscribe to Twitter friends already here.'); + return _('Connect your Twitter account to share your updates ' . + 'with your Twitter friends and vice-versa.'); } /** @@ -93,7 +92,7 @@ class TwittersettingsAction extends ConnectSettingsAction $flink = Foreign_link::getByUserID($user->id, TWITTER_SERVICE); - if ($flink) { + if (!empty($flink)) { $fuser = $flink->getForeignUser(); } @@ -102,73 +101,61 @@ class TwittersettingsAction extends ConnectSettingsAction 'class' => 'form_settings', 'action' => common_local_url('twittersettings'))); - $this->elementStart('fieldset', array('id' => 'settings_twitter_account')); - $this->element('legend', null, _('Twitter Account')); + $this->hidden('token', common_session_token()); - if ($fuser) { + + + if (empty($fuser)) { + + $this->elementStart('fieldset', array('id' => 'settings_twitter_account')); $this->elementStart('ul', 'form_data'); - $this->elementStart('li', array('id' => 'settings_twitter_remove')); - $this->element('span', 'twitter_user', $fuser->nickname); - $this->element('a', array('href' => $fuser->uri), $fuser->uri); - $this->element('p', 'form_note', - _('Current verified Twitter account.')); - $this->hidden('flink_foreign_id', $flink->foreign_id); - $this->elementEnd('li'); + $this->elementStart('li', array('id' => 'settings_twitter_login_button')); + $this->element('a', array('href' => common_local_url('twitterauthorization')), + 'Connect my Twitter account'); + $this->elementEnd('li'); $this->elementEnd('ul'); - $this->submit('remove', _('Remove')); + $this->elementEnd('fieldset'); + } else { + + $this->elementStart('fieldset', + array('id' => 'settings_twitter_preferences')); + $this->element('legend', null, _('Preferences')); + $this->elementStart('ul', 'form_data'); - $this->elementStart('li', array('id' => 'settings_twitter_login')); - $this->input('twitter_username', _('Twitter user name'), - ($this->arg('twitter_username')) ? - $this->arg('twitter_username') : - $profile->nickname, - _('No spaces, please.')); // hey, it's what Twitter says + $this->elementStart('li'); + $this->checkbox('noticesend', + _('Automatically send my notices to Twitter.'), + ($flink) ? + ($flink->noticesync & FOREIGN_NOTICE_SEND) : + true); $this->elementEnd('li'); $this->elementStart('li'); - $this->password('twitter_password', _('Twitter password')); - $this->elementend('li'); - $this->elementEnd('ul'); - } - $this->elementEnd('fieldset'); + $this->checkbox('replysync', + _('Send local "@" replies to Twitter.'), + ($flink) ? + ($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : + true); + $this->elementEnd('li'); + $this->elementStart('li'); + $this->checkbox('friendsync', + _('Subscribe to my Twitter friends here.'), + ($flink) ? + ($flink->friendsync & FOREIGN_FRIEND_RECV) : + false); + $this->elementEnd('li'); - $this->elementStart('fieldset', - array('id' => 'settings_twitter_preferences')); - $this->element('legend', null, _('Preferences')); - - $this->elementStart('ul', 'form_data'); - $this->elementStart('li'); - $this->checkbox('noticesend', - _('Automatically send my notices to Twitter.'), - ($flink) ? - ($flink->noticesync & FOREIGN_NOTICE_SEND) : - true); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->checkbox('replysync', - _('Send local "@" replies to Twitter.'), - ($flink) ? - ($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : - true); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->checkbox('friendsync', - _('Subscribe to my Twitter friends here.'), - ($flink) ? - ($flink->friendsync & FOREIGN_FRIEND_RECV) : - false); - $this->elementEnd('li'); - - if (common_config('twitterbridge','enabled')) { + if (common_config('twitterbridge','enabled')) { $this->elementStart('li'); $this->checkbox('noticerecv', - _('Import my Friends Timeline.'), - ($flink) ? - ($flink->noticesync & FOREIGN_NOTICE_RECV) : - false); + _('Import my Friends Timeline.'), + ($flink) ? + ($flink->noticesync & FOREIGN_NOTICE_RECV) : + false); $this->elementEnd('li'); - } else { + // preserve setting even if bidrection bridge toggled off + if ($flink && ($flink->noticesync & FOREIGN_NOTICE_RECV)) { $this->hidden('noticerecv', true, 'noticerecv'); } @@ -181,11 +168,13 @@ class TwittersettingsAction extends ConnectSettingsAction } else { $this->submit('add', _('Add')); } + $this->elementEnd('fieldset'); + } - $this->showTwitterSubscriptions(); + $this->showTwitterSubscriptions(); - $this->elementEnd('form'); + $this->elementEnd('form'); } /** diff --git a/lib/common.php b/lib/common.php index 9d7954fa9..f9ac66f4f 100644 --- a/lib/common.php +++ b/lib/common.php @@ -196,6 +196,9 @@ $config = 'integration' => array('source' => 'Laconica', # source attribute for Twitter 'taguri' => $_server.',2009'), # base for tag URIs + 'twitter' => + array('consumer_key' => null, + 'consumer_secret' => null), 'memcached' => array('enabled' => false, 'server' => 'localhost', diff --git a/lib/router.php b/lib/router.php index e10d484f4..582dfae6d 100644 --- a/lib/router.php +++ b/lib/router.php @@ -88,6 +88,10 @@ class Router $m->connect('doc/:title', array('action' => 'doc')); + // Twitter + + $m->connect('twitter/authorization', array('action' => 'twitterauthorization')); + // facebook $m->connect('facebook', array('action' => 'facebookhome')); diff --git a/lib/twitteroauthclient.php b/lib/twitteroauthclient.php new file mode 100644 index 000000000..616fbc213 --- /dev/null +++ b/lib/twitteroauthclient.php @@ -0,0 +1,109 @@ +sha1_method = new OAuthSignatureMethod_HMAC_SHA1(); + $consumer_key = common_config('twitter', 'consumer_key'); + $consumer_secret = common_config('twitter', 'consumer_secret'); + $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret); + $this->token = null; + + if (isset($oauth_token) && isset($oauth_token_secret)) { + $this->token = new OAuthToken($oauth_token, $oauth_token_secret); + } + } + + function getRequestToken() + { + $response = $this->oAuthGet(TwitterOAuthClient::$requestTokenURL); + parse_str($response); + $token = new OAuthToken($oauth_token, $oauth_token_secret); + return $token; + } + + function getAuthorizeLink($request_token) + { + // Not sure Twitter actually looks at oauth_callback + + return TwitterOAuthClient::$authorizeURL . + '?oauth_token=' . $request_token->key . '&oauth_callback=' . + urlencode(common_local_url('twitterauthorization')); + } + + function getAccessToken() + { + $response = $this->oAuthPost(TwitterOAuthClient::$accessTokenURL); + parse_str($response); + $token = new OAuthToken($oauth_token, $oauth_token_secret); + return $token; + } + + function verify_credentials() + { + $url = 'https://twitter.com/account/verify_credentials.json'; + $response = $this->oAuthGet($url); + $twitter_user = json_decode($response); + return $twitter_user; + } + + function oAuthGet($url) + { + $request = OAuthRequest::from_consumer_and_token($this->consumer, + $this->token, 'GET', $url, null); + $request->sign_request($this->sha1_method, + $this->consumer, $this->token); + + return $this->httpRequest($request->to_url()); + } + + function oAuthPost($url, $params = null) + { + $request = OAuthRequest::from_consumer_and_token($this->consumer, + $this->token, 'POST', $url, $params); + $request->sign_request($this->sha1_method, + $this->consumer, $this->token); + + return $this->httpRequest($request->get_normalized_http_url(), + $request->to_postdata()); + } + + function httpRequest($url, $params = null) + { + $options = array( + CURLOPT_RETURNTRANSFER => true, + CURLOPT_FAILONERROR => true, + CURLOPT_HEADER => false, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_USERAGENT => 'Laconica', + CURLOPT_CONNECTTIMEOUT => 120, + CURLOPT_TIMEOUT => 120, + CURLOPT_HTTPAUTH => CURLAUTH_ANY, + CURLOPT_SSL_VERIFYPEER => false, + + // Twitter is strict about accepting invalid "Expect" headers + + CURLOPT_HTTPHEADER => array('Expect:') + ); + + if (isset($params)) { + $options[CURLOPT_POST] = true; + $options[CURLOPT_POSTFIELDS] = $params; + } + + $ch = curl_init($url); + curl_setopt_array($ch, $options); + $response = curl_exec($ch); + curl_close($ch); + + return $response; + } + +} -- cgit v1.2.3-54-g00ecf From 981fa1b33a8073bd0d53d8bee7dfccd171685e61 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Mon, 3 Aug 2009 22:46:01 +0000 Subject: Make the TwitterQueuehandler post to Twitter using OAuth --- actions/twitterauthorization.php | 48 +++++++++++----- lib/mail.php | 19 ++++--- lib/twitter.php | 117 +++++++++++++++------------------------ lib/twitteroauthclient.php | 39 +++++++++---- 4 files changed, 116 insertions(+), 107 deletions(-) diff --git a/actions/twitterauthorization.php b/actions/twitterauthorization.php index f19cd7f65..519427dac 100644 --- a/actions/twitterauthorization.php +++ b/actions/twitterauthorization.php @@ -67,39 +67,57 @@ class TwitterauthorizationAction extends Action if (empty($this->oauth_token)) { - // Get a new request token and authorize it + try { - $client = new TwitterOAuthClient(); - $req_tok = $client->getRequestToken(); + // Get a new request token and authorize it - // Sock the request token away in the session temporarily + $client = new TwitterOAuthClient(); + $req_tok = $client->getRequestToken(); - $_SESSION['twitter_request_token'] = $req_tok->key; - $_SESSION['twitter_request_token_secret'] = $req_tok->key; + // Sock the request token away in the session temporarily + + $_SESSION['twitter_request_token'] = $req_tok->key; + $_SESSION['twitter_request_token_secret'] = $req_tok->key; + + $auth_link = $client->getAuthorizeLink($req_tok); + + } catch (TwitterOAuthClientException $e) { + $msg = sprintf('OAuth client cURL error - code: %1s, msg: %2s', + $e->getCode(), $e->getMessage()); + $this->serverError(_('Couldn\'t link your Twitter account.')); + } - $auth_link = $client->getAuthorizeLink($req_tok); common_redirect($auth_link); } else { - // Check to make sure Twitter sent us the same request token we sent + // Check to make sure Twitter returned the same request + // token we sent them if ($_SESSION['twitter_request_token'] != $this->oauth_token) { $this->serverError(_('Couldn\'t link your Twitter account.')); } - $client = new TwitterOAuthClient($_SESSION['twitter_request_token'], - $_SESSION['twitter_request_token_secret']); + try { - // Exchange the request token for an access token + $client = new TwitterOAuthClient($_SESSION['twitter_request_token'], + $_SESSION['twitter_request_token_secret']); - $atok = $client->getAccessToken(); + // Exchange the request token for an access token - // Save the access token and Twitter user info + $atok = $client->getAccessToken(); - $client = new TwitterOAuthClient($atok->key, $atok->secret); + // Save the access token and Twitter user info - $twitter_user = $client->verify_credentials(); + $client = new TwitterOAuthClient($atok->key, $atok->secret); + + $twitter_user = $client->verify_credentials(); + + } catch (OAuthClientException $e) { + $msg = sprintf('OAuth client cURL error - code: %1s, msg: %2s', + $e->getCode(), $e->getMessage()); + $this->serverError(_('Couldn\'t link your Twitter account.')); + } $user = common_current_user(); diff --git a/lib/mail.php b/lib/mail.php index 0050ad810..16c1b0f30 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -645,13 +645,14 @@ function mail_twitter_bridge_removed($user) $subject = sprintf(_('Your Twitter bridge has been disabled.')); - $body = sprintf(_("Hi, %1\$s. We're sorry to inform you that your " . - 'link to Twitter has been disabled. Your Twitter credentials ' . - 'have either changed (did you recently change your Twitter ' . - 'password?) or you have otherwise revoked our access to your ' . - "Twitter account.\n\n" . - 'You can re-enable your Twitter bridge by visiting your ' . - "Twitter settings page:\n\n\t%2\$s\n\n" . + $site_name = common_config('site', 'name'); + + $body = sprintf(_('Hi, %1$s. We\'re sorry to inform you that your ' . + 'link to Twitter has been disabled. We no longer seem to have ' . + 'permission to update your Twitter status. (Did you revoke ' . + '%3$s\'s access?)' . "\n\n" . + 'You can re-enable your Twitter bridge by visiting your ' . + "Twitter settings page:\n\n\t%2\$s\n\n" . "Regards,\n%3\$s\n"), $profile->getBestName(), common_local_url('twittersettings'), @@ -679,11 +680,11 @@ function mail_facebook_app_removed($user) $site_name = common_config('site', 'name'); $subject = sprintf( - _('Your %1\$s Facebook application access has been disabled.', + _('Your %1$s Facebook application access has been disabled.', $site_name)); $body = sprintf(_("Hi, %1\$s. We're sorry to inform you that we are " . - 'unable to update your Facebook status from %2\$s, and have disabled ' . + 'unable to update your Facebook status from %2$s, and have disabled ' . 'the Facebook application for your account. This may be because ' . 'you have removed the Facebook application\'s authorization, or ' . 'have deleted your Facebook account. You can re-enable the ' . diff --git a/lib/twitter.php b/lib/twitter.php index 47af32e61..2369ac267 100644 --- a/lib/twitter.php +++ b/lib/twitter.php @@ -360,104 +360,72 @@ function is_twitter_bound($notice, $flink) { function broadcast_twitter($notice) { - $flink = Foreign_link::getByUserID($notice->profile_id, TWITTER_SERVICE); if (is_twitter_bound($notice, $flink)) { - $fuser = $flink->getForeignUser(); - $twitter_user = $fuser->nickname; - $twitter_password = $flink->credentials; - $uri = 'http://www.twitter.com/statuses/update.json'; + $user = $flink->getUser(); // XXX: Hack to get around PHP cURL's use of @ being a a meta character $statustxt = preg_replace('/^@/', ' @', $notice->content); - $options = array( - CURLOPT_USERPWD => "$twitter_user:$twitter_password", - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => - array( - 'status' => $statustxt, - 'source' => common_config('integration', 'source') - ), - CURLOPT_RETURNTRANSFER => true, - CURLOPT_FAILONERROR => true, - CURLOPT_HEADER => false, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_USERAGENT => "Laconica", - CURLOPT_CONNECTTIMEOUT => 120, // XXX: How long should this be? - CURLOPT_TIMEOUT => 120, - - # Twitter is strict about accepting invalid "Expect" headers - CURLOPT_HTTPHEADER => array('Expect:') - ); - - $ch = curl_init($uri); - curl_setopt_array($ch, $options); - $data = curl_exec($ch); - $errmsg = curl_error($ch); - $errno = curl_errno($ch); + $client = new TwitterOAuthClient($flink->token, $flink->credentials); - if (!empty($errmsg)) { - common_debug("cURL error ($errno): $errmsg - " . - "trying to send notice for $twitter_user.", - __FILE__); + $status = null; - $user = $flink->getUser(); + try { + $status = $client->statuses_update($statustxt); + } catch (OAuthClientCurlException $e) { - if ($errmsg == 'The requested URL returned error: 401') { - common_debug(sprintf('User %s (user id: %s) ' . - 'has bad Twitter credentials!', - $user->nickname, $user->id)); + if ($e->getMessage() == 'The requested URL returned error: 401') { - // Bad credentials we need to delete the foreign_link - // to Twitter and inform the user. + $errmsg = sprintf('User %1$s (user id: %2$s) has an invalid ' . + 'Twitter OAuth access token.', + $user->nickname, $user->id); + common_log(LOG_WARNING, $errmsg); - remove_twitter_link($flink); + // Bad auth token! We need to delete the foreign_link + // to Twitter and inform the user. - return true; + remove_twitter_link($flink); + return true; - } else { + } else { - // Some other error happened, so we should try to - // send again later + // Some other error happened, so we should probably + // try to send again later. - return false; - } + $errmsg = sprintf('cURL error trying to send notice to Twitter ' . + 'for user %1$s (user id: %2$s) - ' . + 'code: %3$s message: $4$s.', + $user->nickname, $user->id, + $e->getCode(), $e->getMessage()); + common_log(LOG_WARNING, $errmsg); + return false; } + } - curl_close($ch); - - if (empty($data)) { - common_debug("No data returned by Twitter's " . - "API trying to send update for $twitter_user", - __FILE__); + if (empty($status)) { - // XXX: Not sure this represents a failure to send, but it - // probably does + // This could represent a failure posting, + // or the Twitter API might just be behaving flakey. - return false; + $errmsg = sprint('No data returned by Twitter API when ' . + 'trying to send update for %1$s (user id %2$s).', + $user->nickname, $user->id); + common_log(LOG_WARNING, $errmsg); - } else { - - // Twitter should return a status - $status = json_decode($data); + return false; + } - if (empty($status)) { - common_debug("Unexpected data returned by Twitter " . - " API trying to send update for $twitter_user", - __FILE__); + // Notice crossed the great divide - // XXX: Again, this could represent a failure posting - // or the Twitter API might just be behaving flakey. - // We're treating it as a failure to post. + $msg = sprintf('Twitter bridge posted notice %s to Twitter.', + $notice->id); + common_log(LOG_INFO, $msg); - return false; - } - } } return true; @@ -480,17 +448,20 @@ function remove_twitter_link($flink) // Notify the user that her Twitter bridge is down + if (isset($user->email)) { + $result = mail_twitter_bridge_removed($user); if (!$result) { $msg = 'Unable to send email to notify ' . - "$user->nickname (user id: $user->id) " . - 'that their Twitter bridge link was ' . + "$user->nickname (user id: $user->id) " . + 'that their Twitter bridge link was ' . 'removed!'; common_log(LOG_WARNING, $msg); } + } } diff --git a/lib/twitteroauthclient.php b/lib/twitteroauthclient.php index 616fbc213..63ffe1c7c 100644 --- a/lib/twitteroauthclient.php +++ b/lib/twitteroauthclient.php @@ -2,6 +2,8 @@ require_once('OAuth.php'); +class OAuthClientCurlException extends Exception { } + class TwitterOAuthClient { public static $requestTokenURL = 'https://twitter.com/oauth/request_token'; @@ -54,6 +56,16 @@ class TwitterOAuthClient return $twitter_user; } + function statuses_update($status, $in_reply_to_status_id = null) + { + $url = 'https://twitter.com/statuses/update.json'; + $params = array('status' => $status, + 'in_reply_to_status_id' => $in_reply_to_status_id); + $response = $this->oAuthPost($url, $params); + $status = json_decode($response); + return $status; + } + function oAuthGet($url) { $request = OAuthRequest::from_consumer_and_token($this->consumer, @@ -91,19 +103,26 @@ class TwitterOAuthClient // Twitter is strict about accepting invalid "Expect" headers CURLOPT_HTTPHEADER => array('Expect:') - ); + ); - if (isset($params)) { - $options[CURLOPT_POST] = true; - $options[CURLOPT_POSTFIELDS] = $params; - } + if (isset($params)) { + $options[CURLOPT_POST] = true; + $options[CURLOPT_POSTFIELDS] = $params; + } + + $ch = curl_init($url); + curl_setopt_array($ch, $options); + $response = curl_exec($ch); + + if ($response === false) { + $msg = curl_error($ch); + $code = curl_errno($ch); + throw new OAuthClientCurlException($msg, $code); + } - $ch = curl_init($url); - curl_setopt_array($ch, $options); - $response = curl_exec($ch); - curl_close($ch); + curl_close($ch); - return $response; + return $response; } } -- cgit v1.2.3-54-g00ecf From 1f9d1772c091e1f09cc741e3e21cfe5ba7fa3560 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 4 Aug 2009 00:02:07 +0000 Subject: Allow removal of Twitter account. Deleted dead code. --- actions/twittersettings.php | 344 +++++++------------------------------------- 1 file changed, 52 insertions(+), 292 deletions(-) diff --git a/actions/twittersettings.php b/actions/twittersettings.php index acc9fb935..7fffa0af0 100644 --- a/actions/twittersettings.php +++ b/actions/twittersettings.php @@ -34,8 +34,6 @@ if (!defined('LACONICA')) { require_once INSTALLDIR.'/lib/connectsettingsaction.php'; require_once INSTALLDIR.'/lib/twitter.php'; -define('SUBSCRIPTIONS', 80); - /** * Settings for Twitter integration * @@ -70,7 +68,7 @@ class TwittersettingsAction extends ConnectSettingsAction function getInstructions() { return _('Connect your Twitter account to share your updates ' . - 'with your Twitter friends and vice-versa.'); + 'with your Twitter friends and vice-versa.'); } /** @@ -104,179 +102,83 @@ class TwittersettingsAction extends ConnectSettingsAction $this->hidden('token', common_session_token()); + $this->elementStart('fieldset', array('id' => 'settings_twitter_account')); if (empty($fuser)) { - - $this->elementStart('fieldset', array('id' => 'settings_twitter_account')); $this->elementStart('ul', 'form_data'); $this->elementStart('li', array('id' => 'settings_twitter_login_button')); $this->element('a', array('href' => common_local_url('twitterauthorization')), - 'Connect my Twitter account'); - $this->elementEnd('li'); + 'Connect my Twitter account'); + $this->elementEnd('li'); $this->elementEnd('ul'); - $this->elementEnd('fieldset'); + $this->elementEnd('fieldset'); } else { + $this->element('legend', null, _('Twitter account')); + $this->elementStart('p', array('id' => 'form_confirmed')); + $this->element('a', array('href' => $fuser->uri), $fuser->nickname); + $this->elementEnd('p'); + $this->element('p', 'form_note', + _('Connected Twitter account')); - $this->elementStart('fieldset', - array('id' => 'settings_twitter_preferences')); - $this->element('legend', null, _('Preferences')); + $this->submit('remove', _('Remove')); + + $this->elementEnd('fieldset'); + $this->elementStart('fieldset', array('id' => 'settings_twitter_preferences')); + + $this->element('legend', null, _('Preferences')); $this->elementStart('ul', 'form_data'); $this->elementStart('li'); $this->checkbox('noticesend', - _('Automatically send my notices to Twitter.'), - ($flink) ? - ($flink->noticesync & FOREIGN_NOTICE_SEND) : - true); + _('Automatically send my notices to Twitter.'), + ($flink) ? + ($flink->noticesync & FOREIGN_NOTICE_SEND) : + true); $this->elementEnd('li'); $this->elementStart('li'); $this->checkbox('replysync', - _('Send local "@" replies to Twitter.'), - ($flink) ? - ($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : - true); + _('Send local "@" replies to Twitter.'), + ($flink) ? + ($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : + true); $this->elementEnd('li'); $this->elementStart('li'); $this->checkbox('friendsync', - _('Subscribe to my Twitter friends here.'), - ($flink) ? - ($flink->friendsync & FOREIGN_FRIEND_RECV) : - false); + _('Subscribe to my Twitter friends here.'), + ($flink) ? + ($flink->friendsync & FOREIGN_FRIEND_RECV) : + false); $this->elementEnd('li'); if (common_config('twitterbridge','enabled')) { - $this->elementStart('li'); - $this->checkbox('noticerecv', - _('Import my Friends Timeline.'), - ($flink) ? - ($flink->noticesync & FOREIGN_NOTICE_RECV) : - false); - $this->elementEnd('li'); - - // preserve setting even if bidrection bridge toggled off - - if ($flink && ($flink->noticesync & FOREIGN_NOTICE_RECV)) { - $this->hidden('noticerecv', true, 'noticerecv'); - } - } - - $this->elementEnd('ul'); - - if ($flink) { - $this->submit('save', _('Save')); - } else { - $this->submit('add', _('Add')); - } - - $this->elementEnd('fieldset'); - } - - $this->showTwitterSubscriptions(); - - $this->elementEnd('form'); - } - - /** - * Gets some of the user's Twitter friends - * - * Gets the number of Twitter friends that are on this - * instance of Laconica. - * - * @return array array of User objects - */ - - function subscribedTwitterUsers() - { - - $current_user = common_current_user(); - - $qry = 'SELECT "user".* ' . - 'FROM subscription ' . - 'JOIN "user" ON subscription.subscribed = "user".id ' . - 'JOIN foreign_link ON foreign_link.user_id = "user".id ' . - 'WHERE subscriber = %d ' . - 'ORDER BY "user".nickname'; - - $user = new User(); - - $user->query(sprintf($qry, $current_user->id)); - - $users = array(); - - while ($user->fetch()) { - - // Don't include the user's own self-subscription - if ($user->id != $current_user->id) { - $users[] = clone($user); - } - } - - return $users; - } - - /** - * Show user's Twitter friends - * - * Gets the number of Twitter friends that are on this - * instance of Laconica, and shows their mini-avatars. - * - * @return void - */ - - function showTwitterSubscriptions() - { - - $friends = $this->subscribedTwitterUsers(); - - $friends_count = count($friends); - - if ($friends_count > 0) { - $this->elementStart('div', array('id' => 'entity_subscriptions', - 'class' => 'section')); - $this->element('h2', null, _('Twitter Friends')); - $this->elementStart('ul', 'entities users xoxo'); - - for ($i = 0; $i < min($friends_count, SUBSCRIPTIONS); $i++) { + $this->elementStart('li'); + $this->checkbox('noticerecv', + _('Import my Friends Timeline.'), + ($flink) ? + ($flink->noticesync & FOREIGN_NOTICE_RECV) : + false); + $this->elementEnd('li'); - $other = Profile::staticGet($friends[$i]->id); + // preserve setting even if bidrection bridge toggled off - if (!$other) { - common_log_db_error($subs, 'SELECT', __FILE__); - continue; + if ($flink && ($flink->noticesync & FOREIGN_NOTICE_RECV)) { + $this->hidden('noticerecv', true, 'noticerecv'); } - - $this->elementStart('li', 'vcard'); - $this->elementStart('a', array('title' => ($other->fullname) ? - $other->fullname : - $other->nickname, - 'href' => $other->profileurl, - 'class' => 'url')); - - $avatar = $other->getAvatar(AVATAR_MINI_SIZE); - - $avatar_url = ($avatar) ? - $avatar->displayUrl() : - Avatar::defaultImage(AVATAR_MINI_SIZE); - - $this->element('img', array('src' => $avatar_url, - 'width' => AVATAR_MINI_SIZE, - 'height' => AVATAR_MINI_SIZE, - 'class' => 'avatar photo', - 'alt' => ($other->fullname) ? - $other->fullname : - $other->nickname)); - - $this->element('span', 'fn nickname', $other->nickname); - $this->elementEnd('a'); - $this->elementEnd('li'); - } $this->elementEnd('ul'); - $this->elementEnd('div'); + if ($flink) { + $this->submit('save', _('Save')); + } else { + $this->submit('add', _('Add')); + } + + $this->elementEnd('fieldset'); } + + $this->elementEnd('form'); } /** @@ -292,7 +194,6 @@ class TwittersettingsAction extends ConnectSettingsAction function handlePost() { - // CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { @@ -303,8 +204,6 @@ class TwittersettingsAction extends ConnectSettingsAction if ($this->arg('save')) { $this->savePreferences(); - } else if ($this->arg('add')) { - $this->addTwitterAccount(); } else if ($this->arg('remove')) { $this->removeTwitterAccount(); } else { @@ -312,82 +211,6 @@ class TwittersettingsAction extends ConnectSettingsAction } } - /** - * Associate a Twitter account with the user's account - * - * Validates post input; verifies it against Twitter; and if - * successful stores in the database. - * - * @return void - */ - - function addTwitterAccount() - { - $screen_name = $this->trimmed('twitter_username'); - $password = $this->trimmed('twitter_password'); - $noticesend = $this->boolean('noticesend'); - $noticerecv = $this->boolean('noticerecv'); - $replysync = $this->boolean('replysync'); - $friendsync = $this->boolean('friendsync'); - - if (!Validate::string($screen_name, - array('min_length' => 1, - 'max_length' => 15, - 'format' => VALIDATE_NUM.VALIDATE_ALPHA.'_'))) { - $this->showForm(_('Username must have only numbers, '. - 'upper- and lowercase letters, '. - 'and underscore (_). 15 chars max.')); - return; - } - - if (!$this->verifyCredentials($screen_name, $password)) { - $this->showForm(_('Could not verify your Twitter credentials!')); - return; - } - - $twit_user = twitter_user_info($screen_name, $password); - - if (!$twit_user) { - $this->showForm(sprintf(_('Unable to retrieve account information '. - 'For "%s" from Twitter.'), - $screen_name)); - return; - } - - if (!save_twitter_user($twit_user->id, $screen_name)) { - $this->showForm(_('Unable to save your Twitter settings!')); - return; - } - - $user = common_current_user(); - - $flink = new Foreign_link(); - - $flink->user_id = $user->id; - $flink->foreign_id = $twit_user->id; - $flink->service = TWITTER_SERVICE; - $flink->credentials = $password; - $flink->created = common_sql_now(); - - $flink->set_flags($noticesend, $noticerecv, $replysync, $friendsync); - - $flink_id = $flink->insert(); - - if (!$flink_id) { - common_log_db_error($flink, 'INSERT', __FILE__); - $this->showForm(_('Unable to save your Twitter settings!')); - return; - } - - if ($friendsync) { - save_twitter_friends($user, $twit_user->id, $screen_name, $password); - $flink->last_friendsync = common_sql_now(); - $flink->update(); - } - - $this->showForm(_('Twitter settings saved.'), true); - } - /** * Disassociate an existing Twitter account from this account * @@ -397,20 +220,11 @@ class TwittersettingsAction extends ConnectSettingsAction function removeTwitterAccount() { $user = common_current_user(); - - $flink = Foreign_link::getByUserID($user->id, 1); - - $flink_foreign_id = $this->arg('flink_foreign_id'); - - // Maybe an old tab open...? - if ($flink->foreign_id != $flink_foreign_id) { - $this->showForm(_('That is not your Twitter account.')); - return; - } + $flink = Foreign_link::getByUserID($user->id, TWITTER_SERVICE); $result = $flink->delete(); - if (!$result) { + if (empty($result)) { common_log_db_error($flink, 'DELETE', __FILE__); $this->serverError(_('Couldn\'t remove Twitter user.')); return; @@ -433,32 +247,16 @@ class TwittersettingsAction extends ConnectSettingsAction $replysync = $this->boolean('replysync'); $user = common_current_user(); + $flink = Foreign_link::getByUserID($user->id, TWITTER_SERVICE); - $flink = Foreign_link::getByUserID($user->id, 1); - - if (!$flink) { + if (empty($flink)) { common_log_db_error($flink, 'SELECT', __FILE__); $this->showForm(_('Couldn\'t save Twitter preferences.')); return; } - $twitter_id = $flink->foreign_id; - $password = $flink->credentials; - - $fuser = $flink->getForeignUser(); - - if (!$fuser) { - common_log_db_error($fuser, 'SELECT', __FILE__); - $this->showForm(_('Couldn\'t save Twitter preferences.')); - return; - } - - $screen_name = $fuser->nickname; - $original = clone($flink); - $flink->set_flags($noticesend, $noticerecv, $replysync, $friendsync); - $result = $flink->update($original); if ($result === false) { @@ -467,45 +265,7 @@ class TwittersettingsAction extends ConnectSettingsAction return; } - if ($friendsync) { - save_twitter_friends($user, $flink->foreign_id, $screen_name, $password); - } - $this->showForm(_('Twitter preferences saved.'), true); } - /** - * Verifies a username and password against Twitter's API - * - * @param string $screen_name Twitter user name - * @param string $password Twitter password - * - * @return boolean success flag - */ - - function verifyCredentials($screen_name, $password) - { - $uri = 'http://twitter.com/account/verify_credentials.json'; - - $data = get_twitter_data($uri, $screen_name, $password); - - if (!$data) { - return false; - } - - $user = json_decode($data); - - if (!$user) { - return false; - } - - $twitter_id = $user->id; - - if ($twitter_id) { - return $twitter_id; - } - - return false; - } - } -- cgit v1.2.3-54-g00ecf From f94ee5597d09dd46c0580ce043907ea960ace358 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 4 Aug 2009 00:46:18 +0000 Subject: Moved some stuff to a base class --- actions/twitterauthorization.php | 2 +- lib/oauthclient.php | 111 +++++++++++++++++++++++++++++++++++++++ lib/twitteroauthclient.php | 98 +++------------------------------- 3 files changed, 118 insertions(+), 93 deletions(-) create mode 100644 lib/oauthclient.php diff --git a/actions/twitterauthorization.php b/actions/twitterauthorization.php index 519427dac..2390034cd 100644 --- a/actions/twitterauthorization.php +++ b/actions/twitterauthorization.php @@ -80,7 +80,7 @@ class TwitterauthorizationAction extends Action $_SESSION['twitter_request_token_secret'] = $req_tok->key; $auth_link = $client->getAuthorizeLink($req_tok); - + } catch (TwitterOAuthClientException $e) { $msg = sprintf('OAuth client cURL error - code: %1s, msg: %2s', $e->getCode(), $e->getMessage()); diff --git a/lib/oauthclient.php b/lib/oauthclient.php new file mode 100644 index 000000000..11de991c8 --- /dev/null +++ b/lib/oauthclient.php @@ -0,0 +1,111 @@ +sha1_method = new OAuthSignatureMethod_HMAC_SHA1(); + $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret); + $this->token = null; + + if (isset($oauth_token) && isset($oauth_token_secret)) { + $this->token = new OAuthToken($oauth_token, $oauth_token_secret); + } + } + + function getRequestToken() + { + $response = $this->oAuthGet(TwitterOAuthClient::$requestTokenURL); + parse_str($response); + $token = new OAuthToken($oauth_token, $oauth_token_secret); + return $token; + } + + function getAuthorizeLink($request_token, $oauth_callback = null) + { + $url = TwitterOAuthClient::$authorizeURL . '?oauth_token=' . + $request_token->key; + + if (isset($oauth_callback)) { + $url .= '&oauth_callback=' . urlencode($oauth_callback); + } + + return $url; + } + + function getAccessToken() + { + $response = $this->oAuthPost(TwitterOAuthClient::$accessTokenURL); + parse_str($response); + $token = new OAuthToken($oauth_token, $oauth_token_secret); + return $token; + } + + function oAuthGet($url) + { + $request = OAuthRequest::from_consumer_and_token($this->consumer, + $this->token, 'GET', $url, null); + $request->sign_request($this->sha1_method, + $this->consumer, $this->token); + + return $this->httpRequest($request->to_url()); + } + + function oAuthPost($url, $params = null) + { + $request = OAuthRequest::from_consumer_and_token($this->consumer, + $this->token, 'POST', $url, $params); + $request->sign_request($this->sha1_method, + $this->consumer, $this->token); + + return $this->httpRequest($request->get_normalized_http_url(), + $request->to_postdata()); + } + + function httpRequest($url, $params = null) + { + $options = array( + CURLOPT_RETURNTRANSFER => true, + CURLOPT_FAILONERROR => true, + CURLOPT_HEADER => false, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_USERAGENT => 'Laconica', + CURLOPT_CONNECTTIMEOUT => 120, + CURLOPT_TIMEOUT => 120, + CURLOPT_HTTPAUTH => CURLAUTH_ANY, + CURLOPT_SSL_VERIFYPEER => false, + + // Twitter is strict about accepting invalid "Expect" headers + + CURLOPT_HTTPHEADER => array('Expect:') + ); + + if (isset($params)) { + $options[CURLOPT_POST] = true; + $options[CURLOPT_POSTFIELDS] = $params; + } + + $ch = curl_init($url); + curl_setopt_array($ch, $options); + $response = curl_exec($ch); + + if ($response === false) { + $msg = curl_error($ch); + $code = curl_errno($ch); + throw new OAuthClientCurlException($msg, $code); + } + + curl_close($ch); + + return $response; + } + +} diff --git a/lib/twitteroauthclient.php b/lib/twitteroauthclient.php index 63ffe1c7c..e1190f167 100644 --- a/lib/twitteroauthclient.php +++ b/lib/twitteroauthclient.php @@ -1,10 +1,6 @@ sha1_method = new OAuthSignatureMethod_HMAC_SHA1(); $consumer_key = common_config('twitter', 'consumer_key'); $consumer_secret = common_config('twitter', 'consumer_secret'); - $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret); - $this->token = null; - if (isset($oauth_token) && isset($oauth_token_secret)) { - $this->token = new OAuthToken($oauth_token, $oauth_token_secret); - } + parent::__construct($consumer_key, $consumer_secret, + $oauth_token, $oauth_token_secret); } - function getRequestToken() - { - $response = $this->oAuthGet(TwitterOAuthClient::$requestTokenURL); - parse_str($response); - $token = new OAuthToken($oauth_token, $oauth_token_secret); - return $token; - } - - function getAuthorizeLink($request_token) - { - // Not sure Twitter actually looks at oauth_callback - - return TwitterOAuthClient::$authorizeURL . - '?oauth_token=' . $request_token->key . '&oauth_callback=' . - urlencode(common_local_url('twitterauthorization')); - } + function getAuthorizeLink($request_token) { + return parent::getAuthorizeLink($request_token, + common_local_url('twitterauthorization')); - function getAccessToken() - { - $response = $this->oAuthPost(TwitterOAuthClient::$accessTokenURL); - parse_str($response); - $token = new OAuthToken($oauth_token, $oauth_token_secret); - return $token; } function verify_credentials() @@ -66,63 +39,4 @@ class TwitterOAuthClient return $status; } - function oAuthGet($url) - { - $request = OAuthRequest::from_consumer_and_token($this->consumer, - $this->token, 'GET', $url, null); - $request->sign_request($this->sha1_method, - $this->consumer, $this->token); - - return $this->httpRequest($request->to_url()); - } - - function oAuthPost($url, $params = null) - { - $request = OAuthRequest::from_consumer_and_token($this->consumer, - $this->token, 'POST', $url, $params); - $request->sign_request($this->sha1_method, - $this->consumer, $this->token); - - return $this->httpRequest($request->get_normalized_http_url(), - $request->to_postdata()); - } - - function httpRequest($url, $params = null) - { - $options = array( - CURLOPT_RETURNTRANSFER => true, - CURLOPT_FAILONERROR => true, - CURLOPT_HEADER => false, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_USERAGENT => 'Laconica', - CURLOPT_CONNECTTIMEOUT => 120, - CURLOPT_TIMEOUT => 120, - CURLOPT_HTTPAUTH => CURLAUTH_ANY, - CURLOPT_SSL_VERIFYPEER => false, - - // Twitter is strict about accepting invalid "Expect" headers - - CURLOPT_HTTPHEADER => array('Expect:') - ); - - if (isset($params)) { - $options[CURLOPT_POST] = true; - $options[CURLOPT_POSTFIELDS] = $params; - } - - $ch = curl_init($url); - curl_setopt_array($ch, $options); - $response = curl_exec($ch); - - if ($response === false) { - $msg = curl_error($ch); - $code = curl_errno($ch); - throw new OAuthClientCurlException($msg, $code); - } - - curl_close($ch); - - return $response; - } - } -- cgit v1.2.3-54-g00ecf From fe9fc152861a0131582c4aa512870d2d01bccb57 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 4 Aug 2009 02:21:18 +0000 Subject: Make TwitterStatusFetcher daemon work with OAuth --- lib/twitteroauthclient.php | 19 +++++++++++++++++++ scripts/twitterstatusfetcher.php | 32 +++++++++++++++----------------- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/lib/twitteroauthclient.php b/lib/twitteroauthclient.php index e1190f167..aabda8d6a 100644 --- a/lib/twitteroauthclient.php +++ b/lib/twitteroauthclient.php @@ -39,4 +39,23 @@ class TwitterOAuthClient extends OAuthClient return $status; } + function statuses_friends_timeline($since_id = null, $max_id = null, + $cnt = null, $page = null) { + + $url = 'http://twitter.com/statuses/friends_timeline.json'; + $params = array('since_id' => $since_id, + 'max_id' => $max_id, + 'count' => $cnt, + 'page' => $page); + $qry = http_build_query($params); + + if (!empty($qry)) { + $url .= "?$qry"; + } + + $response = $this->oAuthGet($url); + $statuses = json_decode($response); + return $statuses; + } + } diff --git a/scripts/twitterstatusfetcher.php b/scripts/twitterstatusfetcher.php index e1745cfc0..d9f035fa6 100755 --- a/scripts/twitterstatusfetcher.php +++ b/scripts/twitterstatusfetcher.php @@ -191,7 +191,7 @@ class TwitterStatusFetcher extends Daemon { $flink = new Foreign_link(); - $flink->service = 1; // Twitter + $flink->service = TWITTER_SERVICE; $flink->orderBy('last_noticesync'); @@ -241,35 +241,33 @@ class TwitterStatusFetcher extends Daemon function getTimeline($flink) { - if (empty($flink)) { + if (empty($flink)) { common_log(LOG_WARNING, "Can't retrieve Foreign_link for foreign ID $fid"); return; } - $fuser = $flink->getForeignUser(); - - if (empty($fuser)) { - common_log(LOG_WARNING, "Unmatched user for ID " . - $flink->user_id); - return; - } - if (defined('SCRIPT_DEBUG')) { common_debug('Trying to get timeline for Twitter user ' . - "$fuser->nickname ($flink->foreign_id)."); + $flink->foreign_id); } // XXX: Biggest remaining issue - How do we know at which status // to start importing? How many statuses? Right now I'm going // with the default last 20. - $url = 'http://twitter.com/statuses/friends_timeline.json'; + $client = new TwitterOAuthClient($flink->token, $flink->credentials); - $timeline_json = get_twitter_data($url, $fuser->nickname, - $flink->credentials); + $timeline = null; - $timeline = json_decode($timeline_json); + try { + $timeline = $client->statuses_friends_timeline(); + } catch (OAuthClientCurlException $e) { + common_log(LOG_WARNING, + 'OAuth client unable to get friends timeline for user ' . + $flink->user_id . ' - code: ' . + $e->getCode() . 'msg: ' . $e->getMessage()); + } if (empty($timeline)) { common_log(LOG_WARNING, "Empty timeline."); @@ -303,7 +301,7 @@ class TwitterStatusFetcher extends Daemon $id = $this->ensureProfile($status->user); $profile = Profile::staticGet($id); - if (!$profile) { + if (empty($profile)) { common_log(LOG_ERR, 'Problem saving notice. No associated Profile.'); return null; @@ -318,7 +316,7 @@ class TwitterStatusFetcher extends Daemon // check to see if we've already imported the status - if (!$notice) { + if (empty($notice)) { $notice = new Notice(); -- cgit v1.2.3-54-g00ecf From 0685b85d8dd7ab9629b0acbfbd7b4aae20c14103 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 4 Aug 2009 17:19:05 +0000 Subject: Use ssl for fetching frinds_timeline from Twitter since it requires auth and is a protected resource --- lib/twitteroauthclient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/twitteroauthclient.php b/lib/twitteroauthclient.php index aabda8d6a..c5f114fb0 100644 --- a/lib/twitteroauthclient.php +++ b/lib/twitteroauthclient.php @@ -42,7 +42,7 @@ class TwitterOAuthClient extends OAuthClient function statuses_friends_timeline($since_id = null, $max_id = null, $cnt = null, $page = null) { - $url = 'http://twitter.com/statuses/friends_timeline.json'; + $url = 'https://twitter.com/statuses/friends_timeline.json'; $params = array('since_id' => $since_id, 'max_id' => $max_id, 'count' => $cnt, -- cgit v1.2.3-54-g00ecf From 5576917662b47ef27bf7ba3e551411c3d3b5e26c Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 4 Aug 2009 17:20:28 +0000 Subject: Use empty() for checking whether DB_DataObject returned something --- scripts/twitterstatusfetcher.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/twitterstatusfetcher.php b/scripts/twitterstatusfetcher.php index d9f035fa6..dd139417c 100755 --- a/scripts/twitterstatusfetcher.php +++ b/scripts/twitterstatusfetcher.php @@ -356,7 +356,7 @@ class TwitterStatusFetcher extends Daemon $profileurl = 'http://twitter.com/' . $user->screen_name; $profile = Profile::staticGet('profileurl', $profileurl); - if ($profile) { + if (!empty($profile) { if (defined('SCRIPT_DEBUG')) { common_debug("Profile for $profile->nickname found."); } @@ -394,7 +394,7 @@ class TwitterStatusFetcher extends Daemon // check for remote profile $remote_pro = Remote_profile::staticGet('uri', $profileurl); - if (!$remote_pro) { + if (empty($remote_pro)) { $remote_pro = new Remote_profile(); -- cgit v1.2.3-54-g00ecf From cd71f9cc51f77b6b8e3b11c34cb7523f36339cea Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 5 Aug 2009 00:16:12 +0000 Subject: Better (hopefully) database connection management for child processes --- scripts/twitterstatusfetcher.php | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/scripts/twitterstatusfetcher.php b/scripts/twitterstatusfetcher.php index dd139417c..67f52a3cc 100755 --- a/scripts/twitterstatusfetcher.php +++ b/scripts/twitterstatusfetcher.php @@ -99,13 +99,6 @@ class TwitterStatusFetcher extends Daemon foreach ($flinks as $f) { - // We have to disconnect from the DB before forking so - // each sub-process will open its own connection and - // avoid stomping on the others - - $conn = &$f->getDatabaseConnection(); - $conn->disconnect(); - $pid = pcntl_fork(); if ($pid == -1) { @@ -125,7 +118,24 @@ class TwitterStatusFetcher extends Daemon } else { // Child + + // Each child ps needs its own DB connection + + // Note: DataObject::getDatabaseConnection() creates + // a new connection if there isn't one already + + global $_DB_DATAOBJECT; + $conn = &$f->getDatabaseConnection(); + $this->getTimeline($f); + + $conn->disconnect(); + + // XXX: Couldn't find a less brutal way to blow + // away a cached connection + + unset($_DB_DATAOBJECT['CONNECTIONS']); + exit(); } @@ -189,7 +199,10 @@ class TwitterStatusFetcher extends Daemon function refreshFlinks() { + global $_DB_DATAOBJECT; + $flink = new Foreign_link(); + $conn = &$flink->getDatabaseConnection(); $flink->service = TWITTER_SERVICE; @@ -215,6 +228,9 @@ class TwitterStatusFetcher extends Daemon $flink->free(); unset($flink); + $conn->disconnect(); + unset($_DB_DATAOBJECT['CONNECTIONS']); + return $flinks; } @@ -299,6 +315,7 @@ class TwitterStatusFetcher extends Daemon function saveStatus($status, $flink) { $id = $this->ensureProfile($status->user); + $profile = Profile::staticGet($id); if (empty($profile)) { @@ -356,7 +373,7 @@ class TwitterStatusFetcher extends Daemon $profileurl = 'http://twitter.com/' . $user->screen_name; $profile = Profile::staticGet('profileurl', $profileurl); - if (!empty($profile) { + if (!empty($profile)) { if (defined('SCRIPT_DEBUG')) { common_debug("Profile for $profile->nickname found."); } -- cgit v1.2.3-54-g00ecf From 83ff1cecd39e197e108ecdaba7139b59d22dbee0 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 5 Aug 2009 16:26:19 -0400 Subject: Use NICKNAME_FMT everywhere consistently --- actions/finishopenidlogin.php | 4 ++-- actions/profilesettings.php | 2 +- actions/updateprofile.php | 2 +- actions/userauthorization.php | 2 +- plugins/FBConnect/FBConnectAuth.php | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/actions/finishopenidlogin.php b/actions/finishopenidlogin.php index ff0b35218..ba1e933e3 100644 --- a/actions/finishopenidlogin.php +++ b/actions/finishopenidlogin.php @@ -217,7 +217,7 @@ class FinishopenidloginAction extends Action if (!Validate::string($nickname, array('min_length' => 1, 'max_length' => 64, - 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { + 'format' => NICKNAME_FMT))) { $this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.')); return; } @@ -389,7 +389,7 @@ class FinishopenidloginAction extends Action { if (!Validate::string($str, array('min_length' => 1, 'max_length' => 64, - 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { + 'format' => NICKNAME_FMT))) { return false; } if (!User::allowed_nickname($str)) { diff --git a/actions/profilesettings.php b/actions/profilesettings.php index fb847680b..d8fb2c9bb 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -189,7 +189,7 @@ class ProfilesettingsAction extends AccountSettingsAction // Some validation if (!Validate::string($nickname, array('min_length' => 1, 'max_length' => 64, - 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { + 'format' => NICKNAME_FMT))) { $this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.')); return; } else if (!User::allowed_nickname($nickname)) { diff --git a/actions/updateprofile.php b/actions/updateprofile.php index d8b62fb09..f6cb277aa 100644 --- a/actions/updateprofile.php +++ b/actions/updateprofile.php @@ -79,7 +79,7 @@ class UpdateprofileAction extends Action $nickname = $req->get_parameter('omb_listenee_nickname'); if ($nickname && !Validate::string($nickname, array('min_length' => 1, 'max_length' => 64, - 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { + 'format' => NICKNAME_FMT))) { $this->clientError(_('Nickname must have only lowercase letters and numbers and no spaces.')); return false; } diff --git a/actions/userauthorization.php b/actions/userauthorization.php index 8dc2c808d..00903ae01 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -481,7 +481,7 @@ class UserauthorizationAction extends Action $nickname = $_GET['omb_listenee_nickname']; if (!Validate::string($nickname, array('min_length' => 1, 'max_length' => 64, - 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { + 'format' => NICKNAME_FMT))) { throw new OAuthException('Nickname must have only letters and numbers and no spaces.'); } $profile = $_GET['omb_listenee_profile']; diff --git a/plugins/FBConnect/FBConnectAuth.php b/plugins/FBConnect/FBConnectAuth.php index 3cf9fefc1..a3e2cdadc 100644 --- a/plugins/FBConnect/FBConnectAuth.php +++ b/plugins/FBConnect/FBConnectAuth.php @@ -238,7 +238,7 @@ class FBConnectauthAction extends Action if (!Validate::string($nickname, array('min_length' => 1, 'max_length' => 64, - 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { + 'format' => NICKNAME_FMT))) { $this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.')); return; } @@ -418,7 +418,7 @@ class FBConnectauthAction extends Action { if (!Validate::string($str, array('min_length' => 1, 'max_length' => 64, - 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { + 'format' => NICKNAME_FMT))) { return false; } if (!User::allowed_nickname($str)) { -- cgit v1.2.3-54-g00ecf From d77982b9b47b8b17051000cfcf3db1a8945d6279 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 5 Aug 2009 17:09:19 -0400 Subject: added Infinite Scroll plugin --- plugins/InfiniteScroll/InfiniteScrollPlugin.php | 66 ++++++ plugins/InfiniteScroll/ajax-loader.gif | Bin 0 -> 10819 bytes plugins/InfiniteScroll/jquery.infinitescroll.js | 251 +++++++++++++++++++++ .../InfiniteScroll/jquery.infinitescroll.min.js | 8 + plugins/InfiniteScroll/readme.txt | 6 + 5 files changed, 331 insertions(+) create mode 100644 plugins/InfiniteScroll/InfiniteScrollPlugin.php create mode 100644 plugins/InfiniteScroll/ajax-loader.gif create mode 100644 plugins/InfiniteScroll/jquery.infinitescroll.js create mode 100644 plugins/InfiniteScroll/jquery.infinitescroll.min.js create mode 100644 plugins/InfiniteScroll/readme.txt diff --git a/plugins/InfiniteScroll/InfiniteScrollPlugin.php b/plugins/InfiniteScroll/InfiniteScrollPlugin.php new file mode 100644 index 000000000..6738dc760 --- /dev/null +++ b/plugins/InfiniteScroll/InfiniteScrollPlugin.php @@ -0,0 +1,66 @@ +. + * + * @category Plugin + * @package Laconica + * @author Craig Andrews + * @copyright 2009 Craig Andrews http://candrews.integralblue.com + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +class InfiniteScrollPlugin extends Plugin +{ + function __construct() + { + parent::__construct(); + } + + function onEndShowScripts($action) + { + $action->element('script', + array('type' => 'text/javascript', + 'src' => common_path('plugins/InfiniteScroll/jquery.infinitescroll.min.js')), + ''); + + $loading_image = common_path('plugins/InfiniteScroll/ajax-loader.gif'); + $js_string = << +jQuery(document).ready(function($){ + $('notices_primary').infinitescroll({ + nextSelector : "li.nav_next a", + loadingImg : "$loading_image", + text : "Loading the next set of posts...", + donetext : "Congratulations, you\'ve reached the end of the Internet.", + navSelector : "div.pagination", + contentSelector : "#notices_primary", + itemSelector : "ol.notices" + }); +}); + +EOT; + $action->raw($js_string); + } +} diff --git a/plugins/InfiniteScroll/ajax-loader.gif b/plugins/InfiniteScroll/ajax-loader.gif new file mode 100644 index 000000000..a576ecd5e Binary files /dev/null and b/plugins/InfiniteScroll/ajax-loader.gif differ diff --git a/plugins/InfiniteScroll/jquery.infinitescroll.js b/plugins/InfiniteScroll/jquery.infinitescroll.js new file mode 100644 index 000000000..670686b0e --- /dev/null +++ b/plugins/InfiniteScroll/jquery.infinitescroll.js @@ -0,0 +1,251 @@ + +/*! +// Infinite Scroll jQuery plugin +// copyright Paul Irish, licensed GPL & MIT +// version 1.2.090804 + +// home and docs: http://www.infinite-scroll.com +*/ + +// todo: add preloading option. + +;(function($){ + + $.fn.infinitescroll = function(options,callback){ + + // console log wrapper. + function debug(){ + if (opts.debug) { window.console && console.log.call(console,arguments)} + } + + // grab each selector option and see if any fail. + function areSelectorsValid(opts){ + for (var key in opts){ + if (key.indexOf && key.indexOf('Selector') && $(opts[key]).length === 0){ + debug('Your ' + key + ' found no elements.'); + return false; + } + return true; + } + } + + + // find the number to increment in the path. + function determinePath(path){ + + path.match(relurl) ? path.match(relurl)[2] : path; + + // there is a 2 in the url surrounded by slashes, e.g. /page/2/ + if ( path.match(/^(.*?)\b2\b(.*?$)/) ){ + path = path.match(/^(.*?)\b2\b(.*?$)/).slice(1); + } else + // if there is any 2 in the url at all. + if (path.match(/^(.*?)2(.*?$)/)){ + debug('Trying backup next selector parse technique. Treacherous waters here, matey.'); + path = path.match(/^(.*?)2(.*?$)/).slice(1); + } else { + debug('Sorry, we couldn\'t parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.'); + props.isInvalidPage = true; //prevent it from running on this page. + } + + return path; + } + + + // 'document' means the full document usually, but sometimes the content of the overflow'd div in local mode + function getDocumentHeight(){ + // weird doubletouch of scrollheight because http://soulpass.com/2006/07/24/ie-and-scrollheight/ + return opts.localMode ? ($(props.container)[0].scrollHeight && $(props.container)[0].scrollHeight) + // needs to be document's height. (not props.container's) html's height is wrong in IE. + : $(document).height() + } + + + + function isNearBottom(opts,props){ + + // distance remaining in the scroll + // computed as: document height - distance already scroll - viewport height - buffer + var pixelsFromWindowBottomToBottom = getDocumentHeight() - + (opts.localMode ? $(props.container).scrollTop() : + // have to do this bs because safari doesnt report a scrollTop on the html element + ($(props.container).scrollTop() || $(props.container.ownerDocument.body).scrollTop())) - + $(opts.localMode ? props.container : window).height(); + + debug('math:',pixelsFromWindowBottomToBottom, props.pixelsFromNavToBottom); + + // if distance remaining in the scroll (including buffer) is less than the orignal nav to bottom.... + return (pixelsFromWindowBottomToBottom - opts.bufferPx < props.pixelsFromNavToBottom); + } + + function showDoneMsg(){ + props.loadingMsg + .find('img').hide() + .parent() + .find('div').html(opts.donetext).animate({opacity: 1},2000).fadeOut('normal'); + + // user provided callback when done + opts.errorCallback(); + } + + function infscrSetup(path,opts,props,callback){ + + if (props.isDuringAjax || props.isInvalidPage || props.isDone) return; + + if ( !isNearBottom(opts,props) ) return; + + // we dont want to fire the ajax multiple times + props.isDuringAjax = true; + + // show the loading message and hide the previous/next links + props.loadingMsg.appendTo( opts.contentSelector ).show(); + $( opts.navSelector ).hide(); + + // increment the URL bit. e.g. /page/3/ + props.currPage++; + + debug('heading into ajax',path); + + // if we're dealing with a table we can't use DIVs + var box = $(opts.contentSelector).is('table') ? $('') : $('
'); + + box + .attr('id','infscr-page-'+props.currPage) + .addClass('infscr-pages') + .appendTo( opts.contentSelector ) + .load( path.join( props.currPage ) + ' ' + opts.itemSelector,null,function(){ + + // if we've hit the last page... + if (props.isDone){ + showDoneMsg(); + return false; + + } else { + + // if it didn't return anything + if (box.children().length == 0){ + // fake an ajaxError so we can quit. + $.event.trigger( "ajaxError", [{status:404}] ); + } + + // fadeout currently makes the 'd text ugly in IE6 + props.loadingMsg.fadeOut('normal' ); + + // smooth scroll to ease in the new content + if (opts.animate){ + var scrollTo = $(window).scrollTop() + $('#infscr-loading').height() + opts.extraScrollPx + 'px'; + $('html,body').animate({scrollTop: scrollTo}, 800,function(){ props.isDuringAjax = false; }); + } + + // pass in the new DOM element as context for the callback + callback.call( box[0] ); + + if (!opts.animate) props.isDuringAjax = false; // once the call is done, we can allow it again. + } + }); // end of load() + + + } // end of infscrSetup() + + + + + // lets get started. + + var opts = $.extend({}, $.infinitescroll.defaults, options); + var props = $.infinitescroll; // shorthand + callback = callback || function(){}; + + if (!areSelectorsValid(opts)){ return false; } + + // we doing this on an overflow:auto div? + props.container = opts.localMode ? this : document.documentElement; + + // contentSelector we'll use for our .load() + opts.contentSelector = opts.contentSelector || this; + + + // get the relative URL - everything past the domain name. + var relurl = /(.*?\/\/).*?(\/.*)/; + var path = $(opts.nextSelector).attr('href'); + + + if (!path) { debug('Navigation selector not found'); return; } + + // set the path to be a relative URL from root. + path = determinePath(path); + + + // reset scrollTop in case of page refresh: + if (opts.localMode) $(props.container)[0].scrollTop = 0; + + // distance from nav links to bottom + // computed as: height of the document + top offset of container - top offset of nav link + props.pixelsFromNavToBottom = getDocumentHeight() + + $(props.container).offset().top - + $(opts.navSelector).offset().top; + + // define loading msg + props.loadingMsg = $('
Loading...
'+opts.loadingText+'
'); + // preload the image + (new Image()).src = opts.loadingImg; + + + + // set up our bindings + $(document).ajaxError(function(e,xhr,opt){ + debug('Page not found. Self-destructing...'); + + // die if we're out of pages. + if (xhr.status == 404){ + showDoneMsg(); + props.isDone = true; + $(opts.localMode ? this : window).unbind('scroll.infscr'); + } + }); + + // bind scroll handler to element (if its a local scroll) or window + $(opts.localMode ? this : window) + .bind('scroll.infscr', function(){ infscrSetup(path,opts,props,callback); } ) + .trigger('scroll.infscr'); // trigger the event, in case it's a short page + + + return this; + + } // end of $.fn.infinitescroll() + + + + // options and read-only properties object + + $.infinitescroll = { + defaults : { + debug : false, + preload : false, + nextSelector : "div.navigation a:first", + loadingImg : "http://www.infinite-scroll.com/loading.gif", + loadingText : "Loading the next set of posts...", + donetext : "Congratulations, you've reached the end of the internet.", + navSelector : "div.navigation", + contentSelector : null, // not really a selector. :) it's whatever the method was called on.. + extraScrollPx : 150, + itemSelector : "div.post", + animate : false, + localMode : false, + bufferPx : 40, + errorCallback : function(){} + }, + loadingImg : undefined, + loadingMsg : undefined, + container : undefined, + currPage : 1, + currDOMChunk : null, // defined in setup()'s load() + isDuringAjax : false, + isInvalidPage : false, + isDone : false // for when it goes all the way through the archive. + }; + + + +})(jQuery); diff --git a/plugins/InfiniteScroll/jquery.infinitescroll.min.js b/plugins/InfiniteScroll/jquery.infinitescroll.min.js new file mode 100644 index 000000000..04c75c456 --- /dev/null +++ b/plugins/InfiniteScroll/jquery.infinitescroll.min.js @@ -0,0 +1,8 @@ +/* +// Infinite Scroll jQuery plugin +// copyright Paul Irish, licensed GPL & MIT +// version 1.2.090804 + +// home and docs: http://www.infinite-scroll.com +*/ +(function(A){A.fn.infinitescroll=function(N,L){function E(){if(B.debug){window.console&&console.log.call(console,arguments)}}function G(P){for(var O in P){if(O.indexOf&&O.indexOf("Selector")&&A(P[O]).length===0){E("Your "+O+" found no elements.");return false}return true}}function K(O){O.match(C)?O.match(C)[2]:O;if(O.match(/^(.*?)\b2\b(.*?$)/)){O=O.match(/^(.*?)\b2\b(.*?$)/).slice(1)}else{if(O.match(/^(.*?)2(.*?$)/)){E("Trying backup next selector parse technique. Treacherous waters here, matey.");O=O.match(/^(.*?)2(.*?$)/).slice(1)}else{E("Sorry, we couldn't parse your Next (Previous Posts) URL. Verify your the css selector points to the correct A tag. If you still get this error: yell, scream, and kindly ask for help at infinite-scroll.com.");H.isInvalidPage=true}}return O}function I(){return B.localMode?(A(H.container)[0].scrollHeight&&A(H.container)[0].scrollHeight):A(document).height()}function F(Q,P){var O=I()-(Q.localMode?A(P.container).scrollTop():(A(P.container).scrollTop()||A(P.container.ownerDocument.body).scrollTop()))-A(Q.localMode?P.container:window).height();E("math:",O,P.pixelsFromNavToBottom);return(O-Q.bufferPx"):A("
");P.attr("id","infscr-page-"+O.currPage).addClass("infscr-pages").appendTo(Q.contentSelector).load(R.join(O.currPage)+" "+Q.itemSelector,null,function(){if(O.isDone){J();return false}else{if(P.children().length==0){A.event.trigger("ajaxError",[{status:404}])}O.loadingMsg.fadeOut("normal");if(Q.animate){var T=A(window).scrollTop()+A("#infscr-loading").height()+Q.extraScrollPx+"px";A("html,body").animate({scrollTop:T},800,function(){O.isDuringAjax=false})}S.call(P[0]);if(!Q.animate){O.isDuringAjax=false}}})}var B=A.extend({},A.infinitescroll.defaults,N);var H=A.infinitescroll;L=L||function(){};if(!G(B)){return false}H.container=B.localMode?this:document.documentElement;B.contentSelector=B.contentSelector||this;var C=/(.*?\/\/).*?(\/.*)/;var M=A(B.nextSelector).attr("href");if(!M){E("Navigation selector not found");return }M=K(M);if(B.localMode){A(H.container)[0].scrollTop=0}H.pixelsFromNavToBottom=I()+A(H.container).offset().top-A(B.navSelector).offset().top;H.loadingMsg=A('
Loading...
'+B.loadingText+"
");(new Image()).src=B.loadingImg;A(document).ajaxError(function(P,Q,O){E("Page not found. Self-destructing...");if(Q.status==404){J();H.isDone=true;A(B.localMode?this:window).unbind("scroll.infscr")}});A(B.localMode?this:window).bind("scroll.infscr",function(){D(M,B,H,L)}).trigger("scroll.infscr");return this};A.infinitescroll={defaults:{debug:false,preload:false,nextSelector:"div.navigation a:first",loadingImg:"http://www.infinite-scroll.com/loading.gif",loadingText:"Loading the next set of posts...",donetext:"Congratulations, you've reached the end of the internet.",navSelector:"div.navigation",contentSelector:null,extraScrollPx:150,itemSelector:"div.post",animate:false,localMode:false,bufferPx:40,errorCallback:function(){}},loadingImg:undefined,loadingMsg:undefined,container:undefined,currPage:1,currDOMChunk:null,isDuringAjax:false,isInvalidPage:false,isDone:false}})(jQuery); \ No newline at end of file diff --git a/plugins/InfiniteScroll/readme.txt b/plugins/InfiniteScroll/readme.txt new file mode 100644 index 000000000..3ce3b7fd2 --- /dev/null +++ b/plugins/InfiniteScroll/readme.txt @@ -0,0 +1,6 @@ +Infinite Scroll adds the following functionality to your Laconica installation: When a user scrolls towards the bottom of the page, the next page of notices is automatically retrieved and appended. This means they never need to click "Next Page", which dramatically increases stickiness. + +Installation +============ +Add "addPlugin('InfiniteScroll');" to the bottom of your config.php +That's it! -- cgit v1.2.3-54-g00ecf From 95ba22c5d7ffb28fa5c44a398edca86cc0f637f5 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 5 Aug 2009 18:27:27 -0400 Subject: Switch DOCTYPE's to the XHTML 5 DOCTYPE --- install.php | 4 +--- lib/htmloutputter.php | 4 +--- plugins/FBConnect/FBC_XDReceiver.php | 4 +--- plugins/FBConnect/FBConnectPlugin.php | 4 +--- plugins/recaptcha/recaptcha.php | 4 +--- tpl/index.php | 6 ++---- 6 files changed, 7 insertions(+), 19 deletions(-) diff --git a/install.php b/install.php index 227f99789..ea2135651 100644 --- a/install.php +++ b/install.php @@ -383,9 +383,7 @@ function runDbScript($filename, $conn, $type='mysql') ?> xml version="1.0" encoding="UTF-8" "; ?> - + Install Laconica diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 06603ac05..cba8a5f5e 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -110,9 +110,7 @@ class HTMLOutputter extends XMLOutputter $this->extraHeaders(); - $this->startXML('html', - '-//W3C//DTD XHTML 1.0 Strict//EN', - 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); + $this->startXML('html'); $language = $this->getLanguage(); diff --git a/plugins/FBConnect/FBC_XDReceiver.php b/plugins/FBConnect/FBC_XDReceiver.php index 57c98b4f1..d9677fca7 100644 --- a/plugins/FBConnect/FBC_XDReceiver.php +++ b/plugins/FBConnect/FBC_XDReceiver.php @@ -47,9 +47,7 @@ class FBC_XDReceiverAction extends Action header('Expires:'); header('Pragma:'); - $this->startXML('html', - '-//W3C//DTD XHTML 1.0 Strict//EN', - 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); + $this->startXML('html'); $language = $this->getLanguage(); diff --git a/plugins/FBConnect/FBConnectPlugin.php b/plugins/FBConnect/FBConnectPlugin.php index 6788793b2..2fb10a675 100644 --- a/plugins/FBConnect/FBConnectPlugin.php +++ b/plugins/FBConnect/FBConnectPlugin.php @@ -82,9 +82,7 @@ class FBConnectPlugin extends Plugin $action->extraHeaders(); - $action->startXML('html', - '-//W3C//DTD XHTML 1.0 Strict//EN', - 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); + $action->startXML('html'); $language = $action->getLanguage(); diff --git a/plugins/recaptcha/recaptcha.php b/plugins/recaptcha/recaptcha.php index 5ef8352d1..38a860fc7 100644 --- a/plugins/recaptcha/recaptcha.php +++ b/plugins/recaptcha/recaptcha.php @@ -65,9 +65,7 @@ class recaptcha extends Plugin $action->extraHeaders(); - $action->startXML('html', - '-//W3C//DTD XHTML 1.0 Strict//EN', - 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); + $action->startXML('html'); $action->raw(''); return false; diff --git a/tpl/index.php b/tpl/index.php index 5f1ed8439..be375e75a 100644 --- a/tpl/index.php +++ b/tpl/index.php @@ -1,6 +1,4 @@ - + <?php echo section('title'); ?> @@ -44,4 +42,4 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- \ No newline at end of file + -- cgit v1.2.3-54-g00ecf From b975a6a0e5a5a7332eea4834494029c5c1238540 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 5 Aug 2009 18:55:47 -0400 Subject: Don't start HTML responses with extraHeaders(); - - $this->startXML('html'); + if( ! substr($type,0,strlen('text/html'))=='text/html' ){ + // Browsers don't like it when xw->startDocument('1.0', 'UTF-8'); + } + if ($doc) { + $this->xw->writeDTD('html', $public, $system); + } $language = $this->getLanguage(); -- cgit v1.2.3-54-g00ecf From feac024348e0584c84fd5392c503d912000d30bc Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 5 Aug 2009 19:24:34 -0400 Subject: Accidentally caused the DOCTYPE to never be rendered - fix that. --- lib/htmloutputter.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 8f3b1a609..5da1fbe14 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -113,9 +113,7 @@ class HTMLOutputter extends XMLOutputter // Browsers don't like it when xw->startDocument('1.0', 'UTF-8'); } - if ($doc) { - $this->xw->writeDTD('html', $public, $system); - } + $this->xw->writeDTD('html', $public, $system); $language = $this->getLanguage(); -- cgit v1.2.3-54-g00ecf From 6a76addbe8bbfafd1a1dd6ed7ffbf8afebff5abe Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 5 Aug 2009 19:35:42 -0400 Subject: Added cssLink() and script() functions to htmloutputter --- lib/htmloutputter.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 5da1fbe14..0b4c1405a 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -339,6 +339,42 @@ class HTMLOutputter extends XMLOutputter 'title' => $title)); } + /** + * output a script (almost always javascript) tag + * + * @param string $src relative or absolute script path + * @param string $type 'type' attribute value of the tag + * + * @return void + */ + function script($src, $type='text/javascript') + { + $this->element('script', array('type' => $type, + 'src' => common_path($src) . '?version=' . LACONICA_VERSION), + ' '); + } + + /** + * output a css link + * + * @param string $relative relative path within the theme directory + * @param string $theme 'theme' that contains the stylesheet + * @param string media 'media' attribute of the tag + * + * @return void + */ + function cssLink($relative,$theme,$media) + { + if (!$theme) { + $theme = common_config('site', 'theme'); + } + + $this->element('link', array('rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => theme_path($relative, $theme) . '?version=' . LACONICA_VERSION, + 'media' => $media)); + } + /** * output an HTML textarea and associated elements * -- cgit v1.2.3-54-g00ecf From 304db1d30b4ad96f8a2ca500d224bb1609588fed Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 5 Aug 2009 19:45:12 -0400 Subject: Use script() and cssLink() methods everywhere instead of manually writing out javascript and css each time --- actions/avatarsettings.php | 17 +++-------------- actions/grouplogo.php | 17 +++-------------- lib/action.php | 39 +++++++++------------------------------ lib/designsettings.php | 17 +++-------------- lib/facebookaction.php | 27 +++------------------------ 5 files changed, 21 insertions(+), 96 deletions(-) diff --git a/actions/avatarsettings.php b/actions/avatarsettings.php index c2bb35a39..38e3103f4 100644 --- a/actions/avatarsettings.php +++ b/actions/avatarsettings.php @@ -382,13 +382,7 @@ class AvatarsettingsAction extends AccountSettingsAction function showStylesheets() { parent::showStylesheets(); - $jcropStyle = - common_path('theme/base/css/jquery.Jcrop.css?version='.LACONICA_VERSION); - - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => $jcropStyle, - 'media' => 'screen, projection, tv')); + $this->cssLink('css/jquery.Jcrop.css','base','screen, projection, tv'); } /** @@ -402,13 +396,8 @@ class AvatarsettingsAction extends AccountSettingsAction parent::showScripts(); if ($this->mode == 'crop') { - $jcropPack = common_path('js/jcrop/jquery.Jcrop.pack.js'); - $jcropGo = common_path('js/jcrop/jquery.Jcrop.go.js'); - - $this->element('script', array('type' => 'text/javascript', - 'src' => $jcropPack)); - $this->element('script', array('type' => 'text/javascript', - 'src' => $jcropGo)); + $this->script('js/jcrop/jquery.Jcrop.pack.js'); + $this->script('js/jcrop/jquery.Jcrop.go.js'); } } } diff --git a/actions/grouplogo.php b/actions/grouplogo.php index 8f6158dac..5edb10cf8 100644 --- a/actions/grouplogo.php +++ b/actions/grouplogo.php @@ -428,13 +428,7 @@ class GrouplogoAction extends GroupDesignAction function showStylesheets() { parent::showStylesheets(); - $jcropStyle = - common_path('theme/base/css/jquery.Jcrop.css?version='.LACONICA_VERSION); - - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => $jcropStyle, - 'media' => 'screen, projection, tv')); + $this->cssLink('css/jquery.Jcrop.css','base','screen, projection, tv'); } /** @@ -448,13 +442,8 @@ class GrouplogoAction extends GroupDesignAction parent::showScripts(); if ($this->mode == 'crop') { - $jcropPack = common_path('js/jcrop/jquery.Jcrop.pack.js'); - $jcropGo = common_path('js/jcrop/jquery.Jcrop.go.js'); - - $this->element('script', array('type' => 'text/javascript', - 'src' => $jcropPack)); - $this->element('script', array('type' => 'text/javascript', - 'src' => $jcropGo)); + $this->script('js/jcrop/jquery.Jcrop.pack.js'); + $this->script('js/jcrop/jquery.Jcrop.go.js'); } } diff --git a/lib/action.php b/lib/action.php index a5244371a..1c6170693 100644 --- a/lib/action.php +++ b/lib/action.php @@ -193,21 +193,12 @@ class Action extends HTMLOutputter // lawsuit if (Event::handle('StartShowStyles', array($this))) { if (Event::handle('StartShowLaconicaStyles', array($this))) { - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => theme_path('css/display.css', null) . '?version=' . LACONICA_VERSION, - 'media' => 'screen, projection, tv')); + $this->cssLink('css/display.css',null,'screen, projection, tv'); if (common_config('site', 'mobile')) { - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => theme_path('css/mobile.css', 'base') . '?version=' . LACONICA_VERSION, - // TODO: "handheld" CSS for other mobile devices - 'media' => 'only screen and (max-device-width: 480px)')); // Mobile WebKit + // TODO: "handheld" CSS for other mobile devices + $this->cssLink('css/mobile.css','base','only screen and (max-device-width: 480px)'); // Mobile WebKit } - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => theme_path('css/print.css', 'base') . '?version=' . LACONICA_VERSION, - 'media' => 'print')); + $this->cssLink('css/print.css','base','print'); Event::handle('EndShowLaconicaStyles', array($this)); } @@ -253,26 +244,14 @@ class Action extends HTMLOutputter // lawsuit { if (Event::handle('StartShowScripts', array($this))) { if (Event::handle('StartShowJQueryScripts', array($this))) { - $this->element('script', array('type' => 'text/javascript', - 'src' => common_path('js/jquery.min.js')), - ' '); - $this->element('script', array('type' => 'text/javascript', - 'src' => common_path('js/jquery.form.js')), - ' '); - - $this->element('script', array('type' => 'text/javascript', - 'src' => common_path('js/jquery.joverlay.min.js')), - ' '); - + $this->script('js/jquery.min.js'); + $this->script('js/jquery.form.js'); + $this->script('js/jquery.joverlay.min.js'); Event::handle('EndShowJQueryScripts', array($this)); } if (Event::handle('StartShowLaconicaScripts', array($this))) { - $this->element('script', array('type' => 'text/javascript', - 'src' => common_path('js/xbImportNode.js')), - ' '); - $this->element('script', array('type' => 'text/javascript', - 'src' => common_path('js/util.js?version='.LACONICA_VERSION)), - ' '); + $this->script('js/xbImportNode.js'); + $this->script('js/util.js'); // Frame-busting code to avoid clickjacking attacks. $this->element('script', array('type' => 'text/javascript'), 'if (window.top !== window.self) { window.top.location.href = window.self.location.href; }'); diff --git a/lib/designsettings.php b/lib/designsettings.php index 1b0e62166..a48ec9d22 100644 --- a/lib/designsettings.php +++ b/lib/designsettings.php @@ -311,13 +311,7 @@ class DesignSettingsAction extends AccountSettingsAction function showStylesheets() { parent::showStylesheets(); - $farbtasticStyle = - common_path('theme/base/css/farbtastic.css?version='.LACONICA_VERSION); - - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => $farbtasticStyle, - 'media' => 'screen, projection, tv')); + $this->cssLink('css/farbtastic.css','base','screen, projection, tv'); } /** @@ -330,13 +324,8 @@ class DesignSettingsAction extends AccountSettingsAction { parent::showScripts(); - $farbtasticPack = common_path('js/farbtastic/farbtastic.js'); - $userDesignGo = common_path('js/userdesign.go.js'); - - $this->element('script', array('type' => 'text/javascript', - 'src' => $farbtasticPack)); - $this->element('script', array('type' => 'text/javascript', - 'src' => $userDesignGo)); + $this->script('js/farbtastic/farbtastic.js'); + $this->script('js/farbtastic/farbtastic.go.js'); } /** diff --git a/lib/facebookaction.php b/lib/facebookaction.php index 5be2f2fe6..ab11b613e 100644 --- a/lib/facebookaction.php +++ b/lib/facebookaction.php @@ -95,34 +95,13 @@ class FacebookAction extends Action function showStylesheets() { - // Add a timestamp to the file so Facebook cache wont ignore our changes - $ts = filemtime(INSTALLDIR.'/theme/base/css/display.css'); - - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => theme_path('css/display.css', 'base') . '?ts=' . $ts)); - - $theme = common_config('site', 'theme'); - - $ts = filemtime(INSTALLDIR. '/theme/' . $theme .'/css/display.css'); - - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => theme_path('css/display.css', null) . '?ts=' . $ts)); - - $ts = filemtime(INSTALLDIR.'/theme/base/css/facebookapp.css'); - - $this->element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => theme_path('css/facebookapp.css', 'base') . '?ts=' . $ts)); + $this->cssLink('css/display.css', 'base'); + $this->cssLink('css/facebookapp.css', 'base'); } function showScripts() { - // Add a timestamp to the file so Facebook cache wont ignore our changes - $ts = filemtime(INSTALLDIR.'/js/facebookapp.js'); - - $this->element('script', array('src' => common_path('js/facebookapp.js') . '?ts=' . $ts)); + $this->script('js/facebookapp.js'); } /** -- cgit v1.2.3-54-g00ecf From 9a9195ecd8eea36943dbb5e46adf685aef9edc4e Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 5 Aug 2009 19:54:46 -0400 Subject: Used script() function to write out the javascript link --- plugins/InfiniteScroll/InfiniteScrollPlugin.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/InfiniteScroll/InfiniteScrollPlugin.php b/plugins/InfiniteScroll/InfiniteScrollPlugin.php index 6738dc760..7e942550a 100644 --- a/plugins/InfiniteScroll/InfiniteScrollPlugin.php +++ b/plugins/InfiniteScroll/InfiniteScrollPlugin.php @@ -40,11 +40,7 @@ class InfiniteScrollPlugin extends Plugin function onEndShowScripts($action) { - $action->element('script', - array('type' => 'text/javascript', - 'src' => common_path('plugins/InfiniteScroll/jquery.infinitescroll.min.js')), - ''); - + $action->script('plugins/InfiniteScroll/jquery.infinitescroll.min.js'); $loading_image = common_path('plugins/InfiniteScroll/ajax-loader.gif'); $js_string = << -- cgit v1.2.3-54-g00ecf From 5ba33836654e7e09098880fe9e6e9d3593f23b40 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Wed, 5 Aug 2009 20:15:00 -0400 Subject: Use script() to write out javascript +EOT; + $action->raw($js_string); + $action->script('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.pack.js'); + $action->script('plugins/Autocomplete/Autocomplete.js'); + } + + function onEndShowLaconicaStyles($action) + { + $action->cssLink('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.css'); + } + +} +?> diff --git a/plugins/Autocomplete/jquery-autocomplete/changelog.txt b/plugins/Autocomplete/jquery-autocomplete/changelog.txt new file mode 100644 index 000000000..94cb5ccde --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/changelog.txt @@ -0,0 +1,20 @@ +1.0.2 +----- +* Fixed missing semicolon + +1.0.1 +----- +* Fixed element creation (
    to
      and
    • to
    • ) +* Fixed ac_even class (was ac_event) +* Fixed bgiframe usage: now its really optional +* Removed the blur-on-return workaround, added a less obtrusive one only for Opera +* Fixed hold cursor keys: Opera needs keypress, everyone else keydown to scroll through result list when holding cursor key +* Updated package to jQuery 1.2.5, removing dimensions +* Fixed multiple-mustMatch: Remove only the last term when no match is found +* Fixed multiple without mustMatch: Don't select the last active when no match is found (on tab/return) +* Fixed multiple cursor position: Put cursor at end of input after selecting a value + +1.0 +--- + +* First release. \ No newline at end of file diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/bg.gif b/plugins/Autocomplete/jquery-autocomplete/demo/bg.gif new file mode 100644 index 000000000..846add071 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/bg.gif differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/emails.php b/plugins/Autocomplete/jquery-autocomplete/demo/emails.php new file mode 100644 index 000000000..f79b10e4a --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/demo/emails.php @@ -0,0 +1,23 @@ +"peter@pan.de", + "Molly"=>"molly@yahoo.com", + "Forneria Marconi"=>"live@japan.jp", + "Master Sync"=>"205bw@samsung.com", + "Dr. Tech de Log"=>"g15@logitech.com", + "Don Corleone"=>"don@vegas.com", + "Mc Chick"=>"info@donalds.org", + "Donnie Darko"=>"dd@timeshift.info", + "Quake The Net"=>"webmaster@quakenet.org", + "Dr. Write"=>"write@writable.com" +); + +echo "["; +foreach ($items as $key=>$value) { + if (strpos(strtolower($key), $q) !== false) { + echo "{ name: \"$key\", to: \"$value\" }, "; + } +} +echo "]"; \ No newline at end of file diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/emails.phps b/plugins/Autocomplete/jquery-autocomplete/demo/emails.phps new file mode 100644 index 000000000..f79b10e4a --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/demo/emails.phps @@ -0,0 +1,23 @@ +"peter@pan.de", + "Molly"=>"molly@yahoo.com", + "Forneria Marconi"=>"live@japan.jp", + "Master Sync"=>"205bw@samsung.com", + "Dr. Tech de Log"=>"g15@logitech.com", + "Don Corleone"=>"don@vegas.com", + "Mc Chick"=>"info@donalds.org", + "Donnie Darko"=>"dd@timeshift.info", + "Quake The Net"=>"webmaster@quakenet.org", + "Dr. Write"=>"write@writable.com" +); + +echo "["; +foreach ($items as $key=>$value) { + if (strpos(strtolower($key), $q) !== false) { + echo "{ name: \"$key\", to: \"$value\" }, "; + } +} +echo "]"; \ No newline at end of file diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images.php b/plugins/Autocomplete/jquery-autocomplete/demo/images.php new file mode 100644 index 000000000..407645c06 --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/demo/images.php @@ -0,0 +1,9 @@ + diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Amsterdam Van-Gogh Museum.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Amsterdam Van-Gogh Museum.jpg new file mode 100644 index 000000000..025328c7d Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Amsterdam Van-Gogh Museum.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Amsterdam.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Amsterdam.jpg new file mode 100644 index 000000000..5f019bdfd Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Amsterdam.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Antwerpen Rubenshaus.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Antwerpen Rubenshaus.jpg new file mode 100644 index 000000000..7f5d01f71 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Antwerpen Rubenshaus.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Antwerpen.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Antwerpen.jpg new file mode 100644 index 000000000..46f74a3d1 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Antwerpen.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Appenzell.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Appenzell.jpg new file mode 100644 index 000000000..1691ed954 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Appenzell.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Arnhem Historisches Museum.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Arnhem Historisches Museum.jpg new file mode 100644 index 000000000..276f88a31 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Arnhem Historisches Museum.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Bled.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Bled.jpg new file mode 100644 index 000000000..bdcae3184 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Bled.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Bled_Die Burg von Bled.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Bled_Die Burg von Bled.jpg new file mode 100644 index 000000000..355108409 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Bled_Die Burg von Bled.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Bogojina_Die Pfarrkirche.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Bogojina_Die Pfarrkirche.jpg new file mode 100644 index 000000000..3e0cd5099 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Bogojina_Die Pfarrkirche.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/BolognaBasilicadiSanPetronio.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/BolognaBasilicadiSanPetronio.jpg new file mode 100644 index 000000000..ef2153593 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/BolognaBasilicadiSanPetronio.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/BolognaFontanadelNettuno.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/BolognaFontanadelNettuno.jpg new file mode 100644 index 000000000..0f5b576d5 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/BolognaFontanadelNettuno.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/BolognaPiazzaMaggiore.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/BolognaPiazzaMaggiore.jpg new file mode 100644 index 000000000..48449cf1e Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/BolognaPiazzaMaggiore.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Bolsward Martinikerk.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Bolsward Martinikerk.jpg new file mode 100644 index 000000000..6df035af4 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Bolsward Martinikerk.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Bolsward Stadhuis.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Bolsward Stadhuis.jpg new file mode 100644 index 000000000..7c141012d Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Bolsward Stadhuis.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Bolsward.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Bolsward.jpg new file mode 100644 index 000000000..84dd775af Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Bolsward.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/BordeauxND.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/BordeauxND.jpg new file mode 100644 index 000000000..242ecefc3 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/BordeauxND.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/BordeauxPlaceB.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/BordeauxPlaceB.jpg new file mode 100644 index 000000000..026b4014d Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/BordeauxPlaceB.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/BotanischerGartenZuerich.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/BotanischerGartenZuerich.jpg new file mode 100644 index 000000000..5ee9535ef Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/BotanischerGartenZuerich.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Bouillon.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Bouillon.jpg new file mode 100644 index 000000000..72638cfd8 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Bouillon.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Gent Hotel de Ville2.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Gent Hotel de Ville2.jpg new file mode 100644 index 000000000..9084f6f47 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Gent Hotel de Ville2.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Gent.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Gent.jpg new file mode 100644 index 000000000..ebbd6df49 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Gent.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/GenuaStrand.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/GenuaStrand.jpg new file mode 100644 index 000000000..d52af3c79 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/GenuaStrand.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/GenuabeiNacht.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/GenuabeiNacht.jpg new file mode 100644 index 000000000..f2a371036 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/GenuabeiNacht.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Giessbachfaelle Brienz.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Giessbachfaelle Brienz.jpg new file mode 100644 index 000000000..096319267 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Giessbachfaelle Brienz.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Giethoorn.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Giethoorn.jpg new file mode 100644 index 000000000..a6f7b0f4c Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Giethoorn.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Gnesen.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Gnesen.jpg new file mode 100644 index 000000000..e8825a846 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Gnesen.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Gornij Grad_KATHEDRALE.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Gornij Grad_KATHEDRALE.jpg new file mode 100644 index 000000000..47cce10d3 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Gornij Grad_KATHEDRALE.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Gossensass.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Gossensass.jpg new file mode 100644 index 000000000..6aba6d373 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Gossensass.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Grad_Burg Grad2.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Grad_Burg Grad2.jpg new file mode 100644 index 000000000..5bf35ad85 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Grad_Burg Grad2.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/GrandDixence.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/GrandDixence.jpg new file mode 100644 index 000000000..09464d7ce Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/GrandDixence.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/GrenoblePanorama.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/GrenoblePanorama.jpg new file mode 100644 index 000000000..d4d0d1bb3 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/GrenoblePanorama.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Groningen.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Groningen.jpg new file mode 100644 index 000000000..0068a86f3 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Groningen.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/GrottenvonReclere.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/GrottenvonReclere.jpg new file mode 100644 index 000000000..74d6b3d3f Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/GrottenvonReclere.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Guebwiller.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Guebwiller.jpg new file mode 100644 index 000000000..e31f924c4 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Guebwiller.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Kamnik_Die Franziskaner Bibliothek.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Kamnik_Die Franziskaner Bibliothek.jpg new file mode 100644 index 000000000..1de470593 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Kamnik_Die Franziskaner Bibliothek.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Karlsbad Muehlbrunnkolonnade.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Karlsbad Muehlbrunnkolonnade.jpg new file mode 100644 index 000000000..86caa2049 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Karlsbad Muehlbrunnkolonnade.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Kazimierz.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Kazimierz.jpg new file mode 100644 index 000000000..62c265074 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Kazimierz.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/KirchbergAltesRathaus1.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/KirchbergAltesRathaus1.jpg new file mode 100644 index 000000000..6f4d018c4 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/KirchbergAltesRathaus1.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/KlagenfurtDom.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/KlagenfurtDom.jpg new file mode 100644 index 000000000..ac9faad2f Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/KlagenfurtDom.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/KleineMeerjungfreu.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/KleineMeerjungfreu.jpg new file mode 100644 index 000000000..b5b13c193 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/KleineMeerjungfreu.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/LazienkiparkWarschau.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/LazienkiparkWarschau.jpg new file mode 100644 index 000000000..c0b114483 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/LazienkiparkWarschau.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/LeHavreHafen.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/LeHavreHafen.jpg new file mode 100644 index 000000000..9fc38d016 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/LeHavreHafen.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/LeMans.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/LeMans.jpg new file mode 100644 index 000000000..d919de7da Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/LeMans.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Lednice.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Lednice.jpg new file mode 100644 index 000000000..726248044 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Lednice.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Leeuwarden Fries Museum.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Leeuwarden Fries Museum.jpg new file mode 100644 index 000000000..6d93e3478 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Leeuwarden Fries Museum.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Leeuwarden.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Leeuwarden.jpg new file mode 100644 index 000000000..c0f78c0cf Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Leeuwarden.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Lelystad.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Lelystad.jpg new file mode 100644 index 000000000..be794f3cd Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Lelystad.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Lemmer.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Lemmer.jpg new file mode 100644 index 000000000..41d8996b2 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Lemmer.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Leper Halles aux draps.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Leper Halles aux draps.jpg new file mode 100644 index 000000000..cb3138d65 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Leper Halles aux draps.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Leuven Museum fuer Kirchenkunst.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Leuven Museum fuer Kirchenkunst.jpg new file mode 100644 index 000000000..235869079 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Leuven Museum fuer Kirchenkunst.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Leuven.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Leuven.jpg new file mode 100644 index 000000000..3e4d5f3b3 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Leuven.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Luxemburg.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Luxemburg.jpg new file mode 100644 index 000000000..3aaafc9cb Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Luxemburg.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/LuzernAltstadt.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/LuzernAltstadt.jpg new file mode 100644 index 000000000..47ebd5d1e Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/LuzernAltstadt.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/LuzernPicassoMuseum.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/LuzernPicassoMuseum.jpg new file mode 100644 index 000000000..08fbb5a0e Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/LuzernPicassoMuseum.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Lyon.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Lyon.jpg new file mode 100644 index 000000000..7a3eda9d0 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Lyon.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Maastricht Onze Lieve Vrou...jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Maastricht Onze Lieve Vrou...jpg new file mode 100644 index 000000000..1474bb092 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Maastricht Onze Lieve Vrou...jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Maastricht St Servaasbasiliek.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Maastricht St Servaasbasiliek.jpg new file mode 100644 index 000000000..c41e1aa17 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Maastricht St Servaasbasiliek.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Maastricht Walmuur.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Maastricht Walmuur.jpg new file mode 100644 index 000000000..75fb02750 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Maastricht Walmuur.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Maastricht.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Maastricht.jpg new file mode 100644 index 000000000..4dcb6d5d1 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Maastricht.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/MagiatalMaggia.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/MagiatalMaggia.jpg new file mode 100644 index 000000000..42ff384d9 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/MagiatalMaggia.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Mailand3.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Mailand3.jpg new file mode 100644 index 000000000..863e198f2 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Mailand3.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Metlika_Bela Krajina Museum.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Metlika_Bela Krajina Museum.jpg new file mode 100644 index 000000000..47d24d70b Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Metlika_Bela Krajina Museum.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/MilanoCastelloSforzesco.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/MilanoCastelloSforzesco.jpg new file mode 100644 index 000000000..b430de520 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/MilanoCastelloSforzesco.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/MilanoDom.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/MilanoDom.jpg new file mode 100644 index 000000000..0a5eef4a4 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/MilanoDom.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/MilazzoBurg.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/MilazzoBurg.jpg new file mode 100644 index 000000000..01226a323 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/MilazzoBurg.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Novo Mesto_Das Museum.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Novo Mesto_Das Museum.jpg new file mode 100644 index 000000000..452076124 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Novo Mesto_Das Museum.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/ObervellachBurgFalkenstein.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/ObervellachBurgFalkenstein.jpg new file mode 100644 index 000000000..d502ff483 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/ObervellachBurgFalkenstein.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/OdenseeAndersen.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/OdenseeAndersen.jpg new file mode 100644 index 000000000..f131b7608 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/OdenseeAndersen.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Olimje_Kirche und Apotheke in Olimje.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Olimje_Kirche und Apotheke in Olimje.jpg new file mode 100644 index 000000000..16ea33fb3 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Olimje_Kirche und Apotheke in Olimje.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Olomouc.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Olomouc.jpg new file mode 100644 index 000000000..d9a7641f3 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Olomouc.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/OlympischesMuseumLausanne.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/OlympischesMuseumLausanne.jpg new file mode 100644 index 000000000..37a267ae5 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/OlympischesMuseumLausanne.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/OrleansMaisonJeannedArc.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/OrleansMaisonJeannedArc.jpg new file mode 100644 index 000000000..220ad08fa Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/OrleansMaisonJeannedArc.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/OrleansParcFloraldelaSource.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/OrleansParcFloraldelaSource.jpg new file mode 100644 index 000000000..171e56de8 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/OrleansParcFloraldelaSource.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/OstiaAntica.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/OstiaAntica.jpg new file mode 100644 index 000000000..b505ec7fd Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/OstiaAntica.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Ostrow Tumski.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Ostrow Tumski.jpg new file mode 100644 index 000000000..91cae01be Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Ostrow Tumski.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/PoertschachSchlossLeonstain.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/PoertschachSchlossLeonstain.jpg new file mode 100644 index 000000000..9e958b7df Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/PoertschachSchlossLeonstain.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Portoroz.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Portoroz.jpg new file mode 100644 index 000000000..bbad5aa81 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Portoroz.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Posen.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Posen.jpg new file mode 100644 index 000000000..791c46f2a Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Posen.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Postojna.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Postojna.jpg new file mode 100644 index 000000000..ec2a6be8f Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Postojna.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Prag Altstaedter Ring.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Prag Altstaedter Ring.jpg new file mode 100644 index 000000000..9f13fd367 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Prag Altstaedter Ring.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Prag Waldsteinpalais.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Prag Waldsteinpalais.jpg new file mode 100644 index 000000000..718b4e8d9 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Prag Waldsteinpalais.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/RouenNotreDame.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/RouenNotreDame.jpg new file mode 100644 index 000000000..4e0845342 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/RouenNotreDame.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/Salzbergwerk Bex.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/Salzbergwerk Bex.jpg new file mode 100644 index 000000000..29bdfe029 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/Salzbergwerk Bex.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/SalzbergwerkWieliczka.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/SalzbergwerkWieliczka.jpg new file mode 100644 index 000000000..745b18501 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/SalzbergwerkWieliczka.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/SalzburgFestungHohensalzburg.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/SalzburgFestungHohensalzburg.jpg new file mode 100644 index 000000000..c3e9f7428 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/SalzburgFestungHohensalzburg.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/SalzburgResidenz.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/SalzburgResidenz.jpg new file mode 100644 index 000000000..eca7e6022 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/SalzburgResidenz.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/WienMuseumsQuartier.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/WienMuseumsQuartier.jpg new file mode 100644 index 000000000..4e2262cac Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/WienMuseumsQuartier.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/WienMusikverein.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/WienMusikverein.jpg new file mode 100644 index 000000000..477bafceb Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/WienMusikverein.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/WienRiesenrad.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/WienRiesenrad.jpg new file mode 100644 index 000000000..0013657e7 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/WienRiesenrad.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/images/WienRingstrasse.jpg b/plugins/Autocomplete/jquery-autocomplete/demo/images/WienRingstrasse.jpg new file mode 100644 index 000000000..9543af9b9 Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/images/WienRingstrasse.jpg differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/index.html b/plugins/Autocomplete/jquery-autocomplete/demo/index.html new file mode 100644 index 000000000..977483e04 --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/demo/index.html @@ -0,0 +1,272 @@ + + + + +jQuery Autocomplete Plugin + + + + + + + + + + + + + + + + +

      jQuery Autocomplete Plugin Demo

      + +
      + +
      +

      + + + + + + +

      +

      + + + + (Current month is excluded from list) +

      +

      + + + +

      +

      + + + +

      +

      + + +

      +

      + + + +

      +

      + + + +

      +

      + + + +

      +

      + + +

      +

      + + + +

      +

      + + + +

      +

      + + +

      + + +
      + +

      + Click here for an autocomplete inside a thickbox window. (this should work even if it is beyond the fold) +

      + + + + + + PHP script used to for remote autocomplete + +

      Result:

        + +
        + + + + diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/indicator.gif b/plugins/Autocomplete/jquery-autocomplete/demo/indicator.gif new file mode 100644 index 000000000..085ccaeca Binary files /dev/null and b/plugins/Autocomplete/jquery-autocomplete/demo/indicator.gif differ diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/json.html b/plugins/Autocomplete/jquery-autocomplete/demo/json.html new file mode 100644 index 000000000..9ed974faf --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/demo/json.html @@ -0,0 +1,68 @@ + + + + +jQuery Autocomplete Plugin + + + + + + + + + + + + + + + + +

        jQuery Autocomplete Plugin Demo

        + +
        + +
        +

        + + +

        + + +
        + + Server-side script creating the JSON data + +
        + + + + diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/localdata.js b/plugins/Autocomplete/jquery-autocomplete/demo/localdata.js new file mode 100644 index 000000000..6015f7c82 --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/demo/localdata.js @@ -0,0 +1,216 @@ +var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; +var emails = [ + { name: "Peter Pan", to: "peter@pan.de" }, + { name: "Molly", to: "molly@yahoo.com" }, + { name: "Forneria Marconi", to: "live@japan.jp" }, + { name: "Master Sync", to: "205bw@samsung.com" }, + { name: "Dr. Tech de Log", to: "g15@logitech.com" }, + { name: "Don Corleone", to: "don@vegas.com" }, + { name: "Mc Chick", to: "info@donalds.org" }, + { name: "Donnie Darko", to: "dd@timeshift.info" }, + { name: "Quake The Net", to: "webmaster@quakenet.org" }, + { name: "Dr. Write", to: "write@writable.com" } +]; +var cities = [ + "Aberdeen", "Ada", "Adamsville", "Addyston", "Adelphi", "Adena", "Adrian", "Akron", + "Albany", "Alexandria", "Alger", "Alledonia", "Alliance", "Alpha", "Alvada", + "Alvordton", "Amanda", "Amelia", "Amesville", "Amherst", "Amlin", "Amsden", + "Amsterdam", "Andover", "Anna", "Ansonia", "Antwerp", "Apple Creek", "Arcadia", + "Arcanum", "Archbold", "Arlington", "Ashland", "Ashley", "Ashtabula", "Ashville", + "Athens", "Attica", "Atwater", "Augusta", "Aurora", "Austinburg", "Ava", "Avon", + "Avon Lake", "Bainbridge", "Bakersville", "Baltic", "Baltimore", "Bannock", + "Barberton", "Barlow", "Barnesville", "Bartlett", "Barton", "Bascom", "Batavia", + "Bath", "Bay Village", "Beach City", "Beachwood", "Beallsville", "Beaver", + "Beaverdam", "Bedford", "Bellaire", "Bellbrook", "Belle Center", "Belle Valley", + "Bellefontaine", "Bellevue", "Bellville", "Belmont", "Belmore", "Beloit", "Belpre", + "Benton Ridge", "Bentonville", "Berea", "Bergholz", "Berkey", "Berlin", + "Berlin Center", "Berlin Heights", "Bethel", "Bethesda", "Bettsville", "Beverly", + "Bidwell", "Big Prairie", "Birmingham", "Blacklick", "Bladensburg", "Blaine", + "Blakeslee", "Blanchester", "Blissfield", "Bloomdale", "Bloomingburg", + "Bloomingdale", "Bloomville", "Blue Creek", "Blue Rock", "Bluffton", + "Bolivar", "Botkins", "Bourneville", "Bowerston", "Bowersville", + "Bowling Green", "Bradford", "Bradner", "Brady Lake", "Brecksville", + "Bremen", "Brewster", "Brice", "Bridgeport", "Brilliant", "Brinkhaven", + "Bristolville", "Broadview Heights", "Broadway", "Brookfield", "Brookpark", + "Brookville", "Brownsville", "Brunswick", "Bryan", "Buchtel", "Buckeye Lake", + "Buckland", "Bucyrus", "Buffalo", "Buford", "Burbank", "Burghill", "Burgoon", + "Burkettsville", "Burton", "Butler", "Byesville", "Cable", "Cadiz", "Cairo", + "Caldwell", "Caledonia", "Cambridge", "Camden", "Cameron", "Camp Dennison", + "Campbell", "Canal Fulton", "Canal Winchester", "Canfield", "Canton", "Carbon Hill", + "Carbondale", "Cardington", "Carey", "Carroll", "Carrollton", "Casstown", + "Castalia", "Catawba", "Cecil", "Cedarville", "Celina", "Centerburg", + "Chagrin Falls", "Chandlersville", "Chardon", "Charm", "Chatfield", "Chauncey", + "Cherry Fork", "Chesapeake", "Cheshire", "Chester", "Chesterhill", "Chesterland", + "Chesterville", "Chickasaw", "Chillicothe", "Chilo", "Chippewa Lake", + "Christiansburg", "Cincinnati", "Circleville", "Clarington", "Clarksburg", + "Clarksville", "Clay Center", "Clayton", "Cleveland", "Cleves", "Clifton", + "Clinton", "Cloverdale", "Clyde", "Coal Run", "Coalton", "Coldwater", "Colerain", + "College Corner", "Collins", "Collinsville", "Colton", "Columbia Station", + "Columbiana", "Columbus", "Columbus Grove", "Commercial Point", "Conesville", + "Conneaut", "Conover", "Continental", "Convoy", "Coolville", "Corning", "Cortland", + "Coshocton", "Covington", "Creola", "Crestline", "Creston", "Crooksville", + "Croton", "Crown City", "Cuba", "Cumberland", "Curtice", "Custar", "Cutler", + "Cuyahoga Falls", "Cygnet", "Cynthiana", "Dalton", "Damascus", "Danville", + "Dayton", "De Graff", "Decatur", "Deerfield", "Deersville", "Defiance", + "Delaware", "Dellroy", "Delphos", "Delta", "Dennison", "Derby", "Derwent", + "Deshler", "Dexter City", "Diamond", "Dillonvale", "Dola", "Donnelsville", + "Dorset", "Dover", "Doylestown", "Dresden", "Dublin", "Dunbridge", "Duncan Falls", + "Dundee", "Dunkirk", "Dupont", "East Claridon", "East Fultonham", + "East Liberty", "East Liverpool", "East Palestine", "East Rochester", + "East Sparta", "East Springfield", "Eastlake", "Eaton", "Edgerton", "Edison", + "Edon", "Eldorado", "Elgin", "Elkton", "Ellsworth", "Elmore", "Elyria", + "Empire", "Englewood", "Enon", "Etna", "Euclid", "Evansport", "Fairborn", + "Fairfield", "Fairpoint", "Fairview", "Farmdale", "Farmer", "Farmersville", + "Fayette", "Fayetteville", "Feesburg", "Felicity", "Findlay", "Flat Rock", + "Fleming", "Fletcher", "Flushing", "Forest", "Fort Jennings", "Fort Loramie", + "Fort Recovery", "Fostoria", "Fowler", "Frankfort", "Franklin", + "Franklin Furnace", "Frazeysburg", "Fredericksburg", "Fredericktown", + "Freeport", "Fremont", "Fresno", "Friendship", "Fulton", "Fultonham", + "Galena", "Galion", "Gallipolis", "Galloway", "Gambier", "Garrettsville", + "Gates Mills", "Geneva", "Genoa", "Georgetown", "Germantown", "Gettysburg", + "Gibsonburg", "Girard", "Glandorf", "Glencoe", "Glenford", "Glenmont", + "Glouster", "Gnadenhutten", "Gomer", "Goshen", "Grafton", "Grand Rapids", + "Grand River", "Granville", "Gratiot", "Gratis", "Graysville", "Graytown", + "Green", "Green Camp", "Green Springs", "Greenfield", "Greenford", + "Greentown", "Greenville", "Greenwich", "Grelton", "Grove City", + "Groveport", "Grover Hill", "Guysville", "Gypsum", "Hallsville", + "Hamden", "Hamersville", "Hamilton", "Hamler", "Hammondsville", + "Hannibal", "Hanoverton", "Harbor View", "Harlem Springs", "Harpster", + "Harrisburg", "Harrison", "Harrisville", "Harrod", "Hartford", "Hartville", + "Harveysburg", "Haskins", "Haverhill", "Haviland", "Haydenville", "Hayesville", + "Heath", "Hebron", "Helena", "Hicksville", "Higginsport", "Highland", "Hilliard", + "Hillsboro", "Hinckley", "Hiram", "Hockingport", "Holgate", "Holland", + "Hollansburg", "Holloway", "Holmesville", "Homer", "Homerville", "Homeworth", + "Hooven", "Hopedale", "Hopewell", "Houston", "Howard", "Hoytville", "Hubbard", + "Hudson", "Huntsburg", "Huntsville", "Huron", "Iberia", "Independence", + "Irondale", "Ironton", "Irwin", "Isle Saint George", "Jackson", "Jackson Center", + "Jacksontown", "Jacksonville", "Jacobsburg", "Jamestown", "Jasper", + "Jefferson", "Jeffersonville", "Jenera", "Jeromesville", "Jerry City", + "Jerusalem", "Jewell", "Jewett", "Johnstown", "Junction City", "Kalida", + "Kansas", "Keene", "Kelleys Island", "Kensington", "Kent", "Kenton", + "Kerr", "Kettlersville", "Kidron", "Kilbourne", "Killbuck", "Kimbolton", + "Kings Mills", "Kingston", "Kingsville", "Kinsman", "Kipling", "Kipton", + "Kirby", "Kirkersville", "Kitts Hill", "Kunkle", "La Rue", "Lacarne", + "Lafayette", "Lafferty", "Lagrange", "Laings", "Lake Milton", "Lakemore", + "Lakeside Marblehead", "Lakeview", "Lakeville", "Lakewood", "Lancaster", + "Langsville", "Lansing", "Latham", "Latty", "Laura", "Laurelville", + "Leavittsburg", "Lebanon", "Lees Creek", "Leesburg", "Leesville", + "Leetonia", "Leipsic", "Lemoyne", "Lewis Center", "Lewisburg", + "Lewistown", "Lewisville", "Liberty Center", "Lima", "Limaville", + "Lindsey", "Lisbon", "Litchfield", "Lithopolis", "Little Hocking", + "Lockbourne", "Lodi", "Logan", "London", "Londonderry", + "Long Bottom", "Lorain", "Lore City", "Loudonville", "Louisville", + "Loveland", "Lowell", "Lowellville", "Lower Salem", "Lucas", + "Lucasville", "Luckey", "Ludlow Falls", "Lynchburg", "Lynx", + "Lyons", "Macedonia", "Macksburg", "Madison", "Magnetic Springs", + "Magnolia", "Maineville", "Malaga", "Malinta", "Malta", "Malvern", + "Manchester", "Mansfield", "Mantua", "Maple Heights", "Maplewood", + "Marathon", "Marengo", "Maria Stein", "Marietta", "Marion", + "Mark Center", "Marshallville", "Martel", "Martin", "Martins Ferry", + "Martinsburg", "Martinsville", "Marysville", "Mason", "Massillon", + "Masury", "Maumee", "Maximo", "Maynard", "Mc Arthur", "Mc Clure", + "Mc Comb", "Mc Connelsville", "Mc Cutchenville", "Mc Dermott", + "Mc Donald", "Mc Guffey", "Mechanicsburg", "Mechanicstown", + "Medina", "Medway", "Melmore", "Melrose", "Mendon", "Mentor", + "Mesopotamia", "Metamora", "Miamisburg", "Miamitown", "Miamiville", + "Middle Bass", "Middle Point", "Middlebranch", "Middleburg", + "Middlefield", "Middleport", "Middletown", "Midland", "Midvale", + "Milan", "Milford", "Milford Center", "Millbury", "Milledgeville", + "Miller City", "Millersburg", "Millersport", "Millfield", + "Milton Center", "Mineral City", "Mineral Ridge", "Minerva", + "Minford", "Mingo", "Mingo Junction", "Minster", "Mogadore", + "Monclova", "Monroe", "Monroeville", "Montezuma", "Montpelier", + "Montville", "Morral", "Morristown", "Morrow", "Moscow", + "Mount Blanchard", "Mount Cory", "Mount Eaton", "Mount Gilead", + "Mount Hope", "Mount Liberty", "Mount Orab", "Mount Perry", + "Mount Pleasant", "Mount Saint Joseph", "Mount Sterling", + "Mount Vernon", "Mount Victory", "Mowrystown", "Moxahala", + "Munroe Falls", "Murray City", "Nankin", "Napoleon", "Nashport", + "Nashville", "Navarre", "Neapolis", "Neffs", "Negley", + "Nelsonville", "Nevada", "Neville", "New Albany", "New Athens", + "New Bavaria", "New Bloomington", "New Bremen", "New Carlisle", + "New Concord", "New Hampshire", "New Haven", "New Holland", + "New Knoxville", "New Lebanon", "New Lexington", "New London", + "New Madison", "New Marshfield", "New Matamoras", "New Middletown", + "New Paris", "New Philadelphia", "New Plymouth", "New Richmond", + "New Riegel", "New Rumley", "New Springfield", "New Straitsville", + "New Vienna", "New Washington", "New Waterford", "New Weston", + "Newark", "Newbury", "Newcomerstown", "Newport", "Newton Falls", + "Newtonsville", "Ney", "Niles", "North Baltimore", "North Bend", + "North Benton", "North Bloomfield", "North Fairfield", + "North Georgetown", "North Hampton", "North Jackson", + "North Kingsville", "North Lawrence", "North Lewisburg", + "North Lima", "North Olmsted", "North Ridgeville", "North Robinson", + "North Royalton", "North Star", "Northfield", "Northwood", "Norwalk", + "Norwich", "Nova", "Novelty", "Oak Harbor", "Oak Hill", "Oakwood", + "Oberlin", "Oceola", "Ohio City", "Okeana", "Okolona", "Old Fort", + "Old Washington", "Olmsted Falls", "Ontario", "Orangeville", + "Oregon", "Oregonia", "Orient", "Orrville", "Orwell", "Osgood", + "Ostrander", "Ottawa", "Ottoville", "Otway", "Overpeck", + "Owensville", "Oxford", "Painesville", "Palestine", "Pandora", + "Paris", "Parkman", "Pataskala", "Patriot", "Paulding", "Payne", + "Pedro", "Peebles", "Pemberton", "Pemberville", "Peninsula", + "Perry", "Perrysburg", "Perrysville", "Petersburg", "Pettisville", + "Phillipsburg", "Philo", "Pickerington", "Piedmont", "Pierpont", + "Piketon", "Piney Fork", "Pioneer", "Piqua", "Pitsburg", + "Plain City", "Plainfield", "Pleasant City", "Pleasant Hill", + "Pleasant Plain", "Pleasantville", "Plymouth", "Polk", + "Pomeroy", "Port Clinton", "Port Jefferson", "Port Washington", + "Port William", "Portage", "Portland", "Portsmouth", "Potsdam", + "Powell", "Powhatan Point", "Proctorville", "Prospect", "Put in Bay", + "Quaker City", "Quincy", "Racine", "Radnor", "Randolph", "Rarden", + "Ravenna", "Rawson", "Ray", "Rayland", "Raymond", "Reedsville", + "Reesville", "Reno", "Republic", "Reynoldsburg", "Richfield", + "Richmond", "Richmond Dale", "Richwood", "Ridgeville Corners", + "Ridgeway", "Rio Grande", "Ripley", "Risingsun", "Rittman", + "Robertsville", "Rock Camp", "Rock Creek", "Rockbridge", "Rockford", + "Rocky Ridge", "Rocky River", "Rogers", "Rome", "Rootstown", "Roseville", + "Rosewood", "Ross", "Rossburg", "Rossford", "Roundhead", "Rudolph", + "Rushsylvania", "Rushville", "Russells Point", "Russellville", "Russia", + "Rutland", "Sabina", "Saint Clairsville", "Saint Henry", "Saint Johns", + "Saint Louisville", "Saint Marys", "Saint Paris", "Salem", "Salesville", + "Salineville", "Sandusky", "Sandyville", "Sarahsville", "Sardinia", + "Sardis", "Savannah", "Scio", "Scioto Furnace", "Scott", "Scottown", + "Seaman", "Sebring", "Sedalia", "Senecaville", "Seven Mile", "Seville", + "Shade", "Shadyside", "Shandon", "Sharon Center", "Sharpsburg", + "Shauck", "Shawnee", "Sheffield Lake", "Shelby", "Sherrodsville", + "Sherwood", "Shiloh", "Short Creek", "Shreve", "Sidney", "Sinking Spring", + "Smithfield", "Smithville", "Solon", "Somerdale", "Somerset", + "Somerville", "South Bloomingville", "South Charleston", "South Lebanon", + "South Point", "South Salem", "South Solon", "South Vienna", + "South Webster", "Southington", "Sparta", "Spencer", "Spencerville", + "Spring Valley", "Springboro", "Springfield", "Stafford", "Sterling", + "Steubenville", "Stewart", "Stillwater", "Stockdale", "Stockport", + "Stone Creek", "Stony Ridge", "Stout", "Stoutsville", "Stow", "Strasburg", + "Stratton", "Streetsboro", "Strongsville", "Struthers", "Stryker", + "Sugar Grove", "Sugarcreek", "Sullivan", "Sulphur Springs", "Summerfield", + "Summit Station", "Summitville", "Sunbury", "Swanton", "Sycamore", + "Sycamore Valley", "Sylvania", "Syracuse", "Tallmadge", "Tarlton", + "Terrace Park", "The Plains", "Thompson", "Thornville", "Thurman", + "Thurston", "Tiffin", "Tiltonsville", "Tipp City", "Tippecanoe", "Tiro", + "Toledo", "Tontogany", "Torch", "Toronto", "Tremont City", "Trenton", + "Trimble", "Trinway", "Troy", "Tuppers Plains", "Tuscarawas", "Twinsburg", + "Uhrichsville", "Union City", "Union Furnace", "Unionport", "Uniontown", + "Unionville", "Unionville Center", "Uniopolis", "Upper Sandusky", "Urbana", + "Utica", "Valley City", "Van Buren", "Van Wert", "Vandalia", "Vanlue", + "Vaughnsville", "Venedocia", "Vermilion", "Verona", "Versailles", + "Vickery", "Vienna", "Vincent", "Vinton", "Wadsworth", "Wakefield", + "Wakeman", "Walbridge", "Waldo", "Walhonding", "Walnut Creek", "Wapakoneta", + "Warnock", "Warren", "Warsaw", "Washington Court House", + "Washingtonville", "Waterford", "Waterloo", "Watertown", "Waterville", + "Wauseon", "Waverly", "Wayland", "Wayne", "Waynesburg", "Waynesfield", + "Waynesville", "Wellington", "Wellston", "Wellsville", "West Alexandria", + "West Chester", "West Elkton", "West Farmington", "West Jefferson", + "West Lafayette", "West Liberty", "West Manchester", "West Mansfield", + "West Millgrove", "West Milton", "West Point", "West Portsmouth", + "West Rushville", "West Salem", "West Union", "West Unity", "Westerville", + "Westfield Center", "Westlake", "Weston", "Westville", "Wharton", + "Wheelersburg", "Whipple", "White Cottage", "Whitehouse", "Wickliffe", + "Wilberforce", "Wilkesville", "Willard", "Williamsburg", "Williamsfield", + "Williamsport", "Williamstown", "Williston", "Willoughby", "Willow Wood", + "Willshire", "Wilmington", "Wilmot", "Winchester", "Windham", "Windsor", + "Winesburg", "Wingett Run", "Winona", "Wolf Run", "Woodsfield", + "Woodstock", "Woodville", "Wooster", "Wren", "Xenia", "Yellow Springs", + "Yorkshire", "Yorkville", "Youngstown", "Zaleski", "Zanesfield", "Zanesville", + "Zoar" +]; \ No newline at end of file diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/main.css b/plugins/Autocomplete/jquery-autocomplete/demo/main.css new file mode 100644 index 000000000..b502a8a1a --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/demo/main.css @@ -0,0 +1,53 @@ +body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0} +table{border-collapse:collapse;border-spacing:0} +fieldset,img{border:0} +address,caption,cite,code,dfn,th,var{font-style:normal;font-weight:normal} +ol,ul{list-style:none} +caption,th{text-align:left} +h1,h2,h3,h4,h5,h6{font-size:100%;font-style:normal;font-weight:normal} +q:before,q:after{content:''} +body{font:13px arial,helvetica,clean,sans-serif;font-size:small;} +select,input,textarea{font:99% arial,helvetica,clean,sans-serif} +pre,code{font:115% monospace;font-size:100%} +body * {line-height:1.22em} +body { + color: #202020; +} + +h1 { + color: #fff; + background: #06b; + padding: 10px; + font-size: 200%; +} + +h2 { + color: #000; + font-size: 150%; + padding: 10px 0; +} + +h3 { + color: #000; + font-size: 120%; + padding: 10px 0; +} + +ul { + list-style: disc inside; + margin-left: 1em; +} + +#content { + padding: 10px; +} + +label { + float: left; + width: 12em; +} +input[type=text] { width: 15em; } + +#banner { padding: 15px; background-color: #06b; color: white; font-size: large; border-bottom: 1px solid #ccc; + background: url(bg.gif) repeat-x; text-align: center } +#banner a { color: white; } \ No newline at end of file diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/search.php b/plugins/Autocomplete/jquery-autocomplete/demo/search.php new file mode 100644 index 000000000..03c0c0eab --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/demo/search.php @@ -0,0 +1,578 @@ +Bittern
        "=>"Botaurus stellaris", +"Little Grebe"=>"Tachybaptus ruficollis", +"Black-necked Grebe"=>"Podiceps nigricollis", +"Little Bittern"=>"Ixobrychus minutus", +"Black-crowned Night Heron"=>"Nycticorax nycticorax", +"Purple Heron"=>"Ardea purpurea", +"White Stork"=>"Ciconia ciconia", +"Spoonbill"=>"Platalea leucorodia", +"Red-crested Pochard"=>"Netta rufina", +"Common Eider"=>"Somateria mollissima", +"Red Kite"=>"Milvus milvus", +"Hen Harrier"=>"Circus cyaneus", +"Montagu`s Harrier"=>"Circus pygargus", +"Black Grouse"=>"Tetrao tetrix", +"Grey Partridge"=>"Perdix perdix", +"Spotted Crake"=>"Porzana porzana", +"Corncrake"=>"Crex crex", +"Common Crane"=>"Grus grus", +"Avocet"=>"Recurvirostra avosetta", +"Stone Curlew"=>"Burhinus oedicnemus", +"Common Ringed Plover"=>"Charadrius hiaticula", +"Kentish Plover"=>"Charadrius alexandrinus", +"Ruff"=>"Philomachus pugnax", +"Common Snipe"=>"Gallinago gallinago", +"Black-tailed Godwit"=>"Limosa limosa", +"Common Redshank"=>"Tringa totanus", +"Sandwich Tern"=>"Sterna sandvicensis", +"Common Tern"=>"Sterna hirundo", +"Arctic Tern"=>"Sterna paradisaea", +"Little Tern"=>"Sternula albifrons", +"Black Tern"=>"Chlidonias niger", +"Barn Owl"=>"Tyto alba", +"Little Owl"=>"Athene noctua", +"Short-eared Owl"=>"Asio flammeus", +"European Nightjar"=>"Caprimulgus europaeus", +"Common Kingfisher"=>"Alcedo atthis", +"Eurasian Hoopoe"=>"Upupa epops", +"Eurasian Wryneck"=>"Jynx torquilla", +"European Green Woodpecker"=>"Picus viridis", +"Crested Lark"=>"Galerida cristata", +"White-headed Duck"=>"Oxyura leucocephala", +"Pale-bellied Brent Goose"=>"Branta hrota", +"Tawny Pipit"=>"Anthus campestris", +"Whinchat"=>"Saxicola rubetra", +"European Stonechat"=>"Saxicola rubicola", +"Northern Wheatear"=>"Oenanthe oenanthe", +"Savi`s Warbler"=>"Locustella luscinioides", +"Sedge Warbler"=>"Acrocephalus schoenobaenus", +"Great Reed Warbler"=>"Acrocephalus arundinaceus", +"Bearded Reedling"=>"Panurus biarmicus", +"Red-backed Shrike"=>"Lanius collurio", +"Great Grey Shrike"=>"Lanius excubitor", +"Woodchat Shrike"=>"Lanius senator", +"Common Raven"=>"Corvus corax", +"Yellowhammer"=>"Emberiza citrinella", +"Ortolan Bunting"=>"Emberiza hortulana", +"Corn Bunting"=>"Emberiza calandra", +"Great Cormorant"=>"Phalacrocorax carbo", +"Hawfinch"=>"Coccothraustes coccothraustes", +"Common Shelduck"=>"Tadorna tadorna", +"Bluethroat"=>"Luscinia svecica", +"Grey Heron"=>"Ardea cinerea", +"Barn Swallow"=>"Hirundo rustica", +"Hooded Crow"=>"Corvus cornix", +"Dunlin"=>"Calidris alpina", +"Eurasian Pied Flycatcher"=>"Ficedula hypoleuca", +"Eurasian Nuthatch"=>"Sitta europaea", +"Short-toed Tree Creeper"=>"Certhia brachydactyla", +"Wood Lark"=>"Lullula arborea", +"Tree Pipit"=>"Anthus trivialis", +"Eurasian Hobby"=>"Falco subbuteo", +"Marsh Warbler"=>"Acrocephalus palustris", +"Wood Sandpiper"=>"Tringa glareola", +"Tawny Owl"=>"Strix aluco", +"Lesser Whitethroat"=>"Sylvia curruca", +"Barnacle Goose"=>"Branta leucopsis", +"Common Goldeneye"=>"Bucephala clangula", +"Western Marsh Harrier"=>"Circus aeruginosus", +"Common Buzzard"=>"Buteo buteo", +"Sanderling"=>"Calidris alba", +"Little Gull"=>"Larus minutus", +"Eurasian Magpie"=>"Pica pica", +"Willow Warbler"=>"Phylloscopus trochilus", +"Wood Warbler"=>"Phylloscopus sibilatrix", +"Great Crested Grebe"=>"Podiceps cristatus", +"Eurasian Jay"=>"Garrulus glandarius", +"Common Redstart"=>"Phoenicurus phoenicurus", +"Blue-headed Wagtail"=>"Motacilla flava", +"Common Swift"=>"Apus apus", +"Marsh Tit"=>"Poecile palustris", +"Goldcrest"=>"Regulus regulus", +"European Golden Plover"=>"Pluvialis apricaria", +"Eurasian Bullfinch"=>"Pyrrhula pyrrhula", +"Common Whitethroat"=>"Sylvia communis", +"Meadow Pipit"=>"Anthus pratensis", +"Greylag Goose"=>"Anser anser", +"Spotted Flycatcher"=>"Muscicapa striata", +"European Greenfinch"=>"Carduelis chloris", +"Common Greenshank"=>"Tringa nebularia", +"Great Spotted Woodpecker"=>"Dendrocopos major", +"Greater Canada Goose"=>"Branta canadensis", +"Mistle Thrush"=>"Turdus viscivorus", +"Great Black-backed Gull"=>"Larus marinus", +"Goosander"=>"Mergus merganser", +"Great Egret"=>"Casmerodius albus", +"Northern Goshawk"=>"Accipiter gentilis", +"Dunnock"=>"Prunella modularis", +"Stock Dove"=>"Columba oenas", +"Common Wood Pigeon"=>"Columba palumbus", +"Eurasian Woodcock"=>"Scolopax rusticola", +"House Sparrow"=>"Passer domesticus", +"Common House Martin"=>"Delichon urbicum", +"Red Knot"=>"Calidris canutus", +"Western Jackdaw"=>"Corvus monedula", +"Brambling"=>"Fringilla montifringilla", +"Northern Lapwing"=>"Vanellus vanellus", +"European Reed Warbler"=>"Acrocephalus scirpaceus", +"Lesser Black-backed Gull"=>"Larus fuscus", +"Little Egret"=>"Egretta garzetta", +"Little Stint"=>"Calidris minuta", +"Common Linnet"=>"Carduelis cannabina", +"Mute Swan"=>"Cygnus olor", +"Common Cuckoo"=>"Cuculus canorus", +"Black-headed Gull"=>"Larus ridibundus", +"Greater White-fronted Goose"=>"Anser albifrons", +"Great Tit"=>"Parus major", +"Redwing"=>"Turdus iliacus", +"Gadwall"=>"Anas strepera", +"Fieldfare"=>"Turdus pilaris", +"Tufted Duck"=>"Aythya fuligula", +"Crested Tit"=>"Lophophanes cristatus", +"Willow Tit"=>"Poecile montanus", +"Eurasian Coot"=>"Fulica atra", +"Common Blackbird"=>"Turdus merula", +"Smew"=>"Mergus albellus", +"Common Sandpiper"=>"Actitis hypoleucos", +"Sand Martin"=>"Riparia riparia", +"Purple Sandpiper"=>"Calidris maritima", +"Northern Pintail"=>"Anas acuta", +"Blue Tit"=>"Cyanistes caeruleus", +"European Goldfinch"=>"Carduelis carduelis", +"Eurasian Whimbrel"=>"Numenius phaeopus", +"Common Reed Bunting"=>"Emberiza schoeniclus", +"Eurasian Tree Sparrow"=>"Passer montanus", +"Rook"=>"Corvus frugilegus", +"European Robin"=>"Erithacus rubecula", +"Bar-tailed Godwit"=>"Limosa lapponica", +"Dark-bellied Brent Goose"=>"Branta bernicla", +"Eurasian Oystercatcher"=>"Haematopus ostralegus", +"Eurasian Siskin"=>"Carduelis spinus", +"Northern Shoveler"=>"Anas clypeata", +"Eurasian Wigeon"=>"Anas penelope", +"Eurasian Sparrow Hawk"=>"Accipiter nisus", +"Icterine Warbler"=>"Hippolais icterina", +"Common Starling"=>"Sturnus vulgaris", +"Long-tailed Tit"=>"Aegithalos caudatus", +"Ruddy Turnstone"=>"Arenaria interpres", +"Mew Gull"=>"Larus canus", +"Common Pochard"=>"Aythya ferina", +"Common Chiffchaff"=>"Phylloscopus collybita", +"Greater Scaup"=>"Aythya marila", +"Common Kestrel"=>"Falco tinnunculus", +"Garden Warbler"=>"Sylvia borin", +"Eurasian Collared Dove"=>"Streptopelia decaocto", +"Eurasian Skylark"=>"Alauda arvensis", +"Common Chaffinch"=>"Fringilla coelebs", +"Common Moorhen"=>"Gallinula chloropus", +"Water Pipit"=>"Anthus spinoletta", +"Mallard"=>"Anas platyrhynchos", +"Winter Wren"=>"Troglodytes troglodytes", +"Common Teal"=>"Anas crecca", +"Green Sandpiper"=>"Tringa ochropus", +"White Wagtail"=>"Motacilla alba", +"Eurasian Curlew"=>"Numenius arquata", +"Song Thrush"=>"Turdus philomelos", +"European Herring Gull"=>"Larus argentatus", +"Grey Plover"=>"Pluvialis squatarola", +"Carrion Crow"=>"Corvus corone", +"Coal Tit"=>"Periparus ater", +"Spotted Redshank"=>"Tringa erythropus", +"Blackcap"=>"Sylvia atricapilla", +"Egyptian Vulture"=>"Neophron percnopterus", +"Razorbill"=>"Alca torda", +"Alpine Swift"=>"Apus melba", +"Long-legged Buzzard"=>"Buteo rufinus", +"Audouin`s Gull"=>"Larus audouinii", +"Balearic Shearwater"=>"Puffinus mauretanicus", +"Upland Sandpiper"=>"Bartramia longicauda", +"Greater Spotted Eagle"=>"Aquila clanga", +"Ring Ouzel"=>"Turdus torquatus", +"Yellow-browed Warbler"=>"Phylloscopus inornatus", +"Blue Rock Thrush"=>"Monticola solitarius", +"Buff-breasted Sandpiper"=>"Tryngites subruficollis", +"Jack Snipe"=>"Lymnocryptes minimus", +"White-rumped Sandpiper"=>"Calidris fuscicollis", +"Ruddy Shelduck"=>"Tadorna ferruginea", +"Cetti's Warbler"=>"Cettia cetti", +"Citrine Wagtail"=>"Motacilla citreola", +"Roseate Tern"=>"Sterna dougallii", +"Black-legged Kittiwake"=>"Rissa tridactyla", +"Pygmy Cormorant"=>"Phalacrocorax pygmeus", +"Booted Eagle"=>"Aquila pennata", +"Lesser White-fronted Goose"=>"Anser erythropus", +"Little Bunting"=>"Emberiza pusilla", +"Eleonora's Falcon"=>"Falco eleonorae", +"European Serin"=>"Serinus serinus", +"Twite"=>"Carduelis flavirostris", +"Yellow-legged Gull"=>"Larus michahellis", +"Gyr Falcon"=>"Falco rusticolus", +"Greenish Warbler"=>"Phylloscopus trochiloides", +"Red-necked Phalarope"=>"Phalaropus lobatus", +"Mealy Redpoll"=>"Carduelis flammea", +"Glaucous Gull"=>"Larus hyperboreus", +"Great Skua"=>"Stercorarius skua", +"Great Bustard"=>"Otis tarda", +"Velvet Scoter"=>"Melanitta fusca", +"Pine Grosbeak"=>"Pinicola enucleator", +"House Crow"=>"Corvus splendens", +"Hume`s Leaf Warbler"=>"Phylloscopus humei", +"Great Northern Loon"=>"Gavia immer", +"Long-tailed Duck"=>"Clangula hyemalis", +"Lapland Longspur"=>"Calcarius lapponicus", +"Northern Gannet"=>"Morus bassanus", +"Eastern Imperial Eagle"=>"Aquila heliaca", +"Little Auk"=>"Alle alle", +"Lesser Spotted Woodpecker"=>"Dendrocopos minor", +"Iceland Gull"=>"Larus glaucoides", +"Parasitic Jaeger"=>"Stercorarius parasiticus", +"Bewick`s Swan"=>"Cygnus bewickii", +"Little Bustard"=>"Tetrax tetrax", +"Little Crake"=>"Porzana parva", +"Baillon`s Crake"=>"Porzana pusilla", +"Long-tailed Jaeger"=>"Stercorarius longicaudus", +"King Eider"=>"Somateria spectabilis", +"Greater Short-toed Lark"=>"Calandrella brachydactyla", +"Houbara Bustard"=>"Chlamydotis undulata", +"Curlew Sandpiper"=>"Calidris ferruginea", +"Common Crossbill"=>"Loxia curvirostra", +"European Shag"=>"Phalacrocorax aristotelis", +"Horned Grebe"=>"Podiceps auritus", +"Common Quail"=>"Coturnix coturnix", +"Bearded Vulture"=>"Gypaetus barbatus", +"Lanner Falcon"=>"Falco biarmicus", +"Middle Spotted Woodpecker"=>"Dendrocopos medius", +"Pomarine Jaeger"=>"Stercorarius pomarinus", +"Red-breasted Merganser"=>"Mergus serrator", +"Eurasian Black Vulture"=>"Aegypius monachus", +"Eurasian Dotterel"=>"Charadrius morinellus", +"Common Nightingale"=>"Luscinia megarhynchos", +"Northern willow warbler"=>"Phylloscopus trochilus acredula", +"Manx Shearwater"=>"Puffinus puffinus", +"Northern Fulmar"=>"Fulmarus glacialis", +"Eurasian Eagle Owl"=>"Bubo bubo", +"Orphean Warbler"=>"Sylvia hortensis", +"Melodious Warbler"=>"Hippolais polyglotta", +"Pallas's Leaf Warbler"=>"Phylloscopus proregulus", +"Atlantic Puffin"=>"Fratercula arctica", +"Black-throated Loon"=>"Gavia arctica", +"Bohemian Waxwing"=>"Bombycilla garrulus", +"Marsh Sandpiper"=>"Tringa stagnatilis", +"Great Snipe"=>"Gallinago media", +"Squacco Heron"=>"Ardeola ralloides", +"Long-eared Owl"=>"Asio otus", +"Caspian Tern"=>"Hydroprogne caspia", +"Red-breasted Goose"=>"Branta ruficollis", +"Red-throated Loon"=>"Gavia stellata", +"Common Rosefinch"=>"Carpodacus erythrinus", +"Red-footed Falcon"=>"Falco vespertinus", +"Ross's Goose"=>"Anser rossii", +"Red Phalarope"=>"Phalaropus fulicarius", +"Pied Wagtail"=>"Motacilla yarrellii", +"Rose-coloured Starling"=>"Sturnus roseus", +"Rough-legged Buzzard"=>"Buteo lagopus", +"Saker Falcon"=>"Falco cherrug", +"European Roller"=>"Coracias garrulus", +"Short-toed Eagle"=>"Circaetus gallicus", +"Peregrine Falcon"=>"Falco peregrinus", +"Merlin"=>"Falco columbarius", +"Snow Goose"=>"Anser caerulescens", +"Snowy Owl"=>"Bubo scandiacus", +"Snow Bunting"=>"Plectrophenax nivalis", +"Common Grasshopper Warbler"=>"Locustella naevia", +"Golden Eagle"=>"Aquila chrysaetos", +"Black-winged Stilt"=>"Himantopus himantopus", +"Steppe Eagle"=>"Aquila nipalensis", +"Pallid Harrier"=>"Circus macrourus", +"European Storm-petrel"=>"Hydrobates pelagicus", +"Horned Lark"=>"Eremophila alpestris", +"Eurasian Treecreeper"=>"Certhia familiaris", +"Taiga Bean Goose"=>"Anser fabalis", +"Temminck`s Stint"=>"Calidris temminckii", +"Terek Sandpiper"=>"Xenus cinereus", +"Tundra Bean Goose"=>"Anser serrirostris", +"European Turtle Dove"=>"Streptopelia turtur", +"Leach`s Storm-petrel"=>"Oceanodroma leucorhoa", +"Eurasian Griffon Vulture"=>"Gyps fulvus", +"Paddyfield Warbler"=>"Acrocephalus agricola", +"Osprey"=>"Pandion haliaetus", +"Firecrest"=>"Regulus ignicapilla", +"Water Rail"=>"Rallus aquaticus", +"European Honey Buzzard"=>"Pernis apivorus", +"Eurasian Golden Oriole"=>"Oriolus oriolus", +"Whooper Swan"=>"Cygnus cygnus", +"Two-barred Crossbill"=>"Loxia leucoptera", +"White-tailed Eagle"=>"Haliaeetus albicilla", +"Atlantic Murre"=>"Uria aalge", +"Garganey"=>"Anas querquedula", +"Black Redstart"=>"Phoenicurus ochruros", +"Common Scoter"=>"Melanitta nigra", +"Rock Pipit"=>"Anthus petrosus", +"Lesser Spotted Eagle"=>"Aquila pomarina", +"Cattle Egret"=>"Bubulcus ibis", +"White-winged Black Tern"=>"Chlidonias leucopterus", +"Black Stork"=>"Ciconia nigra", +"Mediterranean Gull"=>"Larus melanocephalus", +"Black Kite"=>"Milvus migrans", +"Yellow Wagtail"=>"Motacilla flavissima", +"Red-necked Grebe"=>"Podiceps grisegena", +"Gull-billed Tern"=>"Gelochelidon nilotica", +"Pectoral Sandpiper"=>"Calidris melanotos", +"Barred Warbler"=>"Sylvia nisoria", +"Red-throated Pipit"=>"Anthus cervinus", +"Grey Wagtail"=>"Motacilla cinerea", +"Richard`s Pipit"=>"Anthus richardi", +"Black Woodpecker"=>"Dryocopus martius", +"Little Ringed Plover"=>"Charadrius dubius", +"Whiskered Tern"=>"Chlidonias hybrida", +"Lesser Redpoll"=>"Carduelis cabaret", +"Pallas' Bunting"=>"Emberiza pallasi", +"Ferruginous Duck"=>"Aythya nyroca", +"Whistling Swan"=>"Cygnus columbianus", +"Black Brant"=>"Branta nigricans", +"Marbled Teal"=>"Marmaronetta angustirostris", +"Canvasback"=>"Aythya valisineria", +"Redhead"=>"Aythya americana", +"Lesser Scaup"=>"Aythya affinis", +"Steller`s Eider"=>"Polysticta stelleri", +"Spectacled Eider"=>"Somateria fischeri", +"Harlequin Duck"=>"Histronicus histrionicus", +"Black Scoter"=>"Melanitta americana", +"Surf Scoter"=>"Melanitta perspicillata", +"Barrow`s Goldeneye"=>"Bucephala islandica", +"Falcated Duck"=>"Anas falcata", +"American Wigeon"=>"Anas americana", +"Blue-winged Teal"=>"Anas discors", +"American Black Duck"=>"Anas rubripes", +"Baikal Teal"=>"Anas formosa", +"Green-Winged Teal"=>"Anas carolinensis", +"Hazel Grouse"=>"Bonasa bonasia", +"Rock Partridge"=>"Alectoris graeca", +"Red-legged Partridge"=>"Alectoris rufa", +"Yellow-billed Loon"=>"Gavia adamsii", +"Cory`s Shearwater"=>"Calonectris borealis", +"Madeiran Storm-Petrel"=>"Oceanodroma castro", +"Great White Pelican"=>"Pelecanus onocrotalus", +"Dalmatian Pelican"=>"Pelecanus crispus", +"American Bittern"=>"Botaurus lentiginosus", +"Glossy Ibis"=>"Plegadis falcinellus", +"Spanish Imperial Eagle"=>"Aquila adalberti", +"Lesser Kestrel"=>"Falco naumanni", +"Houbara Bustard"=>"Chlamydotis undulata", +"Crab-Plover"=>"Dromas ardeola", +"Cream-coloured Courser"=>"Cursorius cursor", +"Collared Pratincole"=>"Glareola pratincola", +"Black-winged Pratincole"=>"Glareola nordmanni", +"Killdeer"=>"Charadrius vociferus", +"Lesser Sand Plover"=>"Charadrius mongolus", +"Greater Sand Plover"=>"Charadrius leschenaultii", +"Caspian Plover"=>"Charadrius asiaticus", +"American Golden Plover"=>"Pluvialis dominica", +"Pacific Golden Plover"=>"Pluvialis fulva", +"Sharp-tailed Sandpiper"=>"Calidris acuminata", +"Broad-billed Sandpiper"=>"Limicola falcinellus", +"Spoon-Billed Sandpiper"=>"Eurynorhynchus pygmaeus", +"Short-Billed Dowitcher"=>"Limnodromus griseus", +"Long-billed Dowitcher"=>"Limnodromus scolopaceus", +"Hudsonian Godwit"=>"Limosa haemastica", +"Little Curlew"=>"Numenius minutus", +"Lesser Yellowlegs"=>"Tringa flavipes", +"Wilson`s Phalarope"=>"Phalaropus tricolor", +"Pallas`s Gull"=>"Larus ichthyaetus", +"Laughing Gull"=>"Larus atricilla", +"Franklin`s Gull"=>"Larus pipixcan", +"Bonaparte`s Gull"=>"Larus philadelphia", +"Ring-billed Gull"=>"Larus delawarensis", +"American Herring Gull"=>"Larus smithsonianus", +"Caspian Gull"=>"Larus cachinnans", +"Ivory Gull"=>"Pagophila eburnea", +"Royal Tern"=>"Sterna maxima", +"Brünnich`s Murre"=>"Uria lomvia", +"Crested Auklet"=>"Aethia cristatella", +"Parakeet Auklet"=>"Cyclorrhynchus psittacula", +"Tufted Puffin"=>"Lunda cirrhata", +"Laughing Dove"=>"Streptopelia senegalensis", +"Great Spotted Cuckoo"=>"Clamator glandarius", +"Great Grey Owl"=>"Strix nebulosa", +"Tengmalm`s Owl"=>"Aegolius funereus", +"Red-Necked Nightjar"=>"Caprimulgus ruficollis", +"Chimney Swift"=>"Chaetura pelagica", +"Green Bea-Eater"=>"Merops orientalis", +"Grey-headed Woodpecker"=>"Picus canus", +"Lesser Short-Toed Lark"=>"Calandrella rufescens", +"Eurasian Crag Martin"=>"Hirundo rupestris", +"Red-rumped Swallow"=>"Cecropis daurica", +"Blyth`s Pipit"=>"Anthus godlewskii", +"Pechora Pipit"=>"Anthus gustavi", +"Grey-headed Wagtail"=>"Motacilla thunbergi", +"Yellow-Headed Wagtail"=>"Motacilla lutea", +"White-throated Dipper"=>"Cinclus cinclus", +"Rufous-Tailed Scrub Robin"=>"Cercotrichas galactotes", +"Thrush Nightingale"=>"Luscinia luscinia", +"White-throated Robin"=>"Irania gutturalis", +"Caspian Stonechat"=>"Saxicola maura variegata", +"Western Black-eared Wheatear"=>"Oenanthe hispanica", +"Rufous-tailed Rock Thrush"=>"Monticola saxatilis", +"Red-throated Thrush/Black-throated"=>"Turdus ruficollis", +"American Robin"=>"Turdus migratorius", +"Zitting Cisticola"=>"Cisticola juncidis", +"Lanceolated Warbler"=>"Locustella lanceolata", +"River Warbler"=>"Locustella fluviatilis", +"Blyth`s Reed Warbler"=>"Acrocephalus dumetorum", +"Caspian Reed Warbler"=>"Acrocephalus fuscus", +"Aquatic Warbler"=>"Acrocephalus paludicola", +"Booted Warbler"=>"Acrocephalus caligatus", +"Marmora's Warbler"=>"Sylvia sarda", +"Dartford Warbler"=>"Sylvia undata", +"Subalpine Warbler"=>"Sylvia cantillans", +"Ménétries's Warbler"=>"Sylvia mystacea", +"Rüppel's Warbler"=>"Sylvia rueppelli", +"Asian Desert Warbler"=>"Sylvia nana", +"Western Orphean Warbler"=>"Sylvia hortensis hortensis", +"Arctic Warbler"=>"Phylloscopus borealis", +"Radde`s Warbler"=>"Phylloscopus schwarzi", +"Western Bonelli`s Warbler"=>"Phylloscopus bonelli", +"Red-breasted Flycatcher"=>"Ficedula parva", +"Eurasian Penduline Tit"=>"Remiz pendulinus", +"Daurian Shrike"=>"Lanius isabellinus", +"Long-Tailed Shrike"=>"Lanius schach", +"Lesser Grey Shrike"=>"Lanius minor", +"Southern Grey Shrike"=>"Lanius meridionalis", +"Masked Shrike"=>"Lanius nubicus", +"Spotted Nutcracker"=>"Nucifraga caryocatactes", +"Daurian Jackdaw"=>"Corvus dauuricus", +"Purple-Backed Starling"=>"Sturnus sturninus", +"Red-Fronted Serin"=>"Serinus pusillus", +"Arctic Redpoll"=>"Carduelis hornemanni", +"Scottish Crossbill"=>"Loxia scotica", +"Parrot Crossbill"=>"Loxia pytyopsittacus", +"Black-faced Bunting"=>"Emberiza spodocephala", +"Pink-footed Goose"=>"Anser brachyrhynchus", +"Black-winged Kite"=>"Elanus caeruleus", +"European Bee-eater"=>"Merops apiaster", +"Sabine`s Gull"=>"Larus sabini", +"Sooty Shearwater"=>"Puffinus griseus", +"Lesser Canada Goose"=>"Branta hutchinsii", +"Ring-necked Duck"=>"Aythya collaris", +"Greater Flamingo"=>"Phoenicopterus roseus", +"Iberian Chiffchaff"=>"Phylloscopus ibericus", +"Ashy-headed Wagtail"=>"Motacilla cinereocapilla", +"Stilt Sandpiper"=>"Calidris himantopus", +"Siberian Stonechat"=>"Saxicola maurus", +"Greater Yellowlegs"=>"Tringa melanoleuca", +"Forster`s Tern"=>"Sterna forsteri", +"Dusky Warbler"=>"Phylloscopus fuscatus", +"Cirl Bunting"=>"Emberiza cirlus", +"Olive-backed Pipit"=>"Anthus hodgsoni", +"Sociable Lapwing"=>"Vanellus gregarius", +"Spotted Sandpiper"=>"Actitis macularius", +"Baird`s Sandpiper"=>"Calidris bairdii", +"Rustic Bunting"=>"Emberiza rustica", +"Yellow-browed Bunting"=>"Emberiza chrysophrys", +"Great Shearwater"=>"Puffinus gravis", +"Bonelli`s Eagle"=>"Aquila fasciata", +"Calandra Lark"=>"Melanocorypha calandra", +"Sardinian Warbler"=>"Sylvia melanocephala", +"Ross's Gull"=>"Larus roseus", +"Yellow-Breasted Bunting"=>"Emberiza aureola", +"Pine Bunting"=>"Emberiza leucocephalos", +"Black Guillemot"=>"Cepphus grylle", +"Pied-billed Grebe"=>"Podilymbus podiceps", +"Soft-plumaged Petrel"=>"Pterodroma mollis", +"Bulwer's Petrel"=>"Bulweria bulwerii", +"White-Faced Storm-Petrel"=>"Pelagodroma marina", +"Pallas’s Fish Eagle"=>"Haliaeetus leucoryphus", +"Sandhill Crane"=>"Grus canadensis", +"Macqueen’s Bustard"=>"Chlamydotis macqueenii", +"White-tailed Lapwing"=>"Vanellus leucurus", +"Great Knot"=>"Calidris tenuirostris", +"Semipalmated Sandpiper"=>"Calidris pusilla", +"Red-necked Stint"=>"Calidris ruficollis", +"Slender-billed Curlew"=>"Numenius tenuirostris", +"Bridled Tern"=>"Onychoprion anaethetus", +"Pallas’s Sandgrouse"=>"Syrrhaptes paradoxus", +"European Scops Owl"=>"Otus scops", +"Northern Hawk Owl"=>"Surnia ulula", +"White-Throated Needletail"=>"Hirundapus caudacutus", +"Belted Kingfisher"=>"Ceryle alcyon", +"Blue-cheeked Bee-eater"=>"Merops persicus", +"Black-headed Wagtail"=>"Motacilla feldegg", +"Northern Mockingbird"=>"Mimus polyglottos", +"Alpine Accentor"=>"Prunella collaris", +"Red-flanked Bluetail"=>"Tarsiger cyanurus", +"Isabelline Wheatear"=>"Oenanthe isabellina", +"Pied Wheatear"=>"Oenanthe pleschanka", +"Eastern Black-eared Wheatear"=>"Oenanthe melanoleuca", +"Desert Wheatear"=>"Oenanthe deserti", +"White`s Thrush"=>"Zoothera aurea", +"Siberian Thrush"=>"Zoothera sibirica", +"Eyebrowed Thrush"=>"Turdus obscurus", +"Dusky Thrush"=>"Turdus eunomus", +"Black-throated Thrush"=>"Turdus atrogularis", +"Pallas`s Grasshopper Warbler"=>"Locustella certhiola", +"Spectacled Warbler"=>"Sylvia conspicillata", +"Two-barred Warbler"=>"Phylloscopus plumbeitarsus", +"Eastern Bonelli’s Warbler"=>"Phylloscopus orientalis", +"Collared Flycatcher"=>"Ficedula albicollis", +"Wallcreeper"=>"Tichodroma muraria", +"Turkestan Shrike"=>"Lanius phoenicuroides", +"Steppe Grey Shrike"=>"Lanius pallidirostris", +"Spanish Sparrow"=>"Passer hispaniolensis", +"Red-eyed Vireo"=>"Vireo olivaceus", +"Myrtle Warbler"=>"Dendroica coronata", +"White-crowned Sparrow"=>"Zonotrichia leucophrys", +"White-throated Sparrow"=>"Zonotrichia albicollis", +"Cretzschmar`s Bunting"=>"Emberiza caesia", +"Chestnut Bunting"=>"Emberiza rutila", +"Red-headed Bunting"=>"Emberiza bruniceps", +"Black-headed Bunting"=>"Emberiza melanocephala", +"Indigo Bunting"=>"Passerina cyanea", +"Balearic Woodchat Shrike"=>"Lanius senator badius", +"Demoiselle Crane"=>"Grus virgo", +"Chough"=>"Pyrrhocorax pyrrhocorax", +"Red-Billed Chough"=>"Pyrrhocorax graculus", +"Elegant Tern"=>"Sterna elegans", +"Chukar"=>"Alectoris chukar", +"Yellow-Billed Cuckoo"=>"Coccyzus americanus", +"American Sandwich Tern"=>"Sterna sandvicensis acuflavida", +"Olive-Tree Warbler"=>"Hippolais olivetorum", +"Eastern Olivaceous Warbler"=>"Acrocephalus pallidus", +"Indian Cormorant"=>"Phalacrocorax fuscicollis", +"Spur-Winged Lapwing"=>"Vanellus spinosus", +"Yelkouan Shearwater"=>"Puffinus yelkouan", +"Trumpeter Finch"=>"Bucanetes githagineus", +"Red Grouse"=>"Lagopus scoticus", +"Rock Ptarmigan"=>"Lagopus mutus", +"Long-Tailed Cormorant"=>"Phalacrocorax africanus", +"Double-crested Cormorant"=>"Phalacrocorax auritus", +"Magnificent Frigatebird"=>"Fregata magnificens", +"Naumann's Thrush"=>"Turdus naumanni", +"Oriental Pratincole"=>"Glareola maldivarum", +"Bufflehead"=>"Bucephala albeola", +"Snowfinch"=>"Montifrigilla nivalis", +"Ural owl"=>"Strix uralensis", +"Spanish Wagtail"=>"Motacilla iberiae", +"Song Sparrow"=>"Melospiza melodia", +"Rock Bunting"=>"Emberiza cia", +"Siberian Rubythroat"=>"Luscinia calliope", +"Pallid Swift"=>"Apus pallidus", +"Eurasian Pygmy Owl"=>"Glaucidium passerinum", +"Madeira Little Shearwater"=>"Puffinus baroli", +"House Finch"=>"Carpodacus mexicanus", +"Green Heron"=>"Butorides virescens", +"Solitary Sandpiper"=>"Tringa solitaria", +"Heuglin's Gull"=>"Larus heuglini" +); + +foreach ($items as $key=>$value) { + if (strpos(strtolower($key), $q) !== false) { + echo "$key|$value\n"; + } +} + +?> \ No newline at end of file diff --git a/plugins/Autocomplete/jquery-autocomplete/demo/search.phps b/plugins/Autocomplete/jquery-autocomplete/demo/search.phps new file mode 100644 index 000000000..03c0c0eab --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/demo/search.phps @@ -0,0 +1,578 @@ +Bittern"=>"Botaurus stellaris", +"Little Grebe"=>"Tachybaptus ruficollis", +"Black-necked Grebe"=>"Podiceps nigricollis", +"Little Bittern"=>"Ixobrychus minutus", +"Black-crowned Night Heron"=>"Nycticorax nycticorax", +"Purple Heron"=>"Ardea purpurea", +"White Stork"=>"Ciconia ciconia", +"Spoonbill"=>"Platalea leucorodia", +"Red-crested Pochard"=>"Netta rufina", +"Common Eider"=>"Somateria mollissima", +"Red Kite"=>"Milvus milvus", +"Hen Harrier"=>"Circus cyaneus", +"Montagu`s Harrier"=>"Circus pygargus", +"Black Grouse"=>"Tetrao tetrix", +"Grey Partridge"=>"Perdix perdix", +"Spotted Crake"=>"Porzana porzana", +"Corncrake"=>"Crex crex", +"Common Crane"=>"Grus grus", +"Avocet"=>"Recurvirostra avosetta", +"Stone Curlew"=>"Burhinus oedicnemus", +"Common Ringed Plover"=>"Charadrius hiaticula", +"Kentish Plover"=>"Charadrius alexandrinus", +"Ruff"=>"Philomachus pugnax", +"Common Snipe"=>"Gallinago gallinago", +"Black-tailed Godwit"=>"Limosa limosa", +"Common Redshank"=>"Tringa totanus", +"Sandwich Tern"=>"Sterna sandvicensis", +"Common Tern"=>"Sterna hirundo", +"Arctic Tern"=>"Sterna paradisaea", +"Little Tern"=>"Sternula albifrons", +"Black Tern"=>"Chlidonias niger", +"Barn Owl"=>"Tyto alba", +"Little Owl"=>"Athene noctua", +"Short-eared Owl"=>"Asio flammeus", +"European Nightjar"=>"Caprimulgus europaeus", +"Common Kingfisher"=>"Alcedo atthis", +"Eurasian Hoopoe"=>"Upupa epops", +"Eurasian Wryneck"=>"Jynx torquilla", +"European Green Woodpecker"=>"Picus viridis", +"Crested Lark"=>"Galerida cristata", +"White-headed Duck"=>"Oxyura leucocephala", +"Pale-bellied Brent Goose"=>"Branta hrota", +"Tawny Pipit"=>"Anthus campestris", +"Whinchat"=>"Saxicola rubetra", +"European Stonechat"=>"Saxicola rubicola", +"Northern Wheatear"=>"Oenanthe oenanthe", +"Savi`s Warbler"=>"Locustella luscinioides", +"Sedge Warbler"=>"Acrocephalus schoenobaenus", +"Great Reed Warbler"=>"Acrocephalus arundinaceus", +"Bearded Reedling"=>"Panurus biarmicus", +"Red-backed Shrike"=>"Lanius collurio", +"Great Grey Shrike"=>"Lanius excubitor", +"Woodchat Shrike"=>"Lanius senator", +"Common Raven"=>"Corvus corax", +"Yellowhammer"=>"Emberiza citrinella", +"Ortolan Bunting"=>"Emberiza hortulana", +"Corn Bunting"=>"Emberiza calandra", +"Great Cormorant"=>"Phalacrocorax carbo", +"Hawfinch"=>"Coccothraustes coccothraustes", +"Common Shelduck"=>"Tadorna tadorna", +"Bluethroat"=>"Luscinia svecica", +"Grey Heron"=>"Ardea cinerea", +"Barn Swallow"=>"Hirundo rustica", +"Hooded Crow"=>"Corvus cornix", +"Dunlin"=>"Calidris alpina", +"Eurasian Pied Flycatcher"=>"Ficedula hypoleuca", +"Eurasian Nuthatch"=>"Sitta europaea", +"Short-toed Tree Creeper"=>"Certhia brachydactyla", +"Wood Lark"=>"Lullula arborea", +"Tree Pipit"=>"Anthus trivialis", +"Eurasian Hobby"=>"Falco subbuteo", +"Marsh Warbler"=>"Acrocephalus palustris", +"Wood Sandpiper"=>"Tringa glareola", +"Tawny Owl"=>"Strix aluco", +"Lesser Whitethroat"=>"Sylvia curruca", +"Barnacle Goose"=>"Branta leucopsis", +"Common Goldeneye"=>"Bucephala clangula", +"Western Marsh Harrier"=>"Circus aeruginosus", +"Common Buzzard"=>"Buteo buteo", +"Sanderling"=>"Calidris alba", +"Little Gull"=>"Larus minutus", +"Eurasian Magpie"=>"Pica pica", +"Willow Warbler"=>"Phylloscopus trochilus", +"Wood Warbler"=>"Phylloscopus sibilatrix", +"Great Crested Grebe"=>"Podiceps cristatus", +"Eurasian Jay"=>"Garrulus glandarius", +"Common Redstart"=>"Phoenicurus phoenicurus", +"Blue-headed Wagtail"=>"Motacilla flava", +"Common Swift"=>"Apus apus", +"Marsh Tit"=>"Poecile palustris", +"Goldcrest"=>"Regulus regulus", +"European Golden Plover"=>"Pluvialis apricaria", +"Eurasian Bullfinch"=>"Pyrrhula pyrrhula", +"Common Whitethroat"=>"Sylvia communis", +"Meadow Pipit"=>"Anthus pratensis", +"Greylag Goose"=>"Anser anser", +"Spotted Flycatcher"=>"Muscicapa striata", +"European Greenfinch"=>"Carduelis chloris", +"Common Greenshank"=>"Tringa nebularia", +"Great Spotted Woodpecker"=>"Dendrocopos major", +"Greater Canada Goose"=>"Branta canadensis", +"Mistle Thrush"=>"Turdus viscivorus", +"Great Black-backed Gull"=>"Larus marinus", +"Goosander"=>"Mergus merganser", +"Great Egret"=>"Casmerodius albus", +"Northern Goshawk"=>"Accipiter gentilis", +"Dunnock"=>"Prunella modularis", +"Stock Dove"=>"Columba oenas", +"Common Wood Pigeon"=>"Columba palumbus", +"Eurasian Woodcock"=>"Scolopax rusticola", +"House Sparrow"=>"Passer domesticus", +"Common House Martin"=>"Delichon urbicum", +"Red Knot"=>"Calidris canutus", +"Western Jackdaw"=>"Corvus monedula", +"Brambling"=>"Fringilla montifringilla", +"Northern Lapwing"=>"Vanellus vanellus", +"European Reed Warbler"=>"Acrocephalus scirpaceus", +"Lesser Black-backed Gull"=>"Larus fuscus", +"Little Egret"=>"Egretta garzetta", +"Little Stint"=>"Calidris minuta", +"Common Linnet"=>"Carduelis cannabina", +"Mute Swan"=>"Cygnus olor", +"Common Cuckoo"=>"Cuculus canorus", +"Black-headed Gull"=>"Larus ridibundus", +"Greater White-fronted Goose"=>"Anser albifrons", +"Great Tit"=>"Parus major", +"Redwing"=>"Turdus iliacus", +"Gadwall"=>"Anas strepera", +"Fieldfare"=>"Turdus pilaris", +"Tufted Duck"=>"Aythya fuligula", +"Crested Tit"=>"Lophophanes cristatus", +"Willow Tit"=>"Poecile montanus", +"Eurasian Coot"=>"Fulica atra", +"Common Blackbird"=>"Turdus merula", +"Smew"=>"Mergus albellus", +"Common Sandpiper"=>"Actitis hypoleucos", +"Sand Martin"=>"Riparia riparia", +"Purple Sandpiper"=>"Calidris maritima", +"Northern Pintail"=>"Anas acuta", +"Blue Tit"=>"Cyanistes caeruleus", +"European Goldfinch"=>"Carduelis carduelis", +"Eurasian Whimbrel"=>"Numenius phaeopus", +"Common Reed Bunting"=>"Emberiza schoeniclus", +"Eurasian Tree Sparrow"=>"Passer montanus", +"Rook"=>"Corvus frugilegus", +"European Robin"=>"Erithacus rubecula", +"Bar-tailed Godwit"=>"Limosa lapponica", +"Dark-bellied Brent Goose"=>"Branta bernicla", +"Eurasian Oystercatcher"=>"Haematopus ostralegus", +"Eurasian Siskin"=>"Carduelis spinus", +"Northern Shoveler"=>"Anas clypeata", +"Eurasian Wigeon"=>"Anas penelope", +"Eurasian Sparrow Hawk"=>"Accipiter nisus", +"Icterine Warbler"=>"Hippolais icterina", +"Common Starling"=>"Sturnus vulgaris", +"Long-tailed Tit"=>"Aegithalos caudatus", +"Ruddy Turnstone"=>"Arenaria interpres", +"Mew Gull"=>"Larus canus", +"Common Pochard"=>"Aythya ferina", +"Common Chiffchaff"=>"Phylloscopus collybita", +"Greater Scaup"=>"Aythya marila", +"Common Kestrel"=>"Falco tinnunculus", +"Garden Warbler"=>"Sylvia borin", +"Eurasian Collared Dove"=>"Streptopelia decaocto", +"Eurasian Skylark"=>"Alauda arvensis", +"Common Chaffinch"=>"Fringilla coelebs", +"Common Moorhen"=>"Gallinula chloropus", +"Water Pipit"=>"Anthus spinoletta", +"Mallard"=>"Anas platyrhynchos", +"Winter Wren"=>"Troglodytes troglodytes", +"Common Teal"=>"Anas crecca", +"Green Sandpiper"=>"Tringa ochropus", +"White Wagtail"=>"Motacilla alba", +"Eurasian Curlew"=>"Numenius arquata", +"Song Thrush"=>"Turdus philomelos", +"European Herring Gull"=>"Larus argentatus", +"Grey Plover"=>"Pluvialis squatarola", +"Carrion Crow"=>"Corvus corone", +"Coal Tit"=>"Periparus ater", +"Spotted Redshank"=>"Tringa erythropus", +"Blackcap"=>"Sylvia atricapilla", +"Egyptian Vulture"=>"Neophron percnopterus", +"Razorbill"=>"Alca torda", +"Alpine Swift"=>"Apus melba", +"Long-legged Buzzard"=>"Buteo rufinus", +"Audouin`s Gull"=>"Larus audouinii", +"Balearic Shearwater"=>"Puffinus mauretanicus", +"Upland Sandpiper"=>"Bartramia longicauda", +"Greater Spotted Eagle"=>"Aquila clanga", +"Ring Ouzel"=>"Turdus torquatus", +"Yellow-browed Warbler"=>"Phylloscopus inornatus", +"Blue Rock Thrush"=>"Monticola solitarius", +"Buff-breasted Sandpiper"=>"Tryngites subruficollis", +"Jack Snipe"=>"Lymnocryptes minimus", +"White-rumped Sandpiper"=>"Calidris fuscicollis", +"Ruddy Shelduck"=>"Tadorna ferruginea", +"Cetti's Warbler"=>"Cettia cetti", +"Citrine Wagtail"=>"Motacilla citreola", +"Roseate Tern"=>"Sterna dougallii", +"Black-legged Kittiwake"=>"Rissa tridactyla", +"Pygmy Cormorant"=>"Phalacrocorax pygmeus", +"Booted Eagle"=>"Aquila pennata", +"Lesser White-fronted Goose"=>"Anser erythropus", +"Little Bunting"=>"Emberiza pusilla", +"Eleonora's Falcon"=>"Falco eleonorae", +"European Serin"=>"Serinus serinus", +"Twite"=>"Carduelis flavirostris", +"Yellow-legged Gull"=>"Larus michahellis", +"Gyr Falcon"=>"Falco rusticolus", +"Greenish Warbler"=>"Phylloscopus trochiloides", +"Red-necked Phalarope"=>"Phalaropus lobatus", +"Mealy Redpoll"=>"Carduelis flammea", +"Glaucous Gull"=>"Larus hyperboreus", +"Great Skua"=>"Stercorarius skua", +"Great Bustard"=>"Otis tarda", +"Velvet Scoter"=>"Melanitta fusca", +"Pine Grosbeak"=>"Pinicola enucleator", +"House Crow"=>"Corvus splendens", +"Hume`s Leaf Warbler"=>"Phylloscopus humei", +"Great Northern Loon"=>"Gavia immer", +"Long-tailed Duck"=>"Clangula hyemalis", +"Lapland Longspur"=>"Calcarius lapponicus", +"Northern Gannet"=>"Morus bassanus", +"Eastern Imperial Eagle"=>"Aquila heliaca", +"Little Auk"=>"Alle alle", +"Lesser Spotted Woodpecker"=>"Dendrocopos minor", +"Iceland Gull"=>"Larus glaucoides", +"Parasitic Jaeger"=>"Stercorarius parasiticus", +"Bewick`s Swan"=>"Cygnus bewickii", +"Little Bustard"=>"Tetrax tetrax", +"Little Crake"=>"Porzana parva", +"Baillon`s Crake"=>"Porzana pusilla", +"Long-tailed Jaeger"=>"Stercorarius longicaudus", +"King Eider"=>"Somateria spectabilis", +"Greater Short-toed Lark"=>"Calandrella brachydactyla", +"Houbara Bustard"=>"Chlamydotis undulata", +"Curlew Sandpiper"=>"Calidris ferruginea", +"Common Crossbill"=>"Loxia curvirostra", +"European Shag"=>"Phalacrocorax aristotelis", +"Horned Grebe"=>"Podiceps auritus", +"Common Quail"=>"Coturnix coturnix", +"Bearded Vulture"=>"Gypaetus barbatus", +"Lanner Falcon"=>"Falco biarmicus", +"Middle Spotted Woodpecker"=>"Dendrocopos medius", +"Pomarine Jaeger"=>"Stercorarius pomarinus", +"Red-breasted Merganser"=>"Mergus serrator", +"Eurasian Black Vulture"=>"Aegypius monachus", +"Eurasian Dotterel"=>"Charadrius morinellus", +"Common Nightingale"=>"Luscinia megarhynchos", +"Northern willow warbler"=>"Phylloscopus trochilus acredula", +"Manx Shearwater"=>"Puffinus puffinus", +"Northern Fulmar"=>"Fulmarus glacialis", +"Eurasian Eagle Owl"=>"Bubo bubo", +"Orphean Warbler"=>"Sylvia hortensis", +"Melodious Warbler"=>"Hippolais polyglotta", +"Pallas's Leaf Warbler"=>"Phylloscopus proregulus", +"Atlantic Puffin"=>"Fratercula arctica", +"Black-throated Loon"=>"Gavia arctica", +"Bohemian Waxwing"=>"Bombycilla garrulus", +"Marsh Sandpiper"=>"Tringa stagnatilis", +"Great Snipe"=>"Gallinago media", +"Squacco Heron"=>"Ardeola ralloides", +"Long-eared Owl"=>"Asio otus", +"Caspian Tern"=>"Hydroprogne caspia", +"Red-breasted Goose"=>"Branta ruficollis", +"Red-throated Loon"=>"Gavia stellata", +"Common Rosefinch"=>"Carpodacus erythrinus", +"Red-footed Falcon"=>"Falco vespertinus", +"Ross's Goose"=>"Anser rossii", +"Red Phalarope"=>"Phalaropus fulicarius", +"Pied Wagtail"=>"Motacilla yarrellii", +"Rose-coloured Starling"=>"Sturnus roseus", +"Rough-legged Buzzard"=>"Buteo lagopus", +"Saker Falcon"=>"Falco cherrug", +"European Roller"=>"Coracias garrulus", +"Short-toed Eagle"=>"Circaetus gallicus", +"Peregrine Falcon"=>"Falco peregrinus", +"Merlin"=>"Falco columbarius", +"Snow Goose"=>"Anser caerulescens", +"Snowy Owl"=>"Bubo scandiacus", +"Snow Bunting"=>"Plectrophenax nivalis", +"Common Grasshopper Warbler"=>"Locustella naevia", +"Golden Eagle"=>"Aquila chrysaetos", +"Black-winged Stilt"=>"Himantopus himantopus", +"Steppe Eagle"=>"Aquila nipalensis", +"Pallid Harrier"=>"Circus macrourus", +"European Storm-petrel"=>"Hydrobates pelagicus", +"Horned Lark"=>"Eremophila alpestris", +"Eurasian Treecreeper"=>"Certhia familiaris", +"Taiga Bean Goose"=>"Anser fabalis", +"Temminck`s Stint"=>"Calidris temminckii", +"Terek Sandpiper"=>"Xenus cinereus", +"Tundra Bean Goose"=>"Anser serrirostris", +"European Turtle Dove"=>"Streptopelia turtur", +"Leach`s Storm-petrel"=>"Oceanodroma leucorhoa", +"Eurasian Griffon Vulture"=>"Gyps fulvus", +"Paddyfield Warbler"=>"Acrocephalus agricola", +"Osprey"=>"Pandion haliaetus", +"Firecrest"=>"Regulus ignicapilla", +"Water Rail"=>"Rallus aquaticus", +"European Honey Buzzard"=>"Pernis apivorus", +"Eurasian Golden Oriole"=>"Oriolus oriolus", +"Whooper Swan"=>"Cygnus cygnus", +"Two-barred Crossbill"=>"Loxia leucoptera", +"White-tailed Eagle"=>"Haliaeetus albicilla", +"Atlantic Murre"=>"Uria aalge", +"Garganey"=>"Anas querquedula", +"Black Redstart"=>"Phoenicurus ochruros", +"Common Scoter"=>"Melanitta nigra", +"Rock Pipit"=>"Anthus petrosus", +"Lesser Spotted Eagle"=>"Aquila pomarina", +"Cattle Egret"=>"Bubulcus ibis", +"White-winged Black Tern"=>"Chlidonias leucopterus", +"Black Stork"=>"Ciconia nigra", +"Mediterranean Gull"=>"Larus melanocephalus", +"Black Kite"=>"Milvus migrans", +"Yellow Wagtail"=>"Motacilla flavissima", +"Red-necked Grebe"=>"Podiceps grisegena", +"Gull-billed Tern"=>"Gelochelidon nilotica", +"Pectoral Sandpiper"=>"Calidris melanotos", +"Barred Warbler"=>"Sylvia nisoria", +"Red-throated Pipit"=>"Anthus cervinus", +"Grey Wagtail"=>"Motacilla cinerea", +"Richard`s Pipit"=>"Anthus richardi", +"Black Woodpecker"=>"Dryocopus martius", +"Little Ringed Plover"=>"Charadrius dubius", +"Whiskered Tern"=>"Chlidonias hybrida", +"Lesser Redpoll"=>"Carduelis cabaret", +"Pallas' Bunting"=>"Emberiza pallasi", +"Ferruginous Duck"=>"Aythya nyroca", +"Whistling Swan"=>"Cygnus columbianus", +"Black Brant"=>"Branta nigricans", +"Marbled Teal"=>"Marmaronetta angustirostris", +"Canvasback"=>"Aythya valisineria", +"Redhead"=>"Aythya americana", +"Lesser Scaup"=>"Aythya affinis", +"Steller`s Eider"=>"Polysticta stelleri", +"Spectacled Eider"=>"Somateria fischeri", +"Harlequin Duck"=>"Histronicus histrionicus", +"Black Scoter"=>"Melanitta americana", +"Surf Scoter"=>"Melanitta perspicillata", +"Barrow`s Goldeneye"=>"Bucephala islandica", +"Falcated Duck"=>"Anas falcata", +"American Wigeon"=>"Anas americana", +"Blue-winged Teal"=>"Anas discors", +"American Black Duck"=>"Anas rubripes", +"Baikal Teal"=>"Anas formosa", +"Green-Winged Teal"=>"Anas carolinensis", +"Hazel Grouse"=>"Bonasa bonasia", +"Rock Partridge"=>"Alectoris graeca", +"Red-legged Partridge"=>"Alectoris rufa", +"Yellow-billed Loon"=>"Gavia adamsii", +"Cory`s Shearwater"=>"Calonectris borealis", +"Madeiran Storm-Petrel"=>"Oceanodroma castro", +"Great White Pelican"=>"Pelecanus onocrotalus", +"Dalmatian Pelican"=>"Pelecanus crispus", +"American Bittern"=>"Botaurus lentiginosus", +"Glossy Ibis"=>"Plegadis falcinellus", +"Spanish Imperial Eagle"=>"Aquila adalberti", +"Lesser Kestrel"=>"Falco naumanni", +"Houbara Bustard"=>"Chlamydotis undulata", +"Crab-Plover"=>"Dromas ardeola", +"Cream-coloured Courser"=>"Cursorius cursor", +"Collared Pratincole"=>"Glareola pratincola", +"Black-winged Pratincole"=>"Glareola nordmanni", +"Killdeer"=>"Charadrius vociferus", +"Lesser Sand Plover"=>"Charadrius mongolus", +"Greater Sand Plover"=>"Charadrius leschenaultii", +"Caspian Plover"=>"Charadrius asiaticus", +"American Golden Plover"=>"Pluvialis dominica", +"Pacific Golden Plover"=>"Pluvialis fulva", +"Sharp-tailed Sandpiper"=>"Calidris acuminata", +"Broad-billed Sandpiper"=>"Limicola falcinellus", +"Spoon-Billed Sandpiper"=>"Eurynorhynchus pygmaeus", +"Short-Billed Dowitcher"=>"Limnodromus griseus", +"Long-billed Dowitcher"=>"Limnodromus scolopaceus", +"Hudsonian Godwit"=>"Limosa haemastica", +"Little Curlew"=>"Numenius minutus", +"Lesser Yellowlegs"=>"Tringa flavipes", +"Wilson`s Phalarope"=>"Phalaropus tricolor", +"Pallas`s Gull"=>"Larus ichthyaetus", +"Laughing Gull"=>"Larus atricilla", +"Franklin`s Gull"=>"Larus pipixcan", +"Bonaparte`s Gull"=>"Larus philadelphia", +"Ring-billed Gull"=>"Larus delawarensis", +"American Herring Gull"=>"Larus smithsonianus", +"Caspian Gull"=>"Larus cachinnans", +"Ivory Gull"=>"Pagophila eburnea", +"Royal Tern"=>"Sterna maxima", +"Brünnich`s Murre"=>"Uria lomvia", +"Crested Auklet"=>"Aethia cristatella", +"Parakeet Auklet"=>"Cyclorrhynchus psittacula", +"Tufted Puffin"=>"Lunda cirrhata", +"Laughing Dove"=>"Streptopelia senegalensis", +"Great Spotted Cuckoo"=>"Clamator glandarius", +"Great Grey Owl"=>"Strix nebulosa", +"Tengmalm`s Owl"=>"Aegolius funereus", +"Red-Necked Nightjar"=>"Caprimulgus ruficollis", +"Chimney Swift"=>"Chaetura pelagica", +"Green Bea-Eater"=>"Merops orientalis", +"Grey-headed Woodpecker"=>"Picus canus", +"Lesser Short-Toed Lark"=>"Calandrella rufescens", +"Eurasian Crag Martin"=>"Hirundo rupestris", +"Red-rumped Swallow"=>"Cecropis daurica", +"Blyth`s Pipit"=>"Anthus godlewskii", +"Pechora Pipit"=>"Anthus gustavi", +"Grey-headed Wagtail"=>"Motacilla thunbergi", +"Yellow-Headed Wagtail"=>"Motacilla lutea", +"White-throated Dipper"=>"Cinclus cinclus", +"Rufous-Tailed Scrub Robin"=>"Cercotrichas galactotes", +"Thrush Nightingale"=>"Luscinia luscinia", +"White-throated Robin"=>"Irania gutturalis", +"Caspian Stonechat"=>"Saxicola maura variegata", +"Western Black-eared Wheatear"=>"Oenanthe hispanica", +"Rufous-tailed Rock Thrush"=>"Monticola saxatilis", +"Red-throated Thrush/Black-throated"=>"Turdus ruficollis", +"American Robin"=>"Turdus migratorius", +"Zitting Cisticola"=>"Cisticola juncidis", +"Lanceolated Warbler"=>"Locustella lanceolata", +"River Warbler"=>"Locustella fluviatilis", +"Blyth`s Reed Warbler"=>"Acrocephalus dumetorum", +"Caspian Reed Warbler"=>"Acrocephalus fuscus", +"Aquatic Warbler"=>"Acrocephalus paludicola", +"Booted Warbler"=>"Acrocephalus caligatus", +"Marmora's Warbler"=>"Sylvia sarda", +"Dartford Warbler"=>"Sylvia undata", +"Subalpine Warbler"=>"Sylvia cantillans", +"Ménétries's Warbler"=>"Sylvia mystacea", +"Rüppel's Warbler"=>"Sylvia rueppelli", +"Asian Desert Warbler"=>"Sylvia nana", +"Western Orphean Warbler"=>"Sylvia hortensis hortensis", +"Arctic Warbler"=>"Phylloscopus borealis", +"Radde`s Warbler"=>"Phylloscopus schwarzi", +"Western Bonelli`s Warbler"=>"Phylloscopus bonelli", +"Red-breasted Flycatcher"=>"Ficedula parva", +"Eurasian Penduline Tit"=>"Remiz pendulinus", +"Daurian Shrike"=>"Lanius isabellinus", +"Long-Tailed Shrike"=>"Lanius schach", +"Lesser Grey Shrike"=>"Lanius minor", +"Southern Grey Shrike"=>"Lanius meridionalis", +"Masked Shrike"=>"Lanius nubicus", +"Spotted Nutcracker"=>"Nucifraga caryocatactes", +"Daurian Jackdaw"=>"Corvus dauuricus", +"Purple-Backed Starling"=>"Sturnus sturninus", +"Red-Fronted Serin"=>"Serinus pusillus", +"Arctic Redpoll"=>"Carduelis hornemanni", +"Scottish Crossbill"=>"Loxia scotica", +"Parrot Crossbill"=>"Loxia pytyopsittacus", +"Black-faced Bunting"=>"Emberiza spodocephala", +"Pink-footed Goose"=>"Anser brachyrhynchus", +"Black-winged Kite"=>"Elanus caeruleus", +"European Bee-eater"=>"Merops apiaster", +"Sabine`s Gull"=>"Larus sabini", +"Sooty Shearwater"=>"Puffinus griseus", +"Lesser Canada Goose"=>"Branta hutchinsii", +"Ring-necked Duck"=>"Aythya collaris", +"Greater Flamingo"=>"Phoenicopterus roseus", +"Iberian Chiffchaff"=>"Phylloscopus ibericus", +"Ashy-headed Wagtail"=>"Motacilla cinereocapilla", +"Stilt Sandpiper"=>"Calidris himantopus", +"Siberian Stonechat"=>"Saxicola maurus", +"Greater Yellowlegs"=>"Tringa melanoleuca", +"Forster`s Tern"=>"Sterna forsteri", +"Dusky Warbler"=>"Phylloscopus fuscatus", +"Cirl Bunting"=>"Emberiza cirlus", +"Olive-backed Pipit"=>"Anthus hodgsoni", +"Sociable Lapwing"=>"Vanellus gregarius", +"Spotted Sandpiper"=>"Actitis macularius", +"Baird`s Sandpiper"=>"Calidris bairdii", +"Rustic Bunting"=>"Emberiza rustica", +"Yellow-browed Bunting"=>"Emberiza chrysophrys", +"Great Shearwater"=>"Puffinus gravis", +"Bonelli`s Eagle"=>"Aquila fasciata", +"Calandra Lark"=>"Melanocorypha calandra", +"Sardinian Warbler"=>"Sylvia melanocephala", +"Ross's Gull"=>"Larus roseus", +"Yellow-Breasted Bunting"=>"Emberiza aureola", +"Pine Bunting"=>"Emberiza leucocephalos", +"Black Guillemot"=>"Cepphus grylle", +"Pied-billed Grebe"=>"Podilymbus podiceps", +"Soft-plumaged Petrel"=>"Pterodroma mollis", +"Bulwer's Petrel"=>"Bulweria bulwerii", +"White-Faced Storm-Petrel"=>"Pelagodroma marina", +"Pallas’s Fish Eagle"=>"Haliaeetus leucoryphus", +"Sandhill Crane"=>"Grus canadensis", +"Macqueen’s Bustard"=>"Chlamydotis macqueenii", +"White-tailed Lapwing"=>"Vanellus leucurus", +"Great Knot"=>"Calidris tenuirostris", +"Semipalmated Sandpiper"=>"Calidris pusilla", +"Red-necked Stint"=>"Calidris ruficollis", +"Slender-billed Curlew"=>"Numenius tenuirostris", +"Bridled Tern"=>"Onychoprion anaethetus", +"Pallas’s Sandgrouse"=>"Syrrhaptes paradoxus", +"European Scops Owl"=>"Otus scops", +"Northern Hawk Owl"=>"Surnia ulula", +"White-Throated Needletail"=>"Hirundapus caudacutus", +"Belted Kingfisher"=>"Ceryle alcyon", +"Blue-cheeked Bee-eater"=>"Merops persicus", +"Black-headed Wagtail"=>"Motacilla feldegg", +"Northern Mockingbird"=>"Mimus polyglottos", +"Alpine Accentor"=>"Prunella collaris", +"Red-flanked Bluetail"=>"Tarsiger cyanurus", +"Isabelline Wheatear"=>"Oenanthe isabellina", +"Pied Wheatear"=>"Oenanthe pleschanka", +"Eastern Black-eared Wheatear"=>"Oenanthe melanoleuca", +"Desert Wheatear"=>"Oenanthe deserti", +"White`s Thrush"=>"Zoothera aurea", +"Siberian Thrush"=>"Zoothera sibirica", +"Eyebrowed Thrush"=>"Turdus obscurus", +"Dusky Thrush"=>"Turdus eunomus", +"Black-throated Thrush"=>"Turdus atrogularis", +"Pallas`s Grasshopper Warbler"=>"Locustella certhiola", +"Spectacled Warbler"=>"Sylvia conspicillata", +"Two-barred Warbler"=>"Phylloscopus plumbeitarsus", +"Eastern Bonelli’s Warbler"=>"Phylloscopus orientalis", +"Collared Flycatcher"=>"Ficedula albicollis", +"Wallcreeper"=>"Tichodroma muraria", +"Turkestan Shrike"=>"Lanius phoenicuroides", +"Steppe Grey Shrike"=>"Lanius pallidirostris", +"Spanish Sparrow"=>"Passer hispaniolensis", +"Red-eyed Vireo"=>"Vireo olivaceus", +"Myrtle Warbler"=>"Dendroica coronata", +"White-crowned Sparrow"=>"Zonotrichia leucophrys", +"White-throated Sparrow"=>"Zonotrichia albicollis", +"Cretzschmar`s Bunting"=>"Emberiza caesia", +"Chestnut Bunting"=>"Emberiza rutila", +"Red-headed Bunting"=>"Emberiza bruniceps", +"Black-headed Bunting"=>"Emberiza melanocephala", +"Indigo Bunting"=>"Passerina cyanea", +"Balearic Woodchat Shrike"=>"Lanius senator badius", +"Demoiselle Crane"=>"Grus virgo", +"Chough"=>"Pyrrhocorax pyrrhocorax", +"Red-Billed Chough"=>"Pyrrhocorax graculus", +"Elegant Tern"=>"Sterna elegans", +"Chukar"=>"Alectoris chukar", +"Yellow-Billed Cuckoo"=>"Coccyzus americanus", +"American Sandwich Tern"=>"Sterna sandvicensis acuflavida", +"Olive-Tree Warbler"=>"Hippolais olivetorum", +"Eastern Olivaceous Warbler"=>"Acrocephalus pallidus", +"Indian Cormorant"=>"Phalacrocorax fuscicollis", +"Spur-Winged Lapwing"=>"Vanellus spinosus", +"Yelkouan Shearwater"=>"Puffinus yelkouan", +"Trumpeter Finch"=>"Bucanetes githagineus", +"Red Grouse"=>"Lagopus scoticus", +"Rock Ptarmigan"=>"Lagopus mutus", +"Long-Tailed Cormorant"=>"Phalacrocorax africanus", +"Double-crested Cormorant"=>"Phalacrocorax auritus", +"Magnificent Frigatebird"=>"Fregata magnificens", +"Naumann's Thrush"=>"Turdus naumanni", +"Oriental Pratincole"=>"Glareola maldivarum", +"Bufflehead"=>"Bucephala albeola", +"Snowfinch"=>"Montifrigilla nivalis", +"Ural owl"=>"Strix uralensis", +"Spanish Wagtail"=>"Motacilla iberiae", +"Song Sparrow"=>"Melospiza melodia", +"Rock Bunting"=>"Emberiza cia", +"Siberian Rubythroat"=>"Luscinia calliope", +"Pallid Swift"=>"Apus pallidus", +"Eurasian Pygmy Owl"=>"Glaucidium passerinum", +"Madeira Little Shearwater"=>"Puffinus baroli", +"House Finch"=>"Carpodacus mexicanus", +"Green Heron"=>"Butorides virescens", +"Solitary Sandpiper"=>"Tringa solitaria", +"Heuglin's Gull"=>"Larus heuglini" +); + +foreach ($items as $key=>$value) { + if (strpos(strtolower($key), $q) !== false) { + echo "$key|$value\n"; + } +} + +?> \ No newline at end of file diff --git a/plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.css b/plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.css new file mode 100644 index 000000000..91b622833 --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.css @@ -0,0 +1,48 @@ +.ac_results { + padding: 0px; + border: 1px solid black; + background-color: white; + overflow: hidden; + z-index: 99999; +} + +.ac_results ul { + width: 100%; + list-style-position: outside; + list-style: none; + padding: 0; + margin: 0; +} + +.ac_results li { + margin: 0px; + padding: 2px 5px; + cursor: default; + display: block; + /* + if width will be 100% horizontal scrollbar will apear + when scroll mode will be used + */ + /*width: 100%;*/ + font: menu; + font-size: 12px; + /* + it is very important, if line-height not setted or setted + in relative units scroll will be broken in firefox + */ + line-height: 16px; + overflow: hidden; +} + +.ac_loading { + background: white url('indicator.gif') right center no-repeat; +} + +.ac_odd { + background-color: #eee; +} + +.ac_over { + background-color: #0A246A; + color: white; +} diff --git a/plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.js b/plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.js new file mode 100644 index 000000000..5ad9178f8 --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.js @@ -0,0 +1,759 @@ +/* + * Autocomplete - jQuery plugin 1.0.2 + * + * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $ + * + */ + +;(function($) { + +$.fn.extend({ + autocomplete: function(urlOrData, options) { + var isUrl = typeof urlOrData == "string"; + options = $.extend({}, $.Autocompleter.defaults, { + url: isUrl ? urlOrData : null, + data: isUrl ? null : urlOrData, + delay: isUrl ? $.Autocompleter.defaults.delay : 10, + max: options && !options.scroll ? 10 : 150 + }, options); + + // if highlight is set to false, replace it with a do-nothing function + options.highlight = options.highlight || function(value) { return value; }; + + // if the formatMatch option is not specified, then use formatItem for backwards compatibility + options.formatMatch = options.formatMatch || options.formatItem; + + return this.each(function() { + new $.Autocompleter(this, options); + }); + }, + result: function(handler) { + return this.bind("result", handler); + }, + search: function(handler) { + return this.trigger("search", [handler]); + }, + flushCache: function() { + return this.trigger("flushCache"); + }, + setOptions: function(options){ + return this.trigger("setOptions", [options]); + }, + unautocomplete: function() { + return this.trigger("unautocomplete"); + } +}); + +$.Autocompleter = function(input, options) { + + var KEY = { + UP: 38, + DOWN: 40, + DEL: 46, + TAB: 9, + RETURN: 13, + ESC: 27, + COMMA: 188, + PAGEUP: 33, + PAGEDOWN: 34, + BACKSPACE: 8 + }; + + // Create $ object for input element + var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass); + + var timeout; + var previousValue = ""; + var cache = $.Autocompleter.Cache(options); + var hasFocus = 0; + var lastKeyPressCode; + var config = { + mouseDownOnSelect: false + }; + var select = $.Autocompleter.Select(options, input, selectCurrent, config); + + var blockSubmit; + + // prevent form submit in opera when selecting with return key + $.browser.opera && $(input.form).bind("submit.autocomplete", function() { + if (blockSubmit) { + blockSubmit = false; + return false; + } + }); + + // only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all + $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) { + // track last key pressed + lastKeyPressCode = event.keyCode; + switch(event.keyCode) { + + case KEY.UP: + event.preventDefault(); + if ( select.visible() ) { + select.prev(); + } else { + onChange(0, true); + } + break; + + case KEY.DOWN: + event.preventDefault(); + if ( select.visible() ) { + select.next(); + } else { + onChange(0, true); + } + break; + + case KEY.PAGEUP: + event.preventDefault(); + if ( select.visible() ) { + select.pageUp(); + } else { + onChange(0, true); + } + break; + + case KEY.PAGEDOWN: + event.preventDefault(); + if ( select.visible() ) { + select.pageDown(); + } else { + onChange(0, true); + } + break; + + // matches also semicolon + case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA: + case KEY.TAB: + case KEY.RETURN: + if( selectCurrent() ) { + // stop default to prevent a form submit, Opera needs special handling + event.preventDefault(); + blockSubmit = true; + return false; + } + break; + + case KEY.ESC: + select.hide(); + break; + + default: + clearTimeout(timeout); + timeout = setTimeout(onChange, options.delay); + break; + } + }).focus(function(){ + // track whether the field has focus, we shouldn't process any + // results if the field no longer has focus + hasFocus++; + }).blur(function() { + hasFocus = 0; + if (!config.mouseDownOnSelect) { + hideResults(); + } + }).click(function() { + // show select when clicking in a focused field + if ( hasFocus++ > 1 && !select.visible() ) { + onChange(0, true); + } + }).bind("search", function() { + // TODO why not just specifying both arguments? + var fn = (arguments.length > 1) ? arguments[1] : null; + function findValueCallback(q, data) { + var result; + if( data && data.length ) { + for (var i=0; i < data.length; i++) { + if( data[i].result.toLowerCase() == q.toLowerCase() ) { + result = data[i]; + break; + } + } + } + if( typeof fn == "function" ) fn(result); + else $input.trigger("result", result && [result.data, result.value]); + } + $.each(trimWords($input.val()), function(i, value) { + request(value, findValueCallback, findValueCallback); + }); + }).bind("flushCache", function() { + cache.flush(); + }).bind("setOptions", function() { + $.extend(options, arguments[1]); + // if we've updated the data, repopulate + if ( "data" in arguments[1] ) + cache.populate(); + }).bind("unautocomplete", function() { + select.unbind(); + $input.unbind(); + $(input.form).unbind(".autocomplete"); + }); + + + function selectCurrent() { + var selected = select.selected(); + if( !selected ) + return false; + + var v = selected.result; + previousValue = v; + + if ( options.multiple ) { + var words = trimWords($input.val()); + if ( words.length > 1 ) { + v = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v; + } + v += options.multipleSeparator; + } + + $input.val(v); + hideResultsNow(); + $input.trigger("result", [selected.data, selected.value]); + return true; + } + + function onChange(crap, skipPrevCheck) { + if( lastKeyPressCode == KEY.DEL ) { + select.hide(); + return; + } + + var currentValue = $input.val(); + + if ( !skipPrevCheck && currentValue == previousValue ) + return; + + previousValue = currentValue; + + currentValue = lastWord(currentValue); + if ( currentValue.length >= options.minChars) { + $input.addClass(options.loadingClass); + if (!options.matchCase) + currentValue = currentValue.toLowerCase(); + request(currentValue, receiveData, hideResultsNow); + } else { + stopLoading(); + select.hide(); + } + }; + + function trimWords(value) { + if ( !value ) { + return [""]; + } + var words = value.split( options.multipleSeparator ); + var result = []; + $.each(words, function(i, value) { + if ( $.trim(value) ) + result[i] = $.trim(value); + }); + return result; + } + + function lastWord(value) { + if ( !options.multiple ) + return value; + var words = trimWords(value); + return words[words.length - 1]; + } + + // fills in the input box w/the first match (assumed to be the best match) + // q: the term entered + // sValue: the first matching result + function autoFill(q, sValue){ + // autofill in the complete box w/the first match as long as the user hasn't entered in more data + // if the last user key pressed was backspace, don't autofill + if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) { + // fill in the value (keep the case the user has typed) + $input.val($input.val() + sValue.substring(lastWord(previousValue).length)); + // select the portion of the value not typed by the user (so the next character will erase) + $.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length); + } + }; + + function hideResults() { + clearTimeout(timeout); + timeout = setTimeout(hideResultsNow, 200); + }; + + function hideResultsNow() { + var wasVisible = select.visible(); + select.hide(); + clearTimeout(timeout); + stopLoading(); + if (options.mustMatch) { + // call search and run callback + $input.search( + function (result){ + // if no value found, clear the input box + if( !result ) { + if (options.multiple) { + var words = trimWords($input.val()).slice(0, -1); + $input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") ); + } + else + $input.val( "" ); + } + } + ); + } + if (wasVisible) + // position cursor at end of input field + $.Autocompleter.Selection(input, input.value.length, input.value.length); + }; + + function receiveData(q, data) { + if ( data && data.length && hasFocus ) { + stopLoading(); + select.display(data, q); + autoFill(q, data[0].value); + select.show(); + } else { + hideResultsNow(); + } + }; + + function request(term, success, failure) { + if (!options.matchCase) + term = term.toLowerCase(); + var data = cache.load(term); + // recieve the cached data + if (data && data.length) { + success(term, data); + // if an AJAX url has been supplied, try loading the data now + } else if( (typeof options.url == "string") && (options.url.length > 0) ){ + + var extraParams = { + timestamp: +new Date() + }; + $.each(options.extraParams, function(key, param) { + extraParams[key] = typeof param == "function" ? param() : param; + }); + + $.ajax({ + // try to leverage ajaxQueue plugin to abort previous requests + mode: "abort", + // limit abortion to this input + port: "autocomplete" + input.name, + dataType: options.dataType, + url: options.url, + data: $.extend({ + q: lastWord(term), + limit: options.max + }, extraParams), + success: function(data) { + var parsed = options.parse && options.parse(data) || parse(data); + cache.add(term, parsed); + success(term, parsed); + } + }); + } else { + // if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match + select.emptyList(); + failure(term); + } + }; + + function parse(data) { + var parsed = []; + var rows = data.split("\n"); + for (var i=0; i < rows.length; i++) { + var row = $.trim(rows[i]); + if (row) { + row = row.split("|"); + parsed[parsed.length] = { + data: row, + value: row[0], + result: options.formatResult && options.formatResult(row, row[0]) || row[0] + }; + } + } + return parsed; + }; + + function stopLoading() { + $input.removeClass(options.loadingClass); + }; + +}; + +$.Autocompleter.defaults = { + inputClass: "ac_input", + resultsClass: "ac_results", + loadingClass: "ac_loading", + minChars: 1, + delay: 400, + matchCase: false, + matchSubset: true, + matchContains: false, + cacheLength: 10, + max: 100, + mustMatch: false, + extraParams: {}, + selectFirst: true, + formatItem: function(row) { return row[0]; }, + formatMatch: null, + autoFill: false, + width: 0, + multiple: false, + multipleSeparator: ", ", + highlight: function(value, term) { + return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1"); + }, + scroll: true, + scrollHeight: 180 +}; + +$.Autocompleter.Cache = function(options) { + + var data = {}; + var length = 0; + + function matchSubset(s, sub) { + if (!options.matchCase) + s = s.toLowerCase(); + var i = s.indexOf(sub); + if (i == -1) return false; + return i == 0 || options.matchContains; + }; + + function add(q, value) { + if (length > options.cacheLength){ + flush(); + } + if (!data[q]){ + length++; + } + data[q] = value; + } + + function populate(){ + if( !options.data ) return false; + // track the matches + var stMatchSets = {}, + nullData = 0; + + // no url was specified, we need to adjust the cache length to make sure it fits the local data store + if( !options.url ) options.cacheLength = 1; + + // track all options for minChars = 0 + stMatchSets[""] = []; + + // loop through the array and create a lookup structure + for ( var i = 0, ol = options.data.length; i < ol; i++ ) { + var rawValue = options.data[i]; + // if rawValue is a string, make an array otherwise just reference the array + rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue; + + var value = options.formatMatch(rawValue, i+1, options.data.length); + if ( value === false ) + continue; + + var firstChar = value.charAt(0).toLowerCase(); + // if no lookup array for this character exists, look it up now + if( !stMatchSets[firstChar] ) + stMatchSets[firstChar] = []; + + // if the match is a string + var row = { + value: value, + data: rawValue, + result: options.formatResult && options.formatResult(rawValue) || value + }; + + // push the current match into the set list + stMatchSets[firstChar].push(row); + + // keep track of minChars zero items + if ( nullData++ < options.max ) { + stMatchSets[""].push(row); + } + }; + + // add the data items to the cache + $.each(stMatchSets, function(i, value) { + // increase the cache size + options.cacheLength++; + // add to the cache + add(i, value); + }); + } + + // populate any existing data + setTimeout(populate, 25); + + function flush(){ + data = {}; + length = 0; + } + + return { + flush: flush, + add: add, + populate: populate, + load: function(q) { + if (!options.cacheLength || !length) + return null; + /* + * if dealing w/local data and matchContains than we must make sure + * to loop through all the data collections looking for matches + */ + if( !options.url && options.matchContains ){ + // track all matches + var csub = []; + // loop through all the data grids for matches + for( var k in data ){ + // don't search through the stMatchSets[""] (minChars: 0) cache + // this prevents duplicates + if( k.length > 0 ){ + var c = data[k]; + $.each(c, function(i, x) { + // if we've got a match, add it to the array + if (matchSubset(x.value, q)) { + csub.push(x); + } + }); + } + } + return csub; + } else + // if the exact item exists, use it + if (data[q]){ + return data[q]; + } else + if (options.matchSubset) { + for (var i = q.length - 1; i >= options.minChars; i--) { + var c = data[q.substr(0, i)]; + if (c) { + var csub = []; + $.each(c, function(i, x) { + if (matchSubset(x.value, q)) { + csub[csub.length] = x; + } + }); + return csub; + } + } + } + return null; + } + }; +}; + +$.Autocompleter.Select = function (options, input, select, config) { + var CLASSES = { + ACTIVE: "ac_over" + }; + + var listItems, + active = -1, + data, + term = "", + needsInit = true, + element, + list; + + // Create results + function init() { + if (!needsInit) + return; + element = $("
        ") + .hide() + .addClass(options.resultsClass) + .css("position", "absolute") + .appendTo(document.body); + + list = $("
          ").appendTo(element).mouseover( function(event) { + if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') { + active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event)); + $(target(event)).addClass(CLASSES.ACTIVE); + } + }).click(function(event) { + $(target(event)).addClass(CLASSES.ACTIVE); + select(); + // TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus + input.focus(); + return false; + }).mousedown(function() { + config.mouseDownOnSelect = true; + }).mouseup(function() { + config.mouseDownOnSelect = false; + }); + + if( options.width > 0 ) + element.css("width", options.width); + + needsInit = false; + } + + function target(event) { + var element = event.target; + while(element && element.tagName != "LI") + element = element.parentNode; + // more fun with IE, sometimes event.target is empty, just ignore it then + if(!element) + return []; + return element; + } + + function moveSelect(step) { + listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE); + movePosition(step); + var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE); + if(options.scroll) { + var offset = 0; + listItems.slice(0, active).each(function() { + offset += this.offsetHeight; + }); + if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) { + list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight()); + } else if(offset < list.scrollTop()) { + list.scrollTop(offset); + } + } + }; + + function movePosition(step) { + active += step; + if (active < 0) { + active = listItems.size() - 1; + } else if (active >= listItems.size()) { + active = 0; + } + } + + function limitNumberOfItems(available) { + return options.max && options.max < available + ? options.max + : available; + } + + function fillList() { + list.empty(); + var max = limitNumberOfItems(data.length); + for (var i=0; i < max; i++) { + if (!data[i]) + continue; + var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term); + if ( formatted === false ) + continue; + var li = $("
        • ").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0]; + $.data(li, "ac_data", data[i]); + } + listItems = list.find("li"); + if ( options.selectFirst ) { + listItems.slice(0, 1).addClass(CLASSES.ACTIVE); + active = 0; + } + // apply bgiframe if available + if ( $.fn.bgiframe ) + list.bgiframe(); + } + + return { + display: function(d, q) { + init(); + data = d; + term = q; + fillList(); + }, + next: function() { + moveSelect(1); + }, + prev: function() { + moveSelect(-1); + }, + pageUp: function() { + if (active != 0 && active - 8 < 0) { + moveSelect( -active ); + } else { + moveSelect(-8); + } + }, + pageDown: function() { + if (active != listItems.size() - 1 && active + 8 > listItems.size()) { + moveSelect( listItems.size() - 1 - active ); + } else { + moveSelect(8); + } + }, + hide: function() { + element && element.hide(); + listItems && listItems.removeClass(CLASSES.ACTIVE); + active = -1; + }, + visible : function() { + return element && element.is(":visible"); + }, + current: function() { + return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]); + }, + show: function() { + var offset = $(input).offset(); + element.css({ + width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(), + top: offset.top + input.offsetHeight, + left: offset.left + }).show(); + if(options.scroll) { + list.scrollTop(0); + list.css({ + maxHeight: options.scrollHeight, + overflow: 'auto' + }); + + if($.browser.msie && typeof document.body.style.maxHeight === "undefined") { + var listHeight = 0; + listItems.each(function() { + listHeight += this.offsetHeight; + }); + var scrollbarsVisible = listHeight > options.scrollHeight; + list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight ); + if (!scrollbarsVisible) { + // IE doesn't recalculate width when scrollbar disappears + listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) ); + } + } + + } + }, + selected: function() { + var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE); + return selected && selected.length && $.data(selected[0], "ac_data"); + }, + emptyList: function (){ + list && list.empty(); + }, + unbind: function() { + element && element.remove(); + } + }; +}; + +$.Autocompleter.Selection = function(field, start, end) { + if( field.createTextRange ){ + var selRange = field.createTextRange(); + selRange.collapse(true); + selRange.moveStart("character", start); + selRange.moveEnd("character", end); + selRange.select(); + } else if( field.setSelectionRange ){ + field.setSelectionRange(start, end); + } else { + if( field.selectionStart ){ + field.selectionStart = start; + field.selectionEnd = end; + } + } + field.focus(); +}; + +})(jQuery); \ No newline at end of file diff --git a/plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.min.js b/plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.min.js new file mode 100644 index 000000000..c9ddfb220 --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.min.js @@ -0,0 +1,15 @@ +/* + * Autocomplete - jQuery plugin 1.0.2 + * + * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $ + * + */;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i1){v=words.slice(0,words.length-1).join(options.multipleSeparator)+options.multipleSeparator+v;}v+=options.multipleSeparator;}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}var currentValue=$input.val();if(!skipPrevCheck&¤tValue==previousValue)return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value){return[""];}var words=value.split(options.multipleSeparator);var result=[];$.each(words,function(i,value){if($.trim(value))result[i]=$.trim(value);});return result;}function lastWord(value){if(!options.multiple)return value;var words=trimWords(value);return words[words.length-1];}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$.Autocompleter.Selection(input,previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}else +$input.val("");}});}if(wasVisible)$.Autocompleter.Selection(input,input.value.length,input.value.length);};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"$1");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}if(!data[q]){length++;}data[q]=value;}function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}return csub;}else +if(data[q]){return data[q];}else +if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)return;element=$("
          ").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("
            ").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)element.css("width",options.width);needsInit=false;}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode;if(!element)return[];return element;}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset=listItems.size()){active=0;}}function limitNumberOfItems(available){return options.max&&options.max").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}if($.fn.bgiframe)list.bgiframe();}return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.Autocompleter.Selection=function(field,start,end){if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}else if(field.setSelectionRange){field.setSelectionRange(start,end);}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end;}}field.focus();};})(jQuery); \ No newline at end of file diff --git a/plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.pack.js b/plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.pack.js new file mode 100644 index 000000000..271014a2b --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.pack.js @@ -0,0 +1,13 @@ +/* + * Autocomplete - jQuery plugin 1.0.2 + * + * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $ + * + */ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(3($){$.31.1o({12:3(b,d){5 c=Y b=="1w";d=$.1o({},$.D.1L,{11:c?b:14,w:c?14:b,1D:c?$.D.1L.1D:10,Z:d&&!d.1x?10:3U},d);d.1t=d.1t||3(a){6 a};d.1q=d.1q||d.1K;6 I.K(3(){1E $.D(I,d)})},M:3(a){6 I.X("M",a)},1y:3(a){6 I.15("1y",[a])},20:3(){6 I.15("20")},1Y:3(a){6 I.15("1Y",[a])},1X:3(){6 I.15("1X")}});$.D=3(o,r){5 t={2N:38,2I:40,2D:46,2x:9,2v:13,2q:27,2d:3x,2j:33,2o:34,2e:8};5 u=$(o).3f("12","3c").P(r.24);5 p;5 m="";5 n=$.D.2W(r);5 s=0;5 k;5 h={1z:B};5 l=$.D.2Q(r,o,1U,h);5 j;$.1T.2L&&$(o.2K).X("3S.12",3(){4(j){j=B;6 B}});u.X(($.1T.2L?"3Q":"3N")+".12",3(a){k=a.2F;3L(a.2F){Q t.2N:a.1d();4(l.L()){l.2y()}A{W(0,C)}N;Q t.2I:a.1d();4(l.L()){l.2u()}A{W(0,C)}N;Q t.2j:a.1d();4(l.L()){l.2t()}A{W(0,C)}N;Q t.2o:a.1d();4(l.L()){l.2s()}A{W(0,C)}N;Q r.19&&$.1p(r.R)==","&&t.2d:Q t.2x:Q t.2v:4(1U()){a.1d();j=C;6 B}N;Q t.2q:l.U();N;3A:1I(p);p=1H(W,r.1D);N}}).1G(3(){s++}).3v(3(){s=0;4(!h.1z){2k()}}).2i(3(){4(s++>1&&!l.L()){W(0,C)}}).X("1y",3(){5 c=(1n.7>1)?1n[1]:14;3 23(q,a){5 b;4(a&&a.7){16(5 i=0;i1){v=a.17(0,a.7-1).2Z(r.R)+r.R+v}v+=r.R}u.J(v);1l();u.15("M",[b.w,b.H]);6 C}3 W(b,c){4(k==t.2D){l.U();6}5 a=u.J();4(!c&&a==m)6;m=a;a=1k(a);4(a.7>=r.22){u.P(r.21);4(!r.1C)a=a.O();1R(a,2V,1l)}A{1B();l.U()}};3 1g(b){4(!b){6[""]}5 d=b.1Z(r.R);5 c=[];$.K(d,3(i,a){4($.1p(a))c[i]=$.1p(a)});6 c}3 1k(a){4(!r.19)6 a;5 b=1g(a);6 b[b.7-1]}3 1A(q,a){4(r.1A&&(1k(u.J()).O()==q.O())&&k!=t.2e){u.J(u.J()+a.48(1k(m).7));$.D.1N(o,m.7,m.7+a.7)}};3 2k(){1I(p);p=1H(1l,47)};3 1l(){5 c=l.L();l.U();1I(p);1B();4(r.2U){u.1y(3(a){4(!a){4(r.19){5 b=1g(u.J()).17(0,-1);u.J(b.2Z(r.R)+(b.7?r.R:""))}A u.J("")}})}4(c)$.D.1N(o,o.H.7,o.H.7)};3 2V(q,a){4(a&&a.7&&s){1B();l.2T(a,q);1A(q,a[0].H);l.1W()}A{1l()}};3 1R(f,d,g){4(!r.1C)f=f.O();5 e=n.2S(f);4(e&&e.7){d(f,e)}A 4((Y r.11=="1w")&&(r.11.7>0)){5 c={45:+1E 44()};$.K(r.2R,3(a,b){c[a]=Y b=="3"?b():b});$.43({42:"41",3Z:"12"+o.3Y,2M:r.2M,11:r.11,w:$.1o({q:1k(f),3X:r.Z},c),3W:3(a){5 b=r.1r&&r.1r(a)||1r(a);n.1h(f,b);d(f,b)}})}A{l.2J();g(f)}};3 1r(c){5 d=[];5 b=c.1Z("\\n");16(5 i=0;i]*)("+a.2C(/([\\^\\$\\(\\)\\[\\]\\{\\}\\*\\.\\+\\?\\|\\\\])/2A,"\\\\$1")+")(?![^<>]*>)(?![^&;]+;)","2A"),"<2z>$1")},1x:C,1s:3I};$.D.2W=3(g){5 h={};5 j=0;3 1a(s,a){4(!g.1C)s=s.O();5 i=s.3H(a);4(i==-1)6 B;6 i==0||g.1V};3 1h(q,a){4(j>g.1j){18()}4(!h[q]){j++}h[q]=a}3 1f(){4(!g.w)6 B;5 f={},2w=0;4(!g.11)g.1j=1;f[""]=[];16(5 i=0,30=g.w.7;i<30;i++){5 c=g.w[i];c=(Y c=="1w")?[c]:c;5 d=g.1q(c,i+1,g.w.7);4(d===B)1P;5 e=d.3G(0).O();4(!f[e])f[e]=[];5 b={H:d,w:c,M:g.1v&&g.1v(c)||d};f[e].1O(b);4(2w++0){5 c=h[k];$.K(c,3(i,x){4(1a(x.H,q)){a.1O(x)}})}}6 a}A 4(h[q]){6 h[q]}A 4(g.1a){16(5 i=q.7-1;i>=g.22;i--){5 c=h[q.3F(0,i)];4(c){5 a=[];$.K(c,3(i,x){4(1a(x.H,q)){a[a.7]=x}});6 a}}}6 14}}};$.D.2Q=3(e,g,f,k){5 h={G:"3E"};5 j,y=-1,w,1m="",1M=C,F,z;3 2r(){4(!1M)6;F=$("<3D/>").U().P(e.2H).T("3C","3B").1J(2p.2n);z=$("<3z/>").1J(F).3y(3(a){4(V(a).2m&&V(a).2m.3w()==\'2l\'){y=$("1F",z).1e(h.G).3u(V(a));$(V(a)).P(h.G)}}).2i(3(a){$(V(a)).P(h.G);f();g.1G();6 B}).3t(3(){k.1z=C}).3s(3(){k.1z=B});4(e.E>0)F.T("E",e.E);1M=B}3 V(a){5 b=a.V;3r(b&&b.3q!="2l")b=b.3p;4(!b)6[];6 b}3 S(b){j.17(y,y+1).1e(h.G);2h(b);5 a=j.17(y,y+1).P(h.G);4(e.1x){5 c=0;j.17(0,y).K(3(){c+=I.1i});4((c+a[0].1i-z.1c())>z[0].3o){z.1c(c+a[0].1i-z.3n())}A 4(c=j.1b()){y=0}}3 2g(a){6 e.Z&&e.Z").3m(e.1t(a,1m)).P(i%2==0?"3l":"3k").1J(z)[0];$.w(c,"2c",w[i])}j=z.3j("1F");4(e.1S){j.17(0,1).P(h.G);y=0}4($.31.2b)z.2b()}6{2T:3(d,q){2r();w=d;1m=q;2f()},2u:3(){S(1)},2y:3(){S(-1)},2t:3(){4(y!=0&&y-8<0){S(-y)}A{S(-8)}},2s:3(){4(y!=j.1b()-1&&y+8>j.1b()){S(j.1b()-1-y)}A{S(8)}},U:3(){F&&F.U();j&&j.1e(h.G);y=-1},L:3(){6 F&&F.3i(":L")},3h:3(){6 I.L()&&(j.2a("."+h.G)[0]||e.1S&&j[0])},1W:3(){5 a=$(g).3g();F.T({E:Y e.E=="1w"||e.E>0?e.E:$(g).E(),2E:a.2E+g.1i,1Q:a.1Q}).1W();4(e.1x){z.1c(0);z.T({29:e.1s,3e:\'3d\'});4($.1T.3b&&Y 2p.2n.3T.29==="3a"){5 c=0;j.K(3(){c+=I.1i});5 b=c>e.1s;z.T(\'3V\',b?e.1s:c);4(!b){j.E(z.E()-28(j.T("32-1Q"))-28(j.T("32-39")))}}}},26:3(){5 a=j&&j.2a("."+h.G).1e(h.G);6 a&&a.7&&$.w(a[0],"2c")},2J:3(){z&&z.2B()},1u:3(){F&&F.37()}}};$.D.1N=3(b,a,c){4(b.2O){5 d=b.2O();d.36(C);d.35("2P",a);d.4c("2P",c);d.4b()}A 4(b.2Y){b.2Y(a,c)}A{4(b.2X){b.2X=a;b.4a=c}}b.1G()}})(49);',62,261,'|||function|if|var|return|length|||||||||||||||||||||||||data||active|list|else|false|true|Autocompleter|width|element|ACTIVE|value|this|val|each|visible|result|break|toLowerCase|addClass|case|multipleSeparator|moveSelect|css|hide|target|onChange|bind|typeof|max||url|autocomplete||null|trigger|for|slice|flush|multiple|matchSubset|size|scrollTop|preventDefault|removeClass|populate|trimWords|add|offsetHeight|cacheLength|lastWord|hideResultsNow|term|arguments|extend|trim|formatMatch|parse|scrollHeight|highlight|unbind|formatResult|string|scroll|search|mouseDownOnSelect|autoFill|stopLoading|matchCase|delay|new|li|focus|setTimeout|clearTimeout|appendTo|formatItem|defaults|needsInit|Selection|push|continue|left|request|selectFirst|browser|selectCurrent|matchContains|show|unautocomplete|setOptions|split|flushCache|loadingClass|minChars|findValueCallback|inputClass||selected||parseInt|maxHeight|filter|bgiframe|ac_data|COMMA|BACKSPACE|fillList|limitNumberOfItems|movePosition|click|PAGEUP|hideResults|LI|nodeName|body|PAGEDOWN|document|ESC|init|pageDown|pageUp|next|RETURN|nullData|TAB|prev|strong|gi|empty|replace|DEL|top|keyCode|in|resultsClass|DOWN|emptyList|form|opera|dataType|UP|createTextRange|character|Select|extraParams|load|display|mustMatch|receiveData|Cache|selectionStart|setSelectionRange|join|ol|fn|padding|||moveStart|collapse|remove||right|undefined|msie|off|auto|overflow|attr|offset|current|is|find|ac_odd|ac_even|html|innerHeight|clientHeight|parentNode|tagName|while|mouseup|mousedown|index|blur|toUpperCase|188|mouseover|ul|default|absolute|position|div|ac_over|substr|charAt|indexOf|180|RegExp|100|switch|400|keydown|ac_loading|ac_results|keypress|ac_input|submit|style|150|height|success|limit|name|port||abort|mode|ajax|Date|timestamp||200|substring|jQuery|selectionEnd|select|moveEnd'.split('|'),0,{})) \ No newline at end of file diff --git a/plugins/Autocomplete/jquery-autocomplete/lib/jquery.ajaxQueue.js b/plugins/Autocomplete/jquery-autocomplete/lib/jquery.ajaxQueue.js new file mode 100644 index 000000000..bdd2e4f82 --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/lib/jquery.ajaxQueue.js @@ -0,0 +1,116 @@ +/** + * Ajax Queue Plugin + * + * Homepage: http://jquery.com/plugins/project/ajaxqueue + * Documentation: http://docs.jquery.com/AjaxQueue + */ + +/** + + +
              + + */ +/* + * Queued Ajax requests. + * A new Ajax request won't be started until the previous queued + * request has finished. + */ + +/* + * Synced Ajax requests. + * The Ajax request will happen as soon as you call this method, but + * the callbacks (success/error/complete) won't fire until all previous + * synced requests have been completed. + */ + + +(function($) { + + var ajax = $.ajax; + + var pendingRequests = {}; + + var synced = []; + var syncedData = []; + + $.ajax = function(settings) { + // create settings for compatibility with ajaxSetup + settings = jQuery.extend(settings, jQuery.extend({}, jQuery.ajaxSettings, settings)); + + var port = settings.port; + + switch(settings.mode) { + case "abort": + if ( pendingRequests[port] ) { + pendingRequests[port].abort(); + } + return pendingRequests[port] = ajax.apply(this, arguments); + case "queue": + var _old = settings.complete; + settings.complete = function(){ + if ( _old ) + _old.apply( this, arguments ); + jQuery([ajax]).dequeue("ajax" + port );; + }; + + jQuery([ ajax ]).queue("ajax" + port, function(){ + ajax( settings ); + }); + return; + case "sync": + var pos = synced.length; + + synced[ pos ] = { + error: settings.error, + success: settings.success, + complete: settings.complete, + done: false + }; + + syncedData[ pos ] = { + error: [], + success: [], + complete: [] + }; + + settings.error = function(){ syncedData[ pos ].error = arguments; }; + settings.success = function(){ syncedData[ pos ].success = arguments; }; + settings.complete = function(){ + syncedData[ pos ].complete = arguments; + synced[ pos ].done = true; + + if ( pos == 0 || !synced[ pos-1 ] ) + for ( var i = pos; i < synced.length && synced[i].done; i++ ) { + if ( synced[i].error ) synced[i].error.apply( jQuery, syncedData[i].error ); + if ( synced[i].success ) synced[i].success.apply( jQuery, syncedData[i].success ); + if ( synced[i].complete ) synced[i].complete.apply( jQuery, syncedData[i].complete ); + + synced[i] = null; + syncedData[i] = null; + } + }; + } + return ajax.apply(this, arguments); + }; + +})(jQuery); \ No newline at end of file diff --git a/plugins/Autocomplete/jquery-autocomplete/lib/jquery.bgiframe.min.js b/plugins/Autocomplete/jquery-autocomplete/lib/jquery.bgiframe.min.js new file mode 100644 index 000000000..7faef4b33 --- /dev/null +++ b/plugins/Autocomplete/jquery-autocomplete/lib/jquery.bgiframe.min.js @@ -0,0 +1,10 @@ +/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net) + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + * + * $LastChangedDate: 2007-07-22 01:45:56 +0200 (Son, 22 Jul 2007) $ + * $Rev: 2447 $ + * + * Version 2.1.1 + */ +(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='