irigsoft Posted December 5, 2016 Posted December 5, 2016 Hi there. We use this code "var docElm = document.documentElement; if (docElm.requestFullscreen) { docElm.requestFullscreen(); } else if (docElm.mozRequestFullScreen) { docElm.mozRequestFullScreen(); } else if (docElm.webkitRequestFullScreen) { docElm.webkitRequestFullScreen(); } else if (docElm.msRequestFullscreen) { docElm.msRequestFullscreen(); }" for starting Browser Full Screen, try with diferent ways: UniSession.JSCode (Data); OR UniSession.AddJs (Data); OR UniSession.JSONDirect (Data); but browser not going on Fullscreen. What I am wrong? Quote
Sherzod Posted December 5, 2016 Posted December 5, 2016 Hi, Fullscreen requires the event to originate with a user interactionYou could just tell the user to press F11 Best regards. Quote
irigsoft Posted December 6, 2016 Author Posted December 6, 2016 Thanks. I know that. I have a desktop application with user interface design, in this application enable users to create their own functions. Now, I will use unigui to create Web server applications with the designed form and functions. All functions are in text files so this web server will use UniSession.JSCode (Data); OR UniSession.AddJs (Data); OR UniSession.JSONDirect (Data), to complete them. it all starts with Button Click event. With an older version (I think 98) this example works fine, but with last version 99.1346 not work. Quote
irigsoft Posted December 6, 2016 Author Posted December 6, 2016 Yes. I try some potential with unigui. and soon will buy, but you should know what opportunities there Quote
irigsoft Posted December 6, 2016 Author Posted December 6, 2016 Or may be not with this support ? Quote
Sherzod Posted December 6, 2016 Posted December 6, 2016 Hi, For now can you try this?!: 1. MainForm -> Script: function launchIntoFullscreen(element) { if (element.requestFullscreen) { element.requestFullscreen(); } else if (element.mozRequestFullScreen) { element.mozRequestFullScreen(); } else if (element.webkitRequestFullscreen) { element.webkitRequestFullscreen(); } else if (element.msRequestFullscreen) { element.msRequestFullscreen(); } } function exitFullscreen() { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } } 2. For fullscreen Button -> ClientEvents -> ExtEvents -> function click: function click(sender, e, eOpts) { launchIntoFullscreen(document.documentElement); } 3. For exit fullscreen Button -> ClientEvents -> ExtEvents -> function click: function click(sender, e, eOpts) { exitFullscreen(); } Best regards. Quote
irigsoft Posted December 6, 2016 Author Posted December 6, 2016 Thanks. I want to know is this a bug ? Quote
Sherzod Posted December 6, 2016 Posted December 6, 2016 I want to know is this a bug ? I'm sorry, seems I do not quite understand you What do you mean?! Quote
irigsoft Posted December 6, 2016 Author Posted December 6, 2016 I would like to know is it possible can use the some of the above - mentioned methods to perform functions of the file. I started with tests rudimentary attempt fullscreen, but it did not work. Then I tried to use a similar method to let sound, but it did not work. I would like to note that I use the same script that worked on the old version. So I wonder if this is a bug in the version or another cause. Thanks. Quote
Harry Rogers Posted December 7, 2016 Posted December 7, 2016 The above code works for me on FF(v50), Edge(v38), Chrome(v55) but not IE (V11.447..) Quote
irigsoft Posted December 7, 2016 Author Posted December 7, 2016 Thanks. I use windows XP, Chrome Version 49.0.2623.112 m Start server, Create Main Form, after that I create other Application Form. On second form I create at run time different components, some have java script functions (this functions server read from "server path\files\JavascriptFileName.txt") When I click on some component must execute UniSession.JSCode (Data); Data = readed from file functions. On this scenario I can't execute javascript function Fullscreen. I try Delphi Developer's example on My smartphone Android 5.5 on my Tablet on My Windows XP Chrome browser on My Company Windows 7 Chrome broswer, server is running on Windows Xp, but "fullscreen" is not working. when I use F11, my Chrome go to "Fullscreen" Quote
Sherzod Posted December 7, 2016 Posted December 7, 2016 Hi, Sorry, If you asking a question, and if I understand you correctly, then you can use this: procedure TYourNewForm.UniFormCreate(Sender: TObject); ... begin ... NewUniButton.Name := 'NewName'; NewUniButton.ClientEvents.ExtEvents.Values['click'] := 'function click(sender, e, eOpts){yourJSFunction();}'; ... Quote
irigsoft Posted December 7, 2016 Author Posted December 7, 2016 Ok, I ask for this: Can I use UniSession.JSCode (Data); OR UniSession.AddJs (Data); OR UniSession.JSONDirect (Data); for Executing javascript on the fly. Quote
irigsoft Posted December 7, 2016 Author Posted December 7, 2016 I try this with in Button.OnClick (); begin UniSession.JSCode (' function launchIntoFullscreen(element) { alert (element.name); //here I expect button.name or some, but I get "undefined" if (element.requestFullscreen) { element.requestFullscreen(); } else if (element.mozRequestFullScreen) { element.mozRequestFullScreen(); } else if (element.webkitRequestFullscreen) { element.webkitRequestFullscreen(); } else if (element.msRequestFullscreen) { element.msRequestFullscreen(); } }; launchIntoFullscreen (document.documentElement);'); end; anybody can tell me why (new'm javascript) ? Quote
Hayri ASLAN Posted December 7, 2016 Posted December 7, 2016 use UniSession.AddJS instead of UniSession.JSCode Quote
irigsoft Posted December 8, 2016 Author Posted December 8, 2016 Hi, I try with UniSession.AddJS but no change still not going to FullScreen. So, can anybody tell me In demo version, this is a bug or this is a limitation ? Quote
Administrators Farshad Mohajeri Posted December 8, 2016 Administrators Posted December 8, 2016 Or may be not with this support ? Hi, Or support does not cover solving browser specific technologies and/or custom JS code which you send to the client to perform a specific task which again can be browser specific. That said, we do our best to help our customers in such cases. Since you are trying uniGUI since version 0.98, I think it is right time to switch to our commercial edition soon! Thank you PS: you can attach a test case for us to see what exactly is the problem. (or send it to info@fmsoft.net) Quote
Administrators Farshad Mohajeri Posted December 8, 2016 Administrators Posted December 8, 2016 It is a security limitation: http://stackoverflow.com/questions/29281986/run-a-website-in-fullscreen-mode If you test in uniGUI v0.98 it will also fail if you use it with recent browsers. Quote
irigsoft Posted December 8, 2016 Author Posted December 8, 2016 I install last version. I make my own server application and I want to know what can or can not to do with unigui. When I use unigui for the first time I try this option with JScode, AddJs and so on and all work fine. After that I install version 99.1309 and Fullscreen stop working, then install 1364 and no change. For that reason I want to know what is changed between this 3 versions. Logic on my server is: enabled user to can make own javascript function and add to application without changing programming code like *.js functions on other web servers. I try some functions like, play sound, start video, go to Full screen, url redirect , always with AddJs and data readed from text files. Everiting work fine on my first installed version on unigui, after upgrade for first time I lost all working functions. Change only unigui, not changed Chrome, not changed Windows XP or anything else Please help. Quote
Sherzod Posted December 8, 2016 Posted December 8, 2016 Hi, Can you make a small test case for this ?!! Best regards. Quote
Administrators Farshad Mohajeri Posted December 8, 2016 Administrators Posted December 8, 2016 Can you send a test case which works with version 0.98? Quote
irigsoft Posted December 8, 2016 Author Posted December 8, 2016 sorry, I dont have anymore older version. Quote
Sherzod Posted December 8, 2016 Posted December 8, 2016 Can you make a small test case for this ?!! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.