Changeset 35854 for websites/modoki
- Timestamp:
- 11/05/09 15:00:33 (4 years ago)
- Files:
-
- 1 modified
-
websites/modoki/index.html (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
websites/modoki/index.html
r35849 r35854 239 239 } 240 240 this.keyHandler = { 241 ' j' : function(){ _self.down(); },241 'J' : function(){ _self.down(); }, 242 242 'DOWN' : function(){ _self.down(); }, 243 ' k' : function(){ _self.up(); },243 'K' : function(){ _self.up(); }, 244 244 'UP' : function(){ _self.up(); }, 245 ' s' : function(){ _self.fav(); },246 ' e' : function(){ _self.open_url(); },247 ' r' : function(){ _self.reply(); },248 ' n' : function(){ _self.nextTab(); },245 'S' : function(){ _self.fav(); }, 246 'E' : function(){ _self.open_url(); }, 247 'R' : function(){ _self.reply(); }, 248 'N' : function(){ _self.nextTab(); }, 249 249 'RIGHT' : function(){ _self.nextTab(); }, 250 ' p' : function(){ _self.prevTab(); },250 'P' : function(){ _self.prevTab(); }, 251 251 'LEFT' : function(){ _self.prevTab(); }, 252 252 'ENT' : function(){ _self.reply(); }, 253 253 'R' : function(){ _self.retween(); }, 254 254 ' ' : function(){ _self.searchLastUnread(); }, 255 ' gg' : function(){ _self.searchTop(); },256 ' G': function(){ _self.searchLast(); },257 ' a' : function(){ _self.clearUnread(); },255 'GG' : function(){ _self.searchTop(); }, 256 'S-G' : function(){ _self.searchLast(); }, 257 'A' : function(){ _self.clearUnread(); }, 258 258 'C-H' : function(){ _self.openHome(); }, 259 259 'C-E' : function(){ _self.openTwid(); } … … 261 261 this._altanative = (new Date).getTime(); 262 262 this._crosspost = 0; 263 this._version = '0.5 3';263 this._version = '0.55'; 264 264 this._max_id = 0; 265 265 this.p_name = ''; … … 268 268 this._outputz_secret = this.readCookie('outputz_secret'); 269 269 this._footer_message = this.readCookie('footer_message'); 270 this._user_name = this.readCookie('user_name');271 this._user_pass = this.readCookie('user_pass');272 270 this.nt; 273 271 this.keyChoice = []; … … 278 276 'Option': { 'selected' : false, 'func' : function(){ _self.showOptionArea(); } } 279 277 }; 280 281 282 278 }, 283 279 … … 287 283 this.firstStroke = {}; 288 284 for( var key in this.keyHandler ){ 289 if( key.length > 1 ){285 if( key.length > 1 && !(/DOWN|LEFT|RIGHT|UP|ENT|TAB|BS|ESC|S-|A-|C-/.test(key))){ 290 286 this.firstStroke[key[0]] = 'sw'; 291 287 } 292 288 } 293 289 var keybind = function(e){ 294 if( e.target.tagName == 'INPUT' || e.target.tagName == 'TEXTAREA') return;290 if( /INPUT|TEXTAREA/.test(e.target.tagName) ) return; 295 291 var keyCode = (e.which || e.keyCode); 296 var pressKey = (e.ctrlKey?'C-':'') + (e.altKey?'A-':'') + ((typeof _self.specialkey[keyCode] == 'undefined' )?String.fromCharCode(keyCode) : _self.specialkey[keyCode]);297 _self.keyChoice.push(pressKey);292 var pressKey = (e.ctrlKey?'C-':'') + (e.altKey?'A-':'') + (e.shiftKey?'S-':'') + ((typeof _self.specialkey[keyCode] == 'undefined' )?String.fromCharCode(keyCode) : _self.specialkey[keyCode]); 293 if( window.opera ){ pressKey = pressKey.toUpperCase(); } 298 294 if( _self.firstStroke[pressKey] == 'sw' ){ //w stroke bind 295 _self.keyChoice.push(pressKey); 299 296 if( typeof _self.keyHandler[_self.keyChoice.join('')] != 'function' ){ 300 _self.keyChoice.length = 0;301 _self.keyChoice.push(pressKey);302 297 e.preventDefault(); 303 298 return; … … 308 303 if( typeof _self.keyHandler[pressKey] != 'function' ) return; 309 304 try{ 310 _self.keyChoice.length = 0;311 e.preventDefault(); //Stop Default Event312 _self.keyHandler[pressKey].apply();305 _self.keyChoice.length = 0; //clear keychoice 306 e.preventDefault(); //Stop Default Event 307 _self.keyHandler[pressKey].apply(); 313 308 }catch(d){} 314 309 }; 315 window.addEventListener('keypress', keybind, false); 310 //opera can't stop default event in keydown events. 311 window.addEventListener((window.opera) ? 'keypress' : 'keydown', function(e){ keybind(e); }, false ); 316 312 }, 317 313 … … 357 353 footer_message.value = this._footer_message; 358 354 } 359 360 //user name361 _option_area.appendChild(d.createElement('br'));362 _option_area.appendChild(d.createTextNode('user name '));363 var user_name = _option_area.appendChild(d.createElement('input'));364 user_name.id = 'user_name';365 user_name.type = 'text';366 if( this._user_name != '' ){367 user_name.value = this._user_name;368 }369 370 //user pass371 _option_area.appendChild(d.createElement('br'));372 _option_area.appendChild(d.createTextNode('user pass '));373 var user_pass = _option_area.appendChild(d.createElement('input'));374 user_pass.id = 'user_pass';375 user_pass.type = 'password';376 if( this._user_pass != '' ){377 user_pass.value = this._user_pass;378 }379 380 355 381 356 _option_area.appendChild(d.createElement('br')); … … 473 448 } 474 449 475 var saveDatas = ['outputz_secret', 'footer_message' , 'user_name', 'user_pass'];450 var saveDatas = ['outputz_secret', 'footer_message' ]; 476 451 for( var i=0, l=saveDatas.length; i<l; i++ ){ 477 452 write_datas(saveDatas[i]); 478 453 } 454 455 var fl_str = ''; 456 for( var i=0, l=this.followers.length; i<l; i++ ){ 457 fl_str += this.followers[i] + ','; 458 } 459 fl_str = fl_str.substring(0, fl_str.length-1); 460 479 461 }, 480 462 readCookie : function(key){ … … 780 762 twAuth : function(){ 781 763 var url = 'https://twitter.com/account/verify_credentials.json?callback=ta'; 782 if( this._user_name.length !=0 && this._user_pass.length != 0 ){783 var str = 'https://' + this._user_name + ':' + this._user_pass + '@';784 url = url.replace('https://',str);785 }786 764 this.getJSON(url); 787 765 }, … … 806 784 modoki.p_name = data.screen_name; 807 785 modoki.p_id = data.id; 808 modoki.twFollower(data.id); 786 if( modoki.followers.length == 0 ){ 787 modoki.twFollower(data.id); 788 }else{ 789 stLoad(); 790 } 809 791 }; 810 792 … … 812 794 modoki.followers=data.sort(); 813 795 modoki.followers.push(modoki.p_id); 796 stLoad(); 797 }; 798 799 var stLoad = function(){ 814 800 document.getElementById('time_line').innerHTML = ''; 815 801 modoki.loadTimeLine(); … … 824 810 firstTime(); 825 811 modoki.loop = setInterval( function(){ modoki.loadTimeLine(); }, 45000 ); 826 827 812 }; 828 813
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)