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 pathstring The path to the resource. It can be a remote URL or a path to a local file.
cbcallbacks An object containing two callbacks, { success : callback, error: callback }.
storageTypeCocoon.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 xnumber <optional>
The horizontal position where to show the WebView.
ynumber <optional>
The vertical position where to show the WebView.
widthnumber <optional>
The horitonzal size of the WebView.
heightnumber <optional>
the vertical size of the WebView.