From d0c850f380d1e302b5b7ae2696526c8ac64d62de Mon Sep 17 00:00:00 2001 From: Samantha Doherty Date: Wed, 11 May 2011 16:57:42 -0400 Subject: [PATCH 01/26] Quick fix for extended profile js buttons --- plugins/ExtendedProfile/css/profiledetail.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ExtendedProfile/css/profiledetail.css b/plugins/ExtendedProfile/css/profiledetail.css index 7de7e88ff5..def07f3beb 100644 --- a/plugins/ExtendedProfile/css/profiledetail.css +++ b/plugins/ExtendedProfile/css/profiledetail.css @@ -119,7 +119,7 @@ height: 16px; width: 16px; overflow: hidden; - background-image: url('../../../theme/rebase/images/icons/icons-01.gif'); + background-image: url('../../../theme/base/images/icons/icons-01.gif'); background-repeat: no-repeat; } From 37cf7c0e8ccaffb11b743da45eaea4a2897bad94 Mon Sep 17 00:00:00 2001 From: Samantha Doherty Date: Wed, 11 May 2011 17:07:08 -0400 Subject: [PATCH 02/26] Style for invite forms and width fix for Onboard popup. --- lib/inviteform.php | 10 -------- theme/neo/css/display.css | 48 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 12 deletions(-) diff --git a/lib/inviteform.php b/lib/inviteform.php index 7b3c164cc8..da23d31264 100644 --- a/lib/inviteform.php +++ b/lib/inviteform.php @@ -65,16 +65,6 @@ class InviteForm extends Form return 'form_invite'; } - /** - * class of the form - * - * @return string of the form class - */ - function formClass() - { - return 'form_settings'; - } - /** * Action of the form * diff --git a/theme/neo/css/display.css b/theme/neo/css/display.css index 2ca9831963..dbf9b70cd2 100644 --- a/theme/neo/css/display.css +++ b/theme/neo/css/display.css @@ -1057,7 +1057,7 @@ background-color:rgba(200, 200, 200, 0.300); background-color: #f2f2f2; } -.form_notice input.submit, .form_settings input.submit, .form_settings input.cancel { +.form_notice input.submit, .form_settings input.submit, .form_settings input.cancel, #form_invite input.submit { height: 1.9em; padding: 0px 10px; color:#fff; @@ -1075,7 +1075,7 @@ background-color:rgba(200, 200, 200, 0.300); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff9d63', endColorstr='#FB6104',GradientType=0 ); } -.form_notice input.submit:hover, .form_settings input.submit:hover, .form_settings input.cancel:hover { +.form_notice input.submit:hover, .form_settings input.submit:hover, .form_settings input.cancel:hover, #form_invite input.submit:hover { text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.6); background: #ff9d63; background: -moz-linear-gradient(top, #FB6104 , #fc8035); @@ -1128,6 +1128,45 @@ background-color:rgba(200, 200, 200, 0.300); padding-top: 25px; } +#invite #content p { + margin-bottom: 15px; +} + +#invite #content ul { + list-style-type: none; + margin-bottom: 25px; + margin-left: 25px; +} + +#invite #content li { + background: url(../images/resultset_next.png) no-repeat 0px 3px; + padding-left: 20px; + margin-bottom: 10px; +} + +#invite #content #form_invite ul, #invite #content #form_invite li { + margin-left: 0px; + padding-left: 0px; + background: none; +} + +#form_invite input[type=text], #form_invite textarea { + width: 250px; + padding: 5px; + border: 1px solid #a6a6a6; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2); + -moz-box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.2); +} + +#form_invite textarea { + clear: left; + width: 508px; + height: 48px; +} #content thead th { text-align:left; @@ -1339,6 +1378,11 @@ ul.bookmark-tags a:hover { padding: 10px; } +.onboard_iframe #wrap { + width: auto; + background: none; +} + .onboard_welcome p { margin-bottom: 10px; } From 04a593487a3b7a44f213cc92b783b3c22c23c579 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 11 May 2011 14:33:22 -0700 Subject: [PATCH 03/26] Change whitelist invite form's add new item control to be consistent with similar controls elsewhere --- .../DomainWhitelist/lib/whitelistinviteform.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/plugins/DomainWhitelist/lib/whitelistinviteform.php b/plugins/DomainWhitelist/lib/whitelistinviteform.php index 72029bc3e8..4928b88199 100644 --- a/plugins/DomainWhitelist/lib/whitelistinviteform.php +++ b/plugins/DomainWhitelist/lib/whitelistinviteform.php @@ -141,7 +141,7 @@ class WhitelistInviteForm extends Form 'a', array( 'class' => 'remove_row', - 'href' => 'javascript://', + 'href' => 'javascript://', ), '-' ); @@ -150,21 +150,12 @@ class WhitelistInviteForm extends Form 'a', array( 'class' => 'add_row', - 'href' => 'javascript://', + 'href' => 'javascript://', ), - '+' + _m('Add another item') ); } - - function getUsersDomain() - { - $user = common_current_user(); - assert(!empty($user)); - - - } - /** * Action elements * From 84c8ffc28a13d13e40b88708fd7d8dd35b74dea8 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 11 May 2011 16:00:35 -0700 Subject: [PATCH 04/26] Show confirm dialog when deleting an invite (if the user has already entered an email address) --- .../DomainWhitelist/DomainWhitelistPlugin.php | 14 ++++++++ plugins/DomainWhitelist/js/whitelistinvite.js | 35 ++++++++++++++++--- .../lib/whitelistinviteform.php | 2 +- 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/plugins/DomainWhitelist/DomainWhitelistPlugin.php b/plugins/DomainWhitelist/DomainWhitelistPlugin.php index e320fb2490..9e1b31ef34 100644 --- a/plugins/DomainWhitelist/DomainWhitelistPlugin.php +++ b/plugins/DomainWhitelist/DomainWhitelistPlugin.php @@ -248,11 +248,25 @@ class DomainWhitelistPlugin extends Plugin */ function onStartShowInviteForm($action) { + $this->showConfirmDialog($action); $form = new WhitelistInviteForm($action, $this->getWhitelist()); $form->show(); return false; } + function showConfirmDialog($action) + { + // For JQuery UI modal dialog + $action->elementStart( + 'div', + // TRANS: Title for invitiation deletion dialog. + array('id' => 'confirm-dialog', 'title' => _m('Confirmation Required')) + ); + // TRANS: Confirmation text for invitation deletion dialog. + $action->text(_m('Really delete this invitation?')); + $action->elementEnd('div'); + } + /** * This is a bit of a hack. We take the values from the custom * whitelist invite form and reformat them so they look like diff --git a/plugins/DomainWhitelist/js/whitelistinvite.js b/plugins/DomainWhitelist/js/whitelistinvite.js index d6a5a29eed..9a71936445 100644 --- a/plugins/DomainWhitelist/js/whitelistinvite.js +++ b/plugins/DomainWhitelist/js/whitelistinvite.js @@ -27,14 +27,41 @@ SN_WHITELIST.addRow = function() { }; SN_WHITELIST.removeRow = function() { - $(this).closest("li").hide("blind", "slow", function() { - $(this).remove(); - SN_WHITELIST.updateButtons(); + + var that = this; + + $("#confirm-dialog").dialog({ + buttons : { + "Confirm" : function() { + $(this).dialog("close"); + $(that).closest("li").hide("blind", "slow", function() { + $(this).remove(); + SN_WHITELIST.updateButtons(); + }); + }, + "Cancel" : function() { + $(this).dialog("close"); + } + } }); + + if ($(this).closest('li').find(':input[name^=username]').val()) { + $("#confirm-dialog").dialog("open"); + } else { + $(that).closest("li").hide("blind", "slow", function() { + $(this).remove(); + SN_WHITELIST.updateButtons(); + }); + } }; $(document).ready(function() { + + $("#confirm-dialog").dialog({ + autoOpen: false, + modal: true + }); + $('.add_row').live('click', SN_WHITELIST.addRow); $('.remove_row').live('click', SN_WHITELIST.removeRow); }); - diff --git a/plugins/DomainWhitelist/lib/whitelistinviteform.php b/plugins/DomainWhitelist/lib/whitelistinviteform.php index 4928b88199..165d708b75 100644 --- a/plugins/DomainWhitelist/lib/whitelistinviteform.php +++ b/plugins/DomainWhitelist/lib/whitelistinviteform.php @@ -134,7 +134,7 @@ class WhitelistInviteForm extends Form $this->showMultiControls(); $this->out->elementEnd('li'); } - + function showMultiControls() { $this->out->element( From 607fa564493a1c8b68d49542f865d2dc49471669 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 11 May 2011 16:19:51 -0700 Subject: [PATCH 05/26] Don't add the user's domain to invitee domains unless it's on the whitelist --- plugins/DomainWhitelist/DomainWhitelistPlugin.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/DomainWhitelist/DomainWhitelistPlugin.php b/plugins/DomainWhitelist/DomainWhitelistPlugin.php index 9e1b31ef34..cf0d94884d 100644 --- a/plugins/DomainWhitelist/DomainWhitelistPlugin.php +++ b/plugins/DomainWhitelist/DomainWhitelistPlugin.php @@ -231,8 +231,9 @@ class DomainWhitelistPlugin extends Plugin ) ); - array_unshift($orderedWhitelist, $userDomain); - + if (in_array($userDomain, $whitelist)) { + array_unshift($orderedWhitelist, $userDomain); + } return $orderedWhitelist; } From 4a04291c1651df62c9008548ebf9511ab5d8df04 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 11 May 2011 16:29:35 -0700 Subject: [PATCH 06/26] Make add/remove item buttons work the same way they do on the extended profile form --- plugins/DomainWhitelist/js/whitelistinvite.js | 8 ++++++-- plugins/DomainWhitelist/lib/whitelistinviteform.php | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/DomainWhitelist/js/whitelistinvite.js b/plugins/DomainWhitelist/js/whitelistinvite.js index 9a71936445..2038a93f33 100644 --- a/plugins/DomainWhitelist/js/whitelistinvite.js +++ b/plugins/DomainWhitelist/js/whitelistinvite.js @@ -2,12 +2,16 @@ var SN_WHITELIST = SN_WHITELIST || {}; SN_WHITELIST.updateButtons = function() { + $("ul > li > a.remove_row").show(); + $("ul > li > a.add_row").hide(); + var lis = $('ul > li > input[name^="username[]"]'); if (lis.length === 1) { $("ul > li > a.remove_row").hide(); } else { $("ul > li > a.remove_row:first").show(); } + $("ul > li > a.add_row:last").show(); }; SN_WHITELIST.resetRow = function(row) { @@ -27,7 +31,6 @@ SN_WHITELIST.addRow = function() { }; SN_WHITELIST.removeRow = function() { - var that = this; $("#confirm-dialog").dialog({ @@ -56,7 +59,6 @@ SN_WHITELIST.removeRow = function() { }; $(document).ready(function() { - $("#confirm-dialog").dialog({ autoOpen: false, modal: true @@ -64,4 +66,6 @@ $(document).ready(function() { $('.add_row').live('click', SN_WHITELIST.addRow); $('.remove_row').live('click', SN_WHITELIST.removeRow); + + SN_WHITELIST.updateButtons(); }); diff --git a/plugins/DomainWhitelist/lib/whitelistinviteform.php b/plugins/DomainWhitelist/lib/whitelistinviteform.php index 165d708b75..7ff730e6a8 100644 --- a/plugins/DomainWhitelist/lib/whitelistinviteform.php +++ b/plugins/DomainWhitelist/lib/whitelistinviteform.php @@ -142,6 +142,7 @@ class WhitelistInviteForm extends Form array( 'class' => 'remove_row', 'href' => 'javascript://', + 'style' => 'display: none;' ), '-' ); @@ -151,6 +152,7 @@ class WhitelistInviteForm extends Form array( 'class' => 'add_row', 'href' => 'javascript://', + 'style' => 'display: none;' ), _m('Add another item') ); From f44e0330df8ffd18786dbeb2e0a6ad4e2641046a Mon Sep 17 00:00:00 2001 From: Samantha Doherty Date: Wed, 11 May 2011 20:12:32 -0400 Subject: [PATCH 07/26] Style for fancy invite form item controls. --- theme/neo/css/display.css | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/theme/neo/css/display.css b/theme/neo/css/display.css index dbf9b70cd2..2ab4b9158d 100644 --- a/theme/neo/css/display.css +++ b/theme/neo/css/display.css @@ -1168,6 +1168,39 @@ background-color:rgba(200, 200, 200, 0.300); height: 48px; } +#form_invite a.add_row, #form_invite a.remove_row { + display: block; + height: 16px; + width: 16px; + overflow: hidden; + background-image: url('../../base/images/icons/icons-01.gif'); + background-repeat: no-repeat; +} + +#form_invite a.remove_row { + background-position: 0px -1252px; + display: inline-block; + position: relative; + top: 4px; + left: 10px; + line-height: 4em; +} + +#form_invite a.add_row { + clear: both; + position: relative; + top: 10px; + background-position: 0px -1186px; + width: 120px; + padding-left: 20px; + line-height: 1.2em; +} + +#form_invite label[for=personal] { + display: block; + margin-top: 25px; +} + #content thead th { text-align:left; } From 125141a0c6762e25f22464f741914a7404ae6dd8 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 11 May 2011 17:20:24 -0700 Subject: [PATCH 08/26] Make the effects for adding/removing invites less jerky --- plugins/DomainWhitelist/js/whitelistinvite.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/DomainWhitelist/js/whitelistinvite.js b/plugins/DomainWhitelist/js/whitelistinvite.js index 2038a93f33..01e493fa6a 100644 --- a/plugins/DomainWhitelist/js/whitelistinvite.js +++ b/plugins/DomainWhitelist/js/whitelistinvite.js @@ -24,8 +24,9 @@ SN_WHITELIST.resetRow = function(row) { SN_WHITELIST.addRow = function() { var row = $(this).closest("li"); var newRow = row.clone(); + $(row).find('a.add_row').hide(); SN_WHITELIST.resetRow(newRow); - $(newRow).insertAfter(row).show("blind", "slow", function() { + $(newRow).insertAfter(row).show("blind", "fast", function() { SN_WHITELIST.updateButtons(); }); }; @@ -37,7 +38,7 @@ SN_WHITELIST.removeRow = function() { buttons : { "Confirm" : function() { $(this).dialog("close"); - $(that).closest("li").hide("blind", "slow", function() { + $(that).closest("li").hide("blind", "fast", function() { $(this).remove(); SN_WHITELIST.updateButtons(); }); @@ -51,7 +52,7 @@ SN_WHITELIST.removeRow = function() { if ($(this).closest('li').find(':input[name^=username]').val()) { $("#confirm-dialog").dialog("open"); } else { - $(that).closest("li").hide("blind", "slow", function() { + $(that).closest("li").hide("blind", "fast", function() { $(this).remove(); SN_WHITELIST.updateButtons(); }); From 4718063a7890b5c8ff94e7bf71bcfae837a43e9b Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Mon, 16 May 2011 13:25:26 -0700 Subject: [PATCH 09/26] Script to cancel an email registration --- .../scripts/cancelemailregistration.php | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 plugins/EmailRegistration/scripts/cancelemailregistration.php diff --git a/plugins/EmailRegistration/scripts/cancelemailregistration.php b/plugins/EmailRegistration/scripts/cancelemailregistration.php new file mode 100644 index 0000000000..e6430e850f --- /dev/null +++ b/plugins/EmailRegistration/scripts/cancelemailregistration.php @@ -0,0 +1,55 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); + +$shortoptions = 'd'; +$longoptions = array('dryrun'); + +$helptext = << + +Options: +-d --dryrun Don't actually delete the email registration and confirmation code + +Cancel an email registration code + +END_OF_REGISTEREMAILUSER_HELP; + +require_once INSTALLDIR.'/scripts/commandline.inc'; + +if (count($args) == 0) { + show_help(); +} + +$email = $args[0]; + +$confirm = Confirm_address::getAddress($email, EmailRegistrationPlugin::CONFIRMTYPE); + +if (!empty($confirm)) { + if (have_option('d', 'dryrun')) { + print "[Dry run mode] Deleted confirmation code {$confirm->code} for {$confirm->address}.\n"; + } else { + $confirm->delete(); + print "Deleted confirmation code {$confirm->code} for {$confirm->address}.\n"; + } +} else { + print "Couldn't find an email registration code for {$email}.\n"; +} From 0f5aab8cd5ce252978b8f3c65a83f349e7427c20 Mon Sep 17 00:00:00 2001 From: Samantha Doherty Date: Wed, 18 May 2011 09:23:55 -0400 Subject: [PATCH 10/26] Small syntax fix for inline reply placeholder. --- js/util.js | 2 +- js/util.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/util.js b/js/util.js index 5c12ab111d..979415c639 100644 --- a/js/util.js +++ b/js/util.js @@ -735,7 +735,7 @@ var SN = { // StatusNet list = notice.find('ul.threaded-replies'); } var placeholder = $('
  • ' + - '' + + '' + '
  • '); placeholder.find('input') .val(SN.msg('reply_placeholder')); diff --git a/js/util.min.js b/js/util.min.js index 1b3867b7ca..1dd11c2852 100644 --- a/js/util.min.js +++ b/js/util.min.js @@ -1 +1 @@ -var SN={C:{I:{CounterBlackout:false,MaxLength:140,PatternUsername:/^[0-9a-zA-Z\-_.]*$/,HTTP20x30x:[200,201,202,203,204,205,206,300,301,302,303,304,305,306,307],NoticeFormMaster:null},S:{Disabled:"disabled",Warning:"warning",Error:"error",Success:"success",Processing:"processing",CommandResult:"command_result",FormNotice:"form_notice",NoticeDataGeo:"notice_data-geo",NoticeDataGeoCookie:"NoticeDataGeo",NoticeDataGeoSelected:"notice_data-geo_selected",StatusNetInstance:"StatusNetInstance"}},messages:{},msg:function(a){if(typeof SN.messages[a]=="undefined"){return"["+a+"]"}else{return SN.messages[a]}},U:{FormNoticeEnhancements:function(b){if(jQuery.data(b[0],"ElementData")===undefined){MaxLength=b.find(".count").text();if(typeof(MaxLength)=="undefined"){MaxLength=SN.C.I.MaxLength}jQuery.data(b[0],"ElementData",{MaxLength:MaxLength});SN.U.Counter(b);NDT=b.find(".notice_data-text:first");NDT.bind("keyup",function(c){SN.U.Counter(b)});var a=function(c){window.setTimeout(function(){SN.U.Counter(b)},50)};NDT.bind("cut",a).bind("paste",a)}else{b.find(".count").text(jQuery.data(b[0],"ElementData").MaxLength)}},Counter:function(d){SN.C.I.FormNoticeCurrent=d;var b=jQuery.data(d[0],"ElementData").MaxLength;if(b<=0){return}var c=b-SN.U.CharacterCount(d);var a=d.find(".count");if(c.toString()!=a.text()){if(!SN.C.I.CounterBlackout||c===0){if(a.text()!=String(c)){a.text(c)}if(c<0){d.addClass(SN.C.S.Warning)}else{d.removeClass(SN.C.S.Warning)}if(!SN.C.I.CounterBlackout){SN.C.I.CounterBlackout=true;SN.C.I.FormNoticeCurrent=d;window.setTimeout("SN.U.ClearCounterBlackout(SN.C.I.FormNoticeCurrent);",500)}}}},CharacterCount:function(a){return a.find(".notice_data-text:first").val().length},ClearCounterBlackout:function(a){SN.C.I.CounterBlackout=false;SN.U.Counter(a)},RewriteAjaxAction:function(a){if(document.location.protocol=="https:"&&a.substr(0,5)=="http:"){return a.replace(/^http:\/\/[^:\/]+/,"https://"+document.location.host)}else{return a}},FormXHR:function(a,b){$.ajax({type:"POST",dataType:"xml",url:SN.U.RewriteAjaxAction(a.attr("action")),data:a.serialize()+"&ajax=1",beforeSend:function(c){a.addClass(SN.C.S.Processing).find(".submit").addClass(SN.C.S.Disabled).attr(SN.C.S.Disabled,SN.C.S.Disabled)},error:function(e,f,d){var c=null;if(e.responseXML){c=$("#error",e.responseXML).text()}alert(c||d||f);a.removeClass(SN.C.S.Processing).find(".submit").removeClass(SN.C.S.Disabled).removeAttr(SN.C.S.Disabled)},success:function(c,d){if(typeof($("form",c)[0])!="undefined"){form_new=document._importNode($("form",c)[0],true);a.replaceWith(form_new);if(b){b()}}else{if(typeof($("p",c)[0])!="undefined"){a.replaceWith(document._importNode($("p",c)[0],true));if(b){b()}}else{alert("Unknown error.")}}}})},FormNoticeXHR:function(b){SN.C.I.NoticeDataGeo={};b.append('');b.attr("action",SN.U.RewriteAjaxAction(b.attr("action")));var c=function(d,e){b.append($('

    ').addClass(d).text(e))};var a=function(){b.find(".form_response").remove()};b.ajaxForm({dataType:"xml",timeout:"60000",beforeSend:function(d){if(b.find(".notice_data-text:first").val()==""){b.addClass(SN.C.S.Warning);return false}b.addClass(SN.C.S.Processing).find(".submit").addClass(SN.C.S.Disabled).attr(SN.C.S.Disabled,SN.C.S.Disabled);SN.U.normalizeGeoData(b);return true},error:function(f,g,e){b.removeClass(SN.C.S.Processing).find(".submit").removeClass(SN.C.S.Disabled).removeAttr(SN.C.S.Disabled,SN.C.S.Disabled);a();if(g=="timeout"){c("error","Sorry! We had trouble sending your notice. The servers are overloaded. Please try again, and contact the site administrator if this problem persists.")}else{var d=SN.U.GetResponseXML(f);if($("."+SN.C.S.Error,d).length>0){b.append(document._importNode($("."+SN.C.S.Error,d)[0],true))}else{if(parseInt(f.status)===0||jQuery.inArray(parseInt(f.status),SN.C.I.HTTP20x30x)>=0){b.resetForm().find(".attach-status").remove();SN.U.FormNoticeEnhancements(b)}else{c("error","(Sorry! We had trouble sending your notice ("+f.status+" "+f.statusText+"). Please report the problem to the site administrator if this happens again.")}}}},success:function(j,f){a();var p=$("#"+SN.C.S.Error,j);if(p.length>0){c("error",p.text())}else{if($("body")[0].id=="bookmarklet"){self.close()}var d=$("#"+SN.C.S.CommandResult,j);if(d.length>0){c("success",d.text())}else{var o=document._importNode($("li",j)[0],true);var k=$("#notices_primary .notices:first");var m=b.closest("li.notice-reply");if(m.length>0){var l=b.closest(".threaded-replies");var n=l.find(".notice-reply-placeholder");m.remove();var e=$(o).attr("id");if($("#"+e).length==0){$(o).insertBefore(n)}else{}n.show()}else{if(k.length>0&&SN.U.belongsOnTimeline(o)){if($("#"+o.id).length===0){var h=b.find("[name=inreplyto]").val();var g="#notices_primary #notice-"+h;if($("body")[0].id=="conversation"){if(h.length>0&&$(g+" .notices").length<1){$(g).append('
      ')}$($(g+" .notices")[0]).append(o)}else{k.prepend(o)}$("#"+o.id).css({display:"none"}).fadeIn(2500);SN.U.NoticeWithAttachment($("#"+o.id));SN.U.switchInputFormTab("placeholder")}}else{c("success",$("title",j).text())}}}b.resetForm();b.find("[name=inreplyto]").val("");b.find(".attach-status").remove();SN.U.FormNoticeEnhancements(b)}},complete:function(d,e){b.removeClass(SN.C.S.Processing).find(".submit").removeAttr(SN.C.S.Disabled).removeClass(SN.C.S.Disabled);b.find("[name=lat]").val(SN.C.I.NoticeDataGeo.NLat);b.find("[name=lon]").val(SN.C.I.NoticeDataGeo.NLon);b.find("[name=location_ns]").val(SN.C.I.NoticeDataGeo.NLNS);b.find("[name=location_id]").val(SN.C.I.NoticeDataGeo.NLID);b.find("[name=notice_data-geo]").attr("checked",SN.C.I.NoticeDataGeo.NDG)}})},FormProfileSearchXHR:function(a){$.ajax({type:"POST",dataType:"xml",url:a.attr("action"),data:a.serialize()+"&ajax=1",beforeSend:function(b){a.addClass(SN.C.S.Processing).find(".submit").addClass(SN.C.S.Disabled).attr(SN.C.S.Disabled,SN.C.S.Disabled)},error:function(c,d,b){alert(b||d)},success:function(d,f){var b=$("#profile_search_results");if(typeof($("ul",d)[0])!="undefined"){var c=document._importNode($("ul",d)[0],true);b.replaceWith(c)}else{var e=$("
    • ").append(document._importNode($("p",d)[0],true));b.html(e)}a.removeClass(SN.C.S.Processing).find(".submit").removeClass(SN.C.S.Disabled).attr(SN.C.S.Disabled,false)}})},FormPeopletagsXHR:function(a){$.ajax({type:"POST",dataType:"xml",url:a.attr("action"),data:a.serialize()+"&ajax=1",beforeSend:function(b){a.find(".submit").addClass(SN.C.S.Processing).addClass(SN.C.S.Disabled).attr(SN.C.S.Disabled,SN.C.S.Disabled)},error:function(c,d,b){alert(b||d)},success:function(d,e){var c=a.parents(".entity_tags");if(typeof($(".entity_tags",d)[0])!="undefined"){var b=document._importNode($(".entity_tags",d)[0],true);$(b).find(".editable").append($('').closest(".notice-options").addClass("opaque");a.find("button.close").click(function(){$(this).remove();a.removeClass("dialogbox").closest(".notice-options").removeClass("opaque");a.find(".submit_dialogbox").remove();a.find(".submit").show();return false})},NoticeAttachments:function(){$(".notice a.attachment").each(function(){SN.U.NoticeWithAttachment($(this).closest(".notice"))})},NoticeWithAttachment:function(b){if(b.find(".attachment").length===0){return}var a=b.find(".attachment.more");if(a.length>0){$(a[0]).click(function(){var c=$(this);c.addClass(SN.C.S.Processing);$.get(c.attr("href")+"/ajax",null,function(d){c.parent(".entry-content").html($(d).find("#attachment_view .entry-content").html())});return false}).attr("title",SN.msg("showmore_tooltip"))}},NoticeDataAttach:function(b){var a=b.find("input[type=file]");a.change(function(f){b.find(".attach-status").remove();var d=$(this).val();if(!d){return false}var c=$('
      ');c.find("code").text(d);c.find("button").click(function(){c.remove();a.val("");return false});b.append(c);if(typeof this.files=="object"){for(var e=0;eg){f=false}if(f){h(c,function(k){var j=$("").attr("title",e).attr("alt",e).attr("src",k).attr("style","height: 120px");d.find(".attach-status").append(j)})}else{var b=$("
      ").text(e);d.find(".attach-status").append(b)}},NoticeLocationAttach:function(a){var e=a.find("[name=lat]");var l=a.find("[name=lon]");var g=a.find("[name=location_ns]").val();var m=a.find("[name=location_id]").val();var b="";var d=a.find("[name=notice_data-geo]");var c=a.find("[name=notice_data-geo]");var k=a.find("label.notice_data-geo");function f(o){k.attr("title",jQuery.trim(k.text())).removeClass("checked");a.find("[name=lat]").val("");a.find("[name=lon]").val("");a.find("[name=location_ns]").val("");a.find("[name=location_id]").val("");a.find("[name=notice_data-geo]").attr("checked",false);$.cookie(SN.C.S.NoticeDataGeoCookie,"disabled",{path:"/"});if(o){a.find(".geo_status_wrapper").removeClass("success").addClass("error");a.find(".geo_status_wrapper .geo_status").text(o)}else{a.find(".geo_status_wrapper").remove()}}function n(o,p){SN.U.NoticeGeoStatus(a,"Looking up place name...");$.getJSON(o,p,function(q){var r,s;if(typeof(q.location_ns)!="undefined"){a.find("[name=location_ns]").val(q.location_ns);r=q.location_ns}if(typeof(q.location_id)!="undefined"){a.find("[name=location_id]").val(q.location_id);s=q.location_id}if(typeof(q.name)=="undefined"){NLN_text=p.lat+";"+p.lon}else{NLN_text=q.name}SN.U.NoticeGeoStatus(a,NLN_text,p.lat,p.lon,q.url);k.attr("title",NoticeDataGeo_text.ShareDisable+" ("+NLN_text+")");a.find("[name=lat]").val(p.lat);a.find("[name=lon]").val(p.lon);a.find("[name=location_ns]").val(r);a.find("[name=location_id]").val(s);a.find("[name=notice_data-geo]").attr("checked",true);var t={NLat:p.lat,NLon:p.lon,NLNS:r,NLID:s,NLN:NLN_text,NLNU:q.url,NDG:true};$.cookie(SN.C.S.NoticeDataGeoCookie,JSON.stringify(t),{path:"/"})})}if(c.length>0){if($.cookie(SN.C.S.NoticeDataGeoCookie)=="disabled"){c.attr("checked",false)}else{c.attr("checked",true)}var h=a.find(".notice_data-geo_wrap");var j=h.attr("data-api");k.attr("title",k.text());c.change(function(){if(c.attr("checked")===true||$.cookie(SN.C.S.NoticeDataGeoCookie)===null){k.attr("title",NoticeDataGeo_text.ShareDisable).addClass("checked");if($.cookie(SN.C.S.NoticeDataGeoCookie)===null||$.cookie(SN.C.S.NoticeDataGeoCookie)=="disabled"){if(navigator.geolocation){SN.U.NoticeGeoStatus(a,"Requesting location from browser...");navigator.geolocation.getCurrentPosition(function(q){a.find("[name=lat]").val(q.coords.latitude);a.find("[name=lon]").val(q.coords.longitude);var r={lat:q.coords.latitude,lon:q.coords.longitude,token:$("#token").val()};n(j,r)},function(q){switch(q.code){case q.PERMISSION_DENIED:f("Location permission denied.");break;case q.TIMEOUT:f("Location lookup timeout.");break}},{timeout:10000})}else{if(e.length>0&&l.length>0){var o={lat:e,lon:l,token:$("#token").val()};n(j,o)}else{f();c.remove();k.remove()}}}else{var p=JSON.parse($.cookie(SN.C.S.NoticeDataGeoCookie));a.find("[name=lat]").val(p.NLat);a.find("[name=lon]").val(p.NLon);a.find("[name=location_ns]").val(p.NLNS);a.find("[name=location_id]").val(p.NLID);a.find("[name=notice_data-geo]").attr("checked",p.NDG);SN.U.NoticeGeoStatus(a,p.NLN,p.NLat,p.NLon,p.NLNU);k.attr("title",NoticeDataGeo_text.ShareDisable+" ("+p.NLN+")").addClass("checked")}}else{f()}}).change()}},NoticeGeoStatus:function(e,a,f,g,c){var h=e.find(".geo_status_wrapper");if(h.length==0){h=$('
      ');h.find("button.close").click(function(){e.find("[name=notice_data-geo]").removeAttr("checked").change();return false});e.append(h)}var b;if(c){b=$("").attr("href",c)}else{b=$("")}b.text(a);if(f||g){var d=f+";"+g;b.attr("title",d);if(!a){b.text(d)}}h.find(".geo_status").empty().append(b)},NewDirectMessage:function(){NDM=$(".entity_send-a-message a");NDM.attr({href:NDM.attr("href")+"&ajax=1"});NDM.bind("click",function(){var a=$(".entity_send-a-message form");if(a.length===0){$(this).addClass(SN.C.S.Processing);$.get(NDM.attr("href"),null,function(b){$(".entity_send-a-message").append(document._importNode($("form",b)[0],true));a=$(".entity_send-a-message .form_notice");SN.U.FormNoticeXHR(a);SN.U.FormNoticeEnhancements(a);a.append('');$(".entity_send-a-message button").click(function(){a.hide();return false});NDM.removeClass(SN.C.S.Processing)})}else{a.show();$(".entity_send-a-message textarea").focus()}return false})},GetFullYear:function(c,d,a){var b=new Date();b.setFullYear(c,d,a);return b},StatusNetInstance:{Set:function(b){var a=SN.U.StatusNetInstance.Get();if(a!==null){b=$.extend(a,b)}$.cookie(SN.C.S.StatusNetInstance,JSON.stringify(b),{path:"/",expires:SN.U.GetFullYear(2029,0,1)})},Get:function(){var a=$.cookie(SN.C.S.StatusNetInstance);if(a!==null){return JSON.parse(a)}return null},Delete:function(){$.cookie(SN.C.S.StatusNetInstance,null)}},belongsOnTimeline:function(b){var a=$("body").attr("id");if(a=="public"){return true}var c=$("#nav_profile a").attr("href");if(c){var d=$(b).find(".vcard.author a.url").attr("href");if(d==c){if(a=="all"||a=="showstream"){return true}}}return false},switchInputFormTab:function(a){$(".input_form_nav_tab.current").removeClass("current");if(a=="placeholder"){$("#input_form_nav_status").addClass("current")}else{$("#input_form_nav_"+a).addClass("current")}var b=$(".input_form.current.nonav");if(b.length>0){return}$(".input_form.current").removeClass("current");$("#input_form_"+a).addClass("current").find(".ajax-notice").each(function(){var c=$(this);SN.Init.NoticeFormSetup(c)}).find(".notice_data-text").focus()}},Init:{NoticeForm:function(){if($("body.user_in").length>0){$("#input_form_placeholder input.placeholder").focus(function(){SN.U.switchInputFormTab("status")});$("body").bind("click",function(g){var d=$("#content .input_forms div.current");if(d.length>0){if($("#content .input_forms").has(g.target).length==0){var a=d.find('textarea, input[type=text], input[type=""]');var c=false;a.each(function(){c=c||$(this).val()});if(!c){SN.U.switchInputFormTab("placeholder")}}}var b=$("li.notice-reply");if(b.length>0){var f=$(g.target);b.each(function(){var k=$(this);if(k.has(g.target).length==0){var h=k.find(".notice_data-text:first");var j=$.trim(h.val());if(j==""||j==h.data("initialText")){var e=k.closest("li.notice");k.remove();e.find("li.notice-reply-placeholder").show()}}})}});$(".input_forms fieldset fieldset label").inFieldLabels({fadeOpacity:0})}},NoticeFormSetup:function(a){if(!a.data("NoticeFormSetup")){SN.U.NoticeLocationAttach(a);SN.U.FormNoticeXHR(a);SN.U.FormNoticeEnhancements(a);SN.U.NoticeDataAttach(a);a.data("NoticeFormSetup",true)}},Notices:function(){if($("body.user_in").length>0){var a=$(".form_notice:first");if(a.length>0){SN.C.I.NoticeFormMaster=document._importNode(a[0],true)}SN.U.NoticeRepeat();SN.U.NoticeReply();SN.U.NoticeInlineReplySetup()}SN.U.NoticeAttachments()},EntityActions:function(){if($("body.user_in").length>0){$(".form_user_subscribe").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_user_unsubscribe").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_group_join").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_group_leave").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_user_nudge").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_peopletag_subscribe").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_peopletag_unsubscribe").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_user_add_peopletag").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_user_remove_peopletag").live("click",function(){SN.U.FormXHR($(this));return false});SN.U.NewDirectMessage()}},ProfileSearch:function(){if($("body.user_in").length>0){$(".form_peopletag_edit_user_search input.submit").live("click",function(){SN.U.FormProfileSearchXHR($(this).parents("form"));return false})}},Login:function(){if(SN.U.StatusNetInstance.Get()!==null){var a=SN.U.StatusNetInstance.Get().Nickname;if(a!==null){$("#form_login #nickname").val(a)}}$("#form_login").bind("submit",function(){SN.U.StatusNetInstance.Set({Nickname:$("#form_login #nickname").val()});return true})},PeopletagAutocomplete:function(b){var a=function(d){return d.split(/\s+/)};var c=function(d){return a(d).pop()};b.live("keydown",function(d){if(d.keyCode===$.ui.keyCode.TAB&&$(this).data("autocomplete").menu.active){d.preventDefault()}}).autocomplete({minLength:0,source:function(e,d){d($.ui.autocomplete.filter(SN.C.PtagACData,c(e.term)))},focus:function(){return false},select:function(e,f){var d=a(this.value);d.pop();d.push(f.item.value);d.push("");this.value=d.join(" ");return false}}).data("autocomplete")._renderItem=function(e,f){var d=''+f.tag+' '+f.mode+''+f.freq+"";return $("
    • ").addClass("mode-"+f.mode).addClass("ptag-ac-line").data("item.autocomplete",f).append(d).appendTo(e)}},PeopleTags:function(){$(".user_profile_tags .editable").append($('').closest(".notice-options").addClass("opaque");a.find("button.close").click(function(){$(this).remove();a.removeClass("dialogbox").closest(".notice-options").removeClass("opaque");a.find(".submit_dialogbox").remove();a.find(".submit").show();return false})},NoticeAttachments:function(){$(".notice a.attachment").each(function(){SN.U.NoticeWithAttachment($(this).closest(".notice"))})},NoticeWithAttachment:function(b){if(b.find(".attachment").length===0){return}var a=b.find(".attachment.more");if(a.length>0){$(a[0]).click(function(){var c=$(this);c.addClass(SN.C.S.Processing);$.get(c.attr("href")+"/ajax",null,function(d){c.parent(".entry-content").html($(d).find("#attachment_view .entry-content").html())});return false}).attr("title",SN.msg("showmore_tooltip"))}},NoticeDataAttach:function(b){var a=b.find("input[type=file]");a.change(function(f){b.find(".attach-status").remove();var d=$(this).val();if(!d){return false}var c=$('
      ');c.find("code").text(d);c.find("button").click(function(){c.remove();a.val("");return false});b.append(c);if(typeof this.files=="object"){for(var e=0;eg){f=false}if(f){h(c,function(k){var j=$("").attr("title",e).attr("alt",e).attr("src",k).attr("style","height: 120px");d.find(".attach-status").append(j)})}else{var b=$("
      ").text(e);d.find(".attach-status").append(b)}},NoticeLocationAttach:function(a){var e=a.find("[name=lat]");var l=a.find("[name=lon]");var g=a.find("[name=location_ns]").val();var m=a.find("[name=location_id]").val();var b="";var d=a.find("[name=notice_data-geo]");var c=a.find("[name=notice_data-geo]");var k=a.find("label.notice_data-geo");function f(o){k.attr("title",jQuery.trim(k.text())).removeClass("checked");a.find("[name=lat]").val("");a.find("[name=lon]").val("");a.find("[name=location_ns]").val("");a.find("[name=location_id]").val("");a.find("[name=notice_data-geo]").attr("checked",false);$.cookie(SN.C.S.NoticeDataGeoCookie,"disabled",{path:"/"});if(o){a.find(".geo_status_wrapper").removeClass("success").addClass("error");a.find(".geo_status_wrapper .geo_status").text(o)}else{a.find(".geo_status_wrapper").remove()}}function n(o,p){SN.U.NoticeGeoStatus(a,"Looking up place name...");$.getJSON(o,p,function(q){var r,s;if(typeof(q.location_ns)!="undefined"){a.find("[name=location_ns]").val(q.location_ns);r=q.location_ns}if(typeof(q.location_id)!="undefined"){a.find("[name=location_id]").val(q.location_id);s=q.location_id}if(typeof(q.name)=="undefined"){NLN_text=p.lat+";"+p.lon}else{NLN_text=q.name}SN.U.NoticeGeoStatus(a,NLN_text,p.lat,p.lon,q.url);k.attr("title",NoticeDataGeo_text.ShareDisable+" ("+NLN_text+")");a.find("[name=lat]").val(p.lat);a.find("[name=lon]").val(p.lon);a.find("[name=location_ns]").val(r);a.find("[name=location_id]").val(s);a.find("[name=notice_data-geo]").attr("checked",true);var t={NLat:p.lat,NLon:p.lon,NLNS:r,NLID:s,NLN:NLN_text,NLNU:q.url,NDG:true};$.cookie(SN.C.S.NoticeDataGeoCookie,JSON.stringify(t),{path:"/"})})}if(c.length>0){if($.cookie(SN.C.S.NoticeDataGeoCookie)=="disabled"){c.attr("checked",false)}else{c.attr("checked",true)}var h=a.find(".notice_data-geo_wrap");var j=h.attr("data-api");k.attr("title",k.text());c.change(function(){if(c.attr("checked")===true||$.cookie(SN.C.S.NoticeDataGeoCookie)===null){k.attr("title",NoticeDataGeo_text.ShareDisable).addClass("checked");if($.cookie(SN.C.S.NoticeDataGeoCookie)===null||$.cookie(SN.C.S.NoticeDataGeoCookie)=="disabled"){if(navigator.geolocation){SN.U.NoticeGeoStatus(a,"Requesting location from browser...");navigator.geolocation.getCurrentPosition(function(q){a.find("[name=lat]").val(q.coords.latitude);a.find("[name=lon]").val(q.coords.longitude);var r={lat:q.coords.latitude,lon:q.coords.longitude,token:$("#token").val()};n(j,r)},function(q){switch(q.code){case q.PERMISSION_DENIED:f("Location permission denied.");break;case q.TIMEOUT:f("Location lookup timeout.");break}},{timeout:10000})}else{if(e.length>0&&l.length>0){var o={lat:e,lon:l,token:$("#token").val()};n(j,o)}else{f();c.remove();k.remove()}}}else{var p=JSON.parse($.cookie(SN.C.S.NoticeDataGeoCookie));a.find("[name=lat]").val(p.NLat);a.find("[name=lon]").val(p.NLon);a.find("[name=location_ns]").val(p.NLNS);a.find("[name=location_id]").val(p.NLID);a.find("[name=notice_data-geo]").attr("checked",p.NDG);SN.U.NoticeGeoStatus(a,p.NLN,p.NLat,p.NLon,p.NLNU);k.attr("title",NoticeDataGeo_text.ShareDisable+" ("+p.NLN+")").addClass("checked")}}else{f()}}).change()}},NoticeGeoStatus:function(e,a,f,g,c){var h=e.find(".geo_status_wrapper");if(h.length==0){h=$('
      ');h.find("button.close").click(function(){e.find("[name=notice_data-geo]").removeAttr("checked").change();return false});e.append(h)}var b;if(c){b=$("").attr("href",c)}else{b=$("")}b.text(a);if(f||g){var d=f+";"+g;b.attr("title",d);if(!a){b.text(d)}}h.find(".geo_status").empty().append(b)},NewDirectMessage:function(){NDM=$(".entity_send-a-message a");NDM.attr({href:NDM.attr("href")+"&ajax=1"});NDM.bind("click",function(){var a=$(".entity_send-a-message form");if(a.length===0){$(this).addClass(SN.C.S.Processing);$.get(NDM.attr("href"),null,function(b){$(".entity_send-a-message").append(document._importNode($("form",b)[0],true));a=$(".entity_send-a-message .form_notice");SN.U.FormNoticeXHR(a);SN.U.FormNoticeEnhancements(a);a.append('');$(".entity_send-a-message button").click(function(){a.hide();return false});NDM.removeClass(SN.C.S.Processing)})}else{a.show();$(".entity_send-a-message textarea").focus()}return false})},GetFullYear:function(c,d,a){var b=new Date();b.setFullYear(c,d,a);return b},StatusNetInstance:{Set:function(b){var a=SN.U.StatusNetInstance.Get();if(a!==null){b=$.extend(a,b)}$.cookie(SN.C.S.StatusNetInstance,JSON.stringify(b),{path:"/",expires:SN.U.GetFullYear(2029,0,1)})},Get:function(){var a=$.cookie(SN.C.S.StatusNetInstance);if(a!==null){return JSON.parse(a)}return null},Delete:function(){$.cookie(SN.C.S.StatusNetInstance,null)}},belongsOnTimeline:function(b){var a=$("body").attr("id");if(a=="public"){return true}var c=$("#nav_profile a").attr("href");if(c){var d=$(b).find(".vcard.author a.url").attr("href");if(d==c){if(a=="all"||a=="showstream"){return true}}}return false},switchInputFormTab:function(a){$(".input_form_nav_tab.current").removeClass("current");if(a=="placeholder"){$("#input_form_nav_status").addClass("current")}else{$("#input_form_nav_"+a).addClass("current")}var b=$(".input_form.current.nonav");if(b.length>0){return}$(".input_form.current").removeClass("current");$("#input_form_"+a).addClass("current").find(".ajax-notice").each(function(){var c=$(this);SN.Init.NoticeFormSetup(c)}).find(".notice_data-text").focus()}},Init:{NoticeForm:function(){if($("body.user_in").length>0){$("#input_form_placeholder input.placeholder").focus(function(){SN.U.switchInputFormTab("status")});$("body").bind("click",function(g){var d=$("#content .input_forms div.current");if(d.length>0){if($("#content .input_forms").has(g.target).length==0){var a=d.find('textarea, input[type=text], input[type=""]');var c=false;a.each(function(){c=c||$(this).val()});if(!c){SN.U.switchInputFormTab("placeholder")}}}var b=$("li.notice-reply");if(b.length>0){var f=$(g.target);b.each(function(){var k=$(this);if(k.has(g.target).length==0){var h=k.find(".notice_data-text:first");var j=$.trim(h.val());if(j==""||j==h.data("initialText")){var e=k.closest("li.notice");k.remove();e.find("li.notice-reply-placeholder").show()}}})}});$(".input_forms fieldset fieldset label").inFieldLabels({fadeOpacity:0})}},NoticeFormSetup:function(a){if(!a.data("NoticeFormSetup")){SN.U.NoticeLocationAttach(a);SN.U.FormNoticeXHR(a);SN.U.FormNoticeEnhancements(a);SN.U.NoticeDataAttach(a);a.data("NoticeFormSetup",true)}},Notices:function(){if($("body.user_in").length>0){var a=$(".form_notice:first");if(a.length>0){SN.C.I.NoticeFormMaster=document._importNode(a[0],true)}SN.U.NoticeRepeat();SN.U.NoticeReply();SN.U.NoticeInlineReplySetup()}SN.U.NoticeAttachments()},EntityActions:function(){if($("body.user_in").length>0){$(".form_user_subscribe").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_user_unsubscribe").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_group_join").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_group_leave").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_user_nudge").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_peopletag_subscribe").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_peopletag_unsubscribe").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_user_add_peopletag").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_user_remove_peopletag").live("click",function(){SN.U.FormXHR($(this));return false});SN.U.NewDirectMessage()}},ProfileSearch:function(){if($("body.user_in").length>0){$(".form_peopletag_edit_user_search input.submit").live("click",function(){SN.U.FormProfileSearchXHR($(this).parents("form"));return false})}},Login:function(){if(SN.U.StatusNetInstance.Get()!==null){var a=SN.U.StatusNetInstance.Get().Nickname;if(a!==null){$("#form_login #nickname").val(a)}}$("#form_login").bind("submit",function(){SN.U.StatusNetInstance.Set({Nickname:$("#form_login #nickname").val()});return true})},PeopletagAutocomplete:function(b){var a=function(d){return d.split(/\s+/)};var c=function(d){return a(d).pop()};b.live("keydown",function(d){if(d.keyCode===$.ui.keyCode.TAB&&$(this).data("autocomplete").menu.active){d.preventDefault()}}).autocomplete({minLength:0,source:function(e,d){d($.ui.autocomplete.filter(SN.C.PtagACData,c(e.term)))},focus:function(){return false},select:function(e,f){var d=a(this.value);d.pop();d.push(f.item.value);d.push("");this.value=d.join(" ");return false}}).data("autocomplete")._renderItem=function(e,f){var d=''+f.tag+' '+f.mode+''+f.freq+"";return $("
    • ").addClass("mode-"+f.mode).addClass("ptag-ac-line").data("item.autocomplete",f).append(d).appendTo(e)}},PeopleTags:function(){$(".user_profile_tags .editable").append($('