PluginProbe
Hostinger Tools / 2.0.1
Hostinger Tools v2.0.1
3.0.79 3.0.78 3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 All 110 releases
← All changes | src/js/main.js +19 -65 1.9.6 → 2.0.1 View file →
@@ -1,86 +1,22 @@
1 -import './autocomplete_steps';
1 +import './actions'
2 2 import './videos'
3 3
4 4 ( function ( $ ) {
5 5 $( document ).on( 'ready', function () {
6 6 const openClass = 'open';
7 - const completedClass = 'completed';
8 7 let selectedTab = 'Home';
9 8 const stepsTitle = $( '.hsr-onboarding-step--title' )
10 - const gotItBtn = $( '.hsr-got-it-btn' );
11 - const publishBtn = $( '.hsr-publish-btn' );
12 9 const closeBtn = $( '.hsr-close-btn' );
13 10 const navigationItem = $( '.hsr-list__item' );
14 11 const knowledgeCard = $( '#card-knowledge' );
15 12 const helpCard = $( '#card-help' );
16 13
17 - gotItBtn.on( 'click', function ( e ) {
18 - e.preventDefault();
19 - const element = $( this );
20 - const step = $( this ).data( 'step' );
21 - let remaining_tasks = $( '.hsr-onboarding-steps' ).data( 'remaining-tasks' );
22 -
23 - $.ajax( {
24 - type: 'post',
25 - dataType: 'json',
26 - url: ajaxurl,
27 - data: {
28 - action: 'hostinger_complete_onboarding_step',
29 - step: step,
30 - },
31 - success: function () {
32 - element.closest( '.hsr-onboarding-step--content' ).slideUp()
33 - element.parents( '.hsr-onboarding-step' )
34 - .find( '.hsr-onboarding-step--status' )
35 - .addClass( completedClass )
36 -
37 - if ( remaining_tasks > 0 ) {
38 - remaining_tasks = remaining_tasks - 1;
39 - $( '.hsr-onboarding-steps' ).data( 'remaining-tasks', remaining_tasks )
40 -
41 - if ( remaining_tasks === 0 ) {
42 - $( '.hsr-publish-btn' ).addClass( completedClass );
43 - }
44 -
45 - }
46 - },
47 - } )
48 - } )
49 -
50 14 stepsTitle.on( 'click', function () {
51 15 $( this ).find( '.hsr-onboarding-step--expand' ).toggleClass( openClass );
52 16 $( this ).parent().find( '.hsr-onboarding-step--content' ).slideToggle( 200 );
53 17 } )
54 18
55 - publishBtn.on( 'click', function ( e ) {
56 - e.preventDefault();
57 - $( '.hsr-modal' ).addClass( 'open' );
58 - $( 'body' ).addClass( 'modal-open' );
59 - $.ajax( {
60 - type: 'post',
61 - dataType: 'json',
62 - url: ajaxurl,
63 - data: {
64 - action: 'hostinger_publish_website',
65 - maintenance: 0,
66 - },
67 - success: function ( result ) {
68 - const previewBtn = $( '.hsr-preview-btn' );
69 - $( '.hsr-circular' ).addClass( 'hsr-hide' )
70 - $( '.hsr-success-circular' ).addClass( 'hsr-show' )
71 - $( '.hsr-publish-modal--footer' ).addClass( 'show' )
72 - $( '.hsr-publish-modal--body h3' ).text( result.data.title );
73 - $( '.hsr-publish-modal--body__description' ).text( result.data.description );
74 - $( '.hsr-publish-btn' ).addClass( 'hsr-preview' )
75 - previewBtn.addClass( 'hsr-preview' )
76 - previewBtn.text( result.data.content.btn.text )
77 - $( '.hsr-onboarding__title' ).text( result.data.content.title );
78 - $( '.hsr-onboarding__description' ).text( result.data.content.description );
79 - },
80 - } )
81 - } )
82 -
83 19 closeBtn.on( 'click', function () {
84 20 $( '.hsr-modal' ).removeClass( 'open' );
85 21 $( 'body' ).removeClass( 'modal-open' );
86 22 } )
@@ -120,8 +56,26 @@
120 56 } );
121 57 knowledgeCard.click( function () {
122 58 window.open( 'https://support.hostinger.com/en/?q=WordPress', '_blank' );
123 59 } );
60 +
61 + $('body').on('click', '.hst-open-affiliate-tab', function(e) {
62 + e.preventDefault();
63 +
64 + $( 'li.hsr-list__item[data-name="amazon_affiliate"]' ).trigger( 'click' );
65 + } );
66 +
67 + $('body').on('click', '#hst-connect_affiliate_settings', function(e) {
68 + e.preventDefault();
69 +
70 + $( 'li.hsr-list__item[data-name="amazon_affiliate"]' ).trigger( 'click' );
71 +
72 + document.dispatchEvent(
73 + new CustomEvent('scrollToAffiliateSettings', {
74 + bubbles: true
75 + })
76 + );
77 + } );
124 78
125 79 document.querySelectorAll( '.hsr-playlist-item' ).forEach( function ( item ) {
126 80 const firstItem = document.querySelector( '.hsr-playlist-item:first-child' );
127 81 firstItem.classList.add( 'hsr-active-video' );