diff options
204 files changed, 7825 insertions, 4111 deletions
diff --git a/.gitignore b/.gitignore index fb5d478fe..8c94886e7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ _darcs/* config.php .htaccess *.tmproj +dataobject.ini +*~ +*.bak diff --git a/actions/accesstoken.php b/actions/accesstoken.php index 072ce27eb..ad03b7019 100644 --- a/actions/accesstoken.php +++ b/actions/accesstoken.php @@ -38,7 +38,7 @@ class AccesstokenAction extends Action common_debug('printing the access token', __FILE__); print $token; } catch (OAuthException $e) { - common_server_error($e->getMessage()); + $this->serverError($e->getMessage()); } } } diff --git a/actions/all.php b/actions/all.php index 526ac5f40..548d7a103 100644 --- a/actions/all.php +++ b/actions/all.php @@ -19,80 +19,86 @@ if (!defined('LACONICA')) { exit(1); } -require_once(INSTALLDIR.'/actions/showstream.php'); +require_once INSTALLDIR.'/lib/personalgroupnav.php'; +require_once INSTALLDIR.'/lib/noticelist.php'; +require_once INSTALLDIR.'/lib/feedlist.php'; -class AllAction extends StreamAction +class AllAction extends Action { - - function handle($args) + var $user = null; + var $page = null; + + function isReadOnly() { - - parent::handle($args); - + return true; + } + + function prepare($args) + { + parent::prepare($args); $nickname = common_canonical_nickname($this->arg('nickname')); - $user = User::staticGet('nickname', $nickname); - - if (!$user) { - $this->client_error(_('No such user.')); - return; + $this->user = User::staticGet('nickname', $nickname); + $this->page = $this->trimmed('page'); + if (!$this->page) { + $this->page = 1; } - - $profile = $user->getProfile(); - - if (!$profile) { - common_server_error(_('User has no profile.')); + return true; + } + + function handle($args) + { + parent::handle($args); + + if (!$this->user) { + $this->clientError(_('No such user.')); return; } - - # Looks like we're good; show the header - - common_show_header(sprintf(_("%s and friends"), $profile->nickname), - array($this, 'show_header'), $user, - array($this, 'show_top')); - - $this->show_notices($user); - - common_show_footer(); + + $this->showPage(); } - - function show_header($user) + + function title() + { + if ($this->page > 1) { + return sprintf(_("%s and friends, page %d"), $this->user->nickname, $this->page); + } else { + return sprintf(_("%s and friends"), $this->user->nickname); + } + } + + function showFeeds() { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('allrss', array('nickname' => - $user->nickname)), + $this->user->nickname)), 'type' => 'application/rss+xml', - 'title' => sprintf(_('Feed for friends of %s'), $user->nickname))); + 'title' => sprintf(_('Feed for friends of %s'), $this->user->nickname))); } - - function show_top($user) + + function showLocalNav() { - $cur = common_current_user(); - - if ($cur && $cur->id == $user->id) { - common_notice_form('all'); - } - - $this->views_menu(); - - $this->show_feeds_list(array(0=>array('href'=>common_local_url('allrss', array('nickname' => $user->nickname)), - 'type' => 'rss', - 'version' => 'RSS 1.0', - 'item' => 'allrss'))); + $nav = new PersonalGroupNav($this); + $nav->show(); } - function show_notices($user) + function showExportData() { - - $page = $this->trimmed('page'); - if (!$page) { - $page = 1; - } - - $notice = $user->noticesWithFriends(($page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); - - $cnt = $this->show_notice_list($notice); - - common_pagination($page > 1, $cnt > NOTICES_PER_PAGE, - $page, 'all', array('nickname' => $user->nickname)); + $fl = new FeedList($this); + $fl->show(array(0=>array('href'=>common_local_url('allrss', array('nickname' => $this->user->nickname)), + 'type' => 'rss', + 'version' => 'RSS 1.0', + 'item' => 'allrss'))); + } + + function showContent() + { + $notice = $this->user->noticesWithFriends(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); + + $nl = new NoticeList($notice, $this); + + $cnt = $nl->show(); + + $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, + $this->page, 'all', array('nickname' => $this->user->nickname)); } } diff --git a/actions/allrss.php b/actions/allrss.php index 660afb9e2..56818d605 100644 --- a/actions/allrss.php +++ b/actions/allrss.php @@ -34,7 +34,7 @@ class AllrssAction extends Rss10Action $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return false; } else { return true; diff --git a/actions/api.php b/actions/api.php index 7a0759831..47c119605 100644 --- a/actions/api.php +++ b/actions/api.php @@ -103,10 +103,10 @@ class ApiAction extends Action call_user_func(array($action_obj, $this->api_method), $_REQUEST, $apidata); } else { - common_user_error("API method not found!", $code=404); + $this->clientError("API method not found!", $code=404); } } else { - common_user_error("API method not found!", $code=404); + $this->clientError("API method not found!", $code=404); } } @@ -159,10 +159,10 @@ class ApiAction extends Action if ($this->content_type == 'xml') { header('Content-Type: application/xml; charset=utf-8'); common_start_xml(); - common_element_start('hash'); - common_element('error', null, $msg); - common_element('request', null, $_SERVER['REQUEST_URI']); - common_element_end('hash'); + $this->elementStart('hash'); + $this->element('error', null, $msg); + $this->element('request', null, $_SERVER['REQUEST_URI']); + $this->elementEnd('hash'); common_end_xml(); } else if ($this->content_type == 'json') { header('Content-Type: application/json; charset=utf-8'); @@ -174,7 +174,7 @@ class ApiAction extends Action } } - function is_readonly() + function isReadOnly() { # NOTE: before handle(), can't use $this->arg $apiaction = $_REQUEST['apiaction']; diff --git a/actions/avatarbynickname.php b/actions/avatarbynickname.php index 666f386f6..d2d078b61 100644 --- a/actions/avatarbynickname.php +++ b/actions/avatarbynickname.php @@ -26,28 +26,28 @@ class AvatarbynicknameAction extends Action parent::handle($args); $nickname = $this->trimmed('nickname'); if (!$nickname) { - $this->client_error(_('No nickname.')); + $this->clientError(_('No nickname.')); return; } $size = $this->trimmed('size'); if (!$size) { - $this->client_error(_('No size.')); + $this->clientError(_('No size.')); return; } $size = strtolower($size); if (!in_array($size, array('original', '96', '48', '24'))) { - $this->client_error(_('Invalid size.')); + $this->clientError(_('Invalid size.')); return; } $user = User::staticGet('nickname', $nickname); if (!$user) { - $this->client_error(_('No such user.')); + $this->clientError(_('No such user.')); return; } $profile = $user->getProfile(); if (!$profile) { - $this->client_error(_('User has no profile.')); + $this->clientError(_('User has no profile.')); return; } if ($size == 'original') { diff --git a/actions/block.php b/actions/block.php index c1ff7c044..738cbfbf7 100644 --- a/actions/block.php +++ b/actions/block.php @@ -30,28 +30,28 @@ class BlockAction extends Action parent::prepare($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return false; } $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } $id = $this->trimmed('blockto'); if (!$id) { - $this->client_error(_('No profile specified.')); + $this->clientError(_('No profile specified.')); return false; } $this->profile = Profile::staticGet('id', $id); if (!$this->profile) { - $this->client_error(_('No profile with that ID.')); + $this->clientError(_('No profile with that ID.')); return false; } @@ -81,34 +81,34 @@ class BlockAction extends Action common_show_header(_('Block user')); - common_element('p', null, + $this->element('p', null, _('Are you sure you want to block this user? '. 'Afterwards, they will be unsubscribed from you, '. 'unable to subscribe to you in the future, and '. 'you will not be notified of any @-replies from them.')); - common_element_start('form', array('id' => 'block-' . $id, + $this->elementStart('form', array('id' => 'block-' . $id, 'method' => 'post', 'class' => 'block', 'action' => common_local_url('block'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_element('input', array('id' => 'blockto-' . $id, + $this->element('input', array('id' => 'blockto-' . $id, 'name' => 'blockto', 'type' => 'hidden', 'value' => $id)); foreach ($this->args as $k => $v) { if (substr($k, 0, 9) == 'returnto-') { - common_hidden($k, $v); + $this->hidden($k, $v); } } - common_submit('no', _('No')); - common_submit('yes', _('Yes')); + $this->submit('no', _('No')); + $this->submit('yes', _('Yes')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } @@ -119,14 +119,14 @@ class BlockAction extends Action $cur = common_current_user(); if ($cur->hasBlocked($this->profile)) { - $this->client_error(_('You have already blocked this user.')); + $this->clientError(_('You have already blocked this user.')); return; } $result = $cur->block($this->profile); if (!$result) { - $this->server_error(_('Failed to save block information.')); + $this->serverError(_('Failed to save block information.')); return; } diff --git a/actions/confirmaddress.php b/actions/confirmaddress.php index 1d5c53ff2..53410fbe6 100644 --- a/actions/confirmaddress.php +++ b/actions/confirmaddress.php @@ -32,26 +32,26 @@ class ConfirmaddressAction extends Action } $code = $this->trimmed('code'); if (!$code) { - $this->client_error(_('No confirmation code.')); + $this->clientError(_('No confirmation code.')); return; } $confirm = Confirm_address::staticGet('code', $code); if (!$confirm) { - $this->client_error(_('Confirmation code not found.')); + $this->clientError(_('Confirmation code not found.')); return; } $cur = common_current_user(); if ($cur->id != $confirm->user_id) { - $this->client_error(_('That confirmation code is not for you!')); + $this->clientError(_('That confirmation code is not for you!')); return; } $type = $confirm->address_type; if (!in_array($type, array('email', 'jabber', 'sms'))) { - $this->server_error(sprintf(_('Unrecognized address type %s'), $type)); + $this->serverError(sprintf(_('Unrecognized address type %s'), $type)); return; } if ($cur->$type == $confirm->address) { - $this->client_error(_('That address has already been confirmed.')); + $this->clientError(_('That address has already been confirmed.')); return; } @@ -71,7 +71,7 @@ class ConfirmaddressAction extends Action if (!$result) { common_log_db_error($cur, 'UPDATE', __FILE__); - $this->server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } @@ -83,14 +83,14 @@ class ConfirmaddressAction extends Action if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - $this->server_error(_('Couldn\'t delete email confirmation.')); + $this->serverError(_('Couldn\'t delete email confirmation.')); return; } $cur->query('COMMIT'); common_show_header(_('Confirm Address')); - common_element('p', null, + $this->element('p', null, sprintf(_('The address "%s" has been confirmed for your account.'), $cur->$type)); common_show_footer(); } diff --git a/actions/deletenotice.php b/actions/deletenotice.php index e9b4b3254..bae0eac1b 100644 --- a/actions/deletenotice.php +++ b/actions/deletenotice.php @@ -51,24 +51,24 @@ class DeletenoticeAction extends DeleteAction common_show_header($this->get_title(), array($this, 'show_header'), $error, array($this, 'show_top')); - common_element_start('form', array('id' => 'notice_delete_form', + $this->elementStart('form', array('id' => 'notice_delete_form', 'method' => 'post', 'action' => common_local_url('deletenotice'))); - common_hidden('token', common_session_token()); - common_hidden('notice', $this->trimmed('notice')); - common_element_start('p'); - common_element('span', array('id' => 'confirmation_text'), _('Are you sure you want to delete this notice?')); + $this->hidden('token', common_session_token()); + $this->hidden('notice', $this->trimmed('notice')); + $this->elementStart('p'); + $this->element('span', array('id' => 'confirmation_text'), _('Are you sure you want to delete this notice?')); - common_element('input', array('id' => 'submit_no', + $this->element('input', array('id' => 'submit_no', 'name' => 'submit', 'type' => 'submit', 'value' => _('No'))); - common_element('input', array('id' => 'submit_yes', + $this->element('input', array('id' => 'submit_yes', 'name' => 'submit', 'type' => 'submit', 'value' => _('Yes'))); - common_element_end('p'); - common_element_end('form'); + $this->elementEnd('p'); + $this->elementEnd('form'); common_show_footer(); } diff --git a/actions/deleteprofile.php b/actions/deleteprofile.php index e12fe131a..cc236f847 100644 --- a/actions/deleteprofile.php +++ b/actions/deleteprofile.php @@ -24,7 +24,7 @@ class DeleteprofileAction extends Action function handle($args) { parent::handle($args); - $this->server_error(_('Code not yet ready.')); + $this->serverError(_('Code not yet ready.')); return; if ('POST' === $_SERVER['REQUEST_METHOD']) { $this->handle_post(); @@ -49,15 +49,15 @@ class DeleteprofileAction extends Action function show_feeds_list($feeds) { - common_element_start('div', array('class' => 'feedsdel')); - common_element('p', null, 'Feeds:'); - common_element_start('ul', array('class' => 'xoxo')); + $this->elementStart('div', array('class' => 'feedsdel')); + $this->element('p', null, 'Feeds:'); + $this->elementStart('ul', array('class' => 'xoxo')); foreach ($feeds as $key => $value) { $this->common_feed_item($feeds[$key]); } - common_element_end('ul'); - common_element_end('div'); + $this->elementEnd('ul'); + $this->elementEnd('div'); } //TODO move to common.php (and retrace its origin) @@ -81,19 +81,19 @@ class DeleteprofileAction extends Action $feed['textContent'] = "FOAF"; break; } - common_element_start('li'); - common_element('a', array('href' => $feed['href'], + $this->elementStart('li'); + $this->element('a', array('href' => $feed['href'], 'class' => $feed_classname, 'type' => $feed_mimetype, 'title' => $feed_title), $feed['textContent']); - common_element_end('li'); + $this->elementEnd('li'); } function show_form($msg=null, $success=false) { $this->form_header(_('Delete my account'), $msg, $success); - common_element('h2', null, _('Delete my account confirmation')); + $this->element('h2', null, _('Delete my account confirmation')); $this->show_confirm_delete_form(); common_show_footer(); } @@ -105,13 +105,13 @@ class DeleteprofileAction extends Action $notices->profile_id = $user->id; $notice_count = (int) $notices->count(); - common_element_start('form', array('method' => 'POST', + $this->elementStart('form', array('method' => 'POST', 'id' => 'delete', 'action' => common_local_url('deleteprofile'))); - common_hidden('token', common_session_token()); - common_element('p', null, "Last chance to copy your notices and contacts by saving the two links below before deleting your account. Be careful, this operation cannot be undone."); + $this->hidden('token', common_session_token()); + $this->element('p', null, "Last chance to copy your notices and contacts by saving the two links below before deleting your account. Be careful, this operation cannot be undone."); $this->show_feeds_list(array(0=>array('href'=>common_local_url('userrss', array('limit' => $notice_count, 'nickname' => $user->nickname)), 'type' => 'rss', @@ -122,10 +122,10 @@ class DeleteprofileAction extends Action 'version' => 'FOAF', 'item' => 'foaf'))); - common_checkbox('confirmation', _('Check if you are sure you want to delete your account.')); + $this->checkbox('confirmation', _('Check if you are sure you want to delete your account.')); - common_submit('deleteaccount', _('Delete my account')); - common_element_end('form'); + $this->submit('deleteaccount', _('Delete my account')); + $this->elementEnd('form'); } function handle_post() @@ -238,9 +238,9 @@ class DeleteprofileAction extends Action } else { $inst = $this->get_instructions(); $output = common_markup_to_html($inst); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); } $this->settings_menu(); } @@ -272,7 +272,7 @@ class DeleteprofileAction extends Action _('Other options'))); $action = $this->trimmed('action'); - common_element_start('ul', array('id' => 'nav_views')); + $this->elementStart('ul', array('id' => 'nav_views')); foreach ($menu as $menuaction => $menudesc) { if ($menuaction == 'imsettings' && !common_config('xmpp', 'enabled')) { @@ -283,7 +283,7 @@ class DeleteprofileAction extends Action $menudesc[1], $action == $menuaction); } - common_element_end('ul'); + $this->elementEnd('ul'); } } diff --git a/actions/disfavor.php b/actions/disfavor.php index 74aae86cc..fc36f7c75 100644 --- a/actions/disfavor.php +++ b/actions/disfavor.php @@ -28,7 +28,7 @@ class DisfavorAction extends Action parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -46,7 +46,7 @@ class DisfavorAction extends Action $token = $this->trimmed('token-'.$notice->id); if (!$token || $token != common_session_token()) { - $this->client_error(_("There was a problem with your session token. Try again, please.")); + $this->clientError(_("There was a problem with your session token. Try again, please.")); return; } @@ -54,7 +54,7 @@ class DisfavorAction extends Action $fave->user_id = $this->id; $fave->notice_id = $notice->id; if (!$fave->find(true)) { - $this->client_error(_('This notice is not a favorite!')); + $this->clientError(_('This notice is not a favorite!')); return; } @@ -62,7 +62,7 @@ class DisfavorAction extends Action if (!$result) { common_log_db_error($fave, 'DELETE', __FILE__); - $this->server_error(_('Could not delete favorite.')); + $this->serverError(_('Could not delete favorite.')); return; } @@ -70,13 +70,13 @@ class DisfavorAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Add to favorites')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Add to favorites')); + $this->elementEnd('head'); + $this->elementStart('body'); common_favor_form($notice); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url('showfavorites', array('nickname' => $user->nickname))); diff --git a/actions/doc.php b/actions/doc.php index 856025e66..3d14b25b8 100644 --- a/actions/doc.php +++ b/actions/doc.php @@ -28,13 +28,13 @@ class DocAction extends Action $title = $this->trimmed('title'); $filename = INSTALLDIR.'/doc/'.$title; if (!file_exists($filename)) { - common_user_error(_('No such document.')); + $this->clientError(_('No such document.')); return; } $c = file_get_contents($filename); $output = common_markup_to_html($c); common_show_header(_(ucfirst($title))); - common_raw($output); + $this->raw($output); common_show_footer(); } } diff --git a/actions/emailsettings.php b/actions/emailsettings.php index 3fa8ce296..6210c07b4 100644 --- a/actions/emailsettings.php +++ b/actions/emailsettings.php @@ -33,83 +33,83 @@ class EmailsettingsAction extends SettingsAction { $user = common_current_user(); $this->form_header(_('Email Settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'emailsettings', 'action' => common_local_url('emailsettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_element('h2', null, _('Address')); + $this->element('h2', null, _('Address')); if ($user->email) { - common_element_start('p'); - common_element('span', 'address confirmed', $user->email); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address confirmed', $user->email); + $this->element('span', 'input_instructions', _('Current confirmed email address.')); - common_hidden('email', $user->email); - common_element_end('p'); - common_submit('remove', _('Remove')); + $this->hidden('email', $user->email); + $this->elementEnd('p'); + $this->submit('remove', _('Remove')); } else { $confirm = $this->get_confirmation(); if ($confirm) { - common_element_start('p'); - common_element('span', 'address unconfirmed', $confirm->address); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address unconfirmed', $confirm->address); + $this->element('span', 'input_instructions', _('Awaiting confirmation on this address. Check your inbox (and spam box!) for a message with further instructions.')); - common_hidden('email', $confirm->address); - common_element_end('p'); - common_submit('cancel', _('Cancel')); + $this->hidden('email', $confirm->address); + $this->elementEnd('p'); + $this->submit('cancel', _('Cancel')); } else { - common_input('email', _('Email Address'), + $this->input('email', _('Email Address'), ($this->arg('email')) ? $this->arg('email') : null, _('Email address, like "UserName@example.org"')); - common_submit('add', _('Add')); + $this->submit('add', _('Add')); } } if ($user->email) { - common_element('h2', null, _('Incoming email')); + $this->element('h2', null, _('Incoming email')); if ($user->incomingemail) { - common_element_start('p'); - common_element('span', 'address', $user->incomingemail); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address', $user->incomingemail); + $this->element('span', 'input_instructions', _('Send email to this address to post new notices.')); - common_element_end('p'); - common_submit('removeincoming', _('Remove')); + $this->elementEnd('p'); + $this->submit('removeincoming', _('Remove')); } - common_element_start('p'); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'input_instructions', _('Make a new email address for posting to; cancels the old one.')); - common_element_end('p'); - common_submit('newincoming', _('New')); + $this->elementEnd('p'); + $this->submit('newincoming', _('New')); } - common_element('h2', null, _('Preferences')); + $this->element('h2', null, _('Preferences')); - common_checkbox('emailnotifysub', + $this->checkbox('emailnotifysub', _('Send me notices of new subscriptions through email.'), $user->emailnotifysub); - common_checkbox('emailnotifyfav', + $this->checkbox('emailnotifyfav', _('Send me email when someone adds my notice as a favorite.'), $user->emailnotifyfav); - common_checkbox('emailnotifymsg', + $this->checkbox('emailnotifymsg', _('Send me email when someone sends me a private message.'), $user->emailnotifymsg); - common_checkbox('emailnotifynudge', + $this->checkbox('emailnotifynudge', _('Allow friends to nudge me and send me an email.'), $user->emailnotifynudge); - common_checkbox('emailpost', + $this->checkbox('emailpost', _('I want to post notices by email.'), $user->emailpost); - common_checkbox('emailmicroid', + $this->checkbox('emailmicroid', _('Publish a MicroID for my email address.'), $user->emailmicroid); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } @@ -182,7 +182,7 @@ class EmailsettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } @@ -232,7 +232,7 @@ class EmailsettingsAction extends SettingsAction if ($result === false) { common_log_db_error($confirm, 'INSERT', __FILE__); - common_server_error(_('Couldn\'t insert confirmation code.')); + $this->serverError(_('Couldn\'t insert confirmation code.')); return; } @@ -260,7 +260,7 @@ class EmailsettingsAction extends SettingsAction if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - $this->server_error(_('Couldn\'t delete email confirmation.')); + $this->serverError(_('Couldn\'t delete email confirmation.')); return; } @@ -286,7 +286,7 @@ class EmailsettingsAction extends SettingsAction $result = $user->updateKeys($original); if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } $user->query('COMMIT'); @@ -308,7 +308,7 @@ class EmailsettingsAction extends SettingsAction if (!$user->updateKeys($orig)) { common_log_db_error($user, 'UPDATE', __FILE__); - $this->server_error(_("Couldn't update user record.")); + $this->serverError(_("Couldn't update user record.")); } $this->show_form(_('Incoming email address removed.'), true); @@ -323,7 +323,7 @@ class EmailsettingsAction extends SettingsAction if (!$user->updateKeys($orig)) { common_log_db_error($user, 'UPDATE', __FILE__); - $this->server_error(_("Couldn't update user record.")); + $this->serverError(_("Couldn't update user record.")); } $this->show_form(_('New incoming email address added.'), true); diff --git a/actions/facebookhome.php b/actions/facebookhome.php index f72f08a34..d2ac7617d 100644 --- a/actions/facebookhome.php +++ b/actions/facebookhome.php @@ -105,7 +105,7 @@ class FacebookhomeAction extends FacebookAction $this->show_header('Home'); if ($msg) { - common_element('fb:success', array('message' => $msg)); + $this->element('fb:success', array('message' => $msg)); } echo $this->show_notices($user); diff --git a/actions/facebookinvite.php b/actions/facebookinvite.php index fe0c5e493..103d5a568 100644 --- a/actions/facebookinvite.php +++ b/actions/facebookinvite.php @@ -43,22 +43,22 @@ class FacebookinviteAction extends FacebookAction $this->show_header('Invite'); - common_element('h2', null, _('Thanks for inviting your friends to use Identi.ca!')); - common_element('p', null, _('Invitations have been sent to the following users:')); + $this->element('h2', null, _('Thanks for inviting your friends to use Identi.ca!')); + $this->element('p', null, _('Invitations have been sent to the following users:')); $friend_ids = $_POST['ids']; // Hmm... $this->arg('ids') doesn't seem to work - common_element_start("ul"); + $this->elementStart("ul"); foreach ($friend_ids as $friend) { - common_element_start('li'); - common_element('fb:profile-pic', array('uid' => $friend)); - common_element('fb:name', array('uid' => $friend, + $this->elementStart('li'); + $this->element('fb:profile-pic', array('uid' => $friend)); + $this->element('fb:name', array('uid' => $friend, 'capitalize' => 'true')); - common_element_end('li'); + $this->elementEnd('li'); } - common_element_end("ul"); + $this->elementEnd("ul"); $this->show_footer(); } @@ -77,32 +77,32 @@ class FacebookinviteAction extends FacebookAction $content = _('You have been invited to Identi.ca!') . htmlentities('<fb:req-choice url="http://apps.facebook.com/identica_app/" label="Add"/>'); - common_element_start('fb:request-form', array('action' => 'invite.php', + $this->elementStart('fb:request-form', array('action' => 'invite.php', 'method' => 'post', 'invite' => 'true', 'type' => 'Identi.ca', 'content' => $content)); - common_hidden('invite', 'true'); + $this->hidden('invite', 'true'); $actiontext = 'Invite your friends to use Identi.ca.'; - common_element('fb:multi-friend-selector', array('showborder' => 'false', + $this->element('fb:multi-friend-selector', array('showborder' => 'false', 'actiontext' => $actiontext, 'exclude_ids' => implode(',', $exclude_ids), 'bypass' => 'cancel')); - common_element_end('fb:request-form'); + $this->elementEnd('fb:request-form'); - common_element('h2', null, _('Friends already using Identi.ca:')); - common_element_start("ul"); + $this->element('h2', null, _('Friends already using Identi.ca:')); + $this->elementStart("ul"); foreach ($exclude_ids as $friend) { - common_element_start('li'); - common_element('fb:profile-pic', array('uid' => $friend)); - common_element('fb:name', array('uid' => $friend, + $this->elementStart('li'); + $this->element('fb:profile-pic', array('uid' => $friend)); + $this->element('fb:name', array('uid' => $friend, 'capitalize' => 'true')); - common_element_end('li'); + $this->elementEnd('li'); } - common_element_end("ul"); + $this->elementEnd("ul"); $this->show_footer(); diff --git a/actions/facebookremove.php b/actions/facebookremove.php index a200fefbf..d0a0dd951 100644 --- a/actions/facebookremove.php +++ b/actions/facebookremove.php @@ -53,7 +53,7 @@ class FacebookremoveAction extends FacebookAction if (!$result) { common_log_db_error($flink, 'DELETE', __FILE__); - common_server_error(_('Couldn\'t remove Facebook user.')); + $this->serverError(_('Couldn\'t remove Facebook user.')); return; } diff --git a/actions/facebooksettings.php b/actions/facebooksettings.php index ab04ad82b..8b071353a 100644 --- a/actions/facebooksettings.php +++ b/actions/facebooksettings.php @@ -68,43 +68,43 @@ class FacebooksettingsAction extends FacebookAction $this->show_header('Settings', $msg, $success); - common_element_start('fb:if-section-not-added', array('section' => 'profile')); - common_element('h2', null, _('Add an Identi.ca box to my profile')); - common_element_start('p'); - common_element('fb:add-section-button', array('section' => 'profile')); - common_element_end('p'); - - common_element_end('fb:if-section-not-added'); - common_element_start('p'); - common_element_start('fb:prompt-permission', array('perms' => 'status_update')); - common_element('h2', null, _('Allow Identi.ca to update my Facebook status')); - common_element_end('fb:prompt-permission'); - common_element_end('p'); + $this->elementStart('fb:if-section-not-added', array('section' => 'profile')); + $this->element('h2', null, _('Add an Identi.ca box to my profile')); + $this->elementStart('p'); + $this->element('fb:add-section-button', array('section' => 'profile')); + $this->elementEnd('p'); + + $this->elementEnd('fb:if-section-not-added'); + $this->elementStart('p'); + $this->elementStart('fb:prompt-permission', array('perms' => 'status_update')); + $this->element('h2', null, _('Allow Identi.ca to update my Facebook status')); + $this->elementEnd('fb:prompt-permission'); + $this->elementEnd('p'); if ($facebook->api_client->users_hasAppPermission('status_update')) { - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'facebook_settings')); - common_element('h2', null, _('Sync preferences')); + $this->element('h2', null, _('Sync preferences')); - common_checkbox('noticesync', _('Automatically update my Facebook status with my notices.'), + $this->checkbox('noticesync', _('Automatically update my Facebook status with my notices.'), ($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND) : true); - common_checkbox('replysync', _('Send local "@" replies to Facebook.'), + $this->checkbox('replysync', _('Send local "@" replies to Facebook.'), ($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : true); - // function common_input($id, $label, $value=null,$instructions=null) + // function $this->input($id, $label, $value=null,$instructions=null) $prefix = $facebook->api_client->data_getUserPreference(1); - common_input('prefix', _('Prefix'), + $this->input('prefix', _('Prefix'), ($prefix) ? $prefix : null, _('A string to prefix notices with.')); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); } diff --git a/actions/favor.php b/actions/favor.php index 8103f8181..8d751a7a9 100644 --- a/actions/favor.php +++ b/actions/favor.php @@ -29,7 +29,7 @@ class FavorAction extends Action parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -48,19 +48,19 @@ class FavorAction extends Action $token = $this->trimmed('token-'.$notice->id); if (!$token || $token != common_session_token()) { - $this->client_error(_("There was a problem with your session token. Try again, please.")); + $this->clientError(_("There was a problem with your session token. Try again, please.")); return; } if ($user->hasFave($notice)) { - $this->client_error(_('This notice is already a favorite!')); + $this->clientError(_('This notice is already a favorite!')); return; } $fave = Fave::addNew($user, $notice); if (!$fave) { - $this->server_error(_('Could not create favorite.')); + $this->serverError(_('Could not create favorite.')); return; } @@ -69,13 +69,13 @@ class FavorAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Disfavor favorite')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Disfavor favorite')); + $this->elementEnd('head'); + $this->elementStart('body'); common_disfavor_form($notice); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url('showfavorites', array('nickname' => $user->nickname))); diff --git a/actions/favorited.php b/actions/favorited.php index 71a9e026e..936905732 100644 --- a/actions/favorited.php +++ b/actions/favorited.php @@ -43,9 +43,9 @@ class FavoritedAction extends StreamAction { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); $this->public_views_menu(); } @@ -81,7 +81,7 @@ class FavoritedAction extends StreamAction $notice = new Notice; $notice->query(sprintf($qry, common_config('popular', 'dropoff'))); - common_element_start('ul', array('id' => 'notices')); + $this->elementStart('ul', array('id' => 'notices')); $cnt = 0; @@ -96,7 +96,7 @@ class FavoritedAction extends StreamAction $item->show(); } - common_element_end('ul'); + $this->elementEnd('ul'); common_pagination($page > 1, $cnt > NOTICES_PER_PAGE, $page, 'favorited'); diff --git a/actions/favoritesrss.php b/actions/favoritesrss.php index 8c7ce52bf..3f4ffc63a 100644 --- a/actions/favoritesrss.php +++ b/actions/favoritesrss.php @@ -34,7 +34,7 @@ class FavoritesrssAction extends Rss10Action $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return false; } else { return true; diff --git a/actions/featured.php b/actions/featured.php index 2bf8b0b81..035622691 100644 --- a/actions/featured.php +++ b/actions/featured.php @@ -44,9 +44,9 @@ class FeaturedAction extends StreamAction { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); $this->public_views_menu(); } diff --git a/actions/finishaddopenid.php b/actions/finishaddopenid.php index 0ce1680aa..708e8d4bf 100644 --- a/actions/finishaddopenid.php +++ b/actions/finishaddopenid.php @@ -28,7 +28,7 @@ class FinishaddopenidAction extends Action { parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); } else { $this->try_login(); } @@ -101,7 +101,7 @@ class FinishaddopenidAction extends Action function message($msg) { common_show_header(_('OpenID Login')); - common_element('p', null, $msg); + $this->element('p', null, $msg); common_show_footer(); } } diff --git a/actions/finishopenidlogin.php b/actions/finishopenidlogin.php index bdb8516a3..bc33ac330 100644 --- a/actions/finishopenidlogin.php +++ b/actions/finishopenidlogin.php @@ -28,7 +28,7 @@ class FinishopenidloginAction extends Action { parent::handle($args); if (common_logged_in()) { - common_user_error(_('Already logged in.')); + $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { @@ -57,10 +57,10 @@ class FinishopenidloginAction extends Action function show_top($error=null) { if ($error) { - common_element('div', array('class' => 'error'), $error); + $this->element('div', array('class' => 'error'), $error); } else { global $config; - common_element('div', 'instructions', + $this->element('div', 'instructions', sprintf(_('This is the first time you\'ve logged into %s so we must connect your OpenID to a local account. You can either create a new account, or connect with your existing account, if you have one.'), $config['site']['name'])); } } @@ -70,36 +70,36 @@ class FinishopenidloginAction extends Action common_show_header(_('OpenID Account Setup'), null, $error, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'account_connect', 'action' => common_local_url('finishopenidlogin'))); - common_hidden('token', common_session_token()); - common_element('h2', null, + $this->hidden('token', common_session_token()); + $this->element('h2', null, _('Create new account')); - common_element('p', null, + $this->element('p', null, _('Create a new user with this nickname.')); - common_input('newname', _('New nickname'), + $this->input('newname', _('New nickname'), ($username) ? $username : '', _('1-64 lowercase letters or numbers, no punctuation or spaces')); - common_element_start('p'); - common_element('input', array('type' => 'checkbox', + $this->elementStart('p'); + $this->element('input', array('type' => 'checkbox', 'id' => 'license', 'name' => 'license', 'value' => 'true')); - common_text(_('My text and files are available under ')); - common_element('a', array(href => common_config('license', 'url')), + $this->text(_('My text and files are available under ')); + $this->element('a', array(href => common_config('license', 'url')), common_config('license', 'title')); - common_text(_(' except this private data: password, email address, IM address, phone number.')); - common_element_end('p'); - common_submit('create', _('Create')); - common_element('h2', null, + $this->text(_(' except this private data: password, email address, IM address, phone number.')); + $this->elementEnd('p'); + $this->submit('create', _('Create')); + $this->element('h2', null, _('Connect existing account')); - common_element('p', null, + $this->element('p', null, _('If you already have an account, login with your username and password to connect it to your OpenID.')); - common_input('nickname', _('Existing nickname')); - common_password('password', _('Password')); - common_submit('connect', _('Connect')); - common_element_end('form'); + $this->input('nickname', _('Existing nickname')); + $this->password('password', _('Password')); + $this->submit('connect', _('Connect')); + $this->elementEnd('form'); common_show_footer(); } @@ -154,7 +154,7 @@ class FinishopenidloginAction extends Action function message($msg) { common_show_header(_('OpenID Login')); - common_element('p', null, $msg); + $this->element('p', null, $msg); common_show_footer(); } @@ -179,7 +179,7 @@ class FinishopenidloginAction extends Action # FIXME: save invite code before redirect, and check here if (common_config('site', 'closed') || common_config('site', 'inviteonly')) { - common_user_error(_('Registration not allowed.')); + $this->clientError(_('Registration not allowed.')); return; } @@ -205,7 +205,7 @@ class FinishopenidloginAction extends Action list($display, $canonical, $sreg) = $this->get_saved_values(); if (!$display || !$canonical) { - common_server_error(_('Stored OpenID not found.')); + $this->serverError(_('Stored OpenID not found.')); return; } @@ -214,7 +214,7 @@ class FinishopenidloginAction extends Action $other = oid_get_user($canonical); if ($other) { - common_server_error(_('Creating new account for OpenID that already has a user.')); + $this->serverError(_('Creating new account for OpenID that already has a user.')); return; } @@ -274,14 +274,14 @@ class FinishopenidloginAction extends Action list($display, $canonical, $sreg) = $this->get_saved_values(); if (!$display || !$canonical) { - common_server_error(_('Stored OpenID not found.')); + $this->serverError(_('Stored OpenID not found.')); return; } $result = oid_link_user($user->id, $canonical, $display); if (!$result) { - common_server_error(_('Error connecting user to OpenID.')); + $this->serverError(_('Error connecting user to OpenID.')); return; } diff --git a/actions/finishremotesubscribe.php b/actions/finishremotesubscribe.php index cee3a1818..f9094a50c 100644 --- a/actions/finishremotesubscribe.php +++ b/actions/finishremotesubscribe.php @@ -30,14 +30,14 @@ class FinishremotesubscribeAction extends Action parent::handle($args); if (common_logged_in()) { - common_user_error(_('You can use the local subscription!')); + $this->clientError(_('You can use the local subscription!')); return; } $omb = $_SESSION['oauth_authorization_request']; if (!$omb) { - common_user_error(_('Not expecting this response!')); + $this->clientError(_('Not expecting this response!')); return; } @@ -51,38 +51,38 @@ class FinishremotesubscribeAction extends Action # I think this is the success metric if ($token != $omb['token']) { - common_user_error(_('Not authorized.')); + $this->clientError(_('Not authorized.')); return; } $version = $req->get_parameter('omb_version'); if ($version != OMB_VERSION_01) { - common_user_error(_('Unknown version of OMB protocol.')); + $this->clientError(_('Unknown version of OMB protocol.')); return; } $nickname = $req->get_parameter('omb_listener_nickname'); if (!$nickname) { - common_user_error(_('No nickname provided by remote server.')); + $this->clientError(_('No nickname provided by remote server.')); return; } $profile_url = $req->get_parameter('omb_listener_profile'); if (!$profile_url) { - common_user_error(_('No profile URL returned by server.')); + $this->clientError(_('No profile URL returned by server.')); return; } if (!Validate::uri($profile_url, array('allowed_schemes' => array('http', 'https')))) { - common_user_error(_('Invalid profile URL returned by server.')); + $this->clientError(_('Invalid profile URL returned by server.')); return; } if ($profile_url == common_local_url('showstream', array('nickname' => $nickname))) { - common_user_error(_('You can use the local subscription!')); + $this->clientError(_('You can use the local subscription!')); return; } @@ -91,14 +91,14 @@ class FinishremotesubscribeAction extends Action $user = User::staticGet('nickname', $omb['listenee']); if (!$user) { - common_user_error(_('User being listened to doesn\'t exist.')); + $this->clientError(_('User being listened to doesn\'t exist.')); return; } $other = User::staticGet('uri', $omb['listener']); if ($other) { - common_user_error(_('You can use the local subscription!')); + $this->clientError(_('You can use the local subscription!')); return; } @@ -111,7 +111,7 @@ class FinishremotesubscribeAction extends Action list($newtok, $newsecret) = $this->access_token($omb); if (!$newtok || !$newsecret) { - common_user_error(_('Couldn\'t convert request tokens to access tokens.')); + $this->clientError(_('Couldn\'t convert request tokens to access tokens.')); return; } @@ -155,7 +155,7 @@ class FinishremotesubscribeAction extends Action $profile->created = DB_DataObject_Cast::dateTime(); # current time $id = $profile->insert(); if (!$id) { - common_server_error(_('Error inserting new profile')); + $this->serverError(_('Error inserting new profile')); return; } $remote->id = $id; @@ -163,7 +163,7 @@ class FinishremotesubscribeAction extends Action if ($avatar_url) { if (!$this->add_avatar($profile, $avatar_url)) { - common_server_error(_('Error inserting avatar')); + $this->serverError(_('Error inserting avatar')); return; } } @@ -173,19 +173,19 @@ class FinishremotesubscribeAction extends Action if ($exists) { if (!$remote->update($orig_remote)) { - common_server_error(_('Error updating remote profile')); + $this->serverError(_('Error updating remote profile')); return; } } else { $remote->created = DB_DataObject_Cast::dateTime(); # current time if (!$remote->insert()) { - common_server_error(_('Error inserting remote profile')); + $this->serverError(_('Error inserting remote profile')); return; } } if ($user->hasBlocked($profile)) { - $this->client_error(_('That user has blocked you from subscribing.')); + $this->clientError(_('That user has blocked you from subscribing.')); return; } @@ -215,7 +215,7 @@ class FinishremotesubscribeAction extends Action if (!$result) { common_log_db_error($sub, ($sub_exists) ? 'UPDATE' : 'INSERT', __FILE__); - common_user_error(_('Couldn\'t insert new subscription.')); + $this->clientError(_('Couldn\'t insert new subscription.')); return; } diff --git a/actions/foaf.php b/actions/foaf.php index 30e98960c..9fa321d4a 100644 --- a/actions/foaf.php +++ b/actions/foaf.php @@ -26,7 +26,7 @@ define('BOTH', 0); class FoafAction extends Action { - function is_readonly() + function isReadOnly() { return true; } @@ -40,21 +40,21 @@ class FoafAction extends Action $user = User::staticGet('nickname', $nickname); if (!$user) { - common_user_error(_('No such user.'), 404); + $this->clientError(_('No such user.'), 404); return; } $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.'), 500); + $this->serverError(_('User has no profile.'), 500); return; } header('Content-Type: application/rdf+xml'); common_start_xml(); - common_element_start('rdf:RDF', array('xmlns:rdf' => + $this->elementStart('rdf:RDF', array('xmlns:rdf' => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'xmlns:rdfs' => 'http://www.w3.org/2000/01/rdf-schema#', @@ -67,25 +67,25 @@ class FoafAction extends Action $this->show_ppd('', $user->uri); # XXX: might not be a person - common_element_start('Person', array('rdf:about' => + $this->elementStart('Person', array('rdf:about' => $user->uri)); - common_element('mbox_sha1sum', null, sha1('mailto:' . $user->email)); + $this->element('mbox_sha1sum', null, sha1('mailto:' . $user->email)); if ($profile->fullname) { - common_element('name', null, $profile->fullname); + $this->element('name', null, $profile->fullname); } if ($profile->homepage) { - common_element('homepage', array('rdf:resource' => $profile->homepage)); + $this->element('homepage', array('rdf:resource' => $profile->homepage)); } if ($profile->bio) { - common_element('rdfs:comment', null, $profile->bio); + $this->element('rdfs:comment', null, $profile->bio); } # XXX: more structured location data if ($profile->location) { - common_element_start('based_near'); - common_element_start('geo:SpatialThing'); - common_element('name', null, $profile->location); - common_element_end('geo:SpatialThing'); - common_element_end('based_near'); + $this->elementStart('based_near'); + $this->elementStart('geo:SpatialThing'); + $this->element('name', null, $profile->location); + $this->elementEnd('geo:SpatialThing'); + $this->elementEnd('based_near'); } $this->show_microblogging_account($profile, common_root_url()); @@ -93,18 +93,18 @@ class FoafAction extends Action $avatar = $profile->getOriginalAvatar(); if ($avatar) { - common_element_start('img'); - common_element_start('Image', array('rdf:about' => $avatar->url)); + $this->elementStart('img'); + $this->elementStart('Image', array('rdf:about' => $avatar->url)); foreach (array(AVATAR_PROFILE_SIZE, AVATAR_STREAM_SIZE, AVATAR_MINI_SIZE) as $size) { $scaled = $profile->getAvatar($size); if (!$scaled->original) { # sometimes the original has one of our scaled sizes - common_element_start('thumbnail'); - common_element('Image', array('rdf:about' => $scaled->url)); - common_element_end('thumbnail'); + $this->elementStart('thumbnail'); + $this->element('Image', array('rdf:about' => $scaled->url)); + $this->elementEnd('thumbnail'); } } - common_element_end('Image'); - common_element_end('img'); + $this->elementEnd('Image'); + $this->elementEnd('img'); } # Get people user is subscribed to @@ -126,7 +126,7 @@ class FoafAction extends Action common_debug('Got a bad subscription: '.print_r($sub,true)); continue; } - common_element('knows', array('rdf:resource' => $other->uri)); + $this->element('knows', array('rdf:resource' => $other->uri)); $person[$other->uri] = array(LISTENEE, $other); } } @@ -156,7 +156,7 @@ class FoafAction extends Action } } - common_element_end('Person'); + $this->elementEnd('Person'); foreach ($person as $uri => $p) { $foaf_url = null; @@ -164,44 +164,44 @@ class FoafAction extends Action $foaf_url = common_local_url('foaf', array('nickname' => $p[1]->nickname)); } $profile = Profile::staticGet($p[1]->id); - common_element_start('Person', array('rdf:about' => $uri)); + $this->elementStart('Person', array('rdf:about' => $uri)); if ($p[0] == LISTENER || $p[0] == BOTH) { - common_element('knows', array('rdf:resource' => $user->uri)); + $this->element('knows', array('rdf:resource' => $user->uri)); } $this->show_microblogging_account($profile, ($p[1] instanceof User) ? common_root_url() : null); if ($foaf_url) { - common_element('rdfs:seeAlso', array('rdf:resource' => $foaf_url)); + $this->element('rdfs:seeAlso', array('rdf:resource' => $foaf_url)); } - common_element_end('Person'); + $this->elementEnd('Person'); if ($foaf_url) { $this->show_ppd($foaf_url, $uri); } } - common_element_end('rdf:RDF'); + $this->elementEnd('rdf:RDF'); } function show_ppd($foaf_url, $person_uri) { - common_element_start('PersonalProfileDocument', array('rdf:about' => $foaf_url)); - common_element('maker', array('rdf:resource' => $person_uri)); - common_element('primaryTopic', array('rdf:resource' => $person_uri)); - common_element_end('PersonalProfileDocument'); + $this->elementStart('PersonalProfileDocument', array('rdf:about' => $foaf_url)); + $this->element('maker', array('rdf:resource' => $person_uri)); + $this->element('primaryTopic', array('rdf:resource' => $person_uri)); + $this->elementEnd('PersonalProfileDocument'); } function show_microblogging_account($profile, $service=null) { # Their account - common_element_start('holdsAccount'); - common_element_start('OnlineAccount'); + $this->elementStart('holdsAccount'); + $this->elementStart('OnlineAccount'); if ($service) { - common_element('accountServiceHomepage', array('rdf:resource' => + $this->element('accountServiceHomepage', array('rdf:resource' => $service)); } - common_element('accountName', null, $profile->nickname); - common_element('homepage', array('rdf:resource' => $profile->profileurl)); - common_element_end('OnlineAccount'); - common_element_end('holdsAccount'); + $this->element('accountName', null, $profile->nickname); + $this->element('homepage', array('rdf:resource' => $profile->profileurl)); + $this->elementEnd('OnlineAccount'); + $this->elementEnd('holdsAccount'); } } diff --git a/actions/imsettings.php b/actions/imsettings.php index 8ecf200ec..14df3451a 100644 --- a/actions/imsettings.php +++ b/actions/imsettings.php @@ -34,57 +34,57 @@ class ImsettingsAction extends SettingsAction { $user = common_current_user(); $this->form_header(_('IM Settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'imsettings', 'action' => common_local_url('imsettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_element('h2', null, _('Address')); + $this->element('h2', null, _('Address')); if ($user->jabber) { - common_element_start('p'); - common_element('span', 'address confirmed', $user->jabber); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address confirmed', $user->jabber); + $this->element('span', 'input_instructions', _('Current confirmed Jabber/GTalk address.')); - common_hidden('jabber', $user->jabber); - common_element_end('p'); - common_submit('remove', _('Remove')); + $this->hidden('jabber', $user->jabber); + $this->elementEnd('p'); + $this->submit('remove', _('Remove')); } else { $confirm = $this->get_confirmation(); if ($confirm) { - common_element_start('p'); - common_element('span', 'address unconfirmed', $confirm->address); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address unconfirmed', $confirm->address); + $this->element('span', 'input_instructions', sprintf(_('Awaiting confirmation on this address. Check your Jabber/GTalk account for a message with further instructions. (Did you add %s to your buddy list?)'), jabber_daemon_address())); - common_hidden('jabber', $confirm->address); - common_element_end('p'); - common_submit('cancel', _('Cancel')); + $this->hidden('jabber', $confirm->address); + $this->elementEnd('p'); + $this->submit('cancel', _('Cancel')); } else { - common_input('jabber', _('IM Address'), + $this->input('jabber', _('IM Address'), ($this->arg('jabber')) ? $this->arg('jabber') : null, sprintf(_('Jabber or GTalk address, like "UserName@example.org". First, make sure to add %s to your buddy list in your IM client or on GTalk.'), jabber_daemon_address())); - common_submit('add', _('Add')); + $this->submit('add', _('Add')); } } - common_element('h2', null, _('Preferences')); + $this->element('h2', null, _('Preferences')); - common_checkbox('jabbernotify', + $this->checkbox('jabbernotify', _('Send me notices through Jabber/GTalk.'), $user->jabbernotify); - common_checkbox('updatefrompresence', + $this->checkbox('updatefrompresence', _('Post a notice when my Jabber/GTalk status changes.'), $user->updatefrompresence); - common_checkbox('jabberreplies', + $this->checkbox('jabberreplies', _('Send me replies through Jabber/GTalk from people I\'m not subscribed to.'), $user->jabberreplies); - common_checkbox('jabbermicroid', + $this->checkbox('jabbermicroid', _('Publish a MicroID for my Jabber/GTalk address.'), $user->jabbermicroid); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } @@ -149,7 +149,7 @@ class ImsettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } @@ -199,7 +199,7 @@ class ImsettingsAction extends SettingsAction if ($result === false) { common_log_db_error($confirm, 'INSERT', __FILE__); - common_server_error(_('Couldn\'t insert confirmation code.')); + $this->serverError(_('Couldn\'t insert confirmation code.')); return; } @@ -231,7 +231,7 @@ class ImsettingsAction extends SettingsAction if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - $this->server_error(_('Couldn\'t delete email confirmation.')); + $this->serverError(_('Couldn\'t delete email confirmation.')); return; } @@ -257,7 +257,7 @@ class ImsettingsAction extends SettingsAction $result = $user->updateKeys($original); if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } $user->query('COMMIT'); diff --git a/actions/invite.php b/actions/invite.php index 80e022a3d..95d96bcde 100644 --- a/actions/invite.php +++ b/actions/invite.php @@ -22,7 +22,7 @@ if (!defined('LACONICA')) { exit(1); } class InviteAction extends Action { - function is_readonly() + function isReadOnly() { return false; } @@ -31,7 +31,7 @@ class InviteAction extends Action { parent::handle($args); if (!common_logged_in()) { - $this->client_error(sprintf(_('You must be logged in to invite other users to use %s'), + $this->clientError(sprintf(_('You must be logged in to invite other users to use %s'), common_config('site', 'name'))); return; } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { @@ -89,29 +89,29 @@ class InviteAction extends Action common_show_header(_('Invitation(s) sent')); if ($already) { - common_element('p', null, _('You are already subscribed to these users:')); - common_element_start('ul'); + $this->element('p', null, _('You are already subscribed to these users:')); + $this->elementStart('ul'); foreach ($already as $other) { - common_element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); + $this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); } - common_element_end('ul'); + $this->elementEnd('ul'); } if ($subbed) { - common_element('p', null, _('These people are already users and you were automatically subscribed to them:')); - common_element_start('ul'); + $this->element('p', null, _('These people are already users and you were automatically subscribed to them:')); + $this->elementStart('ul'); foreach ($subbed as $other) { - common_element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); + $this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email)); } - common_element_end('ul'); + $this->elementEnd('ul'); } if ($sent) { - common_element('p', null, _('Invitation(s) sent to the following people:')); - common_element_start('ul'); + $this->element('p', null, _('Invitation(s) sent to the following people:')); + $this->elementStart('ul'); foreach ($sent as $other) { - common_element('li', null, $other); + $this->element('li', null, $other); } - common_element_end('ul'); - common_element('p', null, _('You will be notified when your invitees accept the invitation and register on the site. Thanks for growing the community!')); + $this->elementEnd('ul'); + $this->element('p', null, _('You will be notified when your invitees accept the invitation and register on the site. Thanks for growing the community!')); } common_show_footer(); } @@ -119,12 +119,12 @@ class InviteAction extends Action function show_top($error=null) { if ($error) { - common_element('p', 'error', $error); + $this->element('p', 'error', $error); } else { - common_element_start('div', 'instructions'); - common_element('p', null, + $this->elementStart('div', 'instructions'); + $this->element('p', null, _('Use this form to invite your friends and colleagues to use this service.')); - common_element_end('div'); + $this->elementEnd('div'); } } @@ -135,22 +135,22 @@ class InviteAction extends Action common_show_header(_('Invite new users'), null, $error, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'invite', 'action' => common_local_url('invite'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_textarea('addresses', _('Email addresses'), + $this->textarea('addresses', _('Email addresses'), $this->trimmed('addresses'), _('Addresses of friends to invite (one per line)')); - common_textarea('personal', _('Personal message'), + $this->textarea('personal', _('Personal message'), $this->trimmed('personal'), _('Optionally add a personal message to the invitation.')); - common_submit('send', _('Send')); + $this->submit('send', _('Send')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } diff --git a/actions/login.php b/actions/login.php index 8600d44fd..23ab16676 100644 --- a/actions/login.php +++ b/actions/login.php @@ -21,8 +21,9 @@ if (!defined('LACONICA')) { exit(1); } class LoginAction extends Action { - - function is_readonly() + var $error = null; + + function isReadOnly() { return true; } @@ -31,22 +32,22 @@ class LoginAction extends Action { parent::handle($args); if (common_is_real_login()) { - common_user_error(_('Already logged in.')); + $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { - $this->check_login(); + $this->checkLogin(); } else { - $this->show_form(); + $this->showForm(); } } - function check_login() + function checkLogin() { # XXX: login throttle # CSRF protection - token set in common_notice_form() $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } @@ -55,7 +56,7 @@ class LoginAction extends Action if (common_check_user($nickname, $password)) { # success! if (!common_set_user($nickname)) { - common_server_error(_('Error setting user.')); + $this->serverError(_('Error setting user.')); return; } common_real_login(true); @@ -75,13 +76,13 @@ class LoginAction extends Action } common_redirect($url); } else { - $this->show_form(_('Incorrect username or password.')); + $this->showForm(_('Incorrect username or password.')); return; } # success! if (!common_set_user($user)) { - common_server_error(_('Error setting user.')); + $this->serverError(_('Error setting user.')); return; } @@ -104,28 +105,48 @@ class LoginAction extends Action common_redirect($url); } - function show_form($error=null) + function showForm($error=null) { - common_show_header(_('Login'), null, $error, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->error = $error; + $this->showPage(); + } + + function title() + { + return _('Login'); + } + + function showPageNotice() + { + if ($this->error) { + $this->element('p', 'error', $this->error); + } else { + $instr = $this->getInstructions(); + $output = common_markup_to_html($instr); + $this->raw($output); + } + } + + function showContent() + { + $this->elementStart('form', array('method' => 'post', 'id' => 'login', 'action' => common_local_url('login'))); - common_input('nickname', _('Nickname')); - common_password('password', _('Password')); - common_checkbox('rememberme', _('Remember me'), false, + $this->input('nickname', _('Nickname')); + $this->password('password', _('Password')); + $this->checkbox('rememberme', _('Remember me'), false, _('Automatically login in the future; ' . 'not for shared computers!')); - common_submit('submit', _('Login')); - common_hidden('token', common_session_token()); - common_element_end('form'); - common_element_start('p'); - common_element('a', array('href' => common_local_url('recoverpassword')), + $this->submit('submit', _('Login')); + $this->hidden('token', common_session_token()); + $this->elementEnd('form'); + $this->elementStart('p'); + $this->element('a', array('href' => common_local_url('recoverpassword')), _('Lost or forgotten password?')); - common_element_end('p'); - common_show_footer(); + $this->elementEnd('p'); } - function get_instructions() + function getInstructions() { if (common_logged_in() && !common_is_real_login() && @@ -143,17 +164,4 @@ class LoginAction extends Action 'try [OpenID](%%action.openidlogin%%). '); } } - - function show_top($error=null) - { - if ($error) { - common_element('p', 'error', $error); - } else { - $instr = $this->get_instructions(); - $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); - } - } } diff --git a/actions/logout.php b/actions/logout.php index 201378730..86d6270ab 100644 --- a/actions/logout.php +++ b/actions/logout.php @@ -24,7 +24,7 @@ require_once(INSTALLDIR.'/lib/openid.php'); class LogoutAction extends Action { - function is_readonly() + function isReadOnly() { return true; } @@ -33,7 +33,7 @@ class LogoutAction extends Action { parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); } else { common_set_user(null); common_real_login(false); # not logged in diff --git a/actions/microsummary.php b/actions/microsummary.php index 13ddc4e3e..b46c5bee5 100644 --- a/actions/microsummary.php +++ b/actions/microsummary.php @@ -31,14 +31,14 @@ class MicrosummaryAction extends Action $user = User::staticGet('nickname', $nickname); if (!$user) { - $this->client_error(_('No such user'), 404); + $this->clientError(_('No such user'), 404); return; } $notice = $user->getCurrentNotice(); if (!$notice) { - $this->client_error(_('No current status'), 404); + $this->clientError(_('No current status'), 404); } header('Content-Type: text/plain'); diff --git a/actions/newmessage.php b/actions/newmessage.php index 27fa9d518..510a5f8f3 100644 --- a/actions/newmessage.php +++ b/actions/newmessage.php @@ -27,7 +27,7 @@ class NewmessageAction extends Action parent::handle($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.'), 403); + $this->clientError(_('Not logged in.'), 403); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->save_new_message(); } else { @@ -71,10 +71,10 @@ class NewmessageAction extends Action $this->show_form(_('No recipient specified.')); return; } else if (!$user->mutuallySubscribed($other)) { - $this->client_error(_('You can\'t send a message to this user.'), 404); + $this->clientError(_('You can\'t send a message to this user.'), 404); return; } else if ($user->id == $other->id) { - $this->client_error(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'), 403); + $this->clientError(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'), 403); return; } @@ -113,12 +113,12 @@ class NewmessageAction extends Action $other = User::staticGet('id', $to); if (!$other) { - $this->client_error(_('No such user'), 404); + $this->clientError(_('No such user'), 404); return; } if (!$user->mutuallySubscribed($other)) { - $this->client_error(_('You can\'t send a message to this user.'), 404); + $this->clientError(_('You can\'t send a message to this user.'), 404); return; } @@ -127,7 +127,7 @@ class NewmessageAction extends Action array($this, 'show_top')); if ($msg) { - common_element('p', array('id'=>'error'), $msg); + $this->element('p', array('id'=>'error'), $msg); } common_show_footer(); diff --git a/actions/newnotice.php b/actions/newnotice.php index c412e893d..cb02854a1 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -29,13 +29,13 @@ class NewnoticeAction extends Action parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { # CSRF protection - token set in common_notice_form() $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } @@ -92,13 +92,13 @@ class NewnoticeAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Notice posted')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Notice posted')); + $this->elementEnd('head'); + $this->elementStart('body'); $this->show_notice($notice); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { $returnto = $this->trimmed('returnto'); @@ -116,13 +116,13 @@ class NewnoticeAction extends Action function ajax_error_msg($msg) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Ajax Error')); - common_element_end('head'); - common_element_start('body'); - common_element('p', array('id' => 'error'), $msg); - common_element_end('body'); - common_element_end('html'); + $this->elementStart('head'); + $this->element('title', null, _('Ajax Error')); + $this->elementEnd('head'); + $this->elementStart('body'); + $this->element('p', array('id' => 'error'), $msg); + $this->elementEnd('body'); + $this->elementEnd('html'); } function show_top($content=null) @@ -147,7 +147,7 @@ class NewnoticeAction extends Action common_show_header(_('New notice'), null, $content, array($this, 'show_top')); if ($msg) { - common_element('p', array('id' => 'error'), $msg); + $this->element('p', array('id' => 'error'), $msg); } common_show_footer(); } diff --git a/actions/noticesearch.php b/actions/noticesearch.php index b36fc8ad2..336e39bd3 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -58,7 +58,7 @@ class NoticesearchAction extends SearchAction } if ($cnt > 0) { $terms = preg_split('/[\s,]+/', $q); - common_element_start('ul', array('id' => 'notices')); + $this->elementStart('ul', array('id' => 'notices')); for ($i = 0; $i < min($cnt, NOTICES_PER_PAGE); $i++) { if ($notice->fetch()) { $this->show_notice($notice, $terms); @@ -67,9 +67,9 @@ class NoticesearchAction extends SearchAction break; } } - common_element_end('ul'); + $this->elementEnd('ul'); } else { - common_element('p', 'error', _('No results')); + $this->element('p', 'error', _('No results')); } common_pagination($page > 1, $cnt > NOTICES_PER_PAGE, @@ -82,7 +82,7 @@ class NoticesearchAction extends SearchAction $q = $arr[0]; } if ($q) { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('noticesearchrss', array('q' => $q)), 'type' => 'application/rss+xml', @@ -97,62 +97,62 @@ class NoticesearchAction extends SearchAction $profile = $notice->getProfile(); if (!$profile) { common_log_db_error($notice, 'SELECT', __FILE__); - $this->server_error(_('Notice without matching profile')); + $this->serverError(_('Notice without matching profile')); return; } # XXX: RDFa - common_element_start('li', array('class' => 'notice_single', + $this->elementStart('li', array('class' => 'notice_single', 'id' => 'notice-' . $notice->id)); $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE); - common_element_start('a', array('href' => $profile->profileurl)); - common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE), + $this->elementStart('a', array('href' => $profile->profileurl)); + $this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE), 'class' => 'avatar stream', 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'alt' => ($profile->fullname) ? $profile->fullname : $profile->nickname)); - common_element_end('a'); - common_element('a', array('href' => $profile->profileurl, + $this->elementEnd('a'); + $this->element('a', array('href' => $profile->profileurl, 'class' => 'nickname'), $profile->nickname); # FIXME: URL, image, video, audio - common_element_start('p', array('class' => 'content')); + $this->elementStart('p', array('class' => 'content')); if ($notice->rendered) { - common_raw($this->highlight($notice->rendered, $terms)); + $this->raw($this->highlight($notice->rendered, $terms)); } else { # XXX: may be some uncooked notices in the DB, # we cook them right now. This should probably disappear in future # versions (>> 0.4.x) - common_raw($this->highlight(common_render_content($notice->content, $notice), $terms)); + $this->raw($this->highlight(common_render_content($notice->content, $notice), $terms)); } - common_element_end('p'); + $this->elementEnd('p'); $noticeurl = common_local_url('shownotice', array('notice' => $notice->id)); - common_element_start('p', 'time'); - common_element('a', array('class' => 'permalink', + $this->elementStart('p', 'time'); + $this->element('a', array('class' => 'permalink', 'href' => $noticeurl, 'title' => common_exact_date($notice->created)), common_date_string($notice->created)); if ($notice->reply_to) { $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to)); - common_text(' ('); - common_element('a', array('class' => 'inreplyto', + $this->text(' ('); + $this->element('a', array('class' => 'inreplyto', 'href' => $replyurl), _('in reply to...')); - common_text(')'); + $this->text(')'); } - common_element_start('a', + $this->elementStart('a', array('href' => common_local_url('newnotice', array('replyto' => $profile->nickname)), 'onclick' => 'doreply("'.$profile->nickname.'"); return false', 'title' => _('reply'), 'class' => 'replybutton')); - common_hidden('posttoken', common_session_token()); + $this->hidden('posttoken', common_session_token()); - common_raw('→'); - common_element_end('a'); - common_element_end('p'); - common_element_end('li'); + $this->raw('→'); + $this->elementEnd('a'); + $this->elementEnd('p'); + $this->elementEnd('li'); } function highlight($text, $terms) diff --git a/actions/nudge.php b/actions/nudge.php index a6480a582..49223d431 100644 --- a/actions/nudge.php +++ b/actions/nudge.php @@ -29,7 +29,7 @@ class NudgeAction extends Action parent::handle($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -46,12 +46,12 @@ class NudgeAction extends Action $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } if (!$other->email || !$other->emailnotifynudge) { - $this->client_error(_('This user doesn\'t allow nudges or hasn\'t confirmed or set his email yet.')); + $this->clientError(_('This user doesn\'t allow nudges or hasn\'t confirmed or set his email yet.')); return; } @@ -59,13 +59,13 @@ class NudgeAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Nudge sent')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Nudge sent')); + $this->elementEnd('head'); + $this->elementStart('body'); common_nudge_response(); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { // display a confirmation to the user common_redirect(common_local_url('showstream', diff --git a/actions/openidlogin.php b/actions/openidlogin.php index 09679e372..d1989e0de 100644 --- a/actions/openidlogin.php +++ b/actions/openidlogin.php @@ -28,7 +28,7 @@ class OpenidloginAction extends Action { parent::handle($args); if (common_logged_in()) { - common_user_error(_('Already logged in.')); + $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $openid_url = $this->trimmed('openid_url'); @@ -66,13 +66,13 @@ class OpenidloginAction extends Action function show_top($error=null) { if ($error) { - common_element('div', array('class' => 'error'), $error); + $this->element('div', array('class' => 'error'), $error); } else { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); } } @@ -80,18 +80,18 @@ class OpenidloginAction extends Action { common_show_header(_('OpenID Login'), null, $error, array($this, 'show_top')); $formaction = common_local_url('openidlogin'); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'openidlogin', 'action' => $formaction)); - common_hidden('token', common_session_token()); - common_input('openid_url', _('OpenID URL'), + $this->hidden('token', common_session_token()); + $this->input('openid_url', _('OpenID URL'), $openid_url, _('Your OpenID URL')); - common_checkbox('rememberme', _('Remember me'), false, + $this->checkbox('rememberme', _('Remember me'), false, _('Automatically login in the future; ' . 'not for shared computers!')); - common_submit('submit', _('Login')); - common_element_end('form'); + $this->submit('submit', _('Login')); + $this->elementEnd('form'); common_show_footer(); } } diff --git a/actions/openidsettings.php b/actions/openidsettings.php index 039236048..9265b5ea6 100644 --- a/actions/openidsettings.php +++ b/actions/openidsettings.php @@ -39,28 +39,28 @@ class OpenidsettingsAction extends SettingsAction $this->form_header(_('OpenID settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'openidadd', 'action' => common_local_url('openidsettings'))); - common_hidden('token', common_session_token()); - common_element('h2', null, _('Add OpenID')); - common_element('p', null, + $this->hidden('token', common_session_token()); + $this->element('h2', null, _('Add OpenID')); + $this->element('p', null, _('If you want to add an OpenID to your account, ' . 'enter it in the box below and click "Add".')); - common_element_start('p'); - common_element('label', array('for' => 'openid_url'), + $this->elementStart('p'); + $this->element('label', array('for' => 'openid_url'), _('OpenID URL')); - common_element('input', array('name' => 'openid_url', + $this->element('input', array('name' => 'openid_url', 'type' => 'text', 'id' => 'openid_url')); - common_element('input', array('type' => 'submit', + $this->element('input', array('type' => 'submit', 'id' => 'add', 'name' => 'add', 'class' => 'submit', 'value' => _('Add'))); - common_element_end('p'); - common_element_end('form'); + $this->elementEnd('p'); + $this->elementEnd('form'); $oid = new User_openid(); $oid->user_id = $user->id; @@ -69,48 +69,48 @@ class OpenidsettingsAction extends SettingsAction if ($cnt > 0) { - common_element('h2', null, _('Remove OpenID')); + $this->element('h2', null, _('Remove OpenID')); if ($cnt == 1 && !$user->password) { - common_element('p', null, + $this->element('p', null, _('Removing your only OpenID would make it impossible to log in! ' . 'If you need to remove it, add another OpenID first.')); if ($oid->fetch()) { - common_element_start('p'); - common_element('a', array('href' => $oid->canonical), + $this->elementStart('p'); + $this->element('a', array('href' => $oid->canonical), $oid->display); - common_element_end('p'); + $this->elementEnd('p'); } } else { - common_element('p', null, + $this->element('p', null, _('You can remove an OpenID from your account '. 'by clicking the button marked "Remove".')); $idx = 0; while ($oid->fetch()) { - common_element_start('form', array('method' => 'POST', + $this->elementStart('form', array('method' => 'POST', 'id' => 'openiddelete' . $idx, 'action' => common_local_url('openidsettings'))); - common_element_start('p'); - common_hidden('token', common_session_token()); - common_element('a', array('href' => $oid->canonical), + $this->elementStart('p'); + $this->hidden('token', common_session_token()); + $this->element('a', array('href' => $oid->canonical), $oid->display); - common_element('input', array('type' => 'hidden', + $this->element('input', array('type' => 'hidden', 'id' => 'openid_url'.$idx, 'name' => 'openid_url', 'value' => $oid->canonical)); - common_element('input', array('type' => 'submit', + $this->element('input', array('type' => 'submit', 'id' => 'remove'.$idx, 'name' => 'remove', 'class' => 'submit', 'value' => _('Remove'))); - common_element_end('p'); - common_element_end('form'); + $this->elementEnd('p'); + $this->elementEnd('form'); $idx++; } } diff --git a/actions/opensearch.php b/actions/opensearch.php index 96691fa6f..6e6e794e9 100644 --- a/actions/opensearch.php +++ b/actions/opensearch.php @@ -41,21 +41,21 @@ class OpensearchAction extends Action header('Content-Type: text/html'); common_start_xml(); - common_element_start('OpenSearchDescription', array('xmlns' => 'http://a9.com/-/spec/opensearch/1.1/')); + $this->elementStart('OpenSearchDescription', array('xmlns' => 'http://a9.com/-/spec/opensearch/1.1/')); $short_name = common_config('site', 'name').' '.$short_name; - common_element('ShortName', null, $short_name); - common_element('Contact', null, common_config('site', 'email')); - common_element('Url', array('type' => 'text/html', 'method' => 'get', + $this->element('ShortName', null, $short_name); + $this->element('Contact', null, common_config('site', 'email')); + $this->element('Url', array('type' => 'text/html', 'method' => 'get', 'template' => str_replace('---', '{searchTerms}', common_local_url($type, array('q' => '---'))))); - common_element('Image', array('height' => 16, 'width' => 16, 'type' => 'image/vnd.microsoft.icon'), common_path('favicon.ico')); - common_element('Image', array('height' => 50, 'width' => 50, 'type' => 'image/png'), theme_path('logo.png')); - common_element('AdultContent', null, 'false'); - common_element('Language', null, common_language()); - common_element('OutputEncoding', null, 'UTF-8'); - common_element('InputEncoding', null, 'UTF-8'); - - common_element_end('OpenSearchDescription'); + $this->element('Image', array('height' => 16, 'width' => 16, 'type' => 'image/vnd.microsoft.icon'), common_path('favicon.ico')); + $this->element('Image', array('height' => 50, 'width' => 50, 'type' => 'image/png'), theme_path('logo.png')); + $this->element('AdultContent', null, 'false'); + $this->element('Language', null, common_language()); + $this->element('OutputEncoding', null, 'UTF-8'); + $this->element('InputEncoding', null, 'UTF-8'); + + $this->elementEnd('OpenSearchDescription'); common_end_xml(); } } diff --git a/actions/othersettings.php b/actions/othersettings.php index c2f08934c..51f6f8197 100644 --- a/actions/othersettings.php +++ b/actions/othersettings.php @@ -35,12 +35,12 @@ class OthersettingsAction extends SettingsAction $this->form_header(_('Other Settings'), $msg, $success); - common_element('h2', null, _('URL Auto-shortening')); - common_element_start('form', array('method' => 'post', + $this->element('h2', null, _('URL Auto-shortening')); + $this->elementStart('form', array('method' => 'post', 'id' => 'othersettings', 'action' => common_local_url('othersettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); $services = array( '' => 'None', @@ -54,13 +54,13 @@ class OthersettingsAction extends SettingsAction 'metamark.net' => 'metamark.net' ); - common_dropdown('urlshorteningservice', _('Service'), $services, _('Automatic shortening service to use.'), false, $user->urlshorteningservice); + $this->dropdown('urlshorteningservice', _('Service'), $services, _('Automatic shortening service to use.'), false, $user->urlshorteningservice); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); -// common_element('h2', null, _('Delete my account')); +// $this->element('h2', null, _('Delete my account')); // $this->show_delete_form(); common_show_footer(); @@ -68,15 +68,15 @@ class OthersettingsAction extends SettingsAction function show_feeds_list($feeds) { - common_element_start('div', array('class' => 'feedsdel')); - common_element('p', null, 'Feeds:'); - common_element_start('ul', array('class' => 'xoxo')); + $this->elementStart('div', array('class' => 'feedsdel')); + $this->element('p', null, 'Feeds:'); + $this->elementStart('ul', array('class' => 'xoxo')); foreach ($feeds as $key => $value) { $this->common_feed_item($feeds[$key]); } - common_element_end('ul'); - common_element_end('div'); + $this->elementEnd('ul'); + $this->elementEnd('div'); } //TODO move to common.php (and retrace its origin) @@ -100,13 +100,13 @@ class OthersettingsAction extends SettingsAction $feed['textContent'] = "FOAF"; break; } - common_element_start('li'); - common_element('a', array('href' => $feed['href'], + $this->elementStart('li'); + $this->element('a', array('href' => $feed['href'], 'class' => $feed_classname, 'type' => $feed_mimetype, 'title' => $feed_title), $feed['textContent']); - common_element_end('li'); + $this->elementEnd('li'); } // function show_delete_form() { @@ -115,13 +115,13 @@ class OthersettingsAction extends SettingsAction // $notices->profile_id = $user->id; // $notice_count = (int) $notices->count(); // -// common_element_start('form', array('method' => 'POST', +// $this->elementStart('form', array('method' => 'POST', // 'id' => 'delete', // 'action' => // common_local_url('deleteprofile'))); // -// common_hidden('token', common_session_token()); -// common_element('p', null, "You can copy your notices and contacts by saving the two links below before deleting your account. Be careful, this operation cannot be undone."); +// $this->hidden('token', common_session_token()); +// $this->element('p', null, "You can copy your notices and contacts by saving the two links below before deleting your account. Be careful, this operation cannot be undone."); // // $this->show_feeds_list(array(0=>array('href'=>common_local_url('userrss', array('limit' => $notice_count, 'nickname' => $user->nickname)), // 'type' => 'rss', @@ -132,8 +132,8 @@ class OthersettingsAction extends SettingsAction // 'version' => 'FOAF', // 'item' => 'foaf'))); // -// common_submit('deleteaccount', _('Delete my account')); -// common_element_end('form'); +// $this->submit('deleteaccount', _('Delete my account')); +// $this->elementEnd('form'); // } function handle_post() @@ -177,7 +177,7 @@ class OthersettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index 0d0fae4e5..2b13b0812 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -60,7 +60,7 @@ class PeoplesearchAction extends SearchAction $results = new PeopleSearchResults($profile, $terms); $results->show_list(); } else { - common_element('p', 'error', _('No results')); + $this->element('p', 'error', _('No results')); } $profile->free(); diff --git a/actions/peopletag.php b/actions/peopletag.php index 13a0b7a41..7bcfcb93e 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -32,7 +32,7 @@ class PeopletagAction extends Action $tag = $this->trimmed('tag'); if (!common_valid_profile_tag($tag)) { - $this->client_error(sprintf(_('Not a valid people tag: %s'), $tag)); + $this->clientError(sprintf(_('Not a valid people tag: %s'), $tag)); return; } @@ -90,11 +90,11 @@ class PeopletagAction extends Action { $instr = sprintf(_('These are users who have tagged themselves "%s" ' . 'to show a common interest, characteristic, hobby or job.'), $tag); - common_element_start('div', 'instructions'); - common_element_start('p'); - common_text($instr); - common_element_end('p'); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->elementStart('p'); + $this->text($instr); + $this->elementEnd('p'); + $this->elementEnd('div'); } function get_title() diff --git a/actions/postnotice.php b/actions/postnotice.php index dec62a678..0b4735296 100644 --- a/actions/postnotice.php +++ b/actions/postnotice.php @@ -36,7 +36,7 @@ class PostnoticeAction extends Action print "omb_version=".OMB_VERSION_01; } } catch (OAuthException $e) { - common_server_error($e->getMessage()); + $this->serverError($e->getMessage()); return; } } @@ -45,36 +45,36 @@ class PostnoticeAction extends Action { $version = $req->get_parameter('omb_version'); if ($version != OMB_VERSION_01) { - common_user_error(_('Unsupported OMB version'), 400); + $this->clientError(_('Unsupported OMB version'), 400); return false; } # First, check to see $listenee = $req->get_parameter('omb_listenee'); $remote_profile = Remote_profile::staticGet('uri', $listenee); if (!$remote_profile) { - common_user_error(_('Profile unknown'), 403); + $this->clientError(_('Profile unknown'), 403); return false; } $sub = Subscription::staticGet('token', $token->key); if (!$sub) { - common_user_error(_('No such subscription'), 403); + $this->clientError(_('No such subscription'), 403); return false; } $content = $req->get_parameter('omb_notice_content'); $content_shortened = common_shorten_links($content); if (mb_strlen($content_shortened) > 140) { - common_user_error(_('Invalid notice content'), 400); + $this->clientError(_('Invalid notice content'), 400); return false; } $notice_uri = $req->get_parameter('omb_notice'); if (!Validate::uri($notice_uri) && !common_valid_tag($notice_uri)) { - common_user_error(_('Invalid notice uri'), 400); + $this->clientError(_('Invalid notice uri'), 400); return false; } $notice_url = $req->get_parameter('omb_notice_url'); if ($notice_url && !common_valid_http_url($notice_url)) { - common_user_error(_('Invalid notice url'), 400); + $this->clientError(_('Invalid notice url'), 400); return false; } $notice = Notice::staticGet('uri', $notice_uri); diff --git a/actions/profilesettings.php b/actions/profilesettings.php index d861919b9..6ad3f2ef5 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -34,11 +34,11 @@ class ProfilesettingsAction extends SettingsAction { $this->form_header(_('Profile settings'), $msg, $success); $this->show_settings_form(); - common_element('h2', null, _('Avatar')); + $this->element('h2', null, _('Avatar')); $this->show_avatar_form(); - common_element('h2', null, _('Change password')); + $this->element('h2', null, _('Change password')); $this->show_password_form(); -// common_element('h2', null, _('Delete my account')); +// $this->element('h2', null, _('Delete my account')); // $this->show_delete_form(); common_show_footer(); } @@ -74,46 +74,46 @@ class ProfilesettingsAction extends SettingsAction $user = common_current_user(); $profile = $user->getProfile(); - common_element_start('form', array('method' => 'POST', + $this->elementStart('form', array('method' => 'POST', 'id' => 'profilesettings', 'action' => common_local_url('profilesettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); # too much common patterns here... abstractable? - common_input('nickname', _('Nickname'), + $this->input('nickname', _('Nickname'), ($this->arg('nickname')) ? $this->arg('nickname') : $profile->nickname, _('1-64 lowercase letters or numbers, no punctuation or spaces')); - common_input('fullname', _('Full name'), + $this->input('fullname', _('Full name'), ($this->arg('fullname')) ? $this->arg('fullname') : $profile->fullname); - common_input('homepage', _('Homepage'), + $this->input('homepage', _('Homepage'), ($this->arg('homepage')) ? $this->arg('homepage') : $profile->homepage, _('URL of your homepage, blog, or profile on another site')); - common_textarea('bio', _('Bio'), + $this->textarea('bio', _('Bio'), ($this->arg('bio')) ? $this->arg('bio') : $profile->bio, _('Describe yourself and your interests in 140 chars')); - common_input('location', _('Location'), + $this->input('location', _('Location'), ($this->arg('location')) ? $this->arg('location') : $profile->location, _('Where you are, like "City, State (or Region), Country"')); - common_input('tags', _('Tags'), + $this->input('tags', _('Tags'), ($this->arg('tags')) ? $this->arg('tags') : implode(' ', $user->getSelfTags()), _('Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated')); $language = common_language(); - common_dropdown('language', _('Language'), get_nice_language_list(), _('Preferred language'), true, $language); + $this->dropdown('language', _('Language'), get_nice_language_list(), _('Preferred language'), true, $language); $timezone = common_timezone(); $timezones = array(); foreach(DateTimeZone::listIdentifiers() as $k => $v) { $timezones[$v] = $v; } - common_dropdown('timezone', _('Timezone'), $timezones, _('What timezone are you normally in?'), true, $timezone); + $this->dropdown('timezone', _('Timezone'), $timezones, _('What timezone are you normally in?'), true, $timezone); - common_checkbox('autosubscribe', _('Automatically subscribe to whoever subscribes to me (best for non-humans)'), + $this->checkbox('autosubscribe', _('Automatically subscribe to whoever subscribes to me (best for non-humans)'), ($this->arg('autosubscribe')) ? $this->boolean('autosubscribe') : $user->autosubscribe); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); } @@ -125,69 +125,69 @@ class ProfilesettingsAction extends SettingsAction if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->server_error(_('User without matching profile')); + $this->serverError(_('User without matching profile')); return; } $original = $profile->getOriginalAvatar(); - common_element_start('form', array('enctype' => 'multipart/form-data', + $this->elementStart('form', array('enctype' => 'multipart/form-data', 'method' => 'POST', 'id' => 'avatar', 'action' => common_local_url('profilesettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); if ($original) { - common_element_start('div', array('id'=>'avatar_original', 'class'=>'avatar_view')); - common_element('h3', null, _("Original:")); - common_element_start('div', array('id'=>'avatar_original_view')); - common_element('img', array('src' => $original->url, + $this->elementStart('div', array('id'=>'avatar_original', 'class'=>'avatar_view')); + $this->element('h3', null, _("Original:")); + $this->elementStart('div', array('id'=>'avatar_original_view')); + $this->element('img', array('src' => $original->url, 'class' => 'avatar original', 'width' => $original->width, 'height' => $original->height, 'alt' => $user->nickname)); - common_element_end('div'); - common_element_end('div'); + $this->elementEnd('div'); + $this->elementEnd('div'); } $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); if ($avatar) { - common_element_start('div', array('id'=>'avatar_preview', 'class'=>'avatar_view')); - common_element('h3', null, _("Preview:")); - common_element_start('div', array('id'=>'avatar_preview_view')); - common_element('img', array('src' => $original->url,//$avatar->url, + $this->elementStart('div', array('id'=>'avatar_preview', 'class'=>'avatar_view')); + $this->element('h3', null, _("Preview:")); + $this->elementStart('div', array('id'=>'avatar_preview_view')); + $this->element('img', array('src' => $original->url,//$avatar->url, 'class' => 'avatar profile', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $user->nickname)); - common_element_end('div'); - common_element_end('div'); + $this->elementEnd('div'); + $this->elementEnd('div'); foreach(array('avatar_crop_x', 'avatar_crop_y', 'avatar_crop_w', 'avatar_crop_h') as $crop_info) { - common_element('input', array('name' => $crop_info, + $this->element('input', array('name' => $crop_info, 'type' => 'hidden', 'id' => $crop_info)); } - common_submit('crop', _('Crop')); + $this->submit('crop', _('Crop')); } - common_element('input', array('name' => 'MAX_FILE_SIZE', + $this->element('input', array('name' => 'MAX_FILE_SIZE', 'type' => 'hidden', 'id' => 'MAX_FILE_SIZE', 'value' => MAX_AVATAR_SIZE)); - common_element_start('p'); + $this->elementStart('p'); - common_element('input', array('name' => 'avatarfile', + $this->element('input', array('name' => 'avatarfile', 'type' => 'file', 'id' => 'avatarfile')); - common_element_end('p'); + $this->elementEnd('p'); - common_submit('upload', _('Upload')); - common_element_end('form'); + $this->submit('upload', _('Upload')); + $this->elementEnd('form'); } @@ -195,23 +195,23 @@ class ProfilesettingsAction extends SettingsAction { $user = common_current_user(); - common_element_start('form', array('method' => 'POST', + $this->elementStart('form', array('method' => 'POST', 'id' => 'password', 'action' => common_local_url('profilesettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); # Users who logged in with OpenID won't have a pwd if ($user->password) { - common_password('oldpassword', _('Old password')); + $this->password('oldpassword', _('Old password')); } - common_password('newpassword', _('New password'), + $this->password('newpassword', _('New password'), _('6 or more characters')); - common_password('confirm', _('Confirm'), + $this->password('confirm', _('Confirm'), _('same as password above')); - common_submit('changepass', _('Change')); - common_element_end('form'); + $this->submit('changepass', _('Change')); + $this->elementEnd('form'); } function save_profile() @@ -298,7 +298,7 @@ class ProfilesettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } else { # Re-initialize language environment if it changed @@ -318,7 +318,7 @@ class ProfilesettingsAction extends SettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user for autosubscribe.')); + $this->serverError(_('Couldn\'t update user for autosubscribe.')); return; } } @@ -341,7 +341,7 @@ class ProfilesettingsAction extends SettingsAction if (!$result) { common_log_db_error($profile, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t save profile.')); + $this->serverError(_('Couldn\'t save profile.')); return; } @@ -350,7 +350,7 @@ class ProfilesettingsAction extends SettingsAction $result = $user->setSelfTags($tags); if (!$result) { - common_server_error(_('Couldn\'t save tags.')); + $this->serverError(_('Couldn\'t save tags.')); return; } @@ -475,7 +475,7 @@ class ProfilesettingsAction extends SettingsAction } if (!$user->update($original)) { - common_server_error(_('Can\'t save new password.')); + $this->serverError(_('Can\'t save new password.')); return; } diff --git a/actions/public.php b/actions/public.php index 039e885e6..0ceeef98e 100644 --- a/actions/public.php +++ b/actions/public.php @@ -1,9 +1,12 @@ <?php -/* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, Controlez-Vous, Inc. +/** + * Laconica, the distributed open-source microblogging tool * - * This program is free software: you can redistribute it and/or modify + * Action for displaying the public stream + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -15,91 +18,183 @@ * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Public + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @copyright 2008-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); } +if (!defined('LACONICA')) { + exit(1); +} -require_once(INSTALLDIR.'/lib/stream.php'); +require_once INSTALLDIR.'/lib/publicgroupnav.php'; +require_once INSTALLDIR.'/lib/noticelist.php'; +require_once INSTALLDIR.'/lib/feedlist.php'; -class PublicAction extends StreamAction +/** + * Action for displaying the public stream + * + * @category Public + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see PublicrssAction + * @see PublicxrdsAction + */ + +class PublicAction extends Action { + /** + * page of the stream we're on; default = 1 + */ - function handle($args) - { - parent::handle($args); + var $page = null; - $page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; + /** + * Read and validate arguments + * + * @param array $args URL parameters + * + * @return boolean success value + */ - header('X-XRDS-Location: '. common_local_url('publicxrds')); + function prepare($args) + { + parent::prepare($args); + $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; + return true; + } - common_show_header(_('Public timeline'), - array($this, 'show_header'), null, - array($this, 'show_top')); + /** + * handle request + * + * Show the public stream, using recipe method showPage() + * + * @param array $args arguments, mostly unused + * + * @return void + */ - # XXX: Public sidebar here? + function handle($args) + { + parent::handle($args); - $this->show_notices($page); + header('X-XRDS-Location: '. common_local_url('publicxrds')); - common_show_footer(); + $this->showPage(); } - function show_top() + /** + * Title of the page + * + * @return page title, including page number if over 1 + */ + + function title() { - if (common_logged_in()) { - common_notice_form('public'); + if ($this->page > 1) { + return sprintf(_('Public timeline, page %d'), $this->page); } else { - $instr = $this->get_instructions(); - $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + return _('Public timeline'); } - - $this->public_views_menu(); - - $this->show_feeds_list(array(0=>array('href'=>common_local_url('publicrss'), - 'type' => 'rss', - 'version' => 'RSS 1.0', - 'item' => 'publicrss'), - 1=>array('href'=>common_local_url('publicatom'), - 'type' => 'atom', - 'version' => 'Atom 1.0', - 'item' => 'publicatom'))); } - function get_instructions() - { - return _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . - 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' . - '[Join now](%%action.register%%) to share notices about yourself with friends, family, and colleagues! ([Read more](%%doc.help%%))'); - } + /** + * Output <head> elements for RSS and Atom feeds + * + * @return void + */ - function show_header() + function showFeeds() { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('publicrss'), 'type' => 'application/rss+xml', 'title' => _('Public Stream Feed'))); - # for client side of OpenID authentication - common_element('meta', array('http-equiv' => 'X-XRDS-Location', + } + + /** + * Extra head elements + * + * We include a <meta> element linking to the publicxrds page, for OpenID + * client-side authentication. + * + * @return void + */ + + function extraHead() + { + // for client side of OpenID authentication + $this->element('meta', array('http-equiv' => 'X-XRDS-Location', 'content' => common_local_url('publicxrds'))); } - function show_notices($page) + /** + * Show tabset for this page + * + * Uses the PublicGroupNav widget + * + * @return void + * @see PublicGroupNav + */ + + function showLocalNav() { + $nav = new PublicGroupNav($this); + $nav->show(); + } + + /** + * Fill the content area + * + * Shows a list of the notices in the public stream, with some pagination + * controls. + * + * @return void + */ - $cnt = 0; - $notice = Notice::publicStream(($page-1)*NOTICES_PER_PAGE, + function showContent() + { + $notice = Notice::publicStream(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); if (!$notice) { - $this->server_error(_('Could not retrieve public stream.')); + $this->serverError(_('Could not retrieve public stream.')); return; } - $cnt = $this->show_notice_list($notice); + $nl = new NoticeList($notice, $this); + + $cnt = $nl->show(); - common_pagination($page > 1, $cnt > NOTICES_PER_PAGE, - $page, 'public'); + $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, + $this->page, 'public'); + } + + /** + * Makes a list of exported feeds for this page + * + * @return void + * + * @todo I18N + */ + + function showExportData() + { + $fl = new FeedList($this); + $fl->show(array(0 => array('href' => common_local_url('publicrss'), + 'type' => 'rss', + 'version' => 'RSS 1.0', + 'item' => 'publicrss'), + 1 => array('href' => common_local_url('publicatom'), + 'type' => 'atom', + 'version' => 'Atom 1.0', + 'item' => 'publicatom'))); } } diff --git a/actions/publicxrds.php b/actions/publicxrds.php index 3d731d79f..e765fb1c9 100644 --- a/actions/publicxrds.php +++ b/actions/publicxrds.php @@ -26,7 +26,7 @@ require_once(INSTALLDIR.'/lib/openid.php'); class PublicxrdsAction extends Action { - function is_readonly() + function isReadOnly() { return true; } @@ -39,45 +39,45 @@ class PublicxrdsAction extends Action header('Content-Type: application/xrds+xml'); common_start_xml(); - common_element_start('XRDS', array('xmlns' => 'xri://$xrds')); + $this->elementStart('XRDS', array('xmlns' => 'xri://$xrds')); - common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', + $this->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'xmlns:simple' => 'http://xrds-simple.net/core/1.0', 'version' => '2.0')); - common_element('Type', null, 'xri://$xrds*simple'); + $this->element('Type', null, 'xri://$xrds*simple'); foreach (array('finishopenidlogin', 'finishaddopenid', 'finishimmediate') as $finish) { $this->show_service(Auth_OpenID_RP_RETURN_TO_URL_TYPE, common_local_url($finish)); } - common_element_end('XRD'); + $this->elementEnd('XRD'); - common_element_end('XRDS'); + $this->elementEnd('XRDS'); common_end_xml(); } function show_service($type, $uri, $params=null, $sigs=null, $localId=null) { - common_element_start('Service'); + $this->elementStart('Service'); if ($uri) { - common_element('URI', null, $uri); + $this->element('URI', null, $uri); } - common_element('Type', null, $type); + $this->element('Type', null, $type); if ($params) { foreach ($params as $param) { - common_element('Type', null, $param); + $this->element('Type', null, $param); } } if ($sigs) { foreach ($sigs as $sig) { - common_element('Type', null, $sig); + $this->element('Type', null, $sig); } } if ($localId) { - common_element('LocalID', null, $localId); + $this->element('LocalID', null, $localId); } - common_element_end('Service'); + $this->elementEnd('Service'); } }
\ No newline at end of file diff --git a/actions/recoverpassword.php b/actions/recoverpassword.php index bb6ef81d6..3d839e751 100644 --- a/actions/recoverpassword.php +++ b/actions/recoverpassword.php @@ -30,7 +30,7 @@ class RecoverpasswordAction extends Action { parent::handle($args); if (common_logged_in()) { - $this->client_error(_('You are already logged in!')); + $this->clientError(_('You are already logged in!')); return; } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($this->arg('recover')) { @@ -38,7 +38,7 @@ class RecoverpasswordAction extends Action } else if ($this->arg('reset')) { $this->reset_password(); } else { - $this->client_error(_('Unexpected form submission.')); + $this->clientError(_('Unexpected form submission.')); } } else { if ($this->trimmed('code')) { @@ -56,18 +56,18 @@ class RecoverpasswordAction extends Action $confirm = Confirm_address::staticGet('code', $code); if (!$confirm) { - $this->client_error(_('No such recovery code.')); + $this->clientError(_('No such recovery code.')); return; } if ($confirm->address_type != 'recover') { - $this->client_error(_('Not a recovery code.')); + $this->clientError(_('Not a recovery code.')); return; } $user = User::staticGet($confirm->user_id); if (!$user) { - $this->server_error(_('Recovery code for unknown user.')); + $this->serverError(_('Recovery code for unknown user.')); return; } @@ -80,7 +80,7 @@ class RecoverpasswordAction extends Action if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - common_server_error(_('Error with confirmation code.')); + $this->serverError(_('Error with confirmation code.')); return; } @@ -91,7 +91,7 @@ class RecoverpasswordAction extends Action common_log(LOG_WARNING, 'Attempted redemption on recovery code ' . 'that is ' . $touched . ' seconds old. '); - $this->client_error(_('This confirmation code is too old. ' . + $this->clientError(_('This confirmation code is too old. ' . 'Please start again.')); return; } @@ -105,7 +105,7 @@ class RecoverpasswordAction extends Action $result = $user->updateKeys($orig); if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); - $this->server_error(_('Could not update user with confirmed email address.')); + $this->serverError(_('Could not update user with confirmed email address.')); return; } } @@ -141,24 +141,24 @@ class RecoverpasswordAction extends Action function show_top($msg=null) { if ($msg) { - common_element('div', 'error', $msg); + $this->element('div', 'error', $msg); } else { - common_element_start('div', 'instructions'); - common_element('p', null, + $this->elementStart('div', 'instructions'); + $this->element('p', null, _('If you\'ve forgotten or lost your' . ' password, you can get a new one sent to' . ' the email address you have stored ' . ' in your account.')); - common_element_end('div'); + $this->elementEnd('div'); } } function show_password_top($msg=null) { if ($msg) { - common_element('div', 'error', $msg); + $this->element('div', 'error', $msg); } else { - common_element('div', 'instructions', + $this->element('div', 'instructions', _('You\'ve been identified. Enter a ' . ' new password below. ')); } @@ -170,15 +170,15 @@ class RecoverpasswordAction extends Action common_show_header(_('Recover password'), null, $msg, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'recoverpassword', 'action' => common_local_url('recoverpassword'))); - common_input('nicknameoremail', _('Nickname or email'), + $this->input('nicknameoremail', _('Nickname or email'), $this->trimmed('nicknameoremail'), _('Your nickname on this server, ' . 'or your registered email address.')); - common_submit('recover', _('Recover')); - common_element_end('form'); + $this->submit('recover', _('Recover')); + $this->elementEnd('form'); common_show_footer(); } @@ -188,16 +188,16 @@ class RecoverpasswordAction extends Action common_show_header(_('Reset password'), null, $msg, array($this, 'show_password_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'recoverpassword', 'action' => common_local_url('recoverpassword'))); - common_hidden('token', common_session_token()); - common_password('newpassword', _('New password'), + $this->hidden('token', common_session_token()); + $this->password('newpassword', _('New password'), _('6 or more characters, and don\'t forget it!')); - common_password('confirm', _('Confirm'), + $this->password('confirm', _('Confirm'), _('Same as password above')); - common_submit('reset', _('Reset')); - common_element_end('form'); + $this->submit('reset', _('Reset')); + $this->elementEnd('form'); common_show_footer(); } @@ -240,7 +240,7 @@ class RecoverpasswordAction extends Action } if (!$user->email && !$confirm_email) { - $this->client_error(_('No registered email address for that user.')); + $this->clientError(_('No registered email address for that user.')); return; } @@ -254,7 +254,7 @@ class RecoverpasswordAction extends Action if (!$confirm->insert()) { common_log_db_error($confirm, 'INSERT', __FILE__); - $this->server_error(_('Error saving address confirmation.')); + $this->serverError(_('Error saving address confirmation.')); return; } @@ -278,7 +278,7 @@ class RecoverpasswordAction extends Action mail_to_user($user, _('Password recovery requested'), $body, $confirm->address); common_show_header(_('Password recovery requested')); - common_element('p', null, + $this->element('p', null, _('Instructions for recovering your password ' . 'have been sent to the email address registered to your ' . 'account.')); @@ -298,7 +298,7 @@ class RecoverpasswordAction extends Action $user = $this->get_temp_user(); if (!$user) { - $this->client_error(_('Unexpected password reset.')); + $this->clientError(_('Unexpected password reset.')); return; } @@ -322,21 +322,21 @@ class RecoverpasswordAction extends Action if (!$user->update($original)) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Can\'t save new password.')); + $this->serverError(_('Can\'t save new password.')); return; } $this->clear_temp_user(); if (!common_set_user($user->nickname)) { - common_server_error(_('Error setting user.')); + $this->serverError(_('Error setting user.')); return; } common_real_login(true); common_show_header(_('Password saved.')); - common_element('p', null, _('New password successfully saved. ' . + $this->element('p', null, _('New password successfully saved. ' . 'You are now logged in.')); common_show_footer(); } diff --git a/actions/register.php b/actions/register.php index c479816ef..b4d0d43fb 100644 --- a/actions/register.php +++ b/actions/register.php @@ -26,9 +26,9 @@ class RegisterAction extends Action parent::handle($args); if (common_config('site', 'closed')) { - common_user_error(_('Registration not allowed.')); + $this->clientError(_('Registration not allowed.')); } else if (common_logged_in()) { - common_user_error(_('Already logged in.')); + $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->try_register(); } else { @@ -65,7 +65,7 @@ class RegisterAction extends Action } if (common_config('site', 'inviteonly') && !($code && $invite)) { - $this->client_error(_('Sorry, only invited people can register.')); + $this->clientError(_('Sorry, only invited people can register.')); return; } @@ -115,7 +115,7 @@ class RegisterAction extends Action } # success! if (!common_set_user($user)) { - common_server_error(_('Error setting user.')); + $this->serverError(_('Error setting user.')); return; } # this is a real login @@ -155,16 +155,16 @@ class RegisterAction extends Action function show_top($error=null) { if ($error) { - common_element('p', 'error', $error); + $this->element('p', 'error', $error); } else { $instr = common_markup_to_html(_('With this form you can create a new account. ' . 'You can then post notices and link up to friends and colleagues. '. '(Have an [OpenID](http://openid.net/)? ' . 'Try our [OpenID registration](%%action.openidlogin%%)!)')); - common_element_start('div', 'instructions'); - common_raw($instr); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($instr); + $this->elementEnd('div'); } } @@ -179,50 +179,50 @@ class RegisterAction extends Action } if (common_config('site', 'inviteonly') && !($code && $invite)) { - $this->client_error(_('Sorry, only invited people can register.')); + $this->clientError(_('Sorry, only invited people can register.')); return; } common_show_header(_('Register'), null, $error, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'login', 'action' => common_local_url('register'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); if ($code) { - common_hidden('code', $code); + $this->hidden('code', $code); } - common_input('nickname', _('Nickname'), $this->trimmed('nickname'), + $this->input('nickname', _('Nickname'), $this->trimmed('nickname'), _('1-64 lowercase letters or numbers, no punctuation or spaces. Required.')); - common_password('password', _('Password'), + $this->password('password', _('Password'), _('6 or more characters. Required.')); - common_password('confirm', _('Confirm'), + $this->password('confirm', _('Confirm'), _('Same as password above. Required.')); if ($invite && $invite->address_type == 'email') { - common_input('email', _('Email'), $invite->address, + $this->input('email', _('Email'), $invite->address, _('Used only for updates, announcements, and password recovery')); } else { - common_input('email', _('Email'), $this->trimmed('email'), + $this->input('email', _('Email'), $this->trimmed('email'), _('Used only for updates, announcements, and password recovery')); } - common_input('fullname', _('Full name'), + $this->input('fullname', _('Full name'), $this->trimmed('fullname'), _('Longer name, preferably your "real" name')); - common_input('homepage', _('Homepage'), + $this->input('homepage', _('Homepage'), $this->trimmed('homepage'), _('URL of your homepage, blog, or profile on another site')); - common_textarea('bio', _('Bio'), + $this->textarea('bio', _('Bio'), $this->trimmed('bio'), _('Describe yourself and your interests in 140 chars')); - common_input('location', _('Location'), + $this->input('location', _('Location'), $this->trimmed('location'), _('Where you are, like "City, State (or Region), Country"')); - common_checkbox('rememberme', _('Remember me'), + $this->checkbox('rememberme', _('Remember me'), $this->boolean('rememberme'), _('Automatically login in the future; not for shared computers!')); - common_element_start('p'); + $this->elementStart('p'); $attrs = array('type' => 'checkbox', 'id' => 'license', 'name' => 'license', @@ -230,14 +230,14 @@ class RegisterAction extends Action if ($this->boolean('license')) { $attrs['checked'] = 'checked'; } - common_element('input', $attrs); - common_text(_('My text and files are available under ')); - common_element('a', array('href' => $config['license']['url']), + $this->element('input', $attrs); + $this->text(_('My text and files are available under ')); + $this->element('a', array('href' => $config['license']['url']), $config['license']['title']); - common_text(_(' except this private data: password, email address, IM address, phone number.')); - common_element_end('p'); - common_submit('submit', _('Register')); - common_element_end('form'); + $this->text(_(' except this private data: password, email address, IM address, phone number.')); + $this->elementEnd('p'); + $this->submit('submit', _('Register')); + $this->elementEnd('form'); common_show_footer(); } @@ -245,7 +245,7 @@ class RegisterAction extends Action { $nickname = $this->arg('nickname'); common_show_header(_('Registration successful')); - common_element_start('div', 'success'); + $this->elementStart('div', 'success'); $instr = sprintf(_('Congratulations, %s! And welcome to %%%%site.name%%%%. From here, you may want to...'. "\n\n" . '* Go to [your profile](%s) and post your first message.' . "\n" . '* Add a [Jabber/GTalk address](%%%%action.imsettings%%%%) so you can send notices through instant messages.' . "\n" . @@ -254,14 +254,14 @@ class RegisterAction extends Action '* Read over the [online docs](%%%%doc.help%%%%) for features you may have missed. ' . "\n\n" . 'Thanks for signing up and we hope you enjoy using this service.'), $nickname, common_local_url('showstream', array('nickname' => $nickname))); - common_raw(common_markup_to_html($instr)); + $this->raw(common_markup_to_html($instr)); $have_email = $this->trimmed('email'); if ($have_email) { $emailinstr = _('(You should receive a message by email momentarily, with ' . 'instructions on how to confirm your email address.)'); - common_raw(common_markup_to_html($emailinstr)); + $this->raw(common_markup_to_html($emailinstr)); } - common_element_end('div'); + $this->elementEnd('div'); common_show_footer(); } diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php index a9494772e..32e9bf3d3 100644 --- a/actions/remotesubscribe.php +++ b/actions/remotesubscribe.php @@ -30,7 +30,7 @@ class RemotesubscribeAction extends Action parent::handle($args); if (common_logged_in()) { - common_user_error(_('You can use the local subscription!')); + $this->clientError(_('You can use the local subscription!')); return; } @@ -61,13 +61,13 @@ class RemotesubscribeAction extends Action function show_top($err=null) { if ($err) { - common_element('div', 'error', $err); + $this->element('div', 'error', $err); } else { $instructions = $this->get_instructions(); $output = common_markup_to_html($instructions); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('p'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('p'); } } @@ -79,15 +79,15 @@ class RemotesubscribeAction extends Action array($this, 'show_top')); # id = remotesubscribe conflicts with the # button on profile page - common_element_start('form', array('id' => 'remsub', 'method' => 'post', + $this->elementStart('form', array('id' => 'remsub', 'method' => 'post', 'action' => common_local_url('remotesubscribe'))); - common_hidden('token', common_session_token()); - common_input('nickname', _('User nickname'), $nickname, + $this->hidden('token', common_session_token()); + $this->input('nickname', _('User nickname'), $nickname, _('Nickname of the user you want to follow')); - common_input('profile_url', _('Profile URL'), $profile, + $this->input('profile_url', _('Profile URL'), $profile, _('URL of your profile on another compatible microblogging service')); - common_submit('submit', _('Subscribe')); - common_element_end('form'); + $this->submit('submit', _('Subscribe')); + $this->elementEnd('form'); common_show_footer(); } @@ -342,7 +342,7 @@ class RemotesubscribeAction extends Action $profile = $user->getProfile(); if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->server_error(_('User without matching profile')); + $this->serverError(_('User without matching profile')); return; } diff --git a/actions/replies.php b/actions/replies.php index eceeb4d65..84fd894ff 100644 --- a/actions/replies.php +++ b/actions/replies.php @@ -40,7 +40,7 @@ class RepliesAction extends StreamAction $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -57,12 +57,12 @@ class RepliesAction extends StreamAction function no_such_user() { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); } function show_header($user) { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('repliesrss', array('nickname' => $user->nickname)), 'type' => 'application/rss+xml', diff --git a/actions/repliesrss.php b/actions/repliesrss.php index 5f85f8d2e..43be133a4 100644 --- a/actions/repliesrss.php +++ b/actions/repliesrss.php @@ -34,7 +34,7 @@ class RepliesrssAction extends Rss10Action $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return false; } else { return true; diff --git a/actions/requesttoken.php b/actions/requesttoken.php index a74548739..5058deedb 100644 --- a/actions/requesttoken.php +++ b/actions/requesttoken.php @@ -24,7 +24,7 @@ require_once(INSTALLDIR.'/lib/omb.php'); class RequesttokenAction extends Action { - function is_readonly() + function isReadOnly() { return false; } @@ -39,7 +39,7 @@ class RequesttokenAction extends Action $token = $server->fetch_request_token($req); print $token; } catch (OAuthException $e) { - common_server_error($e->getMessage()); + $this->serverError($e->getMessage()); } } } diff --git a/actions/showfavorites.php b/actions/showfavorites.php index f4344833d..caa823893 100644 --- a/actions/showfavorites.php +++ b/actions/showfavorites.php @@ -33,14 +33,14 @@ class ShowfavoritesAction extends StreamAction $user = User::staticGet('nickname', $nickname); if (!$user) { - $this->client_error(_('No such user.')); + $this->clientError(_('No such user.')); return; } $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -57,7 +57,7 @@ class ShowfavoritesAction extends StreamAction function show_header($user) { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('favoritesrss', array('nickname' => $user->nickname)), 'type' => 'application/rss+xml', @@ -90,7 +90,7 @@ class ShowfavoritesAction extends StreamAction $notice = $user->favoriteNotices(($page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); if (!$notice) { - $this->server_error(_('Could not retrieve favorite notices.')); + $this->serverError(_('Could not retrieve favorite notices.')); return; } diff --git a/actions/showmessage.php b/actions/showmessage.php index 25330a568..d13e9f671 100644 --- a/actions/showmessage.php +++ b/actions/showmessage.php @@ -32,7 +32,7 @@ class ShowmessageAction extends MailboxAction $message = $this->get_message(); if (!$message) { - $this->client_error(_('No such message.'), 404); + $this->clientError(_('No such message.'), 404); return; } @@ -41,7 +41,7 @@ class ShowmessageAction extends MailboxAction if ($cur && ($cur->id == $message->from_profile || $cur->id == $message->to_profile)) { $this->show_page($cur, 1); } else { - $this->client_error(_('Only the sender and recipient may read this message.'), 403); + $this->clientError(_('Only the sender and recipient may read this message.'), 403); return; } } diff --git a/actions/shownotice.php b/actions/shownotice.php index 2df09cb3f..82d4bd270 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -37,14 +37,14 @@ class ShownoticeAction extends StreamAction $this->notice = Notice::staticGet($id); if (!$this->notice) { - $this->client_error(_('No such notice.'), 404); + $this->clientError(_('No such notice.'), 404); return false; } $this->profile = $this->notice->getProfile(); if (!$this->profile) { - $this->server_error(_('Notice has no profile'), 500); + $this->serverError(_('Notice has no profile'), 500); return false; } @@ -81,10 +81,10 @@ class ShownoticeAction extends StreamAction array($this, 'show_header'), null, array($this, 'show_top')); - common_element_start('ul', array('id' => 'notices')); + $this->elementStart('ul', array('id' => 'notices')); $nli = new NoticeListItem($this->notice); $nli->show(); - common_element_end('ul'); + $this->elementEnd('ul'); common_show_footer(); } @@ -99,12 +99,12 @@ class ShownoticeAction extends StreamAction } if ($user->emailmicroid && $user->email && $this->notice->uri) { - common_element('meta', array('name' => 'microid', + $this->element('meta', array('name' => 'microid', 'content' => "mailto+http:sha1:" . sha1(sha1('mailto:' . $user->email) . sha1($this->notice->uri)))); } if ($user->jabbermicroid && $user->jabber && $this->notice->uri) { - common_element('meta', array('name' => 'microid', + $this->element('meta', array('name' => 'microid', 'content' => "xmpp+http:sha1:" . sha1(sha1('xmpp:' . $user->jabber) . sha1($this->notice->uri)))); } } @@ -119,6 +119,6 @@ class ShownoticeAction extends StreamAction function no_such_notice() { - common_user_error(_('No such notice.')); + $this->clientError(_('No such notice.')); } } diff --git a/actions/showstream.php b/actions/showstream.php index e4e5d96d1..ed38c67f9 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -56,7 +56,7 @@ class ShowstreamAction extends StreamAction $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -106,66 +106,66 @@ class ShowstreamAction extends StreamAction function show_header($user) { # Feeds - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('api', array('apiaction' => 'statuses', 'method' => 'user_timeline.rss', 'argument' => $user->nickname)), 'type' => 'application/rss+xml', 'title' => sprintf(_('Notice feed for %s'), $user->nickname))); - common_element('link', array('rel' => 'alternate feed', + $this->element('link', array('rel' => 'alternate feed', 'href' => common_local_url('api', array('apiaction' => 'statuses', 'method' => 'user_timeline.atom', 'argument' => $user->nickname)), 'type' => 'application/atom+xml', 'title' => sprintf(_('Notice feed for %s'), $user->nickname))); - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('userrss', array('nickname' => $user->nickname)), 'type' => 'application/rdf+xml', 'title' => sprintf(_('Notice feed for %s'), $user->nickname))); # FOAF - common_element('link', array('rel' => 'meta', + $this->element('link', array('rel' => 'meta', 'href' => common_local_url('foaf', array('nickname' => $user->nickname)), 'type' => 'application/rdf+xml', 'title' => 'FOAF')); # for remote subscriptions etc. - common_element('meta', array('http-equiv' => 'X-XRDS-Location', + $this->element('meta', array('http-equiv' => 'X-XRDS-Location', 'content' => common_local_url('xrds', array('nickname' => $user->nickname)))); $profile = $user->getProfile(); if ($profile->bio) { - common_element('meta', array('name' => 'description', + $this->element('meta', array('name' => 'description', 'content' => $profile->bio)); } if ($user->emailmicroid && $user->email && $profile->profileurl) { - common_element('meta', array('name' => 'microid', + $this->element('meta', array('name' => 'microid', 'content' => "mailto+http:sha1:" . sha1(sha1('mailto:' . $user->email) . sha1($profile->profileurl)))); } if ($user->jabbermicroid && $user->jabber && $profile->profileurl) { - common_element('meta', array('name' => 'microid', + $this->element('meta', array('name' => 'microid', 'content' => "xmpp+http:sha1:" . sha1(sha1('xmpp:' . $user->jabber) . sha1($profile->profileurl)))); } # See https://wiki.mozilla.org/Microsummaries - common_element('link', array('rel' => 'microsummary', + $this->element('link', array('rel' => 'microsummary', 'href' => common_local_url('microsummary', array('nickname' => $profile->nickname)))); } function no_such_user() { - $this->client_error(_('No such user.'), 404); + $this->clientError(_('No such user.'), 404); } function show_profile($profile) { - common_element_start('div', array('id' => 'profile', 'class' => 'vcard')); + $this->elementStart('div', array('id' => 'profile', 'class' => 'vcard')); $this->show_personal($profile); @@ -175,23 +175,23 @@ class ShowstreamAction extends StreamAction $this->show_subscriptions($profile); - common_element_end('div'); + $this->elementEnd('div'); } function show_personal($profile) { $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); - common_element_start('div', array('id' => 'profile_avatar')); - common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE), + $this->elementStart('div', array('id' => 'profile_avatar')); + $this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE), 'class' => 'avatar profile photo', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $profile->nickname)); - common_element_start('ul', array('id' => 'profile_actions')); + $this->elementStart('ul', array('id' => 'profile_actions')); - common_element_start('li', array('id' => 'profile_subscribe')); + $this->elementStart('li', array('id' => 'profile_subscribe')); $cur = common_current_user(); if ($cur) { if ($cur->id != $profile->id) { @@ -204,14 +204,14 @@ class ShowstreamAction extends StreamAction } else { $this->show_remote_subscribe_link($profile); } - common_element_end('li'); + $this->elementEnd('li'); $user = User::staticGet('id', $profile->id); common_profile_new_message_nudge($cur, $user, $profile); if ($cur && $cur->id != $profile->id) { $blocked = $cur->hasBlocked($profile); - common_element_start('li', array('id' => 'profile_block')); + $this->elementStart('li', array('id' => 'profile_block')); if ($blocked) { common_unblock_form($profile, array('action' => 'showstream', 'nickname' => $profile->nickname)); @@ -219,62 +219,62 @@ class ShowstreamAction extends StreamAction common_block_form($profile, array('action' => 'showstream', 'nickname' => $profile->nickname)); } - common_element_end('li'); + $this->elementEnd('li'); } - common_element_end('ul'); + $this->elementEnd('ul'); - common_element_end('div'); + $this->elementEnd('div'); - common_element_start('div', array('id' => 'profile_information')); + $this->elementStart('div', array('id' => 'profile_information')); if ($profile->fullname) { - common_element('h1', array('class' => 'fn'), $profile->fullname . ' (' . $profile->nickname . ')'); + $this->element('h1', array('class' => 'fn'), $profile->fullname . ' (' . $profile->nickname . ')'); } else { - common_element('h1', array('class' => 'fn nickname'), $profile->nickname); + $this->element('h1', array('class' => 'fn nickname'), $profile->nickname); } if ($profile->location) { - common_element('p', 'location', $profile->location); + $this->element('p', 'location', $profile->location); } if ($profile->bio) { - common_element('p', 'description note', $profile->bio); + $this->element('p', 'description note', $profile->bio); } if ($profile->homepage) { - common_element_start('p', 'website'); - common_element('a', array('href' => $profile->homepage, + $this->elementStart('p', 'website'); + $this->element('a', array('href' => $profile->homepage, 'rel' => 'me', 'class' => 'url'), $profile->homepage); - common_element_end('p'); + $this->elementEnd('p'); } $this->show_statistics($profile); - common_element_end('div'); + $this->elementEnd('div'); } function show_remote_subscribe_link($profile) { $url = common_local_url('remotesubscribe', array('nickname' => $profile->nickname)); - common_element('a', array('href' => $url, + $this->element('a', array('href' => $url, 'id' => 'remotesubscribe'), _('Subscribe')); } function show_unsubscribe_form($profile) { - common_element_start('form', array('id' => 'unsubscribe', 'method' => 'post', + $this->elementStart('form', array('id' => 'unsubscribe', 'method' => 'post', 'action' => common_local_url('unsubscribe'))); - common_hidden('token', common_session_token()); - common_element('input', array('id' => 'unsubscribeto', + $this->hidden('token', common_session_token()); + $this->element('input', array('id' => 'unsubscribeto', 'name' => 'unsubscribeto', 'type' => 'hidden', 'value' => $profile->nickname)); - common_element('input', array('type' => 'submit', + $this->element('input', array('type' => 'submit', 'class' => 'submit', 'value' => _('Unsubscribe'))); - common_element_end('form'); + $this->elementEnd('form'); } function show_subscriptions($profile) @@ -293,13 +293,13 @@ class ShowstreamAction extends StreamAction $subs_count = $subs->find(); - common_element_start('div', array('id' => 'subscriptions')); + $this->elementStart('div', array('id' => 'subscriptions')); - common_element('h2', null, _('Subscriptions')); + $this->element('h2', null, _('Subscriptions')); if ($subs_count > 0) { - common_element_start('ul', array('id' => 'subscriptions_avatars')); + $this->elementStart('ul', array('id' => 'subscriptions_avatars')); for ($i = 0; $i < min($subs_count, SUBSCRIPTIONS); $i++) { @@ -315,39 +315,39 @@ class ShowstreamAction extends StreamAction continue; } - common_element_start('li', 'vcard'); - common_element_start('a', array('title' => ($other->fullname) ? + $this->elementStart('li', 'vcard'); + $this->elementStart('a', array('title' => ($other->fullname) ? $other->fullname : $other->nickname, 'href' => $other->profileurl, 'rel' => 'contact', 'class' => 'subscription fn url')); $avatar = $other->getAvatar(AVATAR_MINI_SIZE); - common_element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)), + $this->element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)), 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar mini photo', 'alt' => ($other->fullname) ? $other->fullname : $other->nickname)); - common_element_end('a'); - common_element_end('li'); + $this->elementEnd('a'); + $this->elementEnd('li'); } - common_element_end('ul'); + $this->elementEnd('ul'); } if ($subs_count > SUBSCRIPTIONS) { - common_element_start('p', array('id' => 'subscriptions_viewall')); + $this->elementStart('p', array('id' => 'subscriptions_viewall')); - common_element('a', array('href' => common_local_url('subscriptions', + $this->element('a', array('href' => common_local_url('subscriptions', array('nickname' => $profile->nickname)), 'class' => 'moresubscriptions'), _('All subscriptions')); - common_element_end('p'); + $this->elementEnd('p'); } - common_element_end('div'); + $this->elementEnd('div'); } function show_statistics($profile) @@ -366,49 +366,49 @@ class ShowstreamAction extends StreamAction $notices->profile_id = $profile->id; $notice_count = (int) $notices->count(); - common_element_start('div', 'statistics'); - common_element('h2', 'statistics', _('Statistics')); + $this->elementStart('div', 'statistics'); + $this->element('h2', 'statistics', _('Statistics')); # Other stats...? - common_element_start('dl', 'statistics'); - common_element('dt', 'membersince', _('Member since')); - common_element('dd', 'membersince', date('j M Y', + $this->elementStart('dl', 'statistics'); + $this->element('dt', 'membersince', _('Member since')); + $this->element('dd', 'membersince', date('j M Y', strtotime($profile->created))); - common_element_start('dt', 'subscriptions'); - common_element('a', array('href' => common_local_url('subscriptions', + $this->elementStart('dt', 'subscriptions'); + $this->element('a', array('href' => common_local_url('subscriptions', array('nickname' => $profile->nickname))), _('Subscriptions')); - common_element_end('dt'); - common_element('dd', 'subscriptions', (is_int($subs_count)) ? $subs_count : '0'); - common_element_start('dt', 'subscribers'); - common_element('a', array('href' => common_local_url('subscribers', + $this->elementEnd('dt'); + $this->element('dd', 'subscriptions', (is_int($subs_count)) ? $subs_count : '0'); + $this->elementStart('dt', 'subscribers'); + $this->element('a', array('href' => common_local_url('subscribers', array('nickname' => $profile->nickname))), _('Subscribers')); - common_element_end('dt'); - common_element('dd', 'subscribers', (is_int($subbed_count)) ? $subbed_count : '0'); - common_element('dt', 'notices', _('Notices')); - common_element('dd', 'notices', (is_int($notice_count)) ? $notice_count : '0'); + $this->elementEnd('dt'); + $this->element('dd', 'subscribers', (is_int($subbed_count)) ? $subbed_count : '0'); + $this->element('dt', 'notices', _('Notices')); + $this->element('dd', 'notices', (is_int($notice_count)) ? $notice_count : '0'); # XXX: link these to something - common_element('dt', 'tags', _('Tags')); - common_element_start('dd', 'tags'); + $this->element('dt', 'tags', _('Tags')); + $this->elementStart('dd', 'tags'); $tags = Profile_tag::getTags($profile->id, $profile->id); - common_element_start('ul', 'tags xoxo'); + $this->elementStart('ul', 'tags xoxo'); foreach ($tags as $tag) { - common_element_start('li'); - common_element('a', array('rel' => 'bookmark tag', + $this->elementStart('li'); + $this->element('a', array('rel' => 'bookmark tag', 'href' => common_local_url('peopletag', array('tag' => $tag))), $tag); - common_element_end('li'); + $this->elementEnd('li'); } - common_element_end('ul'); - common_element_end('dd'); + $this->elementEnd('ul'); + $this->elementEnd('dd'); - common_element_end('dl'); + $this->elementEnd('dl'); - common_element_end('div'); + $this->elementEnd('div'); } function show_notices($user) @@ -428,22 +428,22 @@ class ShowstreamAction extends StreamAction function show_last_notice($profile) { - common_element('h2', null, _('Currently')); + $this->element('h2', null, _('Currently')); $notice = $profile->getCurrentNotice(); if ($notice) { # FIXME: URL, image, video, audio - common_element_start('p', array('class' => 'notice_current')); + $this->elementStart('p', array('class' => 'notice_current')); if ($notice->rendered) { - common_raw($notice->rendered); + $this->raw($notice->rendered); } else { # XXX: may be some uncooked notices in the DB, # we cook them right now. This can probably disappear in future # versions (>> 0.4.x) - common_raw(common_render_content($notice->content, $notice)); + $this->raw(common_render_content($notice->content, $notice)); } - common_element_end('p'); + $this->elementEnd('p'); } } } diff --git a/actions/smssettings.php b/actions/smssettings.php index fad71135c..c5879e4d9 100644 --- a/actions/smssettings.php +++ b/actions/smssettings.php @@ -34,75 +34,75 @@ class SmssettingsAction extends EmailsettingsAction { $user = common_current_user(); $this->form_header(_('SMS Settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'smssettings', 'action' => common_local_url('smssettings'))); - common_hidden('token', common_session_token()); - common_element('h2', null, _('Address')); + $this->hidden('token', common_session_token()); + $this->element('h2', null, _('Address')); if ($user->sms) { - common_element_start('p'); + $this->elementStart('p'); $carrier = $user->getCarrier(); - common_element('span', 'address confirmed', $user->sms . ' (' . $carrier->name . ')'); - common_element('span', 'input_instructions', + $this->element('span', 'address confirmed', $user->sms . ' (' . $carrier->name . ')'); + $this->element('span', 'input_instructions', _('Current confirmed SMS-enabled phone number.')); - common_hidden('sms', $user->sms); - common_hidden('carrier', $user->carrier); - common_element_end('p'); - common_submit('remove', _('Remove')); + $this->hidden('sms', $user->sms); + $this->hidden('carrier', $user->carrier); + $this->elementEnd('p'); + $this->submit('remove', _('Remove')); } else { $confirm = $this->get_confirmation(); if ($confirm) { $carrier = Sms_carrier::staticGet($confirm->address_extra); - common_element_start('p'); - common_element('span', 'address unconfirmed', $confirm->address . ' (' . $carrier->name . ')'); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address unconfirmed', $confirm->address . ' (' . $carrier->name . ')'); + $this->element('span', 'input_instructions', _('Awaiting confirmation on this phone number.')); - common_hidden('sms', $confirm->address); - common_hidden('carrier', $confirm->address_extra); - common_element_end('p'); - common_submit('cancel', _('Cancel')); - common_input('code', _('Confirmation code'), null, + $this->hidden('sms', $confirm->address); + $this->hidden('carrier', $confirm->address_extra); + $this->elementEnd('p'); + $this->submit('cancel', _('Cancel')); + $this->input('code', _('Confirmation code'), null, _('Enter the code you received on your phone.')); - common_submit('confirm', _('Confirm')); + $this->submit('confirm', _('Confirm')); } else { - common_input('sms', _('SMS Phone number'), + $this->input('sms', _('SMS Phone number'), ($this->arg('sms')) ? $this->arg('sms') : null, _('Phone number, no punctuation or spaces, with area code')); $this->carrier_select(); - common_submit('add', _('Add')); + $this->submit('add', _('Add')); } } if ($user->sms) { - common_element('h2', null, _('Incoming email')); + $this->element('h2', null, _('Incoming email')); if ($user->incomingemail) { - common_element_start('p'); - common_element('span', 'address', $user->incomingemail); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'address', $user->incomingemail); + $this->element('span', 'input_instructions', _('Send email to this address to post new notices.')); - common_element_end('p'); - common_submit('removeincoming', _('Remove')); + $this->elementEnd('p'); + $this->submit('removeincoming', _('Remove')); } - common_element_start('p'); - common_element('span', 'input_instructions', + $this->elementStart('p'); + $this->element('span', 'input_instructions', _('Make a new email address for posting to; cancels the old one.')); - common_element_end('p'); - common_submit('newincoming', _('New')); + $this->elementEnd('p'); + $this->submit('newincoming', _('New')); } - common_element('h2', null, _('Preferences')); + $this->element('h2', null, _('Preferences')); - common_checkbox('smsnotify', + $this->checkbox('smsnotify', _('Send me notices through SMS; I understand I may incur exorbitant charges from my carrier.'), $user->smsnotify); - common_submit('save', _('Save')); + $this->submit('save', _('Save')); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } @@ -168,7 +168,7 @@ class SmssettingsAction extends EmailsettingsAction if ($result === false) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } @@ -218,7 +218,7 @@ class SmssettingsAction extends EmailsettingsAction if ($result === false) { common_log_db_error($confirm, 'INSERT', __FILE__); - common_server_error(_('Couldn\'t insert confirmation code.')); + $this->serverError(_('Couldn\'t insert confirmation code.')); return; } @@ -254,7 +254,7 @@ class SmssettingsAction extends EmailsettingsAction if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); - $this->server_error(_('Couldn\'t delete email confirmation.')); + $this->serverError(_('Couldn\'t delete email confirmation.')); return; } @@ -283,7 +283,7 @@ class SmssettingsAction extends EmailsettingsAction $result = $user->updateKeys($original); if (!$result) { common_log_db_error($user, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t update user.')); + $this->serverError(_('Couldn\'t update user.')); return; } $user->query('COMMIT'); @@ -307,19 +307,19 @@ class SmssettingsAction extends EmailsettingsAction $carrier = new Sms_carrier(); $cnt = $carrier->find(); - common_element_start('p'); - common_element('label', array('for' => 'carrier')); - common_element_start('select', array('name' => 'carrier', + $this->elementStart('p'); + $this->element('label', array('for' => 'carrier')); + $this->elementStart('select', array('name' => 'carrier', 'id' => 'carrier')); - common_element('option', array('value' => 0), + $this->element('option', array('value' => 0), _('Select a carrier')); while ($carrier->fetch()) { - common_element('option', array('value' => $carrier->id), + $this->element('option', array('value' => $carrier->id), $carrier->name); } - common_element_end('select'); - common_element_end('p'); - common_element('span', 'input_instructions', + $this->elementEnd('select'); + $this->elementEnd('p'); + $this->element('span', 'input_instructions', sprintf(_('Mobile carrier for your phone. '. 'If you know a carrier that accepts ' . 'SMS over email but isn\'t listed here, ' . diff --git a/actions/subedit.php b/actions/subedit.php index 1142b7a03..e22384869 100644 --- a/actions/subedit.php +++ b/actions/subedit.php @@ -30,28 +30,28 @@ class SubeditAction extends Action parent::prepare($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return false; } $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } $id = $this->trimmed('profile'); if (!$id) { - $this->client_error(_('No profile specified.')); + $this->clientError(_('No profile specified.')); return false; } $this->profile = Profile::staticGet('id', $id); if (!$this->profile) { - $this->client_error(_('No profile with that ID.')); + $this->clientError(_('No profile with that ID.')); return false; } @@ -68,7 +68,7 @@ class SubeditAction extends Action 'subscribed' => $this->profile->id)); if (!$sub) { - $this->client_error(_('You are not subscribed to that profile.')); + $this->clientError(_('You are not subscribed to that profile.')); return false; } @@ -81,7 +81,7 @@ class SubeditAction extends Action if (!$result) { common_log_db_error($sub, 'UPDATE', __FILE__); - $this->server_error(_('Could not save subscription.')); + $this->serverError(_('Could not save subscription.')); return false; } diff --git a/actions/subscribe.php b/actions/subscribe.php index f33d1d207..b6f03f0f1 100644 --- a/actions/subscribe.php +++ b/actions/subscribe.php @@ -27,7 +27,7 @@ class SubscribeAction extends Action parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -43,7 +43,7 @@ class SubscribeAction extends Action $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } @@ -52,26 +52,26 @@ class SubscribeAction extends Action $other = User::staticGet('id', $other_id); if (!$other) { - $this->client_error(_('Not a local user.')); + $this->clientError(_('Not a local user.')); return; } $result = subs_subscribe_to($user, $other); if($result != true) { - common_user_error($result); + $this->clientError($result); return; } if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Subscribed')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Subscribed')); + $this->elementEnd('head'); + $this->elementStart('body'); common_unsubscribe_form($other->getProfile()); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url('subscriptions', array('nickname' => $user->nickname))); diff --git a/actions/subscriptions.php b/actions/subscriptions.php index afe8fb260..7a87a144f 100644 --- a/actions/subscriptions.php +++ b/actions/subscriptions.php @@ -72,16 +72,16 @@ class SubscriptionsList extends ProfileList return; } - common_element_start('form', array('id' => 'subedit-' . $profile->id, + $this->elementStart('form', array('id' => 'subedit-' . $profile->id, 'method' => 'post', 'class' => 'subedit', 'action' => common_local_url('subedit'))); - common_hidden('token', common_session_token()); - common_hidden('profile', $profile->id); - common_checkbox('jabber', _('Jabber'), $sub->jabber); - common_checkbox('sms', _('SMS'), $sub->sms); - common_submit('save', _('Save')); - common_element_end('form'); + $this->hidden('token', common_session_token()); + $this->hidden('profile', $profile->id); + $this->checkbox('jabber', _('Jabber'), $sub->jabber); + $this->checkbox('sms', _('SMS'), $sub->sms); + $this->submit('save', _('Save')); + $this->elementEnd('form'); return; } } diff --git a/actions/sup.php b/actions/sup.php index 6a1897585..38e2e2e59 100644 --- a/actions/sup.php +++ b/actions/sup.php @@ -79,7 +79,7 @@ class SupAction extends Action return $updates; } - function is_readonly() + function isReadOnly() { return true; } diff --git a/actions/tag.php b/actions/tag.php index 8a3f90c16..3096b75b3 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -51,7 +51,7 @@ class TagAction extends StreamAction function show_header($tag = false) { if ($tag) { - common_element('link', array('rel' => 'alternate', + $this->element('link', array('rel' => 'alternate', 'href' => common_local_url('tagrss', array('tag' => $tag)), 'type' => 'application/rss+xml', 'title' => sprintf(_('Feed for tag %s'), $tag))); @@ -68,9 +68,9 @@ class TagAction extends StreamAction if (!$tag) { $instr = $this->get_instructions(); $output = common_markup_to_html($instr); - common_element_start('div', 'instructions'); - common_raw($output); - common_element_end('div'); + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); $this->public_views_menu(); } else { @@ -110,7 +110,7 @@ class TagAction extends StreamAction $cnt = $tags->find(); if ($cnt > 0) { - common_element_start('p', 'tagcloud'); + $this->elementStart('p', 'tagcloud'); $tw = array(); $sum = 0; @@ -125,7 +125,7 @@ class TagAction extends StreamAction $this->show_tag($tag, $weight, $weight/$sum); } - common_element_end('p'); + $this->elementEnd('p'); } } @@ -149,10 +149,10 @@ class TagAction extends StreamAction $cls = 'smallest'; } - common_element('a', array('class' => "$cls weight-$weight relative-$relative", + $this->element('a', array('class' => "$cls weight-$weight relative-$relative", 'href' => common_local_url('tag', array('tag' => $tag))), $tag); - common_text(' '); + $this->text(' '); } function show_notices($tag) diff --git a/actions/tagother.php b/actions/tagother.php index ff6788cc6..e11e3a00d 100644 --- a/actions/tagother.php +++ b/actions/tagother.php @@ -30,7 +30,7 @@ class TagotherAction extends Action parent::handle($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in'), 403); + $this->clientError(_('Not logged in'), 403); return; } @@ -39,12 +39,12 @@ class TagotherAction extends Action } else { $id = $this->trimmed('id'); if (!$id) { - $this->client_error(_('No id argument.')); + $this->clientError(_('No id argument.')); return; } $profile = Profile::staticGet('id', $id); if (!$profile) { - $this->client_error(_('No profile with that ID.')); + $this->clientError(_('No profile with that ID.')); return; } $this->show_form($profile); @@ -61,7 +61,7 @@ class TagotherAction extends Action $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); - common_element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE), + $this->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_PROFILE_SIZE), 'class' => 'avatar stream', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, @@ -69,39 +69,39 @@ class TagotherAction extends Action ($profile->fullname) ? $profile->fullname : $profile->nickname)); - common_element('a', array('href' => $profile->profileurl, + $this->element('a', array('href' => $profile->profileurl, 'class' => 'external profile nickname'), $profile->nickname); if ($profile->fullname) { - common_element_start('div', 'fullname'); + $this->elementStart('div', 'fullname'); if ($profile->homepage) { - common_element('a', array('href' => $profile->homepage), + $this->element('a', array('href' => $profile->homepage), $profile->fullname); } else { - common_text($profile->fullname); + $this->text($profile->fullname); } - common_element_end('div'); + $this->elementEnd('div'); } if ($profile->location) { - common_element('div', 'location', $profile->location); + $this->element('div', 'location', $profile->location); } if ($profile->bio) { - common_element('div', 'bio', $profile->bio); + $this->element('div', 'bio', $profile->bio); } - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'tag_user', 'name' => 'tagother', 'action' => $this->self_url())); - common_hidden('token', common_session_token()); - common_hidden('id', $profile->id); - common_input('tags', _('Tags'), + $this->hidden('token', common_session_token()); + $this->hidden('id', $profile->id); + $this->input('tags', _('Tags'), ($this->arg('tags')) ? $this->arg('tags') : implode(' ', Profile_tag::getTags($user->id, $profile->id)), _('Tags for this user (letters, numbers, -, ., and _), comma- or space- separated')); - common_submit('save', _('Save')); - common_element_end('form'); + $this->submit('save', _('Save')); + $this->elementEnd('form'); common_show_footer(); } @@ -121,7 +121,7 @@ class TagotherAction extends Action $profile = Profile::staticGet('id', $id); if (!$profile) { - $this->client_error(_('No such profile.')); + $this->clientError(_('No such profile.')); return; } @@ -147,14 +147,14 @@ class TagotherAction extends Action !Subscription::pkeyGet(array('subscriber' => $profile->id, 'subscribed' => $user->id))) { - $this->client_error(_('You can only tag people you are subscribed to or who are subscribed to you.')); + $this->clientError(_('You can only tag people you are subscribed to or who are subscribed to you.')); return; } $result = Profile_tag::setTags($user->id, $profile->id, $tags); if (!$result) { - $this->client_error(_('Could not save tags.')); + $this->clientError(_('Could not save tags.')); return; } @@ -162,20 +162,20 @@ class TagotherAction extends Action if ($this->boolean('ajax')) { common_start_html('text/xml'); - common_element_start('head'); - common_element('title', null, _('Tags')); - common_element_end('head'); - common_element_start('body'); - common_element_start('p', 'subtags'); + $this->elementStart('head'); + $this->element('title', null, _('Tags')); + $this->elementEnd('head'); + $this->elementStart('body'); + $this->elementStart('p', 'subtags'); foreach ($tags as $tag) { - common_element('a', array('href' => common_local_url($action, + $this->element('a', array('href' => common_local_url($action, array('nickname' => $user->nickname, 'tag' => $tag))), $tag); } - common_element_end('p'); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('p'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url($action, array('nickname' => $user->nickname))); @@ -186,12 +186,12 @@ class TagotherAction extends Action { list($profile, $error) = $arr; if ($error) { - common_element('p', 'error', $error); + $this->element('p', 'error', $error); } else { - common_element_start('div', 'instructions'); - common_element('p', null, + $this->elementStart('div', 'instructions'); + $this->element('p', null, _('Use this form to add tags to your subscribers or subscriptions.')); - common_element_end('div'); + $this->elementEnd('div'); } } } diff --git a/actions/tagrss.php b/actions/tagrss.php index 912d71413..b0227ab39 100644 --- a/actions/tagrss.php +++ b/actions/tagrss.php @@ -32,7 +32,7 @@ class TagrssAction extends Rss10Action $this->tag = Notice_tag::staticGet('tag', $tag); if (!$this->tag) { - common_user_error(_('No such tag.')); + $this->clientError(_('No such tag.')); return false; } else { return true; diff --git a/actions/twitapiaccount.php b/actions/twitapiaccount.php index 79e1ed990..e51a29a2d 100644 --- a/actions/twitapiaccount.php +++ b/actions/twitapiaccount.php @@ -29,7 +29,7 @@ class TwitapiaccountAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -39,7 +39,7 @@ class TwitapiaccountAction extends TwitterapiAction function end_session($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function update_location($args, $apidata) @@ -47,7 +47,7 @@ class TwitapiaccountAction extends TwitterapiAction parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { - $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST.'), 400, $apidata['content-type']); return; } @@ -56,7 +56,7 @@ class TwitapiaccountAction extends TwitterapiAction if (!is_null($location) && strlen($location) > 255) { // XXX: But Twitter just truncates and runs with it. -- Zach - $this->client_error(_('That\'s too long. Max notice size is 255 chars.'), 406, $apidate['content-type']); + $this->clientError(_('That\'s too long. Max notice size is 255 chars.'), 406, $apidate['content-type']); return; } @@ -64,7 +64,7 @@ class TwitapiaccountAction extends TwitterapiAction $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -75,7 +75,7 @@ class TwitapiaccountAction extends TwitterapiAction if (!$result) { common_log_db_error($profile, 'UPDATE', __FILE__); - common_server_error(_('Couldn\'t save profile.')); + $this->serverError(_('Couldn\'t save profile.')); return; } @@ -91,12 +91,12 @@ class TwitapiaccountAction extends TwitterapiAction function update_delivery_device($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function rate_limit_status($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } }
\ No newline at end of file diff --git a/actions/twitapiblocks.php b/actions/twitapiblocks.php index 5d64f2f7d..8135adef3 100644 --- a/actions/twitapiblocks.php +++ b/actions/twitapiblocks.php @@ -32,7 +32,7 @@ class TwitapiblocksAction extends TwitterapiAction $blockee = $this->get_user($apidata['api_arg'], $apidata); if (!$blockee) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } @@ -44,7 +44,7 @@ class TwitapiblocksAction extends TwitterapiAction $this->show_profile($blockee, $type); $this->end_document($type); } else { - common_server_error(_('Block user failed.')); + $this->serverError(_('Block user failed.')); } } @@ -54,7 +54,7 @@ class TwitapiblocksAction extends TwitterapiAction $blockee = $this->get_user($apidata['api_arg'], $apidata); if (!$blockee) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } @@ -66,7 +66,7 @@ class TwitapiblocksAction extends TwitterapiAction $this->show_profile($blockee, $type); $this->end_document($type); } else { - common_server_error(_('Unblock user failed.')); + $this->serverError(_('Unblock user failed.')); } } }
\ No newline at end of file diff --git a/actions/twitapidirect_messages.php b/actions/twitapidirect_messages.php index e0731f66f..db55e8cd0 100644 --- a/actions/twitapidirect_messages.php +++ b/actions/twitapidirect_messages.php @@ -108,7 +108,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction $this->show_json_dmsgs($message); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -119,7 +119,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { - $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST.'), 400, $apidata['content-type']); return; } @@ -134,11 +134,11 @@ class Twitapidirect_messagesAction extends TwitterapiAction $content = $this->trimmed('text'); if (!$content) { - $this->client_error(_('No message text!'), $code = 406, $apidata['content-type']); + $this->clientError(_('No message text!'), $code = 406, $apidata['content-type']); } else { $content_shortened = common_shorten_links($content); if (mb_strlen($content_shortened) > 140) { - $this->client_error(_('That\'s too long. Max message size is 140 chars.'), + $this->clientError(_('That\'s too long. Max message size is 140 chars.'), $code = 406, $apidata['content-type']); return; } @@ -147,15 +147,15 @@ class Twitapidirect_messagesAction extends TwitterapiAction $other = $this->get_user($this->trimmed('user')); if (!$other) { - $this->client_error(_('Recipient user not found.'), $code = 403, $apidata['content-type']); + $this->clientError(_('Recipient user not found.'), $code = 403, $apidata['content-type']); return; } else if (!$user->mutuallySubscribed($other)) { - $this->client_error(_('Can\'t send direct messages to users who aren\'t your friend.'), + $this->clientError(_('Can\'t send direct messages to users who aren\'t your friend.'), $code = 403, $apidata['content-type']); return; } else if ($user->id == $other->id) { // Sending msgs to yourself is allowed by Twitter - $this->client_error(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'), + $this->clientError(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'), $code = 403, $apidata['content-type']); return; } @@ -164,7 +164,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction html_entity_decode($content, ENT_NOQUOTES, 'UTF-8'), $source); if (is_string($message)) { - $this->server_error($message); + $this->serverError($message); return; } @@ -181,14 +181,14 @@ class Twitapidirect_messagesAction extends TwitterapiAction function destroy($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function show_xml_dmsgs($message) { $this->init_document('xml'); - common_element_start('direct-messages', array('type' => 'array')); + $this->elementStart('direct-messages', array('type' => 'array')); if (is_array($messages)) { foreach ($message as $m) { @@ -202,7 +202,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction } } - common_element_end('direct-messages'); + $this->elementEnd('direct-messages'); $this->end_document('xml'); } @@ -236,13 +236,13 @@ class Twitapidirect_messagesAction extends TwitterapiAction $this->init_document('rss'); - common_element_start('channel'); - common_element('title', null, $title); + $this->elementStart('channel'); + $this->element('title', null, $title); - common_element('link', null, $link); - common_element('description', null, $subtitle); - common_element('language', null, 'en-us'); - common_element('ttl', null, '40'); + $this->element('link', null, $link); + $this->element('description', null, $subtitle); + $this->element('language', null, 'en-us'); + $this->element('ttl', null, '40'); if (is_array($message)) { foreach ($message as $m) { @@ -256,7 +256,7 @@ class Twitapidirect_messagesAction extends TwitterapiAction } } - common_element_end('channel'); + $this->elementEnd('channel'); $this->end_twitter_rss(); } @@ -266,12 +266,12 @@ class Twitapidirect_messagesAction extends TwitterapiAction $this->init_document('atom'); - common_element('title', null, $title); + $this->element('title', null, $title); $siteserver = common_config('site', 'server'); - common_element('id', null, "tag:$siteserver,2008:DirectMessage"); - common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null); - common_element('updated', null, common_date_iso8601(strftime('%c'))); - common_element('subtitle', null, $subtitle); + $this->element('id', null, "tag:$siteserver,2008:DirectMessage"); + $this->element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), null); + $this->element('updated', null, common_date_iso8601(strftime('%c'))); + $this->element('subtitle', null, $subtitle); if (is_array($message)) { foreach ($message as $m) { diff --git a/actions/twitapifavorites.php b/actions/twitapifavorites.php index 55e04732f..737b7229f 100644 --- a/actions/twitapifavorites.php +++ b/actions/twitapifavorites.php @@ -32,14 +32,14 @@ class TwitapifavoritesAction extends TwitterapiAction $user = $this->get_user($apidata['api_arg'], $apidata); if (!$user) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -56,7 +56,7 @@ class TwitapifavoritesAction extends TwitterapiAction $notice = $user->favoriteNotices((($page-1)*20), $count); if (!$notice) { - common_server_error(_('Could not retrieve favorite notices.')); + $this->serverError(_('Could not retrieve favorite notices.')); return; } @@ -82,7 +82,7 @@ class TwitapifavoritesAction extends TwitterapiAction $this->show_json_timeline($notice); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -94,12 +94,12 @@ class TwitapifavoritesAction extends TwitterapiAction // Check for RESTfulness if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { // XXX: Twitter just prints the err msg, no XML / JSON. - $this->client_error(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); return; } if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -109,20 +109,20 @@ class TwitapifavoritesAction extends TwitterapiAction $notice = Notice::staticGet($notice_id); if (!$notice) { - $this->client_error(_('No status found with that ID.'), 404, $apidata['content-type']); + $this->clientError(_('No status found with that ID.'), 404, $apidata['content-type']); return; } // XXX: Twitter lets you fave things repeatedly via api. if ($user->hasFave($notice)) { - $this->client_error(_('This notice is already a favorite!'), 403, $apidata['content-type']); + $this->clientError(_('This notice is already a favorite!'), 403, $apidata['content-type']); return; } $fave = Fave::addNew($user, $notice); if (!$fave) { - common_server_error(_('Could not create favorite.')); + $this->serverError(_('Could not create favorite.')); return; } @@ -140,7 +140,7 @@ class TwitapifavoritesAction extends TwitterapiAction function destroy($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } // XXX: these two funcs swiped from faves. Maybe put in util.php, or some common base class? diff --git a/actions/twitapifriendships.php b/actions/twitapifriendships.php index ba4afe441..c50c5e84a 100644 --- a/actions/twitapifriendships.php +++ b/actions/twitapifriendships.php @@ -29,7 +29,7 @@ class TwitapifriendshipsAction extends TwitterapiAction parent::handle($args); if ($_SERVER['REQUEST_METHOD'] != 'POST') { - $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST.'), 400, $apidata['content-type']); return; } @@ -38,7 +38,7 @@ class TwitapifriendshipsAction extends TwitterapiAction $other = $this->get_user($id); if (!$other) { - $this->client_error(_('Could not follow user: User not found.'), 403, $apidata['content-type']); + $this->clientError(_('Could not follow user: User not found.'), 403, $apidata['content-type']); return; } @@ -46,7 +46,7 @@ class TwitapifriendshipsAction extends TwitterapiAction if ($user->isSubscribed($other)) { $errmsg = sprintf(_('Could not follow user: %s is already on your list.'), $other->nickname); - $this->client_error($errmsg, 403, $apidata['content-type']); + $this->clientError($errmsg, 403, $apidata['content-type']); return; } @@ -62,7 +62,7 @@ class TwitapifriendshipsAction extends TwitterapiAction if (!$result) { $errmsg = sprintf(_('Could not follow user: %s is already on your list.'), $other->nickname); - $this->client_error($errmsg, 400, $apidata['content-type']); + $this->clientError($errmsg, 400, $apidata['content-type']); return; } @@ -82,7 +82,7 @@ class TwitapifriendshipsAction extends TwitterapiAction parent::handle($args); if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { - $this->client_error(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); return; } @@ -102,7 +102,7 @@ class TwitapifriendshipsAction extends TwitterapiAction $sub->delete(); $sub->query('COMMIT'); } else { - $this->client_error(_('You are not friends with the specified user.'), 403, $apidata['content-type']); + $this->clientError(_('You are not friends with the specified user.'), 403, $apidata['content-type']); return; } @@ -118,7 +118,7 @@ class TwitapifriendshipsAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -129,7 +129,7 @@ class TwitapifriendshipsAction extends TwitterapiAction $user_b = $this->get_user($user_b_id); if (!$user_a || !$user_b) { - $this->client_error(_('Two user ids or screen_names must be supplied.'), 400, $apidata['content-type']); + $this->clientError(_('Two user ids or screen_names must be supplied.'), 400, $apidata['content-type']); return; } @@ -142,7 +142,7 @@ class TwitapifriendshipsAction extends TwitterapiAction switch ($apidata['content-type']) { case 'xml': $this->init_document('xml'); - common_element('friends', null, $result); + $this->element('friends', null, $result); $this->end_document('xml'); break; case 'json': diff --git a/actions/twitapihelp.php b/actions/twitapihelp.php index 1b84cb11b..db5892baf 100644 --- a/actions/twitapihelp.php +++ b/actions/twitapihelp.php @@ -34,14 +34,14 @@ class TwitapihelpAction extends TwitterapiAction if ($apidata['content-type'] == 'xml') { $this->init_document('xml'); - common_element('ok', null, 'true'); + $this->element('ok', null, 'true'); $this->end_document('xml'); } elseif ($apidata['content-type'] == 'json') { $this->init_document('json'); print '"ok"'; $this->end_document('json'); } else { - common_user_error(_('API method not found!'), $code=404); + $this->clientError(_('API method not found!'), $code=404); } } @@ -49,7 +49,7 @@ class TwitapihelpAction extends TwitterapiAction function downtime_schedule($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } }
\ No newline at end of file diff --git a/actions/twitapilaconica.php b/actions/twitapilaconica.php index 722423fae..8cd7a64b9 100644 --- a/actions/twitapilaconica.php +++ b/actions/twitapilaconica.php @@ -70,7 +70,7 @@ class TwitapilaconicaAction extends TwitterapiAction switch ($apidata['content-type']) { case 'xml': $this->init_document('xml'); - common_element('version', null, LACONICA_VERSION); + $this->element('version', null, LACONICA_VERSION); $this->end_document('xml'); break; case 'json': @@ -79,7 +79,7 @@ class TwitapilaconicaAction extends TwitterapiAction $this->end_document('json'); break; default: - $this->client_error(_('API method not found!'), $code=404); + $this->clientError(_('API method not found!'), $code=404); } } @@ -115,10 +115,10 @@ class TwitapilaconicaAction extends TwitterapiAction switch ($apidata['content-type']) { case 'xml': $this->init_document('xml'); - common_element_start('config'); + $this->elementStart('config'); // XXX: check that all sections and settings are legal XML elements foreach ($keys as $section => $settings) { - common_element_start($section); + $this->elementStart($section); foreach ($settings as $setting) { $value = common_config($section, $setting); if (is_array($value)) { @@ -128,11 +128,11 @@ class TwitapilaconicaAction extends TwitterapiAction } else if ($value === true) { $value = 'true'; } - common_element($setting, null, $value); + $this->element($setting, null, $value); } - common_element_end($section); + $this->elementEnd($section); } - common_element_end('config'); + $this->elementEnd('config'); $this->end_document('xml'); break; case 'json': @@ -148,7 +148,7 @@ class TwitapilaconicaAction extends TwitterapiAction $this->end_document('json'); break; default: - $this->client_error(_('API method not found!'), $code=404); + $this->clientError(_('API method not found!'), $code=404); } } @@ -169,6 +169,6 @@ class TwitapilaconicaAction extends TwitterapiAction function wadl($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), 501); + $this->serverError(_('API method under construction.'), 501); } } diff --git a/actions/twitapinotifications.php b/actions/twitapinotifications.php index a19d652c3..411971af1 100644 --- a/actions/twitapinotifications.php +++ b/actions/twitapinotifications.php @@ -28,13 +28,13 @@ class TwitapinotificationsAction extends TwitterapiAction function follow($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function leave($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } }
\ No newline at end of file diff --git a/actions/twitapistatuses.php b/actions/twitapistatuses.php index e629d5cc4..a35f4b12e 100644 --- a/actions/twitapistatuses.php +++ b/actions/twitapistatuses.php @@ -76,12 +76,12 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_json_timeline($notice); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); break; } } else { - common_server_error(_('Couldn\'t find any statuses.'), $code = 503); + $this->serverError(_('Couldn\'t find any statuses.'), $code = 503); } } @@ -144,7 +144,7 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_json_timeline($notice); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -157,14 +157,14 @@ class TwitapistatusesAction extends TwitterapiAction $user = $this->get_user($apidata['api_arg'], $apidata); if (!$user) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -225,7 +225,7 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_json_timeline($notice); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -236,12 +236,12 @@ class TwitapistatusesAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } if ($_SERVER['REQUEST_METHOD'] != 'POST') { - $this->client_error(_('This method requires a POST.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST.'), 400, $apidata['content-type']); return; } @@ -273,7 +273,7 @@ class TwitapistatusesAction extends TwitterapiAction // as "truncated." Sending this error may screw up some clients // that assume Twitter will truncate for them. Should we just // truncate too? -- Zach - $this->client_error(_('That\'s too long. Max notice size is 140 chars.'), $code = 406, $apidata['content-type']); + $this->clientError(_('That\'s too long. Max notice size is 140 chars.'), $code = 406, $apidata['content-type']); return; } @@ -306,7 +306,7 @@ class TwitapistatusesAction extends TwitterapiAction if ($reply) { $reply_to = $in_reply_to_status_id; } else { - $this->client_error(_('Not found'), $code = 404, $apidata['content-type']); + $this->clientError(_('Not found'), $code = 404, $apidata['content-type']); return; } } @@ -315,7 +315,7 @@ class TwitapistatusesAction extends TwitterapiAction $source, 1, $reply_to); if (is_string($notice)) { - $this->server_error($notice); + $this->serverError($notice); return; } @@ -389,7 +389,7 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_json_timeline($notices); break; default: - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); } } @@ -399,7 +399,7 @@ class TwitapistatusesAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -415,7 +415,7 @@ class TwitapistatusesAction extends TwitterapiAction } } else { // XXX: Twitter just sets a 404 header and doens't bother to return an err msg - $this->client_error(_('No status with that ID found.'), 404, $apidata['content-type']); + $this->clientError(_('No status with that ID found.'), 404, $apidata['content-type']); } } @@ -426,14 +426,14 @@ class TwitapistatusesAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } // Check for RESTfulness if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { // XXX: Twitter just prints the err msg, no XML / JSON. - $this->client_error(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); + $this->clientError(_('This method requires a POST or DELETE.'), 400, $apidata['content-type']); return; } @@ -443,7 +443,7 @@ class TwitapistatusesAction extends TwitterapiAction $notice = Notice::staticGet($notice_id); if (!$notice) { - $this->client_error(_('No status found with that ID.'), 404, $apidata['content-type']); + $this->clientError(_('No status found with that ID.'), 404, $apidata['content-type']); return; } @@ -460,7 +460,7 @@ class TwitapistatusesAction extends TwitterapiAction $this->show_single_json_status($notice); } } else { - $this->client_error(_('You may not delete another user\'s status.'), 403, $apidata['content-type']); + $this->clientError(_('You may not delete another user\'s status.'), 403, $apidata['content-type']); } } @@ -487,7 +487,7 @@ class TwitapistatusesAction extends TwitterapiAction $user = $this->get_user($apidata['api_arg'], $apidata); if (!$user) { - $this->client_error('Not Found', 404, $apidata['content-type']); + $this->clientError('Not Found', 404, $apidata['content-type']); return; } @@ -500,7 +500,7 @@ class TwitapistatusesAction extends TwitterapiAction $profile = $user->getProfile(); if (!$profile) { - common_server_error(_('User has no profile.')); + $this->serverError(_('User has no profile.')); return; } @@ -538,11 +538,11 @@ class TwitapistatusesAction extends TwitterapiAction { switch ($type) { case 'xml': - common_element_start('users', array('type' => 'array')); + $this->elementStart('users', array('type' => 'array')); foreach ($profiles as $profile) { $this->show_profile($profile); } - common_element_end('users'); + $this->elementEnd('users'); break; case 'json': $arrays = array(); @@ -552,14 +552,14 @@ class TwitapistatusesAction extends TwitterapiAction print json_encode($arrays); break; default: - $this->client_error(_('unsupported file type')); + $this->clientError(_('unsupported file type')); } } function featured($args, $apidata) { parent::handle($args); - common_server_error(_('API method under construction.'), $code=501); + $this->serverError(_('API method under construction.'), $code=501); } function supported($cmd) diff --git a/actions/twitapiusers.php b/actions/twitapiusers.php index 409986985..ed2417561 100644 --- a/actions/twitapiusers.php +++ b/actions/twitapiusers.php @@ -29,7 +29,7 @@ class TwitapiusersAction extends TwitterapiAction parent::handle($args); if (!in_array($apidata['content-type'], array('xml', 'json'))) { - common_user_error(_('API method not found!'), $code = 404); + $this->clientError(_('API method not found!'), $code = 404); return; } @@ -44,7 +44,7 @@ class TwitapiusersAction extends TwitterapiAction if (!$user) { // XXX: Twitter returns a random(?) user instead of throwing and err! -- Zach - $this->client_error(_('Not found.'), 404, $apidata['content-type']); + $this->clientError(_('Not found.'), 404, $apidata['content-type']); return; } diff --git a/actions/twittersettings.php b/actions/twittersettings.php index 62262e021..d6d31c483 100644 --- a/actions/twittersettings.php +++ b/actions/twittersettings.php @@ -44,52 +44,52 @@ class TwittersettingsAction extends SettingsAction } $this->form_header(_('Twitter settings'), $msg, $success); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'twittersettings', 'action' => common_local_url('twittersettings'))); - common_hidden('token', common_session_token()); + $this->hidden('token', common_session_token()); - common_element('h2', null, _('Twitter Account')); + $this->element('h2', null, _('Twitter Account')); if ($fuser) { - common_element_start('p'); + $this->elementStart('p'); - common_element('span', 'twitter_user', $fuser->nickname); - common_element('a', array('href' => $fuser->uri), $fuser->uri); - common_element('span', 'input_instructions', + $this->element('span', 'twitter_user', $fuser->nickname); + $this->element('a', array('href' => $fuser->uri), $fuser->uri); + $this->element('span', 'input_instructions', _('Current verified Twitter account.')); - common_hidden('flink_foreign_id', $flink->foreign_id); - common_element_end('p'); - common_submit('remove', _('Remove')); + $this->hidden('flink_foreign_id', $flink->foreign_id); + $this->elementEnd('p'); + $this->submit('remove', _('Remove')); } else { - common_input('twitter_username', _('Twitter user name'), + $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 - common_password('twitter_password', _('Twitter password')); + $this->password('twitter_password', _('Twitter password')); } - common_element('h2', null, _('Preferences')); + $this->element('h2', null, _('Preferences')); - common_checkbox('noticesync', _('Automatically send my notices to Twitter.'), + $this->checkbox('noticesync', _('Automatically send my notices to Twitter.'), ($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND) : true); - common_checkbox('replysync', _('Send local "@" replies to Twitter.'), + $this->checkbox('replysync', _('Send local "@" replies to Twitter.'), ($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : true); - common_checkbox('friendsync', _('Subscribe to my Twitter friends here.'), + $this->checkbox('friendsync', _('Subscribe to my Twitter friends here.'), ($flink) ? ($flink->friendsync & FOREIGN_FRIEND_RECV) : false); if ($flink) { - common_submit('save', _('Save')); + $this->submit('save', _('Save')); } else { - common_submit('add', _('Add')); + $this->submit('add', _('Add')); } $this->show_twitter_subscriptions(); - common_element_end('form'); + $this->elementEnd('form'); common_show_footer(); } @@ -131,9 +131,9 @@ class TwittersettingsAction extends SettingsAction if ($friends_count > 0) { - common_element('h3', null, _('Twitter Friends')); - common_element_start('div', array('id' => 'subscriptions')); - common_element_start('ul', array('id' => 'subscriptions_avatars')); + $this->element('h3', null, _('Twitter Friends')); + $this->elementStart('div', array('id' => 'subscriptions')); + $this->elementStart('ul', array('id' => 'subscriptions_avatars')); for ($i = 0; $i < min($friends_count, SUBSCRIPTIONS); $i++) { @@ -144,28 +144,28 @@ class TwittersettingsAction extends SettingsAction continue; } - common_element_start('li'); - common_element_start('a', array('title' => ($other->fullname) ? + $this->elementStart('li'); + $this->elementStart('a', array('title' => ($other->fullname) ? $other->fullname : $other->nickname, 'href' => $other->profileurl, 'rel' => 'contact', 'class' => 'subscription')); $avatar = $other->getAvatar(AVATAR_MINI_SIZE); - common_element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)), + $this->element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_MINI_SIZE)), 'width' => AVATAR_MINI_SIZE, 'height' => AVATAR_MINI_SIZE, 'class' => 'avatar mini', 'alt' => ($other->fullname) ? $other->fullname : $other->nickname)); - common_element_end('a'); - common_element_end('li'); + $this->elementEnd('a'); + $this->elementEnd('li'); } - common_element_end('ul'); - common_element_end('div'); + $this->elementEnd('ul'); + $this->elementEnd('div'); } @@ -173,13 +173,13 @@ class TwittersettingsAction extends SettingsAction /* if ($subs_count > SUBSCRIPTIONS) { - common_element_start('p', array('id' => 'subscriptions_viewall')); + $this->elementStart('p', array('id' => 'subscriptions_viewall')); - common_element('a', array('href' => common_local_url('subscriptions', + $this->element('a', array('href' => common_local_url('subscriptions', array('nickname' => $profile->nickname)), 'class' => 'moresubscriptions'), _('All subscriptions')); - common_element_end('p'); + $this->elementEnd('p'); } */ @@ -285,7 +285,7 @@ class TwittersettingsAction extends SettingsAction if (!$result) { common_log_db_error($flink, 'DELETE', __FILE__); - common_server_error(_('Couldn\'t remove Twitter user.')); + $this->serverError(_('Couldn\'t remove Twitter user.')); return; } diff --git a/actions/unblock.php b/actions/unblock.php index 112304f71..59270f882 100644 --- a/actions/unblock.php +++ b/actions/unblock.php @@ -30,28 +30,28 @@ class UnblockAction extends Action parent::prepare($args); if (!common_logged_in()) { - $this->client_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return false; } $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } $id = $this->trimmed('unblockto'); if (!$id) { - $this->client_error(_('No profile specified.')); + $this->clientError(_('No profile specified.')); return false; } $this->profile = Profile::staticGet('id', $id); if (!$this->profile) { - $this->client_error(_('No profile with that ID.')); + $this->clientError(_('No profile with that ID.')); return false; } @@ -74,7 +74,7 @@ class UnblockAction extends Action $result = $cur->unblock($this->profile); if (!$result) { - $this->server_error(_('Error removing the block.')); + $this->serverError(_('Error removing the block.')); return; } diff --git a/actions/unsubscribe.php b/actions/unsubscribe.php index 1c2e13635..32511a4b4 100644 --- a/actions/unsubscribe.php +++ b/actions/unsubscribe.php @@ -24,7 +24,7 @@ class UnsubscribeAction extends Action { parent::handle($args); if (!common_logged_in()) { - common_user_error(_('Not logged in.')); + $this->clientError(_('Not logged in.')); return; } @@ -40,40 +40,40 @@ class UnsubscribeAction extends Action $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->client_error(_('There was a problem with your session token. Try again, please.')); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return; } $other_id = $this->arg('unsubscribeto'); if (!$other_id) { - $this->client_error(_('No profile id in request.')); + $this->clientError(_('No profile id in request.')); return; } $other = Profile::staticGet('id', $other_id); if (!$other_id) { - $this->client_error(_('No profile with that id.')); + $this->clientError(_('No profile with that id.')); return; } $result = subs_unsubscribe_to($user, $other); if ($result != true) { - common_user_error($result); + $this->clientError($result); return; } if ($this->boolean('ajax')) { common_start_html('text/xml;charset=utf-8', true); - common_element_start('head'); - common_element('title', null, _('Unsubscribed')); - common_element_end('head'); - common_element_start('body'); + $this->elementStart('head'); + $this->element('title', null, _('Unsubscribed')); + $this->elementEnd('head'); + $this->elementStart('body'); common_subscribe_form($other); - common_element_end('body'); - common_element_end('html'); + $this->elementEnd('body'); + $this->elementEnd('html'); } else { common_redirect(common_local_url('subscriptions', array('nickname' => $user->nickname))); diff --git a/actions/updateprofile.php b/actions/updateprofile.php index abb034c81..c79112dac 100644 --- a/actions/updateprofile.php +++ b/actions/updateprofile.php @@ -37,7 +37,7 @@ class UpdateprofileAction extends Action print "omb_version=".OMB_VERSION_01; } } catch (OAuthException $e) { - $this->server_error($e->getMessage()); + $this->serverError($e->getMessage()); return; } } @@ -46,14 +46,14 @@ class UpdateprofileAction extends Action { $version = $req->get_parameter('omb_version'); if ($version != OMB_VERSION_01) { - $this->client_error(_('Unsupported OMB version'), 400); + $this->clientError(_('Unsupported OMB version'), 400); return false; } # First, check to see if listenee exists $listenee = $req->get_parameter('omb_listenee'); $remote = Remote_profile::staticGet('uri', $listenee); if (!$remote) { - $this->client_error(_('Profile unknown'), 404); + $this->clientError(_('Profile unknown'), 404); return false; } # Second, check to see if they should be able to post updates! @@ -64,72 +64,72 @@ class UpdateprofileAction extends Action $sub->subscribed = $remote->id; $sub->token = $token->key; if (!$sub->find(true)) { - $this->client_error(_('You did not send us that profile'), 403); + $this->clientError(_('You did not send us that profile'), 403); return false; } $profile = Profile::staticGet('id', $remote->id); if (!$profile) { # This one is our fault - $this->server_error(_('Remote profile with no matching profile'), 500); + $this->serverError(_('Remote profile with no matching profile'), 500); return false; } $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))) { - $this->client_error(_('Nickname must have only lowercase letters and numbers and no spaces.')); + $this->clientError(_('Nickname must have only lowercase letters and numbers and no spaces.')); return false; } $license = $req->get_parameter('omb_listenee_license'); if ($license && !common_valid_http_url($license)) { - $this->client_error(sprintf(_("Invalid license URL '%s'"), $license)); + $this->clientError(sprintf(_("Invalid license URL '%s'"), $license)); return false; } $profile_url = $req->get_parameter('omb_listenee_profile'); if ($profile_url && !common_valid_http_url($profile_url)) { - $this->client_error(sprintf(_("Invalid profile URL '%s'."), $profile_url)); + $this->clientError(sprintf(_("Invalid profile URL '%s'."), $profile_url)); return false; } # optional stuff $fullname = $req->get_parameter('omb_listenee_fullname'); if ($fullname && strlen($fullname) > 255) { - $this->client_error(_("Full name is too long (max 255 chars).")); + $this->clientError(_("Full name is too long (max 255 chars).")); return false; } $homepage = $req->get_parameter('omb_listenee_homepage'); if ($homepage && (!common_valid_http_url($homepage) || strlen($homepage) > 255)) { - $this->client_error(sprintf(_("Invalid homepage '%s'"), $homepage)); + $this->clientError(sprintf(_("Invalid homepage '%s'"), $homepage)); return false; } $bio = $req->get_parameter('omb_listenee_bio'); if ($bio && strlen($bio) > 140) { - $this->client_error(_("Bio is too long (max 140 chars).")); + $this->clientError(_("Bio is too long (max 140 chars).")); return false; } $location = $req->get_parameter('omb_listenee_location'); if ($location && strlen($location) > 255) { - $this->client_error(_("Location is too long (max 255 chars).")); + $this->clientError(_("Location is too long (max 255 chars).")); return false; } $avatar = $req->get_parameter('omb_listenee_avatar'); if ($avatar) { if (!common_valid_http_url($avatar) || strlen($avatar) > 255) { - $this->client_error(sprintf(_("Invalid avatar URL '%s'"), $avatar)); + $this->clientError(sprintf(_("Invalid avatar URL '%s'"), $avatar)); return false; } $size = @getimagesize($avatar); if (!$size) { - $this->client_error(sprintf(_("Can't read avatar URL '%s'"), $avatar)); + $this->clientError(sprintf(_("Can't read avatar URL '%s'"), $avatar)); return false; } if ($size[0] != AVATAR_PROFILE_SIZE || $size[1] != AVATAR_PROFILE_SIZE) { - $this->client_error(sprintf(_("Wrong size image at '%s'"), $avatar)); + $this->clientError(sprintf(_("Wrong size image at '%s'"), $avatar)); return false; } if (!in_array($size[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG))) { - $this->client_error(sprintf(_("Wrong image type for '%s'"), $avatar)); + $this->clientError(sprintf(_("Wrong image type for '%s'"), $avatar)); return false; } } @@ -156,14 +156,14 @@ class UpdateprofileAction extends Action } if (!$profile->update($orig_profile)) { - $this->server_error(_('Could not save new profile info'), 500); + $this->serverError(_('Could not save new profile info'), 500); return false; } else { if ($avatar) { $temp_filename = tempnam(sys_get_temp_dir(), 'listenee_avatar'); copy($avatar, $temp_filename); if (!$profile->setOriginal($temp_filename)) { - $this->server_error(_('Could not save avatar info'), 500); + $this->serverError(_('Could not save avatar info'), 500); return false; } } diff --git a/actions/userauthorization.php b/actions/userauthorization.php index 05efbc16c..838458932 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -54,7 +54,7 @@ class UserauthorizationAction extends Action common_debug('getting new request', __FILE__); $req = $this->get_new_request(); if (!$req) { - $this->client_error(_('No request found!')); + $this->clientError(_('No request found!')); } common_debug('validating request', __FILE__); # XXX: only validate new requests, since nonce is one-time use @@ -64,7 +64,7 @@ class UserauthorizationAction extends Action $this->show_form($req); } catch (OAuthException $e) { $this->clear_request(); - $this->client_error($e->getMessage()); + $this->clientError($e->getMessage()); return; } @@ -84,51 +84,51 @@ class UserauthorizationAction extends Action $avatar = $req->get_parameter('omb_listenee_avatar'); common_show_header(_('Authorize subscription')); - common_element('p', null, _('Please check these details to make sure '. + $this->element('p', null, _('Please check these details to make sure '. 'that you want to subscribe to this user\'s notices. '. 'If you didn\'t just ask to subscribe to someone\'s notices, '. 'click "Cancel".')); - common_element_start('div', 'profile'); + $this->elementStart('div', 'profile'); if ($avatar) { - common_element('img', array('src' => $avatar, + $this->element('img', array('src' => $avatar, 'class' => 'avatar profile', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $nickname)); } - common_element('a', array('href' => $profile, + $this->element('a', array('href' => $profile, 'class' => 'external profile nickname'), $nickname); if ($fullname) { - common_element_start('div', 'fullname'); + $this->elementStart('div', 'fullname'); if ($homepage) { - common_element('a', array('href' => $homepage), + $this->element('a', array('href' => $homepage), $fullname); } else { - common_text($fullname); + $this->text($fullname); } - common_element_end('div'); + $this->elementEnd('div'); } if ($location) { - common_element('div', 'location', $location); + $this->element('div', 'location', $location); } if ($bio) { - common_element('div', 'bio', $bio); + $this->element('div', 'bio', $bio); } - common_element_start('div', 'license'); - common_element('a', array('href' => $license, + $this->elementStart('div', 'license'); + $this->element('a', array('href' => $license, 'class' => 'license'), $license); - common_element_end('div'); - common_element_end('div'); - common_element_start('form', array('method' => 'post', + $this->elementEnd('div'); + $this->elementEnd('div'); + $this->elementStart('form', array('method' => 'post', 'id' => 'userauthorization', 'name' => 'userauthorization', 'action' => common_local_url('userauthorization'))); - common_hidden('token', common_session_token()); - common_submit('accept', _('Accept')); - common_submit('reject', _('Reject')); - common_element_end('form'); + $this->hidden('token', common_session_token()); + $this->submit('accept', _('Accept')); + $this->submit('reject', _('Reject')); + $this->elementEnd('form'); common_show_footer(); } @@ -137,7 +137,7 @@ class UserauthorizationAction extends Action $req = $this->get_stored_request(); if (!$req) { - common_user_error(_('No authorization request!')); + $this->clientError(_('No authorization request!')); return; } @@ -145,10 +145,10 @@ class UserauthorizationAction extends Action if ($this->arg('accept')) { if (!$this->authorize_token($req)) { - $this->client_error(_('Error authorizing token')); + $this->clientError(_('Error authorizing token')); } if (!$this->save_remote_profile($req)) { - $this->client_error(_('Error saving remote profile')); + $this->clientError(_('Error saving remote profile')); } if (!$callback) { $this->show_accept_message($req->get_parameter('oauth_token')); @@ -160,7 +160,7 @@ class UserauthorizationAction extends Action $profile = $user->getProfile(); if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->server_error(_('User without matching profile')); + $this->serverError(_('User without matching profile')); return; } $params['omb_listener_nickname'] = $user->nickname; @@ -328,18 +328,18 @@ class UserauthorizationAction extends Action function show_accept_message($tok) { common_show_header(_('Subscription authorized')); - common_element('p', null, + $this->element('p', null, _('The subscription has been authorized, but no '. 'callback URL was passed. Check with the site\'s instructions for '. 'details on how to authorize the subscription. Your subscription token is:')); - common_element('blockquote', 'token', $tok); + $this->element('blockquote', 'token', $tok); common_show_footer(); } function show_reject_message($tok) { common_show_header(_('Subscription rejected')); - common_element('p', null, + $this->element('p', null, _('The subscription has been rejected, but no '. 'callback URL was passed. Check with the site\'s instructions for '. 'details on how to fully reject the subscription.')); diff --git a/actions/userbyid.php b/actions/userbyid.php index d57ed21a5..4bb896c38 100644 --- a/actions/userbyid.php +++ b/actions/userbyid.php @@ -22,7 +22,7 @@ if (!defined('LACONICA')) { exit(1); } class UserbyidAction extends Action { - function is_readonly() + function isReadOnly() { return true; } @@ -32,11 +32,11 @@ class UserbyidAction extends Action parent::handle($args); $id = $this->trimmed('id'); if (!$id) { - $this->client_error(_('No id.')); + $this->clientError(_('No id.')); } $user =& User::staticGet($id); if (!$user) { - $this->client_error(_('No such user.')); + $this->clientError(_('No such user.')); } // support redirecting to FOAF rdf/xml if the agent prefers it diff --git a/actions/userrss.php b/actions/userrss.php index 1e9fe121f..d14fc523e 100644 --- a/actions/userrss.php +++ b/actions/userrss.php @@ -34,7 +34,7 @@ class UserrssAction extends Rss10Action $this->user = User::staticGet('nickname', $nickname); if (!$this->user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return false; } else { return true; @@ -78,7 +78,7 @@ class UserrssAction extends Rss10Action $profile = $user->getProfile(); if (!$profile) { common_log_db_error($user, 'SELECT', __FILE__); - $this->server_error(_('User without matching profile')); + $this->serverError(_('User without matching profile')); return null; } $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); diff --git a/actions/xrds.php b/actions/xrds.php index 7edc6aa39..14cb9d503 100644 --- a/actions/xrds.php +++ b/actions/xrds.php @@ -24,7 +24,7 @@ require_once(INSTALLDIR.'/lib/omb.php'); class XrdsAction extends Action { - function is_readonly() + function isReadOnly() { return true; } @@ -35,7 +35,7 @@ class XrdsAction extends Action $nickname = $this->trimmed('nickname'); $user = User::staticGet('nickname', $nickname); if (!$user) { - common_user_error(_('No such user.')); + $this->clientError(_('No such user.')); return; } $this->show_xrds($user); @@ -47,14 +47,14 @@ class XrdsAction extends Action header('Content-Type: application/xrds+xml'); common_start_xml(); - common_element_start('XRDS', array('xmlns' => 'xri://$xrds')); + $this->elementStart('XRDS', array('xmlns' => 'xri://$xrds')); - common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', + $this->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'xml:id' => 'oauth', 'xmlns:simple' => 'http://xrds-simple.net/core/1.0', 'version' => '2.0')); - common_element('Type', null, 'xri://$xrds*simple'); + $this->element('Type', null, 'xri://$xrds*simple'); $this->show_service(OAUTH_ENDPOINT_REQUEST, common_local_url('requesttoken'), @@ -77,16 +77,16 @@ class XrdsAction extends Action array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY), array(OAUTH_HMAC_SHA1)); - common_element_end('XRD'); + $this->elementEnd('XRD'); # XXX: decide whether to include user's ID/nickname in postNotice URL - common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', + $this->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'xml:id' => 'omb', 'xmlns:simple' => 'http://xrds-simple.net/core/1.0', 'version' => '2.0')); - common_element('Type', null, 'xri://$xrds*simple'); + $this->element('Type', null, 'xri://$xrds*simple'); $this->show_service(OMB_ENDPOINT_POSTNOTICE, common_local_url('postnotice')); @@ -94,44 +94,44 @@ class XrdsAction extends Action $this->show_service(OMB_ENDPOINT_UPDATEPROFILE, common_local_url('updateprofile')); - common_element_end('XRD'); + $this->elementEnd('XRD'); - common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', + $this->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'version' => '2.0')); - common_element('Type', null, 'xri://$xrds*simple'); + $this->element('Type', null, 'xri://$xrds*simple'); $this->show_service(OAUTH_DISCOVERY, '#oauth'); $this->show_service(OMB_NAMESPACE, '#omb'); - common_element_end('XRD'); + $this->elementEnd('XRD'); - common_element_end('XRDS'); + $this->elementEnd('XRDS'); common_end_xml(); } function show_service($type, $uri, $params=null, $sigs=null, $localId=null) { - common_element_start('Service'); + $this->elementStart('Service'); if ($uri) { - common_element('URI', null, $uri); + $this->element('URI', null, $uri); } - common_element('Type', null, $type); + $this->element('Type', null, $type); if ($params) { foreach ($params as $param) { - common_element('Type', null, $param); + $this->element('Type', null, $param); } } if ($sigs) { foreach ($sigs as $sig) { - common_element('Type', null, $sig); + $this->element('Type', null, $sig); } } if ($localId) { - common_element('LocalID', null, $localId); + $this->element('LocalID', null, $localId); } - common_element_end('Service'); + $this->elementEnd('Service'); } }
\ No newline at end of file @@ -55,7 +55,7 @@ if (file_exists($actionfile)) { $action_obj = new $action_class(); - if ($config['db']['mirror'] && $action_obj->is_readonly()) { + if ($config['db']['mirror'] && $action_obj->isReadOnly()) { if (is_array($config['db']['mirror'])) { // "load balancing", ha ha $k = array_rand($config['db']['mirror']); diff --git a/js/jcrop/jquery.Jcrop.go.js b/js/jcrop/jquery.Jcrop.go.js deleted file mode 100644 index 7c5b5e4e6..000000000 --- a/js/jcrop/jquery.Jcrop.go.js +++ /dev/null @@ -1,41 +0,0 @@ - $(function(){ - jQuery("#avatar_original img.avatar").Jcrop({ onChange: showPreview, - setSelect: [ 0, 0, $("#avatar_original img.avatar").attr("width"), $("#avatar_original img.avatar").attr("height") ], - onSelect: updateCoords, - aspectRatio: 1, - boxWidth: 480, - boxHeight: 480, - bgColor: '#000', - bgOpacity: .4 - }); - }); - - function showPreview(coords) { - var rx = 96 / coords.w; - var ry = 96 / coords.h; - - var img_width = $("#avatar_original img.avatar").attr("width"); - var img_height = $("#avatar_original img.avatar").attr("height"); - - - $('#avatar_preview img.avatar').css({ - width: Math.round(rx *img_width) + 'px', - height: Math.round(ry * img_height) + 'px', - marginLeft: '-' + Math.round(rx * coords.x) + 'px', - marginTop: '-' + Math.round(ry * coords.y) + 'px' - }); - }; - - function updateCoords(c) { - $('#avatar_crop_x').val(c.x); - $('#avatar_crop_y').val(c.y); - $('#avatar_crop_w').val(c.w); - $('#avatar_crop_h').val(c.h); - }; - - function checkCoords() { - if (parseInt($('#avatar_crop_w').val())) return true; - alert('Please select a crop region then press submit.'); - return false; - }; - diff --git a/js/jquery.Jcrop.go.js b/js/jquery.Jcrop.go.js new file mode 100644 index 000000000..e5d587354 --- /dev/null +++ b/js/jquery.Jcrop.go.js @@ -0,0 +1,41 @@ + $(function(){ + jQuery("#photo_original img").Jcrop({ + onChange: showPreview, + setSelect: [ 0, 0, $("#photo_original img").attr("width"), $("#photo_original img").attr("height") ], + onSelect: updateCoords, + aspectRatio: 1, + boxWidth: 480, + boxHeight: 480, + bgColor: '#000', + bgOpacity: .4 + }); + }); + + function showPreview(coords) { + var rx = 96 / coords.w; + var ry = 96 / coords.h; + + var img_width = $("#photo_original img").attr("width"); + var img_height = $("#photo_original img").attr("height"); + + $('#photo_preview img').css({ + width: Math.round(rx *img_width) + 'px', + height: Math.round(ry * img_height) + 'px', + marginLeft: '-' + Math.round(rx * coords.x) + 'px', + marginTop: '-' + Math.round(ry * coords.y) + 'px' + }); + }; + + function updateCoords(c) { + $('#photo_crop_x').val(c.x); + $('#photo_crop_y').val(c.y); + $('#photo_crop_w').val(c.w); + $('#photo_crop_h').val(c.h); + }; + + function checkCoords() { + if (parseInt($('#photo_crop_w').val())) return true; + alert('Please select a crop region then press submit.'); + return false; + }; + diff --git a/js/jcrop/jquery.Jcrop.pack.js b/js/jquery.Jcrop.pack.js index aa82e8abe..aa82e8abe 100644 --- a/js/jcrop/jquery.Jcrop.pack.js +++ b/js/jquery.Jcrop.pack.js diff --git a/js/jquery.form.js b/js/jquery.form.js deleted file mode 100644 index cb8b5a660..000000000 --- a/js/jquery.form.js +++ /dev/null @@ -1,632 +0,0 @@ -/*
- * jQuery Form Plugin
- * version: 2.17 (06-NOV-2008)
- * @requires jQuery v1.2.2 or later
- *
- * Examples and documentation at: http://malsup.com/jquery/form/
- * 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$
- */
-;(function($) {
-
-/*
- Usage Note:
- -----------
- Do not use both ajaxSubmit and ajaxForm on the same form. These
- functions are intended to be exclusive. Use ajaxSubmit if you want
- to bind your own submit handler to the form. For example,
-
- $(document).ready(function() {
- $('#myForm').bind('submit', function() {
- $(this).ajaxSubmit({
- target: '#output'
- });
- return false; // <-- important!
- });
- });
-
- Use ajaxForm when you want the plugin to manage all the event binding
- for you. For example,
-
- $(document).ready(function() {
- $('#myForm').ajaxForm({
- target: '#output'
- });
- });
-
- When using ajaxForm, the ajaxSubmit function will be invoked for you
- at the appropriate time.
-*/
-
-/**
- * ajaxSubmit() provides a mechanism for immediately submitting
- * an HTML form using AJAX.
- */
-$.fn.ajaxSubmit = function(options) {
- // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
- if (!this.length) {
- log('ajaxSubmit: skipping submit process - no element selected');
- return this;
- }
-
- if (typeof options == 'function')
- options = { success: options };
-
- options = $.extend({
- url: this.attr('action') || window.location.toString(),
- type: this.attr('method') || 'GET'
- }, options || {});
-
- // hook for manipulating the form data before it is extracted;
- // convenient for use with rich editors like tinyMCE or FCKEditor
- var veto = {};
- this.trigger('form-pre-serialize', [this, options, veto]);
- if (veto.veto) {
- log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
- return this;
- }
-
- // provide opportunity to alter form data before it is serialized
- if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
- log('ajaxSubmit: submit aborted via beforeSerialize callback');
- return this;
- }
-
- var a = this.formToArray(options.semantic);
- if (options.data) {
- options.extraData = options.data;
- for (var n in options.data) {
- if(options.data[n] instanceof Array) {
- for (var k in options.data[n])
- a.push( { name: n, value: options.data[n][k] } )
- }
- else
- a.push( { name: n, value: options.data[n] } );
- }
- }
-
- // give pre-submit callback an opportunity to abort the submit
- if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
- log('ajaxSubmit: submit aborted via beforeSubmit callback');
- return this;
- }
-
- // fire vetoable 'validate' event
- this.trigger('form-submit-validate', [a, this, options, veto]);
- if (veto.veto) {
- log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
- return this;
- }
-
- var q = $.param(a);
-
- if (options.type.toUpperCase() == 'GET') {
- options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
- options.data = null; // data is null for 'get'
- }
- else
- options.data = q; // data is the query string for 'post'
-
- var $form = this, callbacks = [];
- if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
- if (options.clearForm) callbacks.push(function() { $form.clearForm(); });
-
- // perform a load on the target only if dataType is not provided
- if (!options.dataType && options.target) {
- var oldSuccess = options.success || function(){};
- callbacks.push(function(data) {
- $(options.target).html(data).each(oldSuccess, arguments);
- });
- }
- else if (options.success)
- callbacks.push(options.success);
-
- options.success = function(data, status) {
- for (var i=0, max=callbacks.length; i < max; i++)
- callbacks[i].apply(options, [data, status, $form]);
- };
-
- // are there files to upload?
- var files = $('input:file', this).fieldValue();
- var found = false;
- for (var j=0; j < files.length; j++)
- if (files[j])
- found = true;
-
- // options.iframe allows user to force iframe mode
- if (options.iframe || found) {
- // hack to fix Safari hang (thanks to Tim Molendijk for this)
- // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
- if ($.browser.safari && options.closeKeepAlive)
- $.get(options.closeKeepAlive, fileUpload);
- else
- fileUpload();
- }
- else
- $.ajax(options);
-
- // fire 'notify' event
- this.trigger('form-submit-notify', [this, options]);
- return this;
-
-
- // private function for handling file uploads (hat tip to YAHOO!)
- function fileUpload() {
- var form = $form[0];
-
- if ($(':input[@name=submit]', form).length) {
- alert('Error: Form elements must not be named "submit".');
- return;
- }
-
- var opts = $.extend({}, $.ajaxSettings, options);
- var s = jQuery.extend(true, {}, $.extend(true, {}, $.ajaxSettings), opts);
-
- var id = 'jqFormIO' + (new Date().getTime());
- var $io = $('<iframe id="' + id + '" name="' + id + '" />');
- var io = $io[0];
-
- if ($.browser.msie || $.browser.opera)
- io.src = 'javascript:false;document.write("");';
- $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
-
- var xhr = { // mock object
- aborted: 0,
- responseText: null,
- responseXML: null,
- status: 0,
- statusText: 'n/a',
- getAllResponseHeaders: function() {},
- getResponseHeader: function() {},
- setRequestHeader: function() {},
- abort: function() {
- this.aborted = 1;
- $io.attr('src','about:blank'); // abort op in progress
- }
- };
-
- var g = opts.global;
- // trigger ajax global events so that activity/block indicators work like normal
- if (g && ! $.active++) $.event.trigger("ajaxStart");
- if (g) $.event.trigger("ajaxSend", [xhr, opts]);
-
- if (s.beforeSend && s.beforeSend(xhr, s) === false) {
- s.global && jQuery.active--;
- return;
- }
- if (xhr.aborted)
- return;
-
- var cbInvoked = 0;
- var timedOut = 0;
-
- // add submitting element to data if we know it
- var sub = form.clk;
- if (sub) {
- var n = sub.name;
- if (n && !sub.disabled) {
- options.extraData = options.extraData || {};
- options.extraData[n] = sub.value;
- if (sub.type == "image") {
- options.extraData[name+'.x'] = form.clk_x;
- options.extraData[name+'.y'] = form.clk_y;
- }
- }
- }
-
- // take a breath so that pending repaints get some cpu time before the upload starts
- setTimeout(function() {
- // make sure form attrs are set
- var t = $form.attr('target'), a = $form.attr('action');
- $form.attr({
- target: id,
- method: 'POST',
- action: opts.url
- });
-
- // ie borks in some cases when setting encoding
- if (! options.skipEncodingOverride) {
- $form.attr({
- encoding: 'multipart/form-data',
- enctype: 'multipart/form-data'
- });
- }
-
- // support timout
- if (opts.timeout)
- setTimeout(function() { timedOut = true; cb(); }, opts.timeout);
-
- // add "extra" data to form if provided in options
- var extraInputs = [];
- try {
- if (options.extraData)
- for (var n in options.extraData)
- extraInputs.push(
- $('<input type="hidden" name="'+n+'" value="'+options.extraData[n]+'" />')
- .appendTo(form)[0]);
-
- // add iframe to doc and submit the form
- $io.appendTo('body');
- io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
- form.submit();
- }
- finally {
- // reset attrs and remove "extra" input elements
- $form.attr('action', a);
- t ? $form.attr('target', t) : $form.removeAttr('target');
- $(extraInputs).remove();
- }
- }, 10);
-
- function cb() {
- if (cbInvoked++) return;
-
- io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);
-
- var operaHack = 0;
- var ok = true;
- try {
- if (timedOut) throw 'timeout';
- // extract the server response from the iframe
- var data, doc;
-
- doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
-
- if (doc.body == null && !operaHack && $.browser.opera) {
- // In Opera 9.2.x the iframe DOM is not always traversable when
- // the onload callback fires so we give Opera 100ms to right itself
- operaHack = 1;
- cbInvoked--;
- setTimeout(cb, 100);
- return;
- }
-
- xhr.responseText = doc.body ? doc.body.innerHTML : null;
- xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
- xhr.getResponseHeader = function(header){
- var headers = {'content-type': opts.dataType};
- return headers[header];
- };
-
- if (opts.dataType == 'json' || opts.dataType == 'script') {
- var ta = doc.getElementsByTagName('textarea')[0];
- xhr.responseText = ta ? ta.value : xhr.responseText;
- }
- else if (opts.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) {
- xhr.responseXML = toXml(xhr.responseText);
- }
- data = $.httpData(xhr, opts.dataType);
- }
- catch(e){
- ok = false;
- $.handleError(opts, xhr, 'error', e);
- }
-
- // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
- if (ok) {
- opts.success(data, 'success');
- if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
- }
- if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
- if (g && ! --$.active) $.event.trigger("ajaxStop");
- if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');
-
- // clean up
- setTimeout(function() {
- $io.remove();
- xhr.responseXML = null;
- }, 100);
- };
-
- function toXml(s, doc) {
- if (window.ActiveXObject) {
- doc = new ActiveXObject('Microsoft.XMLDOM');
- doc.async = 'false';
- doc.loadXML(s);
- }
- else
- doc = (new DOMParser()).parseFromString(s, 'text/xml');
- return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
- };
- };
-};
-
-/**
- * ajaxForm() provides a mechanism for fully automating form submission.
- *
- * The advantages of using this method instead of ajaxSubmit() are:
- *
- * 1: This method will include coordinates for <input type="image" /> elements (if the element
- * is used to submit the form).
- * 2. This method will include the submit element's name/value data (for the element that was
- * used to submit the form).
- * 3. This method binds the submit() method to the form for you.
- *
- * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely
- * passes the options argument along after properly binding events for submit elements and
- * the form itself.
- */
-$.fn.ajaxForm = function(options) {
- return this.ajaxFormUnbind().bind('submit.form-plugin',function() {
- $(this).ajaxSubmit(options);
- return false;
- }).each(function() {
- // store options in hash
- $(":submit,input:image", this).bind('click.form-plugin',function(e) {
- var form = this.form;
- form.clk = this;
- if (this.type == 'image') {
- if (e.offsetX != undefined) {
- form.clk_x = e.offsetX;
- form.clk_y = e.offsetY;
- } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
- var offset = $(this).offset();
- form.clk_x = e.pageX - offset.left;
- form.clk_y = e.pageY - offset.top;
- } else {
- form.clk_x = e.pageX - this.offsetLeft;
- form.clk_y = e.pageY - this.offsetTop;
- }
- }
- // clear form vars
- setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 10);
- });
- });
-};
-
-// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
-$.fn.ajaxFormUnbind = function() {
- this.unbind('submit.form-plugin');
- return this.each(function() {
- $(":submit,input:image", this).unbind('click.form-plugin');
- });
-
-};
-
-/**
- * formToArray() gathers form element data into an array of objects that can
- * be passed to any of the following ajax functions: $.get, $.post, or load.
- * Each object in the array has both a 'name' and 'value' property. An example of
- * an array for a simple login form might be:
- *
- * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
- *
- * It is this array that is passed to pre-submit callback functions provided to the
- * ajaxSubmit() and ajaxForm() methods.
- */
-$.fn.formToArray = function(semantic) {
- var a = [];
- if (this.length == 0) return a;
-
- var form = this[0];
- var els = semantic ? form.getElementsByTagName('*') : form.elements;
- if (!els) return a;
- for(var i=0, max=els.length; i < max; i++) {
- var el = els[i];
- var n = el.name;
- if (!n) continue;
-
- if (semantic && form.clk && el.type == "image") {
- // handle image inputs on the fly when semantic == true
- if(!el.disabled && form.clk == el)
- a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
- continue;
- }
-
- var v = $.fieldValue(el, true);
- if (v && v.constructor == Array) {
- for(var j=0, jmax=v.length; j < jmax; j++)
- a.push({name: n, value: v[j]});
- }
- else if (v !== null && typeof v != 'undefined')
- a.push({name: n, value: v});
- }
-
- if (!semantic && form.clk) {
- // input type=='image' are not found in elements array! handle them here
- var inputs = form.getElementsByTagName("input");
- for(var i=0, max=inputs.length; i < max; i++) {
- var input = inputs[i];
- var n = input.name;
- if(n && !input.disabled && input.type == "image" && form.clk == input)
- a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
- }
- }
- return a;
-};
-
-/**
- * Serializes form data into a 'submittable' string. This method will return a string
- * in the format: name1=value1&name2=value2
- */
-$.fn.formSerialize = function(semantic) {
- //hand off to jQuery.param for proper encoding
- return $.param(this.formToArray(semantic));
-};
-
-/**
- * Serializes all field elements in the jQuery object into a query string.
- * This method will return a string in the format: name1=value1&name2=value2
- */
-$.fn.fieldSerialize = function(successful) {
- var a = [];
- this.each(function() {
- var n = this.name;
- if (!n) return;
- var v = $.fieldValue(this, successful);
- if (v && v.constructor == Array) {
- for (var i=0,max=v.length; i < max; i++)
- a.push({name: n, value: v[i]});
- }
- else if (v !== null && typeof v != 'undefined')
- a.push({name: this.name, value: v});
- });
- //hand off to jQuery.param for proper encoding
- return $.param(a);
-};
-
-/**
- * Returns the value(s) of the element in the matched set. For example, consider the following form:
- *
- * <form><fieldset>
- * <input name="A" type="text" />
- * <input name="A" type="text" />
- * <input name="B" type="checkbox" value="B1" />
- * <input name="B" type="checkbox" value="B2"/>
- * <input name="C" type="radio" value="C1" />
- * <input name="C" type="radio" value="C2" />
- * </fieldset></form>
- *
- * var v = $(':text').fieldValue();
- * // if no values are entered into the text inputs
- * v == ['','']
- * // if values entered into the text inputs are 'foo' and 'bar'
- * v == ['foo','bar']
- *
- * var v = $(':checkbox').fieldValue();
- * // if neither checkbox is checked
- * v === undefined
- * // if both checkboxes are checked
- * v == ['B1', 'B2']
- *
- * var v = $(':radio').fieldValue();
- * // if neither radio is checked
- * v === undefined
- * // if first radio is checked
- * v == ['C1']
- *
- * The successful argument controls whether or not the field element must be 'successful'
- * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
- * The default value of the successful argument is true. If this value is false the value(s)
- * for each element is returned.
- *
- * Note: This method *always* returns an array. If no valid value can be determined the
- * array will be empty, otherwise it will contain one or more values.
- */
-$.fn.fieldValue = function(successful) {
- for (var val=[], i=0, max=this.length; i < max; i++) {
- var el = this[i];
- var v = $.fieldValue(el, successful);
- if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
- continue;
- v.constructor == Array ? $.merge(val, v) : val.push(v);
- }
- return val;
-};
-
-/**
- * Returns the value of the field element.
- */
-$.fieldValue = function(el, successful) {
- var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
- if (typeof successful == 'undefined') successful = true;
-
- if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
- (t == 'checkbox' || t == 'radio') && !el.checked ||
- (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
- tag == 'select' && el.selectedIndex == -1))
- return null;
-
- if (tag == 'select') {
- var index = el.selectedIndex;
- if (index < 0) return null;
- var a = [], ops = el.options;
- var one = (t == 'select-one');
- var max = (one ? index+1 : ops.length);
- for(var i=(one ? index : 0); i < max; i++) {
- var op = ops[i];
- if (op.selected) {
- // extra pain for IE...
- var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
- if (one) return v;
- a.push(v);
- }
- }
- return a;
- }
- return el.value;
-};
-
-/**
- * Clears the form data. Takes the following actions on the form's input fields:
- * - input text fields will have their 'value' property set to the empty string
- * - select elements will have their 'selectedIndex' property set to -1
- * - checkbox and radio inputs will have their 'checked' property set to false
- * - inputs of type submit, button, reset, and hidden will *not* be effected
- * - button elements will *not* be effected
- */
-$.fn.clearForm = function() {
- return this.each(function() {
- $('input,select,textarea', this).clearFields();
- });
-};
-
-/**
- * Clears the selected form elements.
- */
-$.fn.clearFields = $.fn.clearInputs = function() {
- return this.each(function() {
- var t = this.type, tag = this.tagName.toLowerCase();
- if (t == 'text' || t == 'password' || tag == 'textarea')
- this.value = '';
- else if (t == 'checkbox' || t == 'radio')
- this.checked = false;
- else if (tag == 'select')
- this.selectedIndex = -1;
- });
-};
-
-/**
- * Resets the form data. Causes all form elements to be reset to their original value.
- */
-$.fn.resetForm = function() {
- return this.each(function() {
- // guard against an input with the name of 'reset'
- // note that IE reports the reset function as an 'object'
- if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
- this.reset();
- });
-};
-
-/**
- * Enables or disables any matching elements.
- */
-$.fn.enable = function(b) {
- if (b == undefined) b = true;
- return this.each(function() {
- this.disabled = !b
- });
-};
-
-/**
- * Checks/unchecks any matching checkboxes or radio buttons and
- * selects/deselects and matching option elements.
- */
-$.fn.selected = function(select) {
- if (select == undefined) select = true;
- return this.each(function() {
- var t = this.type;
- if (t == 'checkbox' || t == 'radio')
- this.checked = select;
- else if (this.tagName.toLowerCase() == 'option') {
- var $sel = $(this).parent('select');
- if (select && $sel[0] && $sel[0].type == 'select-one') {
- // deselect all other options
- $sel.find('option').selected(false);
- }
- this.selected = select;
- }
- });
-};
-
-// helper fn for console logging
-// set $.fn.ajaxSubmit.debug to true to enable debug logging
-function log() {
- if ($.fn.ajaxSubmit.debug && window.console && window.console.log)
- window.console.log('[jquery.form] ' + Array.prototype.join.call(arguments,''));
-};
-
-})(jQuery);
diff --git a/js/jquery.js b/js/jquery.js index 88e661eec..fc06ace27 100644 --- a/js/jquery.js +++ b/js/jquery.js @@ -1,34 +1,36 @@ -(function(){ -/* - * jQuery 1.2.6 - New Wave Javascript +/*! + * jQuery JavaScript Library v1.3 + * http://jquery.com/ * - * Copyright (c) 2008 John Resig (jquery.com) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License * - * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ - * $Rev: 5685 $ + * Date: 2009-01-13 12:50:31 -0500 (Tue, 13 Jan 2009) + * Revision: 6104 */ +(function(){ -// Map over jQuery in case of overwrite -var _jQuery = window.jQuery, -// Map over the $ in case of overwrite - _$ = window.$; - -var jQuery = window.jQuery = window.$ = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context ); -}; - -// A simple way to check for HTML strings or ID strings -// (both of which we optimize for) -var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/, - -// Is it a simple selector - isSimple = /^.[^:#\[\.]*$/, +var + // Will speed up references to window, and allows munging its name. + window = this, + // Will speed up references to undefined, and allows munging its name. + undefined, + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + // Map over the $ in case of overwrite + _$ = window.$, + + jQuery = window.jQuery = window.$ = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); + }, -// Will speed up references to undefined, and allows munging its name. - undefined; + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/; jQuery.fn = jQuery.prototype = { init: function( selector, context ) { @@ -39,10 +41,11 @@ jQuery.fn = jQuery.prototype = { if ( selector.nodeType ) { this[0] = selector; this.length = 1; + this.context = selector; return this; } // Handle HTML strings - if ( typeof selector == "string" ) { + if ( typeof selector === "string" ) { // Are we dealing with HTML string or an ID? var match = quickExpr.exec( selector ); @@ -65,7 +68,10 @@ jQuery.fn = jQuery.prototype = { return jQuery().find( selector ); // Otherwise, we inject the element directly into the jQuery object - return jQuery( elem ); + var ret = jQuery( elem ); + ret.context = document; + ret.selector = selector; + return ret; } selector = []; } @@ -78,26 +84,32 @@ jQuery.fn = jQuery.prototype = { // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) - return jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector ); + return jQuery( document ).ready( selector ); + + // Make sure that old selector state is passed along + if ( selector.selector && selector.context ) { + this.selector = selector.selector; + this.context = selector.context; + } return this.setArray(jQuery.makeArray(selector)); }, + // Start with an empty selector + selector: "", + // The current version of jQuery being used - jquery: "1.2.6", + jquery: "1.3", // The number of elements contained in the matched element set size: function() { return this.length; }, - // The number of elements contained in the matched element set - length: 0, - // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { - return num == undefined ? + return num === undefined ? // Return a 'clean' array jQuery.makeArray( this ) : @@ -108,13 +120,20 @@ jQuery.fn = jQuery.prototype = { // Take an array of elements and push it onto the stack // (returning the new matched element set) - pushStack: function( elems ) { + pushStack: function( elems, name, selector ) { // Build a new jQuery matched element set var ret = jQuery( elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; + ret.context = this.context; + + if ( name === "find" ) + ret.selector = this.selector + (this.selector ? " " : "") + selector; + else if ( name ) + ret.selector = this.selector + "." + name + "(" + selector + ")"; + // Return the newly-formed element set return ret; }, @@ -141,8 +160,6 @@ jQuery.fn = jQuery.prototype = { // Determine the position of an element within // the matched set of elements index: function( elem ) { - var ret = -1; - // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used @@ -154,7 +171,7 @@ jQuery.fn = jQuery.prototype = { var options = name; // Look for the case where we're accessing a style value - if ( name.constructor == String ) + if ( typeof name === "string" ) if ( value === undefined ) return this[0] && jQuery[ type || "attr" ]( this[0], name ); @@ -184,7 +201,7 @@ jQuery.fn = jQuery.prototype = { }, text: function( text ) { - if ( typeof text != "object" && text != null ) + if ( typeof text !== "object" && text != null ) return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); var ret = ""; @@ -202,20 +219,22 @@ jQuery.fn = jQuery.prototype = { }, wrapAll: function( html ) { - if ( this[0] ) + if ( this[0] ) { // The elements to wrap the target around - jQuery( html, this[0].ownerDocument ) - .clone() - .insertBefore( this[0] ) - .map(function(){ - var elem = this; + var wrap = jQuery( html, this[0].ownerDocument ).clone(); - while ( elem.firstChild ) - elem = elem.firstChild; + if ( this[0].parentNode ) + wrap.insertBefore( this[0] ); - return elem; - }) - .append(this); + wrap.map(function(){ + var elem = this; + + while ( elem.firstChild ) + elem = elem.firstChild; + + return elem; + }).append(this); + } return this; }, @@ -233,27 +252,27 @@ jQuery.fn = jQuery.prototype = { }, append: function() { - return this.domManip(arguments, true, false, function(elem){ + return this.domManip(arguments, true, function(elem){ if (this.nodeType == 1) this.appendChild( elem ); }); }, prepend: function() { - return this.domManip(arguments, true, true, function(elem){ + return this.domManip(arguments, true, function(elem){ if (this.nodeType == 1) this.insertBefore( elem, this.firstChild ); }); }, before: function() { - return this.domManip(arguments, false, false, function(elem){ + return this.domManip(arguments, false, function(elem){ this.parentNode.insertBefore( elem, this ); }); }, after: function() { - return this.domManip(arguments, false, true, function(elem){ + return this.domManip(arguments, false, function(elem){ this.parentNode.insertBefore( elem, this.nextSibling ); }); }, @@ -262,20 +281,31 @@ jQuery.fn = jQuery.prototype = { return this.prevObject || jQuery( [] ); }, + // For internal use only. + // Behaves like an Array's .push method, not like a jQuery method. + push: [].push, + find: function( selector ) { - var elems = jQuery.map(this, function(elem){ - return jQuery.find( selector, elem ); - }); + if ( this.length === 1 && !/,/.test(selector) ) { + var ret = this.pushStack( [], "find", selector ); + ret.length = 0; + jQuery.find( selector, this[0], ret ); + return ret; + } else { + var elems = jQuery.map(this, function(elem){ + return jQuery.find( selector, elem ); + }); - return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ? - jQuery.unique( elems ) : - elems ); + return this.pushStack( /[^+>] [^+>]/.test( selector ) ? + jQuery.unique( elems ) : + elems, "find", selector ); + } }, clone: function( events ) { // Do the clone var ret = this.map(function(){ - if ( jQuery.browser.msie && !jQuery.isXMLDoc(this) ) { + if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { // IE copies events bound via attachEvent when // using cloneNode. Calling detachEvent on the // clone will also remove the events from the orignal @@ -296,7 +326,7 @@ jQuery.fn = jQuery.prototype = { // removeData doesn't work here, IE removes it from the original as well // this is primarily for IE but the data expando shouldn't be copied over in any browser var clone = ret.find("*").andSelf().each(function(){ - if ( this[ expando ] != undefined ) + if ( this[ expando ] !== undefined ) this[ expando ] = null; }); @@ -323,14 +353,29 @@ jQuery.fn = jQuery.prototype = { return selector.call( elem, i ); }) || - jQuery.multiFilter( selector, this ) ); + jQuery.multiFilter( selector, jQuery.grep(this, function(elem){ + return elem.nodeType === 1; + }) ), "filter", selector ); + }, + + closest: function( selector ) { + var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null; + + return this.map(function(){ + var cur = this; + while ( cur && cur.ownerDocument ) { + if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) + return cur; + cur = cur.parentNode; + } + }); }, not: function( selector ) { - if ( selector.constructor == String ) + if ( typeof selector === "string" ) // test special case where just one selector is passed in if ( isSimple.test( selector ) ) - return this.pushStack( jQuery.multiFilter( selector, this, true ) ); + return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector ); else selector = jQuery.multiFilter( selector, this ); @@ -343,7 +388,7 @@ jQuery.fn = jQuery.prototype = { add: function( selector ) { return this.pushStack( jQuery.unique( jQuery.merge( this.get(), - typeof selector == 'string' ? + typeof selector === "string" ? jQuery( selector ) : jQuery.makeArray( selector ) ))); @@ -354,15 +399,17 @@ jQuery.fn = jQuery.prototype = { }, hasClass: function( selector ) { - return this.is( "." + selector ); + return !!selector && this.is( "." + selector ); }, val: function( value ) { - if ( value == undefined ) { - - if ( this.length ) { - var elem = this[0]; + if ( value === undefined ) { + var elem = this[0]; + if ( elem ) { + if( jQuery.nodeName( elem, 'option' ) ) + return (elem.attributes.value || {}).specified ? elem.value : elem.text; + // We need to handle select boxes special if ( jQuery.nodeName( elem, "select" ) ) { var index = elem.selectedIndex, @@ -380,7 +427,7 @@ jQuery.fn = jQuery.prototype = { if ( option.selected ) { // Get the specifc value for the option - value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value; + value = jQuery(option).val(); // We don't need an array for one selects if ( one ) @@ -391,25 +438,25 @@ jQuery.fn = jQuery.prototype = { } } - return values; + return values; + } // Everything else, we just grab the value - } else - return (this[0].value || "").replace(/\r/g, ""); + return (elem.value || "").replace(/\r/g, ""); } return undefined; } - if( value.constructor == Number ) + if ( typeof value === "number" ) value += ''; return this.each(function(){ if ( this.nodeType != 1 ) return; - if ( value.constructor == Array && /radio|checkbox/.test( this.type ) ) + if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) ) this.checked = (jQuery.inArray(this.value, value) >= 0 || jQuery.inArray(this.name, value) >= 0); @@ -430,7 +477,7 @@ jQuery.fn = jQuery.prototype = { }, html: function( value ) { - return value == undefined ? + return value === undefined ? (this[0] ? this[0].innerHTML : null) : @@ -442,11 +489,12 @@ jQuery.fn = jQuery.prototype = { }, eq: function( i ) { - return this.slice( i, i + 1 ); + return this.slice( i, +i + 1 ); }, slice: function() { - return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); + return this.pushStack( Array.prototype.slice.apply( this, arguments ), + "slice", Array.prototype.slice.call(arguments).join(",") ); }, map: function( callback ) { @@ -459,69 +507,29 @@ jQuery.fn = jQuery.prototype = { return this.add( this.prevObject ); }, - data: function( key, value ){ - var parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - if ( data === undefined && this.length ) - data = jQuery.data( this[0], key ); - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - } else - return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ - jQuery.data( this, key, value ); - }); - }, - - removeData: function( key ){ - return this.each(function(){ - jQuery.removeData( this, key ); - }); - }, - - domManip: function( args, table, reverse, callback ) { - var clone = this.length > 1, elems; - - return this.each(function(){ - if ( !elems ) { - elems = jQuery.clean( args, this.ownerDocument ); - - if ( reverse ) - elems.reverse(); - } - - var obj = this; - - if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) ) - obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") ); - - var scripts = jQuery( [] ); - - jQuery.each(elems, function(){ - var elem = clone ? - jQuery( this ).clone( true )[0] : - this; - - // execute all scripts after the elements have been injected - if ( jQuery.nodeName( elem, "script" ) ) - scripts = scripts.add( elem ); - else { - // Remove any inner scripts for later evaluation - if ( elem.nodeType == 1 ) - scripts = scripts.add( jQuery( "script", elem ).remove() ); - - // Inject the elements into the document - callback.call( obj, elem ); - } - }); + domManip: function( args, table, callback ) { + if ( this[0] ) { + var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), + scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ), + first = fragment.firstChild, + extra = this.length > 1 ? fragment.cloneNode(true) : fragment; + + if ( first ) + for ( var i = 0, l = this.length; i < l; i++ ) + callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment ); + + if ( scripts ) + jQuery.each( scripts, evalScript ); + } - scripts.each( evalScript ); - }); + return this; + + function root( elem, cur ) { + return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ? + (elem.getElementsByTagName("tbody")[0] || + elem.appendChild(elem.ownerDocument.createElement("tbody"))) : + elem; + } } }; @@ -552,7 +560,7 @@ jQuery.extend = jQuery.fn.extend = function() { var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; // Handle a deep copy situation - if ( target.constructor == Boolean ) { + if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target @@ -560,7 +568,7 @@ jQuery.extend = jQuery.fn.extend = function() { } // Handle case when target is a string or something (possible in deep copy) - if ( typeof target != "object" && typeof target != "function" ) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) target = {}; // extend jQuery itself if only one argument is passed @@ -581,7 +589,7 @@ jQuery.extend = jQuery.fn.extend = function() { continue; // Recurse if we're merging object values - if ( deep && copy && typeof copy == "object" && !copy.nodeType ) + if ( deep && copy && typeof copy === "object" && !copy.nodeType ) target[ name ] = jQuery.extend( deep, // Never move original objects, clone them src || ( copy.length != null ? [ ] : { } ) @@ -597,11 +605,11 @@ jQuery.extend = jQuery.fn.extend = function() { return target; }; -var expando = "jQuery" + now(), uuid = 0, windowData = {}, - // exclude the following css properties to add px - exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, +// exclude the following css properties to add px +var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, // cache defaultView - defaultView = document.defaultView || {}; + defaultView = document.defaultView || {}, + toString = Object.prototype.toString; jQuery.extend({ noConflict: function( deep ) { @@ -613,10 +621,15 @@ jQuery.extend({ return jQuery; }, - // See test/unit/core.js for details concerning this function. - isFunction: function( fn ) { - return !!fn && typeof fn != "string" && !fn.nodeName && - fn.constructor != Array && /^[\s[]?function/.test( fn + "" ); + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return toString.call(obj) === "[object Function]"; + }, + + isArray: function( obj ) { + return toString.call(obj) === "[object Array]"; }, // check if an element is in a (or is an) XML document @@ -636,10 +649,10 @@ jQuery.extend({ script = document.createElement("script"); script.type = "text/javascript"; - if ( jQuery.browser.msie ) - script.text = data; - else + if ( jQuery.support.scriptEval ) script.appendChild( document.createTextNode( data ) ); + else + script.text = data; // Use insertBefore instead of appendChild to circumvent an IE6 bug. // This arises when a base node is used (#2709). @@ -652,80 +665,12 @@ jQuery.extend({ return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); }, - cache: {}, - - data: function( elem, name, data ) { - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ]; - - // Compute a unique ID for the element - if ( !id ) - id = elem[ expando ] = ++uuid; - - // Only generate the data cache if we're - // trying to access or manipulate it - if ( name && !jQuery.cache[ id ] ) - jQuery.cache[ id ] = {}; - - // Prevent overriding the named cache with undefined values - if ( data !== undefined ) - jQuery.cache[ id ][ name ] = data; - - // Return the named cache data, or the ID for the element - return name ? - jQuery.cache[ id ][ name ] : - id; - }, - - removeData: function( elem, name ) { - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ]; - - // If we want to remove a specific section of the element's data - if ( name ) { - if ( jQuery.cache[ id ] ) { - // Remove the section of cache data - delete jQuery.cache[ id ][ name ]; - - // If we've removed all the data, remove the element's cache - name = ""; - - for ( name in jQuery.cache[ id ] ) - break; - - if ( !name ) - jQuery.removeData( elem ); - } - - // Otherwise, we want to remove all of the element's data - } else { - // Clean up the element expando - try { - delete elem[ expando ]; - } catch(e){ - // IE has trouble directly removing the expando - // but it's ok with using removeAttribute - if ( elem.removeAttribute ) - elem.removeAttribute( expando ); - } - - // Completely remove the data cache - delete jQuery.cache[ id ]; - } - }, - // args is for internal usage only each: function( object, callback, args ) { var name, i = 0, length = object.length; if ( args ) { - if ( length == undefined ) { + if ( length === undefined ) { for ( name in object ) if ( callback.apply( object[ name ], args ) === false ) break; @@ -736,7 +681,7 @@ jQuery.extend({ // A special, fast, case for the most common use of each } else { - if ( length == undefined ) { + if ( length === undefined ) { for ( name in object ) if ( callback.call( object[ name ], name, object[ name ] ) === false ) break; @@ -754,7 +699,7 @@ jQuery.extend({ value = value.call( elem, i ); // Handle passing in a number to a CSS property - return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ? + return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ? value + "px" : value; }, @@ -771,7 +716,7 @@ jQuery.extend({ // internal only, use removeClass("class") remove: function( elem, classNames ) { if (elem.nodeType == 1) - elem.className = classNames != undefined ? + elem.className = classNames !== undefined ? jQuery.grep(elem.className.split(/\s+/), function(className){ return !jQuery.className.has( classNames, className ); }).join(" ") : @@ -828,30 +773,14 @@ jQuery.extend({ curCSS: function( elem, name, force ) { var ret, style = elem.style; - // A helper method for determining if an element's values are broken - function color( elem ) { - if ( !jQuery.browser.safari ) - return false; - - // defaultView is cached - var ret = defaultView.getComputedStyle( elem, null ); - return !ret || ret.getPropertyValue("color") == ""; - } - // We need to handle opacity special in IE - if ( name == "opacity" && jQuery.browser.msie ) { + if ( name == "opacity" && !jQuery.support.opacity ) { ret = jQuery.attr( style, "opacity" ); return ret == "" ? "1" : ret; } - // Opera sometimes will give the wrong display answer, this fixes it, see #2037 - if ( jQuery.browser.opera && name == "display" ) { - var save = style.outline; - style.outline = "0 solid black"; - style.outline = save; - } // Make sure we're using the right name for getting the float value if ( name.match( /float/i ) ) @@ -870,38 +799,9 @@ jQuery.extend({ var computedStyle = defaultView.getComputedStyle( elem, null ); - if ( computedStyle && !color( elem ) ) + if ( computedStyle ) ret = computedStyle.getPropertyValue( name ); - // If the element isn't reporting its values properly in Safari - // then some display: none elements are involved - else { - var swap = [], stack = [], a = elem, i = 0; - - // Locate all of the parent display: none elements - for ( ; a && color(a); a = a.parentNode ) - stack.unshift(a); - - // Go through and make them visible, but in reverse - // (It would be better if we knew the exact display type that they had) - for ( ; i < stack.length; i++ ) - if ( color( stack[ i ] ) ) { - swap[ i ] = stack[ i ].style.display; - stack[ i ].style.display = "block"; - } - - // Since we flip the display style, we have to handle that - // one special, otherwise get the value - ret = name == "display" && swap[ stack.length - 1 ] != null ? - "none" : - ( computedStyle && computedStyle.getPropertyValue( name ) ) || ""; - - // Finally, revert the display styles back - for ( i = 0; i < swap.length; i++ ) - if ( swap[ i ] != null ) - stack[ i ].style.display = swap[ i ]; - } - // We should always get a number back from opacity if ( name == "opacity" && ret == "" ) ret = "1"; @@ -936,22 +836,32 @@ jQuery.extend({ return ret; }, - clean: function( elems, context ) { - var ret = []; + clean: function( elems, context, fragment ) { context = context || document; + // !context.createElement fails in IE with an error but returns typeof 'object' - if (typeof context.createElement == 'undefined') + if ( typeof context.createElement === "undefined" ) context = context.ownerDocument || context[0] && context[0].ownerDocument || document; + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) { + var match = /^<(\w+)\s*\/?>$/.exec(elems[0]); + if ( match ) + return [ context.createElement( match[1] ) ]; + } + + var ret = [], scripts = [], div = context.createElement("div"); + jQuery.each(elems, function(i, elem){ + if ( typeof elem === "number" ) + elem += ''; + if ( !elem ) return; - if ( elem.constructor == Number ) - elem += ''; - // Convert html string into DOM nodes - if ( typeof elem == "string" ) { + if ( typeof elem === "string" ) { // Fix "XHTML"-style tags in all browsers elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? @@ -960,7 +870,7 @@ jQuery.extend({ }); // Trim whitespace, otherwise indexOf won't work as expected - var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div"); + var tags = jQuery.trim( elem ).toLowerCase(); var wrap = // option or optgroup @@ -984,7 +894,7 @@ jQuery.extend({ [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] || // IE can't serialize <link> and <script> tags normally - jQuery.browser.msie && + !jQuery.support.htmlSerialize && [ 1, "div<div>", "</div>" ] || [ 0, "", "" ]; @@ -997,7 +907,7 @@ jQuery.extend({ div = div.lastChild; // Remove IE's autoinserted <tbody> from table fragments - if ( jQuery.browser.msie ) { + if ( !jQuery.support.tbody ) { // String was a <table>, *may* have spurious <tbody> var tbody = !tags.indexOf("<table") && tags.indexOf("<tbody") < 0 ? @@ -1012,26 +922,36 @@ jQuery.extend({ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) tbody[ j ].parentNode.removeChild( tbody[ j ] ); - // IE completely kills leading whitespace when innerHTML is used - if ( /^\s/.test( elem ) ) - div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild ); - - } + } + // IE completely kills leading whitespace when innerHTML is used + if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) ) + div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild ); + elem = jQuery.makeArray( div.childNodes ); } - if ( elem.length === 0 && (!jQuery.nodeName( elem, "form" ) && !jQuery.nodeName( elem, "select" )) ) - return; - - if ( elem[0] == undefined || jQuery.nodeName( elem, "form" ) || elem.options ) + if ( elem.nodeType ) ret.push( elem ); - else ret = jQuery.merge( ret, elem ); }); + if ( fragment ) { + for ( var i = 0; ret[i]; i++ ) { + if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) { + scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] ); + } else { + if ( ret[i].nodeType === 1 ) + ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) ); + fragment.appendChild( ret[i] ); + } + } + + return scripts; + } + return ret; }, @@ -1042,8 +962,7 @@ jQuery.extend({ var notxml = !jQuery.isXMLDoc( elem ), // Whether we are setting (or getting) - set = value !== undefined, - msie = jQuery.browser.msie; + set = value !== undefined; // Try to normalize/fix the name name = notxml && jQuery.props[ name ] || name; @@ -1057,7 +976,7 @@ jQuery.extend({ // Safari mis-reports the default selected property of a hidden option // Accessing the parent's selectedIndex property fixes it - if ( name == "selected" && jQuery.browser.safari ) + if ( name == "selected" && elem.parentNode ) elem.parentNode.selectedIndex; // If applicable, access the attribute via the DOM 0 way @@ -1074,17 +993,28 @@ jQuery.extend({ if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) return elem.getAttributeNode( name ).nodeValue; + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + if ( name == "tabIndex" ) { + var attributeNode = elem.getAttributeNode( "tabIndex" ); + return attributeNode && attributeNode.specified + ? attributeNode.value + : elem.nodeName.match(/^(a|area|button|input|object|select|textarea)$/i) + ? 0 + : undefined; + } + return elem[ name ]; } - if ( msie && notxml && name == "style" ) + if ( !jQuery.support.style && notxml && name == "style" ) return jQuery.attr( elem.style, "cssText", value ); if ( set ) // convert the value to a string (all browsers do this but IE) see #1070 elem.setAttribute( name, "" + value ); - var attr = msie && notxml && special + var attr = !jQuery.support.hrefNormalized && notxml && special // Some attributes require a special call on IE ? elem.getAttribute( name, 2 ) : elem.getAttribute( name ); @@ -1096,7 +1026,7 @@ jQuery.extend({ // elem is actually elem.style ... set the style // IE uses filters for opacity - if ( msie && name == "opacity" ) { + if ( !jQuery.support.opacity && name == "opacity" ) { if ( set ) { // IE has trouble with opacity if it does not have layout // Force it by setting the zoom level @@ -1131,8 +1061,8 @@ jQuery.extend({ if( array != null ){ var i = array.length; - //the window, strings and functions also have 'length' - if( i == null || array.split || array.setInterval || array.call ) + // The window, strings (and functions) also have 'length' + if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval ) ret[0] = array; else while( i ) @@ -1157,13 +1087,13 @@ jQuery.extend({ var i = 0, elem, pos = first.length; // Also, we need to make sure that the correct elements are being returned // (IE returns comment nodes in a '*' query) - if ( jQuery.browser.msie ) { - while ( elem = second[ i++ ] ) + if ( !jQuery.support.getAll ) { + while ( (elem = second[ i++ ]) != null ) if ( elem.nodeType != 8 ) first[ pos++ ] = elem; } else - while ( elem = second[ i++ ] ) + while ( (elem = second[ i++ ]) != null ) first[ pos++ ] = elem; return first; @@ -1218,37 +1148,21 @@ jQuery.extend({ } }); +// Use of jQuery.browser is deprecated. +// It's included for backwards compatibility and plugins, +// although they should work to migrate away. + var userAgent = navigator.userAgent.toLowerCase(); // Figure out what browser is being used jQuery.browser = { - version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1], + version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1], safari: /webkit/.test( userAgent ), opera: /opera/.test( userAgent ), msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ), mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ) }; -var styleFloat = jQuery.browser.msie ? - "styleFloat" : - "cssFloat"; - -jQuery.extend({ - // Check to see if the W3C box model is being used - boxModel: !jQuery.browser.msie || document.compatMode == "CSS1Compat", - - props: { - "for": "htmlFor", - "class": "className", - "float": styleFloat, - cssFloat: styleFloat, - styleFloat: styleFloat, - readonly: "readOnly", - maxlength: "maxLength", - cellspacing: "cellSpacing" - } -}); - jQuery.each({ parent: function(elem){return elem.parentNode;}, parents: function(elem){return jQuery.dir(elem,"parentNode");}, @@ -1266,7 +1180,7 @@ jQuery.each({ if ( selector && typeof selector == "string" ) ret = jQuery.multiFilter( selector, ret ); - return this.pushStack( jQuery.unique( ret ) ); + return this.pushStack( jQuery.unique( ret ), name, selector ); }; }); @@ -1302,14 +1216,16 @@ jQuery.each({ jQuery.className.remove( this, classNames ); }, - toggleClass: function( classNames ) { - jQuery.className[ jQuery.className.has( this, classNames ) ? "remove" : "add" ]( this, classNames ); + toggleClass: function( classNames, state ) { + if( typeof state !== "boolean" ) + state = !jQuery.className.has( this, classNames ); + jQuery.className[ state ? "add" : "remove" ]( this, classNames ); }, remove: function( selector ) { - if ( !selector || jQuery.filter( selector, [ this ] ).r.length ) { + if ( !selector || jQuery.filter( selector, [ this ] ).length ) { // Prevent memory leaks - jQuery( "*", this ).add(this).each(function(){ + jQuery( "*", this ).add([this]).each(function(){ jQuery.event.remove(this); jQuery.removeData(this); }); @@ -1332,489 +1248,1063 @@ jQuery.each({ }; }); -jQuery.each([ "Height", "Width" ], function(i, name){ - var type = name.toLowerCase(); +// Helper function used by the dimensions and offset modules +function num(elem, prop) { + return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0; +} +var expando = "jQuery" + now(), uuid = 0, windowData = {};
+
+jQuery.extend({
+ cache: {},
+
+ data: function( elem, name, data ) {
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ];
+
+ // Compute a unique ID for the element
+ if ( !id )
+ id = elem[ expando ] = ++uuid;
+
+ // Only generate the data cache if we're
+ // trying to access or manipulate it
+ if ( name && !jQuery.cache[ id ] )
+ jQuery.cache[ id ] = {};
+
+ // Prevent overriding the named cache with undefined values
+ if ( data !== undefined )
+ jQuery.cache[ id ][ name ] = data;
+
+ // Return the named cache data, or the ID for the element
+ return name ?
+ jQuery.cache[ id ][ name ] :
+ id;
+ },
+
+ removeData: function( elem, name ) {
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ];
+
+ // If we want to remove a specific section of the element's data
+ if ( name ) {
+ if ( jQuery.cache[ id ] ) {
+ // Remove the section of cache data
+ delete jQuery.cache[ id ][ name ];
+
+ // If we've removed all the data, remove the element's cache
+ name = "";
+
+ for ( name in jQuery.cache[ id ] )
+ break;
+
+ if ( !name )
+ jQuery.removeData( elem );
+ }
+
+ // Otherwise, we want to remove all of the element's data
+ } else {
+ // Clean up the element expando
+ try {
+ delete elem[ expando ];
+ } catch(e){
+ // IE has trouble directly removing the expando
+ // but it's ok with using removeAttribute
+ if ( elem.removeAttribute )
+ elem.removeAttribute( expando );
+ }
+
+ // Completely remove the data cache
+ delete jQuery.cache[ id ];
+ }
+ },
+ queue: function( elem, type, data ) {
+ if ( elem ){
+
+ type = (type || "fx") + "queue";
+
+ var q = jQuery.data( elem, type );
+
+ if ( !q || jQuery.isArray(data) )
+ q = jQuery.data( elem, type, jQuery.makeArray(data) );
+ else if( data )
+ q.push( data );
+
+ }
+ return q;
+ },
+
+ dequeue: function( elem, type ){
+ var queue = jQuery.queue( elem, type ),
+ fn = queue.shift();
+
+ if( !type || type === "fx" )
+ fn = queue[0];
+
+ if( fn !== undefined )
+ fn.call(elem);
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ){
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ if ( data === undefined && this.length )
+ data = jQuery.data( this[0], key );
+
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+ } else
+ return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
+ jQuery.data( this, key, value );
+ });
+ },
+
+ removeData: function( key ){
+ return this.each(function(){
+ jQuery.removeData( this, key );
+ });
+ },
+ queue: function(type, data){
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined )
+ return jQuery.queue( this[0], type );
+
+ return this.each(function(){
+ var queue = jQuery.queue( this, type, data );
+
+ if( type == "fx" && queue.length == 1 )
+ queue[0].call(this);
+ });
+ },
+ dequeue: function(type){
+ return this.each(function(){
+ jQuery.dequeue( this, type );
+ });
+ }
+});/*! + * Sizzle CSS Selector Engine - v0.9.1 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){ - jQuery.fn[ type ] = function( size ) { - // Get window width or height - return this[0] == window ? - // Opera reports document.body.client[Width/Height] properly in both quirks and standards - jQuery.browser.opera && document.body[ "client" + name ] || +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g, + done = 0, + toString = Object.prototype.toString; - // Safari reports inner[Width/Height] just fine (Mozilla and Opera include scroll bar widths) - jQuery.browser.safari && window[ "inner" + name ] || +var Sizzle = function(selector, context, results, seed) { + results = results || []; + context = context || document; - // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode - document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || document.body[ "client" + name ] : + if ( context.nodeType !== 1 && context.nodeType !== 9 ) + return []; + + if ( !selector || typeof selector !== "string" ) { + return results; + } - // Get document width or height - this[0] == document ? - // Either scroll[Width/Height] or offset[Width/Height], whichever is greater - Math.max( - Math.max(document.body["scroll" + name], document.documentElement["scroll" + name]), - Math.max(document.body["offset" + name], document.documentElement["offset" + name]) - ) : + var parts = [], m, set, checkSet, check, mode, extra, prune = true; + + // Reset the position of the chunker regexp (start from head) + chunker.lastIndex = 0; + + while ( (m = chunker.exec(selector)) !== null ) { + parts.push( m[1] ); + + if ( m[2] ) { + extra = RegExp.rightContext; + break; + } + } - // Get or set width or height on the element - size == undefined ? - // Get width or height on the element - (this.length ? jQuery.css( this[0], type ) : null) : + if ( parts.length > 1 && Expr.match.POS.exec( selector ) ) { + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + var later = "", match; - // Set the width or height on the element (default to pixels if value is unitless) - this.css( type, size.constructor == String ? size : size + "px" ); - }; -}); + // Position selectors must be done after the filter + while ( (match = Expr.match.POS.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.POS, "" ); + } -// Helper function used by the dimensions and offset modules -function num(elem, prop) { - return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0; -}var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ? - "(?:[\\w*_-]|\\\\.)" : - "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)", - quickChild = new RegExp("^>\\s*(" + chars + "+)"), - quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"), - quickClass = new RegExp("^([#.]?)(" + chars + "*)"); + set = Sizzle.filter( later, Sizzle( /\s$/.test(selector) ? selector + "*" : selector, context ) ); + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); -jQuery.extend({ - expr: { - "": function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);}, - "#": function(a,i,m){return a.getAttribute("id")==m[2];}, - ":": { - // Position Checks - lt: function(a,i,m){return i<m[3]-0;}, - gt: function(a,i,m){return i>m[3]-0;}, - nth: function(a,i,m){return m[3]-0==i;}, - eq: function(a,i,m){return m[3]-0==i;}, - first: function(a,i){return i==0;}, - last: function(a,i,m,r){return i==r.length-1;}, - even: function(a,i){return i%2==0;}, - odd: function(a,i){return i%2;}, - - // Child Checks - "first-child": function(a){return a.parentNode.getElementsByTagName("*")[0]==a;}, - "last-child": function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;}, - "only-child": function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling");}, - - // Parent Checks - parent: function(a){return a.firstChild;}, - empty: function(a){return !a.firstChild;}, - - // Text Check - contains: function(a,i,m){return (a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;}, - - // Visibility - visible: function(a){return "hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";}, - hidden: function(a){return "hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";}, - - // Form attributes - enabled: function(a){return !a.disabled;}, - disabled: function(a){return a.disabled;}, - checked: function(a){return a.checked;}, - selected: function(a){return a.selected||jQuery.attr(a,"selected");}, - - // Form elements - text: function(a){return "text"==a.type;}, - radio: function(a){return "radio"==a.type;}, - checkbox: function(a){return "checkbox"==a.type;}, - file: function(a){return "file"==a.type;}, - password: function(a){return "password"==a.type;}, - submit: function(a){return "submit"==a.type;}, - image: function(a){return "image"==a.type;}, - reset: function(a){return "reset"==a.type;}, - button: function(a){return "button"==a.type||jQuery.nodeName(a,"button");}, - input: function(a){return /input|select|textarea|button/i.test(a.nodeName);}, - - // :has() - has: function(a,i,m){return jQuery.find(m[3],a).length;}, - - // :header - header: function(a){return /h\d/i.test(a.nodeName);}, - - // :animated - animated: function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;} - } - }, - - // The regular expressions that power the parsing engine - parse: [ - // Match: [@value='test'], [@foo] - /^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/, - - // Match: :contains('foo') - /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/, - - // Match: :even, :last-child, #id, .class - new RegExp("^([:.#]*)(" + chars + "+)") - ], - - multiFilter: function( expr, elems, not ) { - var old, cur = []; - - while ( expr && expr != old ) { - old = expr; - var f = jQuery.filter( expr, elems, not ); - expr = f.t.replace(/^\s*,\s*/, "" ); - cur = not ? elems = f.r : jQuery.merge( cur, f.r ); - } - - return cur; - }, - - find: function( t, context ) { - // Quickly handle non-string expressions - if ( typeof t != "string" ) - return [ t ]; - - // check to make sure context is a DOM element or a document - if ( context && context.nodeType != 1 && context.nodeType != 9) - return [ ]; - - // Set the correct context (if none is provided) - context = context || document; + while ( parts.length ) { + var tmpSet = []; - // Initialize the search - var ret = [context], done = [], last, nodeName; + selector = parts.shift(); + if ( Expr.relative[ selector ] ) + selector += parts.shift(); - // Continue while a selector expression exists, and while - // we're no longer looping upon ourselves - while ( t && last != t ) { - var r = []; - last = t; + for ( var i = 0, l = set.length; i < l; i++ ) { + Sizzle( selector, set[i], tmpSet ); + } - t = jQuery.trim(t); + set = tmpSet; + } + } + } else { + var ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context ); + set = Sizzle.filter( ret.expr, ret.set ); + + if ( parts.length > 0 ) { + checkSet = makeArray(set); + } else { + prune = false; + } - var foundToken = false, + while ( parts.length ) { + var cur = parts.pop(), pop = cur; - // An attempt at speeding up child selectors that - // point to a specific element tag - re = quickChild, + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } - m = re.exec(t); + if ( pop == null ) { + pop = context; + } - if ( m ) { - nodeName = m[1].toUpperCase(); + Expr.relative[ cur ]( checkSet, pop, isXML(context) ); + } + } - // Perform our own iteration and filter - for ( var i = 0; ret[i]; i++ ) - for ( var c = ret[i].firstChild; c; c = c.nextSibling ) - if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName) ) - r.push( c ); + if ( !checkSet ) { + checkSet = set; + } - ret = r; - t = t.replace( re, "" ); - if ( t.indexOf(" ") == 0 ) continue; - foundToken = true; - } else { - re = /^([>+~])\s*(\w*)/i; + if ( !checkSet ) { + throw "Syntax error, unrecognized expression: " + (cur || selector); + } - if ( (m = re.exec(t)) != null ) { - r = []; + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + } else if ( context.nodeType === 1 ) { + for ( var i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + } else { + for ( var i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + } else { + makeArray( checkSet, results ); + } - var merge = {}; - nodeName = m[2].toUpperCase(); - m = m[1]; + if ( extra ) { + Sizzle( extra, context, results, seed ); + } - for ( var j = 0, rl = ret.length; j < rl; j++ ) { - var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild; - for ( ; n; n = n.nextSibling ) - if ( n.nodeType == 1 ) { - var id = jQuery.data(n); + return results; +}; - if ( m == "~" && merge[id] ) break; +Sizzle.matches = function(expr, set){ + return Sizzle(expr, null, null, set); +}; - if (!nodeName || n.nodeName.toUpperCase() == nodeName ) { - if ( m == "~" ) merge[id] = true; - r.push( n ); - } +Sizzle.find = function(expr, context){ + var set, match; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var type = Expr.order[i], match; + + if ( (match = Expr.match[ type ].exec( expr )) ) { + var left = RegExp.leftContext; + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace(/\\/g, ""); + set = Expr.find[ type ]( match, context ); + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = context.getElementsByTagName("*"); + } + + return {set: set, expr: expr}; +}; + +Sizzle.filter = function(expr, set, inplace, not){ + var old = expr, result = [], curLoop = set, match, anyFound; + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.match[ type ].exec( expr )) != null ) { + var filter = Expr.filter[ type ], goodArray = null, goodPos = 0, found, item; + anyFound = false; + + if ( curLoop == result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not ); + + if ( !match ) { + anyFound = found = true; + } else if ( match === true ) { + continue; + } else if ( match[0] === true ) { + goodArray = []; + var last = null, elem; + for ( var i = 0; (elem = curLoop[i]) !== undefined; i++ ) { + if ( elem && last !== elem ) { + goodArray.push( elem ); + last = elem; + } + } + } + } - if ( m == "+" ) break; + if ( match ) { + for ( var i = 0; (item = curLoop[i]) !== undefined; i++ ) { + if ( item ) { + if ( goodArray && item != goodArray[goodPos] ) { + goodPos++; + } + + found = filter( item, match, goodPos, goodArray ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + } else { + curLoop[i] = false; + } + } else if ( pass ) { + result.push( item ); + anyFound = true; } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; } - ret = r; + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } - // And remove the token - t = jQuery.trim( t.replace( re, "" ) ); - foundToken = true; + break; } } + } - // See if there's still an expression, and that we haven't already - // matched a token - if ( t && !foundToken ) { - // Handle multiple expressions - if ( !t.indexOf(",") ) { - // Clean the result set - if ( context == ret[0] ) ret.shift(); - - // Merge the result sets - done = jQuery.merge( done, ret ); + expr = expr.replace(/\s*,\s*/, ""); - // Reset the context - r = ret = [context]; + // Improper expression + if ( expr == old ) { + if ( anyFound == null ) { + throw "Syntax error, unrecognized expression: " + expr; + } else { + break; + } + } - // Touch up the selector string - t = " " + t.substr(1,t.length); + old = expr; + } - } else { - // Optimize for the case nodeName#idName - var re2 = quickID; - var m = re2.exec(t); + return curLoop; +}; - // Re-organize the results, so that they're consistent - if ( m ) { - m = [ 0, m[2], m[3], m[1] ]; +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + match: { + ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/ + }, + attrMap: { + "class": "className", + "for": "htmlFor" + }, + attrHandle: { + href: function(elem){ + return elem.getAttribute("href"); + } + }, + relative: { + "+": function(checkSet, part){ + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + var cur = elem.previousSibling; + while ( cur && cur.nodeType !== 1 ) { + cur = cur.previousSibling; + } + checkSet[i] = typeof part === "string" ? + cur || false : + cur === part; + } + } - } else { - // Otherwise, do a traditional filter check for - // ID, class, and element selectors - re2 = quickClass; - m = re2.exec(t); + if ( typeof part === "string" ) { + Sizzle.filter( part, checkSet, true ); + } + }, + ">": function(checkSet, part, isXML){ + if ( typeof part === "string" && !/\W/.test(part) ) { + part = isXML ? part : part.toUpperCase(); + + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName === part ? parent : false; } + } + } else { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + checkSet[i] = typeof part === "string" ? + elem.parentNode : + elem.parentNode === part; + } + } - m[2] = m[2].replace(/\\/g, ""); + if ( typeof part === "string" ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + "": function(checkSet, part, isXML){ + var doneName = "done" + (done++), checkFn = dirCheck; - var elem = ret[ret.length-1]; + if ( !part.match(/\W/) ) { + var nodeCheck = part = isXML ? part : part.toUpperCase(); + checkFn = dirNodeCheck; + } - // Try to do a global search by ID, where we can - if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) { - // Optimization for HTML document case - var oid = elem.getElementById(m[2]); + checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); + }, + "~": function(checkSet, part, isXML){ + var doneName = "done" + (done++), checkFn = dirCheck; - // Do a quick check for the existence of the actual ID attribute - // to avoid selecting by the name attribute in IE - // also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form - if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] ) - oid = jQuery('[@id="'+m[2]+'"]', elem)[0]; + if ( typeof part === "string" && !part.match(/\W/) ) { + var nodeCheck = part = isXML ? part : part.toUpperCase(); + checkFn = dirNodeCheck; + } - // Do a quick check for node name (where applicable) so - // that div#foo searches will be really fast - ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : []; - } else { - // We need to find all descendant elements - for ( var i = 0; ret[i]; i++ ) { - // Grab the tag name being searched for - var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2]; + checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); + } + }, + find: { + ID: function(match, context){ + if ( context.getElementById ) { + var m = context.getElementById(match[1]); + return m ? [m] : []; + } + }, + NAME: function(match, context){ + return context.getElementsByName ? context.getElementsByName(match[1]) : null; + }, + TAG: function(match, context){ + return context.getElementsByTagName(match[1]); + } + }, + preFilter: { + CLASS: function(match, curLoop, inplace, result, not){ + match = " " + match[1].replace(/\\/g, "") + " "; + + for ( var i = 0; curLoop[i]; i++ ) { + if ( not ^ (" " + curLoop[i].className + " ").indexOf(match) >= 0 ) { + if ( !inplace ) + result.push( curLoop[i] ); + } else if ( inplace ) { + curLoop[i] = false; + } + } - // Handle IE7 being really dumb about <object>s - if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" ) - tag = "param"; + return false; + }, + ID: function(match){ + return match[1].replace(/\\/g, ""); + }, + TAG: function(match, curLoop){ + for ( var i = 0; !curLoop[i]; i++ ){} + return isXML(curLoop[i]) ? match[1] : match[1].toUpperCase(); + }, + CHILD: function(match){ + if ( match[1] == "nth" ) { + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( + match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } - r = jQuery.merge( r, ret[i].getElementsByTagName( tag )); - } + // TODO: Move to normal caching system + match[0] = "done" + (done++); - // It's faster to filter by class and be done with it - if ( m[1] == "." ) - r = jQuery.classFilter( r, m[2] ); + return match; + }, + ATTR: function(match){ + var name = match[1]; + + if ( Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } - // Same with ID filtering - if ( m[1] == "#" ) { - var tmp = []; + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } - // Try to find the element with the ID - for ( var i = 0; r[i]; i++ ) - if ( r[i].getAttribute("id") == m[2] ) { - tmp = [ r[i] ]; - break; - } + return match; + }, + PSEUDO: function(match, curLoop, inplace, result, not){ + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( match[3].match(chunker).length > 1 ) { + match[3] = Sizzle(match[3], null, null, curLoop); + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + if ( !inplace ) { + result.push.apply( result, ret ); + } + return false; + } + } else if ( Expr.match.POS.test( match[0] ) ) { + return true; + } + + return match; + }, + POS: function(match){ + match.unshift( true ); + return match; + } + }, + filters: { + enabled: function(elem){ + return elem.disabled === false && elem.type !== "hidden"; + }, + disabled: function(elem){ + return elem.disabled === true; + }, + checked: function(elem){ + return elem.checked === true; + }, + selected: function(elem){ + // Accessing this property makes selected-by-default + // options in Safari work properly + elem.parentNode.selectedIndex; + return elem.selected === true; + }, + parent: function(elem){ + return !!elem.firstChild; + }, + empty: function(elem){ + return !elem.firstChild; + }, + has: function(elem, i, match){ + return !!Sizzle( match[3], elem ).length; + }, + header: function(elem){ + return /h\d/i.test( elem.nodeName ); + }, + text: function(elem){ + return "text" === elem.type; + }, + radio: function(elem){ + return "radio" === elem.type; + }, + checkbox: function(elem){ + return "checkbox" === elem.type; + }, + file: function(elem){ + return "file" === elem.type; + }, + password: function(elem){ + return "password" === elem.type; + }, + submit: function(elem){ + return "submit" === elem.type; + }, + image: function(elem){ + return "image" === elem.type; + }, + reset: function(elem){ + return "reset" === elem.type; + }, + button: function(elem){ + return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON"; + }, + input: function(elem){ + return /input|select|textarea|button/i.test(elem.nodeName); + } + }, + setFilters: { + first: function(elem, i){ + return i === 0; + }, + last: function(elem, i, match, array){ + return i === array.length - 1; + }, + even: function(elem, i){ + return i % 2 === 0; + }, + odd: function(elem, i){ + return i % 2 === 1; + }, + lt: function(elem, i, match){ + return i < match[3] - 0; + }, + gt: function(elem, i, match){ + return i > match[3] - 0; + }, + nth: function(elem, i, match){ + return match[3] - 0 == i; + }, + eq: function(elem, i, match){ + return match[3] - 0 == i; + } + }, + filter: { + CHILD: function(elem, match){ + var type = match[1], parent = elem.parentNode; - r = tmp; - } + var doneName = "child" + parent.childNodes.length; + + if ( parent && (!parent[ doneName ] || !elem.nodeIndex) ) { + var count = 1; + + for ( var node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType == 1 ) { + node.nodeIndex = count++; + } + } + + parent[ doneName ] = count - 1; + } + + if ( type == "first" ) { + return elem.nodeIndex == 1; + } else if ( type == "last" ) { + return elem.nodeIndex == parent[ doneName ]; + } else if ( type == "only" ) { + return parent[ doneName ] == 1; + } else if ( type == "nth" ) { + var add = false, first = match[2], last = match[3]; + + if ( first == 1 && last == 0 ) { + return true; + } - ret = r; + if ( first == 0 ) { + if ( elem.nodeIndex == last ) { + add = true; } + } else if ( (elem.nodeIndex - last) % first == 0 && (elem.nodeIndex - last) / first >= 0 ) { + add = true; + } - t = t.replace( re2, "" ); + return add; + } + }, + PSEUDO: function(elem, match, i, array){ + var name = match[1], filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0; + } else if ( name === "not" ) { + var not = match[3]; + + for ( var i = 0, l = not.length; i < l; i++ ) { + if ( not[i] === elem ) { + return false; + } } + return true; } + }, + ID: function(elem, match){ + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + TAG: function(elem, match){ + return (match === "*" && elem.nodeType === 1) || elem.nodeName === match; + }, + CLASS: function(elem, match){ + return match.test( elem.className ); + }, + ATTR: function(elem, match){ + var result = Expr.attrHandle[ match[1] ] ? Expr.attrHandle[ match[1] ]( elem ) : elem[ match[1] ] || elem.getAttribute( match[1] ), value = result + "", type = match[2], check = match[4]; + return result == null ? + false : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !match[4] ? + result : + type === "!=" ? + value != check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + POS: function(elem, match, i, array){ + var name = match[2], filter = Expr.setFilters[ name ]; - // If a selector string still exists - if ( t ) { - // Attempt to filter it - var val = jQuery.filter(t,r); - ret = r = val.r; - t = jQuery.trim(val.t); + if ( filter ) { + return filter( elem, i, match, array ); } } + } +}; - // An error occurred with the selector; - // just return an empty set instead - if ( t ) - ret = []; +for ( var type in Expr.match ) { + Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); +} - // Remove the root context - if ( ret && context == ret[0] ) - ret.shift(); +var makeArray = function(array, results) { + array = Array.prototype.slice.call( array ); - // And combine the results - done = jQuery.merge( done, ret ); + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; - return done; - }, +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +try { + Array.prototype.slice.call( document.documentElement.childNodes ); + +// Provide a fallback method if it does not work +} catch(e){ + makeArray = function(array, results) { + var ret = results || []; - classFilter: function(r,m,not){ - m = " " + m + " "; - var tmp = []; - for ( var i = 0; r[i]; i++ ) { - var pass = (" " + r[i].className + " ").indexOf( m ) >= 0; - if ( !not && pass || not && !pass ) - tmp.push( r[i] ); + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + } else { + if ( typeof array.length === "number" ) { + for ( var i = 0, l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + } else { + for ( var i = 0; array[i]; i++ ) { + ret.push( array[i] ); + } + } } - return tmp; - }, - filter: function(t,r,not) { - var last; + return ret; + }; +} + +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + var form = document.createElement("form"), + id = "script" + (new Date).getTime(); + form.innerHTML = "<input name='" + id + "'/>"; + + // Inject it into the root element, check its status, and remove it quickly + var root = document.documentElement; + root.insertBefore( form, root.firstChild ); + + // The workaround has to do additional checks after a getElementById + // Which slows things down for other browsers (hence the branching) + if ( !!document.getElementById( id ) ) { + Expr.find.ID = function(match, context){ + if ( context.getElementById ) { + var m = context.getElementById(match[1]); + return m ? m.id === match[1] || m.getAttributeNode && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; + } + }; - // Look for common filter expressions - while ( t && t != last ) { - last = t; + Expr.filter.ID = function(elem, match){ + var node = elem.getAttributeNode && elem.getAttributeNode("id"); + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + } - var p = jQuery.parse, m; + root.removeChild( form ); +})(); - for ( var i = 0; p[i]; i++ ) { - m = p[i].exec( t ); +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") - if ( m ) { - // Remove what we just matched - t = t.substring( m[0].length ); + // Create a fake element + var div = document.createElement("div"); + div.appendChild( document.createComment("") ); - m[2] = m[2].replace(/\\/g, ""); - break; + // Make sure no comments are found + if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function(match, context){ + var results = context.getElementsByTagName(match[1]); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } } + + results = tmp; } - if ( !m ) - break; + return results; + }; + } - // :not() is a special case that can be optimized by - // keeping it out of the expression list - if ( m[1] == ":" && m[2] == "not" ) - // optimize if only one selector found (most common case) - r = isSimple.test( m[3] ) ? - jQuery.filter(m[3], r, true).r : - jQuery( r ).not( m[3] ); - - // We can get a big speed boost by filtering by class here - else if ( m[1] == "." ) - r = jQuery.classFilter(r, m[2], not); - - else if ( m[1] == "[" ) { - var tmp = [], type = m[3]; - - for ( var i = 0, rl = r.length; i < rl; i++ ) { - var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ]; - - if ( z == null || /href|src|selected/.test(m[2]) ) - z = jQuery.attr(a,m[2]) || ''; - - if ( (type == "" && !!z || - type == "=" && z == m[5] || - type == "!=" && z != m[5] || - type == "^=" && z && !z.indexOf(m[5]) || - type == "$=" && z.substr(z.length - m[5].length) == m[5] || - (type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not ) - tmp.push( a ); - } + // Check to see if an attribute returns normalized href attributes + div.innerHTML = "<a href='#'></a>"; + if ( div.firstChild.getAttribute("href") !== "#" ) { + Expr.attrHandle.href = function(elem){ + return elem.getAttribute("href", 2); + }; + } +})(); - r = tmp; +if ( document.querySelectorAll ) (function(){ + var oldSizzle = Sizzle; + + Sizzle = function(query, context, extra, seed){ + context = context || document; - // We can get a speed boost by handling nth-child here - } else if ( m[1] == ":" && m[2] == "nth-child" ) { - var merge = {}, tmp = [], - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( - m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" || - !/\D/.test(m[3]) && "0n+" + m[3] || m[3]), - // calculate the numbers (first)n+(last) including if they are negative - first = (test[1] + (test[2] || 1)) - 0, last = test[3] - 0; + if ( !seed && context.nodeType === 9 ) { + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(e){} + } + + return oldSizzle(query, context, extra, seed); + }; - // loop through all the elements left in the jQuery object - for ( var i = 0, rl = r.length; i < rl; i++ ) { - var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode); + Sizzle.find = oldSizzle.find; + Sizzle.filter = oldSizzle.filter; + Sizzle.selectors = oldSizzle.selectors; + Sizzle.matches = oldSizzle.matches; +})(); - if ( !merge[id] ) { - var c = 1; +if ( document.documentElement.getElementsByClassName ) { + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function(match, context) { + return context.getElementsByClassName(match[1]); + }; +} - for ( var n = parentNode.firstChild; n; n = n.nextSibling ) - if ( n.nodeType == 1 ) - n.nodeIndex = c++; +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + elem = elem[dir]; + var match = false; + + while ( elem && elem.nodeType ) { + var done = elem[doneName]; + if ( done ) { + match = checkSet[ done ]; + break; + } - merge[id] = true; - } + if ( elem.nodeType === 1 && !isXML ) + elem[doneName] = i; - var add = false; + if ( elem.nodeName === cur ) { + match = elem; + break; + } - if ( first == 0 ) { - if ( node.nodeIndex == last ) - add = true; - } else if ( (node.nodeIndex - last) % first == 0 && (node.nodeIndex - last) / first >= 0 ) - add = true; + elem = elem[dir]; + } - if ( add ^ not ) - tmp.push( node ); + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + if ( elem ) { + elem = elem[dir]; + var match = false; + + while ( elem && elem.nodeType ) { + if ( elem[doneName] ) { + match = checkSet[ elem[doneName] ]; + break; } - r = tmp; + if ( elem.nodeType === 1 ) { + if ( !isXML ) + elem[doneName] = i; - // Otherwise, find the expression to execute - } else { - var fn = jQuery.expr[ m[1] ]; - if ( typeof fn == "object" ) - fn = fn[ m[2] ]; + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } - if ( typeof fn == "string" ) - fn = eval("false||function(a,i){return " + fn + ";}"); + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } - // Execute it against the current filter - r = jQuery.grep( r, function(elem, i){ - return fn(elem, i, m, r); - }, not ); + elem = elem[dir]; } + + checkSet[i] = match; } + } +} - // Return an array of filtered elements (r) - // and the modified expression string (t) - return { r: r, t: t }; - }, +var contains = document.compareDocumentPosition ? function(a, b){ + return a.compareDocumentPosition(b) & 16; +} : function(a, b){ + return a !== b && (a.contains ? a.contains(b) : true); +}; - dir: function( elem, dir ){ - var matched = [], - cur = elem[dir]; - while ( cur && cur != document ) { - if ( cur.nodeType == 1 ) - matched.push( cur ); - cur = cur[dir]; - } - return matched; - }, +var isXML = function(elem){ + return elem.documentElement && !elem.body || + elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; +}; - nth: function(cur,result,dir,elem){ - result = result || 1; - var num = 0; +// EXPOSE +jQuery.find = Sizzle; +jQuery.filter = Sizzle.filter; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; - for ( ; cur; cur = cur[dir] ) - if ( cur.nodeType == 1 && ++num == result ) - break; +Sizzle.selectors.filters.hidden = function(elem){ + return "hidden" === elem.type || + jQuery.css(elem, "display") === "none" || + jQuery.css(elem, "visibility") === "hidden"; +}; - return cur; - }, +Sizzle.selectors.filters.visible = function(elem){ + return "hidden" !== elem.type && + jQuery.css(elem, "display") !== "none" && + jQuery.css(elem, "visibility") !== "hidden"; +}; - sibling: function( n, elem ) { - var r = []; +Sizzle.selectors.filters.animated = function(elem){ + return jQuery.grep(jQuery.timers, function(fn){ + return elem === fn.elem; + }).length; +}; - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType == 1 && n != elem ) - r.push( n ); - } +jQuery.multiFilter = function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return Sizzle.matches(expr, elems); +}; - return r; +jQuery.dir = function( elem, dir ){ + var matched = [], cur = elem[dir]; + while ( cur && cur != document ) { + if ( cur.nodeType == 1 ) + matched.push( cur ); + cur = cur[dir]; } -}); + return matched; +}; + +jQuery.nth = function(cur, result, dir, elem){ + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) + if ( cur.nodeType == 1 && ++num == result ) + break; + + return cur; +}; + +jQuery.sibling = function(n, elem){ + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType == 1 && n != elem ) + r.push( n ); + } + + return r; +}; + +return; + +window.Sizzle = Sizzle; + +})(); /* * A number of helper functions used for managing events. - * Many of the ideas behind this code orignated from + * Many of the ideas behind this code originated from * Dean Edwards' addEvent library. */ jQuery.event = { @@ -1827,7 +2317,7 @@ jQuery.event = { // For whatever reason, IE has trouble passing the window object // around, causing it to be cloned in the process - if ( jQuery.browser.msie && elem.setInterval ) + if ( elem.setInterval && elem != window ) elem = window; // Make sure that the function being executed has a unique ID @@ -1835,15 +2325,12 @@ jQuery.event = { handler.guid = this.guid++; // if data is passed, bind to handler - if( data != undefined ) { + if ( data !== undefined ) { // Create temporary function pointer to original handler var fn = handler; // Create unique handler function, wrapped around original handler - handler = this.proxy( fn, function() { - // Pass arguments and context to original handler - return fn.apply(this, arguments); - }); + handler = this.proxy( fn ); // Store data in unique handler handler.data = data; @@ -1854,8 +2341,9 @@ jQuery.event = { handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){ // Handle the second event of a trigger and when // an event is called after a page has unloaded - if ( typeof jQuery != "undefined" && !jQuery.event.triggered ) - return jQuery.event.handle.apply(arguments.callee.elem, arguments); + return typeof jQuery !== "undefined" && !jQuery.event.triggered ? + jQuery.event.handle.apply(arguments.callee.elem, arguments) : + undefined; }); // Add elem as a property of the handle function // This is to prevent a memory leak with non-native @@ -1866,12 +2354,15 @@ jQuery.event = { // jQuery(...).bind("mouseover mouseout", fn); jQuery.each(types.split(/\s+/), function(index, type) { // Namespaced event handlers - var parts = type.split("."); - type = parts[0]; - handler.type = parts[1]; + var namespaces = type.split("."); + type = namespaces.shift(); + handler.type = namespaces.slice().sort().join("."); // Get the current list of functions bound to this event var handlers = events[type]; + + if ( jQuery.event.specialAll[type] ) + jQuery.event.specialAll[type].setup.call(elem, data, namespaces); // Init the event handler queue if (!handlers) { @@ -1880,7 +2371,7 @@ jQuery.event = { // Check for a special event handler // Only use addEventListener/attachEvent if the special // events handler returns false - if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem) === false ) { + if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) { // Bind the global event handler to the element if (elem.addEventListener) elem.addEventListener(type, handle, false); @@ -1913,7 +2404,7 @@ jQuery.event = { if ( events ) { // Unbind all events for the element - if ( types == undefined || (typeof types == "string" && types.charAt(0) == ".") ) + if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") ) for ( var type in events ) this.remove( elem, type + (types || "") ); else { @@ -1927,8 +2418,9 @@ jQuery.event = { // jQuery(...).unbind("mouseover mouseout", fn); jQuery.each(types.split(/\s+/), function(index, type){ // Namespaced event handlers - var parts = type.split("."); - type = parts[0]; + var namespaces = type.split("."); + type = namespaces.shift(); + var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); if ( events[type] ) { // remove the given handler for the given type @@ -1937,15 +2429,18 @@ jQuery.event = { // remove all handlers for the given type else - for ( handler in events[type] ) + for ( var handle in events[type] ) // Handle the removal of namespaced events - if ( !parts[1] || events[type][handler].type == parts[1] ) - delete events[type][handler]; + if ( namespace.test(events[type][handle].type) ) + delete events[type][handle]; + + if ( jQuery.event.specialAll[type] ) + jQuery.event.specialAll[type].teardown.call(elem, namespaces); // remove generic event handler if no more handlers exist for ( ret in events[type] ) break; if ( !ret ) { - if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem) === false ) { + if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) { if (elem.removeEventListener) elem.removeEventListener(type, jQuery.data(elem, "handle"), false); else if (elem.detachEvent) @@ -1969,97 +2464,95 @@ jQuery.event = { } }, - trigger: function(type, data, elem, donative, extra) { - // Clone the incoming data, if any - data = jQuery.makeArray(data); + // bubbling is internal + trigger: function( event, data, elem, bubbling ) { + // Event object or event type + var type = event.type || event; + + if( !bubbling ){ + event = typeof event === "object" ? + // jQuery.Event object + event[expando] ? event : + // Object literal + jQuery.extend( jQuery.Event(type), event ) : + // Just the event type (string) + jQuery.Event(type); + + if ( type.indexOf("!") >= 0 ) { + event.type = type = type.slice(0, -1); + event.exclusive = true; + } - if ( type.indexOf("!") >= 0 ) { - type = type.slice(0, -1); - var exclusive = true; - } + // Handle a global trigger + if ( !elem ) { + // Don't bubble custom events when global (to avoid too much overhead) + event.stopPropagation(); + // Only trigger if we've ever bound an event for it + if ( this.global[type] ) + jQuery.each( jQuery.cache, function(){ + if ( this.events && this.events[type] ) + jQuery.event.trigger( event, data, this.handle.elem ); + }); + } - // Handle a global trigger - if ( !elem ) { - // Only trigger if we've ever bound an event for it - if ( this.global[type] ) - jQuery("*").add([window, document]).trigger(type, data); + // Handle triggering a single element - // Handle triggering a single element - } else { // don't do events on text and comment nodes - if ( elem.nodeType == 3 || elem.nodeType == 8 ) + if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 ) return undefined; + + // Clean up in case it is reused + event.result = undefined; + event.target = elem; + + // Clone the incoming data, if any + data = jQuery.makeArray(data); + data.unshift( event ); + } - var val, ret, fn = jQuery.isFunction( elem[ type ] || null ), - // Check to see if we need to provide a fake event, or not - event = !data[0] || !data[0].preventDefault; - - // Pass along a fake event - if ( event ) { - data.unshift({ - type: type, - target: elem, - preventDefault: function(){}, - stopPropagation: function(){}, - timeStamp: now() - }); - data[0][expando] = true; // no need to fix fake event - } + event.currentTarget = elem; - // Enforce the right trigger type - data[0].type = type; - if ( exclusive ) - data[0].exclusive = true; - - // Trigger the event, it is assumed that "handle" is a function - var handle = jQuery.data(elem, "handle"); - if ( handle ) - val = handle.apply( elem, data ); - - // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links) - if ( (!fn || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false ) - val = false; - - // Extra functions don't get the custom event object - if ( event ) - data.shift(); - - // Handle triggering of extra function - if ( extra && jQuery.isFunction( extra ) ) { - // call the extra function and tack the current return value on the end for possible inspection - ret = extra.apply( elem, val == null ? data : data.concat( val ) ); - // if anything is returned, give it precedence and have it overwrite the previous value - if (ret !== undefined) - val = ret; - } + // Trigger the event, it is assumed that "handle" is a function + var handle = jQuery.data(elem, "handle"); + if ( handle ) + handle.apply( elem, data ); - // Trigger the native events (except for clicks on links) - if ( fn && donative !== false && val !== false && !(jQuery.nodeName(elem, 'a') && type == "click") ) { - this.triggered = true; - try { - elem[ type ](); - // prevent IE from throwing an error for some hidden elements - } catch (e) {} - } + // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links) + if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false ) + event.result = false; - this.triggered = false; + // Trigger the native events (except for clicks on links) + if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) { + this.triggered = true; + try { + elem[ type ](); + // prevent IE from throwing an error for some hidden elements + } catch (e) {} } - return val; + this.triggered = false; + + if ( !event.isPropagationStopped() ) { + var parent = elem.parentNode || elem.ownerDocument; + if ( parent ) + jQuery.event.trigger(event, data, parent, true); + } }, handle: function(event) { // returned undefined or false - var val, ret, namespace, all, handlers; + var all, handlers; event = arguments[0] = jQuery.event.fix( event || window.event ); // Namespaced event handlers - namespace = event.type.split("."); - event.type = namespace[0]; - namespace = namespace[1]; + var namespaces = event.type.split("."); + event.type = namespaces.shift(); + // Cache this now, all = true means, any handler - all = !namespace && !event.exclusive; + all = !namespaces.length && !event.exclusive; + + var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)"); handlers = ( jQuery.data(this, "events") || {} )[event.type]; @@ -2067,61 +2560,44 @@ jQuery.event = { var handler = handlers[j]; // Filter the functions by class - if ( all || handler.type == namespace ) { + if ( all || namespace.test(handler.type) ) { // Pass in a reference to the handler function itself // So that we can later remove it event.handler = handler; event.data = handler.data; - ret = handler.apply( this, arguments ); + var ret = handler.apply(this, arguments); - if ( val !== false ) - val = ret; - - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); + if( ret !== undefined ){ + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } } + + if( event.isImmediatePropagationStopped() ) + break; + } } - - return val; }, + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), + fix: function(event) { - if ( event[expando] == true ) + if ( event[expando] ) return event; // store a copy of the original event object // and "clone" to set read-only properties var originalEvent = event; - event = { originalEvent: originalEvent }; - var props = "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" "); - for ( var i=props.length; i; i-- ) - event[ props[i] ] = originalEvent[ props[i] ]; - - // Mark it as fixed - event[expando] = true; - - // add preventDefault and stopPropagation since - // they will not work on the clone - event.preventDefault = function() { - // if preventDefault exists run it on the original event - if (originalEvent.preventDefault) - originalEvent.preventDefault(); - // otherwise set the returnValue property of the original event to false (IE) - originalEvent.returnValue = false; - }; - event.stopPropagation = function() { - // if stopPropagation exists run it on the original event - if (originalEvent.stopPropagation) - originalEvent.stopPropagation(); - // otherwise set the cancelBubble property of the original event to true (IE) - originalEvent.cancelBubble = true; - }; + event = jQuery.Event( originalEvent ); - // Fix timeStamp - event.timeStamp = event.timeStamp || now(); + for ( var i = this.props.length, prop; i; ){ + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } // Fix target property, if necessary if ( !event.target ) @@ -2159,6 +2635,7 @@ jQuery.event = { }, proxy: function( fn, proxy ){ + proxy = proxy || function(){ return fn.apply(this, arguments); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++; // So proxy can be declared as an argument @@ -2167,60 +2644,128 @@ jQuery.event = { special: { ready: { - setup: function() { - // Make sure the ready event is setup - bindReady(); - return; - }, - - teardown: function() { return; } - }, - - mouseenter: { - setup: function() { - if ( jQuery.browser.msie ) return false; - jQuery(this).bind("mouseover", jQuery.event.special.mouseenter.handler); - return true; + // Make sure the ready event is setup + setup: bindReady, + teardown: function() {} + } + }, + + specialAll: { + live: { + setup: function( selector, namespaces ){ + jQuery.event.add( this, namespaces[0], liveHandler ); }, + teardown: function( namespaces ){ + if ( namespaces.length ) { + var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)"); + + jQuery.each( (jQuery.data(this, "events").live || {}), function(){ + if ( name.test(this.type) ) + remove++; + }); + + if ( remove < 1 ) + jQuery.event.remove( this, namespaces[0], liveHandler ); + } + } + } + } +}; - teardown: function() { - if ( jQuery.browser.msie ) return false; - jQuery(this).unbind("mouseover", jQuery.event.special.mouseenter.handler); - return true; - }, +jQuery.Event = function( src ){ + // Allow instantiation without the 'new' keyword + if( !this.preventDefault ) + return new jQuery.Event(src); + + // Event object + if( src && src.type ){ + this.originalEvent = src; + this.type = src.type; + this.timeStamp = src.timeStamp; + // Event type + }else + this.type = src; + + if( !this.timeStamp ) + this.timeStamp = now(); + + // Mark it as fixed + this[expando] = true; +}; - handler: function(event) { - // If we actually just moused on to a sub-element, ignore it - if ( withinElement(event, this) ) return true; - // Execute the right handlers by setting the event type to mouseenter - event.type = "mouseenter"; - return jQuery.event.handle.apply(this, arguments); - } - }, +function returnFalse(){ + return false; +} +function returnTrue(){ + return true; +} - mouseleave: { - setup: function() { - if ( jQuery.browser.msie ) return false; - jQuery(this).bind("mouseout", jQuery.event.special.mouseleave.handler); - return true; - }, +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; - teardown: function() { - if ( jQuery.browser.msie ) return false; - jQuery(this).unbind("mouseout", jQuery.event.special.mouseleave.handler); - return true; - }, + var e = this.originalEvent; + if( !e ) + return; + // if preventDefault exists run it on the original event + if (e.preventDefault) + e.preventDefault(); + // otherwise set the returnValue property of the original event to false (IE) + e.returnValue = false; + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; - handler: function(event) { - // If we actually just moused on to a sub-element, ignore it - if ( withinElement(event, this) ) return true; - // Execute the right handlers by setting the event type to mouseleave - event.type = "mouseleave"; - return jQuery.event.handle.apply(this, arguments); - } - } + var e = this.originalEvent; + if( !e ) + return; + // if stopPropagation exists run it on the original event + if (e.stopPropagation) + e.stopPropagation(); + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation:function(){ + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; +// Checks if an event happened on an element within another element +// Used in jQuery.event.special.mouseenter and mouseleave handlers +var withinElement = function(event) { + // Check if mouse(over|out) are still within the same parent element + var parent = event.relatedTarget; + // Traverse up the tree + while ( parent && parent != this ) + try { parent = parent.parentNode; } + catch(e) { parent = this; } + + if( parent != this ){ + // set the correct event type + event.type = event.data; + // handle event if we actually just moused on to a non sub-element + jQuery.event.handle.apply( this, arguments ); } }; + +jQuery.each({ + mouseover: 'mouseenter', + mouseout: 'mouseleave' +}, function( orig, fix ){ + jQuery.event.special[ fix ] = { + setup: function(){ + jQuery.event.add( this, orig, withinElement, fix ); + }, + teardown: function(){ + jQuery.event.remove( this, orig, withinElement ); + } + }; +}); jQuery.fn.extend({ bind: function( type, data, fn ) { @@ -2245,14 +2790,20 @@ jQuery.fn.extend({ }); }, - trigger: function( type, data, fn ) { + trigger: function( type, data ) { return this.each(function(){ - jQuery.event.trigger( type, data, this, true, fn ); + jQuery.event.trigger( type, data, this ); }); }, - triggerHandler: function( type, data, fn ) { - return this[0] && jQuery.event.trigger( type, data, this[0], false, fn ); + triggerHandler: function( type, data ) { + if( this[0] ){ + var event = jQuery.Event(type); + event.preventDefault(); + event.stopPropagation(); + jQuery.event.trigger( event, data, this[0] ); + return event.result; + } }, toggle: function( fn ) { @@ -2276,7 +2827,7 @@ jQuery.fn.extend({ }, hover: function(fnOver, fnOut) { - return this.bind('mouseenter', fnOver).bind('mouseleave', fnOut); + return this.mouseenter(fnOver).mouseleave(fnOut); }, ready: function(fn) { @@ -2291,12 +2842,52 @@ jQuery.fn.extend({ // Otherwise, remember the function for later else // Add the function to the wait list - jQuery.readyList.push( function() { return fn.call(this, jQuery); } ); + jQuery.readyList.push( fn ); return this; + }, + + live: function( type, fn ){ + var proxy = jQuery.event.proxy( fn ); + proxy.guid += this.selector + type; + + jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy ); + + return this; + }, + + die: function( type, fn ){ + jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null ); + return this; } }); +function liveHandler( event ){ + var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"), + stop = true, + elems = []; + + jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){ + if ( check.test(fn.type) ) { + var elem = jQuery(event.target).closest(fn.data)[0]; + if ( elem ) + elems.push({ elem: elem, fn: fn }); + } + }); + + jQuery.each(elems, function(){ + if ( !event.isImmediatePropagationStopped() && + this.fn.call(this.elem, event, this.fn.data) === false ) + stop = false; + }); + + return stop; +} + +function liveConvert(type, selector){ + return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join("."); +} + jQuery.extend({ isReady: false, readyList: [], @@ -2311,7 +2902,7 @@ jQuery.extend({ if ( jQuery.readyList ) { // Execute all of them jQuery.each( jQuery.readyList, function(){ - this.call( document ); + this.call( document, jQuery ); }); // Reset the list of functions @@ -2330,53 +2921,39 @@ function bindReady(){ if ( readyBound ) return; readyBound = true; - // Mozilla, Opera (see further below for it) and webkit nightlies currently support this event - if ( document.addEventListener && !jQuery.browser.opera) + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { // Use the handy event callback - document.addEventListener( "DOMContentLoaded", jQuery.ready, false ); - - // If IE is used and is not in a frame - // Continually check to see if the document is ready - if ( jQuery.browser.msie && window == top ) (function(){ - if (jQuery.isReady) return; - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch( error ) { - setTimeout( arguments.callee, 0 ); - return; - } - // and execute any waiting functions - jQuery.ready(); - })(); - - if ( jQuery.browser.opera ) - document.addEventListener( "DOMContentLoaded", function () { - if (jQuery.isReady) return; - for (var i = 0; i < document.styleSheets.length; i++) - if (document.styleSheets[i].disabled) { - setTimeout( arguments.callee, 0 ); - return; - } - // and execute any waiting functions + document.addEventListener( "DOMContentLoaded", function(){ + document.removeEventListener( "DOMContentLoaded", arguments.callee, false ); jQuery.ready(); - }, false); - - if ( jQuery.browser.safari ) { - var numStyles; - (function(){ - if (jQuery.isReady) return; - if ( document.readyState != "loaded" && document.readyState != "complete" ) { - setTimeout( arguments.callee, 0 ); - return; + }, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent("onreadystatechange", function(){ + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", arguments.callee ); + jQuery.ready(); } - if ( numStyles === undefined ) - numStyles = jQuery("style, link[rel=stylesheet]").length; - if ( document.styleSheets.length != numStyles ) { + }); + + // If IE and not an iframe + // continually check to see if the document is ready + if ( document.documentElement.doScroll && !window.frameElement ) (function(){ + if ( jQuery.isReady ) return; + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch( error ) { setTimeout( arguments.callee, 0 ); return; } + // and execute any waiting functions jQuery.ready(); })(); @@ -2387,8 +2964,8 @@ function bindReady(){ } jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," + - "mousedown,mouseup,mousemove,mouseover,mouseout,change,select," + - "submit,keydown,keypress,keyup,error").split(","), function(i, name){ + "mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave," + + "change,select,submit,keydown,keypress,keyup,error").split(","), function(i, name){ // Handle event binding jQuery.fn[name] = function(fn){ @@ -2396,29 +2973,134 @@ jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," + }; }); -// Checks if an event happened on an element within another element -// Used in jQuery.event.special.mouseenter and mouseleave handlers -var withinElement = function(event, elem) { - // Check if mouse(over|out) are still within the same parent element - var parent = event.relatedTarget; - // Traverse up the tree - while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; } - // Return true if we actually just moused on to a sub-element - return parent == elem; -}; - // Prevent memory leaks in IE // And prevent errors on refresh with events like mouseover in other browsers // Window isn't included so as not to unbind existing unload events -jQuery(window).bind("unload", function() { - jQuery("*").add(document).unbind(); -}); +jQuery( window ).bind( 'unload', function(){ + for ( var id in jQuery.cache ) + // Skip the window + if ( id != 1 && jQuery.cache[ id ].handle ) + jQuery.event.remove( jQuery.cache[ id ].handle.elem ); +}); +(function(){ + + jQuery.support = {}; + + var root = document.documentElement, + script = document.createElement("script"), + div = document.createElement("div"), + id = "script" + (new Date).getTime(); + + div.style.display = "none"; + div.innerHTML = ' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>'; + + var all = div.getElementsByTagName("*"), + a = div.getElementsByTagName("a")[0]; + + // Can't get basic test support + if ( !all || !all.length || !a ) { + return; + } + + jQuery.support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: div.firstChild.nodeType == 3, + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: !div.getElementsByTagName("tbody").length, + + // Make sure that you can get all elements in an <object> element + // IE 7 always returns no results + objectAll: !!div.getElementsByTagName("object")[0] + .getElementsByTagName("*").length, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: !!div.getElementsByTagName("link").length, + + // Get the style information from getAttribute + // (IE uses .cssText insted) + style: /red/.test( a.getAttribute("style") ), + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: a.getAttribute("href") === "/a", + + // Make sure that element opacity exists + // (IE uses filter instead) + opacity: a.style.opacity === "0.5", + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: !!a.style.cssFloat, + + // Will be defined later + scriptEval: false, + noCloneEvent: true, + boxModel: null + }; + + script.type = "text/javascript"; + try { + script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); + } catch(e){} + + root.insertBefore( script, root.firstChild ); + + // Make sure that the execution of code works by injecting a script + // tag with appendChild/createTextNode + // (IE doesn't support this, fails, and uses .text instead) + if ( window[ id ] ) { + jQuery.support.scriptEval = true; + delete window[ id ]; + } + + root.removeChild( script ); + + if ( div.attachEvent && div.fireEvent ) { + div.attachEvent("onclick", function(){ + // Cloning a node shouldn't copy over any + // bound event handlers (IE does this) + jQuery.support.noCloneEvent = false; + div.detachEvent("onclick", arguments.callee); + }); + div.cloneNode(true).fireEvent("onclick"); + } + + // Figure out if the W3C box model works as expected + // document.body must exist before we can do this + jQuery(function(){ + var div = document.createElement("div"); + div.style.width = "1px"; + div.style.paddingLeft = "1px"; + + document.body.appendChild( div ); + jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; + document.body.removeChild( div ); + }); +})(); + +var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat"; + +jQuery.props = { + "for": "htmlFor", + "class": "className", + "float": styleFloat, + cssFloat: styleFloat, + styleFloat: styleFloat, + readonly: "readOnly", + maxlength: "maxLength", + cellspacing: "cellSpacing", + rowspan: "rowSpan", + tabindex: "tabIndex" +}; jQuery.fn.extend({ // Keep a copy of the old load _load: jQuery.fn.load, load: function( url, params, callback ) { - if ( typeof url != 'string' ) + if ( typeof url !== "string" ) return this._load( url ); var off = url.indexOf(" "); @@ -2427,8 +3109,6 @@ jQuery.fn.extend({ url = url.slice(0, off); } - callback = callback || function(){}; - // Default to a GET request var type = "GET"; @@ -2441,7 +3121,7 @@ jQuery.fn.extend({ params = null; // Otherwise, build a param string - } else { + } else if( typeof params === "object" ) { params = jQuery.param( params ); type = "POST"; } @@ -2471,7 +3151,8 @@ jQuery.fn.extend({ // If not, just inject the full result res.responseText ); - self.each( callback, [res.responseText, status, res] ); + if( callback ) + self.each( callback, [res.responseText, status, res] ); } }); return this; @@ -2482,8 +3163,7 @@ jQuery.fn.extend({ }, serializeArray: function() { return this.map(function(){ - return jQuery.nodeName(this, "form") ? - jQuery.makeArray(this.elements) : this; + return this.elements ? jQuery.makeArray(this.elements) : this; }) .filter(function(){ return this.name && !this.disabled && @@ -2493,7 +3173,7 @@ jQuery.fn.extend({ .map(function(i, elem){ var val = jQuery(this).val(); return val == null ? null : - val.constructor == Array ? + jQuery.isArray(val) ? jQuery.map( val, function(val, i){ return {name: elem.name, value: val}; }) : @@ -2512,6 +3192,7 @@ jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".sp var jsc = now(); jQuery.extend({ + get: function( url, data, callback, type ) { // shift arguments if data argument was ommited if ( jQuery.isFunction( data ) ) { @@ -2559,13 +3240,21 @@ jQuery.extend({ url: location.href, global: true, type: "GET", - timeout: 0, contentType: "application/x-www-form-urlencoded", processData: true, async: true, + /* + timeout: 0, data: null, username: null, password: null, + */ + // Create the request object; Microsoft failed to properly + // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available + // This function can be overriden by calling jQuery.ajaxSetup + xhr:function(){ + return window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); + }, accepts: { xml: "application/xml, text/xml", html: "text/html", @@ -2588,7 +3277,7 @@ jQuery.extend({ type = s.type.toUpperCase(); // convert data if not already a string - if ( s.data && s.processData && typeof s.data != "string" ) + if ( s.data && s.processData && typeof s.data !== "string" ) s.data = jQuery.param(s.data); // Handle JSONP Parameter Callbacks @@ -2651,12 +3340,13 @@ jQuery.extend({ jQuery.event.trigger( "ajaxStart" ); // Matches an absolute URL, and saves the domain - var remote = /^(?:\w+:)?\/\/([^\/?#]+)/; + var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url ); // If we're requesting a remote document // and trying to load JSON or Script with a GET - if ( s.dataType == "script" && type == "GET" - && remote.test(s.url) && remote.exec(s.url)[1] != location.host ){ + if ( s.dataType == "script" && type == "GET" && parts + && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){ + var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.src = s.url; @@ -2687,9 +3377,8 @@ jQuery.extend({ var requestDone = false; - // Create the request object; Microsoft failed to properly - // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available - var xhr = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); + // Create the request object + var xhr = s.xhr(); // Open the socket // Passing null username, generates a login popup on Opera (#2865) @@ -2718,10 +3407,11 @@ jQuery.extend({ s.accepts._default ); } catch(e){} - // Allow custom headers/mimetypes + // Allow custom headers/mimetypes and early abort if ( s.beforeSend && s.beforeSend(xhr, s) === false ) { - // cleanup active request counter - s.global && jQuery.active--; + // Handle the global AJAX counter + if ( s.global && ! --jQuery.active ) + jQuery.event.trigger( "ajaxStop" ); // close opended socket xhr.abort(); return false; @@ -2732,8 +3422,18 @@ jQuery.extend({ // Wait for a response to come back var onreadystatechange = function(isTimeout){ + // The request was aborted, clear the interval and decrement jQuery.active + if (xhr.readyState == 0) { + if (ival) { + // clear poll interval + clearInterval(ival); + ival = null; + // Handle the global AJAX counter + if ( s.global && ! --jQuery.active ) + jQuery.event.trigger( "ajaxStop" ); + } // The transfer is complete and the data is available, or the request timed out - if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) { + } else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) { requestDone = true; // clear poll interval @@ -2742,16 +3442,16 @@ jQuery.extend({ ival = null; } - status = isTimeout == "timeout" && "timeout" || - !jQuery.httpSuccess( xhr ) && "error" || - s.ifModified && jQuery.httpNotModified( xhr, s.url ) && "notmodified" || + status = isTimeout == "timeout" ? "timeout" : + !jQuery.httpSuccess( xhr ) ? "error" : + s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" : "success"; if ( status == "success" ) { // Watch for, and catch, XML document parse errors try { // process the data (runs the xml through httpData regardless of callback) - data = jQuery.httpData( xhr, s.dataType, s.dataFilter ); + data = jQuery.httpData( xhr, s.dataType, s ); } catch(e) { status = "parsererror"; } @@ -2792,11 +3492,12 @@ jQuery.extend({ setTimeout(function(){ // Check to see if the request is still happening if ( xhr ) { - // Cancel the request - xhr.abort(); - if( !requestDone ) onreadystatechange( "timeout" ); + + // Cancel the request + if ( xhr ) + xhr.abort(); } }, s.timeout); } @@ -2857,8 +3558,7 @@ jQuery.extend({ try { // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450 return !xhr.status && location.protocol == "file:" || - ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223 || - jQuery.browser.safari && xhr.status == undefined; + ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223; } catch(e){} return false; }, @@ -2869,13 +3569,12 @@ jQuery.extend({ var xhrRes = xhr.getResponseHeader("Last-Modified"); // Firefox always returns 200. check Last-Modified date - return xhr.status == 304 || xhrRes == jQuery.lastModified[url] || - jQuery.browser.safari && xhr.status == undefined; + return xhr.status == 304 || xhrRes == jQuery.lastModified[url]; } catch(e){} return false; }, - httpData: function( xhr, type, filter ) { + httpData: function( xhr, type, s ) { var ct = xhr.getResponseHeader("content-type"), xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0, data = xml ? xhr.responseXML : xhr.responseText; @@ -2884,31 +3583,40 @@ jQuery.extend({ throw "parsererror"; // Allow a pre-filtering function to sanitize the response - if( filter ) - data = filter( data, type ); + // s != null is checked to keep backwards compatibility + if( s && s.dataFilter ) + data = s.dataFilter( data, type ); - // If the type is "script", eval it in global context - if ( type == "script" ) - jQuery.globalEval( data ); + // The filter can actually parse the response + if( typeof data === "string" ){ - // Get the JavaScript object, if JSON is used. - if ( type == "json" ) - data = eval("(" + data + ")"); + // If the type is "script", eval it in global context + if ( type == "script" ) + jQuery.globalEval( data ); + // Get the JavaScript object, if JSON is used. + if ( type == "json" ) + data = window["eval"]("(" + data + ")"); + } + return data; }, // Serialize an array of form elements or a set of // key/values into a query string param: function( a ) { - var s = []; + var s = [ ]; + + function add( key, value ){ + s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value); + }; // If an array was passed in, assume that it is an array // of form elements - if ( a.constructor == Array || a.jquery ) + if ( jQuery.isArray(a) || a.jquery ) // Serialize the form elements jQuery.each( a, function(){ - s.push( encodeURIComponent(this.name) + "=" + encodeURIComponent( this.value ) ); + add( this.name, this.value ); }); // Otherwise, assume that it's an object of key/value pairs @@ -2916,83 +3624,99 @@ jQuery.extend({ // Serialize the key/values for ( var j in a ) // If the value is an array then the key names need to be repeated - if ( a[j] && a[j].constructor == Array ) + if ( jQuery.isArray(a[j]) ) jQuery.each( a[j], function(){ - s.push( encodeURIComponent(j) + "=" + encodeURIComponent( this ) ); + add( j, this ); }); else - s.push( encodeURIComponent(j) + "=" + encodeURIComponent( jQuery.isFunction(a[j]) ? a[j]() : a[j] ) ); + add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] ); // Return the resulting serialization return s.join("&").replace(/%20/g, "+"); } }); +var elemdisplay = {}, + fxAttrs = [ + // height animations + [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ], + // width animations + [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ], + // opacity animations + [ "opacity" ] + ]; + +function genFx( type, num ){ + var obj = {}; + jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){ + obj[ this ] = type; + }); + return obj; +} + jQuery.fn.extend({ show: function(speed,callback){ - return speed ? - this.animate({ - height: "show", width: "show", opacity: "show" - }, speed, callback) : - - this.filter(":hidden").each(function(){ - this.style.display = this.oldblock || ""; - if ( jQuery.css(this,"display") == "none" ) { - var elem = jQuery("<" + this.tagName + " />").appendTo("body"); - this.style.display = elem.css("display"); - // handle an edge condition where css is - div { display:none; } or similar - if (this.style.display == "none") - this.style.display = "block"; - elem.remove(); + if ( speed ) { + return this.animate( genFx("show", 3), speed, callback); + } else { + for ( var i = 0, l = this.length; i < l; i++ ){ + var old = jQuery.data(this[i], "olddisplay"); + + this[i].style.display = old || ""; + + if ( jQuery.css(this[i], "display") === "none" ) { + var tagName = this[i].tagName, display; + + if ( elemdisplay[ tagName ] ) { + display = elemdisplay[ tagName ]; + } else { + var elem = jQuery("<" + tagName + " />").appendTo("body"); + + display = elem.css("display"); + if ( display === "none" ) + display = "block"; + + elem.remove(); + + elemdisplay[ tagName ] = display; + } + + this[i].style.display = jQuery.data(this[i], "olddisplay", display); } - }).end(); + } + + return this; + } }, hide: function(speed,callback){ - return speed ? - this.animate({ - height: "hide", width: "hide", opacity: "hide" - }, speed, callback) : - - this.filter(":visible").each(function(){ - this.oldblock = this.oldblock || jQuery.css(this,"display"); - this.style.display = "none"; - }).end(); + if ( speed ) { + return this.animate( genFx("hide", 3), speed, callback); + } else { + for ( var i = 0, l = this.length; i < l; i++ ){ + var old = jQuery.data(this[i], "olddisplay"); + if ( !old && old !== "none" ) + jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display")); + this[i].style.display = "none"; + } + return this; + } }, // Save the old toggle function _toggle: jQuery.fn.toggle, toggle: function( fn, fn2 ){ + var bool = typeof fn === "boolean"; + return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? this._toggle.apply( this, arguments ) : - fn ? - this.animate({ - height: "toggle", width: "toggle", opacity: "toggle" - }, fn, fn2) : + fn == null || bool ? this.each(function(){ - jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ](); - }); - }, - - slideDown: function(speed,callback){ - return this.animate({height: "show"}, speed, callback); - }, - - slideUp: function(speed,callback){ - return this.animate({height: "hide"}, speed, callback); - }, - - slideToggle: function(speed, callback){ - return this.animate({height: "toggle"}, speed, callback); - }, - - fadeIn: function(speed, callback){ - return this.animate({opacity: "show"}, speed, callback); - }, - - fadeOut: function(speed, callback){ - return this.animate({opacity: "hide"}, speed, callback); + var state = bool ? fn : jQuery(this).is(":hidden"); + jQuery(this)[ state ? "show" : "hide" ](); + }) : + this.animate(genFx("toggle", 3), fn, fn2); }, fadeTo: function(speed,to,callback){ @@ -3003,17 +3727,16 @@ jQuery.fn.extend({ var optall = jQuery.speed(speed, easing, callback); return this[ optall.queue === false ? "each" : "queue" ](function(){ - if ( this.nodeType != 1) - return false; - + var opt = jQuery.extend({}, optall), p, - hidden = jQuery(this).is(":hidden"), self = this; - + hidden = this.nodeType == 1 && jQuery(this).is(":hidden"), + self = this; + for ( p in prop ) { if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) return opt.complete.call(this); - if ( p == "height" || p == "width" ) { + if ( ( p == "height" || p == "width" ) && this.style ) { // Store display property opt.display = jQuery.css(this, "display"); @@ -3062,27 +3785,6 @@ jQuery.fn.extend({ }); }, - queue: function(type, fn){ - if ( jQuery.isFunction(type) || ( type && type.constructor == Array )) { - fn = type; - type = "fx"; - } - - if ( !type || (typeof type == "string" && !fn) ) - return queue( this[0], type ); - - return this.each(function(){ - if ( fn.constructor == Array ) - queue(this, type, fn); - else { - queue(this, type).push( fn ); - - if ( queue(this, type).length == 1 ) - fn.call(this); - } - }); - }, - stop: function(clearQueue, gotoEnd){ var timers = jQuery.timers; @@ -3109,46 +3811,31 @@ jQuery.fn.extend({ }); -var queue = function( elem, type, array ) { - if ( elem ){ - - type = type || "fx"; - - var q = jQuery.data( elem, type + "queue" ); - - if ( !q || array ) - q = jQuery.data( elem, type + "queue", jQuery.makeArray(array) ); - - } - return q; -}; - -jQuery.fn.dequeue = function(type){ - type = type || "fx"; - - return this.each(function(){ - var q = queue(this, type); - - q.shift(); - - if ( q.length ) - q[0].call( this ); - }); -}; +// Generate shortcuts for custom animations +jQuery.each({ + slideDown: genFx("show", 1), + slideUp: genFx("hide", 1), + slideToggle: genFx("toggle", 1), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" } +}, function( name, props ){ + jQuery.fn[ name ] = function( speed, callback ){ + return this.animate( props, speed, callback ); + }; +}); jQuery.extend({ speed: function(speed, easing, fn) { - var opt = speed && speed.constructor == Object ? speed : { + var opt = typeof speed === "object" ? speed : { complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, - easing: fn && easing || easing && easing.constructor != Function && easing + easing: fn && easing || easing && !jQuery.isFunction(easing) && easing }; - opt.duration = (opt.duration && opt.duration.constructor == Number ? - opt.duration : - jQuery.fx.speeds[opt.duration]) || jQuery.fx.speeds.def; + opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : + jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default; // Queueing opt.old = opt.complete; @@ -3195,13 +3882,13 @@ jQuery.fx.prototype = { (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this ); // Set display property to block for height/width animations - if ( this.prop == "height" || this.prop == "width" ) + if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style ) this.elem.style.display = "block"; }, // Get the current size cur: function(force){ - if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null ) + if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) return this.elem[ this.prop ]; var r = parseFloat(jQuery.css(this.elem, this.prop, force)); @@ -3216,7 +3903,6 @@ jQuery.fx.prototype = { this.unit = unit || this.unit || "px"; this.now = this.start; this.pos = this.state = 0; - this.update(); var self = this; function t(gotoEnd){ @@ -3227,7 +3913,7 @@ jQuery.fx.prototype = { jQuery.timers.push(t); - if ( jQuery.timerId == null ) { + if ( t() && jQuery.timerId == null ) { jQuery.timerId = setInterval(function(){ var timers = jQuery.timers; @@ -3250,12 +3936,9 @@ jQuery.fx.prototype = { this.options.show = true; // Begin the animation - this.custom(0, this.cur()); - // Make sure that we start at a small width/height to avoid any // flash of content - if ( this.prop == "width" || this.prop == "height" ) - this.elem.style[this.prop] = "1px"; + this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur()); // Start by showing the element jQuery(this.elem).show(); @@ -3275,7 +3958,7 @@ jQuery.fx.prototype = { step: function(gotoEnd){ var t = now(); - if ( gotoEnd || t > this.options.duration + this.startTime ) { + if ( gotoEnd || t >= this.options.duration + this.startTime ) { this.now = this.end; this.pos = this.state = 1; this.update(); @@ -3300,7 +3983,7 @@ jQuery.fx.prototype = { // Hide the element if the "hide" operation was done if ( this.options.hide ) - this.elem.style.display = "none"; + jQuery(this.elem).hide(); // Reset the properties, if the item has been hidden or shown if ( this.options.hide || this.options.show ) @@ -3335,124 +4018,106 @@ jQuery.extend( jQuery.fx, { slow: 600, fast: 200, // Default speed - def: 400 + _default: 400 }, step: { - scrollLeft: function(fx){ - fx.elem.scrollLeft = fx.now; - }, - - scrollTop: function(fx){ - fx.elem.scrollTop = fx.now; - }, opacity: function(fx){ jQuery.attr(fx.elem.style, "opacity", fx.now); }, _default: function(fx){ - fx.elem.style[ fx.prop ] = fx.now + fx.unit; + if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) + fx.elem.style[ fx.prop ] = fx.now + fx.unit; + else + fx.elem[ fx.prop ] = fx.now; } } }); -// The Offset Method -// Originally By Brandon Aaron, part of the Dimension Plugin -// http://jquery.com/plugins/project/dimensions -jQuery.fn.offset = function() { - var left = 0, top = 0, elem = this[0], results; - - if ( elem ) with ( jQuery.browser ) { - var parent = elem.parentNode, - offsetChild = elem, - offsetParent = elem.offsetParent, - doc = elem.ownerDocument, - safari2 = safari && parseInt(version) < 522 && !/adobeair/i.test(userAgent), - css = jQuery.curCSS, - fixed = css(elem, "position") == "fixed"; - - // Use getBoundingClientRect if available - if ( elem.getBoundingClientRect ) { - var box = elem.getBoundingClientRect(); - - // Add the document scroll offsets - add(box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft), - box.top + Math.max(doc.documentElement.scrollTop, doc.body.scrollTop)); - - // IE adds the HTML element's border, by default it is medium which is 2px - // IE 6 and 7 quirks mode the border width is overwritable by the following css html { border: 0; } - // IE 7 standards mode, the border is always 2px - // This border/offset is typically represented by the clientLeft and clientTop properties - // However, in IE6 and 7 quirks mode the clientLeft and clientTop properties are not updated when overwriting it via CSS - // Therefore this method will be off by 2px in IE while in quirksmode - add( -doc.documentElement.clientLeft, -doc.documentElement.clientTop ); - - // Otherwise loop through the offsetParents and parentNodes - } else { - - // Initial element offsets - add( elem.offsetLeft, elem.offsetTop ); - - // Get parent offsets - while ( offsetParent ) { - // Add offsetParent offsets - add( offsetParent.offsetLeft, offsetParent.offsetTop ); +if ( document.documentElement["getBoundingClientRect"] ) + jQuery.fn.offset = function() { + if ( !this[0] ) return { top: 0, left: 0 }; + if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] ); + var box = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement, + clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0, + top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop, + left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft; + return { top: top, left: left }; + }; +else + jQuery.fn.offset = function() { + if ( !this[0] ) return { top: 0, left: 0 }; + if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] ); + jQuery.offset.initialized || jQuery.offset.initialize(); + + var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem, + doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement, + body = doc.body, defaultView = doc.defaultView, + prevComputedStyle = defaultView.getComputedStyle(elem, null), + top = elem.offsetTop, left = elem.offsetLeft; + + while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) { + computedStyle = defaultView.getComputedStyle(elem, null); + top -= elem.scrollTop, left -= elem.scrollLeft; + if ( elem === offsetParent ) { + top += elem.offsetTop, left += elem.offsetLeft; + if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) ) + top += parseInt( computedStyle.borderTopWidth, 10) || 0, + left += parseInt( computedStyle.borderLeftWidth, 10) || 0; + prevOffsetParent = offsetParent, offsetParent = elem.offsetParent; + } + if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) + top += parseInt( computedStyle.borderTopWidth, 10) || 0, + left += parseInt( computedStyle.borderLeftWidth, 10) || 0; + prevComputedStyle = computedStyle; + } - // Mozilla and Safari > 2 does not include the border on offset parents - // However Mozilla adds the border for table or table cells - if ( mozilla && !/^t(able|d|h)$/i.test(offsetParent.tagName) || safari && !safari2 ) - border( offsetParent ); + if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) + top += body.offsetTop, + left += body.offsetLeft; - // Add the document scroll offsets if position is fixed on any offsetParent - if ( !fixed && css(offsetParent, "position") == "fixed" ) - fixed = true; + if ( prevComputedStyle.position === "fixed" ) + top += Math.max(docElem.scrollTop, body.scrollTop), + left += Math.max(docElem.scrollLeft, body.scrollLeft); - // Set offsetChild to previous offsetParent unless it is the body element - offsetChild = /^body$/i.test(offsetParent.tagName) ? offsetChild : offsetParent; - // Get next offsetParent - offsetParent = offsetParent.offsetParent; - } + return { top: top, left: left }; + }; - // Get parent scroll offsets - while ( parent && parent.tagName && !/^body|html$/i.test(parent.tagName) ) { - // Remove parent scroll UNLESS that parent is inline or a table to work around Opera inline/table scrollLeft/Top bug - if ( !/^inline|table.*$/i.test(css(parent, "display")) ) - // Subtract parent scroll offsets - add( -parent.scrollLeft, -parent.scrollTop ); +jQuery.offset = { + initialize: function() { + if ( this.initialized ) return; + var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop, + html = '<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"cellpadding="0"cellspacing="0"><tr><td></td></tr></table>'; - // Mozilla does not add the border for a parent that has overflow != visible - if ( mozilla && css(parent, "overflow") != "visible" ) - border( parent ); + rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' }; + for ( prop in rules ) container.style[prop] = rules[prop]; - // Get next parent - parent = parent.parentNode; - } + container.innerHTML = html; + body.insertBefore(container, body.firstChild); + innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild; - // Safari <= 2 doubles body offsets with a fixed position element/offsetParent or absolutely positioned offsetChild - // Mozilla doubles body offsets with a non-absolutely positioned offsetChild - if ( (safari2 && (fixed || css(offsetChild, "position") == "absolute")) || - (mozilla && css(offsetChild, "position") != "absolute") ) - add( -doc.body.offsetLeft, -doc.body.offsetTop ); + this.doesNotAddBorder = (checkDiv.offsetTop !== 5); + this.doesAddBorderForTableAndCells = (td.offsetTop === 5); - // Add the document scroll offsets if position is fixed - if ( fixed ) - add(Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft), - Math.max(doc.documentElement.scrollTop, doc.body.scrollTop)); - } + innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative'; + this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5); - // Return an object with top and left properties - results = { top: top, left: left }; - } + body.style.marginTop = '1px'; + this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0); + body.style.marginTop = bodyMarginTop; - function border(elem) { - add( jQuery.curCSS(elem, "borderLeftWidth", true), jQuery.curCSS(elem, "borderTopWidth", true) ); - } + body.removeChild(container); + this.initialized = true; + }, - function add(l, t) { - left += parseInt(l, 10) || 0; - top += parseInt(t, 10) || 0; + bodyOffset: function(body) { + jQuery.offset.initialized || jQuery.offset.initialize(); + var top = body.offsetTop, left = body.offsetLeft; + if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) + top += parseInt( jQuery.curCSS(body, 'marginTop', true), 10 ) || 0, + left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0; + return { top: top, left: left }; } - - return results; }; @@ -3471,11 +4136,11 @@ jQuery.fn.extend({ // Subtract element margins // note: when an element has margin: auto the offsetLeft and marginLeft // are the same in Safari causing offset.left to incorrectly be 0 - offset.top -= num( this, 'marginTop' ); + offset.top -= num( this, 'marginTop' ); offset.left -= num( this, 'marginLeft' ); // Add offsetParent borders - parentOffset.top += num( offsetParent, 'borderTopWidth' ); + parentOffset.top += num( offsetParent, 'borderTopWidth' ); parentOffset.left += num( offsetParent, 'borderLeftWidth' ); // Subtract the two offsets @@ -3489,7 +4154,7 @@ jQuery.fn.extend({ }, offsetParent: function() { - var offsetParent = this[0].offsetParent; + var offsetParent = this[0].offsetParent || document.body; while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') ) offsetParent = offsetParent.offsetParent; return jQuery(offsetParent); @@ -3502,9 +4167,9 @@ jQuery.each( ['Left', 'Top'], function(i, name) { var method = 'scroll' + name; jQuery.fn[ method ] = function(val) { - if (!this[0]) return; + if (!this[0]) return null; - return val != undefined ? + return val !== undefined ? // Set the scroll offset this.each(function() { @@ -3545,5 +4210,32 @@ jQuery.each([ "Height", "Width" ], function(i, name){ (margin ? num(this, "margin" + tl) + num(this, "margin" + br) : 0); }; + + var type = name.toLowerCase(); + + jQuery.fn[ type ] = function( size ) { + // Get window width or height + return this[0] == window ? + // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode + document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] || + document.body[ "client" + name ] : + + // Get document width or height + this[0] == document ? + // Either scroll[Width/Height] or offset[Width/Height], whichever is greater + Math.max( + document.documentElement["client" + name], + document.body["scroll" + name], document.documentElement["scroll" + name], + document.body["offset" + name], document.documentElement["offset" + name] + ) : + + // Get or set width or height on the element + size === undefined ? + // Get width or height on the element + (this.length ? jQuery.css( this[0], type ) : null) : + + // Set the width or height on the element (default to pixels if value is unitless) + this.css( type, typeof size === "string" ? size : size + "px" ); + }; });})(); diff --git a/js/jquery.min.js b/js/jquery.min.js index 82b98e1d7..396646c84 100644 --- a/js/jquery.min.js +++ b/js/jquery.min.js @@ -1,32 +1,19 @@ /* - * jQuery 1.2.6 - New Wave Javascript + * jQuery JavaScript Library v1.3 + * http://jquery.com/ * - * Copyright (c) 2008 John Resig (jquery.com) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License * - * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ - * $Rev: 5685 $ + * Date: 2009-01-13 12:50:31 -0500 (Tue, 13 Jan 2009) + * Revision: 6104 */ -(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else -return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else -return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else -selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else -return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else -this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else -return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else -jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&©&&typeof copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy;}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else -script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object)if(callback.apply(object[name],args)===false)break;}else -for(;i<length;)if(callback.apply(object[i++],args)===false)break;}else{if(length==undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break;}else -for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else -jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else -ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&¬xml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&¬xml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&¬xml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else -while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else -while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value;}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else -for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else -jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else -xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else -jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else -for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else -s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else -e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();
\ No newline at end of file +(function(){var l=this,g,x=l.jQuery,o=l.$,n=l.jQuery=l.$=function(D,E){return new n.fn.init(D,E)},C=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;n.fn=n.prototype={init:function(D,G){D=D||document;if(D.nodeType){this[0]=D;this.length=1;this.context=D;return this}if(typeof D==="string"){var F=C.exec(D);if(F&&(F[1]||!G)){if(F[1]){D=n.clean([F[1]],G)}else{var H=document.getElementById(F[3]);if(H){if(H.id!=F[3]){return n().find(D)}var E=n(H);E.context=document;E.selector=D;return E}D=[]}}else{return n(G).find(D)}}else{if(n.isFunction(D)){return n(document).ready(D)}}if(D.selector&&D.context){this.selector=D.selector;this.context=D.context}return this.setArray(n.makeArray(D))},selector:"",jquery:"1.3",size:function(){return this.length},get:function(D){return D===g?n.makeArray(this):this[D]},pushStack:function(E,G,D){var F=n(E);F.prevObject=this;F.context=this.context;if(G==="find"){F.selector=this.selector+(this.selector?" ":"")+D}else{if(G){F.selector=this.selector+"."+G+"("+D+")"}}return F},setArray:function(D){this.length=0;Array.prototype.push.apply(this,D);return this},each:function(E,D){return n.each(this,E,D)},index:function(D){return n.inArray(D&&D.jquery?D[0]:D,this)},attr:function(E,G,F){var D=E;if(typeof E==="string"){if(G===g){return this[0]&&n[F||"attr"](this[0],E)}else{D={};D[E]=G}}return this.each(function(H){for(E in D){n.attr(F?this.style:this,E,n.prop(this,D[E],F,H,E))}})},css:function(D,E){if((D=="width"||D=="height")&&parseFloat(E)<0){E=g}return this.attr(D,E,"curCSS")},text:function(E){if(typeof E!=="object"&&E!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(E))}var D="";n.each(E||this,function(){n.each(this.childNodes,function(){if(this.nodeType!=8){D+=this.nodeType!=1?this.nodeValue:n.fn.text([this])}})});return D},wrapAll:function(D){if(this[0]){var E=n(D,this[0].ownerDocument).clone();if(this[0].parentNode){E.insertBefore(this[0])}E.map(function(){var F=this;while(F.firstChild){F=F.firstChild}return F}).append(this)}return this},wrapInner:function(D){return this.each(function(){n(this).contents().wrapAll(D)})},wrap:function(D){return this.each(function(){n(this).wrapAll(D)})},append:function(){return this.domManip(arguments,true,function(D){if(this.nodeType==1){this.appendChild(D)}})},prepend:function(){return this.domManip(arguments,true,function(D){if(this.nodeType==1){this.insertBefore(D,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(D){this.parentNode.insertBefore(D,this)})},after:function(){return this.domManip(arguments,false,function(D){this.parentNode.insertBefore(D,this.nextSibling)})},end:function(){return this.prevObject||n([])},push:[].push,find:function(D){if(this.length===1&&!/,/.test(D)){var F=this.pushStack([],"find",D);F.length=0;n.find(D,this[0],F);return F}else{var E=n.map(this,function(G){return n.find(D,G)});return this.pushStack(/[^+>] [^+>]/.test(D)?n.unique(E):E,"find",D)}},clone:function(E){var D=this.map(function(){if(!n.support.noCloneEvent&&!n.isXMLDoc(this)){var H=this.cloneNode(true),G=document.createElement("div");G.appendChild(H);return n.clean([G.innerHTML])[0]}else{return this.cloneNode(true)}});var F=D.find("*").andSelf().each(function(){if(this[h]!==g){this[h]=null}});if(E===true){this.find("*").andSelf().each(function(H){if(this.nodeType==3){return}var G=n.data(this,"events");for(var J in G){for(var I in G[J]){n.event.add(F[H],J,G[J][I],G[J][I].data)}}})}return D},filter:function(D){return this.pushStack(n.isFunction(D)&&n.grep(this,function(F,E){return D.call(F,E)})||n.multiFilter(D,n.grep(this,function(E){return E.nodeType===1})),"filter",D)},closest:function(D){var E=n.expr.match.POS.test(D)?n(D):null;return this.map(function(){var F=this;while(F&&F.ownerDocument){if(E?E.index(F)>-1:n(F).is(D)){return F}F=F.parentNode}})},not:function(D){if(typeof D==="string"){if(f.test(D)){return this.pushStack(n.multiFilter(D,this,true),"not",D)}else{D=n.multiFilter(D,this)}}var E=D.length&&D[D.length-1]!==g&&!D.nodeType;return this.filter(function(){return E?n.inArray(this,D)<0:this!=D})},add:function(D){return this.pushStack(n.unique(n.merge(this.get(),typeof D==="string"?n(D):n.makeArray(D))))},is:function(D){return !!D&&n.multiFilter(D,this).length>0},hasClass:function(D){return !!D&&this.is("."+D)},val:function(J){if(J===g){var D=this[0];if(D){if(n.nodeName(D,"option")){return(D.attributes.value||{}).specified?D.value:D.text}if(n.nodeName(D,"select")){var H=D.selectedIndex,K=[],L=D.options,G=D.type=="select-one";if(H<0){return null}for(var E=G?H:0,I=G?H+1:L.length;E<I;E++){var F=L[E];if(F.selected){J=n(F).val();if(G){return J}K.push(J)}}return K}return(D.value||"").replace(/\r/g,"")}return g}if(typeof J==="number"){J+=""}return this.each(function(){if(this.nodeType!=1){return}if(n.isArray(J)&&/radio|checkbox/.test(this.type)){this.checked=(n.inArray(this.value,J)>=0||n.inArray(this.name,J)>=0)}else{if(n.nodeName(this,"select")){var M=n.makeArray(J);n("option",this).each(function(){this.selected=(n.inArray(this.value,M)>=0||n.inArray(this.text,M)>=0)});if(!M.length){this.selectedIndex=-1}}else{this.value=J}}})},html:function(D){return D===g?(this[0]?this[0].innerHTML:null):this.empty().append(D)},replaceWith:function(D){return this.after(D).remove()},eq:function(D){return this.slice(D,+D+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(D){return this.pushStack(n.map(this,function(F,E){return D.call(F,E,F)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=n.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild,D=this.length>1?I.cloneNode(true):I;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),G>0?D.cloneNode(true):I)}}if(F){n.each(F,y)}}return this;function K(N,O){return M&&n.nodeName(N,"table")&&n.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};n.fn.init.prototype=n.fn;function y(D,E){if(E.src){n.ajax({url:E.src,async:false,dataType:"script"})}else{n.globalEval(E.text||E.textContent||E.innerHTML||"")}if(E.parentNode){E.parentNode.removeChild(E)}}function e(){return +new Date}n.extend=n.fn.extend=function(){var I=arguments[0]||{},G=1,H=arguments.length,D=false,F;if(typeof I==="boolean"){D=I;I=arguments[1]||{};G=2}if(typeof I!=="object"&&!n.isFunction(I)){I={}}if(H==G){I=this;--G}for(;G<H;G++){if((F=arguments[G])!=null){for(var E in F){var J=I[E],K=F[E];if(I===K){continue}if(D&&K&&typeof K==="object"&&!K.nodeType){I[E]=n.extend(D,J||(K.length!=null?[]:{}),K)}else{if(K!==g){I[E]=K}}}}}return I};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,p=document.defaultView||{},r=Object.prototype.toString;n.extend({noConflict:function(D){l.$=o;if(D){l.jQuery=x}return n},isFunction:function(D){return r.call(D)==="[object Function]"},isArray:function(D){return r.call(D)==="[object Array]"},isXMLDoc:function(D){return D.documentElement&&!D.body||D.tagName&&D.ownerDocument&&!D.ownerDocument.body},globalEval:function(F){F=n.trim(F);if(F){var E=document.getElementsByTagName("head")[0]||document.documentElement,D=document.createElement("script");D.type="text/javascript";if(n.support.scriptEval){D.appendChild(document.createTextNode(F))}else{D.text=F}E.insertBefore(D,E.firstChild);E.removeChild(D)}},nodeName:function(E,D){return E.nodeName&&E.nodeName.toUpperCase()==D.toUpperCase()},each:function(F,J,E){var D,G=0,H=F.length;if(E){if(H===g){for(D in F){if(J.apply(F[D],E)===false){break}}}else{for(;G<H;){if(J.apply(F[G++],E)===false){break}}}}else{if(H===g){for(D in F){if(J.call(F[D],D,F[D])===false){break}}}else{for(var I=F[0];G<H&&J.call(I,G,I)!==false;I=F[++G]){}}}return F},prop:function(G,H,F,E,D){if(n.isFunction(H)){H=H.call(G,E)}return typeof H==="number"&&F=="curCSS"&&!b.test(D)?H+"px":H},className:{add:function(D,E){n.each((E||"").split(/\s+/),function(F,G){if(D.nodeType==1&&!n.className.has(D.className,G)){D.className+=(D.className?" ":"")+G}})},remove:function(D,E){if(D.nodeType==1){D.className=E!==g?n.grep(D.className.split(/\s+/),function(F){return !n.className.has(E,F)}).join(" "):""}},has:function(E,D){return n.inArray(D,(E.className||E).toString().split(/\s+/))>-1}},swap:function(G,F,H){var D={};for(var E in F){D[E]=G.style[E];G.style[E]=F[E]}H.call(G);for(var E in F){G.style[E]=D[E]}},css:function(F,D,H){if(D=="width"||D=="height"){var J,E={position:"absolute",visibility:"hidden",display:"block"},I=D=="width"?["Left","Right"]:["Top","Bottom"];function G(){J=D=="width"?F.offsetWidth:F.offsetHeight;var L=0,K=0;n.each(I,function(){L+=parseFloat(n.curCSS(F,"padding"+this,true))||0;K+=parseFloat(n.curCSS(F,"border"+this+"Width",true))||0});J-=Math.round(L+K)}if(n(F).is(":visible")){G()}else{n.swap(F,E,G)}return Math.max(0,J)}return n.curCSS(F,D,H)},curCSS:function(H,E,F){var K,D=H.style;if(E=="opacity"&&!n.support.opacity){K=n.attr(D,"opacity");return K==""?"1":K}if(E.match(/float/i)){E=v}if(!F&&D&&D[E]){K=D[E]}else{if(p.getComputedStyle){if(E.match(/float/i)){E="float"}E=E.replace(/([A-Z])/g,"-$1").toLowerCase();var L=p.getComputedStyle(H,null);if(L){K=L.getPropertyValue(E)}if(E=="opacity"&&K==""){K="1"}}else{if(H.currentStyle){var I=E.replace(/\-(\w)/g,function(M,N){return N.toUpperCase()});K=H.currentStyle[E]||H.currentStyle[I];if(!/^\d+(px)?$/i.test(K)&&/^\d/.test(K)){var G=D.left,J=H.runtimeStyle.left;H.runtimeStyle.left=H.currentStyle.left;D.left=K||0;K=D.pixelLeft+"px";D.left=G;H.runtimeStyle.left=J}}}}return K},clean:function(E,J,H){J=J||document;if(typeof J.createElement==="undefined"){J=J.ownerDocument||J[0]&&J[0].ownerDocument||document}if(!H&&E.length===1&&typeof E[0]==="string"){var G=/^<(\w+)\s*\/?>$/.exec(E[0]);if(G){return[J.createElement(G[1])]}}var F=[],D=[],K=J.createElement("div");n.each(E,function(O,Q){if(typeof Q==="number"){Q+=""}if(!Q){return}if(typeof Q==="string"){Q=Q.replace(/(<(\w+)[^>]*?)\/>/g,function(S,T,R){return R.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?S:T+"></"+R+">"});var N=n.trim(Q).toLowerCase();var P=!N.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!N.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||N.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!N.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!N.indexOf("<td")||!N.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!N.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!n.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];K.innerHTML=P[1]+Q+P[2];while(P[0]--){K=K.lastChild}if(!n.support.tbody){var M=!N.indexOf("<table")&&N.indexOf("<tbody")<0?K.firstChild&&K.firstChild.childNodes:P[1]=="<table>"&&N.indexOf("<tbody")<0?K.childNodes:[];for(var L=M.length-1;L>=0;--L){if(n.nodeName(M[L],"tbody")&&!M[L].childNodes.length){M[L].parentNode.removeChild(M[L])}}}if(!n.support.leadingWhitespace&&/^\s/.test(Q)){K.insertBefore(J.createTextNode(Q.match(/^\s*/)[0]),K.firstChild)}Q=n.makeArray(K.childNodes)}if(Q.nodeType){F.push(Q)}else{F=n.merge(F,Q)}});if(H){for(var I=0;F[I];I++){if(n.nodeName(F[I],"script")&&(!F[I].type||F[I].type.toLowerCase()==="text/javascript")){D.push(F[I].parentNode?F[I].parentNode.removeChild(F[I]):F[I])}else{if(F[I].nodeType===1){F.splice.apply(F,[I+1,0].concat(n.makeArray(F[I].getElementsByTagName("script"))))}H.appendChild(F[I])}}return D}return F},attr:function(I,F,J){if(!I||I.nodeType==3||I.nodeType==8){return g}var G=!n.isXMLDoc(I),K=J!==g;F=G&&n.props[F]||F;if(I.tagName){var E=/href|src|style/.test(F);if(F=="selected"&&I.parentNode){I.parentNode.selectedIndex}if(F in I&&G&&!E){if(K){if(F=="type"&&n.nodeName(I,"input")&&I.parentNode){throw"type property can't be changed"}I[F]=J}if(n.nodeName(I,"form")&&I.getAttributeNode(F)){return I.getAttributeNode(F).nodeValue}if(F=="tabIndex"){var H=I.getAttributeNode("tabIndex");return H&&H.specified?H.value:I.nodeName.match(/^(a|area|button|input|object|select|textarea)$/i)?0:g}return I[F]}if(!n.support.style&&G&&F=="style"){return n.attr(I.style,"cssText",J)}if(K){I.setAttribute(F,""+J)}var D=!n.support.hrefNormalized&&G&&E?I.getAttribute(F,2):I.getAttribute(F);return D===null?g:D}if(!n.support.opacity&&F=="opacity"){if(K){I.zoom=1;I.filter=(I.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(J)+""=="NaN"?"":"alpha(opacity="+J*100+")")}return I.filter&&I.filter.indexOf("opacity=")>=0?(parseFloat(I.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}F=F.replace(/-([a-z])/ig,function(L,M){return M.toUpperCase()});if(K){I[F]=J}return I[F]},trim:function(D){return(D||"").replace(/^\s+|\s+$/g,"")},makeArray:function(F){var D=[];if(F!=null){var E=F.length;if(E==null||typeof F==="string"||n.isFunction(F)||F.setInterval){D[0]=F}else{while(E){D[--E]=F[E]}}}return D},inArray:function(F,G){for(var D=0,E=G.length;D<E;D++){if(G[D]===F){return D}}return -1},merge:function(G,D){var E=0,F,H=G.length;if(!n.support.getAll){while((F=D[E++])!=null){if(F.nodeType!=8){G[H++]=F}}}else{while((F=D[E++])!=null){G[H++]=F}}return G},unique:function(J){var E=[],D={};try{for(var F=0,G=J.length;F<G;F++){var I=n.data(J[F]);if(!D[I]){D[I]=true;E.push(J[F])}}}catch(H){E=J}return E},grep:function(E,I,D){var F=[];for(var G=0,H=E.length;G<H;G++){if(!D!=!I(E[G],G)){F.push(E[G])}}return F},map:function(D,I){var E=[];for(var F=0,G=D.length;F<G;F++){var H=I(D[F],F);if(H!=null){E[E.length]=H}}return E.concat.apply([],E)}});var B=navigator.userAgent.toLowerCase();n.browser={version:(B.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(B),opera:/opera/.test(B),msie:/msie/.test(B)&&!/opera/.test(B),mozilla:/mozilla/.test(B)&&!/(compatible|webkit)/.test(B)};n.each({parent:function(D){return D.parentNode},parents:function(D){return n.dir(D,"parentNode")},next:function(D){return n.nth(D,2,"nextSibling")},prev:function(D){return n.nth(D,2,"previousSibling")},nextAll:function(D){return n.dir(D,"nextSibling")},prevAll:function(D){return n.dir(D,"previousSibling")},siblings:function(D){return n.sibling(D.parentNode.firstChild,D)},children:function(D){return n.sibling(D.firstChild)},contents:function(D){return n.nodeName(D,"iframe")?D.contentDocument||D.contentWindow.document:n.makeArray(D.childNodes)}},function(D,E){n.fn[D]=function(F){var G=n.map(this,E);if(F&&typeof F=="string"){G=n.multiFilter(F,G)}return this.pushStack(n.unique(G),D,F)}});n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(D,E){n.fn[D]=function(){var F=arguments;return this.each(function(){for(var G=0,H=F.length;G<H;G++){n(F[G])[E](this)}})}});n.each({removeAttr:function(D){n.attr(this,D,"");if(this.nodeType==1){this.removeAttribute(D)}},addClass:function(D){n.className.add(this,D)},removeClass:function(D){n.className.remove(this,D)},toggleClass:function(E,D){if(typeof D!=="boolean"){D=!n.className.has(this,E)}n.className[D?"add":"remove"](this,E)},remove:function(D){if(!D||n.filter(D,[this]).length){n("*",this).add([this]).each(function(){n.event.remove(this);n.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){n(">*",this).remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(D,E){n.fn[D]=function(){return this.each(E,arguments)}});function j(D,E){return D[0]&&parseInt(n.curCSS(D[0],E,true),10)||0}var h="jQuery"+e(),u=0,z={};n.extend({cache:{},data:function(E,D,F){E=E==l?z:E;var G=E[h];if(!G){G=E[h]=++u}if(D&&!n.cache[G]){n.cache[G]={}}if(F!==g){n.cache[G][D]=F}return D?n.cache[G][D]:G},removeData:function(E,D){E=E==l?z:E;var G=E[h];if(D){if(n.cache[G]){delete n.cache[G][D];D="";for(D in n.cache[G]){break}if(!D){n.removeData(E)}}}else{try{delete E[h]}catch(F){if(E.removeAttribute){E.removeAttribute(h)}}delete n.cache[G]}},queue:function(E,D,G){if(E){D=(D||"fx")+"queue";var F=n.data(E,D);if(!F||n.isArray(G)){F=n.data(E,D,n.makeArray(G))}else{if(G){F.push(G)}}}return F},dequeue:function(G,F){var D=n.queue(G,F),E=D.shift();if(!F||F==="fx"){E=D[0]}if(E!==g){E.call(G)}}});n.fn.extend({data:function(D,F){var G=D.split(".");G[1]=G[1]?"."+G[1]:"";if(F===g){var E=this.triggerHandler("getData"+G[1]+"!",[G[0]]);if(E===g&&this.length){E=n.data(this[0],D)}return E===g&&G[1]?this.data(G[0]):E}else{return this.trigger("setData"+G[1]+"!",[G[0],F]).each(function(){n.data(this,D,F)})}},removeData:function(D){return this.each(function(){n.removeData(this,D)})},queue:function(D,E){if(typeof D!=="string"){E=D;D="fx"}if(E===g){return n.queue(this[0],D)}return this.each(function(){var F=n.queue(this,D,E);if(D=="fx"&&F.length==1){F[0].call(this)}})},dequeue:function(D){return this.each(function(){n.dequeue(this,D)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.1 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var N=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|[^[\]]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,I=0,F=Object.prototype.toString;var E=function(ae,S,aa,V){aa=aa||[];S=S||document;if(S.nodeType!==1&&S.nodeType!==9){return[]}if(!ae||typeof ae!=="string"){return aa}var ab=[],ac,Y,ah,ag,Z,R,Q=true;N.lastIndex=0;while((ac=N.exec(ae))!==null){ab.push(ac[1]);if(ac[2]){R=RegExp.rightContext;break}}if(ab.length>1&&G.match.POS.exec(ae)){if(ab.length===2&&G.relative[ab[0]]){var U="",X;while((X=G.match.POS.exec(ae))){U+=X[0];ae=ae.replace(G.match.POS,"")}Y=E.filter(U,E(/\s$/.test(ae)?ae+"*":ae,S))}else{Y=G.relative[ab[0]]?[S]:E(ab.shift(),S);while(ab.length){var P=[];ae=ab.shift();if(G.relative[ae]){ae+=ab.shift()}for(var af=0,ad=Y.length;af<ad;af++){E(ae,Y[af],P)}Y=P}}}else{var ai=V?{expr:ab.pop(),set:D(V)}:E.find(ab.pop(),ab.length===1&&S.parentNode?S.parentNode:S);Y=E.filter(ai.expr,ai.set);if(ab.length>0){ah=D(Y)}else{Q=false}while(ab.length){var T=ab.pop(),W=T;if(!G.relative[T]){T=""}else{W=ab.pop()}if(W==null){W=S}G.relative[T](ah,W,M(S))}}if(!ah){ah=Y}if(!ah){throw"Syntax error, unrecognized expression: "+(T||ae)}if(F.call(ah)==="[object Array]"){if(!Q){aa.push.apply(aa,ah)}else{if(S.nodeType===1){for(var af=0;ah[af]!=null;af++){if(ah[af]&&(ah[af]===true||ah[af].nodeType===1&&H(S,ah[af]))){aa.push(Y[af])}}}else{for(var af=0;ah[af]!=null;af++){if(ah[af]&&ah[af].nodeType===1){aa.push(Y[af])}}}}}else{D(ah,aa)}if(R){E(R,S,aa,V)}return aa};E.matches=function(P,Q){return E(P,null,null,Q)};E.find=function(V,S){var W,Q;if(!V){return[]}for(var R=0,P=G.order.length;R<P;R++){var T=G.order[R],Q;if((Q=G.match[T].exec(V))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){Q[1]=(Q[1]||"").replace(/\\/g,"");W=G.find[T](Q,S);if(W!=null){V=V.replace(G.match[T],"");break}}}}if(!W){W=S.getElementsByTagName("*")}return{set:W,expr:V}};E.filter=function(S,ac,ad,T){var Q=S,Y=[],ah=ac,V,ab;while(S&&ac.length){for(var U in G.filter){if((V=G.match[U].exec(S))!=null){var Z=G.filter[U],R=null,X=0,aa,ag;ab=false;if(ah==Y){Y=[]}if(G.preFilter[U]){V=G.preFilter[U](V,ah,ad,Y,T);if(!V){ab=aa=true}else{if(V===true){continue}else{if(V[0]===true){R=[];var W=null,af;for(var ae=0;(af=ah[ae])!==g;ae++){if(af&&W!==af){R.push(af);W=af}}}}}}if(V){for(var ae=0;(ag=ah[ae])!==g;ae++){if(ag){if(R&&ag!=R[X]){X++}aa=Z(ag,V,X,R);var P=T^!!aa;if(ad&&aa!=null){if(P){ab=true}else{ah[ae]=false}}else{if(P){Y.push(ag);ab=true}}}}}if(aa!==g){if(!ad){ah=Y}S=S.replace(G.match[U],"");if(!ab){return[]}break}}}S=S.replace(/\s*,\s*/,"");if(S==Q){if(ab==null){throw"Syntax error, unrecognized expression: "+S}else{break}}Q=S}return ah};var G=E.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(P){return P.getAttribute("href")}},relative:{"+":function(T,Q){for(var R=0,P=T.length;R<P;R++){var S=T[R];if(S){var U=S.previousSibling;while(U&&U.nodeType!==1){U=U.previousSibling}T[R]=typeof Q==="string"?U||false:U===Q}}if(typeof Q==="string"){E.filter(Q,T,true)}},">":function(U,Q,V){if(typeof Q==="string"&&!/\W/.test(Q)){Q=V?Q:Q.toUpperCase();for(var R=0,P=U.length;R<P;R++){var T=U[R];if(T){var S=T.parentNode;U[R]=S.nodeName===Q?S:false}}}else{for(var R=0,P=U.length;R<P;R++){var T=U[R];if(T){U[R]=typeof Q==="string"?T.parentNode:T.parentNode===Q}}if(typeof Q==="string"){E.filter(Q,U,true)}}},"":function(S,Q,U){var R="done"+(I++),P=O;if(!Q.match(/\W/)){var T=Q=U?Q:Q.toUpperCase();P=L}P("parentNode",Q,R,S,T,U)},"~":function(S,Q,U){var R="done"+(I++),P=O;if(typeof Q==="string"&&!Q.match(/\W/)){var T=Q=U?Q:Q.toUpperCase();P=L}P("previousSibling",Q,R,S,T,U)}},find:{ID:function(Q,R){if(R.getElementById){var P=R.getElementById(Q[1]);return P?[P]:[]}},NAME:function(P,Q){return Q.getElementsByName?Q.getElementsByName(P[1]):null},TAG:function(P,Q){return Q.getElementsByTagName(P[1])}},preFilter:{CLASS:function(S,Q,R,P,U){S=" "+S[1].replace(/\\/g,"")+" ";for(var T=0;Q[T];T++){if(U^(" "+Q[T].className+" ").indexOf(S)>=0){if(!R){P.push(Q[T])}}else{if(R){Q[T]=false}}}return false},ID:function(P){return P[1].replace(/\\/g,"")},TAG:function(Q,P){for(var R=0;!P[R];R++){}return M(P[R])?Q[1]:Q[1].toUpperCase()},CHILD:function(P){if(P[1]=="nth"){var Q=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(P[2]=="even"&&"2n"||P[2]=="odd"&&"2n+1"||!/\D/.test(P[2])&&"0n+"+P[2]||P[2]);P[2]=(Q[1]+(Q[2]||1))-0;P[3]=Q[3]-0}P[0]="done"+(I++);return P},ATTR:function(Q){var P=Q[1];if(G.attrMap[P]){Q[1]=G.attrMap[P]}if(Q[2]==="~="){Q[4]=" "+Q[4]+" "}return Q},PSEUDO:function(T,Q,R,P,U){if(T[1]==="not"){if(T[3].match(N).length>1){T[3]=E(T[3],null,null,Q)}else{var S=E.filter(T[3],Q,R,true^U);if(!R){P.push.apply(P,S)}return false}}else{if(G.match.POS.test(T[0])){return true}}return T},POS:function(P){P.unshift(true);return P}},filters:{enabled:function(P){return P.disabled===false&&P.type!=="hidden"},disabled:function(P){return P.disabled===true},checked:function(P){return P.checked===true},selected:function(P){P.parentNode.selectedIndex;return P.selected===true},parent:function(P){return !!P.firstChild},empty:function(P){return !P.firstChild},has:function(R,Q,P){return !!E(P[3],R).length},header:function(P){return/h\d/i.test(P.nodeName)},text:function(P){return"text"===P.type},radio:function(P){return"radio"===P.type},checkbox:function(P){return"checkbox"===P.type},file:function(P){return"file"===P.type},password:function(P){return"password"===P.type},submit:function(P){return"submit"===P.type},image:function(P){return"image"===P.type},reset:function(P){return"reset"===P.type},button:function(P){return"button"===P.type||P.nodeName.toUpperCase()==="BUTTON"},input:function(P){return/input|select|textarea|button/i.test(P.nodeName)}},setFilters:{first:function(Q,P){return P===0},last:function(R,Q,P,S){return Q===S.length-1},even:function(Q,P){return P%2===0},odd:function(Q,P){return P%2===1},lt:function(R,Q,P){return Q<P[3]-0},gt:function(R,Q,P){return Q>P[3]-0},nth:function(R,Q,P){return P[3]-0==Q},eq:function(R,Q,P){return P[3]-0==Q}},filter:{CHILD:function(P,S){var V=S[1],W=P.parentNode;var U="child"+W.childNodes.length;if(W&&(!W[U]||!P.nodeIndex)){var T=1;for(var Q=W.firstChild;Q;Q=Q.nextSibling){if(Q.nodeType==1){Q.nodeIndex=T++}}W[U]=T-1}if(V=="first"){return P.nodeIndex==1}else{if(V=="last"){return P.nodeIndex==W[U]}else{if(V=="only"){return W[U]==1}else{if(V=="nth"){var Y=false,R=S[2],X=S[3];if(R==1&&X==0){return true}if(R==0){if(P.nodeIndex==X){Y=true}}else{if((P.nodeIndex-X)%R==0&&(P.nodeIndex-X)/R>=0){Y=true}}return Y}}}}},PSEUDO:function(V,R,S,W){var Q=R[1],T=G.filters[Q];if(T){return T(V,S,R,W)}else{if(Q==="contains"){return(V.textContent||V.innerText||"").indexOf(R[3])>=0}else{if(Q==="not"){var U=R[3];for(var S=0,P=U.length;S<P;S++){if(U[S]===V){return false}}return true}}}},ID:function(Q,P){return Q.nodeType===1&&Q.getAttribute("id")===P},TAG:function(Q,P){return(P==="*"&&Q.nodeType===1)||Q.nodeName===P},CLASS:function(Q,P){return P.test(Q.className)},ATTR:function(T,R){var P=G.attrHandle[R[1]]?G.attrHandle[R[1]](T):T[R[1]]||T.getAttribute(R[1]),U=P+"",S=R[2],Q=R[4];return P==null?false:S==="="?U===Q:S==="*="?U.indexOf(Q)>=0:S==="~="?(" "+U+" ").indexOf(Q)>=0:!R[4]?P:S==="!="?U!=Q:S==="^="?U.indexOf(Q)===0:S==="$="?U.substr(U.length-Q.length)===Q:S==="|="?U===Q||U.substr(0,Q.length+1)===Q+"-":false},POS:function(T,Q,R,U){var P=Q[2],S=G.setFilters[P];if(S){return S(T,R,Q,U)}}}};for(var K in G.match){G.match[K]=RegExp(G.match[K].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var D=function(Q,P){Q=Array.prototype.slice.call(Q);if(P){P.push.apply(P,Q);return P}return Q};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(J){D=function(T,S){var Q=S||[];if(F.call(T)==="[object Array]"){Array.prototype.push.apply(Q,T)}else{if(typeof T.length==="number"){for(var R=0,P=T.length;R<P;R++){Q.push(T[R])}}else{for(var R=0;T[R];R++){Q.push(T[R])}}}return Q}}(function(){var Q=document.createElement("form"),R="script"+(new Date).getTime();Q.innerHTML="<input name='"+R+"'/>";var P=document.documentElement;P.insertBefore(Q,P.firstChild);if(!!document.getElementById(R)){G.find.ID=function(T,U){if(U.getElementById){var S=U.getElementById(T[1]);return S?S.id===T[1]||S.getAttributeNode&&S.getAttributeNode("id").nodeValue===T[1]?[S]:g:[]}};G.filter.ID=function(U,S){var T=U.getAttributeNode&&U.getAttributeNode("id");return U.nodeType===1&&T&&T.nodeValue===S}}P.removeChild(Q)})();(function(){var P=document.createElement("div");P.appendChild(document.createComment(""));if(P.getElementsByTagName("*").length>0){G.find.TAG=function(Q,U){var T=U.getElementsByTagName(Q[1]);if(Q[1]==="*"){var S=[];for(var R=0;T[R];R++){if(T[R].nodeType===1){S.push(T[R])}}T=S}return T}}P.innerHTML="<a href='#'></a>";if(P.firstChild.getAttribute("href")!=="#"){G.attrHandle.href=function(Q){return Q.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var P=E;E=function(T,S,Q,R){S=S||document;if(!R&&S.nodeType===9){try{return D(S.querySelectorAll(T),Q)}catch(U){}}return P(T,S,Q,R)};E.find=P.find;E.filter=P.filter;E.selectors=P.selectors;E.matches=P.matches})()}if(document.documentElement.getElementsByClassName){G.order.splice(1,0,"CLASS");G.find.CLASS=function(P,Q){return Q.getElementsByClassName(P[1])}}function L(Q,W,V,Z,X,Y){for(var T=0,R=Z.length;T<R;T++){var P=Z[T];if(P){P=P[Q];var U=false;while(P&&P.nodeType){var S=P[V];if(S){U=Z[S];break}if(P.nodeType===1&&!Y){P[V]=T}if(P.nodeName===W){U=P;break}P=P[Q]}Z[T]=U}}}function O(Q,V,U,Y,W,X){for(var S=0,R=Y.length;S<R;S++){var P=Y[S];if(P){P=P[Q];var T=false;while(P&&P.nodeType){if(P[U]){T=Y[P[U]];break}if(P.nodeType===1){if(!X){P[U]=S}if(typeof V!=="string"){if(P===V){T=true;break}}else{if(E.filter(V,[P]).length>0){T=P;break}}}P=P[Q]}Y[S]=T}}}var H=document.compareDocumentPosition?function(Q,P){return Q.compareDocumentPosition(P)&16}:function(Q,P){return Q!==P&&(Q.contains?Q.contains(P):true)};var M=function(P){return P.documentElement&&!P.body||P.tagName&&P.ownerDocument&&!P.ownerDocument.body};n.find=E;n.filter=E.filter;n.expr=E.selectors;n.expr[":"]=n.expr.filters;E.selectors.filters.hidden=function(P){return"hidden"===P.type||n.css(P,"display")==="none"||n.css(P,"visibility")==="hidden"};E.selectors.filters.visible=function(P){return"hidden"!==P.type&&n.css(P,"display")!=="none"&&n.css(P,"visibility")!=="hidden"};E.selectors.filters.animated=function(P){return n.grep(n.timers,function(Q){return P===Q.elem}).length};n.multiFilter=function(R,P,Q){if(Q){R=":not("+R+")"}return E.matches(R,P)};n.dir=function(R,Q){var P=[],S=R[Q];while(S&&S!=document){if(S.nodeType==1){P.push(S)}S=S[Q]}return P};n.nth=function(T,P,R,S){P=P||1;var Q=0;for(;T;T=T[R]){if(T.nodeType==1&&++Q==P){break}}return T};n.sibling=function(R,Q){var P=[];for(;R;R=R.nextSibling){if(R.nodeType==1&&R!=Q){P.push(R)}}return P};return;l.Sizzle=E})();n.event={add:function(H,E,G,J){if(H.nodeType==3||H.nodeType==8){return}if(H.setInterval&&H!=l){H=l}if(!G.guid){G.guid=this.guid++}if(J!==g){var F=G;G=this.proxy(F);G.data=J}var D=n.data(H,"events")||n.data(H,"events",{}),I=n.data(H,"handle")||n.data(H,"handle",function(){return typeof n!=="undefined"&&!n.event.triggered?n.event.handle.apply(arguments.callee.elem,arguments):g});I.elem=H;n.each(E.split(/\s+/),function(L,M){var N=M.split(".");M=N.shift();G.type=N.slice().sort().join(".");var K=D[M];if(n.event.specialAll[M]){n.event.specialAll[M].setup.call(H,J,N)}if(!K){K=D[M]={};if(!n.event.special[M]||n.event.special[M].setup.call(H,J,N)===false){if(H.addEventListener){H.addEventListener(M,I,false)}else{if(H.attachEvent){H.attachEvent("on"+M,I)}}}}K[G.guid]=G;n.event.global[M]=true});H=null},guid:1,global:{},remove:function(J,G,I){if(J.nodeType==3||J.nodeType==8){return}var F=n.data(J,"events"),E,D;if(F){if(G===g||(typeof G==="string"&&G.charAt(0)==".")){for(var H in F){this.remove(J,H+(G||""))}}else{if(G.type){I=G.handler;G=G.type}n.each(G.split(/\s+/),function(L,N){var P=N.split(".");N=P.shift();var M=RegExp("(^|\\.)"+P.slice().sort().join(".*\\.")+"(\\.|$)");if(F[N]){if(I){delete F[N][I.guid]}else{for(var O in F[N]){if(M.test(F[N][O].type)){delete F[N][O]}}}if(n.event.specialAll[N]){n.event.specialAll[N].teardown.call(J,P)}for(E in F[N]){break}if(!E){if(!n.event.special[N]||n.event.special[N].teardown.call(J,P)===false){if(J.removeEventListener){J.removeEventListener(N,n.data(J,"handle"),false)}else{if(J.detachEvent){J.detachEvent("on"+N,n.data(J,"handle"))}}}E=null;delete F[N]}}})}for(E in F){break}if(!E){var K=n.data(J,"handle");if(K){K.elem=null}n.removeData(J,"events");n.removeData(J,"handle")}}},trigger:function(H,J,G,D){var F=H.type||H;if(!D){H=typeof H==="object"?H[h]?H:n.extend(n.Event(F),H):n.Event(F);if(F.indexOf("!")>=0){H.type=F=F.slice(0,-1);H.exclusive=true}if(!G){H.stopPropagation();if(this.global[F]){n.each(n.cache,function(){if(this.events&&this.events[F]){n.event.trigger(H,J,this.handle.elem)}})}}if(!G||G.nodeType==3||G.nodeType==8){return g}H.result=g;H.target=G;J=n.makeArray(J);J.unshift(H)}H.currentTarget=G;var I=n.data(G,"handle");if(I){I.apply(G,J)}if((!G[F]||(n.nodeName(G,"a")&&F=="click"))&&G["on"+F]&&G["on"+F].apply(G,J)===false){H.result=false}if(!D&&G[F]&&!H.isDefaultPrevented()&&!(n.nodeName(G,"a")&&F=="click")){this.triggered=true;try{G[F]()}catch(K){}}this.triggered=false;if(!H.isPropagationStopped()){var E=G.parentNode||G.ownerDocument;if(E){n.event.trigger(H,J,E,true)}}},handle:function(J){var I,D;J=arguments[0]=n.event.fix(J||l.event);var K=J.type.split(".");J.type=K.shift();I=!K.length&&!J.exclusive;var H=RegExp("(^|\\.)"+K.slice().sort().join(".*\\.")+"(\\.|$)");D=(n.data(this,"events")||{})[J.type];for(var F in D){var G=D[F];if(I||H.test(G.type)){J.handler=G;J.data=G.data;var E=G.apply(this,arguments);if(E!==g){J.result=E;if(E===false){J.preventDefault();J.stopPropagation()}}if(J.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(G){if(G[h]){return G}var E=G;G=n.Event(E);for(var F=this.props.length,I;F;){I=this.props[--F];G[I]=E[I]}if(!G.target){G.target=G.srcElement||document}if(G.target.nodeType==3){G.target=G.target.parentNode}if(!G.relatedTarget&&G.fromElement){G.relatedTarget=G.fromElement==G.target?G.toElement:G.fromElement}if(G.pageX==null&&G.clientX!=null){var H=document.documentElement,D=document.body;G.pageX=G.clientX+(H&&H.scrollLeft||D&&D.scrollLeft||0)-(H.clientLeft||0);G.pageY=G.clientY+(H&&H.scrollTop||D&&D.scrollTop||0)-(H.clientTop||0)}if(!G.which&&((G.charCode||G.charCode===0)?G.charCode:G.keyCode)){G.which=G.charCode||G.keyCode}if(!G.metaKey&&G.ctrlKey){G.metaKey=G.ctrlKey}if(!G.which&&G.button){G.which=(G.button&1?1:(G.button&2?3:(G.button&4?2:0)))}return G},proxy:function(E,D){D=D||function(){return E.apply(this,arguments)};D.guid=E.guid=E.guid||D.guid||this.guid++;return D},special:{ready:{setup:A,teardown:function(){}}},specialAll:{live:{setup:function(D,E){n.event.add(this,E[0],c)},teardown:function(F){if(F.length){var D=0,E=RegExp("(^|\\.)"+F[0]+"(\\.|$)");n.each((n.data(this,"events").live||{}),function(){if(E.test(this.type)){D++}});if(D<1){n.event.remove(this,F[0],c)}}}}}};n.Event=function(D){if(!this.preventDefault){return new n.Event(D)}if(D&&D.type){this.originalEvent=D;this.type=D.type;this.timeStamp=D.timeStamp}else{this.type=D}if(!this.timeStamp){this.timeStamp=e()}this[h]=true};function k(){return false}function t(){return true}n.Event.prototype={preventDefault:function(){this.isDefaultPrevented=t;var D=this.originalEvent;if(!D){return}if(D.preventDefault){D.preventDefault()}D.returnValue=false},stopPropagation:function(){this.isPropagationStopped=t;var D=this.originalEvent;if(!D){return}if(D.stopPropagation){D.stopPropagation()}D.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=t;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(E){var D=E.relatedTarget;while(D&&D!=this){try{D=D.parentNode}catch(F){D=this}}if(D!=this){E.type=E.data;n.event.handle.apply(this,arguments)}};n.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(E,D){n.event.special[D]={setup:function(){n.event.add(this,E,a,D)},teardown:function(){n.event.remove(this,E,a)}}});n.fn.extend({bind:function(E,F,D){return E=="unload"?this.one(E,F,D):this.each(function(){n.event.add(this,E,D||F,D&&F)})},one:function(F,G,E){var D=n.event.proxy(E||G,function(H){n(this).unbind(H,D);return(E||G).apply(this,arguments)});return this.each(function(){n.event.add(this,F,D,E&&G)})},unbind:function(E,D){return this.each(function(){n.event.remove(this,E,D)})},trigger:function(D,E){return this.each(function(){n.event.trigger(D,E,this)})},triggerHandler:function(D,F){if(this[0]){var E=n.Event(D);E.preventDefault();E.stopPropagation();n.event.trigger(E,F,this[0]);return E.result}},toggle:function(F){var D=arguments,E=1;while(E<D.length){n.event.proxy(F,D[E++])}return this.click(n.event.proxy(F,function(G){this.lastToggle=(this.lastToggle||0)%E;G.preventDefault();return D[this.lastToggle++].apply(this,arguments)||false}))},hover:function(D,E){return this.mouseenter(D).mouseleave(E)},ready:function(D){A();if(n.isReady){D.call(document,n)}else{n.readyList.push(D)}return this},live:function(F,E){var D=n.event.proxy(E);D.guid+=this.selector+F;n(document).bind(i(F,this.selector),this.selector,D);return this},die:function(E,D){n(document).unbind(i(E,this.selector),D?{guid:D.guid+this.selector+E}:null);return this}});function c(G){var D=RegExp("(^|\\.)"+G.type+"(\\.|$)"),F=true,E=[];n.each(n.data(this,"events").live||[],function(H,I){if(D.test(I.type)){var J=n(G.target).closest(I.data)[0];if(J){E.push({elem:J,fn:I})}}});n.each(E,function(){if(!G.isImmediatePropagationStopped()&&this.fn.call(this.elem,G,this.fn.data)===false){F=false}});return F}function i(E,D){return["live",E,D.replace(/\./g,"`").replace(/ /g,"|")].join(".")}n.extend({isReady:false,readyList:[],ready:function(){if(!n.isReady){n.isReady=true;if(n.readyList){n.each(n.readyList,function(){this.call(document,n)});n.readyList=null}n(document).triggerHandler("ready")}}});var w=false;function A(){if(w){return}w=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);n.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);n.ready()}});if(document.documentElement.doScroll&&!l.frameElement){(function(){if(n.isReady){return}try{document.documentElement.doScroll("left")}catch(D){setTimeout(arguments.callee,0);return}n.ready()})()}}}n.event.add(l,"load",n.ready)}n.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(E,D){n.fn[D]=function(F){return F?this.bind(D,F):this.trigger(D)}});n(l).bind("unload",function(){for(var D in n.cache){if(D!=1&&n.cache[D].handle){n.event.remove(n.cache[D].handle.elem)}}});(function(){n.support={};var E=document.documentElement,F=document.createElement("script"),J=document.createElement("div"),I="script"+(new Date).getTime();J.style.display="none";J.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var G=J.getElementsByTagName("*"),D=J.getElementsByTagName("a")[0];if(!G||!G.length||!D){return}n.support={leadingWhitespace:J.firstChild.nodeType==3,tbody:!J.getElementsByTagName("tbody").length,objectAll:!!J.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!J.getElementsByTagName("link").length,style:/red/.test(D.getAttribute("style")),hrefNormalized:D.getAttribute("href")==="/a",opacity:D.style.opacity==="0.5",cssFloat:!!D.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};F.type="text/javascript";try{F.appendChild(document.createTextNode("window."+I+"=1;"))}catch(H){}E.insertBefore(F,E.firstChild);if(l[I]){n.support.scriptEval=true;delete l[I]}E.removeChild(F);if(J.attachEvent&&J.fireEvent){J.attachEvent("onclick",function(){n.support.noCloneEvent=false;J.detachEvent("onclick",arguments.callee)});J.cloneNode(true).fireEvent("onclick")}n(function(){var K=document.createElement("div");K.style.width="1px";K.style.paddingLeft="1px";document.body.appendChild(K);n.boxModel=n.support.boxModel=K.offsetWidth===2;document.body.removeChild(K)})})();var v=n.support.cssFloat?"cssFloat":"styleFloat";n.props={"for":"htmlFor","class":"className","float":v,cssFloat:v,styleFloat:v,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};n.fn.extend({_load:n.fn.load,load:function(F,I,J){if(typeof F!=="string"){return this._load(F)}var H=F.indexOf(" ");if(H>=0){var D=F.slice(H,F.length);F=F.slice(0,H)}var G="GET";if(I){if(n.isFunction(I)){J=I;I=null}else{if(typeof I==="object"){I=n.param(I);G="POST"}}}var E=this;n.ajax({url:F,type:G,dataType:"html",data:I,complete:function(L,K){if(K=="success"||K=="notmodified"){E.html(D?n("<div/>").append(L.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(D):L.responseText)}if(J){E.each(J,[L.responseText,K,L])}}});return this},serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?n.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))}).map(function(D,E){var F=n(this).val();return F==null?null:n.isArray(F)?n.map(F,function(H,G){return{name:E.name,value:H}}):{name:E.name,value:F}}).get()}});n.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(D,E){n.fn[E]=function(F){return this.bind(E,F)}});var q=e();n.extend({get:function(D,F,G,E){if(n.isFunction(F)){G=F;F=null}return n.ajax({type:"GET",url:D,data:F,success:G,dataType:E})},getScript:function(D,E){return n.get(D,null,E,"script")},getJSON:function(D,E,F){return n.get(D,E,F,"json")},post:function(D,F,G,E){if(n.isFunction(F)){G=F;F={}}return n.ajax({type:"POST",url:D,data:F,success:G,dataType:E})},ajaxSetup:function(D){n.extend(n.ajaxSettings,D)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(L){L=n.extend(true,L,n.extend(true,{},n.ajaxSettings,L));var V,E=/=\?(&|$)/g,Q,U,F=L.type.toUpperCase();if(L.data&&L.processData&&typeof L.data!=="string"){L.data=n.param(L.data)}if(L.dataType=="jsonp"){if(F=="GET"){if(!L.url.match(E)){L.url+=(L.url.match(/\?/)?"&":"?")+(L.jsonp||"callback")+"=?"}}else{if(!L.data||!L.data.match(E)){L.data=(L.data?L.data+"&":"")+(L.jsonp||"callback")+"=?"}}L.dataType="json"}if(L.dataType=="json"&&(L.data&&L.data.match(E)||L.url.match(E))){V="jsonp"+q++;if(L.data){L.data=(L.data+"").replace(E,"="+V+"$1")}L.url=L.url.replace(E,"="+V+"$1");L.dataType="script";l[V]=function(W){U=W;H();K();l[V]=g;try{delete l[V]}catch(X){}if(G){G.removeChild(S)}}}if(L.dataType=="script"&&L.cache==null){L.cache=false}if(L.cache===false&&F=="GET"){var D=e();var T=L.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+D+"$2");L.url=T+((T==L.url)?(L.url.match(/\?/)?"&":"?")+"_="+D:"")}if(L.data&&F=="GET"){L.url+=(L.url.match(/\?/)?"&":"?")+L.data;L.data=null}if(L.global&&!n.active++){n.event.trigger("ajaxStart")}var P=/^(\w+:)?\/\/([^\/?#]+)/.exec(L.url);if(L.dataType=="script"&&F=="GET"&&P&&(P[1]&&P[1]!=location.protocol||P[2]!=location.host)){var G=document.getElementsByTagName("head")[0];var S=document.createElement("script");S.src=L.url;if(L.scriptCharset){S.charset=L.scriptCharset}if(!V){var N=false;S.onload=S.onreadystatechange=function(){if(!N&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){N=true;H();K();G.removeChild(S)}}}G.appendChild(S);return g}var J=false;var I=L.xhr();if(L.username){I.open(F,L.url,L.async,L.username,L.password)}else{I.open(F,L.url,L.async)}try{if(L.data){I.setRequestHeader("Content-Type",L.contentType)}if(L.ifModified){I.setRequestHeader("If-Modified-Since",n.lastModified[L.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}I.setRequestHeader("X-Requested-With","XMLHttpRequest");I.setRequestHeader("Accept",L.dataType&&L.accepts[L.dataType]?L.accepts[L.dataType]+", */*":L.accepts._default)}catch(R){}if(L.beforeSend&&L.beforeSend(I,L)===false){if(L.global&&!--n.active){n.event.trigger("ajaxStop")}I.abort();return false}if(L.global){n.event.trigger("ajaxSend",[I,L])}var M=function(W){if(I.readyState==0){if(O){clearInterval(O);O=null;if(L.global&&!--n.active){n.event.trigger("ajaxStop")}}}else{if(!J&&I&&(I.readyState==4||W=="timeout")){J=true;if(O){clearInterval(O);O=null}Q=W=="timeout"?"timeout":!n.httpSuccess(I)?"error":L.ifModified&&n.httpNotModified(I,L.url)?"notmodified":"success";if(Q=="success"){try{U=n.httpData(I,L.dataType,L)}catch(Y){Q="parsererror"}}if(Q=="success"){var X;try{X=I.getResponseHeader("Last-Modified")}catch(Y){}if(L.ifModified&&X){n.lastModified[L.url]=X}if(!V){H()}}else{n.handleError(L,I,Q)}K();if(L.async){I=null}}}};if(L.async){var O=setInterval(M,13);if(L.timeout>0){setTimeout(function(){if(I){if(!J){M("timeout")}if(I){I.abort()}}},L.timeout)}}try{I.send(L.data)}catch(R){n.handleError(L,I,null,R)}if(!L.async){M()}function H(){if(L.success){L.success(U,Q)}if(L.global){n.event.trigger("ajaxSuccess",[I,L])}}function K(){if(L.complete){L.complete(I,Q)}if(L.global){n.event.trigger("ajaxComplete",[I,L])}if(L.global&&!--n.active){n.event.trigger("ajaxStop")}}return I},handleError:function(E,G,D,F){if(E.error){E.error(G,D,F)}if(E.global){n.event.trigger("ajaxError",[G,E,F])}},active:0,httpSuccess:function(E){try{return !E.status&&location.protocol=="file:"||(E.status>=200&&E.status<300)||E.status==304||E.status==1223}catch(D){}return false},httpNotModified:function(F,D){try{var G=F.getResponseHeader("Last-Modified");return F.status==304||G==n.lastModified[D]}catch(E){}return false},httpData:function(I,G,F){var E=I.getResponseHeader("content-type"),D=G=="xml"||!G&&E&&E.indexOf("xml")>=0,H=D?I.responseXML:I.responseText;if(D&&H.documentElement.tagName=="parsererror"){throw"parsererror"}if(F&&F.dataFilter){H=F.dataFilter(H,G)}if(typeof H==="string"){if(G=="script"){n.globalEval(H)}if(G=="json"){H=l["eval"]("("+H+")")}}return H},param:function(D){var F=[];function G(H,I){F[F.length]=encodeURIComponent(H)+"="+encodeURIComponent(I)}if(n.isArray(D)||D.jquery){n.each(D,function(){G(this.name,this.value)})}else{for(var E in D){if(n.isArray(D[E])){n.each(D[E],function(){G(E,this)})}else{G(E,n.isFunction(D[E])?D[E]():D[E])}}}return F.join("&").replace(/%20/g,"+")}});var m={},d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function s(E,D){var F={};n.each(d.concat.apply([],d.slice(0,D)),function(){F[this]=E});return F}n.fn.extend({show:function(I,K){if(I){return this.animate(s("show",3),I,K)}else{for(var G=0,E=this.length;G<E;G++){var D=n.data(this[G],"olddisplay");this[G].style.display=D||"";if(n.css(this[G],"display")==="none"){var F=this[G].tagName,J;if(m[F]){J=m[F]}else{var H=n("<"+F+" />").appendTo("body");J=H.css("display");if(J==="none"){J="block"}H.remove();m[F]=J}this[G].style.display=n.data(this[G],"olddisplay",J)}}return this}},hide:function(G,H){if(G){return this.animate(s("hide",3),G,H)}else{for(var F=0,E=this.length;F<E;F++){var D=n.data(this[F],"olddisplay");if(!D&&D!=="none"){n.data(this[F],"olddisplay",n.css(this[F],"display"))}this[F].style.display="none"}return this}},_toggle:n.fn.toggle,toggle:function(F,E){var D=typeof F==="boolean";return n.isFunction(F)&&n.isFunction(E)?this._toggle.apply(this,arguments):F==null||D?this.each(function(){var G=D?F:n(this).is(":hidden");n(this)[G?"show":"hide"]()}):this.animate(s("toggle",3),F,E)},fadeTo:function(D,F,E){return this.animate({opacity:F},D,E)},animate:function(H,E,G,F){var D=n.speed(E,G,F);return this[D.queue===false?"each":"queue"](function(){var J=n.extend({},D),L,K=this.nodeType==1&&n(this).is(":hidden"),I=this;for(L in H){if(H[L]=="hide"&&K||H[L]=="show"&&!K){return J.complete.call(this)}if((L=="height"||L=="width")&&this.style){J.display=n.css(this,"display");J.overflow=this.style.overflow}}if(J.overflow!=null){this.style.overflow="hidden"}J.curAnim=n.extend({},H);n.each(H,function(N,R){var Q=new n.fx(I,J,N);if(/toggle|show|hide/.test(R)){Q[R=="toggle"?K?"show":"hide":R](H)}else{var P=R.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),S=Q.cur(true)||0;if(P){var M=parseFloat(P[2]),O=P[3]||"px";if(O!="px"){I.style[N]=(M||1)+O;S=((M||1)/Q.cur(true))*S;I.style[N]=S+O}if(P[1]){M=((P[1]=="-="?-1:1)*M)+S}Q.custom(S,M,O)}else{Q.custom(S,R,"")}}});return true})},stop:function(E,D){var F=n.timers;if(E){this.queue([])}this.each(function(){for(var G=F.length-1;G>=0;G--){if(F[G].elem==this){if(D){F[G](true)}F.splice(G,1)}}});if(!D){this.dequeue()}return this}});n.each({slideDown:s("show",1),slideUp:s("hide",1),slideToggle:s("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(D,E){n.fn[D]=function(F,G){return this.animate(E,F,G)}});n.extend({speed:function(F,G,E){var D=typeof F==="object"?F:{complete:E||!E&&G||n.isFunction(F)&&F,duration:F,easing:E&&G||G&&!n.isFunction(G)&&G};D.duration=n.fx.off?0:typeof D.duration==="number"?D.duration:n.fx.speeds[D.duration]||n.fx.speeds._default;D.old=D.complete;D.complete=function(){if(D.queue!==false){n(this).dequeue()}if(n.isFunction(D.old)){D.old.call(this)}};return D},easing:{linear:function(F,G,D,E){return D+E*F},swing:function(F,G,D,E){return((-Math.cos(F*Math.PI)/2)+0.5)*E+D}},timers:[],timerId:null,fx:function(E,D,F){this.options=D;this.elem=E;this.prop=F;if(!D.orig){D.orig={}}}});n.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(n.fx.step[this.prop]||n.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(E){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var D=parseFloat(n.css(this.elem,this.prop,E));return D&&D>-10000?D:parseFloat(n.curCSS(this.elem,this.prop))||0},custom:function(H,G,F){this.startTime=e();this.start=H;this.end=G;this.unit=F||this.unit||"px";this.now=this.start;this.pos=this.state=0;var D=this;function E(I){return D.step(I)}E.elem=this.elem;n.timers.push(E);if(E()&&n.timerId==null){n.timerId=setInterval(function(){var J=n.timers;for(var I=0;I<J.length;I++){if(!J[I]()){J.splice(I--,1)}}if(!J.length){clearInterval(n.timerId);n.timerId=null}},13)}},show:function(){this.options.orig[this.prop]=n.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());n(this.elem).show()},hide:function(){this.options.orig[this.prop]=n.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(G){var F=e();if(G||F>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var D=true;for(var E in this.options.curAnim){if(this.options.curAnim[E]!==true){D=false}}if(D){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(n.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){n(this.elem).hide()}if(this.options.hide||this.options.show){for(var H in this.options.curAnim){n.attr(this.elem.style,H,this.options.orig[H])}}}if(D){this.options.complete.call(this.elem)}return false}else{var I=F-this.startTime;this.state=I/this.options.duration;this.pos=n.easing[this.options.easing||(n.easing.swing?"swing":"linear")](this.state,I,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};n.extend(n.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(D){n.attr(D.elem.style,"opacity",D.now)},_default:function(D){if(D.elem.style&&D.elem.style[D.prop]!=null){D.elem.style[D.prop]=D.now+D.unit}else{D.elem[D.prop]=D.now}}}});if(document.documentElement.getBoundingClientRect){n.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return n.offset.bodyOffset(this[0])}var F=this[0].getBoundingClientRect(),I=this[0].ownerDocument,E=I.body,D=I.documentElement,K=D.clientTop||E.clientTop||0,J=D.clientLeft||E.clientLeft||0,H=F.top+(self.pageYOffset||n.boxModel&&D.scrollTop||E.scrollTop)-K,G=F.left+(self.pageXOffset||n.boxModel&&D.scrollLeft||E.scrollLeft)-J;return{top:H,left:G}}}else{n.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return n.offset.bodyOffset(this[0])}n.offset.initialized||n.offset.initialize();var I=this[0],F=I.offsetParent,E=I,N=I.ownerDocument,L,G=N.documentElement,J=N.body,K=N.defaultView,D=K.getComputedStyle(I,null),M=I.offsetTop,H=I.offsetLeft;while((I=I.parentNode)&&I!==J&&I!==G){L=K.getComputedStyle(I,null);M-=I.scrollTop,H-=I.scrollLeft;if(I===F){M+=I.offsetTop,H+=I.offsetLeft;if(n.offset.doesNotAddBorder&&!(n.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(I.tagName))){M+=parseInt(L.borderTopWidth,10)||0,H+=parseInt(L.borderLeftWidth,10)||0}E=F,F=I.offsetParent}if(n.offset.subtractsBorderForOverflowNotVisible&&L.overflow!=="visible"){M+=parseInt(L.borderTopWidth,10)||0,H+=parseInt(L.borderLeftWidth,10)||0}D=L}if(D.position==="relative"||D.position==="static"){M+=J.offsetTop,H+=J.offsetLeft}if(D.position==="fixed"){M+=Math.max(G.scrollTop,J.scrollTop),H+=Math.max(G.scrollLeft,J.scrollLeft)}return{top:M,left:H}}}n.offset={initialize:function(){if(this.initialized){return}var K=document.body,E=document.createElement("div"),G,F,M,H,L,D,I=K.style.marginTop,J='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"cellpadding="0"cellspacing="0"><tr><td></td></tr></table>';L={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(D in L){E.style[D]=L[D]}E.innerHTML=J;K.insertBefore(E,K.firstChild);G=E.firstChild,F=G.firstChild,H=G.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(F.offsetTop!==5);this.doesAddBorderForTableAndCells=(H.offsetTop===5);G.style.overflow="hidden",G.style.position="relative";this.subtractsBorderForOverflowNotVisible=(F.offsetTop===-5);K.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(K.offsetTop===0);K.style.marginTop=I;K.removeChild(E);this.initialized=true},bodyOffset:function(D){n.offset.initialized||n.offset.initialize();var F=D.offsetTop,E=D.offsetLeft;if(n.offset.doesNotIncludeMarginInBodyOffset){F+=parseInt(n.curCSS(D,"marginTop",true),10)||0,E+=parseInt(n.curCSS(D,"marginLeft",true),10)||0}return{top:F,left:E}}};n.fn.extend({position:function(){var H=0,G=0,E;if(this[0]){var F=this.offsetParent(),I=this.offset(),D=/^body|html$/i.test(F[0].tagName)?{top:0,left:0}:F.offset();I.top-=j(this,"marginTop");I.left-=j(this,"marginLeft");D.top+=j(F,"borderTopWidth");D.left+=j(F,"borderLeftWidth");E={top:I.top-D.top,left:I.left-D.left}}return E},offsetParent:function(){var D=this[0].offsetParent||document.body;while(D&&(!/^body|html$/i.test(D.tagName)&&n.css(D,"position")=="static")){D=D.offsetParent}return n(D)}});n.each(["Left","Top"],function(E,D){var F="scroll"+D;n.fn[F]=function(G){if(!this[0]){return null}return G!==g?this.each(function(){this==l||this==document?l.scrollTo(!E?G:n(l).scrollLeft(),E?G:n(l).scrollTop()):this[F]=G}):this[0]==l||this[0]==document?self[E?"pageYOffset":"pageXOffset"]||n.boxModel&&document.documentElement[F]||document.body[F]:this[0][F]}});n.each(["Height","Width"],function(G,E){var D=G?"Left":"Top",F=G?"Right":"Bottom";n.fn["inner"+E]=function(){return this[E.toLowerCase()]()+j(this,"padding"+D)+j(this,"padding"+F)};n.fn["outer"+E]=function(I){return this["inner"+E]()+j(this,"border"+D+"Width")+j(this,"border"+F+"Width")+(I?j(this,"margin"+D)+j(this,"margin"+F):0)};var H=E.toLowerCase();n.fn[H]=function(I){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+E]||document.body["client"+E]:this[0]==document?Math.max(document.documentElement["client"+E],document.body["scroll"+E],document.documentElement["scroll"+E],document.body["offset"+E],document.documentElement["offset"+E]):I===g?(this.length?n.css(this[0],H):null):this.css(H,typeof I==="string"?I:I+"px")}})})();
\ No newline at end of file diff --git a/js/xbImportNode.js b/js/xbImportNode.js deleted file mode 100644 index 1da6bae69..000000000 --- a/js/xbImportNode.js +++ /dev/null @@ -1,46 +0,0 @@ -/* is this stuff defined? */ -if (!document.ELEMENT_NODE) { - document.ELEMENT_NODE = 1; - document.ATTRIBUTE_NODE = 2; - document.TEXT_NODE = 3; - document.CDATA_SECTION_NODE = 4; - document.ENTITY_REFERENCE_NODE = 5; - document.ENTITY_NODE = 6; - document.PROCESSING_INSTRUCTION_NODE = 7; - document.COMMENT_NODE = 8; - document.DOCUMENT_NODE = 9; - document.DOCUMENT_TYPE_NODE = 10; - document.DOCUMENT_FRAGMENT_NODE = 11; - document.NOTATION_NODE = 12; -} - -document._importNode = function(node, allChildren) { - /* find the node type to import */ - switch (node.nodeType) { - case document.ELEMENT_NODE: - /* create a new element */ - var newNode = document.createElement(node.nodeName); - /* does the node have any attributes to add? */ - if (node.attributes && node.attributes.length > 0) - /* add all of the attributes */ - for (var i = 0, il = node.attributes.length; i < il;) { - if (node.attributes[i].nodeName == 'class') { - newNode.className = node.getAttribute(node.attributes[i++].nodeName); - } else { - newNode.setAttribute(node.attributes[i].nodeName, node.getAttribute(node.attributes[i++].nodeName)); - } - } - /* are we going after children too, and does the node have any? */ - if (allChildren && node.childNodes && node.childNodes.length > 0) - /* recursively get all of the child nodes */ - for (var i = 0, il = node.childNodes.length; i < il;) - newNode.appendChild(document._importNode(node.childNodes[i++], allChildren)); - return newNode; - break; - case document.TEXT_NODE: - case document.CDATA_SECTION_NODE: - case document.COMMENT_NODE: - return document.createTextNode(node.nodeValue); - break; - } -}; diff --git a/lib/action.php b/lib/action.php index 486b40387..792b9c057 100644 --- a/lib/action.php +++ b/lib/action.php @@ -1,9 +1,12 @@ <?php /** - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, Controlez-Vous, Inc. + * Laconica, the distributed open-source microblogging tool * - * This program is free software: you can redistribute it and/or modify + * Base class for all actions (~views) + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -15,19 +18,61 @@ * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Action + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @copyright 2008 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 Action // lawsuit -{ +require_once INSTALLDIR.'/lib/noticeform.php'; +require_once INSTALLDIR.'/lib/htmloutputter.php'; + +/** + * Base class for all actions + * + * This is the base class for all actions in the package. An action is + * more or less a "view" in an MVC framework. + * + * Actions are responsible for extracting and validating parameters; using + * model classes to read and write to the database; and doing ouput. + * + * @category Output + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see HTMLOutputter + */ +class Action extends HTMLOutputter // lawsuit +{ var $args; - function Action() + /** + * Constructor + * + * Just wraps the HTMLOutputter constructor. + * + * @param string $output URI to output to, default = stdout + * @param boolean $indent Whether to indent output, default true + * + * @see XMLOutputter::__construct + * @see HTMLOutputter::__construct + */ + + function __construct($output='php://output', $indent=true) { + parent::__construct($output, $indent); } // For initializing members of the class @@ -38,6 +83,372 @@ class Action // lawsuit return true; } + function showPage() + { + $this->startHTML(); + $this->showHead(); + $this->showBody(); + $this->endHTML(); + } + + function showHead() + { + // XXX: attributes (profile?) + $this->elementStart('head'); + $this->showTitle(); + $this->showStylesheets(); + $this->showScripts(); + $this->showOpenSearch(); + $this->showFeeds(); + $this->showDescription(); + $this->extraHead(); + $this->elementEnd('head'); + } + + function showTitle() + { + $this->element('title', null, + sprintf(_("%s - %s"), + $this->title(), + common_config('site', 'name'))); + } + + // SHOULD overload + + function title() + { + return _("Untitled page"); + } + + function showStylesheets() + { + $this->element('link', array('rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => theme_path('css/display.css', 'base') . '?version=' . LACONICA_VERSION, + 'media' => 'screen, projection, tv')); + $this->element('link', array('rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => theme_path('css/thickbox.css', 'base') . '?version=' . LACONICA_VERSION, + 'media' => 'screen, projection, tv')); + $this->element('link', array('rel' => 'stylesheet', + 'type' => 'text/css', + 'href' => theme_path('css/display.css', null) . '?version=' . LACONICA_VERSION, + 'media' => 'screen, projection, tv')); + foreach (array(6,7) as $ver) { + if (file_exists(theme_file('ie'.$ver.'.css'))) { + // Yes, IE people should be put in jail. + $this->comment('[if lte IE '.$ver.']><link rel="stylesheet" type="text/css" '. + 'href="'.theme_path('ie'.$ver.'.css').'?version='.LACONICA_VERSION.'" /><![endif]'); + } + } + } + + function showScripts() + { + $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/xbImportNode.js')), + ' '); + $this->element('script', array('type' => 'text/javascript', + 'src' => common_path('js/util.js?version='.LACONICA_VERSION)), + ' '); + } + + function showOpenSearch() + { + $this->element('link', array('rel' => 'search', 'type' => 'application/opensearchdescription+xml', + 'href' => common_local_url('opensearch', array('type' => 'people')), + 'title' => common_config('site', 'name').' People Search')); + + $this->element('link', array('rel' => 'search', 'type' => 'application/opensearchdescription+xml', + 'href' => common_local_url('opensearch', array('type' => 'notice')), + 'title' => common_config('site', 'name').' Notice Search')); + } + + // MAY overload + + function showFeeds() + { + // does nothing by default + } + + // SHOULD overload + + function showDescription() + { + // does nothing by default + } + + // MAY overload + + function extraHead() + { + // does nothing by default + } + + function showBody() + { + $this->elementStart('body', array('id' => $this->trimmed('action'))); + $this->elementStart('div', 'wrap'); + $this->showHeader(); + $this->showCore(); + $this->showFooter(); + $this->elementEnd('div'); + $this->elementEnd('body'); + } + + function showHeader() + { + $this->elementStart('div', array('id' => 'header')); + $this->showLogo(); + $this->showPrimaryNav(); + $this->showSiteNotice(); + if (common_logged_in()) { + $this->showNoticeForm(); + } else { + $this->showAnonymousMessage(); + } + $this->elementEnd('div'); + } + + function showLogo() + { + $this->elementStart('address', array('id' => 'site_contact', + 'class' => 'vcard')); + $this->elementStart('a', array('class' => 'url home bookmark', + 'href' => common_local_url('public'))); + if (common_config('site', 'logo') || file_exists(theme_file('logo.png'))) + { + $this->element('img', array('class' => 'logo photo', + 'src' => (common_config('site', 'logo')) ? common_config('site', 'logo') : theme_path('logo.png'), + 'alt' => common_config('site', 'name'))); + } + $this->element('span', array('class' => 'fn org'), common_config('site', 'name')); + $this->elementEnd('a'); + $this->elementEnd('address'); + } + + function showPrimaryNav() + { + $this->elementStart('dl', array('id' => 'site_nav_global_primary')); + $this->element('dt', null, _('Primary site navigation')); + $this->elementStart('dd'); + $user = common_current_user(); + $this->elementStart('ul', array('class' => 'nav')); + if ($user) { + $this->menuItem(common_local_url('all', array('nickname' => $user->nickname)), + _('Home')); + } + $this->menuItem(common_local_url('peoplesearch'), _('Search')); + if ($user) { + $this->menuItem(common_local_url('profilesettings'), + _('Settings')); + $this->menuItem(common_local_url('invite'), + _('Invite')); + $this->menuItem(common_local_url('logout'), + _('Logout')); + } else { + $this->menuItem(common_local_url('login'), _('Login')); + if (!common_config('site', 'closed')) { + $this->menuItem(common_local_url('register'), _('Register')); + } + $this->menuItem(common_local_url('openidlogin'), _('OpenID')); + } + $this->menuItem(common_local_url('doc', array('title' => 'help')), + _('Help')); + $this->elementEnd('ul'); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + } + + // Revist. Should probably do an hAtom pattern here + function showSiteNotice() + { + $text = common_config('site', 'notice'); + if ($text) { + $this->elementStart('dl', array('id' => 'site_notice', + 'class' => 'system_notice')); + $this->element('dt', null, _('Site notice')); + $this->element('dd', null, $text); + $this->elementEnd('dl'); + } + } + + // MAY overload if no notice form needed... or direct message box???? + + function showNoticeForm() + { + $notice_form = new NoticeForm($this); + $notice_form->show(); + } + + function showAnonymousMessage() + { + // needs to be defined by the class + } + + function showCore() + { + $this->elementStart('div', array('id' => 'core')); + $this->elementStart('dl', array('id' => 'site_nav_local_views')); + $this->element('dt', null, _('Local views')); + $this->elementStart('dd'); + $this->showLocalNav(); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + $this->showContentBlock(); + $this->showAside(); + $this->elementEnd('div'); + } + + // SHOULD overload + + function showLocalNav() + { + // does nothing by default + } + + function showContentBlock() + { + $this->elementStart('div', array('id' => 'content')); + $this->showPageTitle(); + $this->showPageNoticeBlock(); + $this->elementStart('div', array('id' => 'content_inner')); + // show the actual content (forms, lists, whatever) + $this->showContent(); + $this->elementEnd('div'); + $this->elementEnd('div'); + } + + function showPageTitle() { + $this->element('h1', NULL, $this->title()); + } + + function showPageNoticeBlock() + { + $this->elementStart('dl', array('id' => 'page_notice', + 'class' => 'system_notice')); + $this->element('dt', null, _('Page notice')); + $this->elementStart('dd'); + $this->showPageNotice(); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + } + + // SHOULD overload (unless there's not a notice) + + function showPageNotice() + { + } + + // MUST overload + + function showContent() + { + } + + function showAside() + { + $this->elementStart('div', array('id' => 'aside_primary', + 'class' => 'aside')); + $this->showExportData(); + $this->showSections(); + $this->elementEnd('div'); + } + + // MAY overload if there are feeds + + function showExportData() + { + // is there structure to this? + // list of (visible!) feed links + // can we reuse list of feeds from showFeeds() ? + } + + // SHOULD overload + + function showSections() { + // for each section, show it + } + + function showFooter() + { + $this->elementStart('div', array('id' => 'footer')); + $this->showSecondaryNav(); + $this->showLicenses(); + $this->elementEnd('div'); + } + + function showSecondaryNav() + { + $this->elementStart('dl', array('id' => 'site_nav_global_secondary')); + $this->element('dt', null, _('Secondary site navigation')); + $this->elementStart('dd', null); + $this->elementStart('ul', array('class' => 'nav')); + $this->menuItem(common_local_url('doc', array('title' => 'help')), + _('Help')); + $this->menuItem(common_local_url('doc', array('title' => 'about')), + _('About')); + $this->menuItem(common_local_url('doc', array('title' => 'faq')), + _('FAQ')); + $this->menuItem(common_local_url('doc', array('title' => 'privacy')), + _('Privacy')); + $this->menuItem(common_local_url('doc', array('title' => 'source')), + _('Source')); + $this->menuItem(common_local_url('doc', array('title' => 'contact')), + _('Contact')); + $this->elementEnd('ul'); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + } + + function showLicenses() + { + $this->elementStart('dl', array('id' => 'licenses')); + $this->showLaconicaLicense(); + $this->showContentLicense(); + $this->elementEnd('dl'); + } + + function showLaconicaLicense() + { + $this->element('dt', array('id' => 'site_laconica_license'), _('Laconica software license')); + $this->elementStart('dd', null); + if (common_config('site', 'broughtby')) { + $instr = _('**%%site.name%%** is a microblogging service brought to you by [%%site.broughtby%%](%%site.broughtbyurl%%). '); + } else { + $instr = _('**%%site.name%%** is a microblogging service. '); + } + $instr .= sprintf(_('It runs the [Laconica](http://laconi.ca/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), LACONICA_VERSION); + $output = common_markup_to_html($instr); + $this->raw($output); + $this->elementEnd('dd'); + // do it + } + + function showContentLicense() + { + $this->element('dt', array('id' => 'site_content_license'), _('Laconica software license')); + $this->elementStart('dd', array('id' => 'site_content_license_cc')); + $this->elementStart('p'); + $this->text(_('Unless otherwise specified, contents of this site are copyright by the contributors and available under the ')); + $this->element('a', array('class' => 'license', + 'rel' => 'external license', + 'href' => common_config('license', 'url')), + common_config('license', 'title')); + $this->text(_('. Contributors should be attributed by full name or nickname.')); + $this->elementEnd('p'); + $this->element('img', array('id' => 'license_cc', + 'src' => common_config('license', 'image'), + 'alt' => common_config('license', 'title'))); + $this->elementEnd('dd'); + } + // For comparison with If-Last-Modified // If not applicable, return null @@ -51,7 +462,7 @@ class Action // lawsuit return null; } - function is_readonly() + function isReadOnly() { return false; } @@ -120,14 +531,14 @@ class Action // lawsuit } } - function server_error($msg, $code=500) + function serverError($msg, $code=500) { $action = $this->trimmed('action'); common_debug("Server error '$code' on '$action': $msg", __FILE__); common_server_error($msg, $code); } - function client_error($msg, $code=400) + function clientError($msg, $code=400) { $action = $this->trimmed('action'); common_debug("User error '$code' on '$action': $msg", __FILE__); @@ -145,17 +556,61 @@ class Action // lawsuit return common_local_url($action, $args); } - function nav_menu($menu) + // Added @id to li for some control. + // XXX: We might want to move this to htmloutputter.php + + function menuItem($url, $text, $title=null, $is_selected=false, $id=null) { - $action = $this->trimmed('action'); - common_element_start('ul', array('id' => 'nav_views')); - foreach ($menu as $menuaction => $menudesc) { - common_menu_item(common_local_url($menuaction, - isset($menudesc[2]) ? $menudesc[2] : null), - $menudesc[0], - $menudesc[1], - $action == $menuaction); - } - common_element_end('ul'); + $lattrs = array(); + if ($is_selected) { + $lattrs['class'] = 'current'; + } + + $this->elementStart('li', (is_null($id)) ? null : array('id' => $id), $lattrs); + $attrs['href'] = $url; + if ($title) { + $attrs['title'] = $title; + } + $this->element('a', $attrs, $text); + $this->elementEnd('li'); + } + + // Does a little before-after block for next/prev page + + function pagination($have_before, $have_after, $page, $action, $args=null) + { + if ($have_before || $have_after) { + $this->elementStart('div', array('class' => 'pagination')); + $this->elementStart('dl', null); + $this->element('dt', null, _('Pagination')); + $this->elementStart('dd', null); + $this->elementStart('ul', array('class' => 'nav')); + } + + if ($have_before) { + $pargs = array('page' => $page-1); + $newargs = ($args) ? array_merge($args,$pargs) : $pargs; + + $this->elementStart('li', array('class' => 'nav_prev')); + $this->element('a', array('href' => common_local_url($action, $newargs), 'rel' => 'prev'), + _('After')); + $this->elementEnd('li'); + } + + if ($have_after) { + $pargs = array('page' => $page+1); + $newargs = ($args) ? array_merge($args,$pargs) : $pargs; + $this->elementStart('li', array('class' => 'nav_next')); + $this->element('a', array('href' => common_local_url($action, $newargs), 'rel' => 'next'), + _('Before')); + $this->elementEnd('li'); + } + + if ($have_before || $have_after) { + $this->elementEnd('ul'); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + $this->elementEnd('div'); + } } } diff --git a/lib/blockform.php b/lib/blockform.php new file mode 100644 index 000000000..51e43f8b5 --- /dev/null +++ b/lib/blockform.php @@ -0,0 +1,130 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Form for blocking a user + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @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); +} + +require_once INSTALLDIR.'/lib/form.php'; + +/** + * Form for blocking a user + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see UnblockForm + */ + +class BlockForm extends Form +{ + /** + * Profile of user to block + */ + + var $profile = null; + + /** + * Return-to args + */ + + var $args = null; + + /** + * Constructor + * + * @param HTMLOutputter $out output channel + * @param Profile $profile profile of user to block + * @param array $args return-to args + */ + + function __construct($out=null, $profile=null, $args=null) + { + parent::__construct($out); + + $this->profile = $profile; + $this->args = $args; + } + + /** + * ID of the form + * + * @return int ID of the form + */ + + function id() + { + return 'block-' . $this->profile->id; + } + + /** + * Action of the form + * + * @return string URL of the action + */ + + function action() + { + return common_local_url('block'); + } + + /** + * Data elements of the form + * + * @return void + */ + + function formData() + { + $this->out->hidden('blockto-' . $this->profile->id, + $this->profile->id, + 'blockto'); + if ($this->args) { + foreach ($this->args as $k => $v) { + $this->out->hidden('returnto-' . $k, $v); + } + } + } + + /** + * Action elements + * + * @return void + */ + + function formActions() + { + $this->out->submit('submit', _('Block')); + } +}
\ No newline at end of file diff --git a/lib/common.php b/lib/common.php index 74c992f1c..2ef26cfc6 100644 --- a/lib/common.php +++ b/lib/common.php @@ -169,5 +169,7 @@ function __autoload($class) require_once('OAuth.php'); } else if (file_exists(INSTALLDIR.'/classes/' . $class . '.php')) { require_once(INSTALLDIR.'/classes/' . $class . '.php'); + } else if (file_exists(INSTALLDIR.'/lib/' . strtolower($class) . '.php')) { + require_once(INSTALLDIR.'/lib/' . strtolower($class) . '.php'); } } diff --git a/lib/disfavorform.php b/lib/disfavorform.php new file mode 100644 index 000000000..ffca0cd8b --- /dev/null +++ b/lib/disfavorform.php @@ -0,0 +1,142 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Form for disfavoring a notice + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @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); +} + +require_once INSTALLDIR.'/lib/form.php'; + +/** + * Form for disfavoring a notice + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see FavorForm + */ + +class DisfavorForm extends Form +{ + /** + * Notice to disfavor + */ + + var $notice = null; + + /** + * Constructor + * + * @param HTMLOutputter $out output channel + * @param Notice $notice notice to disfavor + */ + + function __construct($out=null, $notice=null) + { + parent::__construct($out); + + $this->notice = $notice; + } + + /** + * ID of the form + * + * @return int ID of the form + */ + + function id() + { + return 'disfavor-' . $this->notice->id; + } + + /** + * Action of the form + * + * @return string URL of the action + */ + + function action() + { + common_local_url('disfavor'); + } + + /** + * Include a session token for CSRF protection + * + * @return void + */ + + function sessionToken() + { + $this->out->hidden('token-' . $this->notice->id, + common_session_token()); + } + + /** + * Data elements + * + * @return void + */ + + function formData() + { + $this->out->hidden('notice-n'.$this->notice->id, + $this->notice->id, + 'notice'); + } + + /** + * Action elements + * + * @return void + */ + + function formActions() + { + $this->out->submit('disfavor-submit-' . $this->notice->id, + _('Disfavor favorite')); + } + + /** + * Class of the form. + * + * @return string the form's class + */ + + function formClass() + { + return 'disfavor'; + } + +}
\ No newline at end of file diff --git a/lib/favorform.php b/lib/favorform.php new file mode 100644 index 000000000..977f19183 --- /dev/null +++ b/lib/favorform.php @@ -0,0 +1,153 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Form for favoring a notice + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @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); +} + +require_once INSTALLDIR.'/lib/form.php'; + +/** + * Form for favoring a notice + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see DisfavorForm + */ + +class FavorForm extends Form +{ + /** + * Notice to favor + */ + + var $notice = null; + + /** + * Constructor + * + * @param HTMLOutputter $out output channel + * @param Notice $notice notice to favor + */ + + function __construct($out=null, $notice=null) + { + parent::__construct($out); + + $this->notice = $notice; + } + + /** + * ID of the form + * + * @return int ID of the form + */ + + function id() + { + return 'favor-' . $this->notice->id; + } + + /** + * Action of the form + * + * @return string URL of the action + */ + + function action() + { + common_local_url('favor'); + } + + /** + * Include a session token for CSRF protection + * + * @return void + */ + + function sessionToken() + { + $this->out->hidden('token-' . $this->notice->id, + common_session_token()); + } + + + /** + * Legend of the Form + * + * @return void + */ + function formLegend() + { + $this->out->element('legend', null, _('Delete this notice')); + } + + + /** + * Data elements + * + * @return void + */ + + function formData() + { + $this->out->hidden('notice-n'.$this->notice->id, + $this->notice->id, + 'notice'); + } + + /** + * Action elements + * + * @return void + */ + + function formActions() + { + $this->out->submit('favor-submit-' . $this->notice->id, + _('Favorite')); + } + + /** + * Class of the form. + * + * @return string the form's class + */ + + function formClass() + { + return 'notice_favorite'; + } +} diff --git a/lib/feedlist.php b/lib/feedlist.php new file mode 100644 index 000000000..47d909e96 --- /dev/null +++ b/lib/feedlist.php @@ -0,0 +1,158 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Widget for showing a list of feeds + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @copyright 2008 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); +} + +/** + * Widget for showing a list of feeds + * + * Typically used for Action::showExportList() + * + * @category Widget + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see Action::showExportList() + */ + +class FeedList extends Widget +{ + var $action = null; + + function __construct($action=null) + { + parent::__construct($action); + $this->action = $action; + } + + function show($feeds) + { + $this->out->elementStart('div', array('id' => 'export_data', + 'class' => 'section')); + $this->out->element('h2', null, _('Export data')); + $this->out->elementStart('ul', array('class' => 'xoxo')); + + foreach ($feeds as $key => $value) { + $this->feedItem($feeds[$key]); + } + + $this->out->elementEnd('ul'); + $this->out->elementEnd('div'); + } + + function feedItem($feed) + { + $nickname = $this->action->trimmed('nickname'); + + switch($feed['item']) { + case 'notices': default: + $feed_classname = $feed['type']; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = "$nickname's ".$feed['version']." notice feed"; + $feed['textContent'] = "RSS"; + break; + + case 'allrss': + $feed_classname = $feed['type']; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = $feed['version']." feed for $nickname and friends"; + $feed['textContent'] = "RSS"; + break; + + case 'repliesrss': + $feed_classname = $feed['type']; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = $feed['version']." feed for replies to $nickname"; + $feed['textContent'] = "RSS"; + break; + + case 'publicrss': + $feed_classname = $feed['type']; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = "Public timeline ".$feed['version']." feed"; + $feed['textContent'] = "RSS"; + break; + + case 'publicatom': + $feed_classname = "atom"; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = "Public timeline ".$feed['version']." feed"; + $feed['textContent'] = "Atom"; + break; + + case 'tagrss': + $feed_classname = $feed['type']; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = $feed['version']." feed for this tag"; + $feed['textContent'] = "RSS"; + break; + + case 'favoritedrss': + $feed_classname = $feed['type']; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = "Favorited ".$feed['version']." feed"; + $feed['textContent'] = "RSS"; + break; + + case 'foaf': + $feed_classname = "foaf"; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = "$nickname's FOAF file"; + $feed['textContent'] = "FOAF"; + break; + + case 'favoritesrss': + $feed_classname = "favorites"; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = "Feed for favorites of $nickname"; + $feed['textContent'] = "RSS"; + break; + + case 'usertimeline': + $feed_classname = "atom"; + $feed_mimetype = "application/".$feed['type']."+xml"; + $feed_title = "$nickname's ".$feed['version']." notice feed"; + $feed['textContent'] = "Atom"; + break; + } + $this->out->elementStart('li'); + $this->out->element('a', array('href' => $feed['href'], + 'class' => $feed_classname, + 'type' => $feed_mimetype, + 'title' => $feed_title), + $feed['textContent']); + $this->out->elementEnd('li'); + } +} diff --git a/lib/form.php b/lib/form.php new file mode 100644 index 000000000..011d4bfc9 --- /dev/null +++ b/lib/form.php @@ -0,0 +1,168 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Base class for forms + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @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); +} + +require_once INSTALLDIR.'/lib/widget.php'; + +/** + * Base class for forms + * + * We have a lot of common forms (subscribe, fave, delete) and this superclass + * lets us abstract out the basic features of the form. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see HTMLOutputter + */ + +class Form extends Widget +{ + /** + * Show the form + * + * Uses a recipe to output the form. + * + * @return void + * @see Widget::show() + */ + + function show() + { + $this->out->elementStart('form', + array('id' => $this->id(), + 'class' => $this->formClass(), + 'method' => 'post', + 'action' => $this->action())); + $this->out->elementStart('fieldset'); + $this->formLegend(); + $this->sessionToken(); + $this->formData(); + $this->formActions(); + $this->out->elementEnd('fieldset'); + $this->out->elementEnd('form'); + } + + /** + * Include a session token for CSRF protection + * + * @return void + */ + + function sessionToken() + { + $this->out->hidden('token', common_session_token()); + } + + + /** + * Name of the form + * + * Sub-classes should overload this with the name of their form. + * + * @return void + */ + + function formLegend() + { + } + + + /** + * Visible or invisible data elements + * + * Display the form fields that make up the data of the form. + * Sub-classes should overload this to show their data. + * + * @return void + */ + + function formData() + { + } + + /** + * Buttons for form actions + * + * Submit and cancel buttons (or whatever) + * Sub-classes should overload this to show their own buttons. + * + * @return void + */ + + function formActions() + { + } + + /** + * ID of the form + * + * Should be unique on the page. Sub-classes should overload this + * to show their own IDs. + * + * @return int ID of the form + */ + + function id() + { + return null; + } + + /** + * Action of the form. + * + * URL to post to. Should be overloaded by subclasses to give + * somewhere to post to. + * + * @return string URL to post to + */ + + function action() + { + } + + /** + * Class of the form. + * + * @return string the form's class + */ + + function formClass() + { + return 'form'; + } +} diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php new file mode 100644 index 000000000..eb8a612e4 --- /dev/null +++ b/lib/htmloutputter.php @@ -0,0 +1,363 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Low-level generator for HTML + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Output + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @copyright 2008 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); +} + +require_once INSTALLDIR.'/lib/xmloutputter.php'; + +define('PAGE_TYPE_PREFS', + 'text/html,application/xhtml+xml,'. + 'application/xml;q=0.3,text/xml;q=0.2'); + +/** + * Low-level generator for HTML + * + * Abstracts some of the code necessary for HTML generation. Especially + * has methods for generating HTML form elements. Note that these have + * been created kind of haphazardly, not with an eye to making a general + * HTML-creation class. + * + * @category Output + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see Action + * @see XMLOutputter + */ + +class HTMLOutputter extends XMLOutputter +{ + /** + * Constructor + * + * Just wraps the XMLOutputter constructor. + * + * @param string $output URI to output to, default = stdout + * @param boolean $indent Whether to indent output, default true + */ + + function __construct($output='php://output', $indent=true) + { + parent::__construct($output, $indent); + } + + /** + * Start an HTML document + * + * If $type isn't specified, will attempt to do content negotiation. + * + * Attempts to do content negotiation for language, also. + * + * @param string $type MIME type to use; default is to do negotation. + * + * @todo extract content negotiation code to an HTTP module or class. + * + * @return void + */ + + function startHTML($type=null) + { + if (!$type) { + $httpaccept = isset($_SERVER['HTTP_ACCEPT']) ? + $_SERVER['HTTP_ACCEPT'] : null; + + // XXX: allow content negotiation for RDF, RSS, or XRDS + + $cp = common_accept_to_prefs($httpaccept); + $sp = common_accept_to_prefs(PAGE_TYPE_PREFS); + + $type = common_negotiate_type($cp, $sp); + + if (!$type) { + common_user_error(_('This page is not available in a '. + 'media type you accept'), 406); + exit(0); + } + } + + header('Content-Type: '.$type); + + $this->startXML('html', + '-//W3C//DTD XHTML 1.0 Strict//EN', + 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); + + // FIXME: correct language for interface + + $language = common_language(); + + $this->elementStart('html', array('xmlns' => 'http://www.w3.org/1999/xhtml', + 'xml:lang' => $language, + 'lang' => $language)); + } + + /** + * Ends an HTML document + * + * @return void + */ + function endHTML() + { + $this->elementEnd('html'); + $this->endXML(); + } + + /** + * Output an HTML text input element + * + * Despite the name, it is specifically for outputting a + * text input element, not other <input> elements. It outputs + * a cluster of elements, including a <label> and an associated + * instructions span. + * + * @param string $id element ID, must be unique on page + * @param string $label text of label for the element + * @param string $value value of the element, default null + * @param string $instructions instructions for valid input + * + * @todo add a $name parameter + * @todo add a $maxLength parameter + * @todo add a $size parameter + * + * @return void + */ + + function input($id, $label, $value=null, $instructions=null) + { + $this->elementStart('p'); + $this->element('label', array('for' => $id), $label); + $attrs = array('name' => $id, + 'type' => 'text', + 'class' => 'input_text', + 'id' => $id); + if ($value) { + $attrs['value'] = htmlspecialchars($value); + } + $this->element('input', $attrs); + if ($instructions) { + $this->element('span', 'input_instructions', $instructions); + } + $this->elementEnd('p'); + } + + /** + * output an HTML checkbox and associated elements + * + * Note that the value is default 'true' (the string), which can + * be used by Action::boolean() + * + * @param string $id element ID, must be unique on page + * @param string $label text of label for the element + * @param string $checked if the box is checked, default false + * @param string $instructions instructions for valid input + * @param string $value value of the checkbox, default 'true' + * @param string $disabled show the checkbox disabled, default false + * + * @return void + * + * @todo add a $name parameter + */ + + function checkbox($id, $label, $checked=false, $instructions=null, + $value='true', $disabled=false) + { + $this->elementStart('p'); + $attrs = array('name' => $id, + 'type' => 'checkbox', + 'class' => 'checkbox', + 'id' => $id); + if ($value) { + $attrs['value'] = htmlspecialchars($value); + } + if ($checked) { + $attrs['checked'] = 'checked'; + } + if ($disabled) { + $attrs['disabled'] = 'true'; + } + $this->element('input', $attrs); + $this->text(' '); + $this->element('label', array('class' => 'checkbox_label', + 'for' => $id), + $label); + $this->text(' '); + if ($instructions) { + $this->element('span', 'input_instructions', $instructions); + } + $this->elementEnd('p'); + } + + /** + * output an HTML combobox/select and associated elements + * + * $content is an array of key-value pairs for the dropdown, where + * the key is the option value attribute and the value is the option + * text. (Careful on the overuse of 'value' here.) + * + * @param string $id element ID, must be unique on page + * @param string $label text of label for the element + * @param array $content options array, value => text + * @param string $instructions instructions for valid input + * @param string $blank_select whether to have a blank entry, default false + * @param string $selected selected value, default null + * + * @return void + * + * @todo add a $name parameter + */ + + function dropdown($id, $label, $content, $instructions=null, + $blank_select=false, $selected=null) + { + $this->elementStart('p'); + $this->element('label', array('for' => $id), $label); + $this->elementStart('select', array('id' => $id, 'name' => $id)); + if ($blank_select) { + $this->element('option', array('value' => '')); + } + foreach ($content as $value => $option) { + if ($value == $selected) { + $this->element('option', array('value' => $value, + 'selected' => $value), + $option); + } else { + $this->element('option', array('value' => $value), $option); + } + } + $this->elementEnd('select'); + if ($instructions) { + $this->element('span', 'input_instructions', $instructions); + } + $this->elementEnd('p'); + } + + /** + * output an HTML hidden element + * + * $id is re-used as name + * + * @param string $id element ID, must be unique on page + * @param string $value hidden element value, default null + * @param string $name name, if different than ID + * + * @return void + */ + + function hidden($id, $value, $name=null) + { + $this->element('input', array('name' => ($name) ? $name : $id, + 'type' => 'hidden', + 'id' => $id, + 'value' => $value)); + } + + /** + * output an HTML password input and associated elements + * + * @param string $id element ID, must be unique on page + * @param string $label text of label for the element + * @param string $instructions instructions for valid input + * + * @return void + * + * @todo add a $name parameter + */ + + function password($id, $label, $instructions=null) + { + $this->elementStart('p'); + $this->element('label', array('for' => $id), $label); + $attrs = array('name' => $id, + 'type' => 'password', + 'class' => 'password', + 'id' => $id); + $this->element('input', $attrs); + if ($instructions) { + $this->element('span', 'input_instructions', $instructions); + } + $this->elementEnd('p'); + } + + /** + * output an HTML submit input and associated elements + * + * @param string $id element ID, must be unique on page + * @param string $label text of the button + * @param string $cls class of the button, default 'submit' + * @param string $name name, if different than ID + * + * @return void + * + * @todo add a $name parameter + */ + + function submit($id, $label, $cls='submit', $name=null) + { + $this->element('input', array('type' => 'submit', + 'id' => $id, + 'name' => ($name) ? $name : $id, + 'class' => $cls, + 'value' => $label)); + } + + /** + * output an HTML textarea and associated elements + * + * @param string $id element ID, must be unique on page + * @param string $label text of label for the element + * @param string $content content of the textarea, default none + * @param string $instructions instructions for valid input + * + * @return void + * + * @todo add a $name parameter + * @todo add a $cols parameter + * @todo add a $rows parameter + */ + + function textarea($id, $label, $content=null, $instructions=null) + { + $this->elementStart('p'); + $this->element('label', array('for' => $id), $label); + $this->element('textarea', array('rows' => 3, + 'cols' => 40, + 'name' => $id, + 'id' => $id), + ($content) ? $content : ''); + if ($instructions) { + $this->element('span', 'input_instructions', $instructions); + } + $this->elementEnd('p'); + } +} diff --git a/lib/messageform.php b/lib/messageform.php new file mode 100644 index 000000000..eca39cc06 --- /dev/null +++ b/lib/messageform.php @@ -0,0 +1,152 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Form for posting a direct message + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @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); +} + +require_once INSTALLDIR.'/lib/form.php'; + +/** + * Form for posting a direct message + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see HTMLOutputter + */ + +class MessageForm extends Form +{ + /** + * User to send a direct message to + */ + + var $to = null; + + /** + * Pre-filled content of the form + */ + + var $content = null; + + /** + * Constructor + * + * @param HTMLOutputter $out output channel + * @param User $to user to send a message to + * @param string $content content to pre-fill + */ + + function __construct($out=null, $to=null, $content=null) + { + parent::__construct($out); + + $this->to = $to; + $this->content = $content; + } + + /** + * ID of the form + * + * @return int ID of the form + */ + + function id() + { + return 'message_form'; + } + + /** + * Action of the form + * + * @return string URL of the action + */ + + function action() + { + return common_local_url('newmessage'); + } + + /** + * Data elements + * + * @return void + */ + + function formData() + { + $user = common_current_user(); + + $mutual_users = $user->mutuallySubscribedUsers(); + + $mutual = array(); + + while ($mutual_users->fetch()) { + if ($mutual_users->id != $user->id) { + $mutual[$mutual_users->id] = $mutual_users->nickname; + } + } + + $mutual_users->free(); + unset($mutual_users); + + $this->out->dropdown('to', _('To'), $mutual, null, false, + $this->to->id); + + $this->out->elementStart('p'); + + $this->out->element('textarea', array('id' => 'message_content', + 'cols' => 60, + 'rows' => 3, + 'name' => 'content'), + ($this->content) ? $this->content : ''); + + $this->out->elementEnd('p'); + } + + /** + * Action elements + * + * @return void + */ + + function formActions() + { + $this->out->element('input', array('id' => 'message_send', + 'name' => 'message_send', + 'type' => 'submit', + 'value' => _('Send'))); + } +}
\ No newline at end of file diff --git a/lib/noticeform.php b/lib/noticeform.php new file mode 100644 index 000000000..84817639a --- /dev/null +++ b/lib/noticeform.php @@ -0,0 +1,169 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Form for posting a notice + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @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); +} + +require_once INSTALLDIR.'/lib/form.php'; + +/** + * Form for posting a notice + * + * Frequently-used form for posting a notice + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see HTMLOutputter + */ + +class NoticeForm extends Form +{ + /** + * Current action, used for returning to this page. + */ + + var $action = null; + + /** + * Pre-filled content of the form + */ + + var $content = null; + + /** + * Constructor + * + * @param HTMLOutputter $out output channel + * @param string $action action to return to, if any + * @param string $content content to pre-fill + */ + + function __construct($out=null, $action=null, $content=null) + { + parent::__construct($out); + + $this->action = $action; + $this->content = $content; + } + + /** + * ID of the form + * + * @return int ID of the form + */ + + function id() + { + return 'form_notice'; + } + + /** + * Action of the form + * + * @return string URL of the action + */ + + function action() + { + return common_local_url('newnotice'); + } + + + /** + * Legend of the Form + * + * @return void + */ + function formLegend() + { + $this->out->element('legend', null, _('Send a notice')); + } + + + /** + * Data elements + * + * @return void + */ + + function formData() + { + $user = common_current_user(); + + $this->out->elementStart('ul', 'form_datas'); + $this->out->elementStart('li', array('id' => 'notice_text')); + $this->out->element('label', array('for' => 'notice_data-text'), + sprintf(_('What\'s up, %s?'), $user->nickname)); + // XXX: vary by defined max size + $this->out->element('textarea', array('id' => 'notice_data-text', + 'cols' => 35, + 'rows' => 4, + 'name' => 'status_textarea'), + ($this->content) ? $this->content : ''); + $this->out->elementEnd('li'); + $this->out->elementEnd('ul'); + + $this->out->elementStart('dl', 'form_note'); + $this->out->element('dt', null, _('Available characters')); + $this->out->element('dd', array('id' => 'notice_text-count'), + '140'); + $this->out->elementEnd('dl'); + + if ($this->action) { + $this->out->hidden('notice_return-to', $this->action, 'returnto'); + $this->out->hidden('notice_in-reply-to', $this->action, 'inreplyto'); + } + } + + /** + * Action elements + * + * @return void + */ + + function formActions() + { + $this->out->elementStart('ul', 'form_actions'); + $this->out->elementStart('li', array('id' => 'notice_submit')); + $this->out->element('input', array('id' => 'notice_action-submit', + 'class' => 'submit', + 'name' => 'status_submit', + 'type' => 'submit', + 'value' => _('Send'))); + $this->out->elementEnd('li'); + $this->out->elementEnd('ul'); + } +} diff --git a/lib/noticelist.php b/lib/noticelist.php index 71db067d0..fde93a3b6 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -31,6 +31,9 @@ if (!defined('LACONICA')) { exit(1); } +require_once INSTALLDIR.'/lib/favorform.php'; +require_once INSTALLDIR.'/lib/disfavorform.php'; + /** * widget for displaying a list of notices * @@ -50,7 +53,7 @@ if (!defined('LACONICA')) { * @see ProfileNoticeList */ -class NoticeList +class NoticeList extends Widget { /** the current stream of notices being displayed. */ @@ -62,8 +65,9 @@ class NoticeList * @param Notice $notice stream of notices from DB_DataObject */ - function __construct($notice) + function __construct($notice, $out=null) { + parent::__construct($out); $this->notice = $notice; } @@ -78,7 +82,9 @@ class NoticeList function show() { - common_element_start('ul', array('id' => 'notices')); + $this->out->elementStart('div', array('id' =>'notices_primary')); + $this->out->element('h2', null, _('Notices')); + $this->out->elementStart('ul', array('class' => 'notices')); $cnt = 0; @@ -93,7 +99,8 @@ class NoticeList $item->show(); } - common_element_end('ul'); + $this->out->elementEnd('ul'); + $this->out->elementEnd('div'); return $cnt; } @@ -111,7 +118,7 @@ class NoticeList function newListItem($notice) { - return new NoticeListItem($notice); + return new NoticeListItem($notice, $this->out); } } @@ -133,7 +140,7 @@ class NoticeList * @see ProfileNoticeListItem */ -class NoticeListItem +class NoticeListItem extends Widget { /** The notice this item will show. */ @@ -151,8 +158,9 @@ class NoticeListItem * @param Notice $notice The notice we'll display */ - function __construct($notice) + function __construct($notice, $out=null) { + parent::__construct($out); $this->notice = $notice; $this->profile = $notice->getProfile(); } @@ -169,19 +177,39 @@ class NoticeListItem function show() { $this->showStart(); - $this->showFaveForm(); + $this->showNotice(); + $this->showNoticeInfo(); + $this->showNoticeOptions(); + $this->showEnd(); + } + + function showNotice() + { + $this->out->elementStart('div', 'entry-title'); $this->showAuthor(); $this->showContent(); - $this->startTimeSection(); + $this->out->elementEnd('div'); + } + + function showNoticeInfo() + { + $this->out->elementStart('div', 'entry-content'); $this->showNoticeLink(); $this->showNoticeSource(); $this->showReplyTo(); + $this->out->elementEnd('div'); + } + + function showNoticeOptions() + { + $this->out->elementStart('div', 'notice-options'); + $this->showFaveForm(); $this->showReplyLink(); $this->showDeleteLink(); - $this->endTimeSection(); - $this->showEnd(); + $this->out->elementEnd('div'); } + /** * start a single notice. * @@ -191,7 +219,8 @@ class NoticeListItem function showStart() { // XXX: RDFa - common_element_start('li', array('class' => 'notice_single hentry', + // TODO: add notice_type class e.g., notice_video, notice_image + $this->out->elementStart('li', array('class' => 'hentry notice', 'id' => 'notice-' . $this->notice->id)); } @@ -206,9 +235,11 @@ class NoticeListItem $user = common_current_user(); if ($user) { if ($user->hasFave($this->notice)) { - common_disfavor_form($this->notice); + $disfavor = new DisfavorForm($this->out, $this->notice); + $disfavor->show(); } else { - common_favor_form($this->notice); + $favor = new FavorForm($this->out, $this->notice); + $favor->show(); } } } @@ -223,10 +254,13 @@ class NoticeListItem function showAuthor() { - common_element_start('span', 'vcard author'); + $this->out->elementStart('span', 'vcard author'); + $this->out->elementStart('a', array('href' => $this->profile->profileurl, + 'class' => 'url')); $this->showAvatar(); $this->showNickname(); - common_element_end('span'); + $this->out->elementEnd('a'); + $this->out->elementEnd('span'); } /** @@ -241,18 +275,17 @@ class NoticeListItem function showAvatar() { $avatar = $this->profile->getAvatar(AVATAR_STREAM_SIZE); - common_element_start('a', array('href' => $this->profile->profileurl)); - common_element('img', array('src' => ($avatar) ? + + $this->out->element('img', array('src' => ($avatar) ? common_avatar_display_url($avatar) : common_default_avatar(AVATAR_STREAM_SIZE), - 'class' => 'avatar stream photo', + 'class' => 'avatar photo', 'width' => AVATAR_STREAM_SIZE, 'height' => AVATAR_STREAM_SIZE, 'alt' => ($this->profile->fullname) ? $this->profile->fullname : $this->profile->nickname)); - common_element_end('a'); } /** @@ -265,8 +298,7 @@ class NoticeListItem function showNickname() { - common_element('a', array('href' => $this->profile->profileurl, - 'class' => 'nickname fn url'), + $this->out->element('span', array('class' => 'nickname fn'), $this->profile->nickname); } @@ -283,31 +315,16 @@ class NoticeListItem function showContent() { // FIXME: URL, image, video, audio - common_element_start('p', array('class' => 'content entry-title')); + $this->out->elementStart('p', array('class' => 'entry-content')); if ($this->notice->rendered) { - common_raw($this->notice->rendered); + $this->out->raw($this->notice->rendered); } else { // XXX: may be some uncooked notices in the DB, // we cook them right now. This should probably disappear in future // versions (>> 0.4.x) - common_raw(common_render_content($this->notice->content, $this->notice)); + $this->out->raw(common_render_content($this->notice->content, $this->notice)); } - common_element_end('p'); - } - - /** - * show the "time" section of a notice - * - * This is the greyed-out section that appears beneath the content, including - * links to delete or reply to the notice. Probably should be called something - * else. - * - * @return void - */ - - function startTimeSection() - { - common_element_start('p', 'time'); + $this->out->elementEnd('p'); } /** @@ -328,14 +345,18 @@ class NoticeListItem preg_match('/^http/', $this->notice->uri)) { $noticeurl = $this->notice->uri; } - common_element_start('a', array('class' => 'permalink', - 'rel' => 'bookmark', + $this->out->elementStart('dl', 'timestamp'); + $this->out->element('dt', null, _('Published')); + $this->out->elementStart('dd', null); + $this->out->elementStart('a', array('rel' => 'bookmark', 'href' => $noticeurl)); $dt = common_date_iso8601($this->notice->created); - common_element('abbr', array('class' => 'published', + $this->out->element('abbr', array('class' => 'published', 'title' => $dt), common_date_string($this->notice->created)); - common_element_end('a'); + $this->out->elementEnd('a'); + $this->out->elementEnd('dd'); + $this->out->elementEnd('dl'); } /** @@ -350,7 +371,8 @@ class NoticeListItem function showNoticeSource() { if ($this->notice->source) { - common_element('span', null, _(' from ')); + $this->out->elementStart('dl', 'device'); + $this->out->element('dt', null, _('From')); $source_name = _($this->notice->source); switch ($this->notice->source) { case 'web': @@ -358,18 +380,22 @@ class NoticeListItem case 'mail': case 'omb': case 'api': - common_element('span', 'noticesource', $source_name); + $this->out->element('dd', 'noticesource', $source_name); break; default: $ns = Notice_source::staticGet($this->notice->source); if ($ns) { - common_element('a', array('href' => $ns->url), + $this->out->elementStart('dd', null); + $this->out->element('a', array('href' => $ns->url, + 'rel' => 'external'), $ns->name); + $this->out->elementEnd('dd'); } else { - common_element('span', 'noticesource', $source_name); + $this->out->element('dd', 'noticesource', $source_name); } break; } + $this->out->elementEnd('dl'); } } @@ -387,11 +413,14 @@ class NoticeListItem if ($this->notice->reply_to) { $replyurl = common_local_url('shownotice', array('notice' => $this->notice->reply_to)); - common_text(' ('); - common_element('a', array('class' => 'inreplyto', - 'href' => $replyurl), - _('in reply to...')); - common_text(')'); + $this->out->elementStart('dl', 'response'); + $this->out->element('dt', null, _('To')); + $this->out->elementStart('dd'); + $this->out->element('a', array('href' => $replyurl, + 'rel' => 'in-reply-to'), + _('in reply to')); + $this->out->elementEnd('dd'); + $this->out->elementEnd('dl'); } } @@ -409,16 +438,13 @@ class NoticeListItem $reply_url = common_local_url('newnotice', array('replyto' => $this->profile->nickname)); - $reply_js = - 'return doreply("'.$this->profile->nickname.'",'.$this->notice->id.');'; - - common_element_start('a', - array('href' => $reply_url, - 'onclick' => $reply_js, - 'title' => _('reply'), - 'class' => 'replybutton')); - common_raw(' →'); - common_element_end('a'); + $this->out->elementStart('dl', 'reply'); + $this->out->element('dt', null, _('Reply to this notice')); + $this->out->elementStart('dd'); + $this->out->element('a', array('href' => $reply_url, + 'title' => _('reply')), _('Reply')); + $this->out->elementEnd('dd'); + $this->out->elementEnd('dl'); } /** @@ -433,26 +459,15 @@ class NoticeListItem if ($user && $this->notice->profile_id == $user->id) { $deleteurl = common_local_url('deletenotice', array('notice' => $this->notice->id)); - common_element_start('a', array('class' => 'deletenotice', + $this->out->elementStart('a', array('class' => 'deletenotice', 'href' => $deleteurl, 'title' => _('delete'))); - common_raw(' ×'); - common_element_end('a'); + $this->out->raw(' ×'); + $this->out->elementEnd('a'); } } /** - * end the time section - * - * @return void - */ - - function endTimeSection() - { - common_element_end('p'); - } - - /** * finish the notice * * Close the last elements in the notice list item @@ -462,6 +477,6 @@ class NoticeListItem function showEnd() { - common_element_end('li'); + $this->out->elementEnd('li'); } } diff --git a/lib/nudgeform.php b/lib/nudgeform.php new file mode 100644 index 000000000..7d04e11e4 --- /dev/null +++ b/lib/nudgeform.php @@ -0,0 +1,105 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Form for nudging a user + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @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); +} + +require_once INSTALLDIR.'/lib/form.php'; + +/** + * Form for nudging a user + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see DisfavorForm + */ + +class NudgeForm extends Form +{ + /** + * Profile of user to nudge + */ + + var $profile = null; + + /** + * Constructor + * + * @param HTMLOutputter $out output channel + * @param Profile $profile profile of user to nudge + */ + + function __construct($out=null, $profile=null) + { + parent::__construct($out); + + $this->profile = $profile; + } + + /** + * ID of the form + * + * @return int ID of the form + */ + + function id() + { + return 'nudge'; + } + + /** + * Action of the form + * + * @return string URL of the action + */ + + function action() + { + return common_local_url('nudge', + array('nickname' => $this->profile->nickname)); + } + + /** + * Action elements + * + * @return void + */ + + function formActions() + { + $this->out->submit('submit', _('Send a nudge')); + } +}
\ No newline at end of file diff --git a/lib/personal.php b/lib/personal.php index 02b01fece..46f9ff6be 100644 --- a/lib/personal.php +++ b/lib/personal.php @@ -21,193 +21,10 @@ if (!defined('LACONICA')) { exit(1); } class PersonalAction extends Action { - - function is_readonly() - { - return true; - } - function handle($args) { parent::handle($args); common_set_returnto($this->self_url()); } - function views_menu() - { - - $user = null; - $action = $this->trimmed('action'); - $nickname = $this->trimmed('nickname'); - - if ($nickname) { - $user = User::staticGet('nickname', $nickname); - $user_profile = $user->getProfile(); - } else { - $user_profile = false; - } - - common_element_start('ul', array('id' => 'nav_views')); - - common_menu_item(common_local_url('all', array('nickname' => - $nickname)), - _('Personal'), - sprintf(_('%s and friends'), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)), - $action == 'all'); - common_menu_item(common_local_url('replies', array('nickname' => - $nickname)), - _('Replies'), - sprintf(_('Replies to %s'), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)), - $action == 'replies'); - common_menu_item(common_local_url('showstream', array('nickname' => - $nickname)), - _('Profile'), - ($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname, - $action == 'showstream'); - common_menu_item(common_local_url('showfavorites', array('nickname' => - $nickname)), - _('Favorites'), - sprintf(_('%s\'s favorite notices'), ($user_profile) ? $user_profile->getBestName() : _('User')), - $action == 'showfavorites'); - - $cur = common_current_user(); - - if ($cur && $cur->id == $user->id) { - - common_menu_item(common_local_url('inbox', array('nickname' => - $nickname)), - _('Inbox'), - _('Your incoming messages'), - $action == 'inbox'); - common_menu_item(common_local_url('outbox', array('nickname' => - $nickname)), - _('Outbox'), - _('Your sent messages'), - $action == 'outbox'); - } - - common_element_end('ul'); - } - - function show_feeds_list($feeds) - { - common_element_start('div', array('class' => 'feeds')); - common_element('p', null, 'Feeds:'); - common_element_start('ul', array('class' => 'xoxo')); - - foreach ($feeds as $key => $value) { - $this->common_feed_item($feeds[$key]); - } - common_element_end('ul'); - common_element_end('div'); - } - - function common_feed_item($feed) - { - $nickname = $this->trimmed('nickname'); - - switch($feed['item']) { - case 'notices': default: - $feed_classname = $feed['type']; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = "$nickname's ".$feed['version']." notice feed"; - $feed['textContent'] = "RSS"; - break; - - case 'allrss': - $feed_classname = $feed['type']; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = $feed['version']." feed for $nickname and friends"; - $feed['textContent'] = "RSS"; - break; - - case 'repliesrss': - $feed_classname = $feed['type']; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = $feed['version']." feed for replies to $nickname"; - $feed['textContent'] = "RSS"; - break; - - case 'publicrss': - $feed_classname = $feed['type']; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = "Public timeline ".$feed['version']." feed"; - $feed['textContent'] = "RSS"; - break; - - case 'publicatom': - $feed_classname = "atom"; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = "Public timeline ".$feed['version']." feed"; - $feed['textContent'] = "Atom"; - break; - - case 'tagrss': - $feed_classname = $feed['type']; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = $feed['version']." feed for this tag"; - $feed['textContent'] = "RSS"; - break; - - case 'favoritedrss': - $feed_classname = $feed['type']; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = "Favorited ".$feed['version']." feed"; - $feed['textContent'] = "RSS"; - break; - - case 'foaf': - $feed_classname = "foaf"; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = "$nickname's FOAF file"; - $feed['textContent'] = "FOAF"; - break; - - case 'favoritesrss': - $feed_classname = "favorites"; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = "Feed for favorites of $nickname"; - $feed['textContent'] = "RSS"; - break; - - case 'usertimeline': - $feed_classname = "atom"; - $feed_mimetype = "application/".$feed['type']."+xml"; - $feed_title = "$nickname's ".$feed['version']." notice feed"; - $feed['textContent'] = "Atom"; - break; - } - common_element_start('li'); - common_element('a', array('href' => $feed['href'], - 'class' => $feed_classname, - 'type' => $feed_mimetype, - 'title' => $feed_title), - $feed['textContent']); - common_element_end('li'); - } - - - function source_link($source) - { - $source_name = _($source); - switch ($source) { - case 'web': - case 'xmpp': - case 'mail': - case 'omb': - case 'api': - common_element('span', 'noticesource', $source_name); - break; - default: - $ns = Notice_source::staticGet($source); - if ($ns) { - common_element('a', array('href' => $ns->url), - $ns->name); - } else { - common_element('span', 'noticesource', $source_name); - } - break; - } - return; - } } diff --git a/lib/personalgroupnav.php b/lib/personalgroupnav.php new file mode 100644 index 000000000..5d727a505 --- /dev/null +++ b/lib/personalgroupnav.php @@ -0,0 +1,135 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Base class for all actions (~views) + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Action + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @copyright 2008 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); +} + +require_once INSTALLDIR.'/lib/widget.php'; + +/** + * Base class for all actions + * + * This is the base class for all actions in the package. An action is + * more or less a "view" in an MVC framework. + * + * Actions are responsible for extracting and validating parameters; using + * model classes to read and write to the database; and doing ouput. + * + * @category Output + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see HTMLOutputter + */ + +class PersonalGroupNav extends Widget +{ + var $action = null; + + /** + * Construction + * + * @param Action $action current action, used for output + */ + + function __construct($action=null) + { + parent::__construct($action); + $this->action = $action; + } + + /** + * Show the menu + * + * @return void + */ + + function show() + { + $user = null; + + // FIXME: we should probably pass this in + + $action = $this->action->trimmed('action'); + $nickname = $this->action->trimmed('nickname'); + + if ($nickname) { + $user = User::staticGet('nickname', $nickname); + $user_profile = $user->getProfile(); + } else { + $user_profile = false; + } + + $this->out->elementStart('ul', array('id' => 'nav_views')); + + $this->out->menuItem(common_local_url('all', array('nickname' => + $nickname)), + _('Personal'), + sprintf(_('%s and friends'), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)), + $action == 'all'); + $this->out->menuItem(common_local_url('replies', array('nickname' => + $nickname)), + _('Replies'), + sprintf(_('Replies to %s'), (($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname)), + $action == 'replies'); + $this->out->menuItem(common_local_url('showstream', array('nickname' => + $nickname)), + _('Profile'), + ($user_profile && $user_profile->fullname) ? $user_profile->fullname : $nickname, + $action == 'showstream'); + $this->out->menuItem(common_local_url('showfavorites', array('nickname' => + $nickname)), + _('Favorites'), + sprintf(_('%s\'s favorite notices'), ($user_profile) ? $user_profile->getBestName() : _('User')), + $action == 'showfavorites'); + + $cur = common_current_user(); + + if ($cur && $cur->id == $user->id) { + + $this->out->menuItem(common_local_url('inbox', array('nickname' => + $nickname)), + _('Inbox'), + _('Your incoming messages'), + $action == 'inbox'); + $this->out->menuItem(common_local_url('outbox', array('nickname' => + $nickname)), + _('Outbox'), + _('Your sent messages'), + $action == 'outbox'); + } + + $this->out->elementEnd('ul'); + } +} diff --git a/lib/publicgroupnav.php b/lib/publicgroupnav.php new file mode 100644 index 000000000..7860783fa --- /dev/null +++ b/lib/publicgroupnav.php @@ -0,0 +1,98 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Base class for all actions (~views) + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Action + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @copyright 2008 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); +} + +require_once INSTALLDIR.'/lib/widget.php'; + +/** + * Base class for all actions + * + * This is the base class for all actions in the package. An action is + * more or less a "view" in an MVC framework. + * + * Actions are responsible for extracting and validating parameters; using + * model classes to read and write to the database; and doing ouput. + * + * @category Output + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see HTMLOutputter + */ + +class PublicGroupNav extends Widget +{ + var $action = null; + + /** + * Construction + * + * @param Action $action current action, used for output + */ + + function __construct($action=null) + { + parent::__construct($action); + $this->action = $action; + } + + /** + * Show the menu + * + * @return void + */ + + function show() + { + $this->action->elementStart('ul', array('class' => 'nav')); + + $this->out->menuItem(common_local_url('public'), _('Public'), + _('Public timeline'), $this->action == 'public', 'nav_timeline_public'); + + $this->out->menuItem(common_local_url('tag'), _('Recent tags'), + _('Recent tags'), $this->action == 'tag', 'nav_recent-tags'); + + if (count(common_config('nickname', 'featured')) > 0) { + $this->out->menuItem(common_local_url('featured'), _('Featured'), + _('Featured users'), $this->action == 'featured', 'nav_featured'); + } + + $this->out->menuItem(common_local_url('favorited'), _('Popular'), + _("Popular notices"), $this->action == 'favorited', 'nav_timeline_favorited'); + + $this->action->elementEnd('ul'); + } +} diff --git a/lib/stream.php b/lib/stream.php index 73758adee..0cb9e0bf4 100644 --- a/lib/stream.php +++ b/lib/stream.php @@ -24,32 +24,6 @@ require_once(INSTALLDIR.'/lib/noticelist.php'); class StreamAction extends PersonalAction { - - function public_views_menu() - { - - $action = $this->trimmed('action'); - - common_element_start('ul', array('id' => 'nav_views')); - - common_menu_item(common_local_url('public'), _('Public'), - _('Public timeline'), $action == 'public'); - - common_menu_item(common_local_url('tag'), _('Recent tags'), - _('Recent tags'), $action == 'tag'); - - if (count(common_config('nickname', 'featured')) > 0) { - common_menu_item(common_local_url('featured'), _('Featured'), - _('Featured users'), $action == 'featured'); - } - - common_menu_item(common_local_url('favorited'), _('Popular'), - _("Popular notices"), $action == 'favorited'); - - common_element_end('ul'); - - } - function show_notice_list($notice) { $nl = new NoticeList($notice); diff --git a/lib/subscribeform.php b/lib/subscribeform.php new file mode 100644 index 000000000..996729a28 --- /dev/null +++ b/lib/subscribeform.php @@ -0,0 +1,117 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Form for subscribing to a user + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @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); +} + +require_once INSTALLDIR.'/lib/form.php'; + +/** + * Form for subscribing to a user + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see UnsubscribeForm + */ + +class SubscribeForm extends Form +{ + /** + * Profile of user to subscribe to + */ + + var $profile = null; + + /** + * Constructor + * + * @param HTMLOutputter $out output channel + * @param Profile $profile profile of user to subscribe to + */ + + function __construct($out=null, $profile=null) + { + parent::__construct($out); + + $this->profile = $profile; + } + + /** + * ID of the form + * + * @return int ID of the form + */ + + function id() + { + return 'subscribe-' . $this->profile->id; + } + + /** + * Action of the form + * + * @return string URL of the action + */ + + function action() + { + return common_local_url('subscribe'); + } + + /** + * Data elements of the form + * + * @return void + */ + + function formData() + { + $this->out->hidden('subscribeto-' . $this->profile->id, + $this->profile->id, + 'subscribeto'); + } + + /** + * Action elements + * + * @return void + */ + + function formActions() + { + $this->out->submit('submit', _('Subscribe')); + } +}
\ No newline at end of file diff --git a/lib/theme.php b/lib/theme.php index 6f365bd99..95030affe 100644 --- a/lib/theme.php +++ b/lib/theme.php @@ -1,9 +1,12 @@ <?php -/* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, Controlez-Vous, Inc. +/** + * Laconica, the distributed open-source microblogging tool * - * This program is free software: you can redistribute it and/or modify + * Utilities for theme files and paths + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. @@ -15,19 +18,51 @@ * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Paths + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @copyright 2008 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); } +if (!defined('LACONICA')) { + exit(1); +} + +/** + * Gets the full path of a file in a theme dir based on its relative name + * + * @param string $relative relative path within the theme directory + * @param string $theme name of the theme; defaults to current theme + * + * @return string File path to the theme file + */ -function theme_file($relative) +function theme_file($relative, $theme=null) { - $theme = common_config('site', 'theme'); + if (!$theme) { + $theme = common_config('site', 'theme'); + } return INSTALLDIR.'/theme/'.$theme.'/'.$relative; } -function theme_path($relative) +/** + * Gets the full URL of a file in a theme dir based on its relative name + * + * @param string $relative relative path within the theme directory + * @param string $theme name of the theme; defaults to current theme + * + * @return string URL of the file + */ + +function theme_path($relative, $theme=null) { - $theme = common_config('site', 'theme'); + if (!$theme) { + $theme = common_config('site', 'theme'); + } $server = common_config('theme', 'server'); if ($server) { return 'http://'.$server.'/'.$theme.'/'.$relative; diff --git a/lib/unblockform.php b/lib/unblockform.php new file mode 100644 index 000000000..4cb9ae4f5 --- /dev/null +++ b/lib/unblockform.php @@ -0,0 +1,130 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Form for unblocking a user + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @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); +} + +require_once INSTALLDIR.'/lib/form.php'; + +/** + * Form for unblocking a user + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see BlockForm + */ + +class UnblockForm extends Form +{ + /** + * Profile of user to unblock + */ + + var $profile = null; + + /** + * Return-to args + */ + + var $args = null; + + /** + * Constructor + * + * @param HTMLOutputter $out output channel + * @param Profile $profile profile of user to unblock + * @param array $args return-to args + */ + + function __construct($out=null, $profile=null, $args=null) + { + parent::__construct($out); + + $this->profile = $profile; + $this->args = $args; + } + + /** + * ID of the form + * + * @return int ID of the form + */ + + function id() + { + return 'unblock-' . $this->profile->id; + } + + /** + * Action of the form + * + * @return string URL of the action + */ + + function action() + { + return common_local_url('unblock'); + } + + /** + * Data elements of the form + * + * @return void + */ + + function formData() + { + $this->out->hidden('unblockto-' . $this->profile->id, + $this->profile->id, + 'unblockto'); + if ($this->args) { + foreach ($this->args as $k => $v) { + $this->out->hidden('returnto-' . $k, $v); + } + } + } + + /** + * Action elements + * + * @return void + */ + + function formActions() + { + $this->out->submit('submit', _('Unblock')); + } +}
\ No newline at end of file diff --git a/lib/unsubscribeform.php b/lib/unsubscribeform.php new file mode 100644 index 000000000..a724bb312 --- /dev/null +++ b/lib/unsubscribeform.php @@ -0,0 +1,117 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Form for unsubscribing from a user + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @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); +} + +require_once INSTALLDIR.'/lib/form.php'; + +/** + * Form for unsubscribing from a user + * + * @category Form + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see SubscribeForm + */ + +class UnsubscribeForm extends Form +{ + /** + * Profile of user to unsubscribe from + */ + + var $profile = null; + + /** + * Constructor + * + * @param HTMLOutputter $out output channel + * @param Profile $profile profile of user to unsub from + */ + + function __construct($out=null, $profile=null) + { + parent::__construct($out); + + $this->profile = $profile; + } + + /** + * ID of the form + * + * @return int ID of the form + */ + + function id() + { + return 'unsubscribe-' . $this->profile->id; + } + + /** + * Action of the form + * + * @return string URL of the action + */ + + function action() + { + return common_local_url('unsubscribe'); + } + + /** + * Data elements of the form + * + * @return void + */ + + function formData() + { + $this->out->hidden('unsubscribeto-' . $this->profile->id, + $this->profile->id, + 'unsubscribeto'); + } + + /** + * Action elements + * + * @return void + */ + + function formActions() + { + $this->out->submit('submit', _('Unsubscribe')); + } +}
\ No newline at end of file diff --git a/lib/util.php b/lib/util.php index fbe04c6c4..9ca817eab 100644 --- a/lib/util.php +++ b/lib/util.php @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* XXX: break up into separate modules (HTTP, HTML, user, files) */ +/* XXX: break up into separate modules (HTTP, user, files) */ // Show a server error @@ -79,65 +79,6 @@ function common_user_error($msg, $code=400) common_show_footer(); } -$xw = null; - -// Start an HTML element -function common_element_start($tag, $attrs=null) -{ - global $xw; - $xw->startElement($tag); - if (is_array($attrs)) { - foreach ($attrs as $name => $value) { - $xw->writeAttribute($name, $value); - } - } else if (is_string($attrs)) { - $xw->writeAttribute('class', $attrs); - } -} - -function common_element_end($tag) -{ - static $empty_tag = array('base', 'meta', 'link', 'hr', - 'br', 'param', 'img', 'area', - 'input', 'col'); - global $xw; - // XXX: check namespace - if (in_array($tag, $empty_tag)) { - $xw->endElement(); - } else { - $xw->fullEndElement(); - } -} - -function common_element($tag, $attrs=null, $content=null) -{ - common_element_start($tag, $attrs); - global $xw; - if (!is_null($content)) { - $xw->text($content); - } - common_element_end($tag); -} - -function common_start_xml($doc=null, $public=null, $system=null, $indent=true) -{ - global $xw; - $xw = new XMLWriter(); - $xw->openURI('php://output'); - $xw->setIndent($indent); - $xw->startDocument('1.0', 'UTF-8'); - if ($doc) { - $xw->writeDTD($doc, $public, $system); - } -} - -function common_end_xml() -{ - global $xw; - $xw->endDocument(); - $xw->flush(); -} - function common_init_locale($language=null) { if(!$language) { @@ -167,346 +108,6 @@ function common_init_language() } } -define('PAGE_TYPE_PREFS', 'text/html,application/xhtml+xml,application/xml;q=0.3,text/xml;q=0.2'); - -function common_show_header($pagetitle, $callable=null, $data=null, $headercall=null) -{ - - global $config, $xw; - global $action; /* XXX: kind of cheating here. */ - - common_start_html(); - - common_element_start('head'); - common_element('title', null, - $pagetitle . " - " . $config['site']['name']); - common_element('link', array('rel' => 'stylesheet', - 'type' => 'text/css', - 'href' => theme_path('display.css') . '?version=' . LACONICA_VERSION, - 'media' => 'screen, projection, tv')); - foreach (array(6,7) as $ver) { - if (file_exists(theme_file('ie'.$ver.'.css'))) { - // Yes, IE people should be put in jail. - $xw->writeComment('[if lte IE '.$ver.']><link rel="stylesheet" type="text/css" '. - 'href="'.theme_path('ie'.$ver.'.css').'?version='.LACONICA_VERSION.'" /><![endif]'); - } - } - - common_element('script', array('type' => 'text/javascript', - 'src' => common_path('js/jquery.min.js')), - ' '); - common_element('script', array('type' => 'text/javascript', - 'src' => common_path('js/jquery.form.js')), - ' '); - common_element('script', array('type' => 'text/javascript', - 'src' => common_path('js/xbImportNode.js')), - ' '); - common_element('script', array('type' => 'text/javascript', - 'src' => common_path('js/util.js?version='.LACONICA_VERSION)), - ' '); - common_element('link', array('rel' => 'search', 'type' => 'application/opensearchdescription+xml', - 'href' => common_local_url('opensearch', array('type' => 'people')), - 'title' => common_config('site', 'name').' People Search')); - - common_element('link', array('rel' => 'search', 'type' => 'application/opensearchdescription+xml', - 'href' => common_local_url('opensearch', array('type' => 'notice')), - 'title' => common_config('site', 'name').' Notice Search')); - - if ($callable) { - if ($data) { - call_user_func($callable, $data); - } else { - call_user_func($callable); - } - } - common_element_end('head'); - common_element_start('body', $action); - common_element_start('div', array('id' => 'wrap')); - common_element_start('div', array('id' => 'header')); - common_nav_menu(); - if ((isset($config['site']['logo']) && is_string($config['site']['logo']) && (strlen($config['site']['logo']) > 0)) - || file_exists(theme_file('logo.png'))) - { - common_element_start('a', array('href' => common_local_url('public'))); - common_element('img', array('src' => isset($config['site']['logo']) ? - ($config['site']['logo']) : theme_path('logo.png'), - 'alt' => $config['site']['name'], - 'id' => 'logo')); - common_element_end('a'); - } else { - common_element_start('p', array('id' => 'branding')); - common_element('a', array('href' => common_local_url('public')), - $config['site']['name']); - common_element_end('p'); - } - - common_element('h1', 'pagetitle', $pagetitle); - - if ($headercall) { - if ($data) { - call_user_func($headercall, $data); - } else { - call_user_func($headercall); - } - } - common_element_end('div'); - common_element_start('div', array('id' => 'content')); -} - -function common_start_html($type=null, $indent=true) -{ - - if (!$type) { - $httpaccept = isset($_SERVER['HTTP_ACCEPT']) ? $_SERVER['HTTP_ACCEPT'] : null; - - // XXX: allow content negotiation for RDF, RSS, or XRDS - - $type = common_negotiate_type(common_accept_to_prefs($httpaccept), - common_accept_to_prefs(PAGE_TYPE_PREFS)); - - if (!$type) { - common_user_error(_('This page is not available in a media type you accept'), 406); - exit(0); - } - } - - header('Content-Type: '.$type); - - common_start_xml('html', - '-//W3C//DTD XHTML 1.0 Strict//EN', - 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd', $indent); - - // FIXME: correct language for interface - - $language = common_language(); - - common_element_start('html', array('xmlns' => 'http://www.w3.org/1999/xhtml', - 'xml:lang' => $language, - 'lang' => $language)); -} - -function common_show_footer() -{ - global $xw, $config; - common_element_end('div'); // content div - common_foot_menu(); - common_element_start('div', array('id' => 'footer')); - common_element_start('div', 'laconica'); - if (common_config('site', 'broughtby')) { - $instr = _('**%%site.name%%** is a microblogging service brought to you by [%%site.broughtby%%](%%site.broughtbyurl%%). '); - } else { - $instr = _('**%%site.name%%** is a microblogging service. '); - } - $instr .= sprintf(_('It runs the [Laconica](http://laconi.ca/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), LACONICA_VERSION); - $output = common_markup_to_html($instr); - common_raw($output); - common_element_end('div'); - common_element('img', array('id' => 'cc', - 'src' => $config['license']['image'], - 'alt' => $config['license']['title'])); - common_element_start('p'); - common_text(_('Unless otherwise specified, contents of this site are copyright by the contributors and available under the ')); - common_element('a', array('class' => 'license', - 'rel' => 'license', - 'href' => $config['license']['url']), - $config['license']['title']); - common_text(_('. Contributors should be attributed by full name or nickname.')); - common_element_end('p'); - common_element_end('div'); - common_element_end('div'); - common_element_end('body'); - common_element_end('html'); - common_end_xml(); -} - -function common_text($txt) -{ - global $xw; - $xw->text($txt); -} - -function common_raw($xml) -{ - global $xw; - $xw->writeRaw($xml); -} - -function common_nav_menu() -{ - $user = common_current_user(); - common_element_start('ul', array('id' => 'nav')); - if ($user) { - common_menu_item(common_local_url('all', array('nickname' => $user->nickname)), - _('Home')); - } - common_menu_item(common_local_url('peoplesearch'), _('Search')); - if ($user) { - common_menu_item(common_local_url('profilesettings'), - _('Settings')); - common_menu_item(common_local_url('invite'), - _('Invite')); - common_menu_item(common_local_url('logout'), - _('Logout')); - } else { - common_menu_item(common_local_url('login'), _('Login')); - if (!common_config('site', 'closed')) { - common_menu_item(common_local_url('register'), _('Register')); - } - common_menu_item(common_local_url('openidlogin'), _('OpenID')); - } - common_menu_item(common_local_url('doc', array('title' => 'help')), - _('Help')); - common_element_end('ul'); -} - -function common_foot_menu() -{ - common_element_start('ul', array('id' => 'nav_sub')); - common_menu_item(common_local_url('doc', array('title' => 'help')), - _('Help')); - common_menu_item(common_local_url('doc', array('title' => 'about')), - _('About')); - common_menu_item(common_local_url('doc', array('title' => 'faq')), - _('FAQ')); - common_menu_item(common_local_url('doc', array('title' => 'privacy')), - _('Privacy')); - common_menu_item(common_local_url('doc', array('title' => 'source')), - _('Source')); - common_menu_item(common_local_url('doc', array('title' => 'contact')), - _('Contact')); - common_element_end('ul'); -} - -function common_menu_item($url, $text, $title=null, $is_selected=false) -{ - $lattrs = array(); - if ($is_selected) { - $lattrs['class'] = 'current'; - } - common_element_start('li', $lattrs); - $attrs['href'] = $url; - if ($title) { - $attrs['title'] = $title; - } - common_element('a', $attrs, $text); - common_element_end('li'); -} - -function common_input($id, $label, $value=null,$instructions=null) -{ - common_element_start('p'); - common_element('label', array('for' => $id), $label); - $attrs = array('name' => $id, - 'type' => 'text', - 'class' => 'input_text', - 'id' => $id); - if ($value) { - $attrs['value'] = htmlspecialchars($value); - } - common_element('input', $attrs); - if ($instructions) { - common_element('span', 'input_instructions', $instructions); - } - common_element_end('p'); -} - -function common_checkbox($id, $label, $checked=false, $instructions=null, $value='true', $disabled=false) -{ - common_element_start('p'); - $attrs = array('name' => $id, - 'type' => 'checkbox', - 'class' => 'checkbox', - 'id' => $id); - if ($value) { - $attrs['value'] = htmlspecialchars($value); - } - if ($checked) { - $attrs['checked'] = 'checked'; - } - if ($disabled) { - $attrs['disabled'] = 'true'; - } - common_element('input', $attrs); - common_text(' '); - common_element('label', array('class' => 'checkbox_label', 'for' => $id), $label); - common_text(' '); - if ($instructions) { - common_element('span', 'input_instructions', $instructions); - } - common_element_end('p'); -} - -function common_dropdown($id, $label, $content, $instructions=null, $blank_select=false, $selected=null) -{ - common_element_start('p'); - common_element('label', array('for' => $id), $label); - common_element_start('select', array('id' => $id, 'name' => $id)); - if ($blank_select) { - common_element('option', array('value' => '')); - } - foreach ($content as $value => $option) { - if ($value == $selected) { - common_element('option', array('value' => $value, 'selected' => $value), $option); - } else { - common_element('option', array('value' => $value), $option); - } - } - common_element_end('select'); - if ($instructions) { - common_element('span', 'input_instructions', $instructions); - } - common_element_end('p'); -} -function common_hidden($id, $value) -{ - common_element('input', array('name' => $id, - 'type' => 'hidden', - 'id' => $id, - 'value' => $value)); -} - -function common_password($id, $label, $instructions=null) -{ - common_element_start('p'); - common_element('label', array('for' => $id), $label); - $attrs = array('name' => $id, - 'type' => 'password', - 'class' => 'password', - 'id' => $id); - common_element('input', $attrs); - if ($instructions) { - common_element('span', 'input_instructions', $instructions); - } - common_element_end('p'); -} - -function common_submit($id, $label, $cls='submit') -{ - global $xw; - common_element_start('p'); - common_element('input', array('type' => 'submit', - 'id' => $id, - 'name' => $id, - 'class' => $cls, - 'value' => $label)); - common_element_end('p'); -} - -function common_textarea($id, $label, $content=null, $instructions=null) -{ - common_element_start('p'); - common_element('label', array('for' => $id), $label); - common_element('textarea', array('rows' => 3, - 'cols' => 40, - 'name' => $id, - 'id' => $id), - ($content) ? $content : ''); - if ($instructions) { - common_element('span', 'input_instructions', $instructions); - } - common_element_end('p'); -} - function common_timezone() { if (common_logged_in()) { @@ -970,7 +571,7 @@ function common_tag_link($tag) { $canonical = common_canonical_tag($tag); $url = common_local_url('tag', array('tag' => $canonical)); - return '<a href="' . htmlspecialchars($url) . '" rel="tag" class="hashlink">' . htmlspecialchars($tag) . '</a>'; + return '<span class="tag"><a href="' . htmlspecialchars($url) . '" rel="tag">' . htmlspecialchars($tag) . '</a></span>'; } function common_canonical_tag($tag) @@ -988,7 +589,7 @@ function common_at_link($sender_id, $nickname) $sender = Profile::staticGet($sender_id); $recipient = common_relative_profile($sender, common_canonical_nickname($nickname)); if ($recipient) { - return '<a href="'.htmlspecialchars($recipient->profileurl).'" class="atlink">'.$nickname.'</a>'; + return '<span class="vcard"><a href="'.htmlspecialchars($recipient->profileurl).'" class="url"><span class="fn nickname">'.$nickname.'</span></a></span>'; } else { return $nickname; } @@ -1005,7 +606,7 @@ function common_at_hash_link($sender_id, $tag) $url = common_local_url('subscriptions', array('nickname' => $user->nickname, 'tag' => $tag)); - return '<a href="'.htmlspecialchars($url).'" class="atlink">'.$tag.'</a>'; + return '<span class="tag"><a href="'.htmlspecialchars($url).'" rel="tag">'.$tag.'</a></span>'; } else { return $tag; } @@ -1694,39 +1295,6 @@ function common_profile_url($nickname) return common_local_url('showstream', array('nickname' => $nickname)); } -// Don't call if nobody's logged in - -function common_notice_form($action=null, $content=null) -{ - $user = common_current_user(); - assert(!is_null($user)); - common_element_start('form', array('id' => 'status_form', - 'method' => 'post', - 'action' => common_local_url('newnotice'))); - common_element_start('p'); - common_element('label', array('for' => 'status_textarea', - 'id' => 'status_label'), - sprintf(_('What\'s up, %s?'), $user->nickname)); - common_element('span', array('id' => 'counter', 'class' => 'counter'), '140'); - common_element('textarea', array('id' => 'status_textarea', - 'cols' => 60, - 'rows' => 3, - 'name' => 'status_textarea'), - ($content) ? $content : ''); - common_hidden('token', common_session_token()); - if ($action) { - common_hidden('returnto', $action); - } - // set by JavaScript - common_hidden('inreplyto', 'false'); - common_element('input', array('id' => 'status_submit', - 'name' => 'status_submit', - 'type' => 'submit', - 'value' => _('Send'))); - common_element_end('p'); - common_element_end('form'); -} - // Should make up a reasonable root URL function common_root_url() @@ -1858,41 +1426,6 @@ function common_valid_tag($tag) return false; } -// Does a little before-after block for next/prev page - -function common_pagination($have_before, $have_after, $page, $action, $args=null) -{ - - if ($have_before || $have_after) { - common_element_start('div', array('id' => 'pagination')); - common_element_start('ul', array('id' => 'nav_pagination')); - } - - if ($have_before) { - $pargs = array('page' => $page-1); - $newargs = ($args) ? array_merge($args,$pargs) : $pargs; - - common_element_start('li', 'before'); - common_element('a', array('href' => common_local_url($action, $newargs), 'rel' => 'prev'), - _('« After')); - common_element_end('li'); - } - - if ($have_after) { - $pargs = array('page' => $page+1); - $newargs = ($args) ? array_merge($args,$pargs) : $pargs; - common_element_start('li', 'after'); - common_element('a', array('href' => common_local_url($action, $newargs), 'rel' => 'next'), - _('Before »')); - common_element_end('li'); - } - - if ($have_before || $have_after) { - common_element_end('ul'); - common_element_end('div'); - } -} - /* Following functions are copied from MediaWiki GlobalFunctions.php * and written by Evan Prodromou. */ @@ -2105,111 +1638,11 @@ function common_session_token() return $_SESSION['token']; } -function common_disfavor_form($notice) -{ - common_element_start('form', array('id' => 'disfavor-' . $notice->id, - 'method' => 'post', - 'class' => 'disfavor', - 'action' => common_local_url('disfavor'))); - - common_element('input', array('type' => 'hidden', - 'name' => 'token-'. $notice->id, - 'id' => 'token-'. $notice->id, - 'class' => 'token', - 'value' => common_session_token())); - - common_element('input', array('type' => 'hidden', - 'name' => 'notice', - 'id' => 'notice-n'. $notice->id, - 'class' => 'notice', - 'value' => $notice->id)); - - common_element('input', array('type' => 'submit', - 'id' => 'disfavor-submit-' . $notice->id, - 'name' => 'disfavor-submit-' . $notice->id, - 'class' => 'disfavor', - 'value' => 'Disfavor favorite', - 'title' => 'Remove this message from favorites')); - common_element_end('form'); -} - -function common_favor_form($notice) -{ - common_element_start('form', array('id' => 'favor-' . $notice->id, - 'method' => 'post', - 'class' => 'favor', - 'action' => common_local_url('favor'))); - - common_element('input', array('type' => 'hidden', - 'name' => 'token-'. $notice->id, - 'id' => 'token-'. $notice->id, - 'class' => 'token', - 'value' => common_session_token())); - - common_element('input', array('type' => 'hidden', - 'name' => 'notice', - 'id' => 'notice-n'. $notice->id, - 'class' => 'notice', - 'value' => $notice->id)); - - common_element('input', array('type' => 'submit', - 'id' => 'favor-submit-' . $notice->id, - 'name' => 'favor-submit-' . $notice->id, - 'class' => 'favor', - 'value' => 'Add to favorites', - 'title' => 'Add this message to favorites')); - common_element_end('form'); -} - -function common_nudge_form($profile) -{ - common_element_start('form', array('id' => 'nudge', 'method' => 'post', - 'action' => common_local_url('nudge', array('nickname' => $profile->nickname)))); - common_hidden('token', common_session_token()); - common_element('input', array('type' => 'submit', - 'class' => 'submit', - 'value' => _('Send a nudge'))); - common_element_end('form'); -} function common_nudge_response() { common_element('p', array('id' => 'nudge_response'), _('Nudge sent!')); } -function common_subscribe_form($profile) -{ - common_element_start('form', array('id' => 'subscribe-' . $profile->id, - 'method' => 'post', - 'class' => 'subscribe', - 'action' => common_local_url('subscribe'))); - common_hidden('token', common_session_token()); - common_element('input', array('id' => 'subscribeto-' . $profile->id, - 'name' => 'subscribeto', - 'type' => 'hidden', - 'value' => $profile->id)); - common_element('input', array('type' => 'submit', - 'class' => 'submit', - 'value' => _('Subscribe'))); - common_element_end('form'); -} - -function common_unsubscribe_form($profile) -{ - common_element_start('form', array('id' => 'unsubscribe-' . $profile->id, - 'method' => 'post', - 'class' => 'unsubscribe', - 'action' => common_local_url('unsubscribe'))); - common_hidden('token', common_session_token()); - common_element('input', array('id' => 'unsubscribeto-' . $profile->id, - 'name' => 'unsubscribeto', - 'type' => 'hidden', - 'value' => $profile->id)); - common_element('input', array('type' => 'submit', - 'class' => 'submit', - 'value' => _('Unsubscribe'))); - common_element_end('form'); -} - // XXX: Refactor this code function common_profile_new_message_nudge ($cur, $profile) { @@ -2241,47 +1674,6 @@ function common_keyize($str) return $str; } -function common_message_form($content, $user, $to) -{ - - common_element_start('form', array('id' => 'message_form', - 'method' => 'post', - 'action' => common_local_url('newmessage'))); - - $mutual_users = $user->mutuallySubscribedUsers(); - - $mutual = array(); - - while ($mutual_users->fetch()) { - if ($mutual_users->id != $user->id) { - $mutual[$mutual_users->id] = $mutual_users->nickname; - } - } - - $mutual_users->free(); - unset($mutual_users); - - common_dropdown('to', _('To'), $mutual, null, false, $to->id); - - common_element_start('p'); - - common_element('textarea', array('id' => 'message_content', - 'cols' => 60, - 'rows' => 3, - 'name' => 'content'), - ($content) ? $content : ''); - - common_element('input', array('id' => 'message_send', - 'name' => 'message_send', - 'type' => 'submit', - 'value' => _('Send'))); - - common_hidden('token', common_session_token()); - - common_element_end('p'); - common_element_end('form'); -} - function common_memcache() { static $cache = null; @@ -2308,39 +1700,3 @@ function common_compatible_license($from, $to) // XXX: better compatibility check needed here! return ($from == $to); } - -/* These are almost identical, so we use a helper function */ - -function common_block_form($profile, $args=null) -{ - common_blocking_form('block', _('Block'), $profile, $args); -} - -function common_unblock_form($profile, $args=null) -{ - common_blocking_form('unblock', _('Unblock'), $profile, $args); -} - -function common_blocking_form($type, $label, $profile, $args=null) -{ - common_element_start('form', array('id' => $type . '-' . $profile->id, - 'method' => 'post', - 'class' => $type, - 'action' => common_local_url($type))); - common_hidden('token', common_session_token()); - common_element('input', array('id' => $type . 'to-' . $profile->id, - 'name' => $type . 'to', - 'type' => 'hidden', - 'value' => $profile->id)); - common_element('input', array('type' => 'submit', - 'class' => 'submit', - 'name' => $type, - 'value' => $label)); - if ($args) { - foreach ($args as $k => $v) { - common_hidden('returnto-' . $k, $v); - } - } - common_element_end('form'); - return; -} diff --git a/lib/widget.php b/lib/widget.php new file mode 100644 index 000000000..c70505c44 --- /dev/null +++ b/lib/widget.php @@ -0,0 +1,82 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Base class for UI widgets + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @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); +} + +/** + * Base class for UI widgets + * + * A widget is a cluster of HTML elements that provide some functionality + * that's used on different parts of the site. Examples would be profile + * lists, notice lists, navigation menus (tabsets) and common forms. + * + * @category Widget + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see HTMLOutputter + */ + +class Widget +{ + /** + * HTMLOutputter to use for output + */ + + var $out = null; + + /** + * Prepare the widget for use + * + * @param HTMLOutputter $out output helper, defaults to null + */ + + function __construct($out=null) + { + $this->out = $out; + } + + /** + * Show the widget + * + * Emit the HTML for the widget, using the configured outputter. + * + * @return void + */ + + function show() + { + } +} diff --git a/lib/xmloutputter.php b/lib/xmloutputter.php new file mode 100644 index 000000000..64935da40 --- /dev/null +++ b/lib/xmloutputter.php @@ -0,0 +1,242 @@ +<?php +/** + * Laconica, the distributed open-source microblogging tool + * + * Low-level generator for XML + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Output + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @copyright 2008 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); +} + +/** + * Low-level generator for XML + * + * This is a thin wrapper around PHP's XMLWriter. The main + * advantage is the element() method, which simplifies outputting + * an element. + * + * @category Output + * @package Laconica + * @author Evan Prodromou <evan@controlyourself.ca> + * @author Sarven Capadisli <csarven@controlyourself.ca> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * @see Action + * @see HTMLOutputter + */ + +class XMLOutputter +{ + /** + * Wrapped XMLWriter object, which does most of the heavy lifting + * for output. + */ + + var $xw = null; + + /** + * Constructor + * + * Initializes the wrapped XMLWriter. + * + * @param string $output URL for outputting, defaults to stdout + * @param boolean $indent Whether to indent output, default true + */ + + function __construct($output='php://output', $indent=true) + { + $this->xw = new XMLWriter(); + $this->xw->openURI($output); + $this->xw->setIndent($indent); + } + + /** + * Start a new XML document + * + * @param string $doc document element + * @param string $public public identifier + * @param string $system system identifier + * + * @return void + */ + + function startXML($doc=null, $public=null, $system=null) + { + $this->xw->startDocument('1.0', 'UTF-8'); + if ($doc) { + $this->xw->writeDTD($doc, $public, $system); + } + } + + /** + * finish an XML document + * + * It's probably a bad idea to continue to use this object + * after calling endXML(). + * + * @return void + */ + + function endXML() + { + $this->xw->endDocument(); + $this->xw->flush(); + } + + /** + * output an XML element + * + * Utility for outputting an XML element. A convenient wrapper + * for a bunch of longer XMLWriter calls. This is best for + * when an element doesn't have any sub-elements; if that's the + * case, use elementStart() and elementEnd() instead. + * + * The $content element will be escaped for XML. If you need + * raw output, use elementStart() and elementEnd() with a call + * to raw() in the middle. + * + * If $attrs is a string instead of an array, it will be treated + * as the class attribute of the element. + * + * @param string $tag Element type or tagname + * @param array $attrs Array of element attributes, as + * key-value pairs + * @param string $content string content of the element + * + * @return void + */ + + function element($tag, $attrs=null, $content=null) + { + $this->elementStart($tag, $attrs); + if (!is_null($content)) { + $this->xw->text($content); + } + $this->elementEnd($tag); + } + + /** + * output a start tag for an element + * + * Mostly used for when an element has content that's + * not a simple string. + * + * If $attrs is a string instead of an array, it will be treated + * as the class attribute of the element. + * + * @param string $tag Element type or tagname + * @param array $attrs Array of element attributes + * + * @return void + */ + + function elementStart($tag, $attrs=null) + { + $this->xw->startElement($tag); + if (is_array($attrs)) { + foreach ($attrs as $name => $value) { + $this->xw->writeAttribute($name, $value); + } + } else if (is_string($attrs)) { + $this->xw->writeAttribute('class', $attrs); + } + } + + /** + * output an end tag for an element + * + * Used in conjunction with elementStart(). $tag param + * should match the elementStart() param. + * + * For HTML 4 compatibility, this method will force + * a full end element (</tag>) even if the element is + * empty, except for a handful of exception tagnames. + * This is a hack. + * + * @param string $tag Element type or tagname. + * + * @return void + */ + + function elementEnd($tag) + { + static $empty_tag = array('base', 'meta', 'link', 'hr', + 'br', 'param', 'img', 'area', + 'input', 'col'); + // XXX: check namespace + if (in_array($tag, $empty_tag)) { + $this->xw->endElement(); + } else { + $this->xw->fullEndElement(); + } + } + + /** + * output plain text + * + * Text will be escaped. If you need it not to be, + * use raw() instead. + * + * @param string $txt Text to output. + * + * @return void + */ + + function text($txt) + { + $this->xw->text($txt); + } + + /** + * output raw xml + * + * This will spit out its argument verbatim -- no escaping is + * done. + * + * @param string $xml XML to output. + * + * @return void + */ + + function raw($xml) + { + $this->xw->writeRaw($xml); + } + + /** + * output a comment + * + * @param string $txt text of the comment + * + * @return void + */ + + function comment($txt) + { + $this->xw->writeComment($txt); + } +} diff --git a/theme/base/css/display.css b/theme/base/css/display.css new file mode 100644 index 000000000..b039dc110 --- /dev/null +++ b/theme/base/css/display.css @@ -0,0 +1,1087 @@ +/* theme: base */ +* { margin:0; padding:0; } +img { display:block; border:0; } +a abbr { cursor: pointer; border-bottom:0; } +table { border-collapse:collapse; } +ol { list-style-position:inside; } +html { font-size: 87.5%; background-color:#fff; height:100%; } +body { +background-color:#fff; +color:#000; +font-family:sans-serif; +font-size:1em; +line-height:1.65; +position:relative; +margin:0 auto; +width:1004px; +width:71.714em; +max-width:100%; +} +h1 { +font-size:2.1em; +line-height:1.1; +margin-bottom:0.25em; +} +h2 { font-size:1.3em; } +h3 { font-size:1.2em; } +h4 { font-size:1.1em; } +h5 { font-size:1em; } +h6 { font-size:0.9em; } +h1,h2,h3,h4,h5,h6 { + text-transform:uppercase; + margin-bottom:7px; +} +legend { font-weight:bold; } +input, textarea, select, option { +padding:4px; +font-family:sans-serif; +font-size:1em; +-moz-border-radius:4px; +} +select, option { +padding-bottom:0; +} +fieldset { +padding:11px; +} +input:focus, textarea:focus, select:focus { +border-width:2px; +border-style: solid; +-moz-border-radius:4px; +} +caption { +font-weight:bold; +} +.opened { display: block !important;} +.closed { display: none !important;} +span.required { font-weight:bold; } +form ul li { +list-style-type:none; +margin:0 0 18px 0; +} +form label { +font-weight:bold; +/*margin:0 0 11px 0;*/ +} +form ul li input { +} +form .error { +margin-right:11px; +} +form label.submit { +display:none; +} +form .error_message { +display:block; +} +.form_response { +margin-bottom:18px; +} +.form_response dt { +} +.form_response dd { +} + +form input.remove, +form input.submit { +-moz-border-radius:4px; +} +form input.submit { +} + + + + +/* FORM SETTINGS */ +.form_settings fieldset { +padding:0; +border:0; +} +.form_settings legend { +display:none; +} +.form_settings .form_datas label { +display:block; +} + +.form_guide { +font-style:italic; +} + +.form_settings .form_actions label { +display:none; +} + +.form_settings #settings_autosubscribe label { +display:inline; +font-weight:bold; +} + + + +/* FORM SETTINGS */ + + + + +address { +float:left; +margin-bottom:18px; +margin-left:18px; +} +address .fn, +address .email { +display:none; +} + + + +#header { +width:100%; +position:relative; +float:left; +padding-top:18px; +margin-bottom:29px; +} + +#site_nav_global_primary { +float:right; +} +#site_nav_global_primary ul li { +display:inline; +margin-left:11px; +} + + +.system_notice dt { +font-weight:bold; +text-transform:uppercase; +display:none; +} + +#site_notice { +position:absolute; +right:0; +top:49px; +float:right; +width:322px; +} +#page_notice { +clear:both; +margin-bottom:18px; +} + + + + +#footer { +float:left; +width:100%; +padding-bottom:11px; +} + + + +#site_nav_local_views { +width:100%; +float:left; +} +#site_nav_local_views dt { +display:none; +} +#site_nav_local_views li { +float:left; +margin-right:18px; +list-style-type:none; +} +#site_nav_local_views a { +float:left; +text-decoration:none; +padding:4px 11px; +-moz-border-radius-topleft:4px; +-moz-border-radius-topright:4px; +border-width:1px; +border-style:dashed; +border-bottom:0; +} +#site_nav_local_views .nav { +float:left; +width:100%; +} + + +#site_nav_global_primary dt, +#site_nav_global_secondary dt { +display:none; +} +/* +#site_nav_global_primary .current a { +font-weight:bold; +border-style:solid; +} +*/ +#site_nav_global_secondary { +margin-bottom:11px; +} + +#site_nav_global_secondary ul li { +display:inline; +margin-right:11px; +} +#export_data li a { +padding-left:20px; +} +#export_data li a.foaf { +padding-left:30px; +} +#export_data li a.export_vcard { +padding-left:28px; +} + + + +#export_data ul { +display:inline; +} +#export_data li { +list-style-type:none; +display:inline; +margin-left:11px; +} +#export_data li:first-child { +margin-left:0; +} + + + + +#licenses dt { +font-weight:bold; +display:none; +} +#licenses dd { +margin-bottom:11px; +} + + +#site_content_license_cc p { +float:left; +margin-left:10%; +width:90%; +} +#site_content_license_cc img { +float:left; +margin-left:-100%; +} + + +#wrap { + float:left; + margin:0 auto; + width:1004px; + width:71.714em; +} + + +#core { +position:relative; +width:100%; +float:left; +margin-bottom:1em; +} + +#content { +width:644px; +padding:18px; +float:left; +-moz-border-radius:7px; +-moz-border-radius-topleft:0; +} + +#content_inner { +position:relative; +} + +#aside_primary { +width:300px; +float:left; +margin-left:2px; +padding:18px 4px 18px 18px; +-moz-border-radius:7px; +} + + + + +/*Start: FORM NOTICE*/ +#form_notice { +width:384px; +width:458px; +float:left; +margin-left:68px; +position:relative; +line-height:1; +} +#form_notice fieldset { +border:0; +padding:0; +} +#form_notice legend { +display:none; +} +#form_notice textarea { +-moz-border-radius:4px; +width:304px; +width:377px; +height:95px; +height:86px; +line-height:1.5; +padding:7px 7px 14px 7px; +} +#form_notice label { +display:block; +font-size:1.3em; +margin-bottom:7px; +} +#form_notice .form_datas li { +float:left; +} + +#form_notice #notice_attach_file label, +#form_notice #notice_submit label { +display:none; +} + +#form_notice #notice_attachment { +margin-top:25px; +margin-left:4px; +} + +#form_notice .form_note { +position:absolute; +top:125px; +top:116px; +right:98px; +z-index:9; +} + +#form_notice .form_note dt { +font-weight:bold; +display:none; +} +#notice_text-count { +font-weight:bold; +line-height:1.15; +} + +#form_notice #notice_data-attach_view { +/*position:absolute;*/ +top:25px; +right:30px; +margin-left:4px; +padding:0; +cursor:pointer; +width:16px; +height:16px; +border:0; +text-indent:-9999px; +} +#form_notice .form_actions { +position:absolute; +top:107px; +top:98px; +right:0; +} +#form_notice li { +margin-bottom:0; +} +/*end FORM NOTICE*/ + + + + + +/* user_profile */ +#user_profile { +position:relative; +width:633px; +min-height:123px; +float:left; +margin-bottom:17px; +margin-left:0; +} +#user_profile dt, +#user_statistics dt { +font-weight:bold; +} +#user_profile .user_depiction { +float:left; +position:absolute; +top:0; +left:0; +width:96px; +} +#user_profile .user_fn, +#user_profile .user_nickname, +#user_profile .user_location, +#user_profile .user_url, +#user_profile .user_note, +#user_profile .user_tags { +float:left; +clear:left; +margin-left:125px; +width:322px; +margin-bottom:4px; +} + +#user_profile .user_fn, +#user_profile .user_nickname { +width:auto; +clear:none; +} +#user_profile .user_nickname { +margin-left:11px; +} +#user_profile .user_nickname .nickname { +font-style:italic; +font-weight:bold; +margin-left:4px; +margin-right:4px; +} + +#user_profile .user_nickname dd:before { +content: "("; +} +#user_profile .user_nickname dd:after { +content: ")"; +} + +#user_profile dt { +display:none; +} +#user_profile h2 { +display:none; +} +/* user_profile */ + +/*user_actions*/ +#user_actions { +clear:left; +float:left; +position:absolute; +top:0; +right:0; +} +#user_actions h2 { +display:none; +} +#user_actions ul { +list-style-type:none; +} +#user_actions li { +border-top-width:1px; +border-top-style:dotted; +} +#user_actions li:first-child { +border-top:0; +} +#user_actions fieldset { +border:0; +padding:0; +} +#user_actions legend { +display:none; +} + +#user_actions a, +#user_actions input.submit { +display:block; +text-align:left; +padding:4px 0 4px 19px; +} +#user_actions a { +text-decoration:none; +} +#user_subscribe a, +#TB_window input.submit, +#user_actions input.submit { +border:0; +cursor:pointer; +padding-left:16px; +width:100%; +font-size:0.9em; +} + +#user_subscribe a { +width:auto; +padding-left:20px; +} + +#user_subscribe a, +#TB_window input.submit, +.form_user_subscribe input.submit { +font-weight:bold; +} + + + +#user_send-a-message form { +clear:left; +width:322px; +margin-top:18px; +} + +#user_send-a-message textarea { +width:96%; +} + +.user_tags ul { +list-style-type:none; +} +.user_tags li { +display:inline; +margin-right:1em; +float:left; +} + + + +.aside .section { +margin-bottom:29px; +clear:both; +} +.aside .section h2 { +text-transform:uppercase; +font-size:1em; +} + +#user_statistics dt, +#user_statistics dd { +display:inline; +} +#user_statistics dt:after { +content: ":"; +} + + +#user_subscriptions, +#user_subscriptions-common { +float:left; +} +#user_subscriptions ul.users { +width:220px; +float:left; +} +#user_subscriptions .users li { +list-style-type:none; +float:left; +margin-right:7px; +margin-bottom:7px; +} +#user_subscriptions .users li .photo { +width:24px; +height:24px; +margin-right:0; +} +#user_subscriptions .users li .fn { +display:none; +} +.aside .section .more { +clear:both; +} + + + + + +/* NOTICE */ +.notice { +position:relative; +padding-top:18px; +padding-bottom:18px; +clear:both; +float:left; +width:644px; +width:96.699%; +width:100%; +border-top:1px dashed #D1D9E4; +/*-moz-border-radius:7px;*/ +} +.notices li { +list-style-type:none; +/*margin-bottom:11px;*/ +} +.notices li.over { +background-color:#fcfcfc; +} + + +/* NOTICES */ +#notices_primary { +float:left; +width:644px; +-moz-border-radius:7px; +} +#notices_primary h2 { +display:none; +} +.notice-data a span { +display:block; +padding-left:28px; +} + + +.notice .author { +float:left; +width:96px; +width:199px; +margin-left:-217px; +margin-left:-199px; +} +.notice .author a { +} +.notice .author:after { +content:":"; +} + +.vcard .photo { +display:inline; +margin-right:11px; +margin-right:4px; +vertical-align:top; +} +.vcard .url { +text-decoration:none; +} +.vcard .fn { +border-bottom-width:1px; +border-bottom-style:dotted; +font-style:italic; +} +.vcard .fn:hover { +border-bottom-width:1px; +border-bottom-style:solid; +} + + +.notice .entry-title { +float:left; +margin-bottom:11px; +margin-left:217px; +margin-left:199px; +} +.notice p.entry-content { +float:left; +width:427px; +width:100%; +} + +.notice_video p.entry-content, +.notice_audio p.entry-content, +.notice_image p.entry-content, +.notice_location p.entry-content, +.notice_event p.entry-content, +.notice_document p.entry-content { +width:322px; +width:75.41%; +} +#laconicat .notice p.entry-content { +/*margin-left:199px;*/ +} +.notice p.entry-content a { + +} +.notice p.entry-content a:hover { + +} +.notice p.entry-content .tag a { + +} +.notice p.entry-content .tag a:hover { + +} + + +.notice div.entry-content { +/*border:1px solid blue;*/ +clear:left; +float:left; +margin-left:11px; +margin-left:0; +margin-bottom:4px; +width:199px; +width:149px; +} +.notice div.entry-content, +.notice .notice-options a, +.notice .notice-options input { +font-size:0.9em; +} + + +#laconicat .notice div.entry-content { +/*margin-left:0;*/ +} + +.notice div.entry-content dl, +.notice div.entry-content dt, +.notice div.entry-content dd { +display:inline; +} +.notice div.entry-content .timestamp dt, +.notice div.entry-content .response dt { +display:none; +} +.notice div.entry-content .timestamp { + +} +.notice div.entry-content .device dt { +text-transform:lowercase; +} +.notice div.entry-content a { +text-decoration:none; +border-bottom-width:1px; +border-bottom-style:dotted; +} +.notice div.entry-content a:hover { +border-bottom-width:1px; +border-bottom-style:solid; +} + + + +.notice-data { +position:absolute; +top:18px; +right:0; +min-height:50px; +margin-bottom:4px; +} +.notice .entry-content .notice-data dt { +display:none; +} + +.notice-data a { +display:block; +outline:none; +} + + + +.notice-options { +margin-left:18px; +margin-left:260px; +margin-left:304px; +margin-left:18px; +margin-left:50px; +float:left; +} +.notice-options .reply, +.notice-options .notice_delete , +.notice-options .notice_favorite { +float:left; +margin-right:11px; +} +.notice-options .reply dt { +display:none; +} +.notice-options .reply a, +.notice-options form input.submit { +display:block; +border:0; +padding-left:20px; +} + +.notice-options .reply a { +text-decoration:none; +} +.notice-options form input.submit { +cursor:pointer; +width:16px; +width:auto; +height:16px; +height:auto; +padding-top:0; +padding-right:0; +padding-bottom:0; +} + +.notice-options .notice_delete legend, +.notice-options .notice_favorite legend { +display:none; +} +.notice-options .notice_delete fieldset, +.notice-options .notice_favorite fieldset { +border:0; +padding:0; +} + + +.notice-options form.notice_delete { +margin-left:2em; +} +/*END: NOTICES */ + + + + + +.pagination dt { +font-weight:bold; +display:none; +} + +.pagination .nav { +float:left; +width:100%; +list-style-type:none; +} + +.pagination .nav_prev { +float:left; +} +.pagination .nav_next { +float:right; +} + +.pagination a { +display:block; +text-decoration:none; +font-weight:bold; +padding:7px; +border:1px dotted #D1D9E4; +border-bottom:0; +} + +.pagination .nav_prev a { +-moz-border-radius-topright:4px; +padding-left:20px; +border-left:0; +} +.pagination .nav_next a { +-moz-border-radius-topleft:4px; +padding-right:20px; +border-right:0; +} + + +/* END: NOTICE */ + + + + + + + +/*START: LOAD ALONG WITH JS*/ +.notice .in-reply-to { + width:98%; + margin-left:2%; +} +.notice .in-reply-to li { +background-color:#F7F9FB; +} +.notice .in-reply-to li .in-reply-to li { +background-color:#E4E9F0; +} +.notice .in-reply-to li .in-reply-to li .in-reply-to li { +background-color:#D1D9E4; +} + + + +#user_actions #user_subscribe .form_note, +#user_actions #user_subscribe .form_datas, +#user_actions #user_subscribe .form_actions label { +display:none; +} +#form_user-relationship .form_note, +#form_user-relationship .form_datas, +#form_user-relationship .form_actions label { +display:block; +} + +#user_actions #user-relationship_submit { +margin-bottom:0; +} +#form_user-relationship .form_datas li label { +margin-right:11px; +} + +#user_relationship_xfn { +/*z-index:1000; +position:absolute; +width:521px; +height:322px;*/ +display:none; +} +#user_relationship_xfn fieldset { +background-color:#fff; +} + +/*END: LOAD ALONG WITH JS*/ + + + +/* TOP_POSTERS */ +#top-posters caption { +text-align:left; +text-transform:uppercase; +} + +#top-posters thead { +display:none; +} +#top-poster_user { +width:199px; +} +#top-poster_number-of-notices { +width:123px; +} +#top-posters tbody td { +padding-right:11px; +padding-bottom:4px; +} +#top-posters img { +margin-right:7px; +height:24px; +width:24px; +} + + + +/* tagcloud */ +#tagcloud ul { +list-style-type:none; +} +#tagcloud ul li { +display:inline; +margin-right:7px; +line-height:1.4; +} + +#tagcloud.section dt { +text-transform:uppercase; +font-weight:bold; +} +#tagcloud .weight_1 { +font-size:1em; +} +#tagcloud .weight_2 { +font-size:1.3em; +} +#tagcloud .weight_3 { +font-size:1.6em; +} +#tagcloud .weight_4 { +font-size:1.9em; +} +#tagcloud .weight_5 { +font-size:2.2em; +} + + + +#form_settings_photo .form_datas { +clear:both; +} + + + + +#photo_original, +#photo_preview { +float:left; +} +#photo_preview, +#settings_photo_action-crop { +margin-left:29px; +} +#photo_preview_view { +height:96px; +width:96px; +overflow:hidden; +} + + + + +.section .groups, +#users_featured ul { +list-style-type:none; +} +.section .groups li, +#users_featured li { +margin-top:11px; +float:left; +width:100%; +} +.section .groups li:first-child, +#users_featured li:first-child { +margin-top:0; +} + +.section .groups .vcard, +#users_featured .vcard { +float:left; +margin-bottom:-23px; +} + +.section .groups dl, +#users_featured dl { +float:left; +margin-left:63px; +clear:left; +} +.section .groups dt, +#users_featured dt { +display:none; +font-weight:bold; +} + + + +#home.logged_out h1 { +display:none; +} + +#home #intro { +margin-bottom:29px; +float:left; +width:100%; +} + +#home #intro p { +margin-bottom:18px; +font-size:1.8em; +} + +#home #intro #guide_steps { +list-style-type:none; +} +#home #intro #guide_steps li { +float:left; +margin-left:18px; +} +#home #intro #guide_steps li:first-child { +margin-left:0; +} +#home #intro #guide_steps li a { +display:block; +float:left; +width:185px; +height:109px; +border-width:1px; +border-style:dotted; +text-decoration:none; +-moz-border-radius:7px; +padding:7px; +font-size:1.6em; +font-weight:bold; +text-align:center; +} + + +#testimonials { +clear:both; +} diff --git a/theme/base/css/initial_states.css b/theme/base/css/initial_states.css new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/theme/base/css/initial_states.css @@ -0,0 +1 @@ + diff --git a/js/jcrop/jquery.Jcrop.css b/theme/base/css/jquery.Jcrop.css index b95178a72..6c6dfb503 100644 --- a/js/jcrop/jquery.Jcrop.css +++ b/theme/base/css/jquery.Jcrop.css @@ -8,7 +8,7 @@ { font-size: 0; position: absolute; - background: white url('Jcrop.gif') top left repeat; + background: #fff url(../images/illustrations/illu_jcrop.gif) top left repeat; /* opacity: .5; *filter:alpha(opacity=50); @@ -22,12 +22,12 @@ height: 7px !important; border: 1px #eee solid; background-color: #333; - *width: 9px; - *height: 9px; + /*width: 9px; + height: 9px;*/ } .jcrop-tracker { - *background-color: gray; + /*background-color: gray;*/ width: 100%; height: 100%; } diff --git a/theme/base/css/thickbox.css b/theme/base/css/thickbox.css new file mode 100644 index 000000000..d24b9bedf --- /dev/null +++ b/theme/base/css/thickbox.css @@ -0,0 +1,163 @@ +/* ----------------------------------------------------------------------------------------------------------------*/ +/* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/ +/* ----------------------------------------------------------------------------------------------------------------*/ +*{padding: 0; margin: 0;} + +/* ----------------------------------------------------------------------------------------------------------------*/ +/* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/ +/* ----------------------------------------------------------------------------------------------------------------*/ +#TB_window { + font: 12px Arial, Helvetica, sans-serif; + color: #333333; +} + +#TB_secondLine { + font: 10px Arial, Helvetica, sans-serif; + color:#666666; +} + +#TB_window a:link {color: #666666;} +#TB_window a:visited {color: #666666;} +#TB_window a:hover {color: #000;} +#TB_window a:active {color: #666666;} +#TB_window a:focus{color: #666666;} + +/* ----------------------------------------------------------------------------------------------------------------*/ +/* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/ +/* ----------------------------------------------------------------------------------------------------------------*/ +#TB_overlay { + position: fixed; + z-index:100; + top: 0px; + left: 0px; + height:100%; + width:100%; +} + +.TB_overlayMacFFBGHack {background: url(macFFBgHack.png) repeat;} +.TB_overlayBG { + background-color:#000; + filter:alpha(opacity=75); + -moz-opacity: 0.75; + opacity: 0.75; +} + +* html #TB_overlay { /* ie6 hack */ + position: absolute; + height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); +} + +#TB_window { + position: fixed; + background: #ffffff; + z-index: 102; + color:#000000; + display:none; + border: 4px solid #525252; + text-align:left; + top:50%; + left:50%; +} + +* html #TB_window { /* ie6 hack */ +position: absolute; +margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); +} + +#TB_window img#TB_Image { + display:block; + margin: 15px 0 0 15px; + border-right: 1px solid #ccc; + border-bottom: 1px solid #ccc; + border-top: 1px solid #666; + border-left: 1px solid #666; +} + +#TB_caption{ + height:25px; + padding:7px 30px 10px 25px; + float:left; +} + +#TB_closeWindow{ + height:25px; + padding:11px 25px 10px 0; + float:right; +} + +#TB_closeAjaxWindow{ + padding:7px 10px 5px 0; + margin-bottom:1px; + text-align:right; + float:right; +} + +#TB_ajaxWindowTitle{ + float:left; + padding:7px 0 5px 10px; + margin-bottom:1px; +} + +#TB_title{ + background-color:#e8e8e8; + height:27px; +} + +#TB_ajaxContent{ + clear:both; + padding:2px 15px 15px 15px; + overflow:auto; + text-align:left; + line-height:1.4em; +} + +#TB_ajaxContent.TB_modal{ + padding:15px; +} + +#TB_ajaxContent p{ + padding:5px 0px 5px 0px; +} + +#TB_load{ + position: fixed; + display:none; + height:13px; + width:208px; + z-index:103; + top: 50%; + left: 50%; + margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */ +} + +* html #TB_load { /* ie6 hack */ +position: absolute; +margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); +} + +#TB_HideSelect{ + z-index:99; + position:fixed; + top: 0; + left: 0; + background-color:#fff; + border:none; + filter:alpha(opacity=0); + -moz-opacity: 0; + opacity: 0; + height:100%; + width:100%; +} + +* html #TB_HideSelect { /* ie6 hack */ + position: absolute; + height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); +} + +#TB_iframeContent{ + clear:both; + border:none; + margin-bottom:-1px; + margin-top:1px; + _margin-bottom:1px; +} diff --git a/theme/base/images/icons/icon_atom.jpg b/theme/base/images/icons/icon_atom.jpg Binary files differnew file mode 100644 index 000000000..22853edc4 --- /dev/null +++ b/theme/base/images/icons/icon_atom.jpg diff --git a/theme/base/images/icons/icon_foaf.gif b/theme/base/images/icons/icon_foaf.gif Binary files differnew file mode 100644 index 000000000..f8f784423 --- /dev/null +++ b/theme/base/images/icons/icon_foaf.gif diff --git a/theme/base/images/icons/icon_rss.jpg b/theme/base/images/icons/icon_rss.jpg Binary files differnew file mode 100644 index 000000000..da23422d0 --- /dev/null +++ b/theme/base/images/icons/icon_rss.jpg diff --git a/theme/base/images/icons/icon_vcard.gif b/theme/base/images/icons/icon_vcard.gif Binary files differnew file mode 100644 index 000000000..6d52947f3 --- /dev/null +++ b/theme/base/images/icons/icon_vcard.gif diff --git a/js/jcrop/Jcrop.gif b/theme/base/images/illustrations/illu_jcrop.gif Binary files differindex 72ea7ccb5..72ea7ccb5 100644 --- a/js/jcrop/Jcrop.gif +++ b/theme/base/images/illustrations/illu_jcrop.gif diff --git a/theme/base/images/illustrations/illu_progress_loading-01.gif b/theme/base/images/illustrations/illu_progress_loading-01.gif Binary files differnew file mode 100644 index 000000000..82290f483 --- /dev/null +++ b/theme/base/images/illustrations/illu_progress_loading-01.gif diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css new file mode 100644 index 000000000..6ae85449a --- /dev/null +++ b/theme/identica/css/display.css @@ -0,0 +1,235 @@ +/* theme: identica */ +html { + background-color:#ddd; +} +body { + font-family: sans-serif; + font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; + font-size:1em; + +} +input, textarea, select, option { + font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif; +} +input:focus, textarea:focus, select:focus { +border-color:#B2D0DD; +} +form span.required { color:#f00; } +form .error { +background-color:#f00; +color:#fff; +} +form .error_message { +color:#EC008C; +} + +a { +color:#002E6E; +} + + + +#aside_primary { +background-color:#CEE1E9; +} + + + +#form_notice label { +color:#88171A; +} +#notice_text-count { +color:#333; +} +#notice_text-count.warning { +color:#FDFF00; +background-color:#000; +} +#notice_data-text.warning { +border-color:#FDFF00; +} + +#form_notice #notice_data-attach_view { +background-image:url(../images/icons/twotone/green/paper-clip.gif); +background-repeat:no-repeat; +background-position:0 45%; +background-color:transparent; +} + + +#site_nav_local_views a { +border-color:#fff; +} + +/* +#site_nav_global_primary .current a { +font-weight:bold; +border-color:#ccc; +border-style:solid; +} +*/ + +#content, +#site_nav_local_views .current a { +background-color:#fff; +} + + + + + +#export_data li a { +background-repeat:no-repeat; +background-position:0 45%; +} +#export_data li a.rss { +background-image:url(../../base/images/icons/icon_rss.jpg); +} +#export_data li a.atom { +background-image:url(../../base/images/icons/icon_atom.jpg); +} +#export_data li a.foaf { +background-image:url(../../base/images/icons/icon_foaf.gif); +=} +#export_data li a.export_vcard { +background-image:url(../../base/images/icons/icon_vcard.gif); +} + + +/*user_actions*/ +#user_actions li { +border-top-color:#eee; +} +#user_actions a { +color:#000; +} +#user_subscribe a, +#TB_window input.submit, +.form_user_subscribe input.submit { +background:#CEE1E9 url(../images/icons/twotone/green/shield.gif) 0 45% no-repeat; +} +.form_user_unsubscribe input.submit { +background-color:#647819; +color:#fff; +} +#user_send-a-message a { +background:url(../images/icons/twotone/green/quote.gif) 0 45% no-repeat; +} +.form_user_nudge input.submit { +background:url(../images/icons/twotone/green/mail.gif) 0 45% no-repeat; +} +.form_user_block input.submit { +background:url(../images/icons/twotone/green/against.gif) 0 45% no-repeat; +} + + +.user_tags .mark_hash { +color:#555; +} + + + +.vcard .fn { +border-bottom-color:#ccc; +} +.vcard .fn:hover { +border-bottom-color:#555; +} + + + + +/* NOTICES */ +.notice div.entry-content a { +color:#333; +border-bottom-color:#ccc; +} +.notice div.entry-content a:hover { +border-bottom-color:#555; +} + + +.notice-data a span { +background-color:transparent; +background-repeat:no-repeat; +background-position:0 45%; +} +.notice_video .notice-data a span { +background-image:url(../images/icons/twotone/green/camera.gif); +} +.notice_audio .notice-data a span { +background-image:url(../images/icons/twotone/green/music.gif); +} +.notice_image .notice-data a span { +background-image:url(../images/icons/twotone/green/search.gif); +} +.notice_event .notice-data a span { +background-image:url(../images/icons/twotone/green/calendar.gif); +} +.notice_location .notice-data a span { +background-image:url(../images/icons/twotone/green/flag.gif); +} +.notice_document .notice-data a span { +background-image:url(../images/icons/twotone/green/document.gif); +} + +.notice-options .reply a, +.notice-options form input.submit { +background-color:transparent; +} +.notice-options .reply a { +background:transparent url(../images/icons/twotone/green/reply.gif) no-repeat 0 45%; +} +.notice-options form.notice_favorite input.submit { +background:transparent url(../images/icons/twotone/green/favourite.gif) no-repeat 0 45%; +} +.notice-options form.notice_delete input.submit { +background:transparent url(../images/icons/twotone/green/trash.gif) no-repeat 0 45%; +} + +.notice-options a, +.notice-options input { +opacity:0.1; +} +.notices li.hover { +background-color:#fcfcfc; +} +.notices li.hover .notice-options a, +.notices li.hover .notice-options input { +opacity:1; +} + + +/*END: NOTICES */ + + + +.pagination .nav_prev a, +.pagination .nav_next a { +background-repeat:no-repeat; +} +.pagination .nav_prev a { +background-image:url(../images/icons/twotone/green/arrow-left.gif); +background-position:0 45%; +} +.pagination .nav_next a { +background-image:url(../images/icons/twotone/green/arrow-right.gif); +background-position:100% 45%; +} + + + +#home #intro #guide_steps li a { +border-color:#ccc; +color:#fff; +} +#home #intro #step_join-now a { +background-color:#f00; +} +#home #intro #step_start-a-group a { +background-color:#0f0; +} +#home #intro #step_create-a-community a { +background-color:#00f; +} + diff --git a/theme/identica/images/icons/icon_atom.jpg b/theme/identica/images/icons/icon_atom.jpg Binary files differnew file mode 100644 index 000000000..22853edc4 --- /dev/null +++ b/theme/identica/images/icons/icon_atom.jpg diff --git a/theme/identica/images/icons/icon_foaf.gif b/theme/identica/images/icons/icon_foaf.gif Binary files differnew file mode 100644 index 000000000..f8f784423 --- /dev/null +++ b/theme/identica/images/icons/icon_foaf.gif diff --git a/theme/identica/images/icons/icon_rss.jpg b/theme/identica/images/icons/icon_rss.jpg Binary files differnew file mode 100644 index 000000000..da23422d0 --- /dev/null +++ b/theme/identica/images/icons/icon_rss.jpg diff --git a/theme/identica/images/icons/icon_vcard.gif b/theme/identica/images/icons/icon_vcard.gif Binary files differnew file mode 100644 index 000000000..6d52947f3 --- /dev/null +++ b/theme/identica/images/icons/icon_vcard.gif diff --git a/theme/identica/images/icons/twotone/green/against.gif b/theme/identica/images/icons/twotone/green/against.gif Binary files differnew file mode 100644 index 000000000..ca796c8a3 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/against.gif diff --git a/theme/identica/images/icons/twotone/green/arrow-down.gif b/theme/identica/images/icons/twotone/green/arrow-down.gif Binary files differnew file mode 100644 index 000000000..c709e5877 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/arrow-down.gif diff --git a/theme/identica/images/icons/twotone/green/arrow-downleft.gif b/theme/identica/images/icons/twotone/green/arrow-downleft.gif Binary files differnew file mode 100644 index 000000000..a4a98035d --- /dev/null +++ b/theme/identica/images/icons/twotone/green/arrow-downleft.gif diff --git a/theme/identica/images/icons/twotone/green/arrow-downright.gif b/theme/identica/images/icons/twotone/green/arrow-downright.gif Binary files differnew file mode 100644 index 000000000..3e6001a61 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/arrow-downright.gif diff --git a/theme/identica/images/icons/twotone/green/arrow-left.gif b/theme/identica/images/icons/twotone/green/arrow-left.gif Binary files differnew file mode 100644 index 000000000..afed19084 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/arrow-left.gif diff --git a/theme/identica/images/icons/twotone/green/arrow-right.gif b/theme/identica/images/icons/twotone/green/arrow-right.gif Binary files differnew file mode 100644 index 000000000..ee1707ed9 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/arrow-right.gif diff --git a/theme/identica/images/icons/twotone/green/arrow-up.gif b/theme/identica/images/icons/twotone/green/arrow-up.gif Binary files differnew file mode 100644 index 000000000..d0f5fbeaa --- /dev/null +++ b/theme/identica/images/icons/twotone/green/arrow-up.gif diff --git a/theme/identica/images/icons/twotone/green/arrow-upleft.gif b/theme/identica/images/icons/twotone/green/arrow-upleft.gif Binary files differnew file mode 100644 index 000000000..1e9e6935b --- /dev/null +++ b/theme/identica/images/icons/twotone/green/arrow-upleft.gif diff --git a/theme/identica/images/icons/twotone/green/arrow-upright.gif b/theme/identica/images/icons/twotone/green/arrow-upright.gif Binary files differnew file mode 100644 index 000000000..c7fecc8a0 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/arrow-upright.gif diff --git a/theme/identica/images/icons/twotone/green/back-forth.gif b/theme/identica/images/icons/twotone/green/back-forth.gif Binary files differnew file mode 100644 index 000000000..33a9540c8 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/back-forth.gif diff --git a/theme/identica/images/icons/twotone/green/bookmark.gif b/theme/identica/images/icons/twotone/green/bookmark.gif Binary files differnew file mode 100644 index 000000000..23f318ecc --- /dev/null +++ b/theme/identica/images/icons/twotone/green/bookmark.gif diff --git a/theme/identica/images/icons/twotone/green/bulb.gif b/theme/identica/images/icons/twotone/green/bulb.gif Binary files differnew file mode 100644 index 000000000..f70652c03 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/bulb.gif diff --git a/theme/identica/images/icons/twotone/green/calendar.gif b/theme/identica/images/icons/twotone/green/calendar.gif Binary files differnew file mode 100644 index 000000000..a09b65aca --- /dev/null +++ b/theme/identica/images/icons/twotone/green/calendar.gif diff --git a/theme/identica/images/icons/twotone/green/calendar2.gif b/theme/identica/images/icons/twotone/green/calendar2.gif Binary files differnew file mode 100644 index 000000000..7884b02dd --- /dev/null +++ b/theme/identica/images/icons/twotone/green/calendar2.gif diff --git a/theme/identica/images/icons/twotone/green/camera.gif b/theme/identica/images/icons/twotone/green/camera.gif Binary files differnew file mode 100644 index 000000000..1a85fbad0 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/camera.gif diff --git a/theme/identica/images/icons/twotone/green/cart.gif b/theme/identica/images/icons/twotone/green/cart.gif Binary files differnew file mode 100644 index 000000000..47eaa0a2e --- /dev/null +++ b/theme/identica/images/icons/twotone/green/cart.gif diff --git a/theme/identica/images/icons/twotone/green/caution.gif b/theme/identica/images/icons/twotone/green/caution.gif Binary files differnew file mode 100644 index 000000000..3ad2c322b --- /dev/null +++ b/theme/identica/images/icons/twotone/green/caution.gif diff --git a/theme/identica/images/icons/twotone/green/chart.gif b/theme/identica/images/icons/twotone/green/chart.gif Binary files differnew file mode 100644 index 000000000..136d74517 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/chart.gif diff --git a/theme/identica/images/icons/twotone/green/checkmark.gif b/theme/identica/images/icons/twotone/green/checkmark.gif Binary files differnew file mode 100644 index 000000000..892429d48 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/checkmark.gif diff --git a/theme/identica/images/icons/twotone/green/clipboard.gif b/theme/identica/images/icons/twotone/green/clipboard.gif Binary files differnew file mode 100644 index 000000000..9317bdcd0 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/clipboard.gif diff --git a/theme/identica/images/icons/twotone/green/clock.gif b/theme/identica/images/icons/twotone/green/clock.gif Binary files differnew file mode 100644 index 000000000..d1410f925 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/clock.gif diff --git a/theme/identica/images/icons/twotone/green/closed-folder.gif b/theme/identica/images/icons/twotone/green/closed-folder.gif Binary files differnew file mode 100644 index 000000000..0410fc6e8 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/closed-folder.gif diff --git a/theme/identica/images/icons/twotone/green/database.gif b/theme/identica/images/icons/twotone/green/database.gif Binary files differnew file mode 100644 index 000000000..29ce02492 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/database.gif diff --git a/theme/identica/images/icons/twotone/green/diskette.gif b/theme/identica/images/icons/twotone/green/diskette.gif Binary files differnew file mode 100644 index 000000000..e970b0a30 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/diskette.gif diff --git a/theme/identica/images/icons/twotone/green/document.gif b/theme/identica/images/icons/twotone/green/document.gif Binary files differnew file mode 100644 index 000000000..9c08f4a3a --- /dev/null +++ b/theme/identica/images/icons/twotone/green/document.gif diff --git a/theme/identica/images/icons/twotone/green/double-arrow.gif b/theme/identica/images/icons/twotone/green/double-arrow.gif Binary files differnew file mode 100644 index 000000000..2e8648264 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/double-arrow.gif diff --git a/theme/identica/images/icons/twotone/green/edit.gif b/theme/identica/images/icons/twotone/green/edit.gif Binary files differnew file mode 100644 index 000000000..c746aca60 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/edit.gif diff --git a/theme/identica/images/icons/twotone/green/eject.gif b/theme/identica/images/icons/twotone/green/eject.gif Binary files differnew file mode 100644 index 000000000..7e0906cfe --- /dev/null +++ b/theme/identica/images/icons/twotone/green/eject.gif diff --git a/theme/identica/images/icons/twotone/green/exclaim.gif b/theme/identica/images/icons/twotone/green/exclaim.gif Binary files differnew file mode 100644 index 000000000..588e28c26 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/exclaim.gif diff --git a/theme/identica/images/icons/twotone/green/fastforward.gif b/theme/identica/images/icons/twotone/green/fastforward.gif Binary files differnew file mode 100644 index 000000000..28e495103 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/fastforward.gif diff --git a/theme/identica/images/icons/twotone/green/favourite.gif b/theme/identica/images/icons/twotone/green/favourite.gif Binary files differnew file mode 100644 index 000000000..d93515e37 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/favourite.gif diff --git a/theme/identica/images/icons/twotone/green/flag.gif b/theme/identica/images/icons/twotone/green/flag.gif Binary files differnew file mode 100644 index 000000000..68c8aee25 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/flag.gif diff --git a/theme/identica/images/icons/twotone/green/graph.gif b/theme/identica/images/icons/twotone/green/graph.gif Binary files differnew file mode 100644 index 000000000..0c1794b4e --- /dev/null +++ b/theme/identica/images/icons/twotone/green/graph.gif diff --git a/theme/identica/images/icons/twotone/green/grow.gif b/theme/identica/images/icons/twotone/green/grow.gif Binary files differnew file mode 100644 index 000000000..c4118d53b --- /dev/null +++ b/theme/identica/images/icons/twotone/green/grow.gif diff --git a/theme/identica/images/icons/twotone/green/headphones.gif b/theme/identica/images/icons/twotone/green/headphones.gif Binary files differnew file mode 100644 index 000000000..5be6c67dd --- /dev/null +++ b/theme/identica/images/icons/twotone/green/headphones.gif diff --git a/theme/identica/images/icons/twotone/green/home.gif b/theme/identica/images/icons/twotone/green/home.gif Binary files differnew file mode 100644 index 000000000..d2a3421ef --- /dev/null +++ b/theme/identica/images/icons/twotone/green/home.gif diff --git a/theme/identica/images/icons/twotone/green/hourglass.gif b/theme/identica/images/icons/twotone/green/hourglass.gif Binary files differnew file mode 100644 index 000000000..b62b9480c --- /dev/null +++ b/theme/identica/images/icons/twotone/green/hourglass.gif diff --git a/theme/identica/images/icons/twotone/green/info.gif b/theme/identica/images/icons/twotone/green/info.gif Binary files differnew file mode 100644 index 000000000..86ef1f8b4 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/info.gif diff --git a/theme/identica/images/icons/twotone/green/key.gif b/theme/identica/images/icons/twotone/green/key.gif Binary files differnew file mode 100644 index 000000000..ccf357ab2 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/key.gif diff --git a/theme/identica/images/icons/twotone/green/lock.gif b/theme/identica/images/icons/twotone/green/lock.gif Binary files differnew file mode 100644 index 000000000..db00706b5 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/lock.gif diff --git a/theme/identica/images/icons/twotone/green/mail.gif b/theme/identica/images/icons/twotone/green/mail.gif Binary files differnew file mode 100644 index 000000000..1084c862f --- /dev/null +++ b/theme/identica/images/icons/twotone/green/mail.gif diff --git a/theme/identica/images/icons/twotone/green/move.gif b/theme/identica/images/icons/twotone/green/move.gif Binary files differnew file mode 100644 index 000000000..d2c30b1d2 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/move.gif diff --git a/theme/identica/images/icons/twotone/green/music.gif b/theme/identica/images/icons/twotone/green/music.gif Binary files differnew file mode 100644 index 000000000..64b51d4e1 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/music.gif diff --git a/theme/identica/images/icons/twotone/green/news.gif b/theme/identica/images/icons/twotone/green/news.gif Binary files differnew file mode 100644 index 000000000..712c685dc --- /dev/null +++ b/theme/identica/images/icons/twotone/green/news.gif diff --git a/theme/identica/images/icons/twotone/green/note.gif b/theme/identica/images/icons/twotone/green/note.gif Binary files differnew file mode 100644 index 000000000..bcc0b149b --- /dev/null +++ b/theme/identica/images/icons/twotone/green/note.gif diff --git a/theme/identica/images/icons/twotone/green/open-folder.gif b/theme/identica/images/icons/twotone/green/open-folder.gif Binary files differnew file mode 100644 index 000000000..d41300a08 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/open-folder.gif diff --git a/theme/identica/images/icons/twotone/green/paper-clip.gif b/theme/identica/images/icons/twotone/green/paper-clip.gif Binary files differnew file mode 100644 index 000000000..1d45f1d1e --- /dev/null +++ b/theme/identica/images/icons/twotone/green/paper-clip.gif diff --git a/theme/identica/images/icons/twotone/green/paper-clip2.gif b/theme/identica/images/icons/twotone/green/paper-clip2.gif Binary files differnew file mode 100644 index 000000000..a8c7805be --- /dev/null +++ b/theme/identica/images/icons/twotone/green/paper-clip2.gif diff --git a/theme/identica/images/icons/twotone/green/pause.gif b/theme/identica/images/icons/twotone/green/pause.gif Binary files differnew file mode 100644 index 000000000..ced0b6440 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/pause.gif diff --git a/theme/identica/images/icons/twotone/green/phone.gif b/theme/identica/images/icons/twotone/green/phone.gif Binary files differnew file mode 100644 index 000000000..69359f764 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/phone.gif diff --git a/theme/identica/images/icons/twotone/green/play.gif b/theme/identica/images/icons/twotone/green/play.gif Binary files differnew file mode 100644 index 000000000..794ec85b6 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/play.gif diff --git a/theme/identica/images/icons/twotone/green/plus.gif b/theme/identica/images/icons/twotone/green/plus.gif Binary files differnew file mode 100644 index 000000000..4407d0b2d --- /dev/null +++ b/theme/identica/images/icons/twotone/green/plus.gif diff --git a/theme/identica/images/icons/twotone/green/print.gif b/theme/identica/images/icons/twotone/green/print.gif Binary files differnew file mode 100644 index 000000000..17727d5d7 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/print.gif diff --git a/theme/identica/images/icons/twotone/green/question-mark.gif b/theme/identica/images/icons/twotone/green/question-mark.gif Binary files differnew file mode 100644 index 000000000..1689efcd0 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/question-mark.gif diff --git a/theme/identica/images/icons/twotone/green/quote.gif b/theme/identica/images/icons/twotone/green/quote.gif Binary files differnew file mode 100644 index 000000000..4ba1f0c03 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/quote.gif diff --git a/theme/identica/images/icons/twotone/green/refresh.gif b/theme/identica/images/icons/twotone/green/refresh.gif Binary files differnew file mode 100644 index 000000000..8a8b8144f --- /dev/null +++ b/theme/identica/images/icons/twotone/green/refresh.gif diff --git a/theme/identica/images/icons/twotone/green/reply.gif b/theme/identica/images/icons/twotone/green/reply.gif Binary files differnew file mode 100644 index 000000000..6ff01bb35 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/reply.gif diff --git a/theme/identica/images/icons/twotone/green/rewind.gif b/theme/identica/images/icons/twotone/green/rewind.gif Binary files differnew file mode 100644 index 000000000..aca3ee35b --- /dev/null +++ b/theme/identica/images/icons/twotone/green/rewind.gif diff --git a/theme/identica/images/icons/twotone/green/search.gif b/theme/identica/images/icons/twotone/green/search.gif Binary files differnew file mode 100644 index 000000000..c36463d0d --- /dev/null +++ b/theme/identica/images/icons/twotone/green/search.gif diff --git a/theme/identica/images/icons/twotone/green/shield.gif b/theme/identica/images/icons/twotone/green/shield.gif Binary files differnew file mode 100644 index 000000000..419d5ee4b --- /dev/null +++ b/theme/identica/images/icons/twotone/green/shield.gif diff --git a/theme/identica/images/icons/twotone/green/skip-back.gif b/theme/identica/images/icons/twotone/green/skip-back.gif Binary files differnew file mode 100644 index 000000000..adca7aa3e --- /dev/null +++ b/theme/identica/images/icons/twotone/green/skip-back.gif diff --git a/theme/identica/images/icons/twotone/green/skip.gif b/theme/identica/images/icons/twotone/green/skip.gif Binary files differnew file mode 100644 index 000000000..ae5417f2f --- /dev/null +++ b/theme/identica/images/icons/twotone/green/skip.gif diff --git a/theme/identica/images/icons/twotone/green/skull.gif b/theme/identica/images/icons/twotone/green/skull.gif Binary files differnew file mode 100644 index 000000000..033506732 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/skull.gif diff --git a/theme/identica/images/icons/twotone/green/statusbar.gif b/theme/identica/images/icons/twotone/green/statusbar.gif Binary files differnew file mode 100644 index 000000000..47d61b106 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/statusbar.gif diff --git a/theme/identica/images/icons/twotone/green/stop.gif b/theme/identica/images/icons/twotone/green/stop.gif Binary files differnew file mode 100644 index 000000000..e0b108d35 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/stop.gif diff --git a/theme/identica/images/icons/twotone/green/template.gif b/theme/identica/images/icons/twotone/green/template.gif Binary files differnew file mode 100644 index 000000000..65c0c4a0a --- /dev/null +++ b/theme/identica/images/icons/twotone/green/template.gif diff --git a/theme/identica/images/icons/twotone/green/text-bigger.gif b/theme/identica/images/icons/twotone/green/text-bigger.gif Binary files differnew file mode 100644 index 000000000..45e143b7a --- /dev/null +++ b/theme/identica/images/icons/twotone/green/text-bigger.gif diff --git a/theme/identica/images/icons/twotone/green/text-smaller.gif b/theme/identica/images/icons/twotone/green/text-smaller.gif Binary files differnew file mode 100644 index 000000000..a54d0c1d3 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/text-smaller.gif diff --git a/theme/identica/images/icons/twotone/green/trash.gif b/theme/identica/images/icons/twotone/green/trash.gif Binary files differnew file mode 100644 index 000000000..78dd64a3d --- /dev/null +++ b/theme/identica/images/icons/twotone/green/trash.gif diff --git a/theme/identica/images/icons/twotone/green/two-docs.gif b/theme/identica/images/icons/twotone/green/two-docs.gif Binary files differnew file mode 100644 index 000000000..97e54b964 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/two-docs.gif diff --git a/theme/identica/images/icons/twotone/green/twotone.gif b/theme/identica/images/icons/twotone/green/twotone.gif Binary files differnew file mode 100644 index 000000000..45aad25c4 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/twotone.gif diff --git a/theme/identica/images/icons/twotone/green/undo.gif b/theme/identica/images/icons/twotone/green/undo.gif Binary files differnew file mode 100644 index 000000000..6869b3050 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/undo.gif diff --git a/theme/identica/images/icons/twotone/green/user.gif b/theme/identica/images/icons/twotone/green/user.gif Binary files differnew file mode 100644 index 000000000..c85460fcd --- /dev/null +++ b/theme/identica/images/icons/twotone/green/user.gif diff --git a/theme/identica/images/icons/twotone/green/vegetable.gif b/theme/identica/images/icons/twotone/green/vegetable.gif Binary files differnew file mode 100644 index 000000000..4d421c1bb --- /dev/null +++ b/theme/identica/images/icons/twotone/green/vegetable.gif diff --git a/theme/identica/images/icons/twotone/green/x.gif b/theme/identica/images/icons/twotone/green/x.gif Binary files differnew file mode 100644 index 000000000..ffb2efea0 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/x.gif diff --git a/theme/identica/images/icons/twotone/green/zoom-in.gif b/theme/identica/images/icons/twotone/green/zoom-in.gif Binary files differnew file mode 100644 index 000000000..a59a5bb50 --- /dev/null +++ b/theme/identica/images/icons/twotone/green/zoom-in.gif diff --git a/theme/identica/images/icons/twotone/green/zoom-out.gif b/theme/identica/images/icons/twotone/green/zoom-out.gif Binary files differnew file mode 100644 index 000000000..c61f999fd --- /dev/null +++ b/theme/identica/images/icons/twotone/green/zoom-out.gif diff --git a/theme/identica/logo.png b/theme/identica/logo.png Binary files differindex 3b271814d..4a5b5470e 100644 --- a/theme/identica/logo.png +++ b/theme/identica/logo.png |