Page 1 of 1

Messi - nice popup library

Posted: Sun Mar 26, 2017 9:51 am
by e2robot
http://messijs.github.io/MessiJS/demos/


Simple example (does 4 example popups)

Code: Select all

!$("head").append("<link rel='stylesheet' type='text/css' href='http://messijs.github.io/MessiJS/stylesheets/messi.css' />");

!$.getScript("http://messijs.github.io/MessiJS/javascripts/messi.js", loadok);
!function loadok()
!{
Debug "OK"
!}





Procedure messi(title.s,message.s)
   
 !   new Messi(v_message, {title: v_title, titleClass: 'anim error', modal: true , buttons: [{id: 0, label: 'Close', val: 'X'}]});
 !  new Messi(v_message, {title: v_title, titleClass: 'anim info', modal: true , buttons: [{id: 0, label: 'Close', val: 'X'}]});
 !  new Messi(v_message, {title: v_title, titleClass: 'anim warning ', modal: true , buttons: [{id: 0, label: 'Close', val: 'X'}]});
 !  new Messi(v_message, {title: v_title, titleClass: 'anim success', modal: true , buttons: [{id: 0, label: 'Close', val: 'X'}]});
    
    
 
    
    
    
    

  
EndProcedure


Procedure buttonpressed()
  
messi("Error","No Problem !!")
  
  EndProcedure

If OpenWindow(1, 1, 1, 200, 100, "TEST", #PB_Window_SystemMenu|#PB_Window_TitleBar)

ButtonGadget(1 ,60, 50, 75, 30, "GO")
BindGadgetEvent(1,@buttonpressed(),#PB_EventType_LeftClick)

EndIf


More complex (with call back to SB code)
Compile with debugger on as that's what I am using in callback to test interaction

Code: Select all

!$("head").append("<link rel='stylesheet' type='text/css' href='http://messijs.github.io/MessiJS/stylesheets/messi.css' />");

!$.getScript("http://messijs.github.io/MessiJS/javascripts/messi.js", loadok);
!function loadok()
!{
Debug "OK"
!}





Procedure messi(title.s,message.s)
   
        
!    new Messi(v_message,{title: v_title,modal: true,buttons: [{id: 0, label: 'Yes', val: 'Y'},{id: 1, label: 'No', val: 'N'}],callback: function(val) { v_sb=val;
 
 If sb.s="Y"
   Debug "Yes"
 
 EndIf
 
 If sb.s="N"
   Debug "No"
  
 EndIf
  
 !}
 !}
!);
    
     
  
EndProcedure


Procedure buttonpressed()
  
messi("This is the title","This is the message")
  
  EndProcedure

If OpenWindow(1, 1, 1, 200, 100, "TEST", #PB_Window_SystemMenu|#PB_Window_TitleBar)

ButtonGadget(1 ,60, 50, 75, 30, "GO")
BindGadgetEvent(1,@buttonpressed(),#PB_EventType_LeftClick)

EndIf


Re: Messi - nice popup library

Posted: Fri May 12, 2017 9:08 am
by IdeasVacuum
Hi e2robot

Just tried your examples, very nice indeed. I have seen a lot of javascript that relies on the successful connection to the developer's server

Code: Select all

!$.getScript("http://messijs.github.io/MessiJS/javascripts/messi.js", loadok);
If for any reason that should fail, effectively your app fails with it since an essential part won't be there?

Re: Messi - nice popup library

Posted: Mon May 15, 2017 2:07 am
by e2robot
You can easily save a copy of the external JS library locally and link to local copy

Just go to http://messijs.github.io/MessiJS/javascripts/messi.js

Cut and paste all the content into a js file stored on your web server instead.

Adjust your Spiderbasic program to load local js file.

Regards,
Phil

Re: Messi - nice popup library

Posted: Tue May 16, 2017 11:59 am
by IdeasVacuum
Hello Phil, I hear you, but that isn't necessarily better or safer - it still relies on the availability of a Web Server.
What if the app is compiled to Android/iOS/MacOS/Win10/Linux? You could have a portable device running any of those but not necessarily have an Internet connection.

So, in an ideal world, we want the javascript code compiled with the SB code, Internet dependency thus reduced, or nil.

Re: Messi - nice popup library

Posted: Tue May 16, 2017 12:52 pm
by falsam
What if the app is compiled to Android/iOS/MacOS/Win10/Linux? You could have a portable device running any of those but not necessarily have an Internet connection.
Hello IdeasVacuum.

If the javascript file (messi.js) is included in the code folder, it will be exported to your mobile application.

The mobile app contains a browser that will interpret the Javascript code of your application.

An APK file is a compressed file that will contain the folders of your apllication and the javascript code generated by Spiderbasic.

If one of your folders contains messi.js, it will also be interpreted.

An internet connection is not necessary.

Re: Messi - nice popup library

Posted: Tue May 16, 2017 1:54 pm
by IdeasVacuum
Hi Falsam - good to hear from you. Thanks for the explanation, that's perfect.
What do you think - would it be good to be able to define an app for Windows10 too?

Re: Messi - nice popup library

Posted: Tue May 16, 2017 3:36 pm
by falsam
IdeasVacuum wrote:What do you think - would it be good to be able to define an app for Windows10 too?
To generate mobile applications, SpiderBasic uses the Cordova SDK.

This SDK can also generate applications for Windows 10 (1) and Windows Phone. I do not know the dependencies required because I never create applications for windows 10.

Spiderbasic will be able to generate applications Windows 10 and Windows Phone? Mystery ;)

(1) Requirements : Windows 10, Windows 8.1, Windows Phone 8.1