alchemy_cms 2.4.rc1 → 2.4.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/stylesheets/alchemy/base.scss +2 -18
- data/app/assets/stylesheets/alchemy/elements.scss +2 -2
- data/app/assets/stylesheets/alchemy/form_elements.scss +35 -18
- data/app/assets/stylesheets/alchemy/login.scss +1 -1
- data/app/assets/stylesheets/alchemy/mixins.scss +4 -3
- data/app/assets/stylesheets/alchemy/search.scss +2 -6
- data/app/assets/stylesheets/alchemy/tables.scss +2 -2
- data/app/controllers/alchemy/admin/elements_controller.rb +1 -1
- data/app/views/alchemy/admin/elements/create.js.erb +3 -1
- data/app/views/alchemy/admin/tags/_tag.html.erb +1 -1
- data/app/views/alchemy/admin/tags/edit.html.erb +3 -3
- data/lib/alchemy/version.rb +1 -1
- data/spec/controllers/admin/elements_controller_spec.rb +13 -4
- data/vendor/assets/javascripts/jquery_plugins/jquery.selectboxit.min.js +11 -1
- metadata +2 -2
@@ -175,7 +175,7 @@ div.tip {
|
|
175
175
|
}
|
176
176
|
|
177
177
|
#page_names textarea {
|
178
|
-
height:
|
178
|
+
height: 67px;
|
179
179
|
}
|
180
180
|
|
181
181
|
div#new_page_from_clipboard {
|
@@ -858,7 +858,7 @@ div.elements_for_page {
|
|
858
858
|
|
859
859
|
.alchemy_selectbox {
|
860
860
|
float: left;
|
861
|
-
width:
|
861
|
+
width: 212px;
|
862
862
|
}
|
863
863
|
}
|
864
864
|
|
@@ -952,26 +952,10 @@ select#url_protocol.medium {
|
|
952
952
|
margin: 0;
|
953
953
|
}
|
954
954
|
|
955
|
-
#alchemy .ui-dialog-content input.auto_resize, #alchemy .ui-dialog-content textarea.auto_resize {
|
956
|
-
width: 98%;
|
957
|
-
}
|
958
|
-
|
959
955
|
#alchemy .ui-dialog-content td.medium {
|
960
956
|
width: 76px;
|
961
957
|
}
|
962
958
|
|
963
|
-
#alchemy .ui-dialog-content input.medium_long {
|
964
|
-
width: 129px;
|
965
|
-
}
|
966
|
-
|
967
|
-
#alchemy .ui-dialog-content input.long, #alchemy .ui-dialog-content textarea.long {
|
968
|
-
width: 240px;
|
969
|
-
}
|
970
|
-
|
971
|
-
#alchemy .ui-dialog-content input.very_long {
|
972
|
-
width: 300px;
|
973
|
-
}
|
974
|
-
|
975
959
|
#alchemy .ui-dialog-content p.buttons {
|
976
960
|
text-align: right;
|
977
961
|
margin: 0;
|
@@ -216,7 +216,7 @@ div.element_editor {
|
|
216
216
|
|
217
217
|
input[data-autocomplete] {
|
218
218
|
padding-left: 25px;
|
219
|
-
width:
|
219
|
+
width: 100%;
|
220
220
|
background-color: #F1EAD9;
|
221
221
|
}
|
222
222
|
}
|
@@ -629,7 +629,7 @@ div.content_editor {
|
|
629
629
|
position: relative;
|
630
630
|
|
631
631
|
input.thin_border {
|
632
|
-
width:
|
632
|
+
width: 100%;
|
633
633
|
}
|
634
634
|
|
635
635
|
&.missing p {
|
@@ -240,19 +240,35 @@ textarea, input[type="text"], input[type="email"], input[type="password"], .thin
|
|
240
240
|
}
|
241
241
|
}
|
242
242
|
|
243
|
+
#alchemy .ui-dialog-content input.auto_resize, #alchemy .ui-dialog-content textarea.auto_resize {
|
244
|
+
width: 100%;
|
245
|
+
}
|
246
|
+
|
247
|
+
#alchemy .ui-dialog-content input.medium_long {
|
248
|
+
width: 139px;
|
249
|
+
}
|
250
|
+
|
251
|
+
#alchemy .ui-dialog-content input.long, #alchemy .ui-dialog-content textarea.long {
|
252
|
+
width: 250px;
|
253
|
+
}
|
254
|
+
|
255
|
+
#alchemy .ui-dialog-content input.very_long {
|
256
|
+
width: 310px;
|
257
|
+
}
|
258
|
+
|
243
259
|
textarea {
|
244
260
|
height: auto;
|
245
|
-
padding: 4px !important;
|
261
|
+
padding: 4px 8px !important;
|
246
262
|
line-height: 19px !important;
|
247
263
|
}
|
248
264
|
|
249
265
|
input#search_input_field {
|
250
|
-
width:
|
266
|
+
width: 224px;
|
251
267
|
text-align: left;
|
252
268
|
@include border-radius(21px);
|
253
269
|
padding: 3px 26px;
|
254
270
|
margin: 0;
|
255
|
-
height:
|
271
|
+
height: 29px;
|
256
272
|
}
|
257
273
|
|
258
274
|
div.search_field span.icon, div.js_filter_field_box span.icon {
|
@@ -267,11 +283,11 @@ div.search_field span.icon, div.js_filter_field_box span.icon {
|
|
267
283
|
margin-left: 4px;
|
268
284
|
|
269
285
|
.js_filter_field {
|
270
|
-
width:
|
286
|
+
width: 220px;
|
271
287
|
text-align: left;
|
272
288
|
@include border-radius(15px);
|
273
289
|
padding: 3px 24px;
|
274
|
-
height:
|
290
|
+
height: 29px;
|
275
291
|
margin: 0;
|
276
292
|
}
|
277
293
|
|
@@ -307,7 +323,7 @@ select {
|
|
307
323
|
* Author: @gregfranko
|
308
324
|
*/
|
309
325
|
|
310
|
-
form td.select
|
326
|
+
form td.select .selectboxit {
|
311
327
|
width: 208px;
|
312
328
|
|
313
329
|
.selectboxit-text {
|
@@ -315,7 +331,7 @@ form td.select div.selectboxit {
|
|
315
331
|
}
|
316
332
|
}
|
317
333
|
|
318
|
-
|
334
|
+
.selectboxit-container {
|
319
335
|
@include inline-block;
|
320
336
|
margin: $default-form-field-margin;
|
321
337
|
position: relative;
|
@@ -325,11 +341,11 @@ div.selectboxit-container {
|
|
325
341
|
|
326
342
|
a { text-decoration: none }
|
327
343
|
|
328
|
-
|
344
|
+
.selectboxit {
|
329
345
|
@include default-button-style;
|
330
346
|
width: auto;
|
331
347
|
height: 15px;
|
332
|
-
padding: 6px 0 6px
|
348
|
+
padding: 6px 0 6px 8px;
|
333
349
|
margin: 0;
|
334
350
|
@include inline-block;
|
335
351
|
overflow: hidden;
|
@@ -344,7 +360,7 @@ div.selectboxit-container {
|
|
344
360
|
}
|
345
361
|
|
346
362
|
&.short {
|
347
|
-
width:
|
363
|
+
width: 82px;
|
348
364
|
|
349
365
|
.selectboxit-text {
|
350
366
|
max-width: 60px !important;
|
@@ -352,7 +368,7 @@ div.selectboxit-container {
|
|
352
368
|
}
|
353
369
|
|
354
370
|
&.medium {
|
355
|
-
width:
|
371
|
+
width: 150px;
|
356
372
|
|
357
373
|
.selectboxit-text {
|
358
374
|
max-width: 120px !important;
|
@@ -360,7 +376,7 @@ div.selectboxit-container {
|
|
360
376
|
}
|
361
377
|
|
362
378
|
&.long {
|
363
|
-
width:
|
379
|
+
width: 240px;
|
364
380
|
|
365
381
|
.selectboxit-text {
|
366
382
|
max-width: 210px !important;
|
@@ -368,7 +384,7 @@ div.selectboxit-container {
|
|
368
384
|
}
|
369
385
|
|
370
386
|
&.very_long {
|
371
|
-
width:
|
387
|
+
width: 310px;
|
372
388
|
|
373
389
|
.selectboxit-text {
|
374
390
|
max-width: 280px !important;
|
@@ -376,7 +392,7 @@ div.selectboxit-container {
|
|
376
392
|
}
|
377
393
|
|
378
394
|
&.full_width {
|
379
|
-
width:
|
395
|
+
width: 426px;
|
380
396
|
|
381
397
|
.selectboxit-text {
|
382
398
|
max-width: 396px !important;
|
@@ -441,6 +457,7 @@ div.selectboxit-container {
|
|
441
457
|
|
442
458
|
/* Dropdown List Options List*/
|
443
459
|
ul {
|
460
|
+
@include box-sizing(border-box);
|
444
461
|
min-height: 28px;
|
445
462
|
min-width: 100%;
|
446
463
|
background: white;
|
@@ -465,10 +482,10 @@ div.selectboxit-container {
|
|
465
482
|
white-space: nowrap;
|
466
483
|
list-style: none;
|
467
484
|
margin: 0;
|
468
|
-
padding: 6px
|
485
|
+
padding: 6px 8px;
|
469
486
|
}
|
470
487
|
|
471
|
-
li.selectboxit-hover, li.selectboxit-focus {
|
488
|
+
li.selectboxit-hover, li.selectboxit-focus, li.active {
|
472
489
|
background-color: #e6f0f5;
|
473
490
|
color: $text-color;
|
474
491
|
}
|
@@ -485,7 +502,7 @@ div.selectboxit-container {
|
|
485
502
|
|
486
503
|
/* Dropdown List Optgroup Options */
|
487
504
|
.selectboxit-optgroup-option {
|
488
|
-
text-indent:
|
505
|
+
text-indent: 8px;
|
489
506
|
}
|
490
507
|
|
491
508
|
/* Dropdown List Optgroup Header hover psuedo class */
|
@@ -505,7 +522,7 @@ div.selectboxit-container {
|
|
505
522
|
}
|
506
523
|
|
507
524
|
input[data-autocomplete] {
|
508
|
-
width:
|
525
|
+
width: 250px;
|
509
526
|
padding-left: 24px;
|
510
527
|
}
|
511
528
|
}
|
@@ -51,21 +51,22 @@
|
|
51
51
|
}
|
52
52
|
|
53
53
|
@mixin default-input-style {
|
54
|
+
@include box-sizing(border-box);
|
54
55
|
$border-inset-color: lighten($default-border-color, 20%);
|
55
56
|
@include rounded-corner;
|
56
57
|
@include box-shadow(inset 1px 1px 2px $medium-gray);
|
57
58
|
font: $default-font-style;
|
58
|
-
padding: 1px
|
59
|
+
padding: 1px 2*$default-padding;
|
59
60
|
margin: $default-form-field-margin;
|
60
61
|
background: #fff;
|
61
62
|
border-top: 1px solid $default-border-color;
|
62
63
|
border-left: 1px solid $default-border-color;
|
63
64
|
border-bottom: 1px solid $border-inset-color;
|
64
65
|
border-right: 1px solid $border-inset-color;
|
65
|
-
width:
|
66
|
+
width: 218px;
|
66
67
|
font-size: 12px;
|
67
68
|
line-height: 12px;
|
68
|
-
height:
|
69
|
+
height: 29px;
|
69
70
|
@include transition(all 0.25s ease-in-out);
|
70
71
|
|
71
72
|
&:focus {
|
@@ -48,12 +48,8 @@ td#tags_tag_list {
|
|
48
48
|
margin: 0;
|
49
49
|
|
50
50
|
.js_filter_field {
|
51
|
-
width:
|
52
|
-
border-radius
|
53
|
-
-o-border-radius: 3px;
|
54
|
-
-ms-border-radius: 3px;
|
55
|
-
-moz-border-radius: 3px;
|
56
|
-
-webkit-border-radius: 3px;
|
51
|
+
width: 100%;
|
52
|
+
@include border-radius(3px);
|
57
53
|
}
|
58
54
|
|
59
55
|
label {
|
@@ -133,7 +133,7 @@ module Alchemy
|
|
133
133
|
@source_element = Element.find(element_from_clipboard[:id])
|
134
134
|
new_attributes = {:page_id => @page.id}
|
135
135
|
if @page.can_have_cells?
|
136
|
-
new_attributes = new_attributes.merge({:cell_id => find_or_create_cell.id})
|
136
|
+
new_attributes = new_attributes.merge({:cell_id => find_or_create_cell.try(:id)})
|
137
137
|
end
|
138
138
|
element = Element.copy(@source_element, new_attributes)
|
139
139
|
cut_element if element_from_clipboard[:action] == 'cut'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
var $el;
|
2
|
-
var $element_area
|
2
|
+
var $element_area;
|
3
3
|
var element_html = '<%= escape_javascript render(:partial => "element", :object => @element, :locals => {:draggable => true}) -%>';
|
4
4
|
|
5
5
|
<% if @cutted_element_id %>
|
@@ -10,6 +10,8 @@ $('.element_editor[data-element-id="<%= @cutted_element_id %>"]').remove();
|
|
10
10
|
Alchemy.selectOrCreateCellTab('<%= @cell_name -%>', '<%= @cell.nil? ? t("other Elements") : @cell.name_for_label -%>');
|
11
11
|
<% end %>
|
12
12
|
|
13
|
+
$element_area = $('#cell_<%= @cell_name -%>');
|
14
|
+
|
13
15
|
<% if @insert_at_top %>
|
14
16
|
$element_area.prepend(element_html);
|
15
17
|
<% else %>
|
@@ -2,11 +2,11 @@
|
|
2
2
|
<%= form_for @tag, :as => :tag, :url => {:controller => :tags, :action => "update", :id => @tag.id}, :html => {:method => :put}, :remote => true do |f| %>
|
3
3
|
<table border="0" cellspacing="4" cellpadding="4" style="width: 100%">
|
4
4
|
<tr>
|
5
|
-
<td class="label
|
5
|
+
<td class="label">
|
6
6
|
<%= f.label :name, "Name" %>
|
7
7
|
</td>
|
8
8
|
<td class="input">
|
9
|
-
<%= f.text_field :name, :class => "thin_border
|
9
|
+
<%= f.text_field :name, :class => "thin_border long" %>
|
10
10
|
</td>
|
11
11
|
</tr>
|
12
12
|
<tr>
|
@@ -21,7 +21,7 @@
|
|
21
21
|
<%= form_for @tag, :as => :tag, :url => {:controller => :tags, :action => "update", :id => @tag.id, :replace => true}, :html => {:method => :put, :style => "clear: both"}, :remote => true do |f| %>
|
22
22
|
<table border="0" cellspacing="4" cellpadding="4" style="width: 100%">
|
23
23
|
<tr>
|
24
|
-
<td class="label
|
24
|
+
<td class="label">
|
25
25
|
<label>Tags</label>
|
26
26
|
</td>
|
27
27
|
<td class="input" id="tags_tag_list">
|
data/lib/alchemy/version.rb
CHANGED
@@ -156,7 +156,7 @@ module Alchemy
|
|
156
156
|
|
157
157
|
describe '#create' do
|
158
158
|
|
159
|
-
context "
|
159
|
+
context "if page has cells" do
|
160
160
|
|
161
161
|
context "" do
|
162
162
|
|
@@ -206,9 +206,18 @@ module Alchemy
|
|
206
206
|
clipboard[:elements] = [{:id => element_in_clipboard.id}]
|
207
207
|
end
|
208
208
|
|
209
|
-
|
210
|
-
|
211
|
-
|
209
|
+
context "and cell name in element name" do
|
210
|
+
it "should create the element in the correct cell" do
|
211
|
+
post :create, {:element => {:page_id => @page.id}, :paste_from_clipboard => "#{element_in_clipboard.id}##{@cell.name}", :format => :js}
|
212
|
+
@cell.elements.first.should be_an_instance_of(Element)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
context "and no cell name in element name" do
|
217
|
+
it "should create the element in the nil cell" do
|
218
|
+
post :create, {:element => {:page_id => @page.id}, :paste_from_clipboard => "#{element_in_clipboard.id}", :format => :js}
|
219
|
+
@page.elements.first.cell.should == nil
|
220
|
+
end
|
212
221
|
end
|
213
222
|
|
214
223
|
context "" do
|
@@ -1 +1,11 @@
|
|
1
|
-
(function(e){"use strict";e(window.jQuery,window,document)})(function(e,t,n,r){"use strict";e.widget("selectBox.selectBoxIt",{VERSION:"1.8.0",options:{showEffect:"none",showEffectOptions:{},showEffectSpeed:"medium",hideEffect:"none",hideEffectOptions:{},hideEffectSpeed:"medium",showFirstOption:!0,defaultText:"",defaultIcon:"",downArrowIcon:"",theme:"twitterbootstrap",keydownOpen:!0,isMobile:function(){var e=navigator.userAgent||navigator.vendor||t.opera;return/android.+mobile|avantgo|bada\/|blackberry|ipad|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(e.substr(0,4))}},_create:function(){var t=this;return t.originalElem=t.element[0],t.selectBox=t.element,t.selectItems=t.element.find("option"),t.firstSelectItem=t.element.find("option").slice(0,1),t.currentFocus=0,t.blur=!0,t.documentHeight=e(n).height(),t.textArray=[],t.currentIndex=0,t.flipped=!1,t._createDiv()._createUnorderedList()._replaceSelectBox()._eventHandlers(),t.originalElem.disabled&&t.disable&&t.disable(),t._ariaAccessibility&&t._ariaAccessibility(),t._mobile&&t._mobile(),t.options.theme==="twitterbootstrap"?t._twitterbootstrap():this.options.theme==="jqueryui"?t._jqueryui():t._addClasses(),t.selectBox.trigger("create"),t},_createDiv:function(){var t=this;return t.divText=e("<span/>",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItText","class":"selectboxit-text",unselectable:"on",text:t.firstSelectItem.text()}).attr("data-val",t.originalElem.value),t.divImage=e("<i/>",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItDefaultIcon","class":"selectboxit-default-icon",unselectable:"on"}),t.div=e("<div/>",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxIt","class":"selectboxit "+(t.selectBox.attr("class")||""),style:t.selectBox.attr("style"),name:t.originalElem.name,tabindex:t.selectBox.attr("tabindex")||"0",unselectable:"on"}).append(t.divImage).append(t.divText),t.divContainer=e("<div/>",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItContainer","class":"selectboxit-container"}).append(t.div),t},_createUnorderedList:function(){var t=this,n,r="",i="",s,o=[],u=e("<ul/>",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItOptions","class":"selectboxit-options",tabindex:-1});return t.options.showFirstOption||(t.selectItems=t.selectBox.find("option").slice(1)),t.selectItems.each(function(u){n=e(this).prop("disabled"),s=e(this).data("icon")||"",e(this).parent().is("optgroup")?(r="selectboxit-optgroup-option",e(this).index()===0?i='<div class="selectboxit-optgroup-header" data-disabled="true">'+e(this).parent().first().attr("label")+"</div>":i=""):r="",o.push(i+'<li id="'+u+'" data-val="'+this.value.replace(/\"/g,""")+'" data-disabled="'+n+'" class="'+r+" selectboxit-option"+(e(this).attr("class")||"")+'" style="'+(e(this).attr("style")||"")+'"><a><i class="'+s+'"></i>'+e(this).text()+"</a></li>"),t.textArray[u]=e(this).text(),this.selected&&(t.divText.text(e(this).text()),t.currentFocus=u)}),t.options.defaultText&&t.divText.text(t.options.defaultText),t.selectBox.data("text")&&(t.divText.text(t.selectBox.data("text")),t.options.defaultText=t.selectBox.data("text")),u.append(o.join("")),t.list=u,t.divContainer.append(t.list),t.listItems=t.list.find("li"),t.list.find("li[data-disabled='true']").not(".optgroupHeader").addClass("ui-state-disabled"),t.currentFocus===0&&!t.options.showFirstOption&&t.listItems.eq(0).hasClass("ui-state-disabled")&&(t.currentFocus=+t.listItems.not(".ui-state-disabled").first().attr("id")),t.divImage.addClass(t.selectBox.data("icon")||t.options.defaultIcon||t.listItems.eq(t.currentFocus).find("i").attr("class")),t},_replaceSelectBox:function(){var t=this;t.selectBox.css("display","none").after(t.divContainer);var n=t.div.height();return t.downArrow=e("<i/>",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItArrow","class":"selectboxit-arrow",unselectable:"on"}),t.downArrowContainer=e("<span/>",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItArrowContainer","class":"selectboxit-arrow-container",unselectable:"on",style:"height:"+n+"px;"}).append(t.downArrow),t.div.append(t.downArrowContainer),t.divText.css({"line-height":t.div.css("height"),"max-width":t.div.width()-(t.downArrowContainer.width()+t.divImage.width())}),t.divImage.css({"margin-top":n/4}),t},_scrollToView:function(e){var t=this,n=t.list.scrollTop(),r=t.listItems.eq(t.currentFocus).height(),i=t.listItems.eq(t.currentFocus).position().top,s=t.list.height();return e==="search"?s-i<r?t.list.scrollTop(n+(i-(s-r))):i<-1&&t.list.scrollTop(i-r):e==="up"?i<-1&&t.list.scrollTop(n-Math.abs(t.listItems.eq(t.currentFocus).position().top)):e==="down"&&s-i<r&&t.list.scrollTop(n+(Math.abs(t.listItems.eq(t.currentFocus).position().top)-s+r)),t},_callbackSupport:function(t){var n=this;return e.isFunction(t)&&t.call(n,n.div),n},open:function(e){var t=this;if(!this.list.is(":visible")){t.selectBox.trigger("open"),t._dynamicPositioning&&t._dynamicPositioning();switch(t.options.showEffect){case"none":t.list.show(),t._scrollToView("search");break;case"show":t.list.show(t.options.showEffectSpeed,function(){t._scrollToView("search")});break;case"slideDown":t.list.slideDown(t.options.showEffectSpeed,function(){t._scrollToView("search")});break;case"fadeIn":t.list.fadeIn(t.options.showEffectSpeed),t._scrollToView("search");break;default:t.list.show(t.options.showEffect,t.options.showEffectOptions,t.options.showEffectSpeed,function(){t._scrollToView("search")})}}return t._callbackSupport(e),t},close:function(e){var t=this;if(t.list.is(":visible")){t.selectBox.trigger("close");switch(t.options.hideEffect){case"none":t.list.hide(),t._scrollToView("search");break;case"hide":t.list.hide(t.options.hideEffectSpeed);break;case"slideUp":t.list.slideUp(t.options.hideEffectSpeed);break;case"fadeOut":t.list.fadeOut(t.options.hideEffectSpeed);break;default:t.list.hide(t.options.hideEffect,t.options.hideEffectOptions,t.options.hideEffectSpeed,function(){t._scrollToView("search")})}}return t._callbackSupport(e),t},_eventHandlers:function(){var t=this,n=38,r=40,i=13,s=8,o=9,u=32,a=27;return this.div.bind({"click.selectBoxIt":function(){t.div.focus(),t.originalElem.disabled||(t.selectBox.trigger("click"),t.list.is(":visible")?t.close():t.open())},"mousedown.selectBoxIt":function(){e(this).data("mdown",!0)},"blur.selectBoxIt":function(){t.blur&&(t.selectBox.trigger("blur").trigger("focusout"),t.list.is(":visible")&&t.close())},"focus.selectBoxIt":function(){var n=e(this).data("mdown");e(this).removeData("mdown"),n||t.selectBox.trigger("tab-focus"),t.list.is(":visible")||t.selectBox.trigger("focus").trigger("focusin")},"keydown.selectBoxIt":function(e){var u=e.keyCode;switch(u){case r:e.preventDefault(),t.moveDown&&(t.options.keydownOpen?t.list.is(":visible")?t.moveDown():t.open():t.moveDown()),t.options.keydownOpen&&t.open();break;case n:e.preventDefault(),t.moveUp&&(t.options.keydownOpen?t.list.is(":visible")?t.moveUp():t.open():t.moveUp()),t.options.keydownOpen&&t.open();break;case i:e.preventDefault(),t.list.is(":visible")&&t.close(),(!t.options.showFirstOption&&t.div.text()===t.firstSelectItem.text()&&t.currentFocus===0||t.options.showFirstOption&&t.options.defaultText||!t.options.showFirstOption&&!t.listItems.eq(0).not("[data-disabled='true']"))&&t.selectBox.val(t.listItems.eq(t.currentFocus).attr("data-val")).trigger("change",!0),t.selectBox.trigger("enter");break;case o:t.selectBox.trigger("tab-blur");break;case s:e.preventDefault(),t.selectBox.trigger("backspace");break;case a:t.close();break;default:}},"keypress.selectBoxIt":function(e){var n=e.charCode||e.keyCode,r=String.fromCharCode(n);n===u&&e.preventDefault(),t.search&&t.search(r,!0,"")},"mouseenter.selectBoxIt":function(){t.selectBox.trigger("mouseenter")},"mouseleave.selectBoxIt":function(){t.selectBox.trigger("mouseleave")}}),t.list.bind({"mouseover.selectBoxIt":function(){t.blur=!1},"mouseout.selectBoxIt":function(){t.blur=!0},"focusin.selectBoxIt":function(){t.div.focus()}}).delegate("li","click.selectBoxIt",function(){e(this).data("disabled")||(t.originalElem.value=e(this).attr("data-val"),t.currentFocus=+this.id,t.close(),t.originalElem.value!==t.divText.attr("data-val")&&t.selectBox.trigger("change",!0),t.selectBox.trigger("option-click"))}).delegate("li","focus.selectBoxIt",function(){e(this).data("disabled")||(t.originalElem.value=e(this).attr("data-val"),t.originalElem.value!==t.divText.attr("data-val")&&t.selectBox.trigger("change",!0))}),t.selectBox.bind({"change.selectBoxIt":function(e,n){if(n)t.divText.text(t.listItems.eq(t.currentFocus).text()).attr("data-val",t.originalElem.value);else{var r=t.list.find('li[data-val="'+t.originalElem.value+'"]');r.length&&(t.listItems.eq(t.currentFocus).removeClass(t.focusClass),t.currentFocus=r.attr("id"),t.divText.text(t.listItems.eq(t.currentFocus).text()).attr("data-val",t.originalElem.value))}t.listItems.eq(t.currentFocus).find("i").attr("class")&&t.divImage.attr("class",t.listItems.eq(t.currentFocus).find("i").attr("class")).addClass("selectboxit-default-icon"),t.selectBox.trigger("changed")},"disable.selectBoxIt":function(){t.div.addClass("ui-state-disabled")},"enable.selectBoxIt":function(){t.div.removeClass("ui-state-disabled")}}),t},_addClasses:function(t,n,r,i,s){var o=this,u=t||"selectboxit-focus",a=n||"selectboxit-hover",f=i||"selectboxit-btn",l=s||"selectboxit-dropdown";return o.focusClass=u,o.downArrow.addClass(o.selectBox.data("downarrow")||o.options.downArrowIcon||r),o.div.addClass(i),o.list.addClass(s),o.listItems.bind({"focus.selectBoxIt":function(){e(this).addClass(u)},"blur.selectBoxIt":function(){e(this).removeClass(u)}}),o.selectBox.bind({"open.selectBoxIt":function(){o.div.removeClass(a).add(o.listItems.eq(o.currentFocus)).addClass(u)},"blur.selectBoxIt":function(){o.div.removeClass(u)},"mouseenter.selectBoxIt":function(){o.div.addClass(a)},"mouseleave.selectBoxIt":function(){o.div.removeClass(a)}}),o.listItems.bind({"mouseenter.selectBoxIt":function(){o.listItems.removeClass(u),e(this).addClass(a)},"mouseleave.selectBoxIt":function(){e(this).removeClass(a)}}),o.options.theme==="twitterbootstrap"&&r==="caret"?o.downArrow.css({"margin-top":o.downArrowContainer.height()/2}):o.downArrow.css({"margin-top":o.downArrowContainer.height()/4}),o},_jqueryui:function(){var e=this;return e._addClasses("ui-state-focus","ui-state-hover","ui-icon ui-icon-triangle-1-s","ui-widget ui-state-default","ui-widget ui-widget-content"),e},_twitterbootstrap:function(){var e=this;return e._addClasses("active","","caret","btn","dropdown-menu"),e},destroy:function(t){var n=this;return n._destroySelectBoxIt(),e.Widget.prototype.destroy.call(n),n._callbackSupport(t),n},_destroySelectBoxIt:function(){var e=this;return e.div.unbind(".selectBoxIt").undelegate(".selectBoxIt"),e.divContainer.remove(),e.selectBox.trigger("destroy").show(),e},refresh:function(e){var t=this;return t._destroySelectBoxIt()._create()._callbackSupport(e),t}})});$(function(){$.selectBox.selectBoxIt.prototype._ariaAccessibility=function(){var e=this;return e.div.attr({role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-owns":e.list.attr("id"),"aria-activedescendant":e.listItems.eq(e.currentFocus).attr("id"),"aria-label":$("label[for='"+e.originalElem.id+"']").text()||"","aria-live":"assertive"}).bind({"disable.selectBoxIt":function(){e.div.attr("aria-disabled","true")},"enable.selectBoxIt":function(){e.div.attr("aria-disabled","false")}}),e.list.attr({role:"listbox","aria-hidden":"true"}),e.listItems.attr({role:"option"}),e.selectBox.bind({"change.selectBoxIt":function(){e.divText.attr("aria-label",e.originalElem.value)},"open.selectBoxIt":function(){e.list.attr("aria-hidden","false"),e.div.attr("aria-expanded","true")},"close.selectBoxIt":function(){e.list.attr("aria-hidden","true"),e.div.attr("aria-expanded","false")}}),e}});$(function(){$.selectBox.selectBoxIt.prototype.disable=function(e){var t=this;if(!t.options.disabled)return t.close(),t.selectBox.trigger("disable").attr("disabled","disabled"),t.div.removeAttr("tabindex").css("cursor","default"),$.Widget.prototype.disable.call(t),t._callbackSupport(e),t},$.selectBox.selectBoxIt.prototype._isDisabled=function(e){var t=this;return t.originalElem.disabled&&t.disable(),t}});$(function(){$.selectBox.selectBoxIt.prototype._dynamicPositioning=function(){var e=this,t=e.div.offset().top,n=e.list.height(),r=e.div.height();return t+r+n>=$(window).height()+$(window).scrollTop()&&t-n>=0?e.flipped||(e.list.css("top",e.divContainer.position().top-e.list.height()-2),e.flipped=!0):e.flipped&&(e.list.css("top",e.divContainer.position().top+e.div.height()+2),e.flipped=!1),e}});$(function(){$.selectBox.selectBoxIt.prototype.enable=function(e){var t=this;return t.options.disabled&&(t.selectBox.trigger("enable").removeAttr("disabled"),t.div.attr("tabindex",0).css("cursor","pointer"),$.Widget.prototype.enable.call(t),t._callbackSupport(e)),t}});$(function(){$.selectBox.selectBoxIt.prototype.moveDown=function(e){var t=this;t.currentFocus+=1;var n=t.listItems.eq(t.currentFocus).data("disabled"),r=t.listItems.eq(t.currentFocus).nextAll("li").not("[data-disabled='true']").first().length;if(t.currentFocus===t.listItems.length)t.currentFocus-=1;else{if(n&&r){t.listItems.eq(t.currentFocus-1).blur(),t.moveDown();return}n&&!r?t.currentFocus-=1:(t.listItems.eq(t.currentFocus-1).blur().end().eq(t.currentFocus).focus(),t._scrollToView("down"),t.selectBox.trigger("moveDown"))}return t._callbackSupport(e),t},$.selectBox.selectBoxIt.prototype.moveUp=function(e){var t=this;t.currentFocus-=1;var n=t.listItems.eq(t.currentFocus).data("disabled"),r=t.listItems.eq(t.currentFocus).prevAll("li").not("[data-disabled='true']").first().length;if(t.currentFocus===-1)t.currentFocus+=1;else{if(n&&r){t.listItems.eq(t.currentFocus+1).blur(),t.moveUp();return}n&&!r?t.currentFocus+=1:(t.listItems.eq(this.currentFocus+1).blur().end().eq(t.currentFocus).focus(),t._scrollToView("up"),t.selectBox.trigger("moveUp"))}return t._callbackSupport(e),t}});$(function(){$.selectBox.selectBoxIt.prototype._setCurrentSearchOption=function(e){var t=this;return(e!==0||!!t.options.showFirstOption)&&t.listItems.eq(e).data("disabled")!==!0&&(t.divText.text(t.textArray[e]),t.listItems.eq(t.currentFocus).blur(),t.currentIndex=e,t.currentFocus=e,t.listItems.eq(t.currentFocus).focus(),t._scrollToView("search"),t.selectBox.trigger("search")),t},$.selectBox.selectBoxIt.prototype._searchAlgorithm=function(e,t){var n=this,r=!1,i,s,o;for(i=e,o=n.textArray.length;i<o;i+=1){for(s=0;s<o;s+=1)n.textArray[s].search(t)!==-1&&(r=!0,s=o);r||(n.currentText=n.currentText.charAt(n.currentText.length-1).replace(/[|()\[{.+*?$\\]/g,"\\$0"),t=new RegExp(n.currentText,"gi"));if(n.currentText.length<3){t=new RegExp(n.currentText.charAt(0),"gi");if(n.textArray[i].charAt(0).search(t)!==-1)return n._setCurrentSearchOption(i),n.currentIndex+=1,!1}else if(n.textArray[i].search(t)!==-1)return n._setCurrentSearchOption(i),!1;if(n.textArray[i].toLowerCase()===n.currentText.toLowerCase())return n._setCurrentSearchOption(i),n.currentText="",!1}return!0},$.selectBox.selectBoxIt.prototype.search=function(e,t,n){var r=this;t?r.currentText+=e.replace(/[|()\[{.+*?$\\]/g,"\\$0"):r.currentText=e.replace(/[|()\[{.+*?$\\]/g,"\\$0");var i=new RegExp(r.currentText,"gi"),s=r._searchAlgorithm(r.currentIndex,i);return s&&r._searchAlgorithm(0,i),r._callbackSupport(n),r}});$(function(){$.selectBox.selectBoxIt.prototype.setOption=function(e,t,n){var r=this;return e==="showFirstOption"&&!t?r.listItems.eq(0).hide():e==="showFirstOption"&&t?r.listItems.eq(0).show():e==="defaultIcon"&&t?r.divImage.attr("class",t):e==="downArrowIcon"&&t?r.downArrow.attr("class",t):e==="defaultText"&&r.divText.text(t),$.Widget.prototype._setOption.apply(r,arguments),r._callbackSupport(n),r}});$(function(){$.selectBox.selectBoxIt.prototype.setOptions=function(e,t){var n=this;return $.Widget.prototype._setOptions.apply(n,arguments),n.options.showFirstOption?n.listItems.eq(0).show():n.listItems.eq(0).hide(),n.options.defaultIcon&&n.divImage.attr("class",n.options.defaultIcon),n.options.downArrowIcon&&n.downArrow.attr("class",n.options.downArrowIcon),n.options.defaultText&&n.divText.text(n.options.defaultText),n._callbackSupport(t),n}});$(function(){$.selectBox.selectBoxIt.prototype.wait=function(e,t){var n=this,r=this.returnTimeout(e);return r.then(function(){n._callbackSupport(t)}),n},$.selectBox.selectBoxIt.prototype.returnTimeout=function(e){return $.Deferred(function(t){setTimeout(t.resolve,e)})}});$(function(){$.selectBox.selectBoxIt.prototype._mobile=function(e){var t=this,n;return t.options.isMobile()&&t.selectBox.css({display:"block",width:t.div.width(),opacity:"0",position:"absolute"}).bind({changed:function(){n=t.selectBox.find("option").filter(":selected"),t.divText.text(n.text()),t.list.find('li[data-val="'+n.val()+'"]').find("i").attr("class")&&t.divImage.attr("class",t.list.find('li[data-val="'+n.val()+'"]').find("i").attr("class")).addClass("selectboxit-default-icon")}}),t}});
|
1
|
+
(function(e){"use strict";e(window.jQuery,window,document)})(function(e,t,n,r){"use strict";e.widget("selectBox.selectBoxIt",{VERSION:"2.0.0",options:{showEffect:"none",showEffectOptions:{},showEffectSpeed:"medium",hideEffect:"none",hideEffectOptions:{},hideEffectSpeed:"medium",showFirstOption:!0,defaultText:"",defaultIcon:"",downArrowIcon:"",theme:"twitterbootstrap",keydownOpen:!0,isMobile:function(){var e=navigator.userAgent||navigator.vendor||t.opera;return/iPhone|iPod|iPad|Android|BlackBerry|Opera Mini|IEMobile/.test(e)},nostyle:!1},_create:function(){var t=this;return t.originalElem=t.element[0],t.selectBox=t.element,t.selectItems=t.element.find("option"),t.firstSelectItem=t.element.find("option").slice(0,1),t.currentFocus=0,t.blur=!0,t.documentHeight=e(n).height(),t.textArray=[],t.currentIndex=0,t.flipped=!1,t._createDiv()._createUnorderedList()._replaceSelectBox()._eventHandlers(),t.originalElem.disabled&&t.disable&&t.disable(),t._ariaAccessibility&&t._ariaAccessibility(),t._mobile&&t._mobile(),t.options.theme==="twitterbootstrap"?t._twitterbootstrap():this.options.theme==="jqueryui"?t._jqueryui():t._addClasses(),t.selectBox.trigger("create"),t},_createDiv:function(){var t=this;return t.divText=e("<span/>",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItText","class":"selectboxit-text",unselectable:"on",text:t.firstSelectItem.text()}).attr("data-val",t.originalElem.value),t.divImage=e("<i/>",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItDefaultIcon","class":"selectboxit-default-icon",unselectable:"on"}),t.div=e("<span/>",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxIt","class":"selectboxit "+(t.selectBox.attr("class")||""),style:t.selectBox.attr("style"),name:t.originalElem.name,tabindex:t.selectBox.attr("tabindex")||"0",unselectable:"on"}).append(t.divImage).append(t.divText),t.divContainer=e("<span/>",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItContainer","class":"selectboxit-container"}).append(t.div),t},_createUnorderedList:function(){var t=this,n,r="",i="",s,o="",u=e("<ul/>",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItOptions","class":"selectboxit-options",tabindex:-1});return t.options.showFirstOption||(t.selectItems=t.selectBox.find("option").slice(1)),t.selectItems.each(function(u){n=e(this).prop("disabled"),s=e(this).data("icon")||"",e(this).parent().is("optgroup")?(r="selectboxit-optgroup-option",e(this).index()===0?i='<div class="selectboxit-optgroup-header" data-disabled="true">'+e(this).parent().first().attr("label")+"</div>":i=""):r="",o+=i+'<li id="'+u+'" data-val="'+t.htmlEscape(this.value)+'" data-disabled="'+n+'" class="'+r+" selectboxit-option"+(e(this).attr("class")||"")+'" style="'+(e(this).attr("style")||"")+'"><a class="selectboxit-option-anchor"><i class="selectboxit-option-icon '+s+'"></i>'+t.htmlEscape(e(this).text())+"</a></li>",t.textArray[u]=e(this).text(),this.selected&&(t.divText.text(e(this).text()),t.currentFocus=u)}),t.options.defaultText&&t.divText.text(t.options.defaultText),t.selectBox.data("text")&&(t.divText.text(t.selectBox.data("text")),t.options.defaultText=t.selectBox.data("text")),u.append(o),t.list=u,t.divContainer.append(t.list),t.listItems=t.list.find("li"),t.list.find("li[data-disabled='true']").not(".optgroupHeader").addClass("ui-state-disabled"),t.currentFocus===0&&!t.options.showFirstOption&&t.listItems.eq(0).hasClass("ui-state-disabled")&&(t.currentFocus=+t.listItems.not(".ui-state-disabled").first().attr("id")),t.divImage.addClass(t.selectBox.data("icon")||t.options.defaultIcon||t.listItems.eq(t.currentFocus).find("i").attr("class")),t},_replaceSelectBox:function(){var t=this;t.selectBox.css("display","none").after(t.divContainer);var n=t.div.height();return t.downArrow=e("<i/>",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItArrow","class":"selectboxit-arrow",unselectable:"on"}),t.downArrowContainer=e("<span/>",{id:(t.originalElem.id||"")&&t.originalElem.id+"SelectBoxItArrowContainer","class":"selectboxit-arrow-container",unselectable:"on"}).append(t.downArrow),t.div.append(this.options.nostyle?t.downArrow:t.downArrowContainer),t.options.nostyle||(t.downArrowContainer.css({height:n+"px"}),t.divText.css({"line-height":t.div.css("height"),"max-width":t.div.outerWidth()-(t.downArrowContainer.outerWidth()+t.divImage.outerWidth())}),t.divImage.css({"margin-top":n/4})),t},_scrollToView:function(e){var t=this,n=t.list.scrollTop(),r=t.listItems.eq(t.currentFocus).height(),i=t.listItems.eq(t.currentFocus).position().top,s=t.list.height();return e==="search"?s-i<r?t.list.scrollTop(n+(i-(s-r))):i<-1&&t.list.scrollTop(i-r):e==="up"?i<-1&&t.list.scrollTop(n-Math.abs(t.listItems.eq(t.currentFocus).position().top)):e==="down"&&s-i<r&&t.list.scrollTop(n+(Math.abs(t.listItems.eq(t.currentFocus).position().top)-s+r)),t},_callbackSupport:function(t){var n=this;return e.isFunction(t)&&t.call(n,n.div),n},open:function(e){var t=this;t._dynamicPositioning&&t._dynamicPositioning();if(!this.list.is(":visible")){t.selectBox.trigger("open");switch(t.options.showEffect){case"none":t.list.show(),t._scrollToView("search");break;case"show":t.list.show(t.options.showEffectSpeed,function(){t._scrollToView("search")});break;case"slideDown":t.list.slideDown(t.options.showEffectSpeed,function(){t._scrollToView("search")});break;case"fadeIn":t.list.fadeIn(t.options.showEffectSpeed),t._scrollToView("search");break;default:t.list.show(t.options.showEffect,t.options.showEffectOptions,t.options.showEffectSpeed,function(){t._scrollToView("search")})}}return t._callbackSupport(e),t},close:function(e){var t=this;if(t.list.is(":visible")){t.selectBox.trigger("close");switch(t.options.hideEffect){case"none":t.list.hide(),t._scrollToView("search");break;case"hide":t.list.hide(t.options.hideEffectSpeed);break;case"slideUp":t.list.slideUp(t.options.hideEffectSpeed);break;case"fadeOut":t.list.fadeOut(t.options.hideEffectSpeed);break;default:t.list.hide(t.options.hideEffect,t.options.hideEffectOptions,t.options.hideEffectSpeed,function(){t._scrollToView("search")})}}return t._callbackSupport(e),t},_eventHandlers:function(){var t=this,n=38,r=40,i=13,s=8,o=9,u=32,a=27;return this.div.bind({"click.selectBoxIt":function(){t.div.focus(),t.originalElem.disabled||(t.selectBox.trigger("click"),t.list.is(":visible")?t.close():t.open())},"mousedown.selectBoxIt":function(){e(this).data("mdown",!0)},"blur.selectBoxIt":function(){t.blur&&(t.selectBox.trigger("blur").trigger("focusout"),t.list.is(":visible")&&t.close())},"focus.selectBoxIt":function(){var n=e(this).data("mdown");e(this).removeData("mdown"),n||t.selectBox.trigger("tab-focus"),t.list.is(":visible")||t.selectBox.trigger("focus").trigger("focusin")},"keydown.selectBoxIt":function(e){var u=e.keyCode;switch(u){case r:e.preventDefault(),t.moveDown&&(t.options.keydownOpen?t.list.is(":visible")?t.moveDown():t.open():t.moveDown()),t.options.keydownOpen&&t.open();break;case n:e.preventDefault(),t.moveUp&&(t.options.keydownOpen?t.list.is(":visible")?t.moveUp():t.open():t.moveUp()),t.options.keydownOpen&&t.open();break;case i:e.preventDefault(),t.list.is(":visible")&&t.close(),(!t.options.showFirstOption&&t.div.text()===t.firstSelectItem.text()&&t.currentFocus===0||t.options.showFirstOption&&t.options.defaultText||!t.options.showFirstOption&&!t.listItems.eq(0).not("[data-disabled='true']"))&&t.selectBox.val(t.listItems.eq(t.currentFocus).attr("data-val")).trigger("change",!0),t.selectBox.trigger("enter");break;case o:t.selectBox.trigger("tab-blur");break;case s:e.preventDefault(),t.selectBox.trigger("backspace");break;case a:t.close();break;default:}},"keypress.selectBoxIt":function(e){var n=e.charCode||e.keyCode,r=String.fromCharCode(n);n===u&&e.preventDefault(),t.search&&t.search(r,!0,"")},"mouseenter.selectBoxIt":function(){t.selectBox.trigger("mouseenter")},"mouseleave.selectBoxIt":function(){t.selectBox.trigger("mouseleave")}}),t.list.bind({"mouseover.selectBoxIt":function(){t.blur=!1},"mouseout.selectBoxIt":function(){t.blur=!0},"focusin.selectBoxIt":function(){t.div.focus()}}).delegate("li","click.selectBoxIt",function(){e(this).data("disabled")||(t.originalElem.value=e(this).attr("data-val"),t.currentFocus=+this.id,t.close(),t.originalElem.value!==t.divText.attr("data-val")&&t.selectBox.trigger("change",!0),t.selectBox.trigger("option-click"))}).delegate("li","focus.selectBoxIt",function(){e(this).data("disabled")||(t.originalElem.value=e(this).attr("data-val"),t.originalElem.value!==t.divText.attr("data-val")&&t.selectBox.trigger("change",!0))}),t.selectBox.bind({"change.selectBoxIt":function(e,n){if(!n){var r=t.list.find('li[data-val="'+t.originalElem.value+'"]');r.length&&(t.listItems.eq(t.currentFocus).removeClass(t.focusClass),t.currentFocus=+r.attr("id"))}t.divText.text(t.listItems.eq(t.currentFocus).find("a").text()).attr("data-val",t.originalElem.value),t.listItems.eq(t.currentFocus).find("i").attr("class")&&t.divImage.attr("class",t.listItems.eq(t.currentFocus).find("i").attr("class")).addClass("selectboxit-default-icon"),t.selectBox.trigger("changed")},"disable.selectBoxIt":function(){t.div.addClass("ui-state-disabled")},"enable.selectBoxIt":function(){t.div.removeClass("ui-state-disabled")}}),t},_addClasses:function(t,n,r,i,s){var o=this,u=t||"selectboxit-focus",a=n||"selectboxit-hover",f=i||"selectboxit-btn",l=s||"selectboxit-dropdown";return o.focusClass=u,o.downArrow.addClass(o.selectBox.data("downarrow")||o.options.downArrowIcon||r),o.div.addClass(i),o.list.addClass(s),o.listItems.bind({"focus.selectBoxIt":function(){e(this).addClass(u)},"blur.selectBoxIt":function(){e(this).removeClass(u)}}),o.selectBox.bind({"open.selectBoxIt":function(){o.div.removeClass(a).add(o.listItems.eq(o.currentFocus)).addClass(u)},"blur.selectBoxIt":function(){o.div.removeClass(u)},"mouseenter.selectBoxIt":function(){o.div.addClass(a)},"mouseleave.selectBoxIt":function(){o.div.removeClass(a)}}),o.listItems.bind({"mouseenter.selectBoxIt":function(){o.listItems.removeClass(u),e(this).addClass(a)},"mouseleave.selectBoxIt":function(){e(this).removeClass(a)}}),o.options.nostyle||(o.options.theme==="twitterbootstrap"&&!o.option("downArrowIcon").length?o.downArrow.css({"margin-top":o.downArrowContainer.height()/2}):o.downArrow.css({"margin-top":o.downArrowContainer.height()/3})),e(".selectboxit-option-icon").not(".selectboxit-default-icon").css("margin-top",o.downArrowContainer.height()/4),o},_jqueryui:function(){var e=this;return e._addClasses("ui-state-focus","ui-state-hover","ui-icon ui-icon-triangle-1-s","ui-widget ui-state-default","ui-widget ui-widget-content"),e},_twitterbootstrap:function(){var e=this;return e._addClasses("active","","caret","btn","dropdown-menu"),e},destroy:function(t){var n=this;return n._destroySelectBoxIt(),e.Widget.prototype.destroy.call(n),n._callbackSupport(t),n},_destroySelectBoxIt:function(){var e=this;return e.div.unbind(".selectBoxIt").undelegate(".selectBoxIt"),e.divContainer.remove(),e.selectBox.trigger("destroy").show(),e},refresh:function(e){var t=this;return t._destroySelectBoxIt()._create()._callbackSupport(e),t.selectBox.trigger("refresh"),t},_applyNativeSelect:function(){var e=this,t;e.selectBox.css({display:"block",width:e.div.outerWidth(),height:e.div.outerHeight(),opacity:"0",position:"absolute",top:e.div.offset().top,bottom:e.div.offset().bottom,left:e.div.offset().left,right:e.div.offset().right}).bind({changed:function(){t=e.selectBox.find("option").filter(":selected"),e.divText.text(t.text()),e.list.find('li[data-val="'+t.val()+'"]').find("i").attr("class")&&e.divImage.attr("class",e.list.find('li[data-val="'+t.val()+'"]').find("i").attr("class")).addClass("selectboxit-default-icon")}})},htmlEscape:function(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}})});
|
2
|
+
$(function(){$.selectBox.selectBoxIt.prototype._ariaAccessibility=function(){var e=this;return e.div.attr({role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-owns":e.list.attr("id"),"aria-activedescendant":e.listItems.eq(e.currentFocus).attr("id"),"aria-label":$("label[for='"+e.originalElem.id+"']").text()||"","aria-live":"assertive"}).bind({"disable.selectBoxIt":function(){e.div.attr("aria-disabled","true")},"enable.selectBoxIt":function(){e.div.attr("aria-disabled","false")}}),e.list.attr({role:"listbox","aria-hidden":"true"}),e.listItems.attr({role:"option"}),e.selectBox.bind({"change.selectBoxIt":function(){e.divText.attr("aria-label",e.originalElem.value)},"open.selectBoxIt":function(){e.list.attr("aria-hidden","false"),e.div.attr("aria-expanded","true")},"close.selectBoxIt":function(){e.list.attr("aria-hidden","true"),e.div.attr("aria-expanded","false")}}),e}});
|
3
|
+
$(function(){$.selectBox.selectBoxIt.prototype.disable=function(e){var t=this;if(!t.options.disabled)return t.close(),t.selectBox.trigger("disable").attr("disabled","disabled"),t.div.removeAttr("tabindex").addClass("selectboxit-disabled"),$.Widget.prototype.disable.call(t),t._callbackSupport(e),t},$.selectBox.selectBoxIt.prototype._isDisabled=function(e){var t=this;return t.originalElem.disabled&&t.disable(),t}});
|
4
|
+
$(function(){$.selectBox.selectBoxIt.prototype._dynamicPositioning=function(){var e=this,t=e.div.offset().top,n=e.list.data("max-height")||e.list.outerHeight(),r=e.div.outerHeight(),i=$(window).height(),s=$(window).scrollTop(),o=t+r+n<=i+s,u=!o;e.list.data("max-height")||e.list.data("max-height",e.list.outerHeight()),e.selectBox.css("display","none");if(!u)e.list.css("max-height",e.list.data("max-height")),e.list.css("top","auto");else if(e.div.offset().top-s>=n)e.list.css("max-height",e.list.data("max-height")),e.list.css("top",e.div.position().top-e.list.outerHeight());else{var a=Math.abs(t+r+n-(i+s)),f=Math.abs(e.div.offset().top-s-n);a<f?(e.list.css("max-height",e.list.data("max-height")-a-r/2),e.list.css("top","auto")):(e.list.css("max-height",e.list.data("max-height")-f-r/2),e.list.css("top",e.div.position().top-e.list.outerHeight()))}return e}});
|
5
|
+
$(function(){$.selectBox.selectBoxIt.prototype.enable=function(e){var t=this;return t.options.disabled&&(t.selectBox.trigger("enable").removeAttr("disabled"),t.div.attr("tabindex",0).removeClass("selectboxit-disabled"),$.Widget.prototype.enable.call(t),t._callbackSupport(e)),t}});
|
6
|
+
$(function(){$.selectBox.selectBoxIt.prototype.moveDown=function(e){var t=this;t.currentFocus+=1;var n=t.listItems.eq(t.currentFocus).data("disabled"),r=t.listItems.eq(t.currentFocus).nextAll("li").not("[data-disabled='true']").first().length;if(t.currentFocus===t.listItems.length)t.currentFocus-=1;else{if(n&&r){t.listItems.eq(t.currentFocus-1).blur(),t.moveDown();return}n&&!r?t.currentFocus-=1:(t.listItems.eq(t.currentFocus-1).blur().end().eq(t.currentFocus).focus(),t._scrollToView("down"),t.selectBox.trigger("moveDown"))}return t._callbackSupport(e),t},$.selectBox.selectBoxIt.prototype.moveUp=function(e){var t=this;t.currentFocus-=1;var n=t.listItems.eq(t.currentFocus).data("disabled"),r=t.listItems.eq(t.currentFocus).prevAll("li").not("[data-disabled='true']").first().length;if(t.currentFocus===-1)t.currentFocus+=1;else{if(n&&r){t.listItems.eq(t.currentFocus+1).blur(),t.moveUp();return}n&&!r?t.currentFocus+=1:(t.listItems.eq(this.currentFocus+1).blur().end().eq(t.currentFocus).focus(),t._scrollToView("up"),t.selectBox.trigger("moveUp"))}return t._callbackSupport(e),t}});
|
7
|
+
$(function(){$.selectBox.selectBoxIt.prototype._setCurrentSearchOption=function(e){var t=this;return(e!==0||!!t.options.showFirstOption)&&t.listItems.eq(e).data("disabled")!==!0&&(t.divText.text(t.textArray[e]),t.listItems.eq(t.currentFocus).blur(),t.currentIndex=e,t.currentFocus=e,t.listItems.eq(t.currentFocus).focus(),t._scrollToView("search"),t.selectBox.trigger("search")),t},$.selectBox.selectBoxIt.prototype._searchAlgorithm=function(e,t){var n=this,r=!1,i,s,o;for(i=e,o=n.textArray.length;i<o;i+=1){for(s=0;s<o;s+=1)n.textArray[s].search(t)!==-1&&(r=!0,s=o);r||(n.currentText=n.currentText.charAt(n.currentText.length-1).replace(/[|()\[{.+*?$\\]/g,"\\$0"),t=new RegExp(n.currentText,"gi"));if(n.currentText.length<3){t=new RegExp(n.currentText.charAt(0),"gi");if(n.textArray[i].charAt(0).search(t)!==-1)return n._setCurrentSearchOption(i),n.currentIndex+=1,!1}else if(n.textArray[i].search(t)!==-1)return n._setCurrentSearchOption(i),!1;if(n.textArray[i].toLowerCase()===n.currentText.toLowerCase())return n._setCurrentSearchOption(i),n.currentText="",!1}return!0},$.selectBox.selectBoxIt.prototype.search=function(e,t,n){var r=this;t?r.currentText+=e.replace(/[|()\[{.+*?$\\]/g,"\\$0"):r.currentText=e.replace(/[|()\[{.+*?$\\]/g,"\\$0");var i=new RegExp(r.currentText,"gi"),s=r._searchAlgorithm(r.currentIndex,i);return s&&r._searchAlgorithm(0,i),r._callbackSupport(n),r}});
|
8
|
+
$(function(){$.selectBox.selectBoxIt.prototype._mobile=function(e){return this.options.isMobile()&&this._applyNativeSelect(),this}});
|
9
|
+
$(function(){$.selectBox.selectBoxIt.prototype.setOption=function(e,t,n){var r=this;return e==="showFirstOption"&&!t?r.listItems.eq(0).hide():e==="showFirstOption"&&t?r.listItems.eq(0).show():e==="defaultIcon"&&t?r.divImage.attr("class",t+" selectboxit-arrow"):e==="downArrowIcon"&&t?r.downArrow.attr("class",t+" selectboxit-arrow"):e==="defaultText"&&r.divText.text(t),$.Widget.prototype._setOption.apply(r,arguments),r._callbackSupport(n),r}});
|
10
|
+
$(function(){$.selectBox.selectBoxIt.prototype.setOptions=function(e,t){var n=this;return $.Widget.prototype._setOptions.apply(n,arguments),n.options.showFirstOption?n.listItems.eq(0).show():n.listItems.eq(0).hide(),n.options.defaultIcon&&n.divImage.attr("class",n.options.defaultIcon+" selectboxit-arrow"),n.options.downArrowIcon&&n.downArrow.attr("class",n.options.downArrowIcon+" selectboxit-arrow"),n.options.defaultText&&n.divText.text(n.options.defaultText),n._callbackSupport(t),n}});
|
11
|
+
$(function(){$.selectBox.selectBoxIt.prototype.wait=function(e,t){var n=this,r=this.returnTimeout(e);return r.then(function(){n._callbackSupport(t)}),n},$.selectBox.selectBoxIt.prototype.returnTimeout=function(e){return $.Deferred(function(t){setTimeout(t.resolve,e)})}});
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.rc2
|
5
5
|
prerelease: 4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2012-11-
|
15
|
+
date: 2012-11-23 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rails
|