From c7bacb91f553aac894bacdd69a00776e7f82e728 Mon Sep 17 00:00:00 2001 From: ultimatemember Date: Sat, 20 Dec 2014 18:02:41 +0200 Subject: [PATCH] Improved load time --- admin/assets/css/um-admin-columns.css | 4 +- admin/assets/css/um-admin-misc.css | 15 +- admin/assets/img/logo.png | Bin 0 -> 6792 bytes admin/assets/img/logo_small.png | Bin 0 -> 9501 bytes .../ReduxFramework/ReduxCore/framework.php | 34 +- admin/core/um-admin-columns.php | 35 +- admin/core/um-admin-enqueue.php | 21 +- admin/core/um-admin-notices.php | 20 - admin/core/um-admin-redux.php | 2 +- admin/templates/about.php | 99 ++ admin/templates/about_header.php | 24 + admin/templates/start.php | 99 ++ admin/templates/welcome.php | 0 admin/um-admin-init.php | 11 + assets/css/um-styles.css | 4 + assets/js/um-fileupload.js | 2 +- assets/js/um-jquery-form.js | 1277 +++++++++++++++++ core/um-account.php | 2 +- core/um-actions-global.php | 12 + core/um-actions-login.php | 4 +- core/um-actions-register.php | 4 +- core/um-actions-tracking.php | 6 +- core/um-enqueue.php | 3 + core/um-fields.php | 2 +- core/um-files.php | 4 +- core/um-filters-avatars.php | 3 +- core/um-form.php | 9 +- core/um-global-functions.php | 48 - core/um-query.php | 2 +- core/um-rewrite.php | 1 - core/um-setup.php | 3 + core/um-short-functions.php | 54 +- core/um-taxonomies.php | 28 +- core/um-uninstall.php | 8 +- index.php | 12 +- um-config.php | 34 +- um-init.php | 10 +- 37 files changed, 1710 insertions(+), 186 deletions(-) create mode 100644 admin/assets/img/logo.png create mode 100644 admin/assets/img/logo_small.png create mode 100644 admin/templates/about.php create mode 100644 admin/templates/about_header.php create mode 100644 admin/templates/start.php delete mode 100644 admin/templates/welcome.php create mode 100644 assets/js/um-jquery-form.js delete mode 100644 core/um-global-functions.php diff --git a/admin/assets/css/um-admin-columns.css b/admin/assets/css/um-admin-columns.css index 6f0f02d7..5bac6216 100644 --- a/admin/assets/css/um-admin-columns.css +++ b/admin/assets/css/um-admin-columns.css @@ -3,7 +3,7 @@ -moz-osx-font-smoothing: grayscale; } -.um-admin.post-type-um_form .manage-column.column-id {width: 40px} +.um-admin.post-type-um_form .manage-column.column-id {width: 60px} .um-admin.post-type-um_form .manage-column.column-mode {width: 100px} .um-admin.post-type-um_form .manage-column.column-title {width: 200px} .um-admin.post-type-um_form .manage-column.column-shortcode {width: 200px} @@ -32,7 +32,7 @@ .um-admin.post-type-um_directory td.column-shortcode, .um-admin.post-type-um_directory td.column-id, .um-admin.post-type-um_role td.column-count -{color: #aaa;font-size: 14px;} +{font-size: 14px;} .um-admin.users-php td.column-um_actions {padding-top: 12px} diff --git a/admin/assets/css/um-admin-misc.css b/admin/assets/css/um-admin-misc.css index 48d22ab8..11e05f7d 100644 --- a/admin/assets/css/um-admin-misc.css +++ b/admin/assets/css/um-admin-misc.css @@ -1,5 +1,15 @@ /* - - Columns + - Welcome +*/ + +.um-badge { + color: #fff; + background: none !important; + background: #3ba1da url(../img/logo_small.png) no-repeat center 0px !important; +} + +/* + - General */ body.um-admin-modal-open { @@ -8,9 +18,6 @@ body.um-admin-modal-open { .um-admin #major-publishing-actions{background-color: #fff !important;border-top:0} -.um-admin .postbox h3 { -background: #f9f9f9; -} .um-admin .postbox h3 i { font-size: 1.3em !important; vertical-align: middle !important; diff --git a/admin/assets/img/logo.png b/admin/assets/img/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..98a578c71db985fddbff04ce8397296cf8e9e387 GIT binary patch literal 6792 zcmc(Ec{p2pySDCbTT$(96*ad-DHW};re?QlE~xk%_n<*-+O)EdEfKzIp>d+wXSuq-;?KB>wc#D7yZOomy1JygN22K zOJDENQx=vpg?}CAeqr9(0(3rOp4ff#to>P7IJy5i&aj}fuQG4)2WVRbn0dPd1VR0r zSsplfKXbmO?+JBve(DT$3i0i6)?i@~;L(5dz&v=8HVuh0Uk+j0tlQtNaqQP!9lWgd z>`b%|z#&OU8xtGnF?OaXnL7Cc;J0ZccjP<#B(3oZ1U#cOr&gU)+L%Jbw9ueCC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`B9)2|ZB-xmp^sGc~HuzxK z_i9#cLI17mqDBid6<)X3KR=+Lf`c7A69JXjir$2Tm67|*LHuTZ_GP0>TsKzLx`Ziq zVfHcssj@B8|3?DdAoKoTU9{MN;uSHuxe^QjhKI^e+eR1IY;-;~Y}oqLUCVc#cTO%GA1MD*8EcztUF(1m z%eJ-(;lJ8p0{{-Q4vl|EuKww?hBlDAWIr w_+QvzAQ^KrcRc=mFX4a2mCLkK)~hU@B6l6#jZb`-yGShh+QyHt4;^0q2bqaLBLDyZ literal 0 HcmV?d00001 diff --git a/admin/assets/img/logo_small.png b/admin/assets/img/logo_small.png new file mode 100644 index 0000000000000000000000000000000000000000..43b514bf07e3beb2d217080fc761aa8e483f6860 GIT binary patch literal 9501 zcmeHtWl&sAx9(uUEw~d15MXc%gTo-fEx0>@8OUHWI3xrJ!Gc4O;Lad{3{D`pySoPn zZh_>I_d9aWy|?QAIX};?>fOD2KWnXi*6Q86s(VFhYbq1s(c%FB0Kyk4VBLp0`ES8_ z^l+C%d%gZpp?T;k%L6Kh>GvKUaNSjmJpcfFvcCllkp7AK0WjdKZ{%sDp$@WjgYa70 zx!KtB!XfSt=m#Be&_feq?`h2phqyvLKyWFRe-NOD_TO$k7Uq8-o-R@>MjG183T`la zW)WUtUVav7JZ5HQNtm4jNEfX1Z{iP6QY=oMp6(z%J|7<+ULPS|H<%-zfVj9gAHN`< zpdil!g2w{^^|XfbKs{LhrR3lBfbBhOVb1QJ&TdfVzk020+`K%cSXllV`j6}1#tCu% z4?|Foe`EE)j}LC`&L_aj&-ecl@^p6i&*A+SslRXjCH4=ie;Jc}a1BTSW^e832Ge(Q zbCs6+>pSKb5Nk(!U3+Ugge2epiTKZvO8!*|(tK52)nGbL3P12J3&Mo zCOR7WTBa4rH-&-nO1h;l`asKrN>eDOu?|{=34WP@i;jDHjL4LncLTP>XOjmzAByRppTrD1XXlDOD+G`E?^;-|Q zzib$;hzG{B1H%yMhWnJCo{dzH?VK%P=$*ENy#7_Q5kk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bae4d20..9614712b 100644 --- a/admin/core/lib/ReduxFramework/ReduxCore/framework.php +++ b/admin/core/lib/ReduxFramework/ReduxCore/framework.php @@ -1299,6 +1299,9 @@ * @return void */ public function _options_page() { + + $um_admin = new UM_Admin_API(); + $this->import_export->in_field(); if ( $this->args['menu_type'] == 'submenu' ) { @@ -1307,7 +1310,11 @@ add_menu_page( __('Ultimate Member', $this->slug), __('Ultimate Member', $this->slug), 'manage_options', $this->slug, array(&$this, 'admin_page'), 'dashicons-admin-users', '50.78578'); - add_submenu_page( '_welcome_to_um', __('Welcome to Ultimate Member!', $this->slug), __('Welcome to Ultimate Member!', $this->slug), 'manage_options', $this->slug . '-welcome', array(&$this, 'admin_page') ); + foreach( $um_admin->about_tabs as $k => $tab ) { + + add_submenu_page( '_'. $k . '_um', sprintf(__('%s | Ultimate Member', $this->slug), $tab), sprintf(__('%s | Ultimate Member', $this->slug), $tab), 'manage_options', $this->slug . '-' . $k, array(&$this, 'admin_page') ); + + } add_submenu_page( $this->slug, __('Dashboard', $this->slug), __('Dashboard', $this->slug), 'manage_options', $this->slug, array(&$this, 'admin_page') ); @@ -1321,11 +1328,11 @@ add_submenu_page( $this->slug, __('Forms', $this->slug), __('Forms', $this->slug), 'manage_options', 'edit.php?post_type=um_form', '', '' ); - add_submenu_page( $this->slug, __('Roles', $this->slug), __('Roles', $this->slug), 'manage_options', 'edit.php?post_type=um_role', '', '' ); + add_submenu_page( $this->slug, __('Member Levels', $this->slug), __('Member Levels', $this->slug), 'manage_options', 'edit.php?post_type=um_role', '', '' ); + + add_submenu_page( $this->slug, __('Member Directories', $this->slug), __('Member Directories', $this->slug), 'manage_options', 'edit.php?post_type=um_directory', '', '' ); add_submenu_page( $this->slug, __('Members', $this->slug), __('Members', $this->slug), 'manage_options', 'users.php', '', '' ); - - add_submenu_page( $this->slug, __('Directories', $this->slug), __('Directories', $this->slug), 'manage_options', 'edit.php?post_type=um_directory', '', '' ); } else { $this->page = add_menu_page( @@ -4311,11 +4318,26 @@ public function admin_page(){ + $um_admin = new UM_Admin_API(); + $page = $_REQUEST['page']; - if ( $page == 'ultimatemember') - + if ( $page == 'ultimatemember' ) { include_once um_path . 'admin/templates/dashboard.php'; + } + + if ( strstr( $page, 'ultimatemember-' ) ) { + + $template = str_replace('ultimatemember-','',$page); + $file = um_path . 'admin/templates/'. $template . '.php'; + + if ( file_exists( $file ) ){ + include_once um_path . 'admin/templates/'. $template . '.php'; + } else { + echo '

' . __('Please create a team.php template in admin templates.','ultimatemember') . '

'; + } + + } } diff --git a/admin/core/um-admin-columns.php b/admin/core/um-admin-columns.php index aecae9c3..596d72fc 100644 --- a/admin/core/um-admin-columns.php +++ b/admin/core/um-admin-columns.php @@ -22,10 +22,10 @@ class UM_Admin_Columns { $admin = new UM_Admin_Metabox(); $new_columns['cb'] = ''; - $new_columns['id'] = __('ID'); + $new_columns['id'] = __('ID') . $admin->_tooltip( 'Unique ID for each form' ); $new_columns['title'] = __('Title'); - $new_columns['mode'] = __('Type'); - $new_columns['shortcode'] = __('Shortcode') . $admin->_tooltip( 'Copy this shortcode to any post/page to display the relevant form' ); + $new_columns['mode'] = __('Type') . $admin->_tooltip( 'This is the type of the form' ); + $new_columns['shortcode'] = __('Shortcode') . $admin->_tooltip( 'Use this shortcode to display the form' ); $new_columns['impressions'] = __('Impressions') . $admin->_tooltip( 'The total number of times this form has been viewed' ); $new_columns['conversions'] = __('Conversions') . $admin->_tooltip( 'The total number of conversions. e.g. Successful sign-ups' ); $new_columns['date'] = __('Date'); @@ -33,6 +33,23 @@ class UM_Admin_Columns { return $new_columns; } + + /*** + *** @Custom columns for Directory + ***/ + function manage_edit_um_directory_columns($columns) { + + $admin = new UM_Admin_Metabox(); + + $new_columns['cb'] = ''; + $new_columns['id'] = __('ID') . $admin->_tooltip( 'Unique ID for each form' ); + $new_columns['title'] = __('Title'); + $new_columns['shortcode'] = __('Shortcode') . $admin->_tooltip( 'Use this shortcode to display the member directory' ); + $new_columns['date'] = __('Date'); + + return $new_columns; + + } /*** *** @Display cusom columns for Form @@ -75,18 +92,6 @@ class UM_Admin_Columns { } } - - /*** - *** @Custom columns for Directory - ***/ - function manage_edit_um_directory_columns($columns) { - $new_columns['cb'] = ''; - $new_columns['id'] = __('ID'); - $new_columns['title'] = __('Title'); - $new_columns['shortcode'] = __('Shortcode'); - $new_columns['date'] = __('Date'); - return $new_columns; - } /*** *** @Display cusom columns for Directory diff --git a/admin/core/um-admin-enqueue.php b/admin/core/um-admin-enqueue.php index c9e16b69..5b5d27ba 100644 --- a/admin/core/um-admin-enqueue.php +++ b/admin/core/um-admin-enqueue.php @@ -12,10 +12,25 @@ class UM_Admin_Enqueue { add_filter('admin_body_class', array(&$this, 'admin_body_class'), 9 ); - add_filter( 'enter_title_here', array(&$this, 'enter_title_here') ); + add_filter('enter_title_here', array(&$this, 'enter_title_here') ); + add_filter('admin_footer_text', array(&$this, 'admin_footer_text') ); + } + /*** + *** @Show footer text + ***/ + function admin_footer_text() { + $copyright = sprintf(__('Thank you for creating with Ultimate Member and WordPress.','ultimatemember')); + + if ( um_get_option('admin_load_time') == 1 ) { + $copyright .= '
' . sprintf(__('%1$s queries made in %2$s seconds','ultimatemember'), get_num_queries(), timer_stop(0) ); + } + + return '' . $copyright . ''; + } + /*** *** @enter title placeholder ***/ @@ -42,8 +57,8 @@ class UM_Admin_Enqueue { if ( strstr($screen_id, 'um_form') ) $highlighted_id = 3; if ( strstr($screen_id, 'um_role') ) $highlighted_id = 4; - if ( strstr($screen_id, 'um_directory') ) $highlighted_id = 6; - if ( strstr($screen_id, 'user') || strstr($screen_id, 'profile') ) $highlighted_id = 5; + if ( strstr($screen_id, 'um_directory') ) $highlighted_id = 5; + if ( strstr($screen_id, 'user') || strstr($screen_id, 'profile') ) $highlighted_id = 6; if ( isset($highlighted_id) ) { ?> diff --git a/admin/core/um-admin-notices.php b/admin/core/um-admin-notices.php index 3c47a5d7..20446390 100644 --- a/admin/core/um-admin-notices.php +++ b/admin/core/um-admin-notices.php @@ -5,9 +5,6 @@ class UM_Admin_Notices { function __construct() { add_action('admin_notices', array(&$this, 'admin_notices')); - - add_action('admin_notices', array(&$this, 'um_admin_notices')); - } /*** @@ -47,21 +44,4 @@ class UM_Admin_Notices { } - /*** - *** @For custom-styled notices - ***/ - function um_admin_notices() { - - $notices = get_option('um_admin_notices'); - if ( $notices ) { - - foreach($notices as $notice){ - echo "
-
$notice
-
"; - } - - } - } - } \ No newline at end of file diff --git a/admin/core/um-admin-redux.php b/admin/core/um-admin-redux.php index 3386a451..a9cee43a 100644 --- a/admin/core/um-admin-redux.php +++ b/admin/core/um-admin-redux.php @@ -61,7 +61,7 @@ 'google_api_key' => '', // Must be defined to add google fonts to the typography module 'async_typography' => true, // Use a asynchronous font on the front end or font string - 'admin_bar' => true, // Show the panel pages on the admin bar + 'admin_bar' => false, // Show the panel pages on the admin bar 'global_variable' => '', // Set a different name for your global variable other than the opt_name 'dev_mode' => false, // Show the time the page took to load, etc 'customizer' => false, // Enable basic customizer support diff --git a/admin/templates/about.php b/admin/templates/about.php new file mode 100644 index 00000000..9cb27749 --- /dev/null +++ b/admin/templates/about.php @@ -0,0 +1,99 @@ +
+ + + +
+

Introducing Twenty Fifteen

+ + +
+
+

Our newest default theme, Twenty Fifteen, is a blog-focused theme designed for clarity.

+

Twenty Fifteen has flawless language support, with help from Google’s Noto font family.

+

The straightforward typography is readable on any screen size.

+

Your content always takes center stage, whether viewed on a phone, tablet, laptop, or desktop computer.

+
+
+ +
+
+ +
+
+ +
+ +
+

Distraction-free writing

+
+
+ +
+

Just write.

+

Sometimes, you just need to concentrate on putting your thoughts into words. Try turning on distraction-free writing mode. When you start typing, all the distractions will fade away, letting you focus solely on your writing. All your editing tools instantly return when you need them.

+
+
+ +
+ +
+

The Finer Points

+ +
+
+

Choose a language

+

Right now, WordPress 4.1 is already translated into 40 languages, with more always in progress. You can switch to any translation on the General Settings screen.

+
+ +
+

Vine embeds

+

Embedding videos from Vine is as simple as pasting a URL onto its own line in a post. See the full list of supported embeds.

+
+ +
+

Log out everywhere

+

If you’ve ever worried you forgot to sign out from a shared computer, you can now go to your profile and log out everywhere.

+
+ +
+

Plugin recommendations

+

The plugin installer suggests plugins for you to try. Recommendations are based on the plugins you and other users have installed.

+
+ +
+ +
+ +
+ +
+

Under the Hood

+ +
+
+

Complex Queries

+

Metadata, date, and term queries now support advanced conditional logic, like nested clauses and multiple operators — A AND ( B OR C ).

+ +

Customizer API

+

Expanded JavaScript APIs in the customizer enable a new media experience as well as dynamic and contextual controls, sections, and panels.

+
+
+

<title> tags in themes

+

add_theme_support( 'title-tag' ) tells WordPress to handle the complexities of document titles.

+ +

Developer Reference

+

Continued improvements to inline code documentation have made the developer reference more complete than ever.

+
+
+ +
+ + + +
+ +
\ No newline at end of file diff --git a/admin/templates/about_header.php b/admin/templates/about_header.php new file mode 100644 index 00000000..97f0cbc7 --- /dev/null +++ b/admin/templates/about_header.php @@ -0,0 +1,24 @@ + +

Welcome to Ultimate Member

+ +
Thank you for installing! Ultimate Member is a powerful community and membership plugin that allows you to create beautiful community and membership sites with WordPress.
+ +
Version
+ + \ No newline at end of file diff --git a/admin/templates/start.php b/admin/templates/start.php new file mode 100644 index 00000000..edf8b46d --- /dev/null +++ b/admin/templates/start.php @@ -0,0 +1,99 @@ +
+ + + +
+

Introducing Twenty Fifteen

+ + +
+
+

Our newest default theme, Twenty Fifteen, is a blog-focused theme designed for clarity.

+

Twenty Fifteen has flawless language support, with help from Google’s Noto font family.

+

The straightforward typography is readable on any screen size.

+

Your content always takes center stage, whether viewed on a phone, tablet, laptop, or desktop computer.

+
+
+ +
+
+ +
+
+ +
+ +
+

Distraction-free writing

+
+
+ +
+

Just write.

+

Sometimes, you just need to concentrate on putting your thoughts into words. Try turning on distraction-free writing mode. When you start typing, all the distractions will fade away, letting you focus solely on your writing. All your editing tools instantly return when you need them.

+
+
+ +
+ +
+

The Finer Points

+ +
+
+

Choose a language

+

Right now, WordPress 4.1 is already translated into 40 languages, with more always in progress. You can switch to any translation on the General Settings screen.

+
+ +
+

Vine embeds

+

Embedding videos from Vine is as simple as pasting a URL onto its own line in a post. See the full list of supported embeds.

+
+ +
+

Log out everywhere

+

If you’ve ever worried you forgot to sign out from a shared computer, you can now go to your profile and log out everywhere.

+
+ +
+

Plugin recommendations

+

The plugin installer suggests plugins for you to try. Recommendations are based on the plugins you and other users have installed.

+
+ +
+ +
+ +
+ +
+

Under the Hood

+ +
+
+

Complex Queries

+

Metadata, date, and term queries now support advanced conditional logic, like nested clauses and multiple operators — A AND ( B OR C ).

+ +

Customizer API

+

Expanded JavaScript APIs in the customizer enable a new media experience as well as dynamic and contextual controls, sections, and panels.

+
+
+

<title> tags in themes

+

add_theme_support( 'title-tag' ) tells WordPress to handle the complexities of document titles.

+ +

Developer Reference

+

Continued improvements to inline code documentation have made the developer reference more complete than ever.

+
+
+ +
+ + + +
+ +
\ No newline at end of file diff --git a/admin/templates/welcome.php b/admin/templates/welcome.php deleted file mode 100644 index e69de29b..00000000 diff --git a/admin/um-admin-init.php b/admin/um-admin-init.php index 89e7daab..70295881 100644 --- a/admin/um-admin-init.php +++ b/admin/um-admin-init.php @@ -8,6 +8,17 @@ class UM_Admin_API { add_action('admin_init', array(&$this, 'admin_init'), 0); + if ( !class_exists( 'ReduxFramework' ) && file_exists( um_path . 'admin/core/lib/ReduxFramework/ReduxCore/framework.php' ) ) { + require_once( um_path . 'admin/core/lib/ReduxFramework/ReduxCore/framework.php' ); + } + if ( file_exists ( um_path . 'admin/core/um-admin-redux.php' ) ) { + require_once( um_path . 'admin/core/um-admin-redux.php' ); + } + + + $this->about_tabs['about'] = 'About'; + $this->about_tabs['start'] = 'Getting Started'; + } /*** diff --git a/assets/css/um-styles.css b/assets/css/um-styles.css index 1c8fcb33..b6bd28c7 100644 --- a/assets/css/um-styles.css +++ b/assets/css/um-styles.css @@ -26,6 +26,10 @@ box-sizing: content-box; } +.um a:focus { + outline: 0 !important; +} + /* only in admin mode */ .um.um-in-admin { padding-top: 0; diff --git a/assets/js/um-fileupload.js b/assets/js/um-fileupload.js index c5e82d85..9f02a168 100644 --- a/assets/js/um-fileupload.js +++ b/assets/js/um-fileupload.js @@ -5,4 +5,4 @@ * Copyright (c) 2013 Ravishanker Kusuma * http://hayageek.com/ */ -(function(b){if(b.fn.ajaxForm==undefined){b.getScript("http://malsup.github.io/jquery.form.js")}var a={};a.fileapi=b("").get(0).files!==undefined;a.formdata=window.FormData!==undefined;b.fn.uploadFile=function(t){var r=b.extend({url:"",method:"POST",enctype:"multipart/form-data",formData:null,returnType:null,allowedTypes:"*",fileName:"file",formData:{},dynamicFormData:function(){return{}},maxFileSize:-1,maxFileCount:-1,multiple:true,dragDrop:true,autoSubmit:true,showCancel:true,showAbort:true,showDone:true,showDelete:false,showError:true,showStatusAfterSuccess:true,showStatusAfterError:true,showFileCounter:true,fileCounterStyle:"). ",showProgress:false,onSelect:function(s){return true},onSubmit:function(s,u){},onSuccess:function(u,s,v){},onError:function(v,s,u){},deleteCallback:false,afterUploadAll:false,uploadButtonClass:"upload",dragDropStr:"",abortStr:"Abort",cancelStr:"Cancel",deletelStr:"Delete",doneStr:"Done",multiDragErrorStr:"Multiple File Drag & Drop is not allowed.",extErrorStr:"",sizeErrorStr:"",uploadErrorStr:"Upload is not allowed",maxFileCountErrorStr:""},t);this.fileCounter=1;this.selectedFiles=0;this.fCounter=0;this.sCounter=0;this.tCounter=0;var d="upload-"+(new Date().getTime());this.formGroup=d;this.hide();this.errorLog=b("
");this.after(this.errorLog);this.responses=[];if(!a.formdata){r.dragDrop=false}if(!a.formdata){r.multiple=false}var m=this;var e=b("
"+b(this).html()+"
");b(e).addClass(r.uploadButtonClass);(function k(){if(b.fn.ajaxForm){if(r.dragDrop){var s=b('
');b(m).before(s);b(s).append(e);b(s).prepend(b(r.dragDropStr));f(m,r,s)}else{b(m).before(e)}q(m,d,r,e)}else{window.setTimeout(k,10)}})();this.startUpload=function(){b("."+this.formGroup).each(function(u,s){if(b(this).is("form")){b(this).submit()}})};this.stopUpload=function(){b(".upload-red").each(function(u,s){if(b(this).hasClass(m.formGroup)){b(this).click()}})};this.getResponses=function(){return this.responses};var g=false;function j(){if(r.afterUploadAll&&!g){g=true;(function s(){if(m.sCounter!=0&&(m.sCounter+m.fCounter==m.tCounter)){r.afterUploadAll(m);g=false}else{window.setTimeout(s,100)}})()}}function f(w,u,v){v.on("dragenter",function(s){s.stopPropagation();s.preventDefault();b(this).css("border","3px dashed #ddd")});v.on("dragover",function(s){s.stopPropagation();s.preventDefault()});v.on("drop",function(x){b(this).css("border","3px dashed #ddd");x.preventDefault();w.errorLog.html("");var s=x.originalEvent.dataTransfer.files;if(!u.multiple&&s.length>1){if(u.showError){b("
"+u.multiDragErrorStr+"
").appendTo(w.errorLog)}return}if(u.onSelect(s)==false){return}l(u,w,s)});b(document).on("dragenter",function(s){s.stopPropagation();s.preventDefault()});b(document).on("dragover",function(s){s.stopPropagation();s.preventDefault();v.css("border","3px dashed #ddd")});b(document).on("drop",function(s){s.stopPropagation();s.preventDefault();v.css("border","3px dashed #ddd")})}function i(s){var v="";var u=s/1024;if(parseInt(u)>1024){var w=u/1024;v=w.toFixed(2)+" MB"}else{v=u.toFixed(2)+" KB"}return v}function o(x){var y=[];if(jQuery.type(x)=="string"){y=x.split("&")}else{y=b.param(x).split("&")}var u=y.length;var s=[];var w,v;for(w=0;w"+H.extErrorStr+"").appendTo(B.errorLog)}continue}if(H.maxFileSize!=-1&&u[C].size>H.maxFileSize){if(H.showError){b("
"+H.sizeErrorStr+"
").appendTo(B.errorLog)}continue}if(H.maxFileCount!=-1&&B.selectedFiles>=H.maxFileCount){if(H.showError){b("
"+H.maxFileCountErrorStr+"
").appendTo(B.errorLog)}continue}B.selectedFiles++;var D=H;var w=new FormData();var A=H.fileName.replace("[]","");w.append(A,u[C]);var y=H.formData;if(y){var F=o(y);for(var z=0;z");v.appendTo("body");var x=[];x.push(u[C].name);n(v,D,E,x,B);B.fileCounter++}}function c(w,v,y){var x=v.allowedTypes.toLowerCase().split(",");var u=y.split(".").pop().toLowerCase();if(v.allowedTypes!="*"&&jQuery.inArray(u,x)<0){return false}return true}function h(u,w){if(u.showFileCounter){var v=b(".upload-filename").length;w.fileCounter=v+1;b(".upload-filename").each(function(A,y){var s=b(this).html().split(u.fileCounterStyle);var x=parseInt(s[0])-1;var z=v+u.fileCounterStyle+s[1];b(this).html(z);v--})}}function q(y,B,D,u){var A="ajax-upload-id-"+(new Date().getTime());var w=b("
");var v="";if(D.multiple){if(D.fileName.indexOf("[]")!=D.fileName.length-2){D.fileName+="[]"}v=""}var z=b(v).appendTo(w);z.change(function(){y.errorLog.html("");var K=D.allowedTypes.toLowerCase().split(",");var G=[];if(this.files){for(H=0;H"+D.extErrorStr+"").appendTo(y.errorLog)}return}F.push({name:I,size:"NA"});if(D.onSelect(F)==false){return}}h(D,y);u.unbind("click");w.hide();q(y,B,D,u);w.addClass(B);if(a.fileapi&&a.formdata){w.removeClass(B);var J=this.files;l(D,y,J)}else{var E="";for(var H=0;H"}else{E+=G[H]+"
"}y.fileCounter++}if(D.maxFileCount!=-1&&(y.selectedFiles+G.length)>D.maxFileCount){if(D.showError){b("
"+D.maxFileCountErrorStr+"
").appendTo(y.errorLog)}return}y.selectedFiles+=G.length;var s=new p(y,D);s.filename.html(E);n(w,D,s,G,y)}});w.css({margin:0,padding:0});var C=b(u).width()+10;if(C==10){C=120}var x=u.height()+10;if(x==10){x=35}u.css({position:"relative",overflow:"hidden",cursor:"default"});z.css({position:"absolute",cursor:"pointer",top:"0px",width:'100%',height:'34px',left:"0px","z-index":"100",opacity:"0.0",filter:"alpha(opacity=0)","-ms-filter":"alpha(opacity=0)","-khtml-opacity":"0.0","-moz-opacity":"0.0"});w.appendTo(u)}function p(v,u){this.statusbar=b("
");this.filename=b("
").appendTo(this.statusbar);this.progressDiv=b("
").appendTo(this.statusbar).hide();this.progressbar=b("
").appendTo(this.progressDiv);this.abort=b("
"+u.abortStr+"
").appendTo(this.statusbar).hide();this.cancel=b("
"+u.cancelStr+"
").appendTo(this.statusbar).hide();this.done=b("
"+u.doneStr+"
").appendTo(this.statusbar).hide();this.del=b("
"+u.deletelStr+"
").appendTo(this.statusbar).hide();v.errorLog.after(this.statusbar);return this}function n(z,y,u,w,A){var x=null;var v={cache:false,contentType:false,processData:false,forceSync:false,data:y.formData,formData:y.fileData,dataType:y.returnType,beforeSubmit:function(F,C,E){if(y.onSubmit.call(this,w)!=false){var B=y.dynamicFormData();if(B){var s=o(B);if(s){for(var D=0;D"+y.uploadErrorStr+"
");u.cancel.show();z.remove();u.cancel.click(function(){u.statusbar.remove()});return false},beforeSend:function(B,s){u.progressDiv.show();u.cancel.hide();u.done.hide();if(y.showAbort){u.abort.show();u.abort.click(function(){B.abort();A.selectedFiles-=w.length})}if(!a.formdata){u.progressbar.width("5%")}else{u.progressbar.width("1%")}},uploadProgress:function(E,s,D,C){if(C>98){C=98}var B=C+"%";if(C>1){u.progressbar.width(B)}if(y.showProgress){u.progressbar.html(B);u.progressbar.css("text-align","center")}},success:function(B,s,C){A.responses.push(B);u.progressbar.width("100%");if(y.showProgress){u.progressbar.html("100%");u.progressbar.css("text-align","center")}u.abort.hide();y.onSuccess.call(this,w,B,C);if(y.showStatusAfterSuccess){if(y.showDone){u.done.show();u.done.click(function(){u.statusbar.hide("slow");u.statusbar.remove()})}else{u.done.hide()}if(y.showDelete){u.del.show();u.del.click(function(){u.statusbar.hide().remove();if(y.deleteCallback){y.deleteCallback.call(this,B,u)}A.selectedFiles-=w.length;h(y,A)})}else{u.del.hide()}}else{u.statusbar.hide("slow");u.statusbar.remove()}z.remove();A.sCounter+=w.length},error:function(C,s,B){u.abort.hide();if(C.statusText=="abort"){u.statusbar.hide("slow").remove();h(y,A)}else{y.onError.call(this,w,s,B);if(y.showStatusAfterError){u.progressDiv.hide();u.statusbar.append("ERROR: "+B+"")}else{u.statusbar.hide();u.statusbar.remove()}A.selectedFiles-=w.length}z.remove();A.fCounter+=w.length}};if(y.autoSubmit){z.ajaxSubmit(v)}else{if(y.showCancel){u.cancel.show();u.cancel.click(function(){z.remove();u.statusbar.remove();A.selectedFiles-=w.length;h(y,A)})}z.ajaxForm(v)}}return this}}(jQuery)); \ No newline at end of file +(function(b){if(b.fn.ajaxForm==undefined){}var a={};a.fileapi=b("").get(0).files!==undefined;a.formdata=window.FormData!==undefined;b.fn.uploadFile=function(t){var r=b.extend({url:"",method:"POST",enctype:"multipart/form-data",formData:null,returnType:null,allowedTypes:"*",fileName:"file",formData:{},dynamicFormData:function(){return{}},maxFileSize:-1,maxFileCount:-1,multiple:true,dragDrop:true,autoSubmit:true,showCancel:true,showAbort:true,showDone:true,showDelete:false,showError:true,showStatusAfterSuccess:true,showStatusAfterError:true,showFileCounter:true,fileCounterStyle:"). ",showProgress:false,onSelect:function(s){return true},onSubmit:function(s,u){},onSuccess:function(u,s,v){},onError:function(v,s,u){},deleteCallback:false,afterUploadAll:false,uploadButtonClass:"upload",dragDropStr:"",abortStr:"Abort",cancelStr:"Cancel",deletelStr:"Delete",doneStr:"Done",multiDragErrorStr:"Multiple File Drag & Drop is not allowed.",extErrorStr:"",sizeErrorStr:"",uploadErrorStr:"Upload is not allowed",maxFileCountErrorStr:""},t);this.fileCounter=1;this.selectedFiles=0;this.fCounter=0;this.sCounter=0;this.tCounter=0;var d="upload-"+(new Date().getTime());this.formGroup=d;this.hide();this.errorLog=b("
");this.after(this.errorLog);this.responses=[];if(!a.formdata){r.dragDrop=false}if(!a.formdata){r.multiple=false}var m=this;var e=b("
"+b(this).html()+"
");b(e).addClass(r.uploadButtonClass);(function k(){if(b.fn.ajaxForm){if(r.dragDrop){var s=b('
');b(m).before(s);b(s).append(e);b(s).prepend(b(r.dragDropStr));f(m,r,s)}else{b(m).before(e)}q(m,d,r,e)}else{window.setTimeout(k,10)}})();this.startUpload=function(){b("."+this.formGroup).each(function(u,s){if(b(this).is("form")){b(this).submit()}})};this.stopUpload=function(){b(".upload-red").each(function(u,s){if(b(this).hasClass(m.formGroup)){b(this).click()}})};this.getResponses=function(){return this.responses};var g=false;function j(){if(r.afterUploadAll&&!g){g=true;(function s(){if(m.sCounter!=0&&(m.sCounter+m.fCounter==m.tCounter)){r.afterUploadAll(m);g=false}else{window.setTimeout(s,100)}})()}}function f(w,u,v){v.on("dragenter",function(s){s.stopPropagation();s.preventDefault();b(this).css("border","3px dashed #ddd")});v.on("dragover",function(s){s.stopPropagation();s.preventDefault()});v.on("drop",function(x){b(this).css("border","3px dashed #ddd");x.preventDefault();w.errorLog.html("");var s=x.originalEvent.dataTransfer.files;if(!u.multiple&&s.length>1){if(u.showError){b("
"+u.multiDragErrorStr+"
").appendTo(w.errorLog)}return}if(u.onSelect(s)==false){return}l(u,w,s)});b(document).on("dragenter",function(s){s.stopPropagation();s.preventDefault()});b(document).on("dragover",function(s){s.stopPropagation();s.preventDefault();v.css("border","3px dashed #ddd")});b(document).on("drop",function(s){s.stopPropagation();s.preventDefault();v.css("border","3px dashed #ddd")})}function i(s){var v="";var u=s/1024;if(parseInt(u)>1024){var w=u/1024;v=w.toFixed(2)+" MB"}else{v=u.toFixed(2)+" KB"}return v}function o(x){var y=[];if(jQuery.type(x)=="string"){y=x.split("&")}else{y=b.param(x).split("&")}var u=y.length;var s=[];var w,v;for(w=0;w"+H.extErrorStr+"").appendTo(B.errorLog)}continue}if(H.maxFileSize!=-1&&u[C].size>H.maxFileSize){if(H.showError){b("
"+H.sizeErrorStr+"
").appendTo(B.errorLog)}continue}if(H.maxFileCount!=-1&&B.selectedFiles>=H.maxFileCount){if(H.showError){b("
"+H.maxFileCountErrorStr+"
").appendTo(B.errorLog)}continue}B.selectedFiles++;var D=H;var w=new FormData();var A=H.fileName.replace("[]","");w.append(A,u[C]);var y=H.formData;if(y){var F=o(y);for(var z=0;z");v.appendTo("body");var x=[];x.push(u[C].name);n(v,D,E,x,B);B.fileCounter++}}function c(w,v,y){var x=v.allowedTypes.toLowerCase().split(",");var u=y.split(".").pop().toLowerCase();if(v.allowedTypes!="*"&&jQuery.inArray(u,x)<0){return false}return true}function h(u,w){if(u.showFileCounter){var v=b(".upload-filename").length;w.fileCounter=v+1;b(".upload-filename").each(function(A,y){var s=b(this).html().split(u.fileCounterStyle);var x=parseInt(s[0])-1;var z=v+u.fileCounterStyle+s[1];b(this).html(z);v--})}}function q(y,B,D,u){var A="ajax-upload-id-"+(new Date().getTime());var w=b("
");var v="";if(D.multiple){if(D.fileName.indexOf("[]")!=D.fileName.length-2){D.fileName+="[]"}v=""}var z=b(v).appendTo(w);z.change(function(){y.errorLog.html("");var K=D.allowedTypes.toLowerCase().split(",");var G=[];if(this.files){for(H=0;H"+D.extErrorStr+"").appendTo(y.errorLog)}return}F.push({name:I,size:"NA"});if(D.onSelect(F)==false){return}}h(D,y);u.unbind("click");w.hide();q(y,B,D,u);w.addClass(B);if(a.fileapi&&a.formdata){w.removeClass(B);var J=this.files;l(D,y,J)}else{var E="";for(var H=0;H"}else{E+=G[H]+"
"}y.fileCounter++}if(D.maxFileCount!=-1&&(y.selectedFiles+G.length)>D.maxFileCount){if(D.showError){b("
"+D.maxFileCountErrorStr+"
").appendTo(y.errorLog)}return}y.selectedFiles+=G.length;var s=new p(y,D);s.filename.html(E);n(w,D,s,G,y)}});w.css({margin:0,padding:0});var C=b(u).width()+10;if(C==10){C=120}var x=u.height()+10;if(x==10){x=35}u.css({position:"relative",overflow:"hidden",cursor:"default"});z.css({position:"absolute",cursor:"pointer",top:"0px",width:'100%',height:'34px',left:"0px","z-index":"100",opacity:"0.0",filter:"alpha(opacity=0)","-ms-filter":"alpha(opacity=0)","-khtml-opacity":"0.0","-moz-opacity":"0.0"});w.appendTo(u)}function p(v,u){this.statusbar=b("
");this.filename=b("
").appendTo(this.statusbar);this.progressDiv=b("
").appendTo(this.statusbar).hide();this.progressbar=b("
").appendTo(this.progressDiv);this.abort=b("
"+u.abortStr+"
").appendTo(this.statusbar).hide();this.cancel=b("
"+u.cancelStr+"
").appendTo(this.statusbar).hide();this.done=b("
"+u.doneStr+"
").appendTo(this.statusbar).hide();this.del=b("
"+u.deletelStr+"
").appendTo(this.statusbar).hide();v.errorLog.after(this.statusbar);return this}function n(z,y,u,w,A){var x=null;var v={cache:false,contentType:false,processData:false,forceSync:false,data:y.formData,formData:y.fileData,dataType:y.returnType,beforeSubmit:function(F,C,E){if(y.onSubmit.call(this,w)!=false){var B=y.dynamicFormData();if(B){var s=o(B);if(s){for(var D=0;D"+y.uploadErrorStr+"
");u.cancel.show();z.remove();u.cancel.click(function(){u.statusbar.remove()});return false},beforeSend:function(B,s){u.progressDiv.show();u.cancel.hide();u.done.hide();if(y.showAbort){u.abort.show();u.abort.click(function(){B.abort();A.selectedFiles-=w.length})}if(!a.formdata){u.progressbar.width("5%")}else{u.progressbar.width("1%")}},uploadProgress:function(E,s,D,C){if(C>98){C=98}var B=C+"%";if(C>1){u.progressbar.width(B)}if(y.showProgress){u.progressbar.html(B);u.progressbar.css("text-align","center")}},success:function(B,s,C){A.responses.push(B);u.progressbar.width("100%");if(y.showProgress){u.progressbar.html("100%");u.progressbar.css("text-align","center")}u.abort.hide();y.onSuccess.call(this,w,B,C);if(y.showStatusAfterSuccess){if(y.showDone){u.done.show();u.done.click(function(){u.statusbar.hide("slow");u.statusbar.remove()})}else{u.done.hide()}if(y.showDelete){u.del.show();u.del.click(function(){u.statusbar.hide().remove();if(y.deleteCallback){y.deleteCallback.call(this,B,u)}A.selectedFiles-=w.length;h(y,A)})}else{u.del.hide()}}else{u.statusbar.hide("slow");u.statusbar.remove()}z.remove();A.sCounter+=w.length},error:function(C,s,B){u.abort.hide();if(C.statusText=="abort"){u.statusbar.hide("slow").remove();h(y,A)}else{y.onError.call(this,w,s,B);if(y.showStatusAfterError){u.progressDiv.hide();u.statusbar.append("ERROR: "+B+"")}else{u.statusbar.hide();u.statusbar.remove()}A.selectedFiles-=w.length}z.remove();A.fCounter+=w.length}};if(y.autoSubmit){z.ajaxSubmit(v)}else{if(y.showCancel){u.cancel.show();u.cancel.click(function(){z.remove();u.statusbar.remove();A.selectedFiles-=w.length;h(y,A)})}z.ajaxForm(v)}}return this}}(jQuery)); \ No newline at end of file diff --git a/assets/js/um-jquery-form.js b/assets/js/um-jquery-form.js new file mode 100644 index 00000000..591ad6f1 --- /dev/null +++ b/assets/js/um-jquery-form.js @@ -0,0 +1,1277 @@ +/*! + * jQuery Form Plugin + * version: 3.51.0-2014.06.20 + * Requires jQuery v1.5 or later + * Copyright (c) 2014 M. Alsup + * Examples and documentation at: http://malsup.com/jquery/form/ + * Project repository: https://github.com/malsup/form + * Dual licensed under the MIT and GPL licenses. + * https://github.com/malsup/form#copyright-and-license + */ +/*global ActiveXObject */ + +// AMD support +(function (factory) { + "use strict"; + if (typeof define === 'function' && define.amd) { + // using AMD; register as anon module + define(['jquery'], factory); + } else { + // no AMD; invoke directly + factory( (typeof(jQuery) != 'undefined') ? jQuery : window.Zepto ); + } +} + +(function($) { +"use strict"; + +/* + Usage Note: + ----------- + Do not use both ajaxSubmit and ajaxForm on the same form. These + functions are mutually exclusive. Use ajaxSubmit if you want + to bind your own submit handler to the form. For example, + + $(document).ready(function() { + $('#myForm').on('submit', function(e) { + e.preventDefault(); // <-- important + $(this).ajaxSubmit({ + target: '#output' + }); + }); + }); + + Use ajaxForm when you want the plugin to manage all the event binding + for you. For example, + + $(document).ready(function() { + $('#myForm').ajaxForm({ + target: '#output' + }); + }); + + You can also use ajaxForm with delegation (requires jQuery v1.7+), so the + form does not have to exist when you invoke ajaxForm: + + $('#myForm').ajaxForm({ + delegation: true, + target: '#output' + }); + + When using ajaxForm, the ajaxSubmit function will be invoked for you + at the appropriate time. +*/ + +/** + * Feature detection + */ +var feature = {}; +feature.fileapi = $("").get(0).files !== undefined; +feature.formdata = window.FormData !== undefined; + +var hasProp = !!$.fn.prop; + +// attr2 uses prop when it can but checks the return type for +// an expected string. this accounts for the case where a form +// contains inputs with names like "action" or "method"; in those +// cases "prop" returns the element +$.fn.attr2 = function() { + if ( ! hasProp ) { + return this.attr.apply(this, arguments); + } + var val = this.prop.apply(this, arguments); + if ( ( val && val.jquery ) || typeof val === 'string' ) { + return val; + } + return this.attr.apply(this, arguments); +}; + +/** + * ajaxSubmit() provides a mechanism for immediately submitting + * an HTML form using AJAX. + */ +$.fn.ajaxSubmit = function(options) { + /*jshint scripturl:true */ + + // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) + if (!this.length) { + log('ajaxSubmit: skipping submit process - no element selected'); + return this; + } + + var method, action, url, $form = this; + + if (typeof options == 'function') { + options = { success: options }; + } + else if ( options === undefined ) { + options = {}; + } + + method = options.type || this.attr2('method'); + action = options.url || this.attr2('action'); + + url = (typeof action === 'string') ? $.trim(action) : ''; + url = url || window.location.href || ''; + if (url) { + // clean url (don't include hash vaue) + url = (url.match(/^([^#]+)/)||[])[1]; + } + + options = $.extend(true, { + url: url, + success: $.ajaxSettings.success, + type: method || $.ajaxSettings.type, + iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' + }, options); + + // hook for manipulating the form data before it is extracted; + // convenient for use with rich editors like tinyMCE or FCKEditor + var veto = {}; + this.trigger('form-pre-serialize', [this, options, veto]); + if (veto.veto) { + log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); + return this; + } + + // provide opportunity to alter form data before it is serialized + if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { + log('ajaxSubmit: submit aborted via beforeSerialize callback'); + return this; + } + + var traditional = options.traditional; + if ( traditional === undefined ) { + traditional = $.ajaxSettings.traditional; + } + + var elements = []; + var qx, a = this.formToArray(options.semantic, elements); + if (options.data) { + options.extraData = options.data; + qx = $.param(options.data, traditional); + } + + // give pre-submit callback an opportunity to abort the submit + if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { + log('ajaxSubmit: submit aborted via beforeSubmit callback'); + return this; + } + + // fire vetoable 'validate' event + this.trigger('form-submit-validate', [a, this, options, veto]); + if (veto.veto) { + log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); + return this; + } + + var q = $.param(a, traditional); + if (qx) { + q = ( q ? (q + '&' + qx) : qx ); + } + if (options.type.toUpperCase() == 'GET') { + options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; + options.data = null; // data is null for 'get' + } + else { + options.data = q; // data is the query string for 'post' + } + + var callbacks = []; + if (options.resetForm) { + callbacks.push(function() { $form.resetForm(); }); + } + if (options.clearForm) { + callbacks.push(function() { $form.clearForm(options.includeHidden); }); + } + + // perform a load on the target only if dataType is not provided + if (!options.dataType && options.target) { + var oldSuccess = options.success || function(){}; + callbacks.push(function(data) { + var fn = options.replaceTarget ? 'replaceWith' : 'html'; + $(options.target)[fn](data).each(oldSuccess, arguments); + }); + } + else if (options.success) { + callbacks.push(options.success); + } + + options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg + var context = options.context || this ; // jQuery 1.4+ supports scope context + for (var i=0, max=callbacks.length; i < max; i++) { + callbacks[i].apply(context, [data, status, xhr || $form, $form]); + } + }; + + if (options.error) { + var oldError = options.error; + options.error = function(xhr, status, error) { + var context = options.context || this; + oldError.apply(context, [xhr, status, error, $form]); + }; + } + + if (options.complete) { + var oldComplete = options.complete; + options.complete = function(xhr, status) { + var context = options.context || this; + oldComplete.apply(context, [xhr, status, $form]); + }; + } + + // are there files to upload? + + // [value] (issue #113), also see comment: + // https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219 + var fileInputs = $('input[type=file]:enabled', this).filter(function() { return $(this).val() !== ''; }); + + var hasFileInputs = fileInputs.length > 0; + var mp = 'multipart/form-data'; + var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); + + var fileAPI = feature.fileapi && feature.formdata; + log("fileAPI :" + fileAPI); + var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI; + + var jqxhr; + + // options.iframe allows user to force iframe mode + // 06-NOV-09: now defaulting to iframe mode if file input is detected + if (options.iframe !== false && (options.iframe || shouldUseFrame)) { + // hack to fix Safari hang (thanks to Tim Molendijk for this) + // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d + if (options.closeKeepAlive) { + $.get(options.closeKeepAlive, function() { + jqxhr = fileUploadIframe(a); + }); + } + else { + jqxhr = fileUploadIframe(a); + } + } + else if ((hasFileInputs || multipart) && fileAPI) { + jqxhr = fileUploadXhr(a); + } + else { + jqxhr = $.ajax(options); + } + + $form.removeData('jqxhr').data('jqxhr', jqxhr); + + // clear element array + for (var k=0; k < elements.length; k++) { + elements[k] = null; + } + + // fire 'notify' event + this.trigger('form-submit-notify', [this, options]); + return this; + + // utility fn for deep serialization + function deepSerialize(extraData){ + var serialized = $.param(extraData, options.traditional).split('&'); + var len = serialized.length; + var result = []; + var i, part; + for (i=0; i < len; i++) { + // #252; undo param space replacement + serialized[i] = serialized[i].replace(/\+/g,' '); + part = serialized[i].split('='); + // #278; use array instead of object storage, favoring array serializations + result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]); + } + return result; + } + + // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz) + function fileUploadXhr(a) { + var formdata = new FormData(); + + for (var i=0; i < a.length; i++) { + formdata.append(a[i].name, a[i].value); + } + + if (options.extraData) { + var serializedData = deepSerialize(options.extraData); + for (i=0; i < serializedData.length; i++) { + if (serializedData[i]) { + formdata.append(serializedData[i][0], serializedData[i][1]); + } + } + } + + options.data = null; + + var s = $.extend(true, {}, $.ajaxSettings, options, { + contentType: false, + processData: false, + cache: false, + type: method || 'POST' + }); + + if (options.uploadProgress) { + // workaround because jqXHR does not expose upload property + s.xhr = function() { + var xhr = $.ajaxSettings.xhr(); + if (xhr.upload) { + xhr.upload.addEventListener('progress', function(event) { + var percent = 0; + var position = event.loaded || event.position; /*event.position is deprecated*/ + var total = event.total; + if (event.lengthComputable) { + percent = Math.ceil(position / total * 100); + } + options.uploadProgress(event, position, total, percent); + }, false); + } + return xhr; + }; + } + + s.data = null; + var beforeSend = s.beforeSend; + s.beforeSend = function(xhr, o) { + //Send FormData() provided by user + if (options.formData) { + o.data = options.formData; + } + else { + o.data = formdata; + } + if(beforeSend) { + beforeSend.call(this, xhr, o); + } + }; + return $.ajax(s); + } + + // private function for handling file uploads (hat tip to YAHOO!) + function fileUploadIframe(a) { + var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; + var deferred = $.Deferred(); + + // #341 + deferred.abort = function(status) { + xhr.abort(status); + }; + + if (a) { + // ensure that every serialized input is still enabled + for (i=0; i < elements.length; i++) { + el = $(elements[i]); + if ( hasProp ) { + el.prop('disabled', false); + } + else { + el.removeAttr('disabled'); + } + } + } + + s = $.extend(true, {}, $.ajaxSettings, options); + s.context = s.context || s; + id = 'jqFormIO' + (new Date().getTime()); + if (s.iframeTarget) { + $io = $(s.iframeTarget); + n = $io.attr2('name'); + if (!n) { + $io.attr2('name', id); + } + else { + id = n; + } + } + else { + $io = $('