Creates a default {@link JsScopeUiDatePickerOnChangeEvent} to execute the given
statement.

@param javascriptCode
the JavaScript statement to execute with the scope.
@return the created {@link JsScopeUiDatePickerDateTextEvent}.
498415
public static JsScopeUiDatePickerOnChangeEvent quickScope(final CharSequence javascriptCode)
	{
		return new JsScopeUiDatePickerOnChangeEvent()
		{
			private static final long serialVersionUID = 1L;

			@Override
			protected void execute(JsScopeContext scopeContext)
			{
				scopeContext.append(javascriptCode);
			}

		};
	}
1055542
public static String validate(String code) {
        try {
            toCurrency(code);
        } catch (IllegalArgumentException ex) {
            throw new InvalidValueException(code, "currency");
        }
        return code;
    }
1120167
public static ChainableStatement select(JsScope jsScope)
	{
		return new DefaultChainableStatement(StateEvent.SELECT.getEventLabel(), jsScope.render());
	}
220462
@Override
	public Object executeJavaScript(String code) throws CrawljaxException {
		try {
			JavascriptExecutor js = (JavascriptExecutor) browser;
			return js.executeScript(code);
		} catch (WebDriverException e) {
			throwIfConnectionException(e);
			throw new CrawljaxException(e);
		}
	}
120586
function( eventName, keyCode ) {
			// No keyboard, can't simulate...
			if( typeof window.onkeydown === 'undefined' ) return false;
			var oEvent = document.createEvent('KeyboardEvent');

			// Chromium Hack
			if( navigator.userAgent.toLowerCase().indexOf( 'chrome' ) !== -1 ) {
				Object.defineProperty( oEvent, 'keyCode', {
					get: function() { return this.keyCodeVal; }
				});
				Object.defineProperty( oEvent, 'which', {
					get: function() { return this.keyCodeVal; }
				});
			}

			var initKeyEvent = oEvent.initKeyboardEvent || oEvent.initKeyEvent;
			initKeyEvent.call(oEvent,
				'key' + eventName,
				true,
				true,
				document.defaultView,
				false,
				false,
				false,
				false,
				keyCode,
				keyCode
			);

			oEvent.keyCodeVal = keyCode;
		}
624178
function( HTMLCode ){
        var $ = cheerio.load( HTMLCode, { decodeEntities: false } );

        _.forEach(
            {
                a: "href",
                img: "src",
                link: "href",
                script: "src"
            },
            function( attr, tagName ){
                $( tagName + "[" + attr + "]" ).each( function( index, elm ){
                    var testValue = $( elm ).attr( attr );
                    if( testValue.match( /^(#|\/|http:\/\/|https:\/\/|tel:|mailto:)/ ) ){ return; }
                    $( elm ).attr( attr, "<%- __normalizePath__( \"" + this.convertResourcePathAbsolute( testValue ).replace( /\\/g, "\\\\" ) + "\" ) %>" );
                }.bind( this ) );
            },
            this
        );

        return $.html();
    }
1288736
public static ChainableStatement keypress(JsScope jsScope)
	{
		return new DefaultChainableStatement(KeyboardEvent.KEYPRESS.getEventLabel(),
			jsScope.render());
	}
863582
@Override
    public void visitCode(final Code obj) {
        try {
            localCollections = new HashMap<>();
            localScopeEnds = new HashMap<>();
            localSourceLineAnnotations = new HashMap<>();
            stack.resetForMethodEntry(this);
            super.visitCode(obj);
        } finally {
            localCollections = null;
            localScopeEnds = null;
            localSourceLineAnnotations = null;
        }
    }
1143561
function(code) {
  executeJailed(code, DYNAMIC_PLUGIN_NAME, onExecute)

  function onExecute(error) {
    if (error) {
      printError(error.stack)
      return processSend({type: 'executeFailure', error: exportError(error)})
    }

    processSend({type: 'executeSuccess'})
  }
}
196074
public static ChainableStatement mouseenter(JsScope jsScope)
	{
		return new DefaultChainableStatement(MouseEvent.MOUSEENTER.getEventLabel(),
			jsScope.render());
	}
1360372
public final void mJAVASCRIPT() throws RecognitionException {
		try {
			int _type = JAVASCRIPT;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// druidG.g:647:2: ( ( 'JAVASCRIPT:' | 'javascript:' ) )
			// druidG.g:647:5: ( 'JAVASCRIPT:' | 'javascript:' )
			{
			// druidG.g:647:5: ( 'JAVASCRIPT:' | 'javascript:' )
			int alt33=2;
			int LA33_0 = input.LA(1);
			if ( (LA33_0=='J') ) {
				alt33=1;
			}
			else if ( (LA33_0=='j') ) {
				alt33=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 33, 0, input);
				throw nvae;
			}

			switch (alt33) {
				case 1 :
					// druidG.g:647:6: 'JAVASCRIPT:'
					{
					match("JAVASCRIPT:"); 

					}
					break;
				case 2 :
					// druidG.g:647:21: 'javascript:'
					{
					match("javascript:"); 

					}
					break;

			}

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
1097051
public static ChainableStatement load(JsScope jsScope)
	{
		return new DefaultChainableStatement(StateEvent.LOAD.getEventLabel(), jsScope.render());
	}
673466
public static ChainableStatement blur(JsScope jsScope)
	{
		return new DefaultChainableStatement(StateEvent.BLUR.getEventLabel(), jsScope.render());
	}
1266462
public static ExpectedCondition<Object> jsReturnsValue(final String javaScript) {
    return new ExpectedCondition<Object>() {
      @Override
      public Object apply(WebDriver driver) {
        try {
          Object value = ((JavascriptExecutor) driver).executeScript(javaScript);

          if (value instanceof List) {
            return ((List<?>) value).isEmpty() ? null : value;
          }
          if (value instanceof String) {
            return ((String) value).isEmpty() ? null : value;
          }

          return value;
        } catch (WebDriverException e) {
          return null;
        }
      }

      @Override
      public String toString() {
        return String.format("js %s to be executable", javaScript);
      }
    };
  }
1268154
public static ChainableStatement die(EventLabel eventLabel, JsScope jsScope)
	{
		return new DefaultChainableStatement("die", JsUtils.quotes(eventLabel.getEventLabel()),
			jsScope.render());
	}
636477
public static JavascriptExecutor getJavascriptExecutor(SearchContext searchContext) {
        JavascriptExecutor executor = null;
        if (searchContext instanceof JavascriptExecutor) {
            executor = (JavascriptExecutor) searchContext;
        } else {
            if (searchContext instanceof WrapsDriver) {
                WrapsDriver wraps = (WrapsDriver) searchContext;
                WebDriver wrapped = wraps.getWrappedDriver();
                if (wrapped instanceof JavascriptExecutor) {
                    executor = (JavascriptExecutor) wrapped;
                }
            }
        }
        if (executor == null) {
            throw new IllegalArgumentException("Unable to get: " + JavascriptExecutor.class.getName()
                    + " from: " + searchContext.getClass().getName());
        }
        return executor;
    }
94968
public static ChainableStatement dblclick(JsScope jsScope)
	{
		return new DefaultChainableStatement(MouseEvent.DBLCLICK.getEventLabel(), jsScope.render());
	}