Menu

Previous / Next page links?

Help
Izzy
2014-10-07
2014-10-09
  • Izzy

    Izzy - 2014-10-07

    Is this a feature worth mentioning?
    links to the previous and next page would be automatically placed at top (and/or bottom).
    example: http://simplegui.izzysoft.com/RM/#4-en

    Can links use the same page names like in the TreeView?

    Thanks.

     
    • Richard Bondi

      Richard Bondi - 2014-10-07

      Hello Izzy,

      It sounds like a reasonable feature. Each node is stored with a reference
      to a parent node. along with a label so presenting the label in the link
      should be easy. The next link would be the next child with parent id same
      as the current one if it exists. If not, recurse back checking for
      additional children along the way. Similar check for previous. Not a
      small task but not extremely difficult.

      I like your discussion plugin, have not seen that before.

      rb

       

      Last edit: Richard Bondi 2014-10-08
      • Izzy

        Izzy - 2014-10-08

        Ty for making WWH. :)

        Discussions is from https://disqus.com/websites/
        I didnt know much about the plugin system, so i hacked the sources to add it, but wound up having to learn about plugins soon after :P so i can call a javascript function at the end of a page load. Disqus was a pain to add at 1st, to be honest. :/ but reading the docs helps. :}

        I'm trying out navigating the TreeView using jqLite and i'm almost there. I named the plugin page-nav. Seems to be working ok so far.

        Also, how difficult would it be to let the user set the focus to the TreeView and use Tab or arrow keys to change the page?

        I included jqLite on my site, so doing a call like:

        $( '#tree div[id^="treelabel"]' ).each( function(idx){ $(this).attr('tabindex', idx+1); } );

        ... would add a TabIndex attribute to each 'treelabel#', and it should be in the proper order. After making that call, Most browsers can use the tab key to switch the focus between all visible 'treelabel#'s.

        I wonder if this can be used somehow.
        maybe call: $('#tree div[tabindex="14"]');
        Not sure how useful that might be atm. :/

        Or perhaps:

        $( '#tree div[id^="treelabel"]' ).bind( 'keypress', function(e){ if(e.keyCode == 13) console.log('you hit return while tab-focus was on: ' + this.id ); } );

         

        Last edit: Izzy 2014-10-09
  • Izzy

    Izzy - 2014-10-09

    Just made a 'page-nav' plugin. (Attached)

    usage: [#page-nav,{};#]

    That will work as is.
    Or... if you want to use more parameters, then:

    usage: [#page-nav,{"UsePageName":"true", "AddClass":"Top", "PrevImg": "images/left-arrow.png", "NextImg": "images/right-arrow.png"};#]

    I have not debugged this, so one or two issues might have slipped through. spent 2 days on it.

    Also, left clicking anywhere on the TreeView (even the white area) and presing Up or Down arrows will go the previous or next page. :)

    Edit: small change to the Previous Link for Nested levels.

     

    Last edit: Izzy 2015-08-05

Log in to post a comment.