Sistema Fenix Posted October 19, 2016 Share Posted October 19, 2016 Hi Follows a tip for using the notification by the browser. Add push_notification.js in folder files Add in the uniServerModule->CustomFiles To dispare notification: procedure FenixNotification(pTitle, pMessage:String); var vJS: String; begin vjs := format('jQuery(document).ready(function($){$.notify("%s",{title: "%s", icon: "http:\\dominio.com\yourimage.png"});});',[pMessage,pTitle]); UniSession.AddJS(vjs); end; procedure TFMenu.ButtonNotrClick(Sender: TObject); begin FenixNotification('Fenix','Your session is expiring.'; end; Best regards push_notification.zip 1 3 Link to comment Share on other sites More sharing options...
Harry Rogers Posted October 19, 2016 Share Posted October 19, 2016 Thanks for that Fenix - it works a treat. Link to comment Share on other sites More sharing options...
mehmet07 Posted October 19, 2016 Share Posted October 19, 2016 thanks Fenix Link to comment Share on other sites More sharing options...
Harry Rogers Posted October 20, 2016 Share Posted October 20, 2016 How would you go about adding an audio notification to this? Cheers Link to comment Share on other sites More sharing options...
Sistema Fenix Posted October 20, 2016 Author Share Posted October 20, 2016 Hi HarryG, I found nothing about audio. You can use another command before calling the notification. Look at this example: https://github.com/admsev/jquery-play-sound https://jsfiddle.net/admsev/xscxya0g/ Link to comment Share on other sites More sharing options...
Harry Rogers Posted October 21, 2016 Share Posted October 21, 2016 Ok many thanks Fenix Link to comment Share on other sites More sharing options...
roneydourados Posted June 28, 2017 Share Posted June 28, 2017 Thanks Fenix!!!!!!! Link to comment Share on other sites More sharing options...
sparkz Posted September 8, 2017 Share Posted September 8, 2017 Fenix, this looks like a really useful bit of code. I'm new to the java side and am struggling to get this to work - I get "$.notify is not a function" errors. I suspect because I haven't setup things correctly. Have you got a sample project with this or some other bit of JS so I can learn from it. Thanks Link to comment Share on other sites More sharing options...
sparkz Posted September 9, 2017 Share Posted September 9, 2017 The .js file is included in the server CustomFiles: files/push_notification.js I'm calling the following on a button click in the client main form: procedure PushNotification(sTitle, sMessage: String); var sJS: String; begin sJS := Format('jQuery(document).ready(function($){$.notify("%s",{title: "%s", icon: ""});});', [sMessage, sTitle]); UniSession.AddJS(sJS); end; But I get the following error: I can put the JS code into the script directly and it works fine but I can't get the interaction between calling the "notify" function and the library .js file to work. I assume it's not finding the library? It seems to be one of those aspects not well documented, I'd really appreciate if someone could tell me what I may be missing... JSTest.zip Link to comment Share on other sites More sharing options...
acms Posted December 14, 2017 Share Posted December 14, 2017 Same problem to me : "$.notify is not a function" Fenix, this looks like a really useful bit of code. I'm new to the java side and am struggling to get this to work - I get "$.notify is not a function" errors. I suspect because I haven't setup things correctly. Have you got a sample project with this or some other bit of JS so I can learn from it. Thanks Link to comment Share on other sites More sharing options...
leons Posted December 14, 2017 Share Posted December 14, 2017 Hi Fenix, Works on my local machine for Chrome, IE and Edge with the program as stand-alone server. On IIS/ISAPI on the server as dll, only Edge is working. Any idea? Leon Link to comment Share on other sites More sharing options...
edujgomes5 Posted July 12, 2023 Share Posted July 12, 2023 On 10/19/2016 at 8:47 AM, Sistema Fenix said: Hi Follows a tip for using the notification by the browser. Add push_notification.js in folder files Add in the uniServerModule->CustomFiles To dispare notification: procedure FenixNotification(pTitle, pMessage:String); var vJS: String; begin vjs := format('jQuery(document).ready(function($){$.notify("%s",{title: "%s", icon: "http:\\dominio.com\yourimage.png"});});',[pMessage,pTitle]); UniSession.AddJS(vjs); end; procedure TFMenu.ButtonNotrClick(Sender: TObject); begin FenixNotification('Fenix','Your session is expiring.'; end; Best regards push_notification.zipUnavailable Alguém ainda tem esse arquivo (push_notification.zip) para disponibilizar? Gostaria de implementar no meu projeto. Link to comment Share on other sites More sharing options...
Sherzod Posted July 12, 2023 Share Posted July 12, 2023 24 minutes ago, edujgomes5 said: Alguém ainda tem esse arquivo (push_notification.zip) para disponibilizar? Gostaria de implementar no meu projeto. Which edition and build of uniGUI are you using? Link to comment Share on other sites More sharing options...
edujgomes5 Posted July 12, 2023 Share Posted July 12, 2023 6 minutes ago, Sherzod said: Qual edição e compilação do uniGUI você está usando? Uso esta: 1.90.0.1555 Link to comment Share on other sites More sharing options...
Sherzod Posted July 12, 2023 Share Posted July 12, 2023 Trial? Link to comment Share on other sites More sharing options...
edujgomes5 Posted July 12, 2023 Share Posted July 12, 2023 3 minutes ago, Sherzod said: Trial? Não, versão completa. Link to comment Share on other sites More sharing options...
Sherzod Posted July 12, 2023 Share Posted July 12, 2023 Just now, edujgomes5 said: Não, versão completa. Then please adjust your forum email address first: Link to comment Share on other sites More sharing options...
edujgomes5 Posted July 12, 2023 Share Posted July 12, 2023 2 hours ago, Sherzod said: Em seguida, ajuste primeiro o endereço de e-mail do seu fórum: Estava com a cabeça cheia, respondi errado, uso uma versão trial, ainda estamos estudando a possibilidade de comprar a versão completa. desculpe-me por isso. Link to comment Share on other sites More sharing options...
Sherzod Posted July 13, 2023 Share Posted July 13, 2023 5 hours ago, edujgomes5 said: Uso esta: 1.90.0.1555 And are you using this trial version? Link to comment Share on other sites More sharing options...
edujgomes5 Posted July 13, 2023 Share Posted July 13, 2023 13 hours ago, Sherzod said: E você está usando esta versão de teste? sim Link to comment Share on other sites More sharing options...
Sherzod Posted July 13, 2023 Share Posted July 13, 2023 16 minutes ago, edujgomes5 said: sim I'm sorry, but this doesn't seem to be true. You are using a pirated version then... Link to comment Share on other sites More sharing options...
chefdackel Posted July 14, 2023 Share Posted July 14, 2023 @edujgomes5and please.... tranlating in english is so easy today. So we can all be part of the conversation. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now