Changeset 11947
- Timestamp:
- 05/19/08 01:02:52 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/ldrize_cooperation.js
r10099 r11947 1 1 // Vimperator plugin: 'Cooperation LDRize Mappings' 2 // Version: 0.1 63 // Last Change: 08-Apr-2008. Jan 20082 // Version: 0.17 3 // Last Change: 19-May-2008. Jan 2008 4 4 // License: Creative Commons 5 5 // Maintainer: Trapezoid <trapezoid.g@gmail.com> - http://unsigned.g.hatena.ne.jp/Trapezoid … … 14 14 // LDRize Cooperation be Enable by default or not 15 15 // usage: let g:ldrc_enable = "false" 16 // default: true 17 // g:ldrc_isModHints 18 // Narrows "hinttags" based on Siteinfo. 19 // usage: let g:ldrc_isModHints = "true" 20 // default: false 16 21 // Mappings: 17 22 // Mappings for LDRize … … 38 43 // usage: :set noldrc 39 44 // 45 // 'ldrchints' 46 // Enable "Narrows Hinttags based on Siteinfo" 47 // usage: :set ldrchints 48 // 'noldrchints' 49 // Disable "Narrows Hinttags based on Siteinfo" 50 // usage: :set noldrchints 40 51 41 52 (function(){ … … 49 60 // wait: 5000 50 61 //}, 51 {52 handler: ['C:\\usr\\irvine\\irvine.exe',['%URL%']],53 },62 //{ 63 // handler: ['C:\\usr\\irvine\\irvine.exe',['%URL%']], 64 //}, 54 65 ]; 55 66 const DISABLE_ICON = 'data:image/png;base64,' … … 97 108 98 109 this.captureMappings = window.eval(liberator.globalVariables.ldrc_captureMappings) || ['j','k','p','o']; 110 this.isModHints = liberator.globalVariables.ldrc_isModHints != undefined ? 111 window.eval(liberator.globalVariables.ldrc_isModHints) : false ; 99 112 100 113 this.convertHandlerInfo(this.handlerInfo); … … 152 165 initLDRizeCooperationFuture: function(){ 153 166 var self = this; 167 168 var originalHinttags = liberator.options.hinttags; 169 var originalExtendedHinttags = liberator.options.hinttags; 170 171 function setHinttags(){ 172 if(self.isEnableLDRize() && self.isModHints){ 173 var siteinfo = self.LDRize.getSiteinfo(); 174 if(siteinfo.link && siteinfo.paragraph){ 175 liberator.options.hinttags = siteinfo.paragraph + "/" + siteinfo.link; 176 liberator.options.extendedhinttags = siteinfo.paragraph + "/" + siteinfo.link; 177 }else{ 178 liberator.options.hinttags = originalHinttags; 179 liberator.options.extendedhinttags = originalExtendedHinttags; 180 } 181 }else{ 182 liberator.options.hinttags = originalHinttags; 183 liberator.options.extendedhinttags = originalExtendedHinttags; 184 } 185 } 186 187 188 //Mappings 154 189 liberator.mappings.addUserMap([liberator.modes.NORMAL], [",f"], 155 190 "Focus on search field by LDRize", 156 191 function(){self.LDRize.bindFocus();} ,{}); 157 192 193 liberator.mappings.addUserMap([liberator.modes.NORMAL], ["f"], 194 "Start QuickHint mode", 195 function(){ 196 setHinttags(); 197 liberator.hints.show(liberator.modes.QUICK_HINT); 198 },{}); 199 200 liberator.mappings.addUserMap([liberator.modes.NORMAL], ["F"], 201 "Start QuickHint mode, but open link in a new tab", 202 function(){ 203 setHinttags(); 204 liberator.hints.show(liberator.modes.QUICK_HINT, "t"); 205 },{}); 206 207 liberator.mappings.addUserMap([liberator.modes.NORMAL], [";"], 208 "Start an extended hint mode", 209 function(arg){ 210 setHinttags(); 211 212 if(arg == "f") 213 liberator.hints.show(liberator.modes.ALWAYS_HINT, "o"); 214 else if(arg == "F") 215 liberator.hints.show(liberator.modes.ALWAYS_HINT, "t"); 216 else 217 liberator.hints.show(liberator.modes.EXTENDED_HINT, arg); 218 }, 219 { flags: liberator.Mappings.flags.ARGUMENT }); 158 220 //Commands 159 221 liberator.commands.addUserCommand(["pin"], "LDRize Pinned Links", … … 191 253 } 192 254 ); 255 liberator.options.add(['ldrchints'],'mod hinttags for LDRize','boolean',this.isModHints, 256 { 257 setter: function(value){ self.isModHints = value; }, 258 getter: function(){ return self.isModHints; } 259 } 260 ); 193 261 }, 194 262 convertHandlerInfo: function(handlerInfoArray){
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)