From af6b2749759e3925b82f122864ebf3b4c4f9ad25 Mon Sep 17 00:00:00 2001 From: nikitasinelnikov Date: Tue, 22 Oct 2019 00:03:32 +0300 Subject: [PATCH] - localized um-raty.js script; --- assets/js/um-raty.js | 4 ++-- assets/js/um-raty.min.js | 2 +- includes/admin/core/class-admin-enqueue.php | 4 ++-- includes/core/class-access.php | 5 ----- languages/ultimate-member-en_US.po | 4 ++-- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/assets/js/um-raty.js b/assets/js/um-raty.js index 0899cb51..10e973d4 100644 --- a/assets/js/um-raty.js +++ b/assets/js/um-raty.js @@ -609,7 +609,7 @@ $.fn.um_raty.defaults = { cancel : false, cancelClass : 'raty-cancel', - cancelHint : 'Cancel this rating!', + cancelHint : wp.i18n.__( 'Cancel this rating!', 'ultimate-member' ), cancelOff : 'cancel-off.png', cancelOn : 'cancel-on.png', cancelPlace : 'left', @@ -620,7 +620,7 @@ iconRange : undefined, mouseout : undefined, mouseover : undefined, - noRatedMsg : 'Not rated yet!', + noRatedMsg : wp.i18n.__( 'Not rated yet!', 'ultimate-member' ), number : 5, numberMax : 20, path : undefined, diff --git a/assets/js/um-raty.min.js b/assets/js/um-raty.min.js index 8c80e3d1..8762e6d4 100644 --- a/assets/js/um-raty.min.js +++ b/assets/js/um-raty.min.js @@ -1 +1 @@ -!function(l){"use strict";var c={init:function(t){return this.each(function(){this.self=l(this),c.destroy.call(this.self),this.opt=l.extend(!0,{},l.fn.um_raty.defaults,t),c._adjustCallback.call(this),c._adjustNumber.call(this),"img"!==this.opt.starType&&c._adjustStarType.call(this),c._adjustPath.call(this),c._createStars.call(this),this.opt.cancel&&c._createCancel.call(this),this.opt.precision&&c._adjustPrecision.call(this),c._createScore.call(this),c._apply.call(this,this.opt.score),c._target.call(this,this.opt.score),this.opt.readOnly?c._lock.call(this):(this.style.cursor="pointer",c._binds.call(this)),this.self.data("options",this.opt)})},_adjustCallback:function(){for(var t=["number","readOnly","score","scoreName","target"],a=0;a",{name:this.opt.scoreName,type:"hidden"}).appendTo(this)},_createCancel:function(){var t=this.opt.path+this.opt.cancelOff,a=l("<"+this.opt.starType+" />",{title:this.opt.cancelHint,class:this.opt.cancelClass});"img"===this.opt.starType?a.attr({src:t,alt:"x"}):a.attr("data-alt","x").addClass(t),"left"===this.opt.cancelPlace?this.self.prepend(" ").prepend(a):this.self.append(" ").append(a),this.cancel=a},_createScore:function(){var t=l(this.opt.targetScore);this.score=t.length?t:c._buildScoreField.call(this)},_createStars:function(){for(var t=1;t<=this.opt.number;t++){var a=c._nameForIndex.call(this,t),e={alt:t,src:this.opt.path+this.opt[a]};"img"!==this.opt.starType&&(e={"data-alt":t,class:e.src}),e.title=c._getHint.call(this,t),l("<"+this.opt.starType+" />",e).appendTo(this),this.opt.space&&this.self.append(ta){var r=this.opt.iconRange[a];s=c._getRangeIcon.call(this,r,o),e<=r.range&&c._setIcon.call(this,i,s),e===r.range&&a++}else s=this.opt[o?"starOn":"starOff"],c._setIcon.call(this,i,s)}},_getRangeIcon:function(t,a){return a?t.on||this.opt.starOn:t.off||this.opt.starOff},_getScoreByPosition:function(t,a){var e=parseInt(a.alt||a.getAttribute("data-alt"),10);if(this.opt.half){var s=c._getSize.call(this),i=parseFloat((t.pageX-l(a).offset().left)/s);e=this.opt.precision?e-1+i:e-1+(.5=t?"starOn":"starOff"},_roundStars:function(t){var a=(t%1).toFixed(2);if(a>this.opt.round.down){var e="starOn";this.opt.halfShow&&a=a.number&&(t=a.number-1,e=10);var s=c._getSize.call(this)/10,i=l(this.stars[t]),o=i.offset().left+s*parseInt(e,10),r=l.Event("mousemove",{pageX:o});i.trigger(r)})},readOnly:function(a){return this.each(function(){var t=l(this);t.data("readonly")!==a&&(a?(t.off(".um_raty").children("img").off(".um_raty"),c._lock.call(this)):(c._binds.call(this),c._unlock.call(this)),t.data("readonly",a))})},reload:function(){return c.set.call(this,{})},score:function(){var t=l(this);return arguments.length?c.setScore.apply(t,arguments):c.getScore.call(t)},set:function(s){return this.each(function(){var t=l(this),a=t.data("options"),e=l.extend({},a,s);t.um_raty(e)})},setScore:function(t){return this.each(function(){!0!==l(this).data("readonly")&&(c._apply.call(this,t),c._target.call(this,t))})}};l.fn.um_raty=function(t){return c[t]?c[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void l.error("Method "+t+" does not exist!"):c.init.apply(this,arguments)},l.fn.um_raty.defaults={cancel:!1,cancelClass:"raty-cancel",cancelHint:"Cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:void 0,half:!1,halfShow:!0,hints:["bad","poor","regular","good","gorgeous"],iconRange:void 0,mouseout:void 0,mouseover:void 0,noRatedMsg:"Not rated yet!",number:5,numberMax:20,path:void 0,precision:!1,readOnly:!1,round:{down:.25,full:.6,up:.76},score:void 0,scoreName:"score",single:!1,space:!0,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",starType:"img",target:void 0,targetFormat:"{score}",targetKeep:!1,targetScore:void 0,targetText:"",targetType:"hint"}}(jQuery); \ No newline at end of file +!function(l){"use strict";var c={init:function(t){return this.each(function(){this.self=l(this),c.destroy.call(this.self),this.opt=l.extend(!0,{},l.fn.um_raty.defaults,t),c._adjustCallback.call(this),c._adjustNumber.call(this),"img"!==this.opt.starType&&c._adjustStarType.call(this),c._adjustPath.call(this),c._createStars.call(this),this.opt.cancel&&c._createCancel.call(this),this.opt.precision&&c._adjustPrecision.call(this),c._createScore.call(this),c._apply.call(this,this.opt.score),c._target.call(this,this.opt.score),this.opt.readOnly?c._lock.call(this):(this.style.cursor="pointer",c._binds.call(this)),this.self.data("options",this.opt)})},_adjustCallback:function(){for(var t=["number","readOnly","score","scoreName","target"],e=0;e",{name:this.opt.scoreName,type:"hidden"}).appendTo(this)},_createCancel:function(){var t=this.opt.path+this.opt.cancelOff,e=l("<"+this.opt.starType+" />",{title:this.opt.cancelHint,class:this.opt.cancelClass});"img"===this.opt.starType?e.attr({src:t,alt:"x"}):e.attr("data-alt","x").addClass(t),"left"===this.opt.cancelPlace?this.self.prepend(" ").prepend(e):this.self.append(" ").append(e),this.cancel=e},_createScore:function(){var t=l(this.opt.targetScore);this.score=t.length?t:c._buildScoreField.call(this)},_createStars:function(){for(var t=1;t<=this.opt.number;t++){var e=c._nameForIndex.call(this,t),a={alt:t,src:this.opt.path+this.opt[e]};"img"!==this.opt.starType&&(a={"data-alt":t,class:a.src}),a.title=c._getHint.call(this,t),l("<"+this.opt.starType+" />",a).appendTo(this),this.opt.space&&this.self.append(te){var r=this.opt.iconRange[e];s=c._getRangeIcon.call(this,r,o),a<=r.range&&c._setIcon.call(this,i,s),a===r.range&&e++}else s=this.opt[o?"starOn":"starOff"],c._setIcon.call(this,i,s)}},_getRangeIcon:function(t,e){return e?t.on||this.opt.starOn:t.off||this.opt.starOff},_getScoreByPosition:function(t,e){var a=parseInt(e.alt||e.getAttribute("data-alt"),10);if(this.opt.half){var s=c._getSize.call(this),i=parseFloat((t.pageX-l(e).offset().left)/s);a=this.opt.precision?a-1+i:a-1+(.5=t?"starOn":"starOff"},_roundStars:function(t){var e=(t%1).toFixed(2);if(e>this.opt.round.down){var a="starOn";this.opt.halfShow&&e=e.number&&(t=e.number-1,a=10);var s=c._getSize.call(this)/10,i=l(this.stars[t]),o=i.offset().left+s*parseInt(a,10),r=l.Event("mousemove",{pageX:o});i.trigger(r)})},readOnly:function(e){return this.each(function(){var t=l(this);t.data("readonly")!==e&&(e?(t.off(".um_raty").children("img").off(".um_raty"),c._lock.call(this)):(c._binds.call(this),c._unlock.call(this)),t.data("readonly",e))})},reload:function(){return c.set.call(this,{})},score:function(){var t=l(this);return arguments.length?c.setScore.apply(t,arguments):c.getScore.call(t)},set:function(s){return this.each(function(){var t=l(this),e=t.data("options"),a=l.extend({},e,s);t.um_raty(a)})},setScore:function(t){return this.each(function(){!0!==l(this).data("readonly")&&(c._apply.call(this,t),c._target.call(this,t))})}};l.fn.um_raty=function(t){return c[t]?c[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void l.error("Method "+t+" does not exist!"):c.init.apply(this,arguments)},l.fn.um_raty.defaults={cancel:!1,cancelClass:"raty-cancel",cancelHint:wp.i18n.__("Cancel this rating!","ultimate-member"),cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:void 0,half:!1,halfShow:!0,hints:["bad","poor","regular","good","gorgeous"],iconRange:void 0,mouseout:void 0,mouseover:void 0,noRatedMsg:wp.i18n.__("Not rated yet!","ultimate-member"),number:5,numberMax:20,path:void 0,precision:!1,readOnly:!1,round:{down:.25,full:.6,up:.76},score:void 0,scoreName:"score",single:!1,space:!0,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",starType:"img",target:void 0,targetFormat:"{score}",targetKeep:!1,targetScore:void 0,targetText:"",targetType:"hint"}}(jQuery); \ No newline at end of file diff --git a/includes/admin/core/class-admin-enqueue.php b/includes/admin/core/class-admin-enqueue.php index 617d6336..c9d7ff31 100644 --- a/includes/admin/core/class-admin-enqueue.php +++ b/includes/admin/core/class-admin-enqueue.php @@ -153,7 +153,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) { wp_register_style( 'um_modal', $this->front_css_baseurl . 'um-modal.css', array(), ultimatemember_version ); wp_register_style( 'um_styles', $this->front_css_baseurl . 'um-styles.css', array(), ultimatemember_version ); wp_register_style( 'um_members', $this->front_css_baseurl . 'um-members.css', array(), ultimatemember_version ); - wp_register_style( 'um_profile', $this->front_css_baseurl . 'um-profile.css', array( 'wp-i18n' ), ultimatemember_version ); + wp_register_style( 'um_profile', $this->front_css_baseurl . 'um-profile.css', array(), ultimatemember_version ); wp_register_style( 'um_account', $this->front_css_baseurl . 'um-account.css', array(), ultimatemember_version ); wp_register_style( 'um_misc', $this->front_css_baseurl . 'um-misc.css', array(), ultimatemember_version ); wp_register_style( 'um_default_css', $this->front_css_baseurl . 'um-old-default.css', array( 'um_crop', 'um_tipsy', 'um_raty', 'um_responsive', 'um_modal', 'um_styles', 'um_members', 'um_profile', 'um_account', 'um_misc', 'um_datetime_date', 'um_datetime_time', 'um_scrollbar' ), ultimatemember_version ); @@ -633,7 +633,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) { UM()->enqueue()->load_modal(); UM()->enqueue()->load_responsive(); - wp_register_script( 'um_raty', um_url . 'assets/js/um-raty' . UM()->enqueue()->suffix . '.js', array( 'jquery' ), ultimatemember_version, true ); + wp_register_script( 'um_raty', um_url . 'assets/js/um-raty' . UM()->enqueue()->suffix . '.js', array( 'jquery', 'wp-i18n' ), ultimatemember_version, true ); wp_register_style( 'um_raty', um_url . 'assets/css/um-raty.css', array(), ultimatemember_version ); wp_register_style( 'um_default_css', um_url . 'assets/css/um-old-default.css', '', ultimatemember_version, 'all' ); diff --git a/includes/core/class-access.php b/includes/core/class-access.php index 975a6b00..a4d66d04 100644 --- a/includes/core/class-access.php +++ b/includes/core/class-access.php @@ -180,11 +180,6 @@ if ( ! class_exists( 'um\core\Access' ) ) { add_filter( 'archive_template', array( &$this, 'taxonomy_message' ), 10, 3 ); add_filter( 'category_template', array( &$this, 'taxonomy_message' ), 10, 3 ); add_filter( 'taxonomy_template', array( &$this, 'taxonomy_message' ), 10, 3 ); - - /*global $wp_query; - $wp_query->set_404(); - status_header( 404 ); - nocache_headers();*/ } } else { $user_can = $this->user_can( get_current_user_id(), $restriction['_um_access_roles'] ); diff --git a/languages/ultimate-member-en_US.po b/languages/ultimate-member-en_US.po index f987d9a4..c4509fd4 100644 --- a/languages/ultimate-member-en_US.po +++ b/languages/ultimate-member-en_US.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: Ultimate Member\n" -"POT-Creation-Date: 2019-10-21 23:36+0300\n" -"PO-Revision-Date: 2019-10-21 23:37+0300\n" +"POT-Creation-Date: 2019-10-22 00:01+0300\n" +"PO-Revision-Date: 2019-10-22 00:01+0300\n" "Last-Translator: \n" "Language-Team: \n" "Language: en_US\n"