mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
Merge pull request #68 from jonfalcon/update-datepicker
Update datepicker
This commit is contained in:
@@ -1,10 +1,133 @@
|
||||
|
||||
/*jshint
|
||||
asi: true,
|
||||
unused: true,
|
||||
boss: true,
|
||||
loopfunc: true,
|
||||
eqnull: true
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
* Legacy browser support
|
||||
*/
|
||||
[].map||(Array.prototype.map=function(a,b){for(var c=this,d=c.length,e=new Array(d),f=0;d>f;f++)f in c&&(e[f]=a.call(b,c[f],f,c));return e}),[].filter||(Array.prototype.filter=function(a){if(null==this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments[1],f=0;c>f;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d}),[].indexOf||(Array.prototype.indexOf=function(a){if(null==this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!=d?d=0:0!==d&&1/0!=d&&d!=-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1});/*!
|
||||
|
||||
|
||||
// Map array support
|
||||
if ( ![].map ) {
|
||||
Array.prototype.map = function ( callback, self ) {
|
||||
var array = this, len = array.length, newArray = new Array( len )
|
||||
for ( var i = 0; i < len; i++ ) {
|
||||
if ( i in array ) {
|
||||
newArray[ i ] = callback.call( self, array[ i ], i, array )
|
||||
}
|
||||
}
|
||||
return newArray
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Filter array support
|
||||
if ( ![].filter ) {
|
||||
Array.prototype.filter = function( callback ) {
|
||||
if ( this == null ) throw new TypeError()
|
||||
var t = Object( this ), len = t.length >>> 0
|
||||
if ( typeof callback != 'function' ) throw new TypeError()
|
||||
var newArray = [], thisp = arguments[ 1 ]
|
||||
for ( var i = 0; i < len; i++ ) {
|
||||
if ( i in t ) {
|
||||
var val = t[ i ]
|
||||
if ( callback.call( thisp, val, i, t ) ) newArray.push( val )
|
||||
}
|
||||
}
|
||||
return newArray
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Index of array support
|
||||
if ( ![].indexOf ) {
|
||||
Array.prototype.indexOf = function( searchElement ) {
|
||||
if ( this == null ) throw new TypeError()
|
||||
var t = Object( this ), len = t.length >>> 0
|
||||
if ( len === 0 ) return -1
|
||||
var n = 0
|
||||
if ( arguments.length > 1 ) {
|
||||
n = Number( arguments[ 1 ] )
|
||||
if ( n != n ) {
|
||||
n = 0
|
||||
}
|
||||
else if ( n !== 0 && n != Infinity && n != -Infinity ) {
|
||||
n = ( n > 0 || -1 ) * Math.floor( Math.abs( n ) )
|
||||
}
|
||||
}
|
||||
if ( n >= len ) return -1
|
||||
var k = n >= 0 ? n : Math.max( len - Math.abs( n ), 0 )
|
||||
for ( ; k < len; k++ ) {
|
||||
if ( k in t && t[ k ] === searchElement ) return k
|
||||
}
|
||||
return -1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Cross-Browser Split 1.1.1
|
||||
* Copyright 2007-2012 Steven Levithan <stevenlevithan.com>
|
||||
* Available under the MIT License
|
||||
* http://blog.stevenlevithan.com/archives/cross-browser-split
|
||||
*/
|
||||
var nativeSplit=String.prototype.split,compliantExecNpcg=void 0===/()??/.exec("")[1];String.prototype.split=function(a,b){var c=this;if("[object RegExp]"!==Object.prototype.toString.call(a))return nativeSplit.call(c,a,b);var d,e,f,g,h=[],i=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.extended?"x":"")+(a.sticky?"y":""),j=0;for(a=new RegExp(a.source,i+"g"),c+="",compliantExecNpcg||(d=new RegExp("^"+a.source+"$(?!\\s)",i)),b=void 0===b?-1>>>0:b>>>0;(e=a.exec(c))&&(f=e.index+e[0].length,!(f>j&&(h.push(c.slice(j,e.index)),!compliantExecNpcg&&e.length>1&&e[0].replace(d,function(){for(var a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(e[a]=void 0)}),e.length>1&&e.index<c.length&&Array.prototype.push.apply(h,e.slice(1)),g=e[0].length,j=f,h.length>=b)));)a.lastIndex===e.index&&a.lastIndex++;return j===c.length?(g||!a.test(""))&&h.push(""):h.push(c.slice(j)),h.length>b?h.slice(0,b):h};
|
||||
var nativeSplit = String.prototype.split, compliantExecNpcg = /()??/.exec('')[1] === undefined
|
||||
String.prototype.split = function(separator, limit) {
|
||||
var str = this
|
||||
if (Object.prototype.toString.call(separator) !== '[object RegExp]') {
|
||||
return nativeSplit.call(str, separator, limit)
|
||||
}
|
||||
var output = [],
|
||||
flags = (separator.ignoreCase ? 'i' : '') +
|
||||
(separator.multiline ? 'm' : '') +
|
||||
(separator.extended ? 'x' : '') +
|
||||
(separator.sticky ? 'y' : ''),
|
||||
lastLastIndex = 0,
|
||||
separator2, match, lastIndex, lastLength
|
||||
separator = new RegExp(separator.source, flags + 'g')
|
||||
str += ''
|
||||
if (!compliantExecNpcg) {
|
||||
separator2 = new RegExp('^' + separator.source + '$(?!\\s)', flags)
|
||||
}
|
||||
limit = limit === undefined ? -1 >>> 0 : limit >>> 0
|
||||
while (match = separator.exec(str)) {
|
||||
lastIndex = match.index + match[0].length
|
||||
if (lastIndex > lastLastIndex) {
|
||||
output.push(str.slice(lastLastIndex, match.index))
|
||||
if (!compliantExecNpcg && match.length > 1) {
|
||||
match[0].replace(separator2, function () {
|
||||
for (var i = 1; i < arguments.length - 2; i++) {
|
||||
if (arguments[i] === undefined) {
|
||||
match[i] = undefined
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
if (match.length > 1 && match.index < str.length) {
|
||||
Array.prototype.push.apply(output, match.slice(1))
|
||||
}
|
||||
lastLength = match[0].length
|
||||
lastLastIndex = lastIndex
|
||||
if (output.length >= limit) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if (separator.lastIndex === match.index) {
|
||||
separator.lastIndex++
|
||||
}
|
||||
}
|
||||
if (lastLastIndex === str.length) {
|
||||
if (lastLength || !separator.test('')) {
|
||||
output.push('')
|
||||
}
|
||||
} else {
|
||||
output.push(str.slice(lastLastIndex))
|
||||
}
|
||||
return output.length > limit ? output.slice(0, limit) : output
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1158
-2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+109
-106
@@ -3,14 +3,14 @@
|
||||
class UM_Enqueue {
|
||||
|
||||
function __construct() {
|
||||
|
||||
|
||||
add_action('wp_head', array(&$this, 'wp_head'), 999); // high-priority
|
||||
|
||||
$priority = apply_filters( 'um_core_enqueue_priority', 0 );
|
||||
|
||||
$priority = apply_filters( 'um_core_enqueue_priority', 100 );
|
||||
add_action('wp_enqueue_scripts', array(&$this, 'wp_enqueue_scripts'), $priority );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Enqueue inline css globally
|
||||
***/
|
||||
@@ -18,7 +18,7 @@ class UM_Enqueue {
|
||||
$css = um_get_option('custom_css');
|
||||
if ( !$css ) return; ?><!-- ULTIMATE MEMBER INLINE CSS BEGIN --><style type="text/css"><?php print $this->minify( $css ); ?></style><!-- ULTIMATE MEMBER INLINE CSS END --><?php
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Minify css string
|
||||
***/
|
||||
@@ -31,34 +31,34 @@ class UM_Enqueue {
|
||||
$css = str_replace(': ',':', $css );
|
||||
return $css;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Enqueue scripts and styles
|
||||
***/
|
||||
function wp_enqueue_scripts() {
|
||||
global $ultimatemember;
|
||||
global $ultimatemember, $post;
|
||||
|
||||
$exclude_home = um_get_option('js_css_exlcude_home');
|
||||
if ( $exclude_home && ( is_home() || is_front_page() ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$exclude = um_get_option('js_css_exclude');
|
||||
if ( is_array( $exclude ) ) {
|
||||
array_filter( $exclude );
|
||||
}
|
||||
if ( $exclude && !is_admin() && is_array( $exclude ) ) {
|
||||
|
||||
|
||||
$c_url = $ultimatemember->permalinks->get_current_url( get_option('permalink_structure') );
|
||||
|
||||
|
||||
foreach( $exclude as $match ) {
|
||||
if ( strstr( $c_url, untrailingslashit( $match ) ) ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$include = um_get_option('js_css_include');
|
||||
if ( is_array( $include ) ) {
|
||||
array_filter( $include );
|
||||
@@ -80,88 +80,91 @@ class UM_Enqueue {
|
||||
}
|
||||
|
||||
if ( isset($force_load) && $force_load == false ) return;
|
||||
|
||||
|
||||
// enqueue styles
|
||||
if ( um_get_option('disable_minify') ) {
|
||||
|
||||
|
||||
$this->load_original();
|
||||
|
||||
|
||||
wp_localize_script( 'um_scripts', 'um_scripts', array(
|
||||
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
||||
'fileupload' => um_url . 'core/lib/upload/um-file-upload.php',
|
||||
'imageupload' => um_url . 'core/lib/upload/um-image-upload.php'
|
||||
) );
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
wp_register_script('um_minified', um_url . 'assets/js/um.min.js', array('jquery'), ultimatemember_version, true );
|
||||
wp_enqueue_script('um_minified');
|
||||
|
||||
|
||||
wp_localize_script( 'um_minified', 'um_scripts', array(
|
||||
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
||||
'fileupload' => um_url . 'core/lib/upload/um-file-upload.php',
|
||||
'imageupload' => um_url . 'core/lib/upload/um-image-upload.php'
|
||||
) );
|
||||
|
||||
|
||||
wp_register_style('um_minified', um_url . 'assets/css/um.min.css', '', ultimatemember_version, 'all' );
|
||||
wp_enqueue_style('um_minified');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// rtl style
|
||||
if ( is_rtl() ) {
|
||||
wp_register_style('um_rtl', um_url . 'assets/css/um.rtl.css', '', ultimatemember_version, 'all' );
|
||||
wp_enqueue_style('um_rtl');
|
||||
}
|
||||
|
||||
|
||||
// load a localized version for date/time
|
||||
$locale = get_locale();
|
||||
if ( $locale && file_exists( um_path . 'assets/js/pickadate/translations/' . $locale . '.js' ) ) {
|
||||
wp_register_script('um_datetime_locale', um_url . 'assets/js/pickadate/translations/' . $locale . '.js', '', ultimatemember_version, true );
|
||||
wp_enqueue_script('um_datetime_locale');
|
||||
}
|
||||
|
||||
|
||||
if(is_object($post) && has_shortcode($post->post_content,'ultimatemember')) {
|
||||
wp_dequeue_script('jquery-form');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @This will load original files (not minified)
|
||||
***/
|
||||
function load_original() {
|
||||
|
||||
|
||||
$this->load_google_charts();
|
||||
|
||||
|
||||
$this->load_fonticons();
|
||||
|
||||
|
||||
$this->load_selectjs();
|
||||
|
||||
|
||||
$this->load_modal();
|
||||
|
||||
|
||||
$this->load_css();
|
||||
|
||||
|
||||
$this->load_fileupload();
|
||||
|
||||
|
||||
$this->load_datetimepicker();
|
||||
|
||||
|
||||
$this->load_raty();
|
||||
|
||||
|
||||
$this->load_scrollto();
|
||||
|
||||
|
||||
$this->load_scrollbar();
|
||||
|
||||
$this->load_imagecrop();
|
||||
|
||||
|
||||
$this->load_masonry();
|
||||
|
||||
|
||||
$this->load_tipsy();
|
||||
|
||||
|
||||
$this->load_functions();
|
||||
|
||||
|
||||
$this->load_responsive();
|
||||
|
||||
|
||||
$this->load_customjs();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Include Google charts
|
||||
***/
|
||||
@@ -169,205 +172,205 @@ class UM_Enqueue {
|
||||
|
||||
wp_register_script('um_gchart', 'https://www.google.com/jsapi' );
|
||||
wp_enqueue_script('um_gchart');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load plugin css
|
||||
***/
|
||||
function load_css(){
|
||||
|
||||
|
||||
wp_register_style('um_styles', um_url . 'assets/css/um-styles.css' );
|
||||
wp_enqueue_style('um_styles');
|
||||
|
||||
|
||||
wp_register_style('um_members', um_url . 'assets/css/um-members.css' );
|
||||
wp_enqueue_style('um_members');
|
||||
|
||||
|
||||
wp_register_style('um_profile', um_url . 'assets/css/um-profile.css' );
|
||||
wp_enqueue_style('um_profile');
|
||||
|
||||
|
||||
wp_register_style('um_account', um_url . 'assets/css/um-account.css' );
|
||||
wp_enqueue_style('um_account');
|
||||
|
||||
|
||||
wp_register_style('um_misc', um_url . 'assets/css/um-misc.css' );
|
||||
wp_enqueue_style('um_misc');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load select-dropdowns JS
|
||||
***/
|
||||
function load_selectjs(){
|
||||
|
||||
|
||||
wp_register_script('um_select', um_url . 'assets/js/um-select.js', array('jquery') );
|
||||
wp_enqueue_script('um_select');
|
||||
|
||||
|
||||
wp_register_style('um_select', um_url . 'assets/css/um-select.css' );
|
||||
wp_enqueue_style('um_select');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load Fonticons
|
||||
***/
|
||||
function load_fonticons(){
|
||||
|
||||
|
||||
wp_register_style('um_fonticons_ii', um_url . 'assets/css/um-fonticons-ii.css' );
|
||||
wp_enqueue_style('um_fonticons_ii');
|
||||
|
||||
|
||||
wp_register_style('um_fonticons_fa', um_url . 'assets/css/um-fonticons-fa.css' );
|
||||
wp_enqueue_style('um_fonticons_fa');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load fileupload JS
|
||||
***/
|
||||
function load_fileupload() {
|
||||
|
||||
|
||||
wp_register_script('um_jquery_form', um_url . 'assets/js/um-jquery-form.js' );
|
||||
wp_enqueue_script('um_jquery_form');
|
||||
|
||||
|
||||
wp_register_script('um_fileupload', um_url . 'assets/js/um-fileupload.js' );
|
||||
wp_enqueue_script('um_fileupload');
|
||||
|
||||
|
||||
wp_register_style('um_fileupload', um_url . 'assets/css/um-fileupload.css' );
|
||||
wp_enqueue_style('um_fileupload');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load JS functions
|
||||
***/
|
||||
function load_functions(){
|
||||
|
||||
|
||||
wp_register_script('um_functions', um_url . 'assets/js/um-functions.js' );
|
||||
wp_enqueue_script('um_functions');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load custom JS
|
||||
***/
|
||||
function load_customjs(){
|
||||
|
||||
|
||||
wp_register_script('um_conditional', um_url . 'assets/js/um-conditional.js' );
|
||||
wp_enqueue_script('um_conditional');
|
||||
|
||||
|
||||
wp_register_script('um_scripts', um_url . 'assets/js/um-scripts.js' );
|
||||
wp_enqueue_script('um_scripts');
|
||||
|
||||
wp_register_script('um_members', um_url . 'assets/js/um-members.js' );
|
||||
wp_enqueue_script('um_members');
|
||||
|
||||
|
||||
wp_register_script('um_profile', um_url . 'assets/js/um-profile.js' );
|
||||
wp_enqueue_script('um_profile');
|
||||
|
||||
|
||||
wp_register_script('um_account', um_url . 'assets/js/um-account.js' );
|
||||
wp_enqueue_script('um_account');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load date & time picker
|
||||
***/
|
||||
function load_datetimepicker(){
|
||||
|
||||
|
||||
wp_register_script('um_datetime', um_url . 'assets/js/pickadate/picker.js' );
|
||||
wp_enqueue_script('um_datetime');
|
||||
|
||||
|
||||
wp_register_script('um_datetime_date', um_url . 'assets/js/pickadate/picker.date.js' );
|
||||
wp_enqueue_script('um_datetime_date');
|
||||
|
||||
|
||||
wp_register_script('um_datetime_time', um_url . 'assets/js/pickadate/picker.time.js' );
|
||||
wp_enqueue_script('um_datetime_time');
|
||||
|
||||
|
||||
wp_register_script('um_datetime_legacy', um_url . 'assets/js/pickadate/legacy.js' );
|
||||
wp_enqueue_script('um_datetime_legacy');
|
||||
|
||||
|
||||
wp_register_style('um_datetime', um_url . 'assets/css/pickadate/default.css' );
|
||||
wp_enqueue_style('um_datetime');
|
||||
|
||||
|
||||
wp_register_style('um_datetime_date', um_url . 'assets/css/pickadate/default.date.css' );
|
||||
wp_enqueue_style('um_datetime_date');
|
||||
|
||||
|
||||
wp_register_style('um_datetime_time', um_url . 'assets/css/pickadate/default.time.css' );
|
||||
wp_enqueue_style('um_datetime_time');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load scrollto
|
||||
***/
|
||||
function load_scrollto(){
|
||||
|
||||
|
||||
wp_register_script('um_scrollto', um_url . 'assets/js/um-scrollto.js' );
|
||||
wp_enqueue_script('um_scrollto');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load scrollbar
|
||||
***/
|
||||
function load_scrollbar(){
|
||||
|
||||
|
||||
wp_register_script('um_scrollbar', um_url . 'assets/js/um-scrollbar.js' );
|
||||
wp_enqueue_script('um_scrollbar');
|
||||
|
||||
|
||||
wp_register_style('um_scrollbar', um_url . 'assets/css/um-scrollbar.css' );
|
||||
wp_enqueue_style('um_scrollbar');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load rating
|
||||
***/
|
||||
function load_raty(){
|
||||
|
||||
|
||||
wp_register_script('um_raty', um_url . 'assets/js/um-raty.js' );
|
||||
wp_enqueue_script('um_raty');
|
||||
|
||||
|
||||
wp_register_style('um_raty', um_url . 'assets/css/um-raty.css' );
|
||||
wp_enqueue_style('um_raty');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load crop script
|
||||
***/
|
||||
function load_imagecrop(){
|
||||
|
||||
|
||||
wp_register_script('um_crop', um_url . 'assets/js/um-crop.js' );
|
||||
wp_enqueue_script('um_crop');
|
||||
|
||||
|
||||
wp_register_style('um_crop', um_url . 'assets/css/um-crop.css' );
|
||||
wp_enqueue_style('um_crop');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load masonry
|
||||
***/
|
||||
function load_masonry(){
|
||||
|
||||
|
||||
wp_register_script('um_masonry', um_url . 'assets/js/um-masonry.js' );
|
||||
wp_enqueue_script('um_masonry');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load tipsy
|
||||
***/
|
||||
function load_tipsy(){
|
||||
|
||||
|
||||
wp_register_script('um_tipsy', um_url . 'assets/js/um-tipsy.js' );
|
||||
wp_enqueue_script('um_tipsy');
|
||||
|
||||
|
||||
wp_register_style('um_tipsy', um_url . 'assets/css/um-tipsy.css' );
|
||||
wp_enqueue_style('um_tipsy');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load modal
|
||||
***/
|
||||
@@ -375,23 +378,23 @@ class UM_Enqueue {
|
||||
|
||||
wp_register_style('um_modal', um_url . 'assets/css/um-modal.css' );
|
||||
wp_enqueue_style('um_modal');
|
||||
|
||||
|
||||
wp_register_script('um_modal', um_url . 'assets/js/um-modal.js' );
|
||||
wp_enqueue_script('um_modal');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*** @Load responsive styles
|
||||
***/
|
||||
function load_responsive(){
|
||||
|
||||
|
||||
wp_register_script('um_responsive', um_url . 'assets/js/um-responsive.js' );
|
||||
wp_enqueue_script('um_responsive');
|
||||
|
||||
|
||||
wp_register_style('um_responsive', um_url . 'assets/css/um-responsive.css' );
|
||||
wp_enqueue_style('um_responsive');
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user