dust-cms 0.0.05
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.md +3 -0
- data/Rakefile +5 -0
- data/app/assets/images/admin/blank.png +0 -0
- data/app/assets/images/admin/dust-letterpress.png +0 -0
- data/app/assets/images/admin/main-back.png +0 -0
- data/app/assets/images/admin/ui/delete-icon.png +0 -0
- data/app/assets/images/admin/ui/edit-icon.png +0 -0
- data/app/assets/images/admin/ui/handle.png +0 -0
- data/app/assets/images/admin/ui/icons.png +0 -0
- data/app/assets/images/admin/ui/index-icon.png +0 -0
- data/app/assets/images/admin/ui/new-icon.png +0 -0
- data/app/assets/images/entypo/entypo.eot +0 -0
- data/app/assets/images/entypo/entypo.svg +13 -0
- data/app/assets/images/entypo/entypo.ttf +0 -0
- data/app/assets/images/entypo/entypo.woff +0 -0
- data/app/assets/images/entypo-social/entypo-social.eot +0 -0
- data/app/assets/images/entypo-social/entypo-social.svg +13 -0
- data/app/assets/images/entypo-social/entypo-social.ttf +0 -0
- data/app/assets/images/entypo-social/entypo-social.woff +0 -0
- data/app/assets/images/fancybox/blank.gif +0 -0
- data/app/assets/images/fancybox/fancy_close.png +0 -0
- data/app/assets/images/fancybox/fancy_loading.png +0 -0
- data/app/assets/images/fancybox/fancy_nav_left.png +0 -0
- data/app/assets/images/fancybox/fancy_nav_right.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_e.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_n.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_ne.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_nw.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_s.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_se.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_sw.png +0 -0
- data/app/assets/images/fancybox/fancy_shadow_w.png +0 -0
- data/app/assets/images/fancybox/fancy_title_left.png +0 -0
- data/app/assets/images/fancybox/fancy_title_main.png +0 -0
- data/app/assets/images/fancybox/fancy_title_over.png +0 -0
- data/app/assets/images/fancybox/fancy_title_right.png +0 -0
- data/app/assets/images/fancybox/fancybox-x.png +0 -0
- data/app/assets/images/fancybox/fancybox-y.png +0 -0
- data/app/assets/images/fancybox/fancybox.png +0 -0
- data/app/assets/javascripts/cms/dust/defaults.js.coffee +31 -0
- data/app/assets/javascripts/cms/dust/gallery/photo.js.coffee +1 -0
- data/app/assets/javascripts/cms/dust/gallery/photo_view.js.coffee +21 -0
- data/app/assets/javascripts/cms/dust/gallery/photos.js.coffee +6 -0
- data/app/assets/javascripts/cms/dust/gallery/photos_view.js.coffee +12 -0
- data/app/assets/javascripts/cms/dust/gallery/router.js.coffee +14 -0
- data/app/assets/javascripts/cms/dust/gallery.js.coffee +31 -0
- data/app/assets/javascripts/cms/dust/nav.js.coffee +21 -0
- data/app/assets/javascripts/cms/dust/sections.js.coffee +21 -0
- data/app/assets/javascripts/cms/dust/sortables.js.coffee +64 -0
- data/app/assets/javascripts/cms/dust/window.js.coffee +11 -0
- data/app/assets/javascripts/cms/dust.js.coffee +19 -0
- data/app/assets/javascripts/cms/lib/backbone.js +42 -0
- data/app/assets/javascripts/cms/lib/fineuploader-3.0.js +71 -0
- data/app/assets/javascripts/cms/lib/handlebars.js +1920 -0
- data/app/assets/javascripts/cms/lib/spin.js +2 -0
- data/app/assets/javascripts/cms/lib/underscore.js +1 -0
- data/app/assets/javascripts/cms.js +14 -0
- data/app/assets/javascripts/core/jquery.form.js +785 -0
- data/app/assets/javascripts/core/jquery.html5.js +29 -0
- data/app/assets/javascripts/core/jquery.mousewheel-3.0.2.pack.js +13 -0
- data/app/assets/javascripts/core/jquery.placeholder.min.js +11 -0
- data/app/assets/javascripts/core/nestedsortables.js +429 -0
- data/app/assets/javascripts/core/serializelist.js +66 -0
- data/app/assets/javascripts/core/tipTip.js +21 -0
- data/app/assets/javascripts/core.js +4 -0
- data/app/assets/javascripts/front_end/application-main.js.coffee +27 -0
- data/app/assets/javascripts/front_end/map.js +34 -0
- data/app/assets/javascripts/front_end/video.js +4569 -0
- data/app/assets/javascripts/front_end.js +18 -0
- data/app/assets/stylesheets/cms/flash_messages.css.scss +17 -0
- data/app/assets/stylesheets/cms/footer.css.scss +12 -0
- data/app/assets/stylesheets/cms/forms.css.scss +67 -0
- data/app/assets/stylesheets/cms/gallery.css.scss +21 -0
- data/app/assets/stylesheets/cms/icons.css.scss +123 -0
- data/app/assets/stylesheets/cms/jquery-ui.custom.scss +6 -0
- data/app/assets/stylesheets/cms/layout.css.scss +162 -0
- data/app/assets/stylesheets/cms/lib/grid.css.scss +116 -0
- data/app/assets/stylesheets/cms/lib/mixins.css.scss +20 -0
- data/app/assets/stylesheets/cms/login.scss +12 -0
- data/app/assets/stylesheets/cms/main.old +155 -0
- data/app/assets/stylesheets/cms/nav.css.scss +73 -0
- data/app/assets/stylesheets/cms/sections.scss +17 -0
- data/app/assets/stylesheets/cms/sortables.scss +20 -0
- data/app/assets/stylesheets/cms.css.scss +30 -0
- data/app/assets/stylesheets/core/app/defaults.css.scss +556 -0
- data/app/assets/stylesheets/core/plugins/PIE.htc +96 -0
- data/app/assets/stylesheets/core/plugins/jquery-ui-1.8.5.custom.old +572 -0
- data/app/assets/stylesheets/core/plugins/jquery.fancybox-1.3.1.css +364 -0
- data/app/assets/stylesheets/core/plugins/skeleton.css +155 -0
- data/app/assets/stylesheets/core/plugins/tipTip.css +115 -0
- data/app/assets/stylesheets/core/plugins/uploadify.css +25 -0
- data/app/assets/stylesheets/core/reset/reset.css +211 -0
- data/app/assets/stylesheets/core/reset/text.css +86 -0
- data/app/assets/stylesheets/core.css.scss +14 -0
- data/app/assets/stylesheets/front_end/app/just-delete-me-and-start-over.css.scss +70 -0
- data/app/assets/stylesheets/front_end.css +14 -0
- data/app/controllers/authentication_controller.rb +30 -0
- data/app/controllers/dust/blocks_controller.rb +49 -0
- data/app/controllers/dust/contacts_controller.rb +89 -0
- data/app/controllers/dust/dashboard_controller.rb +26 -0
- data/app/controllers/dust/gallery/albums_controller.rb +49 -0
- data/app/controllers/dust/gallery/api/photos_controller.rb +28 -0
- data/app/controllers/dust/gallery/photos_controller.rb +47 -0
- data/app/controllers/dust/menu_items_controller.rb +51 -0
- data/app/controllers/dust/menus_controller.rb +47 -0
- data/app/controllers/dust/pages_controller.rb +52 -0
- data/app/controllers/dust/password_resets_controller.rb +48 -0
- data/app/controllers/dust/posts_controller.rb +47 -0
- data/app/controllers/dust/roles_controller.rb +47 -0
- data/app/controllers/dust/sessions_controller.rb +29 -0
- data/app/controllers/dust/site_wides_controller.rb +28 -0
- data/app/controllers/dust/sortable_controller.rb +17 -0
- data/app/controllers/dust/users_controller.rb +52 -0
- data/app/controllers/front_end/page_controller.rb +27 -0
- data/app/controllers/front_end/post_controller.rb +14 -0
- data/app/controllers/front_end/sitemap_controller.rb +11 -0
- data/app/controllers/front_end_controller.rb +18 -0
- data/app/helpers/error_messages_helper.rb +23 -0
- data/app/helpers/exceptions.rb +4 -0
- data/app/helpers/layout_helper.rb +28 -0
- data/app/helpers/misc_helper.rb +29 -0
- data/app/helpers/region_helper.rb +32 -0
- data/app/mailers/post_office.rb +39 -0
- data/app/models/ckeditor/asset.rb +7 -0
- data/app/models/ckeditor/attachment_file.rb +7 -0
- data/app/models/ckeditor/picture.rb +7 -0
- data/app/models/dust/block.rb +114 -0
- data/app/models/dust/builder/page.rb +84 -0
- data/app/models/dust/builder/site_wide.rb +50 -0
- data/app/models/dust/contact.rb +34 -0
- data/app/models/dust/gallery/album.rb +14 -0
- data/app/models/dust/gallery/photo.rb +23 -0
- data/app/models/dust/handlebar.rb +59 -0
- data/app/models/dust/map.rb +21 -0
- data/app/models/dust/menu/item_dependency.rb +66 -0
- data/app/models/dust/menu.rb +11 -0
- data/app/models/dust/menu_item.rb +64 -0
- data/app/models/dust/page.rb +52 -0
- data/app/models/dust/post.rb +39 -0
- data/app/models/dust/role.rb +9 -0
- data/app/models/dust/section.rb +11 -0
- data/app/models/dust/session.rb +28 -0
- data/app/models/dust/site_wide.rb +41 -0
- data/app/models/dust/sort.rb +52 -0
- data/app/models/dust/sortable_item.rb +21 -0
- data/app/models/dust/user.rb +49 -0
- data/app/uploaders/ckeditor_attachment_file_uploader.rb +42 -0
- data/app/uploaders/ckeditor_picture_uploader.rb +53 -0
- data/app/uploaders/gallery_photo_uploader.rb +52 -0
- data/app/uploaders/image_uploader.rb +51 -0
- data/app/uploaders/slide_image_uploader.rb +51 -0
- data/app/views/dust/blocks/_block.html.haml +20 -0
- data/app/views/dust/blocks/_form.html.haml +50 -0
- data/app/views/dust/blocks/_normal_block_content.html.haml +1 -0
- data/app/views/dust/blocks/_search.html.haml +4 -0
- data/app/views/dust/blocks/edit.html.haml +4 -0
- data/app/views/dust/blocks/index.html.haml +16 -0
- data/app/views/dust/blocks/new.html.haml +3 -0
- data/app/views/dust/contacts/_form.html.haml +37 -0
- data/app/views/dust/contacts/_import_csv.html.haml +8 -0
- data/app/views/dust/contacts/_instance.html.haml +13 -0
- data/app/views/dust/contacts/_search.html.haml +4 -0
- data/app/views/dust/contacts/edit.html.haml +2 -0
- data/app/views/dust/contacts/index.html.haml +17 -0
- data/app/views/dust/contacts/index.json.haml +6 -0
- data/app/views/dust/contacts/new.html.haml +3 -0
- data/app/views/dust/dashboard/_options.html.haml +6 -0
- data/app/views/dust/dashboard/show.html.haml +33 -0
- data/app/views/dust/dashboard/update.html.haml +6 -0
- data/app/views/dust/gallery/albums/_form.html.haml +52 -0
- data/app/views/dust/gallery/albums/_photo.html.haml +12 -0
- data/app/views/dust/gallery/albums/edit.html.haml +3 -0
- data/app/views/dust/gallery/albums/index.html.haml +18 -0
- data/app/views/dust/gallery/albums/new.html.haml +4 -0
- data/app/views/dust/gallery/albums/show.html.haml +2 -0
- data/app/views/dust/gallery/photos/_form.html.haml +26 -0
- data/app/views/dust/gallery/photos/edit.html.haml +3 -0
- data/app/views/dust/gallery/photos/index.html.haml +18 -0
- data/app/views/dust/gallery/photos/new.html.haml +4 -0
- data/app/views/dust/gallery/photos/show.json.jbuilder +5 -0
- data/app/views/dust/menu_items/_form.html.haml +24 -0
- data/app/views/dust/menu_items/_roots.html.haml +3 -0
- data/app/views/dust/menu_items/_search.html.haml +4 -0
- data/app/views/dust/menu_items/_tree.html.haml +11 -0
- data/app/views/dust/menu_items/edit.html.haml +2 -0
- data/app/views/dust/menu_items/index.html.haml +19 -0
- data/app/views/dust/menu_items/new.html.haml +2 -0
- data/app/views/dust/menus/_form.html.haml +39 -0
- data/app/views/dust/menus/edit.html.haml +3 -0
- data/app/views/dust/menus/index.html.haml +18 -0
- data/app/views/dust/menus/new.html.haml +4 -0
- data/app/views/dust/menus/show.html.haml +2 -0
- data/app/views/dust/pages/_form.html.haml +68 -0
- data/app/views/dust/pages/_search.html.haml +4 -0
- data/app/views/dust/pages/edit.html.haml +3 -0
- data/app/views/dust/pages/index.html.haml +16 -0
- data/app/views/dust/pages/new.html.haml +3 -0
- data/app/views/dust/password_resets/edit.html.haml +6 -0
- data/app/views/dust/password_resets/new.html.haml +10 -0
- data/app/views/dust/posts/_form.html.haml +39 -0
- data/app/views/dust/posts/edit.html.haml +3 -0
- data/app/views/dust/posts/index.html.haml +18 -0
- data/app/views/dust/posts/new.html.haml +4 -0
- data/app/views/dust/posts/show.html.haml +2 -0
- data/app/views/dust/roles/_form.html.haml +11 -0
- data/app/views/dust/roles/edit.html.haml +2 -0
- data/app/views/dust/roles/index.html.haml +14 -0
- data/app/views/dust/roles/new.html.haml +2 -0
- data/app/views/dust/sessions/_form.html.haml +18 -0
- data/app/views/dust/sessions/new.html.haml +2 -0
- data/app/views/dust/site_wides/new.html.haml +19 -0
- data/app/views/dust/slides/_form.html.haml +26 -0
- data/app/views/dust/slides/_search.html.haml +4 -0
- data/app/views/dust/slides/_slideshow.html.haml +12 -0
- data/app/views/dust/slides/edit.html.haml +5 -0
- data/app/views/dust/slides/index.html.haml +25 -0
- data/app/views/dust/slides/index.js.haml +2 -0
- data/app/views/dust/slides/new.html.haml +6 -0
- data/app/views/dust/slides/show.html.haml +15 -0
- data/app/views/dust/sortable/sort.js.coffee +10 -0
- data/app/views/dust/users/_form.html.haml +27 -0
- data/app/views/dust/users/_search.html.haml +4 -0
- data/app/views/dust/users/_user_bar.html.haml +10 -0
- data/app/views/dust/users/dashboard.html.haml +40 -0
- data/app/views/dust/users/edit.html.haml +2 -0
- data/app/views/dust/users/index.html.haml +16 -0
- data/app/views/dust/users/new.html.haml +2 -0
- data/app/views/front_end/page/_admin.html.haml +6 -0
- data/app/views/front_end/page/search.html.haml +9 -0
- data/app/views/front_end/page/show.html.haml +8 -0
- data/app/views/front_end/post/_admin.html.haml +7 -0
- data/app/views/front_end/post/show.html.haml +12 -0
- data/app/views/front_end/sitemap/index.html.haml +4 -0
- data/app/views/front_end/sitemap/index.xml.haml +9 -0
- data/app/views/layouts/app_partials/_analytics.html.haml +11 -0
- data/app/views/layouts/app_partials/_application_tree.html.haml +6 -0
- data/app/views/layouts/cms.html.haml +52 -0
- data/app/views/layouts/cms_partials/_nav.html.haml +5 -0
- data/app/views/layouts/front_end.html.haml +22 -0
- data/app/views/layouts/sessions.html.haml +19 -0
- data/app/views/post_office/contact_confirmation.html.haml +7 -0
- data/app/views/post_office/contact_request.html.haml +24 -0
- data/app/views/post_office/password_reset_instructions.html.haml +6 -0
- data/app/views/widgets/_contact_form.html.haml +20 -0
- data/app/views/widgets/_map.html.haml +16 -0
- data/app/views/widgets/_quick_contact_form.html.haml +10 -0
- data/app/views/widgets/_site_map.html.haml +7 -0
- data/app/views/widgets/_site_menu.html.haml +10 -0
- data/app/views/widgets/_slider.html.haml +0 -0
- data/app/views/widgets/_user_login.html.haml +13 -0
- data/app/views/widgets/galleries/_archive.html.haml +1 -0
- data/app/views/widgets/galleries/_show.html.haml +0 -0
- data/app/views/widgets/posts/_index.html.haml +1 -0
- data/app/views/widgets/posts/_show.html.haml +0 -0
- data/config/authorization_rules.rb +23 -0
- data/config/generators/templates/haml/scaffold/_form.html.haml +19 -0
- data/config/generators/templates/haml/scaffold/edit.html.haml +3 -0
- data/config/generators/templates/haml/scaffold/index.html.haml +18 -0
- data/config/generators/templates/haml/scaffold/new.html.haml +4 -0
- data/config/generators/templates/haml/scaffold/show.html.haml +2 -0
- data/config/generators/templates/rails/scaffold_controller/controller.rb +51 -0
- data/config/initializers/app_string_io.rb +12 -0
- data/config/initializers/ckeditor.rb +18 -0
- data/config/initializers/client_side_validations.rb +13 -0
- data/config/initializers/dust_config.rb +22 -0
- data/config/initializers/dust_core_reloader.rb +11 -0
- data/config/initializers/sorcery.rb +398 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/routes.rb +55 -0
- data/db/migrate/20101206025845_create_roles.rb +11 -0
- data/db/migrate/20110217212357_create_ckeditor_assets.rb +31 -0
- data/db/migrate/20110218000640_create_pages.rb +15 -0
- data/db/migrate/20110218000641_create_sections.rb +15 -0
- data/db/migrate/20110218002220_create_contacts.rb +22 -0
- data/db/migrate/20110218020608_create_menu_items.rb +21 -0
- data/db/migrate/20110507014158_create_blocks.rb +23 -0
- data/db/migrate/20121106195938_sorcery_core.rb +17 -0
- data/db/migrate/20121106195939_sorcery_remember_me.rb +15 -0
- data/db/migrate/20121106195940_sorcery_reset_password.rb +17 -0
- data/db/migrate/20121106195941_sorcery_activity_logging.rb +17 -0
- data/db/migrate/20121106200754_sorcery_user_activation.rb +17 -0
- data/db/migrate/20130220044031_create_site_wides.rb +11 -0
- data/db/migrate/20130220051658_create_menus.rb +11 -0
- data/db/migrate/20130223030136_create_albums.rb +13 -0
- data/db/migrate/20130223040911_create_photos.rb +15 -0
- data/db/migrate/20130223044553_create_posts.rb +15 -0
- data/lib/dust/engine.rb +18 -0
- data/lib/dust/utils.rb +14 -0
- data/lib/dust/version.rb +3 -0
- data/lib/dust-cms.rb +53 -0
- data/lib/tasks/dust_tasks.rake +51 -0
- data/lib/tasks/seed.rb +46 -0
- metadata +613 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
(function($){$.fn.html5form=function(options){$(this).each(function(){var defaults={async:true,method:$(this).attr('method'),responseDiv:null,labels:'show',colorOn:'#000000',colorOff:'#a1a1a1',action:$(this).attr('action'),messages:false,emptyMessage:false,emailMessage:false,allBrowsers:false};var opts=$.extend({},defaults,options);if(!opts.allBrowsers){if($.browser.webkit&&parseInt($.browser.version)>=533){return false;}}
|
2
|
+
var form=$(this);var required=new Array();var email=new Array();function fillInput(input){input.val(input.attr('placeholder'));input.css('color',opts.colorOff);}
|
3
|
+
if(opts.labels=='hide'){$(this).find('label').hide();}
|
4
|
+
$.each($('select',this),function(){$(this).css('color',opts.colorOff);$(this).change(function(){$(this).css('color',opts.colorOn);});});$.each($(':input:visible:not(:button, :submit, :radio, :checkbox, select)',form),function(i){fillInput($(this));if($.browser.webkit||$.browser.opera){if($(this).attr('required')){required[i]=$(this);}}
|
5
|
+
else{if($(this).attr('required')==''){required[i]=$(this);}}
|
6
|
+
$('input').filter(this).each(function(){if(this.getAttribute('type')=='email'){email[i]=$(this);}});$(this).bind('focus',function(ev){ev.preventDefault();if(this.value==$(this).attr('placeholder')){if(this.getAttribute('type')!='url'){$(this).attr('value','');}}
|
7
|
+
$(this).css('color',opts.colorOn);});$(this).bind('blur',function(ev){ev.preventDefault();if(this.value==''){fillInput($(this));}
|
8
|
+
else{if((this.getAttribute('type')=='url')&&($(this).val()==$(this).attr('placeholder'))){fillInput($(this));}}});$('textarea').filter(this).each(function(){if($(this).attr('maxlength')>0){$(this).keypress(function(ev){var cc=ev.charCode||ev.keyCode;if(cc==37||cc==39){return true;}
|
9
|
+
if(cc==8||cc==46){return true;}
|
10
|
+
if(this.value.length>=$(this).attr('maxlength')){return false;}
|
11
|
+
else{return true;}});}});});$.each($(':submit',this),function(){$(this).bind('click',function(ev){var emptyInput=null;var emailError=null;var input=$(':input:visible:not(:button, :submit, :radio, :checkbox, select)',form);$(required).each(function(key,value){if(value==undefined){return true;}
|
12
|
+
if(($(this).val()==$(this).attr('placeholder'))||($(this).val()=='')){emptyInput=$(this);if(opts.emptyMessage){$(opts.responseDiv).html('<p>'+opts.emptyMessage+'</p>');}
|
13
|
+
else if(opts.messages=='es'){$(opts.responseDiv).html('<p>El campo '+$(this).attr('title')+' es requerido.</p>');}
|
14
|
+
else if(opts.messages=='en'){$(opts.responseDiv).html('<p>The '+$(this).attr('title')+' field is required.</p>');}
|
15
|
+
else if(opts.messages=='it'){$(opts.responseDiv).html('<p>Il campo '+$(this).attr('title')+' é richiesto.</p>');}
|
16
|
+
else if(opts.messages=='de'){$(opts.responseDiv).html('<p>'+$(this).attr('title')+' ist ein Pflichtfeld.</p>');}
|
17
|
+
return false;}
|
18
|
+
return emptyInput;});$(email).each(function(key,value){if(value==undefined){return true;}
|
19
|
+
if($(this).val().search(/[\w-\.]{3,}@([\w-]{2,}\.)*([\w-]{2,}\.)[\w-]{2,4}/i)){emailError=$(this);return false;}
|
20
|
+
return emailError;});if(!emptyInput&&!emailError){$(input).each(function(){if($(this).val()==$(this).attr('placeholder')){$(this).val('');}});if(opts.async){var formData=$(form).serialize();$.ajax({url:opts.action,type:opts.method,data:formData,success:function(data){if(opts.responseDiv){$(opts.responseDiv).html(data);}
|
21
|
+
$(input).val('');$.each(form[0],function(){fillInput($(this).not(':hidden, :button, :submit, :radio, :checkbox, select'));$('select',form).each(function(){$(this).css('color',opts.colorOff);$(this).children('option:eq(0)').attr('selected','selected');});$(':radio, :checkbox',form).removeAttr('checked');});}});}
|
22
|
+
else{$(form).submit();}}else{if(emptyInput){$(emptyInput).focus().select();}
|
23
|
+
else if(emailError){if(opts.emailMessage){$(opts.responseDiv).html('<p>'+opts.emailMessage+'</p>');}
|
24
|
+
else if(opts.messages=='es'){$(opts.responseDiv).html('<p>Ingrese una dirección de correo válida por favor.</p>');}
|
25
|
+
else if(opts.messages=='en'){$(opts.responseDiv).html('<p>Please type a valid email address.</p>');}
|
26
|
+
else if(opts.messages=='it'){$(opts.responseDiv).html("<p>L'indirizzo e-mail non é valido.</p>");}
|
27
|
+
else if(opts.messages=='de'){$(opts.responseDiv).html("<p>Bitte eine gültige E-Mail-Adresse eintragen.</p>");}
|
28
|
+
$(emailError).select();}else{alert('Unknown Error');}}
|
29
|
+
return false;});});});}})(jQuery);
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/*! Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
|
2
|
+
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
3
|
+
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
4
|
+
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
5
|
+
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
6
|
+
*
|
7
|
+
* Version: 3.0.2
|
8
|
+
*
|
9
|
+
* Requires: 1.2.2+
|
10
|
+
*/
|
11
|
+
|
12
|
+
(function(b){function d(a){var f=[].slice.call(arguments,1),e=0;a=b.event.fix(a||window.event);a.type="mousewheel";if(a.wheelDelta)e=a.wheelDelta/120;if(a.detail)e=-a.detail/3;f.unshift(a,e);return b.event.handle.apply(this,f)}var c=["DOMMouseScroll","mousewheel"];b.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],d,false);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],
|
13
|
+
d,false);else this.onmousewheel=null}};b.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/*
|
2
|
+
* Placeholder plugin for jQuery
|
3
|
+
* ---
|
4
|
+
* Copyright 2010, Daniel Stocks (http://webcloud.se)
|
5
|
+
* Released under the MIT, BSD, and GPL Licenses.
|
6
|
+
*/
|
7
|
+
|
8
|
+
(function(b){function d(a){this.input=a;a.attr("type")=="password"&&this.handlePassword();b(a[0].form).submit(function(){if(a.hasClass("placeholder")&&a[0].value==a.attr("placeholder"))a[0].value=""})}d.prototype={show:function(a){if(this.input[0].value===""||a&&this.valueIsPlaceholder()){if(this.isPassword)try{this.input[0].setAttribute("type","text")}catch(b){this.input.before(this.fakePassword.show()).hide()}this.input.addClass("placeholder");this.input[0].value=this.input.attr("placeholder")}},
|
9
|
+
hide:function(){if(this.valueIsPlaceholder()&&this.input.hasClass("placeholder")&&(this.input.removeClass("placeholder"),this.input[0].value="",this.isPassword)){try{this.input[0].setAttribute("type","password")}catch(a){}this.input.show();this.input[0].focus()}},valueIsPlaceholder:function(){return this.input[0].value==this.input.attr("placeholder")},handlePassword:function(){var a=this.input;a.attr("realType","password");this.isPassword=!0;if(b.browser.msie&&a[0].outerHTML){var c=b(a[0].outerHTML.replace(/type=(['"])?password\1/gi,
|
10
|
+
"type=$1text$1"));this.fakePassword=c.val(a.attr("placeholder")).addClass("placeholder").focus(function(){a.trigger("focus");b(this).hide()});b(a[0].form).submit(function(){c.remove();a.show()})}}};var e=!!("placeholder"in document.createElement("input"));b.fn.placeholder=function(){return e?this:this.each(function(){var a=b(this),c=new d(a);c.show(!0);a.focus(function(){c.hide()});a.blur(function(){c.show(!1)});b.browser.msie&&(b(window).load(function(){a.val()&&a.removeClass("placeholder");c.show(!0)}),
|
11
|
+
a.focus(function(){if(this.value==""){var a=this.createTextRange();a.collapse(!0);a.moveStart("character",0);a.select()}}))})}})(jQuery);
|
@@ -0,0 +1,429 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery UI Nested Sortable
|
3
|
+
* v 1.3.5 / 21 jun 2012
|
4
|
+
* http://mjsarfatti.com/code/nestedSortable
|
5
|
+
*
|
6
|
+
* Depends on:
|
7
|
+
* jquery.ui.sortable.js 1.8+
|
8
|
+
*
|
9
|
+
* Copyright (c) 2010-2012 Manuele J Sarfatti
|
10
|
+
* Licensed under the MIT License
|
11
|
+
* http://www.opensource.org/licenses/mit-license.php
|
12
|
+
*/
|
13
|
+
|
14
|
+
(function($) {
|
15
|
+
|
16
|
+
$.widget("mjs.nestedSortable", $.extend({}, $.ui.sortable.prototype, {
|
17
|
+
|
18
|
+
options: {
|
19
|
+
tabSize: 20,
|
20
|
+
disableNesting: 'mjs-nestedSortable-no-nesting',
|
21
|
+
errorClass: 'mjs-nestedSortable-error',
|
22
|
+
doNotClear: false,
|
23
|
+
listType: 'ol',
|
24
|
+
maxLevels: 0,
|
25
|
+
protectRoot: false,
|
26
|
+
rootID: null,
|
27
|
+
rtl: false,
|
28
|
+
isAllowed: function(item, parent) { return true; }
|
29
|
+
},
|
30
|
+
|
31
|
+
_create: function() {
|
32
|
+
this.element.data('sortable', this.element.data('nestedSortable'));
|
33
|
+
|
34
|
+
if (!this.element.is(this.options.listType))
|
35
|
+
throw new Error('nestedSortable: Please check the listType option is set to your actual list type');
|
36
|
+
|
37
|
+
return $.ui.sortable.prototype._create.apply(this, arguments);
|
38
|
+
},
|
39
|
+
|
40
|
+
destroy: function() {
|
41
|
+
this.element
|
42
|
+
.removeData("nestedSortable")
|
43
|
+
.unbind(".nestedSortable");
|
44
|
+
return $.ui.sortable.prototype.destroy.apply(this, arguments);
|
45
|
+
},
|
46
|
+
|
47
|
+
_mouseDrag: function(event) {
|
48
|
+
|
49
|
+
//Compute the helpers position
|
50
|
+
this.position = this._generatePosition(event);
|
51
|
+
this.positionAbs = this._convertPositionTo("absolute");
|
52
|
+
|
53
|
+
if (!this.lastPositionAbs) {
|
54
|
+
this.lastPositionAbs = this.positionAbs;
|
55
|
+
}
|
56
|
+
|
57
|
+
var o = this.options;
|
58
|
+
|
59
|
+
//Do scrolling
|
60
|
+
if(this.options.scroll) {
|
61
|
+
var scrolled = false;
|
62
|
+
if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {
|
63
|
+
|
64
|
+
if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
|
65
|
+
this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
|
66
|
+
else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
|
67
|
+
this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
|
68
|
+
|
69
|
+
if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
|
70
|
+
this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
|
71
|
+
else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
|
72
|
+
this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
|
73
|
+
|
74
|
+
} else {
|
75
|
+
|
76
|
+
if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
|
77
|
+
scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
|
78
|
+
else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
|
79
|
+
scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
|
80
|
+
|
81
|
+
if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
|
82
|
+
scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
|
83
|
+
else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
|
84
|
+
scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
|
85
|
+
|
86
|
+
}
|
87
|
+
|
88
|
+
if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
|
89
|
+
$.ui.ddmanager.prepareOffsets(this, event);
|
90
|
+
}
|
91
|
+
|
92
|
+
//Regenerate the absolute position used for position checks
|
93
|
+
this.positionAbs = this._convertPositionTo("absolute");
|
94
|
+
|
95
|
+
// Find the top offset before rearrangement,
|
96
|
+
var previousTopOffset = this.placeholder.offset().top;
|
97
|
+
|
98
|
+
//Set the helper position
|
99
|
+
if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
|
100
|
+
if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
|
101
|
+
|
102
|
+
//Rearrange
|
103
|
+
for (var i = this.items.length - 1; i >= 0; i--) {
|
104
|
+
|
105
|
+
//Cache variables and intersection, continue if no intersection
|
106
|
+
var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
|
107
|
+
if (!intersection) continue;
|
108
|
+
|
109
|
+
if(itemElement != this.currentItem[0] //cannot intersect with itself
|
110
|
+
&& this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
|
111
|
+
&& !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
|
112
|
+
&& (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)
|
113
|
+
//&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container
|
114
|
+
) {
|
115
|
+
|
116
|
+
$(itemElement).mouseenter();
|
117
|
+
|
118
|
+
this.direction = intersection == 1 ? "down" : "up";
|
119
|
+
|
120
|
+
if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
|
121
|
+
$(itemElement).mouseleave();
|
122
|
+
this._rearrange(event, item);
|
123
|
+
} else {
|
124
|
+
break;
|
125
|
+
}
|
126
|
+
|
127
|
+
// Clear emtpy ul's/ol's
|
128
|
+
this._clearEmpty(itemElement);
|
129
|
+
|
130
|
+
this._trigger("change", event, this._uiHash());
|
131
|
+
break;
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
var parentItem = (this.placeholder[0].parentNode.parentNode &&
|
136
|
+
$(this.placeholder[0].parentNode.parentNode).closest('.ui-sortable').length)
|
137
|
+
? $(this.placeholder[0].parentNode.parentNode)
|
138
|
+
: null,
|
139
|
+
level = this._getLevel(this.placeholder),
|
140
|
+
childLevels = this._getChildLevels(this.helper);
|
141
|
+
|
142
|
+
// To find the previous sibling in the list, keep backtracking until we hit a valid list item.
|
143
|
+
var previousItem = this.placeholder[0].previousSibling ? $(this.placeholder[0].previousSibling) : null;
|
144
|
+
if (previousItem != null) {
|
145
|
+
while (previousItem[0].nodeName.toLowerCase() != 'li' || previousItem[0] == this.currentItem[0] || previousItem[0] == this.helper[0]) {
|
146
|
+
if (previousItem[0].previousSibling) {
|
147
|
+
previousItem = $(previousItem[0].previousSibling);
|
148
|
+
} else {
|
149
|
+
previousItem = null;
|
150
|
+
break;
|
151
|
+
}
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
// To find the next sibling in the list, keep stepping forward until we hit a valid list item.
|
156
|
+
var nextItem = this.placeholder[0].nextSibling ? $(this.placeholder[0].nextSibling) : null;
|
157
|
+
if (nextItem != null) {
|
158
|
+
while (nextItem[0].nodeName.toLowerCase() != 'li' || nextItem[0] == this.currentItem[0] || nextItem[0] == this.helper[0]) {
|
159
|
+
if (nextItem[0].nextSibling) {
|
160
|
+
nextItem = $(nextItem[0].nextSibling);
|
161
|
+
} else {
|
162
|
+
nextItem = null;
|
163
|
+
break;
|
164
|
+
}
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
var newList = document.createElement(o.listType);
|
169
|
+
|
170
|
+
this.beyondMaxLevels = 0;
|
171
|
+
|
172
|
+
// If the item is moved to the left, send it to its parent's level unless there are siblings below it.
|
173
|
+
if (parentItem != null && nextItem == null &&
|
174
|
+
(o.rtl && (this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth()) ||
|
175
|
+
!o.rtl && (this.positionAbs.left < parentItem.offset().left))) {
|
176
|
+
parentItem.after(this.placeholder[0]);
|
177
|
+
this._clearEmpty(parentItem[0]);
|
178
|
+
this._trigger("change", event, this._uiHash());
|
179
|
+
}
|
180
|
+
// If the item is below a sibling and is moved to the right, make it a child of that sibling.
|
181
|
+
else if (previousItem != null &&
|
182
|
+
(o.rtl && (this.positionAbs.left + this.helper.outerWidth() < previousItem.offset().left + previousItem.outerWidth() - o.tabSize) ||
|
183
|
+
!o.rtl && (this.positionAbs.left > previousItem.offset().left + o.tabSize))) {
|
184
|
+
this._isAllowed(previousItem, level, level+childLevels+1);
|
185
|
+
if (!previousItem.children(o.listType).length) {
|
186
|
+
previousItem[0].appendChild(newList);
|
187
|
+
}
|
188
|
+
// If this item is being moved from the top, add it to the top of the list.
|
189
|
+
if (previousTopOffset && (previousTopOffset <= previousItem.offset().top)) {
|
190
|
+
previousItem.children(o.listType).prepend(this.placeholder);
|
191
|
+
}
|
192
|
+
// Otherwise, add it to the bottom of the list.
|
193
|
+
else {
|
194
|
+
previousItem.children(o.listType)[0].appendChild(this.placeholder[0]);
|
195
|
+
}
|
196
|
+
this._trigger("change", event, this._uiHash());
|
197
|
+
}
|
198
|
+
else {
|
199
|
+
this._isAllowed(parentItem, level, level+childLevels);
|
200
|
+
}
|
201
|
+
|
202
|
+
//Post events to containers
|
203
|
+
this._contactContainers(event);
|
204
|
+
|
205
|
+
//Interconnect with droppables
|
206
|
+
if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
|
207
|
+
|
208
|
+
//Call callbacks
|
209
|
+
this._trigger('sort', event, this._uiHash());
|
210
|
+
|
211
|
+
this.lastPositionAbs = this.positionAbs;
|
212
|
+
return false;
|
213
|
+
|
214
|
+
},
|
215
|
+
|
216
|
+
_mouseStop: function(event, noPropagation) {
|
217
|
+
|
218
|
+
// If the item is in a position not allowed, send it back
|
219
|
+
if (this.beyondMaxLevels) {
|
220
|
+
|
221
|
+
this.placeholder.removeClass(this.options.errorClass);
|
222
|
+
|
223
|
+
if (this.domPosition.prev) {
|
224
|
+
$(this.domPosition.prev).after(this.placeholder);
|
225
|
+
} else {
|
226
|
+
$(this.domPosition.parent).prepend(this.placeholder);
|
227
|
+
}
|
228
|
+
|
229
|
+
this._trigger("revert", event, this._uiHash());
|
230
|
+
|
231
|
+
}
|
232
|
+
|
233
|
+
// Clean last empty ul/ol
|
234
|
+
for (var i = this.items.length - 1; i >= 0; i--) {
|
235
|
+
var item = this.items[i].item[0];
|
236
|
+
this._clearEmpty(item);
|
237
|
+
}
|
238
|
+
|
239
|
+
$.ui.sortable.prototype._mouseStop.apply(this, arguments);
|
240
|
+
|
241
|
+
},
|
242
|
+
|
243
|
+
serialize: function(options) {
|
244
|
+
|
245
|
+
var o = $.extend({}, this.options, options),
|
246
|
+
items = this._getItemsAsjQuery(o && o.connected),
|
247
|
+
str = [];
|
248
|
+
|
249
|
+
$(items).each(function() {
|
250
|
+
var res = ($(o.item || this).attr(o.attribute || 'id') || '')
|
251
|
+
.match(o.expression || (/(.+)[-=_](.+)/)),
|
252
|
+
pid = ($(o.item || this).parent(o.listType)
|
253
|
+
.parent(o.items)
|
254
|
+
.attr(o.attribute || 'id') || '')
|
255
|
+
.match(o.expression || (/(.+)[-=_](.+)/));
|
256
|
+
|
257
|
+
if (res) {
|
258
|
+
str.push(((o.key || res[1]) + '[' + (o.key && o.expression ? res[1] : res[2]) + ']')
|
259
|
+
+ '='
|
260
|
+
+ (pid ? (o.key && o.expression ? pid[1] : pid[2]) : o.rootID));
|
261
|
+
}
|
262
|
+
});
|
263
|
+
|
264
|
+
if(!str.length && o.key) {
|
265
|
+
str.push(o.key + '=');
|
266
|
+
}
|
267
|
+
|
268
|
+
return str.join('&');
|
269
|
+
|
270
|
+
},
|
271
|
+
|
272
|
+
toHierarchy: function(options) {
|
273
|
+
|
274
|
+
var o = $.extend({}, this.options, options),
|
275
|
+
sDepth = o.startDepthCount || 0,
|
276
|
+
ret = [];
|
277
|
+
|
278
|
+
$(this.element).children(o.items).each(function () {
|
279
|
+
var level = _recursiveItems(this);
|
280
|
+
ret.push(level);
|
281
|
+
});
|
282
|
+
|
283
|
+
return ret;
|
284
|
+
|
285
|
+
function _recursiveItems(item) {
|
286
|
+
var id = ($(item).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
|
287
|
+
if (id) {
|
288
|
+
var currentItem = {"id" : id[2]};
|
289
|
+
if ($(item).children(o.listType).children(o.items).length > 0) {
|
290
|
+
currentItem.children = [];
|
291
|
+
$(item).children(o.listType).children(o.items).each(function() {
|
292
|
+
var level = _recursiveItems(this);
|
293
|
+
currentItem.children.push(level);
|
294
|
+
});
|
295
|
+
}
|
296
|
+
return currentItem;
|
297
|
+
}
|
298
|
+
}
|
299
|
+
},
|
300
|
+
|
301
|
+
toArray: function(options) {
|
302
|
+
|
303
|
+
var o = $.extend({}, this.options, options),
|
304
|
+
sDepth = o.startDepthCount || 0,
|
305
|
+
ret = [],
|
306
|
+
left = 2;
|
307
|
+
|
308
|
+
ret.push({
|
309
|
+
"item_id": o.rootID,
|
310
|
+
"parent_id": 'none',
|
311
|
+
"depth": sDepth,
|
312
|
+
"left": '1',
|
313
|
+
"right": ($(o.items, this.element).length + 1) * 2
|
314
|
+
});
|
315
|
+
|
316
|
+
$(this.element).children(o.items).each(function () {
|
317
|
+
left = _recursiveArray(this, sDepth + 1, left);
|
318
|
+
});
|
319
|
+
|
320
|
+
ret = ret.sort(function(a,b){ return (a.left - b.left); });
|
321
|
+
|
322
|
+
return ret;
|
323
|
+
|
324
|
+
function _recursiveArray(item, depth, left) {
|
325
|
+
|
326
|
+
var right = left + 1,
|
327
|
+
id,
|
328
|
+
pid;
|
329
|
+
|
330
|
+
if ($(item).children(o.listType).children(o.items).length > 0) {
|
331
|
+
depth ++;
|
332
|
+
$(item).children(o.listType).children(o.items).each(function () {
|
333
|
+
right = _recursiveArray($(this), depth, right);
|
334
|
+
});
|
335
|
+
depth --;
|
336
|
+
}
|
337
|
+
|
338
|
+
id = ($(item).attr(o.attribute || 'id')).match(o.expression || (/(.+)[-=_](.+)/));
|
339
|
+
|
340
|
+
if (depth === sDepth + 1) {
|
341
|
+
pid = o.rootID;
|
342
|
+
} else {
|
343
|
+
var parentItem = ($(item).parent(o.listType)
|
344
|
+
.parent(o.items)
|
345
|
+
.attr(o.attribute || 'id'))
|
346
|
+
.match(o.expression || (/(.+)[-=_](.+)/));
|
347
|
+
pid = parentItem[2];
|
348
|
+
}
|
349
|
+
|
350
|
+
if (id) {
|
351
|
+
ret.push({"item_id": id[2], "parent_id": pid, "depth": depth, "left": left, "right": right});
|
352
|
+
}
|
353
|
+
|
354
|
+
left = right + 1;
|
355
|
+
return left;
|
356
|
+
}
|
357
|
+
|
358
|
+
},
|
359
|
+
|
360
|
+
_clearEmpty: function(item) {
|
361
|
+
|
362
|
+
var emptyList = $(item).children(this.options.listType);
|
363
|
+
if (emptyList.length && !emptyList.children().length && !this.options.doNotClear) {
|
364
|
+
emptyList.remove();
|
365
|
+
}
|
366
|
+
|
367
|
+
},
|
368
|
+
|
369
|
+
_getLevel: function(item) {
|
370
|
+
|
371
|
+
var level = 1;
|
372
|
+
|
373
|
+
if (this.options.listType) {
|
374
|
+
var list = item.closest(this.options.listType);
|
375
|
+
while (list && list.length > 0 &&
|
376
|
+
!list.is('.ui-sortable')) {
|
377
|
+
level++;
|
378
|
+
list = list.parent().closest(this.options.listType);
|
379
|
+
}
|
380
|
+
}
|
381
|
+
|
382
|
+
return level;
|
383
|
+
},
|
384
|
+
|
385
|
+
_getChildLevels: function(parent, depth) {
|
386
|
+
var self = this,
|
387
|
+
o = this.options,
|
388
|
+
result = 0;
|
389
|
+
depth = depth || 0;
|
390
|
+
|
391
|
+
$(parent).children(o.listType).children(o.items).each(function (index, child) {
|
392
|
+
result = Math.max(self._getChildLevels(child, depth + 1), result);
|
393
|
+
});
|
394
|
+
|
395
|
+
return depth ? result + 1 : result;
|
396
|
+
},
|
397
|
+
|
398
|
+
_isAllowed: function(parentItem, level, levels) {
|
399
|
+
var o = this.options,
|
400
|
+
isRoot = $(this.domPosition.parent).hasClass('ui-sortable') ? true : false,
|
401
|
+
maxLevels = this.placeholder.closest('.ui-sortable').nestedSortable('option', 'maxLevels'); // this takes into account the maxLevels set to the recipient list
|
402
|
+
|
403
|
+
// Is the root protected?
|
404
|
+
// Are we trying to nest under a no-nest?
|
405
|
+
// Are we nesting too deep?
|
406
|
+
if (!o.isAllowed(this.currentItem, parentItem) ||
|
407
|
+
parentItem && parentItem.hasClass(o.disableNesting) ||
|
408
|
+
o.protectRoot && (parentItem == null && !isRoot || isRoot && level > 1)) {
|
409
|
+
this.placeholder.addClass(o.errorClass);
|
410
|
+
if (maxLevels < levels && maxLevels != 0) {
|
411
|
+
this.beyondMaxLevels = levels - maxLevels;
|
412
|
+
} else {
|
413
|
+
this.beyondMaxLevels = 1;
|
414
|
+
}
|
415
|
+
} else {
|
416
|
+
if (maxLevels < levels && maxLevels != 0) {
|
417
|
+
this.placeholder.addClass(o.errorClass);
|
418
|
+
this.beyondMaxLevels = levels - maxLevels;
|
419
|
+
} else {
|
420
|
+
this.placeholder.removeClass(o.errorClass);
|
421
|
+
this.beyondMaxLevels = 0;
|
422
|
+
}
|
423
|
+
}
|
424
|
+
}
|
425
|
+
|
426
|
+
}));
|
427
|
+
|
428
|
+
$.mjs.nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.nestedSortable.prototype.options);
|
429
|
+
})(jQuery);
|
@@ -0,0 +1,66 @@
|
|
1
|
+
/**
|
2
|
+
* jQuery Serialize List
|
3
|
+
* Copyright (c) 2009 Mike Botsko, Botsko.net LLC
|
4
|
+
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
|
+
* Copyright notice and license must remain intact for legal use
|
6
|
+
* Version .2
|
7
|
+
*
|
8
|
+
* Serialize an unordered or ordered list item. Optional ability
|
9
|
+
* to determine which attributes are included. The serialization
|
10
|
+
* will be read by PHP as a multidimensional array which you may
|
11
|
+
* use for saving state.
|
12
|
+
*
|
13
|
+
* http://github.com/botskonet/jquery.serialize-list
|
14
|
+
*/
|
15
|
+
(function($){
|
16
|
+
$.fn.serializelist = function(options) {
|
17
|
+
// Extend the configuration options with user-provided
|
18
|
+
var defaults = {
|
19
|
+
attributes: ['id', 'class'], // which html attributes should be sent?
|
20
|
+
allow_nest: true, // allow nested elements to be included
|
21
|
+
prepend: 'ul', // which query string param name should be used?
|
22
|
+
att_regex: false, // replacement regex to run on attr values
|
23
|
+
is_child: false // determine if we're serializing a child list
|
24
|
+
};
|
25
|
+
var opts = $.extend(defaults, options);
|
26
|
+
var serialStr = '';
|
27
|
+
if(!opts.is_child){ opts.prepend = '&'+opts.prepend; }
|
28
|
+
// Begin the core plugin
|
29
|
+
this.each(function() {
|
30
|
+
var li_count = 0;
|
31
|
+
$(this).children().each(function(){
|
32
|
+
if(opts.allow_nest || opts.attributes.length > 1){
|
33
|
+
for(att in opts.attributes){
|
34
|
+
val = att_rep(opts.attributes[att], $(this).attr(opts.attributes[att]));
|
35
|
+
serialStr += opts.prepend+'['+li_count+']['+opts.attributes[att]+']='+val;
|
36
|
+
}
|
37
|
+
} else {
|
38
|
+
val = att_rep(opts.attributes[0], $(this).attr(opts.attributes[0]));
|
39
|
+
serialStr += opts.prepend+'['+li_count+']='+val;
|
40
|
+
}
|
41
|
+
// append any children elements
|
42
|
+
if(opts.allow_nest){
|
43
|
+
var child_base = opts.prepend+'['+li_count+'][children]';
|
44
|
+
$(this).children().each(function(){
|
45
|
+
if(this.tagName == 'UL' || this.tagName == 'OL'){
|
46
|
+
serialStr += $(this).serializelist({'prepend': child_base, 'is_child': true});
|
47
|
+
}
|
48
|
+
});
|
49
|
+
}
|
50
|
+
li_count++;
|
51
|
+
});
|
52
|
+
function att_rep (att, val){
|
53
|
+
if(opts.att_regex){
|
54
|
+
for(x in opts.att_regex){
|
55
|
+
if(opts.att_regex[x].att == att){
|
56
|
+
return val.replace(opts.att_regex[x].regex, '');
|
57
|
+
}
|
58
|
+
}
|
59
|
+
} else {
|
60
|
+
return val;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
});
|
64
|
+
return(serialStr);
|
65
|
+
};
|
66
|
+
})(jQuery);
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/*
|
2
|
+
* TipTip
|
3
|
+
* Copyright 2010 Drew Wilson
|
4
|
+
* www.drewwilson.com
|
5
|
+
* code.drewwilson.com/entry/tiptip-jquery-plugin
|
6
|
+
*
|
7
|
+
* Version 1.3 - Updated: Mar. 23, 2010
|
8
|
+
*
|
9
|
+
* This Plug-In will create a custom tooltip to replace the default
|
10
|
+
* browser tooltip. It is extremely lightweight and very smart in
|
11
|
+
* that it detects the edges of the browser window and will make sure
|
12
|
+
* the tooltip stays within the current window size. As a result the
|
13
|
+
* tooltip will adjust itself to be displayed above, below, to the left
|
14
|
+
* or to the right depending on what is necessary to stay within the
|
15
|
+
* browser window. It is completely customizable as well via CSS.
|
16
|
+
*
|
17
|
+
* This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
|
18
|
+
* http://www.opensource.org/licenses/mit-license.php
|
19
|
+
* http://www.gnu.org/licenses/gpl.html
|
20
|
+
*/
|
21
|
+
(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);
|
@@ -0,0 +1,27 @@
|
|
1
|
+
jQuery.ajaxSetup beforeSend: (xhr) ->
|
2
|
+
xhr.setRequestHeader "Accept", "text/javascript"
|
3
|
+
|
4
|
+
$(document).ready ->
|
5
|
+
|
6
|
+
#Sub Menu/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
7
|
+
# side menu: show submenu
|
8
|
+
$("#nav ul li").hover (->
|
9
|
+
$(this).addClass "hover"
|
10
|
+
), ->
|
11
|
+
$(this).removeClass "hover"
|
12
|
+
|
13
|
+
#Fade In and Hide Flash Messages/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
14
|
+
$("#flash_notice,#flash_error,#status").fadeIn().delay(2000).fadeOut("slow")
|
15
|
+
|
16
|
+
#$(".tip").tipTip
|
17
|
+
#defaultPosition: "top"
|
18
|
+
#delay: 600
|
19
|
+
#fadeOut: 10
|
20
|
+
#edgeOffset: 8
|
21
|
+
|
22
|
+
#$(".slides").cycle
|
23
|
+
#timeout: 9000
|
24
|
+
#pause: true
|
25
|
+
#sync: true
|
26
|
+
|
27
|
+
#$("input[placeholder], textarea[placeholder]").placeholder()
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/*
|
2
|
+
document.load = gmap_init();
|
3
|
+
function gmap_init() {
|
4
|
+
|
5
|
+
geocoder = new google.maps.Geocoder();
|
6
|
+
geocoder.geocode( { 'address': address}, function(results, status) {
|
7
|
+
if (status == google.maps.GeocoderStatus.OK) {
|
8
|
+
map.setCenter(results[0].geometry.location);
|
9
|
+
var marker = new google.maps.Marker({
|
10
|
+
map: map,
|
11
|
+
position: results[0].geometry.location
|
12
|
+
});
|
13
|
+
|
14
|
+
google.maps.event.addListener(marker, 'click', function() {
|
15
|
+
infowindow.open(map, marker);
|
16
|
+
});
|
17
|
+
}
|
18
|
+
});
|
19
|
+
|
20
|
+
var myOptions = {
|
21
|
+
center: new google.maps.LatLng(-34.397, 150.644),
|
22
|
+
zoom: 13,
|
23
|
+
mapTypeId: google.maps.MapTypeId.ROADMAP
|
24
|
+
};
|
25
|
+
|
26
|
+
var map = new google.maps.Map(document.getElementById("map_canvas"),
|
27
|
+
myOptions);
|
28
|
+
|
29
|
+
var infowindow = new google.maps.InfoWindow({
|
30
|
+
content: content
|
31
|
+
});
|
32
|
+
|
33
|
+
}
|
34
|
+
*/
|