Package org.itsnat.impl.core.browser

Examples of org.itsnat.impl.core.browser.Browser


        // de la edici�n inplace y en dicho �mbito lo que nos interesa realmente es que sen env�en
        // los eventos sobre todo el blur aunque sea al detectar un click fuera del control,
        // Obligamos a que el usuario pulse el control
        // si quiere verdadero foco (para que salga el teclado en m�viles etc) pero esto
        // no es ninguna tragedia.
        Browser browser = clientDoc.getBrowser();
        if (browser.isFocusOrBlurMethodWrong(methodName,(HTMLElement)elem))
            return getCallFormControlFocusBlurWithW3CEventCode((HTMLElement)elem,elemRef,methodName,clientDoc);
        else
            return super.getCallBlurFocusFormControlCode(elem,elemRef,methodName,clientDoc);
    }
View Full Code Here


    {
        if (isScriptOrScriptHoldMode())
        {
            // Modos SCRIPT y SCRIPT_HOLD

            Browser browser = response.getClientDocument().getBrowser();

            StringBuilder codeBuff = new StringBuilder();

            codeBuff.append("var elem = document.getElementById(\"" + scriptId + "\");\n"); // elem es el <script> cargador del script
            codeBuff.append("if (elem != null)"); // elem puede ser null cuando hay un timeout en el cliente y se ha eliminado el <script> y por alguna raz�n (extra�a) se ha cargado y ejecutado el script (REVISAR)
            codeBuff.append("{\n");

            codeBuff.append("  elem.executed = true;\n");
            if (error)
            {
                codeBuff.append("  elem.error = true;\n");
                codeBuff.append("  elem.code = " + JSRenderImpl.toTransportableStringLiteral(code,browser) + ";\n");
            }
            else
            {
                if (browser instanceof BrowserMSIEOld)
                {
                    // Esto es porque al eliminar en el cliente el <script> la funci�n JavaScript
                    // contenida se invalida
                    codeBuff.append("  elem.code = " + JSRenderImpl.toTransportableStringLiteral(code,browser) + ";\n");
                }
                else
                {
                    codeBuff.append("  elem.code = function (event,itsNatDoc)\n"); // Los mismos par�metros que processRespValid
                    codeBuff.append("   {\n");
                    codeBuff.append( code );
                    codeBuff.append("   };\n");
                }
            }

            codeBuff.append("}\n");

            code = codeBuff.toString();
        }

        if (code.length() == 0)
        {   // Este caso obviamente s�lo se dar� en eventos AJAX
            // por si acaso lo hacemos tambi�n con eventos SCRIPT
            ClientDocumentImpl clientDoc = response.getClientDocument();
            Browser browser = clientDoc.getBrowser();
            if ((browser instanceof BrowserWebKit) &&
                ((BrowserWebKit)browser).isAJAXEmptyResponseFails())
            {
                code = "          ";
            }
View Full Code Here

        super(clientDoc);
    }

    public static ClientMutationEventListenerHTMLImpl createClientMutationEventListenerHTML(ClientDocumentStfulImpl clientDoc)
    {
        Browser browser = clientDoc.getBrowser();
        if (browser instanceof BrowserMSIEOld)
            return new ClientMutationEventListenerHTMLMSIEOldImpl(clientDoc);       
        else if (browser instanceof BrowserBlackBerryOld)
            return new ClientMutationEventListenerHTMLBlackBerryOldImpl(clientDoc);
        else if (browser instanceof BrowserWebKit)
View Full Code Here

    public static JSRenderCommentImpl getJSRenderComment(Comment node,ClientDocumentStfulImpl clientDoc)
    {
        if (DOMUtilHTML.isHTMLCharacterData(node))
        {
            Browser browser = clientDoc.getBrowser();
            if (browser instanceof BrowserMSIEOld)
                return JSRenderHTMLCommentMSIEOldImpl.getJSRenderHTMLCommentMSIEOld((BrowserMSIEOld)browser);
            else
                return JSRenderCommentDefaultImpl.SINGLETON;
        }
View Full Code Here

        if (sync)
        {
            if (event.getPreventDefault())
            {
                ClientDocumentStfulImpl clientDoc = event.getClientDocumentStful();
                Browser browser = clientDoc.getBrowser();
                JSRenderItsNatDOMStdEventImpl render = JSRenderItsNatDOMStdEventImpl.getJSItsNatDOMStdEventRender((ClientItsNatDOMStdEventImpl)event,browser);
                retEvent.append( render.getPreventDefault("event.getNativeEvent()",clientDoc) );
            }

            if (event.getStopPropagation())
            {
                ClientDocumentStfulImpl clientDoc = event.getClientDocumentStful();
                Browser browser = clientDoc.getBrowser();
                JSRenderItsNatDOMStdEventImpl render = JSRenderItsNatDOMStdEventImpl.getJSItsNatDOMStdEventRender((ClientItsNatDOMStdEventImpl)event,browser);
                retEvent.append( render.getStopPropagation("event.getNativeEvent()",clientDoc) );
            }
        }
View Full Code Here

    }

    public void dispatchRequestListeners()
    {
        ClientDocumentStfulImpl clientDoc = getClientDocumentStful();
        Browser browser = clientDoc.getBrowser();
        if (clientDoc.canReceiveALLNormalEvents() &&
            browser.isCachedBackForwardExecutedScripts())
        {
            // Opera 9 y BlackBerryOld tienen este problema
            // Opera 9 soporta DOMContentLoaded
            // el cual se env�a *antes* del evento load, es importante porque Opera
            // no recarga la p�gina en un back/forward y la emisi�n de este evento
            // puede provocar la recarga de la p�gina, as� evitamos un fallo con load que es un evento
            // m�s normal que pueda usar el usuario.
            // Acerca de DOMContentLoad: http://developer.mozilla.org/en/docs/Gecko-Specific_DOM_Events
            // Alternativas: http://dean.edwards.name/weblog/2005/02/order-of-events/

            ItsNatStfulDocumentImpl itsNatDoc = getItsNatStfulDocument();
            Document doc = itsNatDoc.getDocument();

            OnLoadBackForwardListenerImpl listener = new OnLoadBackForwardListenerImpl();
            ParamTransport[] extraParam = OnLoadBackForwardListenerImpl.createExtraParams();
            String eventType;
            EventTarget target;
            if (browser.isClientWindowEventTarget())
            {
                if (browser.isDOMContentLoadedSupported())
                    eventType = "DOMContentLoaded";
                else
                    eventType = "load";
                target = (EventTarget)((DocumentView)doc).getDefaultView();
            }
View Full Code Here

        // se realizan en el constructor de RhinoInterpreter.java
        // evitando variables globales minimizamos el problema

        StringBuilder code = new StringBuilder();

        Browser browser = getClientDocumentStful().getBrowser();
        boolean enclosing = browser.isFunctionEnclosingByBracketSupported();

        if (enclosing)
            code.append("(function(){\n");

        code.append( getInitScriptContentCode(prevScriptsToRemove) + "\n" );
View Full Code Here

    protected String getInitJSDocumentCode(final int prevScriptsToRemove)
    {
        ClientDocumentStfulImpl clientDoc = getClientDocumentStful();
        ItsNatStfulDocumentImpl itsNatDoc = getItsNatStfulDocument();

        Browser browser = clientDoc.getBrowser();
        int browserType = browser.getTypeCode();
        int browserSubType = browser.getSubTypeCode();
        ItsNatSessionImpl itsNatSession = clientDoc.getItsNatSessionImpl();
        String token = itsNatSession.getToken();
        String sessionId = itsNatSession.getId();
        String clientId = clientDoc.getId();
        String servletPath = delegByBrowser.getServletPathForEvents();
View Full Code Here

    public boolean isUsingSVGWebFlash()
    {
        if (isForceFlash()) return true;

        Browser browser = clientDoc.getBrowser();
        if (browser instanceof BrowserW3C)
        {
            // En navegadores con SVG nativo (los soportados por SVGWeb menos MSIE)
            // y forceFlash desactivado al final el SVG es procesado nativamente
            // por lo que el envolver con <script type="image/svg+xml"> no sirve
View Full Code Here

    public void processEvent()
    {
        if (!processGlobalListeners())
        {
            ClientDocumentImpl clientDoc = request.getClientDocument();
            Browser browser = clientDoc.getBrowser();
            getItsNatServletResponse().addCodeToSend(OnLoadBackForwardListenerImpl.getReloadCode(browser));
        }

    }
View Full Code Here

TOP

Related Classes of org.itsnat.impl.core.browser.Browser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.