transit 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +19 -11
- data/app/assets/images/transit/icon24x24.png +0 -0
- data/app/assets/images/transit/icon24x24_files.png +0 -0
- data/app/assets/images/transit/jplayer.swf +0 -0
- data/app/assets/images/transit/uploadify.swf +0 -0
- data/app/assets/images/transit/video_player.swf +0 -0
- data/app/assets/javascripts/jqtools/expose.js +224 -0
- data/app/assets/javascripts/jqtools/flashembed.js +300 -0
- data/app/assets/javascripts/jqtools/overlay.js +294 -0
- data/app/assets/javascripts/jqtools/scrollable.js +3 -0
- data/app/assets/javascripts/jqtools/scrollable/autoscroll.js +81 -0
- data/app/assets/javascripts/jqtools/scrollable/base.js +335 -0
- data/app/assets/javascripts/jqtools/scrollable/navigator.js +139 -0
- data/app/assets/javascripts/jqtools/validator.js +590 -0
- data/app/assets/javascripts/jqueryui/accordion.js +611 -0
- data/app/assets/javascripts/jqueryui/autocomplete.js +612 -0
- data/app/assets/javascripts/jqueryui/button.js +388 -0
- data/app/assets/javascripts/jqueryui/core.js +312 -0
- data/app/assets/javascripts/jqueryui/datepicker.js +1791 -0
- data/app/assets/javascripts/jqueryui/dialog.js +878 -0
- data/app/assets/javascripts/jqueryui/draggable.js +815 -0
- data/app/assets/javascripts/jqueryui/droppable.js +285 -0
- data/app/assets/javascripts/jqueryui/effects/blind.js +49 -0
- data/app/assets/javascripts/jqueryui/effects/bounce.js +78 -0
- data/app/assets/javascripts/jqueryui/effects/clip.js +54 -0
- data/app/assets/javascripts/jqueryui/effects/core.js +746 -0
- data/app/assets/javascripts/jqueryui/effects/drop.js +50 -0
- data/app/assets/javascripts/jqueryui/effects/explode.js +79 -0
- data/app/assets/javascripts/jqueryui/effects/fade.js +32 -0
- data/app/assets/javascripts/jqueryui/effects/fold.js +56 -0
- data/app/assets/javascripts/jqueryui/effects/highlight.js +50 -0
- data/app/assets/javascripts/jqueryui/effects/pulsate.js +51 -0
- data/app/assets/javascripts/jqueryui/effects/scale.js +178 -0
- data/app/assets/javascripts/jqueryui/effects/shake.js +57 -0
- data/app/assets/javascripts/jqueryui/effects/slide.js +50 -0
- data/app/assets/javascripts/jqueryui/effects/transfer.js +45 -0
- data/app/assets/javascripts/jqueryui/mouse.js +160 -0
- data/app/assets/javascripts/jqueryui/position.js +252 -0
- data/app/assets/javascripts/jqueryui/progressbar.js +109 -0
- data/app/assets/javascripts/jqueryui/resizable.js +814 -0
- data/app/assets/javascripts/jqueryui/selectable.js +266 -0
- data/app/assets/javascripts/jqueryui/slider.js +666 -0
- data/app/assets/javascripts/jqueryui/sortable.js +1077 -0
- data/app/assets/javascripts/jqueryui/tabs.js +758 -0
- data/app/assets/javascripts/jqueryui/widget.js +262 -0
- data/app/assets/javascripts/libs/backbone.js +1152 -0
- data/app/assets/javascripts/libs/cookie.js +89 -0
- data/app/assets/javascripts/libs/fileinput.js +130 -0
- data/app/assets/javascripts/libs/jplayer.js +1768 -0
- data/app/assets/javascripts/libs/proper.js +541 -0
- data/app/assets/javascripts/libs/sanitize.js +282 -0
- data/app/assets/javascripts/libs/selecttolist.js +75 -0
- data/app/assets/javascripts/libs/underscore.js +807 -0
- data/app/assets/javascripts/libs/uploadify.js +677 -0
- data/app/assets/javascripts/libs/wymeditor.js +9538 -0
- data/app/assets/javascripts/transit.js +4 -0
- data/app/assets/javascripts/transit/admin.js +22 -0
- data/app/assets/javascripts/transit/admin/contexts.js +52 -0
- data/app/assets/javascripts/transit/admin/fields.js +36 -0
- data/app/assets/javascripts/transit/admin/upload.js +109 -0
- data/app/assets/javascripts/transit/config.js.erb +101 -0
- data/app/assets/javascripts/transit/contexts/audio.js +39 -0
- data/app/assets/javascripts/transit/contexts/video.js +79 -0
- data/app/assets/javascripts/transit/core.js +171 -0
- data/app/assets/javascripts/transit/frontend.js +3 -0
- data/app/assets/javascripts/transit/lib/base64.js +120 -0
- data/app/assets/javascripts/transit/lib/editor.js +177 -0
- data/app/assets/javascripts/transit/views/audio_player.jst +22 -0
- data/app/assets/javascripts/transit/views/editor_toolbar.jst +12 -0
- data/app/assets/javascripts/transit/views/file_upload.jst +5 -0
- data/app/assets/javascripts/transit/views/video_player.jst +20 -0
- data/app/assets/javascripts/transit/views/wym_box.jst +4 -0
- data/app/assets/javascripts/transit/views/wym_iframe.jst +3 -0
- data/app/assets/stylesheets/transit.css.scss.erb +42 -0
- data/app/assets/stylesheets/transit/forms.css.scss +66 -0
- data/app/assets/stylesheets/transit/media/audio.css.scss +65 -0
- data/app/assets/stylesheets/transit/media/video.css.scss +30 -0
- data/app/assets/stylesheets/transit/panel.css.scss +100 -0
- data/app/assets/stylesheets/transit/ui.css.scss +507 -0
- data/app/controllers/pages_controller.rb +3 -0
- data/app/controllers/posts_controller.rb +3 -0
- data/app/controllers/transit/assets_controller.rb +38 -0
- data/app/controllers/transit/contexts_controller.rb +12 -9
- data/app/controllers/transit/pages_controller.rb +26 -0
- data/app/controllers/transit/posts_controller.rb +31 -0
- data/app/controllers/transit/topics_controller.rb +5 -0
- data/app/controllers/transit_controller.rb +16 -0
- data/app/helpers/transit/admin_helper.rb +43 -0
- data/app/helpers/transit/form_helper.rb +17 -0
- data/app/helpers/transit/package_helper.rb +41 -0
- data/app/helpers/transit/pagination_helper.rb +58 -0
- data/app/helpers/transit_helper.rb +42 -0
- data/app/models/comment.rb +37 -0
- data/app/models/contexts/audio.rb +12 -0
- data/app/models/{text.rb → contexts/text.rb} +0 -0
- data/app/models/contexts/video.rb +24 -0
- data/app/models/topic.rb +19 -0
- data/app/models/transit/asset.rb +68 -0
- data/{lib → app/models}/transit/context.rb +29 -0
- data/app/views/contexts/_text.html.erb +1 -1
- data/app/views/posts/index.rss.builder +18 -0
- data/app/views/transit/assets/_file.html.erb +4 -0
- data/app/views/transit/assets/_image.html.erb +13 -0
- data/app/views/transit/assets/create.js.erb +8 -0
- data/app/views/transit/assets/destroy.js.erb +3 -0
- data/app/views/transit/assets/manage.html.erb +20 -0
- data/app/views/transit/contexts/_audio.html.erb +18 -0
- data/app/views/transit/contexts/_text.html.erb +6 -0
- data/app/views/transit/contexts/_video.html.erb +13 -0
- data/app/views/transit/contexts/destroy.js.erb +1 -0
- data/app/views/transit/contexts/index.html.erb +5 -0
- data/app/views/transit/contexts/new.js.erb +7 -0
- data/app/views/transit/contexts/show.html.erb +8 -0
- data/app/views/transit/index.html.erb +26 -0
- data/app/views/transit/index.js.erb +1 -0
- data/app/views/transit/interface/post_panel.html.erb +96 -0
- data/app/views/transit/pages/_table.html.erb +7 -0
- data/app/views/transit/pages/edit.html.erb +17 -0
- data/app/views/transit/pages/index.html.erb +17 -0
- data/app/views/transit/pages/update.js.erb +1 -0
- data/app/views/transit/posts/_form.html.erb +49 -0
- data/app/views/transit/posts/edit.html.erb +14 -0
- data/app/views/transit/posts/new.html.erb +21 -0
- data/app/views/transit/table.html.erb +13 -0
- data/app/views/transit/table.js.erb +8 -0
- data/app/views/transit/topics/manage.html.erb +28 -0
- data/config/locales/en.yml +22 -0
- data/config/routes.rb +3 -3
- data/lib/transit.rb +51 -17
- data/lib/transit/admin.rb +85 -0
- data/lib/transit/builders/form_builder.rb +319 -0
- data/lib/transit/builders/jst_builder.rb +38 -0
- data/lib/transit/builders/package_builder.rb +45 -0
- data/lib/transit/config.rb +20 -0
- data/lib/transit/controller/generator.rb +42 -0
- data/lib/transit/controller/responder.rb +34 -0
- data/lib/transit/core_ext.rb +18 -0
- data/lib/transit/errors/resource_not_found.rb +6 -0
- data/lib/transit/model/assets.rb +14 -0
- data/lib/transit/model/attachments.rb +55 -0
- data/lib/transit/model/auto_increment.rb +22 -0
- data/lib/transit/model/base.rb +56 -0
- data/lib/transit/model/comments.rb +19 -0
- data/lib/transit/model/hooks.rb +38 -0
- data/lib/transit/model/owners.rb +14 -0
- data/lib/transit/model/paginator.rb +92 -0
- data/lib/transit/model/topics.rb +14 -0
- data/lib/transit/package/page.rb +20 -12
- data/lib/transit/package/post.rb +87 -33
- data/lib/transit/package/post/validations.rb +14 -0
- data/lib/transit/rails/engine.rb +29 -13
- data/lib/transit/rails/railtie.rb +31 -0
- data/lib/transit/rails/routing.rb +11 -6
- data/lib/transit/services.rb +13 -0
- data/lib/transit/services/base.rb +14 -0
- data/lib/transit/services/facebook.rb +13 -0
- data/lib/transit/services/ted.rb +10 -0
- data/lib/transit/services/twitter.rb +13 -0
- data/lib/transit/services/vimeo.rb +10 -0
- data/lib/transit/services/you_tube.rb +12 -0
- data/lib/transit/version.rb +1 -1
- metadata +178 -31
- data/app/assets/stylesheets/includes/_compat.scss +0 -24
- data/app/assets/stylesheets/includes/_defaults.scss +0 -99
- data/app/assets/stylesheets/includes/_global.scss +0 -16
- data/app/assets/stylesheets/includes/_imports.scss +0 -27
- data/app/assets/stylesheets/includes/_mixins.scss +0 -38
- data/app/assets/stylesheets/includes/_setup.scss +0 -85
- data/app/assets/stylesheets/layout.css.scss +0 -29
- data/app/assets/stylesheets/transit.css +0 -3
- data/app/controllers/application_controller.rb +0 -5
- data/app/controllers/transit/index_controller.rb +0 -7
- data/app/controllers/transit/packages_controller.rb +0 -64
- data/app/controllers/transit/transit_controller.rb +0 -4
- data/app/helpers/routing_helpers.rb +0 -7
- data/app/models/audio.rb +0 -4
- data/app/models/package_asset.rb +0 -11
- data/app/models/video.rb +0 -8
- data/app/views/contexts/_audio.html.erb +0 -1
- data/app/views/contexts/_video.html.erb +0 -1
- data/app/views/layouts/transit.html.erb +0 -31
- data/app/views/transit/index/index.html.erb +0 -0
- data/lib/transit/helpers/controller_helpers.rb +0 -40
- data/lib/transit/helpers/model_helpers.rb +0 -26
- data/lib/transit/package.rb +0 -25
- data/lib/transit/package/base.rb +0 -49
@@ -0,0 +1,388 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery UI Button 1.8.13
|
3
|
+
*
|
4
|
+
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
5
|
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6
|
+
* http://jquery.org/license
|
7
|
+
*
|
8
|
+
* http://docs.jquery.com/UI/Button
|
9
|
+
*
|
10
|
+
* Depends:
|
11
|
+
* jquery.ui.core.js
|
12
|
+
* jquery.ui.widget.js
|
13
|
+
*/
|
14
|
+
(function( $, undefined ) {
|
15
|
+
|
16
|
+
var lastActive,
|
17
|
+
baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
|
18
|
+
stateClasses = "ui-state-hover ui-state-active ",
|
19
|
+
typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
|
20
|
+
formResetHandler = function( event ) {
|
21
|
+
$( ":ui-button", event.target.form ).each(function() {
|
22
|
+
var inst = $( this ).data( "button" );
|
23
|
+
setTimeout(function() {
|
24
|
+
inst.refresh();
|
25
|
+
}, 1 );
|
26
|
+
});
|
27
|
+
},
|
28
|
+
radioGroup = function( radio ) {
|
29
|
+
var name = radio.name,
|
30
|
+
form = radio.form,
|
31
|
+
radios = $( [] );
|
32
|
+
if ( name ) {
|
33
|
+
if ( form ) {
|
34
|
+
radios = $( form ).find( "[name='" + name + "']" );
|
35
|
+
} else {
|
36
|
+
radios = $( "[name='" + name + "']", radio.ownerDocument )
|
37
|
+
.filter(function() {
|
38
|
+
return !this.form;
|
39
|
+
});
|
40
|
+
}
|
41
|
+
}
|
42
|
+
return radios;
|
43
|
+
};
|
44
|
+
|
45
|
+
$.widget( "ui.button", {
|
46
|
+
options: {
|
47
|
+
disabled: null,
|
48
|
+
text: true,
|
49
|
+
label: null,
|
50
|
+
icons: {
|
51
|
+
primary: null,
|
52
|
+
secondary: null
|
53
|
+
}
|
54
|
+
},
|
55
|
+
_create: function() {
|
56
|
+
this.element.closest( "form" )
|
57
|
+
.unbind( "reset.button" )
|
58
|
+
.bind( "reset.button", formResetHandler );
|
59
|
+
|
60
|
+
if ( typeof this.options.disabled !== "boolean" ) {
|
61
|
+
this.options.disabled = this.element.attr( "disabled" );
|
62
|
+
}
|
63
|
+
|
64
|
+
this._determineButtonType();
|
65
|
+
this.hasTitle = !!this.buttonElement.attr( "title" );
|
66
|
+
|
67
|
+
var self = this,
|
68
|
+
options = this.options,
|
69
|
+
toggleButton = this.type === "checkbox" || this.type === "radio",
|
70
|
+
hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ),
|
71
|
+
focusClass = "ui-state-focus";
|
72
|
+
|
73
|
+
if ( options.label === null ) {
|
74
|
+
options.label = this.buttonElement.html();
|
75
|
+
}
|
76
|
+
|
77
|
+
if ( this.element.is( ":disabled" ) ) {
|
78
|
+
options.disabled = true;
|
79
|
+
}
|
80
|
+
|
81
|
+
this.buttonElement
|
82
|
+
.addClass( baseClasses )
|
83
|
+
.attr( "role", "button" )
|
84
|
+
.bind( "mouseenter.button", function() {
|
85
|
+
if ( options.disabled ) {
|
86
|
+
return;
|
87
|
+
}
|
88
|
+
$( this ).addClass( "ui-state-hover" );
|
89
|
+
if ( this === lastActive ) {
|
90
|
+
$( this ).addClass( "ui-state-active" );
|
91
|
+
}
|
92
|
+
})
|
93
|
+
.bind( "mouseleave.button", function() {
|
94
|
+
if ( options.disabled ) {
|
95
|
+
return;
|
96
|
+
}
|
97
|
+
$( this ).removeClass( hoverClass );
|
98
|
+
})
|
99
|
+
.bind( "focus.button", function() {
|
100
|
+
// no need to check disabled, focus won't be triggered anyway
|
101
|
+
$( this ).addClass( focusClass );
|
102
|
+
})
|
103
|
+
.bind( "blur.button", function() {
|
104
|
+
$( this ).removeClass( focusClass );
|
105
|
+
})
|
106
|
+
.bind( "click.button", function( event ) {
|
107
|
+
if ( options.disabled ) {
|
108
|
+
event.stopImmediatePropagation();
|
109
|
+
}
|
110
|
+
});
|
111
|
+
|
112
|
+
if ( toggleButton ) {
|
113
|
+
this.element.bind( "change.button", function() {
|
114
|
+
self.refresh();
|
115
|
+
});
|
116
|
+
}
|
117
|
+
|
118
|
+
if ( this.type === "checkbox" ) {
|
119
|
+
this.buttonElement.bind( "click.button", function() {
|
120
|
+
if ( options.disabled ) {
|
121
|
+
return false;
|
122
|
+
}
|
123
|
+
$( this ).toggleClass( "ui-state-active" );
|
124
|
+
self.buttonElement.attr( "aria-pressed", self.element[0].checked );
|
125
|
+
});
|
126
|
+
} else if ( this.type === "radio" ) {
|
127
|
+
this.buttonElement.bind( "click.button", function() {
|
128
|
+
if ( options.disabled ) {
|
129
|
+
return false;
|
130
|
+
}
|
131
|
+
$( this ).addClass( "ui-state-active" );
|
132
|
+
self.buttonElement.attr( "aria-pressed", true );
|
133
|
+
|
134
|
+
var radio = self.element[ 0 ];
|
135
|
+
radioGroup( radio )
|
136
|
+
.not( radio )
|
137
|
+
.map(function() {
|
138
|
+
return $( this ).button( "widget" )[ 0 ];
|
139
|
+
})
|
140
|
+
.removeClass( "ui-state-active" )
|
141
|
+
.attr( "aria-pressed", false );
|
142
|
+
});
|
143
|
+
} else {
|
144
|
+
this.buttonElement
|
145
|
+
.bind( "mousedown.button", function() {
|
146
|
+
if ( options.disabled ) {
|
147
|
+
return false;
|
148
|
+
}
|
149
|
+
$( this ).addClass( "ui-state-active" );
|
150
|
+
lastActive = this;
|
151
|
+
$( document ).one( "mouseup", function() {
|
152
|
+
lastActive = null;
|
153
|
+
});
|
154
|
+
})
|
155
|
+
.bind( "mouseup.button", function() {
|
156
|
+
if ( options.disabled ) {
|
157
|
+
return false;
|
158
|
+
}
|
159
|
+
$( this ).removeClass( "ui-state-active" );
|
160
|
+
})
|
161
|
+
.bind( "keydown.button", function(event) {
|
162
|
+
if ( options.disabled ) {
|
163
|
+
return false;
|
164
|
+
}
|
165
|
+
if ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) {
|
166
|
+
$( this ).addClass( "ui-state-active" );
|
167
|
+
}
|
168
|
+
})
|
169
|
+
.bind( "keyup.button", function() {
|
170
|
+
$( this ).removeClass( "ui-state-active" );
|
171
|
+
});
|
172
|
+
|
173
|
+
if ( this.buttonElement.is("a") ) {
|
174
|
+
this.buttonElement.keyup(function(event) {
|
175
|
+
if ( event.keyCode === $.ui.keyCode.SPACE ) {
|
176
|
+
// TODO pass through original event correctly (just as 2nd argument doesn't work)
|
177
|
+
$( this ).click();
|
178
|
+
}
|
179
|
+
});
|
180
|
+
}
|
181
|
+
}
|
182
|
+
|
183
|
+
// TODO: pull out $.Widget's handling for the disabled option into
|
184
|
+
// $.Widget.prototype._setOptionDisabled so it's easy to proxy and can
|
185
|
+
// be overridden by individual plugins
|
186
|
+
this._setOption( "disabled", options.disabled );
|
187
|
+
},
|
188
|
+
|
189
|
+
_determineButtonType: function() {
|
190
|
+
|
191
|
+
if ( this.element.is(":checkbox") ) {
|
192
|
+
this.type = "checkbox";
|
193
|
+
} else if ( this.element.is(":radio") ) {
|
194
|
+
this.type = "radio";
|
195
|
+
} else if ( this.element.is("input") ) {
|
196
|
+
this.type = "input";
|
197
|
+
} else {
|
198
|
+
this.type = "button";
|
199
|
+
}
|
200
|
+
|
201
|
+
if ( this.type === "checkbox" || this.type === "radio" ) {
|
202
|
+
// we don't search against the document in case the element
|
203
|
+
// is disconnected from the DOM
|
204
|
+
var ancestor = this.element.parents().filter(":last"),
|
205
|
+
labelSelector = "label[for=" + this.element.attr("id") + "]";
|
206
|
+
this.buttonElement = ancestor.find( labelSelector );
|
207
|
+
if ( !this.buttonElement.length ) {
|
208
|
+
ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
|
209
|
+
this.buttonElement = ancestor.filter( labelSelector );
|
210
|
+
if ( !this.buttonElement.length ) {
|
211
|
+
this.buttonElement = ancestor.find( labelSelector );
|
212
|
+
}
|
213
|
+
}
|
214
|
+
this.element.addClass( "ui-helper-hidden-accessible" );
|
215
|
+
|
216
|
+
var checked = this.element.is( ":checked" );
|
217
|
+
if ( checked ) {
|
218
|
+
this.buttonElement.addClass( "ui-state-active" );
|
219
|
+
}
|
220
|
+
this.buttonElement.attr( "aria-pressed", checked );
|
221
|
+
} else {
|
222
|
+
this.buttonElement = this.element;
|
223
|
+
}
|
224
|
+
},
|
225
|
+
|
226
|
+
widget: function() {
|
227
|
+
return this.buttonElement;
|
228
|
+
},
|
229
|
+
|
230
|
+
destroy: function() {
|
231
|
+
this.element
|
232
|
+
.removeClass( "ui-helper-hidden-accessible" );
|
233
|
+
this.buttonElement
|
234
|
+
.removeClass( baseClasses + " " + stateClasses + " " + typeClasses )
|
235
|
+
.removeAttr( "role" )
|
236
|
+
.removeAttr( "aria-pressed" )
|
237
|
+
.html( this.buttonElement.find(".ui-button-text").html() );
|
238
|
+
|
239
|
+
if ( !this.hasTitle ) {
|
240
|
+
this.buttonElement.removeAttr( "title" );
|
241
|
+
}
|
242
|
+
|
243
|
+
$.Widget.prototype.destroy.call( this );
|
244
|
+
},
|
245
|
+
|
246
|
+
_setOption: function( key, value ) {
|
247
|
+
$.Widget.prototype._setOption.apply( this, arguments );
|
248
|
+
if ( key === "disabled" ) {
|
249
|
+
if ( value ) {
|
250
|
+
this.element.attr( "disabled", true );
|
251
|
+
} else {
|
252
|
+
this.element.removeAttr( "disabled" );
|
253
|
+
}
|
254
|
+
}
|
255
|
+
this._resetButton();
|
256
|
+
},
|
257
|
+
|
258
|
+
refresh: function() {
|
259
|
+
var isDisabled = this.element.is( ":disabled" );
|
260
|
+
if ( isDisabled !== this.options.disabled ) {
|
261
|
+
this._setOption( "disabled", isDisabled );
|
262
|
+
}
|
263
|
+
if ( this.type === "radio" ) {
|
264
|
+
radioGroup( this.element[0] ).each(function() {
|
265
|
+
if ( $( this ).is( ":checked" ) ) {
|
266
|
+
$( this ).button( "widget" )
|
267
|
+
.addClass( "ui-state-active" )
|
268
|
+
.attr( "aria-pressed", true );
|
269
|
+
} else {
|
270
|
+
$( this ).button( "widget" )
|
271
|
+
.removeClass( "ui-state-active" )
|
272
|
+
.attr( "aria-pressed", false );
|
273
|
+
}
|
274
|
+
});
|
275
|
+
} else if ( this.type === "checkbox" ) {
|
276
|
+
if ( this.element.is( ":checked" ) ) {
|
277
|
+
this.buttonElement
|
278
|
+
.addClass( "ui-state-active" )
|
279
|
+
.attr( "aria-pressed", true );
|
280
|
+
} else {
|
281
|
+
this.buttonElement
|
282
|
+
.removeClass( "ui-state-active" )
|
283
|
+
.attr( "aria-pressed", false );
|
284
|
+
}
|
285
|
+
}
|
286
|
+
},
|
287
|
+
|
288
|
+
_resetButton: function() {
|
289
|
+
if ( this.type === "input" ) {
|
290
|
+
if ( this.options.label ) {
|
291
|
+
this.element.val( this.options.label );
|
292
|
+
}
|
293
|
+
return;
|
294
|
+
}
|
295
|
+
var buttonElement = this.buttonElement.removeClass( typeClasses ),
|
296
|
+
buttonText = $( "<span></span>" )
|
297
|
+
.addClass( "ui-button-text" )
|
298
|
+
.html( this.options.label )
|
299
|
+
.appendTo( buttonElement.empty() )
|
300
|
+
.text(),
|
301
|
+
icons = this.options.icons,
|
302
|
+
multipleIcons = icons.primary && icons.secondary,
|
303
|
+
buttonClasses = [];
|
304
|
+
|
305
|
+
if ( icons.primary || icons.secondary ) {
|
306
|
+
if ( this.options.text ) {
|
307
|
+
buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
|
308
|
+
}
|
309
|
+
|
310
|
+
if ( icons.primary ) {
|
311
|
+
buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
|
312
|
+
}
|
313
|
+
|
314
|
+
if ( icons.secondary ) {
|
315
|
+
buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
|
316
|
+
}
|
317
|
+
|
318
|
+
if ( !this.options.text ) {
|
319
|
+
buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
|
320
|
+
|
321
|
+
if ( !this.hasTitle ) {
|
322
|
+
buttonElement.attr( "title", buttonText );
|
323
|
+
}
|
324
|
+
}
|
325
|
+
} else {
|
326
|
+
buttonClasses.push( "ui-button-text-only" );
|
327
|
+
}
|
328
|
+
buttonElement.addClass( buttonClasses.join( " " ) );
|
329
|
+
}
|
330
|
+
});
|
331
|
+
|
332
|
+
$.widget( "ui.buttonset", {
|
333
|
+
options: {
|
334
|
+
items: ":button, :submit, :reset, :checkbox, :radio, a, :data(button)"
|
335
|
+
},
|
336
|
+
|
337
|
+
_create: function() {
|
338
|
+
this.element.addClass( "ui-buttonset" );
|
339
|
+
},
|
340
|
+
|
341
|
+
_init: function() {
|
342
|
+
this.refresh();
|
343
|
+
},
|
344
|
+
|
345
|
+
_setOption: function( key, value ) {
|
346
|
+
if ( key === "disabled" ) {
|
347
|
+
this.buttons.button( "option", key, value );
|
348
|
+
}
|
349
|
+
|
350
|
+
$.Widget.prototype._setOption.apply( this, arguments );
|
351
|
+
},
|
352
|
+
|
353
|
+
refresh: function() {
|
354
|
+
this.buttons = this.element.find( this.options.items )
|
355
|
+
.filter( ":ui-button" )
|
356
|
+
.button( "refresh" )
|
357
|
+
.end()
|
358
|
+
.not( ":ui-button" )
|
359
|
+
.button()
|
360
|
+
.end()
|
361
|
+
.map(function() {
|
362
|
+
return $( this ).button( "widget" )[ 0 ];
|
363
|
+
})
|
364
|
+
.removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
|
365
|
+
.filter( ":first" )
|
366
|
+
.addClass( "ui-corner-left" )
|
367
|
+
.end()
|
368
|
+
.filter( ":last" )
|
369
|
+
.addClass( "ui-corner-right" )
|
370
|
+
.end()
|
371
|
+
.end();
|
372
|
+
},
|
373
|
+
|
374
|
+
destroy: function() {
|
375
|
+
this.element.removeClass( "ui-buttonset" );
|
376
|
+
this.buttons
|
377
|
+
.map(function() {
|
378
|
+
return $( this ).button( "widget" )[ 0 ];
|
379
|
+
})
|
380
|
+
.removeClass( "ui-corner-left ui-corner-right" )
|
381
|
+
.end()
|
382
|
+
.button( "destroy" );
|
383
|
+
|
384
|
+
$.Widget.prototype.destroy.call( this );
|
385
|
+
}
|
386
|
+
});
|
387
|
+
|
388
|
+
}( jQuery ) );
|
@@ -0,0 +1,312 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery UI 1.8.13
|
3
|
+
*
|
4
|
+
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
5
|
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
6
|
+
* http://jquery.org/license
|
7
|
+
*
|
8
|
+
* http://docs.jquery.com/UI
|
9
|
+
*/
|
10
|
+
(function( $, undefined ) {
|
11
|
+
|
12
|
+
// prevent duplicate loading
|
13
|
+
// this is only a problem because we proxy existing functions
|
14
|
+
// and we don't want to double proxy them
|
15
|
+
$.ui = $.ui || {};
|
16
|
+
if ( $.ui.version ) {
|
17
|
+
return;
|
18
|
+
}
|
19
|
+
|
20
|
+
$.extend( $.ui, {
|
21
|
+
version: "1.8.13",
|
22
|
+
|
23
|
+
keyCode: {
|
24
|
+
ALT: 18,
|
25
|
+
BACKSPACE: 8,
|
26
|
+
CAPS_LOCK: 20,
|
27
|
+
COMMA: 188,
|
28
|
+
COMMAND: 91,
|
29
|
+
COMMAND_LEFT: 91, // COMMAND
|
30
|
+
COMMAND_RIGHT: 93,
|
31
|
+
CONTROL: 17,
|
32
|
+
DELETE: 46,
|
33
|
+
DOWN: 40,
|
34
|
+
END: 35,
|
35
|
+
ENTER: 13,
|
36
|
+
ESCAPE: 27,
|
37
|
+
HOME: 36,
|
38
|
+
INSERT: 45,
|
39
|
+
LEFT: 37,
|
40
|
+
MENU: 93, // COMMAND_RIGHT
|
41
|
+
NUMPAD_ADD: 107,
|
42
|
+
NUMPAD_DECIMAL: 110,
|
43
|
+
NUMPAD_DIVIDE: 111,
|
44
|
+
NUMPAD_ENTER: 108,
|
45
|
+
NUMPAD_MULTIPLY: 106,
|
46
|
+
NUMPAD_SUBTRACT: 109,
|
47
|
+
PAGE_DOWN: 34,
|
48
|
+
PAGE_UP: 33,
|
49
|
+
PERIOD: 190,
|
50
|
+
RIGHT: 39,
|
51
|
+
SHIFT: 16,
|
52
|
+
SPACE: 32,
|
53
|
+
TAB: 9,
|
54
|
+
UP: 38,
|
55
|
+
WINDOWS: 91 // COMMAND
|
56
|
+
}
|
57
|
+
});
|
58
|
+
|
59
|
+
// plugins
|
60
|
+
$.fn.extend({
|
61
|
+
_focus: $.fn.focus,
|
62
|
+
focus: function( delay, fn ) {
|
63
|
+
return typeof delay === "number" ?
|
64
|
+
this.each(function() {
|
65
|
+
var elem = this;
|
66
|
+
setTimeout(function() {
|
67
|
+
$( elem ).focus();
|
68
|
+
if ( fn ) {
|
69
|
+
fn.call( elem );
|
70
|
+
}
|
71
|
+
}, delay );
|
72
|
+
}) :
|
73
|
+
this._focus.apply( this, arguments );
|
74
|
+
},
|
75
|
+
|
76
|
+
scrollParent: function() {
|
77
|
+
var scrollParent;
|
78
|
+
if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
|
79
|
+
scrollParent = this.parents().filter(function() {
|
80
|
+
return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
|
81
|
+
}).eq(0);
|
82
|
+
} else {
|
83
|
+
scrollParent = this.parents().filter(function() {
|
84
|
+
return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
|
85
|
+
}).eq(0);
|
86
|
+
}
|
87
|
+
|
88
|
+
return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
|
89
|
+
},
|
90
|
+
|
91
|
+
zIndex: function( zIndex ) {
|
92
|
+
if ( zIndex !== undefined ) {
|
93
|
+
return this.css( "zIndex", zIndex );
|
94
|
+
}
|
95
|
+
|
96
|
+
if ( this.length ) {
|
97
|
+
var elem = $( this[ 0 ] ), position, value;
|
98
|
+
while ( elem.length && elem[ 0 ] !== document ) {
|
99
|
+
// Ignore z-index if position is set to a value where z-index is ignored by the browser
|
100
|
+
// This makes behavior of this function consistent across browsers
|
101
|
+
// WebKit always returns auto if the element is positioned
|
102
|
+
position = elem.css( "position" );
|
103
|
+
if ( position === "absolute" || position === "relative" || position === "fixed" ) {
|
104
|
+
// IE returns 0 when zIndex is not specified
|
105
|
+
// other browsers return a string
|
106
|
+
// we ignore the case of nested elements with an explicit value of 0
|
107
|
+
// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
|
108
|
+
value = parseInt( elem.css( "zIndex" ), 10 );
|
109
|
+
if ( !isNaN( value ) && value !== 0 ) {
|
110
|
+
return value;
|
111
|
+
}
|
112
|
+
}
|
113
|
+
elem = elem.parent();
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
return 0;
|
118
|
+
},
|
119
|
+
|
120
|
+
disableSelection: function() {
|
121
|
+
return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
|
122
|
+
".ui-disableSelection", function( event ) {
|
123
|
+
event.preventDefault();
|
124
|
+
});
|
125
|
+
},
|
126
|
+
|
127
|
+
enableSelection: function() {
|
128
|
+
return this.unbind( ".ui-disableSelection" );
|
129
|
+
}
|
130
|
+
});
|
131
|
+
|
132
|
+
$.each( [ "Width", "Height" ], function( i, name ) {
|
133
|
+
var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
|
134
|
+
type = name.toLowerCase(),
|
135
|
+
orig = {
|
136
|
+
innerWidth: $.fn.innerWidth,
|
137
|
+
innerHeight: $.fn.innerHeight,
|
138
|
+
outerWidth: $.fn.outerWidth,
|
139
|
+
outerHeight: $.fn.outerHeight
|
140
|
+
};
|
141
|
+
|
142
|
+
function reduce( elem, size, border, margin ) {
|
143
|
+
$.each( side, function() {
|
144
|
+
size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0;
|
145
|
+
if ( border ) {
|
146
|
+
size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0;
|
147
|
+
}
|
148
|
+
if ( margin ) {
|
149
|
+
size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0;
|
150
|
+
}
|
151
|
+
});
|
152
|
+
return size;
|
153
|
+
}
|
154
|
+
|
155
|
+
$.fn[ "inner" + name ] = function( size ) {
|
156
|
+
if ( size === undefined ) {
|
157
|
+
return orig[ "inner" + name ].call( this );
|
158
|
+
}
|
159
|
+
|
160
|
+
return this.each(function() {
|
161
|
+
$( this ).css( type, reduce( this, size ) + "px" );
|
162
|
+
});
|
163
|
+
};
|
164
|
+
|
165
|
+
$.fn[ "outer" + name] = function( size, margin ) {
|
166
|
+
if ( typeof size !== "number" ) {
|
167
|
+
return orig[ "outer" + name ].call( this, size );
|
168
|
+
}
|
169
|
+
|
170
|
+
return this.each(function() {
|
171
|
+
$( this).css( type, reduce( this, size, true, margin ) + "px" );
|
172
|
+
});
|
173
|
+
};
|
174
|
+
});
|
175
|
+
|
176
|
+
// selectors
|
177
|
+
function focusable( element, isTabIndexNotNaN ) {
|
178
|
+
var nodeName = element.nodeName.toLowerCase();
|
179
|
+
if ( "area" === nodeName ) {
|
180
|
+
var map = element.parentNode,
|
181
|
+
mapName = map.name,
|
182
|
+
img;
|
183
|
+
if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
|
184
|
+
return false;
|
185
|
+
}
|
186
|
+
img = $( "img[usemap=#" + mapName + "]" )[0];
|
187
|
+
return !!img && visible( img );
|
188
|
+
}
|
189
|
+
return ( /input|select|textarea|button|object/.test( nodeName )
|
190
|
+
? !element.disabled
|
191
|
+
: "a" == nodeName
|
192
|
+
? element.href || isTabIndexNotNaN
|
193
|
+
: isTabIndexNotNaN)
|
194
|
+
// the element and all of its ancestors must be visible
|
195
|
+
&& visible( element );
|
196
|
+
}
|
197
|
+
|
198
|
+
function visible( element ) {
|
199
|
+
return !$( element ).parents().andSelf().filter(function() {
|
200
|
+
return $.curCSS( this, "visibility" ) === "hidden" ||
|
201
|
+
$.expr.filters.hidden( this );
|
202
|
+
}).length;
|
203
|
+
}
|
204
|
+
|
205
|
+
$.extend( $.expr[ ":" ], {
|
206
|
+
data: function( elem, i, match ) {
|
207
|
+
return !!$.data( elem, match[ 3 ] );
|
208
|
+
},
|
209
|
+
|
210
|
+
focusable: function( element ) {
|
211
|
+
return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
|
212
|
+
},
|
213
|
+
|
214
|
+
tabbable: function( element ) {
|
215
|
+
var tabIndex = $.attr( element, "tabindex" ),
|
216
|
+
isTabIndexNaN = isNaN( tabIndex );
|
217
|
+
return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
|
218
|
+
}
|
219
|
+
});
|
220
|
+
|
221
|
+
// support
|
222
|
+
$(function() {
|
223
|
+
var body = document.body,
|
224
|
+
div = body.appendChild( div = document.createElement( "div" ) );
|
225
|
+
|
226
|
+
$.extend( div.style, {
|
227
|
+
minHeight: "100px",
|
228
|
+
height: "auto",
|
229
|
+
padding: 0,
|
230
|
+
borderWidth: 0
|
231
|
+
});
|
232
|
+
|
233
|
+
$.support.minHeight = div.offsetHeight === 100;
|
234
|
+
$.support.selectstart = "onselectstart" in div;
|
235
|
+
|
236
|
+
// set display to none to avoid a layout bug in IE
|
237
|
+
// http://dev.jquery.com/ticket/4014
|
238
|
+
body.removeChild( div ).style.display = "none";
|
239
|
+
});
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
// deprecated
|
246
|
+
$.extend( $.ui, {
|
247
|
+
// $.ui.plugin is deprecated. Use the proxy pattern instead.
|
248
|
+
plugin: {
|
249
|
+
add: function( module, option, set ) {
|
250
|
+
var proto = $.ui[ module ].prototype;
|
251
|
+
for ( var i in set ) {
|
252
|
+
proto.plugins[ i ] = proto.plugins[ i ] || [];
|
253
|
+
proto.plugins[ i ].push( [ option, set[ i ] ] );
|
254
|
+
}
|
255
|
+
},
|
256
|
+
call: function( instance, name, args ) {
|
257
|
+
var set = instance.plugins[ name ];
|
258
|
+
if ( !set || !instance.element[ 0 ].parentNode ) {
|
259
|
+
return;
|
260
|
+
}
|
261
|
+
|
262
|
+
for ( var i = 0; i < set.length; i++ ) {
|
263
|
+
if ( instance.options[ set[ i ][ 0 ] ] ) {
|
264
|
+
set[ i ][ 1 ].apply( instance.element, args );
|
265
|
+
}
|
266
|
+
}
|
267
|
+
}
|
268
|
+
},
|
269
|
+
|
270
|
+
// will be deprecated when we switch to jQuery 1.4 - use jQuery.contains()
|
271
|
+
contains: function( a, b ) {
|
272
|
+
return document.compareDocumentPosition ?
|
273
|
+
a.compareDocumentPosition( b ) & 16 :
|
274
|
+
a !== b && a.contains( b );
|
275
|
+
},
|
276
|
+
|
277
|
+
// only used by resizable
|
278
|
+
hasScroll: function( el, a ) {
|
279
|
+
|
280
|
+
//If overflow is hidden, the element might have extra content, but the user wants to hide it
|
281
|
+
if ( $( el ).css( "overflow" ) === "hidden") {
|
282
|
+
return false;
|
283
|
+
}
|
284
|
+
|
285
|
+
var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
|
286
|
+
has = false;
|
287
|
+
|
288
|
+
if ( el[ scroll ] > 0 ) {
|
289
|
+
return true;
|
290
|
+
}
|
291
|
+
|
292
|
+
// TODO: determine which cases actually cause this to happen
|
293
|
+
// if the element doesn't have the scroll set, see if it's possible to
|
294
|
+
// set the scroll
|
295
|
+
el[ scroll ] = 1;
|
296
|
+
has = ( el[ scroll ] > 0 );
|
297
|
+
el[ scroll ] = 0;
|
298
|
+
return has;
|
299
|
+
},
|
300
|
+
|
301
|
+
// these are odd functions, fix the API or move into individual plugins
|
302
|
+
isOverAxis: function( x, reference, size ) {
|
303
|
+
//Determines when x coordinate is over "b" element axis
|
304
|
+
return ( x > reference ) && ( x < ( reference + size ) );
|
305
|
+
},
|
306
|
+
isOver: function( y, x, top, left, height, width ) {
|
307
|
+
//Determines when x, y coordinates is over "b" element
|
308
|
+
return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
|
309
|
+
}
|
310
|
+
});
|
311
|
+
|
312
|
+
})( jQuery );
|