HTML5 Editable Textfield PlugIn

  • Hi,

    i find the same in 1.19pr16

    *confused*

    EDIT:
    i took out some 'out quoted' stuff like: /* bla bla bla */ and now it works..
    Is there a bug on the quoting?

    Tuur *thumbsup*

  • /*
    function setfocus(){
    if(arguments.length<1)return;
    if(arguments[0]==='true')inputelement.focus();
    else inputelement.blur();
    }

    i've used the other solution...

    Code
    inputelement.addEventListener('touchstart',text_click, false);
    
    
    function text_click()
    {
    inputelement.focus();
    }
  • i've used the other solution...

    Code
    inputelement.addEventListener('touchstart',text_click, false);
    
    
    function text_click()
    {
    inputelement.focus();
    }


    /*
    krpano - super simple html5 text input plugin
    */

    var krpanoplugin = function()
    {
    var local = this;

    var krpano = null;
    var plugin = null;

    var inputelement = null;

    local.registerplugin = function(krpanointerface, pluginpath, pluginobject)
    {
    krpano = krpanointerface;
    plugin = pluginobject;

    inputelement = document.createElement("input");
    inputelement.type = "text";
    inputelement.style.width = "100%";
    inputelement.style.height = "100%";
    inputelement.style.color = "#535349";
    inputelement.style.fontFamily = "Verdana";
    inputelement.style.fontSize = "12px";

    plugin.registerattribute("text", "", text_set, text_get);
    plugin.registerattribute("onchanged", null);

    inputelement.addEventListener("change", text_changed, true);
    inputelement.addEventListener('touchstart',text_click, false);

    plugin.sprite.appendChild(inputelement);
    }

    local.unloadplugin = function()
    {
    plugin = null;
    krpano = null;
    }

    function text_set(newtext)
    {
    inputelement.value = newtext;
    }

    function text_get()
    {
    return inputelement.value;
    }

    function text_changed()
    {
    krpano.call(plugin.onchanged, plugin);
    }

    function text_click()
    {
    inputelement.focus();

    }
    };

    this is code is not working((( focus is not set *sad*

  • Hi folks,

    long time no see, but still active *g*

    The focus-problem drove me nuts, so here is my solution, which also works on Androids without holding the finger for 2 seconds on the screen.
    Woks just fine for me, so hopefully for you too *smile*
    Thanks again to Klaus, for this script! Hopefully we will see a more advanced version some day *love*

    Best regards,
    Nupsi

    Einmal editiert, zuletzt von Nupsi (28. September 2021 um 10:39)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!