Navigation

    The Onewheel Forum

    Onewheel Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Rules
    • Archive

    Archive Search

    Report A Problem
    3
    8
    223
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S. Leon
      S. Leon Plus V1 DIY XR last edited by

      For me the search function in the Archive is frustrating. Simply entering one character it launches into a search -- not accepting another character until the results are in -- then the same with each additional character.

      Lia B 2 Replies Last reply Reply Quote 2
      • Lia
        Lia GT XR Pint Plus V1 DIY @S. Leon last edited by

        @s-leon That sounds irritating. I'll see if I can adjust the code to only run if you click a button x

        B 1 Reply Last reply Reply Quote 1
        • B
          biell Plus GT DIY @Lia last edited by

          @lia We can also add a delay, so it delays a second or two between filter passes, allowing you time to type multiple characters. This should help for slower computers.

          B 1 Reply Last reply Reply Quote 3
          • B
            biell Plus GT DIY @S. Leon last edited by

            @s-leon What browser do you use?

            S. Leon 1 Reply Last reply Reply Quote 3
            • S. Leon
              S. Leon Plus V1 DIY XR @biell last edited by S. Leon

              @biell -- The browser is SILK on an old Amazon Fire kindle.
              @Lia -- Being able to type in the character string, then press enter to run the search would, indeed, be nice -- thank you!

              1 Reply Last reply Reply Quote 2
              • B
                biell Plus GT DIY @biell last edited by biell

                @Lia This is one, very simple change as an option. I add a little bit to the top of the <script> element to detect modern browsers and do the cool, filter as you go for them (these should all have working asynchronous javascript, so should let you keep typing while searching.

                Essentially, this keeps everything the same for "fast browsers" and for everyone else, waits until enter is pressed to filter.

                    <script>
                      var fast_browser = false;
                      var fast_browsers = ["Chrome", "Firefox", "Edge", "Safari", "Opera"];
                
                      fast_browsers.forEach(function(browser) {
                        if(navigator.userAgent.indexOf(browser) != -1) {
                          fast_browser = true;
                        }
                      });
                
                      function filter_topics(event) {
                        if(!fast_browser && event.keyCode != 13) {
                          return;
                        }
                        
                        var filter=new RegExp(document.getElementById("filter").value, 'i');
                        var topics=document.getElementById("topics").children;
                

                If we go this route, we also have to change one more line, we need to add event into the filter_topics function call:

                <input id="filter" class="filter-input" width=32 onkeyup="filter_topics(event)">
                

                Edit: We would want to test this on phones and tables, I don't know if they send over an enter or possibly some other keycode.

                Lia 1 Reply Last reply Reply Quote 3
                • Lia
                  Lia GT XR Pint Plus V1 DIY @biell last edited by

                  @biell I'll setup a cloned test page to try this on so we can fiddle, thanks for making that :)
                  Hadn't even gotten around to planning what to do yet. I'm still covered in glue >.>

                  1 Reply Last reply Reply Quote 3
                  • Lia
                    Lia GT XR Pint Plus V1 DIY last edited by

                    Test page setup with @biell s suggestion :)
                    https://archive.owforum.co.uk/test.html

                    Any joy with that? Seems to behave the same on my iPhone (clunky at first as it filters the initial massive block.

                    If not I assume we can just have it so there is a search button that only allows the filter to run once clicked thus removing that initial lag on entry and also prevents the search running as you type.

                    1 Reply Last reply Reply Quote 0
                    • Locked by  Lia Lia 
                    • First post
                      Last post