compass-ui 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/.gitignore +10 -0
  2. data/CHANGELOG.md +22 -0
  3. data/Gemfile +3 -0
  4. data/Gemfile.lock +22 -0
  5. data/LICENSE.md +30 -0
  6. data/README.md +81 -0
  7. data/compass-ui.gemspec +23 -0
  8. data/demos/config.rb +26 -0
  9. data/demos/images/absolution/selector.png +0 -0
  10. data/demos/images/absolution/ui-icons_222222_256x240.png +0 -0
  11. data/demos/images/absolution/ui-icons_eeeeee_256x240.png +0 -0
  12. data/demos/images/absolution/ui-icons_ffffff_256x240.png +0 -0
  13. data/demos/images/dot-luv/ui-bg_diagonals-thick_15_0b3e6f_40x40.png +0 -0
  14. data/demos/images/dot-luv/ui-bg_dots-medium_30_0b58a2_4x4.png +0 -0
  15. data/demos/images/dot-luv/ui-bg_dots-small_20_333333_2x2.png +0 -0
  16. data/demos/images/dot-luv/ui-bg_dots-small_30_a32d00_2x2.png +0 -0
  17. data/demos/images/dot-luv/ui-bg_dots-small_40_00498f_2x2.png +0 -0
  18. data/demos/images/dot-luv/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  19. data/demos/images/dot-luv/ui-bg_flat_40_292929_40x100.png +0 -0
  20. data/demos/images/dot-luv/ui-bg_gloss-wave_20_111111_500x100.png +0 -0
  21. data/demos/images/dot-luv/ui-icons_00498f_256x240.png +0 -0
  22. data/demos/images/dot-luv/ui-icons_98d2fb_256x240.png +0 -0
  23. data/demos/images/dot-luv/ui-icons_9ccdfc_256x240.png +0 -0
  24. data/demos/images/dot-luv/ui-icons_ffffff_256x240.png +0 -0
  25. data/demos/images/jquery-ui-base/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  26. data/demos/images/jquery-ui-base/ui-bg_flat_75_ffffff_40x100.png +0 -0
  27. data/demos/images/jquery-ui-base/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  28. data/demos/images/jquery-ui-base/ui-bg_glass_65_ffffff_1x400.png +0 -0
  29. data/demos/images/jquery-ui-base/ui-bg_glass_75_dadada_1x400.png +0 -0
  30. data/demos/images/jquery-ui-base/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  31. data/demos/images/jquery-ui-base/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  32. data/demos/images/jquery-ui-base/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  33. data/demos/images/jquery-ui-base/ui-icons_222222_256x240.png +0 -0
  34. data/demos/images/jquery-ui-base/ui-icons_2e83ff_256x240.png +0 -0
  35. data/demos/images/jquery-ui-base/ui-icons_454545_256x240.png +0 -0
  36. data/demos/images/jquery-ui-base/ui-icons_888888_256x240.png +0 -0
  37. data/demos/images/jquery-ui-base/ui-icons_cd0a0a_256x240.png +0 -0
  38. data/demos/index.html +65 -0
  39. data/demos/js/demo.js +189 -0
  40. data/demos/sass/_base.scss +5 -0
  41. data/demos/sass/_demo.scss +124 -0
  42. data/demos/sass/_normalize.scss +387 -0
  43. data/demos/sass/absolution.scss +3 -0
  44. data/demos/sass/color-test.scss +111 -0
  45. data/demos/sass/default.scss +3 -0
  46. data/demos/sass/dot-luv.scss +3 -0
  47. data/demos/sass/ie.scss +5 -0
  48. data/demos/sass/print.scss +3 -0
  49. data/demos/sass/smoothness.scss +3 -0
  50. data/demos/sections/accordion.html +56 -0
  51. data/demos/sections/autocomplete.html +6 -0
  52. data/demos/sections/buttons.html +19 -0
  53. data/demos/sections/combinations.html +41 -0
  54. data/demos/sections/datepicker.html +6 -0
  55. data/demos/sections/dialog.html +8 -0
  56. data/demos/sections/form.html +26 -0
  57. data/demos/sections/highlights.html +16 -0
  58. data/demos/sections/icons.html +219 -0
  59. data/demos/sections/overlay.html +14 -0
  60. data/demos/sections/progressbar.html +6 -0
  61. data/demos/sections/sliders.html +19 -0
  62. data/demos/sections/tabs.html +12 -0
  63. data/lib/compass-ui.rb +2 -0
  64. data/lib/compass-ui/compass_plugin.rb +5 -0
  65. data/lib/compass-ui/version.rb +3 -0
  66. data/stylesheets/_compass-ui.scss +1 -0
  67. data/stylesheets/compass-ui/_colors.scss +67 -0
  68. data/stylesheets/compass-ui/_jquery-ui.scss +13 -0
  69. data/stylesheets/compass-ui/jquery-ui/_accordion.scss +50 -0
  70. data/stylesheets/compass-ui/jquery-ui/_autocomplete.scss +56 -0
  71. data/stylesheets/compass-ui/jquery-ui/_button.scss +101 -0
  72. data/stylesheets/compass-ui/jquery-ui/_core.scss +89 -0
  73. data/stylesheets/compass-ui/jquery-ui/_datepicker.scss +167 -0
  74. data/stylesheets/compass-ui/jquery-ui/_dialog.scss +61 -0
  75. data/stylesheets/compass-ui/jquery-ui/_progressbar.scss +17 -0
  76. data/stylesheets/compass-ui/jquery-ui/_resizable.scss +78 -0
  77. data/stylesheets/compass-ui/jquery-ui/_selectable.scss +15 -0
  78. data/stylesheets/compass-ui/jquery-ui/_slider.scss +55 -0
  79. data/stylesheets/compass-ui/jquery-ui/_tabs.scss +53 -0
  80. data/stylesheets/compass-ui/jquery-ui/_theme.scss +796 -0
  81. data/stylesheets/compass-ui/theme/_absolution.scss +151 -0
  82. data/stylesheets/compass-ui/theme/_dot-luv.scss +115 -0
  83. data/stylesheets/compass-ui/theme/_jquery-ui-base.scss +160 -0
  84. data/stylesheets/compass-ui/theme/_smoothness.scss +35 -0
  85. data/stylesheets/compass-ui/theme/absolution/_accordion.scss +65 -0
  86. data/stylesheets/compass-ui/theme/absolution/_autocomplete.scss +41 -0
  87. data/stylesheets/compass-ui/theme/absolution/_datepicker.scss +149 -0
  88. data/stylesheets/compass-ui/theme/absolution/_dialog.scss +84 -0
  89. data/stylesheets/compass-ui/theme/absolution/_progressbar.scss +14 -0
  90. data/stylesheets/compass-ui/theme/absolution/_slider.scss +50 -0
  91. data/stylesheets/compass-ui/theme/absolution/_tabs.scss +68 -0
  92. data/templates/project/_compass-ui.scss +2 -0
  93. data/templates/project/manifest.rb +12 -0
  94. metadata +150 -0
@@ -0,0 +1,10 @@
1
+ .bundle
2
+ .sass-cache/
3
+ *.swp
4
+ *~
5
+ .DS_Store
6
+ bin/*
7
+ *.gem
8
+ demos/stylesheets/
9
+ demos/.sass-cache
10
+
@@ -0,0 +1,22 @@
1
+ # Compass-UI Changelog
2
+
3
+ ### 0.0.3 - extracted from the compass-bearing project
4
+
5
+ ## 0.0.2 - part of the compass-bearing project
6
+
7
+ - Switch to using image-url and relative theme url, instead of hard-coded images url
8
+ - Made _compass-bearing the default for pulling in a jquery base theme
9
+ - Minor style tweaks to absolution and dot-luv
10
+ - Breaking border width, style, and color out into their own vars
11
+ - Adding Dot Luv theme as proof of concept
12
+ - Adding Smoothness theme
13
+ - Updated base jQuery UI theme
14
+ - Added demos for testing and, well, demoing
15
+ - Added jquery-ui-base-theme mixin
16
+ - Changed jQuery UI theme variable naming scheme (from $jquery- variables to $ui-)
17
+ - Moved dependencies from Gemfile to gemspec
18
+
19
+ ## 0.0.1 - previously part of the compass-bearing project
20
+
21
+ - Initial release
22
+ - Unstable and no longer supported, please see subsequent versions or pull from the Github repository.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ # A sample Gemfile
2
+ source "http://rubygems.org"
3
+ gemspec
@@ -0,0 +1,22 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ compass-ui (0.0.1)
5
+ compass (>= 0.11.1)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ chunky_png (1.2.1)
11
+ compass (0.11.5)
12
+ chunky_png (~> 1.2)
13
+ fssm (>= 0.2.7)
14
+ sass (~> 3.1)
15
+ fssm (0.2.7)
16
+ sass (3.1.7)
17
+
18
+ PLATFORMS
19
+ ruby
20
+
21
+ DEPENDENCIES
22
+ compass-ui!
@@ -0,0 +1,30 @@
1
+ Copyright (c) 2011 Patrick A. Ward
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+ No attribution is required by products that make use of this software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+
23
+ Except as contained in this notice, the name(s) of the above copyright
24
+ holders shall not be used in advertising or otherwise to promote the sale,
25
+ use or other dealings in this Software without prior written authorization.
26
+
27
+ Contributors to this project agree to grant all rights to the copyright
28
+ holder of the primary product. Attribution is maintained in the source
29
+ control history of the product.
30
+
@@ -0,0 +1,81 @@
1
+ # Compass-UI
2
+
3
+ Compass-UI is a jQuery UI theme builder for the [compass][compass] CSS framework.
4
+
5
+ I recently worked on two projects that required use of the [jQuery UI][jqueryui]. However, designing a new theme from Themeroller or taking apart the generated CSS by hand proved to be tedious at best. The default themes did not fit our needs. So, I thought it might be useful to build a tool that could make generating jQuery UI themes easier. Compass-UI is an attempt to build that tool.
6
+
7
+ **This is a work-in-progress**.
8
+
9
+ ## Installation and Usage
10
+
11
+ `(sudo) gem install compass-ui`
12
+
13
+ or, in your Gemfile: `gem compass-ui`
14
+
15
+ Then add `require 'compass-ui'` to your Compass config file.
16
+
17
+ To use one of the existing themes import it:
18
+
19
+ ```sass
20
+ @import "compass-ui/theme/absolution";
21
+ ```
22
+
23
+ Then, include the theme when needed:
24
+
25
+ ```sass
26
+ @include absolution-theme;
27
+ ```
28
+
29
+ ## Existing Themes
30
+
31
+ * jQuery UI - Base Theme (import with `@import "compass-ui/theme/jquery-ui-base"`).
32
+
33
+ * Absolution Theme (import with `@import "compass-ui/theme/absolution"`).
34
+
35
+ I've ported [Michaël Vanderheeren's][mvan] wonderful [Absolution Theme](https://github.com/michaelvanderheeren/Absolution) over to Compass/Sass as a proof-of-concept. However, please follow him if you'd like to keep up with his improvements on that theme.
36
+
37
+ * Smoothness Theme - the jQuery UI plain gem in just a few lines.
38
+
39
+ * Dot Luv Theme - the gaudy Dot Luv theme as a proof-of-concept, by just changing default variables and adding background images.
40
+
41
+ ## Creating a New Theme
42
+
43
+ To create a new jQuery UI theme, simply create a new Sass file and import compass-ui:
44
+
45
+ ```sass
46
+ @import "compass-ui";
47
+ ```
48
+
49
+ Then, in your own project, override any of the variables found in the jquery-ui-base file with your own variables.
50
+
51
+ **Please see the proof-of-concept Absolution Theme for a detailed example.** Even though the Absolution Theme has additional CSS, in many cases, I think just overriding variables found in the jquery-ui-base would be sufficient to create a brand-new theme. See the Smoothness and Dot Luv themes in the demos for examples of overriding a few variables to create a new theme.
52
+
53
+ After you've imported it into your project, you'll need to @include the default theme's mixin.
54
+
55
+ Place this after your variable overrides.
56
+
57
+ ```sass
58
+ @include jquery-ui-base-theme;
59
+ ```
60
+
61
+ See the demos for a more detailed example.
62
+
63
+ ## Attribution
64
+ Absolution Theme, Copyright 2010, [Michael Vanderheeren][mvan]
65
+
66
+ jQuery UI CSS Framework, Copyright 2010, [jQuery UI][jqueryui]<br>
67
+ [Dual licensed][jqueryui-license] under the MIT or GPL Version 2 licenses.<br>
68
+ [http://docs.jquery.com/UI/Theming/API](http://docs.jquery.com/UI/Theming/API)<br>
69
+
70
+ ## License
71
+
72
+ Copyright (c) 2011 Patrick A. Ward<br>
73
+ All Rights Reserved.<br>
74
+ Released under a [slightly modified MIT License][license].
75
+
76
+ [license]: http://github.com/patrickward/compass-ui/tree/master/LICENSE.md
77
+ [compass]: http://compass-style.org
78
+ [jqueryui]: http://jqueryui.com
79
+ [jqueryui-license]: http://jquery.org/license
80
+ [mvan]: http://www.michaelvanderheeren.be/
81
+
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require 'compass-ui/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ # Metadata
7
+ s.name = 'compass-ui'
8
+ s.version = CompassUI::VERSION
9
+ s.authors = ['Patrick Ward']
10
+ s.email = ['oss@patrickward.com']
11
+
12
+ s.summary = "jQuery UI theme builder for the Compass CSS Authoring Framework"
13
+ s.description = "Compass-UI is a jQuery UI theme builder for the Compass CSS Authoring Framework."
14
+ s.homepage = 'https://github.com/patrickward/compass-ui'
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_dependency 'compass', [">= 0.11.1"]
22
+
23
+ end
@@ -0,0 +1,26 @@
1
+ # Require any additional compass plugins here.
2
+ require 'compass-ui'
3
+
4
+ # Set this to the root of your project when deployed:
5
+ http_path = "/"
6
+ css_dir = "stylesheets"
7
+ sass_dir = "sass"
8
+ images_dir = "images"
9
+ # http_images_path = "images"
10
+ javascripts_dir = "javascripts"
11
+
12
+ # You can select your preferred output style here (can be overridden via the command line):
13
+ # output_style = :expanded or :nested or :compact or :compressed
14
+
15
+ # To enable relative paths to assets via compass helper functions. Uncomment:
16
+ # relative_assets = true
17
+
18
+ # To disable debugging comments that display the original location of your selectors. Uncomment:
19
+ # line_comments = false
20
+
21
+
22
+ # If you prefer the indented syntax, you might want to regenerate this
23
+ # project again passing --syntax sass, or you can uncomment this:
24
+ # preferred_syntax = :sass
25
+ # and then run:
26
+ # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
@@ -0,0 +1,65 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5
+ <meta http-equiv="Cache-Control" content="no-cache" />
6
+ <title>Compass-UI</title>
7
+ <link type="text/css" href="stylesheets/default.css" rel="stylesheet" />
8
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
9
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.15/jquery-ui.min.js"></script>
10
+ <script type="text/javascript" src="js/demo.js"></script>
11
+ </head>
12
+ <body class="ui-form">
13
+ <div id="container">
14
+ <div id="header">
15
+ <h1>Compass-UI Theme Tests</h1>
16
+ </div>
17
+ <div id="content">
18
+ <p>
19
+ Compass-UI is a jQuery UI theme builder for the Compass CSS authoring framework.
20
+ </p>
21
+ <p>
22
+ This page is used to demonstrate and test the themes that have been built with it so far.
23
+ </p>
24
+
25
+ <p><strong>This is a work-in-progress. So, use it at your own risk.</strong></p>
26
+
27
+ <div id="demo-autocomplete">Loading...</div>
28
+ <div id="demo-buttons">Loading...</div>
29
+ <div id="demo-sliders">Loading...</div>
30
+ <div id="demo-highlights">Loading...</div>
31
+ <div id="demo-accordion">Loading...</div>
32
+ <div id="demo-tabs">Loading...</div>
33
+ <div id="demo-dialog">Loading...</div>
34
+ <div id="demo-datepicker">Loading...</div>
35
+ <div id="demo-progressbar">Loading...</div>
36
+ <div id="demo-icons">Loading...</div>
37
+ <div id="demo-overlay">Loading...</div>
38
+ <div id="demo-combinations">Loading...</div>
39
+ <div id="demo-form">Loading...</div>
40
+ </div>
41
+ <div id="sidebar">
42
+ <h2 id="showing">
43
+ Currently Showing: <br>
44
+ <span>jQuery-UI Base Theme</span>
45
+ </h2>
46
+
47
+ <div id="toggle-css">
48
+ <strong>Choose a theme to test:</strong>
49
+ <a href="#" rel="stylesheets/default.css">jQuery Base Theme</a>
50
+ <a href="#" rel="stylesheets/absolution.css">Absolution Theme</a>
51
+ <a href="#" rel="stylesheets/smoothness.css">Smoothness Theme</a>
52
+ <a href="#" rel="stylesheets/dot-luv.css">Dot Luv Theme</a>
53
+ <a href="#" rel="stylesheets/color-test.css">Color Test</a>
54
+ </div>
55
+
56
+ <p>
57
+ <strong>Resources:</strong>
58
+ <a href="https://github.com/patrickward/compass-ui">Github Project</a>
59
+ </p>
60
+
61
+ </div>
62
+ </div>
63
+ </body>
64
+ </html>
65
+
@@ -0,0 +1,189 @@
1
+ $(function(){
2
+
3
+ // Load each section and it's associated demo code
4
+ $('div[id^="demo-"]').each(function() {
5
+ $(this).load('sections/' + $(this).attr('id').substr(5) + '.html', function() {
6
+ loadDemo($(this).attr('id'));
7
+ });
8
+ });
9
+
10
+ function loadDemo(argument) {
11
+
12
+ switch(argument) {
13
+
14
+ // ---------------------------
15
+ // Countries
16
+ // ---------------------------
17
+ case 'demo-autocomplete':
18
+ var countryList = ["Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burma", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo, Democratic Republic", "Congo, Republic of the", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Greece", "Greenland", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Mongolia", "Morocco", "Monaco", "Mozambique", "Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Samoa", "San Marino", " Sao Tome", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"];
19
+
20
+ $("#countries").autocomplete({
21
+ source: countryList
22
+ });
23
+ // code
24
+ break;
25
+
26
+ // ---------------------------
27
+ // Accordion
28
+ // ---------------------------
29
+ case 'demo-accordion':
30
+ $(".accordion").accordion({ header: "h3" });
31
+ break;
32
+
33
+ // ---------------------------
34
+ // Sliders
35
+ // ---------------------------
36
+ case 'demo-sliders':
37
+ // Horizontal Slider
38
+ $('#horizSlider').slider({
39
+ range: true,
40
+ values: [17, 67]
41
+ }).width(500);
42
+
43
+ // Vertical Slider
44
+ $("#eq > span").each(function() {
45
+ var value = parseInt($(this).text());
46
+ $(this).empty().slider({
47
+ value: value,
48
+ range: "min",
49
+ animate: true,
50
+ orientation: "vertical"
51
+ });
52
+ });
53
+ break;
54
+
55
+ // ---------------------------
56
+ // Tabs
57
+ // ---------------------------
58
+ case 'demo-tabs':
59
+ $('#tabs').tabs();
60
+ break;
61
+
62
+ // ---------------------------
63
+ // Dialog
64
+ // ---------------------------
65
+ case 'demo-dialog':
66
+ // Dialog
67
+ $('#dialog').dialog({
68
+ autoOpen: false,
69
+ width: 600,
70
+ buttons: {
71
+ "Ok": function() {
72
+ $(this).dialog("close");
73
+ },
74
+ "Cancel": function() {
75
+ $(this).dialog("close");
76
+ }
77
+ },
78
+ modal: true
79
+ });
80
+
81
+ $('#dialog_link').button().click(function(){
82
+ $('#dialog').dialog('open');
83
+ return false;
84
+ });
85
+ break;
86
+
87
+ // ---------------------------
88
+ // Datepicker
89
+ // ---------------------------
90
+ case 'demo-datepicker':
91
+ $('#datepicker').datepicker({
92
+ showButtonPanel: true
93
+ }).children().show();
94
+
95
+ $('#datepicker2').datepicker({
96
+ numberOfMonths: 3,
97
+ showButtonPanel: true
98
+ }).children().show();
99
+ break;
100
+
101
+ // ---------------------------
102
+ // Icons
103
+ // ---------------------------
104
+ case 'demo-icons':
105
+ //hover states on the static widgets
106
+ $('#dialog_link, ul#icons li').hover(
107
+ function() { $(this).addClass('ui-state-hover'); },
108
+ function() { $(this).removeClass('ui-state-hover'); }
109
+ );
110
+ break;
111
+
112
+ // ---------------------------
113
+ // Buttons
114
+ // ---------------------------
115
+ case 'demo-buttons':
116
+ // Button
117
+ $("#divButton, #linkButton, #submitButton, #inputButton").button();
118
+
119
+ // Icon Buttons
120
+ $("#leftIconButton").button({
121
+ icons: {
122
+ primary: 'ui-icon-wrench'
123
+ }
124
+ });
125
+
126
+ $("#bothIconButton").button({
127
+ icons: {
128
+ primary: 'ui-icon-wrench',
129
+ secondary: 'ui-icon-triangle-1-s'
130
+ }
131
+ });
132
+
133
+ // Button Set
134
+ $("#radio1").buttonset();
135
+
136
+ $("#buttonInModal").button({
137
+ icons: {primary: 'ui-icon-wrench'}
138
+ });
139
+
140
+
141
+ break;
142
+
143
+ // ---------------------------
144
+ // Progressbar
145
+ // ---------------------------
146
+ case 'demo-progressbar':
147
+ // Progressbar
148
+ $("#progressbar").progressbar({
149
+ value: 37
150
+ }).width(500);
151
+ $("#animateProgress").click(function(event) {
152
+ var randNum = Math.random() * 90;
153
+ $("#progressbar div").animate( { width: randNum+"%" } );
154
+ event.preventDefault();
155
+ });
156
+ break;
157
+
158
+ // ---------------------------
159
+ // Combinations
160
+ // ---------------------------
161
+ case 'demo-combinations':
162
+ // Combinations
163
+ $('#tabs2').tabs();
164
+ $("#accordion2").accordion({ header: "h4" });
165
+ // Nested button tests
166
+ $("#nestedButtonTest_1, #nestedButtonTest_2, #buttonInModal").button().click(function(e) {
167
+ e.preventDefault();
168
+ });
169
+ break;
170
+ default:
171
+ // code
172
+ }
173
+
174
+ }
175
+
176
+ // Switch styles
177
+ $('#toggle-css a').click(function() {
178
+ var name = $(this).html();
179
+ $('link[rel=stylesheet]').attr({href: $(this).attr('rel') + '?' + Date.now() });
180
+ $('h2#showing span')
181
+ .fadeOut('slow', function() {
182
+ $(this)
183
+ .html(name)
184
+ .fadeIn('slow');
185
+ });
186
+ });
187
+
188
+ });
189
+