diff --git a/css/jquery.mobile.theme.css b/css/jquery.mobile.theme.css index e4bf6421..b14201c6 100755 --- a/css/jquery.mobile.theme.css +++ b/css/jquery.mobile.theme.css @@ -14,7 +14,7 @@ .ui-bar-a .ui-link-inherit { color: #fff; } .ui-bar-a .ui-link { color: #7cc4e7; font-weight: bold; } -.ui-body-a { border: 1px solid #2A2A2A; background: #333; color: #fff; text-shadow: 0 1px 0 #000; font-weight: normal; background-image: -moz-linear-gradient(top, #666666, #333333); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #333333),color-stop(1, #(top, #666666, #333333))); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#666666', EndColorStr='#333333)')"; } +.ui-body-a { border: 1px solid #2A2A2A; background: #333; color: #fff; text-shadow: 0 1px 0 #000; font-weight: normal; background-image: -moz-linear-gradient(top, #666666, #222222); -webkit-gradient(linear,left top,left bottom,color-stop(0, #666666),color-stop(1, #222222)); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#666666', EndColorStr='#222222)')"; } .ui-body-a, .ui-body-a input, .ui-body-a select, .ui-body-a textarea, .ui-body-a button { font-family: Helvetica, Arial, sans-serif; } .ui-body-a .ui-link-inherit { color: #fff; } .ui-body-a .ui-link { color: #2489CE; font-weight: bold; } @@ -25,16 +25,16 @@ .ui-bar-b .ui-link-inherit { color: #fff; } .ui-bar-b .ui-link { color: #7cc4e7; font-weight: bold; } -.ui-body-b { border: 1px solid #C6C6C6; background: #e6e7e8; color: #333333; text-shadow: 0 1px 0 #fff; font-weight: normal; background-image: -moz-linear-gradient(top, #d4d5d5, #c6c7c8); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #d4d5d5),color-stop(1, #c6c7c8)); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#d4d5d5', EndColorStr='#c6c7c8')"; } +.ui-body-b { border: 1px solid #C6C6C6; background: #e6e7e8; color: #333333; text-shadow: 0 1px 0 #fff; font-weight: normal; background-image: -moz-linear-gradient(top, #eeeeee, #c6c7c8); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #c6c7c8)); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#d4d5d5', EndColorStr='#c6c7c8')"; } .ui-body-b, .ui-body-b input, .ui-body-b select, .ui-body-b textarea, .ui-body-b button { font-family: Helvetica, Arial, sans-serif; } .ui-body-b .ui-link-inherit { color: #333333; } .ui-body-b .ui-link { color: #2489CE; font-weight: bold; } -.ui-bar-c { border: 1px solid #B3B3B3; background: #dfe0e1; color: #3E3E3E; font-weight: bold; text-shadow: 0 1px 1px #fff; background-image: -moz-linear-gradient(top, #f2f2f2, #e9eaeb); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #f2f2f2),color-stop(1, #e9eaeb)); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#f2f2f2', EndColorStr='#e9eaeb')"; } +.ui-bar-c { border: 1px solid #B3B3B3; background: #f0f0f0; color: #3E3E3E; font-weight: bold; text-shadow: 0 1px 1px #fff; background-image: -moz-linear-gradient(top, #f0f0f0, #e9eaeb); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #f0f0f0),color-stop(1, #e9eaeb)); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#f0f0f0', EndColorStr='#e9eaeb')"; } .ui-bar-c, .ui-bar-c input, .ui-bar-c select, .ui-bar-c textarea, .ui-bar-c button { font-family: Helvetica, Arial, sans-serif; } -.ui-body-c { border: 1px solid #B3B3B3; background: #fff; color: #333333; text-shadow: 0 1px 0 #fff; } +.ui-body-c { border: 1px solid #B3B3B3; color: #333333; text-shadow: 0 1px 0 #fff; background: #f0f0f0; background-image: -moz-linear-gradient(top, #fff, #f0f0f0); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #fff),color-stop(1, #f0f0f0)); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#fff', EndColorStr='#f0f0f0')"; } .ui-body-c, .ui-body-c input, .ui-body-c select, .ui-body-c textarea, .ui-body-c button { font-family: Helvetica, Arial, sans-serif; } .ui-body-c .ui-link-inherit { color: #333333; } .ui-body-c .ui-link { color: #2489CE; font-weight: bold; } @@ -45,6 +45,11 @@ .ui-bar-d .ui-link-inherit { color: #333; } .ui-bar-d .ui-link { color: #2489CE; font-weight: bold; } +.ui-body-d { border: 1px solid #F7C942; color: #333333; text-shadow: 0 1px 0 #fff; background: #faeb9e; background-image: -moz-linear-gradient(top, #fff, #faeb9e); background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #fff),color-stop(1, #faeb9e)); -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#fff', EndColorStr='#faeb9e')"; } +.ui-body-d, .ui-body-d input, .ui-body-d select, .ui-body-d textarea, .ui-body-d button { font-family: Helvetica, Arial, sans-serif; } +.ui-body-d .ui-link-inherit { color: #333333; } +.ui-body-d .ui-link { color: #2489CE; font-weight: bold; } + /* interaction states */ diff --git a/docs/buttons/api-buttons.html b/docs/buttons/api-buttons.html new file mode 100755 index 00000000..81ca6945 --- /dev/null +++ b/docs/buttons/api-buttons.html @@ -0,0 +1,38 @@ + + + + jQuery Mobile Docs - Buttons + + + + + +
+ +
+

Button API

+
+ +
+
+ +

Dependencies

+

To be documented

+ +

Options

+

To be documented

+ +

Methods

+

To be documented

+ +

Known Issues

+

To be documented

+ + + +
+
+
+ + + \ No newline at end of file diff --git a/docs/buttons/buttons-grouped.html b/docs/buttons/buttons-grouped.html new file mode 100755 index 00000000..8612ba4d --- /dev/null +++ b/docs/buttons/buttons-grouped.html @@ -0,0 +1,53 @@ + + + + jQuery Mobile Docs - Buttons + + + + + + +
+ +
+

Grouped buttons

+
+ +
+
+ + +

Vertical grouped buttons (default)

+
+ Yes + No + Maybe +
+ +

Horizontal grouped buttons

+
+ Move up + Move down + Remove +
+ +

Horizontal grouped buttons, icon only

+
+ Move up + Move down + Remove +
+ + + + + + +
+ +
+
+ + + \ No newline at end of file diff --git a/docs/buttons/buttons-icons.html b/docs/buttons/buttons-icons.html new file mode 100755 index 00000000..1dacd89e --- /dev/null +++ b/docs/buttons/buttons-icons.html @@ -0,0 +1,52 @@ + + + + jQuery Mobile Docs - Buttons + + + + + + +
+ +
+

Button icons

+
+ +
+
+ +

Icon position options

+

No icon

+ My button +

Left icon (default) - data-iconpos="left"

+ My button +

Right icon - data-iconpos="right"

+ My button +

Icon only - data-iconpos="notext"

+ My button + +

Icon glyphs

+

Left arrow - data-icon="arrow-u"

+ My button +

Right arrow - data-icon="arrow-d"

+ My button +

Up arrow - data-icon="arrow-u"

+ My button +

Down arrow - data-icon="arrow-d"

+ My button +

Delete - data-icon="delete"

+ My button +

Plus - data-icon="plus"

+ My button +

Minus - data-icon="minus"

+ My button + +
+ +
+
+ + + \ No newline at end of file diff --git a/docs/buttons/buttons-inline.html b/docs/buttons/buttons-inline.html new file mode 100755 index 00000000..02650d6b --- /dev/null +++ b/docs/buttons/buttons-inline.html @@ -0,0 +1,43 @@ + + + + jQuery Mobile Docs - Buttons + + + + + + +
+ +
+

Inline buttons

+
+ +
+
+ + +

Inline buttons (default)

+
+ Cancel + Save +
+ +

Inline toolbar buttons

+ +
+
+ Remove + Add + Move +
+
+ +
+ +
+
+ + + \ No newline at end of file diff --git a/docs/buttons/buttons-themes.html b/docs/buttons/buttons-themes.html new file mode 100755 index 00000000..b322ac37 --- /dev/null +++ b/docs/buttons/buttons-themes.html @@ -0,0 +1,58 @@ + + + + jQuery Mobile Docs - Buttons + + + + + + +
+ +
+

Theming buttons

+
+ +
+
+ +

"a" theme on container with themed buttons inside

+
+ Theme a + Theme b + Theme c + Theme d +
+ +

"b" theme on container with themed buttons inside

+
+ Theme a + Theme b + Theme c + Theme d +
+ +

"c" theme on container with themed buttons inside

+
+ Theme a + Theme b + Theme c + Theme d +
+ +

"d" theme on container with themed buttons inside

+
+ Theme a + Theme b + Theme c + Theme d +
+ +
+ +
+
+ + + \ No newline at end of file diff --git a/docs/buttons/buttons-types.html b/docs/buttons/buttons-types.html new file mode 100755 index 00000000..e77c338f --- /dev/null +++ b/docs/buttons/buttons-types.html @@ -0,0 +1,44 @@ + + + + jQuery Mobile Docs - Lists + + + + + + +
+ +
+

Button markup options

+
+ +
+
+ +

Link based button

+ Link element + +

Button based button

+ + +

Input type="button" based button

+ + +

Input type="submit" based button

+ + +

Input type="reset" based button

+ + +

Input type="image" based button

+ + +
+ +
+
+ + + \ No newline at end of file diff --git a/docs/buttons/docs-buttons.html b/docs/buttons/docs-buttons.html new file mode 100755 index 00000000..9d71368b --- /dev/null +++ b/docs/buttons/docs-buttons.html @@ -0,0 +1,134 @@ + + + + jQuery Mobile Docs - Lists + + + + + +
+ +
+

Buttons

+
+ +
+
+ +

Button basics

+

in jQuery Mobile, buttons that are used for navigation are coded as links and those that submit forms are coded as button elements.

+ +

Buttons in page content

+ +

In the main content block of a page (data-role="content"), any link that you want to look like a button needs the data-role="button" added to the link to tell the framework to style the link as a button.

+ +

+<a href="index.html" data-role="button">Link button</a>
+
+ +

Creates this button:

+ Link button + +

A button element or an input with a type of submit, reset, button, or image will all be automatically transformed into a custom styled button, no need to add the data-role="button" attribute. We found it was impossible to consistently style link and native form buttons consistently across platforms so the framework actually generates a new link-based button for each form button button and hides the original. When a click event fires on a the link button, it triggers a click on the original form button.

+ +

+<button>Button submit</button>
+
+ +

Creates this button:

+ + +

Icon options

+ +

Icons can be added to buttons by adding a data-icon attribute on the anchor to specify the icon to display. There a core set of standard icons included in the framework. To minimize the download size of the core icons, jQuery Mobile only includes these icons in white and automatically adds a semi-transparent black circle behind the icon to make sure it has good contrast on all background colors.

+ +

+<a href="index.html" data-role="button" data-icon="arrow-r">Link button</a>
+
+ +

Creates this button:

+Link button + + +

By default, icons in buttons are added to the left of the text, but the data-iconpos attribute specifies the icon position: left or right of the text. To create an icon-only button, set the data-iconpos to notext and the button plugin will hide the text and add it as a title attribute on the link to provide context for screen readers and devices that support tooltips. In this example, we're adding a plus (+) icon and positioning it to the right of the text with our data- attributes on the link.

+ +

+<a href="index.html" data-role="button" data-icon="arrow-r" data-iconpos="right">Link button</a>
+
+ +

Creates this button:

+Link button + + +

To use custom icons, specify a data-icon value that has a unique name like myapp-email and the button plugin will generate a class by prefixing ui-icon- to the data-icon value and apply it to the button. You can then write a CSS rule that targets the ui-icon-myapp-email class to specify the icon background source. To maintain visual consistency, create a white icon 18x18 pixels saved as a PNG-8 with alpha transparency.

+ +

Inline buttons

+ +

If you have multiple buttons that should sit side-by-side on the same line instead of stacked like the default buttons, wrap the buttons in a container that has a data-inline="true" attribute. This will style the buttons to be the width of their content and float the buttons so they sit on the same line.

+ + <div data-inline="true"> + <a href="index.html" data-role="button">Cancel</a> + <a href="index.html" data-role="button">Save</a> + </div> + +

Grouping

+ +

It's possible to group a set of buttons together to form a single block of buttons that look contained like a navigation component. To get this effect, wrap a set of buttons in a container with the data-role="controlgroup" attribute and the framework will create a vertical button group. This removes all margins and drop shadows between the buttons and only rounds the top and bottom buttons to get the effect that they are group together.

+

+<div data-role="controlgroup">
+	<a href="index.html" data-role="button">Yes</a>
+	<a href="index.html" data-role="button">No</a>
+	<a href="index.html" data-role="button">Maybe</a>
+</div>
+
+ +

Creates this button group:

+ +
+ Yes + No + Maybe +
+ +

By default, grouped buttons are presented as a vertical list. By adding the data-type="horizontal" attribute

to the control group container, you can swap this to a horizontal style group that floats the buttons side-by-side and sets the width to only be large enough to fit the content. Be aware that these will wrap to multiple lines if the button number of text length is to wide for the screen. + +
+ Yes + No + Maybe +
+ +

Theming

+ +

jQuery Mobile has a rich theming system that gives you full control of how buttons are styled. When a link is added to a container, it is automatically assigned a theme swatch letter that matches it's parent bar or content box to visually integrate the button into the parent container, like a chameleon. So a button placed inside a content container with a theme of "a" (black in the default theme) will be automatically assigned the button theme of "a" (charcoal in the default theme). Here are examples of the button theme pairings in the default theme. All buttons have the same HTML markup:

+ +

A swatch

Button
+

B swatch

Button
+

C swatch

Button
+

D swatch

Button
+ +

Button can be manually assigned any of the button color swatches from the theme to add visual contrast with the container they sit inside by adding the data-theme attribute on the button markup and specifying a swatch letter.

+ +
			
+<a href="index.html" data-role="button" data-theme="a">Theme a</a>			
+
+ +

Here are 4 buttons with icons that have a different swatch letter assigned via the data-theme attribute.

+ + Theme a + Theme b + Theme c + Theme d + + +

Buttons in bars

+ +

When buttons are placed inside header or footer bars, they are styled a bit differently than in the body. To save space, buttons in bars are styled with a smaller text size, less padding and only enough width to fit the text and icons inside. The toolbar documentation has full details on the styling options of button in bars.

+ +
+
+
+ + + \ No newline at end of file diff --git a/docs/buttons/index.html b/docs/buttons/index.html new file mode 100755 index 00000000..131d4486 --- /dev/null +++ b/docs/buttons/index.html @@ -0,0 +1,45 @@ + + + + jQuery Mobile Docs - Buttons + + + + + +
+ +
+

Buttons

+
+ +
+
+

Buttons are one of the core widgets in jQuery Mobile and are used within a wide range of other plugins.

+
+ + + + + + + + +
+
+ + + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 85131625..021426fb 100755 --- a/docs/index.html +++ b/docs/index.html @@ -19,11 +19,11 @@
  • Anatomy of a page
  • Links & page transitions
  • Header, footer & nav bars
  • -
  • Content formatting
  • -
  • Buttons
  • -
  • Form elements
  • +
  • Content formatting
  • +
  • Buttons
  • +
  • Form elements
  • List views
  • -
  • Dialogs
  • +
  • Dialogs
  • Animations
  • Events
  • diff --git a/docs/lists/images/asterisk_orange.png b/docs/lists/images/asterisk_orange.png deleted file mode 100755 index 1ebebde5..00000000 Binary files a/docs/lists/images/asterisk_orange.png and /dev/null differ diff --git a/docs/lists/images/book.png b/docs/lists/images/book.png deleted file mode 100755 index b0f4dd79..00000000 Binary files a/docs/lists/images/book.png and /dev/null differ diff --git a/docs/lists/images/cross.png b/docs/lists/images/cross.png deleted file mode 100755 index 1514d51a..00000000 Binary files a/docs/lists/images/cross.png and /dev/null differ diff --git a/docs/lists/images/email_delete.png b/docs/lists/images/email_delete.png deleted file mode 100755 index a9932b1a..00000000 Binary files a/docs/lists/images/email_delete.png and /dev/null differ diff --git a/docs/lists/images/flag_blue.png b/docs/lists/images/flag_blue.png deleted file mode 100755 index 003924f5..00000000 Binary files a/docs/lists/images/flag_blue.png and /dev/null differ diff --git a/docs/lists/images/folder.png b/docs/lists/images/folder.png deleted file mode 100755 index 784e8fa4..00000000 Binary files a/docs/lists/images/folder.png and /dev/null differ diff --git a/docs/lists/images/folder_heart.png b/docs/lists/images/folder_heart.png deleted file mode 100755 index 56d7da1d..00000000 Binary files a/docs/lists/images/folder_heart.png and /dev/null differ diff --git a/docs/lists/images/icon_box.png b/docs/lists/images/icon_box.png deleted file mode 100755 index 8443c23e..00000000 Binary files a/docs/lists/images/icon_box.png and /dev/null differ diff --git a/docs/lists/images/icon_email_go.png b/docs/lists/images/icon_email_go.png deleted file mode 100755 index 4a6c5d39..00000000 Binary files a/docs/lists/images/icon_email_go.png and /dev/null differ diff --git a/docs/lists/images/icon_tag.png b/docs/lists/images/icon_tag.png deleted file mode 100755 index 9757fc6e..00000000 Binary files a/docs/lists/images/icon_tag.png and /dev/null differ diff --git a/docs/lists/images/icon_vcard.png b/docs/lists/images/icon_vcard.png deleted file mode 100755 index c02f315d..00000000 Binary files a/docs/lists/images/icon_vcard.png and /dev/null differ diff --git a/docs/lists/images/star.png b/docs/lists/images/star.png deleted file mode 100755 index b88c8578..00000000 Binary files a/docs/lists/images/star.png and /dev/null differ diff --git a/docs/themes.html b/docs/themes.html index 2ec969c4..10fb5315 100755 --- a/docs/themes.html +++ b/docs/themes.html @@ -17,14 +17,14 @@
    -

    Theming overview

    +

    Theming overview

    The jQuery Mobile theme framework contains multiple color "swatches" for bars, content blocks and buttons. The key to the theme system used in jQuery UI is separation of color and texture (theme) from structural styles that define things like padding and dimensions. This allows the theme colors and textures to be defined once in the stylesheet then re-used throughout the interface as configurable color swatches that can be mixed and matched. We also take advantage of CSS3 properties to add rounded corners, box and text shadow and gradients to make the theme styles very lightweight and reduce server requests.

    Themes include at least 3 swatches for bars, content blocks and buttons. To make mapping of color swatches consistent across our widgets, we have followed the convention that swatch "a" is the highest level of visual priority (black in our default theme), "b" is secondary level (blue) and "c" is the baseline level (gray) that we use by default in many situations. Themes may have additional swatches but these are used for accents colors or specific situations within an app or site.

    -

    Bars

    +

    Bars

    The default theme contains 4 color swatches for bars to use in header, footer and tool bars. The swatches are designated by letters (a, b, c, etc.) and are organized into a visual hierarchy where "a" is the highest level of visual priority, "b" is secondary, "c" is the baseline, and "d" is for accents. Each swatch defines the border color, text color, gradient, text-shadow, font family and link color. Our default theme looks like this:

    @@ -38,7 +38,7 @@ -

    Content Blocks

    +

    Content Blocks

    The default theme contains 3 color swatches for use in content blocks. These are designed to coordinate with the header color swatches in the default theme. Just as with bars, you can add as many content block swatches you want by extending the theme stylesheet. If a theme isn't specified on a content block, the framework will default to "c", just like the header.

    @@ -48,7 +48,7 @@
    -

    Lists

    +

    Lists

    There are 2 supported list view styles. The system defaults to the "a" swatch (silver in default theme) and it can be switched to "b" via the data-theme attribute.

    -

    Active state

    +

    Active state

    The jQuery Mobile framework uses a single theme swatch called "active" (bright blue in the default theme) to consistently indicate the selected state, regardless of the theme of the widget. We apply this in navigation and form controls to indicate what is currently selected. Because this theme swatch is designed for clear, consistent user feedback, it is not currently a theme swatch that can be overridden via the markup. It is set once in the theme and applied by the framework whenever a selected or active state is needed. The styling for this state is in the theme stylesheet under the ui-btn-active style rules.

    @@ -73,7 +73,7 @@
    -

    Buttons

    +

    Buttons

    A set of 4 button colors are also included in the default theme. Each button has styles for normal, hover/focus and pressed states. Each button is intentionally styled to match the color of a bar so they feel tightly integrated.

    @@ -83,8 +83,8 @@ Button D
    -

    Context-aware button theming

    -

    When a link is placed in a header or footer bar, it is automatically transformed into a compact-sized button. It is also assigned a theme swatch letter that matches it's parent bar or content box to visually integrate the button into the parent theme, sort of like a chameleon. To illustrate this idea, below, the same exact button code is in each of the 4 bars and is automatically setting their color swatch to match on the parent bar swatch.

    +

    Context-aware button theming

    +

    A button is automatically assigned a theme swatch letter that matches it's parent bar or content box to visually integrate the button into the parent theme, like a chameleon. To illustrate this idea, below, the same exact button code is in each of the 4 bars and is automatically setting their color swatch to match on the parent bar swatch.

    Bar A

    Button A
    @@ -93,7 +93,9 @@

    Bar D

    Button D
    -

    This makes it really easy to ripple a theme change through a page by setting a theme swatch on a parent because you know the buttons will maintain the same relative visual weight across themes. To add visual emphasis of certain buttons in a toolbar, the theme swatch color for a button can be set by adding a data-theme="a" to the anchor to make it stand out visually from it's parent. If the theme is set on a button in the markup, the framework won't override the theme swatch color when the parent theme is changed because you made a conscious decision to set the color.

    +

    This makes it really easy to ripple a theme change through a page by setting a theme swatch on a parent because you know the buttons will maintain the same relative visual weight across themes. Since form elements use the button styles, they will also adapt to their parent container too.

    + +

    To add visual emphasis of certain buttons in a toolbar, the theme swatch color for a button can be set by adding a data-theme="a" to the anchor to make it stand out visually from it's parent. If the theme is set on a button in the markup, the framework won't override the theme swatch color when the parent theme is changed because you made a conscious decision to set the color.

    @@ -131,21 +133,8 @@
    -

    Icons

    -

    -
    -
    -
    - left - right - up - down - plus - minus - delete -
    -
    -
    +

    Icons

    +

    There a core set of standard icons included in the framework that can be assigned to any button. To minimize the download size of the core icons, jQuery Mobile only includes these icons in white and automatically adds a semi-transparent black circle behind the icon to make sure it has good contrast on all background colors.

    Extensible themes

    diff --git a/docs/toolbars/images/album-af.jpg b/docs/toolbars/images/album-af.jpg deleted file mode 100755 index e2e34fd8..00000000 Binary files a/docs/toolbars/images/album-af.jpg and /dev/null differ diff --git a/docs/toolbars/images/album-ag.jpg b/docs/toolbars/images/album-ag.jpg deleted file mode 100755 index 02766347..00000000 Binary files a/docs/toolbars/images/album-ag.jpg and /dev/null differ diff --git a/docs/toolbars/images/album-bb.jpg b/docs/toolbars/images/album-bb.jpg deleted file mode 100755 index e23683a4..00000000 Binary files a/docs/toolbars/images/album-bb.jpg and /dev/null differ diff --git a/docs/toolbars/images/album-bk.jpg b/docs/toolbars/images/album-bk.jpg deleted file mode 100755 index 58ec190e..00000000 Binary files a/docs/toolbars/images/album-bk.jpg and /dev/null differ diff --git a/docs/toolbars/images/album-hc.jpg b/docs/toolbars/images/album-hc.jpg deleted file mode 100755 index cc099d10..00000000 Binary files a/docs/toolbars/images/album-hc.jpg and /dev/null differ diff --git a/docs/toolbars/images/album-k.jpg b/docs/toolbars/images/album-k.jpg deleted file mode 100755 index ce6cfc29..00000000 Binary files a/docs/toolbars/images/album-k.jpg and /dev/null differ diff --git a/docs/toolbars/images/album-mg.jpg b/docs/toolbars/images/album-mg.jpg deleted file mode 100755 index c3850e3a..00000000 Binary files a/docs/toolbars/images/album-mg.jpg and /dev/null differ diff --git a/docs/toolbars/images/album-ok.jpg b/docs/toolbars/images/album-ok.jpg deleted file mode 100755 index 90a08f7a..00000000 Binary files a/docs/toolbars/images/album-ok.jpg and /dev/null differ diff --git a/docs/toolbars/images/album-p.jpg b/docs/toolbars/images/album-p.jpg deleted file mode 100755 index 3dcce6a8..00000000 Binary files a/docs/toolbars/images/album-p.jpg and /dev/null differ diff --git a/docs/toolbars/images/album-rh.jpg b/docs/toolbars/images/album-rh.jpg deleted file mode 100755 index 614969a2..00000000 Binary files a/docs/toolbars/images/album-rh.jpg and /dev/null differ diff --git a/docs/toolbars/images/album-ws.jpg b/docs/toolbars/images/album-ws.jpg deleted file mode 100755 index 33cf555a..00000000 Binary files a/docs/toolbars/images/album-ws.jpg and /dev/null differ diff --git a/docs/toolbars/images/album-xx.jpg b/docs/toolbars/images/album-xx.jpg deleted file mode 100755 index 78409fe7..00000000 Binary files a/docs/toolbars/images/album-xx.jpg and /dev/null differ diff --git a/docs/toolbars/images/asterisk_orange.png b/docs/toolbars/images/asterisk_orange.png deleted file mode 100755 index 1ebebde5..00000000 Binary files a/docs/toolbars/images/asterisk_orange.png and /dev/null differ diff --git a/docs/toolbars/images/book.png b/docs/toolbars/images/book.png deleted file mode 100755 index b0f4dd79..00000000 Binary files a/docs/toolbars/images/book.png and /dev/null differ diff --git a/docs/toolbars/images/cross.png b/docs/toolbars/images/cross.png deleted file mode 100755 index 1514d51a..00000000 Binary files a/docs/toolbars/images/cross.png and /dev/null differ diff --git a/docs/toolbars/images/email_delete.png b/docs/toolbars/images/email_delete.png deleted file mode 100755 index a9932b1a..00000000 Binary files a/docs/toolbars/images/email_delete.png and /dev/null differ diff --git a/docs/toolbars/images/flag_blue.png b/docs/toolbars/images/flag_blue.png deleted file mode 100755 index 003924f5..00000000 Binary files a/docs/toolbars/images/flag_blue.png and /dev/null differ diff --git a/docs/toolbars/images/folder.png b/docs/toolbars/images/folder.png deleted file mode 100755 index 784e8fa4..00000000 Binary files a/docs/toolbars/images/folder.png and /dev/null differ diff --git a/docs/toolbars/images/folder_heart.png b/docs/toolbars/images/folder_heart.png deleted file mode 100755 index 56d7da1d..00000000 Binary files a/docs/toolbars/images/folder_heart.png and /dev/null differ diff --git a/docs/toolbars/images/icon_box.png b/docs/toolbars/images/icon_box.png deleted file mode 100755 index 8443c23e..00000000 Binary files a/docs/toolbars/images/icon_box.png and /dev/null differ diff --git a/docs/toolbars/images/icon_email_go.png b/docs/toolbars/images/icon_email_go.png deleted file mode 100755 index 4a6c5d39..00000000 Binary files a/docs/toolbars/images/icon_email_go.png and /dev/null differ diff --git a/docs/toolbars/images/icon_tag.png b/docs/toolbars/images/icon_tag.png deleted file mode 100755 index 9757fc6e..00000000 Binary files a/docs/toolbars/images/icon_tag.png and /dev/null differ diff --git a/docs/toolbars/images/icon_vcard.png b/docs/toolbars/images/icon_vcard.png deleted file mode 100755 index c02f315d..00000000 Binary files a/docs/toolbars/images/icon_vcard.png and /dev/null differ diff --git a/docs/toolbars/images/star.png b/docs/toolbars/images/star.png deleted file mode 100755 index b88c8578..00000000 Binary files a/docs/toolbars/images/star.png and /dev/null differ diff --git a/experiments/converter/application.js b/experiments/converter/application.js index e164800d..ad55d10e 100644 --- a/experiments/converter/application.js +++ b/experiments/converter/application.js @@ -10,74 +10,78 @@ $(function() { }; function list() { - var ul = $("#conversions").empty().page( "destroy" ), - ulEdit = $("#edit-conversions").empty().page( "destroy" ); - $.each(all, function(index, conversion) { + var ul = $( "#conversions" ).empty() + .filter( ":mobile-page" ).page( "destroy" ), + ulEdit = $( "#edit-conversions" ).empty() + .filter( ":mobile-page" ).page( "destroy" ); + + $.each( all, function( index, conversion ) { // if last update was less then a minute ago, don't update - if (conversion.type == "currency" && !conversion.rate || conversion.updated && conversion.updated + 60000 < +new Date) { + if ( conversion.type === "currency" && !conversion.rate || conversion.updated && conversion.updated + 60000 < +new Date) { var self = conversion; var url = "http://query.yahooapis.com/v1/public/yql?q=select%20rate%2Cname%20from%20csv%20where%20url%3D'http%3A%2F%2Fdownload.finance.yahoo.com%2Fd%2Fquotes%3Fs%3D" + conversion.from + conversion.to + "%253DX%26f%3Dl1n'%20and%20columns%3D'rate%2Cname'&format=json&diagnostics=true&callback=?"; - $.getJSON(url, function(result) { - self.rate = parseFloat(result.query.results.row.rate); + $.getJSON( url, function( result ) { + console.log( "results", result ); + self.rate = parseFloat( result.query.results.row.rate ); // TODO trigger a custom event instead of keyup? - $("#term").keyup(); + $( "#term" ).keyup(); self.updated = +new Date; conversions.store(); }); } - $("#conversion-field").tmpl(conversion, { + $( "#conversion-field" ).tmpl( conversion, { symbols: symbols - }).appendTo(ul); - $("#conversion-edit-field").tmpl(conversion, { + }).appendTo( ul ); + $( "#conversion-edit-field" ).tmpl( conversion, { symbols: symbols - }).appendTo(ulEdit); + }).appendTo( ulEdit ); }); ul.page(); // TODO trigger a custom event instead of keyup? - $("#term").keyup(); + $( "#term" ).keyup(); } var all = conversions.all(); - $("#term").keyup(function() { + $( "#term" ).keyup(function() { var value = this.value; - $.each(all, function(index, conversion) { - $("#" + conversion.from + conversion.to).val( conversion.rate - ? Math.ceil(value * conversion.rate * 100) / 100 + $.each( all, function( index, conversion ) { + $( "#" + conversion.from + conversion.to ).val( conversion.rate + ? Math.ceil( value * conversion.rate * 100 ) / 100 : "Rate not available, yet." ); }); }).focus(); list(); - $("form").submit(function() { - $("#term").blur(); + $( "form" ).submit(function() { + $( "#term" ).blur(); return false; }); - $("#add").click(function() { + $( "#add" ).click(function() { all.push({ type: "currency", - from: $("#currency-options-from").val(), - to: $("#currency-options-to").val() + from: $( "#currency-options-from" ).val(), + to: $( "#currency-options-to" ).val() }); conversions.store(); list(); return false; }); - $("#clear").click(function() { + $( "#clear" ).click(function() { conversions.clear(); list(); return false; }); - $("#restore").click(function() { + $( "#restore" ).click(function() { conversions.restore(); list(); return false; }); - $("#edit-conversions").click(function(event) { - var target = $(event.target).closest(".deletebutton"); - if (target.length) { - conversions.remove(target.prev("label").attr("for")); + $( "#edit-conversions" ).click(function( event ) { + var target = $( event.target ).closest( ".deletebutton" ); + if ( target.length ) { + conversions.remove( target.prev( "label" ).attr( "for" ) ); list(); } return false; - }) -}); \ No newline at end of file + }); +}); diff --git a/experiments/converter/storage.js b/experiments/converter/storage.js index 8604e91c..5521b18b 100644 --- a/experiments/converter/storage.js +++ b/experiments/converter/storage.js @@ -1,65 +1,68 @@ (function() { - var defaults = [ - { - type: "currency", - from: "USD", - to: "EUR" - } - // TODO add back in as defaults once its possible to add other conversions, not just currencies - /*, - { - type: "distance", - from: "Miles", - to: "Kilometer", - rate: 1.609344 - }, - { - type: "distance", - from: "inch", - to: "centimeter", - rate: 2.54 - }*/ - ]; - - // TODO fallback to whatever else when localStorage isn't available - function get() { - return JSON.parse(localStorage.getItem("conversions")); + +var defaults = [ + { + type: "currency", + from: "USD", + to: "EUR" } - function set(value) { - window.console && console.log && console.log("storing conversion: "+ JSON.stringify(value)) - localStorage.setItem("conversions", JSON.stringify(value)); + // TODO add back in as defaults once its possible to add other conversions, not just currencies + /*, + { + type: "distance", + from: "Miles", + to: "Kilometer", + rate: 1.609344 + }, + { + type: "distance", + from: "inch", + to: "centimeter", + rate: 2.54 + }*/ +]; + +// TODO fallback to whatever else when localStorage isn't available +function get() { + return JSON.parse( localStorage.getItem( "conversions" ) ); +} +function set( value ) { + if ( window.console && console.log ) { + console.log( "storing conversion: "+ JSON.stringify( value ) ); } - - var conversions = get("conversions"); - if (!conversions) { - conversions = $.extend([], defaults); - set(conversions); + localStorage.setItem( "conversions", JSON.stringify( value ) ); +} + +var conversions = get( "conversions" ); +if ( !conversions ) { + conversions = defaults.slice(); + set( conversions ); +} +window.conversions = { + store: function() { + set( conversions ); + }, + all: function() { + return conversions; + }, + clear: function() { + conversions.length = 0; + this.store(); + }, + restore: function() { + conversions.length = 0; + $.extend( conversions, defaults ); + this.store(); + }, + remove: function( tofrom ) { + $.each( conversions, function( index, conversion ) { + if ( ( conversion.from + conversion.to ) === tofrom ) { + conversions.splice( index, 1 ); + return false; + } + }); + this.store(); } - window.conversions = { - store: function() { - set(conversions); - }, - all: function() { - return conversions; - }, - clear: function() { - conversions.length = 0; - this.store(); - }, - restore: function() { - conversions.length = 0; - $.extend(conversions, defaults); - this.store(); - }, - remove: function(tofrom) { - $.each(conversions, function(index, conversion) { - if ((conversion.from + conversion.to) == tofrom) { - conversions.splice(index, 1); - return false; - } - }); - this.store(); - } - }; - +}; + })();