OBBLM Hover menus with phones/tablets

However you play online - Java, Vassal, Email, Cyanide etc - talk about it here.
This is also the place for discussing the various tools for managing leagues, teams and so on.

Moderator: TFF Mods

BigSexy
Rookie
Rookie
Posts: 47
Joined: Fri Jul 10, 2009 4:56 am
Location: SE Michigan, U.S.

OBBLM Hover menus with phones/tablets

Post by BigSexy »

I can use OBBLM fairly well with my iphone but cannot access dropdown menus such as "Matches", "Statistics", etc. These are the dropdowns that are opened when you hover the mouse pointer over them and I've found this is a common issue with websites and mobile touch devices. Is there anykind of work around and development that can fix this? I expect more and more coaches will be wanting to use evil mobile gadgetry to submit match results and such.

Reason: ''
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

Re: OBBLM Hover menus with phones/tablets

Post by Shteve0 »

Not that I've seen; I have the same issue. I'm working on a possible patch, and though I'm an enthusiastic amateur at best, I'll hopefully have something to show for my efforts within a week or two.

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
User avatar
nicholasmr
Experienced
Experienced
Posts: 110
Joined: Mon Oct 22, 2007 1:01 pm
Location: Copenhagen, Denmark
Contact:

Re: OBBLM Hover menus with phones/tablets

Post by nicholasmr »

Please let me know if you patch this! - I'll add it to the official distribution then.

I imagine fixing this by something like making the drop-down unfold if the mouse hovers over the menu OR is clicked on (the latter is probably not enabled at the moment).

Alternatively, maybe a new open source menu system should be used which supports smart phones etc.
? The current one is from before smart phones took off etc...

Nicholas.

Reason: ''
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

Re: OBBLM Hover menus with phones/tablets

Post by Shteve0 »

Hi Nicholas

Apparently in the advanced or ultimate versions of the packaged menu the point is to leverage a hyperlink trigger inside a li item to make it open its child menu. In simple version you will need to use a workaround and add onmouseover="" to each li item containing a drop down menu in order to trigger and toggle its visibility.

Does that make sense? I'll have a go at implementing that on my league page shortly, see how it works out.

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
BigSexy
Rookie
Rookie
Posts: 47
Joined: Fri Jul 10, 2009 4:56 am
Location: SE Michigan, U.S.

Re: OBBLM Hover menus with phones/tablets

Post by BigSexy »

Just to update. My Kindle Fire will open the hover menus when I tap the heading, so apparently it will work for some devices.

Reason: ''
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

Re: OBBLM Hover menus with phones/tablets

Post by Shteve0 »

Main menu fix, of sorts. I now have a much less irritating issue that once I've opened a menu on my ipod, I have to make a selection to get rid of it. I might move the Home option to the left of the first drop down so I have somewhere to go if I mis-hit?

Anyway, here's the patch.

1) TAKE A BACKUP OF YOUR SITE!

2) Open your host's core panel, navigate to [root]/lib/class_htmlout.php, edit.

3) Find this:

Code: Select all

        if (isset($_SESSION['logged_in']) && is_object($coach)) {
            echo '<li><a href="'.urlcompile(T_URL_PROFILE,T_OBJ_COACH,$coach->coach_id,false,false).'">'.$lng->getTrn('menu/cc').'</a></li>';
            if (!empty($admin_menu)) {
                ?>
                <li><span class="dir"><?php echo $lng->getTrn('menu/admin_menu/name');?></span>
                    <ul>
                    <?php
                    foreach ($admin_menu as $lnk => $desc) {
                        if (!is_array($desc)) {
                            echo "<li><a href='index.php?section=admin&subsec=$lnk'>$desc</a></li>\n";
                        }
                        else {
                            ?>
                            <li><span class="dir"><?php echo $desc['title'];?></span>
                            <ul>
                            <?php
                            foreach ($desc['sub'] as $sub) {
                                echo "<li><a href='index.php?section=admin&subsec=$lnk&$sub[href]'>$sub[title]</a></li>\n";
                            }
                            ?>
                            </ul>
                            </li>
                            <?php
                        }
                    }
                    ?>
                    </ul>
                </li>
                <?php
            }
        }
        ?>
        <li><a href="index.php?section=main"><?php echo $lng->getTrn('menu/home');?></a></li>
        <li><a href="index.php?section=teamlist"><?php echo $lng->getTrn('menu/teams');?></a></li>
        <li><a href="index.php?section=coachlist"><?php echo $lng->getTrn('menu/coaches');?></a></li>
        <li><span class="dir"><?php echo $lng->getTrn('menu/matches_menu/name');?></span>
            <ul>
                <li><a href="index.php?section=matches&type=tours"><?php echo $lng->getTrn('menu/matches_menu/tours');?></a></li>
                <li><a href="index.php?section=matches&type=recent"><?php echo $lng->getTrn('menu/matches_menu/recent');?></a></li>
                <li><a href="index.php?section=matches&type=upcoming"><?php echo $lng->getTrn('menu/matches_menu/upcoming');?></a></li>
                <li><a href="index.php?section=matches&type=usersched"><?php echo $lng->getTrn('menu/matches_menu/usersched');?></a></li>
            </ul>
        </li>
        <li><span class="dir"><?php echo $lng->getTrn('menu/statistics_menu/name');?></span>
            <ul>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_TEAM,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/team_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_PLAYER,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/player_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_COACH,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/coach_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_RACE,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/race_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_STAR,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/star_stn');?></a></li>
            </ul>
        </li>
        <li><span class="dir"><?php echo $lng->getTrn('menu/plugins');?></span>
            <ul>
                <?php if (Module::isRegistered('UPLOAD_BOTOCS') && $settings['leegmgr_enabled']) { ?><li><a href="handler.php?type=leegmgr">Client Match Report Upload</a></li><?php } ?>
                <?php if (Module::isRegistered('Search')){ ?><li><a href="handler.php?type=search"><?php echo $lng->getTrn('name', 'Search');?></a></li><?php } ?>
                <?php if (Module::isRegistered('TeamCompare')){ ?><li><a href="handler.php?type=teamcompare"><?php echo $lng->getTrn('name', 'TeamCompare');?></a></li><?php } ?>
                <?php if (Module::isRegistered('PDFMatchReport'))    { ?><li><a href="handler.php?type=pdfmatchreport"><?php echo $lng->getTrn('name', 'PDFMatchReport');?></a></li><?php } ?>
                <?php if (Module::isRegistered('HOF'))   { ?><li><a href="handler.php?type=hof"><?php echo $lng->getTrn('name', 'HOF');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Wanted')){ ?><li><a href="handler.php?type=wanted"><?php echo $lng->getTrn('name', 'Wanted');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Prize')) { ?><li><a href="handler.php?type=prize"><?php echo $lng->getTrn('name', 'Prize');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Memmatches')) { ?><li><a href="handler.php?type=memmatches"><?php echo $lng->getTrn('name', 'Memmatches');?></a></li><?php } ?>
                <?php if (Module::isRegistered('SGraph'))     { ?><li><a href="handler.php?type=graph&gtype=<?php echo SG_T_LEAGUE;?>&id=none"><?php echo $lng->getTrn('name', 'SGraph');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Gallery'))    { ?><li><a href="handler.php?type=gallery"><?php echo $lng->getTrn('name', 'Gallery');?></a></li><?php } ?>
				<?php if (Module::isRegistered('LeagueTables'))    { ?><li><a href="handler.php?type=leaguetables"><?php echo $lng->getTrn('menu-label', 'LeagueTables');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Conference'))    { ?><li><a href="handler.php?type=conference"><?php echo $lng->getTrn('menu-conf', 'Conference');?></a></li><?php } ?>
            </ul>
        </li>

        <li><a href="index.php?section=rules"><?php echo $lng->getTrn('menu/rules');?></a></li>
        <li><a href="index.php?section=about">OBBLM</a></li>
        <?php
        if (!empty($settings['forum_url'])) {
            ?><li><a href="<?php echo $settings['forum_url'];?>"><?php echo $lng->getTrn('menu/forum');?></a></li><?php
        }
        ?>
    </ul>
    <?php
Replace with this:

Code: Select all

        if (isset($_SESSION['logged_in']) && is_object($coach)) {
            echo '<li><a href="'.urlcompile(T_URL_PROFILE,T_OBJ_COACH,$coach->coach_id,false,false).'">'.$lng->getTrn('menu/cc').'</a></li>';
            if (!empty($admin_menu)) {
                ?>
                <li onmouseover=""><span class="dir"><?php echo $lng->getTrn('menu/admin_menu/name');?></span>
                    <ul>
                    <?php
                    foreach ($admin_menu as $lnk => $desc) {
                        if (!is_array($desc)) {
                            echo "<li><a href='index.php?section=admin&subsec=$lnk'>$desc</a></li>\n";
                        }
                        else {
                            ?>
                            <li onmouseover=""><span class="dir"><?php echo $desc['title'];?></span>
                            <ul>
                            <?php
                            foreach ($desc['sub'] as $sub) {
                                echo "<li><a href='index.php?section=admin&subsec=$lnk&$sub[href]'>$sub[title]</a></li>\n";
                            }
                            ?>
                            </ul>
                            </li>
                            <?php
                        }
                    }
                    ?>
                    </ul>
                </li>
                <?php
            }
        }
        ?>
        <li><a href="index.php?section=main"><?php echo $lng->getTrn('menu/home');?></a></li>
        <li><a href="index.php?section=teamlist"><?php echo $lng->getTrn('menu/teams');?></a></li>
        <li><a href="index.php?section=coachlist"><?php echo $lng->getTrn('menu/coaches');?></a></li>
        <li onmouseover=""><span class="dir"><?php echo $lng->getTrn('menu/matches_menu/name');?></span>
            <ul>
                <li><a href="index.php?section=matches&type=tours"><?php echo $lng->getTrn('menu/matches_menu/tours');?></a></li>
                <li><a href="index.php?section=matches&type=recent"><?php echo $lng->getTrn('menu/matches_menu/recent');?></a></li>
                <li><a href="index.php?section=matches&type=upcoming"><?php echo $lng->getTrn('menu/matches_menu/upcoming');?></a></li>
                <li><a href="index.php?section=matches&type=usersched"><?php echo $lng->getTrn('menu/matches_menu/usersched');?></a></li>
            </ul>
        </li>
        <li onmouseover=""><span class="dir"><?php echo $lng->getTrn('menu/statistics_menu/name');?></span>
            <ul>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_TEAM,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/team_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_PLAYER,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/player_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_COACH,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/coach_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_RACE,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/race_stn');?></a></li>
                <li><a href="<?php echo urlcompile(T_URL_STANDINGS,T_OBJ_STAR,false,false,false);?>"><?php echo $lng->getTrn('menu/statistics_menu/star_stn');?></a></li>
            </ul>
        </li>
        <li onmouseover=""><span class="dir"><?php echo $lng->getTrn('menu/plugins');?></span>
            <ul>
                <?php if (Module::isRegistered('UPLOAD_BOTOCS') && $settings['leegmgr_enabled']) { ?><li><a href="handler.php?type=leegmgr">Client Match Report Upload</a></li><?php } ?>
                <?php if (Module::isRegistered('Search')){ ?><li><a href="handler.php?type=search"><?php echo $lng->getTrn('name', 'Search');?></a></li><?php } ?>
                <?php if (Module::isRegistered('TeamCompare')){ ?><li><a href="handler.php?type=teamcompare"><?php echo $lng->getTrn('name', 'TeamCompare');?></a></li><?php } ?>
                <?php if (Module::isRegistered('PDFMatchReport'))    { ?><li><a href="handler.php?type=pdfmatchreport"><?php echo $lng->getTrn('name', 'PDFMatchReport');?></a></li><?php } ?>
                <?php if (Module::isRegistered('HOF'))   { ?><li><a href="handler.php?type=hof"><?php echo $lng->getTrn('name', 'HOF');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Wanted')){ ?><li><a href="handler.php?type=wanted"><?php echo $lng->getTrn('name', 'Wanted');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Prize')) { ?><li><a href="handler.php?type=prize"><?php echo $lng->getTrn('name', 'Prize');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Memmatches')) { ?><li><a href="handler.php?type=memmatches"><?php echo $lng->getTrn('name', 'Memmatches');?></a></li><?php } ?>
                <?php if (Module::isRegistered('SGraph'))     { ?><li><a href="handler.php?type=graph&gtype=<?php echo SG_T_LEAGUE;?>&id=none"><?php echo $lng->getTrn('name', 'SGraph');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Gallery'))    { ?><li><a href="handler.php?type=gallery"><?php echo $lng->getTrn('name', 'Gallery');?></a></li><?php } ?>
				<?php if (Module::isRegistered('LeagueTables'))    { ?><li><a href="handler.php?type=leaguetables"><?php echo $lng->getTrn('menu-label', 'LeagueTables');?></a></li><?php } ?>
                <?php if (Module::isRegistered('Conference'))    { ?><li><a href="handler.php?type=conference"><?php echo $lng->getTrn('menu-conf', 'Conference');?></a></li><?php } ?>
            </ul>
        </li>

        <li><a href="index.php?section=rules"><?php echo $lng->getTrn('menu/rules');?></a></li>
        <li><a href="index.php?section=about">OBBLM</a></li>
        <?php
        if (!empty($settings['forum_url'])) {
            ?><li><a href="<?php echo $settings['forum_url'];?>"><?php echo $lng->getTrn('menu/forum');?></a></li><?php
        }
        ?>
    </ul>
    <?php
Now hit save, and you should be fine.

That sorts out the main menu. There are a few more I need to look at. Confirmed working on my ipod.

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

Re: OBBLM Hover menus with phones/tablets

Post by Shteve0 »

Found another two in the team screen. Is that all of them? Relatively easy fix, this; you want /lib/class_team_htmlout.php

Find:

Code: Select all

  <li><span class="dir">Roster</span>
            <ul>
                <?php if ($pdf)    { ?><li><a TARGET="_blank" href="<?php echo $pdf;?>">PDF</a></li> <?php } ?>
                <?php if ($botocs) { ?><li><a TARGET="_blank" href="<?php echo $botocs;?>">BOTOCS-XML</a></li> <?php } ?>
                <?php if ($cyanide) { ?><li><span class="dir">Cyanide-DB</span>
                    <ul>
Replace with:

Code: Select all

  <li onmouseover=""><span class="dir">Roster</span>
            <ul>
                <?php if ($pdf)    { ?><li><a TARGET="_blank" href="<?php echo $pdf;?>">PDF</a></li> <?php } ?>
                <?php if ($botocs) { ?><li><a TARGET="_blank" href="<?php echo $botocs;?>">BOTOCS-XML</a></li> <?php } ?>
                <?php if ($cyanide) { ?><li onmouseover=""><span class="dir">Cyanide-DB</span>
                    <ul>

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
Hegel
Experienced
Experienced
Posts: 150
Joined: Mon Jan 30, 2012 8:19 am

Re: OBBLM Hover menus with phones/tablets

Post by Hegel »

Just changed the /lib/class_htmlout.php and the main menu works fine on my iPhone now ! Thanks a lot Shteve0 !!! The minor bug with the menu staying open until I select something is neglectable for me.

Reason: ''
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

OBBLM Hover menus with phones/tablets

Post by Shteve0 »

Cool, you're very welcome. The second post fixes the Roster drop down on the team screen, just so you're aware. I personally like to use the pdf version a lot, so that's a big deal for me to have that working.

Enjoy!

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
Hegel
Experienced
Experienced
Posts: 150
Joined: Mon Jan 30, 2012 8:19 am

Re: OBBLM Hover menus with phones/tablets

Post by Hegel »

I only have the PDF option available, but as I don´t have an AirPrint printer I can´t print from the iPad/Phone anyway :) . But thanks for the hint, I´ll fix that too.

Reason: ''
funnyfingers
Emerging Star
Emerging Star
Posts: 418
Joined: Tue Jul 14, 2009 8:41 pm
Contact:

Re: OBBLM Hover menus with phones/tablets

Post by funnyfingers »

Has a bug report been made on this with all the specific changes? If you can't get to making the changes to the trunk, I can if it is all written out in one place.

Reason: ''
Webhosting with the latest version of OBBLM installed: OBBLM Web Hosting (be sure to choose the OBBLM tab)
Hegel
Experienced
Experienced
Posts: 150
Joined: Mon Jan 30, 2012 8:19 am

Re: OBBLM Hover menus with phones/tablets

Post by Hegel »

I´ve been in contact with Nicolas before. I´ve not been aware that there is an option to report bugs somewhere. He´s been here in that topic so I guess he´s already aware of the solution.

Reason: ''
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

OBBLM Hover menus with phones/tablets

Post by Shteve0 »

No, not been raised as yet. May get to it this weekend unless a kind soul beats me to it!

http://code.google.com/p/obblm/issues/list

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
funnyfingers
Emerging Star
Emerging Star
Posts: 418
Joined: Tue Jul 14, 2009 8:41 pm
Contact:

Re: OBBLM Hover menus with phones/tablets

Post by funnyfingers »

Shteve0 wrote:No, not been raised as yet. May get to it this weekend unless a kind soul beats me to it!

http://code.google.com/p/obblm/issues/list

If you can get the bug report all spelled out for me, I think I can get it including in the hosting stuff that I am setting up for OBBLM.

Reason: ''
Webhosting with the latest version of OBBLM installed: OBBLM Web Hosting (be sure to choose the OBBLM tab)
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

Re: OBBLM Hover menus with phones/tablets

Post by Shteve0 »

Issue: On some tablet or mobile computer devices (namely those operating on an iOS), "hover" triggers don't expand the lwis.net drop down menus coded into the obblm software; they simply don't act as clickable links and the functionality of the sub menus is lost.

Solution: the empty onmouseover() is added within each <li> item with an expandable menu to force the iphone to expand that menu, allowing the secondary/tertiary levels to be selected.

As an aside, this generates a new issue in that once the dropdown menu is expanded on an iOS devide, another menu selection needs to be made (or a page refresh carried out) in order to collapse it again (ie refresh the menu). All told, it's a minor inconvience and, I'd suggest, much the lesser of the two evils.

You can see a demo of the fix in action by visiting my league page, http://nzcbbl.obblm.com; from an iOS device the drop downs are functional, and from a normal pc browser there should be no apparent difference (ie I've not actually disabled the hover, just added an empty onmouseover() for iphone browsing).

How To Apply: In simple terms, replace the first code strings in each of my earlier posts within the second code strings (whereby you will essentially be adding the onmouseover() code in the positions that I did). Make sure you take a backup of your site first! You should be able to do this within the source code prior to install without any issues.

Clear enough?

Credit: lwis.net (known fix)

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
Post Reply