var LOG=true; console.log(document.cookie) const ORIENT_TRANSFORMS={ 1: null, 2: 'rotateY(180deg)', 3: 'rotate(180deg)', 4: 'rotate(180deg) rotateY(180deg)', 5: 'rotate(270deg) rotateY(180deg)', 6: 'rotate(90deg)', 7: 'rotate(90deg) rotateY(180deg)', 8: 'rotate(270deg)' } const ORIENTS=[ 1,6,3,8,1,2,1 ]; WCALENDAR.MONTHS=['Januaro','Februaro','Marto','Aprilo','Majo','Junio', 'Julio','Aŭgusto','Septembro','Oktobro','Novembro','Decembro'] WCALENDAR.DOW=['Lun','Mar','Mer','Ĵaŭ','Ven','Sab','Dim'] function _____UPLOAD_____(){} function base64ToArrayBuffer(base64){ var idx; if(base64.startsWith('data:') && (idx=base64.indexOf(','))!=-1) base64=base64.substring(idx+1); var binaryString = atob(base64), length=binaryString.length, bytes=new Uint8Array(length); for(var i=0; ih){ if(w>maxW) h=(w=maxW)/image.width*image.height; }else{ if(h>maxH) w=(h=maxH)/image.height*image.width; } if(w.mainCDiv',null,function(e){ e.style.height=window.innerHeight+'px'; }) w$query("##ys").style.height=(window.innerHeight-w$query(" #mainR>div.S").getBoundingClientRect().bottom); W.M.map.invalidateSize(); } //!! Map resize function MResize(c,e,d){ windowResized(); if(c==0){ return d.target; } } window.addEventListener("resize", function(ev){ windowResized(ev); },false); function splitter(el,args){ args = args || {}; args.d=0; if(!args.side) args.side='both'; if(!args.leftMin) args.leftMin=0; if(!args.rightMin) args.rightMin=0; if(!args.enabled) args.enabled=function(){ return true; } if(!args.toResize) args.toResize=function(){ return true; } if(!args.resizing) args.resizing=function(){} el.onmousedown=(function(ev){ w$no(ev); if(!args.enabled(el,args,ev)) return true; var baseX=ev.pageX, baseL=el.previousElementSibling.clientWidth, baseR=el.nextElementSibling.clientWidth, base=el.parentElement.clientWidth; var ghostbar=document.createElement("div"); ghostbar.id='splitterGhost'; ghostbar.style.height=el.outerHeight+"px"; ghostbar.style.top=el.offsetTop+"px"; ghostbar.style.left=el.offsetLeft+"px"; document.body.appendChild(ghostbar); mousemove=function(ev){ w$no(ev); var d=ev.pageX-baseX; ghostbar.style.left=ev.pageX+'px' ghostbar.style.height=el.parentElement.outerHeight+'px' ghostbar.style.top=el.parentElement.offsetTop+'px' if(args.toResize(el,args,d-args.d)){ args.d=d; if(args.side=='parent-left'){ el.parentElement.style.width=(base-d)+'px'; }else if(args.side=='parent-right'){ el.parentElement.style.width=(base+d)+'px'; }else if( (baseL==undefined || baseL+d>=args.leftMin && (!args.leftMax || baseL+d<=args.leftMax)) && (baseR==undefined || baseR-d>=args.rightMin && (!args.rightMax || baseR-d<=args.rightMax)) ){ if((args.side=='left' || args.side=='both') && baseL!=undefined) el.previousElementSibling.style.width=(baseL+d)+'px'; if((args.side=='right' || args.side=='both') && baseR!=undefined) el.nextElementSibling.style.width=(baseR-d)+'px'; }else{ console.log( el.previousElementSibling.style ); } args.resizing(el,args); } //console.log(ev); } mouseup=function(ev){ w$no(ev); document.removeEventListener("mousemove",mousemove); document.removeEventListener("mouseup",mouseup); document.body.removeChild(ghostbar); } document.addEventListener("mousemove",mousemove); document.addEventListener("mouseup",mouseup); }); } function split(ev,el,args){ args = args || {}; args.d=0; if(!args.side) args.side='both'; if(!args.leftMin) args.leftMin=0; if(!args.rightMin) args.rightMin=0; if(!args.enabled) args.enabled=function(){ return true; } if(!args.toResize) args.toResize=function(){ return true; } if(!args.resizing) args.resizing=function(){} //el.onmousedown=(function(ev){ w$no(ev); if(!args.enabled(el,args,ev)) return true; var baseX=ev.pageX, baseL=el.previousElementSibling?el.previousElementSibling.clientWidth:undefined, baseR=el.nextElementSibling?el.nextElementSibling.clientWidth:undefined, base=el.parentElement.clientWidth; var ghostbar=document.createElement("div"); ghostbar.id='splitterGhost'; ghostbar.style.height=el.outerHeight+"px"; ghostbar.style.top=el.offsetTop+"px"; ghostbar.style.left=el.offsetLeft+"px"; document.body.appendChild(ghostbar); mousemove=function(ev){ var d=ev.pageX-baseX; ghostbar.style.left=ev.pageX+'px' ghostbar.style.height=el.parentElement.outerHeight+'px' ghostbar.style.top=el.parentElement.offsetTop+'px' if(args.toResize(el,args,d-args.d)){ args.d=d; if(args.side=='parent-left'){ el.parentElement.style.width=Math.max(args.leftMin,base-d)+'px'; }else if(args.side=='parent-right'){ el.parentElement.style.width=(base+d)+'px'; }else if( (baseL==undefined || baseL+d>=args.leftMin && (!args.leftMax || baseL+d<=args.leftMax)) && (baseR==undefined || baseR-d>=args.rightMin && (!args.rightMax || baseR-d<=args.rightMax)) ){ if((args.side=='left' || args.side=='both') && baseL!=undefined) el.previousElementSibling.style.width=(baseL+d)+'px'; if((args.side=='right' || args.side=='both') && baseR!=undefined) el.nextElementSibling.style.width=(baseR-+d)+'px'; }else{ console.log( el.previousElementSibling&&el.previousElementSibling.style ); } args.resizing(el,args); } return w$no(ev); } mouseup=function(ev){ w$no(ev); if(args.resized) args.resized(el,args); document.removeEventListener("mousemove",mousemove); document.removeEventListener("mouseup",mouseup); document.body.removeChild(ghostbar); } document.addEventListener("mousemove",mousemove); document.addEventListener("mouseup",mouseup); //}); } function resize(ev,el,args){ args = args || {}; args.dx=0; args.dy=0; if(!args.side) args.side='both'; if(!args.minWidth) args.minWidth=0; if(!args.minHeight) args.minHeight=0; if(!args.enabled) args.enabled=function(){ return true; } if(!args.toResize) args.toResize=function(){ return true; } if(!args.resizing) args.resizing=function(){} if(!args.enabled(el,args,ev)) return true; var baseX=ev.pageX,baseY=ev.pageY; args.width=el.clientWidth,args.height=el.clientHeight; mousemove=function(ev){ var dx=ev.pageX-baseX,dy=ev.pageY-baseY; if(args.toResize(el,args,dx-args.dx,dy-args.dy)){ args.dx=dx; args.dy=dy; if(args.side!='height') el.style.width=Math.max(args.minWidth,args.width+dx)+'px'; if(args.side!='width') el.style.height=Math.max(args.minHeight,args.height+dy)+'px'; args.resizing(el,args); } return w$no(ev); } mouseup=function(ev){ if(args.resized) args.resized(el,args); document.body.removeEventListener("mousemove",mousemove); document.body.removeEventListener("mouseup",mouseup); //document.body.removeEventListener("click",w$no); return w$no(ev); } document.body.addEventListener("mousemove",mousemove); document.body.addEventListener("mouseup",mouseup); //document.body.addEventListener("click",w$no); return w$no(ev); } function mResize(ev){ resize(ev,w$find(ev.target,'mDiv'),{ minWidth:24, minHeight:24, resizing: function(el,args){ var x,c,ch=w$find$$(el).children; for(var i=0; i10 || Math.abs(h-args.height)>10){ if(n._edit && (n.o_mmw)!=w || (n.o_mmh)!=h){ n.o_mmw=w; n.o_mmh=h; w$w({'!nSetData':'', n:{'@id':n.id, 'n.o_mmw':w, 'n.o_mmh':h} }); } } } }); } function miResize(ev){ var $P=$parentEl(ev.target)||w$query('##H'), n=$P.$w.$; resize(ev,ev.target.parentElement,{ side:'width',minWidth:24, minHeight:24, resizing: function(el,args){ if(!n.o_mmo){ var ch=w$find$$(el).children; for(var i=0; idiv.mImageDiv", ch[i]); if(!x) console.log(ch[i]); if(x!=el){ x.style.width=el.style.width; } } } }, resized: function(el,args){ var pc=Math.min(100,Math.round(1000*el.clientWidth/el.parentElement.clientWidth)/10); console.log(pc); if(!n.o_mm){ var ch=w$find$$(el).children; for(var i=0; idiv.mImageDiv", ch[i]); if(!x) console.log(ch[i]); x.style.width=pc+'%'; } if(n._change) w$w({'!nSetData':'', n:{'@id':$P.$w.$.id, 'o_mmi':pc} }); }else{ el.style.width=pc+'%'; if(n._change) w$w({'!nSetData':'', n:{'@id':w$find(el,'N').$w.$.id, 'o_mi':pc} }); } } }); } function _____FORMAT_____(){} function toPercent(v){ return Math.round(1000*v)/10; } function toTime(v){ v=v||0; var w; //console.log(v && v.replace(' ','T')+'Z'); //console.log(Date.now()/1000,new Date(v.replace('[.].*','').replace(' ','T')+'Z').getTime()/1000); //console.log(Date.now()/1000-new Date(v.replace('[.].*','').replace(' ','T')+'Z').getTime()/1000); //console.log(v.replace(/[.][0-9]*/,'').replace(' ','T')+'Z') if(typeof v == 'string') v=(Date.now()-new Date(v.replace(/[.][0-9]*/,'').replace(' ','T')+'Z').getTime())/1000; //console.log(v); if(v<60) return "nun"; if((v/=60)<60) return ((v<2 ? "de" : "de")+' '+~~v+(v<2 ? " minuto" : " minutoj")).trim(); if((v/=60)<24) return ((v<2 ? "de" : "de")+' '+~~v+(v<2 ? " horo" : " horoj")).trim(); if((v/=24)<31) return ((v<2 ? "de" : "de")+' '+~~v+(v<2 ? " tago" : " tagoj")).trim(); var w=v; if((v/=30.43)<24) return ((v<2 ? "de" : "de")+' '+~~v+(v<2 ? " monato": " monatoj")).trim(); v=w/365.25; return ((v<2 ? "de" : "de")+' '+~~v+(v<2 ? " jaro" : " jaroj")).trim(); } function toNum(v){ v=v||0; var s=Math.sign(v); v=Math.abs(v); if(v<2500) return String(s*v); var p='k'; v=Math.round(v/100); if(v>10000){ p='M'; v=Math.round(v/1000); } if(v>10000){ p='G'; v=Math.round(v/1000); } return ~~(s*v/10)+'.'+v%10+p; } function toSize(v){ v=v||0; var s=Math.sign(v); v=Math.abs(v); if(v<2*1024) return (s*v)+'b'; var p='K'; v=Math.round(10*v/1024); if(v>2*10*1024){ p='M'; v=Math.round(v/1024); } if(v>2*10*1024){ p='G'; v=Math.round(v/1024); } return ~~(s*v/10)+'.'+v%10+p; } function toDecLatLong(a,C,c){ if(!a) return null; a=a[0].numerator+a[1].numerator/(60*a[1].denominator)+a[2].numerator/(3600*a[2].denominator); return ((C||'').toUpperCase()==(c||'').toUpperCase()) ? a : -a; } function vote(n){ var T=""; var Y="\n\nVi pensas, ke ĉi tio estas "; var votes={ // GRAVA!', rx:'MALGRAVA!', ix:'NEDECA! '0':{ l:'△', r:'▽', i:'⁈', x:'', ly:'g', lx:'GRAVA!', ry:'m', rx:'MALGRAVA!', iy:'i', ix:'☣ MALDECA!!!' }, 'g':{ l:'✷', r:'', i:'?', x:Y+'GRAVA.', ly:'G', lx:'SIGNIFA!', ry:'0', rx:'NE grava!', iy:'', ix:'' }, 'G':{ l:'🌟', r:'', i:'?', x:Y+'SIGNIFA!', ly:'', lx:'SIGNIFA!', ry:'g', rx:'NE signifa, sed GRAVA.', iy:'', ix:'' }, 'm':{ l:'', r:'◻', i:'?', x:Y+'MALGRAVA.', ly:'0', lx:'NE malgrava.', ry:'M', rx:'BAGATELA!', iy:'', ix:'' }, 'M':{ l:'', r:'◼', i:'⁈', x:Y+'BAGATELA!', ly:'m', lx:'NE bagatela.', ry:'', rx:'BAGATELA!', iy:'i', ix:'☣ MALDECA!!!' }, 'i':{ l:'', r:'', i:'', x:Y+'☣ MALDECA!!!', ly:'', lx:'', ry:'', rx:'', iy:'0', ix:'NO, NOT inappropriate.' }, }; var set=[ { t:"🌟" }, { t:"★★★★★" }, { t:"✰★★★★" }, { t:"✰★★★★" }, { t:"✰✰★★★" }, { t:"✰✰★★★" }, { t:"✰✰✰★★" }, { t:"✰✰✰✰★" }, { t:"✰✰✰✰★" }, { t:"✰✰✰✰✰" }, ]; if(n._vote){ var s_vote=n!=null && n.s_vote || '0'; var S=votes[s_vote], v=0, i=0; if(n){ v=n.n_vote; i=(n.n_inappr || 0); } T+=''+S.l+''+ ''+toNum(v)+''+ ''+S.r+''+ '  '+S.i+''; }else{ if(n.n_vote!=1){ var S=votes['0']; T+=''+S.l+''+ ''+toNum(v)+''+ ''+S.r+''; } } if((n.n_inapp || 0)!=0){ T+=''+n.n_inapp+''; } if(n.x_com==0 && n._com){ // ->+ if(T!='') T+=' ' T+='~ ' +'↪ + '; }else if((n.x_com||0)>0){ // ->n if(T!='') T+=' ' T+='~ ' +'↪ ' +(n.x_com ? toNum(n.x_com) :'')+' '; }else if((n.x_com||0)>0 || n._com){ // ->... if(T!='') T+=' '; T+='~ ' +'↪ ... '; } /* //if(n.x_com || n._com){ if(T!='') T+=' ~ '; if(n.x_com) T+='↪ ' +(n.x_com ? toNum(n.x_com) :'')+' '; //if(n._com) T+=' ↪ ➕'; //}*/ if(n._edit){ if(T!='') T+=' '; T+='~ '+set[n.rate || 5].t+''; } return T; } var LANG2=[{"l2":"aa","n":"Afar"},{"l2":"ab","n":"Abkhazian"},{"l2":"ae","n":"Avestan"},{"l2":"af","n":"Afrikaans"},{"l2":"ak","n":"Akan"},{"l2":"am","n":"Amharic"},{"l2":"an","n":"Aragonese"},{"l2":"ar","n":"Arabic"},{"l2":"as","n":"Assamese"},{"l2":"av","n":"Avaric"},{"l2":"ay","n":"Aymara"},{"l2":"az","n":"Azerbaijani"},{"l2":"ba","n":"Bashkir"},{"l2":"be","n":"Belarusian"},{"l2":"bg","n":"Bulgarian"},{"l2":"bh","n":"Bihari languages"},{"l2":"bi","n":"Bislama"},{"l2":"bm","n":"Bambara"},{"l2":"bn","n":"Bengali"},{"l2":"bo","n":"Tibetan"},{"l2":"br","n":"Breton"},{"l2":"bs","n":"Bosnian"},{"l2":"ca","n":"Catalan; Valencian"},{"l2":"ce","n":"Chechen"},{"l2":"ch","n":"Chamorro"},{"l2":"co","n":"Corsican"},{"l2":"cr","n":"Cree"},{"l2":"cs","n":"Czech"},{"l2":"cu","n":"Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"},{"l2":"cv","n":"Chuvash"},{"l2":"cy","n":"Welsh"},{"l2":"da","n":"Danish"},{"l2":"de","n":"German"},{"l2":"dv","n":"Divehi; Dhivehi; Maldivian"},{"l2":"dz","n":"Dzongkha"},{"l2":"ee","n":"Ewe"},{"l2":"el","n":"Greek, Modern (1453-)"},{"l2":"en","n":"English"},{"l2":"eo","n":"Esperanto"},{"l2":"es","n":"Spanish; Castilian"},{"l2":"et","n":"Estonian"},{"l2":"eu","n":"Basque"},{"l2":"fa","n":"Persian"},{"l2":"ff","n":"Fulah"},{"l2":"fi","n":"Finnish"},{"l2":"fj","n":"Fijian"},{"l2":"fo","n":"Faroese"},{"l2":"fr","n":"French"},{"l2":"fy","n":"Western Frisian"},{"l2":"ga","n":"Irish"},{"l2":"gd","n":"Gaelic; Scottish Gaelic"},{"l2":"gl","n":"Galician"},{"l2":"gn","n":"Guarani"},{"l2":"gu","n":"Gujarati"},{"l2":"gv","n":"Manx"},{"l2":"ha","n":"Hausa"},{"l2":"he","n":"Hebrew"},{"l2":"hi","n":"Hindi"},{"l2":"ho","n":"Hiri Motu"},{"l2":"hr","n":"Croatian"},{"l2":"ht","n":"Haitian; Haitian Creole"},{"l2":"hu","n":"Hungarian"},{"l2":"hy","n":"Armenian"},{"l2":"hz","n":"Herero"},{"l2":"ia","n":"Interlingua (International Auxiliary Language Association)"},{"l2":"id","n":"Indonesian"},{"l2":"ie","n":"Interlingue; Occidental"},{"l2":"ig","n":"Igbo"},{"l2":"ii","n":"Sichuan Yi; Nuosu"},{"l2":"ik","n":"Inupiaq"},{"l2":"io","n":"Ido"},{"l2":"is","n":"Icelandic"},{"l2":"it","n":"Italian"},{"l2":"iu","n":"Inuktitut"},{"l2":"ja","n":"Japanese"},{"l2":"jv","n":"Javanese"},{"l2":"ka","n":"Georgian"},{"l2":"kg","n":"Kongo"},{"l2":"ki","n":"Kikuyu; Gikuyu"},{"l2":"kj","n":"Kuanyama; Kwanyama"},{"l2":"kk","n":"Kazakh"},{"l2":"kl","n":"Kalaallisut; Greenlandic"},{"l2":"km","n":"Central Khmer"},{"l2":"kn","n":"Kannada"},{"l2":"ko","n":"Korean"},{"l2":"kr","n":"Kanuri"},{"l2":"ks","n":"Kashmiri"},{"l2":"ku","n":"Kurdish"},{"l2":"kv","n":"Komi"},{"l2":"kw","n":"Cornish"},{"l2":"ky","n":"Kirghiz; Kyrgyz"},{"l2":"la","n":"Latin"},{"l2":"lb","n":"Luxembourgish; Letzeburgesch"},{"l2":"lg","n":"Ganda"},{"l2":"li","n":"Limburgan; Limburger; Limburgish"},{"l2":"ln","n":"Lingala"},{"l2":"lo","n":"Lao"},{"l2":"lt","n":"Lithuanian"},{"l2":"lu","n":"Luba-Katanga"},{"l2":"lv","n":"Latvian"},{"l2":"mg","n":"Malagasy"},{"l2":"mh","n":"Marshallese"},{"l2":"mi","n":"Maori"},{"l2":"mk","n":"Macedonian"},{"l2":"ml","n":"Malayalam"},{"l2":"mn","n":"Mongolian"},{"l2":"mr","n":"Marathi"},{"l2":"ms","n":"Malay"},{"l2":"mt","n":"Maltese"},{"l2":"my","n":"Burmese"},{"l2":"na","n":"Nauru"},{"l2":"nb","n":"Bokmål, Norwegian; Norwegian Bokmål"},{"l2":"nd","n":"Ndebele, North; North Ndebele"},{"l2":"ne","n":"Nepali"},{"l2":"ng","n":"Ndonga"},{"l2":"nl","n":"Dutch; Flemish"},{"l2":"nn","n":"Norwegian Nynorsk; Nynorsk, Norwegian"},{"l2":"no","n":"Norwegian"},{"l2":"nr","n":"Ndebele, South; South Ndebele"},{"l2":"nv","n":"Navajo; Navaho"},{"l2":"ny","n":"Chichewa; Chewa; Nyanja"},{"l2":"oc","n":"Occitan (post 1500); Provençal"},{"l2":"oj","n":"Ojibwa"},{"l2":"om","n":"Oromo"},{"l2":"or","n":"Oriya"},{"l2":"os","n":"Ossetian; Ossetic"},{"l2":"pa","n":"Panjabi; Punjabi"},{"l2":"pi","n":"Pali"},{"l2":"pl","n":"Polish"},{"l2":"ps","n":"Pushto; Pashto"},{"l2":"pt","n":"Portuguese"},{"l2":"qu","n":"Quechua"},{"l2":"rm","n":"Romansh"},{"l2":"rn","n":"Rundi"},{"l2":"ro","n":"Romanian; Moldavian; Moldovan"},{"l2":"ru","n":"Russian"},{"l2":"rw","n":"Kinyarwanda"},{"l2":"sa","n":"Sanskrit"},{"l2":"sc","n":"Sardinian"},{"l2":"sd","n":"Sindhi"},{"l2":"se","n":"Northern Sami"},{"l2":"sg","n":"Sango"},{"l2":"si","n":"Sinhala; Sinhalese"},{"l2":"sk","n":"Slovak"},{"l2":"sl","n":"Slovenian"},{"l2":"sm","n":"Samoan"},{"l2":"sn","n":"Shona"},{"l2":"so","n":"Somali"},{"l2":"sq","n":"Albanian"},{"l2":"sr","n":"Serbian"},{"l2":"ss","n":"Swati"},{"l2":"st","n":"Sotho, Southern"},{"l2":"su","n":"Sundanese"},{"l2":"sv","n":"Swedish"},{"l2":"sw","n":"Swahili"},{"l2":"ta","n":"Tamil"},{"l2":"te","n":"Telugu"},{"l2":"tg","n":"Tajik"},{"l2":"th","n":"Thai"},{"l2":"ti","n":"Tigrinya"},{"l2":"tk","n":"Turkmen"},{"l2":"tl","n":"Tagalog"},{"l2":"tn","n":"Tswana"},{"l2":"to","n":"Tonga (Tonga Islands)"},{"l2":"tr","n":"Turkish"},{"l2":"ts","n":"Tsonga"},{"l2":"tt","n":"Tatar"},{"l2":"tw","n":"Twi"},{"l2":"ty","n":"Tahitian"},{"l2":"ug","n":"Uighur; Uyghur"},{"l2":"uk","n":"Ukrainian"},{"l2":"ur","n":"Urdu"},{"l2":"uz","n":"Uzbek"},{"l2":"ve","n":"Venda"},{"l2":"vi","n":"Vietnamese"},{"l2":"vo","n":"Volapük"},{"l2":"wa","n":"Walloon"},{"l2":"wo","n":"Wolof"},{"l2":"xh","n":"Xhosa"},{"l2":"yi","n":"Yiddish"},{"l2":"yo","n":"Yoruba"},{"l2":"za","n":"Zhuang; Chuang"},{"l2":"zh","n":"Chinese"},{"l2":"zu","n":"Zulu"}]; var LANG={ 'aa':{ n:"Afar"}, 'ab':{ n:"Abkhazian"}, 'ae':{ n:"Avestan"}, 'af':{ n:"Afrikaans"}, 'ak':{ n:"Akan"}, 'am':{ n:"Amharic"}, 'an':{ n:"Aragonese"}, 'ar':{ n:"Arabic"}, 'as':{ n:"Assamese"}, 'av':{ n:"Avaric"}, 'ay':{ n:"Aymara"}, 'az':{ n:"Azerbaijani"}, 'ba':{ n:"Bashkir"}, 'be':{ n:"Belarusian"}, 'bg':{ n:"Bulgarian"}, 'bh':{ n:"Bihari languages"}, 'bi':{ n:"Bislama"}, 'bm':{ n:"Bambara"}, 'bn':{ n:"Bengali"}, 'bo':{ n:"Tibetan"}, 'br':{ n:"Breton"}, 'bs':{ n:"Bosnian"}, 'ca':{ n:"Catalan; Valencian"}, 'ce':{ n:"Chechen"}, 'ch':{ n:"Chamorro"}, 'co':{ n:"Corsican"}, 'cr':{ n:"Cree"}, 'cs':{ n:"Czech"}, 'cu':{ n:"Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"}, 'cv':{ n:"Chuvash"}, 'cy':{ n:"Welsh"}, 'da':{ n:"Danish"}, 'de':{ n:"German"}, 'dv':{ n:"Divehi; Dhivehi; Maldivian"}, 'dz':{ n:"Dzongkha"}, 'ee':{ n:"Ewe"}, 'el':{ n:"Greek, Modern (1453-)"}, 'en':{ n:"English"}, 'eo':{ n:"Esperanto"}, 'es':{ n:"Spanish; Castilian"}, 'et':{ n:"Estonian"}, 'eu':{ n:"Basque"}, 'fa':{ n:"Persian"}, 'ff':{ n:"Fulah"}, 'fi':{ n:"Finnish"}, 'fj':{ n:"Fijian"}, 'fo':{ n:"Faroese"}, 'fr':{ n:"French"}, 'fy':{ n:"Western Frisian"}, 'ga':{ n:"Irish"}, 'gd':{ n:"Gaelic; Scottish Gaelic"}, 'gl':{ n:"Galician"}, 'gn':{ n:"Guarani"}, 'gu':{ n:"Gujarati"}, 'gv':{ n:"Manx"}, 'ha':{ n:"Hausa"}, 'he':{ n:"Hebrew"}, 'hi':{ n:"Hindi"}, 'ho':{ n:"Hiri Motu"}, 'hr':{ n:"Croatian"}, 'ht':{ n:"Haitian; Haitian Creole"}, 'hu':{ n:"Hungarian"}, 'hy':{ n:"Armenian"}, 'hz':{ n:"Herero"}, 'ia':{ n:"Interlingua (International Auxiliary Language Association)"}, 'id':{ n:"Indonesian"}, 'ie':{ n:"Interlingue; Occidental"}, 'ig':{ n:"Igbo"}, 'ii':{ n:"Sichuan Yi; Nuosu"}, 'ik':{ n:"Inupiaq"}, 'io':{ n:"Ido"}, 'is':{ n:"Icelandic"}, 'it':{ n:"Italian"}, 'iu':{ n:"Inuktitut"}, 'ja':{ n:"Japanese"}, 'jv':{ n:"Javanese"}, 'ka':{ n:"Georgian"}, 'kg':{ n:"Kongo"}, 'ki':{ n:"Kikuyu; Gikuyu"}, 'kj':{ n:"Kuanyama; Kwanyama"}, 'kk':{ n:"Kazakh"}, 'kl':{ n:"Kalaallisut; Greenlandic"}, 'km':{ n:"Central Khmer"}, 'kn':{ n:"Kannada"}, 'ko':{ n:"Korean"}, 'kr':{ n:"Kanuri"}, 'ks':{ n:"Kashmiri"}, 'ku':{ n:"Kurdish"}, 'kv':{ n:"Komi"}, 'kw':{ n:"Cornish"}, 'ky':{ n:"Kirghiz; Kyrgyz"}, 'la':{ n:"Latin"}, 'lb':{ n:"Luxembourgish; Letzeburgesch"}, 'lg':{ n:"Ganda"}, 'li':{ n:"Limburgan; Limburger; Limburgish"}, 'ln':{ n:"Lingala"}, 'lo':{ n:"Lao"}, 'lt':{ n:"Lithuanian"}, 'lu':{ n:"Luba-Katanga"}, 'lv':{ n:"Latvian"}, 'mg':{ n:"Malagasy"}, 'mh':{ n:"Marshallese"}, 'mi':{ n:"Maori"}, 'mk':{ n:"Macedonian"}, 'ml':{ n:"Malayalam"}, 'mn':{ n:"Mongolian"}, 'mr':{ n:"Marathi"}, 'ms':{ n:"Malay"}, 'mt':{ n:"Maltese"}, 'my':{ n:"Burmese"}, 'na':{ n:"Nauru"}, 'nb':{ n:"Bokmål, Norwegian; Norwegian Bokmål"}, 'nd':{ n:"Ndebele, North; North Ndebele"}, 'ne':{ n:"Nepali"}, 'ng':{ n:"Ndonga"}, 'nl':{ n:"Dutch; Flemish"}, 'nn':{ n:"Norwegian Nynorsk; Nynorsk, Norwegian"}, 'no':{ n:"Norwegian"}, 'nr':{ n:"Ndebele, South; South Ndebele"}, 'nv':{ n:"Navajo; Navaho"}, 'ny':{ n:"Chichewa; Chewa; Nyanja"}, 'oc':{ n:"Occitan (post 1500); Provençal"}, 'oj':{ n:"Ojibwa"}, 'om':{ n:"Oromo"}, 'or':{ n:"Oriya"}, 'os':{ n:"Ossetian; Ossetic"}, 'pa':{ n:"Panjabi; Punjabi"}, 'pi':{ n:"Pali"}, 'pl':{ n:"Polish"}, 'ps':{ n:"Pushto; Pashto"}, 'pt':{ n:"Portuguese"}, 'qu':{ n:"Quechua"}, 'rm':{ n:"Romansh"}, 'rn':{ n:"Rundi"}, 'ro':{ n:"Romanian; Moldavian; Moldovan"}, 'ru':{ n:"Russian"}, 'rw':{ n:"Kinyarwanda"}, 'sa':{ n:"Sanskrit"}, 'sc':{ n:"Sardinian"}, 'sd':{ n:"Sindhi"}, 'se':{ n:"Northern Sami"}, 'sg':{ n:"Sango"}, 'si':{ n:"Sinhala; Sinhalese"}, 'sk':{ n:"Slovak"}, 'sl':{ n:"Slovenian"}, 'sm':{ n:"Samoan"}, 'sn':{ n:"Shona"}, 'so':{ n:"Somali"}, 'sq':{ n:"Albanian"}, 'sr':{ n:"Serbian"}, 'ss':{ n:"Swati"}, 'st':{ n:"Sotho, Southern"}, 'su':{ n:"Sundanese"}, 'sv':{ n:"Swedish"}, 'sw':{ n:"Swahili"}, 'ta':{ n:"Tamil"}, 'te':{ n:"Telugu"}, 'tg':{ n:"Tajik"}, 'th':{ n:"Thai"}, 'ti':{ n:"Tigrinya"}, 'tk':{ n:"Turkmen"}, 'tl':{ n:"Tagalog"}, 'tn':{ n:"Tswana"}, 'to':{ n:"Tonga (Tonga Islands)"}, 'tr':{ n:"Turkish"}, 'ts':{ n:"Tsonga"}, 'tt':{ n:"Tatar"}, 'tw':{ n:"Twi"}, 'ty':{ n:"Tahitian"}, 'ug':{ n:"Uighur; Uyghur"}, 'uk':{ n:"Ukrainian"}, 'ur':{ n:"Urdu"}, 'uz':{ n:"Uzbek"}, 've':{ n:"Venda"}, 'vi':{ n:"Vietnamese"}, 'vo':{ n:"Volapük"}, 'wa':{ n:"Walloon"}, 'wo':{ n:"Wolof"}, 'xh':{ n:"Xhosa"}, 'yi':{ n:"Yiddish"}, 'yo':{ n:"Yoruba"}, 'za':{ n:"Zhuang; Chuang"}, 'zh':{ n:"Chinese"}, 'zu':{ n:"Zulu"}}; function lang2(div, select){ select=','+select+','; for(var ln2 in LANG){ var e=document.createElement('div'); e.innerHTML=ln2; e.title=LANG[ln2].n; e.className='lang2'; e.tabindex='-1'; e.setAttribute('data-m',ln2); e.setAttribute('w:on:onclick','lSet'); if(select.indexOf(','+ln2+',')!=-1) e.setAttribute('data-s','1'); div.appendChild(e); } } function _____IMG_____(){} /*function preview(src,data,fn,maxWidth,maxHeight,force){ var r=(maxWidth&&maxHeight) ? maxWidth/maxHeight :0; var image = new Image(); //image.crossOrigin = 'anonymous'; image.onload = function(){ var w=ww=image.naturalWidth || image.width, h=hh=image.naturalHeight||image.height; if(r && w/h>=r || maxWidth){ if(w>maxWidth){ h=(w=maxWidth)/ww*h; ; } }else if(maxHeight){ if(h>maxHeight){ w=(h=maxHeight)/hh*ww; } } if(w!=ww || force){ var canvas = document.querySelector("#canvas"); canvas.width=w; canvas.height=h; var g = canvas.getContext("2d"); g.drawImage(image,0,0,w,h); fn(canvas,data,canvas.toDataURL()); }else{ fn(null,data,null); } } image.src=src; }*/ function _____EDIT_____(){} //var URL_REGEX=/[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/i; var URL_REGEX=/http[s]?[:]\/\/[^\s"'<>]+/; var TEXT_URL_REGEX=/(^|[^'"])(http[s]?[:]\/\/[^\s"'<>]+)/; function getFirstURL(s){ var idx=s.indexOf(")+/,"").replace(/(\s|\u200b|Èb| |​|
)+$/,"") :''; } function nIsEmpty(el){ var nC=w$sub(".nDiv>.nBody>.nContentDiv",w$find(el,'N')); return !removeWS(w$query('.nText',nC).innerHTML) && !removeWS(w$query('.nTitle',nC).innerHTML) && !w$query('.nImage',nC).getAttribute('src') } var BASE_TAGS=['LI','UL','OL','SPAN','B','STRONG','I','U','STRIKE','BR','TT','CODE','PRE','P','A','IMG']; function htmlText(E,l){ for(var ei=0; ei=0; ){ var n=e.attributes[ai].name.toLowerCase(); if(!(n=='style'||n=='src'||n=='width'||n=='height'||n=='href'||n=='title')){ e.removeAttribute(e.attributes[ai].name); } } htmlText(e,1); e.normalize(); var n=e.nodeName; if(!BASE_TAGS.includes(n)){ while(e.firstChild && e.firstChild.nodeType==3){ if(!e.firstChild.textContent.trim()) e.removeChild(e.firstChild); else if(e.firstChild.textContent){ e.firstChild.textContent=e.firstChild.textContent.replace(/\s\s+/,' '); break; } } while(e.lastChild && e.lastChild.nodeType==3){ if(!e.lastChild.textContent.trim()) e.removeChild(e.lastChild); else if(e.lastChild.textContent){ e.lastChild.textContent=e.lastChild.textContent.replace(/\s\s+/g,' '); break; } } if(e.childNodes.length==0){ E.removeChild(e); --ei; }else if(e.childNodes.length==1){ var x=e,y; E.replaceChild(e.childNodes[0], e); }else if(n!='SPAN' && n!='P' && n!='LI'){ n = document.createElement((l==0 && (n=='DIV'||n=='LI'||n=='UL'||n=='OL'||n=='DL')) ? 'P' : 'SPAN'); for(a of e.attributes){ n.setAttribute(a.name, a.value); } while(e.firstChild){ n.appendChild(e.firstChild); } E.replaceChild(n, e); } } }else if(e.nodeType==3 || e.nodeType==4){ if((e.textContent||'').trim().length==0){ E.removeChild(e); --ei; }else if('A'!=E.nodeName){ var s=(e.textContent||''), u; if((u=TEXT_URL_REGEX.exec(s))){ var idx=s.indexOf(u[2]); var a=document.createElement("a"); a.setAttribute("href", u[2]); a.textContent=u[2]; e.textContent=s.substring(0,idx); E.insertBefore(a,e.nextSibling); if(s.length>idx+u[2].length){ var t=document.createTextNode(s.substring(idx+u[2].length)); E.insertBefore(t,a.nextSibling); } } } } } } function HEditStart(el){ W.Y=el; w$setData(el,{ o:'1', e:'1', edit:'1', changed:'', yurl:(this.url||''), vv:el.dataset.v }) w$setAttribute(w$queryAll(" #HHead div.HName,#HHead div.HTitle,#HDetDiv div.BText"),{ contenteditable:'true'}) console.log(w$queryAll(" #HHead div.HName,#HHead div.HTitle,#HDetDiv div.BText")); setTimeout(function(){ w$query(" #HHead div.HTitle").focus(); w$query(" #HDetDiv div.BText").focus(); }, 0); } function HEditStop(force,reset){ var n=W.Y; if(!n) return true; if(!force && n.dataset.changed && !nIsEmpty(n)){ if(!confirm('Forigi lastajn ŝanĝojn?')){ return false; } } location.reload(); } function nEditStart(el,$this){ W.Y=el; $this.__o='1'; $this.__e='1'; w$refresh('now'); w$setData(el,{ e:'1', changed:'', yurl:(this.url||''), vv:el.dataset.v }) //w$setAttribute(w$queryAll(".nTitle,.nText,.xImageTitle,.xImageDescr",nC),{contenteditable:'true'}) setTimeout(function(){ w$query(".nText",w$sub(".nDiv>.nBody>.nContentDiv",el)).focus(); }, 50); } function nEditStop(force,reset){ var el=W.Y; if(!el) return true; if(!force && el.dataset.changed && !nIsEmpty(el)){ if(!confirm('Forigi lastajn ŝanĝojn?')){ return false; } } $this=el.$w.$; if(!$this.id) $this.__o='0'; $this.__e='0'; if(reset){ weave$apply(el.parentElement,el,null,null,$this,null); }else{ w$refresh('now'); } el.dataset.e='0'; W.Y=null; //??? el.style.width='100%'; // el.dataset.e='0'; //w$setAttribute(w$queryAll(".nTitle,.nText,.xImageTitle,.xImageDescr",nC),{ contenteditable:'false'}) //if(!removeWS($(".nTitle",$C).html())) $(".nTitle",$C).css({'min-height':'0','height':null,'margin-bottom':null}); //if(!$(".nImage",$C).attr('src')) $(".nImageDiv",$C).hide(); //$("._nY",$C).hide(); //$(".nLowerDiv",$D).hide(); return true; } var dragWalk=null; function getDropW(a){ for(var i=0; i=this.quota ? 1 : this.used/this.quota; el.style.backgroundColor=!this.quota?'#ccc':(this.used>=this.quota?'#C40320':'rgb(12*16,'+~~(pc*255)+',0)'); return (pc*100)+'%'; }, toURL: function(el,v,p){ return encodeURIComponent(this.uname)+"~"+this.uid; }, toUsage: function(el,v,p){ return toSize(this.quota-this.used)+' / '+(this.quota?toSize(this.quota):'□'); }, uLogin: function(el,ev,op){ if(!op.lp){ w$query('#_login_error').innerHTML='Mankas pasvorto!'; return; } w$w(op, function(data){ if(!data['@err']){ location.reload(); }else{ w$query('#_login_error').textContent='Malĝusta poŝtadreso aŭ pasvorto!'; } }); }, uTyping: function(el,ev){ if(ev.target.id=='login_email' || ev.target.id=='login_password'){ w$query('#login_login').disabled=!w$query('#login_email').value||!w$query('#login_password').value; w$query('#_login_error').textContent=''; console.log(w$query('#login_login').disabled,!w$query('#login_email').value,!w$query('#login_password').value); } }, onkeyup: function(el,ev){ this.uTyping(el,ev); return null; }, onchange: function(el,ev){ this.uTyping(el,ev); return null; }, uLogout: function(el,ev,op){ w$w({'!uLogout':''}, function(data){ location.reload(); }); }, uLang: function(el,ev){ var $el=el, $this=this; w$menu(ev.target,"#menu>*[name='mLang']",function(el,m){ w$sub('.mLangTitle',m).textContent='Mi komprenas:' lang2(w$sub('.mLangs',m),$this.ulangs) if(!this.ulangs) w$sub('div>span._nA',m).dataset.select=1; }) }, langSet: function(el,ev,op){ w$w({'!uSetData':'', 'ulangs':op.lang},function(){ location.reload(); }); }, uSet: function(el,ev,op){ location.href=w$setParameters({u:null}) }, uImg: function(el,ev,op){ var $this=this; uploadResizedImage(256,256, function(dataUri){ $this.uimg=dataUri; //w$query("#U .UImg").setAttribute("src",dataUri); w$w({'!uImg':'', id:$this.uid, type:'image/png', url:dataUri }); }); }, }; w$type.S={ s: function(el,ev, op){ LOG&&console.log(location.pathname,op); if(op['~']) location.href="?s="+encodeURIComponent(op.s); else location=w$setParameters({s:op.s}); }, }; w$type.T={ toNm: function(el,v,p){ if(!v) return ""; var idx; while((idx=v.indexOf("_"))!=-1){ if(idx==v.length-1){ v=v.substring(0,idx); break; } v=v.substring(0,idx)+v.charAt(idx+1).toUpperCase()+v.substring(idx+2); } return v; }, toHRef: function(el,v,p){ // console.log(location.pathname); return w$setParameters({s:v}); //return location.search+"?s="+encodeURIComponent(v); }, cl: function(el,ev){ var e=ev.target; location=e.getAttribute('href'); }, }; w$type.A={ onclick: function(el,ev){ location.replace(el.getAttribute('href')); }, }; w$type.Cl={ onclick: function(el,ev){ var e; if(el.dataset.id=='' && el.dataset.e=='1') return; if(el.dataset.id=='' && el.dataset.e=='0'){ console.log(this); this.nEdit(el,ev); return; } console.log(ev.target); if((e=ev.target) instanceof Element){ if(e.tagName=='A' || (e=e.parentElement).tagName=='A'){ return; } } return null; }, /*onclicked: function(el,ev){ var e; // console.log(ev.target); if(el.dataset.id=='' && el.dataset.e=='0'){ console.log(this); this.nEdit(el,ev); return; } },*/ }; w$type.F={ toInd: function(self,v,p){ return ((this.lvl-1)*10)+"px"; }, ondragstart: function(el,ev){ ev.dataTransfer.setData("text/uri-list", document.getElementsByTagName('base')[0].href+"~"+this.root+"/"+this.name+"~"+this.id); ev.dataTransfer.setData("text/~"+this.root, JSON.stringify({id:this.id, path:this.path})); //ev.dataTransfer.effectAllowed='move'; }, ondragenter: function(el,ev){ el.style.fontWeight=900; ev.preventDefault(); console.log(ev.dataTransfer, -1!=ev.dataTransfer.types.indexOf('text/uri-list')); for(var i=0; i.N>.ny>.N",w$query("#mainC")); for(var i=0; i=90; }, get _change(){ return this.r>=80; }, get _delete(){ return this.r>=70; }, get _add(){ return this.r>=60; }, get _com(){ return this.r>=50; }, get _vote(){ return this.r<90 && this.r>=40; }, get _hasMore(){ //console.log(this.n$ && this.x_ch>this.n$.length); return this.n$ && this.x_ch>this.n$.length; }, get _more(){ return this.x_ch-(this.n$ ? this.n$.length :0); }, get _hasMoreC(){ //return 1; return this.n$ && this.x_ch>this.n$.length; }, get _moreC(){ //return 1; return this.x_ch-(this.n$ ? this.n$.length :0); }, get _hasX(){ // LOG&&console.log(this.x,this.x ||this.x==''); return this.x ||this.x==''; }, get _tl(){ return WCALENDAR.toLocal(this); }, get rname(){ var idx=this.npath?this.npath.indexOf('/',1):-1; return idx!=-1 ? this.npath.substring(1,idx) : ""; }, get isRoot(){ return this.id==this.root; }, toN: function(self,v,p){ //if(this.kind=='c') return 'c'; return !v && (this.$o_m || this.$o_m!=0 && this.rate=='0') ? 'm' : 'n'; }, isM: function(self,v,p){ return this.$o_m || this.toN(self,v)=='m'; }, isN: function(self,v,p){ return (this.$o_m=='0') || this.toN(self,v)=='n'; }, //isC: function(self,v,p){ return this.toN(self,v)=='c'; }, isY: function(self,v,p){ return v && !this.__vm && this._add; }, /*toMain: function(self,v,p){ return this.id; },*/ canW:function(el,nm){ if(el.tagName=='DIV' && el.contentEditable=='true'){ if(this.__e=='1' && el.textContent) return false; } return true; }, toURL: function(el,v){ return (this.isRoot ? '' : toURI(this.rname)+"~"+this.root+'/')+toURI(this.name)+"~"+this.id; }, toTime: function(self,w,p){ var v=this._tl; if(!v){ if(!this.id) return 'now'; else return '🕑'; } v=v.replace('-','\u00B7').replace('-','\u00B7'); return v.substring(0,WCALENDAR.CODELENGTH[this.tm]||0) /* console.log(this,v,p); if(this.tm=='d') v=v.substring(0,10) else v=v.substring(0,16); v=v.replace('-','\u00B7').replace('-','\u00B7') return v; */ }, toMode: function(self,v,p){ return { '5':'🌐', '2':'🖈🔗', '1':'®', '0':'🔒' }[String(v)] || '🌐'; }, toVote: function(self,v,p){ return vote(this) }, toLang: function(self,v,p){ return v||'*'; }, toLangTitle: function(self,v,p){ return "Por parolantoj de\n " + (v && LANG[v] && LANG[v].n || 'Ĉiujn lingvojn'); }, toText: function(self,v,p){ if(!v || !v.trim()) v=null; else if(v.charCodeAt(0)==1) v=v.substring(1)+"  [ ... ] "; return v; }, toImgURL: function(self,v,p){ if(this.$img) return this.$img; if(!v && !this.x) return null; if(v && v.indexOf('.')!=0) return v; return '~'+this.root+'~'+this.id+'.~..'+(this.img_x||''); }, toRotate: function(el,v,p){ if(!v || v=='1') return null; return ORIENT_TRANSFORMS[v]; }, toMap: function(el,v){ if(this.l_la){ //console.log(this.l_la,this.l_lo); if(W.M && W.M.add) W.M.add(this,this.__o=='1') } return v; }, toY: function(el,v){ var $=document.body.$w.$; // console.log(this,v); var tz=Intl.DateTimeFormat().resolvedOptions().timeZone; var n={ __o:'', r:90/*_edit*/, id:'', parent:v.id, root:v.root, head:v.head, kind:'n', m:v.m, lang:v.lang, auth:$.U.uid, aimg_x:$.U.uimg_x, aname:$.U.uname, rate:5, n_vote:1, tm:'s', t:null, tz:Intl.DateTimeFormat().resolvedOptions().timeZone, img:null, $img:null, img_o:null, text:'', }; //Object.setPrototypeOf(n,w$type.N); return n; }, toAHref: function(el,n,p){ if(n.kind=='f') return this.toURL(); //s if(n.url) return n.url; //b if(n.x || n.x==''){ return '~'+n.id+"~"+(n.x || '.'); //b } if(n.img){ if(!n.img.startsWith('.')) return n.img; //b return toURI(n.rname)+"~"+n.id+"~.."; //b } return n.toURL(); //s }, toATitle: function(self,n,p){ var x=n.url && n.kind!='f'; return x ? n.url : ((n.title||'') + " ~"+n.id); }, toATarget: function(self,n,p){ var blank= (n.kind!='f') && (n.url||(n.x||n.x=='')||n.img) return blank ? "_blank" : "_self"; }, toAuth: function(self,n,p){ return encodeURIComponent(this.aname)+'~'+this.auth; }, toRMW:function(self,n,p){ return $parent(self).o_mmw||120; }, toRMH:function(self,n,p){ return $parent(self).o_mmh||100; }, toRMI: function(self,n,p){ var p=$parent(self); if(!p.o_mm && this.o_mi) return this.o_mi; return p.o_mmi||50; }, toLocTitle:function(el,v){ return this.l_la ? this.l_la+","+this.l_lo : null; }, elTitle:function(el){ el=w$find(el,'N'); el=w$sub(".nDiv>.nBody>.nContentDiv>.nTitle",el); return el; }, nImgSplit: function(el,ev){ var $this=this; split(ev,ev.target,{side:'parent-left',leftMin:40, resized:function(el,ops){ //console.log(el.parentElement.offsetWidth/el.parentElement.parentElement.offsetWidth); var pc=Math.round(100*el.parentElement.offsetWidth/el.parentElement.parentElement.offsetWidth); if(pc>95) pc=100; $this.nSetData(w$find(el,'N'),ev,{o_ir:pc}) }}); }, mImgSplit: function(el,ev){ var $this=this; split(ev,ev.target,{side:'left',leftMin:40, resized:function(el,ops){ //console.log(el.parentElement.offsetWidth/el.parentElement.parentElement.offsetWidth); //$this.nSetData(w$find(el,'N'),ev,{o_ir:Math.min(100,100*el.parentElement.offsetWidth/el.parentElement.parentElement.offsetWidth)}) }}); }, niX: function(el,ev){ //var nC=w$sub(".nDiv>.nBody>.nContentDiv",el); /// n Image X //w$query('.nImageTitle',nC).textContent=null; //w$query('.nImageDescr',nC).textContent=null; //w$query('.nImageDiv',nC).removeAttribute('data-src'); //w$query('.nImage',nC).setAttribute('src',''); //el.$w.$.img=el.$w.$.imageURL=''; this.img=this.img_x=this.$img=null; }, nText: function(el,ev){ w$w({'!nText':'',id:this.id,root:this.root,path:this.path,parent:this.parent},el); }, /*onclick: function(el,ev){ if(el.dataset.e=='1') return null; },*/ onclick: function(el,ev){ var e; LOG&&console.log(ev.target,this); if(el.dataset.e=='1') return null; if(el.dataset.id=='' && el.dataset.e=='0'){ //,console.log(this); this.nEdit(el,ev); return; } if((e=ev.target) instanceof Element){ if(e.tagName=='A' || (e=e.parentElement).tagName=='A'){ if(ev.button!=0) return null; if(el.dataset.e!='1'){ w$w({'!ui':'', id:this.id, root:this.root, path:this.path, head:this.head, o:'a' }) window.open(e.href) } } } }, nGoTo: function(el,ev){ if(el.dataset.e==1 || !el.dataset.id) return false; //!! Navigate to w$w({'!ui':'', id:this.id, root:this.root, path:this.path, head:this.head, o:'w'}) location.href=this.toURL(el,ev); }, nGoToURL: function(el,ev){ var e=ev.target,s,t; if(el.dataset.e==1 || !el.dataset.id) return false; if(!!(s=e.getAttribute('href')) || !!(s=(e=e.parentElement).getAttribute('href'))){ console.log(e.getAttribute('target')) window.open(s, (t=e.getAttribute('target'))?t:'_self'); } }, nOpenClose: function(el,ev){ var n=el; //!! Note Open/Close console.log(w$events.clickCount,ev,el,this); if(this.id==''){ //return; } if(1==w$events.clickCount){ var v=(n.dataset.o!='1'); if(el.dataset.e=='1'){ nEditStop(false,true); }else{ w$w({'!ui':'', id:this.id, root:this.root, path:this.path, head:this.head, o: v ? 'n' : 'm' }) if(!v){ n.dataset.o='0'; if(this.l_la!=null){ W.M.to(this,false); } }else{ n.dataset.o='1'; //n.dataset.v='n'; W.M.to(this,true); /*if(this.l_la!=null){ w$query('##MLoc').value=this.l_la+','+this.l_lo w$query('##MUse').checked=true; W.M.to(this,true); }else{ w$query('##MUse').checked=false; }*/ if(n.dataset.opened!='1'){ n.dataset.opened='1'; $nGet(el,this); /*w$w({'!nGet':n.dataset.id,root:this.root,path:this.path,o:this.o,x_ch:this.x_ch,x_com:this.x_com}, function(d){ w$weave(el,"",d) })*/ }else{ el.scrollIntoView({block:'nearest'}); } } el.$w.$.__o=n.dataset.o; } }else if(2==w$events.clickCount){ this.nGoTo(el,ev); } }, mnZ: function(el,ev){ var $el=el, $this=this; w$menu(ev.target,"#menu>ul[name='mnZ']",function(el,m){ if(!$this._edit){ w$queryAll("*[data-edit='1']",m,function(e){ e.style.display='none'; }) } }) }, mnMode: function(el,ev){ var $el=el, $this=this; if(!this._change) return; w$menu(ev.target,"#menu>ul[name='mnMode']",function(el,m){ w$queryAll("*[data-menu='"+$this.m+"']",m,function(e){ e.setAttribute('data-wmenu-select',1); }) }) }, mnRate: function(el,ev){ var $el=el, $this=this; if(!this._change) return; w$menu(ev.target,"#menu>ul[name='mnRate']",function(el,m){ // console.log($this.$w$.rate) w$queryAll("*[data-menu='"+$this.rate+"']",m,function(e){ e.setAttribute('data-wmenu-select',1); }) }) }, mnLang: function(el,ev){ var $el=el, $this=this; if(!this._change) return; w$menu(ev.target,"#menu>*[name='mLang']",function(el,m){ m.dataset.one=1; //w$sub('.mLangTitle',m).textContent='Lingvo de la Noto:' lang2(w$sub('.mLangs',m),$this.lang); if(!$this.lang) w$sub('div>span._nA',m).dataset.select=1; }) }, langSet:function(el,ev,op){ this.nSetData(el,ev,{lang:op.lang}); }, mnTime: function(el,ev){ var $el=el, $this=this; if(!this._change) return; w$menu(ev.target," #menu>.wmenu[name='mnTime']",function(el,M,left,left2,top,top2){ var X={t:$this.t,tm:$this.tm,tz:$this.tz,tzo:$this.tzo}; X.t=WCALENDAR.toLocal(X); WCALENDAR.div(w$query('=cal',M), X, function(el,ev,op){ if(op===undefined) return; w$wmenuOff(); if(op){ LOG&&console.log(op); $this.nSetData($el,ev,{ t:op.t, tm:op.tm, tz:op.tz, tzo:op.tzo }); w$refresh('now'); } }); M.style.position='absolute'; M.style.display='inline-block'; M.style.left=(left+=window.pageXOffset)+'px'; M.style.top=(top+=window.pageYOffset)+'px'; document.body.appendChild(M); var R=document.body.getBoundingClientRect(), r=M.getBoundingClientRect(), d; if((d=r.right-R.right)>0){ M.style.left=Math.max(0,left-d)+'px'; } if((d=(r.top+500-R.bottom))>0){ M.style.top=Math.max(0,top-d)+'px'; } return null; }) }, nSetData: function(el,ev,op){ if(!this._edit) return; var $this=this, rate=this.rate; Object.assign(this,op); if(el.dataset.e!='1' && this.id){ op['@id']=this.id; w$w({'!nSetData':'', n:op },function(data){ if(!el.classList.contains('H') && op.rate && (op.rate=='0' || rate=='0' && op.rate!='0')){ $this.rate=op.rate; var e=$parentEl(el); $nGet(e,e.$w.$) //w$w({'!nGet': $this.parent}, w$find(w$find(el,'N').parentElement,'N') ); } }); } }, nMore: function(el,ev){ var $this=this; $nGet(el,$this,'n'); /*w$w({'!nGet': this.id, o:this.o, o:this.o,x_ch:this.x_ch,x_com:this.x_com, '@from':this._xn_to}, function(r){ for(var i in r.n$) $this.n$.push(r.n$[i]); //$this.n$.push(r.n$); $this._xn_to=r._xn_to; w$refresh('now'); console.log(r); }); */ }, nEdit: function(el,ev){ var $this=this; if(!this._edit) return; if(W.Y==el || !nEditStop(false,true)) return; if(this.text && this.text.charAt(0)=='\1'){ w$w({'!nText':'',id:this.id,root:this.root,path:this.path,parent:this.parent},function(data){ w$weave(el,'',data); nEditStart(el,$this); }); }else{ //console.log("1:", el, el.parentElement); nEditStart(el,$this); } }, neStop: function(el,ev){ nEditStop(true,true); Object.assign(this,this.toY(el,$parent(el))); this.__o=0; el.dataset.e=0; }, $Y: function(elTitle,elText){ var n={ '@id':this.id, '@parent':this.parent, '@root':this.root }; w$assignFields(n,this,['head','kind','lang','rate','t','m','tm','tz','tzo','l_la','l_lo','l_a','l_d']); if(!this.t && this.tm){ var now=new Date(); n.tzo=-now.getTimezoneOffset(); n.t=now.toISOString().replace('T',' ').replace('Z',''); } var title=removeWS(elTitle.textContent), text=removeWS(elText.innerHTML); if(title!=this.title || text!=this.text){ n.title=title; n.text=text; } if((s=this.$url)!=this.url) n.url=s; return n; }, nY: function(el,ev){ var $this=this, nC=w$sub(".nDiv>.nBody>.nContentDiv",el),s; var y={ '!nSet':'', n:this.$Y(this.elTitle(el),w$query(".nText",nC)) } if((s=removeWS(w$query(".nImageTitle",nC).textContent))!=this.img_t) y.n.img_t=s; if((s=removeWS(w$query(".nImageDescr",nC).innerHTML))!=this.img_d) y.n.img_d=s; if(typeof this.$img!='undefined'){ y.n.img=this.$img; y.n.img_o=this.img_o; y.n.o_ir=toPercent(w$query('.nImageCol',nC).getBoundingClientRect().width/nC.getBoundingClientRect().width); } LOG&&console.log(y); var p=$parentEl(el); if(!y.n.id) ++p.$w.$.x_ch w$w(y,function(data){ el.dataset.changed=''; nEditStop(true,true) $nGet(p); //w$w({'!nGet':$this.parent},w$find(w$find(el,'N'),'N',true)); }); }, nVote: function(el,ev,force){ var e=ev.target, v, $this=this; if(e.tagName=='STRIKE') e=e.parentElement; console.log(e); if(e.dataset && (v=e.dataset.v) && v.length==2){ if(!force && (v=="0i" || v=="Mi")){ w$menu(ev.target," #menu>.wmenu[name='mnInapp']",null,function(){ $this.nVote(el,ev,true); }) }else{ this.s_vote=v.substring(1); //w$weave(el,'', { s_vote:v.substring(1) } ); w$w({'!nVote':'','id':el.dataset.id, '@vote':v.substring(0,1), vote:v.substring(1) }, el); } } }, nRemove: function(el,ev){ var $this=this; if(!this._delete) return; // console.log(this); w$w({'!nRemove':'',id:el.dataset.id,parent:this.parent}, function(data){ $nGet($parentEl(el)); }); }, nOrder: function(el,ev,menu){ if(!this._change) return; this.nSetData(el,ev,{o:menu.value}); }, nImg: function(el,ev,op){ var $el=el,$this=this; if(!this._edit) return; uploadImage(function(readerEvent,files){ var dataUri=readerEvent.target.result, X, $change={}; if(!op.i){ if((X=exifFromDataURI(dataUri))){ var t=X.DateTimeOriginal || X.DateTime, x; if(!!(x=X.Orientation)) $change.img_o=x; if(t){ t=t.substring(0,4)+'-'+t.substring(5,7)+'-'+t.substring(8); if(!!(x=X.SubsecTimeOriginal || X.SubsecTimeOriginal)){ t+='.'+(x.length>3?x.substring(0,3):x); } if(!$this.t||!$this.tm) $change.t=t; } if(!$this.l_la && X.GPSLatitude){ if(!!(x=X.GPSAltitude)){ $change.l_a=(X.GPSAltitudeRef!=1? ~~x : -~~x); } if(!!(x=X.GPSImgDirection)){ $change.l_d=x; } var la=toDecLatLong(X.GPSLatitude,'N',X.GPSLatitudeRef), lo=toDecLatLong(X.GPSLongitude,'E',X.GPSLongitudeRef); $change.l_la=la; $change.l_lo=lo; $change.tz=tzlookup(la,lo); } } $change.$img=dataUri; }else{ if((X=exifFromDataURI(dataUri))){ var t=X.DateTimeOriginal || X.DateTime, x; if(!!(x=X.Orientation)) $change.iimg_o=x; } $change.$iimg=dataUri; } $this.nSetData(el,ev,$change); w$refresh('now'); }); }, nImgO: function(el,ev,op){ var idx=ORIENTS.indexOf(this.img_o,op.o==-1?1:0); if(idx!=-1){ this.nSetData(el,ev,{img_o:ORIENTS[idx+Number(op.o)]}); w$refresh(); } console.log(op,idx); }, nImgUnset: function(el,ev,op){ var $el=el,$this=this; //var imgDiv=w$query("div.nImageDiv",w$sub("div.nDiv>div.nBody>div.nContentDiv",$el)); imgDiv.dataset.src=''; //w$query("img",imgDiv).src=''; //w$query("img",w$sub("div.pDiv",$el)).src=''; if(!op.i){ this.img=this.img_x=this.$img=null; this.img_o=1; w$w({'!nSetData':'', n:{ '@id':this.id, img:'', img_x:'', img_o:1} }); }else{ w$w({'!nSetData':'', n:{ '@id':this.id, iimg:'', iimg_x:'', iimg_o:1} }); } }, nAttach: function(el,ev){ var $this=this; uploadFiles(function(files){ var file=files[0], reader=new FileReader(), idx, chg={}; chg.x=(idx=file.name.lastIndexOf('.'))==-1 ? '': file.name.substring(idx); if(!$this.title) chg.title=file.name; reader.onload = function(readerEvent){ chg.$file=readerEvent.target.result; $this.nSetData(el,ev,chg) }; reader.readAsDataURL(file); }) }, nAttachRem: function(el,ev){ var $this=this; $this.nSetData(el,ev,{$file:'', x:null }); }, ncOpenClose: function(el,ev){ //this.nOpenClose(el,ev); //console.log("ncOpenClose"); }, toYC:function(el,v){ var $=document.body.$w.$; // console.log(this,v); var tz=Intl.DateTimeFormat().resolvedOptions().timeZone; var n={ __o:'', r:90/*_edit*/, id:'', parent:v.id, root:v.root, head:v.head, kind:'c', m:v.m, lang:v.lang, auth:$.U.uid, aimg_x:$.U.uimg_x, aname:$.U.uname, rate:5, n_vote:1, t:null, tm:'s', tz:Intl.DateTimeFormat().resolvedOptions().timeZone, img:null, $img:null, img_o:null, text:'', }; //Object.setPrototypeOf(n,w$type.N); return n; }, ncy: function(el,ev){ //this.c$.push(this.toYC(el,this)); //el=w$find(ev.target,'cs'); el.$w.$$=undefined; //weave$apply(el,el,null,null,this.c$,el.$w); //weave$apply(null,e,null,null,this,this); var $this=this.toYC(el,this); $this.__o='1'; $this.__e='1'; var e=w$use('n',$this,w$sub('.xDiv>.xBody>.cs',el)); nEditStart(e,$this); }, nDrag: function(el,ev){ var d=el.dataset; LOG&&console.log(el,this); ev.dataTransfer.setData("text/uri-list", document.getElementsByTagName('base')[0].href+this.rname+"~"+this.root+"/"+this.name+"~"+this.id); ev.dataTransfer.setData("text/~"+this.root, JSON.stringify({id:this.id, path:this.path})); //ev.dataTransfer.effectAllowed='move'; }, ondragenter: function(el,ev){ // for(var i=0; i",s,n.dataset.yurl); $this.$url=(s||''); if(s){ console.log("->",s); w$w({'!v':'', url:s},function(data){ console.log("->",JSON.stringify(data)); if(data.image){ // TODO w$query('.nImage',nC).setAttribute('title',s) // TODO if(data.title){ $this.$img_t=data.title; //w$query('.nImageTitle',nC).textContent=data.title //var nTitle=w$query('.nTitle',nC); var e=$this.elTitle(n); if(!removeWS(e.textContent)){ /*nTitle.style.width='auto';*/ e.textContent=data.title; } } } if(data.image && !$this.$img){ $this.$img=$this.$imgURL=data.image; $this.$img_d=(data.description||''); //n.$w.$.img=data.image; //w$query('.nImage',nC).src=data.image; //w$query('.nImageDiv',nC).dataset.src='1'; //w$query('.nImageDescr',nC).innerHTML=data.description || ''; } if(!$this.t || !$this.tm){ if(data.tm) $this.tm=data.tm; if(data.tz) $this.tz=data.tz; if(data.t) $this.t=data.t; } w$refresh('now'); /*preview(data.image,null,function(canvas,d,url){ if(canvas){ n.$w.$.imageURL=url; } },0,0,true); */ }); } } }else{ // }else{ $("._nY",$D).hide(); } } }, } function _____Type__H_____(){} w$type.H={ toImgURL: function(self,v,p){ if(this.$img) return this.$img; if(v && v.indexOf('.')!=0) return v; return '~'+this.root+'~'+this.id+'.~..'+(this.img_x||''); }, toIImgURL: function(self,v,p){ if(this.$iimg) return this.$iimg; return '~'+this.root+'~'+this.id+'.~...'+(this.iimg_x||''); }, toViewMode: function(self,v,p){ if(v=='b'||v=='s'||v=='n'||v=='m'||v=='-') return '!.resource/__'+v+'.png'; return null; }, hOpenClose: function(el,ev){ if(el.dataset.e=='1') return; //!! NoteBook Open/Close el.setAttribute('data-o', el.getAttribute('data-o')=='1' ? '0' :'1'); }, hBrowseOrList: function(el,ev){ var n=el, d=n.dataset; if(el.dataset.e=='1') return; location.replace((this.root!=this.id ? "~"+this.root+"/":"")+this.name+"~"+this.id+"?o="+(d.vm=='b'?'':'b')); }, hmZ: function(el,ev){ w$menu(ev.target,"#menu>ul[name='mBZ']",function(m){ w$queryAll("*[data-e='1']",m,function(e){ e.style.display='none'; }) }) }, hOrder: function(el,ev,menu,m){ LOG&&console.log(this,location.pathname+'?o='+menu.value) location.replace((this.root!=this.id ? "~"+this.root+"/":"")+this.name+"~"+this.id+'?o='+menu.value); }, hIImgUnset: function(el,ev,op){ var $el=el,$this=this; //var imgDiv=w$query("div.nImageDiv",w$sub("div.nDiv>div.nBody>div.nContentDiv",$el)); imgDiv.dataset.src=''; //w$query("img",imgDiv).src=''; //w$query("img",w$sub("div.pDiv",$el)).src=''; this.iimg=this.iimg_x=null; this.iimg_o=1; w$w({'!nSetData':'', n:{ '@id':this.id, iimg:'', iimg_x:'' } }); }, hEdit: function(el,ev){ var $this=this; if(W.Y==el || !nEditStop(false,true)) return; if(this.text && this.text.charAt(0)=='\1'){ w$w({'!nText':'',id:this.id,root:this.root,path:this.path,parent:this.parent},function(data){ w$weave(el,'',data); HEditStart(el); }); }else{ HEditStart(el); } }, heStop: function(el,ev){ HEditStop(true,true); }, hY: function(el,ev){ var $this=this,s; //w$setAttribute(w$queryAll(" #HHead div.HName,#HHead div.HTitle,#HDetDiv div.BText"),{ contenteditable:'true'}) var y={ '!nSet':'', n: this.$Y(w$query("#HHead div.HTitle"),w$query("#HDetDiv div.BText")) } var name=removeWS(w$query("#HHead div.HName").textContent); if(name!=this.name){ y.n.name=name; } if(typeof this.$img!='undefined'){ y.n.img=this.$img; y.n.img_o=this.img_o; //y.n.o_ir=toPercent(w$query('.nImageCol',nC).getBoundingClientRect().width/nC.getBoundingClientRect().width); } LOG&&console.log(y); w$w(y,function(data){ el.dataset.changed=''; location.reload(); }); }, /*onmenu: function(el,ev,m,me){ console.log(m,me); },*/ hImgSplit: function(el,ev){ var $this=this; split(ev,ev.target,{side:'both',leftMin:20,rightMin:100, resized:function(el,ops){ $this.nSetData(w$find(el,'H'),ev,{o_hir:Math.min(100,100*el.previousElementSibling.offsetWidth/el.parentElement.offsetWidth)}) }}); }, hTxtSplit: function(el,ev){ var $this=this; split(ev,ev.target,{side:'both',leftMin:40,rightMin:100, resized:function(el,ops){ $this.nSetData(w$find(el,'H'),ev, {o_htr:Math.min(100,100*el.previousElementSibling.offsetWidth/el.parentElement.offsetWidth)}) }}); }, } Object.setPrototypeOf(w$type.H,w$type.N); w$type.ML={ lSet: function(el,ev){ var $this=this, e=ev.target; if(el.dataset.one){ this.lOK(el,ev,e.dataset.m); return; } if(e.getAttribute('data-s')=='1'){ e.dataset.s=''; var f=false; w$queryAll('div',e.parentElement,function(e){ if(e.dataset.s) f=true; }) if(!f) w$query("._nA",el).dataset.select=1; }else{ /*w$queryAll('div',e.parentElement,function(e){ e.dataset.s=''; })*/ e.dataset.s='1'; w$query("._nA",el).dataset.select=0; } }, lOK: function(el,ev,v){ var $this=this, e=ev.target; var a=w$queryAll("div[data-s='1']",w$sub('div.mLangs',el)), s="", sep=','; if(v!==undefined) s=v; else for(var i=0; iOpenStreetMap
' }).addTo(W.M.map); W.M.mainICON=new L.Icon({ iconUrl: 'https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-green.png', shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png', iconSize: [25,41], iconAnchor: [12, 41], popupAnchor: [1, -34], shadowSize: [41, 41] }); W.M.newICON=new L.Icon({ iconUrl: 'https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-red.png', shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png', iconSize: [25,41], iconAnchor: [12, 41], popupAnchor: [1, -34], shadowSize: [41, 41] }); W.M.nICON=new L.Icon({ iconUrl: 'https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-grey.png', shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png', //iconSize: [19,31], iconAnchor: [10, 31], popupAnchor: [1, -26], shadowSize: [31, 31] iconSize: [13,20], iconAnchor: [7, 20], popupAnchor: [1, -16], shadowSize: [20, 20] }); W.M.oICON=new L.Icon({ iconUrl: 'https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-blue.png', shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png', //iconSize: [19,31], iconAnchor: [10, 31], popupAnchor: [1, -26], shadowSize: [31, 31] iconSize: [13,20], iconAnchor: [7, 20], popupAnchor: [1, -16], shadowSize: [20, 20] }); W.M.nGROUP=L.featureGroup() .on('click',function(ev){ var id=ev.sourceTarget.options.n$id; var el=document.getElementById('~'+id); w$on(ev.originalEvent,"mouseclicked",el,null,"nOpenClose"); //el.click(); }) .addTo(W.M.map); mMarkerDragend=function(ev){ var id=ev.target.options.n$id; if(W.M.theN && W.M.theN.id==id){ var l=ev.target.getLatLng(); w$query('##MU').disabled=false; w$query('##MLoc').value=l.lat.toFixed(7)+','+l.lng.toFixed(7); w$query('##MUse').checked=true; } } W.M.remove=function(n){ var x=W.M.n$[n.id]; if(x){ W.M.nGROUP.removeLayer(x.marker); } //if(n==W.M.theN) W.M.theN=null; } W.M.add=function(n,isMain){ var x=W.M.n$[n.id]; if(x){ W.M.nGROUP.removeLayer(x.marker); } W.M.n$[n.id]=x={ l:[ n.l_la, n.l_lo] } var icon= (W.M.theN==n ? W.M.mainICON : (isMain?W.M.oICON:W.M.nICON)); var marker = x.marker = new L.Marker(x.l, { icon:icon, draggable:W.M.theN==n, n$id:n.id, title: '~'+n.id }); //marker.bindPopup("" + n.l_la+','+n.l_lo + "").addTo(W.M.map); marker.on('dragend',mMarkerDragend).addTo(W.M.nGROUP); //console.log(W.M.nGROUP.getBounds()); //W.M.map.fitBounds(W.M.nGROUP.getBounds(),{maxZoom:13}); //W.M.map.setView(x.l,13,{animate:true}); }; W.M.to=function(n,isMain){ var c=W.M.theN; if(isMain){ W.M.theN=n; if(c && c!=n && c.l_la){ W.M.add(c,c.__o=='1'); } }else if(c==n){ W.M.theN=null; } w$query('##MU').disabled=true; if(n.l_la){ W.M.add(n,isMain); W.M.map.setView([n.l_la,n.l_lo],13,{animate:true}); w$query('##MLoc').value=n.l_la+','+n.l_lo w$query('##MUse').checked=isMain; }else{ w$query('##MUse').checked=false; } }; //W.M.map.fitWorld(); W.M.map.on('click', function(e){ var n=W.M.theN,x; if(n && !n.l_la){ var icon=W.M.newICON; W.M.n$[n.id]=x={ }; w$query("#MLoc").value=e.latlng.lat.toFixed(7)+','+e.latlng.lng.toFixed(7); w$query('##MUse').checked=true; w$query('##MU').disabled=false; var marker = x.marker = new L.Marker(e.latlng, { icon:icon, draggable:W.M.theN==n, n$id:n.id, title: '~'+n.id }); //marker.bindPopup("" + n.l_la+','+n.l_lo + "").addTo(W.M.map); marker.on('dragend',mMarkerDragend).addTo(W.M.nGROUP); } //console.log(e); w$on(e.originalEvent,"map",null,e); //var marker = new L.Marker(e.latlng, {draggable:true}); if(e.originalEvent.detail==1){ //$("#sLoc").val(Math.round(e.latlng.lat*100000)/100000+','+Math.round(e.latlng.lng*100000)/100000); /*$.getJSON('http://nominatim.openstreetmap.org/reverse?format=json&accept-language=eo&lat='+e.latlng.lat+'&lon='+e.latlng.lng, function (data){ console.log(data); } );*/ } }); } document.addEventListener("DOMContentLoaded", function(){ splitter(w$query('#splitterLC'),{ resizing:function(el,args){ windowResized(); } }) splitter(w$query('#splitterCR'),{ resizing:function(el,args){ windowResized(); } }) setupM(); }); w$sync$t=null; w$sync$dt=null; w$sync$req=null; w$sync=function(t){ cancelAnimationFrame(w$sync$req); //return; if(!t){ }else if(w$sync$dt==null){ w$sync$t=t+(w$sync$dt=4)*1000; //LOG&&console.log('HOLD'); }else if(t>w$sync$t){ //console.log(t,!t || t>w$sync$t); if(W.Y){ w$sync$t=t+(w$sync$dt=4)*1000; }else{ var set=[]; w$queryAll("div.N",null,function(e){ if(e.$w && e.$w.$ && e.$w.$.id) set.push(e.$w.$.id); }) w$w({'!y$':'', '@known':set.join('~')}, { success:function(r){ var el=w$query('#ys'/*>.xDiv>.xBody>.ns'*/); if(r.n$ && r.n$.length>0){ for(var i in r.n$){ var n=r.n$[i]; if(w$query('##~'+n.id)!=null) continue; n.$o_m=0; var e=w$use('n',r.n$[i],el); e.dataset.vm=e.dataset.v='n'; el.removeChild(e); el.insertBefore(e,el.firstChild); } windowResized(); var ys=w$query('#ys'); ys.style.height=ys.style.maxHeight=(window.innerHeight-ys.offsetTop)+'px'; //while(el.lastElementChild) while(el.lastElementChild && el.getBoundingClientRect().bottom',el.getBoundingClientRect().bottom,el.lastElementChild.getBoundingClientRect().top); el.removeChild(el.lastElementChild); } //console.log(el,el.getBoundingClientRect()); } }}) w$sync$t=t+(w$sync$dt=Math.min(w$sync$dt*1.2,15))*1000; } } w$sync$req=requestAnimationFrame(w$sync); }