fe 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +20 -0
- data/Rakefile +48 -0
- data/app/assets/images/fe/ajax-loader.gif +0 -0
- data/app/assets/images/fe/butgrad.png +0 -0
- data/app/assets/images/fe/icons/add.png +0 -0
- data/app/assets/images/fe/icons/application_form.png +0 -0
- data/app/assets/images/fe/icons/application_form_add.png +0 -0
- data/app/assets/images/fe/icons/arrow-move.png +0 -0
- data/app/assets/images/fe/icons/arrow_out.png +0 -0
- data/app/assets/images/fe/icons/asterisk_yellow.png +0 -0
- data/app/assets/images/fe/icons/book-open-list.png +0 -0
- data/app/assets/images/fe/icons/book_open.png +0 -0
- data/app/assets/images/fe/icons/briefcase.png +0 -0
- data/app/assets/images/fe/icons/calendar_view_day.png +0 -0
- data/app/assets/images/fe/icons/checkbox.png +0 -0
- data/app/assets/images/fe/icons/copy_paste.gif +0 -0
- data/app/assets/images/fe/icons/disk.png +0 -0
- data/app/assets/images/fe/icons/document--pencil.png +0 -0
- data/app/assets/images/fe/icons/document-copy.png +0 -0
- data/app/assets/images/fe/icons/map_magnify.png +0 -0
- data/app/assets/images/fe/icons/minus-button.png +0 -0
- data/app/assets/images/fe/icons/move.png +0 -0
- data/app/assets/images/fe/icons/page_error.png +0 -0
- data/app/assets/images/fe/icons/page_valid.png +0 -0
- data/app/assets/images/fe/icons/page_white.png +0 -0
- data/app/assets/images/fe/icons/page_white_add.png +0 -0
- data/app/assets/images/fe/icons/page_white_error.png +0 -0
- data/app/assets/images/fe/icons/paper-clip.png +0 -0
- data/app/assets/images/fe/icons/pencil-small.png +0 -0
- data/app/assets/images/fe/icons/pencil.png +0 -0
- data/app/assets/images/fe/icons/question-balloon.png +0 -0
- data/app/assets/images/fe/icons/radio.png +0 -0
- data/app/assets/images/fe/icons/star-small.png +0 -0
- data/app/assets/images/fe/icons/table.png +0 -0
- data/app/assets/images/fe/icons/text_align_left.png +0 -0
- data/app/assets/images/fe/icons/text_horizontalrule.png +0 -0
- data/app/assets/images/fe/icons/textfield.png +0 -0
- data/app/assets/images/fe/indent.png +0 -0
- data/app/assets/images/fe/overlay.png +0 -0
- data/app/assets/images/fe/selected_bg.jpg +0 -0
- data/app/assets/images/fe/status.gif +0 -0
- data/app/assets/images/fe/tooltip/black.png +0 -0
- data/app/assets/images/fe/tooltip/black_arrow.png +0 -0
- data/app/assets/images/fe/tooltip/black_arrow_big.png +0 -0
- data/app/assets/images/fe/tooltip/black_big.png +0 -0
- data/app/assets/images/fe/tooltip/white.png +0 -0
- data/app/assets/images/fe/tooltip/white_arrow.png +0 -0
- data/app/assets/images/fe/tooltip/white_arrow_big.png +0 -0
- data/app/assets/images/fe/tooltip/white_big.png +0 -0
- data/app/assets/images/fe/uploadify/cancel.png +0 -0
- data/app/assets/images/fe/uploadify/uploadify.swf +0 -0
- data/app/assets/javascripts/fe/admin.js +7 -0
- data/app/assets/javascripts/fe/jquery.metadata.js +122 -0
- data/app/assets/javascripts/fe/jquery.scrollTo-min.js +7 -0
- data/app/assets/javascripts/fe/jquery.uploadify.v2.1.0.js +258 -0
- data/app/assets/javascripts/fe/jquery.validate.pack.js +15 -0
- data/app/assets/javascripts/fe/qe.admin.js +115 -0
- data/app/assets/javascripts/fe/qe.common.js +57 -0
- data/app/assets/javascripts/fe/qe.public.js +331 -0
- data/app/assets/javascripts/fe/swfobject.js +4 -0
- data/app/assets/stylesheets/fe/qe.screen.css.scss.erb +552 -0
- data/app/assets/stylesheets/fe/reset.css +55 -0
- data/app/assets/stylesheets/fe/validation.css +91 -0
- data/app/controllers/fe/admin/elements_controller.rb +185 -0
- data/app/controllers/fe/admin/email_templates_controller.rb +61 -0
- data/app/controllers/fe/admin/question_pages_controller.rb +113 -0
- data/app/controllers/fe/admin/question_sheets_controller.rb +106 -0
- data/app/controllers/fe/answer_pages_controller.rb +3 -0
- data/app/controllers/fe/answer_sheets_controller.rb +3 -0
- data/app/controllers/fe/concerns/answer_pages_controller_concern.rb +80 -0
- data/app/controllers/fe/concerns/answer_sheets_controller_concern.rb +84 -0
- data/app/controllers/fe/reference_sheets_controller.rb +29 -0
- data/app/helpers/fe/answer_pages_helper.rb +19 -0
- data/app/helpers/fe/application_helper.rb +49 -0
- data/app/mailers/fe/notifier.rb +22 -0
- data/app/models/fe/answer.rb +13 -0
- data/app/models/fe/answer_pages_presenter.rb +13 -0
- data/app/models/fe/answer_sheet.rb +10 -0
- data/app/models/fe/answer_sheet_question_sheet.rb +7 -0
- data/app/models/fe/attachment_field.rb +7 -0
- data/app/models/fe/choice_field.rb +7 -0
- data/app/models/fe/concerns/answer_concern.rb +36 -0
- data/app/models/fe/concerns/answer_pages_presenter_concern.rb +99 -0
- data/app/models/fe/concerns/answer_sheet_concern.rb +61 -0
- data/app/models/fe/concerns/choice_field_concern.rb +131 -0
- data/app/models/fe/condition.rb +53 -0
- data/app/models/fe/date_field.rb +52 -0
- data/app/models/fe/element.rb +164 -0
- data/app/models/fe/email_template.rb +7 -0
- data/app/models/fe/option.rb +10 -0
- data/app/models/fe/option_group.rb +10 -0
- data/app/models/fe/page.rb +101 -0
- data/app/models/fe/page_element.rb +9 -0
- data/app/models/fe/page_link.rb +15 -0
- data/app/models/fe/paragraph.rb +10 -0
- data/app/models/fe/payment.rb +52 -0
- data/app/models/fe/payment_question.rb +22 -0
- data/app/models/fe/presenter.rb +23 -0
- data/app/models/fe/question.rb +256 -0
- data/app/models/fe/question_grid.rb +26 -0
- data/app/models/fe/question_grid_with_total.rb +11 -0
- data/app/models/fe/question_set.rb +82 -0
- data/app/models/fe/question_sheet.rb +73 -0
- data/app/models/fe/reference_question.rb +42 -0
- data/app/models/fe/reference_sheet.rb +149 -0
- data/app/models/fe/section.rb +12 -0
- data/app/models/fe/state_chooser.rb +10 -0
- data/app/models/fe/text_field.rb +29 -0
- data/app/views/fe/admin/elements/_errors.html.erb +1 -0
- data/app/views/fe/admin/elements/create.js.erb +11 -0
- data/app/views/fe/admin/elements/destroy.js.erb +4 -0
- data/app/views/fe/admin/elements/drop.js.erb +2 -0
- data/app/views/fe/admin/elements/duplicate.js.erb +2 -0
- data/app/views/fe/admin/elements/edit.js.erb +4 -0
- data/app/views/fe/admin/elements/error.js.erb +4 -0
- data/app/views/fe/admin/elements/new.js.erb +10 -0
- data/app/views/fe/admin/elements/reorder.js.erb +0 -0
- data/app/views/fe/admin/elements/update.js.erb +9 -0
- data/app/views/fe/admin/email_templates/_form.html.erb +8 -0
- data/app/views/fe/admin/email_templates/edit.html.erb +13 -0
- data/app/views/fe/admin/email_templates/index.html.erb +20 -0
- data/app/views/fe/admin/email_templates/new.html.erb +11 -0
- data/app/views/fe/admin/panels/_advanced_options.html.erb +16 -0
- data/app/views/fe/admin/panels/_common_fields.html.erb +24 -0
- data/app/views/fe/admin/panels/_condition.html.erb +6 -0
- data/app/views/fe/admin/panels/_insert.html.erb +39 -0
- data/app/views/fe/admin/panels/_nav_controls.html.erb +6 -0
- data/app/views/fe/admin/panels/_page.html.erb +3 -0
- data/app/views/fe/admin/panels/_pages_list.html.erb +16 -0
- data/app/views/fe/admin/panels/_prop_attachment_field.html.erb +2 -0
- data/app/views/fe/admin/panels/_prop_choice_field.html.erb +46 -0
- data/app/views/fe/admin/panels/_prop_date_field.html.erb +7 -0
- data/app/views/fe/admin/panels/_prop_element.html.erb +30 -0
- data/app/views/fe/admin/panels/_prop_page.html.erb +21 -0
- data/app/views/fe/admin/panels/_prop_paragraph.html.erb +32 -0
- data/app/views/fe/admin/panels/_prop_question_grid.html.erb +23 -0
- data/app/views/fe/admin/panels/_prop_question_grid_with_total.html.erb +14 -0
- data/app/views/fe/admin/panels/_prop_reference_question.html.erb +12 -0
- data/app/views/fe/admin/panels/_prop_section.html.erb +2 -0
- data/app/views/fe/admin/panels/_prop_sheet.html.erb +17 -0
- data/app/views/fe/admin/panels/_prop_text_field.html.erb +20 -0
- data/app/views/fe/admin/question_pages/_element.html.erb +18 -0
- data/app/views/fe/admin/question_pages/_element_show.html.erb +10 -0
- data/app/views/fe/admin/question_pages/_errors.html.erb +1 -0
- data/app/views/fe/admin/question_pages/_question_page.html.erb +13 -0
- data/app/views/fe/admin/question_pages/create.js.erb +11 -0
- data/app/views/fe/admin/question_pages/destroy.js.erb +5 -0
- data/app/views/fe/admin/question_pages/edit.js.erb +3 -0
- data/app/views/fe/admin/question_pages/error.js.erb +4 -0
- data/app/views/fe/admin/question_pages/show.js.erb +8 -0
- data/app/views/fe/admin/question_pages/show_panel.js.erb +3 -0
- data/app/views/fe/admin/question_pages/update.js.erb +2 -0
- data/app/views/fe/admin/question_sheets/_errors.html.erb +1 -0
- data/app/views/fe/admin/question_sheets/edit.js.erb +3 -0
- data/app/views/fe/admin/question_sheets/error.js.erb +5 -0
- data/app/views/fe/admin/question_sheets/index.html.erb +41 -0
- data/app/views/fe/admin/question_sheets/new.html.erb +15 -0
- data/app/views/fe/admin/question_sheets/show.html.erb +27 -0
- data/app/views/fe/admin/question_sheets/update.js.erb +2 -0
- data/app/views/fe/answer_pages/_answer_page.html.erb +56 -0
- data/app/views/fe/answer_pages/_element.html.erb +9 -0
- data/app/views/fe/answer_pages/update.js.erb +5 -0
- data/app/views/fe/answer_sheets/_answer_sheet.html.erb +24 -0
- data/app/views/fe/answer_sheets/_element.html.erb +54 -0
- data/app/views/fe/answer_sheets/_incomplete.html.erb +10 -0
- data/app/views/fe/answer_sheets/_page_link.html.erb +7 -0
- data/app/views/fe/answer_sheets/_pages_list.html.erb +11 -0
- data/app/views/fe/answer_sheets/_title.html.erb +1 -0
- data/app/views/fe/answer_sheets/edit.html.erb +60 -0
- data/app/views/fe/answer_sheets/incomplete.js.erb +5 -0
- data/app/views/fe/answer_sheets/index.html.erb +18 -0
- data/app/views/fe/answer_sheets/send_reference_invite.js.erb +8 -0
- data/app/views/fe/answer_sheets/show.html.erb +13 -0
- data/app/views/fe/help/builder.html +33 -0
- data/app/views/fe/help/question_grid.html +18 -0
- data/app/views/fe/questions/_acceptance.html.erb +13 -0
- data/app/views/fe/questions/_attachment_field.html.erb +42 -0
- data/app/views/fe/questions/_checkbox_field.html.erb +49 -0
- data/app/views/fe/questions/_country.html.erb +7 -0
- data/app/views/fe/questions/_date_field.html.erb +7 -0
- data/app/views/fe/questions/_date_field_mmyy.html.erb +9 -0
- data/app/views/fe/questions/_drop_down_field.html.erb +7 -0
- data/app/views/fe/questions/_paragraph.html.erb +1 -0
- data/app/views/fe/questions/_question_grid.html.erb +65 -0
- data/app/views/fe/questions/_question_grid_with_total.html.erb +57 -0
- data/app/views/fe/questions/_questions.html.erb +9 -0
- data/app/views/fe/questions/_radio_button_field.html.erb +41 -0
- data/app/views/fe/questions/_rating.html.erb +25 -0
- data/app/views/fe/questions/_reference_discipler.html.erb +1 -0
- data/app/views/fe/questions/_reference_friend.html.erb +1 -0
- data/app/views/fe/questions/_reference_parent.html.erb +1 -0
- data/app/views/fe/questions/_reference_peer.html.erb +1 -0
- data/app/views/fe/questions/_reference_question.html.erb +38 -0
- data/app/views/fe/questions/_reference_roommate.html.erb +1 -0
- data/app/views/fe/questions/_reference_spiritual.html.erb +1 -0
- data/app/views/fe/questions/_reference_staff.html.erb +1 -0
- data/app/views/fe/questions/_section.html.erb +1 -0
- data/app/views/fe/questions/_state_chooser.html.erb +7 -0
- data/app/views/fe/questions/_text_area_field.html.erb +6 -0
- data/app/views/fe/questions/_text_field.html.erb +8 -0
- data/app/views/fe/questions/_yes_no.html.erb +17 -0
- data/app/views/fe/questions/_yes_no_field.erb +17 -0
- data/app/views/fe/reference_sheets/not_found.html.erb +5 -0
- data/app/views/layouts/fe/application.html.erb +31 -0
- data/app/views/layouts/fe/qe.admin.html.erb +30 -0
- data/config/routes.rb +49 -0
- data/db/migrate/20131003041856_core.rb +91 -0
- data/db/migrate/20131003044250_create_reference_sheets.rb +23 -0
- data/db/migrate/20131003044436_add_element_and_answer_fields.rb +10 -0
- data/db/migrate/20131003044518_create_email_templates.rb +17 -0
- data/db/migrate/20131003044621_add_max_lengths.rb +8 -0
- data/db/migrate/20131003044714_create_join_table.rb +11 -0
- data/db/migrate/20131016162128_remove_question_id_from_element.rb +9 -0
- data/lib/fe.rb +22 -0
- data/lib/fe/engine.rb +19 -0
- data/lib/fe/version.rb +3 -0
- data/lib/generators/fe/install_generator.rb +132 -0
- data/lib/tasks/qe_tasks.rake +4 -0
- data/spec/controllers/fe/admin/elements_controller_spec.rb +4 -0
- data/spec/controllers/fe/admin/email_templates_controller_spec.rb +4 -0
- data/spec/controllers/fe/admin/question_pages_controller_spec.rb +4 -0
- data/spec/controllers/fe/admin/question_sheets_controller_spec.rb +4 -0
- data/spec/controllers/fe/answer_pages_controller_spec.rb +4 -0
- data/spec/controllers/fe/answer_sheets_controller_spec.rb +4 -0
- data/spec/controllers/fe/reference_sheets_controller_spec.rb +4 -0
- data/spec/factories/answer_sheets.rb +5 -0
- data/spec/factories/answers.rb +4 -0
- data/spec/factories/paragraphs.rb +4 -0
- data/spec/factories/question_sheet.rb +5 -0
- data/spec/factories/reference_questions.rb +4 -0
- data/spec/models/fe/answer_sheet_question_sheet_spec.rb +6 -0
- data/spec/models/fe/answer_sheet_spec.rb +8 -0
- data/spec/models/fe/answer_spec.rb +13 -0
- data/spec/models/fe/attachment_field_spec.rb +4 -0
- data/spec/models/fe/choice_field_spec.rb +5 -0
- data/spec/models/fe/condition_spec.rb +8 -0
- data/spec/models/fe/date_field_spec.rb +49 -0
- data/spec/models/fe/element_spec.rb +12 -0
- data/spec/models/fe/email_template_spec.rb +5 -0
- data/spec/models/fe/option_group_spec.rb +4 -0
- data/spec/models/fe/option_spec.rb +4 -0
- data/spec/models/fe/page_element_spec.rb +6 -0
- data/spec/models/fe/page_link_spec.rb +4 -0
- data/spec/models/fe/page_spec.rb +14 -0
- data/spec/models/fe/paragraph_spec.rb +17 -0
- data/spec/models/fe/question_grid_spec.rb +4 -0
- data/spec/models/fe/question_grid_with_total_spec.rb +4 -0
- data/spec/models/fe/question_set_spec.rb +4 -0
- data/spec/models/fe/question_sheet_spec.rb +8 -0
- data/spec/models/fe/question_spec.rb +20 -0
- data/spec/models/fe/reference_question_spec.rb +17 -0
- data/spec/models/fe/reference_sheet_spec.rb +11 -0
- data/spec/models/fe/section_spec.rb +4 -0
- data/spec/models/fe/state_chooser_spec.rb +4 -0
- data/spec/models/fe/text_field_spec.rb +17 -0
- data/spec/spec_helper.rb +66 -0
- data/spec/support/database.txt +28 -0
- metadata +508 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* jQuery validation plug-in 1.7
|
|
3
|
+
*
|
|
4
|
+
* http://bassistance.de/jquery-plugins/jquery-plugin-validation/
|
|
5
|
+
* http://docs.jquery.com/Plugins/Validation
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2006 - 2008 Jörn Zaefferer
|
|
8
|
+
*
|
|
9
|
+
* $Id: jquery.validate.js 6403 2009-06-17 14:27:16Z joern.zaefferer $
|
|
10
|
+
*
|
|
11
|
+
* Dual licensed under the MIT and GPL licenses:
|
|
12
|
+
* http://www.opensource.org/licenses/mit-license.php
|
|
13
|
+
* http://www.gnu.org/licenses/gpl.html
|
|
14
|
+
*/
|
|
15
|
+
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(7($){$.H($.2L,{17:7(d){l(!6.F){d&&d.2q&&2T.1z&&1z.52("3y 3p, 4L\'t 17, 64 3y");8}p c=$.19(6[0],\'v\');l(c){8 c}c=2w $.v(d,6[0]);$.19(6[0],\'v\',c);l(c.q.3x){6.3s("1w, 3i").1o(".4E").3e(7(){c.3b=w});l(c.q.35){6.3s("1w, 3i").1o(":2s").3e(7(){c.1Z=6})}6.2s(7(b){l(c.q.2q)b.5J();7 1T(){l(c.q.35){l(c.1Z){p a=$("<1w 1V=\'5r\'/>").1s("u",c.1Z.u).33(c.1Z.Z).51(c.U)}c.q.35.V(c,c.U);l(c.1Z){a.3D()}8 N}8 w}l(c.3b){c.3b=N;8 1T()}l(c.L()){l(c.1b){c.1l=w;8 N}8 1T()}12{c.2l();8 N}})}8 c},J:7(){l($(6[0]).2W(\'L\')){8 6.17().L()}12{p b=w;p a=$(6[0].L).17();6.P(7(){b&=a.I(6)});8 b}},4D:7(c){p d={},$I=6;$.P(c.1I(/\\s/),7(a,b){d[b]=$I.1s(b);$I.6d(b)});8 d},1i:7(h,k){p f=6[0];l(h){p i=$.19(f.L,\'v\').q;p d=i.1i;p c=$.v.36(f);23(h){1e"1d":$.H(c,$.v.1X(k));d[f.u]=c;l(k.G)i.G[f.u]=$.H(i.G[f.u],k.G);31;1e"3D":l(!k){T d[f.u];8 c}p e={};$.P(k.1I(/\\s/),7(a,b){e[b]=c[b];T c[b]});8 e}}p g=$.v.41($.H({},$.v.3Y(f),$.v.3V(f),$.v.3T(f),$.v.36(f)),f);l(g.15){p j=g.15;T g.15;g=$.H({15:j},g)}8 g}});$.H($.5p[":"],{5n:7(a){8!$.1p(""+a.Z)},5g:7(a){8!!$.1p(""+a.Z)},5f:7(a){8!a.4h}});$.v=7(b,a){6.q=$.H(w,{},$.v.3d,b);6.U=a;6.3I()};$.v.W=7(c,b){l(R.F==1)8 7(){p a=$.3F(R);a.4V(c);8 $.v.W.1Q(6,a)};l(R.F>2&&b.2c!=3B){b=$.3F(R).4Q(1)}l(b.2c!=3B){b=[b]}$.P(b,7(i,n){c=c.1u(2w 3t("\\\\{"+i+"\\\\}","g"),n)});8 c};$.H($.v,{3d:{G:{},2a:{},1i:{},1c:"3r",28:"J",2F:"4P",2l:w,3o:$([]),2D:$([]),3x:w,3l:[],3k:N,4O:7(a){6.3U=a;l(6.q.4K&&!6.4J){6.q.1K&&6.q.1K.V(6,a,6.q.1c,6.q.28);6.1M(a).2A()}},4C:7(a){l(!6.1E(a)&&(a.u 11 6.1a||!6.K(a))){6.I(a)}},6c:7(a){l(a.u 11 6.1a||a==6.4A){6.I(a)}},68:7(a){l(a.u 11 6.1a)6.I(a);12 l(a.4x.u 11 6.1a)6.I(a.4x)},39:7(a,c,b){$(a).22(c).2v(b)},1K:7(a,c,b){$(a).2v(c).22(b)}},63:7(a){$.H($.v.3d,a)},G:{15:"61 4r 2W 15.",1q:"M 2O 6 4r.",1J:"M O a J 1J 5X.",1B:"M O a J 5W.",1A:"M O a J 1A.",2j:"M O a J 1A (5Q).",1G:"M O a J 1G.",1P:"M O 5O 1P.",2f:"M O a J 5L 5I 1G.",2o:"M O 47 5F Z 5B.",43:"M O a Z 5z a J 5x.",18:$.v.W("M O 3K 5v 2X {0} 2V."),1y:$.v.W("M O 5t 5s {0} 2V."),2i:$.v.W("M O a Z 3W {0} 3O {1} 2V 5o."),2r:$.v.W("M O a Z 3W {0} 3O {1}."),1C:$.v.W("M O a Z 5j 2X 46 3M 3L {0}."),1t:$.v.W("M O a Z 5d 2X 46 3M 3L {0}.")},3J:N,5a:{3I:7(){6.24=$(6.q.2D);6.4t=6.24.F&&6.24||$(6.U);6.2x=$(6.q.3o).1d(6.q.2D);6.1a={};6.54={};6.1b=0;6.1h={};6.1f={};6.21();p f=(6.2a={});$.P(6.q.2a,7(d,c){$.P(c.1I(/\\s/),7(a,b){f[b]=d})});p e=6.q.1i;$.P(e,7(b,a){e[b]=$.v.1X(a)});7 2N(a){p b=$.19(6[0].L,"v"),3c="4W"+a.1V.1u(/^17/,"");b.q[3c]&&b.q[3c].V(b,6[0])}$(6.U).2K(":3E, :4U, :4T, 2e, 4S","2d 2J 4R",2N).2K(":3C, :3A, 2e, 3z","3e",2N);l(6.q.3w)$(6.U).2I("1f-L.17",6.q.3w)},L:7(){6.3v();$.H(6.1a,6.1v);6.1f=$.H({},6.1v);l(!6.J())$(6.U).3u("1f-L",[6]);6.1m();8 6.J()},3v:7(){6.2H();Q(p i=0,14=(6.2b=6.14());14[i];i++){6.29(14[i])}8 6.J()},I:7(a){a=6.2G(a);6.4A=a;6.2P(a);6.2b=$(a);p b=6.29(a);l(b){T 6.1f[a.u]}12{6.1f[a.u]=w}l(!6.3q()){6.13=6.13.1d(6.2x)}6.1m();8 b},1m:7(b){l(b){$.H(6.1v,b);6.S=[];Q(p c 11 b){6.S.27({1j:b[c],I:6.26(c)[0]})}6.1n=$.3n(6.1n,7(a){8!(a.u 11 b)})}6.q.1m?6.q.1m.V(6,6.1v,6.S):6.3m()},2S:7(){l($.2L.2S)$(6.U).2S();6.1a={};6.2H();6.2Q();6.14().2v(6.q.1c)},3q:7(){8 6.2k(6.1f)},2k:7(a){p b=0;Q(p i 11 a)b++;8 b},2Q:7(){6.2C(6.13).2A()},J:7(){8 6.3j()==0},3j:7(){8 6.S.F},2l:7(){l(6.q.2l){3Q{$(6.3h()||6.S.F&&6.S[0].I||[]).1o(":4N").3g().4M("2d")}3f(e){}}},3h:7(){p a=6.3U;8 a&&$.3n(6.S,7(n){8 n.I.u==a.u}).F==1&&a},14:7(){p a=6,2B={};8 $([]).1d(6.U.14).1o(":1w").1L(":2s, :21, :4I, [4H]").1L(6.q.3l).1o(7(){!6.u&&a.q.2q&&2T.1z&&1z.3r("%o 4G 3K u 4F",6);l(6.u 11 2B||!a.2k($(6).1i()))8 N;2B[6.u]=w;8 w})},2G:7(a){8 $(a)[0]},2z:7(){8 $(6.q.2F+"."+6.q.1c,6.4t)},21:7(){6.1n=[];6.S=[];6.1v={};6.1k=$([]);6.13=$([]);6.2b=$([])},2H:7(){6.21();6.13=6.2z().1d(6.2x)},2P:7(a){6.21();6.13=6.1M(a)},29:7(d){d=6.2G(d);l(6.1E(d)){d=6.26(d.u)[0]}p a=$(d).1i();p c=N;Q(Y 11 a){p b={Y:Y,2n:a[Y]};3Q{p f=$.v.1N[Y].V(6,d.Z.1u(/\\r/g,""),d,b.2n);l(f=="1S-1Y"){c=w;6g}c=N;l(f=="1h"){6.13=6.13.1L(6.1M(d));8}l(!f){6.4B(d,b);8 N}}3f(e){6.q.2q&&2T.1z&&1z.6f("6e 6b 6a 69 I "+d.4z+", 29 47 \'"+b.Y+"\' Y",e);67 e;}}l(c)8;l(6.2k(a))6.1n.27(d);8 w},4y:7(a,b){l(!$.1H)8;p c=6.q.3a?$(a).1H()[6.q.3a]:$(a).1H();8 c&&c.G&&c.G[b]},4w:7(a,b){p m=6.q.G[a];8 m&&(m.2c==4v?m:m[b])},4u:7(){Q(p i=0;i<R.F;i++){l(R[i]!==20)8 R[i]}8 20},2u:7(a,b){8 6.4u(6.4w(a.u,b),6.4y(a,b),!6.q.3k&&a.62||20,$.v.G[b],"<4s>60: 5Z 1j 5Y Q "+a.u+"</4s>")},4B:7(b,a){p c=6.2u(b,a.Y),37=/\\$?\\{(\\d+)\\}/g;l(1g c=="7"){c=c.V(6,a.2n,b)}12 l(37.16(c)){c=1F.W(c.1u(37,\'{$1}\'),a.2n)}6.S.27({1j:c,I:b});6.1v[b.u]=c;6.1a[b.u]=c},2C:7(a){l(6.q.2t)a=a.1d(a.4q(6.q.2t));8 a},3m:7(){Q(p i=0;6.S[i];i++){p a=6.S[i];6.q.39&&6.q.39.V(6,a.I,6.q.1c,6.q.28);6.2E(a.I,a.1j)}l(6.S.F){6.1k=6.1k.1d(6.2x)}l(6.q.1x){Q(p i=0;6.1n[i];i++){6.2E(6.1n[i])}}l(6.q.1K){Q(p i=0,14=6.4p();14[i];i++){6.q.1K.V(6,14[i],6.q.1c,6.q.28)}}6.13=6.13.1L(6.1k);6.2Q();6.2C(6.1k).4o()},4p:7(){8 6.2b.1L(6.4n())},4n:7(){8 $(6.S).4m(7(){8 6.I})},2E:7(a,c){p b=6.1M(a);l(b.F){b.2v().22(6.q.1c);b.1s("4l")&&b.4k(c)}12{b=$("<"+6.q.2F+"/>").1s({"Q":6.34(a),4l:w}).22(6.q.1c).4k(c||"");l(6.q.2t){b=b.2A().4o().5V("<"+6.q.2t+"/>").4q()}l(!6.24.5S(b).F)6.q.4j?6.q.4j(b,$(a)):b.5R(a)}l(!c&&6.q.1x){b.3E("");1g 6.q.1x=="1D"?b.22(6.q.1x):6.q.1x(b)}6.1k=6.1k.1d(b)},1M:7(a){p b=6.34(a);8 6.2z().1o(7(){8 $(6).1s(\'Q\')==b})},34:7(a){8 6.2a[a.u]||(6.1E(a)?a.u:a.4z||a.u)},1E:7(a){8/3C|3A/i.16(a.1V)},26:7(d){p c=6.U;8 $(4i.5P(d)).4m(7(a,b){8 b.L==c&&b.u==d&&b||4g})},1O:7(a,b){23(b.4f.4e()){1e\'2e\':8 $("3z:3p",b).F;1e\'1w\':l(6.1E(b))8 6.26(b.u).1o(\':4h\').F}8 a.F},4d:7(b,a){8 6.32[1g b]?6.32[1g b](b,a):w},32:{"5N":7(b,a){8 b},"1D":7(b,a){8!!$(b,a.L).F},"7":7(b,a){8 b(a)}},K:7(a){8!$.v.1N.15.V(6,$.1p(a.Z),a)&&"1S-1Y"},4c:7(a){l(!6.1h[a.u]){6.1b++;6.1h[a.u]=w}},4b:7(a,b){6.1b--;l(6.1b<0)6.1b=0;T 6.1h[a.u];l(b&&6.1b==0&&6.1l&&6.L()){$(6.U).2s();6.1l=N}12 l(!b&&6.1b==0&&6.1l){$(6.U).3u("1f-L",[6]);6.1l=N}},2h:7(a){8 $.19(a,"2h")||$.19(a,"2h",{2M:4g,J:w,1j:6.2u(a,"1q")})}},1R:{15:{15:w},1J:{1J:w},1B:{1B:w},1A:{1A:w},2j:{2j:w},4a:{4a:w},1G:{1G:w},49:{49:w},1P:{1P:w},2f:{2f:w}},48:7(a,b){a.2c==4v?6.1R[a]=b:$.H(6.1R,a)},3V:7(b){p a={};p c=$(b).1s(\'5H\');c&&$.P(c.1I(\' \'),7(){l(6 11 $.v.1R){$.H(a,$.v.1R[6])}});8 a},3T:7(c){p a={};p d=$(c);Q(Y 11 $.v.1N){p b=d.1s(Y);l(b){a[Y]=b}}l(a.18&&/-1|5G|5C/.16(a.18)){T a.18}8 a},3Y:7(a){l(!$.1H)8{};p b=$.19(a.L,\'v\').q.3a;8 b?$(a).1H()[b]:$(a).1H()},36:7(b){p a={};p c=$.19(b.L,\'v\');l(c.q.1i){a=$.v.1X(c.q.1i[b.u])||{}}8 a},41:7(d,e){$.P(d,7(c,b){l(b===N){T d[c];8}l(b.2R||b.2p){p a=w;23(1g b.2p){1e"1D":a=!!$(b.2p,e.L).F;31;1e"7":a=b.2p.V(e,e);31}l(a){d[c]=b.2R!==20?b.2R:w}12{T d[c]}}});$.P(d,7(a,b){d[a]=$.44(b)?b(e):b});$.P([\'1y\',\'18\',\'1t\',\'1C\'],7(){l(d[6]){d[6]=2Z(d[6])}});$.P([\'2i\',\'2r\'],7(){l(d[6]){d[6]=[2Z(d[6][0]),2Z(d[6][1])]}});l($.v.3J){l(d.1t&&d.1C){d.2r=[d.1t,d.1C];T d.1t;T d.1C}l(d.1y&&d.18){d.2i=[d.1y,d.18];T d.1y;T d.18}}l(d.G){T d.G}8 d},1X:7(a){l(1g a=="1D"){p b={};$.P(a.1I(/\\s/),7(){b[6]=w});a=b}8 a},5A:7(c,a,b){$.v.1N[c]=a;$.v.G[c]=b!=20?b:$.v.G[c];l(a.F<3){$.v.48(c,$.v.1X(c))}},1N:{15:7(c,d,a){l(!6.4d(a,d))8"1S-1Y";23(d.4f.4e()){1e\'2e\':p b=$(d).33();8 b&&b.F>0;1e\'1w\':l(6.1E(d))8 6.1O(c,d)>0;5y:8 $.1p(c).F>0}},1q:7(f,h,j){l(6.K(h))8"1S-1Y";p g=6.2h(h);l(!6.q.G[h.u])6.q.G[h.u]={};g.40=6.q.G[h.u].1q;6.q.G[h.u].1q=g.1j;j=1g j=="1D"&&{1B:j}||j;l(g.2M!==f){g.2M=f;p k=6;6.4c(h);p i={};i[h.u]=f;$.2U($.H(w,{1B:j,3Z:"2Y",3X:"17"+h.u,5w:"5u",19:i,1x:7(d){k.q.G[h.u].1q=g.40;p b=d===w;l(b){p e=k.1l;k.2P(h);k.1l=e;k.1n.27(h);k.1m()}12{p a={};p c=(g.1j=d||k.2u(h,"1q"));a[h.u]=$.44(c)?c(f):c;k.1m(a)}g.J=b;k.4b(h,b)}},j));8"1h"}12 l(6.1h[h.u]){8"1h"}8 g.J},1y:7(b,c,a){8 6.K(c)||6.1O($.1p(b),c)>=a},18:7(b,c,a){8 6.K(c)||6.1O($.1p(b),c)<=a},2i:7(b,d,a){p c=6.1O($.1p(b),d);8 6.K(d)||(c>=a[0]&&c<=a[1])},1t:7(b,c,a){8 6.K(c)||b>=a},1C:7(b,c,a){8 6.K(c)||b<=a},2r:7(b,c,a){8 6.K(c)||(b>=a[0]&&b<=a[1])},1J:7(a,b){8 6.K(b)||/^((([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^X`{\\|}~]|[\\E-\\B\\C-\\x\\A-\\y])+(\\.([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^X`{\\|}~]|[\\E-\\B\\C-\\x\\A-\\y])+)*)|((\\3S)((((\\2m|\\1W)*(\\30\\3R))?(\\2m|\\1W)+)?(([\\3P-\\5q\\45\\42\\5D-\\5E\\3N]|\\5m|[\\5l-\\5k]|[\\5i-\\5K]|[\\E-\\B\\C-\\x\\A-\\y])|(\\\\([\\3P-\\1W\\45\\42\\30-\\3N]|[\\E-\\B\\C-\\x\\A-\\y]))))*(((\\2m|\\1W)*(\\30\\3R))?(\\2m|\\1W)+)?(\\3S)))@((([a-z]|\\d|[\\E-\\B\\C-\\x\\A-\\y])|(([a-z]|\\d|[\\E-\\B\\C-\\x\\A-\\y])([a-z]|\\d|-|\\.|X|~|[\\E-\\B\\C-\\x\\A-\\y])*([a-z]|\\d|[\\E-\\B\\C-\\x\\A-\\y])))\\.)+(([a-z]|[\\E-\\B\\C-\\x\\A-\\y])|(([a-z]|[\\E-\\B\\C-\\x\\A-\\y])([a-z]|\\d|-|\\.|X|~|[\\E-\\B\\C-\\x\\A-\\y])*([a-z]|[\\E-\\B\\C-\\x\\A-\\y])))\\.?$/i.16(a)},1B:7(a,b){8 6.K(b)||/^(5h?|5M):\\/\\/(((([a-z]|\\d|-|\\.|X|~|[\\E-\\B\\C-\\x\\A-\\y])|(%[\\1U-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:)*@)?(((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|((([a-z]|\\d|[\\E-\\B\\C-\\x\\A-\\y])|(([a-z]|\\d|[\\E-\\B\\C-\\x\\A-\\y])([a-z]|\\d|-|\\.|X|~|[\\E-\\B\\C-\\x\\A-\\y])*([a-z]|\\d|[\\E-\\B\\C-\\x\\A-\\y])))\\.)+(([a-z]|[\\E-\\B\\C-\\x\\A-\\y])|(([a-z]|[\\E-\\B\\C-\\x\\A-\\y])([a-z]|\\d|-|\\.|X|~|[\\E-\\B\\C-\\x\\A-\\y])*([a-z]|[\\E-\\B\\C-\\x\\A-\\y])))\\.?)(:\\d*)?)(\\/((([a-z]|\\d|-|\\.|X|~|[\\E-\\B\\C-\\x\\A-\\y])|(%[\\1U-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)+(\\/(([a-z]|\\d|-|\\.|X|~|[\\E-\\B\\C-\\x\\A-\\y])|(%[\\1U-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)*)*)?)?(\\?((([a-z]|\\d|-|\\.|X|~|[\\E-\\B\\C-\\x\\A-\\y])|(%[\\1U-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)|[\\5e-\\5T]|\\/|\\?)*)?(\\#((([a-z]|\\d|-|\\.|X|~|[\\E-\\B\\C-\\x\\A-\\y])|(%[\\1U-f]{2})|[!\\$&\'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?$/i.16(a)},1A:7(a,b){8 6.K(b)||!/5U|5c/.16(2w 5b(a))},2j:7(a,b){8 6.K(b)||/^\\d{4}[\\/-]\\d{1,2}[\\/-]\\d{1,2}$/.16(a)},1G:7(a,b){8 6.K(b)||/^-?(?:\\d+|\\d{1,3}(?:,\\d{3})+)(?:\\.\\d+)?$/.16(a)},1P:7(a,b){8 6.K(b)||/^\\d+$/.16(a)},2f:7(b,e){l(6.K(e))8"1S-1Y";l(/[^0-9-]+/.16(b))8 N;p a=0,d=0,2g=N;b=b.1u(/\\D/g,"");Q(p n=b.F-1;n>=0;n--){p c=b.59(n);p d=58(c,10);l(2g){l((d*=2)>9)d-=9}a+=d;2g=!2g}8(a%10)==0},43:7(b,c,a){a=1g a=="1D"?a.1u(/,/g,\'|\'):"57|56?g|55";8 6.K(c)||b.65(2w 3t(".("+a+")$","i"))},2o:7(c,d,a){p b=$(a).66(".17-2o").2I("3H.17-2o",7(){$(d).J()});8 c==b.33()}}});$.W=$.v.W})(1F);(7($){p c=$.2U;p d={};$.2U=7(a){a=$.H(a,$.H({},$.53,a));p b=a.3X;l(a.3Z=="2Y"){l(d[b]){d[b].2Y()}8(d[b]=c.1Q(6,R))}8 c.1Q(6,R)}})(1F);(7($){l(!1F.1r.38.2d&&!1F.1r.38.2J&&4i.3G){$.P({3g:\'2d\',3H:\'2J\'},7(b,a){$.1r.38[a]={50:7(){6.3G(b,2y,w)},4Z:7(){6.4Y(b,2y,w)},2y:7(e){R[0]=$.1r.2O(e);R[0].1V=a;8 $.1r.1T.1Q(6,R)}};7 2y(e){e=$.1r.2O(e);e.1V=a;8 $.1r.1T.V(6,e)}})};$.H($.2L,{2K:7(d,e,c){8 6.2I(e,7(a){p b=$(a.4X);l(b.2W(d)){8 c.1Q(b,R)}})}})})(1F);',62,389,'||||||this|function|return|||||||||||||if||||var|settings||||name|validator|true|uFDCF|uFFEF||uFDF0|uD7FF|uF900||u00A0|length|messages|extend|element|valid|optional|form|Please|false|enter|each|for|arguments|errorList|delete|currentForm|call|format|_|method|value||in|else|toHide|elements|required|test|validate|maxlength|data|submitted|pendingRequest|errorClass|add|case|invalid|typeof|pending|rules|message|toShow|formSubmitted|showErrors|successList|filter|trim|remote|event|attr|min|replace|errorMap|input|success|minlength|console|date|url|max|string|checkable|jQuery|number|metadata|split|email|unhighlight|not|errorsFor|methods|getLength|digits|apply|classRuleSettings|dependency|handle|da|type|x09|normalizeRule|mismatch|submitButton|undefined|reset|addClass|switch|labelContainer||findByName|push|validClass|check|groups|currentElements|constructor|focusin|select|creditcard|bEven|previousValue|rangelength|dateISO|objectLength|focusInvalid|x20|parameters|equalTo|depends|debug|range|submit|wrapper|defaultMessage|removeClass|new|containers|handler|errors|hide|rulesCache|addWrapper|errorLabelContainer|showLabel|errorElement|clean|prepareForm|bind|focusout|validateDelegate|fn|old|delegate|fix|prepareElement|hideErrors|param|resetForm|window|ajax|characters|is|than|abort|Number|x0d|break|dependTypes|val|idOrName|submitHandler|staticRules|theregex|special|highlight|meta|cancelSubmit|eventType|defaults|click|catch|focus|findLastActive|button|size|ignoreTitle|ignore|defaultShowErrors|grep|errorContainer|selected|numberOfInvalids|error|find|RegExp|triggerHandler|checkForm|invalidHandler|onsubmit|nothing|option|checkbox|Array|radio|remove|text|makeArray|addEventListener|blur|init|autoCreateRanges|no|to|equal|x7f|and|x01|try|x0a|x22|attributeRules|lastActive|classRules|between|port|metadataRules|mode|originalMessage|normalizeRules|x0c|accept|isFunction|x0b|or|the|addClassRules|numberDE|dateDE|stopRequest|startRequest|depend|toLowerCase|nodeName|null|checked|document|errorPlacement|html|generated|map|invalidElements|show|validElements|parent|field|strong|errorContext|findDefined|String|customMessage|parentNode|customMetaMessage|id|lastElement|formatAndAdd|onfocusout|removeAttrs|cancel|assigned|has|disabled|image|blockFocusCleanup|focusCleanup|can|trigger|visible|onfocusin|label|slice|keyup|textarea|file|password|unshift|on|target|removeEventListener|teardown|setup|appendTo|warn|ajaxSettings|valueCache|gif|jpe|png|parseInt|charAt|prototype|Date|NaN|greater|uE000|unchecked|filled|https|x5d|less|x5b|x23|x21|blank|long|expr|x08|hidden|least|at|json|more|dataType|extension|default|with|addMethod|again|524288|x0e|x1f|same|2147483647|class|card|preventDefault|x7e|credit|ftp|boolean|only|getElementsByName|ISO|insertAfter|append|uF8FF|Invalid|wrap|URL|address|defined|No|Warning|This|title|setDefaults|returning|match|unbind|throw|onclick|checking|when|occured|onkeyup|removeAttr|exception|log|continue'.split('|'),0,{}))
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
$(function() {
|
|
2
|
+
$('#status').ajaxStart(function() {
|
|
3
|
+
$(this).show();
|
|
4
|
+
}).ajaxComplete(function() {
|
|
5
|
+
$(this).hide();
|
|
6
|
+
setUpJsHelpers();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
$(document).on('click', '.lbOn', function() {
|
|
10
|
+
if ($('#dialog-help')[0] == null) {
|
|
11
|
+
$('body').append('<div id="dialog-help" style="display:none" title="Help!"><p><span id="dialog-help-message"></span></p></div>');
|
|
12
|
+
}
|
|
13
|
+
$.get($(this).attr('href'), function(content) {
|
|
14
|
+
$('#dialog-help-message').html(content);
|
|
15
|
+
$('#dialog-help').dialog({
|
|
16
|
+
modal: true,
|
|
17
|
+
width: 500,
|
|
18
|
+
buttons: {
|
|
19
|
+
Close: function() {
|
|
20
|
+
$(this).dialog('close');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
return false;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
$(document).on('click', '.close_prop', function() {
|
|
29
|
+
$('#element_form_' + $(this).attr('data-dom_id')).hide();
|
|
30
|
+
$('#element_' + $(this).attr('data-dom_id')).show();
|
|
31
|
+
return false;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
});
|
|
35
|
+
// used by form designer
|
|
36
|
+
|
|
37
|
+
var currentTab = 'pages_list';
|
|
38
|
+
|
|
39
|
+
function switchTab(toTab) {
|
|
40
|
+
if(currentTab != null) $('#tab-' + currentTab).removeClass('active');
|
|
41
|
+
$('#tab-' + toTab).addClass('active');
|
|
42
|
+
currentTab = toTab;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function selectPage() {
|
|
46
|
+
el = $('#link-page-name');
|
|
47
|
+
clearCurrentElement();
|
|
48
|
+
el.addClass('active');
|
|
49
|
+
switchTab('properties');
|
|
50
|
+
|
|
51
|
+
if($('#page_label').length > 0) $('#page_label').focus();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function selectElement(id) {
|
|
55
|
+
el = $(id);
|
|
56
|
+
clearPageName();
|
|
57
|
+
clearCurrentElement();
|
|
58
|
+
el.addClass('active');
|
|
59
|
+
// snapElementProperties(el);
|
|
60
|
+
activeElement = id;
|
|
61
|
+
switchTab('properties');
|
|
62
|
+
|
|
63
|
+
// if( $('#element_label')) $('#element_label').focus();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function clearCurrentElement() {
|
|
67
|
+
if (activeElement != '' && $(activeElement)) {
|
|
68
|
+
$(activeElement).removeClass('active');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function clearPageName() {
|
|
73
|
+
$('#link-page-name').removeClass('active');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function snapElementProperties(el) {
|
|
77
|
+
propsTop = Position.cumulativeOffset(el)[1] - 160;
|
|
78
|
+
if (propsTop < 0) propsTop = 0;
|
|
79
|
+
$('#panel-properties-element').css({'margin-top': propsTop});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function scrollToElement(id) {
|
|
83
|
+
$(id).scrollTo();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function addError(id) {
|
|
87
|
+
$('#' + id).addClassName('fieldWithErrors');
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// convert label to slug
|
|
91
|
+
function updateSlug(source, dest) {
|
|
92
|
+
label = $F(source)
|
|
93
|
+
slug = $F(dest)
|
|
94
|
+
if( label == null || slug == null) return; // oh oh
|
|
95
|
+
|
|
96
|
+
label = label.strip();
|
|
97
|
+
slug = slug.strip();
|
|
98
|
+
|
|
99
|
+
if( label != '' && slug == '' ) { // if slug is empty lets copy label to it
|
|
100
|
+
slug = label.toLowerCase();
|
|
101
|
+
slug = slug.gsub(/[^a-z0-9]/, '_'); // only alpha-numeric
|
|
102
|
+
slug = slug.gsub(/_{2,}/, '_'); // compact double hyphens down to one
|
|
103
|
+
slug = slug.gsub(/_$/, ''); // remove trailing underscores
|
|
104
|
+
slug = slug.gsub(/^([0-9])/, '_\1') // can't begin with a digit, so preprend an underscore
|
|
105
|
+
if( slug.length > 36 ) slug = slug.slice(0, 36) // max length
|
|
106
|
+
|
|
107
|
+
$(dest).value = slug
|
|
108
|
+
$(dest).focus();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
$(function() {
|
|
113
|
+
setUpSortables();
|
|
114
|
+
fixGridColumnWidths();
|
|
115
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
function setUpSortables() {
|
|
2
|
+
$('[data-sortable]').sortable({axis:'y',
|
|
3
|
+
dropOnEmpty:false,
|
|
4
|
+
update: function(event, ui) {
|
|
5
|
+
sortable = this;
|
|
6
|
+
$.ajax({data:$(this).sortable('serialize',{key:sortable.id + '[]'}),
|
|
7
|
+
complete: function(request) {$(sortable).effect('highlight')},
|
|
8
|
+
success:function(request){$('#errors').html(request)},
|
|
9
|
+
type:'POST',
|
|
10
|
+
url: $(sortable).attr('data-sortable-url')
|
|
11
|
+
})
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
$('[data-sortable][data-sortable-handle]').each(function() {
|
|
15
|
+
handle = $(this).attr('data-sortable-handle');
|
|
16
|
+
$(this).sortable("option", "handle", handle);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
$('.droppable').droppable({
|
|
21
|
+
activeClass: 'droppable-active',
|
|
22
|
+
drop: function( event, ui ) {
|
|
23
|
+
$.post($(this).attr('data-url'), {draggable_element: ui.draggable.attr('id')}, function() {}, 'script')
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function setUpCalendars() {
|
|
29
|
+
now = new Date();
|
|
30
|
+
year = now.getFullYear() + 10;
|
|
31
|
+
$('[data-calendar]').datepicker({changeYear:true,
|
|
32
|
+
yearRange: '1950:' + year})
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function setUpJsHelpers() {
|
|
36
|
+
// ==================
|
|
37
|
+
// Sortable
|
|
38
|
+
setUpSortables();
|
|
39
|
+
// ==================
|
|
40
|
+
|
|
41
|
+
// ==================
|
|
42
|
+
// Calendar
|
|
43
|
+
setUpCalendars();
|
|
44
|
+
// ==================
|
|
45
|
+
$(".tip[title], a[title]").tooltip()
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function fixGridColumnWidths() {
|
|
49
|
+
$("table.grid").each(function(i, grid) {
|
|
50
|
+
num_columns = $(grid).find("th").length;
|
|
51
|
+
if (num_columns > 0) {
|
|
52
|
+
width = (100 / num_columns) + "%";
|
|
53
|
+
$(grid).find("th").css("width", width);
|
|
54
|
+
$(grid).find("td").css("width", width);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
};
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
// used by answer sheets
|
|
2
|
+
(function($) {
|
|
3
|
+
$(function() {
|
|
4
|
+
|
|
5
|
+
$(document).on('click', '.save_button', function() {
|
|
6
|
+
$.fe.pageHandler.savePage($(this).closest('.answer-page'), true);
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
$(document).on('keydown', '#payment_staff_first, #payment_staff_last', function(e) {
|
|
10
|
+
if (e.which == 13) {
|
|
11
|
+
$('#staff_search').trigger('click');
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
});
|
|
16
|
+
$(document).on('click', '.reference_send_invite', function() {
|
|
17
|
+
var el = this;
|
|
18
|
+
var data = $(el).closest('form').serializeArray();
|
|
19
|
+
|
|
20
|
+
data.push({name: 'answer_sheet_type', value: answer_sheet_type});
|
|
21
|
+
$.ajax({url: $(el).attr('href'), data: data, dataType: 'script', type: 'POST',
|
|
22
|
+
beforeSend: function (xhr) {
|
|
23
|
+
$('body').trigger('ajax:loading', xhr);
|
|
24
|
+
},
|
|
25
|
+
complete: function (xhr) {
|
|
26
|
+
$('body').trigger('ajax:complete', xhr);
|
|
27
|
+
},
|
|
28
|
+
error: function (xhr, status, error) {
|
|
29
|
+
$('body').trigger('ajax:failure', [xhr, status, error]);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return false;
|
|
33
|
+
});
|
|
34
|
+
$(document).on('focus', 'textarea[maxlength]', function() {
|
|
35
|
+
var max = parseInt($(this).attr('maxlength'));
|
|
36
|
+
$(this).parent().find('.charsRemaining').html('You have ' + (max - $(this).val().length) + ' characters remaining');
|
|
37
|
+
}).on('keyup', 'textarea[maxlength]', function(){
|
|
38
|
+
var max = parseInt($(this).attr('maxlength'));
|
|
39
|
+
if($(this).val().length > max){
|
|
40
|
+
$(this).val($(this).val().substr(0, $(this).attr('maxlength')));
|
|
41
|
+
}
|
|
42
|
+
$(this).parent().find('.charsRemaining').html('You have ' + (max - $(this).val().length) + ' characters remaining');
|
|
43
|
+
}).on('blur', 'textarea[maxlength]', function() {
|
|
44
|
+
$(this).parent().find('.charsRemaining').html('');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
});
|
|
48
|
+
$.fe = {};
|
|
49
|
+
$.fe.pageHandler = {
|
|
50
|
+
initialize : function(page) {
|
|
51
|
+
this.auto_save_frequency = 30; // seconds
|
|
52
|
+
this.timer_id = null;
|
|
53
|
+
this.suspendLoad = false;
|
|
54
|
+
|
|
55
|
+
this.current_page = page;
|
|
56
|
+
$('#' + page).data('form_data', this.captureForm($('#' + page)));
|
|
57
|
+
this.registerAutoSave();
|
|
58
|
+
|
|
59
|
+
this.page_validation = {}; // validation objects for each page
|
|
60
|
+
this.enableValidation(page);
|
|
61
|
+
|
|
62
|
+
// this.background_load = false;
|
|
63
|
+
// this.final_submission = false;
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
// swap to a different page
|
|
67
|
+
showPage : function(page) {
|
|
68
|
+
// hide the old
|
|
69
|
+
$('#' + this.current_page + '-li').removeClass('active');
|
|
70
|
+
$('#' + this.current_page).hide();
|
|
71
|
+
|
|
72
|
+
// HACK: Need to clear the main error message when returning to the submit page
|
|
73
|
+
// It is very confusing to users to be there when they revisit the page
|
|
74
|
+
if ((page=='submit_page') && ($('#submit_message')[0] != null)) $('#submit_message').hide();
|
|
75
|
+
if ((page=='submit_page') && ($('#application_errors')[0] != null)) $('#application_errors').html('');
|
|
76
|
+
|
|
77
|
+
// show the new
|
|
78
|
+
// $('#' + page + '-li').removeClass('incomplete');
|
|
79
|
+
// $('#' + page + '-li').removeClass('valid');
|
|
80
|
+
$('#' + page + '-li').addClass('active');
|
|
81
|
+
$('#' + page).show();
|
|
82
|
+
this.current_page = page;
|
|
83
|
+
this.registerAutoSave(page);
|
|
84
|
+
this.suspendLoad = false;
|
|
85
|
+
fixGridColumnWidths();
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
// callback onSuccess
|
|
89
|
+
pageLoaded : function(response) {
|
|
90
|
+
// var response = new String(transport.responseText);
|
|
91
|
+
var match = response.match(/<div id=\"(.*?)\"/i); // what did I just load? parse out the first div id
|
|
92
|
+
if( match != null )
|
|
93
|
+
{
|
|
94
|
+
var page = match[1];
|
|
95
|
+
$('#preview').append(response);
|
|
96
|
+
// if(this.background_load) $('#' + page).hide(); else
|
|
97
|
+
$.fe.pageHandler.showPage(page); // show after load, unless loading in background
|
|
98
|
+
setUpJsHelpers();
|
|
99
|
+
$.fe.pageHandler.enableValidation(page);
|
|
100
|
+
// $.fe.pageHandler.validatePage('#' + page);
|
|
101
|
+
$('#' + page).data('form_data', $.fe.pageHandler.captureForm($('#' + page)));
|
|
102
|
+
}
|
|
103
|
+
$('#page_ajax_spinner').hide();
|
|
104
|
+
$('.reference_send_invite').button();
|
|
105
|
+
updateTotals();
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
loadPage : function(page, url) {
|
|
109
|
+
if (!this.suspendLoad) {
|
|
110
|
+
this.suspendLoad = true; // don't load a page if one is currently loading (prevent double-click behavior where two pages end up visible!)
|
|
111
|
+
|
|
112
|
+
this.unregisterAutoSave(); // don't auto-save while loading/saving
|
|
113
|
+
// will register auto-save on new page once loaded/shown
|
|
114
|
+
|
|
115
|
+
$.scrollTo('#main');
|
|
116
|
+
|
|
117
|
+
this.validatePage(this.current_page); // mark current page as valid (or not) as we're leaving
|
|
118
|
+
|
|
119
|
+
this.savePage();
|
|
120
|
+
|
|
121
|
+
if( $.fe.pageHandler.isPageLoaded(page) && page.match('no_cache') == null ) // if already loaded (element exists) excluding pages that need reloading
|
|
122
|
+
{
|
|
123
|
+
$.fe.pageHandler.showPage(page);
|
|
124
|
+
$('#page_ajax_spinner').hide();
|
|
125
|
+
}
|
|
126
|
+
else
|
|
127
|
+
{
|
|
128
|
+
$.ajax({
|
|
129
|
+
url: url,
|
|
130
|
+
type: 'GET',
|
|
131
|
+
data: {'answer_sheet_type':answer_sheet_type},
|
|
132
|
+
success: $.fe.pageHandler.pageLoaded,
|
|
133
|
+
error: function (xhr, status, error) {
|
|
134
|
+
alert("There was a problem loading that page. We've been notified and will fix it as soon as possible. To work on other pages, please refresh the website.");
|
|
135
|
+
document.location = document.location;
|
|
136
|
+
},
|
|
137
|
+
beforeSend: function (xhr) {
|
|
138
|
+
$('body').trigger('ajax:loading', xhr);
|
|
139
|
+
},
|
|
140
|
+
complete: function (xhr) {
|
|
141
|
+
$('body').trigger('ajax:complete', xhr);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
// new Ajax.Request(url, {asynchronous:true, evalScripts:false, method:'get',
|
|
145
|
+
// onSuccess:this.pageLoaded.bind(this)});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
// save form if any changes were made
|
|
151
|
+
savePage : function(page, force) {
|
|
152
|
+
if (page == null) page = $('#' + this.current_page);
|
|
153
|
+
form_data = this.captureForm(page);
|
|
154
|
+
if( form_data ) {
|
|
155
|
+
if( page.data('form_data') == null || page.data('form_data').data !== form_data.data || force === true) { // if any changes
|
|
156
|
+
page.data('form_data', form_data);
|
|
157
|
+
$.ajax({url: form_data.url, type: 'put', data: form_data.data, beforeSend: function (xhr) {
|
|
158
|
+
$('#spinner_' + page.attr('id')).show();
|
|
159
|
+
},
|
|
160
|
+
complete: function (xhr) {
|
|
161
|
+
$('#spinner_' + page.attr('id')).hide();
|
|
162
|
+
},
|
|
163
|
+
error: function() {
|
|
164
|
+
page.data('form_data', null); // on error, force save for next call to save
|
|
165
|
+
// WARNING: race conditions with load & show?
|
|
166
|
+
// sort of a mess if save fails while another page is already loading!!
|
|
167
|
+
}});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
// Update last saved stamp
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
savePages : function(force) {
|
|
174
|
+
$('.answer-page').each(function() {$.fe.pageHandler.savePage($(this), force)})
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
// setup a timer to auto-save (only one timer, for the page being viewed)
|
|
178
|
+
registerAutoSave: function(page) {
|
|
179
|
+
this.timer_id = setInterval(this.savePages, this.auto_save_frequency * 1000);
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
unregisterAutoSave: function() {
|
|
183
|
+
if( this.timer_id != null )
|
|
184
|
+
{
|
|
185
|
+
clearInterval(this.timer_id);
|
|
186
|
+
this.timer_id = null;
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
// serialize form data and extract url to post to
|
|
191
|
+
captureForm : function(page) {
|
|
192
|
+
form_el = $('#' + page.attr('id') + '-form');
|
|
193
|
+
if( form_el[0] == null ) return null;
|
|
194
|
+
return {url: form_el.attr('action'), data: form_el.serialize() + '&answer_sheet_type=' + answer_sheet_type};
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
// enable form validation (when form is loaded)
|
|
199
|
+
enableValidation : function(page) {
|
|
200
|
+
$('#' + page + '-form').validate({onsubmit:false, focusInvalid:true, onfocusout: function(element) { this.element(element);}});
|
|
201
|
+
// $('#' + page + '-form').valid();
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
validatePage : function(page) {
|
|
205
|
+
try {
|
|
206
|
+
var li = $('#' + page + '-li');
|
|
207
|
+
var form = $('#' + page + '-form');
|
|
208
|
+
|
|
209
|
+
valid = form.valid();
|
|
210
|
+
// Move radio button errors up
|
|
211
|
+
$('input[type=radio].error').closest('tr').addClass('error');
|
|
212
|
+
$('.choice_field input[type=radio].error').removeClass('error')
|
|
213
|
+
.closest('.choice_field')
|
|
214
|
+
.addClass('error');
|
|
215
|
+
$('div.yesno label.error').hide();
|
|
216
|
+
|
|
217
|
+
if(valid) {
|
|
218
|
+
el.removeClass('incomplete');
|
|
219
|
+
el.addClass('complete');
|
|
220
|
+
} else {
|
|
221
|
+
el.removeClass('complete');
|
|
222
|
+
el.addClass('incomplete');
|
|
223
|
+
}
|
|
224
|
+
return valid;
|
|
225
|
+
}
|
|
226
|
+
catch(err) {
|
|
227
|
+
|
|
228
|
+
// If the user clicks too quickly, sometimes the page element isn't properly defined yet.
|
|
229
|
+
// If we don't catch the error, js stops execution. If we catch it, the user just has to click again.
|
|
230
|
+
}
|
|
231
|
+
$('page_ajax_spinner').hide();
|
|
232
|
+
},
|
|
233
|
+
|
|
234
|
+
// callback when falls to 0 active Ajax requests
|
|
235
|
+
completeAll : function()
|
|
236
|
+
{
|
|
237
|
+
$('#submit_button').attr('disabled', true)
|
|
238
|
+
$('#submit_message').html('');
|
|
239
|
+
$('#submit_message').hide();
|
|
240
|
+
// validate all the pages
|
|
241
|
+
$('.page_link').each(function(index, page) {
|
|
242
|
+
$.fe.pageHandler.validatePage($(page).attr('data-page-id'));
|
|
243
|
+
});
|
|
244
|
+
var all_valid = ($('#list-pages li.incomplete').length == 0);
|
|
245
|
+
|
|
246
|
+
// Make sure any necessary payments are made
|
|
247
|
+
var payments_made = $('.payment_question.required').length == $('.payment').length
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
if( payments_made)
|
|
251
|
+
{
|
|
252
|
+
this.savePage($('#' + $.fe.pageHandler.current_page)); // in case any input fields on submit_page
|
|
253
|
+
|
|
254
|
+
// submit the application
|
|
255
|
+
if($('#submit_to')[0] != null)
|
|
256
|
+
{
|
|
257
|
+
url = $('#submit_to').val();
|
|
258
|
+
// clear out pages array to force reload. This enables "frozen" apps
|
|
259
|
+
// immediately after submission - :onSuccess (for USCM which stays in the application vs. redirecting to the dashboard)
|
|
260
|
+
var curr = $.fe.pageHandler.current_page;
|
|
261
|
+
$.ajax({url: url, dataType:'script',
|
|
262
|
+
data: {answer_sheet_type: answer_sheet_type},
|
|
263
|
+
type:'post',
|
|
264
|
+
beforeSend: function(xhr) {
|
|
265
|
+
$('body').trigger('ajax:loading', xhr);
|
|
266
|
+
},
|
|
267
|
+
success: function(xhr) {
|
|
268
|
+
$('#list-pages a').each(function() {
|
|
269
|
+
if ($(this).attr('data-page-id') != curr) $('#' + $(this).attr('data-page-id')).remove();
|
|
270
|
+
})
|
|
271
|
+
},
|
|
272
|
+
complete: function(xhr) {
|
|
273
|
+
$('body').trigger('ajax:complete', xhr);
|
|
274
|
+
var btn = $('#submit_button');
|
|
275
|
+
if (btn) { btn.attr('disabled', false); }
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
else
|
|
281
|
+
{
|
|
282
|
+
// some pages aren't valid
|
|
283
|
+
$('#submit_message').html("Please make a payment");
|
|
284
|
+
$('#submit_message').show();
|
|
285
|
+
|
|
286
|
+
var btn = $('#submit_button'); if (btn) { btn.attr('disabled', false); }
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
|
|
290
|
+
// is page loaded? (useful for toggling enabled state of questions)
|
|
291
|
+
isPageLoaded : function(page)
|
|
292
|
+
{
|
|
293
|
+
return $('#' + page)[0] != null
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
})(jQuery);
|
|
299
|
+
|
|
300
|
+
$(function() {
|
|
301
|
+
fixGridColumnWidths();
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
function updateTotal(id) {
|
|
306
|
+
try {
|
|
307
|
+
total = 0;
|
|
308
|
+
$(".col_" + id ).each(function(e) {
|
|
309
|
+
total += Number(e.val());
|
|
310
|
+
});
|
|
311
|
+
$('#total_' + id).val(total);
|
|
312
|
+
} catch(e) {}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function submitToFrame(id, url)
|
|
316
|
+
{
|
|
317
|
+
form = $('<form method="post" action="'+url+'.js" endtype="multipart/form-data"></form>')
|
|
318
|
+
var csrf_token = $('meta[name=csrf-token]').attr('content'),
|
|
319
|
+
csrf_param = $('meta[name=csrf-param]').attr('content'),
|
|
320
|
+
dom_id = '#attachment_field_' + id,
|
|
321
|
+
metadata_input = '<input name="'+csrf_param+'" value="'+csrf_token+'" type="hidden" />',
|
|
322
|
+
file_field = '<input type="file" name="answers['+ id + ']>';
|
|
323
|
+
if ($(dom_id).val() == '') return;
|
|
324
|
+
form.hide()
|
|
325
|
+
.append(metadata_input)
|
|
326
|
+
.append(file_field)
|
|
327
|
+
.appendTo('body');
|
|
328
|
+
$(dom_id + "-spinner").show();
|
|
329
|
+
form.submit();
|
|
330
|
+
return false
|
|
331
|
+
}
|