⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ig.js

📁 从igoogle上down下来的拖曳代码,实现拖曳布局保存到数据库
💻 JS
📖 第 1 页 / 共 5 页
字号:
this.app_name+"._del("+d+')" class="delbox"style="float:left;margin:1px 3px 0px 0px;"></a>'+c[d].w()+"<br>"}if(parseInt(c[d]._uid,10)<0){b+=c[d].i(d)}}}var e=this.deleted,f="";for(var d=0;d<e.length;d++){if(parseInt(e[d]._uid,10)>=0){f+=","+e[d]._uid}}a+=this.S(b,f);return a};_ListApp.prototype.S=function(a,b){var c="<input type=hidden name=m_"+this.module_id+'_add value="'+a+'"><input type=hidden name=m_'+this.module_id+'_del value="'+b+'">';if(_old_html){c="</table><input type=hidden name=m_"+this.module_id+'_add value="'+a+'"><input type=hidden name=m_'+this.module_id+'_del value="'+b+'">'}return c};_ListApp.prototype.refresh=function(){this.items.sort(this.sort);this.display_area.innerHTML="<font size=-1>"+this.na()+"</font>"};_ListApp.prototype.add=function(a,b){if(!a){a=_trim(this.name_input_field.value)}if(!b){b=_trim(this.value_input_field.value)}var c=new this.item_constructor(a,b,-1);if(!c.s())return;this.items[this.items.length]=c;this.refresh();this.name_input_field.value=this.default_name;this.value_input_field.value=this.default_value};_ListApp.prototype._del=function(a){this.deleted[this.deleted.length]=this.items[a];this.items.splice(a,1);this.refresh()};function _PrefListApp(a,b,c,d,e){var f=typeof c=="string"?[]:c,g=new _ListApp(f,d,e);for(var h in g){this[h]=g[h]}if(typeof c=="string"){this.ma(c)}this.prefidx=a;this.prefname=b;this.app_name="m_"+e+"_"+a+"_App";this.display_area=_gel("m_"+e+"_"+a+"_disp");this.value_input_field=_gel("m_"+e+"_"+a+"_val");this.name_input_field=this.value_input_field;this.default_name="";this.default_value="";this.S=_PrefListApp_get_tail}function _PrefListApp_get_tail(a,b){var c="</table>";_gel("m_"+this.module_id+"_"+this.prefidx).value=this.ra();return c}_PrefListApp.prototype.ma=function(a){if(a.length==0){return}var b=_IG_Prefs._strToArray(a),c=[];for(var d=0;d<b.length;d++){var e=new this.item_constructor(b[d],b[d],-1);c[c.length]=e}this.items=c;this.prev_items=[].concat(c)};_PrefListApp.prototype.ra=function(){var a=[];for(var b=0;b<this.items.length;b++){a[a.length]=this.items[b]._v}return _IG_Prefs._arrayToStr(a)};function _ListItem(a,b,c){this._n=a;this._v=b;this._uid=c}_ListItem.prototype.s=function(){return this._n!=""};_ListItem.prototype.p=function(a){return 0};_ListItem.prototype.w=function(){return _hesc(this._n)};_ListItem.prototype.i=function(a){return"&"+_esc(this._n)+"="+_esc(this._v)};function _BMListItem(a,b,c){_ListItem.call(this,a,b,c)}ig_a(_ListItem,_BMListItem);_BMListItem.prototype.s=function(){return _ListItem.prototype.s.call(this)&&this._n!="http://"};_BMListItem.prototype.D=function(){if(this._v){return this._v}else{var a=this._n;if(a.indexOf("http://")==0){a=a.substring(7)}if(a.indexOf("www.")==0){a=a.substring(4)}return a}};_BMListItem.prototype.w=function(){return'<a href="'+this._n+'" target=bmwindow>'+_hesc(this.D())+"</a>"};_BMListItem.prototype.i=function(a){return"&b"+a+"="+_esc(this._n)+"&t"+a+"="+_esc(this._v)};_BMListItem.prototype.p=function(a){var b=_uc(this.D()),c=_uc(a.D());if(b==c)return 0;return b<c?-1:1};function _WthrListItem(a,b,c){_ListItem.call(this,a,b,c)}ig_a(_ListItem,_WthrListItem);_WthrListItem.prototype.i=function(a){var b="&"+_esc(this._n);if(this._v){b+="="+_esc(this._v)}return b};function _FListItem(a,b,c,d){_ListItem.call(this,a,b,c);this._s=d||0}ig_a(_ListItem,_FListItem);_FListItem.prototype.i=function(a){return"&"+_esc(this._n)};_FListItem.prototype.p=function(a){var b=this;if(b._s<a._s)return-1;if(b._s>a._s)return 1;var c=_uc(b._n),d=_uc(a._n);if(c<d)return-1;if(c>d)return 1;return 0};var ig_v={Q:0,sa:1800,W:null,V:null,da:true,F:null,H:function(){ig_v.Q=(new Date).getTime()+ig_v.sa*1000},Oa:function(){if((new Date).getTime()>ig_v.Q){_testConnection(function(){_reload(ig_v.Q)},ig_v.H)}},Y:function(a){ig_v.H();if(ig_v.W){ig_v.W(a)}},X:function(a){ig_v.H();if(ig_v.V){ig_v.V(a)}}};function _IG_disable_refresh_cycle(){ig_v.da=false;if(ig_v.F!=null){clearInterval(ig_v.F);ig_v.F=null}}function _IG_start_refresh_cycle(a,b){if(ig_v.da){ig_v.W=document.onmousedown;ig_v.V=document.onkeyup;ig_v.sa=a;if(document.addEventListener){document.addEventListener("keyup",ig_v.X,false);document.addEventListener("mousedown",ig_v.Y,false)}else if(document.attachEvent){document.attachEvent("onkeyup",ig_v.X);document.attachEvent("onmousedown",ig_v.Y)}else{document.onkeyup=ig_v.X;document.onmousedown=ig_v.Y}ig_v.H();ig_v.F=setInterval(ig_v.Oa,b*1000)}}function _testConnection(a,b,c){var d=ig_b(),e="/ig/nop?t="+(new Date).getTime();if(!c)c=3500;d.open("GET",e,true);d.onreadystatechange=function(){if(d.readyState==4&&a){if(200<=d.status&&d.status<300||d.status==1223){b=null;a()}}};try{d.send(null)}catch(f){}var g=function(){if(b){a=null;b()}};setTimeout(g,c)}function _mailWindow(a){window.open(a,"mailwindow","width=400,height=340,left=50,top=50,scrollbars=no")}function ig_w(a){if(!a){a=document.body}return a.scrollHeight>a.offsetHeight?a.scrollHeight:a.offsetHeight}function ig_ja(){if(self.pageYOffset){return self.pageYOffset}else if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}else{return document.body.scrollTop}}function _setHomepage(a,b){var c=_gel("hp_url").innerHTML;a.style.behavior="url(#default#homepage)";a.setHomePage(c);_sendx("/ig/ui?action=sethomepage&url="+_esc(c)+"&type="+b+"&confirmed="+(ig_x()?1:0),null,false,null)}function ig_x(){var a=_gel("shp"),b=_gel("hp_url").innerHTML;return a.isHomePage(b)}function _maybeShowSetHPMsg(){if(!ig_x()){_gel("set_homepage_msg").style.display="inline";if(_gel("new_user_demo")!=null){_gel("new_user_demo").style.display="none"}}}function _hideSetHPMsg(){if(_gel("set_homepage_msg")!=null){_gel("set_homepage_msg").style.display="none"}if(_gel("new_user_demo")!=null){_gel("new_user_demo").style.display="block"}}function _maybeShowSetHPFooter(){if(!ig_x()){_gel("set_homepage_footer").style.display="block"}};function _IG_GetCachedUrl(a,b){var c;if(typeof b=="object"){c=b}else{c={}}var d=window.location.href,e="/ig/proxy?",f=/^http:\/\/[^\/]+\/ig\/ifr[?]/,g=f.exec(d);if(g){if(window.location.host!="p.gmodules.com"&&_et){e+="et="+_esc(_et)+"&"}}else{e="http://p.gmodules.com/ig/proxy?"}if(!isNaN(c.refreshInterval)&&c.refreshInterval>=0){e=_appendMaxAgeParameter(e,c.refreshInterval)}return e+"url="+_esc(a)}function _IG_GetImageUrl(a,b){return _IG_GetCachedUrl(a,b)}function _IG_GetImage(a,b){var c=document.createElement("img");c.src=_IG_GetCachedUrl(a,b);return c};function _IG_Callback(a,b,c,d,e,f){var g=arguments;return function(){var h=[];for(var i=0;i<arguments.length;i++){h[h.length]=arguments[i]}for(var i=1;i<g.length;i++){h[h.length]=g[i]}a.apply(null,h)}};var ig_ka={domload:1,xsetpdone:1,moduledragstart:1,moduledragend:1,moduletitleclick:1,moduleedit:1,modulecanceledit:1,moduledelete:1,moduleundelete:1,modulezip:1,moduleunzip:1,modulemaximize:1,moduleunmaximize:1,load:1,unload:1,resize:1},ig_la={dragstart:1,dragend:1,titleclick:1,edit:1,canceledit:1,"delete":1,undelete:1,zip:1,unzip:1,maximize:1,unmaximize:1};function ig_ma(a){var b="ig_event_hashcode_";if(a.hasOwnProperty&&a.hasOwnProperty(b)){return a[b]}if(!a[b]){a[b]=++ig_y.Ja}return a[b]}function ig_na(a){return"builtin_"+a}function ig_oa(a,b){if(a.indexOf&&a.indexOf("m_")==0){a=a.substring(2)}return"builtin_m"+a+"_"+b}function ig_pa(a,b){return"builtin_"+ig_y.Fa(a)+"_"+b}function ig_qa(a){return"custom_"+a}function ig_ra(){for(var a in ig_y.b){for(var b=0;b<ig_y.b[a].length;b++){ig_y.b[a][b]=null}if(a in ig_y.B){var c=ig_y.B[a],d=c[0],e=c[1],f=c[2];if(d.removeEventListener){d.removeEventListener(e,f,false)}else if(d.detachEvent){d.detachEvent("on"+e,f)}ig_y.B[a]=null}}}function ig_sa(a,b,c){for(var d=c;d<b.length;d++){a[a.length]=b[d]}return a}function ig_ta(a,b){if(a in ig_y.b){for(var c=0;c<ig_y.b[a].length;c++){if(ig_y.b[a][c]===b){ig_y.b[a][c]=null;return true}}}return false}function ig_ua(a,b){if(a in ig_y.b){for(var c=0;c<ig_y.b[a].length;c++){if(ig_y.b[a][c]){var d=[];for(var e=1;e<arguments.length;e++){d[d.length]=arguments[e]}ig_y.b[a][c].apply(this,d)}}}}function ig_va(a,b){if(!(a in ig_y.Ta)){throw Error("Unsupported event type: "+a);}var c=ig_y.N(a);if(!(c in ig_y.b)){ig_y.b[c]=[]}ig_y.b[c][ig_y.b[c].length]=b}function ig_wa(a,b,c){if(!(b in ig_y.Ua)){throw Error("Unsupported module event type: "+b);}var d=ig_y.O(a,b);if(!(d in ig_y.b)){ig_y.b[d]=[]}ig_y.b[d][ig_y.b[d].length]=c}function ig_xa(a,b,c){var d=ig_y.fa(a,b);if(!(d in ig_y.b)){ig_y.b[d]=[];var e=function(g){if(!g)g=window.event;ig_y.I.apply(a,[d,g])};if(a.addEventListener){a.addEventListener(b,e,false)}else if(a.attachEvent){a.attachEvent("on"+b,e)}else{throw Error("Object {"+a+"} does not support DOM events.");}ig_y.B[d]=[a,b,e]}var f=ig_y.b[d].length;if(a===window&&b=="unload"&&f>0){ig_y.b[d][f]=ig_y.b[d][f-1];ig_y.b[d][f-1]=c}else{ig_y.b[d][f]=c}}function ig_ya(a,b){var c=ig_y.M(a);if(!(c in ig_y.b)){ig_y.b[c]=[]}ig_y.b[c][ig_y.b[c].length]=b}function ig_za(a,b){var c=ig_y.N(a);return ig_y.G(c,b)}function ig_Aa(a,b,c){var d=ig_y.O(a,b);return ig_y.G(d,c)}function ig_Ba(a,b,c){var d=ig_y.fa(a,b);return ig_y.G(d,c)}function ig_Ca(a,b){var c=ig_y.M(a);return ig_y.G(c,b)}function ig_Da(a,b){var c=ig_y.t([ig_y.N(a)],arguments,1);ig_y.I.apply(window,c)}function ig_Ea(a,b){var c=ig_y.t([],arguments,0);setTimeout(function(){ig_y.triggerEvent.apply(window,c)},0)}function ig_Fa(a,b,c){var d=ig_y.t([ig_y.O(a,b)],arguments,2);ig_y.I.apply(window,d)}function ig_Ga(a,b,c){var d=ig_y.t([],arguments,0);setTimeout(function(){ig_y.triggerModuleEvent.apply(window,d)},0)}function ig_Ha(a,b){var c=ig_y.t([ig_y.M(a)],arguments,1);ig_y.I.apply(window,c)}function ig_Ia(a,b){var c=ig_y.t([],arguments,0);setTimeout(function(){ig_y.triggerCustomEvent.apply(window,c)},0)}var ig_y={Ja:0,b:{},B:{},Ta:ig_ka,Ua:ig_la,Fa:ig_ma,N:ig_na,O:ig_oa,fa:ig_pa,M:ig_qa,Ca:ig_ra,t:ig_sa,G:ig_ta,I:ig_ua,addEventHandler:ig_va,addModuleEventHandler:ig_wa,addDOMEventHandler:ig_xa,addCustomEventHandler:ig_ya,removeEventHandler:ig_za,removeModuleEventHandler:ig_Aa,removeDOMEventHandler:ig_Ba,removeCustomEventHandler:ig_Ca,triggerEvent:ig_Da,triggerModuleEvent:ig_Fa,triggerCustomEvent:ig_Ha,triggerDelayedEvent:ig_Ea,triggerDelayedModuleEvent:ig_Ga,triggerDelayedCustomEvent:ig_Ia},_IG_AddEventHandler=ig_y.addEventHandler,_IG_AddModuleEventHandler=ig_y.addModuleEventHandler,_IG_AddGadgetEventHandler=ig_y.addModuleEventHandler,_IG_AddDOMEventHandler=ig_y.addDOMEventHandler,_IG_AddCustomEventHandler=ig_y.addCustomEventHandler,_IG_RemoveEventHandler=ig_y.removeEventHandler,_IG_RemoveModuleEventHandler=ig_y.removeModuleEventHandler,_IG_RemoveGadgetEventHandler=ig_y.removeModuleEventHandler,_IG_RemoveDOMEventHandler=ig_y.removeDOMEventHandler,_IG_RemoveCustomEventHandler=ig_y.removeCustomEventHandler,_IG_TriggerEvent=ig_y.triggerEvent,_IG_TriggerModuleEvent=ig_y.triggerModuleEvent,_IG_TriggerGadgetEvent=ig_y.triggerModuleEvent,_IG_TriggerCustomEvent=ig_y.triggerCustomEvent,_IG_TriggerDelayedEvent=ig_y.triggerDelayedEvent,_IG_TriggerDelayedModuleEvent=ig_y.triggerDelayedModuleEvent,_IG_TriggerDelayedGadgetEvent=ig_y.triggerDelayedModuleEvent,_IG_TriggerDelayedCustomEvent=ig_y.triggerDelayedCustomEvent;_IG_AddDOMEventHandler(window,"unload",ig_y.Ca);_IG_AddDOMEventHandler(window,"load",function(){_IG_TriggerEvent("load")});_IG_AddDOMEventHandler(window,"unload",function(){_IG_TriggerEvent("unload")});_IG_AddDOMEventHandler(window,"resize",function(){_IG_TriggerEvent("resize")});function _IG_RegisterOnloadHandler(a){_IG_AddEventHandler("domload",a)}function _IG_LoadLibraryDeferred(a,b){_IG_RegisterOnloadHandler(function(){_IG_LoadScript(a,b)})}_exportSymbols("google.gadgets.Events",["addHandler",_IG_AddEventHandler,"removeHandler",_IG_RemoveEventHandler,"addOnloadHandler",_IG_RegisterOnloadHandler]);function _IG_RegisterMaximizeHandler(a,b){_IG_AddModuleEventHandler(a,"unmaximize",function(){b(false)});_IG_AddModuleEventHandler(a,"maximize",function(){b(true)})};var _currentLayout,_layoutData,_IG_Layouts={savedModulePositions:null};_IG_Layouts._selectLayout=function(a){var b=_gel("edit_this_tab_form").edit_this_tab_selected_layout;for(var c=0;c<b.length;c++){var d=b[c].value,e=_gel("edit_this_tab_layoutimg_"+d);if(d!=a){b[c].checked=false;if(e.src.indexOf("_highlight")!=-1){e.src=e.src.substring(0,e.src.indexOf("_highlight"))+".gif"}}else{b[c].checked=true;if(e.src.indexOf("_highlight")==-1){e.src=e.src.substring(0,e.src.indexOf(".gif"))+"_highlight.gif"}}}};_IG_Layouts._renderLayout=function(a){if(!_IG_Layouts.isLayoutValid(a)){return false}var b=_IG_Layouts.getColumnsInOrder(),c=_layoutData[a],d=false;for(var e=0;e<b.length;e++){b[e].style.width=c.sizes[e];if(b[e].style.display!=c.display[e]){b[e].style.display=c.display[e];d=true}}if((a==_currentLayout||d)&&!_IG_Layouts.rearrangeModules(a)){return false}return true};_IG_Layouts.rearrangeModules=function(a){if(!_IG_Layouts.isLayoutValid(a)){return false}var b=_IG_Layouts.getColumnsInOrder(),c=_gel("lc_opt"),

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -