This namespace represents all functionalities available in Canvas+ internal WebView.
Example
Cocoon.WebView.on("load",{ success : function(){ Cocoon.App.showTheWebView(); }, error : function(){ console.log("Cannot show the Webview for some reason :/"); } }); Cocoon.App.loadInTheWebView("WV.html");
Methods
-
<static> hide()
-
Hides the transparent WebView on top of Canvas+.
-
<static> loadInCocoon(path, cb, storageType)
-
Loads a resource in Canvas+ from the WebView.
Parameters:
Name Type Argument Description path
string The path to the resource. It can be a remote URL or a path to a local file.
cb
callbacks An object containing two callbacks, { success : callback, error: callback }.
storageType
Cocoon.App.StorageType <optional>
An optional parameter to specify at which storage in the device the file path is stored. By default, APP_STORAGE is used.
success: This callback function allows listening to events called when Canvas+ load has completed successfully.
error: This callback function allows listening to events called when Canvas+ load fails.Example
Cocoon.WebView.loadInCocoon("index.html", { success : function(){ ... }, error : function(){ ... } });
-
<static> show(x, y, width, height)
-
Shows a transparent WebView on top of the Cocoon hardware accelerated environment rendering context.
Parameters:
Name Type Argument Description x
number <optional>
The horizontal position where to show the WebView.
y
number <optional>
The vertical position where to show the WebView.
width
number <optional>
The horitonzal size of the WebView.
height
number <optional>
the vertical size of the WebView.