Re: LC Server - Check for Screen size?
Matthias, thank you so much for the complete solution. I’m such a beginner with LC server (and not even a beginner at JS) that your explanation was what I needed. -- Scott Morrow Elementary Software (Now with 20% less chalk dust!) web https://elementarysoftware.com/ email sc...@elementarysoftware.com booth1-360-734-4701 -- > On Mar 21, 2021, at 4:51 AM, matthias rebbe via use-livecode > wrote: > > Hi Rick, > here's a sample with some put commands and comments for better understanding. > -- read Cookie screeres if available > put $_COOKIE["screenres"] into tScreenRes > > if tScreenRes is empty > then > put "cookie not found. we need to write the cookie" > -- the cookie does not exists or is empty, so we now executing JS, but > -- the following closing tag is mandatory, otherwise the js is not executed > ?> > > let screenwidth = (screen.availWidth); > let screenheight =(screen.availHeight); > document.cookie = "screenres="+screenwidth +","+screenheight; > >put "cookie written" > else > put "Cookie already there" > end if > > --now we extract height and width from the var tScreenRes > set the itemdelimiter to "," > put item 1 of tScreenRes to tWidth > put item 2 of tScreenRes to tHeight > > --from here take action according the detected screenresolution. > ?> > > > Note: The above script detects and uses the available screen resolution. > Regards, > > > - > Matthias Rebbe > Life Is Too Short For Boring Code > >> Am 21.03.2021 um 01:02 schrieb Rick Harrison via use-livecode >> : >> >> Hi Matthias, >> >> So you are thinking something like: >> >> >> >> >> >> Your Screen: >> >> >> >> >> var txt = ""; >> txt += "Total width/height: " + screen.width + "*" + screen.height + >> "
"; >> txt += "Available width/height: " + screen.availWidth + "*" + >> screen.availHeight + "
"; >> txt += "Color depth: " + screen.colorDepth + "
"; >> txt += "Color resolution: " + screen.pixelDepth + "
"; >> >> document.getElementById("demo").innerHTML = txt; >> >> >> >> >> >> And then put the information into a Javascript cookie and then read the >> cookie value with an LC Server script. >> >> I’ll see if I can get that to work. >> >> Thanks! >> >> Rick >> >>> On Mar 20, 2021, at 6:10 PM, matthias rebbe via use-livecode >>> wrote: >>> >>> As Livecode Server runs on the server there is no direct command/function >>> in LC Server available for this task. >>> >>> But you could use Javascript (document.cookie) in your LC Server script >>> to write the screen resolution into a cookie and read that cookie then with >>> your Livecode Server script. >>> >>> >>> - >>> Matthias Rebbe >>> Life Is Too Short For Boring Code >> >> ___ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your subscription >> preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode > > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: LC Server - Check for Screen size?
Hi Matthias, Thanks! Rick > On Mar 21, 2021, at 7:51 AM, matthias rebbe via use-livecode > wrote: > > Hi Rick, > here's a sample with some put commands and comments for better understanding. > -- read Cookie screeres if available > put $_COOKIE["screenres"] into tScreenRes > > if tScreenRes is empty > then > put "cookie not found. we need to write the cookie" > -- the cookie does not exists or is empty, so we now executing JS, but > -- the following closing tag is mandatory, otherwise the js is not executed > ?> > > let screenwidth = (screen.availWidth); > let screenheight =(screen.availHeight); > document.cookie = "screenres="+screenwidth +","+screenheight; > >put "cookie written" > else > put "Cookie already there" > end if > > --now we extract height and width from the var tScreenRes > set the itemdelimiter to "," > put item 1 of tScreenRes to tWidth > put item 2 of tScreenRes to tHeight > > --from here take action according the detected screenresolution. > ?> > > > Note: The above script detects and uses the available screen resolution. > Regards, > > > - > Matthias Rebbe > Life Is Too Short For Boring Code > ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: LC Server - Check for Screen size?
Hi Rick, here's a sample with some put commands and comments for better understanding. " -- the cookie does not exists or is empty, so we now executing JS, but -- the following closing tag is mandatory, otherwise the js is not executed ?> let screenwidth = (screen.availWidth); let screenheight =(screen.availHeight); document.cookie = "screenres="+screenwidth +","+screenheight; " else put "Cookie already there" end if --now we extract height and width from the var tScreenRes set the itemdelimiter to "," put item 1 of tScreenRes to tWidth put item 2 of tScreenRes to tHeight --from here take action according the detected screenresolution. ?> Note: The above script detects and uses the available screen resolution. Regards, - Matthias Rebbe Life Is Too Short For Boring Code > Am 21.03.2021 um 01:02 schrieb Rick Harrison via use-livecode > : > > Hi Matthias, > > So you are thinking something like: > > > > > > Your Screen: > > > > > var txt = ""; > txt += "Total width/height: " + screen.width + "*" + screen.height + > "
"; > txt += "Available width/height: " + screen.availWidth + "*" + > screen.availHeight + "
"; > txt += "Color depth: " + screen.colorDepth + "
"; > txt += "Color resolution: " + screen.pixelDepth + "
"; > > document.getElementById("demo").innerHTML = txt; > > > > > > And then put the information into a Javascript cookie and then read the > cookie value with an LC Server script. > > I’ll see if I can get that to work. > > Thanks! > > Rick > >> On Mar 20, 2021, at 6:10 PM, matthias rebbe via use-livecode >> wrote: >> >> As Livecode Server runs on the server there is no direct command/function >> in LC Server available for this task. >> >> But you could use Javascript (document.cookie) in your LC Server script to >> write the screen resolution into a cookie and read that cookie then with >> your Livecode Server script. >> >> >> - >> Matthias Rebbe >> Life Is Too Short For Boring Code > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: LC Server - Check for Screen size?
Hi Matthias, So you are thinking something like: Your Screen: var txt = ""; txt += "Total width/height: " + screen.width + "*" + screen.height + "
"; txt += "Available width/height: " + screen.availWidth + "*" + screen.availHeight + "
"; txt += "Color depth: " + screen.colorDepth + "
"; txt += "Color resolution: " + screen.pixelDepth + "
"; document.getElementById("demo").innerHTML = txt; And then put the information into a Javascript cookie and then read the cookie value with an LC Server script. I’ll see if I can get that to work. Thanks! Rick > On Mar 20, 2021, at 6:10 PM, matthias rebbe via use-livecode > wrote: > > As Livecode Server runs on the server there is no direct command/function in > LC Server available for this task. > > But you could use Javascript (document.cookie) in your LC Server script to > write the screen resolution into a cookie and read that cookie then with your > Livecode Server script. > > > - > Matthias Rebbe > Life Is Too Short For Boring Code ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: LC Server - Check for Screen size?
As Livecode Server runs on the server there is no direct command/function in LC Server available for this task. But you could use Javascript (document.cookie) in your LC Server script to write the screen resolution into a cookie and read that cookie then with your Livecode Server script. - Matthias Rebbe Life Is Too Short For Boring Code > Am 20.03.2021 um 22:59 schrieb Rick Harrison via use-livecode > : > > I was wondering if there is anyway to check for the > device type or screen size of the connected device > for LC Server so I can serve the correct size screen? > > Thanks, > > Rick > > ___ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
LC Server - Check for Screen size?
I was wondering if there is anyway to check for the device type or screen size of the connected device for LC Server so I can serve the correct size screen? Thanks, Rick ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode