Вопросы по JavaScript

15.73K
.
valerik88, Делаю под пк. Ты о чем? В какое именно уг не играет? Ты о Героях Меча и Магии?
.
одно дело нормальная полноценная игра.. и совсем другое - тухлая текстовая браузерка
.
valerik88, на твой пост (08.06.2013 / 20:20) отвечу, смотри мои посты выше!!! Я текстовую браузерку не собираюсь делать, не смотря на то, что именно некоторые из них пользуются огромной популярностью в вапе
.
У меня вопрос был не на счет перспективности игры, а насчет эффективности технологий js в данной ситуацие.
.
точка невозврата
Ребята подскажите нубу, почему мои хром и опера класть хотели на document.write('Hello world') в обычном html документе? Когда хеловорлд не получается, дальше читать как то обламываюсь(
.
vermas, В опере всё работает
<script>document.write('Hello world');</script>
.
Как выбрать текст посредством JS? Пример: есть код: <span class="info">1335</span>
Заранее благодарен
.
Enter нажат, к чему теперь рыданья…
vermas (12.06.2013 / 11:56)
Ребята подскажите нубу, почему мои хром и опера класть хотели на document.write('Hello world') в обычном html документе? Когда хеловорлд не получается, дальше читать как то обламываюсь(
Попробуй document.writeln('Hello World');
.
ncux, напишу как это зделать на jQuery:
text=$(".info").text();
.
I'm the Cult of Personality...
привет помогие с js сам мало что понимаю. Проблема в том что он нероботает если подключить (шапку,ноги) джона
//файл ulogin.js
if("undefined"==typeof uLogin||!uLogin.uLogin){var uLogin={protocol:location.href.match(/^https/i)?"https":"http",host:encodeURIComponent(location.host),uLogin:!0,ids:[],langnavigator.language||navigator.systemLanguage||navigator.userLanguage||"en").substr(0,2).toLowerCase(),supportedLanguages:["en","ru","uk"],dialog:"",close:"",lightbox:"",dialogSocket:"",pixel:"//ulogin.ru/m?rand=[rand]&u=[u]&r=[r]",mobile:!1,enabledMobile:{OS:["ios","android"],browsers:["opera","safari"]},mobilePlatform:{desktop:0,tablet:0,phone:0},maxSizes:{width:500,height:!1},scrollTimer:!1,providerNames:"vkontakte odnoklassniki mailru facebook twitter google yandex livejournal openid lastfm linkedin liveid soundcloud steam flickr youtube vimeo webmoney foursquare tumblr googleplus".split(" "),states:["ready","receive","open","close"],asyncCheckID:!1,altway:function(a){a=a.toLowerCase();return(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|bolt|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|minimo|mmp|netfront|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|skyfire|symb(ian|os)|teashark|treo|up\.(browser|link)|uzardweb|vodafone|wap|windows (ce|phone)|xda|xiino|opera m(ob|in)i/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))&&/chrome|crios/i.test(a)?!1:!1;}(navigator.userAgent||navigator.vendor||window.opera),get:function(a){return document.getElementById(a);},exists:function(a){return"undefined"!=typeof a;},add:function(a,b,c){a.addEventListener?a.addEventListener(b,function(b){c(a,b);},!1):a.attachEvent?a.attachEvent("on"+b,function(b){c(a,b);}):a["on"+b]=function(b){c(a,b);};},is_encoded:function(a){return decodeURIComponent(a)!=a;},genID:function(){for(var a=new Date,b=a.getTime()+Math.floor(100000*Math.random());uLogin.get("ul_"+b);){b=a.getTime()+Math.floor(100000*Math.random());}return"ul_"+b;},show:function(a){this.exists(a)&&(a.style.visibility="visible");},hide:function(a){this.exists(a)&&(a.style.visibility="hidden");},parse:function(a){var b={};if(!a){return b;}var c=a.split("&"),c=1<c.length?c:a.split(";");for(a=0;a<c.length;a++){var d=c[a].split("=");d[0]&&(d[0]=d[0].trim());d[1]&&(d[1]=d[1].trim());b[d[0]]=d[1];}return b;},def:function(a,b,c){return this.exists(a[b])?a[b]:c;},scrollTop:function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;},scrollLeft:function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft;},dialogHeight:function(){return uLogin.mobile?uLogin.mobilePlatform.tablet?700:window.innerHeight:358;},dialogWidth:function(){return uLogin.mobile?uLogin.mobilePlatform.tablet?500:window.innerWidth:564;},clientWidth:function(){var a=0;"[object Opera]"==Object.prototype.toString.call(window.opera)&&9.5>window.parseFloat(window.opera.version())?a=document.body.clientWidth:window.innerWidth&&(a=window.innerWidth);uLogin.isIE()&&(a=document.documentElement.clientWidth);return a;},clientHeight:function(){var a=0;"[object Opera]"==Object.prototype.toString.call(window.opera)&&9.5>window.parseFloat(window.opera.version())?a=document.body.clientHeight:window.innerHeight&&(a=window.innerHeight);uLogin.isIE()&&(a=document.documentElement.clientHeight);return a;},hideAll:function(){this.lightbox&&(this.hide(this.lightbox),this.hide(this.dialog),this.hide(this.close));for(var a=0;a<this.ids.length;a++){this.ids[a].showed=!1,this.hide(this.ids[a].hiddenW),this.hide(this.ids[a].hiddenA);}},isIE:function(){if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var a=new Number(RegExp.$1);if(9>a){return a;}}return !1;},browserDetect:{init:function(){this.OS=this.detectMobilePlatfrom();this.browser=this.searchString(this.dataBrowser)||0;this.version=this.searchVersion(navigator.userAgent)||this.searchVersion(navigator.appVersion)||0;},searchString:function(a){for(var b=0;b<a.length;b++){var c=a[b].string,d=a[b].prop;this.versionSearchString=a[b].versionSearch||a[b].identity;if(c){if(a[b].subString.test(c)){return a[b].identity;}}else{if(d){return a[b].identity;}}}},searchVersion:function(a){var b=a.indexOf(this.versionSearchString);if(-1!=b){return parseFloat(a.substring(b+this.versionSearchString.length+1));}},detectMobilePlatfrom:function(){var a=navigator.userAgent.toLowerCase();if(function(){var a=navigator.platform.toLowerCase(),c=navigator.userAgent.toLowerCase(),d=/mobi(le)?|tablet|phone|palm|pocket|handheld|e?book|reader|ip(ad|od|hone)|android|blackberry|playbook|webos|windows ce/;if(d.test(a)||d.test(c)){return !1;}if(/linux|unix|^win|^mac/.test(a)){return !0;}if("ontouchstart" in window){return !1;}}()){return uLogin.mobilePlatform.desktop=1,"desktop";}if(/android/.test(a)){return/tablet/.test(a)?uLogin.mobilePlatform.tablet=1:/mobile|phone/.test(a)?uLogin.mobilePlatform.phone=1:uLogin.mobilePlatform.tablet=1,"android";}if(/ip(ad|od|hone)/.test(a)){return/ip(od|hone)|phone/.test(a)?uLogin.mobilePlatform.phone=1:/ipad|tablet/.test(a)&&(uLogin.mobilePlatform.tablet=1),"ios";}if(/blackberry|playbook/.test(a)){return/playbook|tablet/.test(a)?uLogin.mobilePlatform.tablet=1:uLogin.mobilePlatform.phone=1,"blackberry";}if(/windows/.test(a)){return/tablet/.test(a)?uLogin.mobilePlatform.tablet=1:uLogin.mobilePlatform.phone=1,"winmobile";}if(/tablet/.test(a)){return uLogin.mobilePlatform.tablet=1,0;}if(/phone/.test(a)){return uLogin.mobilePlatform.phone=1,0;}uLogin.mobilePlatform.phone=1;return 0;},dataBrowser:[{string:navigator.userAgent,subString:/Chrome/,identity:"Chrome"},{string:navigator.userAgent,subString:/CriOS/,identity:"Chrome"},{string:navigator.userAgent,subString:/OmniWeb/,versionSearch:"OmniWeb/",identity:"OmniWeb"},{string:navigator.vendor,subString:/Apple/,identity:"Safari",versionSearch:"Version"},{string:navigator.userAgent,subString:/Safari/,identity:"Safari",versionSearch:"Version"},{string:navigator.userAgent,subString:/Opera Mini/,identity:"OperaMini"},{prop:window.opera,identity:"Opera",versionSearch:"Version"},{string:navigator.vendor,subString:/iCab/,identity:"iCab"},{string:navigator.vendor,subString:/KDE/,identity:"Konqueror"},{string:navigator.userAgent,subString:/Firefox/,identity:"Firefox"},{string:navigator.vendor,subString:/Camino/,identity:"Camino"},{string:navigator.userAgent,subString:/Netscape/,identity:"Netscape"},{string:navigator.userAgent,subString:/MSIE/,identity:"Explorer",versionSearch:"MSIE"},{string:navigator.userAgent,subString:/Gecko/,identity:"Mozilla",versionSearch:"rv"},{string:navigator.userAgent,subString:/Mozilla/,identity:"Netscape",versionSearch:"Mozilla"}]},inArray:function(a,b){if(!a||!b){return !1;}for(var c=0,d=b.length;c<d;c++){if(a==b[c]){return !0;}}return !1;},isMobile:function(){uLogin.inArray(uLogin.browserDetect.OS.toLowerCase(),uLogin.enabledMobile.OS)&&uLogin.inArray(uLogin.browserDetect.browser.toLowerCase(),uLogin.enabledMobile.browsers)&&(uLogin.mobile=!0);},extraction:function(){if(uLogin.extraction.disabled){return !1;}for(var a=0,b=[],c=[],d=document.getElementsByTagName("div"),e=document.getElementsByTagName("a");e[a];){e[a]&&(b[a]=e[a]),a++;}for(a=0;d[a];){d[a]&&(c[a]=d[a]),a++;}for(a=0;c[a]||b[a];){c[a]&&uLogin.addWidget(c[a]),b[a]&&uLogin.addWidget(b[a]),a++;}},addWidget:function(a){var b="",c="";a.id&&(b=a.id,c=(c=a.getAttribute("x-ulogin-params"))?c:a.getAttribute("data-ulogin"));if(b&&c){a=this.parse(c);for(var c=!0,d=0;d<this.ids.length;d++){if(b==this.ids[d].id){c=!1;break;}}c&&this.setWidgetProperties(b,this.ids.length,a);}},initWidget:function(a){if(a){var b=uLogin.get(a);if(b){var c=b.getAttribute("x-ulogin-params");if(c=c?c:b.getAttribute("data-ulogin")){var d=uLogin.parse(c),b=!1,e;for(e=0;e<uLogin.ids.length;e++){if(a==uLogin.ids[e].id){b=!0;break;}}b?uLogin.ids[e].initCheck||(uLogin.ids[e].initCheck=window.setInterval(function(){uLogin.ids[e].done&&(window.clearInterval(uLogin.ids[e].initCheck),uLogin.setWidgetProperties(a,e,d));},50))e=uLogin.ids.length,uLogin.setWidgetProperties(a,e,d));}}}},setWidgetProperties:function(a,b,c){this.ids[b]={id:a,dropTimer:!1,initCheck:!1,done:!1,type:this.def(c,"display",""),providers:this.def(c,"providers",""),hidden:this.def(c,"hidden",""),redirect_uri:this.def(c,"redirect_uri",""),callback:this.def(c,"callback",""),fields:this.def(c,"fields","first_name,last_name"),optional:this.def(c,"optional",""),color:this.def(c,"color","fff"),opacity:this.def(c,"opacity","75"),verify:this.def(c,"verify",""),lang:this.def(c,"lang",uLogin.lang),state:"",ready_func:[],receive_func:[],open_func:[],close_func:[]};if(this.ids[b].providers==""&&this.ids[b].type=="window"){this.ids[b].providers=(uLogin.providerNames).join(",");}if(typeof c.mobilebuttons!="undefined"&&c.mobilebuttons==0){uLogin.mobile=0;}this.ids[b].redirect_uri=uLogin.is_encoded(this.ids[b].redirect_uri)?this.ids[b].redirect_uri.replace(/\//g,"%2F"):encodeURIComponent(this.ids[b].redirect_uri);uLogin.altway&&(this.ids[b].redirect_uri=location.href,this.ids[b].callback="");-1==uLogin.supportedLanguages.indexOf(this.ids[b].lang)&&(this.ids[b].lang=uLogin.lang);"undefined"==typeof easyXDM&&1>=this.ids.length&&(a=document.createElement("script"),a.src="//ulogin.ru/js/easyXDM.min.js",document.body.appendChild(a));var d=window.setInterval(function(){if("undefined"!=typeof easyXDM&&"undefined"!=typeof easyXDM.Socket){switch(window.clearInterval(d),c.display=uLogin.ifMobileSetMobile(c.display),c.display){case"small":case"panel":uLogin.ids[b].listener_id=!1;uLogin.initPanel(b);break;case"window":uLogin.initWindow(b);break;case"buttons":uLogin.initButtons(b,uLogin.def(c,"receiver",uLogin.ids[b].redirect_uri));break;case"mobile":uLogin.initMobile(b);break;default:uLogin.ids.splice(b,b);}}},100);},sendPixel:function(){if(!uLogin.pixel){return !1;}var a=document.createElement("iframe"),b=uLogin.pixel,b=b.replace("[rand]",parseInt(100000000*Math.random())),b=b.replace("[u]",encodeURIComponent(location.href)),b=b.replace("[r]",encodeURIComponent(document.referrer?document.referrer:""));a.src=b;a.width=1;a.height=1;a.style.display="none";document.body.appendChild(a);setTimeout(function(){document.body.removeChild(a);},5000);uLogin.pixel=!1;},ifMobileSetMobile:function(a){return uLogin.mobile&&"buttons"!=a?"mobile":a;},init:function(a){uLogin.extraction.disabled=!1;uLogin.browserDetect.init();uLogin.isMobile();""==a&&(uLogin.add(window,"load",function(){setTimeout(function(){clearInterval(uLogin.asyncCheckID);},uLogin.extraction.disabled?100:0);uLogin.sendPixel();uLogin.extraction();}),a=document.getElementsByTagName("script"),a=a[a.length-1].src,-1==a.indexOf("?")&&(a+="?"),a=a.substr(a.indexOf("?")+1));if(""!=a){var b=this.parse(a);if(b.display){var c=this.def(b,"id","uLogin");if(this.get(c)){a=!0;for(var d=0;d<this.ids.length;d++){c==this.ids[d].id&&(a=!1);}a&&(c=this.ids.length,this.setWidgetProperties(this.def(b,"id","uLogin"),c,b));}else{window.setTimeout('uLogin.init("'+a+'")',1000);}}}},initSocket:function(a,b,c,d){var e=new easyXDM.Socket({remote:a,swf:uLogin.isIE()?"https://ulogin.ru/js/easyxdm.swf":"",props:c,container:b,onMessage:function(a){-1<a.indexOf("http")?location.href=a:-1<uLogin.states.indexOf(a)?uLogin._changeState(d,a):"closeme"==a&&uLogin.mobile?(uLogin.hide(uLogin.dialog),uLogin.hide(uLogin.lightbox),uLogin.dialog.style.visibility="hidden",uLogin.dialog.style.display="none",uLogin.lightbox.style.display="none",e.destroy()):"undefined"!=typeof window[uLogin.ids[d].callback]&&(window[uLogin.ids[d].callback](a),uLogin.dialog&&(uLogin.lightbox.style.display="none",uLogin.dialog.style.display="none",uLogin.hide(uLogin.close)));}});return e;},getWidgetNumber:function(a){for(var b=0;b<uLogin.ids.length;b++){if(a==uLogin.ids[b].id){return b;}}return NaN;},initMobile:function(a){if(!uLogin.ids[a].done){var b=uLogin.ids[a].type,c=""!=uLogin.ids[a].hidden,d=uLogin.ids[a].providers,e=uLogin.ids[a].type="mobile";"other"==uLogin.ids[a].hidden?uLogin.ids[a].providers="":""!=uLogin.ids[a].hidden&&(uLogin.ids[a].providers+=(uLogin.ids[a].providers==""?"":",")+uLogin.ids[a].hidden);var f=uLogin.get(uLogin.ids[a].id);"undefined"==typeof f.getElementsByTagName("iframe")[0]&&(f.innerHTML="",f=d.split(",").length,"window"==b?f=187f=("small"==b?21:42)*(c?f+1:f),f="small"==b?128>f?128:f:160>f?160:f),e="https://ulogin.ru/mobile_button.html?id="+a+"&display="+e+"&redirect_uri="+this.ids[a].redirect_uri,e+="&callback="+this.ids[a].callback+"&providers="+this.ids[a].providers+"&fields="+this.ids[a].fields+"&optional="+this.ids[a].optional,e+="&protocol="+uLogin.protocol,e+="&host="+uLogin.host,e+="&lang="+this.ids[a].lang,e+="&verify="+this.ids[a].verify,e=e+("&originaltype="+b)+("&originalhidden="+c),e+="&originalproviders="+d,uLogin.initSocket(e,uLogin.ids[a].id,{style:{display:"inline-block",margin:"0",padding:"0",width:f+2+"px",height"small"==b?14:28)+2+"px",border:"0",overflow:"hidden"},frameBorder:"0",allowTransparency:"true"},a));uLogin.ids[a].done=!0;}},initWindow:function(a){var b=document.createElement("div");if(""==this.dialog){b.innerHTML='<div style="'+("position:absolute;z-index:9997;left:0;top:0;margin:0;padding:0;width:100%;height:100%;background:#"+this.ids[a].color+";opacity:0."+this.ids[a].opacity+";filter:progidXImageTransform.Microsoft.Alpha(opacity="+this.ids[a].opacity+");display:none;")+'"></div>';this.lightbox=b.firstChild;var c=uLogin.dialogHeight(),d=uLogin.dialogWidth(),e=Math.floor(uLogin.scrollLeft()+(uLogin.clientWidth()-d)/2),f=Math.floor(uLogin.scrollTop()+(uLogin.clientHeight()-c)/2),c="position:absolute;z-index:9998;left:"+e+"px;top:"+f+"px;margin-bottom:0;margin-right:0;margin-top:0px;margin-left:0px;padding:0;overflow:hidden;width:"+d+"px;height:"+c+"px;display:none;"+(!uLogin.mobile||uLogin.mobile&&uLogin.mobilePlatform.tablet?"border:10px solid #666;border-radius:8px;":"");b.innerHTML='<div id = "'+uLogin.genID()+'" style="'+c+'"></div>';this.dialog=b.firstChild;if(!uLogin.mobile){b.innerHTML='<img style="width:30px;height:30px;position:absolute;z-index:9999;border:0px;left:0;top:0;margin:0;padding:0;background:url(https://ulogin.ru/img/x.png);cursor:pointer;visibility:hidden" src="https://ulogin.ru/img/blank.gif"/>';this.close=b.firstChild;this.add(this.close,"click",function(){uLogin.lightbox.style.display="none";uLogin.dialog.style.display="none";uLogin.hide(uLogin.close);});this.add(this.close,"mouseover",function(a){a.style.background="url(https://ulogin.ru/img/x_.png)";});this.add(this.close,"mouseout",function(a){a.style.background="url(https://ulogin.ru/img/x.png)";});document.body.appendChild(this.close);this.add(this.lightbox,"click",function(){uLogin.lightbox.style.display="none";uLogin.dialog.style.display="none";uLogin.hide(uLogin.close);});var b=this.get(this.ids[a].id).getElementsByTagName("img")[0],g="ru"==this.ids[a].lang?"https://ulogin.ru/img/button.png":"https://ulogin.ru/img/"+this.ids[a].lang+"/button.png",j="ru"==this.ids[a].lang?"https://ulogin.ru/img/button_.png":"https://ulogin.ru/img/"+this.ids[a].lang+"/button_.png";b&&(b.src=g,b.style.border="none",this.add(b,"mouseover",function(a){a.src!=j&&(a.src=j);}),this.add(b,"mouseout",function(a){a.src!=g&&(a.src=g);}));}document.body.appendChild(this.lightbox);document.body.appendChild(this.dialog);}this.ids[a].done||(this.add(this.get(this.ids[a].id),"click",function(a,b){b.preventDefault?b.preventDefault():b.returnValue=!1;var c=a.id?a:b.srcElement;c&&uLogin.showWindow(c.id);return !1;}),uLogin.add(window,"scroll",function(){uLogin.onMoveWindow();}),uLogin.add(window,"resize",function(){uLogin.onMoveWindow();}),this.ids[a].done=!0);},onMoveWindow:function(){uLogin.mobile?uLogin.moveWindow()uLogin.scrollTimer&&window.clearTimeout(uLogin.scrollTimer),uLogin.scrollTimer=window.setTimeout(uLogin.moveWindow,200));},showWindow:function(a){a=uLogin.getWidgetNumber(a);var b="https://ulogin.ru/"+(uLogin.mobile?"mobile.html":"window.html")+"?id="+a+"&redirect_uri="+uLogin.ids[a].redirect_uri+"&callback="+uLogin.ids[a].callback+"&fields="+uLogin.ids[a].fields+"&optional="+uLogin.ids[a].optional+(uLogin.altway?"&altway=1":"")+"&protocol="+uLogin.protocol+"&host="+uLogin.host+"&lang="+this.ids[a].lang+"&verify="+this.ids[a].verify+(uLogin.mobile?"&providers="+uLogin.ids[a].providers:""),c=uLogin.dialogWidth(),d=uLogin.dialogHeight();""!=uLogin.dialogSocket&&uLogin.dialogSocket.destroy();uLogin.dialogSocket=uLogin.initSocket(b,uLogin.dialog.getAttribute("id"),{style:{margin:"0",padding:"0",background:"#fff",width:c+"px",height:d+"px",border:"0",position:"absolute",left:"0",top:"0",overflow:"hidden"},frameBorder:"0"},a);uLogin.mobile||(uLogin.close.style.left=Math.floor(uLogin.scrollLeft()+(uLogin.clientWidth()+562)/2)+"px",uLogin.close.style.top=Math.floor(uLogin.scrollTop()+(uLogin.clientHeight()-374)/2)+"px",uLogin.show(uLogin.close));uLogin.lightbox.style.display="block";uLogin.dialog.style.display="block";uLogin.lightbox.style.visibility="visible";uLogin.dialog.style.visibility="visible";uLogin.onMoveWindow();},moveWindow:function(){if(!uLogin.dialog.firstChild){return !1;}var a=uLogin.dialogWidth(),b=uLogin.dialogHeight();if(uLogin.mobile){var c=uLogin.clientWidth(),d=uLogin.clientHeight(),a=a>c?c-2:a-2,b=b>d?d-2:b-2;if(uLogin.mobilePlatform.tablet){uLogin.dialog.style.left=Math.floor(uLogin.scrollLeft()+(c-a-20)/2)+"px",uLogin.dialog.style.top=Math.floor(uLogin.scrollTop()+(d-b-20)/2)+"px",uLogin.dialogSocket.postMessage("resize:"+a+":"+b+"");}else{uLogin.dialog.style.left=uLogin.scrollLeft()+"px";uLogin.dialog.style.top=uLogin.scrollTop()+"px";if(!uLogin.maxSizes.height||100>uLogin.maxSizes.height){uLogin.maxSizes.height=b*(uLogin.maxSizes.width/a);}uLogin.dialogSocket.postMessage("resize:"+a+":"+b+":"+(a<b?a/uLogin.maxSizes.width:b/uLogin.maxSizes.height)+"");}uLogin.dialog.style.width=a+"px";uLogin.dialog.style.height=b+"px";uLogin.dialog.firstChild.style.width=a+"px";uLogin.dialog.firstChild.style.height=b+"px";}else{for(var c=(Math.floor(uLogin.scrollLeft()+(uLogin.clientWidth()-a)/2)-new Number(uLogin.dialog.style.left.slice(0,-2)))/10,b=(Math.floor(uLogin.scrollTop()+(uLogin.clientHeight()-b)/2)-new Number(uLogin.dialog.style.top.slice(0,-2)))/10,d=(Math.floor(uLogin.scrollLeft()+(uLogin.clientWidth()+562)/2)-new Number(uLogin.close.style.left.slice(0,-2)))/10,a=(Math.floor(uLogin.scrollTop()+(uLogin.clientHeight()-374)/2)-new Number(uLogin.close.style.top.slice(0,-2)))/10,e=0;10>e;e++){uLogin.dialog.style.left=c+new Number(uLogin.dialog.style.left.slice(0,-2))+"px",uLogin.dialog.style.top=b+new Number(uLogin.dialog.style.top.slice(0,-2))+"px",uLogin.close.style.left=d+new Number(uLogin.close.style.left.slice(0,-2))+"px",uLogin.close.style.top=a+new Number(uLogin.close.style.top.slice(0,-2))+"px";}}},initPanel:function(a){function b(){uLogin.ids[a].listener_id&&uLogin.removeStateListener(uLogin.ids[a].id,uLogin.ids[a].listener_id,"ready");if(!c&&""!=uLogin.ids[a].hidden&&!uLogin.ids[a].done){var b=document.createElement("div"),d=uLogin.ids[a].opacity;b.innerHTML='<img src="https://ulogin.ru/img/blank.gif" style="position:relative;width:'+e+"px;height:"+e+"px;margin:"+f+";cursor:pointer;background:"+g+';vertical-align:top;border:0px;"/>';uLogin.add(b.firstChild,"mouseover",function(b){uLogin.ids[a].showed=!1;uLogin.dropdownDelayed(a,j);b.style.filter="alpha(opacity="+d+") progidXImageTransform.Microsoft.AlphaImageLoader(src=transparent.png, sizingMethod='crop')";b.style.opacity=parseFloat(d)/100;});uLogin.add(b.firstChild,"mouseout",function(b){uLogin.ids[a].showed=!0;uLogin.dropdownDelayed(a,j);b.style.filter="";b.style.opacity="";});uLogin.add(b.firstChild,"click",function(){uLogin.dropdown(a,j);});uLogin.ids[a].drop=b.firstChild;uLogin.get(uLogin.ids[a].id).appendChild(uLogin.ids[a].drop);uLogin.initDrop(a);uLogin.ids[a].listener_id=uLogin.setStateListener(uLogin.ids[a].id,"ready",function(){uLogin.ids[a].done=!0;uLogin.removeStateListener(uLogin.ids[a].id,uLogin.ids[a].listener_id,"ready");});}else{if(""==uLogin.ids[a].hidden||c){uLogin.ids[a].done=!0;}}}uLogin.get(uLogin.ids[a].id).innerHTML="";var c=!0,d="small"==uLogin.ids[a].type?21:42,e="small"==uLogin.ids[a].type?16:32,f="small"==uLogin.ids[a].type?"0 5px 0 0":"0 10px 0 0",g="small"==uLogin.ids[a].type?"url(https://ulogin.ru/img/small7.png) 0 0":"url(https://ulogin.ru/img/panel7.png) 0 -3px",j="small"==uLogin.ids[a].type?1:2;if(this.ids[a].providers){document.createElement("div");var h="https://ulogin.ru/panel.html?id="+a+"&display="+j+"&redirect_uri="+this.ids[a].redirect_uri+"&callback="+this.ids[a].callback+"&providers="+this.ids[a].providers+"&fields="+this.ids[a].fields+"&optional="+this.ids[a].optional+"&othprov="+uLogin.ids[a].hidden,h=h+(uLogin.altway?"&altway=1":""),h=h+("&protocol="+uLogin.protocol),h=h+("&host="+uLogin.host),h=h+("&lang="+this.ids[a].lang),h=h+("&verify="+this.ids[a].verify);uLogin.initSocket(h,uLogin.ids[a].id,{style:{display:"inline-block",margin:"0",padding:"0",width:this.ids[a].providers.split(",").length*d+"px",height:e+"px",border:"0",overflow:"hidden"},frameBorder:"0",allowTransparency:"true"},a);if(this.ids[a].hidden){var d=this.ids[a].providers.split(","),k;for(k in this.providerNames){if(!d[k]){c=!1;break;}}}else{c=!1;}}else{c=!1;}this.ids[a].providers?uLogin.ids[a].listener_id=uLogin.setStateListener(uLogin.ids[a].id,"ready",b):b();},initDrop:function(a){if(""!=this.ids[a].hidden){var b=document.createElement("div"),c=this.get(this.ids[a].id),d=uLogin.genID();if("other"==this.ids[a].hidden){for(var e=this.providerNames.slice(0),f=this.ids[a].providers.split(","),g=0;g<f.length;g++){e.splice(e.indexOf(f[g]),1);}this.ids[a].hidden=e.toString();}b.innerHTML='<div id = "'+d+'" style="position:absolute;z-index:9999;left:100px;top:200px;margin:0;padding:0;width:128px;height:'+(23*this.ids[a].hidden.split(",").length+-2)+'px;border:5px solid #666;border-radius:4px;visibility:hidden"></div>';this.ids[a].hiddenW=b.firstChild;c.appendChild(this.ids[a].hiddenW);e="https://ulogin.ru/drop.html?id="+a+"&redirect_uri="+this.ids[a].redirect_uri+"&callback="+this.ids[a].callback+"&providers="+this.ids[a].hidden+"&fields="+this.ids[a].fields+"&optional="+uLogin.ids[a].optional+"&othprov="+uLogin.ids[a].providers;e+=uLogin.altway?"&altway=1":"";e+="&protocol="+uLogin.protocol;e+="&host="+uLogin.host;e+="&lang="+this.ids[a].lang;e+="&verify="+this.ids[a].verify;uLogin.initSocket(e,d,{style:{position:"relative",margin:"0",padding:"0",background:"#fff",width:"128px",height:23*this.ids[a].hidden.split(",").length-2+"px",border:"0",overflow:"hidden"},frameBorder:"0"},a);b.innerHTML='<div style="position:absolute;background:#000;left:82px;top:'+(23*this.ids[a].hidden.split(",").length-7)+'px;margin:0;padding:0;width:41px;height:13px;border:5px solid #666;border-radius:0px;text-align:center"><a href="https://ulogin.ru/" target="_blank" style="display:block;margin:0px;width:41px;height:13px;background:url(https://ulogin.ru/img/text.png) no-repeat;"></a></div>';this.ids[a].hiddenW.appendChild(b.firstChild);b.innerHTML='<img src="https://ulogin.ru/img/link.png" style="width:8px;height:4px;position:absolute;z-index:9999;margin:0;padding:0;visibility:hidden"/>';this.ids[a].hiddenA=b.firstChild;c.appendChild(this.ids[a].hiddenA);this.ids[a].showed=!1;this.add(document.body,"click",function(a,b){b.target||(b.target=b.srcElement);for(var c=0;c<uLogin.ids.length;c++){b.target!=uLogin.ids[c].drop&&(uLogin.hide(uLogin.ids[c].hiddenW),uLogin.hide(uLogin.ids[c].hiddenA));}});uLogin.ids[a].hiddenW&&uLogin.ids[a].hiddenA&&(this.add(uLogin.ids[a].hiddenW,"mouseout",function(){uLogin.dropdownDelayed(a,0);}),this.add(uLogin.ids[a].hiddenA,"mouseout",function(){uLogin.dropdownDelayed(a,0);}),this.add(uLogin.ids[a].hiddenW,"mouseover",function(){uLogin.clearDropTimer(a);}),this.add(uLogin.ids[a].hiddenA,"mouseover",function(){uLogin.clearDropTimer(a);}));}},showDrop:function(a,b){if(uLogin.ids[a].hiddenW||uLogin.ids[a].hiddenA){if(uLogin.ids[a].showed||0==b){uLogin.ids[a].showed=!1,uLogin.hide(uLogin.ids[a].hiddenW),uLogin.hide(uLogin.ids[a].hiddenA);}else{uLogin.ids[a].showed=!0;var c,d,e=uLogin.ids[a].drop;c=0+e.offsetLeft;d=0+e.offsetTop;c-=e.scrollLeft;d-=e.scrollTop;uLogin.ids[a].hiddenW.style.left=c-(1==b?100:106)+"px";uLogin.ids[a].hiddenW.style.top=d+(1==b?21:37)+"px";uLogin.ids[a].hiddenA.style.left=c+(1==b?4:12)+"px";uLogin.ids[a].hiddenA.style.top=d+(1==b?17:33)+"px";uLogin.show(uLogin.ids[a].hiddenA);uLogin.show(uLogin.ids[a].hiddenW);}}},clearDropTimer:function(a){uLogin.ids[a].dropTimer&&window.clearTimeout(uLogin.ids[a].dropTimer);},dropdown:function(a,b){uLogin.clearDropTimer(a);uLogin.showDrop(a,b);},dropdownDelayed:function(a,b){uLogin.clearDropTimer(a);uLogin.ids[a].dropTimer=window.setTimeout(function(){uLogin.showDrop(a,b);},600);},initButtons:function(a,b){var c=uLogin.get(uLogin.ids[a].id);b=uLogin.is_encoded(b)?b.replace(/\//g,"%2F"):encodeURIComponent(b);uLogin._proceedChildren(c,uLogin._initButton,a,b);uLogin._changeState(a,uLogin.states[0]);uLogin.ids[a].done=!0;},_proceedChildren:function(a,b,c,d){a=a.childNodes;for(var e,f=0,f=0;f<a.length;f++){var g=a[f];if(g.getAttribute&&(b(g,c,d),(e=g.getAttribute("x-ulogin-button"))&&!RegExp(e+"(,|$)","i").test(uLogin.ids[c].providers))){uLogin.ids[c].providers+=e+",";}uLogin._proceedChildren(g,b,c,d);}},_initButton:function(a,b,c){var d=a.getAttribute("x-ulogin-button");if(d&&-1<uLogin.providerNames.indexOf(d)){if((c.match(/^https/i)?"https":"http")!=uLogin.protocol){e=":";d=c.split(e);if(1==d.length){var e="%3A",d=c.split(e);}d.splice(0,1);c=uLogin.protocol+e+d.join(e);}uLogin.add(a,"mouseover",function(a){var c=uLogin.ids[b].opacity;a.style.filter="alpha(opacity="+c+") progidXImageTransform.Microsoft.AlphaImageLoader(src=transparent.png, sizingMethod='crop')";a.style.opacity=parseFloat(c)/100;});uLogin.add(a,"mouseout",function(a){a.style.filter="";a.style.opacity="";});uLogin.add(a,"click",function(a){a=a.getAttribute("x-ulogin-button");if("webmoney"!=a&&"livejournal"!=a&&"openid"!=a){src="https://ulogin.ru/auth";}else{if(src="https://ulogin.ru/url",document.cookie){var d=new Date((new Date).getTime()-60);document.cookie="windows=; expires = "+d.toGMTString()+"; path=/";document.cookie="q=; expires = "+d.toGMTString()+"; path=/";document.cookie="q="+uLogin.ids[b].redirect_uri+"; path=/";document.cookie="window=3; path=/";}}src+=".php?name="+a+"&window=3&lang="+uLogin.lang+"&fields="+uLogin.ids[b].fields+"&optional="+uLogin.ids[b].optional+"&redirect_uri="+uLogin.ids[b].redirect_uri+"&verify="+uLogin.ids[b].verify+"&callback="+uLogin.ids[b].callback+"&screen="+screen.width+"x"+screen.height+"&providers="+uLogin.ids[b].providers.substr(0,uLogin.ids[b].providers.length-1)+"&q="+c;uLogin._changeState(b,uLogin.states[1]);var e=window.open(src,"uLogin","width=800,height=600,left="+(screen.width-800)/2+",top="+(screen.height-600)/2),h=window.setInterval(function(){e&&e.closed&&(window.clearInterval(h),uLogin._changeState(b,uLogin.states[0]));},100);});}},checkCurrentWidgets:function(){for(var a=0;uLogin.ids[a];){var b=uLogin.ifMobileSetMobile(uLogin.ids[a].type);"window"==b?uLogin.initWindow(a):"buttons"==b?uLogin.ids[a].done||uLogin.initButtons(a,"undefined"!=typeof query&&"undefined"!=typeof query.receiver?query.receiver:uLogin.ids[a].redirect_uri):"mobile"==b?uLogin.ids[a].done||uLogin.initMobile(a)b=uLogin.get(uLogin.ids[a].id))&&!b.getElementsByTagName("iframe").length&&uLogin.ids[a].done&&uLogin.initWidget(uLogin.ids[a].id);a++;}},customInit:function(){uLogin.extraction.disabled=!0;for(var a=0;a<arguments.length;a++){var b=uLogin.get(arguments[a]);if(!b||!arguments[a]){return console.log('uLogin ERROR (customInit): Element with ID="'+arguments[a]+'" not found'),!1;}uLogin.addWidget(b);}},checkAsyncWidgets:function(){var a=uLogin.get("ulogin")||uLogin.get("uLogin");a&&a.id&&(uLogin.addWidget(a),clearInterval(uLogin.asyncCheckID));},setStateListener:function(a,b,c){var d=!1;a=uLogin.getWidgetNumber(a);if(NaN!=a&&uLogin.ids[a]){switch(b){case"ready":d=uLogin.ids[a].ready_func.push(c);break;case"receive":d=uLogin.ids[a].receive_func.push(c);break;case"open":d=uLogin.ids[a].open_func.push(c);break;case"close":d=uLogin.ids[a].close_func.push(c);}}return d-1;},removeStateListener:function(a,b,c){a=uLogin.getWidgetNumber(a);if(NaN!=a&&-1<uLogin.states.indexOf(c)){switch(c){case"ready":uLogin.ids[a].ready_func.length>=b&&uLogin.ids[a].ready_func.splice(b,1);break;case"receive":uLogin.ids[a].receive_func.length>=b&&uLogin.ids[a].receive_func.splice(b,1);break;case"open":uLogin.ids[a].open_func.length>=b&&uLogin.ids[a].open_func.splice(b,1);break;case"close":uLogin.ids[a].close_func.length>b&&uLogin.ids[a].close_func.splice(b,1);}}},_changeState:function(a,b){if(uLogin.ids[a]){uLogin.ids[a].state=b;var c=0;switch(b){case"ready":for(;uLogin.ids[a].ready_func[c];){uLogin.ids[a].ready_func[c](),c++;}break;case"receive":for(;uLogin.ids[a].receive_func[c];){uLogin.ids[a].receive_func[c](),c++;}break;case"open":for(;uLogin.ids[a].open_func[c];){uLogin.ids[a].open_func[c](),c++;}break;case"close":for(;uLogin.ids[a].close_func[c];){uLogin.ids[a].close_func[c](),c++;}}}}};Array.indexOf||(Array.prototype.indexOf=function(a){for(var b=0;b<this.length;b++){if(this[b]==a){return b;}}return -1;});String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");});-1==uLogin.supportedLanguages.indexOf(uLogin.lang)&&(uLogin.lang=uLogin.supportedLanguages[0]);uLogin.init("undefined"!=typeof uLogin_query?uLogin_query:"");uLogin.asyncCheckID=setInterval(function(){uLogin.checkAsyncWidgets();},20);setTimeout(function(){uLogin.checkCurrentWidgets();setTimeout(arguments.callee,500);},10);}function receiver(a,b){window[b](a);}function redirect(a,b){var c=document.createElement("form");c.action=decodeURIComponent(b);c.method="post";c.target="_top";c.style.display="none";var d=document.createElement("input");d.type="hidden";d.name="token";d.value=a;c.appendChild(d);document.body.appendChild(c);c.submit();}
Всего: 820