Jump to content

Simon Law

Former Frog Staff
  • Posts

    59
  • Joined

  • Last visited

Posts posted by Simon Law

  1. 1 hour ago, Sue Busher said:

    @Simon Law @pconkie

    Thank you so much guys. Our preference is as Simon suggests as effectively once the files are moved into the appropriate folder its job done.

    So if I put a HTML wigdet on the page, together with a hidden network folder. would the code you suggest (providing I rename it to match our network drive and the menu file), the main menu HTML file would appear?

     

    
    <a href="file:///S:/Path/to/Your/MainMenu.html" target="_blank">Weekly Cover</a>

    Hi @Sue Busher your html above should work, however, Frog may hijack the clicking of the link in which case

    <span onclick="window.open('file:///S:/Path/to/Your/MainMenu.html', '_blank')">Weekly Cover</span>
    or
    <div onclick="window.open('file:///S:/Path/to/Your/MainMenu.html', '_blank')">Weekly Cover</div>

    may yield results

  2. 36 minutes ago, Sue Busher said:

    @Simon Law Its so hard to describe. I am effectively after a menu which when clicked on would open the files. SIMS creates all these HTML documents and a master menu, if I use file drop, it doesn't display the master menu and shows all the documents - which is a bit overwhelming as we are a large school. However, as it wouldn't be me updating it every week, it would  need to be very simple to update. I can't drop the files as it contains personal data. Do you know how other schools have addressed this problem?

    I think I see the problem better now.

    I know I am thinking outside the Frog, but if a link could be made to open a new browser window that opened up the master menu, then you would then be able to view the day files by clicking on one of the links.

    eg 

    <a href="file:///S:/Path/to/Your/MainMenu.html" target="_blank">Weekly Cover</a>

    where S is the network drive and the path goes to the main menu

    Or is the main menu not usable as a index page?

  3. 6 minutes ago, Sue Busher said:

    @Simon Law @pconkie

    As you are both so helpful, I wondered if you'd come across anything like my conumdrum above?

    Well, if your description of the problem is correct, the file is dropped onto a network drive, so could you not drop a network widget onto the page, displaying all the files in that directory, which you could then open ..... or am I missing an important piece of the jigsaw? 

  4. 3 hours ago, Sue Busher said:

    Temporarily put the website 'live' and accessed it from home (outside school network) and it works fine. Would appear to be something behind our firewall stopping it working.

    Thanks for your help @pconkie @Simon Law

     

    Always glad to hear something works outside of a firewall :)

  5. Hi Sue, just as an update really,

    Your code was getting replacing the embed.js file each time a new page was clciked on, so I attempted to get it to load once, use cache if already there, something tockify suggest above,

    however it didn't seem to make the thing work.

    Not had a chance to look at it today

  6. <script>
     function reloadIFrame() {
         document.Name1.location.reload();
     }
        
     window.setInterval(reloadIFrame, 3000);
     </script>
    <iframe src="URL" name="Name1" style="height:70px;border:0px;padding:0px;margin:0px;"></iframe>

    couple of slight changes, good to go (after you change URL to a real URL :)

  7. 5 hours ago, Sue Busher said:

    @Simon Law

    What do you think? It is quite clever - you can add maps, RSVPs, add to your calendar etc.

    yes, it looks nice and it looks like our events need more things to attach to it, 

  8. Just now, Sue Busher said:

    @Simon Law

    Sorry Simon, I refreshed my screen and it works fine. Apologies for wasting your time.

    No time wasted, it was my lunch time foray into the forum, it also give me a chance to see how/what you're using

  9. 3 hours ago, Sue Busher said:

    I am so sorry to ask again, but we were given a bit more code and I can't seem to get it to display again. Would you mind working your magic once again - I promise I will try not to bother you again.
     

    @Sue Busher the code you posted works for me on a new site, so its not the code that's the problem.

    which site /page have you tried this on?

     

  10. 55 minutes ago, ADT said:

    Unfortuanly its a Managed service policy....  would take the head to get unblocked!!  And he isn't that interested in IT magic!! :(

    does that make me a wizard?

  11. <script>
        ///////////////////////////////////////
        //logic:
        /////Always hide widget.. 
        ////Show widget if all criteria met
        ///////////////////////////////////////
        
        //declare and set vars
        //change these values as required
      //SL my widget has different uuid
        var widget_to_hide = "7E50015020028EF283501F8FD1F30A0096EE04DCC9DB2497";
        var school_ip_lower = "10.0.112.1";
        var school_ip_upper = "10.0.127.254";
        var format = 'hh:mm:ss';
        var time = moment();
        var beforeTime = moment('07:30:00', format);
        //SL I am working late so I set for late night
        var afterTime = moment('19:00:00', format);
        var currentuser = FrogOS.getUser();
        var dayOfWeek = moment().day();
        //SL made theWidget so I could use it again and again
        var theWidget = $("div[data-content-uuid='"+widget_to_hide+"']");
        //SL added debugger so I could step through in dev tools
        debugger;
        //hide widget
        theWidget.hide();
        //SL logged in as not a student for testing
        if (currentuser.profile.type == "student") {
            //they are not a student - show the widget
            theWidget.show();
        } else {
            //async load of users school ip address...waits for response...
            $.get( "../ipaddress.php", function( data ) {
    //SL added debugger so I don't have to step through ipaddress call
     debugger;
     var r = /\b(\d{1,3}).(\d{1,3}).(\d{1,3})\b/;
     var ip = data.match(r);
    // capture the individual parts of the ip address
    
    // my ip was 192.168.99 so I had to if condition
    if (ip && ip[1] === '192' && ip[2] === '168' && (parseInt(ip[3]) >= 90 && parseInt(ip[3]) <= 99)) {
                
                    //they are at school
                    //if (dayOfWeek === 1 || dayOfWeek === 2 || dayOfWeek === 3 || dayOfWeek === 4 || dayOfWeek === 5) {
      				//SL cleaner to use inArray
                    if ($.inArray(dayOfWeek, [1,2,3,4,5])) {
                        //0=sunday, 1=monday etc BUT perhaps this isn't correct for US?
                        //it should be Mon-Fri
                        if (time.isBetween(beforeTime, afterTime)) {
                            //it's within school hours
                            //finally show the widget!
                            theWidget.show();
                        }
                    }
                } 
            });
        } 
    </script>

    I had to alter code see //SL but it worked for me

  12. If I was javascript, I would probably not like

    image.png.4b73050a9ca1f6d126408844ea5a56dc.png

    You are trying to use an ip address as though it was a number and comparing it to ip[0] which is a string

    10 is a number

    10.0 is a number

    10.0.112 is not a valid number

    10.0.112.1 is not a valid number

    so ......

    var r = /\b(\d{1,3}).(\d{1,3}).(\d{1,3})\b/;

    // capture the individual parts of the ip address

    var ip = data.match(r);

    if (ip && ip[1] === '10' && ip[2] === '0' && (parseInt(ip[3]) >= 112 && parseInt(ip[3]) <= 127)) {

     

  13. 26 minutes ago, Sue Busher said:

    @Simon Law @Graham Quince  The code has changed but I am still seeing the stretching of the images on my iphone. I haven't used the new image carosuel as not really got to grips with it. Is there any training videos? As you say, at least it would be supported.

    ok, your iphone is probably caching the css, I have changed the html widget to use 'carousel_davids' instead of 'carousel_david', this should be enough for the iphone to not use the cached css

     

     

  14. 40 minutes ago, Sue Busher said:

    @Simon Law Was that in the code then Simon? Or something I could'should have done with the images?

    I am still seeing this on mobile O.o

    @Sue Busher I think you are still seeing the old CSS styling on your mobile.

    As graham said above, the replacement of the height for max-height solves the image sizing.

     

     

  15. 2 hours ago, Sue Busher said:

    ok, I'll have a look 

    The issue was the height setting on the image element, I have changed it to use max-height instead.

    There still seems to be an issue with the carousel-indicators though :(

    • Like 1
×
×
  • Create New...