diff --git a/actions/atompubfavoritefeed.php b/actions/atompubfavoritefeed.php index c31fcbd72a..634bb22457 100644 --- a/actions/atompubfavoritefeed.php +++ b/actions/atompubfavoritefeed.php @@ -256,7 +256,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction if (empty($notice)) { // XXX: import from listed URL or something // TRANS: Client exception thrown when trying favorite a notice without content. - throw new ClientException(_('Unknown note.')); + throw new ClientException(_('Unknown notice.')); } $old = Fave::pkeyGet(array('user_id' => $this->auth_user->id, diff --git a/js/util.js b/js/util.js index fc03bc75fe..6bba34fae6 100644 --- a/js/util.js +++ b/js/util.js @@ -228,6 +228,9 @@ var SN = { // StatusNet * will be extracted and copied in, replacing the original form. * If there's no form, the first paragraph will be used. * + * This will automatically be applied on the 'submit' event for + * any form with the 'ajax' class. + * * @fixme can sometimes explode confusingly if returnd data is bogus * @fixme error handling is pretty vague * @fixme can't submit file uploads @@ -633,17 +636,6 @@ var SN = { // StatusNet } }, - /** - * Setup function -- DOES NOT apply immediately. - * - * Sets up event handlers for favor/disfavor forms to submit via XHR. - * Uses 'live' rather than 'bind', so applies to future as well as present items. - */ - NoticeFavor: function() { - $('.form_favor').live('click', function() { SN.U.FormXHR($(this)); return false; }); - $('.form_disfavor').live('click', function() { SN.U.FormXHR($(this)); return false; }); - }, - NoticeInlineReplyPlaceholder: function(notice) { var list = notice.find('ul.threaded-replies'); var placeholder = $('
  • ' + @@ -1271,7 +1263,7 @@ var SN = { // StatusNet var profileLink = $('#nav_profile a').attr('href'); if (profileLink) { - var authorUrl = $(notice).find('.entry-title .author a.url').attr('href'); + var authorUrl = $(notice).find('.vcard.author a.url').attr('href'); if (authorUrl == profileLink) { if (action == 'all' || action == 'showstream') { // Posts always show on your own friends and profile streams. @@ -1309,7 +1301,7 @@ var SN = { // StatusNet */ NoticeForm: function() { if ($('body.user_in').length > 0) { - $('.'+SN.C.S.FormNotice).each(function() { + $('.ajax-notice').each(function() { var form = $(this); SN.U.NoticeLocationAttach(form); SN.U.FormNoticeXHR(form); @@ -1331,7 +1323,6 @@ var SN = { // StatusNet if (masterForm.length > 0) { SN.C.I.NoticeFormMaster = document._importNode(masterForm[0], true); } - SN.U.NoticeFavor(); SN.U.NoticeRepeat(); SN.U.NoticeReply(); SN.U.NoticeInlineReplySetup(); @@ -1348,12 +1339,6 @@ var SN = { // StatusNet */ 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; }); - SN.U.NewDirectMessage(); } }, @@ -1380,6 +1365,16 @@ var SN = { // StatusNet }); }, + /** + * Set up any generic 'ajax' form so it submits via AJAX with auto-replacement. + */ + AjaxForms: function() { + $('form.ajax').live('submit', function() { + SN.U.FormXHR($(this)); + return false; + }); + }, + /** * Add logic to any file upload forms to handle file size limits, * on browsers that support basic FileAPI. @@ -1416,6 +1411,7 @@ var SN = { // StatusNet * don't start them loading until after DOM-ready time! */ $(document).ready(function(){ + SN.Init.AjaxForms(); SN.Init.UploadForms(); if ($('.'+SN.C.S.FormNotice).length > 0) { SN.Init.NoticeForm(); diff --git a/js/util.min.js b/js/util.min.js index af8b2200e9..88db1a1ac6 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("[name=status_textarea]");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("[name=status_textarea]").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){$.ajax({type:"POST",dataType:"xml",url:SN.U.RewriteAjaxAction(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(b,c){if(typeof($("form",b)[0])!="undefined"){form_new=document._importNode($("form",b)[0],true);a.replaceWith(form_new)}else{a.replaceWith(document._importNode($("p",b)[0],true))}}})},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("[name=status_textarea]").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(i,f){a();var n=$("#"+SN.C.S.Error,i);if(n.length>0){c("error",n.text())}else{if($("body")[0].id=="bookmarklet"){self.close()}var d=$("#"+SN.C.S.CommandResult,i);if(d.length>0){c("success",d.text())}else{var m=document._importNode($("li",i)[0],true);var k=$("#notices_primary .notices:first");var l=b.closest("li.notice-reply");if(l.length>0){var e=$(m).attr("id");if($("#"+e).length==0){var j=l.closest("li.notice");l.replaceWith(m);SN.U.NoticeInlineReplyPlaceholder(j)}else{l.remove()}}else{if(k.length>0&&SN.U.belongsOnTimeline(m)){if($("#"+m.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(m)}else{k.prepend(m)}$("#"+m.id).css({display:"none"}).fadeIn(2500);SN.U.NoticeWithAttachment($("#"+m.id));SN.U.NoticeReplyTo($("#"+m.id))}}else{c("success",$("title",i).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)}})},normalizeGeoData:function(a){SN.C.I.NoticeDataGeo.NLat=a.find("[name=lat]").val();SN.C.I.NoticeDataGeo.NLon=a.find("[name=lon]").val();SN.C.I.NoticeDataGeo.NLNS=a.find("[name=location_ns]").val();SN.C.I.NoticeDataGeo.NLID=a.find("[name=location_id]").val();SN.C.I.NoticeDataGeo.NDG=a.find("[name=notice_data-geo]").attr("checked");var b=$.cookie(SN.C.S.NoticeDataGeoCookie);if(b!==null&&b!="disabled"){b=JSON.parse(b);SN.C.I.NoticeDataGeo.NLat=a.find("[name=lat]").val(b.NLat).val();SN.C.I.NoticeDataGeo.NLon=a.find("[name=lon]").val(b.NLon).val();if(b.NLNS){SN.C.I.NoticeDataGeo.NLNS=a.find("[name=location_ns]").val(b.NLNS).val();SN.C.I.NoticeDataGeo.NLID=a.find("[name=location_id]").val(b.NLID).val()}else{a.find("[name=location_ns]").val("");a.find("[name=location_id]").val("")}}if(b=="disabled"){SN.C.I.NoticeDataGeo.NDG=a.find("[name=notice_data-geo]").attr("checked",false).attr("checked")}else{SN.C.I.NoticeDataGeo.NDG=a.find("[name=notice_data-geo]").attr("checked",true).attr("checked")}},GetResponseXML:function(b){try{return b.responseXML}catch(a){return(new DOMParser()).parseFromString(b.responseText,"text/xml")}},NoticeReply:function(){if($("#content .notice_reply").length>0){$("#content .notice").each(function(){SN.U.NoticeReplyTo($(this))})}},NoticeReplyTo:function(a){a.find(".notice_reply").live("click",function(c){c.preventDefault();var b=($(".author .nickname",a).length>0)?$($(".author .nickname",a)[0]):$(".author .nickname.uid");SN.U.NoticeInlineReplyTrigger(a,"@"+b.text());return false})},NoticeInlineReplyTrigger:function(h,i){var b=$($(".notice_id",h)[0]).text();var e=h;var f=h.closest(".notices");if(f.hasClass("threaded-replies")){e=f.closest(".notice")}else{f=$("ul.threaded-replies",h);if(f.length==0){f=$('');h.append(f)}}var j=$(".notice-reply-form",f);var d=function(){j.find("input[name=inreplyto]").val(b);var m=j.find("textarea");if(m.length==0){throw"No textarea"}var l="";if(i){l=i+" "}m.val(l+m.val().replace(RegExp(l,"i"),""));m.data("initialText",$.trim(i+""));m.focus();if(m[0].setSelectionRange){var k=m.val().length;m[0].setSelectionRange(k,k)}};if(j.length>0){d()}else{$("li.notice-reply-placeholder").remove();var g=$("li.notice-reply",f);if(g.length==0){g=$('
  • ');var c=function(k){var l=document._importNode(k,true);g.append(l);f.append(g);var m=j=$(l);SN.U.NoticeLocationAttach(m);SN.U.FormNoticeXHR(m);SN.U.FormNoticeEnhancements(m);SN.U.NoticeDataAttach(m);d()};if(SN.C.I.NoticeFormMaster){c(SN.C.I.NoticeFormMaster)}else{var a=$("#form_notice").attr("action");$.get(a,{ajax:1},function(k,m,l){c($("form",k)[0])})}}}},NoticeFavor:function(){$(".form_favor").live("click",function(){SN.U.FormXHR($(this));return false});$(".form_disfavor").live("click",function(){SN.U.FormXHR($(this));return false})},NoticeInlineReplyPlaceholder:function(b){var a=b.find("ul.threaded-replies");var c=$('
  • ');c.click(function(){SN.U.NoticeInlineReplyTrigger(b)});c.find("input").val(SN.msg("reply_placeholder"));a.append(c)},NoticeInlineReplySetup:function(){$(".threaded-replies").each(function(){var b=$(this);var a=b.closest(".notice");SN.U.NoticeInlineReplyPlaceholder(a)})},NoticeRepeat:function(){$(".form_repeat").live("click",function(a){a.preventDefault();SN.U.NoticeRepeatConfirmation($(this));return false})},NoticeRepeatConfirmation:function(a){var c=a.find(".submit");var b=c.clone();b.addClass("submit_dialogbox").removeClass("submit");a.append(b);b.bind("click",function(){SN.U.FormXHR(a);return false});c.hide();a.addClass("dialogbox").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(j){var i=$("").attr("title",e).attr("alt",e).attr("src",j).attr("style","height: 120px");d.find(".attach-status").append(i)})}else{var b=$("
    ").text(e);d.find(".attach-status").append(b)}},NoticeLocationAttach:function(a){var e=a.find("[name=lat]");var k=a.find("[name=lon]");var g=a.find("[name=location_ns]").val();var l=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 j=a.find("label.notice_data-geo");function f(n){j.attr("title",jQuery.trim(j.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(n){a.find(".geo_status_wrapper").removeClass("success").addClass("error");a.find(".geo_status_wrapper .geo_status").text(n)}else{a.find(".geo_status_wrapper").remove()}}function m(n,o){SN.U.NoticeGeoStatus(a,"Looking up place name...");$.getJSON(n,o,function(p){var q,r;if(typeof(p.location_ns)!="undefined"){a.find("[name=location_ns]").val(p.location_ns);q=p.location_ns}if(typeof(p.location_id)!="undefined"){a.find("[name=location_id]").val(p.location_id);r=p.location_id}if(typeof(p.name)=="undefined"){NLN_text=o.lat+";"+o.lon}else{NLN_text=p.name}SN.U.NoticeGeoStatus(a,NLN_text,o.lat,o.lon,p.url);j.attr("title",NoticeDataGeo_text.ShareDisable+" ("+NLN_text+")");a.find("[name=lat]").val(o.lat);a.find("[name=lon]").val(o.lon);a.find("[name=location_ns]").val(q);a.find("[name=location_id]").val(r);a.find("[name=notice_data-geo]").attr("checked",true);var s={NLat:o.lat,NLon:o.lon,NLNS:q,NLID:r,NLN:NLN_text,NLNU:p.url,NDG:true};$.cookie(SN.C.S.NoticeDataGeoCookie,JSON.stringify(s),{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 i=h.attr("title");h.removeAttr("title");j.attr("title",j.text());c.change(function(){if(c.attr("checked")===true||$.cookie(SN.C.S.NoticeDataGeoCookie)===null){j.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(p){a.find("[name=lat]").val(p.coords.latitude);a.find("[name=lon]").val(p.coords.longitude);var q={lat:p.coords.latitude,lon:p.coords.longitude,token:$("#token").val()};m(i,q)},function(p){switch(p.code){case p.PERMISSION_DENIED:f("Location permission denied.");break;case p.TIMEOUT:f("Location lookup timeout.");break}},{timeout:10000})}else{if(e.length>0&&k.length>0){var n={lat:e,lon:k,token:$("#token").val()};m(i,n)}else{f();c.remove();j.remove()}}}else{var o=JSON.parse($.cookie(SN.C.S.NoticeDataGeoCookie));a.find("[name=lat]").val(o.NLat);a.find("[name=lon]").val(o.NLon);a.find("[name=location_ns]").val(o.NLNS);a.find("[name=location_id]").val(o.NLID);a.find("[name=notice_data-geo]").attr("checked",o.NDG);SN.U.NoticeGeoStatus(a,o.NLN,o.NLat,o.NLon,o.NLNU);j.attr("title",NoticeDataGeo_text.ShareDisable+" ("+o.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()});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(".entry-title .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");$("#input_form_nav_"+a).addClass("current");$(".input_form.current").removeClass("current");$("#input_form_"+a).addClass("current")}},Init:{NoticeForm:function(){if($("body.user_in").length>0){$("."+SN.C.S.FormNotice).each(function(){var a=$(this);SN.U.NoticeLocationAttach(a);SN.U.FormNoticeXHR(a);SN.U.FormNoticeEnhancements(a);SN.U.NoticeDataAttach(a)})}},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.NoticeFavor();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});SN.U.NewDirectMessage()}},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})},UploadForms:function(){$("input[type=file]").change(function(d){if(typeof this.files=="object"&&this.files.length>0){var c=0;for(var b=0;b0&&c>a){var e="File too large: maximum upload size is %d bytes.";alert(e.replace("%d",a));$(this).val("");d.preventDefault();return false}}})}}};$(document).ready(function(){SN.Init.UploadForms();if($("."+SN.C.S.FormNotice).length>0){SN.Init.NoticeForm()}if($("#content .notices").length>0){SN.Init.Notices()}if($("#content .entity_actions").length>0){SN.Init.EntityActions()}if($("#form_login").length>0){SN.Init.Login()}});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(e,a){switch(e.nodeType){case document.ELEMENT_NODE:var d=document.createElement(e.nodeName);if(e.attributes&&e.attributes.length>0){for(var c=0,b=e.attributes.length;c0){for(var c=0,b=e.childNodes.length;c0){var j=c.pop();j()}}};window._google_loader_apiLoaded=function(){f()};var d=function(){return(window.google&&google.loader)};var g=function(j){if(d()){return true}h(j);e();return false};e();return{shim:true,type:"ClientLocation",lastPosition:null,getCurrentPosition:function(k,n,o){var m=this;if(!g(function(){m.getCurrentPosition(k,n,o)})){return}if(google.loader.ClientLocation){var l=google.loader.ClientLocation;var j={coords:{latitude:l.latitude,longitude:l.longitude,altitude:null,accuracy:43000,altitudeAccuracy:null,heading:null,speed:null},address:{city:l.address.city,country:l.address.country,country_code:l.address.country_code,region:l.address.region},timestamp:new Date()};k(j);this.lastPosition=j}else{if(n==="function"){n({code:3,message:"Using the Google ClientLocation API and it is not able to calculate a location."})}}},watchPosition:function(j,l,m){this.getCurrentPosition(j,l,m);var k=this;var n=setInterval(function(){k.getCurrentPosition(j,l,m)},10000);return n},clearWatch:function(j){clearInterval(j)},getPermission:function(l,j,k){return true}}});navigator.geolocation=(window.google&&google.gears)?a():b()})()}; \ No newline at end of file +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("[name=status_textarea]");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("[name=status_textarea]").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){$.ajax({type:"POST",dataType:"xml",url:SN.U.RewriteAjaxAction(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(b,c){if(typeof($("form",b)[0])!="undefined"){form_new=document._importNode($("form",b)[0],true);a.replaceWith(form_new)}else{a.replaceWith(document._importNode($("p",b)[0],true))}}})},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("[name=status_textarea]").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(i,f){a();var n=$("#"+SN.C.S.Error,i);if(n.length>0){c("error",n.text())}else{if($("body")[0].id=="bookmarklet"){self.close()}var d=$("#"+SN.C.S.CommandResult,i);if(d.length>0){c("success",d.text())}else{var m=document._importNode($("li",i)[0],true);var k=$("#notices_primary .notices:first");var l=b.closest("li.notice-reply");if(l.length>0){var e=$(m).attr("id");if($("#"+e).length==0){var j=l.closest("li.notice");l.replaceWith(m);SN.U.NoticeInlineReplyPlaceholder(j)}else{l.remove()}}else{if(k.length>0&&SN.U.belongsOnTimeline(m)){if($("#"+m.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(m)}else{k.prepend(m)}$("#"+m.id).css({display:"none"}).fadeIn(2500);SN.U.NoticeWithAttachment($("#"+m.id));SN.U.NoticeReplyTo($("#"+m.id))}}else{c("success",$("title",i).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)}})},normalizeGeoData:function(a){SN.C.I.NoticeDataGeo.NLat=a.find("[name=lat]").val();SN.C.I.NoticeDataGeo.NLon=a.find("[name=lon]").val();SN.C.I.NoticeDataGeo.NLNS=a.find("[name=location_ns]").val();SN.C.I.NoticeDataGeo.NLID=a.find("[name=location_id]").val();SN.C.I.NoticeDataGeo.NDG=a.find("[name=notice_data-geo]").attr("checked");var b=$.cookie(SN.C.S.NoticeDataGeoCookie);if(b!==null&&b!="disabled"){b=JSON.parse(b);SN.C.I.NoticeDataGeo.NLat=a.find("[name=lat]").val(b.NLat).val();SN.C.I.NoticeDataGeo.NLon=a.find("[name=lon]").val(b.NLon).val();if(b.NLNS){SN.C.I.NoticeDataGeo.NLNS=a.find("[name=location_ns]").val(b.NLNS).val();SN.C.I.NoticeDataGeo.NLID=a.find("[name=location_id]").val(b.NLID).val()}else{a.find("[name=location_ns]").val("");a.find("[name=location_id]").val("")}}if(b=="disabled"){SN.C.I.NoticeDataGeo.NDG=a.find("[name=notice_data-geo]").attr("checked",false).attr("checked")}else{SN.C.I.NoticeDataGeo.NDG=a.find("[name=notice_data-geo]").attr("checked",true).attr("checked")}},GetResponseXML:function(b){try{return b.responseXML}catch(a){return(new DOMParser()).parseFromString(b.responseText,"text/xml")}},NoticeReply:function(){if($("#content .notice_reply").length>0){$("#content .notice").each(function(){SN.U.NoticeReplyTo($(this))})}},NoticeReplyTo:function(a){a.find(".notice_reply").live("click",function(c){c.preventDefault();var b=($(".author .nickname",a).length>0)?$($(".author .nickname",a)[0]):$(".author .nickname.uid");SN.U.NoticeInlineReplyTrigger(a,"@"+b.text());return false})},NoticeInlineReplyTrigger:function(h,i){var b=$($(".notice_id",h)[0]).text();var e=h;var f=h.closest(".notices");if(f.hasClass("threaded-replies")){e=f.closest(".notice")}else{f=$("ul.threaded-replies",h);if(f.length==0){f=$('
        ');h.append(f)}}var j=$(".notice-reply-form",f);var d=function(){j.find("input[name=inreplyto]").val(b);var m=j.find("textarea");if(m.length==0){throw"No textarea"}var l="";if(i){l=i+" "}m.val(l+m.val().replace(RegExp(l,"i"),""));m.data("initialText",$.trim(i+""));m.focus();if(m[0].setSelectionRange){var k=m.val().length;m[0].setSelectionRange(k,k)}};if(j.length>0){d()}else{$("li.notice-reply-placeholder").remove();var g=$("li.notice-reply",f);if(g.length==0){g=$('
      • ');var c=function(k){var l=document._importNode(k,true);g.append(l);f.append(g);var m=j=$(l);SN.U.NoticeLocationAttach(m);SN.U.FormNoticeXHR(m);SN.U.FormNoticeEnhancements(m);SN.U.NoticeDataAttach(m);d()};if(SN.C.I.NoticeFormMaster){c(SN.C.I.NoticeFormMaster)}else{var a=$("#form_notice").attr("action");$.get(a,{ajax:1},function(k,m,l){c($("form",k)[0])})}}}},NoticeInlineReplyPlaceholder:function(b){var a=b.find("ul.threaded-replies");var c=$('
      • ');c.click(function(){SN.U.NoticeInlineReplyTrigger(b)});c.find("input").val(SN.msg("reply_placeholder"));a.append(c)},NoticeInlineReplySetup:function(){$(".threaded-replies").each(function(){var b=$(this);var a=b.closest(".notice");SN.U.NoticeInlineReplyPlaceholder(a)})},NoticeRepeat:function(){$(".form_repeat").live("click",function(a){a.preventDefault();SN.U.NoticeRepeatConfirmation($(this));return false})},NoticeRepeatConfirmation:function(a){var c=a.find(".submit");var b=c.clone();b.addClass("submit_dialogbox").removeClass("submit");a.append(b);b.bind("click",function(){SN.U.FormXHR(a);return false});c.hide();a.addClass("dialogbox").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(j){var i=$("").attr("title",e).attr("alt",e).attr("src",j).attr("style","height: 120px");d.find(".attach-status").append(i)})}else{var b=$("
        ").text(e);d.find(".attach-status").append(b)}},NoticeLocationAttach:function(a){var e=a.find("[name=lat]");var k=a.find("[name=lon]");var g=a.find("[name=location_ns]").val();var l=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 j=a.find("label.notice_data-geo");function f(n){j.attr("title",jQuery.trim(j.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(n){a.find(".geo_status_wrapper").removeClass("success").addClass("error");a.find(".geo_status_wrapper .geo_status").text(n)}else{a.find(".geo_status_wrapper").remove()}}function m(n,o){SN.U.NoticeGeoStatus(a,"Looking up place name...");$.getJSON(n,o,function(p){var q,r;if(typeof(p.location_ns)!="undefined"){a.find("[name=location_ns]").val(p.location_ns);q=p.location_ns}if(typeof(p.location_id)!="undefined"){a.find("[name=location_id]").val(p.location_id);r=p.location_id}if(typeof(p.name)=="undefined"){NLN_text=o.lat+";"+o.lon}else{NLN_text=p.name}SN.U.NoticeGeoStatus(a,NLN_text,o.lat,o.lon,p.url);j.attr("title",NoticeDataGeo_text.ShareDisable+" ("+NLN_text+")");a.find("[name=lat]").val(o.lat);a.find("[name=lon]").val(o.lon);a.find("[name=location_ns]").val(q);a.find("[name=location_id]").val(r);a.find("[name=notice_data-geo]").attr("checked",true);var s={NLat:o.lat,NLon:o.lon,NLNS:q,NLID:r,NLN:NLN_text,NLNU:p.url,NDG:true};$.cookie(SN.C.S.NoticeDataGeoCookie,JSON.stringify(s),{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 i=h.attr("title");h.removeAttr("title");j.attr("title",j.text());c.change(function(){if(c.attr("checked")===true||$.cookie(SN.C.S.NoticeDataGeoCookie)===null){j.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(p){a.find("[name=lat]").val(p.coords.latitude);a.find("[name=lon]").val(p.coords.longitude);var q={lat:p.coords.latitude,lon:p.coords.longitude,token:$("#token").val()};m(i,q)},function(p){switch(p.code){case p.PERMISSION_DENIED:f("Location permission denied.");break;case p.TIMEOUT:f("Location lookup timeout.");break}},{timeout:10000})}else{if(e.length>0&&k.length>0){var n={lat:e,lon:k,token:$("#token").val()};m(i,n)}else{f();c.remove();j.remove()}}}else{var o=JSON.parse($.cookie(SN.C.S.NoticeDataGeoCookie));a.find("[name=lat]").val(o.NLat);a.find("[name=lon]").val(o.NLon);a.find("[name=location_ns]").val(o.NLNS);a.find("[name=location_id]").val(o.NLID);a.find("[name=notice_data-geo]").attr("checked",o.NDG);SN.U.NoticeGeoStatus(a,o.NLN,o.NLat,o.NLon,o.NLNU);j.attr("title",NoticeDataGeo_text.ShareDisable+" ("+o.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()});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");$("#input_form_nav_"+a).addClass("current");$(".input_form.current").removeClass("current");$("#input_form_"+a).addClass("current")}},Init:{NoticeForm:function(){if($("body.user_in").length>0){$(".ajax-notice").each(function(){var a=$(this);SN.U.NoticeLocationAttach(a);SN.U.FormNoticeXHR(a);SN.U.FormNoticeEnhancements(a);SN.U.NoticeDataAttach(a)})}},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){SN.U.NewDirectMessage()}},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})},AjaxForms:function(){$("form.ajax").live("submit",function(){SN.U.FormXHR($(this));return false})},UploadForms:function(){$("input[type=file]").change(function(d){if(typeof this.files=="object"&&this.files.length>0){var c=0;for(var b=0;b0&&c>a){var e="File too large: maximum upload size is %d bytes.";alert(e.replace("%d",a));$(this).val("");d.preventDefault();return false}}})}}};$(document).ready(function(){SN.Init.AjaxForms();SN.Init.UploadForms();if($("."+SN.C.S.FormNotice).length>0){SN.Init.NoticeForm()}if($("#content .notices").length>0){SN.Init.Notices()}if($("#content .entity_actions").length>0){SN.Init.EntityActions()}if($("#form_login").length>0){SN.Init.Login()}});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(e,a){switch(e.nodeType){case document.ELEMENT_NODE:var d=document.createElement(e.nodeName);if(e.attributes&&e.attributes.length>0){for(var c=0,b=e.attributes.length;c0){for(var c=0,b=e.childNodes.length;c0){var j=c.pop();j()}}};window._google_loader_apiLoaded=function(){f()};var d=function(){return(window.google&&google.loader)};var g=function(j){if(d()){return true}h(j);e();return false};e();return{shim:true,type:"ClientLocation",lastPosition:null,getCurrentPosition:function(k,n,o){var m=this;if(!g(function(){m.getCurrentPosition(k,n,o)})){return}if(google.loader.ClientLocation){var l=google.loader.ClientLocation;var j={coords:{latitude:l.latitude,longitude:l.longitude,altitude:null,accuracy:43000,altitudeAccuracy:null,heading:null,speed:null},address:{city:l.address.city,country:l.address.country,country_code:l.address.country_code,region:l.address.region},timestamp:new Date()};k(j);this.lastPosition=j}else{if(n==="function"){n({code:3,message:"Using the Google ClientLocation API and it is not able to calculate a location."})}}},watchPosition:function(j,l,m){this.getCurrentPosition(j,l,m);var k=this;var n=setInterval(function(){k.getCurrentPosition(j,l,m)},10000);return n},clearWatch:function(j){clearInterval(j)},getPermission:function(l,j,k){return true}}});navigator.geolocation=(window.google&&google.gears)?a():b()})()}; \ No newline at end of file diff --git a/lib/disfavorform.php b/lib/disfavorform.php index 3a1c7d17fb..9d0e39784e 100644 --- a/lib/disfavorform.php +++ b/lib/disfavorform.php @@ -147,6 +147,6 @@ class DisfavorForm extends Form */ function formClass() { - return 'form_disfavor'; + return 'form_disfavor ajax'; } } diff --git a/lib/favorform.php b/lib/favorform.php index 956cc896a2..c07ba6df59 100644 --- a/lib/favorform.php +++ b/lib/favorform.php @@ -146,6 +146,6 @@ class FavorForm extends Form */ function formClass() { - return 'form_favor'; + return 'form_favor ajax'; } } diff --git a/lib/form.php b/lib/form.php index f6501dc6da..74737f6df5 100644 --- a/lib/form.php +++ b/lib/form.php @@ -172,7 +172,13 @@ class Form extends Widget } /** - * Class of the form. + * Class of the form. May include space-separated list of multiple classes. + * + * If 'ajax' is included, the form will automatically be submitted with + * an 'ajax=1' parameter added, and the resulting form or error message + * will replace the form after submission. + * + * It's up to you to make sure that the target action supports this! * * @return string the form's class */ diff --git a/lib/joinform.php b/lib/joinform.php index aa8bc20e24..0918133a55 100644 --- a/lib/joinform.php +++ b/lib/joinform.php @@ -88,7 +88,7 @@ class JoinForm extends Form function formClass() { - return 'form_group_join'; + return 'form_group_join ajax'; } /** diff --git a/lib/leaveform.php b/lib/leaveform.php index 5469b5704c..34671f5f8d 100644 --- a/lib/leaveform.php +++ b/lib/leaveform.php @@ -88,7 +88,7 @@ class LeaveForm extends Form function formClass() { - return 'form_group_leave'; + return 'form_group_leave ajax'; } /** diff --git a/lib/noticeform.php b/lib/noticeform.php index ace8e5582b..e889036f55 100644 --- a/lib/noticeform.php +++ b/lib/noticeform.php @@ -132,7 +132,7 @@ class NoticeForm extends Form function formClass() { - return 'form_notice'; + return 'form_notice ajax-notice'; } /** @@ -187,12 +187,14 @@ class NoticeForm extends Form if (common_config('attachments', 'uploads')) { $this->out->hidden('MAX_FILE_SIZE', common_config('attachments', 'file_quota')); // TRANS: Input label in notice form for adding an attachment. - $this->out->element('label', array('for' => 'notice_data-attach'),_('Attach')); - $this->out->element('input', array('id' => 'notice_data-attach', + $this->out->elementStart('label', array('class' => 'notice_data-attach')); + $this->out->text(_('Attach')); + $this->out->element('input', array('class' => 'notice_data-attach', 'type' => 'file', 'name' => 'attach', // TRANS: Title for input field to attach a file to a notice. 'title' => _('Attach a file.'))); + $this->out->elementEnd('label'); } if ($this->action) { $this->out->hidden('notice_return-to', $this->action, 'returnto'); @@ -210,6 +212,7 @@ class NoticeForm extends Form // @fixme checkbox method allows no way to change the id without changing the name //$this->out->checkbox('notice_data-geo', _('Share my location'), true); + $this->out->elementStart('label', 'notice_data-geo'); $this->out->element('input', array( 'name' => 'notice_data-geo', 'type' => 'checkbox', @@ -218,11 +221,10 @@ class NoticeForm extends Form 'checked' => true, // ? )); $this->out->text(' '); - $this->out->element('label', array('class' => 'notice_data-geo', - 'for' => $this->id() . '-notice_data-geo'), - // TRANS: Field label to add location to a notice. - _('Share my location')); - + // TRANS: Field label to add location to a notice. + $this->out->text(_('Share my location')); + $this->out->elementEnd('label'); + $this->out->elementEnd('div'); // TRANS: Text to not share location for a notice in notice form. $share_disable_text = _('Do not share my location'); diff --git a/lib/nudgeform.php b/lib/nudgeform.php index 3f13b58462..18a008122d 100644 --- a/lib/nudgeform.php +++ b/lib/nudgeform.php @@ -89,7 +89,7 @@ class NudgeForm extends Form function formClass() { - return 'form_user_nudge'; + return 'form_user_nudge ajax'; } diff --git a/lib/subscribeform.php b/lib/subscribeform.php index ae2a6db61c..1cc5b4e48e 100644 --- a/lib/subscribeform.php +++ b/lib/subscribeform.php @@ -89,7 +89,7 @@ class SubscribeForm extends Form function formClass() { - return 'form_user_subscribe'; + return 'form_user_subscribe ajax'; } diff --git a/lib/unsubscribeform.php b/lib/unsubscribeform.php index cb6a87515f..a8e6915d6c 100644 --- a/lib/unsubscribeform.php +++ b/lib/unsubscribeform.php @@ -89,7 +89,7 @@ class UnsubscribeForm extends Form function formClass() { - return 'form_user_unsubscribe'; + return 'form_user_unsubscribe ajax'; } /** diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php index 6c3f8cdc28..bc8985e907 100644 --- a/plugins/Bookmark/BookmarkPlugin.php +++ b/plugins/Bookmark/BookmarkPlugin.php @@ -616,12 +616,15 @@ class BookmarkPlugin extends MicroAppPlugin 'height' => AVATAR_MINI_SIZE, 'alt' => $profile->getBestName())); - $out->raw(' '); + $out->raw(' '); // avoid   for AJAX XML compatibility + $out->elementStart('span', 'vcard author'); // hack for belongsOnTimeline; JS needs to be able to find the author $out->element('a', - array('href' => $profile->profileurl, + array('class' => 'url', + 'href' => $profile->profileurl, 'title' => $profile->getBestName()), $profile->nickname); + $out->elementEnd('span'); } function entryForm($out) diff --git a/plugins/Bookmark/bookmarkform.php b/plugins/Bookmark/bookmarkform.php index b99568e154..d8cf1f7f5b 100644 --- a/plugins/Bookmark/bookmarkform.php +++ b/plugins/Bookmark/bookmarkform.php @@ -94,7 +94,7 @@ class BookmarkForm extends Form function formClass() { - return 'form_settings'; + return 'form_settings ajax-notice'; } /** diff --git a/plugins/Bookmark/newbookmark.php b/plugins/Bookmark/newbookmark.php index a0cf3fffb2..ebfdb6cb95 100644 --- a/plugins/Bookmark/newbookmark.php +++ b/plugins/Bookmark/newbookmark.php @@ -125,6 +125,9 @@ class NewbookmarkAction extends Action function newBookmark() { + if ($this->boolean('ajax')) { + StatusNet::setApi(true); + } try { if (empty($this->title)) { throw new ClientException(_('Bookmark must have a title.')); @@ -147,7 +150,37 @@ class NewbookmarkAction extends Action return; } - common_redirect($saved->bestUrl(), 303); + if ($this->boolean('ajax')) { + header('Content-Type: text/xml;charset=utf-8'); + $this->xw->startDocument('1.0', 'UTF-8'); + $this->elementStart('html'); + $this->elementStart('head'); + // TRANS: Page title after sending a notice. + $this->element('title', null, _('Notice posted')); + $this->elementEnd('head'); + $this->elementStart('body'); + $this->showNotice($saved); + $this->elementEnd('body'); + $this->elementEnd('html'); + } else { + common_redirect($saved->bestUrl(), 303); + } + } + + /** + * Output a notice + * + * Used to generate the notice code for Ajax results. + * + * @param Notice $notice Notice that was saved + * + * @return void + */ + function showNotice($notice) + { + class_exists('NoticeList'); // @fixme hack for autoloader + $nli = new NoticeListItem($notice, $this); + $nli->show(); } /** diff --git a/plugins/MobileProfile/mp-screen.css b/plugins/MobileProfile/mp-screen.css index fcd88277e5..d82486182a 100644 --- a/plugins/MobileProfile/mp-screen.css +++ b/plugins/MobileProfile/mp-screen.css @@ -108,7 +108,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator #form_notice label[for="notice_data-attach"] { display:none; } -#form_notice #notice_data-attach { +#form_notice input.notice_data-attach { position:static; clear:both; width:65%; diff --git a/plugins/Poll/Poll.php b/plugins/Poll/Poll.php index 60ec4399fd..65aad4830e 100644 --- a/plugins/Poll/Poll.php +++ b/plugins/Poll/Poll.php @@ -166,7 +166,9 @@ class Poll extends Managed_DataObject $raw = array(); while ($pr->fetch()) { - $raw[$pr->selection] = $pr->votes; + // Votes list 1-based + // Array stores 0-based + $raw[$pr->selection - 1] = $pr->votes; } $counts = array(); @@ -216,6 +218,7 @@ class Poll extends Managed_DataObject array('id' => $p->id)); } + common_log(LOG_DEBUG, "Saving poll: $p->id $p->uri"); $p->insert(); $content = sprintf(_m('Poll: %s %s'), diff --git a/plugins/Poll/newpoll.php b/plugins/Poll/newpoll.php index 66386affa9..fa6eb798d7 100644 --- a/plugins/Poll/newpoll.php +++ b/plugins/Poll/newpoll.php @@ -127,6 +127,9 @@ class NewPollAction extends Action function newPoll() { + if ($this->boolean('ajax')) { + StatusNet::setApi(true); + } try { if (empty($this->question)) { throw new ClientException(_('Poll must have a question.')); @@ -147,7 +150,37 @@ class NewPollAction extends Action return; } - common_redirect($saved->bestUrl(), 303); + if ($this->boolean('ajax')) { + header('Content-Type: text/xml;charset=utf-8'); + $this->xw->startDocument('1.0', 'UTF-8'); + $this->elementStart('html'); + $this->elementStart('head'); + // TRANS: Page title after sending a notice. + $this->element('title', null, _('Notice posted')); + $this->elementEnd('head'); + $this->elementStart('body'); + $this->showNotice($saved); + $this->elementEnd('body'); + $this->elementEnd('html'); + } else { + common_redirect($saved->bestUrl(), 303); + } + } + + /** + * Output a notice + * + * Used to generate the notice code for Ajax results. + * + * @param Notice $notice Notice that was saved + * + * @return void + */ + function showNotice($notice) + { + class_exists('NoticeList'); // @fixme hack for autoloader + $nli = new NoticeListItem($notice, $this); + $nli->show(); } /** @@ -163,7 +196,7 @@ class NewPollAction extends Action } $form = new NewPollForm($this, - $this->questions, + $this->question, $this->options); $form->show(); diff --git a/plugins/Poll/newpollform.php b/plugins/Poll/newpollform.php index fd5f28748b..73e516c891 100644 --- a/plugins/Poll/newpollform.php +++ b/plugins/Poll/newpollform.php @@ -83,7 +83,7 @@ class NewpollForm extends Form function formClass() { - return 'form_settings'; + return 'form_settings ajax-notice'; } /** diff --git a/plugins/Poll/poll.css b/plugins/Poll/poll.css new file mode 100644 index 0000000000..5ba9c1588f --- /dev/null +++ b/plugins/Poll/poll.css @@ -0,0 +1,10 @@ +.poll-block { + float: left; + height: 16px; + background: #8aa; + margin-right: 8px; +} + +.poll-winner { + background: #4af; +} diff --git a/plugins/Poll/pollresponseform.php b/plugins/Poll/pollresponseform.php index 87340f926f..015dbb1b1f 100644 --- a/plugins/Poll/pollresponseform.php +++ b/plugins/Poll/pollresponseform.php @@ -83,7 +83,7 @@ class PollResponseForm extends Form function formClass() { - return 'form_settings'; + return 'form_settings ajax'; } /** diff --git a/plugins/Poll/pollresultform.php b/plugins/Poll/pollresultform.php index eace105e0d..f4da10cb53 100644 --- a/plugins/Poll/pollresultform.php +++ b/plugins/Poll/pollresultform.php @@ -83,7 +83,7 @@ class PollResultForm extends Form function formClass() { - return 'form_settings'; + return 'form_settings ajax'; } /** @@ -109,14 +109,33 @@ class PollResultForm extends Form $out = $this->out; $counts = $poll->countResponses(); - $out->element('p', 'poll-question', $poll->question); - $out->elementStart('ul', 'poll-options'); - foreach ($poll->getOptions() as $i => $opt) { - $out->elementStart('li'); - $out->text($counts[$i] . ' ' . $opt); - $out->elementEnd('li'); + $width = 200; + $max = max($counts); + if ($max == 0) { + $max = 1; // quick hack :D } - $out->elementEnd('ul'); + + $out->element('p', 'poll-question', $poll->question); + $out->elementStart('table', 'poll-results'); + foreach ($poll->getOptions() as $i => $opt) { + $w = intval($counts[$i] * $width / $max) + 1; + + $out->elementStart('tr'); + + $out->elementStart('td'); + $out->text($opt); + $out->elementEnd('td'); + + $out->elementStart('td'); + $out->element('span', array('class' => 'poll-block', + 'style' => "width: {$w}px"), + "\xc2\xa0"); // nbsp + $out->text($counts[$i]); + $out->elementEnd('td'); + + $out->elementEnd('tr'); + } + $out->elementEnd('table'); } /** diff --git a/plugins/Poll/respondpoll.php b/plugins/Poll/respondpoll.php index 8ae31443fc..07a5235406 100644 --- a/plugins/Poll/respondpoll.php +++ b/plugins/Poll/respondpoll.php @@ -145,7 +145,22 @@ class RespondPollAction extends Action return; } - common_redirect($this->poll->bestUrl(), 303); + if ($this->arg('ajax')) { + header('Content-Type: text/xml;charset=utf-8'); + $this->xw->startDocument('1.0', 'UTF-8'); + $this->elementStart('html'); + $this->elementStart('head'); + // TRANS: Page title after sending a poll response. + $this->element('title', null, _m('Poll results')); + $this->elementEnd('head'); + $this->elementStart('body'); + $form = new PollResultForm($this->poll, $this); + $form->show(); + $this->elementEnd('body'); + $this->elementEnd('html'); + } else { + common_redirect($this->poll->bestUrl(), 303); + } } /** diff --git a/plugins/Poll/showpoll.php b/plugins/Poll/showpoll.php index f5002701a2..21ac7647c0 100644 --- a/plugins/Poll/showpoll.php +++ b/plugins/Poll/showpoll.php @@ -108,4 +108,21 @@ class ShowPollAction extends ShownoticeAction $this->poll->question); } + /** + * @fixme combine the notice time with poll update time + */ + function lastModified() + { + return Action::lastModified(); + } + + + /** + * @fixme combine the notice time with poll update time + */ + function etag() + { + return Action::etag(); + } + } diff --git a/plugins/Realtime/realtimeupdate.css b/plugins/Realtime/realtimeupdate.css index 7fd7fd5ed3..3295fe4a31 100644 --- a/plugins/Realtime/realtimeupdate.css +++ b/plugins/Realtime/realtimeupdate.css @@ -17,13 +17,13 @@ max-width:451px; display:none; } -.realtime-popup #form_notice label[for=notice_data-attach], -.realtime-popup #form_notice #notice_data-attach, +.realtime-popup #form_notice label.notice_data-attach, +.realtime-popup #form_notice input.notice_data-attach, .realtime-popup #form_notice label.notice_data-geo { top:0; } -.realtime-popup #form_notice #notice_data-attach { +.realtime-popup #form_notice input.notice_data-attach { left:auto; right:0; } diff --git a/plugins/UserFlag/UserFlagPlugin.php b/plugins/UserFlag/UserFlagPlugin.php index 52b1fc299e..42a8948dff 100644 --- a/plugins/UserFlag/UserFlagPlugin.php +++ b/plugins/UserFlag/UserFlagPlugin.php @@ -180,21 +180,6 @@ class UserFlagPlugin extends Plugin } } - /** - * Initialize any flagging buttons on the page - * - * @param Action $action action being shown - * - * @return boolean hook result - */ - function onEndShowScripts($action) - { - $action->inlineScript('if ($(".form_entity_flag").length > 0) { '. - '$(".form_entity_flag").bind("click", function() {'. - 'SN.U.FormXHR($(this)); return false; }); }'); - return true; - } - /** * Check whether a user has one of our defined rights * diff --git a/plugins/UserFlag/flagprofileform.php b/plugins/UserFlag/flagprofileform.php index 045c9de852..acb47629e2 100644 --- a/plugins/UserFlag/flagprofileform.php +++ b/plugins/UserFlag/flagprofileform.php @@ -54,7 +54,7 @@ class FlagProfileForm extends ProfileActionForm */ function formClass() { - return 'form_entity_flag'; + return 'form_entity_flag ajax'; } /** diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 16c2b6dce6..85ec1286b9 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -597,19 +597,19 @@ float:left; font-size:1.3em; margin-bottom:7px; } -.form_notice label[for=notice_data-attach], -.form_notice #notice_data-attach { +.form_notice label.notice_data-attach, +.form_notice input.notice_data-attach { position:absolute; top:25px; right:10.5%; cursor:pointer; } -.form_notice label[for=notice_data-attach] { +.form_notice label.notice_data-attach { text-indent:-9999px; width:16px; height:16px; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { padding:0; height:16px; } diff --git a/theme/biz/css/base.css b/theme/biz/css/base.css index 53aca59009..3a20871de9 100644 --- a/theme/biz/css/base.css +++ b/theme/biz/css/base.css @@ -462,11 +462,11 @@ float:left; font-size:1.3em; margin-bottom:7px; } -#form_notice label[for=notice_data-attach] { +#form_notice label.notice_data-attach { text-indent:-9999px; } -#form_notice label[for=notice_data-attach], -#form_notice #notice_data-attach { +#form_notice label.notice_data-attach, +#form_notice input.notice_data-attach { position:absolute; top:25px; right:49px; @@ -474,7 +474,7 @@ width:16px; height:16px; cursor:pointer; } -#form_notice #notice_data-attach { +#form_notice input.notice_data-attach { text-indent:-279px; } #form_notice #notice_submit label { diff --git a/theme/biz/css/display.css b/theme/biz/css/display.css index 0bb53f74a8..2e96d99d1a 100644 --- a/theme/biz/css/display.css +++ b/theme/biz/css/display.css @@ -172,14 +172,14 @@ color:#333333; #form_notice.warning .count { color:#000000; } -.form_notice label[for=notice_data-attach] { +.form_notice label.notice_data-attach { background-position:0 -328px; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { opacity:0; } -.form_notice label[for=notice_data-attach], +.form_notice label.notice_data-attach, #export_data li a.rss, #export_data li a.atom, #export_data li a.foaf, diff --git a/theme/clean/css/display.css b/theme/clean/css/display.css index 96a5c02a56..ea2d62020e 100644 --- a/theme/clean/css/display.css +++ b/theme/clean/css/display.css @@ -114,8 +114,8 @@ address { height: 54px; } -.form_notice label[for=notice_data-attach], -.form_notice #notice_data-attach { +.form_notice label.notice_data-attach, +.form_notice input.notice_data-attach { top: 27px; } diff --git a/theme/clean/css/ie.css b/theme/clean/css/ie.css index 994c1297d3..272a5bbcae 100644 --- a/theme/clean/css/ie.css +++ b/theme/clean/css/ie.css @@ -61,7 +61,7 @@ line-height:auto; color:#FFFFFF; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { filter: alpha(opacity=0); } diff --git a/theme/clean/css/mp-screen.css b/theme/clean/css/mp-screen.css index 35d8326a41..8d9489b0b1 100644 --- a/theme/clean/css/mp-screen.css +++ b/theme/clean/css/mp-screen.css @@ -94,7 +94,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator .form_notice label[for="notice_data-attach"] { display:none; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { position:static; clear:both; width:65%; diff --git a/theme/cleaner/css/display.css b/theme/cleaner/css/display.css index 214c821e59..98d4560d2a 100644 --- a/theme/cleaner/css/display.css +++ b/theme/cleaner/css/display.css @@ -161,8 +161,8 @@ address { border-radius: 6px; } -.form_notice label[for=notice_data-attach], -.form_notice #notice_data-attach { +.form_notice label.notice_data-attach, +.form_notice input.notice_data-attach { top: 27px; right: 86px; } @@ -594,7 +594,7 @@ padding-right:0; right: 6px !important; } -.realtime-popup .form_notice label[for=notice_data-attach], .realtime-popup .form_notice #notice_data-attach { +.realtime-popup .form_notice label.notice_data-attach, .realtime-popup .form_notice input.notice_data-attach { right: 74px; top: 3px !important; } diff --git a/theme/cleaner/css/ie.css b/theme/cleaner/css/ie.css index dbc72b1c22..7bd48790bf 100644 --- a/theme/cleaner/css/ie.css +++ b/theme/cleaner/css/ie.css @@ -65,7 +65,7 @@ line-height:auto; color:#FFFFFF; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { filter: alpha(opacity=0); } diff --git a/theme/cleaner/css/mp-screen.css b/theme/cleaner/css/mp-screen.css index 8b55e596fe..cb3c6d06b6 100644 --- a/theme/cleaner/css/mp-screen.css +++ b/theme/cleaner/css/mp-screen.css @@ -99,7 +99,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator .form_notice label[for="notice_data-attach"] { display:none; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { position:static; clear:both; width:65%; diff --git a/theme/cloudy/css/display.css b/theme/cloudy/css/display.css index a5eabac4ad..5bc8ab0c1e 100644 --- a/theme/cloudy/css/display.css +++ b/theme/cloudy/css/display.css @@ -493,19 +493,19 @@ float:left; font-size:1.3em; margin-bottom:7px; } -.form_notice label[for=notice_data-attach], -.form_notice #notice_data-attach { +.form_notice label.notice_data-attach, +.form_notice input.notice_data-attach { position:absolute; top:25px; right:10.5%; cursor:pointer; } -.form_notice label[for=notice_data-attach] { +.form_notice label.notice_data-attach { text-indent:-9999px; width:16px; height:16px; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { padding:0; height:16px; } @@ -1602,7 +1602,7 @@ background:none; } -.form_notice label[for=notice_data-attach], +.form_notice label.notice_data-attach, #export_data li a.rss, #export_data li a.atom, #export_data li a.foaf, @@ -1787,10 +1787,10 @@ color:#000000; #form_notice.warning .count { color:#000000; } -#form_notice label[for=notice_data-attach] { +#form_notice label.notice_data-attach { background:transparent url(../../base/images/icons/twotone/green/clip-01.gif) no-repeat 0 45%; } -#form_notice #notice_data-attach { +#form_notice input.notice_data-attach { opacity:0; } diff --git a/theme/cloudy/css/ie.css b/theme/cloudy/css/ie.css index edddc16d88..013bdf9d16 100644 --- a/theme/cloudy/css/ie.css +++ b/theme/cloudy/css/ie.css @@ -34,7 +34,7 @@ height:16px; width:16px; display:block; } -#form_notice #notice_data-attach { +#form_notice input.notice_data-attach { filter: alpha(opacity = 0); left:33.5%; } diff --git a/theme/default/css/display.css b/theme/default/css/display.css index fbd3afb12c..3e3bfdfa86 100644 --- a/theme/default/css/display.css +++ b/theme/default/css/display.css @@ -152,14 +152,14 @@ color:#333333; .entity_actions .dialogbox input { color:#000000; } -.form_notice label[for=notice_data-attach] { +.form_notice label.notice_data-attach { background-position:0 -328px; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { opacity:0; } -.form_notice label[for=notice_data-attach], +.form_notice label.notice_data-attach, #export_data li a.rss, #export_data li a.atom, #export_data li a.foaf, diff --git a/theme/default/css/ie.css b/theme/default/css/ie.css index 2bbeb7ffa4..3100821688 100644 --- a/theme/default/css/ie.css +++ b/theme/default/css/ie.css @@ -16,7 +16,7 @@ background-color:#C8D1D5; .form_notice .count + label { background:transparent url(../../base/images/icons/icons-01.gif) no-repeat 0 -328px; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { filter: alpha(opacity=0); } .notice-options form.form_favor input.submit { diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css index fba72a09d6..fe7ffa9f7d 100644 --- a/theme/identica/css/display.css +++ b/theme/identica/css/display.css @@ -153,14 +153,14 @@ color:#333333; .entity_actions .dialogbox input { color:#000000; } -.form_notice label[for=notice_data-attach] { +.form_notice label.notice_data-attach { background-position:0 -328px; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { opacity:0; } -.form_notice label[for=notice_data-attach], +.form_notice label.notice_data-attach, #export_data li a.rss, #export_data li a.atom, #export_data li a.foaf, diff --git a/theme/identica/css/ie.css b/theme/identica/css/ie.css index 888c486f40..858cf3e181 100644 --- a/theme/identica/css/ie.css +++ b/theme/identica/css/ie.css @@ -16,7 +16,7 @@ background-color:#D9DADB; .form_notice .count + label { background:transparent url(../../base/images/icons/icons-01.gif) no-repeat 0 -328px; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { filter: alpha(opacity=0); } .notice-options form.form_favor input.submit { diff --git a/theme/mnml/css/display.css b/theme/mnml/css/display.css index 57ad426c55..e7bce84439 100644 --- a/theme/mnml/css/display.css +++ b/theme/mnml/css/display.css @@ -234,7 +234,7 @@ p.instructions { /*-- FORMS --*/ -.form_notice label[for=notice_data-attach], +.form_notice label.notice_data-attach, #export_data li a.rss, #export_data li a.atom, #export_data li a.foaf, @@ -292,7 +292,7 @@ button.minimize, .form_notice label.notice_data-geo.checked { background-position:0 -1846px; } -.form_notice label[for=notice_data-attach] { +.form_notice label.notice_data-attach { background-position:0 -328px; } button.close { @@ -937,19 +937,19 @@ z-index:2; .form_notice label { float:left; } -.form_notice label[for=notice_data-attach], -.form_notice #notice_data-attach { +.form_notice label.notice_data-attach, +.form_notice input.notice_data-attach { position:absolute; top:2em; right: 3em; cursor:pointer; } -.form_notice label[for=notice_data-attach] { +.form_notice label.notice_data-attach { text-indent:-9999px; width:16px; height:16px; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { opacity: 0; padding:0; height:1.6em; diff --git a/theme/mnml/css/ie.css b/theme/mnml/css/ie.css index fed65f8b9a..839855aa6f 100644 --- a/theme/mnml/css/ie.css +++ b/theme/mnml/css/ie.css @@ -45,7 +45,7 @@ padding:0 4px; background:transparent url(../images/icons/icons-01.png) no-repeat 0 -328px; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { filter: alpha(opacity=0); } .form_notice .notice_data-geo_wrap label { diff --git a/theme/mnml/css/mp-screen.css b/theme/mnml/css/mp-screen.css index fdee4cdef3..47fdbf5e3b 100644 --- a/theme/mnml/css/mp-screen.css +++ b/theme/mnml/css/mp-screen.css @@ -114,7 +114,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator #form_notice label[for="notice_data-attach"] { display:none; } -#form_notice #notice_data-attach { +#form_notice input.notice_data-attach { position:static; clear:both; width:65%; diff --git a/theme/neo/css/display.css b/theme/neo/css/display.css index a542ed7609..3d98b09f02 100644 --- a/theme/neo/css/display.css +++ b/theme/neo/css/display.css @@ -160,8 +160,7 @@ address { border-radius: 6px; } -.form_notice label[for=notice_data-attach], -.form_notice #notice_data-attach { +.form_notice label.notice_data-attach { top: 27px; right: 86px; } @@ -434,8 +433,8 @@ td.entity_profile { /* cf directory table */ #entity_remote_subscribe .dialogbox { border: 1px solid #7B4E82; - border-radius: 8px; - -moz-border-radius: 8px; + border-radius: 8px; + -moz-border-radius: 8px; -webkit-border-radius: 8px; } @@ -612,7 +611,7 @@ padding-right:0; right: 6px !important; } -.realtime-popup .form_notice label[for=notice_data-attach], .realtime-popup .form_notice #notice_data-attach { +.realtime-popup .form_notice label.notice_data-attach, .realtime-popup .form_notice input.notice_data-attach { right: 74px; top: 3px !important; } @@ -637,8 +636,8 @@ padding-right:0; } .bookmark-notice-count { - border-radius: 4px; - -moz-border-radius: 4px; + border-radius: 4px; + -moz-border-radius: 4px; -webkit-border-radius: 4px; padding: 1px 6px; font-size: 1.2em; @@ -676,8 +675,8 @@ padding-right:0; } ul.bookmark-tags a { - border-radius: 4px; - -moz-border-radius: 4px; + border-radius: 4px; + -moz-border-radius: 4px; -webkit-border-radius: 4px; padding: 1px 6px; background: #f2f2f2; @@ -761,8 +760,8 @@ ul.bookmark-tags a:hover { /* Onboard specific styles */ .onboard-flash { - border-radius: 6px; - -moz-border-radius: 6px; + border-radius: 6px; + -moz-border-radius: 6px; -webkit-border-radius: 6px; font-size: 1.1em; box-shadow: 0px 0px 12px rgba(0, 0, 0, 0.5); diff --git a/theme/neo/css/ie.css b/theme/neo/css/ie.css index 41f7dc9f88..81d13f443e 100644 --- a/theme/neo/css/ie.css +++ b/theme/neo/css/ie.css @@ -22,11 +22,11 @@ display:block; width: 106px; max-width: 106px; } -.form_notice #notice_data-attach_selected, +.form_notice input.notice_data-attach_selected, .form_notice #notice_data-geo_selected { width:78.75%; } -.form_notice #notice_data-attach_selected button, +.form_notice input.notice_data-attach_selected button, .form_notice #notice_data-geo_selected button { padding:0 4px; } @@ -65,7 +65,7 @@ line-height:auto; color:#FFFFFF; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { filter: alpha(opacity=0); } diff --git a/theme/neo/css/mp-screen.css b/theme/neo/css/mp-screen.css index d3f95db9b6..1b7480ecaf 100644 --- a/theme/neo/css/mp-screen.css +++ b/theme/neo/css/mp-screen.css @@ -99,7 +99,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator .form_notice label[for="notice_data-attach"] { display:none; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { position:static; clear:both; width:65%; diff --git a/theme/pigeonthoughts/css/base.css b/theme/pigeonthoughts/css/base.css index 59cba446ac..2eade7a451 100644 --- a/theme/pigeonthoughts/css/base.css +++ b/theme/pigeonthoughts/css/base.css @@ -450,19 +450,24 @@ float:left; font-size:1.3em; margin-bottom:7px; } -#form_notice label[for=notice_data-attach], -#form_notice #notice_data-attach { +#form_notice label.notice_data-attach, +#form_notice input.notice_data-attach { position:absolute; -top:25px; cursor:pointer; } -#form_notice label[for=notice_data-attach] { +#form_notice label.notice_data-attach { +top:25px; +} +#form_notice input.notice_data-attach { +top:0; +} +#form_notice label.notice_data-attach { text-indent:-9999px; left:394px; width:16px; height:16px; } -#form_notice #notice_data-attach { +#form_notice input.notice_data-attach { left:183px; padding:0; height:16px; diff --git a/theme/pigeonthoughts/css/display.css b/theme/pigeonthoughts/css/display.css index b4f2f297b0..3ac0f0bce7 100644 --- a/theme/pigeonthoughts/css/display.css +++ b/theme/pigeonthoughts/css/display.css @@ -192,14 +192,14 @@ color:#333333; #form_notice.warning .count { color:#000000; } -#form_notice label[for=notice_data-attach] { +#form_notice label.notice_data-attach { background-position:0 -328px; } -#form_notice #notice_data-attach { +#form_notice input.notice_data-attach { opacity:0; } -.form_notice label[for=notice_data-attach], +.form_notice label.notice_data-attach, #export_data li a.rss, #export_data li a.atom, #export_data li a.foaf, diff --git a/theme/rebase/css/display.css b/theme/rebase/css/display.css index f569131213..810dd70bc1 100644 --- a/theme/rebase/css/display.css +++ b/theme/rebase/css/display.css @@ -226,21 +226,28 @@ address .poweredby { color: #333 !important; } -.form_notice label[for=notice_data-attach], -.form_notice #notice_data-attach { +.form_notice label.notice_data-attach, +.form_notice input.notice_data-attach { position:absolute; - top: 31px; - right: 88px; cursor:pointer; } +.form_notice label.notice_data-attach { + top: 31px; + right: 88px; +} +.form_notice input.notice_data-attach { + /* Positioned inside the label */ + top: 0; + right: 0; +} -.form_notice label[for=notice_data-attach] { +.form_notice label.notice_data-attach { text-indent:-9999px; width:16px; height:16px; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { padding:0; height:16px; } @@ -348,7 +355,7 @@ address .poweredby { opacity: 1; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { opacity:0; } @@ -1724,7 +1731,7 @@ body.realtime-popup { width: 86px; } -.realtime-popup .form_notice label[for=notice_data-attach], .form_notice #notice_data-attach { +.realtime-popup .form_notice label.notice_data-attach { right: 70px; } @@ -1734,7 +1741,7 @@ body.realtime-popup { /* icons */ -.form_notice label[for=notice_data-attach], +.form_notice label.notice_data-attach, #export_data li a.rss, #export_data li a.atom, #export_data li a.foaf, @@ -1921,7 +1928,7 @@ background-position:0 -1648px; #new_group a { background-position:0 -1054px; } -.form_notice label[for=notice_data-attach] { +.form_notice label.notice_data-attach { background-position: 0 -328px; } .form_notice label.notice_data-geo { diff --git a/theme/rebase/css/ie.css b/theme/rebase/css/ie.css index 20e038998b..9dfb176698 100644 --- a/theme/rebase/css/ie.css +++ b/theme/rebase/css/ie.css @@ -61,7 +61,7 @@ line-height:auto; color:#FFFFFF; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { filter: alpha(opacity=0); } diff --git a/theme/shiny/css/display.css b/theme/shiny/css/display.css index e027153dd7..32a0a7e255 100644 --- a/theme/shiny/css/display.css +++ b/theme/shiny/css/display.css @@ -230,8 +230,8 @@ h6 {font-size: 1em;} border: 1px solid #9495b7; } -.form_notice label[for=notice_data-attach], -.form_notice #notice_data-attach { +.form_notice label.notice_data-attach, +.form_notice input.notice_data-attach { top: 27px; right: 86px; } diff --git a/theme/shiny/css/ie.css b/theme/shiny/css/ie.css index 8145073db5..e916b1e4cc 100644 --- a/theme/shiny/css/ie.css +++ b/theme/shiny/css/ie.css @@ -63,7 +63,7 @@ line-height:auto; color:#FFFFFF; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { filter: alpha(opacity=0); } diff --git a/theme/shiny/css/mp-screen.css b/theme/shiny/css/mp-screen.css index cb899b3557..c23a24b3c9 100644 --- a/theme/shiny/css/mp-screen.css +++ b/theme/shiny/css/mp-screen.css @@ -99,7 +99,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator .form_notice label[for="notice_data-attach"] { display:none; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { position:static; clear:both; width:65%; diff --git a/theme/victorian/css/display.css b/theme/victorian/css/display.css index 6252fdf908..65d73e96fc 100644 --- a/theme/victorian/css/display.css +++ b/theme/victorian/css/display.css @@ -328,15 +328,15 @@ a, color:#000000; } -.form_notice label[for=notice_data-attach] { +.form_notice label.notice_data-attach { background-position:0 -328px; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { opacity:0; } -.form_notice label[for=notice_data-attach], +.form_notice label.notice_data-attach, #export_data li a.rss, #export_data li a.atom, #export_data li a.foaf, diff --git a/theme/victorian/css/ie.css b/theme/victorian/css/ie.css index 038195faaf..2befa9cc48 100644 --- a/theme/victorian/css/ie.css +++ b/theme/victorian/css/ie.css @@ -9,7 +9,7 @@ background-color:#C8D1D5; .form_notice .count + label { background:transparent url(../../base/images/icons/icons-01.gif) no-repeat 0 -328px; } -.form_notice #notice_data-attach { +.form_notice input.notice_data-attach { filter: alpha(opacity=0); } .notice-options form.form_favor input.submit { diff --git a/theme/victorian/css/mp-screen.css b/theme/victorian/css/mp-screen.css index 94a534912f..584bfc7c10 100644 --- a/theme/victorian/css/mp-screen.css +++ b/theme/victorian/css/mp-screen.css @@ -109,7 +109,7 @@ iPhone/iPod Touch, Android, Opera Mini Simulator #form_notice label[for="notice_data-attach"] { display:none; } -#form_notice #notice_data-attach { +#form_notice input.notice_data-attach { position:static; clear:both; width:65%;