Admin Admin
Number of posts : 262 Join date : 08.03.12 Age : 62 Dzīvesvieta : Talsi
| Tēma: Virtuāla klaviatūra uz tavas web lapas Svētdena Novembris 25, 2012 7:14 am | |
| Skripta darbība izsauc uz datora ekrāna virtuālu klaviatūru, ar kuras palīdzību var veikt jebkāda teksta ievadi web lapu ievades laukos. Ekrāna klaviatūra paredzēta tiem retajiem gadījumiem, kad kāda iemesla dēļ pēkšņi nav pieejama fiziskā klaviatūra, vai arī slepenu datu ievades laikā, lai izsargātos no "keylogger" (datu zagšanas) programmām. 1) Lapā, kurā nepieciešama klaviatūra, ievietojam sekojošo Javascript bloku : - Kods:
-
<script> window.google={kEI:"PymkTIHfEcKI-AacopSjCw",kEXPI:"17259,17291,26751,26781",kCSI:{e:"17259,17291,26751,26781",ei:"PymkTIHfEcKI-Aac opSjCw",expi:"17259,17291,26751,26781"},ml:function(){},pageState:"#",kHL:"lv",time:function(){return(new Date).getTime()},log:function(b,d,c){var a=new Image,e=google,g=e.lc,f=e.li;a.onerror=(a.onload=(a.onabort=function(){delete g[f]}));g[f]=a;c=c||"/gen_204?atyp=i&ct="+b+"&cad="+d+"&zx="+google.time();a.src=c;e.li=f+1},lc:[],li:0,j:{en:1,l:function(){google.fl=true},e:function(){google.fl=true},b:location.hash&&location.hash!="#",bv:3,pl:[],mc:0,sc:0.5},Toolbelt:{}};(function(){for(var d=0,c;c=["ad","bc","p","pa","zd","ac","pc","pah","ph","sa","spf","xx","zc","zz"][d++];)(function(a){google.j[a]=function(){google.j.pl.push([a,arguments])}})(c)})(); window.google.sn="webhp";window.google.timers={load:{t:{start:(new Date).getTime()}}};try{window.google.pt=window.gtbExternal&&window.gtbExternal.pageT();}catch(u){}window.google.jsrt_kill=1; </script> <script> if(google.y)google.y.first=[];if(google.y)google.y.first=[];if(!google.xjs){google.dstr=[];google.rein=[];window.setTimeout(function(){var a=document.createElement("script");a.src="http://www.google.lv/extern_js/f/CgJsdhICbHYrMEU4ASwrMFo4ACwrMA44ACwrMBc4ACwrMCc4ACwrMDw4ACwrMFE4ACwrMAo4c0AdLCswFjgALCswGTgALCswJTjPiAEsKzAqOAssKzArOBEsKzA1OAQsKzBAOAAsKzBB OAAsKzBOOAYsKzBTOAAsKzBUOAAsKzAdOFosKzAYOAAsKzAmOAAsgAIXkAIe/oN7NrHz6woA.js";(document.getElementById("xjsd")||document.body).appendChild(a);if(google.timers&&google.timers.load.t)google.timers.load.t.xjsls=(new Date).getTime();},0); google.xjs=1}(function(){ function e(){if(typeof window.innerHeight=="number")return window.innerHeight;else if(document.documentElement&&document.documentElement.clientHeight)return document.documentElement.clientHeight;else if(document.body&&document.body.clientHeight)return document.body.clientHeight;return 0}function f(a,b,c){var d=a.offsetHeight?c-a.offsetHeight:c+10,k=b-d-10,h=Math.max(k,0);a.style.height=h+"px";return h}function g(a){if(google.sn!="webhp"){i(a);return}var b=document.getElementById("cpf");if(!b)return; f(b,e(),document.body.offsetHeight);var a=window.onresize;window.onresize=function(){f(b,e(),document.body.offsetHeight);if(a)a()};b.style.display="block";var c=b.getElementsByTagName("a")[0];if(!c.onclick)c.onclick=function(){var d="https://www.google.com/accounts/ServiceLogin?continue\x3dhttp://www.google.lv/webhp%3Fcplp%3D\x26hl\x3dlv";document.location=d.replace("cplp%3D","cplp%3D"+(new Date).getTime())}}function i(a){window.onresize=a;var b=document.getElementById("cpf");if(!b)return;b.style.display="none"}if(!window.google.cpld){var j=window.onresize;if(google.rein)google.rein.push(function(){g(j)}); if(google.dstr)google.dstr.push(function(){i(j)});g(j);window.google.cpld=true}; })(); </script> 2) Vietā, kur vēlamies redzēt ikonu klaviatūras izsaukšanai, ievietojam šādu kodu : - Kods:
-
<img src="http://www.google.lv/textinputassistant/tia.png" width=27 height=23 alt="" style="cursor:pointer;z-index:300" align="absmiddle" onclick="var s=document.createElement('script');s.src='http://www.google.lv/textinputassistant/0/lv_tia.js';google.append(s)"/> | |
|