PureBasic Forum
http://forums.purebasic.com/english/

Embed JS into PureBasic
http://forums.purebasic.com/english/viewtopic.php?f=12&t=63652
Page 2 of 4

Author:  JHPJHP [ Tue Oct 13, 2015 5:40 pm ]
Post subject:  Re: HTML5 Video Player with jQuery

Updated:
- TurnJSBook.pb, TurnJSBook_Create.pb

The update brings dynamic resizing to the page turning effect. Taking into consideration aspect ratios to maximize the fit of the book to your screen.
- create a new "Book" folder using the file TurnJSBook_Create.pb, pointing it to the folder TestFiles\FuturesEnd\
- next run the example TurnJSBook.pb pointing it at the newly created file TestFiles\Book1\FlipBook.div

It's worth noting for best results the first and last pages should have an orientation type of portrait, otherwise those images may be cropped or pressed.

Image

----------------------------------------------------------

Updated:
- VideoPlayer.pb, videoplayer.pbi

The update combines a JavaScript listener-event with the PureBasic Maximize / Restore events to remember a videos last position when switch between full-screen and normal view.

Remove window borders (excluding title bar) with the video players "Full screen" button. Optionally the "Zoom in" button will remove the black video borders.

Image

Author:  Fred [ Wed Oct 14, 2015 9:48 am ]
Post subject:  Re: JavaScript Frameworks from PureBasic

This is really great work !

Author:  JHPJHP [ Fri Oct 16, 2015 12:23 am ]
Post subject:  Re: Embed JS Framework into PureBasic

Hi Fred,

Thank you for finding the time in your busy schedule to comment, it means a lot.

------------------------------------------------

Updated:
- added another framework: Flot Charts
- added 2 examples
-- FlotPieChart.pb, flotpiechart.pbi
-- FlotThresholdChart.pb, flotthresholdchart.pbi
- renamed the video player examples to better reflect their origin (includes minor improvements)

The new examples FlotPieChart.pb and FlotThresholdChart.pb demonstrate only a couple of the many charts available (see website for details).

Image

Author:  IdeasVacuum [ Fri Oct 16, 2015 4:39 am ]
Post subject:  Re: Embed JS Framework into PureBasic

Hi JHPJHP

...working late but couldn't resist trying out your latest and greatest. I'm doing something wrong though:

1) Run TurnJSBook_Create.pb, Select the folder 'FuturesEnd' - success
2) Run TurnJSBook.pb, Select newly created book FlipBook.div - displays book, but only blank pages.

I'm using Win7 x86, PB5.31 32bit.

Author:  JHPJHP [ Fri Oct 16, 2015 1:20 pm ]
Post subject:  Re: Embed JS Framework into PureBasic

Hi IdeasVacuum,

First let me say thank you for posting your results.

blueb also reported this same problem, but I thought I had it worked out. Can you provide me a link to a compressed copy of the Book1 (TestFiles/Book1/) folder created after running TurnJSBook_Create.pb.

Thank you again.

Author:  IdeasVacuum [ Fri Oct 16, 2015 3:31 pm ]
Post subject:  Re: Embed JS Framework into PureBasic

Here we go:
Book1.zip

Author:  JHPJHP [ Fri Oct 16, 2015 4:22 pm ]
Post subject:  Re: Embed JS Framework into PureBasic

Hi IdeasVacuum,

Thank you for the upload, I now know what the problem was.
- needed quotes when the image path included spaces

Thank you again, without your feedback it would not have been resolved.

----------------------------------------------------

Updated:
- fixed the problem posted by IdeasVacuum

Author:  IdeasVacuum [ Fri Oct 16, 2015 6:49 pm ]
Post subject:  Re: Embed JS Framework into PureBasic

.... I should have thought of that myself Image

Author:  JHPJHP [ Sat Oct 17, 2015 4:31 am ]
Post subject:  Re: Embed JS Framework into PureBasic

Updated:
- renamed all the examples and includes
- added 2 examples
-- Flot_RealTime.pb, flot_realtime.pbi
-- Flot_Stacking.pb, flot_stacking.pbi

Unlike the other Flot examples Flot_RealTime.pb isn't linked to a PureBasic dataset, it's receiving random data from a JavaScript file.

Image

Author:  JHPJHP [ Mon Oct 19, 2015 8:24 pm ]
Post subject:  Re: Embed JS Framework into PureBasic

Updated:
- added 1 example
-- Flot_Selection.pb, flot_selection.pbi

Image

Author:  JHPJHP [ Wed Oct 21, 2015 12:18 am ]
Post subject:  Re: Embed JS Framework into PureBasic

Updated:
- added 1 example
-- AS3_Webcam.pb, as3_webcam.pbi

An example that brings your webcam to the WebGagdget.
- includes a snapshot option

NB*: Currently the getUserMedia function is not supported in IE, so the only way to host a webcam in a WebGadget is using adobe flash.

Image

Author:  JHPJHP [ Wed Oct 21, 2015 4:39 am ]
Post subject:  Re: Embed JS Framework into PureBasic

Updated the Flot chart examples.
- added a button to each example to save the charts to a JPEG file

Updated the example AS3_Webcam.pb, as3_webcam.pbi.
- set width / height (no error checking against available settings)
-- BuildCam(WebcamFolder, 320, 240)
- take a snapshot (previous image is replaced)
- save snapshot to a JPEG file
- save snapshot to a base64 encoded file

NB*: Keeping inline with the other examples, the new options are a mix of PureBasic and JavaScript working together.

Author:  JHPJHP [ Sat Oct 24, 2015 7:26 am ]
Post subject:  Re: Embed JS Framework into PureBasic

Hadrianus wrote:
Hi JHPJHP,

I love your JS-magic for Purebasic. Please take a look at ViewerJS.org, it's a fully independent PDF-viewer and free to use. I tried to connect this with PB. Perhaps you will bring this viewer to PB one day.

Hi Hadrianus,

Thank you, I'm glad you liked it.

While I'm not usually one for taking requests, the PDF viewer demonstrates the extensibility of this project in a new way.

I looked at ViewerJS.org, but it was a bit bloated so I decided to go straight to the source: PDF.js.

----------------------------------------------------------------------

Updated:
- added 1 example
-- PDFJS_Viewer.pb

An embedded PDF viewer with a nice interface in a resizable PureBasic Window / WebGadget: PDF.js Demo

Image.

Author:  Hadrianus [ Sun Oct 25, 2015 7:56 pm ]
Post subject:  Re: Embed JS Framework into PureBasic

Thanks a lot JHPJHP !
Also with window api stuff, I have to study this.

Author:  JHPJHP [ Thu Jan 07, 2016 3:41 am ]
Post subject:  Re: Embed JS Framework into PureBasic

Hi Hadrianus,

You're very much welcome, I hope it proves useful.

-------------------------------------------

Applied small updates and improvements.
- I noticed when running the examples consecutively, at various times the HTML5 registry update failed

I don't believe this to be more than a locked process due to the examples using the same temp executable; this should not occur in a production environment.
- added a trap to confirm whether or not the registry update was successful

-------------------------------------------

Applied some minor updates to the existing examples, nothing worth documenting.

Page 2 of 4 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/