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.
));
}
+ function init_page_end() {
+ $tpl = get_markup_template('end.tpl');
+ $this->page['end'] = replace_macros($tpl,array(
+ '$baseurl' => $this->get_baseurl() // FIXME for z_path!!!!
+ ));
+ }
+
function set_curl_code($code) {
$this->curl_code = $code;
}
$plaintext = true;
$tpl = get_markup_template('jot-header.tpl');
-
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$newpost' => 'true',
'$baseurl' => $a->get_baseurl(true),
));
+ $tpl = get_markup_template('jot-end.tpl');
+ $a->page['end'] .= replace_macros($tpl, array(
+ '$newpost' => 'true',
+ '$baseurl' => $a->get_baseurl(true),
+ '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
+ '$geotag' => $geotag,
+ '$nickname' => $x['nickname'],
+ '$ispublic' => t('Visible to <strong>everybody</strong>'),
+ '$linkurl' => t('Please enter a link URL:'),
+ '$vidurl' => t("Please enter a video link/URL:"),
+ '$audurl' => t("Please enter an audio link/URL:"),
+ '$term' => t('Tag term:'),
+ '$fileas' => t('Save to Folder:'),
+ '$whereareu' => t('Where are you right now?')
+ ));
+
+
$tpl = get_markup_template("jot.tpl");
$jotplugins = '';
$a->init_pagehead();
+/**
+ * Build the page ending -- this is stuff that goes right before
+ * the closing </body> tag
+ */
+
+$a->init_page_end();
if(! x($_SESSION,'sysmsg'))
--- /dev/null
+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()};
\ No newline at end of file
--- /dev/null
+/**
+ * AJAX Upload ( http://valums.com/ajax-upload/ )
+ * Copyright (c) Andris Valums
+ * Licensed under the MIT license ( http://valums.com/mit-license/ )
+ * Thanks to Gary Haran, David Mark, Corey Burns and others for contributions.
+ */(function(){function log(){typeof console!="undefined"&&typeof console.log=="function"&&(Array.prototype.unshift.call(arguments,"[Ajax Upload]"),console.log(Array.prototype.join.call(arguments," ")))}function addEvent(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else{if(!e.attachEvent)throw new Error("not supported or DOM not loaded");e.attachEvent("on"+t,function(){n.call(e)})}}function addResizeEvent(e){var t;addEvent(window,"resize",function(){t&&clearTimeout(t),t=setTimeout(e,100)})}function getBox(e){var t,n,r,i,s=getOffset(e);return t=s.left,r=s.top,n=t+e.offsetWidth,i=r+e.offsetHeight,{left:t,right:n,top:r,bottom:i}}function addStyles(e,t){for(var n in t)t.hasOwnProperty(n)&&(e.style[n]=t[n])}function copyLayout(e,t){var n=getBox(e);addStyles(t,{position:"absolute",left:n.left+"px",top:n.top+"px",width:e.offsetWidth+"px",height:e.offsetHeight+"px"}),t.title=e.title}function fileFromPath(e){return e.replace(/.*(\/|\\)/,"")}function getExt(e){return-1!==e.indexOf(".")?e.replace(/.*[.]/,""):""}function hasClass(e,t){var n=new RegExp("\\b"+t+"\\b");return n.test(e.className)}function addClass(e,t){hasClass(e,t)||(e.className+=" "+t)}function removeClass(e,t){var n=new RegExp("\\b"+t+"\\b");e.className=e.className.replace(n,"")}function removeNode(e){e.parentNode.removeChild(e)}if(document.documentElement.getBoundingClientRect)var getOffset=function(e){var t=e.getBoundingClientRect(),n=e.ownerDocument,r=n.body,i=n.documentElement,s=i.clientTop||r.clientTop||0,o=i.clientLeft||r.clientLeft||0,u=1;if(r.getBoundingClientRect){var a=r.getBoundingClientRect();u=(a.right-a.left)/r.clientWidth}u>1&&(s=0,o=0);var f=t.top/u+(window.pageYOffset||i&&i.scrollTop/u||r.scrollTop/u)-s,l=t.left/u+(window.pageXOffset||i&&i.scrollLeft/u||r.scrollLeft/u)-o;return{top:f,left:l}};else var getOffset=function(e){var t=0,n=0;do t+=e.offsetTop||0,n+=e.offsetLeft||0,e=e.offsetParent;while(e);return{left:n,top:t}};var toElement=function(){var e=document.createElement("div");return function(t){e.innerHTML=t;var n=e.firstChild;return e.removeChild(n)}}(),getUID=function(){var e=0;return function(){return"ValumsAjaxUpload"+e++}}();window.AjaxUpload=function(e,t){this._settings={action:"upload.php",name:"userfile",data:{},autoSubmit:!0,responseType:!1,hoverClass:"hover",focusClass:"focus",disabledClass:"disabled",onChange:function(e,t){},onSubmit:function(e,t){},onComplete:function(e,t){}};for(var n in t)t.hasOwnProperty(n)&&(this._settings[n]=t[n]);e.jquery?e=e[0]:typeof e=="string"&&(/^#.*/.test(e)&&(e=e.slice(1)),e=document.getElementById(e));if(!e||e.nodeType!==1)throw new Error("Please make sure that you're passing a valid element");e.nodeName.toUpperCase()=="A"&&addEvent(e,"click",function(e){e&&e.preventDefault?e.preventDefault():window.event&&(window.event.returnValue=!1)}),this._button=e,this._input=null,this._disabled=!1,this.enable(),this._rerouteClicks()},AjaxUpload.prototype={setData:function(e){this._settings.data=e},disable:function(){addClass(this._button,this._settings.disabledClass),this._disabled=!0;var e=this._button.nodeName.toUpperCase();(e=="INPUT"||e=="BUTTON")&&this._button.setAttribute("disabled","disabled"),this._input&&(this._input.parentNode.style.visibility="hidden")},enable:function(){removeClass(this._button,this._settings.disabledClass),this._button.removeAttribute("disabled"),this._disabled=!1},_createInput:function(){var e=this,t=document.createElement("input");t.setAttribute("type","file"),t.setAttribute("name",this._settings.name),addStyles(t,{position:"absolute",right:0,margin:0,padding:0,fontSize:"480px",fontFamily:"sans-serif",cursor:"pointer"});var n=document.createElement("div");addStyles(n,{display:"block",position:"absolute",overflow:"hidden",margin:0,padding:0,opacity:0,direction:"ltr",zIndex:2147483583,cursor:"pointer"});if(n.style.opacity!=="0"){if(typeof n.filters=="undefined")throw new Error("Opacity not supported by the browser");n.style.filter="alpha(opacity=0)"}addEvent(t,"change",function(){if(!t||t.value==="")return;var n=fileFromPath(t.value);if(!1===e._settings.onChange.call(e,n,getExt(n))){e._clearInput();return}e._settings.autoSubmit&&e.submit()}),addEvent(t,"mouseover",function(){addClass(e._button,e._settings.hoverClass)}),addEvent(t,"mouseout",function(){removeClass(e._button,e._settings.hoverClass),removeClass(e._button,e._settings.focusClass),t.parentNode.style.visibility="hidden"}),addEvent(t,"focus",function(){addClass(e._button,e._settings.focusClass)}),addEvent(t,"blur",function(){removeClass(e._button,e._settings.focusClass)}),n.appendChild(t),document.body.appendChild(n),this._input=t},_clearInput:function(){if(!this._input)return;removeNode(this._input.parentNode),this._input=null,this._createInput(),removeClass(this._button,this._settings.hoverClass),removeClass(this._button,this._settings.focusClass)},_rerouteClicks:function(){var e=this;addEvent(e._button,"mouseover",function(){if(e._disabled)return;e._input||e._createInput();var t=e._input.parentNode;copyLayout(e._button,t),t.style.visibility="visible"})},_createIframe:function(){var e=getUID(),t=toElement('<iframe src="javascript:false;" name="'+e+'" />');return t.setAttribute("id",e),t.style.display="none",document.body.appendChild(t),t},_createForm:function(e){var t=this._settings,n=toElement('<form method="post" enctype="multipart/form-data"></form>');n.setAttribute("action",t.action),n.setAttribute("target",e.name),n.style.display="none",document.body.appendChild(n);for(var r in t.data)if(t.data.hasOwnProperty(r)){var i=document.createElement("input");i.setAttribute("type","hidden"),i.setAttribute("name",r),i.setAttribute("value",t.data[r]),n.appendChild(i)}return n},_getResponse:function(iframe,file){var toDeleteFlag=!1,self=this,settings=this._settings;addEvent(iframe,"load",function(){if(iframe.src=="javascript:'%3Chtml%3E%3C/html%3E';"||iframe.src=="javascript:'<html></html>';"){toDeleteFlag&&setTimeout(function(){removeNode(iframe)},0);return}var doc=iframe.contentDocument?iframe.contentDocument:window.frames[iframe.id].document;if(doc.readyState&&doc.readyState!="complete")return;if(doc.body&&doc.body.innerHTML=="false")return;var response;doc.XMLDocument?response=doc.XMLDocument:doc.body?(response=doc.body.innerHTML,settings.responseType&&settings.responseType.toLowerCase()=="json"&&(doc.body.firstChild&&doc.body.firstChild.nodeName.toUpperCase()=="PRE"&&(doc.normalize(),response=doc.body.firstChild.firstChild.nodeValue),response?response=eval("("+response+")"):response={})):response=doc,settings.onComplete.call(self,file,response),toDeleteFlag=!0,iframe.src="javascript:'<html></html>';"})},submit:function(){var e=this,t=this._settings;if(!this._input||this._input.value==="")return;var n=fileFromPath(this._input.value);if(!1===t.onSubmit.call(this,n,getExt(n))){this._clearInput();return}var r=this._createIframe(),i=this._createForm(r);removeNode(this._input.parentNode),removeClass(e._button,e._settings.hoverClass),removeClass(e._button,e._settings.focusClass),i.appendChild(this._input),i.submit(),removeNode(i),i=null,removeNode(this._input),this._input=null,this._getResponse(r,n),this._createInput()}}})();
\ No newline at end of file
--- /dev/null
+//<!-- Docs at: http://www.microcosmotalk.com/tech/scripts/
+// NOTE:
+// This code is placed into the public domain and may be used in any manner desired.
+//
+// Jim Carlock obtained the list of country names and state names from an HTML
+// document at Microsoft's website.
+//
+// Thursday, January 13, 2005, 7:00:52 PM
+//
+function fInitgArStateInfo(){var e=0,t=0,n="",r=0,i=0,s=0,o=0;for(e=0;e<gLngNumberCountries;e++){r=aStates[e].split("|").length+1,gLngNumberStates+=r,gArStateInfo[e]=new Array(r),i=0;for(t=0;t<r;t++)s>i&&(i=s,gArStateInfo[e][t][0]=n);gArCountryInfo[e][3]=parseInt(i)}Update_Globals();return}function xFillState(){var e=0;document.form1.region.options.length=0,gLngSelectedCountry=document.form1.country_name.selectedIndex,gLngNumberStates=gArCountryInfo[[gLngSelectedCountry][2]];for(e=0;e<gLngNumberStates;e++)document.form1.region.options[e]=new Option(gArStateInfo[[gLngSelectedCountry][e][0]]);gLngSelectedState=document.form1.region.options.selectedIndex;return}function Fill_States(e){var t=0,n=0,r=0;document.form1.region.options.length=0,gLngSelectedCountry=document.form1.country_name.selectedIndex,r=aStates[gLngSelectedCountry].split("|").length;for(t=0;t<r;t++)document.form1.region.options[t]=new Option(aStates[document.form1.country_name.selectedIndex].split("|")[t]),sRegionName=document.form1.region.options[t],sRegionName.text==e&&(document.form1.region.selectedIndex=t);return}function Fill_Country(e){var t=0,n="";document.form1.country_name.options.length=0;for(t=0;t<gLngNumberCountries;t++)gArCountryInfo[t]=new Array(4);for(t=0;t<gLngNumberCountries;t++)document.form1.country_name.options[t]=new Option(sCountryString.split("|")[t]),n=document.form1.country_name.options[t],n.text==e&&(document.form1.country_name.selectedIndex=t),gArCountryInfo[t]=[n,parseInt(n.length),aStates,0];fInitgArStateInfo();return}function Update_Globals(){gLngSelectedCountry=parseInt(document.form1.country_name.selectedIndex),gLngSelectedState=parseInt(document.form1.region.selectedIndex);return}var gLngMaxStateLength=0,gLngMaxCountryLength=0,gLngNumberCountries=253,gLngNumberStates=0,gLngSelectedCountry=0,gLngSelectedState=0,gArCountryInfo,gArStateInfo,sCountryString="|Afghanistan|Albania|Algeria|American Samoa|Angola|Anguilla|Antartica|Antigua and Barbuda|Argentina|Armenia|Aruba|Ashmore and Cartier Island|Australia|Austria|Azerbaijan|Bahamas|Bahrain|Bangladesh|Barbados|Belarus|Belgium|Belize|Benin|Bermuda|Bhutan|Bolivia|Bosnia and Herzegovina|Botswana|Brazil|British Virgin Islands|Brunei|Bulgaria|Burkina Faso|Burma|Burundi|Cambodia|Cameroon|Canada|Cape Verde|Cayman Islands|Central African Republic|Chad|Chile|China|Christmas Island|Clipperton Island|Cocos (Keeling) Islands|Colombia|Comoros|Congo, Democratic Republic of the|Congo, Republic of the|Cook Islands|Costa Rica|Cote d'Ivoire|Croatia|Cuba|Cyprus|Czech Republic|Denmark|Djibouti|Dominica|Dominican Republic|Ecuador|Egypt|El Salvador|Equatorial Guinea|Eritrea|Estonia|Ethiopia|Europa Island|Falkland Islands (Islas Malvinas)|Faroe Islands|Fiji|Finland|France|French Guiana|French Polynesia|French Southern and Antarctic Lands|Gabon|Gambia, The|Gaza Strip|Georgia|Germany|Ghana|Gibraltar|Glorioso Islands|Greece|Greenland|Grenada|Guadeloupe|Guam|Guatemala|Guernsey|Guinea|Guinea-Bissau|Guyana|Haiti|Heard Island and McDonald Islands|Holy See (Vatican City)|Honduras|Hong Kong|Howland Island|Hungary|Iceland|India|Indonesia|Iran|Iraq|Ireland|Ireland, Northern|Israel|Italy|Jamaica|Jan Mayen|Japan|Jarvis Island|Jersey|Johnston Atoll|Jordan|Juan de Nova Island|Kazakhstan|Kenya|Kiribati|Korea, North|Korea, South|Kuwait|Kyrgyzstan|Laos|Latvia|Lebanon|Lesotho|Liberia|Libya|Liechtenstein|Lithuania|Luxembourg|Macau|Macedonia, Former Yugoslav Republic of|Madagascar|Malawi|Malaysia|Maldives|Mali|Malta|Man, Isle of|Marshall Islands|Martinique|Mauritania|Mauritius|Mayotte|Mexico|Micronesia, Federated States of|Midway Islands|Moldova|Monaco|Mongolia|Montserrat|Morocco|Mozambique|Namibia|Nauru|Nepal|Netherlands|Netherlands Antilles|New Caledonia|New Zealand|Nicaragua|Niger|Nigeria|Niue|Norfolk Island|Northern Mariana Islands|Norway|Oman|Pakistan|Palau|Panama|Papua New Guinea|Paraguay|Peru|Philippines|Pitcaim Islands|Poland|Portugal|Puerto Rico|Qatar|Reunion|Romainia|Russia|Rwanda|Saint Helena|Saint Kitts and Nevis|Saint Lucia|Saint Pierre and Miquelon|Saint Vincent and the Grenadines|Samoa|San Marino|Sao Tome and Principe|Saudi Arabia|Scotland|Senegal|Seychelles|Sierra Leone|Singapore|Slovakia|Slovenia|Solomon Islands|Somalia|South Africa|South Georgia and South Sandwich Islands|Spain|Spratly Islands|Sri Lanka|Sudan|Suriname|Svalbard|Swaziland|Sweden|Switzerland|Syria|Taiwan|Tajikistan|Tanzania|Thailand|Tobago|Toga|Tokelau|Tonga|Trinidad|Tunisia|Turkey|Turkmenistan|Tuvalu|Uganda|Ukraine|United Arab Emirates|United Kingdom|Uruguay|USA|Uzbekistan|Vanuatu|Venezuela|Vietnam|Virgin Islands|Wales|Wallis and Futuna|West Bank|Western Sahara|Yemen|Yugoslavia|Zambia|Zimbabwe|Friendicaland",aStates=new Array;aStates[0]="",aStates[1]="|Badakhshan|Badghis|Baghlan|Balkh|Bamian|Farah|Faryab|Ghazni|Ghowr|Helmand|Herat|Jowzjan|Kabol|Kandahar|Kapisa|Konar|Kondoz|Laghman|Lowgar|Nangarhar|Nimruz|Oruzgan|Paktia|Paktika|Parvan|Samangan|Sar-e Pol|Takhar|Vardak|Zabol",aStates[2]="|Berat|Bulqize|Delvine|Devoll (Bilisht)|Diber (Peshkopi)|Durres|Elbasan|Fier|Gjirokaster|Gramsh|Has (Krume)|Kavaje|Kolonje (Erseke)|Korce|Kruje|Kucove|Kukes|Kurbin|Lezhe|Librazhd|Lushnje|Malesi e Madhe (Koplik)|Mallakaster (Ballsh)|Mat (Burrel)|Mirdite (Rreshen)|Peqin|Permet|Pogradec|Puke|Sarande|Shkoder|Skrapar (Corovode)|Tepelene|Tirane (Tirana)|Tirane (Tirana)|Tropoje (Bajram Curri)|Vlore",aStates[3]="|Adrar|Ain Defla|Ain Temouchent|Alger|Annaba|Batna|Bechar|Bejaia|Biskra|Blida|Bordj Bou Arreridj|Bouira|Boumerdes|Chlef|Constantine|Djelfa|El Bayadh|El Oued|El Tarf|Ghardaia|Guelma|Illizi|Jijel|Khenchela|Laghouat|M'Sila|Mascara|Medea|Mila|Mostaganem|Naama|Oran|Ouargla|Oum el Bouaghi|Relizane|Saida|Setif|Sidi Bel Abbes|Skikda|Souk Ahras|Tamanghasset|Tebessa|Tiaret|Tindouf|Tipaza|Tissemsilt|Tizi Ouzou|Tlemcen",aStates[4]="|Eastern|Manu'a|Rose Island|Swains Island|Western",aStates[5]="|Andorra la Vella|Bengo|Benguela|Bie|Cabinda|Canillo|Cuando Cubango|Cuanza Norte|Cuanza Sul|Cunene|Encamp|Escaldes-Engordany|Huambo|Huila|La Massana|Luanda|Lunda Norte|Lunda Sul|Malanje|Moxico|Namibe|Ordino|Sant Julia de Loria|Uige|Zaire",aStates[6]="|Anguilla",aStates[7]="|Antartica",aStates[8]="|Barbuda|Redonda|Saint George|Saint John|Saint Mary|Saint Paul|Saint Peter|Saint Philip",aStates[9]="|Antartica e Islas del Atlantico Sur|Buenos Aires|Buenos Aires Capital Federal|Catamarca|Chaco|Chubut|Cordoba|Corrientes|Entre Rios|Formosa|Jujuy|La Pampa|La Rioja|Mendoza|Misiones|Neuquen|Rio Negro|Salta|San Juan|San Luis|Santa Cruz|Santa Fe|Santiago del Estero|Tierra del Fuego|Tucuman",aStates[10]="|Aragatsotn|Ararat|Armavir|Geghark'unik'|Kotayk'|Lorri|Shirak|Syunik'|Tavush|Vayots' Dzor|Yerevan",aStates[11]="|Aruba",aStates[12]="|Ashmore and Cartier Island",aStates[13]="|Australian Capital Territory|New South Wales|Northern Territory|Queensland|South Australia|Tasmania|Victoria|Western Australia",aStates[14]="|Burgenland|Kaernten|Niederoesterreich|Oberoesterreich|Salzburg|Steiermark|Tirol|Vorarlberg|Wien",aStates[15]="|Abseron Rayonu|Agcabadi Rayonu|Agdam Rayonu|Agdas Rayonu|Agstafa Rayonu|Agsu Rayonu|Ali Bayramli Sahari|Astara Rayonu|Baki Sahari|Balakan Rayonu|Barda Rayonu|Beylaqan Rayonu|Bilasuvar Rayonu|Cabrayil Rayonu|Calilabad Rayonu|Daskasan Rayonu|Davaci Rayonu|Fuzuli Rayonu|Gadabay Rayonu|Ganca Sahari|Goranboy Rayonu|Goycay Rayonu|Haciqabul Rayonu|Imisli Rayonu|Ismayilli Rayonu|Kalbacar Rayonu|Kurdamir Rayonu|Lacin Rayonu|Lankaran Rayonu|Lankaran Sahari|Lerik Rayonu|Masalli Rayonu|Mingacevir Sahari|Naftalan Sahari|Naxcivan Muxtar Respublikasi|Neftcala Rayonu|Oguz Rayonu|Qabala Rayonu|Qax Rayonu|Qazax Rayonu|Qobustan Rayonu|Quba Rayonu|Qubadli Rayonu|Qusar Rayonu|Saatli Rayonu|Sabirabad Rayonu|Saki Rayonu|Saki Sahari|Salyan Rayonu|Samaxi Rayonu|Samkir Rayonu|Samux Rayonu|Siyazan Rayonu|Sumqayit Sahari|Susa Rayonu|Susa Sahari|Tartar Rayonu|Tovuz Rayonu|Ucar Rayonu|Xacmaz Rayonu|Xankandi Sahari|Xanlar Rayonu|Xizi Rayonu|Xocali Rayonu|Xocavand Rayonu|Yardimli Rayonu|Yevlax Rayonu|Yevlax Sahari|Zangilan Rayonu|Zaqatala Rayonu|Zardab Rayonu",aStates[16]="|Acklins and Crooked Islands|Bimini|Cat Island|Exuma|Freeport|Fresh Creek|Governor's Harbour|Green Turtle Cay|Harbour Island|High Rock|Inagua|Kemps Bay|Long Island|Marsh Harbour|Mayaguana|New Providence|Nicholls Town and Berry Islands|Ragged Island|Rock Sound|San Salvador and Rum Cay|Sandy Point",aStates[17]="|Al Hadd|Al Manamah|Al Mintaqah al Gharbiyah|Al Mintaqah al Wusta|Al Mintaqah ash Shamaliyah|Al Muharraq|Ar Rifa' wa al Mintaqah al Janubiyah|Jidd Hafs|Juzur Hawar|Madinat 'Isa|Madinat Hamad|Sitrah",aStates[18]="|Barisal|Chittagong|Dhaka|Khulna|Rajshahi|Sylhet",aStates[19]="|Bridgetown|Christ Church|Saint Andrew|Saint George|Saint James|Saint John|Saint Joseph|Saint Lucy|Saint Michael|Saint Peter|Saint Philip|Saint Thomas",aStates[20]="|Brestskaya (Brest)|Homyel'skaya (Homyel')|Horad Minsk|Hrodzyenskaya (Hrodna)|Mahilyowskaya (Mahilyow)|Minskaya|Vitsyebskaya (Vitsyebsk)",aStates[21]="|Antwerpen|Brabant Wallon|Brussels Capitol Region|Hainaut|Liege|Limburg|Luxembourg|Namur|Oost-Vlaanderen|Vlaams Brabant|West-Vlaanderen",aStates[22]="|Belize|Cayo|Corozal|Orange Walk|Stann Creek|Toledo",aStates[23]="|Alibori|Atakora|Atlantique|Borgou|Collines|Couffo|Donga|Littoral|Mono|Oueme|Plateau|Zou",aStates[24]="|Devonshire|Hamilton|Hamilton|Paget|Pembroke|Saint George|Saint Georges|Sandys|Smiths|Southampton|Warwick",aStates[25]="|Bumthang|Chhukha|Chirang|Daga|Geylegphug|Ha|Lhuntshi|Mongar|Paro|Pemagatsel|Punakha|Samchi|Samdrup Jongkhar|Shemgang|Tashigang|Thimphu|Tongsa|Wangdi Phodrang",aStates[26]="|Beni|Chuquisaca|Cochabamba|La Paz|Oruro|Pando|Potosi|Santa Cruz|Tarija",aStates[27]="|Federation of Bosnia and Herzegovina|Republika Srpska",aStates[28]="|Central|Chobe|Francistown|Gaborone|Ghanzi|Kgalagadi|Kgatleng|Kweneng|Lobatse|Ngamiland|North-East|Selebi-Pikwe|South-East|Southern",aStates[29]="|Acre|Alagoas|Amapa|Amazonas|Bahia|Ceara|Distrito Federal|Espirito Santo|Goias|Maranhao|Mato Grosso|Mato Grosso do Sul|Minas Gerais|Para|Paraiba|Parana|Pernambuco|Piaui|Rio de Janeiro|Rio Grande do Norte|Rio Grande do Sul|Rondonia|Roraima|Santa Catarina|Sao Paulo|Sergipe|Tocantins",aStates[30]="|Anegada|Jost Van Dyke|Tortola|Virgin Gorda",aStates[31]="|Belait|Brunei and Muara|Temburong|Tutong",aStates[32]="|Blagoevgrad|Burgas|Dobrich|Gabrovo|Haskovo|Kardzhali|Kyustendil|Lovech|Montana|Pazardzhik|Pernik|Pleven|Plovdiv|Razgrad|Rousse|Shumen|Silistra|Sliven|Smolyan|Sofia|Stara Zagora|Turgovishte|Varna|Veliko Turnovo|Vidin|Vratsa|Yambol",aStates[33]="|Bale|Bam|Banwa|Bazega|Bougouriba|Boulgou|Boulkiemde|Comoe|Ganzourgou|Gnagna|Gourma|Houet|Ioba|Kadiogo|Kenedougou|Komandjari|Kompienga|Kossi|Koupelogo|Kouritenga|Kourweogo|Leraba|Loroum|Mouhoun|Nahouri|Namentenga|Naumbiel|Nayala|Oubritenga|Oudalan|Passore|Poni|Samentenga|Sanguie|Seno|Sissili|Soum|Sourou|Tapoa|Tuy|Yagha|Yatenga|Ziro|Zondomo|Zoundweogo",aStates[34]="|Ayeyarwady|Bago|Chin State|Kachin State|Kayah State|Kayin State|Magway|Mandalay|Mon State|Rakhine State|Sagaing|Shan State|Tanintharyi|Yangon",aStates[35]="|Bubanza|Bujumbura|Bururi|Cankuzo|Cibitoke|Gitega|Karuzi|Kayanza|Kirundo|Makamba|Muramvya|Muyinga|Mwaro|Ngozi|Rutana|Ruyigi",aStates[36]="|Banteay Mean Cheay|Batdambang|Kampong Cham|Kampong Chhnang|Kampong Spoe|Kampong Thum|Kampot|Kandal|Kaoh Kong|Keb|Kracheh|Mondol Kiri|Otdar Mean Cheay|Pailin|Phnum Penh|Pouthisat|Preah Seihanu (Sihanoukville)|Preah Vihear|Prey Veng|Rotanah Kiri|Siem Reab|Stoeng Treng|Svay Rieng|Takev",aStates[37]="|Adamaoua|Centre|Est|Extreme-Nord|Littoral|Nord|Nord-Ouest|Ouest|Sud|Sud-Ouest",aStates[38]="|Alberta|British Columbia|Manitoba|New Brunswick|Newfoundland|Northwest Territories|Nova Scotia|Nunavut|Ontario|Prince Edward Island|Quebec|Saskatchewan|Yukon Territory",aStates[39]="|Boa Vista|Brava|Maio|Mosteiros|Paul|Porto Novo|Praia|Ribeira Grande|Sal|Santa Catarina|Santa Cruz|Sao Domingos|Sao Filipe|Sao Nicolau|Sao Vicente|Tarrafal",aStates[40]="|Creek|Eastern|Midland|South Town|Spot Bay|Stake Bay|West End|Western",aStates[41]="|Bamingui-Bangoran|Bangui|Basse-Kotto|Gribingui|Haut-Mbomou|Haute-Kotto|Haute-Sangha|Kemo-Gribingui|Lobaye|Mbomou|Nana-Mambere|Ombella-Mpoko|Ouaka|Ouham|Ouham-Pende|Sangha|Vakaga",aStates[42]="|Batha|Biltine|Borkou-Ennedi-Tibesti|Chari-Baguirmi|Guera|Kanem|Lac|Logone Occidental|Logone Oriental|Mayo-Kebbi|Moyen-Chari|Ouaddai|Salamat|Tandjile",aStates[43]="|Aisen del General Carlos Ibanez del Campo|Antofagasta|Araucania|Atacama|Bio-Bio|Coquimbo|Libertador General Bernardo O'Higgins|Los Lagos|Magallanes y de la Antartica Chilena|Maule|Region Metropolitana (Santiago)|Tarapaca|Valparaiso",aStates[44]="|Anhui|Beijing|Chongqing|Fujian|Gansu|Guangdong|Guangxi|Guizhou|Hainan|Hebei|Heilongjiang|Henan|Hubei|Hunan|Jiangsu|Jiangxi|Jilin|Liaoning|Nei Mongol|Ningxia|Qinghai|Shaanxi|Shandong|Shanghai|Shanxi|Sichuan|Tianjin|Xinjiang|Xizang (Tibet)|Yunnan|Zhejiang",aStates[45]="|Christmas Island",aStates[46]="|Clipperton Island",aStates[47]="|Direction Island|Home Island|Horsburgh Island|North Keeling Island|South Island|West Island",aStates[48]="|Amazonas|Antioquia|Arauca|Atlantico|Bolivar|Boyaca|Caldas|Caqueta|Casanare|Cauca|Cesar|Choco|Cordoba|Cundinamarca|Distrito Capital de Santa Fe de Bogota|Guainia|Guaviare|Huila|La Guajira|Magdalena|Meta|Narino|Norte de Santander|Putumayo|Quindio|Risaralda|San Andres y Providencia|Santander|Sucre|Tolima|Valle del Cauca|Vaupes|Vichada",aStates[49]="|Anjouan (Nzwani)|Domoni|Fomboni|Grande Comore (Njazidja)|Moheli (Mwali)|Moroni|Moutsamoudou",aStates[50]="|Bandundu|Bas-Congo|Equateur|Kasai-Occidental|Kasai-Oriental|Katanga|Kinshasa|Maniema|Nord-Kivu|Orientale|Sud-Kivu",aStates[51]="|Bouenza|Brazzaville|Cuvette|Kouilou|Lekoumou|Likouala|Niari|Plateaux|Pool|Sangha",aStates[52]="|Aitutaki|Atiu|Avarua|Mangaia|Manihiki|Manuae|Mauke|Mitiaro|Nassau Island|Palmerston|Penrhyn|Pukapuka|Rakahanga|Rarotonga|Suwarrow|Takutea",aStates[53]="|Alajuela|Cartago|Guanacaste|Heredia|Limon|Puntarenas|San Jose",aStates[54]="|Abengourou|Abidjan|Aboisso|Adiake'|Adzope|Agboville|Agnibilekrou|Ale'pe'|Bangolo|Beoumi|Biankouma|Bocanda|Bondoukou|Bongouanou|Bouafle|Bouake|Bouna|Boundiali|Dabakala|Dabon|Daloa|Danane|Daoukro|Dimbokro|Divo|Duekoue|Ferkessedougou|Gagnoa|Grand Bassam|Grand-Lahou|Guiglo|Issia|Jacqueville|Katiola|Korhogo|Lakota|Man|Mankono|Mbahiakro|Odienne|Oume|Sakassou|San-Pedro|Sassandra|Seguela|Sinfra|Soubre|Tabou|Tanda|Tiassale|Tiebissou|Tingrela|Touba|Toulepleu|Toumodi|Vavoua|Yamoussoukro|Zuenoula",aStates[55]="|Bjelovarsko-Bilogorska Zupanija|Brodsko-Posavska Zupanija|Dubrovacko-Neretvanska Zupanija|Istarska Zupanija|Karlovacka Zupanija|Koprivnicko-Krizevacka Zupanija|Krapinsko-Zagorska Zupanija|Licko-Senjska Zupanija|Medimurska Zupanija|Osjecko-Baranjska Zupanija|Pozesko-Slavonska Zupanija|Primorsko-Goranska Zupanija|Sibensko-Kninska Zupanija|Sisacko-Moslavacka Zupanija|Splitsko-Dalmatinska Zupanija|Varazdinska Zupanija|Viroviticko-Podravska Zupanija|Vukovarsko-Srijemska Zupanija|Zadarska Zupanija|Zagreb|Zagrebacka Zupanija",aStates[56]="|Camaguey|Ciego de Avila|Cienfuegos|Ciudad de La Habana|Granma|Guantanamo|Holguin|Isla de la Juventud|La Habana|Las Tunas|Matanzas|Pinar del Rio|Sancti Spiritus|Santiago de Cuba|Villa Clara",aStates[57]="|Famagusta|Kyrenia|Larnaca|Limassol|Nicosia|Paphos",aStates[58]="|Brnensky|Budejovicky|Jihlavsky|Karlovarsky|Kralovehradecky|Liberecky|Olomoucky|Ostravsky|Pardubicky|Plzensky|Praha|Stredocesky|Ustecky|Zlinsky",aStates[59]="|Arhus|Bornholm|Fredericksberg|Frederiksborg|Fyn|Kobenhavn|Kobenhavns|Nordjylland|Ribe|Ringkobing|Roskilde|Sonderjylland|Storstrom|Vejle|Vestsjalland|Viborg",aStates[60]="|'Ali Sabih|Dikhil|Djibouti|Obock|Tadjoura",aStates[61]="|Saint Andrew|Saint David|Saint George|Saint John|Saint Joseph|Saint Luke|Saint Mark|Saint Patrick|Saint Paul|Saint Peter",aStates[62]="|Azua|Baoruco|Barahona|Dajabon|Distrito Nacional|Duarte|El Seibo|Elias Pina|Espaillat|Hato Mayor|Independencia|La Altagracia|La Romana|La Vega|Maria Trinidad Sanchez|Monsenor Nouel|Monte Cristi|Monte Plata|Pedernales|Peravia|Puerto Plata|Salcedo|Samana|San Cristobal|San Juan|San Pedro de Macoris|Sanchez Ramirez|Santiago|Santiago Rodriguez|Valverde",aStates[63]="|Azuay|Bolivar|Canar|Carchi|Chimborazo|Cotopaxi|El Oro|Esmeraldas|Galapagos|Guayas|Imbabura|Loja|Los Rios|Manabi|Morona-Santiago|Napo|Orellana|Pastaza|Pichincha|Sucumbios|Tungurahua|Zamora-Chinchipe",aStates[64]="|Ad Daqahliyah|Al Bahr al Ahmar|Al Buhayrah|Al Fayyum|Al Gharbiyah|Al Iskandariyah|Al Isma'iliyah|Al Jizah|Al Minufiyah|Al Minya|Al Qahirah|Al Qalyubiyah|Al Wadi al Jadid|As Suways|Ash Sharqiyah|Aswan|Asyut|Bani Suwayf|Bur Sa'id|Dumyat|Janub Sina'|Kafr ash Shaykh|Matruh|Qina|Shamal Sina'|Suhaj",aStates[65]="|Ahuachapan|Cabanas|Chalatenango|Cuscatlan|La Libertad|La Paz|La Union|Morazan|San Miguel|San Salvador|San Vicente|Santa Ana|Sonsonate|Usulutan",aStates[66]="|Annobon|Bioko Norte|Bioko Sur|Centro Sur|Kie-Ntem|Litoral|Wele-Nzas",aStates[67]="|Akale Guzay|Barka|Denkel|Hamasen|Sahil|Semhar|Senhit|Seraye",aStates[68]="|Harjumaa (Tallinn)|Hiiumaa (Kardla)|Ida-Virumaa (Johvi)|Jarvamaa (Paide)|Jogevamaa (Jogeva)|Laane-Virumaa (Rakvere)|Laanemaa (Haapsalu)|Parnumaa (Parnu)|Polvamaa (Polva)|Raplamaa (Rapla)|Saaremaa (Kuessaare)|Tartumaa (Tartu)|Valgamaa (Valga)|Viljandimaa (Viljandi)|Vorumaa (Voru)",aStates[69]="|Adis Abeba (Addis Ababa)|Afar|Amara|Dire Dawa|Gambela Hizboch|Hareri Hizb|Oromiya|Sumale|Tigray|YeDebub Biheroch Bihereseboch na Hizboch",aStates[70]="|Europa Island",aStates[71]="|Falkland Islands (Islas Malvinas)",aStates[72]="|Bordoy|Eysturoy|Mykines|Sandoy|Skuvoy|Streymoy|Suduroy|Tvoroyri|Vagar",aStates[73]="|Central|Eastern|Northern|Rotuma|Western",aStates[74]="|Aland|Etela-Suomen Laani|Ita-Suomen Laani|Lansi-Suomen Laani|Lappi|Oulun Laani",aStates[75]="|Alsace|Aquitaine|Auvergne|Basse-Normandie|Bourgogne|Bretagne|Centre|Champagne-Ardenne|Corse|Franche-Comte|Haute-Normandie|Ile-de-France|Languedoc-Roussillon|Limousin|Lorraine|Midi-Pyrenees|Nord-Pas-de-Calais|Pays de la Loire|Picardie|Poitou-Charentes|Provence-Alpes-Cote d'Azur|Rhone-Alpes",aStates[76]="|French Guiana",aStates[77]="|Archipel des Marquises|Archipel des Tuamotu|Archipel des Tubuai|Iles du Vent|Iles Sous-le-Vent",aStates[78]="|Adelie Land|Ile Crozet|Iles Kerguelen|Iles Saint-Paul et Amsterdam",aStates[79]="|Estuaire|Haut-Ogooue|Moyen-Ogooue|Ngounie|Nyanga|Ogooue-Ivindo|Ogooue-Lolo|Ogooue-Maritime|Woleu-Ntem",aStates[80]="|Banjul|Central River|Lower River|North Bank|Upper River|Western",aStates[81]="|Gaza Strip",aStates[82]="|Abashis|Abkhazia or Ap'khazet'is Avtonomiuri Respublika (Sokhumi)|Adigenis|Ajaria or Acharis Avtonomiuri Respublika (Bat'umi)|Akhalgoris|Akhalk'alak'is|Akhalts'ikhis|Akhmetis|Ambrolauris|Aspindzis|Baghdat'is|Bolnisis|Borjomis|Ch'khorotsqus|Ch'okhatauris|Chiat'ura|Dedop'listsqaros|Dmanisis|Dushet'is|Gardabanis|Gori|Goris|Gurjaanis|Javis|K'arelis|K'ut'aisi|Kaspis|Kharagaulis|Khashuris|Khobis|Khonis|Lagodekhis|Lanch'khut'is|Lentekhis|Marneulis|Martvilis|Mestiis|Mts'khet'is|Ninotsmindis|Onis|Ozurget'is|P'ot'i|Qazbegis|Qvarlis|Rust'avi|Sach'kheris|Sagarejos|Samtrediis|Senakis|Sighnaghis|T'bilisi|T'elavis|T'erjolis|T'et'ritsqaros|T'ianet'is|Tqibuli|Ts'ageris|Tsalenjikhis|Tsalkis|Tsqaltubo|Vanis|Zestap'onis|Zugdidi|Zugdidis",aStates[83]="|Baden-Württemberg|Bayern|Berlin|Brandenburg|Bremen|Hamburg|Hessen|Mecklenburg-Vorpommern|Niedersachsen|Nordrhein-Westfalen|Rheinland-Pfalz|Saarland|Sachsen|Sachsen-Anhalt|Schleswig-Holstein|Thüringen",aStates[84]="|Ashanti|Brong-Ahafo|Central|Eastern|Greater Accra|Northern|Upper East|Upper West|Volta|Western",aStates[85]="|Gibraltar",aStates[86]="|Ile du Lys|Ile Glorieuse",aStates[87]="|Aitolia kai Akarnania|Akhaia|Argolis|Arkadhia|Arta|Attiki|Ayion Oros (Mt. Athos)|Dhodhekanisos|Drama|Evritania|Evros|Evvoia|Florina|Fokis|Fthiotis|Grevena|Ilia|Imathia|Ioannina|Irakleion|Kardhitsa|Kastoria|Kavala|Kefallinia|Kerkyra|Khalkidhiki|Khania|Khios|Kikladhes|Kilkis|Korinthia|Kozani|Lakonia|Larisa|Lasithi|Lesvos|Levkas|Magnisia|Messinia|Pella|Pieria|Preveza|Rethimni|Rodhopi|Samos|Serrai|Thesprotia|Thessaloniki|Trikala|Voiotia|Xanthi|Zakinthos",aStates[88]="|Avannaa (Nordgronland)|Kitaa (Vestgronland)|Tunu (Ostgronland)",aStates[89]="|Carriacou and Petit Martinique|Saint Andrew|Saint David|Saint George|Saint John|Saint Mark|Saint Patrick",aStates[90]="|Basse-Terre|Grande-Terre|Iles de la Petite Terre|Iles des Saintes|Marie-Galante",aStates[91]="|Guam",aStates[92]="|Alta Verapaz|Baja Verapaz|Chimaltenango|Chiquimula|El Progreso|Escuintla|Guatemala|Huehuetenango|Izabal|Jalapa|Jutiapa|Peten|Quetzaltenango|Quiche|Retalhuleu|Sacatepequez|San Marcos|Santa Rosa|Solola|Suchitepequez|Totonicapan|Zacapa",aStates[93]="|Castel|Forest|St. Andrew|St. Martin|St. Peter Port|St. Pierre du Bois|St. Sampson|St. Saviour|Torteval|Vale",aStates[94]="|Beyla|Boffa|Boke|Conakry|Coyah|Dabola|Dalaba|Dinguiraye|Dubreka|Faranah|Forecariah|Fria|Gaoual|Gueckedou|Kankan|Kerouane|Kindia|Kissidougou|Koubia|Koundara|Kouroussa|Labe|Lelouma|Lola|Macenta|Mali|Mamou|Mandiana|Nzerekore|Pita|Siguiri|Telimele|Tougue|Yomou",aStates[95]="|Bafata|Biombo|Bissau|Bolama-Bijagos|Cacheu|Gabu|Oio|Quinara|Tombali",aStates[96]="|Barima-Waini|Cuyuni-Mazaruni|Demerara-Mahaica|East Berbice-Corentyne|Essequibo Islands-West Demerara|Mahaica-Berbice|Pomeroon-Supenaam|Potaro-Siparuni|Upper Demerara-Berbice|Upper Takutu-Upper Essequibo",aStates[97]="|Artibonite|Centre|Grand'Anse|Nord|Nord-Est|Nord-Ouest|Ouest|Sud|Sud-Est",aStates[98]="|Heard Island and McDonald Islands",aStates[99]="|Holy See (Vatican City)",aStates[100]="|Atlantida|Choluteca|Colon|Comayagua|Copan|Cortes|El Paraiso|Francisco Morazan|Gracias a Dios|Intibuca|Islas de la Bahia|La Paz|Lempira|Ocotepeque|Olancho|Santa Barbara|Valle|Yoro",aStates[101]="|Hong Kong",aStates[102]="|Howland Island",aStates[103]="|Bacs-Kiskun|Baranya|Bekes|Bekescsaba|Borsod-Abauj-Zemplen|Budapest|Csongrad|Debrecen|Dunaujvaros|Eger|Fejer|Gyor|Gyor-Moson-Sopron|Hajdu-Bihar|Heves|Hodmezovasarhely|Jasz-Nagykun-Szolnok|Kaposvar|Kecskemet|Komarom-Esztergom|Miskolc|Nagykanizsa|Nograd|Nyiregyhaza|Pecs|Pest|Somogy|Sopron|Szabolcs-Szatmar-Bereg|Szeged|Szekesfehervar|Szolnok|Szombathely|Tatabanya|Tolna|Vas|Veszprem|Veszprem|Zala|Zalaegerszeg",aStates[104]="|Akranes|Akureyri|Arnessysla|Austur-Bardhastrandarsysla|Austur-Hunavatnssysla|Austur-Skaftafellssysla|Borgarfjardharsysla|Dalasysla|Eyjafjardharsysla|Gullbringusysla|Hafnarfjordhur|Husavik|Isafjordhur|Keflavik|Kjosarsysla|Kopavogur|Myrasysla|Neskaupstadhur|Nordhur-Isafjardharsysla|Nordhur-Mulasys-la|Nordhur-Thingeyjarsysla|Olafsfjordhur|Rangarvallasysla|Reykjavik|Saudharkrokur|Seydhisfjordhur|Siglufjordhur|Skagafjardharsysla|Snaefellsnes-og Hnappadalssysla|Strandasysla|Sudhur-Mulasysla|Sudhur-Thingeyjarsysla|Vesttmannaeyjar|Vestur-Bardhastrandarsysla|Vestur-Hunavatnssysla|Vestur-Isafjardharsysla|Vestur-Skaftafellssysla",aStates[105]="|Andaman and Nicobar Islands|Andhra Pradesh|Arunachal Pradesh|Assam|Bihar|Chandigarh|Chhattisgarh|Dadra and Nagar Haveli|Daman and Diu|Delhi|Goa|Gujarat|Haryana|Himachal Pradesh|Jammu and Kashmir|Jharkhand|Karnataka|Kerala|Lakshadweep|Madhya Pradesh|Maharashtra|Manipur|Meghalaya|Mizoram|Nagaland|Orissa|Pondicherry|Punjab|Rajasthan|Sikkim|Tamil Nadu|Tripura|Uttar Pradesh|Uttaranchal|West Bengal",aStates[106]="|Aceh|Bali|Banten|Bengkulu|East Timor|Gorontalo|Irian Jaya|Jakarta Raya|Jambi|Jawa Barat|Jawa Tengah|Jawa Timur|Kalimantan Barat|Kalimantan Selatan|Kalimantan Tengah|Kalimantan Timur|Kepulauan Bangka Belitung|Lampung|Maluku|Maluku Utara|Nusa Tenggara Barat|Nusa Tenggara Timur|Riau|Sulawesi Selatan|Sulawesi Tengah|Sulawesi Tenggara|Sulawesi Utara|Sumatera Barat|Sumatera Selatan|Sumatera Utara|Yogyakarta",aStates[107]="|Ardabil|Azarbayjan-e Gharbi|Azarbayjan-e Sharqi|Bushehr|Chahar Mahall va Bakhtiari|Esfahan|Fars|Gilan|Golestan|Hamadan|Hormozgan|Ilam|Kerman|Kermanshah|Khorasan|Khuzestan|Kohgiluyeh va Buyer Ahmad|Kordestan|Lorestan|Markazi|Mazandaran|Qazvin|Qom|Semnan|Sistan va Baluchestan|Tehran|Yazd|Zanjan",aStates[108]="|Al Anbar|Al Basrah|Al Muthanna|Al Qadisiyah|An Najaf|Arbil|As Sulaymaniyah|At Ta'mim|Babil|Baghdad|Dahuk|Dhi Qar|Diyala|Karbala'|Maysan|Ninawa|Salah ad Din|Wasit",aStates[109]="|Antrim|Armargh|Carlow|Cavan|Clare|Cork|Derry|Donegal|Down|Dún Laoghaire–Rathdown|Fermanagh|Dublin|Fingal|Galway|Kerry|Kildare|Kilkenny|Laois|Leitrim|Limerick|Longford|Louth|Mayo|Meath|Monaghan|Offaly|Roscommon|Sligo|Tipperary|Tyrone|Waterford|Westmeath|Wexford|Wicklow",aStates[110]="|Antrim|Armagh|Belfast|Down|Fermanagh|Londonderry|Tyrone",aStates[111]="|Central|Haifa|Jerusalem|Northern|Southern|Tel Aviv",aStates[112]="|Abruzzi|Basilicata|Calabria|Campania|Emilia-Romagna|Friuli-Venezia Giulia|Lazio|Liguria|Lombardia|Marche|Molise|Piemonte|Puglia|Sardegna|Sicilia|Toscana|Trentino-Alto Adige|Umbria|Valle d'Aosta|Veneto",aStates[113]="|Clarendon|Hanover|Kingston|Manchester|Portland|Saint Andrew|Saint Ann|Saint Catherine|Saint Elizabeth|Saint James|Saint Mary|Saint Thomas|Trelawny|Westmoreland",aStates[114]="|Jan Mayen",aStates[115]="|Aichi|Akita|Aomori|Chiba|Ehime|Fukui|Fukuoka|Fukushima|Gifu|Gumma|Hiroshima|Hokkaido|Hyogo|Ibaraki|Ishikawa|Iwate|Kagawa|Kagoshima|Kanagawa|Kochi|Kumamoto|Kyoto|Mie|Miyagi|Miyazaki|Nagano|Nagasaki|Nara|Niigata|Oita|Okayama|Okinawa|Osaka|Saga|Saitama|Shiga|Shimane|Shizuoka|Tochigi|Tokushima|Tokyo|Tottori|Toyama|Wakayama|Yamagata|Yamaguchi|Yamanashi",aStates[116]="|Jarvis Island",aStates[117]="|Jersey",aStates[118]="|Johnston Atoll",aStates[119]="|'Amman|Ajlun|Al 'Aqabah|Al Balqa'|Al Karak|Al Mafraq|At Tafilah|Az Zarqa'|Irbid|Jarash|Ma'an|Madaba",aStates[120]="|Juan de Nova Island",aStates[121]="|Almaty|Aqmola|Aqtobe|Astana|Atyrau|Batys Qazaqstan|Bayqongyr|Mangghystau|Ongtustik Qazaqstan|Pavlodar|Qaraghandy|Qostanay|Qyzylorda|Shyghys Qazaqstan|Soltustik Qazaqstan|Zhambyl",aStates[122]="|Central|Coast|Eastern|Nairobi Area|North Eastern|Nyanza|Rift Valley|Western",aStates[123]="|Abaiang|Abemama|Aranuka|Arorae|Banaba|Banaba|Beru|Butaritari|Central Gilberts|Gilbert Islands|Kanton|Kiritimati|Kuria|Line Islands|Line Islands|Maiana|Makin|Marakei|Nikunau|Nonouti|Northern Gilberts|Onotoa|Phoenix Islands|Southern Gilberts|Tabiteuea|Tabuaeran|Tamana|Tarawa|Tarawa|Teraina",aStates[124]="|Chagang-do (Chagang Province)|Hamgyong-bukto (North Hamgyong Province)|Hamgyong-namdo (South Hamgyong Province)|Hwanghae-bukto (North Hwanghae Province)|Hwanghae-namdo (South Hwanghae Province)|Kaesong-si (Kaesong City)|Kangwon-do (Kangwon Province)|Namp'o-si (Namp'o City)|P'yongan-bukto (North P'yongan Province)|P'yongan-namdo (South P'yongan Province)|P'yongyang-si (P'yongyang City)|Yanggang-do (Yanggang Province)",aStates[125]="|Ch'ungch'ong-bukto|Ch'ungch'ong-namdo|Cheju-do|Cholla-bukto|Cholla-namdo|Inch'on-gwangyoksi|Kangwon-do|Kwangju-gwangyoksi|Kyonggi-do|Kyongsang-bukto|Kyongsang-namdo|Pusan-gwangyoksi|Soul-t'ukpyolsi|Taegu-gwangyoksi|Taejon-gwangyoksi|Ulsan-gwangyoksi",aStates[126]="|Al 'Asimah|Al Ahmadi|Al Farwaniyah|Al Jahra'|Hawalli",aStates[127]="|Batken Oblasty|Bishkek Shaary|Chuy Oblasty (Bishkek)|Jalal-Abad Oblasty|Naryn Oblasty|Osh Oblasty|Talas Oblasty|Ysyk-Kol Oblasty (Karakol)",aStates[128]="|Attapu|Bokeo|Bolikhamxai|Champasak|Houaphan|Khammouan|Louangnamtha|Louangphabang|Oudomxai|Phongsali|Salavan|Savannakhet|Viangchan|Viangchan|Xaignabouli|Xaisomboun|Xekong|Xiangkhoang",aStates[129]="|Aizkraukles Rajons|Aluksnes Rajons|Balvu Rajons|Bauskas Rajons|Cesu Rajons|Daugavpils|Daugavpils Rajons|Dobeles Rajons|Gulbenes Rajons|Jekabpils Rajons|Jelgava|Jelgavas Rajons|Jurmala|Kraslavas Rajons|Kuldigas Rajons|Leipaja|Liepajas Rajons|Limbazu Rajons|Ludzas Rajons|Madonas Rajons|Ogres Rajons|Preilu Rajons|Rezekne|Rezeknes Rajons|Riga|Rigas Rajons|Saldus Rajons|Talsu Rajons|Tukuma Rajons|Valkas Rajons|Valmieras Rajons|Ventspils|Ventspils Rajons",aStates[130]="|Beyrouth|Ech Chimal|Ej Jnoub|El Bekaa|Jabal Loubnane",aStates[131]="|Berea|Butha-Buthe|Leribe|Mafeteng|Maseru|Mohales Hoek|Mokhotlong|Qacha's Nek|Quthing|Thaba-Tseka",aStates[132]="|Bomi|Bong|Grand Bassa|Grand Cape Mount|Grand Gedeh|Grand Kru|Lofa|Margibi|Maryland|Montserrado|Nimba|River Cess|Sinoe",aStates[133]="|Ajdabiya|Al 'Aziziyah|Al Fatih|Al Jabal al Akhdar|Al Jufrah|Al Khums|Al Kufrah|An Nuqat al Khams|Ash Shati'|Awbari|Az Zawiyah|Banghazi|Darnah|Ghadamis|Gharyan|Misratah|Murzuq|Sabha|Sawfajjin|Surt|Tarabulus|Tarhunah|Tubruq|Yafran|Zlitan",aStates[134]="|Balzers|Eschen|Gamprin|Mauren|Planken|Ruggell|Schaan|Schellenberg|Triesen|Triesenberg|Vaduz",aStates[135]="|Akmenes Rajonas|Alytaus Rajonas|Alytus|Anyksciu Rajonas|Birstonas|Birzu Rajonas|Druskininkai|Ignalinos Rajonas|Jonavos Rajonas|Joniskio Rajonas|Jurbarko Rajonas|Kaisiadoriu Rajonas|Kaunas|Kauno Rajonas|Kedainiu Rajonas|Kelmes Rajonas|Klaipeda|Klaipedos Rajonas|Kretingos Rajonas|Kupiskio Rajonas|Lazdiju Rajonas|Marijampole|Marijampoles Rajonas|Mazeikiu Rajonas|Moletu Rajonas|Neringa Pakruojo Rajonas|Palanga|Panevezio Rajonas|Panevezys|Pasvalio Rajonas|Plunges Rajonas|Prienu Rajonas|Radviliskio Rajonas|Raseiniu Rajonas|Rokiskio Rajonas|Sakiu Rajonas|Salcininku Rajonas|Siauliai|Siauliu Rajonas|Silales Rajonas|Silutes Rajonas|Sirvintu Rajonas|Skuodo Rajonas|Svencioniu Rajonas|Taurages Rajonas|Telsiu Rajonas|Traku Rajonas|Ukmerges Rajonas|Utenos Rajonas|Varenos Rajonas|Vilkaviskio Rajonas|Vilniaus Rajonas|Vilnius|Zarasu Rajonas",aStates[136]="|Diekirch|Grevenmacher|Luxembourg",aStates[137]="|Macau",aStates[138]="|Aracinovo|Bac|Belcista|Berovo|Bistrica|Bitola|Blatec|Bogdanci|Bogomila|Bogovinje|Bosilovo|Brvenica|Cair (Skopje)|Capari|Caska|Cegrane|Centar (Skopje)|Centar Zupa|Cesinovo|Cucer-Sandevo|Debar|Delcevo|Delogozdi|Demir Hisar|Demir Kapija|Dobrusevo|Dolna Banjica|Dolneni|Dorce Petrov (Skopje)|Drugovo|Dzepciste|Gazi Baba (Skopje)|Gevgelija|Gostivar|Gradsko|Ilinden|Izvor|Jegunovce|Kamenjane|Karbinci|Karpos (Skopje)|Kavadarci|Kicevo|Kisela Voda (Skopje)|Klecevce|Kocani|Konce|Kondovo|Konopiste|Kosel|Kratovo|Kriva Palanka|Krivogastani|Krusevo|Kuklis|Kukurecani|Kumanovo|Labunista|Lipkovo|Lozovo|Lukovo|Makedonska Kamenica|Makedonski Brod|Mavrovi Anovi|Meseista|Miravci|Mogila|Murtino|Negotino|Negotino-Poloska|Novaci|Novo Selo|Oblesevo|Ohrid|Orasac|Orizari|Oslomej|Pehcevo|Petrovec|Plasnia|Podares|Prilep|Probistip|Radovis|Rankovce|Resen|Rosoman|Rostusa|Samokov|Saraj|Sipkovica|Sopiste|Sopotnika|Srbinovo|Star Dojran|Staravina|Staro Nagoricane|Stip|Struga|Strumica|Studenicani|Suto Orizari (Skopje)|Sveti Nikole|Tearce|Tetovo|Topolcani|Valandovo|Vasilevo|Veles|Velesta|Vevcani|Vinica|Vitoliste|Vranestica|Vrapciste|Vratnica|Vrutok|Zajas|Zelenikovo|Zileno|Zitose|Zletovo|Zrnovci",aStates[139]="|Antananarivo|Antsiranana|Fianarantsoa|Mahajanga|Toamasina|Toliara",aStates[140]="|Balaka|Blantyre|Chikwawa|Chiradzulu|Chitipa|Dedza|Dowa|Karonga|Kasungu|Likoma|Lilongwe|Machinga (Kasupe)|Mangochi|Mchinji|Mulanje|Mwanza|Mzimba|Nkhata Bay|Nkhotakota|Nsanje|Ntcheu|Ntchisi|Phalombe|Rumphi|Salima|Thyolo|Zomba",aStates[141]="|Johor|Kedah|Kelantan|Labuan|Melaka|Negeri Sembilan|Pahang|Perak|Perlis|Pulau Pinang|Sabah|Sarawak|Selangor|Terengganu|Wilayah Persekutuan",aStates[142]="|Alifu|Baa|Dhaalu|Faafu|Gaafu Alifu|Gaafu Dhaalu|Gnaviyani|Haa Alifu|Haa Dhaalu|Kaafu|Laamu|Lhaviyani|Maale|Meemu|Noonu|Raa|Seenu|Shaviyani|Thaa|Vaavu",aStates[143]="|Gao|Kayes|Kidal|Koulikoro|Mopti|Segou|Sikasso|Tombouctou",aStates[144]="|Valletta",aStates[145]="|Man, Isle of",aStates[146]="|Ailinginae|Ailinglaplap|Ailuk|Arno|Aur|Bikar|Bikini|Bokak|Ebon|Enewetak|Erikub|Jabat|Jaluit|Jemo|Kili|Kwajalein|Lae|Lib|Likiep|Majuro|Maloelap|Mejit|Mili|Namorik|Namu|Rongelap|Rongrik|Toke|Ujae|Ujelang|Utirik|Wotho|Wotje",aStates[147]="|Martinique",aStates[148]="|Adrar|Assaba|Brakna|Dakhlet Nouadhibou|Gorgol|Guidimaka|Hodh Ech Chargui|Hodh El Gharbi|Inchiri|Nouakchott|Tagant|Tiris Zemmour|Trarza",aStates[149]="|Agalega Islands|Black River|Cargados Carajos Shoals|Flacq|Grand Port|Moka|Pamplemousses|Plaines Wilhems|Port Louis|Riviere du Rempart|Rodrigues|Savanne",aStates[150]="|Mayotte",aStates[151]="|Aguascalientes|Baja California|Baja California Sur|Campeche|Chiapas|Chihuahua|Coahuila de Zaragoza|Colima|Distrito Federal|Durango|Guanajuato|Guerrero|Hidalgo|Jalisco|Mexico|Michoacan de Ocampo|Morelos|Nayarit|Nuevo Leon|Oaxaca|Puebla|Queretaro de Arteaga|Quintana Roo|San Luis Potosi|Sinaloa|Sonora|Tabasco|Tamaulipas|Tlaxcala|Veracruz-Llave|Yucatan|Zacatecas",aStates[152]="|Chuuk (Truk)|Kosrae|Pohnpei|Yap",aStates[153]="|Midway Islands",aStates[154]="|Balti|Cahul|Chisinau|Chisinau|Dubasari|Edinet|Gagauzia|Lapusna|Orhei|Soroca|Tighina|Ungheni"
+,aStates[155]="|Fontvieille|La Condamine|Monaco-Ville|Monte-Carlo",aStates[156]="|Arhangay|Bayan-Olgiy|Bayanhongor|Bulgan|Darhan|Dornod|Dornogovi|Dundgovi|Dzavhan|Erdenet|Govi-Altay|Hentiy|Hovd|Hovsgol|Omnogovi|Ovorhangay|Selenge|Suhbaatar|Tov|Ulaanbaatar|Uvs",aStates[157]="|Saint Anthony|Saint Georges|Saint Peter's",aStates[158]="|Agadir|Al Hoceima|Azilal|Ben Slimane|Beni Mellal|Boulemane|Casablanca|Chaouen|El Jadida|El Kelaa des Srarhna|Er Rachidia|Essaouira|Fes|Figuig|Guelmim|Ifrane|Kenitra|Khemisset|Khenifra|Khouribga|Laayoune|Larache|Marrakech|Meknes|Nador|Ouarzazate|Oujda|Rabat-Sale|Safi|Settat|Sidi Kacem|Tan-Tan|Tanger|Taounate|Taroudannt|Tata|Taza|Tetouan|Tiznit",aStates[159]="|Cabo Delgado|Gaza|Inhambane|Manica|Maputo|Nampula|Niassa|Sofala|Tete|Zambezia",aStates[160]="|Caprivi|Erongo|Hardap|Karas|Khomas|Kunene|Ohangwena|Okavango|Omaheke|Omusati|Oshana|Oshikoto|Otjozondjupa",aStates[161]="|Aiwo|Anabar|Anetan|Anibare|Baiti|Boe|Buada|Denigomodu|Ewa|Ijuw|Meneng|Nibok|Uaboe|Yaren",aStates[162]="|Bagmati|Bheri|Dhawalagiri|Gandaki|Janakpur|Karnali|Kosi|Lumbini|Mahakali|Mechi|Narayani|Rapti|Sagarmatha|Seti",aStates[163]="|Drenthe|Flevoland|Friesland|Gelderland|Groningen|Limburg|Noord-Brabant|Noord-Holland|Overijssel|Utrecht|Zeeland|Zuid-Holland",aStates[164]="|Netherlands Antilles",aStates[165]="|Iles Loyaute|Nord|Sud",aStates[166]="|Akaroa|Amuri|Ashburton|Bay of Islands|Bruce|Buller|Chatham Islands|Cheviot|Clifton|Clutha|Cook|Dannevirke|Egmont|Eketahuna|Ellesmere|Eltham|Eyre|Featherston|Franklin|Golden Bay|Great Barrier Island|Grey|Hauraki Plains|Hawera|Hawke's Bay|Heathcote|Hikurangi|Hobson|Hokianga|Horowhenua|Hurunui|Hutt|Inangahua|Inglewood|Kaikoura|Kairanga|Kiwitea|Lake|Mackenzie|Malvern|Manaia|Manawatu|Mangonui|Maniototo|Marlborough|Masterton|Matamata|Mount Herbert|Ohinemuri|Opotiki|Oroua|Otamatea|Otorohanga|Oxford|Pahiatua|Paparua|Patea|Piako|Pohangina|Raglan|Rangiora|Rangitikei|Rodney|Rotorua|Runanga|Saint Kilda|Silverpeaks|Southland|Stewart Island|Stratford|Strathallan|Taranaki|Taumarunui|Taupo|Tauranga|Thames-Coromandel|Tuapeka|Vincent|Waiapu|Waiheke|Waihemo|Waikato|Waikohu|Waimairi|Waimarino|Waimate|Waimate West|Waimea|Waipa|Waipawa|Waipukurau|Wairarapa South|Wairewa|Wairoa|Waitaki|Waitomo|Waitotara|Wallace|Wanganui|Waverley|Westland|Whakatane|Whangarei|Whangaroa|Woodville",aStates[167]="|Atlantico Norte|Atlantico Sur|Boaco|Carazo|Chinandega|Chontales|Esteli|Granada|Jinotega|Leon|Madriz|Managua|Masaya|Matagalpa|Nueva Segovia|Rio San Juan|Rivas",aStates[168]="|Agadez|Diffa|Dosso|Maradi|Niamey|Tahoua|Tillaberi|Zinder",aStates[169]="|Abia|Abuja Federal Capital Territory|Adamawa|Akwa Ibom|Anambra|Bauchi|Bayelsa|Benue|Borno|Cross River|Delta|Ebonyi|Edo|Ekiti|Enugu|Gombe|Imo|Jigawa|Kaduna|Kano|Katsina|Kebbi|Kogi|Kwara|Lagos|Nassarawa|Niger|Ogun|Ondo|Osun|Oyo|Plateau|Rivers|Sokoto|Taraba|Yobe|Zamfara",aStates[170]="|Niue",aStates[171]="|Norfolk Island",aStates[172]="|Northern Islands|Rota|Saipan|Tinian",aStates[173]="|Akershus|Aust-Agder|Buskerud|Finnmark|Hedmark|Hordaland|More og Romsdal|Nord-Trondelag|Nordland|Oppland|Oslo|Ostfold|Rogaland|Sogn og Fjordane|Sor-Trondelag|Telemark|Troms|Vest-Agder|Vestfold",aStates[174]="|Ad Dakhiliyah|Al Batinah|Al Wusta|Ash Sharqiyah|Az Zahirah|Masqat|Musandam|Zufar",aStates[175]="|Balochistan|Federally Administered Tribal Areas|Islamabad Capital Territory|North-West Frontier Province|Punjab|Sindh",aStates[176]="|Aimeliik|Airai|Angaur|Hatobohei|Kayangel|Koror|Melekeok|Ngaraard|Ngarchelong|Ngardmau|Ngatpang|Ngchesar|Ngeremlengui|Ngiwal|Palau Island|Peleliu|Sonsoral|Tobi",aStates[177]="|Bocas del Toro|Chiriqui|Cocle|Colon|Darien|Herrera|Los Santos|Panama|San Blas|Veraguas",aStates[178]="|Bougainville|Central|Chimbu|East New Britain|East Sepik|Eastern Highlands|Enga|Gulf|Madang|Manus|Milne Bay|Morobe|National Capital|New Ireland|Northern|Sandaun|Southern Highlands|West New Britain|Western|Western Highlands",aStates[179]="|Alto Paraguay|Alto Parana|Amambay|Asuncion (city)|Boqueron|Caaguazu|Caazapa|Canindeyu|Central|Concepcion|Cordillera|Guaira|Itapua|Misiones|Neembucu|Paraguari|Presidente Hayes|San Pedro",aStates[180]="|Amazonas|Ancash|Apurimac|Arequipa|Ayacucho|Cajamarca|Callao|Cusco|Huancavelica|Huanuco|Ica|Junin|La Libertad|Lambayeque|Lima|Loreto|Madre de Dios|Moquegua|Pasco|Piura|Puno|San Martin|Tacna|Tumbes|Ucayali",aStates[181]="|Abra|Agusan del Norte|Agusan del Sur|Aklan|Albay|Angeles|Antique|Aurora|Bacolod|Bago|Baguio|Bais|Basilan|Basilan City|Bataan|Batanes|Batangas|Batangas City|Benguet|Bohol|Bukidnon|Bulacan|Butuan|Cabanatuan|Cadiz|Cagayan|Cagayan de Oro|Calbayog|Caloocan|Camarines Norte|Camarines Sur|Camiguin|Canlaon|Capiz|Catanduanes|Cavite|Cavite City|Cebu|Cebu City|Cotabato|Dagupan|Danao|Dapitan|Davao City Davao|Davao del Sur|Davao Oriental|Dipolog|Dumaguete|Eastern Samar|General Santos|Gingoog|Ifugao|Iligan|Ilocos Norte|Ilocos Sur|Iloilo|Iloilo City|Iriga|Isabela|Kalinga-Apayao|La Carlota|La Union|Laguna|Lanao del Norte|Lanao del Sur|Laoag|Lapu-Lapu|Legaspi|Leyte|Lipa|Lucena|Maguindanao|Mandaue|Manila|Marawi|Marinduque|Masbate|Mindoro Occidental|Mindoro Oriental|Misamis Occidental|Misamis Oriental|Mountain|Naga|Negros Occidental|Negros Oriental|North Cotabato|Northern Samar|Nueva Ecija|Nueva Vizcaya|Olongapo|Ormoc|Oroquieta|Ozamis|Pagadian|Palawan|Palayan|Pampanga|Pangasinan|Pasay|Puerto Princesa|Quezon|Quezon City|Quirino|Rizal|Romblon|Roxas|Samar|San Carlos (in Negros Occidental)|San Carlos (in Pangasinan)|San Jose|San Pablo|Silay|Siquijor|Sorsogon|South Cotabato|Southern Leyte|Sultan Kudarat|Sulu|Surigao|Surigao del Norte|Surigao del Sur|Tacloban|Tagaytay|Tagbilaran|Tangub|Tarlac|Tawitawi|Toledo|Trece Martires|Zambales|Zamboanga|Zamboanga del Norte|Zamboanga del Sur",aStates[182]="|Pitcaim Islands",aStates[183]="|Dolnoslaskie|Kujawsko-Pomorskie|Lodzkie|Lubelskie|Lubuskie|Malopolskie|Mazowieckie|Opolskie|Podkarpackie|Podlaskie|Pomorskie|Slaskie|Swietokrzyskie|Warminsko-Mazurskie|Wielkopolskie|Zachodniopomorskie",aStates[184]="|Acores (Azores)|Aveiro|Beja|Braga|Braganca|Castelo Branco|Coimbra|Evora|Faro|Guarda|Leiria|Lisboa|Madeira|Portalegre|Porto|Santarem|Setubal|Viana do Castelo|Vila Real|Viseu",aStates[185]="|Adjuntas|Aguada|Aguadilla|Aguas Buenas|Aibonito|Anasco|Arecibo|Arroyo|Barceloneta|Barranquitas|Bayamon|Cabo Rojo|Caguas|Camuy|Canovanas|Carolina|Catano|Cayey|Ceiba|Ciales|Cidra|Coamo|Comerio|Corozal|Culebra|Dorado|Fajardo|Florida|Guanica|Guayama|Guayanilla|Guaynabo|Gurabo|Hatillo|Hormigueros|Humacao|Isabela|Jayuya|Juana Diaz|Juncos|Lajas|Lares|Las Marias|Las Piedras|Loiza|Luquillo|Manati|Maricao|Maunabo|Mayaguez|Moca|Morovis|Naguabo|Naranjito|Orocovis|Patillas|Penuelas|Ponce|Quebradillas|Rincon|Rio Grande|Sabana Grande|Salinas|San German|San Juan|San Lorenzo|San Sebastian|Santa Isabel|Toa Alta|Toa Baja|Trujillo Alto|Utuado|Vega Alta|Vega Baja|Vieques|Villalba|Yabucoa|Yauco",aStates[186]="|Ad Dawhah|Al Ghuwayriyah|Al Jumayliyah|Al Khawr|Al Wakrah|Ar Rayyan|Jarayan al Batinah|Madinat ash Shamal|Umm Salal",aStates[187]="|Reunion",aStates[188]="|Alba|Arad|Arges|Bacau|Bihor|Bistrita-Nasaud|Botosani|Braila|Brasov|Bucuresti|Buzau|Calarasi|Caras-Severin|Cluj|Constanta|Covasna|Dimbovita|Dolj|Galati|Giurgiu|Gorj|Harghita|Hunedoara|Ialomita|Iasi|Maramures|Mehedinti|Mures|Neamt|Olt|Prahova|Salaj|Satu Mare|Sibiu|Suceava|Teleorman|Timis|Tulcea|Vaslui|Vilcea|Vrancea",aStates[189]="|Adygeya (Maykop)|Aginskiy Buryatskiy (Aginskoye)|Altay (Gorno-Altaysk)|Altayskiy (Barnaul)|Amurskaya (Blagoveshchensk)|Arkhangel'skaya|Astrakhanskaya|Bashkortostan (Ufa)|Belgorodskaya|Bryanskaya|Buryatiya (Ulan-Ude)|Chechnya (Groznyy)|Chelyabinskaya|Chitinskaya|Chukotskiy (Anadyr')|Chuvashiya (Cheboksary)|Dagestan (Makhachkala)|Evenkiyskiy (Tura)|Ingushetiya (Nazran')|Irkutskaya|Ivanovskaya|Kabardino-Balkariya (Nal'chik)|Kaliningradskaya|Kalmykiya (Elista)|Kaluzhskaya|Kamchatskaya (Petropavlovsk-Kamchatskiy)|Karachayevo-Cherkesiya (Cherkessk)|Kareliya (Petrozavodsk)|Kemerovskaya|Khabarovskiy|Khakasiya (Abakan)|Khanty-Mansiyskiy (Khanty-Mansiysk)|Kirovskaya|Komi (Syktyvkar)|Komi-Permyatskiy (Kudymkar)|Koryakskiy (Palana)|Kostromskaya|Krasnodarskiy|Krasnoyarskiy|Kurganskaya|Kurskaya|Leningradskaya|Lipetskaya|Magadanskaya|Mariy-El (Yoshkar-Ola)|Mordoviya (Saransk)|Moskovskaya|Moskva (Moscow)|Murmanskaya|Nenetskiy (Nar'yan-Mar)|Nizhegorodskaya|Novgorodskaya|Novosibirskaya|Omskaya|Orenburgskaya|Orlovskaya (Orel)|Penzenskaya|Permskaya|Primorskiy (Vladivostok)|Pskovskaya|Rostovskaya|Ryazanskaya|Sakha (Yakutsk)|Sakhalinskaya (Yuzhno-Sakhalinsk)|Samarskaya|Sankt-Peterburg (Saint Petersburg)|Saratovskaya|Severnaya Osetiya-Alaniya [North Ossetia] (Vladikavkaz)|Smolenskaya|Stavropol'skiy|Sverdlovskaya (Yekaterinburg)|Tambovskaya|Tatarstan (Kazan')|Taymyrskiy (Dudinka)|Tomskaya|Tul'skaya|Tverskaya|Tyumenskaya|Tyva (Kyzyl)|Udmurtiya (Izhevsk)|Ul'yanovskaya|Ust'-Ordynskiy Buryatskiy (Ust'-Ordynskiy)|Vladimirskaya|Volgogradskaya|Vologodskaya|Voronezhskaya|Yamalo-Nenetskiy (Salekhard)|Yaroslavskaya|Yevreyskaya",aStates[190]="|Butare|Byumba|Cyangugu|Gikongoro|Gisenyi|Gitarama|Kibungo|Kibuye|Kigali Rurale|Kigali-ville|Ruhengeri|Umutara",aStates[191]="|Ascension|Saint Helena|Tristan da Cunha",aStates[192]="|Christ Church Nichola Town|Saint Anne Sandy Point|Saint George Basseterre|Saint George Gingerland|Saint James Windward|Saint John Capisterre|Saint John Figtree|Saint Mary Cayon|Saint Paul Capisterre|Saint Paul Charlestown|Saint Peter Basseterre|Saint Thomas Lowland|Saint Thomas Middle Island|Trinity Palmetto Point",aStates[193]="|Anse-la-Raye|Castries|Choiseul|Dauphin|Dennery|Gros Islet|Laborie|Micoud|Praslin|Soufriere|Vieux Fort",aStates[194]="|Miquelon|Saint Pierre",aStates[195]="|Charlotte|Grenadines|Saint Andrew|Saint David|Saint George|Saint Patrick",aStates[196]="|A'ana|Aiga-i-le-Tai|Atua|Fa'asaleleaga|Gaga'emauga|Gagaifomauga|Palauli|Satupa'itea|Tuamasaga|Va'a-o-Fonoti|Vaisigano",aStates[197]="|Acquaviva|Borgo Maggiore|Chiesanuova|Domagnano|Faetano|Fiorentino|Monte Giardino|San Marino|Serravalle",aStates[198]="|Principe|Sao Tome",aStates[199]="|'Asir|Al Bahah|Al Hudud ash Shamaliyah|Al Jawf|Al Madinah|Al Qasim|Ar Riyad|Ash Sharqiyah (Eastern Province)|Ha'il|Jizan|Makkah|Najran|Tabuk",aStates[200]="|Aberdeenshire|Angus|Argyll|Ayrshire|Banffshire|Berwickshire|Bute|Caithness|Clackmannanshire|Cromartyshire|Dumfriesshire|Dunbartonshire|Dundee City|East Lothian|Edinburgh|Fife|Glasgow City|Inverness-shire|Kincardineshire|Kinross-shire|Kirkcudbrightshire|Lanarkshire|Midlothian|Moray|Nairnshire|Orkney Islands|Peeblesshire|Perthshire|Renfrewshire|Ross and Cromarty|Ross-shire|Roxburghshire|Selkirkshire|Shetland Islands|Stirlingshire|Sutherland|West Lothian|Wigtownshire",aStates[201]="|Dakar|Diourbel|Fatick|Kaolack|Kolda|Louga|Saint-Louis|Tambacounda|Thies|Ziguinchor",aStates[202]="|Anse aux Pins|Anse Boileau|Anse Etoile|Anse Louis|Anse Royale|Baie Lazare|Baie Sainte Anne|Beau Vallon|Bel Air|Bel Ombre|Cascade|Glacis|Grand' Anse (on Mahe)|Grand' Anse (on Praslin)|La Digue|La Riviere Anglaise|Mont Buxton|Mont Fleuri|Plaisance|Pointe La Rue|Port Glaud|Saint Louis|Takamaka",aStates[203]="|Eastern|Northern|Southern|Western",aStates[204]="|Singapore",aStates[205]="|Banskobystricky|Bratislavsky|Kosicky|Nitriansky|Presovsky|Trenciansky|Trnavsky|Zilinsky",aStates[206]="|Ajdovscina|Beltinci|Bled|Bohinj|Borovnica|Bovec|Brda|Brezice|Brezovica|Cankova-Tisina|Celje|Cerklje na Gorenjskem|Cerknica|Cerkno|Crensovci|Crna na Koroskem|Crnomelj|Destrnik-Trnovska Vas|Divaca|Dobrepolje|Dobrova-Horjul-Polhov Gradec|Dol pri Ljubljani|Domzale|Dornava|Dravograd|Duplek|Gorenja Vas-Poljane|Gorisnica|Gornja Radgona|Gornji Grad|Gornji Petrovci|Grosuplje|Hodos Salovci|Hrastnik|Hrpelje-Kozina|Idrija|Ig|Ilirska Bistrica|Ivancna Gorica|Izola|Jesenice|Jursinci|Kamnik|Kanal|Kidricevo|Kobarid|Kobilje|Kocevje|Komen|Koper|Kozje|Kranj|Kranjska Gora|Krsko|Kungota|Kuzma|Lasko|Lenart|Lendava|Litija|Ljubljana|Ljubno|Ljutomer|Logatec|Loska Dolina|Loski Potok|Luce|Lukovica|Majsperk|Maribor|Medvode|Menges|Metlika|Mezica|Miren-Kostanjevica|Mislinja|Moravce|Moravske Toplice|Mozirje|Murska Sobota|Muta|Naklo|Nazarje|Nova Gorica|Novo Mesto|Odranci|Ormoz|Osilnica|Pesnica|Piran|Pivka|Podcetrtek|Podvelka-Ribnica|Postojna|Preddvor|Ptuj|Puconci|Race-Fram|Radece|Radenci|Radlje ob Dravi|Radovljica|Ravne-Prevalje|Ribnica|Rogasevci|Rogaska Slatina|Rogatec|Ruse|Semic|Sencur|Sentilj|Sentjernej|Sentjur pri Celju|Sevnica|Sezana|Skocjan|Skofja Loka|Skofljica|Slovenj Gradec|Slovenska Bistrica|Slovenske Konjice|Smarje pri Jelsah|Smartno ob Paki|Sostanj|Starse|Store|Sveti Jurij|Tolmin|Trbovlje|Trebnje|Trzic|Turnisce|Velenje|Velike Lasce|Videm|Vipava|Vitanje|Vodice|Vojnik|Vrhnika|Vuzenica|Zagorje ob Savi|Zalec|Zavrc|Zelezniki|Ziri|Zrece",aStates[207]="|Bellona|Central|Choiseul (Lauru)|Guadalcanal|Honiara|Isabel|Makira|Malaita|Rennell|Temotu|Western",aStates[208]="|Awdal|Bakool|Banaadir|Bari|Bay|Galguduud|Gedo|Hiiraan|Jubbada Dhexe|Jubbada Hoose|Mudug|Nugaal|Sanaag|Shabeellaha Dhexe|Shabeellaha Hoose|Sool|Togdheer|Woqooyi Galbeed",aStates[209]="|Eastern Cape|Free State|Gauteng|KwaZulu-Natal|Mpumalanga|North-West|Northern Cape|Northern Province|Western Cape",aStates[210]="|Bird Island|Bristol Island|Clerke Rocks|Montagu Island|Saunders Island|South Georgia|Southern Thule|Traversay Islands",aStates[211]="|Andalucia|Aragon|Asturias|Ceuta|Islas Baleares|Islas Chafarinas|Islas Canarias|Cantabria|Castilla y Leon|Castilla-La Mancha|Catalunya|Extremadura|Galicia|La Rioja|Madrid|Melilla|Murcia|Navarra|Pais Vasco|Peñón de Alhucemas|Peñón de Vélez de la Gomera|Valencia",aStates[212]="|Spratly Islands",aStates[213]="|Central|Eastern|North Central|North Eastern|North Western|Northern|Sabaragamuwa|Southern|Uva|Western",aStates[214]="|A'ali an Nil|Al Bahr al Ahmar|Al Buhayrat|Al Jazirah|Al Khartum|Al Qadarif|Al Wahdah|An Nil al Abyad|An Nil al Azraq|Ash Shamaliyah|Bahr al Jabal|Gharb al Istiwa'iyah|Gharb Bahr al Ghazal|Gharb Darfur|Gharb Kurdufan|Janub Darfur|Janub Kurdufan|Junqali|Kassala|Nahr an Nil|Shamal Bahr al Ghazal|Shamal Darfur|Shamal Kurdufan|Sharq al Istiwa'iyah|Sinnar|Warab",aStates[215]="|Brokopondo|Commewijne|Coronie|Marowijne|Nickerie|Para|Paramaribo|Saramacca|Sipaliwini|Wanica",aStates[216]="|Barentsoya|Bjornoya|Edgeoya|Hopen|Kvitoya|Nordaustandet|Prins Karls Forland|Spitsbergen",aStates[217]="|Hhohho|Lubombo|Manzini|Shiselweni",aStates[218]="|Blekinge|Dalarnas|Gavleborgs|Gotlands|Hallands|Jamtlands|Jonkopings|Kalmar|Kronobergs|Norrbottens|Orebro|Ostergotlands|Skane|Sodermanlands|Stockholms|Uppsala|Varmlands|Vasterbottens|Vasternorrlands|Vastmanlands|Vastra Gotalands",aStates[219]="|Aargau|Ausser-Rhoden|Basel-Landschaft|Basel-Stadt|Bern|Fribourg|Geneve|Glarus|Graubunden|Inner-Rhoden|Jura|Luzern|Neuchatel|Nidwalden|Obwalden|Sankt Gallen|Schaffhausen|Schwyz|Solothurn|Thurgau|Ticino|Uri|Valais|Vaud|Zug|Zurich",aStates[220]="|Al Hasakah|Al Ladhiqiyah|Al Qunaytirah|Ar Raqqah|As Suwayda'|Dar'a|Dayr az Zawr|Dimashq|Halab|Hamah|Hims|Idlib|Rif Dimashq|Tartus",aStates[221]="|Chang-hua|Chi-lung|Chia-i|Chia-i|Chung-hsing-hsin-ts'un|Hsin-chu|Hsin-chu|Hua-lien|I-lan|Kao-hsiung|Kao-hsiung|Miao-li|Nan-t'ou|P'eng-hu|P'ing-tung|T'ai-chung|T'ai-chung|T'ai-nan|T'ai-nan|T'ai-pei|T'ai-pei|T'ai-tung|T'ao-yuan|Yun-lin",aStates[222]="|Viloyati Khatlon|Viloyati Leninobod|Viloyati Mukhtori Kuhistoni Badakhshon",aStates[223]="|Arusha|Dar es Salaam|Dodoma|Iringa|Kagera|Kigoma|Kilimanjaro|Lindi|Mara|Mbeya|Morogoro|Mtwara|Mwanza|Pemba North|Pemba South|Pwani|Rukwa|Ruvuma|Shinyanga|Singida|Tabora|Tanga|Zanzibar Central/South|Zanzibar North|Zanzibar Urban/West",aStates[224]="|Amnat Charoen|Ang Thong|Buriram|Chachoengsao|Chai Nat|Chaiyaphum|Chanthaburi|Chiang Mai|Chiang Rai|Chon Buri|Chumphon|Kalasin|Kamphaeng Phet|Kanchanaburi|Khon Kaen|Krabi|Krung Thep Mahanakhon (Bangkok)|Lampang|Lamphun|Loei|Lop Buri|Mae Hong Son|Maha Sarakham|Mukdahan|Nakhon Nayok|Nakhon Pathom|Nakhon Phanom|Nakhon Ratchasima|Nakhon Sawan|Nakhon Si Thammarat|Nan|Narathiwat|Nong Bua Lamphu|Nong Khai|Nonthaburi|Pathum Thani|Pattani|Phangnga|Phatthalung|Phayao|Phetchabun|Phetchaburi|Phichit|Phitsanulok|Phra Nakhon Si Ayutthaya|Phrae|Phuket|Prachin Buri|Prachuap Khiri Khan|Ranong|Ratchaburi|Rayong|Roi Et|Sa Kaeo|Sakon Nakhon|Samut Prakan|Samut Sakhon|Samut Songkhram|Sara Buri|Satun|Sing Buri|Sisaket|Songkhla|Sukhothai|Suphan Buri|Surat Thani|Surin|Tak|Trang|Trat|Ubon Ratchathani|Udon Thani|Uthai Thani|Uttaradit|Yala|Yasothon",aStates[225]="|Tobago",aStates[226]="|De La Kara|Des Plateaux|Des Savanes|Du Centre|Maritime",aStates[227]="|Atafu|Fakaofo|Nukunonu",aStates[228]="|Ha'apai|Tongatapu|Vava'u",aStates[229]="|Arima|Caroni|Mayaro|Nariva|Port-of-Spain|Saint Andrew|Saint David|Saint George|Saint Patrick|San Fernando|Victoria",aStates[230]="|Ariana|Beja|Ben Arous|Bizerte|El Kef|Gabes|Gafsa|Jendouba|Kairouan|Kasserine|Kebili|Mahdia|Medenine|Monastir|Nabeul|Sfax|Sidi Bou Zid|Siliana|Sousse|Tataouine|Tozeur|Tunis|Zaghouan",aStates[231]="|Adana|Adiyaman|Afyon|Agri|Aksaray|Amasya|Ankara|Antalya|Ardahan|Artvin|Aydin|Balikesir|Bartin|Batman|Bayburt|Bilecik|Bingol|Bitlis|Bolu|Burdur|Bursa|Canakkale|Cankiri|Corum|Denizli|Diyarbakir|Duzce|Edirne|Elazig|Erzincan|Erzurum|Eskisehir|Gaziantep|Giresun|Gumushane|Hakkari|Hatay|Icel|Igdir|Isparta|Istanbul|Izmir|Kahramanmaras|Karabuk|Karaman|Kars|Kastamonu|Kayseri|Kilis|Kirikkale|Kirklareli|Kirsehir|Kocaeli|Konya|Kutahya|Malatya|Manisa|Mardin|Mugla|Mus|Nevsehir|Nigde|Ordu|Osmaniye|Rize|Sakarya|Samsun|Sanliurfa|Siirt|Sinop|Sirnak|Sivas|Tekirdag|Tokat|Trabzon|Tunceli|Usak|Van|Yalova|Yozgat|Zonguldak",aStates[232]="|Ahal Welayaty|Balkan Welayaty|Dashhowuz Welayaty|Lebap Welayaty|Mary Welayaty",aStates[233]="|Tuvalu",aStates[234]="|Adjumani|Apac|Arua|Bugiri|Bundibugyo|Bushenyi|Busia|Gulu|Hoima|Iganga|Jinja|Kabale|Kabarole|Kalangala|Kampala|Kamuli|Kapchorwa|Kasese|Katakwi|Kibale|Kiboga|Kisoro|Kitgum|Kotido|Kumi|Lira|Luwero|Masaka|Masindi|Mbale|Mbarara|Moroto|Moyo|Mpigi|Mubende|Mukono|Nakasongola|Nebbi|Ntungamo|Pallisa|Rakai|Rukungiri|Sembabule|Soroti|Tororo",aStates[235]="|Avtonomna Respublika Krym (Simferopol')|Cherkas'ka (Cherkasy)|Chernihivs'ka (Chernihiv)|Chernivets'ka (Chernivtsi)|Dnipropetrovs'ka (Dnipropetrovs'k)|Donets'ka (Donets'k)|Ivano-Frankivs'ka (Ivano-Frankivs'k)|Kharkivs'ka (Kharkiv)|Khersons'ka (Kherson)|Khmel'nyts'ka (Khmel'nyts'kyy)|Kirovohrads'ka (Kirovohrad)|Kyyiv|Kyyivs'ka (Kiev)|L'vivs'ka (L'viv)|Luhans'ka (Luhans'k)|Mykolayivs'ka (Mykolayiv)|Odes'ka (Odesa)|Poltavs'ka (Poltava)|Rivnens'ka (Rivne)|Sevastopol'|Sums'ka (Sumy)|Ternopil's'ka (Ternopil')|Vinnyts'ka (Vinnytsya)|Volyns'ka (Luts'k)|Zakarpats'ka (Uzhhorod)|Zaporiz'ka (Zaporizhzhya)|Zhytomyrs'ka (Zhytomyr)",aStates[236]="|'Ajman|Abu Zaby (Abu Dhabi)|Al Fujayrah|Ash Shariqah (Sharjah)|Dubayy (Dubai)|Ra's al Khaymah|Umm al Qaywayn",aStates[237]="|Aberdeen|Aberdeenshire|Anglesey|Angus|Antrim|Argyl|Armagh|Avon|Ayrshire|Banffshire|Bedfordshire|Belfast|Berwickshire|Brecknockshire|Bristol|Buckinghamshire|Bute|Caernarfonshire|Cardiganshire|Caithness|Cambridgeshire|Carmarthenshire|Chesire|Clackmannashire|Cleveland|Clwyd|Cornwall|Cromartyshire|Cumberland|Cumbria|Denbighshire|Derbyshire|Devon|Dfyed|Dorset|Down|Dumfriesshire|Dunbartonshire|Dundee|Durham|East Lothian|East Suffolk|Derry|East Sussex|Edinburgh|Essex|Fermanagh|Fife|Flintshire|Glasgow|Glamorgan|Gloucestershire|Greater London|Greater Manchester|Gwent|Gwynedd|Hampshire|Hereford and Worcester|Herefordshire|Inverness-shire|Hertfordshire|Humberside|Huntingdon and Peterborough|Huntingdonshire|Isle of Ely|Isle of Wight|Kent|Kincardineshire|Kincross-shire|Kirkcudbrightshire|Lanarkshire|Lancashire|Leicestershire|Lincolnshire|London|Londonderry|Merionethshire|Merseyside|Middlesex|Mid Glamorgan|Midlothian|Monmouthshire|Montgomeryshire|Moray|Nairnshire|Norfolk|Northamptonshire|Northumberland|North Humberside|North Yorkshire|Nottinghamshire|Orkney|Oxfordshire|Peeblesshire|Pembrokeshire|Perthshire|Powys|Radnorshire|Renfrewshire|Ross And Cromarty|Ross-shire|Roxburghshire|Selkirkshire|Shetland|Stirlingshire|Sutherland|Soke of Peterborough|Rutland|Shropshire|Somerset|South Glamorgan|South Humberside|South Yorkshire|Staffordshite|Suffolk|Surrey|Sussex|Tyne and Wear|Tyrone|Warwickshire|West Glamorgan|West Lothian|West Midlands|Westmorland|West Suffolk|West Sussex|West Yorkshire|Wigtownshire|Wiltshire|Worcestershire|Yorkshire",aStates[238]="|Artigas|Canelones|Cerro Largo|Colonia|Durazno|Flores|Florida|Lavalleja|Maldonado|Montevideo|Paysandu|Rio Negro|Rivera|Rocha|Salto|San Jose|Soriano|Tacuarembo|Treinta y Tres",aStates[239]="|Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|District of Columbia|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming",aStates[240]="|Andijon Wiloyati|Bukhoro Wiloyati|Farghona Wiloyati|Jizzakh Wiloyati|Khorazm Wiloyati (Urganch)|Namangan Wiloyati|Nawoiy Wiloyati|Qashqadaryo Wiloyati (Qarshi)|Qoraqalpoghiston (Nukus)|Samarqand Wiloyati|Sirdaryo Wiloyati (Guliston)|Surkhondaryo Wiloyati (Termiz)|Toshkent Shahri|Toshkent Wiloyati",aStates[241]="|Malampa|Penama|Sanma|Shefa|Tafea|Torba",aStates[242]="|Amazonas|Anzoategui|Apure|Aragua|Barinas|Bolivar|Carabobo|Cojedes|Delta Amacuro|Dependencias Federales|Distrito Federal|Falcon|Guarico|Lara|Merida|Miranda|Monagas|Nueva Esparta|Portuguesa|Sucre|Tachira|Trujillo|Vargas|Yaracuy|Zulia",aStates[243]="|An Giang|Ba Ria-Vung Tau|Bac Giang|Bac Kan|Bac Lieu|Bac Ninh|Ben Tre|Binh Dinh|Binh Duong|Binh Phuoc|Binh Thuan|Ca Mau|Can Tho|Cao Bang|Da Nang|Dac Lak|Dong Nai|Dong Thap|Gia Lai|Ha Giang|Ha Nam|Ha Noi|Ha Tay|Ha Tinh|Hai Duong|Hai Phong|Ho Chi Minh|Hoa Binh|Hung Yen|Khanh Hoa|Kien Giang|Kon Tum|Lai Chau|Lam Dong|Lang Son|Lao Cai|Long An|Nam Dinh|Nghe An|Ninh Binh|Ninh Thuan|Phu Tho|Phu Yen|Quang Binh|Quang Nam|Quang Ngai|Quang Ninh|Quang Tri|Soc Trang|Son La|Tay Ninh|Thai Binh|Thai Nguyen|Thanh Hoa|Thua Thien-Hue|Tien Giang|Tra Vinh|Tuyen Quang|Vinh Long|Vinh Phuc|Yen Bai",aStates[244]="|Saint Croix|Saint John|Saint Thomas",aStates[245]="|Anglesey|Brecknockshire|Caernfonshire|Cardiganshire|Carmarthenshire|Clwyd|Denbighshire|Dyfed|Flintshire|Glamorgan|Gwent|Gwynedd|Merionethshire|Mid Glamorgan|Monmouthsire|Montgomeryshire|Pembrokeshire|Powys|Radnorshire|South Glamorgan|West Glamorgan",aStates[246]="|Alo|Sigave|Wallis",aStates[247]="|West Bank",aStates[248]="|Western Sahara",aStates[249]="|'Adan|'Ataq|Abyan|Al Bayda'|Al Hudaydah|Al Jawf|Al Mahrah|Al Mahwit|Dhamar|Hadhramawt|Hajjah|Ibb|Lahij|Ma'rib|Sa'dah|San'a'|Ta'izz",aStates[250]="|Kosovo|Montenegro|Serbia|Vojvodina",aStates[251]="|Central|Copperbelt|Eastern|Luapula|Lusaka|North-Western|Northern|Southern|Western",aStates[252]="|Bulawayo|Harare|ManicalandMashonaland Central|Mashonaland East|Mashonaland West|Masvingo|Matabeleland North|Matabeleland South|Midlands",aStates[253]="|Self Hosted|Private Server|Architects Of Sleep|DFRN|Distributed Friend Network|Free-Beer.ch|Foojbook|Free-Haven|Friendica.eu|Friendika.me.4.it|Friendika - I Ask Questions|Frndc.com|Hikado|Hipatia|Hungerfreunde|Kaluguran Community|Kak Ste?|Karl.Markx.pm|Loozah Social Club|MyFriendica.net|MyFriendNetwork|Oi!|OpenMindSpace|Recolutionari.es|SPRACI|Sysfu Social Club|theshi.re|Tumpambae|Uzmiac|Other",gLngNumberCountries=sCountryString.split("|").length,gArCountryInfo=sCountryString.split("|"),gArStateInfo=new Array(gLngNumberCountries);
\ No newline at end of file
--- /dev/null
+/**
+ * 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);
\ No newline at end of file
--- /dev/null
+/* 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);
\ No newline at end of file
--- /dev/null
+function openClose(e){document.getElementById(e).style.display=="block"?document.getElementById(e).style.display="none":document.getElementById(e).style.display="block"}function openMenu(e){document.getElementById(e).style.display="block"}function closeMenu(e){document.getElementById(e).style.display="none"}function NavUpdate(){if(!stopped){var e="ping"+(localUser!=0?"?f=&uid="+localUser:"");$.get(e,function(e){$(e).find("result").each(function(){$("nav").trigger("nav-update",this),$("#live-network").length&&(src="network",liveUpdate()),$("#live-profile").length&&(src="profile",liveUpdate()),$("#live-community").length&&(src="community",liveUpdate()),$("#live-notes").length&&(src="notes",liveUpdate()),$("#live-display").length&&liking&&(liking=0,window.location.href=window.location.href),$("#live-photos").length&&liking&&(liking=0,window.location.href=window.location.href)})})}timer=setTimeout(NavUpdate,updateInterval)}function liveUpdate(){if(src==null||stopped||!profile_uid){$(".like-rotator").hide();return}if($(".comment-edit-text-full").length||in_progress){livetime&&clearTimeout(livetime),livetime=setTimeout(liveUpdate,1e4);return}livetime!=null&&(livetime=null),prev="live-"+src,in_progress=!0;var e=netargs.length?"/"+netargs:"",t="update_"+src+e+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$.get(t,function(e){in_progress=!1,$(".tread-wrapper",e).each(function(){var e=$(this).attr("id");$("#"+e).length==0&&profile_page==1?($("img",this).each(function(){$(this).attr("src",$(this).attr("dst"))}),$("#"+prev).after($(this))):($("img",this).each(function(){$(this).attr("src",$(this).attr("dst"))}),$("#"+e).replaceWith($(this))),prev=e}),$(".like-rotator").hide(),commentBusy&&(commentBusy=!1,$("body").css("cursor","auto")),$(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl")})}function imgbright(e){$(e).removeClass("drophide").addClass("drop")}function imgdull(e){$(e).removeClass("drop").addClass("drophide")}function dolike(e,t){unpause(),$("#like-rotator-"+e.toString()).show(),$.get("like/"+e.toString()+"?verb="+t,NavUpdate),liking=1}function dostar(e){e=e.toString(),$("#like-rotator-"+e).show(),$.get("starred/"+e,function(t){t.match(/1/)?($("#starred-"+e).addClass("starred"),$("#starred-"+e).removeClass("unstarred"),$("#star-"+e).addClass("hidden"),$("#unstar-"+e).removeClass("hidden")):($("#starred-"+e).addClass("unstarred"),$("#starred-"+e).removeClass("starred"),$("#star-"+e).removeClass("hidden"),$("#unstar-"+e).addClass("hidden")),$("#like-rotator-"+e).hide()})}function getPosition(e){var t={x:0,y:0};if(e.pageX||e.pageY)t.x=e.pageX,t.y=e.pageY;else if(e.clientX||e.clientY)t.x=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft,t.y=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop;else if(e.x||e.y)t.x=e.x,t.y=e.y;return t}function lockview(e,t){e=e||window.event,cursor=getPosition(e),lockvisible?lockviewhide():(lockvisible=!0,$.get("lockview/"+t,function(e){$("#panel").html(e),$("#panel").css({left:cursor.x+5,top:cursor.y+5}),$("#panel").show()}))}function lockviewhide(){lockvisible=!1,$("#panel").hide()}function post_comment(e){return unpause(),commentBusy=!0,$("body").css("cursor","wait"),$("#comment-preview-inp-"+e).val("0"),$.post("item",$("#comment-edit-form-"+e).serialize(),function(t){if(t.success){$("#comment-edit-wrapper-"+e).hide(),$("#comment-edit-text-"+e).val("");var n=document.getElementById("comment-edit-text-"+e);n&&commentClose(n,e),timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,10)}t.reload&&(window.location.href=t.reload)},"json"),!1}function preview_comment(e){return $("#comment-preview-inp-"+e).val("1"),$("#comment-edit-preview-"+e).show(),$.post("item",$("#comment-edit-form-"+e).serialize(),function(t){t.preview&&($("#comment-edit-preview-"+e).html(t.preview),$("#comment-edit-preview-"+e+" a").click(function(){return!1}))},"json"),!0}function preview_post(){return $("#jot-preview").val("1"),$("#jot-preview-content").show(),tinyMCE.triggerSave(),$.post("item",$("#profile-jot-form").serialize(),function(e){e.preview&&($("#jot-preview-content").html(e.preview),$("#jot-preview-content a").click(function(){return!1}))},"json"),$("#jot-preview").val("0"),!0}function unpause(){totStopped=!1,stopped=!1,$("#pause").html("")}function bin2hex(e){var t,n,r=0,i=[];e+="",r=e.length;for(n=0;n<r;n++)i[n]=e.charCodeAt(n).toString(16).replace(/^([\da-f])$/,"0$1");return i.join("")}function groupChangeMember(e,t,n){$("body .fakelink").css("cursor","wait"),$.get("group/"+e+"/"+t+"?t="+n,function(e){$("#group-update-wrapper").html(e),$("body .fakelink").css("cursor","auto")})}function profChangeMember(e,t){$("body .fakelink").css("cursor","wait"),$.get("profperm/"+e+"/"+t,function(e){$("#prof-update-wrapper").html(e),$("body .fakelink").css("cursor","auto")})}function contactgroupChangeMember(e,t){$("body").css("cursor","wait"),$.get("contactgroup/"+e+"/"+t,function(e){$("body").css("cursor","auto")})}function checkboxhighlight(e){$(e).is(":checked")?$(e).addClass("checkeditem"):$(e).removeClass("checkeditem")}function notifyMarkAll(){$.get("notify/mark/all",function(e){timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,1e3)})}function fcFileBrowser(e,t,n,r){var i=baseurl+"/fbrowser/"+n+"/";return tinyMCE.activeEditor.windowManager.open({file:i,title:"File Browser",width:420,height:400,resizable:"yes",inline:"yes",close_previous:"no"},{window:r,input:e}),!1}function setupFieldRichtext(){tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:"fieldRichtext",plugins:"bbcode,paste, inlinepopups",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",paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,file_browser_callback:"fcFileBrowser"})}function previewTheme(e){theme=$(e).val(),$.getJSON("pretheme?f=&theme="+theme,function(e){$("#theme-preview").html('<div id="theme-desc">'+e.desc+'</div><div id="theme-version">'+e.version+'</div><div id="theme-credits">'+e.credits+'</div><a href="'+e.img+'"><img src="'+e.img+'" width="320" height="240" alt="'+theme+'" /></a>')})}var src=null,prev=null,livetime=null,msie=!1,stopped=!1,totStopped=!1,timer=null,pr=0,liking=0,in_progress=!1,langSelect=!1,commentBusy=!1,last_popup_menu=null,last_popup_button=null;$(function(){function e(){last_popup_menu&&(last_popup_menu.hide(),last_popup_button.removeClass("selected"),last_popup_menu=null,last_popup_button=null)}$.ajaxSetup({cache:!1}),msie=$.browser.msie,$(".onoff input").each(function(){val=$(this).val(),id=$(this).attr("id"),$("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")}),$(".onoff > a").click(function(e){e.preventDefault();var t=$(this).siblings("input"),n=1-t.val(),r=t.attr("id");$("#"+r+"_onoff ."+(n==0?"on":"off")).addClass("hidden"),$("#"+r+"_onoff ."+(n==1?"on":"off")).removeClass("hidden"),t.val(n)}),setupFieldRichtext(),$("a[rel^=#]").click(function(t){return e(),menu=$($(this).attr("rel")),t.preventDefault(),t.stopPropagation(),menu.attr("popup")=="false"?!1:($(this).parent().toggleClass("selected"),menu.toggle(),menu.css("display")=="none"?(last_popup_menu=null,last_popup_button=null):(last_popup_menu=menu,last_popup_button=$(this).parent()),!1)}),$("html").click(function(){e()}),$("a.popupbox").fancybox({transitionIn:"elastic",transitionOut:"elastic"});var t=unescape($("#nav-notifications-template[rel=template]").html()),n=unescape($("<div>").append($("#nav-notifications-see-all").clone()).html()),r=unescape($("<div>").append($("#nav-notifications-mark-all").clone()).html()),i=unescape($("#nav-notifications-menu").html());$("nav").bind("nav-update",function(e,s){var o=$(s).find("invalid").text();o==1&&(window.location.href=window.location.href);var u=$(s).find("net").text();u==0?(u="",$("#net-update").removeClass("show")):$("#net-update").addClass("show"),$("#net-update").html(u);var a=$(s).find("home").text();a==0?(a="",$("#home-update").removeClass("show")):$("#home-update").addClass("show"),$("#home-update").html(a);var f=$(s).find("intro").text();f==0?(f="",$("#intro-update").removeClass("show")):$("#intro-update").addClass("show"),$("#intro-update").html(f);var l=$(s).find("mail").text();l==0?(l="",$("#mail-update").removeClass("show")):$("#mail-update").addClass("show"),$("#mail-update").html(l);var f=$(s).find("intro").text();f==0?(f="",$("#intro-update-li").removeClass("show")):$("#intro-update-li").addClass("show"),$("#intro-update-li").html(f);var l=$(s).find("mail").text();l==0?(l="",$("#mail-update-li").removeClass("show")):$("#mail-update-li").addClass("show"),$("#mail-update-li").html(l);var c=$(s).find("notif");c.children("note").length==0?$("#nav-notifications-menu").html(i):(nnm=$("#nav-notifications-menu"),nnm.html(n+r),c.children("note").each(function(){e=$(this),text=e.text().format("<span class='contactname'>"+e.attr("name")+"</span>"),html=t.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen")),nnm.append(html)})),notif=c.attr("count"),notif>0?$("#nav-notifications-linkmenu").addClass("on"):$("#nav-notifications-linkmenu").removeClass("on"),notif==0?(notif="",$("#notify-update").removeClass("show")):$("#notify-update").addClass("show"),$("#notify-update").html(notif);var h=$(s).find("sysmsgs");h.children("notice").each(function(){text=$(this).text(),$.jGrowl(text,{sticky:!0,theme:"notice"})}),h.children("info").each(function(){text=$(this).text(),$.jGrowl(text,{sticky:!1,theme:"info",life:1e4})})}),NavUpdate(),$(document).keydown(function(e){if(e.keyCode=="8"){var t=e.target||e.srcElement;if(!/input|textarea/i.test(t.nodeName))return!1}e.keyCode=="19"||e.ctrlKey&&e.which=="32"?(e.preventDefault(),stopped==0?(stopped=!0,e.ctrlKey&&(totStopped=!0),$("#pause").html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />')):unpause()):totStopped||unpause()})});var lockvisible=!1;String.prototype.format=function(){var e=this;for(var t=0;t<arguments.length;t++){var n=new RegExp("\\{"+t+"\\}","gi");e=e.replace(n,arguments[t])}return e},Array.prototype.remove=function(e){to=undefined,from=this.indexOf(e);var t=this.slice((to||from)+1||this.length);return this.length=from<0?this.length+from:from,this.push.apply(this,t)};
\ No newline at end of file
--- /dev/null
+/**
+*
+* 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}};
\ No newline at end of file
--- /dev/null
+/**
+* Ajax Autocomplete for jQuery, version 1.1.3
+* (c) 2010 Tomas Kirda
+*
+* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
+* For details, see the web site: http://www.devbridge.com/projects/autocomplete/jquery/
+*
+* Last Review: 04/19/2010
+* Heavily modified for contact completion in Friendica (add photos, hover tips. etc.) 11-May-2012 mike@macgirvin.com
+*//*jslint onevar: true, evil: true, nomen: true, eqeqeq: true, bitwise: true, regexp: true, newcap: true, immed: true *//*global window: true, document: true, clearInterval: true, setInterval: true, jQuery: true */(function($){function fnFormatResult(value,data,currentValue){var pattern="("+currentValue.replace(reEscape,"\\$1")+")";return value.replace(new RegExp(pattern,"gi"),"<strong>$1</strong>")}function Autocomplete(el,options){this.el=$(el),this.el.attr("autocomplete","off"),this.suggestions=[],this.data=[],this.badQueries=[],this.selectedIndex=-1,this.currentValue=this.el.val(),this.intervalId=0,this.cachedResponse=[],this.onChangeInterval=null,this.ignoreValueChange=!1,this.serviceUrl=options.serviceUrl,this.isLocal=!1,this.options={autoSubmit:!1,minChars:1,maxHeight:300,deferRequestBy:0,width:0,highlight:!0,params:{},fnFormatResult:fnFormatResult,delimiter:null,zIndex:9999},this.initialize(),this.setOptions(options)}var reEscape=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g");$.fn.autocomplete=function(options){return new Autocomplete(this.get(0)||$("<input />"),options)},Autocomplete.prototype={killerFn:null,initialize:function(){var me,uid,autocompleteElId;me=this,uid=Math.floor(Math.random()*1048576).toString(16),autocompleteElId="Autocomplete_"+uid,this.killerFn=function(e){$(e.target).parents(".autocomplete").size()===0&&(me.killSuggestions(),me.disableKillerFn())},this.options.width||(this.options.width=this.el.width()),this.mainContainerId="AutocompleteContainter_"+uid,$('<div id="'+this.mainContainerId+'" style="position:absolute;z-index:9999;"><div class="autocomplete-w1"><div class="autocomplete" id="'+autocompleteElId+'" style="display:none; width:300px;"></div></div></div>').appendTo("body"),this.container=$("#"+autocompleteElId),this.fixPosition(),window.opera?this.el.keypress(function(e){me.onKeyPress(e)}):this.el.keydown(function(e){me.onKeyPress(e)}),this.el.keyup(function(e){me.onKeyUp(e)}),this.el.blur(function(){me.enableKillerFn()}),this.el.focus(function(){me.fixPosition()})},setOptions:function(options){var o=this.options;$.extend(o,options),o.lookup&&(this.isLocal=!0,$.isArray(o.lookup)&&(o.lookup={suggestions:o.lookup,data:[]})),$("#"+this.mainContainerId).css({zIndex:o.zIndex}),this.container.css({maxHeight:o.maxHeight+"px",width:o.width})},clearCache:function(){this.cachedResponse=[],this.badQueries=[]},disable:function(){this.disabled=!0},enable:function(){this.disabled=!1},fixPosition:function(){var offset=this.el.offset();$("#"+this.mainContainerId).css({top:offset.top+this.el.innerHeight()+"px",left:offset.left+"px"})},enableKillerFn:function(){var me=this;$(document).bind("click",me.killerFn)},disableKillerFn:function(){var me=this;$(document).unbind("click",me.killerFn)},killSuggestions:function(){var me=this;this.stopKillSuggestions(),this.intervalId=window.setInterval(function(){me.hide(),me.stopKillSuggestions()},300)},stopKillSuggestions:function(){window.clearInterval(this.intervalId)},onKeyPress:function(e){if(this.disabled||!this.enabled)return;switch(e.keyCode){case 27:this.el.val(this.currentValue),this.hide();break;case 9:case 13:if(this.selectedIndex===-1){this.hide();return}this.select(this.selectedIndex);if(e.keyCode===9)return;break;case 38:this.moveUp();break;case 40:this.moveDown();break;default:return}e.stopImmediatePropagation(),e.preventDefault()},onKeyUp:function(e){if(this.disabled)return;switch(e.keyCode){case 38:case 40:return}clearInterval(this.onChangeInterval);if(this.currentValue!==this.el.val())if(this.options.deferRequestBy>0){var me=this;this.onChangeInterval=setInterval(function(){me.onValueChange()},this.options.deferRequestBy)}else this.onValueChange()},onValueChange:function(){clearInterval(this.onChangeInterval),this.currentValue=this.el.val();var q=this.getQuery(this.currentValue);this.selectedIndex=-1;if(this.ignoreValueChange){this.ignoreValueChange=!1;return}q===""||q.length<this.options.minChars?this.hide():this.getSuggestions(q)},getQuery:function(val){var d,arr;return d=this.options.delimiter,d?(arr=val.split(d),$.trim(arr[arr.length-1])):$.trim(val)},getSuggestionsLocal:function(q){var ret,arr,len,val,i;arr=this.options.lookup,len=arr.suggestions.length,ret={suggestions:[],data:[]},q=q.toLowerCase();for(i=0;i<len;i++)val=arr.suggestions[i],val.toLowerCase().indexOf(q)===0&&(ret.suggestions.push(val),ret.data.push(arr.data[i]));return ret},getSuggestions:function(q){var cr,me;cr=this.isLocal?this.getSuggestionsLocal(q):this.cachedResponse[q],cr&&$.isArray(cr.suggestions)?(this.suggestions=cr.suggestions,this.data=cr.data,this.suggest()):this.isBadQuery(q)||(me=this,me.options.params.query=q,$.get(this.serviceUrl,me.options.params,function(txt){me.processResponse(txt)},"text"))},isBadQuery:function(q){var i=this.badQueries.length;while(i--)if(q.indexOf(this.badQueries[i])===0)return!0;return!1},hide:function(){this.enabled=!1,this.selectedIndex=-1,this.container.hide()},suggest:function(){if(this.suggestions.length===0){this.hide();return}var me,len,div,f,v,i,s,mOver,mClick,l,img;me=this,len=this.suggestions.length,f=this.options.fnFormatResult,v=this.getQuery(this.currentValue),mOver=function(xi){return function(){me.activate(xi)}},mClick=function(xi){return function(){me.select(xi)}},this.container.hide().empty();for(i=0;i<len;i++)s=this.suggestions[i],l=this.links[i],img='<img height="24" width="24" src="'+this.photos[i]+'" alt="'+s+'" /> ',div=$((me.selectedIndex===i?'<div class="selected"':"<div")+' title="'+l+'">'+img+f(s,this.data[i],v)+"</div>"),div.mouseover(mOver(i)),div.click(mClick(i)),this.container.append(div);this.enabled=!0,this.container.show()},processResponse:function(text){var response;try{response=eval("("+text+")")}catch(err){return}$.isArray(response.data)||(response.data=[]),this.options.noCache||(this.cachedResponse[response.query]=response,response.suggestions.length===0&&this.badQueries.push(response.query)),response.query===this.getQuery(this.currentValue)&&(this.photos=response.photos,this.links=response.links,this.suggestions=response.suggestions,this.data=response.data,this.suggest())},activate:function(index){var divs,activeItem;return divs=this.container.children(),this.selectedIndex!==-1&&divs.length>this.selectedIndex&&$(divs.get(this.selectedIndex)).removeClass(),this.selectedIndex=index,this.selectedIndex!==-1&&divs.length>this.selectedIndex&&(activeItem=divs.get(this.selectedIndex),$(activeItem).addClass("selected")),activeItem},deactivate:function(div,index){div.className="",this.selectedIndex===index&&(this.selectedIndex=-1)},select:function(i){var selectedValue,f;selectedValue=this.suggestions[i],selectedValue&&(this.el.val(selectedValue),this.options.autoSubmit&&(f=this.el.parents("form"),f.length>0&&f.get(0).submit()),this.ignoreValueChange=!0,this.hide(),this.onSelect(i))},moveUp:function(){if(this.selectedIndex===-1)return;if(this.selectedIndex===0){this.container.children().get(0).className="",this.selectedIndex=-1,this.el.val(this.currentValue);return}this.adjustScroll(this.selectedIndex-1)},moveDown:function(){if(this.selectedIndex===this.suggestions.length-1)return;this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(i){var activeItem,offsetTop,upperBound,lowerBound;activeItem=this.activate(i),offsetTop=activeItem.offsetTop,upperBound=this.container.scrollTop(),lowerBound=upperBound+this.options.maxHeight-25,offsetTop<upperBound?this.container.scrollTop(offsetTop):offsetTop>lowerBound&&this.container.scrollTop(offsetTop-this.options.maxHeight+25),this.el.val(this.getValue(this.suggestions[i]))},onSelect:function(i){var me,fn,s,d;me=this,fn=me.options.onSelect,s=me.suggestions[i],d=me.data[i],me.el.val(me.getValue(s)),$.isFunction(fn)&&fn(s,d,me.el)},getValue:function(value){var del,currVal,arr,me;return me=this,del=me.options.delimiter,del?(currVal=me.currentValue,arr=currVal.split(del),arr.length===1?value:currVal.substr(0,currVal.length-arr[arr.length-1].length)+value):value}}})(jQuery);
\ No newline at end of file
$a->page['aside'] .= networks_widget('contacts',$_GET['nets']);
$base = $a->get_baseurl();
- $a->page['htmlhead'] .= '<script src="' . $a->get_baseurl(true) . '/library/jquery_ac/friendica.complete.js" ></script>';
- $a->page['htmlhead'] .= <<< EOT
-
-<script>$(document).ready(function() {
- var a;
- a = $("#contacts-search").autocomplete({
- serviceUrl: '$base/acl',
- minChars: 2,
- width: 350,
- });
- a.setOptions({ params: { type: 'a' }});
-
-});
-
-</script>
-EOT;
+ $tpl = get_markup_template("contacts-head.tpl");
+ $a->page['htmlhead'] .= replace_macros($tpl,array(
+ '$baseurl' => $a->get_baseurl(true),
+ '$base' => $base
+ ));
+ $tpl = get_markup_template("contacts-end.tpl");
+ $a->page['end'] .= replace_macros($tpl,array(
+ '$baseurl' => $a->get_baseurl(true),
+ '$base' => $base
+ ));
}
'$baseurl' => $a->get_baseurl(true),
'$editselect' => $editselect,
));
+ $a->page['end'] .= replace_macros(get_markup_template('contact_end.tpl'), array(
+ '$baseurl' => $a->get_baseurl(true),
+ '$editselect' => $editselect,
+ ));
require_once('include/contact_selectors.php');
$o .= '<h2>' . t('Edit post') . '</h2>';
$tpl = get_markup_template('jot-header.tpl');
-
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$nickname' => $a->user['nickname']
));
+ $tpl = get_markup_template('jot-end.tpl');
+ $a->page['end'] .= replace_macros($tpl, array(
+ '$baseurl' => $a->get_baseurl(),
+ '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
+ '$ispublic' => ' ', // t('Visible to <strong>everybody</strong>'),
+ '$geotag' => $geotag,
+ '$nickname' => $a->user['nickname']
+ ));
+
$tpl = get_markup_template("jot.tpl");
$htpl = get_markup_template('event_head.tpl');
$a->page['htmlhead'] .= replace_macros($htpl,array('$baseurl' => $a->get_baseurl()));
+ $etpl = get_markup_template('event_end.tpl');
+ $a->page['end'] .= replace_macros($etpl,array('$baseurl' => $a->get_baseurl()));
+
$o ="";
// tabs
$tabs = profile_tabs($a, True);
));
$base = $a->get_baseurl();
- $a->page['htmlhead'] .= '<script src="' . $a->get_baseurl(true) . '/library/jquery_ac/friendica.complete.js" ></script>';
- $a->page['htmlhead'] .= <<< EOT
-
-<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>
-EOT;
+ $head_tpl = get_markup_template('message-head.tpl');
+ $a->page['htmlhead'] .= replace_macros($head_tpl,array(
+ '$baseurl' => $a->get_baseurl(true),
+ '$base' => $base
+ ));
+
+ $end_tpl = get_markup_template('message-end.tpl');
+ $a->page['end'] .= replace_macros($end_tpl,array(
+ '$baseurl' => $a->get_baseurl(true),
+ '$base' => $base
+ ));
}
$tpl = get_markup_template('msg-header.tpl');
-
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(true),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$linkurl' => t('Please enter a link URL:')
));
+ $tpl = get_markup_template('msg-end.tpl');
+ $a->page['end'] .= replace_macros($tpl, array(
+ '$baseurl' => $a->get_baseurl(true),
+ '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
+ '$nickname' => $a->user['nickname'],
+ '$linkurl' => t('Please enter a link URL:')
+ ));
+
$preselect = (isset($a->argv[2])?array($a->argv[2]):false);
require_once("include/bbcode.php");
$tpl = get_markup_template('msg-header.tpl');
-
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$nickname' => $a->user['nickname'],
'$baseurl' => $a->get_baseurl(true)
));
+ $tpl = get_markup_template('msg-end.tpl');
+ $a->page['end'] .= replace_macros($tpl, array(
+ '$nickname' => $a->user['nickname'],
+ '$baseurl' => $a->get_baseurl(true)
+ ));
+
$mails = array();
$seen = 0;
$a->page['aside'] .= $o;
- $a->page['htmlhead'] .= "<script> var ispublic = '" . t('everybody') . "';" ;
-
- $a->page['htmlhead'] .= <<< EOT
-
- $(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');
-
- });
+ $tpl = get_markup_template("photos_head.tpl");
+ $a->page['htmlhead'] .= replace_macros($tpl,array(
+ '$ispublic' => t('everybody')
+ ));
- </script>
-EOT;
}
return;
$selname = (($datum) ? hex2bin($datum) : '');
- $albumselect = '<select id="photos-upload-album-select" name="album" size="4">';
+ $albumselect = '';
$albumselect .= '<option value="" ' . ((! $selname) ? ' selected="selected" ' : '') . '> </option>';
$celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
- $albumselect .= '</select>';
-
$uploader = '';
$ret = array('post_url' => $a->get_baseurl() . '/photos/' . $a->data['user']['nickname'],
}
- if(! $cmd !== 'edit') {
- $a->page['htmlhead'] .= '<script>
- $(document).keydown(function(event) {' . "\n";
-
- if($prevlink)
- $a->page['htmlhead'] .= 'if(event.ctrlKey && event.keyCode == 37) { event.preventDefault(); window.location.href = \'' . $prevlink . '\'; }' . "\n";
- if($nextlink)
- $a->page['htmlhead'] .= 'if(event.ctrlKey && event.keyCode == 39) { event.preventDefault(); window.location.href = \'' . $nextlink . '\'; }' . "\n";
- $a->page['htmlhead'] .= '});</script>';
+ if( $cmd === 'edit') {
+ $tpl = get_markup_template('photo_edit_head.tpl');
+ $a->page['htmlhead'] .= replace_macros($tpl,array(
+ '$prevlink' => $prevlink,
+ '$nextlink' => $nextlink
+ ));
}
if($prevlink)
$a->config['imagecrop_resolution'] = $smallest;
$a->config['imagecrop_ext'] = $ph->getExt();
$a->page['htmlhead'] .= get_markup_template("crophead.tpl");
+ $a->page['end'] .= get_markup_template("cropend.tpl");
return;
}}
'$baseurl' => $a->get_baseurl(true),
'$editselect' => $editselect,
));
+ $a->page['end'] .= replace_macros(get_markup_template('profed_end.tpl'), array(
+ '$baseurl' => $a->get_baseurl(true),
+ '$editselect' => $editselect,
+ ));
$opt_tpl = get_markup_template("profile-hide-friends.tpl");
'$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
));
- $a->page['htmlhead'] .= "<script type=\"text/javascript\" src=\"js/country.js\" ></script>";
-
-
// These lines provide the javascript needed by the acl selector
- $a->page['htmlhead'] .= "<script> var ispublic = '" . t('everybody') . "';" ;
-
- $a->page['htmlhead'] .= <<< EOT
-
- $(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>
-EOT;
+ $tpl = get_markup_template("settings-head.tpl");
+ $a->page['htmlhead'] .= replace_macros($tpl,array(
+ '$ispublic' => t('everybody')
+ ));
'$theme_config' => $theme_config,
));
+ $tpl = get_markup_template("settings_display_end.tpl");
+ $a->page['end'] .= replace_macros($tpl, array(
+ '$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes)
+ ));
+
return $o;
}
$tpl = get_markup_template('wallmsg-header.tpl');
-
- $a->page['htmlhead'] .= replace_macros($tpl, array(
- '$baseurl' => $a->get_baseurl(true),
- '$editselect' => '/(profile-jot-text|prvmail-text)/',
- '$nickname' => $user['nickname'],
- '$linkurl' => t('Please enter a link URL:')
- ));
+ $a->page['htmlhead'] .= replace_macros($tpl, array(
+ '$baseurl' => $a->get_baseurl(true),
+ '$editselect' => '/(profile-jot-text|prvmail-text)/',
+ '$nickname' => $user['nickname'],
+ '$linkurl' => t('Please enter a link URL:')
+ ));
+
+ $tpl = get_markup_template('wallmsg-end.tpl');
+ $a->page['end'] .= replace_macros($tpl, array(
+ '$baseurl' => $a->get_baseurl(true),
+ '$editselect' => '/(profile-jot-text|prvmail-text)/',
+ '$nickname' => $user['nickname'],
+ '$linkurl' => t('Please enter a link URL:')
+ ));
- $tpl = get_markup_template('wallmessage.tpl');
- $o .= replace_macros($tpl,array(
- '$header' => t('Send Private Message'),
- '$subheader' => sprintf( t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.'), $user['username']),
- '$to' => t('To:'),
- '$subject' => t('Subject:'),
- '$recipname' => $user['username'],
- '$nickname' => $user['nickname'],
- '$subjtxt' => ((x($_REQUEST,'subject')) ? strip_tags($_REQUEST['subject']) : ''),
- '$text' => ((x($_REQUEST,'body')) ? escape_tags(htmlspecialchars($_REQUEST['body'])) : ''),
- '$readonly' => '',
- '$yourmessage' => t('Your message:'),
- '$select' => $select,
- '$parent' => '',
- '$upload' => t('Upload photo'),
- '$insert' => t('Insert web link'),
- '$wait' => t('Please wait')
- ));
-
- return $o;
- }
+ $tpl = get_markup_template('wallmessage.tpl');
+ $o .= replace_macros($tpl,array(
+ '$header' => t('Send Private Message'),
+ '$subheader' => sprintf( t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.'), $user['username']),
+ '$to' => t('To:'),
+ '$subject' => t('Subject:'),
+ '$recipname' => $user['username'],
+ '$nickname' => $user['nickname'],
+ '$subjtxt' => ((x($_REQUEST,'subject')) ? strip_tags($_REQUEST['subject']) : ''),
+ '$text' => ((x($_REQUEST,'body')) ? escape_tags(htmlspecialchars($_REQUEST['body'])) : ''),
+ '$readonly' => '',
+ '$yourmessage' => t('Your message:'),
+ '$select' => $select,
+ '$parent' => '',
+ '$upload' => t('Upload photo'),
+ '$insert' => t('Insert web link'),
+ '$wait' => t('Please wait')
+ ));
+
+ return $o;
+}
$("nav").bind('nav-update', function(e,data){
var elm = $('#pending-update');
var register = $(data).find('register').text();
- if (register=="0") { reigster=""; elm.hide();} else { elm.show(); }
+ if (register=="0") { register=""; elm.hide();} else { elm.show(); }
elm.html(register);
});
});
--- /dev/null
+
+<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>
+
--- /dev/null
+<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>
+
--- /dev/null
+
+<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>
--- /dev/null
+
+<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>
+
<div id="photos-upload-new-end"></div>
<div id="photos-upload-exist-wrapper">
<div id="photos-upload-existing-album-text">$existalbumtext</div>
+ <select id="photos-upload-album-select" name="album" size="4">
$albumselect
+ </select>
</div>
<div id="photos-upload-exist-end"></div>
<div id="photos-upload-noshare-div" class="photos-upload-noshare-div" >
- <input id="photos-upload-noshare" type="checkbox" name="not_visible" value="1" />
+ <input id="photos-upload-noshare" type="checkbox" name="not_visible" value="1" checked />
<label id="photos-upload-noshare-text" for="photos-upload-noshare" >$nosharetext</label>
</div>
+<script type="text/javascript" src="js/country.js" ></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">
--- /dev/null
+
+<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>
+
- Admin: access to more pages than summary?
+- Needs to be faster!
+ - Reduce DOM elements (4100 for 10 items)
+ - Automatically set limit of 10 items for Network and Profile?
+
+
+
--- /dev/null
+<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>
-<script>
- // update pending count //
- $(function(){
- $("nav").bind('nav-update', function(e,data){
- var elm = $('#pending-update');
- var register = $(data).find('register').text();
- if (register=="0") { reigster=""; elm.hide();} else { elm.show(); }
- elm.html(register);
- });
- });
-</script>
<h4><a href="$admurl">$admtxt</a></h4>
<ul class='admin linklist'>
<li class='admin button $admin.site.2'><a href='$admin.site.0'>$admin.site.1</a></li>
-<!--<script>
- $(function(){
-
- $("#cnftheme").fancybox({
- width: 800,
- autoDimensions: false,
- onStart: function(){
- var theme = $("#id_theme :selected").val();
- $("#cnftheme").attr('href',"$baseurl/admin/themes/"+theme);
- },
- onComplete: function(){
- $("div#fancybox-content form").submit(function(e){
- var url = $(this).attr('action');
- // can't get .serialize() to work...
- var data={};
- $(this).find("input").each(function(){
- data[$(this).attr('name')] = $(this).val();
- });
- $(this).find("select").each(function(){
- data[$(this).attr('name')] = $(this).children(":selected").val();
- });
- console.log(":)", url, data);
-
- $.post(url, data, function(data) {
- if(timer) clearTimeout(timer);
- NavUpdate();
- $.fancybox.close();
- })
-
- return false;
- });
-
- }
- });
- });
-</script>-->
+
<div id='adminpage'>
<h1>$title - $page</h1>
- <script>
+<!-- <script>
$(document).ready( function () {
$(document).mouseup(function(e) {
var container = $("#comment-edit-wrapper-$id");
}
});
});
- </script>
+ </script>-->
<div class="comment-wwedit-wrapper" id="comment-edit-wrapper-$id" style="display: block;" >
<form class="comment-edit-form" id="comment-edit-form-$id" action="item" method="post" onsubmit="post_comment($id); return false;" >
--- /dev/null
+
+<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>
-<!--<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>
--->
--- /dev/null
+
+<script src="$baseurl/library/jquery_ac/friendica.complete.min.js" ></script>
+
+
--- /dev/null
+
+<script>
+ window.autocompleteType = 'contacts-head';
+</script>
+
--- /dev/null
+<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>
--- /dev/null
+ <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>
--- /dev/null
+ <link rel="stylesheet" href="library/cropper/cropper.css" type="text/css" />
</div>\r
</div>\r
<?php } ?>\r
+ <?php if(x($page,'end')) echo $page['end']; ?>\r
</body>\r
</html>\r
\r
--- /dev/null
+<!--[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>
+
--- /dev/null
+<script language="javascript" type="text/javascript"
+ src="$baseurl/library/fullcalendar/fullcalendar.min.js"></script>
+
+
<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>
--- /dev/null
+
+ <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>
--- /dev/null
+
+ <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>
type="application/opensearchdescription+xml"
title="Search in Friendica" />
-<!--[if IE]>
-<script type="text/javascript" src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
-<![endif]-->
-<script type="text/javascript" src="$baseurl/js/jquery.js" ></script>
-<script type="text/javascript" src="$baseurl/js/jquery.textinputs.js" ></script>
-<script type="text/javascript" src="$baseurl/js/fk.autocomplete.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/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js" ></script>-->
-<script type="text/javascript" src="$baseurl/view/theme/frost-mobile/js/acl.js" ></script>
-<script type="text/javascript" src="$baseurl/js/webtoolkit.base64.js" ></script>
-<script type="text/javascript" src="$baseurl/view/theme/frost-mobile/js/main.js" ></script>
-<script type="text/javascript" src="$baseurl/view/theme/frost-mobile/js/theme.js"></script>
<script>
-
+ window.delItem = "$delitem";
+ window.commentEmptyText = "$comment";
+ window.showMore = "$showmore";
+ window.showFewer = "$showfewer";
var updateInterval = $update_interval;
var localUser = {{ if $local_user }}$local_user{{ else }}false{{ endif }};
-
- function confirmDelete() { return confirm("$delitem"); }
- function commentOpen(obj,id) {
- if(obj.value == '$comment') {
- obj.value = '';
- $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
- $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
- $("#mod-cmnt-wrap-" + id).show();
- openMenu("comment-edit-submit-wrapper-" + id);
- }
- }
- function commentClose(obj,id) {
- if(obj.value == '') {
- obj.value = '$comment';
- $("#comment-edit-text-" + id).removeClass("comment-edit-text-full");
- $("#comment-edit-text-" + id).addClass("comment-edit-text-empty");
- $("#mod-cmnt-wrap-" + id).hide();
- closeMenu("comment-edit-submit-wrapper-" + id);
- }
- }
-
-
- function commentInsert(obj,id) {
- var tmpStr = $("#comment-edit-text-" + id).val();
- if(tmpStr == '$comment') {
- tmpStr = '';
- $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
- $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
- openMenu("comment-edit-submit-wrapper-" + id);
- }
- var ins = $(obj).html();
- ins = ins.replace('<','<');
- ins = ins.replace('>','>');
- ins = ins.replace('&','&');
- ins = ins.replace('"','"');
- $("#comment-edit-text-" + id).val(tmpStr + ins);
- }
-
- function qCommentInsert(obj,id) {
- var tmpStr = $("#comment-edit-text-" + id).val();
- if(tmpStr == '$comment') {
- tmpStr = '';
- $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
- $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
- openMenu("comment-edit-submit-wrapper-" + id);
- }
- var ins = $(obj).val();
- ins = ins.replace('<','<');
- ins = ins.replace('>','>');
- ins = ins.replace('&','&');
- ins = ins.replace('"','"');
- $("#comment-edit-text-" + id).val(tmpStr + ins);
- $(obj).val('');
- }
-
- function showHideComments(id) {
- if( $('#collapsed-comments-' + id).is(':visible')) {
- $('#collapsed-comments-' + id).hide();
- $('#hide-comments-' + id).html('$showmore');
- }
- else {
- $('#collapsed-comments-' + id).show();
- $('#hide-comments-' + id).html('$showfewer');
- }
- }
-
-
</script>
--- /dev/null
+
+<script type="text/javascript" src="$baseurl/js/ajaxupload.min.js" ></script>
+
+<script>if(typeof window.jotInit != 'undefined') initEditor();</script>
+
-<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) {
- addeditortext(response);
- $('#profile-rotator').hide();
- }
- }
- );
-
-
- });
-
-/* function deleteCheckedItems() {
- var checkedstr = '';
-
- $('.item-select').each( function() {
- if($(this).is(':checked')) {
- if(checkedstr.length != 0) {
- checkedstr = checkedstr + ',' + $(this).val();
- }
- else {
- checkedstr = $(this).val();
- }
- }
- });
- $.post('item', { dropitems: checkedstr }, function(data) {
- window.location.reload();
- });
- }*/
-
- function jotGetLink() {
- reply = prompt("$linkurl");
- if(reply && reply.length) {
- reply = bin2hex(reply);
- $('#profile-rotator').show();
- $.get('parse_url?binurl=' + reply, function(data) {
- addeditortext(data);
- $('#profile-rotator').hide();
- });
- }
- }
-
- function jotVideoURL() {
- reply = prompt("$vidurl");
- if(reply && reply.length) {
- addeditortext('[video]' + reply + '[/video]');
- }
- }
-
- function jotAudioURL() {
- reply = prompt("$audurl");
- if(reply && reply.length) {
- addeditortext('[audio]' + reply + '[/audio]');
- }
- }
-
-
- function jotGetLocation() {
- reply = prompt("$whereareu", $('#jot-location').val());
- if(reply && reply.length) {
- $('#jot-location').val(reply);
- }
- }
-
- function jotShare(id) {
- if ($('#jot-popup').length != 0) $('#jot-popup').show();
-
- $('#like-rotator-' + id).show();
- $.get('share/' + id, function(data) {
- if (!editor) $("#profile-jot-text").val("");
- initEditor(function(){
- addeditortext(data);
- $('#like-rotator-' + id).hide();
- $(window).scrollTop(0);
- });
-
- });
- }
-
-/* function linkdropper(event) {
- var linkFound = event.dataTransfer.types.contains("text/uri-list");
- if(linkFound)
- event.preventDefault();
- }
-
- function linkdrop(event) {
- var reply = event.dataTransfer.getData("text/uri-list");
- event.target.textContent = reply;
- event.preventDefault();
- if(reply && reply.length) {
- reply = bin2hex(reply);
- $('#profile-rotator').show();
- $.get('parse_url?binurl=' + reply, function(data) {
- if (!editor) $("#profile-jot-text").val("");
- initEditor(function(){
- addeditortext(data);
- $('#profile-rotator').hide();
- });
- });
- }
- }*/
-
- function itemTag(id) {
- reply = prompt("$term");
- if(reply && reply.length) {
- reply = reply.replace('#','');
- if(reply.length) {
-
- commentBusy = true;
- $('body').css('cursor', 'wait');
-
- $.get('tagger/' + id + '?term=' + reply);
- if(timer) clearTimeout(timer);
- timer = setTimeout(NavUpdate,3000);
- liking = 1;
- }
- }
- }
-
- function itemFiler(id) {
-
- $.get('filer/', function(data){
-
- var promptText = $('#id_term_label', data).text();
-
- reply = prompt(promptText);
- if(reply && reply.length) {
- commentBusy = true;
- $('body').css('cursor', 'wait');
- $.get('filer/' + id + '?term=' + reply, NavUpdate);
-/* if(timer) clearTimeout(timer);
- timer = setTimeout(NavUpdate,3000);*/
- liking = 1;
-/* $.fancybox.close();*/
- }
- });
-
-/* var bordercolor = $("input").css("border-color");
-
- $.get('filer/', function(data){
- $.fancybox(data);
- $("#id_term").keypress(function(){
- $(this).css("border-color",bordercolor);
- })
- $("#select_term").change(function(){
- $("#id_term").css("border-color",bordercolor);
- })
-
- $("#filer_save").click(function(e){
- e.preventDefault();
- reply = $("#id_term").val();
- if(reply && reply.length) {
- commentBusy = true;
- $('body').css('cursor', 'wait');
- $.get('filer/' + id + '?term=' + reply);
- if(timer) clearTimeout(timer);
- timer = setTimeout(NavUpdate,3000);
- liking = 1;
- $.fancybox.close();
- } else {
- $("#id_term").css("border-color","#FF0000");
- }
- return false;
- });
- });
-*/
- }
-
- function jotClearLocation() {
- $('#jot-coord').val('');
- $('#profile-nolocation-wrapper').hide();
- }
-
- function addeditortext(data) {
- if(plaintext == 'none') {
- var currentText = $("#profile-jot-text").val();
- $("#profile-jot-text").val(currentText + data);
- }
-/* else
- tinyMCE.execCommand('mceInsertRawHTML',false,data);*/
- }
-
- $geotag
-
+ window.editSelect = $editselect;
+ window.isPublic = "$ispublic";
+ window.nickname = "$nickname";
+ window.linkURL = "$linkurl";
+ window.vidURL = "$vidurl";
+ window.audURL = "$audurl";
+ window.whereAreU = "$whereareu";
+ window.term = "$term";
+ window.baseURL = "$baseurl";
+ window.geoTag = function () { $geotag }
</script>
+
<div id="profile-jot-end"></div>
</form>
</div>
- {{ if $content }}<script>initEditor();</script>{{ endif }}
+ {{ if $content }}<script>window.jotInit = true;</script>{{ endif }}
that.group_uids = [];
that.nw = 2; //items per row. should be calulated from #acl-list.width
- that.list_content = $("#acl-list-content");
- that.item_tpl = unescape($(".acl-list-item[rel=acl-template]").html());
- that.showall = $("#acl-showall");
+ that.list_content = $j("#acl-list-content");
+ that.item_tpl = unescape($j(".acl-list-item[rel=acl-template]").html());
+ that.showall = $j("#acl-showall");
if (preset.length==0) that.showall.addClass("selected");
/*events*/
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);
+ $j(".acl-button-show").live('click', that.on_button_show);
+ $j(".acl-button-hide").live('click', that.on_button_hide);
+ $j("#acl-search").keypress(that.on_search);
+ $j("#acl-wrapper").parents("form").submit(that.on_submit);
/* startup! */
that.get(0,100);
}
ACL.prototype.on_submit = function(){
- aclfileds = $("#acl-fields").html("");
- $(that.allow_gid).each(function(i,v){
+ aclfileds = $j("#acl-fields").html("");
+ $j(that.allow_gid).each(function(i,v){
aclfileds.append("<input type='hidden' name='group_allow[]' value='"+v+"'>");
});
- $(that.allow_cid).each(function(i,v){
+ $j(that.allow_cid).each(function(i,v){
aclfileds.append("<input type='hidden' name='contact_allow[]' value='"+v+"'>");
});
- $(that.deny_gid).each(function(i,v){
+ $j(that.deny_gid).each(function(i,v){
aclfileds.append("<input type='hidden' name='group_deny[]' value='"+v+"'>");
});
- $(that.deny_cid).each(function(i,v){
+ $j(that.deny_cid).each(function(i,v){
aclfileds.append("<input type='hidden' name='contact_deny[]' value='"+v+"'>");
});
}
ACL.prototype.search = function(){
- var srcstr = $("#acl-search").val();
+ var srcstr = $j("#acl-search").val();
that.list_content.html("");
that.get(0,100, srcstr);
}
event.stopPropagation();
/*that.showall.removeClass("selected");
- $(this).siblings(".acl-button-hide").removeClass("selected");
- $(this).toggleClass("selected");*/
+ $j(this).siblings(".acl-button-hide").removeClass("selected");
+ $j(this).toggleClass("selected");*/
- that.set_allow($(this).parent().attr('id'));
+ that.set_allow($j(this).parent().attr('id'));
return false;
}
event.stopPropagation();
/*that.showall.removeClass("selected");
- $(this).siblings(".acl-button-show").removeClass("selected");
- $(this).toggleClass("selected");*/
+ $j(this).siblings(".acl-button-show").removeClass("selected");
+ $j(this).toggleClass("selected");*/
- that.set_deny($(this).parent().attr('id'));
+ that.set_deny($j(this).parent().attr('id'));
return false;
}
that.deny_gid.length==0 && that.deny_cid.length==0){
that.showall.addClass("selected");
/* jot acl */
- $('#jot-perms-icon').removeClass('lock').addClass('unlock');
- $('#jot-public').show();
- $('.profile-jot-net input').attr('disabled', false);
+ $j('#jot-perms-icon').removeClass('lock').addClass('unlock');
+ $j('#jot-public').show();
+ $j('.profile-jot-net input').attr('disabled', false);
if(typeof editor != 'undefined' && editor != false) {
- $('#profile-jot-desc').html(ispublic);
+ $j('#profile-jot-desc').html(ispublic);
}
} else {
that.showall.removeClass("selected");
/* jot acl */
- $('#jot-perms-icon').removeClass('unlock').addClass('lock');
- $('#jot-public').hide();
- $('.profile-jot-net input').attr('disabled', 'disabled');
- $('#profile-jot-desc').html(' ');
+ $j('#jot-perms-icon').removeClass('unlock').addClass('lock');
+ $j('#jot-public').hide();
+ $j('.profile-jot-net input').attr('disabled', 'disabled');
+ $j('#profile-jot-desc').html(' ');
}
- $("#acl-list-content .acl-list-item").each(function(){
- $(this).removeClass("groupshow grouphide");
+ $j("#acl-list-content .acl-list-item").each(function(){
+ $j(this).removeClass("groupshow grouphide");
});
- $("#acl-list-content .acl-list-item").each(function(){
- itemid = $(this).attr('id');
+ $j("#acl-list-content .acl-list-item").each(function(){
+ itemid = $j(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");
+ btshow = $j(this).children(".acl-button-show").removeClass("selected");
+ bthide = $j(this).children(".acl-button-hide").removeClass("selected");
switch(type){
case "g":
uclass="grouphide";
}
- $(that.group_uids[id]).each(function(i,v) {
+ $j(that.group_uids[id]).each(function(i,v) {
if(uclass == "grouphide")
- $("#c"+v).removeClass("groupshow");
+ $j("#c"+v).removeClass("groupshow");
if(uclass != "") {
- var cls = $("#c"+v).attr('class');
+ var cls = $j("#c"+v).attr('class');
if( cls == undefined)
return true;
var hiding = cls.indexOf('grouphide');
if(hiding == -1)
- $("#c"+v).addClass(uclass);
+ $j("#c"+v).addClass(uclass);
}
});
search:search,
}
- $.ajax({
+ $j.ajax({
type:'POST',
url: that.url,
data: postdata,
ACL.prototype.populate = function(data){
/* var height = Math.ceil(data.tot / that.nw) * 42;
that.list_content.height(height);*/
- $(data.items).each(function(){
+ $j(data.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 );
if (this.uids!=undefined) that.group_uids[this.id] = this.uids;
--- /dev/null
+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=2,that.list_content=$j("#acl-list-content"),that.item_tpl=unescape($j(".acl-list-item[rel=acl-template]").html()),that.showall=$j("#acl-showall"),t.length==0&&that.showall.addClass("selected"),that.showall.click(that.on_showall),$j(".acl-button-show").live("click",that.on_button_show),$j(".acl-button-hide").live("click",that.on_button_hide),$j("#acl-search").keypress(that.on_search),$j("#acl-wrapper").parents("form").submit(that.on_submit),that.get(0,100)}ACL.prototype.on_submit=function(){aclfileds=$j("#acl-fields").html(""),$j(that.allow_gid).each(function(e,t){aclfileds.append("<input type='hidden' name='group_allow[]' value='"+t+"'>")}),$j(that.allow_cid).each(function(e,t){aclfileds.append("<input type='hidden' name='contact_allow[]' value='"+t+"'>")}),$j(that.deny_gid).each(function(e,t){aclfileds.append("<input type='hidden' name='group_deny[]' value='"+t+"'>")}),$j(that.deny_cid).each(function(e,t){aclfileds.append("<input type='hidden' name='contact_deny[]' value='"+t+"'>")})},ACL.prototype.search=function(){var e=$j("#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($j(this).parent().attr("id")),!1},ACL.prototype.on_button_hide=function(e){return e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),that.set_deny($j(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"),$j("#jot-perms-icon").removeClass("lock").addClass("unlock"),$j("#jot-public").show(),$j(".profile-jot-net input").attr("disabled",!1),typeof editor!="undefined"&&editor!=0&&$j("#profile-jot-desc").html(ispublic)):(that.showall.removeClass("selected"),$j("#jot-perms-icon").removeClass("unlock").addClass("lock"),$j("#jot-public").hide(),$j(".profile-jot-net input").attr("disabled","disabled"),$j("#profile-jot-desc").html(" ")),$j("#acl-list-content .acl-list-item").each(function(){$j(this).removeClass("groupshow grouphide")}),$j("#acl-list-content .acl-list-item").each(function(){itemid=$j(this).attr("id"),type=itemid[0],id=parseInt(itemid.substr(1)),btshow=$j(this).children(".acl-button-show").removeClass("selected"),bthide=$j(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"),$j(that.group_uids[id]).each(function(t,n){e=="grouphide"&&$j("#c"+n).removeClass("groupshow");if(e!=""){var r=$j("#c"+n).attr("class");if(r==undefined)return!0;var i=r.indexOf("grouphide");i==-1&&$j("#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};$j.ajax({type:"POST",url:that.url,data:r,dataType:"json",success:that.populate})},ACL.prototype.populate=function(e){$j(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()};
\ No newline at end of file
--- /dev/null
+/**
+ * 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=$j(e).offset(),n=$j(e).width(),r=$j(e).height();else{var i=e.getContainer();typeof i!="undefined"&&(style=$j(i).offset(),n=$j(i).width(),r=$j(i).height())}style.top=style.top+r,style.width=n,style.position="absolute",style.display="none",this.cont=$j("<div class='acpopup'></div>"),this.cont.css(style),$j("body").append(this.cont)}function ContactAutocomplete(e,t){this.pattern=/@([^ \n]+)$/,this.popup=null;var n=this;$j(e).unbind("keydown"),$j(e).unbind("keyup"),$j(e).keydown(function(e){n.popup!==null&&n.popup.onkey(e)}),$j(e).keyup(function(e){cpos=$j(this).getSelection(),cpos.start==cpos.end&&(match=$j(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(){$j(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"};$j.ajax({type:"POST",url:this.url,data:t,dataType:"json",success:function(t){e.cont.html(""),t.tot>0?(e.cont.show(),$j(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=$j("<div class='acpopupitem' title='"+n+"'>"+e+"</div>");i.click(function(e){t=$j(this).attr("title").replace(new RegExp(" - .*"),""),typeof r.element.container=="undefined"?(el=$j(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())}),$j(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"),$j(this.cont.children()[this.idsel]).addClass("selected");e.keyCode=="27"&&this.close()},function(e){$j.fn.contact_autocomplete=function(e){this.each(function(){new ContactAutocomplete(this,e)})}}(jQuery);
\ No newline at end of file
var last_popup_menu = null;
var last_popup_button = null;
- $(function() {
- $.ajaxSetup({cache: false});
+ $j(function() {
+ $j.ajaxSetup({cache: false});
- msie = $.browser.msie ;
+ msie = $j.browser.msie ;
/* setup tooltips *//*
- $("a,.tt").each(function(){
- var e = $(this);
+ $j("a,.tt").each(function(){
+ var e = $j(this);
var pos="bottom";
if (e.hasClass("tttop")) pos="top";
if (e.hasClass("ttbottom")) pos="bottom";
/* setup onoff widgets */
- $(".onoff input").each(function(){
- val = $(this).val();
- id = $(this).attr("id");
- $("#"+id+"_onoff ."+ (val==0?"on":"off")).addClass("hidden");
+ $j(".onoff input").each(function(){
+ val = $j(this).val();
+ id = $j(this).attr("id");
+ $j("#"+id+"_onoff ."+ (val==0?"on":"off")).addClass("hidden");
});
- $(".onoff > a").click(function(event){
+ $j(".onoff > a").click(function(event){
event.preventDefault();
- var input = $(this).siblings("input");
+ var input = $j(this).siblings("input");
var val = 1-input.val();
var id = input.attr("id");
- $("#"+id+"_onoff ."+ (val==0?"on":"off")).addClass("hidden");
- $("#"+id+"_onoff ."+ (val==1?"on":"off")).removeClass("hidden");
+ $j("#"+id+"_onoff ."+ (val==0?"on":"off")).addClass("hidden");
+ $j("#"+id+"_onoff ."+ (val==1?"on":"off")).removeClass("hidden");
input.val(val);
//console.log(id);
});
function close_last_popup_menu(e) {
if( last_popup_menu ) {
- if( '#' + last_popup_menu.attr('id') !== $(e.target).attr('rel')) {
+ if( '#' + last_popup_menu.attr('id') !== $j(e.target).attr('rel')) {
last_popup_menu.hide();
- if (last_popup_menu.attr('id') == "nav-notifications-menu" ) $('section').show();
+ if (last_popup_menu.attr('id') == "nav-notifications-menu" ) $j('section').show();
last_popup_button.removeClass("selected");
last_popup_menu = null;
last_popup_button = null;
}
}
}
- $('img[rel^=#]').click(function(e){
+ $j('img[rel^=#]').click(function(e){
close_last_popup_menu(e);
- menu = $( $(this).attr('rel') );
+ menu = $j( $j(this).attr('rel') );
e.preventDefault();
e.stopPropagation();
if (menu.attr('popup')=="false") return false;
-// $(this).parent().toggleClass("selected");
+// $j(this).parent().toggleClass("selected");
// menu.toggle();
if (menu.css("display") == "none") {
- $(this).parent().addClass("selected");
+ $j(this).parent().addClass("selected");
menu.show();
- if (menu.attr('id') == "nav-notifications-menu" ) $('section').hide();
+ if (menu.attr('id') == "nav-notifications-menu" ) $j('section').hide();
last_popup_menu = menu;
- last_popup_button = $(this).parent();
+ last_popup_button = $j(this).parent();
} else {
- $(this).parent().removeClass("selected");
+ $j(this).parent().removeClass("selected");
menu.hide();
- if (menu.attr('id') == "nav-notifications-menu" ) $('section').show();
+ if (menu.attr('id') == "nav-notifications-menu" ) $j('section').show();
last_popup_menu = null;
last_popup_button = null;
}
return false;
});
- $('html').click(function(e) {
+ $j('html').click(function(e) {
close_last_popup_menu(e);
});
// fancyboxes
- /*$("a.popupbox").fancybox({
+ /*$j("a.popupbox").fancybox({
'transitionIn' : 'elastic',
'transitionOut' : 'elastic'
});*/
/* notifications template */
- var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
- var notifications_all = unescape($('<div>').append( $("#nav-notifications-see-all").clone() ).html()); //outerHtml hack
- var notifications_mark = unescape($('<div>').append( $("#nav-notifications-mark-all").clone() ).html()); //outerHtml hack
- var notifications_empty = unescape($("#nav-notifications-menu").html());
+ var notifications_tpl= unescape($j("#nav-notifications-template[rel=template]").html());
+ var notifications_all = unescape($j('<div>').append( $j("#nav-notifications-see-all").clone() ).html()); //outerHtml hack
+ var notifications_mark = unescape($j('<div>').append( $j("#nav-notifications-mark-all").clone() ).html()); //outerHtml hack
+ var notifications_empty = unescape($j("#nav-notifications-menu").html());
/* nav update event */
- $('nav').bind('nav-update', function(e,data){;
- var invalid = $(data).find('invalid').text();
+ $j('nav').bind('nav-update', function(e,data){;
+ var invalid = $j(data).find('invalid').text();
if(invalid == 1) { window.location.href=window.location.href }
- var net = $(data).find('net').text();
- if(net == 0) { net = ''; $('#net-update').removeClass('show') } else { $('#net-update').addClass('show') }
- $('#net-update').html(net);
+ var net = $j(data).find('net').text();
+ if(net == 0) { net = ''; $j('#net-update').removeClass('show') } else { $j('#net-update').addClass('show') }
+ $j('#net-update').html(net);
- var home = $(data).find('home').text();
- if(home == 0) { home = ''; $('#home-update').removeClass('show') } else { $('#home-update').addClass('show') }
- $('#home-update').html(home);
+ var home = $j(data).find('home').text();
+ if(home == 0) { home = ''; $j('#home-update').removeClass('show') } else { $j('#home-update').addClass('show') }
+ $j('#home-update').html(home);
- var intro = $(data).find('intro').text();
- if(intro == 0) { intro = ''; $('#intro-update').removeClass('show') } else { $('#intro-update').addClass('show') }
- $('#intro-update').html(intro);
+ var intro = $j(data).find('intro').text();
+ if(intro == 0) { intro = ''; $j('#intro-update').removeClass('show') } else { $j('#intro-update').addClass('show') }
+ $j('#intro-update').html(intro);
- var mail = $(data).find('mail').text();
- if(mail == 0) { mail = ''; $('#mail-update').removeClass('show') } else { $('#mail-update').addClass('show') }
- $('#mail-update').html(mail);
+ var mail = $j(data).find('mail').text();
+ if(mail == 0) { mail = ''; $j('#mail-update').removeClass('show') } else { $j('#mail-update').addClass('show') }
+ $j('#mail-update').html(mail);
- var intro = $(data).find('intro').text();
- if(intro == 0) { intro = ''; $('#intro-update-li').removeClass('show') } else { $('#intro-update-li').addClass('show') }
- $('#intro-update-li').html(intro);
+ var intro = $j(data).find('intro').text();
+ if(intro == 0) { intro = ''; $j('#intro-update-li').removeClass('show') } else { $j('#intro-update-li').addClass('show') }
+ $j('#intro-update-li').html(intro);
- var mail = $(data).find('mail').text();
- if(mail == 0) { mail = ''; $('#mail-update-li').removeClass('show') } else { $('#mail-update-li').addClass('show') }
- $('#mail-update-li').html(mail);
+ var mail = $j(data).find('mail').text();
+ if(mail == 0) { mail = ''; $j('#mail-update-li').removeClass('show') } else { $j('#mail-update-li').addClass('show') }
+ $j('#mail-update-li').html(mail);
- var eNotif = $(data).find('notif')
+ var eNotif = $j(data).find('notif')
if (eNotif.children("note").length==0){
- $("#nav-notifications-menu").html(notifications_empty);
+ $j("#nav-notifications-menu").html(notifications_empty);
} else {
- nnm = $("#nav-notifications-menu");
+ nnm = $j("#nav-notifications-menu");
nnm.html(notifications_all + notifications_mark);
//nnm.attr('popup','true');
eNotif.children("note").each(function(){
- e = $(this);
+ e = $j(this);
text = e.text().format("<span class='contactname'>"+e.attr('name')+"</span>");
html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
nnm.append(html);
}
notif = eNotif.attr('count');
if (notif>0){
- $("#nav-notifications-linkmenu").addClass("on");
+ $j("#nav-notifications-linkmenu").addClass("on");
} else {
- $("#nav-notifications-linkmenu").removeClass("on");
+ $j("#nav-notifications-linkmenu").removeClass("on");
}
- if(notif == 0) { notif = ''; $('#notify-update').removeClass('show') } else { $('#notify-update').addClass('show') }
- $('#notify-update').html(notif);
+ if(notif == 0) { notif = ''; $j('#notify-update').removeClass('show') } else { $j('#notify-update').addClass('show') }
+ $j('#notify-update').html(notif);
- var eSysmsg = $(data).find('sysmsgs');
+ var eSysmsg = $j(data).find('sysmsgs');
eSysmsg.children("notice").each(function(){
- text = $(this).text();
- $.jGrowl(text, { sticky: true, theme: 'notice', life: 1000 });
+ text = $j(this).text();
+ $j.jGrowl(text, { sticky: false, theme: 'notice', life: 1500 });
});
eSysmsg.children("info").each(function(){
- text = $(this).text();
- $.jGrowl(text, { sticky: false, theme: 'info', life: 1000 });
+ text = $j(this).text();
+ $j.jGrowl(text, { sticky: false, theme: 'info', life: 1000 });
});
});
NavUpdate();
// Allow folks to stop the ajax page updates with the pause/break key
-/* $(document).keydown(function(event) {
+/* $j(document).keydown(function(event) {
if(event.keyCode == '8') {
var target = event.target || event.srcElement;
if (!/input|textarea/i.test(target.nodeName)) {
if (event.ctrlKey) {
totStopped = true;
}
- $('#pause').html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />');
+ $j('#pause').html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />');
} else {
unpause();
}
if(! stopped) {
var pingCmd = 'ping' + ((localUser != 0) ? '?f=&uid=' + localUser : '');
- $.get(pingCmd,function(data) {
- $(data).find('result').each(function() {
+ $j.get(pingCmd,function(data) {
+ $j(data).find('result').each(function() {
// send nav-update event
- $('nav').trigger('nav-update', this);
+ $j('nav').trigger('nav-update', this);
// start live update
- if($('#live-network').length) { src = 'network'; liveUpdate(); }
- if($('#live-profile').length) { src = 'profile'; liveUpdate(); }
- if($('#live-community').length) { src = 'community'; liveUpdate(); }
- if($('#live-notes').length) { src = 'notes'; liveUpdate(); }
- if($('#live-display').length) {
+ if($j('#live-network').length) { src = 'network'; liveUpdate(); }
+ if($j('#live-profile').length) { src = 'profile'; liveUpdate(); }
+ if($j('#live-community').length) { src = 'community'; liveUpdate(); }
+ if($j('#live-notes').length) { src = 'notes'; liveUpdate(); }
+ if($j('#live-display').length) {
if(liking) {
liking = 0;
window.location.href=window.location.href
}
}
- if($('#live-photos').length) {
+ if($j('#live-photos').length) {
if(liking) {
liking = 0;
window.location.href=window.location.href
}
function liveUpdate() {
- if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').hide(); return; }
- if(($('.comment-edit-text-full').length) || (in_progress)) {
+ if((src == null) || (stopped) || (! profile_uid)) { $j('.like-rotator').hide(); return; }
+ if(($j('.comment-edit-text-full').length) || (in_progress)) {
if(livetime) {
clearTimeout(livetime);
}
var udargs = ((netargs.length) ? '/' + netargs : '');
var update_url = 'update_' + src + udargs + '&p=' + profile_uid + '&page=' + profile_page + '&msie=' + ((msie) ? 1 : 0);
- $.get(update_url,function(data) {
+ $j.get(update_url,function(data) {
in_progress = false;
- // $('.collapsed-comments',data).each(function() {
- // var ident = $(this).attr('id');
- // var is_hidden = $('#' + ident).is(':hidden');
- // if($('#' + ident).length) {
- // $('#' + ident).replaceWith($(this));
+ // $j('.collapsed-comments',data).each(function() {
+ // var ident = $j(this).attr('id');
+ // var is_hidden = $j('#' + ident).is(':hidden');
+ // if($j('#' + ident).length) {
+ // $j('#' + ident).replaceWith($j(this));
// if(is_hidden)
- // $('#' + ident).hide();
+ // $j('#' + ident).hide();
// }
//});
// add a new thread
- $('.tread-wrapper',data).each(function() {
- var ident = $(this).attr('id');
+ $j('.tread-wrapper',data).each(function() {
+ var ident = $j(this).attr('id');
- if($('#' + ident).length == 0 && profile_page == 1) {
- $('img',this).each(function() {
- $(this).attr('src',$(this).attr('dst'));
+ if($j('#' + ident).length == 0 && profile_page == 1) {
+ $j('img',this).each(function() {
+ $j(this).attr('src',$j(this).attr('dst'));
});
- $('#' + prev).after($(this));
+ $j('#' + prev).after($j(this));
}
else {
- $('img',this).each(function() {
- $(this).attr('src',$(this).attr('dst'));
+ $j('img',this).each(function() {
+ $j(this).attr('src',$j(this).attr('dst'));
});
- $('#' + ident).replaceWith($(this));
+ $j('#' + ident).replaceWith($j(this));
}
prev = ident;
});
/*prev = 'live-' + src;
- $('.wall-item-outside-wrapper',data).each(function() {
- var ident = $(this).attr('id');
+ $j('.wall-item-outside-wrapper',data).each(function() {
+ var ident = $j(this).attr('id');
- if($('#' + ident).length == 0 && prev != 'live-' + src) {
- $('img',this).each(function() {
- $(this).attr('src',$(this).attr('dst'));
+ if($j('#' + ident).length == 0 && prev != 'live-' + src) {
+ $j('img',this).each(function() {
+ $j(this).attr('src',$j(this).attr('dst'));
});
- $('#' + prev).after($(this));
+ $j('#' + prev).after($j(this));
}
else {
- $('#' + ident + ' ' + '.wall-item-ago').replaceWith($(this).find('.wall-item-ago'));
- if($('#' + ident + ' ' + '.comment-edit-text-empty').length)
- $('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($(this).find('.wall-item-comment-wrapper'));
- $('#' + ident + ' ' + '.hide-comments-total').replaceWith($(this).find('.hide-comments-total'));
- $('#' + ident + ' ' + '.wall-item-like').replaceWith($(this).find('.wall-item-like'));
- $('#' + ident + ' ' + '.wall-item-dislike').replaceWith($(this).find('.wall-item-dislike'));
- $('#' + ident + ' ' + '.my-comment-photo').each(function() {
- $(this).attr('src',$(this).attr('dst'));
+ $j('#' + ident + ' ' + '.wall-item-ago').replaceWith($j(this).find('.wall-item-ago'));
+ if($j('#' + ident + ' ' + '.comment-edit-text-empty').length)
+ $j('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($j(this).find('.wall-item-comment-wrapper'));
+ $j('#' + ident + ' ' + '.hide-comments-total').replaceWith($j(this).find('.hide-comments-total'));
+ $j('#' + ident + ' ' + '.wall-item-like').replaceWith($j(this).find('.wall-item-like'));
+ $j('#' + ident + ' ' + '.wall-item-dislike').replaceWith($j(this).find('.wall-item-dislike'));
+ $j('#' + ident + ' ' + '.my-comment-photo').each(function() {
+ $j(this).attr('src',$j(this).attr('dst'));
});
}
prev = ident;
});*/
- $('.like-rotator').hide();
+ $j('.like-rotator').hide();
if(commentBusy) {
commentBusy = false;
- $('body').css('cursor', 'auto');
+ $j('body').css('cursor', 'auto');
}
/* autocomplete @nicknames */
- $(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl");
+ $j(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl");
});
}
function imgbright(node) {
- $(node).removeClass("drophide").addClass("drop");
+ $j(node).removeClass("drophide").addClass("drop");
}
function imgdull(node) {
- $(node).removeClass("drop").addClass("drophide");
+ $j(node).removeClass("drop").addClass("drophide");
}
// Since our ajax calls are asynchronous, we will give a few
function dolike(ident,verb) {
unpause();
- $('#like-rotator-' + ident.toString()).show();
- $.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate );
+ $j('#like-rotator-' + ident.toString()).show();
+ $j.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate );
// if(timer) clearTimeout(timer);
// timer = setTimeout(NavUpdate,3000);
liking = 1;
function dostar(ident) {
ident = ident.toString();
- //$('#like-rotator-' + ident).show();
- $.get('starred/' + ident, function(data) {
+ //$j('#like-rotator-' + ident).show();
+ $j.get('starred/' + ident, function(data) {
if(data.match(/1/)) {
- $('#starred-' + ident).addClass('starred');
- $('#starred-' + ident).removeClass('unstarred');
- $('#star-' + ident).addClass('hidden');
- $('#unstar-' + ident).removeClass('hidden');
+ $j('#starred-' + ident).addClass('starred');
+ $j('#starred-' + ident).removeClass('unstarred');
+ $j('#star-' + ident).addClass('hidden');
+ $j('#unstar-' + ident).removeClass('hidden');
}
else {
- $('#starred-' + ident).addClass('unstarred');
- $('#starred-' + ident).removeClass('starred');
- $('#star-' + ident).removeClass('hidden');
- $('#unstar-' + ident).addClass('hidden');
+ $j('#starred-' + ident).addClass('unstarred');
+ $j('#starred-' + ident).removeClass('starred');
+ $j('#star-' + ident).removeClass('hidden');
+ $j('#unstar-' + ident).addClass('hidden');
}
- //$('#like-rotator-' + ident).hide();
+ //$j('#like-rotator-' + ident).hide();
});
}
}
else {
lockvisible = true;
- $.get('lockview/' + id, function(data) {
- $('#panel').html(data);
- $('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5});
- $('#panel').show();
+ $j.get('lockview/' + id, function(data) {
+ $j('#panel').html(data);
+ $j('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5});
+ $j('#panel').show();
});
}
}
function lockviewhide() {
lockvisible = false;
- $('#panel').hide();
+ $j('#panel').hide();
}
function post_comment(id) {
unpause();
commentBusy = true;
- $('body').css('cursor', 'wait');
- $("#comment-preview-inp-" + id).val("0");
- $.post(
+ $j('body').css('cursor', 'wait');
+ $j("#comment-preview-inp-" + id).val("0");
+ $j.post(
"item",
- $("#comment-edit-form-" + id).serialize(),
+ $j("#comment-edit-form-" + id).serialize(),
function(data) {
if(data.success) {
- $("#comment-edit-wrapper-" + id).hide();
- $("#comment-edit-text-" + id).val('');
+ $j("#comment-edit-wrapper-" + id).hide();
+ $j("#comment-edit-text-" + id).val('');
var tarea = document.getElementById("comment-edit-text-" + id);
if(tarea)
commentClose(tarea,id);
function preview_comment(id) {
- $("#comment-preview-inp-" + id).val("1");
- $("#comment-edit-preview-" + id).show();
- $.post(
+ $j("#comment-preview-inp-" + id).val("1");
+ $j("#comment-edit-preview-" + id).show();
+ $j.post(
"item",
- $("#comment-edit-form-" + id).serialize(),
+ $j("#comment-edit-form-" + id).serialize(),
function(data) {
if(data.preview) {
- $("#comment-edit-preview-" + id).html(data.preview);
- $("#comment-edit-preview-" + id + " a").click(function() { return false; });
+ $j("#comment-edit-preview-" + id).html(data.preview);
+ $j("#comment-edit-preview-" + id + " a").click(function() { return false; });
}
},
"json"
function preview_post() {
- $("#jot-preview").val("1");
- $("#jot-preview-content").show();
+ $j("#jot-preview").val("1");
+ $j("#jot-preview-content").show();
tinyMCE.triggerSave();
- $.post(
+ $j.post(
"item",
- $("#profile-jot-form").serialize(),
+ $j("#profile-jot-form").serialize(),
function(data) {
if(data.preview) {
- $("#jot-preview-content").html(data.preview);
- $("#jot-preview-content" + " a").click(function() { return false; });
+ $j("#jot-preview-content").html(data.preview);
+ $j("#jot-preview-content" + " a").click(function() { return false; });
}
},
"json"
);
- $("#jot-preview").val("0");
+ $j("#jot-preview").val("0");
return true;
}
// unpause auto reloads if they are currently stopped
totStopped = false;
stopped = false;
- $('#pause').html('');
+ $j('#pause').html('');
}
}
function groupChangeMember(gid, cid, sec_token) {
- $('body .fakelink').css('cursor', 'wait');
- $.get('group/' + gid + '/' + cid + "?t=" + sec_token, function(data) {
- $('#group-update-wrapper').html(data);
- $('body .fakelink').css('cursor', 'auto');
+ $j('body .fakelink').css('cursor', 'wait');
+ $j.get('group/' + gid + '/' + cid + "?t=" + sec_token, function(data) {
+ $j('#group-update-wrapper').html(data);
+ $j('body .fakelink').css('cursor', 'auto');
});
}
function profChangeMember(gid,cid) {
- $('body .fakelink').css('cursor', 'wait');
- $.get('profperm/' + gid + '/' + cid, function(data) {
- $('#prof-update-wrapper').html(data);
- $('body .fakelink').css('cursor', 'auto');
+ $j('body .fakelink').css('cursor', 'wait');
+ $j.get('profperm/' + gid + '/' + cid, function(data) {
+ $j('#prof-update-wrapper').html(data);
+ $j('body .fakelink').css('cursor', 'auto');
});
}
function contactgroupChangeMember(gid,cid) {
- $('body').css('cursor', 'wait');
- $.get('contactgroup/' + gid + '/' + cid, function(data) {
- $('body').css('cursor', 'auto');
+ $j('body').css('cursor', 'wait');
+ $j.get('contactgroup/' + gid + '/' + cid, function(data) {
+ $j('body').css('cursor', 'auto');
});
}
function checkboxhighlight(box) {
- if($(box).is(':checked')) {
- $(box).addClass('checkeditem');
+ if($j(box).is(':checked')) {
+ $j(box).addClass('checkeditem');
}
else {
- $(box).removeClass('checkeditem');
+ $j(box).removeClass('checkeditem');
}
}
function notifyMarkAll() {
- $.get('notify/mark/all', function(data) {
+ $j.get('notify/mark/all', function(data) {
if(timer) clearTimeout(timer);
timer = setTimeout(NavUpdate,1000);
});
};
function previewTheme(elm) {
- theme = $(elm).val();
- $.getJSON('pretheme?f=&theme=' + theme,function(data) {
- $('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div><a href="' + data.img + '"><img src="' + data.img + '" width="320" height="240" alt="' + theme + '" /></a>');
+ theme = $j(elm).val();
+ $j.getJSON('pretheme?f=&theme=' + theme,function(data) {
+ $j('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div><a href="' + data.img + '"><img src="' + data.img + '" width="320" height="240" alt="' + theme + '" /></a>');
});
}
--- /dev/null
+function openClose(e){document.getElementById(e).style.display=="block"?document.getElementById(e).style.display="none":document.getElementById(e).style.display="block"}function openMenu(e){document.getElementById(e).style.display="block"}function closeMenu(e){document.getElementById(e).style.display="none"}function NavUpdate(){if(!stopped){var e="ping"+(localUser!=0?"?f=&uid="+localUser:"");$j.get(e,function(e){$j(e).find("result").each(function(){$j("nav").trigger("nav-update",this),$j("#live-network").length&&(src="network",liveUpdate()),$j("#live-profile").length&&(src="profile",liveUpdate()),$j("#live-community").length&&(src="community",liveUpdate()),$j("#live-notes").length&&(src="notes",liveUpdate()),$j("#live-display").length&&liking&&(liking=0,window.location.href=window.location.href),$j("#live-photos").length&&liking&&(liking=0,window.location.href=window.location.href)})})}timer=setTimeout(NavUpdate,updateInterval)}function liveUpdate(){if(src==null||stopped||!profile_uid){$j(".like-rotator").hide();return}if($j(".comment-edit-text-full").length||in_progress){livetime&&clearTimeout(livetime),livetime=setTimeout(liveUpdate,1e4);return}livetime!=null&&(livetime=null),prev="live-"+src,in_progress=!0;var e=netargs.length?"/"+netargs:"",t="update_"+src+e+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$j.get(t,function(e){in_progress=!1,$j(".tread-wrapper",e).each(function(){var e=$j(this).attr("id");$j("#"+e).length==0&&profile_page==1?($j("img",this).each(function(){$j(this).attr("src",$j(this).attr("dst"))}),$j("#"+prev).after($j(this))):($j("img",this).each(function(){$j(this).attr("src",$j(this).attr("dst"))}),$j("#"+e).replaceWith($j(this))),prev=e}),$j(".like-rotator").hide(),commentBusy&&(commentBusy=!1,$j("body").css("cursor","auto")),$j(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl")})}function imgbright(e){$j(e).removeClass("drophide").addClass("drop")}function imgdull(e){$j(e).removeClass("drop").addClass("drophide")}function dolike(e,t){unpause(),$j("#like-rotator-"+e.toString()).show(),$j.get("like/"+e.toString()+"?verb="+t,NavUpdate),liking=1}function dostar(e){e=e.toString(),$j.get("starred/"+e,function(t){t.match(/1/)?($j("#starred-"+e).addClass("starred"),$j("#starred-"+e).removeClass("unstarred"),$j("#star-"+e).addClass("hidden"),$j("#unstar-"+e).removeClass("hidden")):($j("#starred-"+e).addClass("unstarred"),$j("#starred-"+e).removeClass("starred"),$j("#star-"+e).removeClass("hidden"),$j("#unstar-"+e).addClass("hidden"))})}function getPosition(e){var t={x:0,y:0};if(e.pageX||e.pageY)t.x=e.pageX,t.y=e.pageY;else if(e.clientX||e.clientY)t.x=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft,t.y=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop;else if(e.x||e.y)t.x=e.x,t.y=e.y;return t}function lockview(e,t){e=e||window.event,cursor=getPosition(e),lockvisible?lockviewhide():(lockvisible=!0,$j.get("lockview/"+t,function(e){$j("#panel").html(e),$j("#panel").css({left:cursor.x+5,top:cursor.y+5}),$j("#panel").show()}))}function lockviewhide(){lockvisible=!1,$j("#panel").hide()}function post_comment(e){return unpause(),commentBusy=!0,$j("body").css("cursor","wait"),$j("#comment-preview-inp-"+e).val("0"),$j.post("item",$j("#comment-edit-form-"+e).serialize(),function(t){if(t.success){$j("#comment-edit-wrapper-"+e).hide(),$j("#comment-edit-text-"+e).val("");var n=document.getElementById("comment-edit-text-"+e);n&&commentClose(n,e),timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,10)}t.reload&&(window.location.href=t.reload)},"json"),!1}function preview_comment(e){return $j("#comment-preview-inp-"+e).val("1"),$j("#comment-edit-preview-"+e).show(),$j.post("item",$j("#comment-edit-form-"+e).serialize(),function(t){t.preview&&($j("#comment-edit-preview-"+e).html(t.preview),$j("#comment-edit-preview-"+e+" a").click(function(){return!1}))},"json"),!0}function preview_post(){return $j("#jot-preview").val("1"),$j("#jot-preview-content").show(),tinyMCE.triggerSave(),$j.post("item",$j("#profile-jot-form").serialize(),function(e){e.preview&&($j("#jot-preview-content").html(e.preview),$j("#jot-preview-content a").click(function(){return!1}))},"json"),$j("#jot-preview").val("0"),!0}function unpause(){totStopped=!1,stopped=!1,$j("#pause").html("")}function bin2hex(e){var t,n,r=0,i=[];e+="",r=e.length;for(n=0;n<r;n++)i[n]=e.charCodeAt(n).toString(16).replace(/^([\da-f])$/,"0$1");return i.join("")}function groupChangeMember(e,t,n){$j("body .fakelink").css("cursor","wait"),$j.get("group/"+e+"/"+t+"?t="+n,function(e){$j("#group-update-wrapper").html(e),$j("body .fakelink").css("cursor","auto")})}function profChangeMember(e,t){$j("body .fakelink").css("cursor","wait"),$j.get("profperm/"+e+"/"+t,function(e){$j("#prof-update-wrapper").html(e),$j("body .fakelink").css("cursor","auto")})}function contactgroupChangeMember(e,t){$j("body").css("cursor","wait"),$j.get("contactgroup/"+e+"/"+t,function(e){$j("body").css("cursor","auto")})}function checkboxhighlight(e){$j(e).is(":checked")?$j(e).addClass("checkeditem"):$j(e).removeClass("checkeditem")}function notifyMarkAll(){$j.get("notify/mark/all",function(e){timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,1e3)})}function fcFileBrowser(e,t,n,r){var i=baseurl+"/fbrowser/"+n+"/";return tinyMCE.activeEditor.windowManager.open({file:i,title:"File Browser",width:420,height:400,resizable:"yes",inline:"yes",close_previous:"no"},{window:r,input:e}),!1}function setupFieldRichtext(){tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:"fieldRichtext",plugins:"bbcode,paste, inlinepopups",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",paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,file_browser_callback:"fcFileBrowser"})}function previewTheme(e){theme=$j(e).val(),$j.getJSON("pretheme?f=&theme="+theme,function(e){$j("#theme-preview").html('<div id="theme-desc">'+e.desc+'</div><div id="theme-version">'+e.version+'</div><div id="theme-credits">'+e.credits+'</div><a href="'+e.img+'"><img src="'+e.img+'" width="320" height="240" alt="'+theme+'" /></a>')})}var src=null,prev=null,livetime=null,msie=!1,stopped=!1,totStopped=!1,timer=null,pr=0,liking=0,in_progress=!1,langSelect=!1,commentBusy=!1,last_popup_menu=null,last_popup_button=null;$j(function(){function e(e){last_popup_menu&&"#"+last_popup_menu.attr("id")!==$j(e.target).attr("rel")&&(last_popup_menu.hide(),last_popup_menu.attr("id")=="nav-notifications-menu"&&$j("section").show(),last_popup_button.removeClass("selected"),last_popup_menu=null,last_popup_button=null)}$j.ajaxSetup({cache:!1}),msie=$j.browser.msie,$j(".onoff input").each(function(){val=$j(this).val(),id=$j(this).attr("id"),$j("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")}),$j(".onoff > a").click(function(e){e.preventDefault();var t=$j(this).siblings("input"),n=1-t.val(),r=t.attr("id");$j("#"+r+"_onoff ."+(n==0?"on":"off")).addClass("hidden"),$j("#"+r+"_onoff ."+(n==1?"on":"off")).removeClass("hidden"),t.val(n)}),$j("img[rel^=#]").click(function(t){return e(t),menu=$j($j(this).attr("rel")),t.preventDefault(),t.stopPropagation(),menu.attr("popup")=="false"?!1:(menu.css("display")=="none"?($j(this).parent().addClass("selected"),menu.show(),menu.attr("id")=="nav-notifications-menu"&&$j("section").hide(),last_popup_menu=menu,last_popup_button=$j(this).parent()):($j(this).parent().removeClass("selected"),menu.hide(),menu.attr("id")=="nav-notifications-menu"&&$j("section").show(),last_popup_menu=null,last_popup_button=null),!1)}),$j("html").click(function(t){e(t)});var t=unescape($j("#nav-notifications-template[rel=template]").html()),n=unescape($j("<div>").append($j("#nav-notifications-see-all").clone()).html()),r=unescape($j("<div>").append($j("#nav-notifications-mark-all").clone()).html()),i=unescape($j("#nav-notifications-menu").html());$j("nav").bind("nav-update",function(e,s){var o=$j(s).find("invalid").text();o==1&&(window.location.href=window.location.href);var u=$j(s).find("net").text();u==0?(u="",$j("#net-update").removeClass("show")):$j("#net-update").addClass("show"),$j("#net-update").html(u);var a=$j(s).find("home").text();a==0?(a="",$j("#home-update").removeClass("show")):$j("#home-update").addClass("show"),$j("#home-update").html(a);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update").removeClass("show")):$j("#intro-update").addClass("show"),$j("#intro-update").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update").removeClass("show")):$j("#mail-update").addClass("show"),$j("#mail-update").html(l);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update-li").removeClass("show")):$j("#intro-update-li").addClass("show"),$j("#intro-update-li").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update-li").removeClass("show")):$j("#mail-update-li").addClass("show"),$j("#mail-update-li").html(l);var c=$j(s).find("notif");c.children("note").length==0?$j("#nav-notifications-menu").html(i):(nnm=$j("#nav-notifications-menu"),nnm.html(n+r),c.children("note").each(function(){e=$j(this),text=e.text().format("<span class='contactname'>"+e.attr("name")+"</span>"),html=t.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen")),nnm.append(html)})),notif=c.attr("count"),notif>0?$j("#nav-notifications-linkmenu").addClass("on"):$j("#nav-notifications-linkmenu").removeClass("on"),notif==0?(notif="",$j("#notify-update").removeClass("show")):$j("#notify-update").addClass("show"),$j("#notify-update").html(notif);var h=$j(s).find("sysmsgs");h.children("notice").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"notice",life:1500})}),h.children("info").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"info",life:1e3})})}),NavUpdate()});var lockvisible=!1;String.prototype.format=function(){var e=this;for(var t=0;t<arguments.length;t++){var n=new RegExp("\\{"+t+"\\}","gi");e=e.replace(n,arguments[t])}return e},Array.prototype.remove=function(e){to=undefined,from=this.indexOf(e);var t=this.slice((to||from)+1||this.length);return this.length=from<0?this.length+from:from,this.push.apply(this,t)};
\ No newline at end of file
-$(document).ready(function() {
+$j(document).ready(function() {
-/*$('html').click(function() { $("#nav-notifications-menu" ).hide(); });*/
+ /* enable tinymce on focus and click */
+ $j("#profile-jot-text").focus(enableOnUser);
+ $j("#profile-jot-text").click(enableOnUser);
- $('.group-edit-icon').hover(
+ if(typeof window.AjaxUpload != "undefined") {
+ switch(window.ajaxType) {
+ case 'jot-header':
+ var uploader = new window.AjaxUpload(
+ 'wall-image-upload',
+ { action: 'wall_upload/'+window.nickname,
+ name: 'userfile',
+ onSubmit: function(file,ext) { $j('#profile-rotator').show(); },
+ onComplete: function(file,response) {
+ addeditortext(response);
+ $j('#profile-rotator').hide();
+ }
+ }
+ );
+
+ var file_uploader = new window.AjaxUpload(
+ 'wall-file-upload',
+ { action: 'wall_attach/'+window.nickname,
+ name: 'userfile',
+ onSubmit: function(file,ext) { $j('#profile-rotator').show(); },
+ onComplete: function(file,response) {
+ addeditortext(response);
+ $j('#profile-rotator').hide();
+ }
+ }
+ );
+ break;
+ case 'msg-header':
+ var uploader = new window.AjaxUpload(
+ 'prvmail-upload',
+ { action: 'wall_upload/' + window.nickname,
+ name: 'userfile',
+ onSubmit: function(file,ext) { $j('#profile-rotator').show(); },
+ onComplete: function(file,response) {
+ tinyMCE.execCommand('mceInsertRawHTML',false,response);
+ $j('#profile-rotator').hide();
+ }
+ }
+ );
+ break;
+ default:
+ break;
+ }
+ }
+
+ if(typeof acl=="undefined"){
+ acl = new ACL(
+ baseurl+"/acl",
+ [ window.allowCID,window.allowGID,window.denyCID,window.denyGID ]
+ );
+ }
+
+/*$j('html').click(function() { $j("#nav-notifications-menu" ).hide(); });*/
+
+ /*$j('.group-edit-icon').hover(
function() {
- $(this).addClass('icon'); $(this).removeClass('iconspacer');},
+ $j(this).addClass('icon'); $j(this).removeClass('iconspacer');},
function() {
- $(this).removeClass('icon'); $(this).addClass('iconspacer');}
+ $j(this).removeClass('icon'); $j(this).addClass('iconspacer');}
);
- $('.sidebar-group-element').hover(
+ $j('.sidebar-group-element').hover(
function() {
- id = $(this).attr('id');
- $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
+ id = $j(this).attr('id');
+ $j('#edit-' + id).addClass('icon'); $j('#edit-' + id).removeClass('iconspacer');},
function() {
- id = $(this).attr('id');
- $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
+ id = $j(this).attr('id');
+ $j('#edit-' + id).removeClass('icon');$j('#edit-' + id).addClass('iconspacer');}
);
- $('.savedsearchdrop').hover(
+ $j('.savedsearchdrop').hover(
function() {
- $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
+ $j(this).addClass('drop'); $j(this).addClass('icon'); $j(this).removeClass('iconspacer');},
function() {
- $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
+ $j(this).removeClass('drop'); $j(this).removeClass('icon'); $j(this).addClass('iconspacer');}
);
- $('.savedsearchterm').hover(
+ $j('.savedsearchterm').hover(
function() {
- id = $(this).attr('id');
- $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
+ id = $j(this).attr('id');
+ $j('#drop-' + id).addClass('icon'); $j('#drop-' + id).addClass('drophide'); $j('#drop-' + id).removeClass('iconspacer');},
function() {
- id = $(this).attr('id');
- $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
- );
+ id = $j(this).attr('id');
+ $j('#drop-' + id).removeClass('icon');$j('#drop-' + id).removeClass('drophide'); $j('#drop-' + id).addClass('iconspacer');}
+ );*/
+
+ if(window.aclType == "event_head") {
+ $j('#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) {
+ $j("#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]);
+ }
+
+ if(window.aclType == "settings-head" || window.aclType == "photos_head" || window.aclType == "event_head") {
+ $j('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
+ var selstr;
+ $j('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
+ selstr = $j(this).text();
+ $j('#jot-perms-icon').removeClass('unlock').addClass('lock');
+ $j('#jot-public').hide();
+ });
+ if(selstr == null) {
+ $j('#jot-perms-icon').removeClass('lock').addClass('unlock');
+ $j('#jot-public').show();
+ }
+
+ }).trigger('change');
+ }
+
+ switch(window.autocompleteType) {
+ case 'msg-header':
+ var a = $j("#recip").autocomplete({
+ serviceUrl: baseurl + '/acl',
+ minChars: 2,
+ width: 350,
+ onSelect: function(value,data) {
+ $j("#recip-complete").val(data);
+ }
+ });
+ break;
+ case 'contacts-head':
+ var a = $j("#contacts-search").autocomplete({
+ serviceUrl: baseurl + '/acl',
+ minChars: 2,
+ width: 350,
+ });
+ a.setOptions({ params: { type: 'a' }});
+ break;
+ default:
+ break;
+ }
- $(".popupbox").click(function () {
- var parent = $( $(this).attr('href') ).parent();
+
+ $j('#event-share-checkbox').change(function() {
+
+ if ($j('#event-share-checkbox').is(':checked')) {
+ $j('#acl-wrapper').show();
+ }
+ else {
+ $j('#acl-wrapper').hide();
+ }
+ }).trigger('change');
+
+
+ $j(".popupbox").click(function () {
+ var parent = $j( $j(this).attr('href') ).parent();
if (parent.css('display') == 'none') {
parent.show();
} else {
});
+// update pending count //
+$j(function(){
+
+ $j("nav").bind('nav-update', function(e,data){
+ var elm = $j('#pending-update');
+ var register = $j(data).find('register').text();
+ if (register=="0") { register=""; elm.hide();} else { elm.show(); }
+ elm.html(register);
+ });
+});
+
+
function insertFormatting(comment,BBcode,id) {
- var tmpStr = $("#comment-edit-text-" + id).val();
- if(tmpStr == comment) {
- tmpStr = "";
- $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
- $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
- openMenu("comment-edit-submit-wrapper-" + id);
- $("#comment-edit-text-" + id).val(tmpStr);
- }
+ var tmpStr = $j("#comment-edit-text-" + id).val();
+ if(tmpStr == comment) {
+ tmpStr = "";
+ $j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+ $j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+ openMenu("comment-edit-submit-wrapper-" + id);
+ $j("#comment-edit-text-" + id).val(tmpStr);
+ }
textarea = document.getElementById("comment-edit-text-" +id);
if (document.selection) {
}
function cmtBbOpen(id) {
- $(".comment-edit-bb-" + id).show();
+ $j(".comment-edit-bb-" + id).show();
}
function cmtBbClose(id) {
- $(".comment-edit-bb-" + id).hide();
+ $j(".comment-edit-bb-" + id).hide();
}
-// TinyMCE stuff
-// Needs to be in "jot-header.tpl" if the "$editselect" variable is used
-
var editor=false;
var textlen = 0;
-var plaintext = 'none';//'$editselect';
+var plaintext = 'none';//window.editSelect;
+ var ispublic = window.isPublic;
function initEditor(cb){
if (editor==false){
-// $("#profile-jot-text-loading").show();
+// $j("#profile-jot-text-loading").show();
if(plaintext == 'none') {
-// $("#profile-jot-text-loading").hide();
- $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
- $("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
+// $j("#profile-jot-text-loading").hide();
+ $j("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
+ $j("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
editor = true;
-/* $("a#jot-perms-icon").fancybox({
+/* $j("a#jot-perms-icon").fancybox({
'transitionIn' : 'none',
'transitionOut' : 'none'
});*/
- $("a#jot-perms-icon, a#settings-default-perms-menu").click(function () {
- var parent = $("#profile-jot-acl-wrapper").parent();
+ $j("a#jot-perms-icon, a#settings-default-perms-menu").click(function () {
+ var parent = $j("#profile-jot-acl-wrapper").parent();
if (parent.css('display') == 'none') {
parent.show();
} else {
parent.hide();
}
-// $("#profile-jot-acl-wrapper").parent().toggle();
+// $j("#profile-jot-acl-wrapper").parent().toggle();
return false;
});
- $(".jothidden").show();
+ $j(".jothidden").show();
if (typeof cb!="undefined") cb();
return;
}
/* tinyMCE.init({
theme : "advanced",
mode : "specific_textareas",
- editor_selector: $editselect,
+ editor_selector: window.editSelect,
auto_focus: "profile-jot-text",
plugins : "bbcode,paste,autoresize, inlinepopups",
theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,formatselect,code",
}
textlen = txt.length;
- if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
- $('#profile-jot-desc').html(ispublic);
+ if(textlen != 0 && $j('#jot-perms-icon').is('.unlock')) {
+ $j('#profile-jot-desc').html(ispublic);
}
else {
- $('#profile-jot-desc').html(' ');
+ $j('#profile-jot-desc').html(' ');
}
//Character count
if(textlen <= 140) {
- $('#character-counter').removeClass('red');
- $('#character-counter').removeClass('orange');
- $('#character-counter').addClass('grey');
+ $j('#character-counter').removeClass('red');
+ $j('#character-counter').removeClass('orange');
+ $j('#character-counter').addClass('grey');
}
if((textlen > 140) && (textlen <= 420)) {
- $('#character-counter').removeClass('grey');
- $('#character-counter').removeClass('red');
- $('#character-counter').addClass('orange');
+ $j('#character-counter').removeClass('grey');
+ $j('#character-counter').removeClass('red');
+ $j('#character-counter').addClass('orange');
}
if(textlen > 420) {
- $('#character-counter').removeClass('grey');
- $('#character-counter').removeClass('orange');
- $('#character-counter').addClass('red');
+ $j('#character-counter').removeClass('grey');
+ $j('#character-counter').removeClass('orange');
+ $j('#character-counter').addClass('red');
}
- $('#character-counter').text(textlen);
+ $j('#character-counter').text(textlen);
});
ed.onInit.add(function(ed) {
ed.pasteAsPlainText = true;
- $("#profile-jot-text-loading").hide();
- $(".jothidden").show();
+ $j("#profile-jot-text-loading").hide();
+ $j(".jothidden").show();
if (typeof cb!="undefined") cb();
});
});
editor = true;
// setup acl popup
- $("a#jot-perms-icon").fancybox({
+ $j("a#jot-perms-icon").fancybox({
'transitionIn' : 'elastic',
'transitionOut' : 'elastic'
}); */
function enableOnUser(){
if (editor) return;
- $(this).val("");
+ $j(this).val("");
initEditor();
}
+function wallInitEditor() {
+ var plaintext = window.editSelect;
+
+ if(plaintext != 'none') {
+ tinyMCE.init({
+ theme : "advanced",
+ mode : "specific_textareas",
+ editor_selector: /(profile-jot-text|prvmail-text)/,
+ plugins : "bbcode,paste",
+ 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_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 : '',
+ convert_urls: false,
+ content_css: baseurl + "/view/custom_tinymce.css",
+ //Character count
+ theme_advanced_path : false,
+ setup : function(ed) {
+ ed.onInit.add(function(ed) {
+ ed.pasteAsPlainText = true;
+ var editorId = ed.editorId;
+ var textarea = $j('#'+editorId);
+ if (typeof(textarea.attr('tabindex')) != "undefined") {
+ $j('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex'));
+ textarea.attr('tabindex', null);
+ }
+ });
+ }
+ });
+ }
+ else
+ $j("#prvmail-text").contact_autocomplete(baseurl+"/acl");
+}
+
+
+
+
+function initCrop() {
+ function onEndCrop( coords, dimensions ) {
+ $( 'x1' ).value = coords.x1;
+ $( 'y1' ).value = coords.y1;
+ $( 'x2' ).value = coords.x2;
+ $( 'y2' ).value = coords.y2;
+ $( 'width' ).value = dimensions.width;
+ $( 'height' ).value = dimensions.height;
+ }
+
+ Event.observe( window, 'load', function() {
+ new Cropper.ImgWithPreview(
+ 'croppa',
+ {
+ previewWrap: 'previewWrap',
+ minWidth: 175,
+ minHeight: 175,
+ maxWidth: 640,
+ maxHeight: 640,
+ ratioDim: { x: 100, y:100 },
+ displayOnInit: true,
+ onEndCrop: onEndCrop
+ });
+ });
+}
+
+
+function confirmDelete() { return confirm(window.delItem); }
+function commentOpen(obj,id) {
+ if(obj.value == window.commentEmptyText) {
+ obj.value = "";
+ $j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+ $j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+ $j("#mod-cmnt-wrap-" + id).show();
+ openMenu("comment-edit-submit-wrapper-" + id);
+ }
+}
+function commentClose(obj,id) {
+ if(obj.value == "") {
+ obj.value = window.commentEmptyText;
+ $j("#comment-edit-text-" + id).removeClass("comment-edit-text-full");
+ $j("#comment-edit-text-" + id).addClass("comment-edit-text-empty");
+ $j("#mod-cmnt-wrap-" + id).hide();
+ closeMenu("comment-edit-submit-wrapper-" + id);
+ }
+}
+
+
+function commentInsert(obj,id) {
+ var tmpStr = $j("#comment-edit-text-" + id).val();
+ if(tmpStr == window.commentEmptyText) {
+ tmpStr = "";
+ $j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+ $j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+ openMenu("comment-edit-submit-wrapper-" + id);
+ }
+ var ins = $j(obj).html();
+ ins = ins.replace("<","<");
+ ins = ins.replace(">",">");
+ ins = ins.replace("&","&");
+ ins = ins.replace(""",'"');
+ $j("#comment-edit-text-" + id).val(tmpStr + ins);
+}
+
+function qCommentInsert(obj,id) {
+ var tmpStr = $j("#comment-edit-text-" + id).val();
+ if(tmpStr == window.commentEmptyText) {
+ tmpStr = "";
+ $j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+ $j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+ openMenu("comment-edit-submit-wrapper-" + id);
+ }
+ var ins = $j(obj).val();
+ ins = ins.replace("<","<");
+ ins = ins.replace(">",">");
+ ins = ins.replace("&","&");
+ ins = ins.replace(""",'"');
+ $j("#comment-edit-text-" + id).val(tmpStr + ins);
+ $j(obj).val("");
+}
+
+function showHideComments(id) {
+ if( $j("#collapsed-comments-" + id).is(":visible")) {
+ $j("#collapsed-comments-" + id).hide();
+ $j("#hide-comments-" + id).html(window.showMore);
+ }
+ else {
+ $j("#collapsed-comments-" + id).show();
+ $j("#hide-comments-" + id).html(window.showFewer);
+ }
+}
+
+
+/*function deleteCheckedItems() {
+ var checkedstr = '';
+
+ $j('.item-select').each( function() {
+ if($j(this).is(':checked')) {
+ if(checkedstr.length != 0) {
+ checkedstr = checkedstr + ',' + $j(this).val();
+ }
+ else {
+ checkedstr = $j(this).val();
+ }
+ }
+ });
+ $j.post('item', { dropitems: checkedstr }, function(data) {
+ window.location.reload();
+ });
+}*/
+
+function jotVideoURL() {
+ reply = prompt(window.vidURL);
+ if(reply && reply.length) {
+ addeditortext('[video]' + reply + '[/video]');
+ }
+}
+
+function jotAudioURL() {
+ reply = prompt(window.audURL);
+ if(reply && reply.length) {
+ addeditortext('[audio]' + reply + '[/audio]');
+ }
+}
+
+
+function jotGetLocation() {
+ reply = prompt(window.whereAreU, $j('#jot-location').val());
+ if(reply && reply.length) {
+ $j('#jot-location').val(reply);
+ }
+}
+
+function jotShare(id) {
+ if ($j('#jot-popup').length != 0) $j('#jot-popup').show();
+
+ $j('#like-rotator-' + id).show();
+ $j.get('share/' + id, function(data) {
+ if (!editor) $j("#profile-jot-text").val("");
+ initEditor(function(){
+ addeditortext(data);
+ $j('#like-rotator-' + id).hide();
+ $j(window).scrollTop(0);
+ });
+
+ });
+}
+
+function linkdropper(event) {
+ var linkFound = event.dataTransfer.types.contains("text/uri-list");
+ if(linkFound)
+ event.preventDefault();
+}
+
+switch(window.ajaxType) {
+ case 'jot-header':
+ function jotGetLink() {
+ reply = prompt(window.linkURL);
+ if(reply && reply.length) {
+ reply = bin2hex(reply);
+ $j('#profile-rotator').show();
+ $j.get('parse_url?binurl=' + reply, function(data) {
+ addeditortext(data);
+ $j('#profile-rotator').hide();
+ });
+ }
+ }
+
+ function linkdrop(event) {
+ var reply = event.dataTransfer.getData("text/uri-list");
+ event.target.textContent = reply;
+ event.preventDefault();
+ if(reply && reply.length) {
+ reply = bin2hex(reply);
+ $j('#profile-rotator').show();
+ $j.get('parse_url?binurl=' + reply, function(data) {
+ if (!editor) $j("#profile-jot-text").val("");
+ initEditor(function(){
+ addeditortext(data);
+ $j('#profile-rotator').hide();
+ });
+ });
+ }
+ }
+ break;
+ case 'msg-header':
+ case 'wallmsg-header':
+// TINYMCE -- BAD
+ function jotGetLink() {
+ reply = prompt(window.linkURL);
+ if(reply && reply.length) {
+ $j('#profile-rotator').show();
+ $j.get('parse_url?url=' + reply, function(data) {
+ tinyMCE.execCommand('mceInsertRawHTML',false,data);
+ $j('#profile-rotator').hide();
+ });
+ }
+ }
+
+ function linkdrop(event) {
+ var reply = event.dataTransfer.getData("text/uri-list");
+ event.target.textContent = reply;
+ event.preventDefault();
+ if(reply && reply.length) {
+ $j('#profile-rotator').show();
+ $j.get('parse_url?url=' + reply, function(data) {
+ tinyMCE.execCommand('mceInsertRawHTML',false,data);
+ $j('#profile-rotator').hide();
+ });
+ }
+ }
+
+ break;
+ default:
+ break;
+}
+
+function showEvent(eventid) {
+/* $j.get(
+ baseurl + '/events/?id='+eventid,
+ function(data){
+ $j.fancybox(data);
+ }
+ );*/
+}
+
+
+function itemTag(id) {
+ reply = prompt(window.term);
+ if(reply && reply.length) {
+ reply = reply.replace('#','');
+ if(reply.length) {
+
+ commentBusy = true;
+ $j('body').css('cursor', 'wait');
+
+ $j.get('tagger/' + id + '?term=' + reply, NavUpdate);
+ /*if(timer) clearTimeout(timer);
+ timer = setTimeout(NavUpdate,3000);*/
+ liking = 1;
+ }
+ }
+}
+
+function itemFiler(id) {
+
+ $j.get('filer/', function(data){
+
+ var promptText = $j('#id_term_label', data).text();
+
+ reply = prompt(promptText);
+ if(reply && reply.length) {
+ commentBusy = true;
+ $j('body').css('cursor', 'wait');
+ $j.get('filer/' + id + '?term=' + reply, NavUpdate);
+/* if(timer) clearTimeout(timer);
+ timer = setTimeout(NavUpdate,3000);*/
+ liking = 1;
+/* $j.fancybox.close();*/
+ }
+ });
+
+/* var bordercolor = $j("input").css("border-color");
+
+ $j.get('filer/', function(data){
+ $j.fancybox(data);
+ $j("#id_term").keypress(function(){
+ $j(this).css("border-color",bordercolor);
+ })
+ $j("#select_term").change(function(){
+ $j("#id_term").css("border-color",bordercolor);
+ })
+
+ $j("#filer_save").click(function(e){
+ e.preventDefault();
+ reply = $j("#id_term").val();
+ if(reply && reply.length) {
+ commentBusy = true;
+ $j('body').css('cursor', 'wait');
+ $j.get('filer/' + id + '?term=' + reply);
+ if(timer) clearTimeout(timer);
+ timer = setTimeout(NavUpdate,3000);
+ liking = 1;
+ $j.fancybox.close();
+ } else {
+ $j("#id_term").css("border-color","#FF0000");
+ }
+ return false;
+ });
+ });
+*/
+}
+
+function jotClearLocation() {
+ $j('#jot-coord').val('');
+ $j('#profile-nolocation-wrapper').hide();
+}
+
+function addeditortext(data) {
+ if(plaintext == 'none') {
+ var currentText = $j("#profile-jot-text").val();
+ $j("#profile-jot-text").val(currentText + data);
+ }
+ /*else
+ tinyMCE.execCommand('mceInsertRawHTML',false,data);*/
+}
+
+if(typeof window.geoTag === 'function') window.geoTag();
+
+
+++ /dev/null
-$(document).ready(function() {
-
- $.ajaxSetup({
- cache: false
- });
-
-
- $('.system-menu-link').click(function() {
- handleNavMenu('#system-menu-list');
- return false;
- });
-
- $('.contacts-menu-link').click(function() {
- handleNavMenu('#contacts-menu-list');
- return false;
- });
-
- $('.network-menu-link').click(function() {
- handleNavMenu('#network-menu-list');
- return false;
- });
-
-/* $('.nav-load-page-link').click(function() {
- getPageContent( $(this).attr('href') );
- hideNavMenu( '#' + $(this).closest('ul').attr('id') );
- return false;
- });*/
-
-/* $('#nav-network-link').click(function() {
- getPageContent('/network', '#network-menu-list');
- return false;
- });
-
- $('#nav-home-link').click(function() {
-
- var username = $('#site-location').text();
- username = username.substring(0, username.indexOf('@'));
-
- getPageContent('/profile/' + username, '#network-menu-list');
-
- return false;
- });
-
- $('#nav-community-link').click(function() {
- getPageContent('/community', '#network-menu-list');
- return false;
- });
-
- $('#nav-messages-link').click(function() {
- getPageContent('/message');
- return false;
- });
-
- $('#nav-contacts-link').click(function() {
- getPageContent('/contacts', '#contacts-menu-list');
- return false;
- });*/
-
-});
-
-$(document).mouseup(function (clickPos) {
-
- var sysMenu = $("#system-menu-list");
- var sysMenuLink = $(".system-menu-link");
- var contactsMenu = $("#contacts-menu-list");
- var contactsMenuLink = $(".contacts-menu-link");
- var networkMenu = $("#network-menu-list");
- var networkMenuLink = $(".network-menu-link");
-
- if( !sysMenu.is(clickPos.target) && !sysMenuLink.is(clickPos.target) && sysMenu.has(clickPos.target).length === 0) {
- hideNavMenu("#system-menu-list");
- }
- if( !contactsMenu.is(clickPos.target) && !contactsMenuLink.is(clickPos.target) && contactsMenu.has(clickPos.target).length === 0) {
- hideNavMenu("#contacts-menu-list");
- }
- if( !networkMenu.is(clickPos.target) && !networkMenuLink.is(clickPos.target) && networkMenu.has(clickPos.target).length === 0) {
- hideNavMenu("#network-menu-list");
- }
-});
-
-
-function getPageContent(url) {
-
- var pos = $('.main-container').position();
-
- $('.main-container').css('margin-left', pos.left);
- $('.main-content-container').hide(0, function () {
- $('.main-content-loading').show(0);
- });
-
- $.get(url, function(html) {
- console.log($('.main-content-container').html());
- $('.main-content-container').html( $('.main-content-container', html).html() );
- console.log($('.main-content-container').html());
- $('.main-content-loading').hide(function() {
- $('.main-content-container').fadeIn(800,function() {
- $('.main-container').css('margin-left', 'auto'); // This sucks -- if the CSS specification changes, this will be wrong
- });
- });
- });
-}
-
-function handleNavMenu(menuID) {
- if( $(menuID).hasClass('menu-visible') ) {
- hideNavMenu(menuID);
- }
- else {
- showNavMenu(menuID);
- }
-}
-
-function showNavMenu(menuID) {
- $(menuID).show();
- $(menuID).addClass('menu-visible');
-}
-
-function hideNavMenu(menuID) {
- $(menuID).hide();
- $(menuID).removeClass('menu-visible');
-}
-
--- /dev/null
+function insertFormatting(e,t,n){var r=$j("#comment-edit-text-"+n).val();r==e&&(r="",$j("#comment-edit-text-"+n).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+n).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+n),$j("#comment-edit-text-"+n).val(r)),textarea=document.getElementById("comment-edit-text-"+n);if(document.selection)textarea.focus(),selected=document.selection.createRange(),t=="url"?selected.text="["+t+"]"+"http://"+selected.text+"[/"+t+"]":selected.text="["+t+"]"+selected.text+"[/"+t+"]";else if(textarea.selectionStart||textarea.selectionStart=="0"){var i=textarea.selectionStart,s=textarea.selectionEnd;t=="url"?textarea.value=textarea.value.substring(0,i)+"["+t+"]"+"http://"+textarea.value.substring(i,s)+"[/"+t+"]"+textarea.value.substring(s,textarea.value.length):textarea.value=textarea.value.substring(0,i)+"["+t+"]"+textarea.value.substring(i,s)+"[/"+t+"]"+textarea.value.substring(s,textarea.value.length)}return!0}function cmtBbOpen(e){$j(".comment-edit-bb-"+e).show()}function cmtBbClose(e){$j(".comment-edit-bb-"+e).hide()}function initEditor(e){if(editor==0){if(plaintext=="none"){$j("#profile-jot-text").css({height:200,color:"#000"}),$j("#profile-jot-text").contact_autocomplete(baseurl+"/acl"),editor=!0,$j("a#jot-perms-icon, a#settings-default-perms-menu").click(function(){var e=$j("#profile-jot-acl-wrapper").parent();return e.css("display")=="none"?e.show():e.hide(),!1}),$j(".jothidden").show(),typeof e!="undefined"&&e();return}}else typeof e!="undefined"&&e()}function enableOnUser(){if(editor)return;$j(this).val(""),initEditor()}function wallInitEditor(){var e=window.editSelect;e!="none"?tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:/(profile-jot-text|prvmail-text)/,plugins:"bbcode,paste",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_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0;var t=e.editorId,n=$j("#"+t);typeof n.attr("tabindex")!="undefined"&&($j("#"+t+"_ifr").attr("tabindex",n.attr("tabindex")),n.attr("tabindex",null))})}}):$j("#prvmail-text").contact_autocomplete(baseurl+"/acl")}function initCrop(){function e(e,t){$("x1").value=e.x1,$("y1").value=e.y1,$("x2").value=e.x2,$("y2").value=e.y2,$("width").value=t.width,$("height").value=t.height}Event.observe(window,"load",function(){new Cropper.ImgWithPreview("croppa",{previewWrap:"previewWrap",minWidth:175,minHeight:175,maxWidth:640,maxHeight:640,ratioDim:{x:100,y:100},displayOnInit:!0,onEndCrop:e})})}function confirmDelete(){return confirm(window.delItem)}function commentOpen(e,t){e.value==window.commentEmptyText&&(e.value="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),$j("#mod-cmnt-wrap-"+t).show(),openMenu("comment-edit-submit-wrapper-"+t))}function commentClose(e,t){e.value==""&&(e.value=window.commentEmptyText,$j("#comment-edit-text-"+t).removeClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).addClass("comment-edit-text-empty"),$j("#mod-cmnt-wrap-"+t).hide(),closeMenu("comment-edit-submit-wrapper-"+t))}function commentInsert(e,t){var n=$j("#comment-edit-text-"+t).val();n==window.commentEmptyText&&(n="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+t));var r=$j(e).html();r=r.replace("<","<"),r=r.replace(">",">"),r=r.replace("&","&"),r=r.replace(""",'"'),$j("#comment-edit-text-"+t).val(n+r)}function qCommentInsert(e,t){var n=$j("#comment-edit-text-"+t).val();n==window.commentEmptyText&&(n="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+t));var r=$j(e).val();r=r.replace("<","<"),r=r.replace(">",">"),r=r.replace("&","&"),r=r.replace(""",'"'),$j("#comment-edit-text-"+t).val(n+r),$j(e).val("")}function showHideComments(e){$j("#collapsed-comments-"+e).is(":visible")?($j("#collapsed-comments-"+e).hide(),$j("#hide-comments-"+e).html(window.showMore)):($j("#collapsed-comments-"+e).show(),$j("#hide-comments-"+e).html(window.showFewer))}function jotVideoURL(){reply=prompt(window.vidURL),reply&&reply.length&&addeditortext("[video]"+reply+"[/video]")}function jotAudioURL(){reply=prompt(window.audURL),reply&&reply.length&&addeditortext("[audio]"+reply+"[/audio]")}function jotGetLocation(){reply=prompt(window.whereAreU,$j("#jot-location").val()),reply&&reply.length&&$j("#jot-location").val(reply)}function jotShare(e){$j("#jot-popup").length!=0&&$j("#jot-popup").show(),$j("#like-rotator-"+e).show(),$j.get("share/"+e,function(t){editor||$j("#profile-jot-text").val(""),initEditor(function(){addeditortext(t),$j("#like-rotator-"+e).hide(),$j(window).scrollTop(0)})})}function linkdropper(e){var t=e.dataTransfer.types.contains("text/uri-list");t&&e.preventDefault()}function showEvent(e){}function itemTag(e){reply=prompt(window.term),reply&&reply.length&&(reply=reply.replace("#",""),reply.length&&(commentBusy=!0,$j("body").css("cursor","wait"),$j.get("tagger/"+e+"?term="+reply,NavUpdate),liking=1))}function itemFiler(e){$j.get("filer/",function(t){var n=$j("#id_term_label",t).text();reply=prompt(n),reply&&reply.length&&(commentBusy=!0,$j("body").css("cursor","wait"),$j.get("filer/"+e+"?term="+reply,NavUpdate),liking=1)})}function jotClearLocation(){$j("#jot-coord").val(""),$j("#profile-nolocation-wrapper").hide()}function addeditortext(e){if(plaintext=="none"){var t=$j("#profile-jot-text").val();$j("#profile-jot-text").val(t+e)}}$j(document).ready(function(){$j("#profile-jot-text").focus(enableOnUser),$j("#profile-jot-text").click(enableOnUser);if(typeof window.AjaxUpload!="undefined")switch(window.ajaxType){case"jot-header":var e=new window.AjaxUpload("wall-image-upload",{action:"wall_upload/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){addeditortext(t),$j("#profile-rotator").hide()}}),t=new window.AjaxUpload("wall-file-upload",{action:"wall_attach/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){addeditortext(t),$j("#profile-rotator").hide()}});break;case"msg-header":var e=new window.AjaxUpload("prvmail-upload",{action:"wall_upload/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){tinyMCE.execCommand("mceInsertRawHTML",!1,t),$j("#profile-rotator").hide()}});break;default:}typeof acl=="undefined"&&(acl=new ACL(baseurl+"/acl",[window.allowCID,window.allowGID,window.denyCID,window.denyGID]));if(window.aclType=="event_head"){$j("#events-calendar").fullCalendar({events:baseurl+"/events/json/",header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},timeFormat:"H(:mm)",eventClick:function(e,t,n){showEvent(e.id)},eventRender:function(e,t,n){if(e.item["author-name"]==null)return;switch(n.name){case"month":t.find(".fc-event-title").html("<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(e.item["author-avatar"],e.item["author-name"],e.title));break;case"agendaWeek":t.find(".fc-event-title").html("<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(e.item["author-avatar"],e.item["author-name"],e.item.desc,e.item.location));break;case"agendaDay":t.find(".fc-event-title").html("<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(e.item["author-avatar"],e.item["author-name"],e.item.desc,e.item.location))}}});var n=location.href.replace(baseurl,"").split("/");n.length>=4&&$j("#events-calendar").fullCalendar("gotoDate",n[2],n[3]-1);var r=location.hash.split("-");r.length==2&&r[0]=="#link"&&showEvent(r[1])}(window.aclType=="settings-head"||window.aclType=="photos_head"||window.aclType=="event_head")&&$j("#contact_allow, #contact_deny, #group_allow, #group_deny").change(function(){var e;$j("#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected").each(function(){e=$j(this).text(),$j("#jot-perms-icon").removeClass("unlock").addClass("lock"),$j("#jot-public").hide()}),e==null&&($j("#jot-perms-icon").removeClass("lock").addClass("unlock"),$j("#jot-public").show())}).trigger("change");switch(window.autocompleteType){case"msg-header":var i=$j("#recip").autocomplete({serviceUrl:baseurl+"/acl",minChars:2,width:350,onSelect:function(e,t){$j("#recip-complete").val(t)}});break;case"contacts-head":var i=$j("#contacts-search").autocomplete({serviceUrl:baseurl+"/acl",minChars:2,width:350});i.setOptions({params:{type:"a"}});break;default:}$j("#event-share-checkbox").change(function(){$j("#event-share-checkbox").is(":checked")?$j("#acl-wrapper").show():$j("#acl-wrapper").hide()}).trigger("change"),$j(".popupbox").click(function(){var e=$j($j(this).attr("href")).parent();return e.css("display")=="none"?e.show():e.hide(),!1})}),$j(function(){$j("nav").bind("nav-update",function(e,t){var n=$j("#pending-update"),r=$j(t).find("register").text();r=="0"?(r="",n.hide()):n.show(),n.html(r)})});var editor=!1,textlen=0,plaintext="none",ispublic=window.isPublic;switch(window.ajaxType){case"jot-header":function jotGetLink(){reply=prompt(window.linkURL),reply&&reply.length&&(reply=bin2hex(reply),$j("#profile-rotator").show(),$j.get("parse_url?binurl="+reply,function(e){addeditortext(e),$j("#profile-rotator").hide()}))}function linkdrop(e){var t=e.dataTransfer.getData("text/uri-list");e.target.textContent=t,e.preventDefault(),t&&t.length&&(t=bin2hex(t),$j("#profile-rotator").show(),$j.get("parse_url?binurl="+t,function(e){editor||$j("#profile-jot-text").val(""),initEditor(function(){addeditortext(e),$j("#profile-rotator").hide()})}))}break;case"msg-header":case"wallmsg-header":function jotGetLink(){reply=prompt(window.linkURL),reply&&reply.length&&($j("#profile-rotator").show(),$j.get("parse_url?url="+reply,function(e){tinyMCE.execCommand("mceInsertRawHTML",!1,e),$j("#profile-rotator").hide()}))}function linkdrop(e){var t=e.dataTransfer.getData("text/uri-list");e.target.textContent=t,e.preventDefault(),t&&t.length&&($j("#profile-rotator").show(),$j.get("parse_url?url="+t,function(e){tinyMCE.execCommand("mceInsertRawHTML",!1,e),$j("#profile-rotator").hide()}))}break;default:}typeof window.geoTag=="function"&&window.geoTag();
\ No newline at end of file
</form>
</div>
-<script type="text/javascript"> $(document).ready(function() { $("#id_$lname.0").focus();} );</script>
+<script type="text/javascript">window.loginName = "$lname.0";</script>
--- /dev/null
+
+<script src="$baseurl/library/jquery_ac/friendica.complete.min.js" ></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">
-/*
-var plaintext = '$editselect';
-
-if(plaintext != 'none') {
- tinyMCE.init({
- theme : "advanced",
- mode : "specific_textareas",
- editor_selector: /(profile-jot-text|prvmail-text)/,
- plugins : "bbcode,paste",
- 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_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 : '',
- convert_urls: false,
- content_css: "$baseurl/view/custom_tinymce.css",
- //Character count
- theme_advanced_path : false,
- setup : function(ed) {
- ed.onInit.add(function(ed) {
- ed.pasteAsPlainText = true;
- var editorId = ed.editorId;
- var textarea = $('#'+editorId);
- if (typeof(textarea.attr('tabindex')) != "undefined") {
- $('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex'));
- textarea.attr('tabindex', null);
- }
- });
- }
- });
-}
-else*/
- $("#prvmail-text").contact_autocomplete(baseurl+"/acl");
-
-
-</script>
-<script type="text/javascript" src="js/ajaxupload.js" ></script>
-<script>
- $(document).ready(function() {
- var uploader = new window.AjaxUpload(
- 'prvmail-upload',
- { action: 'wall_upload/$nickname',
- name: 'userfile',
- onSubmit: function(file,ext) { $('#profile-rotator').show(); },
- onComplete: function(file,response) {
- tinyMCE.execCommand('mceInsertRawHTML',false,response);
- $('#profile-rotator').hide();
- }
- }
- );
-
- });
-
- function jotGetLink() {
- reply = prompt("$linkurl");
- if(reply && reply.length) {
- $('#profile-rotator').show();
- $.get('parse_url?url=' + reply, function(data) {
- tinyMCE.execCommand('mceInsertRawHTML',false,data);
- $('#profile-rotator').hide();
- });
- }
- }
-
- function linkdropper(event) {
- var linkFound = event.dataTransfer.types.contains("text/uri-list");
- if(linkFound)
- event.preventDefault();
- }
-
- function linkdrop(event) {
- var reply = event.dataTransfer.getData("text/uri-list");
- event.target.textContent = reply;
- event.preventDefault();
- if(reply && reply.length) {
- $('#profile-rotator').show();
- $.get('parse_url?url=' + reply, function(data) {
- tinyMCE.execCommand('mceInsertRawHTML',false,data);
- $('#profile-rotator').hide();
- });
- }
- }
-
+ window.nickname = "$nickname";
+ window.linkURL = "$linkurl";
+ var plaintext = "none";
+ window.ajaxType = 'msg-header';
+ window.autocompleteType = 'msg-header';
</script>
--- /dev/null
+<a href='$embedurl' onclick='this.innerHTML=Base64.decode("$escapedhtml"); return false;' style='float:left; margin: 1em; position: relative;'>
+ <img width='$tw' height='$th' src='$turl' >
+ <div style='position: absolute; top: 0px; left: 0px; width: $twpx; height: $thpx; background: url($baseurl/images/icons/48/play.png) no-repeat center center;'></div>
+</a>
--- /dev/null
+
+<script>
+ window.prevLink = "$prevlink";
+ window.nextLink = "$nextlink";
+ window.photoEdit = true;
+
+</script>
--- /dev/null
+
+<script>
+ window.isPublic = "$ispublic";
+</script>
+
<div id="photos-upload-new-end"></div>
<div id="photos-upload-exist-wrapper">
<div id="photos-upload-existing-album-text">$existalbumtext</div>
+ <select id="photos-upload-album-select" name="album">
$albumselect
+ </select>
</div>
<div id="photos-upload-exist-end"></div>
-
<div id="photos-upload-noshare-div" class="photos-upload-noshare-div" >
<input id="photos-upload-noshare" type="checkbox" name="not_visible" value="1" checked />
- <div id="photos-upload-noshare-label">
<label id="photos-upload-noshare-text" for="photos-upload-noshare" >$nosharetext</label>
- </div>
</div>
+
<div id="photos-upload-perms" class="photos-upload-perms" >
- <a href="#photos-upload-permissions-wrapper" id="photos-upload-perms-menu" class="popupbox button" />
- <span id="jot-perms-icon" class="icon $lockstate photo-perms-icon" ></span><div class="photo-jot-perms-text">$permissions</div>
+ <a href="#photos-upload-permissions-wrapper" id="photos-upload-perms-menu" class="button popupbox" />
+ <span id="jot-perms-icon" class="icon $lockstate" ></span>$permissions
</a>
<div id="photos-upload-perms-end"></div>
<div class="photos-upload-end" ></div>
</form>
-<script>
- $("#photos-upload-album-select").removeAttr('size');
-</script>
--- /dev/null
+
+<script type="text/javascript" src="js/country.min.js" ></script>
+
+<script language="javascript" type="text/javascript">
+ Fill_Country('$country_name');
+ Fill_States('$region');
+</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 : "$editselect",
- 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;
- });
- }
-
-});
-
+<script language="javascript" type="text/javascript">
+ window.editSelect = "none";
</script>
--->
+
</form>
</div>
-<script type="text/javascript">Fill_Country('$country_name');Fill_States('$region');</script>
+
--- /dev/null
+
+<script>
+ window.isPublic = "$ispublic";
+</script>
+
--- /dev/null
+ <script>$j(function(){ previewTheme($j("#id_$theme.0")[0]); });</script>
+
#cropimage-wrapper, #cropimage-preview-wrapper {
float: left;
- padding: 30px;
+ padding: 10px;
+}
+.imgCrop {
+ max-width: 280px;
}
-
#crop-image-form {
margin-top: 30px;
clear: both;
margin-top: 15px;
}
+#contact-edit-last-update-text {
+ float: left;
+ clear: left;
+ margin-top: 30px;
+}
+
#contact-edit-poll-text {
+ float: left;
+ clear: left;
margin-top: 15px;
- margin-bottom: 5px;
+ margin-bottom: 0px;
}
#contact-edit-update-now {
#contact-edit-drop-link {
float: right;
- margin-right: 20px;
+ margin-right: 10px;
}
#contact-edit-nav-end {
width: 100%;
}
+#update_now_link {
+ float: left;
+ clear: left;
+ margin-bottom: 20px;
+}
+
+#label_id_hidden, #id_hidden {
+ margin-top: 30px;
+}
+#help_id_hidden {
+ margin-top: 30px;
+}
+
#contact-edit-end {
clear: both;
margin-top: 15px;
#contact-profile-selector {
width: 175px;
- margin-left: 175px;
+ margin-left: 0px;
}
.contact-edit-submit {
margin-top: 20px;
+ padding: 0.2em 0.5em;
+ font-size: 18px;
}
cursor: pointer;
}
+#photos-upload-perms-menu {
+ margin-left: 15px;
+}
+
#photos-upload-perms-menu:hover {
color: #0000FF;
text-decoration: underline;
$a->page['htmlhead'] = str_replace('$stylesheet', $a->get_baseurl() . '/view/theme/frost-mobile/login-style.css', $a->page['htmlhead']);
}
+ if( $a->module === 'login' )
+ $a->page['end'] .= '<script type="text/javascript"> $j(document).ready(function() { $j("#id_" + window.loginName).focus();} );</script>';
}
--- /dev/null
+
+<script language="javascript" type="text/javascript">
+wallInitEditor();
+</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">
-
-var plaintext = '$editselect';
-
-if(plaintext != 'none') {
- tinyMCE.init({
- theme : "advanced",
- mode : "specific_textareas",
- editor_selector: /(profile-jot-text|prvmail-text)/,
- plugins : "bbcode,paste",
- 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_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 : '',
- convert_urls: false,
- content_css: "$baseurl/view/custom_tinymce.css",
- //Character count
- theme_advanced_path : false,
- setup : function(ed) {
- ed.onInit.add(function(ed) {
- ed.pasteAsPlainText = true;
- var editorId = ed.editorId;
- var textarea = $('#'+editorId);
- if (typeof(textarea.attr('tabindex')) != "undefined") {
- $('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex'));
- textarea.attr('tabindex', null);
- }
- });
- }
- });
-}
-else
- $("#prvmail-text").contact_autocomplete(baseurl+"/acl");
-
+<script language="javascript" type="text/javascript">
+window.editSelect = "none";
+window.ajaxType = "wallmsg-header";
</script>
-<script>
- function jotGetLink() {
- reply = prompt("$linkurl");
- if(reply && reply.length) {
- $('#profile-rotator').show();
- $.get('parse_url?url=' + reply, function(data) {
- tinyMCE.execCommand('mceInsertRawHTML',false,data);
- $('#profile-rotator').hide();
- });
- }
- }
-
- function linkdropper(event) {
- var linkFound = event.dataTransfer.types.contains("text/uri-list");
- if(linkFound)
- event.preventDefault();
- }
-
- function linkdrop(event) {
- var reply = event.dataTransfer.getData("text/uri-list");
- event.target.textContent = reply;
- event.preventDefault();
- if(reply && reply.length) {
- $('#profile-rotator').show();
- $.get('parse_url?url=' + reply, function(data) {
- tinyMCE.execCommand('mceInsertRawHTML',false,data);
- $('#profile-rotator').hide();
- });
- }
- }
-
-</script>
--->
--- /dev/null
+<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>
-<script>
- // update pending count //
- $(function(){
- $("nav").bind('nav-update', function(e,data){
- var elm = $('#pending-update');
- var register = $(data).find('register').text();
- if (register=="0") { reigster=""; elm.hide();} else { elm.show(); }
- elm.html(register);
- });
- });
-</script>
<h4><a href="$admurl">$admtxt</a></h4>
<ul class='admin linklist'>
<li class='admin button $admin.site.2'><a href='$admin.site.0'>$admin.site.1</a></li>
--- /dev/null
+
+<div id='adminpage'>
+ <h1>$title - $page</h1>
+
+ <form action="$baseurl/admin/site" method="post">
+ <input type='hidden' name='form_security_token' value='$form_security_token'>
+
+ {{ inc field_input.tpl with $field=$sitename }}{{ endinc }}
+ {{ inc field_textarea.tpl with $field=$banner }}{{ endinc }}
+ {{ inc field_select.tpl with $field=$language }}{{ endinc }}
+ {{ inc field_select.tpl with $field=$theme }}{{ endinc }}
+ {{ inc field_select.tpl with $field=$ssl_policy }}{{ endinc }}
+
+ <div class="submit"><input type="submit" name="page_site" value="$submit" /></div>
+
+ <h3>$registration</h3>
+ {{ inc field_input.tpl with $field=$register_text }}{{ endinc }}
+ {{ inc field_select.tpl with $field=$register_policy }}{{ endinc }}
+
+ {{ inc field_checkbox.tpl with $field=$no_multi_reg }}{{ endinc }}
+ {{ inc field_checkbox.tpl with $field=$no_openid }}{{ endinc }}
+ {{ inc field_checkbox.tpl with $field=$no_regfullname }}{{ endinc }}
+
+ <div class="submit"><input type="submit" name="page_site" value="$submit" /></div>
+
+ <h3>$upload</h3>
+ {{ inc field_input.tpl with $field=$maximagesize }}{{ endinc }}
+
+ <h3>$corporate</h3>
+ {{ inc field_input.tpl with $field=$allowed_sites }}{{ endinc }}
+ {{ inc field_input.tpl with $field=$allowed_email }}{{ endinc }}
+ {{ inc field_checkbox.tpl with $field=$block_public }}{{ endinc }}
+ {{ inc field_checkbox.tpl with $field=$force_publish }}{{ endinc }}
+ {{ inc field_checkbox.tpl with $field=$no_community_page }}{{ endinc }}
+ {{ inc field_checkbox.tpl with $field=$ostatus_disabled }}{{ endinc }}
+ {{ inc field_checkbox.tpl with $field=$diaspora_enabled }}{{ endinc }}
+ {{ inc field_checkbox.tpl with $field=$dfrn_only }}{{ endinc }}
+ {{ inc field_input.tpl with $field=$global_directory }}{{ endinc }}
+
+ <div class="submit"><input type="submit" name="page_site" value="$submit" /></div>
+
+ <h3>$advanced</h3>
+ {{ inc field_checkbox.tpl with $field=$no_utf }}{{ endinc }}
+ {{ inc field_checkbox.tpl with $field=$verifyssl }}{{ endinc }}
+ {{ inc field_input.tpl with $field=$proxy }}{{ endinc }}
+ {{ inc field_input.tpl with $field=$proxyuser }}{{ endinc }}
+ {{ inc field_input.tpl with $field=$timeout }}{{ endinc }}
+ {{ inc field_input.tpl with $field=$delivery_interval }}{{ endinc }}
+ {{ inc field_input.tpl with $field=$poll_interval }}{{ endinc }}
+ {{ inc field_input.tpl with $field=$maxloadavg }}{{ endinc }}
+ {{ inc field_input.tpl with $field=$abandon_days }}{{ endinc }}
+
+ <div class="submit"><input type="submit" name="page_site" value="$submit" /></div>
+
+ </form>
+</div>
- <script>
+<!-- <script>
$(document).ready( function () {
$(document).mouseup(function(e) {
var container = $("#comment-edit-wrapper-$id");
}
});
});
- </script>
+ </script>-->
<div class="comment-wwedit-wrapper" id="comment-edit-wrapper-$id" style="display: block;">
<form class="comment-edit-form" id="comment-edit-form-$id" action="item" method="post" onsubmit="post_comment($id); return false;">
--- /dev/null
+
+<script language="javascript" type="text/javascript">
+window.editSelect = "$editselect";
+contactInitEditor();
+</script>
+
--- /dev/null
+
+<script src="$baseurl/library/jquery_ac/friendica.complete.min.js" ></script>
+
+
--- /dev/null
+
+<script>
+ window.autocompleteType = 'contacts-head';
+</script>
+
<div id="conversation-end"></div>
-<!--{{ if $dropping }}
+{{ if $dropping }}
<div id="item-delete-selected" class="fakelink" onclick="deleteCheckedItems();">
<div id="item-delete-selected-icon" class="icon drophide" title="$dropping" onmouseover="imgbright(this);" onmouseout="imgdull(this);" ></div>
<div id="item-delete-selected-desc" >$dropping</div>
</div>
<div id="item-delete-selected-end"></div>
-{{ endif }}-->
+{{ endif }}
--- /dev/null
+<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>
--- /dev/null
+ <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>
--- /dev/null
+ <link rel="stylesheet" href="library/cropper/cropper.css" type="text/css" />
</div>\r
</div>\r
<?php } ?>\r
+ <?php if(x($page,'end')) echo $page['end']; ?>\r
</body>\r
</html>\r
\r
--- /dev/null
+<!--[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/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/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/js/theme.min.js"></script>
+<script type="text/javascript" src="$baseurl/view/theme/frost/js/main.min.js" ></script>
+
--- /dev/null
+<script language="javascript" type="text/javascript"
+ src="$baseurl/library/fullcalendar/fullcalendar.min.js"></script>
+
+<script language="javascript" type="text/javascript">
+eventInitEditor();
+</script>
+
--- /dev/null
+<link rel='stylesheet' type='text/css' href='$baseurl/library/fullcalendar/fullcalendar.css' />
+
+<script language="javascript" type="text/javascript">
+window.aclType = 'event_head';
+</script>
+
--- /dev/null
+
+ <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>
type="application/opensearchdescription+xml"
title="Search in Friendica" />
-<!--[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_src.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" src="$baseurl/js/jquery.textinputs.js" ></script>
-<script type="text/javascript" src="$baseurl/js/fk.autocomplete.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/js/acl.js" ></script>
-<script type="text/javascript" src="$baseurl/js/webtoolkit.base64.js" ></script>
-<script type="text/javascript" src="$baseurl/view/theme/frost/js/main.js" ></script>
-<script type="text/javascript" src="$baseurl/view/theme/frost/js/theme.js"></script>
<script>
-
+ window.delItem = "$delitem";
+ window.commentEmptyText = "$comment";
+ window.showMore = "$showmore";
+ window.showFewer = "$showfewer";
var updateInterval = $update_interval;
var localUser = {{ if $local_user }}$local_user{{ else }}false{{ endif }};
-
- function confirmDelete() { return confirm("$delitem"); }
- function commentOpen(obj,id) {
- if(obj.value == '$comment') {
- obj.value = '';
- $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
- $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
- $("#mod-cmnt-wrap-" + id).show();
- openMenu("comment-edit-submit-wrapper-" + id);
- }
- }
- function commentClose(obj,id) {
- if(obj.value == '') {
- obj.value = '$comment';
- $("#comment-edit-text-" + id).removeClass("comment-edit-text-full");
- $("#comment-edit-text-" + id).addClass("comment-edit-text-empty");
- $("#mod-cmnt-wrap-" + id).hide();
- closeMenu("comment-edit-submit-wrapper-" + id);
- }
- }
-
-
- function commentInsert(obj,id) {
- var tmpStr = $("#comment-edit-text-" + id).val();
- if(tmpStr == '$comment') {
- tmpStr = '';
- $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
- $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
- openMenu("comment-edit-submit-wrapper-" + id);
- }
- var ins = $(obj).html();
- ins = ins.replace('<','<');
- ins = ins.replace('>','>');
- ins = ins.replace('&','&');
- ins = ins.replace('"','"');
- $("#comment-edit-text-" + id).val(tmpStr + ins);
- }
-
- function qCommentInsert(obj,id) {
- var tmpStr = $("#comment-edit-text-" + id).val();
- if(tmpStr == '$comment') {
- tmpStr = '';
- $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
- $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
- openMenu("comment-edit-submit-wrapper-" + id);
- }
- var ins = $(obj).val();
- ins = ins.replace('<','<');
- ins = ins.replace('>','>');
- ins = ins.replace('&','&');
- ins = ins.replace('"','"');
- $("#comment-edit-text-" + id).val(tmpStr + ins);
- $(obj).val('');
- }
-
- function showHideComments(id) {
- if( $('#collapsed-comments-' + id).is(':visible')) {
- $('#collapsed-comments-' + id).hide();
- $('#hide-comments-' + id).html('$showmore');
- }
- else {
- $('#collapsed-comments-' + id).show();
- $('#hide-comments-' + id).html('$showfewer');
- }
- }
-
-
</script>
-
--- /dev/null
+
+<script type="text/javascript" src="$baseurl/js/ajaxupload.min.js" ></script>
+
+<script>if(typeof window.jotInit != 'undefined') initEditor();</script>
+
-<script language="javascript" type="text/javascript">
-
-var editor=false;
-var textlen = 0;
-var plaintext = '$editselect';
-
-function initEditor(cb){
- if (editor==false){
- $("#profile-jot-text-loading").show();
- if(plaintext == 'none') {
- $("#profile-jot-text-loading").hide();
- $("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
- $("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
- editor = true;
- $("a#jot-perms-icon").fancybox({
- 'transitionIn' : 'elastic',
- 'transitionOut' : 'elastic'
- });
- $(".jothidden").show();
- if (typeof cb!="undefined") cb();
- return;
- }
- tinyMCE.init({
- theme : "advanced",
- mode : "specific_textareas",
- editor_selector: $editselect,
- auto_focus: "profile-jot-text",
- plugins : "bbcode,paste,autoresize, inlinepopups",
- 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 : '',
- convert_urls: false,
- content_css: "$baseurl/view/custom_tinymce.css",
- theme_advanced_path : false,
- file_browser_callback : "fcFileBrowser",
- setup : function(ed) {
- cPopup = null;
- ed.onKeyDown.add(function(ed,e) {
- if(cPopup !== null)
- cPopup.onkey(e);
- });
-
- ed.onKeyUp.add(function(ed, e) {
- var txt = tinyMCE.activeEditor.getContent();
- match = txt.match(/@([^ \n]+)$/);
- if(match!==null) {
- if(cPopup === null) {
- cPopup = new ACPopup(this,baseurl+"/acl");
- }
- if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
- if(! cPopup.ready) cPopup = null;
- }
- else {
- if(cPopup !== null) { cPopup.close(); cPopup = null; }
- }
-
- textlen = txt.length;
- if(textlen != 0 && $('#jot-perms-icon').is('.unlock')) {
- $('#profile-jot-desc').html(ispublic);
- }
- else {
- $('#profile-jot-desc').html(' ');
- }
-
- //Character count
-
- if(textlen <= 140) {
- $('#character-counter').removeClass('red');
- $('#character-counter').removeClass('orange');
- $('#character-counter').addClass('grey');
- }
- if((textlen > 140) && (textlen <= 420)) {
- $('#character-counter').removeClass('grey');
- $('#character-counter').removeClass('red');
- $('#character-counter').addClass('orange');
- }
- if(textlen > 420) {
- $('#character-counter').removeClass('grey');
- $('#character-counter').removeClass('orange');
- $('#character-counter').addClass('red');
- }
- $('#character-counter').text(textlen);
- });
-
- ed.onInit.add(function(ed) {
- ed.pasteAsPlainText = true;
- $("#profile-jot-text-loading").hide();
- $(".jothidden").show();
- if (typeof cb!="undefined") cb();
- });
-
- }
- });
- editor = true;
- // setup acl popup
- $("a#jot-perms-icon").fancybox({
- 'transitionIn' : 'none',
- 'transitionOut' : 'none'
- });
- } else {
- if (typeof cb!="undefined") cb();
- }
-}
-
-function enableOnUser(){
- if (editor) return;
- $(this).val("");
- initEditor();
-}
-
-</script>
-<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) {
- addeditortext(response);
- $('#profile-rotator').hide();
- }
- }
- );
-
-
- });
-
- function deleteCheckedItems() {
- var checkedstr = '';
-
- $('.item-select').each( function() {
- if($(this).is(':checked')) {
- if(checkedstr.length != 0) {
- checkedstr = checkedstr + ',' + $(this).val();
- }
- else {
- checkedstr = $(this).val();
- }
- }
- });
- $.post('item', { dropitems: checkedstr }, function(data) {
- window.location.reload();
- });
- }
-
- function jotGetLink() {
- reply = prompt("$linkurl");
- if(reply && reply.length) {
- reply = bin2hex(reply);
- $('#profile-rotator').show();
- $.get('parse_url?binurl=' + reply, function(data) {
- addeditortext(data);
- $('#profile-rotator').hide();
- });
- }
- }
-
- function jotVideoURL() {
- reply = prompt("$vidurl");
- if(reply && reply.length) {
- addeditortext('[video]' + reply + '[/video]');
- }
- }
-
- function jotAudioURL() {
- reply = prompt("$audurl");
- if(reply && reply.length) {
- addeditortext('[audio]' + reply + '[/audio]');
- }
- }
-
-
- function jotGetLocation() {
- reply = prompt("$whereareu", $('#jot-location').val());
- if(reply && reply.length) {
- $('#jot-location').val(reply);
- }
- }
-
- function jotShare(id) {
- if ($('#jot-popup').length != 0) $('#jot-popup').show();
-
- $('#like-rotator-' + id).show();
- $.get('share/' + id, function(data) {
- if (!editor) $("#profile-jot-text").val("");
- initEditor(function(){
- addeditortext(data);
- $('#like-rotator-' + id).hide();
- $(window).scrollTop(0);
- });
-
- });
- }
-
- function linkdropper(event) {
- var linkFound = event.dataTransfer.types.contains("text/uri-list");
- if(linkFound)
- event.preventDefault();
- }
-
- function linkdrop(event) {
- var reply = event.dataTransfer.getData("text/uri-list");
- event.target.textContent = reply;
- event.preventDefault();
- if(reply && reply.length) {
- reply = bin2hex(reply);
- $('#profile-rotator').show();
- $.get('parse_url?binurl=' + reply, function(data) {
- if (!editor) $("#profile-jot-text").val("");
- initEditor(function(){
- addeditortext(data);
- $('#profile-rotator').hide();
- });
- });
- }
- }
-
- function itemTag(id) {
- reply = prompt("$term");
- if(reply && reply.length) {
- reply = reply.replace('#','');
- if(reply.length) {
-
- commentBusy = true;
- $('body').css('cursor', 'wait');
-
- $.get('tagger/' + id + '?term=' + reply);
- if(timer) clearTimeout(timer);
- timer = setTimeout(NavUpdate,3000);
- liking = 1;
- }
- }
- }
-
- function itemFiler(id) {
-
- var bordercolor = $("input").css("border-color");
-
- $.get('filer/', function(data){
- $.fancybox(data);
- $("#id_term").keypress(function(){
- $(this).css("border-color",bordercolor);
- })
- $("#select_term").change(function(){
- $("#id_term").css("border-color",bordercolor);
- })
-
- $("#filer_save").click(function(e){
- e.preventDefault();
- reply = $("#id_term").val();
- if(reply && reply.length) {
- commentBusy = true;
- $('body').css('cursor', 'wait');
- $.get('filer/' + id + '?term=' + reply, NavUpdate);
-/* if(timer) clearTimeout(timer);
- timer = setTimeout(NavUpdate,3000);*/
- liking = 1;
- $.fancybox.close();
- } else {
- $("#id_term").css("border-color","#FF0000");
- }
- return false;
- });
- });
-
- }
-
- function jotClearLocation() {
- $('#jot-coord').val('');
- $('#profile-nolocation-wrapper').hide();
- }
-
- function addeditortext(data) {
- if(plaintext == 'none') {
- var currentText = $("#profile-jot-text").val();
- $("#profile-jot-text").val(currentText + data);
- }
- else
- tinyMCE.execCommand('mceInsertRawHTML',false,data);
- }
-
- $geotag
-
+ window.editSelect = $editselect;
+ window.isPublic = "$ispublic";
+ window.nickname = "$nickname";
+ window.linkURL = "$linkurl";
+ window.vidURL = "$vidurl";
+ window.audURL = "$audurl";
+ window.whereAreU = "$whereareu";
+ window.term = "$term";
+ window.baseURL = "$baseurl";
+ window.geoTag = function () { $geotag }
+ window.ajaxType = 'jot-header';
</script>
--- /dev/null
+
+<div id="profile-jot-wrapper" >
+ <div id="profile-jot-banner-wrapper">
+ <div id="profile-jot-desc" > </div>
+ <div id="character-counter" class="grey"></div>
+ </div>
+ <div id="profile-jot-banner-end"></div>
+
+ <form id="profile-jot-form" action="$action" method="post" >
+ <input type="hidden" name="type" value="$ptyp" />
+ <input type="hidden" name="profile_uid" value="$profile_uid" />
+ <input type="hidden" name="return" value="$return_path" />
+ <input type="hidden" name="location" id="jot-location" value="$defloc" />
+ <input type="hidden" name="coord" id="jot-coord" value="" />
+ <input type="hidden" name="post_id" value="$post_id" />
+ <input type="hidden" name="preview" id="jot-preview" value="0" />
+ <div id="jot-title-wrap"><input name="title" id="jot-title" type="text" placeholder="$placeholdertitle" value="$title" class="jothidden" style="display:none"></div>
+ <div id="jot-category-wrap"><input name="category" id="jot-category" type="text" placeholder="$placeholdercategory" value="$category" class="jothidden" style="display:none" /></div>
+ <div id="jot-text-wrap">
+ <img id="profile-jot-text-loading" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" />
+ <textarea rows="5" cols="64" class="profile-jot-text" id="profile-jot-text" name="body" >{{ if $content }}$content{{ else }}$share{{ endif }}</textarea>
+ </div>
+
+<div id="profile-jot-submit-wrapper" class="jothidden">
+ <input type="submit" id="profile-jot-submit" name="submit" value="$share" />
+
+ <div id="profile-upload-wrapper" style="display: $visitor;" >
+ <div id="wall-image-upload-div" ><a href="#" onclick="return false;" id="wall-image-upload" class="icon camera" title="$upload"></a></div>
+ </div>
+ <div id="profile-attach-wrapper" style="display: $visitor;" >
+ <div id="wall-file-upload-div" ><a href="#" onclick="return false;" id="wall-file-upload" class="icon attach" title="$attach"></a></div>
+ </div>
+
+ <div id="profile-link-wrapper" style="display: $visitor;" ondragenter="linkdropper(event);" ondragover="linkdropper(event);" ondrop="linkdrop(event);" >
+ <a id="profile-link" class="icon link" title="$weblink" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink(); return false;"></a>
+ </div>
+ <div id="profile-video-wrapper" style="display: $visitor;" >
+ <a id="profile-video" class="icon video" title="$video" onclick="jotVideoURL();return false;"></a>
+ </div>
+ <div id="profile-audio-wrapper" style="display: $visitor;" >
+ <a id="profile-audio" class="icon audio" title="$audio" onclick="jotAudioURL();return false;"></a>
+ </div>
+ <div id="profile-location-wrapper" style="display: $visitor;" >
+ <a id="profile-location" class="icon globe" title="$setloc" onclick="jotGetLocation();return false;"></a>
+ </div>
+ <div id="profile-nolocation-wrapper" style="display: none;" >
+ <a id="profile-nolocation" class="icon noglobe" title="$noloc" onclick="jotClearLocation();return false;"></a>
+ </div>
+
+ <div id="profile-jot-perms" class="profile-jot-perms" style="display: $pvisit;" >
+ <a href="#profile-jot-acl-wrapper" id="jot-perms-icon" class="icon $lockstate" title="$permset" ></a>$bang
+ </div>
+
+ <span onclick="preview_post();" id="jot-preview-link" class="fakelink">$preview</span>
+
+ <div id="profile-jot-perms-end"></div>
+
+
+ <div id="profile-jot-plugin-wrapper">
+ $jotplugins
+ </div>
+
+ <div id="profile-rotator-wrapper" style="display: $visitor;" >
+ <img id="profile-rotator" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" />
+ </div>
+
+ <div id="jot-preview-content" style="display:none;"></div>
+
+ <div style="display: none;">
+ <div id="profile-jot-acl-wrapper" style="width:auto;height:auto;overflow:auto;">
+ $acl
+ <hr style="clear:both"/>
+ <div id="profile-jot-email-label">$emailcc</div><input type="text" name="emailcc" id="profile-jot-email" title="$emtitle" />
+ <div id="profile-jot-email-end"></div>
+ $jotnets
+ </div>
+ </div>
+
+
+</div>
+
+<div id="profile-jot-end"></div>
+</form>
+</div>
+ {{ if $content }}<script>window.jotInit = true;</script>{{ endif }}
--- /dev/null
+function ACL(backend_url, preset){
+ that = this;
+
+ that.url = backend_url;
+
+ that.kp_timer = null;
+
+ if (preset==undefined) preset = [];
+ that.allow_cid = (preset[0] || []);
+ that.allow_gid = (preset[1] || []);
+ that.deny_cid = (preset[2] || []);
+ that.deny_gid = (preset[3] || []);
+ that.group_uids = [];
+ that.nw = 4; //items per row. should be calulated from #acl-list.width
+
+ that.list_content = $j("#acl-list-content");
+ that.item_tpl = unescape($j(".acl-list-item[rel=acl-template]").html());
+ that.showall = $j("#acl-showall");
+
+ if (preset.length==0) that.showall.addClass("selected");
+
+ /*events*/
+ that.showall.click(that.on_showall);
+ $j(".acl-button-show").live('click', that.on_button_show);
+ $j(".acl-button-hide").live('click', that.on_button_hide);
+ $j("#acl-search").keypress(that.on_search);
+ $j("#acl-wrapper").parents("form").submit(that.on_submit);
+
+ /* startup! */
+ that.get(0,100);
+}
+
+ACL.prototype.on_submit = function(){
+ aclfileds = $j("#acl-fields").html("");
+ $j(that.allow_gid).each(function(i,v){
+ aclfileds.append("<input type='hidden' name='group_allow[]' value='"+v+"'>");
+ });
+ $j(that.allow_cid).each(function(i,v){
+ aclfileds.append("<input type='hidden' name='contact_allow[]' value='"+v+"'>");
+ });
+ $j(that.deny_gid).each(function(i,v){
+ aclfileds.append("<input type='hidden' name='group_deny[]' value='"+v+"'>");
+ });
+ $j(that.deny_cid).each(function(i,v){
+ aclfileds.append("<input type='hidden' name='contact_deny[]' value='"+v+"'>");
+ });
+}
+
+ACL.prototype.search = function(){
+ var srcstr = $j("#acl-search").val();
+ that.list_content.html("");
+ that.get(0,100, srcstr);
+}
+
+ACL.prototype.on_search = function(event){
+ if (that.kp_timer) clearTimeout(that.kp_timer);
+ that.kp_timer = setTimeout( that.search, 1000);
+}
+
+ACL.prototype.on_showall = function(event){
+ event.preventDefault()
+ event.stopPropagation();
+
+ if (that.showall.hasClass("selected")){
+ return false;
+ }
+ that.showall.addClass("selected");
+
+ that.allow_cid = [];
+ that.allow_gid = [];
+ that.deny_cid = [];
+ that.deny_gid = [];
+
+ that.update_view();
+
+ return false;
+}
+
+ACL.prototype.on_button_show = function(event){
+ event.preventDefault()
+ event.stopImmediatePropagation()
+ event.stopPropagation();
+
+ /*that.showall.removeClass("selected");
+ $j(this).siblings(".acl-button-hide").removeClass("selected");
+ $j(this).toggleClass("selected");*/
+
+ that.set_allow($j(this).parent().attr('id'));
+
+ return false;
+}
+ACL.prototype.on_button_hide = function(event){
+ event.preventDefault()
+ event.stopImmediatePropagation()
+ event.stopPropagation();
+
+ /*that.showall.removeClass("selected");
+ $j(this).siblings(".acl-button-show").removeClass("selected");
+ $j(this).toggleClass("selected");*/
+
+ that.set_deny($j(this).parent().attr('id'));
+
+ return false;
+}
+
+ACL.prototype.set_allow = function(itemid){
+ type = itemid[0];
+ id = parseInt(itemid.substr(1));
+ switch(type){
+ case "g":
+ if (that.allow_gid.indexOf(id)<0){
+ that.allow_gid.push(id)
+ }else {
+ that.allow_gid.remove(id);
+ }
+ if (that.deny_gid.indexOf(id)>=0) that.deny_gid.remove(id);
+ break;
+ case "c":
+ if (that.allow_cid.indexOf(id)<0){
+ that.allow_cid.push(id)
+ } else {
+ that.allow_cid.remove(id);
+ }
+ if (that.deny_cid.indexOf(id)>=0) that.deny_cid.remove(id);
+ break;
+ }
+ that.update_view();
+}
+
+ACL.prototype.set_deny = function(itemid){
+ type = itemid[0];
+ id = parseInt(itemid.substr(1));
+ switch(type){
+ case "g":
+ if (that.deny_gid.indexOf(id)<0){
+ that.deny_gid.push(id)
+ } else {
+ that.deny_gid.remove(id);
+ }
+ if (that.allow_gid.indexOf(id)>=0) that.allow_gid.remove(id);
+ break;
+ case "c":
+ if (that.deny_cid.indexOf(id)<0){
+ that.deny_cid.push(id)
+ } else {
+ that.deny_cid.remove(id);
+ }
+ if (that.allow_cid.indexOf(id)>=0) that.allow_cid.remove(id);
+ break;
+ }
+ that.update_view();
+}
+
+ACL.prototype.update_view = function(){
+ if (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 acl */
+ $j('#jot-perms-icon').removeClass('lock').addClass('unlock');
+ $j('#jot-public').show();
+ $j('.profile-jot-net input').attr('disabled', false);
+ if(typeof editor != 'undefined' && editor != false) {
+ $j('#profile-jot-desc').html(ispublic);
+ }
+
+ } else {
+ that.showall.removeClass("selected");
+ /* jot acl */
+ $j('#jot-perms-icon').removeClass('unlock').addClass('lock');
+ $j('#jot-public').hide();
+ $j('.profile-jot-net input').attr('disabled', 'disabled');
+ $j('#profile-jot-desc').html(' ');
+ }
+ $j("#acl-list-content .acl-list-item").each(function(){
+ $j(this).removeClass("groupshow grouphide");
+ });
+
+ $j("#acl-list-content .acl-list-item").each(function(){
+ itemid = $j(this).attr('id');
+ type = itemid[0];
+ id = parseInt(itemid.substr(1));
+
+ btshow = $j(this).children(".acl-button-show").removeClass("selected");
+ bthide = $j(this).children(".acl-button-hide").removeClass("selected");
+
+ switch(type){
+ case "g":
+ var uclass = "";
+ if (that.allow_gid.indexOf(id)>=0){
+ btshow.addClass("selected");
+ bthide.removeClass("selected");
+ uclass="groupshow";
+ }
+ if (that.deny_gid.indexOf(id)>=0){
+ btshow.removeClass("selected");
+ bthide.addClass("selected");
+ uclass="grouphide";
+ }
+
+ $j(that.group_uids[id]).each(function(i,v) {
+ if(uclass == "grouphide")
+ $j("#c"+v).removeClass("groupshow");
+ if(uclass != "") {
+ var cls = $j("#c"+v).attr('class');
+ if( cls == undefined)
+ return true;
+ var hiding = cls.indexOf('grouphide');
+ if(hiding == -1)
+ $j("#c"+v).addClass(uclass);
+ }
+ });
+
+ break;
+ case "c":
+ if (that.allow_cid.indexOf(id)>=0){
+ btshow.addClass("selected");
+ bthide.removeClass("selected");
+ }
+ if (that.deny_cid.indexOf(id)>=0){
+ btshow.removeClass("selected");
+ bthide.addClass("selected");
+ }
+ }
+
+ });
+
+}
+
+
+ACL.prototype.get = function(start,count, search){
+ var postdata = {
+ start:start,
+ count:count,
+ search:search,
+ }
+
+ $j.ajax({
+ type:'POST',
+ url: that.url,
+ data: postdata,
+ dataType: 'json',
+ success:that.populate
+ });
+}
+
+ACL.prototype.populate = function(data){
+ var height = Math.ceil(data.tot / that.nw) * 42;
+ that.list_content.height(height);
+ $j(data.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 );
+ if (this.uids!=undefined) that.group_uids[this.id] = this.uids;
+ //console.log(html);
+ that.list_content.append(html);
+ });
+ that.update_view();
+}
+
--- /dev/null
+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=$j("#acl-list-content"),that.item_tpl=unescape($j(".acl-list-item[rel=acl-template]").html()),that.showall=$j("#acl-showall"),t.length==0&&that.showall.addClass("selected"),that.showall.click(that.on_showall),$j(".acl-button-show").live("click",that.on_button_show),$j(".acl-button-hide").live("click",that.on_button_hide),$j("#acl-search").keypress(that.on_search),$j("#acl-wrapper").parents("form").submit(that.on_submit),that.get(0,100)}ACL.prototype.on_submit=function(){aclfileds=$j("#acl-fields").html(""),$j(that.allow_gid).each(function(e,t){aclfileds.append("<input type='hidden' name='group_allow[]' value='"+t+"'>")}),$j(that.allow_cid).each(function(e,t){aclfileds.append("<input type='hidden' name='contact_allow[]' value='"+t+"'>")}),$j(that.deny_gid).each(function(e,t){aclfileds.append("<input type='hidden' name='group_deny[]' value='"+t+"'>")}),$j(that.deny_cid).each(function(e,t){aclfileds.append("<input type='hidden' name='contact_deny[]' value='"+t+"'>")})},ACL.prototype.search=function(){var e=$j("#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($j(this).parent().attr("id")),!1},ACL.prototype.on_button_hide=function(e){return e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),that.set_deny($j(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"),$j("#jot-perms-icon").removeClass("lock").addClass("unlock"),$j("#jot-public").show(),$j(".profile-jot-net input").attr("disabled",!1),typeof editor!="undefined"&&editor!=0&&$j("#profile-jot-desc").html(ispublic)):(that.showall.removeClass("selected"),$j("#jot-perms-icon").removeClass("unlock").addClass("lock"),$j("#jot-public").hide(),$j(".profile-jot-net input").attr("disabled","disabled"),$j("#profile-jot-desc").html(" ")),$j("#acl-list-content .acl-list-item").each(function(){$j(this).removeClass("groupshow grouphide")}),$j("#acl-list-content .acl-list-item").each(function(){itemid=$j(this).attr("id"),type=itemid[0],id=parseInt(itemid.substr(1)),btshow=$j(this).children(".acl-button-show").removeClass("selected"),bthide=$j(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"),$j(that.group_uids[id]).each(function(t,n){e=="grouphide"&&$j("#c"+n).removeClass("groupshow");if(e!=""){var r=$j("#c"+n).attr("class");if(r==undefined)return!0;var i=r.indexOf("grouphide");i==-1&&$j("#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};$j.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),$j(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()};
\ No newline at end of file
--- /dev/null
+/**
+ * Friendica people autocomplete
+ *
+ * require jQuery, jquery.textareas
+ */
+
+
+
+function ACPopup(elm,backend_url){
+ this.idsel=-1;
+ this.element = elm;
+ this.searchText="";
+ this.ready=true;
+ this.kp_timer = false;
+ this.url = backend_url;
+
+ var w = 530;
+ var h = 130;
+
+
+ if(typeof elm.editorId == "undefined") {
+ style = $j(elm).offset();
+ w = $j(elm).width();
+ h = $j(elm).height();
+ }
+ else {
+ var container = elm.getContainer();
+ if(typeof container != "undefined") {
+ style = $j(container).offset();
+ w = $j(container).width();
+ h = $j(container).height();
+ }
+ }
+
+ style.top=style.top+h;
+ style.width = w;
+ style.position = 'absolute';
+ /* style['max-height'] = '150px';
+ style.border = '1px solid red';
+ style.background = '#cccccc';
+
+ style.overflow = 'auto';
+ style['z-index'] = '100000';
+ */
+ style.display = 'none';
+
+ this.cont = $j("<div class='acpopup'></div>");
+ this.cont.css(style);
+
+ $j("body").append(this.cont);
+}
+ACPopup.prototype.close = function(){
+ $j(this.cont).remove();
+ this.ready=false;
+}
+ACPopup.prototype.search = function(text){
+ var that = this;
+ this.searchText=text;
+ if (this.kp_timer) clearTimeout(this.kp_timer);
+ this.kp_timer = setTimeout( function(){that._search();}, 500);
+}
+ACPopup.prototype._search = function(){
+ console.log("_search");
+ var that = this;
+ var postdata = {
+ start:0,
+ count:100,
+ search:this.searchText,
+ type:'c',
+ }
+
+ $j.ajax({
+ type:'POST',
+ url: this.url,
+ data: postdata,
+ dataType: 'json',
+ success:function(data){
+ that.cont.html("");
+ if (data.tot>0){
+ that.cont.show();
+ $j(data.items).each(function(){
+ html = "<img src='{0}' height='16px' width='16px'>{1} ({2})".format(this.photo, this.name, this.nick)
+ that.add(html, this.nick.replace(' ','') + '+' + this.id + ' - ' + this.link);
+ });
+ } else {
+ that.cont.hide();
+ }
+ }
+ });
+
+}
+ ACPopup.prototype.add = function(label, value){
+ var that=this;
+ var elm = $j("<div class='acpopupitem' title='"+value+"'>"+label+"</div>");
+ elm.click(function(e){
+ t = $j(this).attr('title').replace(new RegExp(' \- .*'),'');
+ if(typeof(that.element.container) === "undefined") {
+ el=$j(that.element);
+ sel = el.getSelection();
+ sel.start = sel.start- that.searchText.length;
+ el.setSelection(sel.start,sel.end).replaceSelectedText(t+' ').collapseSelection(false);
+ that.close();
+ }
+ else {
+ txt = tinyMCE.activeEditor.getContent();
+ // alert(that.searchText + ':' + t);
+ newtxt = txt.replace(that.searchText,t+' ');
+ tinyMCE.activeEditor.setContent(newtxt);
+ tinyMCE.activeEditor.focus();
+ that.close();
+ }
+ });
+ $j(this.cont).append(elm);
+}
+ACPopup.prototype.onkey = function(event){
+ if (event.keyCode == '13') {
+ if(this.idsel>-1) {
+ this.cont.children()[this.idsel].click();
+ event.preventDefault();
+ }
+ else
+ this.close();
+ }
+ if (event.keyCode == '38') { //cursor up
+ cmax = this.cont.children().size()-1;
+ this.idsel--;
+ if (this.idsel<0) this.idsel=cmax;
+ event.preventDefault();
+ }
+ if (event.keyCode == '40' || event.keyCode == '9') { //cursor down
+ cmax = this.cont.children().size()-1;
+ this.idsel++;
+ if (this.idsel>cmax) this.idsel=0;
+ event.preventDefault();
+ }
+
+ if (event.keyCode == '38' || event.keyCode == '40' || event.keyCode == '9') {
+ this.cont.children().removeClass('selected');
+ $j(this.cont.children()[this.idsel]).addClass('selected');
+ }
+
+ if (event.keyCode == '27') { //ESC
+ this.close();
+ }
+}
+
+function ContactAutocomplete(element,backend_url){
+ this.pattern=/@([^ \n]+)$/;
+ this.popup=null;
+ var that = this;
+
+ $j(element).unbind('keydown');
+ $j(element).unbind('keyup');
+
+ $j(element).keydown(function(event){
+ if (that.popup!==null) that.popup.onkey(event);
+ });
+
+ $j(element).keyup(function(event){
+ cpos = $j(this).getSelection();
+ if (cpos.start==cpos.end){
+ match = $j(this).val().substring(0,cpos.start).match(that.pattern);
+ if (match!==null){
+ if (that.popup===null){
+ that.popup = new ACPopup(this, backend_url);
+ }
+ if (that.popup.ready && match[1]!==that.popup.searchText) that.popup.search(match[1]);
+ if (!that.popup.ready) that.popup=null;
+
+ } else {
+ if (that.popup!==null) {that.popup.close(); that.popup=null;}
+ }
+
+
+ }
+ });
+
+}
+
+
+/**
+ * jQuery plugin 'contact_autocomplete'
+ */
+(function( $ ){
+ $j.fn.contact_autocomplete = function(backend_url) {
+ this.each(function(){
+ new ContactAutocomplete(this, backend_url);
+ });
+ };
+})( jQuery );
+
+
+
+
--- /dev/null
+/**
+ * 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=$j(e).offset(),n=$j(e).width(),r=$j(e).height();else{var i=e.getContainer();typeof i!="undefined"&&(style=$j(i).offset(),n=$j(i).width(),r=$j(i).height())}style.top=style.top+r,style.width=n,style.position="absolute",style.display="none",this.cont=$j("<div class='acpopup'></div>"),this.cont.css(style),$j("body").append(this.cont)}function ContactAutocomplete(e,t){this.pattern=/@([^ \n]+)$/,this.popup=null;var n=this;$j(e).unbind("keydown"),$j(e).unbind("keyup"),$j(e).keydown(function(e){n.popup!==null&&n.popup.onkey(e)}),$j(e).keyup(function(e){cpos=$j(this).getSelection(),cpos.start==cpos.end&&(match=$j(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(){$j(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"};$j.ajax({type:"POST",url:this.url,data:t,dataType:"json",success:function(t){e.cont.html(""),t.tot>0?(e.cont.show(),$j(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=$j("<div class='acpopupitem' title='"+n+"'>"+e+"</div>");i.click(function(e){t=$j(this).attr("title").replace(new RegExp(" - .*"),""),typeof r.element.container=="undefined"?(el=$j(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())}),$j(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"),$j(this.cont.children()[this.idsel]).addClass("selected");e.keyCode=="27"&&this.close()},function(e){$j.fn.contact_autocomplete=function(e){this.each(function(){new ContactAutocomplete(this,e)})}}(jQuery);
\ No newline at end of file
var last_popup_menu = null;
var last_popup_button = null;
- $(function() {
- $.ajaxSetup({cache: false});
+ $j(function() {
+ $j.ajaxSetup({cache: false});
- msie = $.browser.msie ;
+ msie = $j.browser.msie ;
/* setup tooltips *//*
- $("a,.tt").each(function(){
- var e = $(this);
+ $j("a,.tt").each(function(){
+ var e = $j(this);
var pos="bottom";
if (e.hasClass("tttop")) pos="top";
if (e.hasClass("ttbottom")) pos="bottom";
/* setup onoff widgets */
- $(".onoff input").each(function(){
- val = $(this).val();
- id = $(this).attr("id");
- $("#"+id+"_onoff ."+ (val==0?"on":"off")).addClass("hidden");
+ $j(".onoff input").each(function(){
+ val = $j(this).val();
+ id = $j(this).attr("id");
+ $j("#"+id+"_onoff ."+ (val==0?"on":"off")).addClass("hidden");
});
- $(".onoff > a").click(function(event){
+ $j(".onoff > a").click(function(event){
event.preventDefault();
- var input = $(this).siblings("input");
+ var input = $j(this).siblings("input");
var val = 1-input.val();
var id = input.attr("id");
- $("#"+id+"_onoff ."+ (val==0?"on":"off")).addClass("hidden");
- $("#"+id+"_onoff ."+ (val==1?"on":"off")).removeClass("hidden");
+ $j("#"+id+"_onoff ."+ (val==0?"on":"off")).addClass("hidden");
+ $j("#"+id+"_onoff ."+ (val==1?"on":"off")).removeClass("hidden");
input.val(val);
//console.log(id);
});
function close_last_popup_menu(e) {
if( last_popup_menu ) {
- if( '#' + last_popup_menu.attr('id') !== $(e.target).attr('rel')) {
+ if( '#' + last_popup_menu.attr('id') !== $j(e.target).attr('rel')) {
last_popup_menu.hide();
last_popup_button.removeClass("selected");
last_popup_menu = null;
}
}
}
- $('a[rel^=#]').click(function(e){
+ $j('a[rel^=#]').click(function(e){
close_last_popup_menu(e);
- menu = $( $(this).attr('rel') );
+ menu = $j( $j(this).attr('rel') );
e.preventDefault();
e.stopPropagation();
if (menu.attr('popup')=="false") return false;
- $(this).parent().toggleClass("selected");
+ $j(this).parent().toggleClass("selected");
menu.slideToggle('fast');
if (menu.css("display") == "none") {
last_popup_button = null;
} else {
last_popup_menu = menu;
- last_popup_button = $(this).parent();
+ last_popup_button = $j(this).parent();
}
return false;
});
- $('html').click(function(e) {
+ $j('html').click(function(e) {
close_last_popup_menu(e);
});
// fancyboxes
- $("a.popupbox").fancybox({
+ $j("a.popupbox").fancybox({
'transitionIn' : 'none',
'transitionOut' : 'none'
});
/* notifications template */
- var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
- var notifications_all = unescape($('<div>').append( $("#nav-notifications-see-all").clone() ).html()); //outerHtml hack
- var notifications_mark = unescape($('<div>').append( $("#nav-notifications-mark-all").clone() ).html()); //outerHtml hack
- var notifications_empty = unescape($("#nav-notifications-menu").html());
+ var notifications_tpl= unescape($j("#nav-notifications-template[rel=template]").html());
+ var notifications_all = unescape($j('<div>').append( $j("#nav-notifications-see-all").clone() ).html()); //outerHtml hack
+ var notifications_mark = unescape($j('<div>').append( $j("#nav-notifications-mark-all").clone() ).html()); //outerHtml hack
+ var notifications_empty = unescape($j("#nav-notifications-menu").html());
/* nav update event */
- $('nav').bind('nav-update', function(e,data){;
- var invalid = $(data).find('invalid').text();
+ $j('nav').bind('nav-update', function(e,data){;
+ var invalid = $j(data).find('invalid').text();
if(invalid == 1) { window.location.href=window.location.href }
- var net = $(data).find('net').text();
- if(net == 0) { net = ''; $('#net-update').removeClass('show') } else { $('#net-update').addClass('show') }
- $('#net-update').html(net);
+ var net = $j(data).find('net').text();
+ if(net == 0) { net = ''; $j('#net-update').removeClass('show') } else { $j('#net-update').addClass('show') }
+ $j('#net-update').html(net);
- var home = $(data).find('home').text();
- if(home == 0) { home = ''; $('#home-update').removeClass('show') } else { $('#home-update').addClass('show') }
- $('#home-update').html(home);
+ var home = $j(data).find('home').text();
+ if(home == 0) { home = ''; $j('#home-update').removeClass('show') } else { $j('#home-update').addClass('show') }
+ $j('#home-update').html(home);
- var intro = $(data).find('intro').text();
- if(intro == 0) { intro = ''; $('#intro-update').removeClass('show') } else { $('#intro-update').addClass('show') }
- $('#intro-update').html(intro);
+ var intro = $j(data).find('intro').text();
+ if(intro == 0) { intro = ''; $j('#intro-update').removeClass('show') } else { $j('#intro-update').addClass('show') }
+ $j('#intro-update').html(intro);
- var mail = $(data).find('mail').text();
- if(mail == 0) { mail = ''; $('#mail-update').removeClass('show') } else { $('#mail-update').addClass('show') }
- $('#mail-update').html(mail);
+ var mail = $j(data).find('mail').text();
+ if(mail == 0) { mail = ''; $j('#mail-update').removeClass('show') } else { $j('#mail-update').addClass('show') }
+ $j('#mail-update').html(mail);
- var intro = $(data).find('intro').text();
- if(intro == 0) { intro = ''; $('#intro-update-li').removeClass('show') } else { $('#intro-update-li').addClass('show') }
- $('#intro-update-li').html(intro);
+ var intro = $j(data).find('intro').text();
+ if(intro == 0) { intro = ''; $j('#intro-update-li').removeClass('show') } else { $j('#intro-update-li').addClass('show') }
+ $j('#intro-update-li').html(intro);
- var mail = $(data).find('mail').text();
- if(mail == 0) { mail = ''; $('#mail-update-li').removeClass('show') } else { $('#mail-update-li').addClass('show') }
- $('#mail-update-li').html(mail);
+ var mail = $j(data).find('mail').text();
+ if(mail == 0) { mail = ''; $j('#mail-update-li').removeClass('show') } else { $j('#mail-update-li').addClass('show') }
+ $j('#mail-update-li').html(mail);
- var eNotif = $(data).find('notif')
+ var eNotif = $j(data).find('notif')
if (eNotif.children("note").length==0){
- $("#nav-notifications-menu").html(notifications_empty);
+ $j("#nav-notifications-menu").html(notifications_empty);
} else {
- nnm = $("#nav-notifications-menu");
+ nnm = $j("#nav-notifications-menu");
nnm.html(notifications_all + notifications_mark);
//nnm.attr('popup','true');
eNotif.children("note").each(function(){
- e = $(this);
+ e = $j(this);
text = e.text().format("<span class='contactname'>"+e.attr('name')+"</span>");
html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
nnm.append(html);
}
notif = eNotif.attr('count');
if (notif>0){
- $("#nav-notifications-linkmenu").addClass("on");
+ $j("#nav-notifications-linkmenu").addClass("on");
} else {
- $("#nav-notifications-linkmenu").removeClass("on");
+ $j("#nav-notifications-linkmenu").removeClass("on");
}
- if(notif == 0) { notif = ''; $('#notify-update').removeClass('show') } else { $('#notify-update').addClass('show') }
- $('#notify-update').html(notif);
+ if(notif == 0) { notif = ''; $j('#notify-update').removeClass('show') } else { $j('#notify-update').addClass('show') }
+ $j('#notify-update').html(notif);
- var eSysmsg = $(data).find('sysmsgs');
+ var eSysmsg = $j(data).find('sysmsgs');
eSysmsg.children("notice").each(function(){
- text = $(this).text();
- $.jGrowl(text, { sticky: true, theme: 'notice' });
+ text = $j(this).text();
+ $j.jGrowl(text, { sticky: false, theme: 'notice', life: 2000 }); // originally: sticky: true,
});
eSysmsg.children("info").each(function(){
- text = $(this).text();
- $.jGrowl(text, { sticky: false, theme: 'info', life: 1500 });
+ text = $j(this).text();
+ $j.jGrowl(text, { sticky: false, theme: 'info', life: 1500 });
});
});
NavUpdate();
// Allow folks to stop the ajax page updates with the pause/break key
- $(document).keydown(function(event) {
+ $j(document).keydown(function(event) {
if(event.keyCode == '8') {
var target = event.target || event.srcElement;
if (!/input|textarea/i.test(target.nodeName)) {
if (event.ctrlKey) {
totStopped = true;
}
- $('#pause').html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />');
+ $j('#pause').html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />');
} else {
unpause();
}
if(! stopped) {
var pingCmd = 'ping' + ((localUser != 0) ? '?f=&uid=' + localUser : '');
- $.get(pingCmd,function(data) {
- $(data).find('result').each(function() {
+ $j.get(pingCmd,function(data) {
+ $j(data).find('result').each(function() {
// send nav-update event
- $('nav').trigger('nav-update', this);
+ $j('nav').trigger('nav-update', this);
// start live update
- if($('#live-network').length) { src = 'network'; liveUpdate(); }
- if($('#live-profile').length) { src = 'profile'; liveUpdate(); }
- if($('#live-community').length) { src = 'community'; liveUpdate(); }
- if($('#live-notes').length) { src = 'notes'; liveUpdate(); }
- if($('#live-display').length) {
+ if($j('#live-network').length) { src = 'network'; liveUpdate(); }
+ if($j('#live-profile').length) { src = 'profile'; liveUpdate(); }
+ if($j('#live-community').length) { src = 'community'; liveUpdate(); }
+ if($j('#live-notes').length) { src = 'notes'; liveUpdate(); }
+ if($j('#live-display').length) {
if(liking) {
liking = 0;
window.location.href=window.location.href
}
}
- if($('#live-photos').length) {
+ if($j('#live-photos').length) {
if(liking) {
liking = 0;
window.location.href=window.location.href
}
function liveUpdate() {
- if((src == null) || (stopped) || (! profile_uid)) { $('.like-rotator').hide(); return; }
- if(($('.comment-edit-text-full').length) || (in_progress)) {
+ if((src == null) || (stopped) || (! profile_uid)) { $j('.like-rotator').hide(); return; }
+ if(($j('.comment-edit-text-full').length) || (in_progress)) {
if(livetime) {
clearTimeout(livetime);
}
var udargs = ((netargs.length) ? '/' + netargs : '');
var update_url = 'update_' + src + udargs + '&p=' + profile_uid + '&page=' + profile_page + '&msie=' + ((msie) ? 1 : 0);
- $.get(update_url,function(data) {
+ $j.get(update_url,function(data) {
in_progress = false;
- // $('.collapsed-comments',data).each(function() {
- // var ident = $(this).attr('id');
- // var is_hidden = $('#' + ident).is(':hidden');
- // if($('#' + ident).length) {
- // $('#' + ident).replaceWith($(this));
+ // $j('.collapsed-comments',data).each(function() {
+ // var ident = $j(this).attr('id');
+ // var is_hidden = $j('#' + ident).is(':hidden');
+ // if($j('#' + ident).length) {
+ // $j('#' + ident).replaceWith($j(this));
// if(is_hidden)
- // $('#' + ident).hide();
+ // $j('#' + ident).hide();
// }
//});
// add a new thread
- $('.tread-wrapper',data).each(function() {
- var ident = $(this).attr('id');
+ $j('.tread-wrapper',data).each(function() {
+ var ident = $j(this).attr('id');
- if($('#' + ident).length == 0 && profile_page == 1) {
- $('img',this).each(function() {
- $(this).attr('src',$(this).attr('dst'));
+ if($j('#' + ident).length == 0 && profile_page == 1) {
+ $j('img',this).each(function() {
+ $j(this).attr('src',$j(this).attr('dst'));
});
- $('#' + prev).after($(this));
+ $j('#' + prev).after($j(this));
}
else {
- $('img',this).each(function() {
- $(this).attr('src',$(this).attr('dst'));
+ $j('img',this).each(function() {
+ $j(this).attr('src',$j(this).attr('dst'));
});
- $('#' + ident).replaceWith($(this));
+ $j('#' + ident).replaceWith($j(this));
}
prev = ident;
});
/*prev = 'live-' + src;
- $('.wall-item-outside-wrapper',data).each(function() {
- var ident = $(this).attr('id');
+ $j('.wall-item-outside-wrapper',data).each(function() {
+ var ident = $j(this).attr('id');
- if($('#' + ident).length == 0 && prev != 'live-' + src) {
- $('img',this).each(function() {
- $(this).attr('src',$(this).attr('dst'));
+ if($j('#' + ident).length == 0 && prev != 'live-' + src) {
+ $j('img',this).each(function() {
+ $j(this).attr('src',$j(this).attr('dst'));
});
- $('#' + prev).after($(this));
+ $j('#' + prev).after($j(this));
}
else {
- $('#' + ident + ' ' + '.wall-item-ago').replaceWith($(this).find('.wall-item-ago'));
- if($('#' + ident + ' ' + '.comment-edit-text-empty').length)
- $('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($(this).find('.wall-item-comment-wrapper'));
- $('#' + ident + ' ' + '.hide-comments-total').replaceWith($(this).find('.hide-comments-total'));
- $('#' + ident + ' ' + '.wall-item-like').replaceWith($(this).find('.wall-item-like'));
- $('#' + ident + ' ' + '.wall-item-dislike').replaceWith($(this).find('.wall-item-dislike'));
- $('#' + ident + ' ' + '.my-comment-photo').each(function() {
- $(this).attr('src',$(this).attr('dst'));
+ $j('#' + ident + ' ' + '.wall-item-ago').replaceWith($j(this).find('.wall-item-ago'));
+ if($j('#' + ident + ' ' + '.comment-edit-text-empty').length)
+ $j('#' + ident + ' ' + '.wall-item-comment-wrapper').replaceWith($j(this).find('.wall-item-comment-wrapper'));
+ $j('#' + ident + ' ' + '.hide-comments-total').replaceWith($j(this).find('.hide-comments-total'));
+ $j('#' + ident + ' ' + '.wall-item-like').replaceWith($j(this).find('.wall-item-like'));
+ $j('#' + ident + ' ' + '.wall-item-dislike').replaceWith($j(this).find('.wall-item-dislike'));
+ $j('#' + ident + ' ' + '.my-comment-photo').each(function() {
+ $j(this).attr('src',$j(this).attr('dst'));
});
}
prev = ident;
});*/
- $('.like-rotator').hide();
+ $j('.like-rotator').hide();
if(commentBusy) {
commentBusy = false;
- $('body').css('cursor', 'auto');
+ $j('body').css('cursor', 'auto');
}
/* autocomplete @nicknames */
- $(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl");
+ $j(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl");
});
}
function imgbright(node) {
- $(node).removeClass("drophide").addClass("drop");
+ $j(node).removeClass("drophide").addClass("drop");
}
function imgdull(node) {
- $(node).removeClass("drop").addClass("drophide");
+ $j(node).removeClass("drop").addClass("drophide");
}
// Since our ajax calls are asynchronous, we will give a few
function dolike(ident,verb) {
unpause();
- $('#like-rotator-' + ident.toString()).show();
- $.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate );
+ $j('#like-rotator-' + ident.toString()).show();
+ $j.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate );
// if(timer) clearTimeout(timer);
// timer = setTimeout(NavUpdate,3000);
liking = 1;
function dostar(ident) {
ident = ident.toString();
-// $('#like-rotator-' + ident).show();
- $.get('starred/' + ident, function(data) {
+// $j('#like-rotator-' + ident).show();
+ $j.get('starred/' + ident, function(data) {
if(data.match(/1/)) {
- $('#starred-' + ident).addClass('starred');
- $('#starred-' + ident).removeClass('unstarred');
- $('#star-' + ident).addClass('hidden');
- $('#unstar-' + ident).removeClass('hidden');
+ $j('#starred-' + ident).addClass('starred');
+ $j('#starred-' + ident).removeClass('unstarred');
+ $j('#star-' + ident).addClass('hidden');
+ $j('#unstar-' + ident).removeClass('hidden');
}
else {
- $('#starred-' + ident).addClass('unstarred');
- $('#starred-' + ident).removeClass('starred');
- $('#star-' + ident).removeClass('hidden');
- $('#unstar-' + ident).addClass('hidden');
+ $j('#starred-' + ident).addClass('unstarred');
+ $j('#starred-' + ident).removeClass('starred');
+ $j('#star-' + ident).removeClass('hidden');
+ $j('#unstar-' + ident).addClass('hidden');
}
-// $('#like-rotator-' + ident).hide();
+// $j('#like-rotator-' + ident).hide();
});
}
}
else {
lockvisible = true;
- $.get('lockview/' + id, function(data) {
- $('#panel').html(data);
- $('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5});
- $('#panel').show();
+ $j.get('lockview/' + id, function(data) {
+ $j('#panel').html(data);
+ $j('#panel').css({ 'left': cursor.x + 5 , 'top': cursor.y + 5});
+ $j('#panel').show();
});
}
}
function lockviewhide() {
lockvisible = false;
- $('#panel').hide();
+ $j('#panel').hide();
}
function post_comment(id) {
unpause();
commentBusy = true;
- $('body').css('cursor', 'wait');
- $("#comment-preview-inp-" + id).val("0");
- $.post(
+ $j('body').css('cursor', 'wait');
+ $j("#comment-preview-inp-" + id).val("0");
+ $j.post(
"item",
- $("#comment-edit-form-" + id).serialize(),
+ $j("#comment-edit-form-" + id).serialize(),
function(data) {
if(data.success) {
- $("#comment-edit-wrapper-" + id).hide();
- $("#comment-edit-text-" + id).val('');
+ $j("#comment-edit-wrapper-" + id).hide();
+ $j("#comment-edit-text-" + id).val('');
var tarea = document.getElementById("comment-edit-text-" + id);
if(tarea)
commentClose(tarea,id);
function preview_comment(id) {
- $("#comment-preview-inp-" + id).val("1");
- $("#comment-edit-preview-" + id).show();
- $.post(
+ $j("#comment-preview-inp-" + id).val("1");
+ $j("#comment-edit-preview-" + id).show();
+ $j.post(
"item",
- $("#comment-edit-form-" + id).serialize(),
+ $j("#comment-edit-form-" + id).serialize(),
function(data) {
if(data.preview) {
- $("#comment-edit-preview-" + id).html(data.preview);
- $("#comment-edit-preview-" + id + " a").click(function() { return false; });
+ $j("#comment-edit-preview-" + id).html(data.preview);
+ $j("#comment-edit-preview-" + id + " a").click(function() { return false; });
}
},
"json"
function preview_post() {
- $("#jot-preview").val("1");
- $("#jot-preview-content").show();
+ $j("#jot-preview").val("1");
+ $j("#jot-preview-content").show();
tinyMCE.triggerSave();
- $.post(
+ $j.post(
"item",
- $("#profile-jot-form").serialize(),
+ $j("#profile-jot-form").serialize(),
function(data) {
if(data.preview) {
- $("#jot-preview-content").html(data.preview);
- $("#jot-preview-content" + " a").click(function() { return false; });
+ $j("#jot-preview-content").html(data.preview);
+ $j("#jot-preview-content" + " a").click(function() { return false; });
}
},
"json"
);
- $("#jot-preview").val("0");
+ $j("#jot-preview").val("0");
return true;
}
// unpause auto reloads if they are currently stopped
totStopped = false;
stopped = false;
- $('#pause').html('');
+ $j('#pause').html('');
}
}
function groupChangeMember(gid, cid, sec_token) {
- $('body .fakelink').css('cursor', 'wait');
- $.get('group/' + gid + '/' + cid + "?t=" + sec_token, function(data) {
- $('#group-update-wrapper').html(data);
- $('body .fakelink').css('cursor', 'auto');
+ $j('body .fakelink').css('cursor', 'wait');
+ $j.get('group/' + gid + '/' + cid + "?t=" + sec_token, function(data) {
+ $j('#group-update-wrapper').html(data);
+ $j('body .fakelink').css('cursor', 'auto');
});
}
function profChangeMember(gid,cid) {
- $('body .fakelink').css('cursor', 'wait');
- $.get('profperm/' + gid + '/' + cid, function(data) {
- $('#prof-update-wrapper').html(data);
- $('body .fakelink').css('cursor', 'auto');
+ $j('body .fakelink').css('cursor', 'wait');
+ $j.get('profperm/' + gid + '/' + cid, function(data) {
+ $j('#prof-update-wrapper').html(data);
+ $j('body .fakelink').css('cursor', 'auto');
});
}
function contactgroupChangeMember(gid,cid) {
- $('body').css('cursor', 'wait');
- $.get('contactgroup/' + gid + '/' + cid, function(data) {
- $('body').css('cursor', 'auto');
+ $j('body').css('cursor', 'wait');
+ $j.get('contactgroup/' + gid + '/' + cid, function(data) {
+ $j('body').css('cursor', 'auto');
});
}
function checkboxhighlight(box) {
- if($(box).is(':checked')) {
- $(box).addClass('checkeditem');
+ if($j(box).is(':checked')) {
+ $j(box).addClass('checkeditem');
}
else {
- $(box).removeClass('checkeditem');
+ $j(box).removeClass('checkeditem');
}
}
function notifyMarkAll() {
- $.get('notify/mark/all', function(data) {
+ $j.get('notify/mark/all', function(data) {
if(timer) clearTimeout(timer);
timer = setTimeout(NavUpdate,1000);
});
};
function previewTheme(elm) {
- theme = $(elm).val();
- $.getJSON('pretheme?f=&theme=' + theme,function(data) {
- $('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div><a href="' + data.img + '"><img src="' + data.img + '" width="320" height="240" alt="' + theme + '" /></a>');
+ theme = $j(elm).val();
+ $j.getJSON('pretheme?f=&theme=' + theme,function(data) {
+ $j('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><div id="theme-version">' + data.version + '</div><div id="theme-credits">' + data.credits + '</div><a href="' + data.img + '"><img src="' + data.img + '" width="320" height="240" alt="' + theme + '" /></a>');
});
}
--- /dev/null
+function openClose(e){document.getElementById(e).style.display=="block"?document.getElementById(e).style.display="none":document.getElementById(e).style.display="block"}function openMenu(e){document.getElementById(e).style.display="block"}function closeMenu(e){document.getElementById(e).style.display="none"}function NavUpdate(){if(!stopped){var e="ping"+(localUser!=0?"?f=&uid="+localUser:"");$j.get(e,function(e){$j(e).find("result").each(function(){$j("nav").trigger("nav-update",this),$j("#live-network").length&&(src="network",liveUpdate()),$j("#live-profile").length&&(src="profile",liveUpdate()),$j("#live-community").length&&(src="community",liveUpdate()),$j("#live-notes").length&&(src="notes",liveUpdate()),$j("#live-display").length&&liking&&(liking=0,window.location.href=window.location.href),$j("#live-photos").length&&liking&&(liking=0,window.location.href=window.location.href)})})}timer=setTimeout(NavUpdate,updateInterval)}function liveUpdate(){if(src==null||stopped||!profile_uid){$j(".like-rotator").hide();return}if($j(".comment-edit-text-full").length||in_progress){livetime&&clearTimeout(livetime),livetime=setTimeout(liveUpdate,1e4);return}livetime!=null&&(livetime=null),prev="live-"+src,in_progress=!0;var e=netargs.length?"/"+netargs:"",t="update_"+src+e+"&p="+profile_uid+"&page="+profile_page+"&msie="+(msie?1:0);$j.get(t,function(e){in_progress=!1,$j(".tread-wrapper",e).each(function(){var e=$j(this).attr("id");$j("#"+e).length==0&&profile_page==1?($j("img",this).each(function(){$j(this).attr("src",$j(this).attr("dst"))}),$j("#"+prev).after($j(this))):($j("img",this).each(function(){$j(this).attr("src",$j(this).attr("dst"))}),$j("#"+e).replaceWith($j(this))),prev=e}),$j(".like-rotator").hide(),commentBusy&&(commentBusy=!1,$j("body").css("cursor","auto")),$j(".comment-edit-form textarea").contact_autocomplete(baseurl+"/acl")})}function imgbright(e){$j(e).removeClass("drophide").addClass("drop")}function imgdull(e){$j(e).removeClass("drop").addClass("drophide")}function dolike(e,t){unpause(),$j("#like-rotator-"+e.toString()).show(),$j.get("like/"+e.toString()+"?verb="+t,NavUpdate),liking=1}function dostar(e){e=e.toString(),$j.get("starred/"+e,function(t){t.match(/1/)?($j("#starred-"+e).addClass("starred"),$j("#starred-"+e).removeClass("unstarred"),$j("#star-"+e).addClass("hidden"),$j("#unstar-"+e).removeClass("hidden")):($j("#starred-"+e).addClass("unstarred"),$j("#starred-"+e).removeClass("starred"),$j("#star-"+e).removeClass("hidden"),$j("#unstar-"+e).addClass("hidden"))})}function getPosition(e){var t={x:0,y:0};if(e.pageX||e.pageY)t.x=e.pageX,t.y=e.pageY;else if(e.clientX||e.clientY)t.x=e.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)-document.documentElement.clientLeft,t.y=e.clientY+(document.documentElement.scrollTop||document.body.scrollTop)-document.documentElement.clientTop;else if(e.x||e.y)t.x=e.x,t.y=e.y;return t}function lockview(e,t){e=e||window.event,cursor=getPosition(e),lockvisible?lockviewhide():(lockvisible=!0,$j.get("lockview/"+t,function(e){$j("#panel").html(e),$j("#panel").css({left:cursor.x+5,top:cursor.y+5}),$j("#panel").show()}))}function lockviewhide(){lockvisible=!1,$j("#panel").hide()}function post_comment(e){return unpause(),commentBusy=!0,$j("body").css("cursor","wait"),$j("#comment-preview-inp-"+e).val("0"),$j.post("item",$j("#comment-edit-form-"+e).serialize(),function(t){if(t.success){$j("#comment-edit-wrapper-"+e).hide(),$j("#comment-edit-text-"+e).val("");var n=document.getElementById("comment-edit-text-"+e);n&&commentClose(n,e),timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,10)}t.reload&&(window.location.href=t.reload)},"json"),!1}function preview_comment(e){return $j("#comment-preview-inp-"+e).val("1"),$j("#comment-edit-preview-"+e).show(),$j.post("item",$j("#comment-edit-form-"+e).serialize(),function(t){t.preview&&($j("#comment-edit-preview-"+e).html(t.preview),$j("#comment-edit-preview-"+e+" a").click(function(){return!1}))},"json"),!0}function preview_post(){return $j("#jot-preview").val("1"),$j("#jot-preview-content").show(),tinyMCE.triggerSave(),$j.post("item",$j("#profile-jot-form").serialize(),function(e){e.preview&&($j("#jot-preview-content").html(e.preview),$j("#jot-preview-content a").click(function(){return!1}))},"json"),$j("#jot-preview").val("0"),!0}function unpause(){totStopped=!1,stopped=!1,$j("#pause").html("")}function bin2hex(e){var t,n,r=0,i=[];e+="",r=e.length;for(n=0;n<r;n++)i[n]=e.charCodeAt(n).toString(16).replace(/^([\da-f])$/,"0$1");return i.join("")}function groupChangeMember(e,t,n){$j("body .fakelink").css("cursor","wait"),$j.get("group/"+e+"/"+t+"?t="+n,function(e){$j("#group-update-wrapper").html(e),$j("body .fakelink").css("cursor","auto")})}function profChangeMember(e,t){$j("body .fakelink").css("cursor","wait"),$j.get("profperm/"+e+"/"+t,function(e){$j("#prof-update-wrapper").html(e),$j("body .fakelink").css("cursor","auto")})}function contactgroupChangeMember(e,t){$j("body").css("cursor","wait"),$j.get("contactgroup/"+e+"/"+t,function(e){$j("body").css("cursor","auto")})}function checkboxhighlight(e){$j(e).is(":checked")?$j(e).addClass("checkeditem"):$j(e).removeClass("checkeditem")}function notifyMarkAll(){$j.get("notify/mark/all",function(e){timer&&clearTimeout(timer),timer=setTimeout(NavUpdate,1e3)})}function fcFileBrowser(e,t,n,r){var i=baseurl+"/fbrowser/"+n+"/";return tinyMCE.activeEditor.windowManager.open({file:i,title:"File Browser",width:420,height:400,resizable:"yes",inline:"yes",close_previous:"no"},{window:r,input:e}),!1}function setupFieldRichtext(){tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:"fieldRichtext",plugins:"bbcode,paste, inlinepopups",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",paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,file_browser_callback:"fcFileBrowser"})}function previewTheme(e){theme=$j(e).val(),$j.getJSON("pretheme?f=&theme="+theme,function(e){$j("#theme-preview").html('<div id="theme-desc">'+e.desc+'</div><div id="theme-version">'+e.version+'</div><div id="theme-credits">'+e.credits+'</div><a href="'+e.img+'"><img src="'+e.img+'" width="320" height="240" alt="'+theme+'" /></a>')})}var src=null,prev=null,livetime=null,msie=!1,stopped=!1,totStopped=!1,timer=null,pr=0,liking=0,in_progress=!1,langSelect=!1,commentBusy=!1,last_popup_menu=null,last_popup_button=null;$j(function(){function e(e){last_popup_menu&&"#"+last_popup_menu.attr("id")!==$j(e.target).attr("rel")&&(last_popup_menu.hide(),last_popup_button.removeClass("selected"),last_popup_menu=null,last_popup_button=null)}$j.ajaxSetup({cache:!1}),msie=$j.browser.msie,$j(".onoff input").each(function(){val=$j(this).val(),id=$j(this).attr("id"),$j("#"+id+"_onoff ."+(val==0?"on":"off")).addClass("hidden")}),$j(".onoff > a").click(function(e){e.preventDefault();var t=$j(this).siblings("input"),n=1-t.val(),r=t.attr("id");$j("#"+r+"_onoff ."+(n==0?"on":"off")).addClass("hidden"),$j("#"+r+"_onoff ."+(n==1?"on":"off")).removeClass("hidden"),t.val(n)}),setupFieldRichtext(),$j("a[rel^=#]").click(function(t){return e(t),menu=$j($j(this).attr("rel")),t.preventDefault(),t.stopPropagation(),menu.attr("popup")=="false"?!1:($j(this).parent().toggleClass("selected"),menu.slideToggle("fast"),menu.css("display")=="none"?(last_popup_menu=null,last_popup_button=null):(last_popup_menu=menu,last_popup_button=$j(this).parent()),!1)}),$j("html").click(function(t){e(t)}),$j("a.popupbox").fancybox({transitionIn:"none",transitionOut:"none"});var t=unescape($j("#nav-notifications-template[rel=template]").html()),n=unescape($j("<div>").append($j("#nav-notifications-see-all").clone()).html()),r=unescape($j("<div>").append($j("#nav-notifications-mark-all").clone()).html()),i=unescape($j("#nav-notifications-menu").html());$j("nav").bind("nav-update",function(e,s){var o=$j(s).find("invalid").text();o==1&&(window.location.href=window.location.href);var u=$j(s).find("net").text();u==0?(u="",$j("#net-update").removeClass("show")):$j("#net-update").addClass("show"),$j("#net-update").html(u);var a=$j(s).find("home").text();a==0?(a="",$j("#home-update").removeClass("show")):$j("#home-update").addClass("show"),$j("#home-update").html(a);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update").removeClass("show")):$j("#intro-update").addClass("show"),$j("#intro-update").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update").removeClass("show")):$j("#mail-update").addClass("show"),$j("#mail-update").html(l);var f=$j(s).find("intro").text();f==0?(f="",$j("#intro-update-li").removeClass("show")):$j("#intro-update-li").addClass("show"),$j("#intro-update-li").html(f);var l=$j(s).find("mail").text();l==0?(l="",$j("#mail-update-li").removeClass("show")):$j("#mail-update-li").addClass("show"),$j("#mail-update-li").html(l);var c=$j(s).find("notif");c.children("note").length==0?$j("#nav-notifications-menu").html(i):(nnm=$j("#nav-notifications-menu"),nnm.html(n+r),c.children("note").each(function(){e=$j(this),text=e.text().format("<span class='contactname'>"+e.attr("name")+"</span>"),html=t.format(e.attr("href"),e.attr("photo"),text,e.attr("date"),e.attr("seen")),nnm.append(html)})),notif=c.attr("count"),notif>0?$j("#nav-notifications-linkmenu").addClass("on"):$j("#nav-notifications-linkmenu").removeClass("on"),notif==0?(notif="",$j("#notify-update").removeClass("show")):$j("#notify-update").addClass("show"),$j("#notify-update").html(notif);var h=$j(s).find("sysmsgs");h.children("notice").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"notice",life:2e3})}),h.children("info").each(function(){text=$j(this).text(),$j.jGrowl(text,{sticky:!1,theme:"info",life:1500})})}),NavUpdate(),$j(document).keydown(function(e){if(e.keyCode=="8"){var t=e.target||e.srcElement;if(!/input|textarea/i.test(t.nodeName))return!1}e.keyCode=="19"||e.ctrlKey&&e.which=="32"?(e.preventDefault(),stopped==0?(stopped=!0,e.ctrlKey&&(totStopped=!0),$j("#pause").html('<img src="images/pause.gif" alt="pause" style="border: 1px solid black;" />')):unpause()):totStopped||unpause()})});var lockvisible=!1;String.prototype.format=function(){var e=this;for(var t=0;t<arguments.length;t++){var n=new RegExp("\\{"+t+"\\}","gi");e=e.replace(n,arguments[t])}return e},Array.prototype.remove=function(e){to=undefined,from=this.indexOf(e);var t=this.slice((to||from)+1||this.length);return this.length=from<0?this.length+from:from,this.push.apply(this,t)};
\ No newline at end of file
-$(document).ready(function() {
+$j(document).ready(function() {
window.navMenuTimeout = {
'#network-menu-list-timeout': null,
'#system-menu-list-closing': false
};
- $.ajaxSetup({
+/* $j.ajaxSetup({
cache: false
- });
+ });*/
- $('.nav-menu-link').hover(function() {
- showNavMenu($(this).attr('rel'));
+ if(typeof acl=="undefined"){
+ acl = new ACL(
+ baseurl+"/acl",
+ [ window.allowCID,window.allowGID,window.denyCID,window.denyGID ]
+ );
+ }
+
+ /* enable tinymce on focus and click */
+ $j("#profile-jot-text").focus(enableOnUser);
+ $j("#profile-jot-text").click(enableOnUser);
+
+
+ $j('.nav-menu-link').hover(function() {
+ showNavMenu($j(this).attr('rel'));
}, function() {
- hideNavMenu($(this).attr('rel'));
+ hideNavMenu($j(this).attr('rel'));
});
-/* $('html').click(function() { $("#nav-notifications-menu" ).hide(); });*/
+/* $j('html').click(function() { $j("#nav-notifications-menu" ).hide(); });*/
- $('.group-edit-icon').hover(
+ $j('.group-edit-icon').hover(
function() {
- $(this).addClass('icon'); $(this).removeClass('iconspacer');},
+ $j(this).addClass('icon'); $j(this).removeClass('iconspacer');},
function() {
- $(this).removeClass('icon'); $(this).addClass('iconspacer');}
+ $j(this).removeClass('icon'); $j(this).addClass('iconspacer');}
);
- $('.sidebar-group-element').hover(
+ $j('.sidebar-group-element').hover(
function() {
- id = $(this).attr('id');
- $('#edit-' + id).addClass('icon'); $('#edit-' + id).removeClass('iconspacer');},
+ id = $j(this).attr('id');
+ $j('#edit-' + id).addClass('icon'); $j('#edit-' + id).removeClass('iconspacer');},
function() {
- id = $(this).attr('id');
- $('#edit-' + id).removeClass('icon');$('#edit-' + id).addClass('iconspacer');}
+ id = $j(this).attr('id');
+ $j('#edit-' + id).removeClass('icon');$j('#edit-' + id).addClass('iconspacer');}
);
- $('.savedsearchdrop').hover(
+ $j('.savedsearchdrop').hover(
function() {
- $(this).addClass('drop'); $(this).addClass('icon'); $(this).removeClass('iconspacer');},
+ $j(this).addClass('drop'); $j(this).addClass('icon'); $j(this).removeClass('iconspacer');},
function() {
- $(this).removeClass('drop'); $(this).removeClass('icon'); $(this).addClass('iconspacer');}
+ $j(this).removeClass('drop'); $j(this).removeClass('icon'); $j(this).addClass('iconspacer');}
);
- $('.savedsearchterm').hover(
+ $j('.savedsearchterm').hover(
function() {
- id = $(this).attr('id');
- $('#drop-' + id).addClass('icon'); $('#drop-' + id).addClass('drophide'); $('#drop-' + id).removeClass('iconspacer');},
+ id = $j(this).attr('id');
+ $j('#drop-' + id).addClass('icon'); $j('#drop-' + id).addClass('drophide'); $j('#drop-' + id).removeClass('iconspacer');},
function() {
- id = $(this).attr('id');
- $('#drop-' + id).removeClass('icon');$('#drop-' + id).removeClass('drophide'); $('#drop-' + id).addClass('iconspacer');}
+ id = $j(this).attr('id');
+ $j('#drop-' + id).removeClass('icon');$j('#drop-' + id).removeClass('drophide'); $j('#drop-' + id).addClass('iconspacer');}
);
-/* $('.nav-load-page-link').click(function() {
- getPageContent( $(this).attr('href') );
- hideNavMenu( '#' + $(this).closest('ul').attr('id') );
+/* $j('.nav-load-page-link').click(function() {
+ getPageContent( $j(this).attr('href') );
+ hideNavMenu( '#' + $j(this).closest('ul').attr('id') );
return false;
});*/
+ if(window.aclType == "event_head") {
+ $j('#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) {
+ $j("#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]);
+ }
+
+ $j('#event-share-checkbox').change(function() {
+
+ if ($j('#event-share-checkbox').is(':checked')) {
+ $j('#acl-wrapper').show();
+ }
+ else {
+ $j('#acl-wrapper').hide();
+ }
+ }).trigger('change');
+
+
+ if(window.aclType == "settings-head" || window.aclType == "photos_head" || window.aclType == "event_head") {
+ $j('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
+ var selstr;
+ $j('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
+ selstr = $j(this).text();
+ $j('#jot-perms-icon').removeClass('unlock').addClass('lock');
+ $j('#jot-public').hide();
+ });
+ if(selstr == null) {
+ $j('#jot-perms-icon').removeClass('lock').addClass('unlock');
+ $j('#jot-public').show();
+ }
+
+ }).trigger('change');
+ }
+// For event_end.tpl
+/* $j('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
+ var selstr;
+ $j('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
+ selstr = $j(this).text();
+ $j('#jot-public').hide();
+ });
+ if(selstr == null) {
+ $j('#jot-public').show();
+ }
+
+ }).trigger('change');*/
+
+
+ switch(window.autocompleteType) {
+ case 'msg-header':
+ var a = $j("#recip").autocomplete({
+ serviceUrl: baseurl + '/acl',
+ minChars: 2,
+ width: 350,
+ onSelect: function(value,data) {
+ $j("#recip-complete").val(data);
+ }
+ });
+ break;
+ case 'contacts-head':
+ var a = $j("#contacts-search").autocomplete({
+ serviceUrl: baseurl + '/acl',
+ minChars: 2,
+ width: 350,
+ });
+ a.setOptions({ params: { type: 'a' }});
+ break;
+ default:
+ break;
+ }
+
+
+ if(typeof window.AjaxUpload != "undefined") {
+ switch(window.ajaxType) {
+ case 'jot-header':
+ var uploader = new window.AjaxUpload(
+ 'wall-image-upload',
+ { action: 'wall_upload/'+window.nickname,
+ name: 'userfile',
+ onSubmit: function(file,ext) { $j('#profile-rotator').show(); },
+ onComplete: function(file,response) {
+ addeditortext(response);
+ $j('#profile-rotator').hide();
+ }
+ }
+ );
+
+ var file_uploader = new window.AjaxUpload(
+ 'wall-file-upload',
+ { action: 'wall_attach/'+window.nickname,
+ name: 'userfile',
+ onSubmit: function(file,ext) { $j('#profile-rotator').show(); },
+ onComplete: function(file,response) {
+ addeditortext(response);
+ $j('#profile-rotator').hide();
+ }
+ }
+ );
+ break;
+ case 'msg-header':
+ var uploader = new window.AjaxUpload(
+ 'prvmail-upload',
+ { action: 'wall_upload/' + window.nickname,
+ name: 'userfile',
+ onSubmit: function(file,ext) { $j('#profile-rotator').show(); },
+ onComplete: function(file,response) {
+ tinyMCE.execCommand('mceInsertRawHTML',false,response);
+ $j('#profile-rotator').hide();
+ }
+ }
+ );
+ break;
+ default:
+ break;
+ }
+ }
+
});
-function insertFormatting(comment,BBcode,id) {
+// update pending count //
+$j(function(){
+
+ $j("nav").bind('nav-update', function(e,data){
+ var elm = $j('#pending-update');
+ var register = $j(data).find('register').text();
+ if (register=="0") { register=""; elm.hide();} else { elm.show(); }
+ elm.html(register);
+ });
+});
+
+
+$j(function(){
- var tmpStr = $("#comment-edit-text-" + id).val();
- if(tmpStr == comment) {
- tmpStr = "";
- $("#comment-edit-text-" + id).addClass("comment-edit-text-full");
- $("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
- openMenu("comment-edit-submit-wrapper-" + id);
- $("#comment-edit-text-" + id).val(tmpStr);
+ $j("#cnftheme").fancybox({
+ width: 800,
+ autoDimensions: false,
+ onStart: function(){
+ var theme = $j("#id_theme :selected").val();
+ $j("#cnftheme").attr('href', baseurl + "/admin/themes/"+theme);
+ },
+ onComplete: function(){
+ $j("div#fancybox-content form").submit(function(e){
+ var url = $j(this).attr('action');
+ // can't get .serialize() to work...
+ var data={};
+ $j(this).find("input").each(function(){
+ data[$j(this).attr('name')] = $j(this).val();
+ });
+ $j(this).find("select").each(function(){
+ data[$j(this).attr('name')] = $j(this).children(":selected").val();
+ });
+ console.log(":)", url, data);
+
+ $j.post(url, data, function(data) {
+ if(timer) clearTimeout(timer);
+ NavUpdate();
+ $j.fancybox.close();
+ })
+
+ return false;
+ });
+
}
+ });
+});
- textarea = document.getElementById("comment-edit-text-" +id);
- if (document.selection) {
- textarea.focus();
- selected = document.selection.createRange();
- if (BBcode == "url"){
- selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
- } else
- selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
- } else if (textarea.selectionStart || textarea.selectionStart == "0") {
- var start = textarea.selectionStart;
- var end = textarea.selectionEnd;
- if (BBcode == "url"){
- textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
- } else
- textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
- }
- return true;
+
+if(typeof window.photoEdit != 'undefined') {
+
+ $j(document).keydown(function(event) {
+
+ if(window.prevLink != '') { if(event.ctrlKey && event.keyCode == 37) { event.preventDefault(); window.location.href = window.prevLink; }}
+ if(window.nextLink != '') { if(event.ctrlKey && event.keyCode == 39) { event.preventDefault(); window.location.href = window.nextLink; }}
+
+ });
}
-function cmtBbOpen(id) {
- $(".comment-edit-bb-" + id).show();
+switch(window.ajaxType) {
+ case 'jot-header':
+ function jotGetLink() {
+ reply = prompt(window.linkURL);
+ if(reply && reply.length) {
+ reply = bin2hex(reply);
+ $j('#profile-rotator').show();
+ $j.get('parse_url?binurl=' + reply, function(data) {
+ addeditortext(data);
+ $j('#profile-rotator').hide();
+ });
+ }
+ }
+
+ function linkdrop(event) {
+ var reply = event.dataTransfer.getData("text/uri-list");
+ event.target.textContent = reply;
+ event.preventDefault();
+ if(reply && reply.length) {
+ reply = bin2hex(reply);
+ $j('#profile-rotator').show();
+ $j.get('parse_url?binurl=' + reply, function(data) {
+ if (!editor) $j("#profile-jot-text").val("");
+ initEditor(function(){
+ addeditortext(data);
+ $j('#profile-rotator').hide();
+ });
+ });
+ }
+ }
+ break;
+ case 'msg-header':
+ case 'wallmsg-header':
+ function jotGetLink() {
+ reply = prompt(window.linkURL);
+ if(reply && reply.length) {
+ $j('#profile-rotator').show();
+ $j.get('parse_url?url=' + reply, function(data) {
+ tinyMCE.execCommand('mceInsertRawHTML',false,data);
+ $j('#profile-rotator').hide();
+ });
+ }
+ }
+
+ function linkdrop(event) {
+ var reply = event.dataTransfer.getData("text/uri-list");
+ event.target.textContent = reply;
+ event.preventDefault();
+ if(reply && reply.length) {
+ $j('#profile-rotator').show();
+ $j.get('parse_url?url=' + reply, function(data) {
+ tinyMCE.execCommand('mceInsertRawHTML',false,data);
+ $j('#profile-rotator').hide();
+ });
+ }
+ }
+
+ break;
+ default:
+ break;
}
-function cmtBbClose(id) {
- $(".comment-edit-bb-" + id).hide();
+
+
+function showEvent(eventid) {
+ $j.get(
+ baseurl + '/events/?id='+eventid,
+ function(data){
+ $j.fancybox(data);
+ }
+ );
+}
+
+function initCrop() {
+ function onEndCrop( coords, dimensions ) {
+ $( 'x1' ).value = coords.x1;
+ $( 'y1' ).value = coords.y1;
+ $( 'x2' ).value = coords.x2;
+ $( 'y2' ).value = coords.y2;
+ $( 'width' ).value = dimensions.width;
+ $( 'height' ).value = dimensions.height;
+ }
+
+ Event.observe( window, 'load', function() {
+ new Cropper.ImgWithPreview(
+ 'croppa',
+ {
+ previewWrap: 'previewWrap',
+ minWidth: 175,
+ minHeight: 175,
+ maxWidth: 640,
+ maxHeight: 640,
+ ratioDim: { x: 100, y:100 },
+ displayOnInit: true,
+ onEndCrop: onEndCrop
+ });
+ });
}
+
/*
-$(document).mouseup(function (clickPos) {
+$j(document).mouseup(function (clickPos) {
- var sysMenu = $("#system-menu-list");
- var sysMenuLink = $(".system-menu-link");
- var contactsMenu = $("#contacts-menu-list");
- var contactsMenuLink = $(".contacts-menu-link");
- var networkMenu = $("#network-menu-list");
- var networkMenuLink = $(".network-menu-link");
+ var sysMenu = $j("#system-menu-list");
+ var sysMenuLink = $j(".system-menu-link");
+ var contactsMenu = $j("#contacts-menu-list");
+ var contactsMenuLink = $j(".contacts-menu-link");
+ var networkMenu = $j("#network-menu-list");
+ var networkMenuLink = $j(".network-menu-link");
if( !sysMenu.is(clickPos.target) && !sysMenuLink.is(clickPos.target) && sysMenu.has(clickPos.target).length === 0) {
hideNavMenu("#system-menu-list");
function getPageContent(url) {
- var pos = $('.main-container').position();
+ var pos = $j('.main-container').position();
- $('.main-container').css('margin-left', pos.left);
- $('.main-content-container').hide(0, function () {
- $('.main-content-loading').show(0);
+ $j('.main-container').css('margin-left', pos.left);
+ $j('.main-content-container').hide(0, function () {
+ $j('.main-content-loading').show(0);
});
- $.get(url, function(html) {
- console.log($('.main-content-container').html());
- $('.main-content-container').html( $('.main-content-container', html).html() );
- console.log($('.main-content-container').html());
- $('.main-content-loading').hide(function() {
- $('.main-content-container').fadeIn(800,function() {
- $('.main-container').css('margin-left', 'auto'); // This sucks -- if the CSS specification changes, this will be wrong
+ $j.get(url, function(html) {
+ console.log($j('.main-content-container').html());
+ $j('.main-content-container').html( $j('.main-content-container', html).html() );
+ console.log($j('.main-content-container').html());
+ $j('.main-content-loading').hide(function() {
+ $j('.main-content-container').fadeIn(800,function() {
+ $j('.main-container').css('margin-left', 'auto'); // This sucks -- if the CSS specification changes, this will be wrong
});
});
});
window.navMenuTimeout[menuID + '-opening'] = true;
window.navMenuTimeout[menuID + '-timeout'] = setTimeout( function () {
- $(menuID).slideDown('fast').show();
+ $j(menuID).slideDown('fast').show();
window.navMenuTimeout[menuID + '-opening'] = false;
}, 200);
}
window.navMenuTimeout[menuID + '-closing'] = true;
window.navMenuTimeout[menuID + '-timeout'] = setTimeout( function () {
- $(menuID).slideUp('fast');
+ $j(menuID).slideUp('fast');
window.navMenuTimeout[menuID + '-closing'] = false;
}, 500);
}
}
+
+
+function insertFormatting(comment,BBcode,id) {
+
+ var tmpStr = $j("#comment-edit-text-" + id).val();
+ if(tmpStr == comment) {
+ tmpStr = "";
+ $j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+ $j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+ openMenu("comment-edit-submit-wrapper-" + id);
+ $j("#comment-edit-text-" + id).val(tmpStr);
+ }
+
+ textarea = document.getElementById("comment-edit-text-" +id);
+ if (document.selection) {
+ textarea.focus();
+ selected = document.selection.createRange();
+ if (BBcode == "url"){
+ selected.text = "["+BBcode+"]" + "http://" + selected.text + "[/"+BBcode+"]";
+ } else
+ selected.text = "["+BBcode+"]" + selected.text + "[/"+BBcode+"]";
+ } else if (textarea.selectionStart || textarea.selectionStart == "0") {
+ var start = textarea.selectionStart;
+ var end = textarea.selectionEnd;
+ if (BBcode == "url"){
+ textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + "http://" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+ } else
+ textarea.value = textarea.value.substring(0, start) + "["+BBcode+"]" + textarea.value.substring(start, end) + "[/"+BBcode+"]" + textarea.value.substring(end, textarea.value.length);
+ }
+ return true;
+}
+
+function cmtBbOpen(id) {
+ $j(".comment-edit-bb-" + id).show();
+}
+function cmtBbClose(id) {
+ $j(".comment-edit-bb-" + id).hide();
+}
+
+function confirmDelete() { return confirm(window.delItem); }
+
+function commentOpen(obj,id) {
+ if(obj.value == window.commentEmptyText) {
+ obj.value = "";
+ $j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+ $j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+ $j("#mod-cmnt-wrap-" + id).show();
+ openMenu("comment-edit-submit-wrapper-" + id);
+ }
+}
+function commentClose(obj,id) {
+ if(obj.value == "") {
+ obj.value = window.commentEmptyText;
+ $j("#comment-edit-text-" + id).removeClass("comment-edit-text-full");
+ $j("#comment-edit-text-" + id).addClass("comment-edit-text-empty");
+ $j("#mod-cmnt-wrap-" + id).hide();
+ closeMenu("comment-edit-submit-wrapper-" + id);
+ }
+}
+
+
+function commentInsert(obj,id) {
+ var tmpStr = $j("#comment-edit-text-" + id).val();
+ if(tmpStr == window.commentEmptyText) {
+ tmpStr = "";
+ $j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+ $j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+ openMenu("comment-edit-submit-wrapper-" + id);
+ }
+ var ins = $j(obj).html();
+ ins = ins.replace("<","<");
+ ins = ins.replace(">",">");
+ ins = ins.replace("&","&");
+ ins = ins.replace(""",'"');
+ $j("#comment-edit-text-" + id).val(tmpStr + ins);
+}
+
+function qCommentInsert(obj,id) {
+ var tmpStr = $j("#comment-edit-text-" + id).val();
+ if(tmpStr == window.commentEmptyText) {
+ tmpStr = "";
+ $j("#comment-edit-text-" + id).addClass("comment-edit-text-full");
+ $j("#comment-edit-text-" + id).removeClass("comment-edit-text-empty");
+ openMenu("comment-edit-submit-wrapper-" + id);
+ }
+ var ins = $j(obj).val();
+ ins = ins.replace("<","<");
+ ins = ins.replace(">",">");
+ ins = ins.replace("&","&");
+ ins = ins.replace(""",'"');
+ $j("#comment-edit-text-" + id).val(tmpStr + ins);
+ $j(obj).val("");
+}
+
+function showHideComments(id) {
+ if( $j("#collapsed-comments-" + id).is(":visible")) {
+ $j("#collapsed-comments-" + id).hide();
+ $j("#hide-comments-" + id).html(window.showMore);
+ }
+ else {
+ $j("#collapsed-comments-" + id).show();
+ $j("#hide-comments-" + id).html(window.showFewer);
+ }
+}
+
+
+
+function enableOnUser(){
+ if (editor) return;
+ $j(this).val("");
+ initEditor();
+}
+
+
+var editor=false;
+var textlen = 0;
+var plaintext = window.editSelect;
+var ispublic = window.isPublic;
+
+function initEditor(cb){
+ if (editor==false){
+ $j("#profile-jot-text-loading").show();
+ if(plaintext == 'none') {
+ $j("#profile-jot-text-loading").hide();
+ $j("#profile-jot-text").css({ 'height': 200, 'color': '#000' });
+ $j("#profile-jot-text").contact_autocomplete(baseurl+"/acl");
+ editor = true;
+ $j("a#jot-perms-icon").fancybox({
+ 'transitionIn' : 'elastic',
+ 'transitionOut' : 'elastic'
+ });
+ $j(".jothidden").show();
+ if (typeof cb!="undefined") cb();
+ return;
+ }
+ tinyMCE.init({
+ theme : "advanced",
+ mode : "specific_textareas",
+ editor_selector: window.editSelect,
+ auto_focus: "profile-jot-text",
+ plugins : "bbcode,paste,autoresize, inlinepopups",
+ 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 : '',
+ convert_urls: false,
+ content_css: window.baseURL + "/view/custom_tinymce.css",
+ theme_advanced_path : false,
+ file_browser_callback : "fcFileBrowser",
+ setup : function(ed) {
+ cPopup = null;
+ ed.onKeyDown.add(function(ed,e) {
+ if(cPopup !== null)
+ cPopup.onkey(e);
+ });
+
+ ed.onKeyUp.add(function(ed, e) {
+ var txt = tinyMCE.activeEditor.getContent();
+ match = txt.match(/@([^ \n]+)$/);
+ if(match!==null) {
+ if(cPopup === null) {
+ cPopup = new ACPopup(this,baseurl+"/acl");
+ }
+ if(cPopup.ready && match[1]!==cPopup.searchText) cPopup.search(match[1]);
+ if(! cPopup.ready) cPopup = null;
+ }
+ else {
+ if(cPopup !== null) { cPopup.close(); cPopup = null; }
+ }
+
+ textlen = txt.length;
+ if(textlen != 0 && $j('#jot-perms-icon').is('.unlock')) {
+ $j('#profile-jot-desc').html(ispublic);
+ }
+ else {
+ $j('#profile-jot-desc').html(' ');
+ }
+
+ //Character count
+
+ if(textlen <= 140) {
+ $j('#character-counter').removeClass('red');
+ $j('#character-counter').removeClass('orange');
+ $j('#character-counter').addClass('grey');
+ }
+ if((textlen > 140) && (textlen <= 420)) {
+ $j('#character-counter').removeClass('grey');
+ $j('#character-counter').removeClass('red');
+ $j('#character-counter').addClass('orange');
+ }
+ if(textlen > 420) {
+ $j('#character-counter').removeClass('grey');
+ $j('#character-counter').removeClass('orange');
+ $j('#character-counter').addClass('red');
+ }
+ $j('#character-counter').text(textlen);
+ });
+
+ ed.onInit.add(function(ed) {
+ ed.pasteAsPlainText = true;
+ $j("#profile-jot-text-loading").hide();
+ $j(".jothidden").show();
+ if (typeof cb!="undefined") cb();
+ });
+
+ }
+ });
+ editor = true;
+ // setup acl popup
+ $j("a#jot-perms-icon").fancybox({
+ 'transitionIn' : 'none',
+ 'transitionOut' : 'none'
+ });
+ } else {
+ if (typeof cb!="undefined") cb();
+ }
+}
+
+
+function msgInitEditor() {
+ if(plaintext != 'none') {
+ tinyMCE.init({
+ theme : "advanced",
+ mode : "specific_textareas",
+ editor_selector: /(profile-jot-text|prvmail-text)/,
+ plugins : "bbcode,paste",
+ 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_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 : '',
+ convert_urls: false,
+ content_css: baseurl + "/view/custom_tinymce.css",
+ //Character count
+ theme_advanced_path : false,
+ setup : function(ed) {
+ ed.onInit.add(function(ed) {
+ ed.pasteAsPlainText = true;
+ var editorId = ed.editorId;
+ var textarea = $j('#'+editorId);
+ if (typeof(textarea.attr('tabindex')) != "undefined") {
+ $j('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex'));
+ textarea.attr('tabindex', null);
+ }
+ });
+ }
+ });
+ }
+ else
+ $j("#prvmail-text").contact_autocomplete(baseurl+"/acl");
+}
+
+
+function profInitEditor() {
+ tinyMCE.init({
+ theme : "advanced",
+ mode : window.editSelect,
+ 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;
+ });
+ }
+
+ });
+}
+
+function eventInitEditor() {
+ 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;
+ });
+ }
+
+ });
+}
+
+function contactInitEditor () {
+ tinyMCE.init({
+ theme : "advanced",
+ mode : window.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"
+
+
+ });
+}
+
+function wallInitEditor() {
+ var plaintext = window.editSelect;
+
+ if(plaintext != 'none') {
+ tinyMCE.init({
+ theme : "advanced",
+ mode : "specific_textareas",
+ editor_selector: /(profile-jot-text|prvmail-text)/,
+ plugins : "bbcode,paste",
+ 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_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 : '',
+ convert_urls: false,
+ content_css: baseurl + "/view/custom_tinymce.css",
+ //Character count
+ theme_advanced_path : false,
+ setup : function(ed) {
+ ed.onInit.add(function(ed) {
+ ed.pasteAsPlainText = true;
+ var editorId = ed.editorId;
+ var textarea = $j('#'+editorId);
+ if (typeof(textarea.attr('tabindex')) != "undefined") {
+ $j('#'+editorId+'_ifr').attr('tabindex', textarea.attr('tabindex'));
+ textarea.attr('tabindex', null);
+ }
+ });
+ }
+ });
+ }
+ else
+ $j("#prvmail-text").contact_autocomplete(baseurl+"/acl");
+}
+
+function deleteCheckedItems() {
+ var checkedstr = '';
+
+ $j('.item-select').each( function() {
+ if($j(this).is(':checked')) {
+ if(checkedstr.length != 0) {
+ checkedstr = checkedstr + ',' + $j(this).val();
+ }
+ else {
+ checkedstr = $j(this).val();
+ }
+ }
+ });
+ $j.post('item', { dropitems: checkedstr }, function(data) {
+ window.location.reload();
+ });
+}
+
+
+function jotVideoURL() {
+ reply = prompt(window.vidURL);
+ if(reply && reply.length) {
+ addeditortext('[video]' + reply + '[/video]');
+ }
+}
+
+function jotAudioURL() {
+ reply = prompt(window.audURL);
+ if(reply && reply.length) {
+ addeditortext('[audio]' + reply + '[/audio]');
+ }
+}
+
+
+function jotGetLocation() {
+ reply = prompt(window.whereAreU, $j('#jot-location').val());
+ if(reply && reply.length) {
+ $j('#jot-location').val(reply);
+ }
+}
+
+function jotShare(id) {
+ if ($j('#jot-popup').length != 0) $j('#jot-popup').show();
+
+ $j('#like-rotator-' + id).show();
+ $j.get('share/' + id, function(data) {
+ if (!editor) $j("#profile-jot-text").val("");
+ initEditor(function(){
+ addeditortext(data);
+ $j('#like-rotator-' + id).hide();
+ $j(window).scrollTop(0);
+ });
+
+ });
+}
+
+function linkdropper(event) {
+ var linkFound = event.dataTransfer.types.contains("text/uri-list");
+ if(linkFound)
+ event.preventDefault();
+}
+
+function itemTag(id) {
+ reply = prompt(window.term);
+ if(reply && reply.length) {
+ reply = reply.replace('#','');
+ if(reply.length) {
+
+ commentBusy = true;
+ $j('body').css('cursor', 'wait');
+
+ $j.get('tagger/' + id + '?term=' + reply, NavUpdate);
+ /*if(timer) clearTimeout(timer);
+ timer = setTimeout(NavUpdate,3000);*/
+ liking = 1;
+ }
+ }
+}
+
+function itemFiler(id) {
+
+ var bordercolor = $j("input").css("border-color");
+
+ $j.get('filer/', function(data){
+ $j.fancybox(data);
+ $j("#id_term").keypress(function(){
+ $j(this).css("border-color",bordercolor);
+ })
+ $j("#select_term").change(function(){
+ $j("#id_term").css("border-color",bordercolor);
+ })
+
+ $j("#filer_save").click(function(e){
+ e.preventDefault();
+ reply = $j("#id_term").val();
+ if(reply && reply.length) {
+ commentBusy = true;
+ $j('body').css('cursor', 'wait');
+ $j.get('filer/' + id + '?term=' + reply, NavUpdate);
+/* if(timer) clearTimeout(timer);
+ timer = setTimeout(NavUpdate,3000);*/
+ liking = 1;
+ $j.fancybox.close();
+ } else {
+ $j("#id_term").css("border-color","#FF0000");
+ }
+ return false;
+ });
+ });
+
+}
+
+function jotClearLocation() {
+ $j('#jot-coord').val('');
+ $j('#profile-nolocation-wrapper').hide();
+}
+
+function addeditortext(data) {
+ if(plaintext == 'none') {
+ var currentText = $j("#profile-jot-text").val();
+ $j("#profile-jot-text").val(currentText + data);
+ }
+ else
+ tinyMCE.execCommand('mceInsertRawHTML',false,data);
+}
+
+if(typeof window.geoTag === 'function') window.geoTag();
+
+
--- /dev/null
+function showEvent(e){$j.get(baseurl+"/events/?id="+e,function(e){$j.fancybox(e)})}function initCrop(){function e(e,t){$("x1").value=e.x1,$("y1").value=e.y1,$("x2").value=e.x2,$("y2").value=e.y2,$("width").value=t.width,$("height").value=t.height}Event.observe(window,"load",function(){new Cropper.ImgWithPreview("croppa",{previewWrap:"previewWrap",minWidth:175,minHeight:175,maxWidth:640,maxHeight:640,ratioDim:{x:100,y:100},displayOnInit:!0,onEndCrop:e})})}function showNavMenu(e){window.navMenuTimeout[e+"-closing"]?(window.navMenuTimeout[e+"-closing"]=!1,clearTimeout(window.navMenuTimeout[e+"-timeout"])):(window.navMenuTimeout[e+"-opening"]=!0,window.navMenuTimeout[e+"-timeout"]=setTimeout(function(){$j(e).slideDown("fast").show(),window.navMenuTimeout[e+"-opening"]=!1},200))}function hideNavMenu(e){window.navMenuTimeout[e+"-opening"]?(window.navMenuTimeout[e+"-opening"]=!1,clearTimeout(window.navMenuTimeout[e+"-timeout"])):(window.navMenuTimeout[e+"-closing"]=!0,window.navMenuTimeout[e+"-timeout"]=setTimeout(function(){$j(e).slideUp("fast"),window.navMenuTimeout[e+"-closing"]=!1},500))}function insertFormatting(e,t,n){var r=$j("#comment-edit-text-"+n).val();r==e&&(r="",$j("#comment-edit-text-"+n).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+n).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+n),$j("#comment-edit-text-"+n).val(r)),textarea=document.getElementById("comment-edit-text-"+n);if(document.selection)textarea.focus(),selected=document.selection.createRange(),t=="url"?selected.text="["+t+"]"+"http://"+selected.text+"[/"+t+"]":selected.text="["+t+"]"+selected.text+"[/"+t+"]";else if(textarea.selectionStart||textarea.selectionStart=="0"){var i=textarea.selectionStart,s=textarea.selectionEnd;t=="url"?textarea.value=textarea.value.substring(0,i)+"["+t+"]"+"http://"+textarea.value.substring(i,s)+"[/"+t+"]"+textarea.value.substring(s,textarea.value.length):textarea.value=textarea.value.substring(0,i)+"["+t+"]"+textarea.value.substring(i,s)+"[/"+t+"]"+textarea.value.substring(s,textarea.value.length)}return!0}function cmtBbOpen(e){$j(".comment-edit-bb-"+e).show()}function cmtBbClose(e){$j(".comment-edit-bb-"+e).hide()}function confirmDelete(){return confirm(window.delItem)}function commentOpen(e,t){e.value==window.commentEmptyText&&(e.value="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),$j("#mod-cmnt-wrap-"+t).show(),openMenu("comment-edit-submit-wrapper-"+t))}function commentClose(e,t){e.value==""&&(e.value=window.commentEmptyText,$j("#comment-edit-text-"+t).removeClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).addClass("comment-edit-text-empty"),$j("#mod-cmnt-wrap-"+t).hide(),closeMenu("comment-edit-submit-wrapper-"+t))}function commentInsert(e,t){var n=$j("#comment-edit-text-"+t).val();n==window.commentEmptyText&&(n="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+t));var r=$j(e).html();r=r.replace("<","<"),r=r.replace(">",">"),r=r.replace("&","&"),r=r.replace(""",'"'),$j("#comment-edit-text-"+t).val(n+r)}function qCommentInsert(e,t){var n=$j("#comment-edit-text-"+t).val();n==window.commentEmptyText&&(n="",$j("#comment-edit-text-"+t).addClass("comment-edit-text-full"),$j("#comment-edit-text-"+t).removeClass("comment-edit-text-empty"),openMenu("comment-edit-submit-wrapper-"+t));var r=$j(e).val();r=r.replace("<","<"),r=r.replace(">",">"),r=r.replace("&","&"),r=r.replace(""",'"'),$j("#comment-edit-text-"+t).val(n+r),$j(e).val("")}function showHideComments(e){$j("#collapsed-comments-"+e).is(":visible")?($j("#collapsed-comments-"+e).hide(),$j("#hide-comments-"+e).html(window.showMore)):($j("#collapsed-comments-"+e).show(),$j("#hide-comments-"+e).html(window.showFewer))}function enableOnUser(){if(editor)return;$j(this).val(""),initEditor()}function initEditor(e){if(editor==0){$j("#profile-jot-text-loading").show();if(plaintext=="none"){$j("#profile-jot-text-loading").hide(),$j("#profile-jot-text").css({height:200,color:"#000"}),$j("#profile-jot-text").contact_autocomplete(baseurl+"/acl"),editor=!0,$j("a#jot-perms-icon").fancybox({transitionIn:"elastic",transitionOut:"elastic"}),$j(".jothidden").show(),typeof e!="undefined"&&e();return}tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:window.editSelect,auto_focus:"profile-jot-text",plugins:"bbcode,paste,autoresize, inlinepopups",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:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:window.baseURL+"/view/custom_tinymce.css",theme_advanced_path:!1,file_browser_callback:"fcFileBrowser",setup:function(t){cPopup=null,t.onKeyDown.add(function(e,t){cPopup!==null&&cPopup.onkey(t)}),t.onKeyUp.add(function(e,t){var n=tinyMCE.activeEditor.getContent();match=n.match(/@([^ \n]+)$/),match!==null?(cPopup===null&&(cPopup=new ACPopup(this,baseurl+"/acl")),cPopup.ready&&match[1]!==cPopup.searchText&&cPopup.search(match[1]),cPopup.ready||(cPopup=null)):cPopup!==null&&(cPopup.close(),cPopup=null),textlen=n.length,textlen!=0&&$j("#jot-perms-icon").is(".unlock")?$j("#profile-jot-desc").html(ispublic):$j("#profile-jot-desc").html(" "),textlen<=140&&($j("#character-counter").removeClass("red"),$j("#character-counter").removeClass("orange"),$j("#character-counter").addClass("grey")),textlen>140&&textlen<=420&&($j("#character-counter").removeClass("grey"),$j("#character-counter").removeClass("red"),$j("#character-counter").addClass("orange")),textlen>420&&($j("#character-counter").removeClass("grey"),$j("#character-counter").removeClass("orange"),$j("#character-counter").addClass("red")),$j("#character-counter").text(textlen)}),t.onInit.add(function(t){t.pasteAsPlainText=!0,$j("#profile-jot-text-loading").hide(),$j(".jothidden").show(),typeof e!="undefined"&&e()})}}),editor=!0,$j("a#jot-perms-icon").fancybox({transitionIn:"none",transitionOut:"none"})}else typeof e!="undefined"&&e()}function msgInitEditor(){plaintext!="none"?tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:/(profile-jot-text|prvmail-text)/,plugins:"bbcode,paste",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_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0;var t=e.editorId,n=$j("#"+t);typeof n.attr("tabindex")!="undefined"&&($j("#"+t+"_ifr").attr("tabindex",n.attr("tabindex")),n.attr("tabindex",null))})}}):$j("#prvmail-text").contact_autocomplete(baseurl+"/acl")}function profInitEditor(){tinyMCE.init({theme:"advanced",mode:window.editSelect,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:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0})}})}function eventInitEditor(){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:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0})}})}function contactInitEditor(){tinyMCE.init({theme:"advanced",mode:window.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:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",content_css:baseurl+"/view/custom_tinymce.css"})}function wallInitEditor(){var e=window.editSelect;e!="none"?tinyMCE.init({theme:"advanced",mode:"specific_textareas",editor_selector:/(profile-jot-text|prvmail-text)/,plugins:"bbcode,paste",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_blockformats:"blockquote,code",gecko_spellcheck:!0,paste_text_sticky:!0,entity_encoding:"raw",add_unload_trigger:!1,remove_linebreaks:!1,force_p_newlines:!1,force_br_newlines:!0,forced_root_block:"",convert_urls:!1,content_css:baseurl+"/view/custom_tinymce.css",theme_advanced_path:!1,setup:function(e){e.onInit.add(function(e){e.pasteAsPlainText=!0;var t=e.editorId,n=$j("#"+t);typeof n.attr("tabindex")!="undefined"&&($j("#"+t+"_ifr").attr("tabindex",n.attr("tabindex")),n.attr("tabindex",null))})}}):$j("#prvmail-text").contact_autocomplete(baseurl+"/acl")}function deleteCheckedItems(){var e="";$j(".item-select").each(function(){$j(this).is(":checked")&&(e.length!=0?e=e+","+$j(this).val():e=$j(this).val())}),$j.post("item",{dropitems:e},function(e){window.location.reload()})}function jotVideoURL(){reply=prompt(window.vidURL),reply&&reply.length&&addeditortext("[video]"+reply+"[/video]")}function jotAudioURL(){reply=prompt(window.audURL),reply&&reply.length&&addeditortext("[audio]"+reply+"[/audio]")}function jotGetLocation(){reply=prompt(window.whereAreU,$j("#jot-location").val()),reply&&reply.length&&$j("#jot-location").val(reply)}function jotShare(e){$j("#jot-popup").length!=0&&$j("#jot-popup").show(),$j("#like-rotator-"+e).show(),$j.get("share/"+e,function(t){editor||$j("#profile-jot-text").val(""),initEditor(function(){addeditortext(t),$j("#like-rotator-"+e).hide(),$j(window).scrollTop(0)})})}function linkdropper(e){var t=e.dataTransfer.types.contains("text/uri-list");t&&e.preventDefault()}function itemTag(e){reply=prompt(window.term),reply&&reply.length&&(reply=reply.replace("#",""),reply.length&&(commentBusy=!0,$j("body").css("cursor","wait"),$j.get("tagger/"+e+"?term="+reply,NavUpdate),liking=1))}function itemFiler(e){var t=$j("input").css("border-color");$j.get("filer/",function(n){$j.fancybox(n),$j("#id_term").keypress(function(){$j(this).css("border-color",t)}),$j("#select_term").change(function(){$j("#id_term").css("border-color",t)}),$j("#filer_save").click(function(t){return t.preventDefault(),reply=$j("#id_term").val(),reply&&reply.length?(commentBusy=!0,$j("body").css("cursor","wait"),$j.get("filer/"+e+"?term="+reply,NavUpdate),liking=1,$j.fancybox.close()):$j("#id_term").css("border-color","#FF0000"),!1})})}function jotClearLocation(){$j("#jot-coord").val(""),$j("#profile-nolocation-wrapper").hide()}function addeditortext(e){if(plaintext=="none"){var t=$j("#profile-jot-text").val();$j("#profile-jot-text").val(t+e)}else tinyMCE.execCommand("mceInsertRawHTML",!1,e)}$j(document).ready(function(){window.navMenuTimeout={"#network-menu-list-timeout":null,"#contacts-menu-list-timeout":null,"#system-menu-list-timeout":null,"#network-menu-list-opening":!1,"#contacts-menu-list-opening":!1,"#system-menu-list-opening":!1,"#network-menu-list-closing":!1,"#contacts-menu-list-closing":!1,"#system-menu-list-closing":!1},typeof acl=="undefined"&&(acl=new ACL(baseurl+"/acl",[window.allowCID,window.allowGID,window.denyCID,window.denyGID])),$j("#profile-jot-text").focus(enableOnUser),$j("#profile-jot-text").click(enableOnUser),$j(".nav-menu-link").hover(function(){showNavMenu($j(this).attr("rel"))},function(){hideNavMenu($j(this).attr("rel"))}),$j(".group-edit-icon").hover(function(){$j(this).addClass("icon"),$j(this).removeClass("iconspacer")},function(){$j(this).removeClass("icon"),$j(this).addClass("iconspacer")}),$j(".sidebar-group-element").hover(function(){id=$j(this).attr("id"),$j("#edit-"+id).addClass("icon"),$j("#edit-"+id).removeClass("iconspacer")},function(){id=$j(this).attr("id"),$j("#edit-"+id).removeClass("icon"),$j("#edit-"+id).addClass("iconspacer")}),$j(".savedsearchdrop").hover(function(){$j(this).addClass("drop"),$j(this).addClass("icon"),$j(this).removeClass("iconspacer")},function(){$j(this).removeClass("drop"),$j(this).removeClass("icon"),$j(this).addClass("iconspacer")}),$j(".savedsearchterm").hover(function(){id=$j(this).attr("id"),$j("#drop-"+id).addClass("icon"),$j("#drop-"+id).addClass("drophide"),$j("#drop-"+id).removeClass("iconspacer")},function(){id=$j(this).attr("id"),$j("#drop-"+id).removeClass("icon"),$j("#drop-"+id).removeClass("drophide"),$j("#drop-"+id).addClass("iconspacer")});if(window.aclType=="event_head"){$j("#events-calendar").fullCalendar({events:baseurl+"/events/json/",header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},timeFormat:"H(:mm)",eventClick:function(e,t,n){showEvent(e.id)},eventRender:function(e,t,n){if(e.item["author-name"]==null)return;switch(n.name){case"month":t.find(".fc-event-title").html("<img src='{0}' style='height:10px;width:10px'>{1} : {2}".format(e.item["author-avatar"],e.item["author-name"],e.title));break;case"agendaWeek":t.find(".fc-event-title").html("<img src='{0}' style='height:12px; width:12px'>{1}<p>{2}</p><p>{3}</p>".format(e.item["author-avatar"],e.item["author-name"],e.item.desc,e.item.location));break;case"agendaDay":t.find(".fc-event-title").html("<img src='{0}' style='height:24px;width:24px'>{1}<p>{2}</p><p>{3}</p>".format(e.item["author-avatar"],e.item["author-name"],e.item.desc,e.item.location))}}});var e=location.href.replace(baseurl,"").split("/");e.length>=4&&$j("#events-calendar").fullCalendar("gotoDate",e[2],e[3]-1);var t=location.hash.split("-");t.length==2&&t[0]=="#link"&&showEvent(t[1])}$j("#event-share-checkbox").change(function(){$j("#event-share-checkbox").is(":checked")?$j("#acl-wrapper").show():$j("#acl-wrapper").hide()}).trigger("change"),(window.aclType=="settings-head"||window.aclType=="photos_head"||window.aclType=="event_head")&&$j("#contact_allow, #contact_deny, #group_allow, #group_deny").change(function(){var e;$j("#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected").each(function(){e=$j(this).text(),$j("#jot-perms-icon").removeClass("unlock").addClass("lock"),$j("#jot-public").hide()}),e==null&&($j("#jot-perms-icon").removeClass("lock").addClass("unlock"),$j("#jot-public").show())}).trigger("change");switch(window.autocompleteType){case"msg-header":var n=$j("#recip").autocomplete({serviceUrl:baseurl+"/acl",minChars:2,width:350,onSelect:function(e,t){$j("#recip-complete").val(t)}});break;case"contacts-head":var n=$j("#contacts-search").autocomplete({serviceUrl:baseurl+"/acl",minChars:2,width:350});n.setOptions({params:{type:"a"}});break;default:}if(typeof window.AjaxUpload!="undefined")switch(window.ajaxType){case"jot-header":var r=new window.AjaxUpload("wall-image-upload",{action:"wall_upload/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){addeditortext(t),$j("#profile-rotator").hide()}}),i=new window.AjaxUpload("wall-file-upload",{action:"wall_attach/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){addeditortext(t),$j("#profile-rotator").hide()}});break;case"msg-header":var r=new window.AjaxUpload("prvmail-upload",{action:"wall_upload/"+window.nickname,name:"userfile",onSubmit:function(e,t){$j("#profile-rotator").show()},onComplete:function(e,t){tinyMCE.execCommand("mceInsertRawHTML",!1,t),$j("#profile-rotator").hide()}});break;default:}}),$j(function(){$j("nav").bind("nav-update",function(e,t){var n=$j("#pending-update"),r=$j(t).find("register").text();r=="0"?(r="",n.hide()):n.show(),n.html(r)})}),$j(function(){$j("#cnftheme").fancybox({width:800,autoDimensions:!1,onStart:function(){var e=$j("#id_theme :selected").val();$j("#cnftheme").attr("href",baseurl+"/admin/themes/"+e)},onComplete:function(){$j("div#fancybox-content form").submit(function(e){var t=$j(this).attr("action"),n={};return $j(this).find("input").each(function(){n[$j(this).attr("name")]=$j(this).val()}),$j(this).find("select").each(function(){n[$j(this).attr("name")]=$j(this).children(":selected").val()}),console.log(":)",t,n),$j.post(t,n,function(e){timer&&clearTimeout(timer),NavUpdate(),$j.fancybox.close()}),!1})}})}),typeof window.photoEdit!="undefined"&&$j(document).keydown(function(e){window.prevLink!=""&&e.ctrlKey&&e.keyCode==37&&(e.preventDefault(),window.location.href=window.prevLink),window.nextLink!=""&&e.ctrlKey&&e.keyCode==39&&(e.preventDefault(),window.location.href=window.nextLink)});switch(window.ajaxType){case"jot-header":function jotGetLink(){reply=prompt(window.linkURL),reply&&reply.length&&(reply=bin2hex(reply),$j("#profile-rotator").show(),$j.get("parse_url?binurl="+reply,function(e){addeditortext(e),$j("#profile-rotator").hide()}))}function linkdrop(e){var t=e.dataTransfer.getData("text/uri-list");e.target.textContent=t,e.preventDefault(),t&&t.length&&(t=bin2hex(t),$j("#profile-rotator").show(),$j.get("parse_url?binurl="+t,function(e){editor||$j("#profile-jot-text").val(""),initEditor(function(){addeditortext(e),$j("#profile-rotator").hide()})}))}break;case"msg-header":case"wallmsg-header":function jotGetLink(){reply=prompt(window.linkURL),reply&&reply.length&&($j("#profile-rotator").show(),$j.get("parse_url?url="+reply,function(e){tinyMCE.execCommand("mceInsertRawHTML",!1,e),$j("#profile-rotator").hide()}))}function linkdrop(e){var t=e.dataTransfer.getData("text/uri-list");e.target.textContent=t,e.preventDefault(),t&&t.length&&($j("#profile-rotator").show(),$j.get("parse_url?url="+t,function(e){tinyMCE.execCommand("mceInsertRawHTML",!1,e),$j("#profile-rotator").hide()}))}break;default:}var editor=!1,textlen=0,plaintext=window.editSelect,ispublic=window.isPublic;typeof window.geoTag=="function"&&window.geoTag();
\ No newline at end of file
</form>
</div>
-<script type="text/javascript"> $(document).ready(function() { $("#id_$lname.0").focus();} );</script>
+<script type="text/javascript">window.loginName = "$lname.0";</script>
--- /dev/null
+
+<script src="$baseurl/library/jquery_ac/friendica.complete.min.js" ></script>
+
+
--- /dev/null
+
+<!--<script language="javascript" type="text/javascript" src="$baseurl/library/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>-->
+<script type="text/javascript" src="js/ajaxupload.min.js" ></script>
+
+<script language="javascript" type="text/javascript">
+ msgInitEditor();
+</script>
+
+
--- /dev/null
+
+<script language="javascript" type="text/javascript">
+ window.nickname = "$nickname";
+ window.linkURL = "$linkurl";
+ var plaintext = "$editselect";
+ window.ajaxType = 'msg-header';
+ window.autocompleteType = 'msg-header';
+</script>
+
--- /dev/null
+
+<script>
+ window.prevLink = "$prevlink";
+ window.nextLink = "$nextlink";
+ window.photoEdit = true;
+
+</script>
--- /dev/null
+
+<script>
+ window.isPublic = "$ispublic";
+</script>
+
<div id="photos-upload-new-end"></div>
<div id="photos-upload-exist-wrapper">
<div id="photos-upload-existing-album-text">$existalbumtext</div>
+ <select id="photos-upload-album-select" name="album" size="4">
$albumselect
+ </select>
</div>
<div id="photos-upload-exist-end"></div>
</div>
</form>
-<!--
-<script>
- $("a#photos-upload-perms-menu").fancybox({
- 'transitionIn' : 'none',
- 'transitionOut' : 'none'
- });
-</script>-->
--- /dev/null
+
+<script type="text/javascript" src="js/country.min.js" ></script>
+
+<script language="javascript" type="text/javascript">
+ profInitEditor();
+ Fill_Country('$country_name');
+ Fill_States('$region');
+</script>
+
--- /dev/null
+
+<script language="javascript" type="text/javascript">
+ window.editSelect = "$editselect";
+</script>
+
</form>
</div>
-<script type="text/javascript">Fill_Country('$country_name');Fill_States('$region');</script>
+
--- /dev/null
+
+<script>
+ window.isPublic = "$ispublic";
+</script>
+
--- /dev/null
+ <script>$j(function(){ previewTheme($j("#id_$theme.0")[0]); });</script>
+
// making pages load faster
if( $a->module === 'home' || $a->module === 'login' || $a->module === 'register' || $a->module === 'lostpass' ) {
$a->page['htmlhead'] = str_replace('$stylesheet', $a->get_baseurl() . '/view/theme/frost/login-style.css', $a->page['htmlhead']);
-
}
+ if( $a->module === 'login' )
+ $a->page['end'] .= '<script type="text/javascript"> $j(document).ready(function() { $j("#id_" + window.loginName).focus();} );</script>';
}
--- /dev/null
+
+<script language="javascript" type="text/javascript">
+wallInitEditor();
+</script>
+
--- /dev/null
+
+<script language="javascript" type="text/javascript">
+window.editSelect = "$editselect";
+window.ajaxType = "wallmsg-header";
+</script>
+