Posts: 304
Threads: 19
Joined: Nov 2022
Reputation:
17
06-03-2023, 02:55 PM
(This post was last modified: 06-05-2023, 07:07 PM by grymmjack.
Edit Reason: Added explicit directions on how to use qbjs bbcode embed.
)
You can now use [qbjs] bbcode in your posts to embed qbjs.org code and play with it directly in the thread.
What is qbjs?
QBJS is an opensource project created by @dbox
QBJS is an implementation of the Basic programming language for the web, with multimedia support and easy sharing of programs. It aims to be compatible with QB64, which in turn implements the same dialect as the classic QBasic.
Support for browser APIs is built-in as of version 0.3.0-beta; a game engine is included separately.
Check it out on the qbjs GitHub
How do I use it?
- Go to https://qbjs.org
- Write some code
- Click the share button
- Copy the share link from the dialog to clipboard
- In forum use CTRL-SHIFT-S to switch to source mode (for whitespace preservation)
- Type: [qbjs]
- Paste from clipboard
- Type: [/qbjs]
Like this:
Anything you've made in qbjs.org IDE can be embedded in the new [qbjs] bbcode. You simply click the share button in qbjs.org, and copy the text and insert it between [qbjs] and [/qbjs] -- or you can just paste your share link from qbjs.org, select it, and click the QBJS button in the toolbar to wrap it in the new [qbjs] bbcode.
Here is an example:
(click the Play button to RUN it)
YOU CAN DO ALMOST ANYTHING YOU CAN DO IN QBASIC and QB64!
See: QBasic Language Support in QBJS
And: QBJS Supported Keywords (includes QBASIC and QB64, etc.)
Learn More:
Posts: 224
Threads: 7
Joined: Apr 2022
Reputation:
14
06-03-2023, 03:02 PM
(This post was last modified: 06-03-2023, 03:07 PM by vince.)
very nice, go team Steve!
Posts: 1,510
Threads: 53
Joined: Jul 2022
Reputation:
47
Pretty cool, this would increase the interest generally in QB64, not necessarily in any "one product".
Good job. Notice now the icon which is the most left-hand-side, to insert QBJS code into the post.
grymmjack congratulations on your promotion to admin!
Posts: 304
Threads: 19
Joined: Nov 2022
Reputation:
17
06-03-2023, 05:31 PM
(This post was last modified: 06-03-2023, 05:32 PM by grymmjack.
Edit Reason: Answering more thoroughly
)
(06-03-2023, 04:04 PM)mnrvovrfc Wrote: Pretty cool, this would increase the interest generally in QB64, not necessarily in any "one product".
Yes exactly! That's the hope
(06-03-2023, 04:04 PM)mnrvovrfc Wrote: Good job. Notice now the icon which is the most left-hand-side, to insert QBJS code into the post.
grymmjack congratulations on your promotion to admin!
Thank you @mnrvovrfc !
Happy to help lend a hand.
Posts: 241
Threads: 10
Joined: Apr 2022
Reputation:
30
Nice addition and clean optic implementation.
One thing, annoying me (maybe only me), once you've started a QBJS program and then leaving the thread either by clicking a link, browser favorite shortcut or browser back button, the browser pops up a "Do you really wanna leave the page" (Firefox). It happens also when the program has finished or was stopped. I would understand it to happen as long as a program is still running, but not after it has finished or was stopped again, maybe this could be changed. However, no rush, it's probably just my perfectionism comming into my way here.
Posts: 304
Threads: 19
Joined: Nov 2022
Reputation:
17
06-03-2023, 07:11 PM
(This post was last modified: 06-03-2023, 07:12 PM by grymmjack.
Edit Reason: Yeesh - removing pasted image inline png.
)
Cheers @RhoSigma
I don't know if there is anything we can do about this, @dbox does it do this as part of it's design?
@RhoSigma I did see though that you can disable this globally in Firefox with about:config
Posts: 241
Threads: 10
Joined: Apr 2022
Reputation:
30
(06-03-2023, 07:11 PM)grymmjack Wrote: Cheers @RhoSigma
I don't know if there is anything we can do about this, @dbox does it do this as part of it's design?
@RhoSigma I did see though that you can disable this globally in Firefox with about:config
Thanx, that works perfect and it eleminates this annoying popup once and forever on every page.
Posts: 159
Threads: 10
Joined: Apr 2022
Reputation:
32
(06-03-2023, 07:04 PM)RhoSigma Wrote: Nice addition and clean optic implementation.
One thing, annoying me (maybe only me), once you've started a QBJS program and then leaving the thread either by clicking a link, browser favorite shortcut or browser back button, the browser pops up a "Do you really wanna leave the page" (Firefox). It happens also when the program has finished or was stopped. I would understand it to happen as long as a program is still running, but not after it has finished or was stopped again, maybe this could be changed. However, no rush, it's probably just my perfectionism comming into my way here.
That was put in place to try to help folks not lose their edits by accidently navigating away from the page before they meant to.
In the embedded context on the forum though, yeah, that will get annoying. I think what I will do is put together a quick patch that will detect whether it is embedded and, if so, disable that popup from triggering.
Posts: 490
Threads: 95
Joined: Apr 2022
Reputation:
23
06-03-2023, 08:31 PM
(This post was last modified: 06-03-2023, 08:34 PM by CharlieJV.)
(06-03-2023, 02:55 PM)grymmjack Wrote: ...snip...
If I happen to do anything with a QBJS program embedded in a thread of discussion (even just run it), the moment I try to get out of that thread of discussion (back button, whatever), my browser annoyingly asks me if I want to leave the site. That is going to drive me to drink.
Otherwise, cool, and should be setup in the wiki so that examples can be run, right there. (Well, after there's a fix for this annoying "Leave site?" prompt.)
Posts: 159
Threads: 10
Joined: Apr 2022
Reputation:
32
(06-03-2023, 08:21 PM)dbox Wrote: (06-03-2023, 07:04 PM)RhoSigma Wrote: Nice addition and clean optic implementation.
One thing, annoying me (maybe only me), once you've started a QBJS program and then leaving the thread either by clicking a link, browser favorite shortcut or browser back button, the browser pops up a "Do you really wanna leave the page" (Firefox). It happens also when the program has finished or was stopped. I would understand it to happen as long as a program is still running, but not after it has finished or was stopped again, maybe this could be changed. However, no rush, it's probably just my perfectionism comming into my way here.
That was put in place to try to help folks not lose their edits by accidently navigating away from the page before they meant to.
In the embedded context on the forum though, yeah, that will get annoying. I think what I will do is put together a quick patch that will detect whether it is embedded and, if so, disable that popup from triggering.
Ok, the update is in place. This prompt should go away point forward. If you still see the prompt on pages you've visited before, you might need to right click in the QBJS window and select "Reload Frame" to make sure the browser is loading the latest version.
|