Skip to content

Commit 9b60cde

Browse files
v3.1.0
1 parent 9587e6e commit 9b60cde

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+4302
-167
lines changed

.gitattributes

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,10 @@ README.md export-ignore
99
/.github export-ignore
1010

1111
# GIT - Release version
12-
/git-tag.sh export-ignore
12+
/git-tag.sh export-ignore
13+
14+
# Composer
15+
composer.json
16+
composer.lock export ignore
17+
includes/pro/composer.lock export-ignore
18+
includes/pro/composer.json

assets/js/algwcwishlistmodal.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Js responsible for creation and save of multiple wishlist.
55
*
6-
* @version 3.0.8
6+
* @version 3.1.0
77
* @since 3.0.0
88
* @requires jQuery.js
99
*/
@@ -94,7 +94,6 @@
9494
return data;
9595
}
9696

97-
9897
function Plugin ( element, options ) {
9998
this.element = element;
10099
this.settings = $.extend( {}, defaults, options );
@@ -109,7 +108,13 @@
109108
Plugin.prototype.handlerMethods( _obj );
110109
},
111110

111+
isTouchScreen:function(){
112+
return window.matchMedia("(pointer: coarse)").matches;
113+
},
114+
112115
handlerMethods: function( _obj ) {
116+
var toggle_item_events_str = Plugin.prototype.isTouchScreen() ? alg_wc_wl_ajax.toggle_item_events.touchscreen.join(' ') : alg_wc_wl_ajax.toggle_item_events.default.join(' ');
117+
113118
$( document ).on( 'click', _obj.algwcwishlistmodalBtn, function() {
114119
var itemid = $(this).attr('data-item_id');
115120
Plugin.prototype.show( _obj );
@@ -121,7 +126,7 @@
121126

122127
});
123128

124-
$( document ).on( 'click', _obj.algwcwishlistmodalThumbBtn, function() {
129+
$( document ).on( toggle_item_events_str, _obj.algwcwishlistmodalThumbBtn, function() {
125130
var itemid = $(this).attr('data-item_id');
126131
Plugin.prototype.show( _obj );
127132
Plugin.prototype.showContainer( _obj );

composer.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"repositories": [
3+
{
4+
"type": "vcs",
5+
"url": "https://github.com/wpcodefactory/wpfactory-promoting-notice"
6+
},
7+
{
8+
"type": "vcs",
9+
"url": "https://github.com/wpcodefactory/wpfactory-cross-selling"
10+
},
11+
{
12+
"type": "vcs",
13+
"url": "https://github.com/wpcodefactory/wpfactory-admin-menu"
14+
}
15+
],
16+
"require": {
17+
"wpfactory/wpfactory-promoting-notice": "*",
18+
"wpfactory/wpfactory-cross-selling": "*",
19+
"wpfactory/wpfactory-admin-menu": "*"
20+
},
21+
"config": {
22+
"preferred-install": "dist"
23+
}
24+
}

composer.lock

+147
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/admin/class-alg-wc-wish-list-settings-advanced.php

+30-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Wish List for WooCommerce - Advanced settings.
44
*
5-
* @version 2.3.7
5+
* @version 3.1.0
66
* @since 2.0.1
77
* @author WPFactory
88
*/
@@ -46,7 +46,7 @@ function get_section_priority() {
4646
/**
4747
* get_settings.
4848
*
49-
* @version 2.3.7
49+
* @version 3.1.0
5050
* @since 2.0.1
5151
*/
5252
function get_settings( $settings = array() ) {
@@ -83,7 +83,7 @@ function get_settings( $settings = array() ) {
8383
'type' => 'sectionend',
8484
'id' => 'alg_wc_wl_advanced',
8585
),
86-
// JS Updater Events
86+
// JS Updater Events.
8787
array(
8888
'title' => __( 'Javascript update events', 'wish-list-for-woocommerce' ),
8989
'type' => 'title',
@@ -109,6 +109,33 @@ function get_settings( $settings = array() ) {
109109
'type' => 'sectionend',
110110
'id' => 'alg_wc_wl_js_updater_events_opt',
111111
),
112+
113+
// JS Toggle events.
114+
array(
115+
'title' => __( 'Javascript toggle events', 'wish-list-for-woocommerce' ),
116+
'type' => 'title',
117+
'desc' => __( 'JavaScript events that toggle items to/from wishlist.', 'wish-list-for-woocommerce' ) . ' ' .
118+
sprintf( __( 'Common events related to click: %s.', 'wish-list-for-woocommerce' ), implode( ', ', array_map( function ( $word ) {
119+
return '<code>' . $word . '</code>';
120+
}, array( 'click', 'dblclick', 'mouseup', 'touchend' ) ) ) ),
121+
'id' => 'alg_wc_wl_js_toggle_events_opt',
122+
),
123+
array(
124+
'title' => __( 'Default toggle events', 'wish-list-for-woocommerce' ),
125+
'type' => 'text',
126+
'default' => 'mouseup,touchend',
127+
'id' => 'alg_wc_wl_default_js_toggle_events',
128+
),
129+
array(
130+
'title' => __( 'Mobile events', 'wish-list-for-woocommerce' ),
131+
'type' => 'text',
132+
'default' => 'mouseup,touchend',
133+
'id' => 'alg_wc_wl_mobile_js_toggle_events',
134+
),
135+
array(
136+
'type' => 'sectionend',
137+
'id' => 'alg_wc_wl_js_toggle_events_opt',
138+
),
112139
);
113140
return parent::get_settings( array_merge( $settings, $new_settings ) );
114141
}

includes/admin/class-alg-wc-wish-list-settings.php

+31-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Wishlist for WooCommerce - Settings
44
*
5-
* @version 1.0.0
5+
* @version 3.1.0
66
* @since 1.0.0
77
* @author WPFactory
88
*/
@@ -16,13 +16,42 @@ class Alg_WC_Wish_List_Settings extends WC_Settings_Page {
1616
/**
1717
* Constructor.
1818
*
19-
* @version 1.0.0
19+
* @version 3.1.0
2020
* @since 1.0.0
2121
*/
2222
function __construct() {
2323
$this->id = 'alg_wc_wish_list';
2424
$this->label = __( 'Wishlist', 'wish-list-for-woocommerce' );
2525
parent::__construct();
26+
27+
// Create notice about pro.
28+
add_action( 'admin_init', array( $this, 'add_promoting_notice' ) );
29+
}
30+
31+
/**
32+
* add_promoting_notice.
33+
*
34+
* @version 3.1.0
35+
* @since 3.1.0
36+
*/
37+
function add_promoting_notice() {
38+
$promoting_notice = wpfactory_promoting_notice();
39+
$promoting_notice->set_args( array(
40+
'url_requirements' => array(
41+
'page_filename' => 'admin.php',
42+
'params' => array( 'page' => 'wc-settings', 'tab' => $this->id ),
43+
),
44+
'enable' => true === apply_filters( 'alg_wc_wishlist_settings', true ),
45+
'optimize_plugin_icon_contrast' => true,
46+
'template_variables' => array(
47+
'%pro_version_url%' => 'https://wpfactory.com/item/wish-list-woocommerce/',
48+
'%plugin_icon_url%' => 'https://ps.w.org/wish-list-for-woocommerce/assets/icon-128x128.png?rev=1884298',
49+
'%pro_version_title%' => __( 'Wishlist for WooCommerce Pro', 'wish-list-for-woocommerce' ),
50+
'%main_text%' => __( 'Disabled options can be unlocked using <a href="%pro_version_url%" target="_blank"><strong>%pro_version_title%</strong></a>', 'wish-list-for-woocommerce' ),
51+
'%btn_call_to_action%' => __( 'Upgrade to Pro version', 'wish-list-for-woocommerce' ),
52+
),
53+
) );
54+
$promoting_notice->init();
2655
}
2756

2857
/**

0 commit comments

Comments
 (0)