×
Namespaces

Variants
Actions
(Difference between revisions)

Adding a Guarana UI busy indicator on a web page

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Fix metadata)
hamishwillee (Talk | contribs)
m (Hamishwillee - Add Abstract. Tidy wiki text)
 
Line 1: Line 1:
 +
[[Category:Symbian]][[Category:Guarana UI]][[Category:Code Examples]]
 
{{ArticleMetaData <!-- v1.2 -->
 
{{ArticleMetaData <!-- v1.2 -->
 
|sourcecode= [[Media:adding a guarana ui busy.diff.zip]] [[Media:adding a guarana ui busy.zip]]
 
|sourcecode= [[Media:adding a guarana ui busy.diff.zip]] [[Media:adding a guarana ui busy.zip]]
Line 21: Line 22:
 
|author= [[User:Tapla]]
 
|author= [[User:Tapla]]
 
<!-- The following are not in current metadata -->
 
<!-- The following are not in current metadata -->
|subcategory= Guarana UI, UI
 
 
|id= CS001549
 
|id= CS001549
 
}}
 
}}
Line 27: Line 27:
 
==Overview==
 
==Overview==
  
This code snippet demonstrates how to add a busy indicator on a web page using Guarana UI components. The busy indicator looks like this:<br/>
+
{{Abstract|This code snippet demonstrates how to add a busy indicator on a web page using Guarana UI components.}} The busy indicator looks like this:
[[File:Guarana busy icon.jpg]]<br/>
+
[[File:Guarana busy icon.jpg|none]]
You can download the component library from [[Guarana UI: a jQuery-Based UI Library for Nokia WRT|Nokia Developer]].
+
You can download the component library from [[Guarana UI: a jQuery-Based UI Library for Nokia WRT]].
  
 
==Source: Relevant HTML components==
 
==Source: Relevant HTML components==
Line 144: Line 144:
 
* For general information on applying the patch, see [[Using Diffs]].
 
* For general information on applying the patch, see [[Using Diffs]].
 
* For unpatched stub applications, see [[Example app stubs with logging framework]].
 
* For unpatched stub applications, see [[Example app stubs with logging framework]].
 
[[Category:Symbian]][[Category:Guarana UI]][[Category:Code Examples]][[Category:Code Snippet]]
 

Latest revision as of 08:54, 5 October 2012

Article Metadata
Code ExampleTested with
Devices(s): Nokia N97, Nokia 5800 XpressMusic
Compatibility
Platform(s):
Symbian
Article
Created: tapla (23 Nov 2009)
Last edited: hamishwillee (05 Oct 2012)

Contents

[edit] Overview

This code snippet demonstrates how to add a busy indicator on a web page using Guarana UI components. The busy indicator looks like this:

Guarana busy icon.jpg

You can download the component library from Guarana UI: a jQuery-Based UI Library for Nokia WRT.

[edit] Source: Relevant HTML components

<head>
<!-- Guarana UI style sheets -->
<link rel="stylesheet"
href="style/themes/themeroller/default-theme/ui.all.css"
type="text/css" media="screen">
 
<!-- Guarana UI scripts -->
<script type="text/javascript" src="lib/jquery/jquery.js"
charset="utf-8"></script>
<script type="text/javascript" src="lib/guarana/defaults.js"
charset="utf-8"></script>
<script type="text/javascript" src="lib/guarana/core.js"
charset="utf-8"></script>
</head>
<body>
<div id="bodyContent" class="bodyContent">
<div id="busyIndicatorContainer"></div>
</div>
</body>

[edit] Source: Relevant CSS declarations

#busyIndicatorContainer {
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
}

[edit] Source: JavaScript

// Initializes the widget
function init() {
createMenu();
 
window.busyIndicator = new Nokia.Busy({
element: "#busyIndicatorContainer",
autoOpen: false
});
}
 
// Executes the snippet.
// Shows the busy indicator and hides it after 2 seconds.
function executeSnippet() {
window.busyIndicator.show();
setTimeout(function() {
window.busyIndicator.hide();
}, 2000);
}

The executeSnippet() function above shows the busy indicator (the show() method) and hides it after 2 seconds (the hide() method).

Note: The busy indicator component requires the following files from the library:

  • lib/jquery/jquery.js
  • src/core.js
  • src/defaults.js
  • src/dom.js (implicitly loaded by core.js)
  • src/util.js (implicitly loaded by core.js)
  • src/device.js (implicitly loaded by core.js)
  • src/animation.js (implicitly loaded by core.js)
  • src/widget.js (implicitly loaded by core.js)
  • src/busy.js (implicitly loaded by core.js)
  • themes/nokia/base/base.css (implicitly loaded by core.js)
  • themes/nokia/base/busy.css (implicitly loaded by core.js)
  • themes/nokia/base/images/busyindicator.gif (from busy.css)
  • themes/nokia/base/images/shadow.png (from base.css)
  • themes/nokia/base/images/shadow-c.png (from base.css)
  • themes/nokia/base/images/shadow-lr.png (from base.css)
  • themes/themeroller/default-theme/ui.accordion.css
  • themes/themeroller/default-theme/ui.all.css
  • themes/themeroller/default-theme/ui.base.css
  • themes/themeroller/default-theme/ui.core.css
  • themes/themeroller/default-theme/ui.theme.css
  • themes/themeroller/default-theme/images/ui-bg_diagonals-thick_10_444444_40x40.png (from ui.theme.css)
  • themes/themeroller/default-theme/images/ui-bg_flat_0_000000_40x100.png (from ui.theme.css)
  • themes/themeroller/default-theme/images/ui-bg_glass_20_9f1504_640x400.png (from ui.theme.css)
  • themes/themeroller/default-theme/images/ui-bg_glass_40_8ab61c_640x400.png (from ui.theme.css)
  • themes/themeroller/default-theme/images/ui-bg_glass_55_8ab61c_640x400.png (from ui.theme.css)
  • themes/themeroller/default-theme/images/ui-bg_glass_100_c2cba5_640x400.png (from ui.theme.css)
  • themes/themeroller/default-theme/images/ui-bg_highlight-hard_80_ededed_640x100.png (from ui.theme.css)
  • themes/themeroller/default-theme/images/ui-bg_highlight-soft_100_ededed_640x100.png (from ui.theme.css)
  • themes/themeroller/default-theme/images/ui-icons_89bf43_256x240.png (from ui.theme.css)
  • themes/themeroller/default-theme/images/ui-icons_97B72B_256x240.png (from ui.theme.css)
  • themes/themeroller/default-theme/images/ui-icons_222222_256x240.png (from ui.theme.css)
  • themes/themeroller/default-theme/images/ui-icons_e3bfb5_256x240.png (from ui.theme.css)
  • themes/themeroller/default-theme/images/ui-icons_ffffff_256x240.png (from ui.theme.css)

[edit] Postconditions

A busy indicator is shown on the web page and hidden after 2 seconds.

[edit] See also

[edit] Supplementary material

This code snippet is part of the stub concept, which means that it has been patched on top of a template application in order to be more useful for developers. The version of the WRT stub application used as a template in this snippet is v1.2.

This page was last modified on 5 October 2012, at 08:54.
91 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×