BANano v5.10
TAKE A BACKUP!
CHANGES:
[UPDATE] Complete rewrite of BANano.TranspilerOptions.RemoveDeadCode
-----------------------------------------------------------------------------------------
The RemoveDeadCode setting has had a complete overhaul. It is a lot smarter than before.
A new setting was also introduced to ignore a certain method to be removed. Just add 'IgnoreDeadCode after the method you want te be ignored.
This is needed in cases like this, as the Transpiler does not know if the method getimageurl is used or not:
Store.SetMethod(Me, "getimageurl")
...
Sub getimageurl(url As String) As String 'IgnoreDeadCode
Return $".${url}"$
End Sub
[NEW] BANano.AddServiceWorkerSyncMethod
------------------------------------------------------
Can only be used in AppStart. Module and method name can NOT be variables.
A Sync method must return a BANanoPromise!
This can be used to add extra functionalities to the ServiceWorker.
Most useful for PWAs using the BANanoServer library.
Example:
' activate the service worker
Server.BANano.TranspilerOptions.UseServiceWorker = True
'define a service worker method and the BROWSER method that will make the call to the SERVER API Handler url
Server.BANano.AddServiceWorkerSyncMethod("sync-db", "BROWSERSyncDB", "SyncDB") ' In hybrid BANano Web Apps the prefix BROWSER/SERVER/SHARED is important!
' add the SERVER API handler
Server.AddHandler("/v1/sync/*", "SERVERSyncDB", False) ' In hybrid BANano Web Apps the prefix BROWSER/SERVER/SHARED is important!
[NEW] BANano.RunServiceWorkerSyncMethod
------------------------------------------------------
Runs this Service Worker Sync Method in the background (previously added with AddServiceWorkerSyncMethod) if supported by the browser.
Example, running the above method:
BANano.RunServiceWorkerSyncMethod("syncdb")
[NEW] BANano.BP: Set a breakpoint
------------------------------------------
Stops the execution of JavaScript. Is ignored if in release mode.
Use the Developer Tools in the browser to inspect e.g. variable values.
[NEW] BANano.TM
----------------------
Is ignored in Release mode.
Track Method. Use it in a Sub to trace some info after it ran in the browsers log.
[NEW] BANano.TMC
------------------------
Is ignored in Release mode.
Same as TM (TrackMethod), but initially collapsed
[DEPRECIATED] BANano.CallDebugger
--------------------------------------------
Use BANano.BP instead
[DEPRECIATED] BANano.DebugtrackLine
-----------------------------------------------
Use BANano.BP instead
[DEPRECIATED] BANano.DebugTrackMethod
---------------------------------------------------
Use BANano.TM or BANano.TMC instead
[NEW] BANano.ExternalHTMLToHTMLBlocks
----------------------------------------------------
Can only be used in AppStart
Useful if you use an external Designer.
Will extract all html blocks where the HTML tag has the class BANANO.
if the class = BANANO, then the body HTML String will not contain these elements.
You can later get their HTML by using the GetHTMLBlock() method.
The Body HTML can be returned with the GetHTMLBody() method.
[NEW] BANano.GetHTMLBlock
-----------------------------------
Returns the HTML String from a removed HTML Block (using the BANANO class)
previously added with the ExternalHTMLToHTMLBlocks() method.
The idPostFix will be added to the original Id as _idPostFix. Is normally a number.
[NEW] BANano.HTMLBody
-------------------------------
returns the HTML String with all HTML Blocks having the BANANO class removed.
[NEW] BANano.GenerateUUID
-----------------------------------
Generates a UUID. Works both in B4J as in BANano code
[NEW] BANano.GetP/SetP
------------------------------
Method to get/set a property from any class
Can be useful for example if you want to get/set a property from a class by name.
The second parameter is Case Sensitive and MUST be a literal String!
Example:
BANano.SetP(mSelf, "mClasses", props.Get("Classes"))
For an example usage, check out the BANanoSkeleton source code.
[NEW] BANanoObject.Initialize5
-------------------------------------
Can be used to create a plain Javascript object. This is basically set the object in Javascript to {}
Example:
Dim options As BANanoObject
options.Initialize5
options.SetField("field", mElement.ToObject)
[NEW] BANano.TranspilerOptions.RedirectOutput
---------------------------------------------------------
Redirects the logs to a file. Must be set in AppStart.
[NEW] BANano.TranspilerOptions.EnableLiveCodeSwapping
---------------------------------------------------------------------
Enable Live Code Swapping and watch live changes made in the B4J source code.
On Save, the changed B4J code is Transpiled again and reloaded by the browser.
Default = true
For more info:
https://www.b4x.com/android/forum/threads/banano-live-code-swapping-in-v5-preview.118053/#content
[NEW] the BANanoSkeleton library has been updated extensively
---------------------------------------------------------------------------
Optimized the Custom Views code.
Now uses the Roboto font and can use Font Awesome Icons.
Because it is no longer just a wrapper of SkeletonCSS, it is now just called Skeleton.
New components:
SKBreadCrumbs
SKChip
SKDatePicker
SKDivider
SKDropButton
SKEditor
SKFloatingButton
SKMobileNav
SKModal
SKPagination
SKQRCode
SKSideBar
SKSignaturePad
SKTabs
Toasts have also been added and if SKTextBox is a file selector, it got a new look.
Some general theme settings can be set very quickly:
SKTools.SetBaseColor("#546e7a")
SKTools.SetDatePickerSelectedColor("#00ff00")
SKTools.SetDatePickerHoverColor("#ff0000")
SKTools.SetFloatingButtonBottom(100)
SKTools.SetBadgeBackColor("#00ff00")
SKTools.WriteTheme ' IMPORTANT
See the DemoNewComponents in the BANanoLibraries\Skeleton folder for a demo of these components.
[FIX] Smaller bug fixes in the transpiler
---------------------------------------------
Download: https://www.b4x.com/android/forum/t...-abstract-designer-support.99740/#post-627764
Alwaysbusy