NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Keith

Pages: [1] 2 3 ... 21
1
Web Server - Ask For Help / Re: Countdown Clock
« on: April 13, 2018, 12:28:28 AM »
Hi Bruce

Thanks for explaining that.  All good now  ;D

Keith

2
Web Server - Ask For Help / Re: Countdown Clock
« on: April 12, 2018, 08:55:24 PM »
Ok, so last question (why am I so optimistic  :) )

I am in Clarion with Keiths.js open and am changing it to make the clock look better (size, colours etc) and I want to Save the new file and refresh the browser to see the new exquisite result.  But the display doesn't change.

I have looked seemingly everywhere for advice on how to clear the (Firefox) cache and have got lots of suggestions none of which work all the time (ctrl-f5 worked once).  The incredible thing is this - the first change that I made was to make one of the words in the clock big (txt.big()) and it worked.  Though now I have a very different js file Firefox is still using the old one AND Chrome also used the old and now non-existent js file.  This is a grand conspiracy.

How can I get around this apart from rebooting (which is what I am going to do now)?

Thanks

Keith

3
Web Server - Ask For Help / Re: Countdown Clock
« on: April 12, 2018, 02:56:46 PM »
Hi Bill and Richard

I am flummoxed!  This morning after getting the server going so that I could install the latest version of this stubbornly not-working countdown clock I checked the p_web.script line and recompiled and . . . it all worked :-(     Or should that be :-)

I can only think that it was to do with ticking 'Included in  All.js' which I un-ticked after Bill's comment.  Though I had tried this previously it may have been that the function itself had a capital letter where it shouldn't have and so one problem masked the other.

Anyway, thanks again for all your help.  All is now well.

Cheers

Keith

4
Web Server - Ask For Help / Re: Countdown Clock
« on: April 11, 2018, 02:35:26 AM »
Ok Bill.

I'll put the latest version up on a server you can get to and you'll be able to see everything.  Hope to do that tomorrow - I got an Administrator Password error when I just tried so need to sort that out.

Cheers

Keith

5
Web Server - Ask For Help / Re: Countdown Clock
« on: April 11, 2018, 12:28:18 AM »
Hi Bill

In my page there is this line near the top:

<script src="/scripts/Keiths.js?c=1" type="text/javascript"></script>

Looking at Network I see that Keiths.js is loaded immediately after All.js but its Status was '304 Not Modified' whereas All.js had a status of '200 Cached'.  It is the last item (the other four are: document, stylesheet, stylesheet, script (all.js)

I'm obviously going to have to learn what all of this means but in the meantime does this look right or wrong?

Thanks

Keith

6
Web Server - Ask For Help / Re: Countdown Clock
« on: April 10, 2018, 03:08:26 PM »
Thanks Bill.

In the Console there is an error: ReferenceError: keithscountdown is not defined

keithscountdown is the JS function and I have copied it in full at the bottom of this post. I have included Keiths.js in the scripts list of the Web Server. I added the ;but still got the error.

Can you spot what is wrong from a JS perspective.  Of course the other question (which started all this) is have I got the p_web.script line correct?

Keiths.js
function keithscountdown(pId,pDate){
    // Set the date we're counting down to
    var countDownDate = new Date(pDate).getTime();//"Sep 5, 2018 15:37:25"
   
    // Update the count down every 1 second
    var x = setInterval(function() {
   
      // Get todays date and time
      var now = new Date().getTime();
   
      // Find the distance between now an the count down date
      var distance = countDownDate - now;
   
      // Time calculations for days, hours, minutes and seconds
      var days = Math.floor(distance / (1000 * 60 * 60 * 24));
      var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
      var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
      var seconds = Math.floor((distance % (1000 * 60)) / 1000);
   
      // Display the result in the element with id="demo"
      document.getElementById(pId).innerHTML = days + "d " + hours + "h "
      + minutes + "m " + seconds + "s ";
   
      // If the count down is finished, write some text
      if (distance < 0) {
        clearInterval(x);
        document.getElementById(pId).innerHTML = "EXPIRED";
      }
    }, 1000);
}

7
Web Server - Ask For Help / Re: Countdown Clock
« on: April 10, 2018, 12:23:32 AM »
And yet a further point to Richard's above - when the script execute line is inserted into the procedure viz. p_web.Script('keithscountdown("selection_timetogo_value_div" ,"Sep 5, 2018 15:37:25")') the tab of the form gets munged (i.e. it doesn't display properly).  Instead of the usual tab enclosure with its name 'Graphical Summaries' it gets displayed  as '<bullet point> Graphical Summaries'

Richard, does this happen to either of your cases - the one that works and the one that doesn't.

Keith

8
Web Server - Ask For Help / Re: Countdown Clock
« on: April 05, 2018, 03:14:34 PM »
Hi
I have attached a document which describes everything in the application - the JavaScript function, the field on the Form, the p_web.script to run the function and the html available out of the Firefox Inspect facility.  The fields on the Form are an Insight graph and underneath, TimeToGo

Thanks for any suggestions

Keith

9
Web Server - Ask For Help / Re: Countdown Clock
« on: March 27, 2018, 02:55:31 AM »
Hi Bruce, thanks for the great explanation in the Webinar.  I have done everything per your tutorial but am stumbling over one thing.

I created Keith.js which contains the function keithscountdowntimer with the pId and Date parameters and this looks to me to be identical with what you created.

I added a Display field to the Form that I want the timer on and added Keith.js to the Webserver/Settings/Scripts (I unticked 'Included in ALL.js  (but I have tried it with this ticked))

The piece I'm not understanding is the line in the procedure that runs the function.  I ran the program and 'Inspected' the Form to find the code for the timetogo field and I found this:

<tr id="timetogo_row">  etc which didn't look like your "updateproducts_timetogo_value_div"

So I was trying to construct the command to put in the value::timetogo routine and I tried a number of times based on <tr id="timetogo_row">  but always got the red message "Error in Site Java Script.  I ended up with what I thought would be my equivalent of what you got running i.e. p_web.Script('keithscountdown("Selection_timetogo_value_div","Sep 5, 2018 15:37:25")')   because my Form procedure is 'Selection'

With this in place the Java Script error message is no longer produced but the page is not created properly and the timer does not display.  I am pretty sure that Keith.js is correct and think that it must be that this line is wrong.

Thanks for your assistance (again!)

Keith

10
Web Server - Ask For Help / Re: Countdown Clock
« on: March 21, 2018, 11:32:54 AM »
PS  Looking at the JS option opens a new Nettalk world.  Very good.  I'll look forward to the seminar to learn how to integrate the JS file.

Also, the graphs all work well now including Pies.

Keith

11
Web Server - Ask For Help / Re: Countdown Clock
« on: March 21, 2018, 11:25:05 AM »
Bruce

Excellent, thanks.

Keith

12
Web Server - Ask For Help / Countdown Clock
« on: March 21, 2018, 12:08:28 AM »
I would really like to create a large Countdown Clock.  Something like:

3 Years 7 Months 3 Days 4 Hours and 27 Seconds

with the time changing in real time - just like the 'Session expires in HH SS'  I'd like it to be triggered by a Menu Item 'Countdown Clock'.

Can this be done easily?

Keith

13
Thanks Bruce.  I had the Window resize Extension template on all of the graphs and so have removed it.  With the code reinstated that reloads the data the graph behaves.

When you create a new Window and add the Insight Control the 'offending' Extension seems to be added automatically.  If this was going to cause the problem that I encountered then maybe the conditions should be documented (they may already be documented but I didn't come across anything along those lines).

I still don't understand why, with the same data being loaded on each Refresh the Resize Extension allows the size of the graph to exponentially increase (irrespective of the maximum Y-axis value) but now that its fixed I won't be worrying about it :-)

Keith

14
Hi, the attached zip file contains the app, dct, files and the exe. The files should be in the same folder as the exe.

If you go here: http://101.98.111.186:24040/ you can choose 'Visualise' and 'Device Owners' then press 'Refresh Information' a couple of times and you will see the graph changing size.

In the attached app I have bypassed the code that would normally run to load new owner data so that all that is happening when the button is pushed is that the fields (including the graph) are being Reset.

Thanks for any advice.

Keith

15
Thanks Bruce

Checked that the data is being deleted correctly when a new Owner is selected.  However I then stripped this down to basics.  The graphs run off files.  The files that feed all of the graphs that work are static.  The one where the graph window gets ever bigger (and sometimes reverts to the correct size!) runs off the file that is reseeded.  So I bypassed the embed code which deletes and reseeds the records. This meant that the items on the Window including the Graph procedure were simply being Reset and the Graph was of the same data.

The result was the same!  Reiterating:  Press the NewGraph button, no delete or insert code executed (i.e. run off current file) and the displayed graph (same data points) varies in size on each iteration.

I am creating a cut down app which demonstrates.

Keith

Pages: [1] 2 3 ... 21