1. Add template category 'end' that places content right before final </body> tag 2. Move most Javascript from tpl files into one cacheable file, theme.js 3. Load scripts at end of the HTML document instead of in the header 4. Minify several Javascript files Note that the second and third things were only done for Frost and Frost Mobile. Doing it for every theme means going through every .tpl for every theme and rearranging the Javascript, which is tedious.pull/413/head
@ -0,0 +1 @@ | |||
function ACL(e,t){that=this,that.url=e,that.kp_timer=null,t==undefined&&(t=[]),that.allow_cid=t[0]||[],that.allow_gid=t[1]||[],that.deny_cid=t[2]||[],that.deny_gid=t[3]||[],that.group_uids=[],that.nw=4,that.list_content=$("#acl-list-content"),that.item_tpl=unescape($(".acl-list-item[rel=acl-template]").html()),that.showall=$("#acl-showall"),t.length==0&&that.showall.addClass("selected"),that.showall.click(that.on_showall),$(".acl-button-show").live("click",that.on_button_show),$(".acl-button-hide").live("click",that.on_button_hide),$("#acl-search").keypress(that.on_search),$("#acl-wrapper").parents("form").submit(that.on_submit),that.get(0,100)}ACL.prototype.on_submit=function(){aclfileds=$("#acl-fields").html(""),$(that.allow_gid).each(function(e,t){aclfileds.append("<input type='hidden' name='group_allow[]' value='"+t+"'>")}),$(that.allow_cid).each(function(e,t){aclfileds.append("<input type='hidden' name='contact_allow[]' value='"+t+"'>")}),$(that.deny_gid).each(function(e,t){aclfileds.append("<input type='hidden' name='group_deny[]' value='"+t+"'>")}),$(that.deny_cid).each(function(e,t){aclfileds.append("<input type='hidden' name='contact_deny[]' value='"+t+"'>")})},ACL.prototype.search=function(){var e=$("#acl-search").val();that.list_content.html(""),that.get(0,100,e)},ACL.prototype.on_search=function(e){that.kp_timer&&clearTimeout(that.kp_timer),that.kp_timer=setTimeout(that.search,1e3)},ACL.prototype.on_showall=function(e){return e.preventDefault(),e.stopPropagation(),that.showall.hasClass("selected")?!1:(that.showall.addClass("selected"),that.allow_cid=[],that.allow_gid=[],that.deny_cid=[],that.deny_gid=[],that.update_view(),!1)},ACL.prototype.on_button_show=function(e){return e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),that.set_allow($(this).parent().attr("id")),!1},ACL.prototype.on_button_hide=function(e){return e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),that.set_deny($(this).parent().attr("id")),!1},ACL.prototype.set_allow=function(e){type=e[0],id=parseInt(e.substr(1));switch(type){case"g":that.allow_gid.indexOf(id)<0?that.allow_gid.push(id):that.allow_gid.remove(id),that.deny_gid.indexOf(id)>=0&&that.deny_gid.remove(id);break;case"c":that.allow_cid.indexOf(id)<0?that.allow_cid.push(id):that.allow_cid.remove(id),that.deny_cid.indexOf(id)>=0&&that.deny_cid.remove(id)}that.update_view()},ACL.prototype.set_deny=function(e){type=e[0],id=parseInt(e.substr(1));switch(type){case"g":that.deny_gid.indexOf(id)<0?that.deny_gid.push(id):that.deny_gid.remove(id),that.allow_gid.indexOf(id)>=0&&that.allow_gid.remove(id);break;case"c":that.deny_cid.indexOf(id)<0?that.deny_cid.push(id):that.deny_cid.remove(id),that.allow_cid.indexOf(id)>=0&&that.allow_cid.remove(id)}that.update_view()},ACL.prototype.update_view=function(){that.allow_gid.length==0&&that.allow_cid.length==0&&that.deny_gid.length==0&&that.deny_cid.length==0?(that.showall.addClass("selected"),$("#jot-perms-icon").removeClass("lock").addClass("unlock"),$("#jot-public").show(),$(".profile-jot-net input").attr("disabled",!1),typeof editor!="undefined"&&editor!=0&&$("#profile-jot-desc").html(ispublic)):(that.showall.removeClass("selected"),$("#jot-perms-icon").removeClass("unlock").addClass("lock"),$("#jot-public").hide(),$(".profile-jot-net input").attr("disabled","disabled"),$("#profile-jot-desc").html(" ")),$("#acl-list-content .acl-list-item").each(function(){$(this).removeClass("groupshow grouphide")}),$("#acl-list-content .acl-list-item").each(function(){itemid=$(this).attr("id"),type=itemid[0],id=parseInt(itemid.substr(1)),btshow=$(this).children(".acl-button-show").removeClass("selected"),bthide=$(this).children(".acl-button-hide").removeClass("selected");switch(type){case"g":var e="";that.allow_gid.indexOf(id)>=0&&(btshow.addClass("selected"),bthide.removeClass("selected"),e="groupshow"),that.deny_gid.indexOf(id)>=0&&(btshow.removeClass("selected"),bthide.addClass("selected"),e="grouphide"),$(that.group_uids[id]).each(function(t,n){e=="grouphide"&&$("#c"+n).removeClass("groupshow");if(e!=""){var r=$("#c"+n).attr("class");if(r==undefined)return!0;var i=r.indexOf("grouphide");i==-1&&$("#c"+n).addClass(e)}});break;case"c":that.allow_cid.indexOf(id)>=0&&(btshow.addClass("selected"),bthide.removeClass("selected")),that.deny_cid.indexOf(id)>=0&&(btshow.removeClass("selected"),bthide.addClass("selected"))}})},ACL.prototype.get=function(e,t,n){var r={start:e,count:t,search:n};$.ajax({type:"POST",url:that.url,data:r,dataType:"json",success:that.populate})},ACL.prototype.populate=function(e){var t=Math.ceil(e.tot/that.nw)*42;that.list_content.height(t),$(e.items).each(function(){html="<div class='acl-list-item {4} {5}' title='{6}' id='{2}{3}'>"+that.item_tpl+"</div>",html=html.format(this.photo,this.name,this.type,this.id,"",this.network,this.link),this.uids!=undefined&&(that.group_uids[this.id]=this.uids),that.list_content.append(html)}),that.update_view()}; |
@ -0,0 +1,5 @@ | |||
/** | |||
* Friendica people autocomplete | |||
* | |||
* require jQuery, jquery.textareas | |||
*/function ACPopup(e,t){this.idsel=-1,this.element=e,this.searchText="",this.ready=!0,this.kp_timer=!1,this.url=t;var n=530,r=130;if(typeof e.editorId=="undefined")style=$(e).offset(),n=$(e).width(),r=$(e).height();else{var i=e.getContainer();typeof i!="undefined"&&(style=$(i).offset(),n=$(i).width(),r=$(i).height())}style.top=style.top+r,style.width=n,style.position="absolute",style.display="none",this.cont=$("<div class='acpopup'></div>"),this.cont.css(style),$("body").append(this.cont)}function ContactAutocomplete(e,t){this.pattern=/@([^ \n]+)$/,this.popup=null;var n=this;$(e).unbind("keydown"),$(e).unbind("keyup"),$(e).keydown(function(e){n.popup!==null&&n.popup.onkey(e)}),$(e).keyup(function(e){cpos=$(this).getSelection(),cpos.start==cpos.end&&(match=$(this).val().substring(0,cpos.start).match(n.pattern),match!==null?(n.popup===null&&(n.popup=new ACPopup(this,t)),n.popup.ready&&match[1]!==n.popup.searchText&&n.popup.search(match[1]),n.popup.ready||(n.popup=null)):n.popup!==null&&(n.popup.close(),n.popup=null))})}ACPopup.prototype.close=function(){$(this.cont).remove(),this.ready=!1},ACPopup.prototype.search=function(e){var t=this;this.searchText=e,this.kp_timer&&clearTimeout(this.kp_timer),this.kp_timer=setTimeout(function(){t._search()},500)},ACPopup.prototype._search=function(){console.log("_search");var e=this,t={start:0,count:100,search:this.searchText,type:"c"};$.ajax({type:"POST",url:this.url,data:t,dataType:"json",success:function(t){e.cont.html(""),t.tot>0?(e.cont.show(),$(t.items).each(function(){html="<img src='{0}' height='16px' width='16px'>{1} ({2})".format(this.photo,this.name,this.nick),e.add(html,this.nick.replace(" ","")+"+"+this.id+" - "+this.link)})):e.cont.hide()}})},ACPopup.prototype.add=function(e,n){var r=this,i=$("<div class='acpopupitem' title='"+n+"'>"+e+"</div>");i.click(function(e){t=$(this).attr("title").replace(new RegExp(" - .*"),""),typeof r.element.container=="undefined"?(el=$(r.element),sel=el.getSelection(),sel.start=sel.start-r.searchText.length,el.setSelection(sel.start,sel.end).replaceSelectedText(t+" ").collapseSelection(!1),r.close()):(txt=tinyMCE.activeEditor.getContent(),newtxt=txt.replace(r.searchText,t+" "),tinyMCE.activeEditor.setContent(newtxt),tinyMCE.activeEditor.focus(),r.close())}),$(this.cont).append(i)},ACPopup.prototype.onkey=function(e){e.keyCode=="13"&&(this.idsel>-1?(this.cont.children()[this.idsel].click(),e.preventDefault()):this.close()),e.keyCode=="38"&&(cmax=this.cont.children().size()-1,this.idsel--,this.idsel<0&&(this.idsel=cmax),e.preventDefault());if(e.keyCode=="40"||e.keyCode=="9")cmax=this.cont.children().size()-1,this.idsel++,this.idsel>cmax&&(this.idsel=0),e.preventDefault();if(e.keyCode=="38"||e.keyCode=="40"||e.keyCode=="9")this.cont.children().removeClass("selected"),$(this.cont.children()[this.idsel]).addClass("selected");e.keyCode=="27"&&this.close()},function(e){e.fn.contact_autocomplete=function(e){this.each(function(){new ContactAutocomplete(this,e)})}}(jQuery); |
@ -0,0 +1,6 @@ | |||
/* jQuery ajax stream plugin | |||
* Version 0.1 | |||
* Copyright (C) 2009 Chris Tarquini | |||
* Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License (http://creativecommons.org/licenses/by-sa/3.0/) | |||
* Permissions beyond the scope of this license may be available by contacting petros000[at]hotmail.com. | |||
*/(function(e){var t=e.ajax,n=e.get,r=e.post,i=!0;e.ajaxSetup({stream:!1,pollInterval:500}),e.enableAjaxStream=function(a){typeof a=="undefined"&&(a=!i),a?(e.ajax=s,e.get=o,e.post=u,i=!0):(e.ajax=t,e.get=n,e.post=r,i=!1)};var s=e.ajax=function(n){n=jQuery.extend(!0,n,jQuery.extend(!0,{},jQuery.ajaxSettings,n));if(n.stream){var r=0,i=0,s=null,o=0,u=!1,a=function(e){s=e,l()},f=function(){c("stream")},l=function(){u||(r=setTimeout(f,n.pollInterval))},c=function(t){typeof t=="undefined"&&(t="stream");if(s.status<3)return;var r=s.responseText;if(t=="stream"){if(r.length<=o){l();return}lastlength=r.length;if(i==r.length){l();return}}var u=r.substr(i);i=r.length,e.isFunction(n.OnDataRecieved)&&n.OnDataRecieved(u,t,s.responseText,s),s.status!=4&&l()},h=function(e,t){clearTimeout(r),u=!0,c(t)};if(e.isFunction(n.success)){var p=n.success;n.success=function(e,t){h(e,t),p(e,t)}}else n.success=h;if(e.isFunction(n.beforeSend)){var d=n.beforeSend;n.beforeSend=function(e){d(e),a(e)}}else n.beforeSend=a}t(n)},o=e.get=function(t,n,r,i,s){if(e.isFunction(n)){var o=r;r=n,e.isFunction(o)&&(s=o),n=null}e.isFunction(i)&&(s=i,i=undefined);var u=e.isFunction(s);return jQuery.ajax({type:"GET",url:t,data:n,success:r,dataType:i,stream:u,OnDataRecieved:s})},u=e.post=function(t,n,r,i,s){if(e.isFunction(n)){var o=r;r=n}e.isFunction(i)&&(s=i,i=undefined);var u=e.isFunction(s);return jQuery.ajax({type:"POST",url:t,data:n,success:r,dataType:i,stream:u,OnDataRecieved:s})}})(jQuery); |
@ -0,0 +1,6 @@ | |||
/** | |||
* | |||
* Base64 encode / decode | |||
* http://www.webtoolkit.info/ | |||
* | |||
**/var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="",n,r,i,s,o,u,a,f=0;e=Base64._utf8_encode(e);while(f<e.length)n=e.charCodeAt(f++),r=e.charCodeAt(f++),i=e.charCodeAt(f++),s=n>>2,o=(n&3)<<4|r>>4,u=(r&15)<<2|i>>6,a=i&63,isNaN(r)?u=a=64:isNaN(i)&&(a=64),t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a);return t},decode:function(e){var t="",n,r,i,s,o,u,a,f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length)s=this._keyStr.indexOf(e.charAt(f++)),o=this._keyStr.indexOf(e.charAt(f++)),u=this._keyStr.indexOf(e.charAt(f++)),a=this._keyStr.indexOf(e.charAt(f++)),n=s<<2|o>>4,r=(o&15)<<4|u>>2,i=(u&3)<<6|a,t+=String.fromCharCode(n),u!=64&&(t+=String.fromCharCode(r)),a!=64&&(t+=String.fromCharCode(i));return t=Base64._utf8_decode(t),t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t+=String.fromCharCode(r):r>127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(r&63|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(r&63|128))}return t},_utf8_decode:function(e){var t="",n=0,r=c1=c2=0;while(n<e.length)r=e.charCodeAt(n),r<128?(t+=String.fromCharCode(r),n++):r>191&&r<224?(c2=e.charCodeAt(n+1),t+=String.fromCharCode((r&31)<<6|c2&63),n+=2):(c2=e.charCodeAt(n+1),c3=e.charCodeAt(n+2),t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63),n+=3);return t}}; |
@ -0,0 +1,17 @@ | |||
<script src="$baseurl/library/jquery_ac/friendica.complete.js" ></script> | |||
<script> | |||
$(document).ready(function() { | |||
var a; | |||
a = $("#contacts-search").autocomplete({ | |||
serviceUrl: '$base/acl', | |||
minChars: 2, | |||
width: 350, | |||
}); | |||
a.setOptions({ params: { type: 'a' }}); | |||
}); | |||
</script> | |||
@ -0,0 +1,17 @@ | |||
<script src="$baseurl/library/jquery_ac/friendica.complete.js" ></script> | |||
<script>$(document).ready(function() { | |||
var a; | |||
a = $("#recip").autocomplete({ | |||
serviceUrl: '$base/acl', | |||
minChars: 2, | |||
width: 350, | |||
onSelect: function(value,data) { | |||
$("#recip-complete").val(data); | |||
} | |||
}); | |||
}); | |||
</script> | |||
@ -0,0 +1,11 @@ | |||
<script> | |||
$(document).keydown(function(event) { | |||
if("$prevlink" != '') { if(event.ctrlKey && event.keyCode == 37) { event.preventDefault(); window.location.href = "$prevlink"; }} | |||
if("$nextlink" != '') { if(event.ctrlKey && event.keyCode == 39) { event.preventDefault(); window.location.href = "$nextlink"; }} | |||
}); | |||
</script> |
@ -0,0 +1,26 @@ | |||
<script> | |||
var ispublic = "$ispublic"; | |||
$(document).ready(function() { | |||
$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() { | |||
var selstr; | |||
$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() { | |||
selstr = $(this).text(); | |||
$('#jot-perms-icon').removeClass('unlock').addClass('lock'); | |||
$('#jot-public').hide(); | |||
}); | |||
if(selstr == null) { | |||
$('#jot-perms-icon').removeClass('lock').addClass('unlock'); | |||
$('#jot-public').show(); | |||
} | |||
}).trigger('change'); | |||
}); | |||
</script> | |||
@ -0,0 +1,25 @@ | |||
<script> | |||
var ispublic = "$ispublic"; | |||
$(document).ready(function() { | |||
$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() { | |||
var selstr; | |||
$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() { | |||
selstr = $(this).text(); | |||
$('#jot-perms-icon').removeClass('unlock').addClass('lock'); | |||
$('#jot-public').hide(); | |||
}); | |||
if(selstr == null) { | |||
$('#jot-perms-icon').removeClass('lock').addClass('unlock'); | |||
$('#jot-public').show(); | |||
} | |||
}).trigger('change'); | |||
}); | |||
</script> | |||
@ -0,0 +1,22 @@ | |||
<div id="acl-wrapper"> | |||
<input id="acl-search"> | |||
<a href="#" id="acl-showall">$showall</a> | |||
<div id="acl-list"> | |||
<div id="acl-list-content"> | |||
</div> | |||
</div> | |||
<span id="acl-fields"></span> | |||
</div> | |||
<div class="acl-list-item" rel="acl-template" style="display:none"> | |||
<img src="{0}"><p>{1}</p> | |||
<a href="#" class='acl-button-show'>$show</a> | |||
<a href="#" class='acl-button-hide'>$hide</a> | |||
</div> | |||
<script> | |||
window.allowCID = $allowcid; | |||
window.allowGID = $allowgid; | |||
window.denyCID = $denycid; | |||
window.denyGID = $denygid; | |||
</script> |
@ -0,0 +1,88 @@ | |||
<h2>$header</h2> | |||
<div id="contact-edit-wrapper" > | |||
$tab_str | |||
<div id="contact-edit-drop-link" > | |||
<a href="contacts/$contact_id/drop" class="icon drophide" id="contact-edit-drop-link" onclick="return confirmDelete();" title="$delete" onmouseover="imgbright(this);" onmouseout="imgdull(this);"></a> | |||
</div> | |||
<div id="contact-edit-drop-link-end"></div> | |||
<div id="contact-edit-nav-wrapper" > | |||
<div id="contact-edit-links"> | |||
<ul> | |||
<li><div id="contact-edit-rel">$relation_text</div></li> | |||
<li><div id="contact-edit-nettype">$nettype</div></li> | |||
{{ if $lost_contact }} | |||
<li><div id="lost-contact-message">$lost_contact</div></li> | |||
{{ endif }} | |||
{{ if $insecure }} | |||
<li><div id="insecure-message">$insecure</div></li> | |||
{{ endif }} | |||
{{ if $blocked }} | |||
<li><div id="block-message">$blocked</div></li> | |||
{{ endif }} | |||
{{ if $ignored }} | |||
<li><div id="ignore-message">$ignored</div></li> | |||
{{ endif }} | |||
{{ if $archived }} | |||
<li><div id="archive-message">$archived</div></li> | |||
{{ endif }} | |||
<li> </li> | |||
{{ if $common_text }} | |||
<li><div id="contact-edit-common"><a href="$common_link">$common_text</a></div></li> | |||
{{ endif }} | |||
{{ if $all_friends }} | |||
<li><div id="contact-edit-allfriends"><a href="allfriends/$contact_id">$all_friends</a></div></li> | |||
{{ endif }} | |||
<li><a href="network/?cid=$contact_id" id="contact-edit-view-recent">$lblrecent</a></li> | |||
{{ if $lblsuggest }} | |||
<li><a href="fsuggest/$contact_id" id="contact-edit-suggest">$lblsuggest</a></li> | |||
{{ endif }} | |||
</ul> | |||
</div> | |||
</div> | |||
<div id="contact-edit-nav-end"></div> | |||
<form action="contacts/$contact_id" method="post" > | |||
<input type="hidden" name="contact_id" value="$contact_id"> | |||
{{ if $poll_enabled }} | |||
<div id="contact-edit-poll-wrapper"> | |||
<div id="contact-edit-last-update-text">$lastupdtext <span id="contact-edit-last-updated">$last_update</span></div> | |||
<span id="contact-edit-poll-text">$updpub $poll_interval</span> <span id="contact-edit-update-now" class="button"><a id="update_now_link" href="contacts/$contact_id/update" >$udnow</a></span> | |||
</div> | |||
{{ endif }} | |||
<div id="contact-edit-end" ></div> | |||
{{inc field_checkbox.tpl with $field=$hidden }}{{endinc}} | |||
<div id="contact-edit-info-wrapper"> | |||
<h4>$lbl_info1</h4> | |||
<textarea id="contact-edit-info" rows="8" cols="35" name="info">$info</textarea> | |||
<input class="contact-edit-submit" type="submit" name="submit" value="$submit" /> | |||
</div> | |||
<div id="contact-edit-info-end"></div> | |||
<div id="contact-edit-profile-select-text"> | |||
<h4>$lbl_vis1</h4> | |||
<p>$lbl_vis2</p> | |||
</div> | |||
$profile_select | |||
<div id="contact-edit-profile-select-end"></div> | |||
<input class="contact-edit-submit" type="submit" name="submit" value="$submit" /> | |||
</form> | |||
</div> |
@ -1,30 +0,0 @@ | |||
<!--<script language="javascript" type="text/javascript" | |||
src="$baseurl/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script> | |||
<script language="javascript" type="text/javascript"> | |||
tinyMCE.init({ | |||
theme : "advanced", | |||
mode : "$editselect", | |||
elements: "contact-edit-info", | |||
plugins : "bbcode", | |||
theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor", | |||
theme_advanced_buttons2 : "", | |||
theme_advanced_buttons3 : "", | |||
theme_advanced_toolbar_location : "top", | |||
theme_advanced_toolbar_align : "center", | |||
theme_advanced_styles : "blockquote,code", | |||
gecko_spellcheck : true, | |||
entity_encoding : "raw", | |||
add_unload_trigger : false, | |||
remove_linebreaks : false, | |||
force_p_newlines : false, | |||
force_br_newlines : true, | |||
forced_root_block : '', | |||
content_css: "$baseurl/view/custom_tinymce.css" | |||
}); | |||
</script> | |||
--> |
@ -0,0 +1,4 @@ | |||
<script src="$baseurl/library/jquery_ac/friendica.complete.min.js" ></script> | |||
@ -0,0 +1,5 @@ | |||
<script> | |||
window.autocompleteType = 'contacts-head'; | |||
</script> | |||
@ -0,0 +1,27 @@ | |||
<h1>$title</h1> | |||
<p id="cropimage-desc"> | |||
$desc | |||
</p> | |||
<div id="cropimage-wrapper"> | |||
<img src="$image_url" id="croppa" class="imgCrop" alt="$title" /> | |||
</div> | |||
<div id="cropimage-preview-wrapper" > | |||
<div id="previewWrap" ></div> | |||
</div> | |||
<form action="profile_photo/$resource" id="crop-image-form" method="post" /> | |||
<input type='hidden' name='form_security_token' value='$form_security_token'> | |||
<input type="hidden" name="cropfinal" value="1" /> | |||
<input type="hidden" name="xstart" id="x1" /> | |||
<input type="hidden" name="ystart" id="y1" /> | |||
<input type="hidden" name="xfinal" id="x2" /> | |||
<input type="hidden" name="yfinal" id="y2" /> | |||
<input type="hidden" name="height" id="height" /> | |||
<input type="hidden" name="width" id="width" /> | |||
<div id="crop-image-submit-wrapper" > | |||
<input type="submit" name="submit" value="$done" /> | |||
</div> | |||
</form> |
@ -0,0 +1,4 @@ | |||
<script type="text/javascript" src="library/cropper/lib/prototype.js" language="javascript"></script> | |||
<script type="text/javascript" src="library/cropper/lib/scriptaculous.js?load=effects,builder,dragdrop" language="javascript"></script> | |||
<script type="text/javascript" src="library/cropper/cropper.js" language="javascript"></script> | |||
<script type="text/javascript" language="javascript">initCrop();</script> |
@ -0,0 +1 @@ | |||
<link rel="stylesheet" href="library/cropper/cropper.css" type="text/css" /> |
@ -0,0 +1,19 @@ | |||
<!--[if IE]> | |||
<script type="text/javascript" src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |||
<![endif]--> | |||
<!--<script type="text/javascript" src="$baseurl/library/tinymce/jscripts/tiny_mce/tiny_mce.js" ></script> | |||
<script type="text/javascript"> | |||
tinyMCE.init({ mode : "none"}); | |||
</script>--> | |||
<script type="text/javascript" src="$baseurl/js/jquery.js" ></script> | |||
<script type="text/javascript">var $j = jQuery.noConflict();</script> | |||
<script type="text/javascript" src="$baseurl/js/jquery.textinputs.js" ></script> | |||
<script type="text/javascript" src="$baseurl/view/theme/frost-mobile/js/fk.autocomplete.min.js" ></script> | |||
<!--<script type="text/javascript" src="$baseurl/library/fancybox/jquery.fancybox-1.3.4.pack.js"></script>--> | |||
<!--<script type="text/javascript" src="$baseurl/library/tiptip/jquery.tipTip.minified.js"></script>--> | |||
<script type="text/javascript" src="$baseurl/library/jgrowl/jquery.jgrowl_minimized.js"></script> | |||
<script type="text/javascript" src="$baseurl/view/theme/frost-mobile/js/acl.min.js" ></script> | |||
<script type="text/javascript" src="$baseurl/js/webtoolkit.base64.min.js" ></script> | |||
<script type="text/javascript" src="$baseurl/view/theme/frost-mobile/js/theme.min.js"></script> | |||
<script type="text/javascript" src="$baseurl/view/theme/frost-mobile/js/main.min.js" ></script> | |||
@ -0,0 +1,4 @@ | |||
<script language="javascript" type="text/javascript" | |||
src="$baseurl/library/fullcalendar/fullcalendar.min.js"></script> | |||
@ -1,139 +1,6 @@ | |||
<link rel='stylesheet' type='text/css' href='$baseurl/library/fullcalendar/fullcalendar.css' /> | |||
<script language="javascript" type="text/javascript" | |||
src="$baseurl/library/fullcalendar/fullcalendar.min.js"></script> | |||
<script> | |||
function showEvent(eventid) { | |||
/* $.get( | |||
'$baseurl/events/?id='+eventid, | |||
function(data){ | |||
$.fancybox(data); | |||
} | |||
); */ | |||
} | |||
$(document).ready(function() { | |||
$('#events-calendar').fullCalendar({ | |||
events: '$baseurl/events/json/', | |||
header: { | |||
left: 'prev,next today', | |||
center: 'title', | |||
right: 'month,agendaWeek,agendaDay' | |||
}, | |||
timeFormat: 'H(:mm)', | |||
eventClick: function(calEvent, jsEvent, view) { | |||
showEvent(calEvent.id); | |||
}, | |||
eventRender: function(event, element, view) { | |||
//console.log(view.name); | |||
if (event.item['author-name']==null) return; | |||
switch(view.name){ | |||
case "month": | |||
element.find(".fc-event-title").html( | |||
"<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format( | |||
event.item['author-avatar'], | |||
event.item['author-name'], | |||
event.title | |||
)); | |||
break; | |||
case "agendaWeek": | |||
element.find(".fc-event-title").html( | |||
"<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format( | |||
event.item['author-avatar'], | |||
event.item['author-name'], | |||
event.item.desc, | |||
event.item.location | |||
)); | |||
break; | |||
case "agendaDay": | |||
element.find(".fc-event-title").html( | |||
"<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format( | |||
event.item['author-avatar'], | |||
event.item['author-name'], | |||
event.item.desc, | |||
event.item.location | |||
)); | |||
break; | |||
} | |||
} | |||
}) | |||
// center on date | |||
var args=location.href.replace(baseurl,"").split("/"); | |||
if (args.length>=4) { | |||
$("#events-calendar").fullCalendar('gotoDate',args[2] , args[3]-1); | |||
} | |||
// show event popup | |||
var hash = location.hash.split("-") | |||
if (hash.length==2 && hash[0]=="#link") showEvent(hash[1]); | |||
}); | |||
</script> | |||
<!--<script language="javascript" type="text/javascript" | |||
src="$baseurl/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>--> | |||
<script language="javascript" type="text/javascript"> | |||
/* | |||
tinyMCE.init({ | |||
theme : "advanced", | |||
mode : "textareas", | |||
plugins : "bbcode,paste", | |||
theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code", | |||
theme_advanced_buttons2 : "", | |||
theme_advanced_buttons3 : "", | |||
theme_advanced_toolbar_location : "top", | |||
theme_advanced_toolbar_align : "center", | |||
theme_advanced_blockformats : "blockquote,code", | |||
gecko_spellcheck : true, | |||
paste_text_sticky : true, | |||
entity_encoding : "raw", | |||
add_unload_trigger : false, | |||
remove_linebreaks : false, | |||
force_p_newlines : false, | |||
force_br_newlines : true, | |||
forced_root_block : '', | |||
content_css: "$baseurl/view/custom_tinymce.css", | |||
theme_advanced_path : false, | |||
setup : function(ed) { | |||
ed.onInit.add(function(ed) { | |||
ed.pasteAsPlainText = true; | |||
}); | |||
} | |||
}); | |||
*/ | |||
$(document).ready(function() { | |||
$('#event-share-checkbox').change(function() { | |||
if ($('#event-share-checkbox').is(':checked')) { | |||
$('#acl-wrapper').show(); | |||
} | |||
else { | |||
$('#acl-wrapper').hide(); | |||
} | |||
}).trigger('change'); | |||
$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() { | |||
var selstr; | |||
$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() { | |||
selstr = $(this).text(); | |||
$('#jot-public').hide(); | |||
}); | |||
if(selstr == null) { | |||
$('#jot-public').show(); | |||
} | |||
}).trigger('change'); | |||
}); | |||
window.aclType = 'event_head'; | |||
</script> | |||
@ -0,0 +1,6 @@ | |||
<div class='field checkbox'> | |||
<label id='label_id_$field.0' for='id_$field.0'>$field.1</label> | |||
<input type="checkbox" name='$field.0' id='id_$field.0' value="1" {{ if $field.2 }}checked="checked"{{ endif }}><br /> | |||
<span class='field_help' id='help_id_$field.0'>$field.3</span> | |||
</div> |
@ -0,0 +1,9 @@ | |||
<div class='field select'> | |||
<label for='id_$field.0'>$field.1</label> | |||
<select name='$field.0' id='id_$field.0' onchange="previewTheme(this);" > | |||
{{ for $field.4 as $opt=>$val }}<option value="$opt" {{ if $opt==$field.2 }}selected="selected"{{ endif }}>$val</option>{{ endfor }} | |||
</select> | |||
<span class='field_help'>$field.3</span> | |||
<div id="theme-preview"></div> | |||
</div> |
@ -0,0 +1,5 @@ | |||
<script type="text/javascript" src="$baseurl/js/ajaxupload.min.js" ></script> | |||
<script>if(typeof window.jotInit != 'undefined') initEditor();</script> | |||
@ -1,212 +1,15 @@ | |||
<script type="text/javascript" src="$baseurl/js/ajaxupload.js" ></script> | |||
<script> | |||
var ispublic = '$ispublic'; | |||
$(document).ready(function() { | |||
/* enable tinymce on focus and click */ | |||
$("#profile-jot-text").focus(enableOnUser); | |||
$("#profile-jot-text").click(enableOnUser); | |||
var uploader = new window.AjaxUpload( | |||
'wall-image-upload', | |||
{ action: 'wall_upload/$nickname', | |||
name: 'userfile', | |||
onSubmit: function(file,ext) { $('#profile-rotator').show(); }, | |||
onComplete: function(file,response) { | |||
addeditortext(response); | |||
$('#profile-rotator').hide(); | |||
} | |||
} | |||
); | |||
var file_uploader = new window.AjaxUpload( | |||
'wall-file-upload', | |||
{ action: 'wall_attach/$nickname', | |||
name: 'userfile', | |||
onSubmit: function(file,ext) { $('#profile-rotator').show(); }, | |||
onComplete: function(file,response) { |