Changeset 24724 for lang/javascript

Show
Ignore:
Timestamp:
11/24/08 06:51:04 (5 years ago)
Author:
janus_wel
Message:

add constraint check

Location:
lang/javascript/vimperator-plugins/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/vimperator-plugins/trunk/blinkelement.js

    r24716 r24724  
    3939 * */ 
    4040 
    41 ( function () { 
     41// use setTimeout to synchronize ( wait to process highlight.js ) 
     42// "liberator.modules.plugins.highlighterFactory" is build by highlight.js . 
     43// it is the factory that build highlight object. 
     44setTimeout( function () { 
     45 
     46if (!plugins.highlighterFactory) { 
     47    liberator.log('blinkelement.js needs highlight.js', 0); 
     48    return; 
     49} 
    4250 
    4351// default settings 
     
    4654const defaultInterval = 800; 
    4755 
    48 // use setTimeout to synchronize ( wait to process highlight.js ) 
    49 // "liberator.modules.plugins.highlighterFactory" is build by highlight.js . 
    50 // it is the factory that build highlight object. 
    51 let highlighter; 
    52 setTimeout( function () { 
    53     highlighter = liberator.modules.plugins.highlighterFactory({ 
    54         color:    liberator.globalVariables.blink_element_color    || defaultColor, 
    55         opacity:  liberator.globalVariables.blink_element_opacity  || defaultOpacity, 
    56         interval: liberator.globalVariables.blink_element_interval || defaultInterval, 
    57     }); 
    58 }, 0); 
     56let highlighter = liberator.modules.plugins.highlighterFactory({ 
     57    color:    liberator.globalVariables.blink_element_color    || defaultColor, 
     58    opacity:  liberator.globalVariables.blink_element_opacity  || defaultOpacity, 
     59    interval: liberator.globalVariables.blink_element_interval || defaultInterval, 
     60}); 
    5961 
    6062// register commands 
     
    115117); 
    116118 
    117 })() 
     119}, 0); // setTimeout 
    118120 
    119121// vim: set sw=4 ts=4 et; 
  • lang/javascript/vimperator-plugins/trunk/mouseinspect.js

    r24716 r24724  
    3333 * */ 
    3434 
    35 ( function () { 
     35// use setTimeout to synchronize ( wait to process highlight.js ) 
     36// "liberator.modules.plugins.highlighterFactory" is build by highlight.js . 
     37// it is the factory that build highlight object. 
     38setTimeout( function () { 
     39 
     40if (!plugins.highlighterFactory) { 
     41    liberator.log('mouseinspect.js needs highlight.js', 0); 
     42    return; 
     43} 
    3644 
    3745// default settings 
     
    6068    'mouse', 
    6169    function () { 
    62         elementInfo.highlighter = liberator.modules.plugins.highlighterFactory({ 
     70        elementInfo.highlighter = plugins.highlighterFactory({ 
    6371            color:    liberator.globalVariables.mouse_inspect_color   || defaultColor, 
    6472            opacity:  liberator.globalVariables.mouse_inspect_opacity || defaultOpacity, 
     
    7987    {} 
    8088); 
    81 } )() 
     89 
     90}, 0); // setTimeout 
    8291 
    8392// vim: set sw=4 ts=4 et;