Skip to content

Commit 05b31b6

Browse files
author
Nilo Velez
committed
WordPress coding standards fixes
1 parent fa6446f commit 05b31b6

File tree

5 files changed

+45
-73
lines changed

5 files changed

+45
-73
lines changed

css/admin.css

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -127,47 +127,11 @@
127127
cursor: pointer !important;
128128
}
129129

130-
/* utils module */
131-
/*
132-
#mache-utils-options .nav-tab::before {
133-
content: '';
134-
display: inline-block;
135-
width: 12px;
136-
height: 12px;
137-
box-sizing: border-box;
138-
border-radius: 6px;
139-
border: 1px solid #ccc;
140-
background: #ddd;
141-
margin: 0 8px 0 0;
142-
position: relative;
143-
top: 2px;
144-
}
145-
#mache-utils-options .nav-tabnav-tab-active-has-content::before {
146-
border-width: 0;
147-
background: #ff9900;
148-
}
149-
150-
#mache-utils-options .nav-tab.nav-tab-changed::before {
151-
border-width: 0;
152-
background: #4ab866;
153-
}
154-
*/
155-
156130
#mache-utils-options .CodeMirror {
157131
border: 1px solid #7e8993;
158132
border-radius: 4px;
159133
}
160134

161-
162-
#machete-tabs {
163-
164-
}
165-
166-
.machete-tabs-content {
167-
168-
}
169-
170-
171135
.machete-wrap.about-wrap .notice,
172136
.machete-wrap.about-wrap div.error,
173137
.machete-wrap.about-wrap div.updated {

inc/powertools/class-machete-powertools-module.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct() {
2929
);
3030

3131
$this->powertools_array = array(
32-
'widget_shortcodes' => array(
32+
'widget_shortcodes' => array(
3333
'title' => __( 'Shortcodes in Widgets', 'machete' ),
3434
'description' => __( 'Enables the use of shortcodes in text/html widgets. It may slightly impact performance', 'machete' ),
3535
),

inc/social/js/share.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@
33
if ( ! Element.prototype.querySelectorAll ) {
44
return;
55
}
6-
var elements = document.querySelectorAll('.mct-share-buttons a');
7-
for (var i = 0; i < elements.length; i++) {
8-
elements[i].addEventListener('click', function( e ){
9-
e.preventDefault();
10-
window.open(
11-
this.getAttribute("href"),
12-
this.getAttribute("data-network"),
13-
"toolbar=yes, top=50, left=50, width=500, height=500"
14-
);
15-
}, false);
6+
var elements = document.querySelectorAll( '.mct-share-buttons a' );
7+
var numElements = elements.length;
8+
for ( var i = 0; i < numElements; i++ ) {
9+
elements[i].addEventListener(
10+
'click',
11+
function( e ){
12+
e.preventDefault();
13+
window.open(
14+
this.getAttribute( "href" ),
15+
this.getAttribute( "data-network" ),
16+
"toolbar=yes, top=50, left=50, width=500, height=500"
17+
);
18+
},
19+
false
20+
);
1621
}
17-
}());
22+
}());

inc/social/js/share.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inc/utils/js/codemirror_tabs.js

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,46 @@
66
current_tab: '#machete-tabs-tracking'
77
};
88

9-
$('#machete-tabs a').each(function(){
10-
machete_utils.tabs[ $(this).attr('href') ] = {};
11-
});
12-
9+
$( '#machete-tabs a' ).each(
10+
function() {
11+
machete_utils.tabs[ $( this ).attr( 'href' ) ] = {};
12+
}
13+
);
14+
1315
if ( window.location.hash && ( machete_utils.tabs[ window.location.hash ] ) ) {
1416
machete_utils.current_tab = window.location.hash;
1517
}
1618

1719
updateTabs = function() {
18-
//console.log(machete_utils.current_tab);
20+
// console.log(machete_utils.current_tab);
1921
window.location.hash = machete_utils.current_tab;
20-
$('#machete-tabs a').removeClass('nav-tab-active');
21-
$('.nav-tab[href="'+machete_utils.current_tab+'"]').addClass('nav-tab-active');
22-
22+
$( '#machete-tabs a' ).removeClass( 'nav-tab-active' );
23+
$( '.nav-tab[href="' + machete_utils.current_tab + '"]' ).addClass( 'nav-tab-active' );
2324

24-
$('.machete-tabs-content:not(' + machete_utils.current_tab + ')').hide();
25-
$(machete_utils.current_tab + '.machete-tabs-content').show();
25+
$( '.machete-tabs-content:not(' + machete_utils.current_tab + ')' ).hide();
26+
$( machete_utils.current_tab + '.machete-tabs-content' ).show();
2627
// machete-tabs-header > header_content
27-
textarea_id = machete_utils.current_tab.replace('#machete-tabs-','') + '_content';
28-
//console.log('textarea_id: ' + textarea_id );
29-
if ( machete_utils.editor && machete_utils.editor.codemirror ){
28+
textarea_id = machete_utils.current_tab.replace( '#machete-tabs-', '' ) + '_content';
29+
// console.log('textarea_id: ' + textarea_id );
30+
if ( machete_utils.editor && machete_utils.editor.codemirror ) {
3031
machete_utils.editor.codemirror.toTextArea();
3132
}
32-
if (textarea_id != 'tracking_content'){
33+
if ( textarea_id != 'tracking_content' ) {
3334
// la pestaña de analytics no tiene editor
3435
machete_utils.editor = wp.codeEditor.initialize( textarea_id );
35-
//machete_utils.editor.codemirror.doc.getValue();
36+
// machete_utils.editor.codemirror.doc.getValue();
3637
}
3738
}
38-
$('.machete-tabs-content h2').hide();
39-
$('#machete-tabs').show().find('a').click( function ( e ) {
40-
e.preventDefault();
41-
if ($(this).attr('href') == machete_utils.current_tab){
42-
return; // clicked already active tab
39+
$( '.machete-tabs-content h2' ).hide();
40+
$( '#machete-tabs' ).show().find( 'a' ).click(
41+
function ( e ) {
42+
e.preventDefault();
43+
if ( $( this ).attr( 'href' ) == machete_utils.current_tab) {
44+
return; // clicked already active tab
45+
}
46+
machete_utils.current_tab = $( this ).attr( 'href' );
47+
updateTabs();
4348
}
44-
machete_utils.current_tab = $(this).attr('href');
45-
updateTabs();
46-
});
49+
);
4750
updateTabs();
48-
})( window.jQuery, window.wp );
51+
})( window.jQuery, window.wp );

0 commit comments

Comments
 (0)