Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit d7fc367

Browse files
author
Alexandre Germain
committed
Continue linting, regenerate docs
1 parent 3b50ee5 commit d7fc367

File tree

259 files changed

+13054
-138920
lines changed

Some content is hidden

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

259 files changed

+13054
-138920
lines changed

Gruntfile.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ module.exports = function gruntInit( grunt ) {
2828
},
2929
},
3030
},
31+
jsPaths = [
32+
'js/**/*.js',
33+
'!js/**/*.min.js',
34+
'tests/**/*.js',
35+
],
3136
gruntLocalconfig = require('./grunt_localconfig.json');
3237

3338
const gruntConfig = {
@@ -80,7 +85,7 @@ module.exports = function gruntInit( grunt ) {
8085
},
8186
jsdoc: {
8287
dist: {
83-
src: [ 'js/*.js' ],
88+
src: jsPaths,
8489
options: {
8590
private: true,
8691
destination: jsDocPath,
@@ -233,11 +238,7 @@ module.exports = function gruntInit( grunt ) {
233238
},
234239
docco: {
235240
debug: {
236-
src: [
237-
'js/*.js',
238-
'!js/*.min.js',
239-
'tests/**/*.js',
240-
],
241+
src: jsPaths,
241242
options: {
242243
output: `${jsDocPath}/docco`,
243244
},

class/class-admin.php

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
wp_die( 'Forbidden' );
2323
}
2424

25-
2625
if ( ! class_exists( __NAMESPACE__ . '\\Admin' ) ) {
2726
/**
2827
* Main class for iThoughts Tooltip Glossary backend
@@ -67,13 +66,35 @@ public function __construct() {
6766
add_action( 'admin_enqueue_scripts', array( &$this, 'enqueue_scripts_and_styles' ) );
6867
}
6968

69+
/**
70+
* Opens a connection with the filesystem. Once done, you can write & read files
71+
* @param [[Type]] $url [[Description]]
72+
* @param [[Type]] $method [[Description]]
73+
* @param [[Type]] $context [[Description]]
74+
* @param [[Type]] [$fields = null] [[Description]]
75+
* @return boolean True if connection is successful, false otherwise
76+
*/
77+
public function connect_fs( $url, $method, $context, $fields = null ) {
78+
global $wp_filesystem;
79+
if ( false === ($credentials = request_filesystem_credentials( $url, $method, false, $context, $fields )) ) {
80+
return false;
81+
}
82+
83+
// check if credentials are correct or not.
84+
if ( ! WP_Filesystem( $credentials ) ) {
85+
request_filesystem_credentials( $url, $method, true, $context );
86+
return false;
87+
}
88+
89+
return true;
90+
}
7091
/**
7192
* Trigger check to see if update steps are available. Include and create an {@link \ithoughts\tooltip_glossary\Updater Updater} instance if required.
7293
*
7394
* @throws \Exception Throws an Exception if the plugin was unable to read its own informations.
7495
* @author Gerkin
7596
*/
76-
public function set_version() {
97+
public function set_version() {
7798
$backbone = \ithoughts\tooltip_glossary\Backbone::get_instance();
7899
try {
79100
$plugindata = get_plugin_data( $backbone->get_base_path() . '/ithoughts_tooltip_glossary.php' );
@@ -1290,13 +1311,14 @@ public function get_tinymce_list_form_ajax() {
12901311
$no_groups = (new \WP_Query(array(
12911312
'post_type' => 'glossary',
12921313
'post_status' => 'publish',
1293-
'tax_query' => array(array(
1294-
'taxonomy' => 'glossary_group',
1295-
'field' => 'term_id',
1296-
'operator' => 'NOT IN',
1297-
'terms' => extract_terms_ids( $groups ),
1314+
'tax_query' => array( // WPCS: tax_query ok.
1315+
array(
1316+
'taxonomy' => 'glossary_group',
1317+
'field' => 'term_id',
1318+
'operator' => 'NOT IN',
1319+
'terms' => extract_terms_ids( $groups ),
1320+
),
12981321
),
1299-
),
13001322
)))->post_count;
13011323

13021324
$inputs = array(
@@ -1511,8 +1533,8 @@ private function loadtheme( $themename = null ) {
15111533
);
15121534
}
15131535

1514-
1515-
/*$url = wp_nonce_url("itg-load-theme?theme_name=$themename",'itg-load-theme');
1536+
/*
1537+
$url = wp_nonce_url("itg-load-theme?theme_name=$themename",'itg-load-theme');
15161538
if (false === ($creds = request_filesystem_credentials($url, '', false, false, null) ) ) {
15171539
return; // stop processing here.
15181540
} else {
@@ -1522,8 +1544,6 @@ private function loadtheme( $themename = null ) {
15221544
}
15231545
}*/
15241546

1525-
1526-
15271547
$content = file_get_contents( $theme_infos['absdir'] . '/' . $file );
15281548

15291549
$match_head_regex = "/^\\.qtip-$reformated_theme_name\\s*{[\\n\\s]*/";

docs/.DS_Store

-6 KB
Binary file not shown.
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>JSDoc: Source: dist/ithoughts_tt_gl-admin.js</title>
6+
7+
<script src="scripts/prettify/prettify.js"> </script>
8+
<script src="scripts/prettify/lang-css.js"> </script>
9+
<!--[if lt IE 9]>
10+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11+
<![endif]-->
12+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14+
</head>
15+
16+
<body>
17+
18+
<div id="main">
19+
20+
<h1 class="page-title">Source: dist/ithoughts_tt_gl-admin.js</h1>
21+
22+
23+
24+
25+
26+
27+
<section>
28+
<article>
29+
<pre class="prettyprint source linenums"><code>/**
30+
* @file Old file. To merge
31+
*
32+
* @author Gerkin
33+
* @copyright 2016 GerkinDevelopment
34+
* @license https://www.gnu.org/licenses/gpl-3.0.html GPLv3
35+
* @package ithoughts-tooltip-glossary
36+
*
37+
* @version 2.7.0
38+
*/
39+
40+
'use strict';
41+
42+
(function selfCalling(ithoughts) {
43+
var $ = ithoughts.$,
44+
itg = iThoughtsTooltipGlossary;
45+
46+
itg.updateStyle = function (keepDefaults, themename, target) {
47+
var styles = ['qtip-' + themename];
48+
if (true === keepDefaults) {
49+
styles = ['ithoughts_tt_gl-tooltip', 'qtip-pos-br'].concat(styles);
50+
} else if (typeof keepDefaults !== 'undefined' &amp;&amp; keepDefaults &amp;&amp; 'Array' === keepDefaults.constructor.name) {
51+
styles = keepDefaults.concat(styles);
52+
}
53+
54+
target.qtip('option', 'style.classes', styles.join(' '));
55+
};
56+
57+
ithoughts.$d.ready(function onDocumentReady() {
58+
$('[data-tooltip-id="exampleStyle"]').qtip('api').show();
59+
var events = 'change blur keyup mouseup',
60+
updateActivationPreview = function updateActivationPreviewWrapper() {
61+
var triggerI = $('#qtiptrigger'),
62+
animInI = $('#anim_in'),
63+
animOutI = $('#anim_out'),
64+
animTimeI = $('#anim_time');
65+
return function updateActivationPreview() {
66+
var trigger = triggerI.val();
67+
try {
68+
$demotip.qtip('option', 'show.event', trigger).qtip('option', 'hide.event', 'responsive' === trigger ? 'responsiveout' : 'mouseleave').qtip('option', 'show.effect', itg.animationFunctions.in[animInI.val()]).qtip('option', 'hide.effect', itg.animationFunctions.out[animOutI.val()]).prop('animation_duration', parseInt(animTimeI.val() || 500));
69+
} catch (e) {
70+
itg.error(e);
71+
}
72+
};
73+
}(),
74+
$demotip = $('#qtip-exampleStyle');
75+
$('#qtiprounded,#qtipshadow,#qtipstyle').bind(events, function updateStyleWrapper() {
76+
var styleI = $('#qtipstyle'),
77+
shadowI = $('#qtipshadow'),
78+
roundedI = $('#qtiprounded');
79+
return function updateStyle(event, themename) {
80+
if ('undefined' == typeof themename) {
81+
themename = styleI.val();
82+
}
83+
var style = ['ithoughts_tt_gl-tooltip', 'qtip-pos-br'];
84+
if (shadowI.is(':checked')) {
85+
style.push('qtip-shadow');
86+
}
87+
if (roundedI.is(':checked')) {
88+
style.push('qtip-rounded');
89+
}
90+
itg.updateStyle(style, $('#qtipstyle').val(), $demotip);
91+
};
92+
}());
93+
$('#tooltips,#qtiptrigger,#anim_in,#anim_out,#anim_time').bind(events, updateActivationPreview);
94+
(function doWrapInit() {
95+
var verbosityInput = $('#verbosity'),
96+
verbosityLabel = $('#ithoughts_tt_gl-verbosity_label'),
97+
verbosityLabels = verbosityLabel.data('labels');
98+
verbosityInput.on('input', function onInput() {
99+
verbosityLabel.text(verbosityLabels[$(this).val()]);
100+
}).trigger('input');
101+
})();
102+
});
103+
})(iThoughts.v5);
104+
//# sourceMappingURL=ithoughts_tt_gl-admin.js.map
105+
</code></pre>
106+
</article>
107+
</section>
108+
109+
110+
111+
112+
</div>
113+
114+
<nav>
115+
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#checkRemoveAttr">checkRemoveAttr</a></li><li><a href="global.html#closeForm">closeForm</a></li><li><a href="global.html#doInitTooltips">doInitTooltips</a></li><li><a href="global.html#filterPrototypeInputs">filterPrototypeInputs</a></li><li><a href="global.html#getOptsObject">getOptsObject</a></li><li><a href="global.html#initTab">initTab</a></li><li><a href="global.html#initTinyMCEPlugin">initTinyMCEPlugin</a></li><li><a href="global.html#removeEditor">removeEditor</a></li></ul>
116+
</nav>
117+
118+
<br class="clear">
119+
120+
<footer>
121+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Wed Jul 05 2017 15:24:10 GMT+0200 (CEST)
122+
</footer>
123+
124+
<script> prettyPrint(); </script>
125+
<script src="scripts/linenumber.js"> </script>
126+
</body>
127+
</html>
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>JSDoc: Source: dist/ithoughts_tt_gl-atoz.js</title>
6+
7+
<script src="scripts/prettify/prettify.js"> </script>
8+
<script src="scripts/prettify/lang-css.js"> </script>
9+
<!--[if lt IE 9]>
10+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11+
<![endif]-->
12+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14+
</head>
15+
16+
<body>
17+
18+
<div id="main">
19+
20+
<h1 class="page-title">Source: dist/ithoughts_tt_gl-atoz.js</h1>
21+
22+
23+
24+
25+
26+
27+
<section>
28+
<article>
29+
<pre class="prettyprint source linenums"><code>/**
30+
* @file Javascript handler for A-to-Z lists
31+
*
32+
* @author Gerkin
33+
* @copyright 2016 GerkinDevelopment
34+
* @license https://www.gnu.org/licenses/gpl-3.0.html GPLv3
35+
* @package ithoughts-tooltip-glossary
36+
*
37+
* @version 2.7.0
38+
*/
39+
40+
'use strict';
41+
42+
(function selfCalling(ithoughts) {
43+
var lastPos,
44+
$ = ithoughts.$,
45+
$w = ithoughts.$w,
46+
pleaseSelect = $('.ithoughts_tt_gl-please-select'),
47+
clickable = $('.itg-atoz-clickable');
48+
49+
function setShow($parent, alpha) {
50+
var fct1k, fct2k;
51+
if (alpha) {
52+
fct1k = 'removeClass';
53+
fct2k = 'addClass';
54+
} else {
55+
fct1k = 'addClass';
56+
fct2k = 'removeClass';
57+
}
58+
$parent.find('.itg-atoz-items')[fct1k]('itg-atoz-items-on')[fct2k]('itg-atoz-items-off');
59+
$parent.find('.ithoughts_tt_gl-please-select')[alpha ? 'hide' : 'show']();
60+
if (alpha) {
61+
$parent.find('.itg-atoz-items-' + alpha).removeClass('itg-atoz-items-off').addClass('itg-atoz-items-on');
62+
}
63+
}
64+
function setCurrentTab(alpha) {
65+
pleaseSelect.hide();
66+
clickable.filter(function filterAlphaTab() {
67+
return $(this).data('alpha') === alpha;
68+
}).click();
69+
}
70+
ithoughts.$d.ready(function onDocumentReady() {
71+
var preventHashChange = false;
72+
// Handle clicking
73+
$('.itg-atoz-clickable').click(function onClickTab() {
74+
// Keep track of the scroll
75+
lastPos = $w.scrollTop();
76+
$(this).removeClass('itg-atoz-menu-off').addClass('itg-atoz-menu-on');
77+
$('.itg-atoz-clickable').removeClass('itg-atoz-menu-on').addClass('itg-atoz-menu-off');
78+
var alpha = $(this).data('alpha');
79+
preventHashChange = true;
80+
location.hash = alpha;
81+
82+
setShow($(this).parent().parent(), alpha);
83+
});
84+
85+
// Manual hash change - trigger click
86+
$w.bind('hashchange', function onHashChange() {
87+
if (preventHashChange) {
88+
preventHashChange = false;
89+
} else {
90+
var alpha = location.hash.replace('#', '');
91+
$w.scrollTop(lastPos);
92+
location.hash = alpha;
93+
setCurrentTab(alpha);
94+
}
95+
});
96+
97+
// Page load hash management:
98+
// - Look for first available if none specified
99+
// - Trigger click if exists
100+
var myLocation = document.location.toString(),
101+
myAlpha = '';
102+
if (myLocation.match('#')) {
103+
myAlpha = myLocation.split('#')[1];
104+
}
105+
if (!myAlpha.length) {
106+
$('.itg-atoz-items').removeClass('itg-atoz-items-on').addClass('itg-atoz-items-off');
107+
clickable.removeClass('itg-atoz-menu-on').addClass('itg-atoz-menu-off');
108+
$('.ithoughts_tt_gl-please-select').show();
109+
} else {
110+
setCurrentTab(myAlpha);
111+
}
112+
});
113+
})(iThoughts.v5);
114+
//# sourceMappingURL=ithoughts_tt_gl-atoz.js.map
115+
</code></pre>
116+
</article>
117+
</section>
118+
119+
120+
121+
122+
</div>
123+
124+
<nav>
125+
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#checkRemoveAttr">checkRemoveAttr</a></li><li><a href="global.html#closeForm">closeForm</a></li><li><a href="global.html#doInitTooltips">doInitTooltips</a></li><li><a href="global.html#filterPrototypeInputs">filterPrototypeInputs</a></li><li><a href="global.html#getOptsObject">getOptsObject</a></li><li><a href="global.html#initTab">initTab</a></li><li><a href="global.html#initTinyMCEPlugin">initTinyMCEPlugin</a></li><li><a href="global.html#removeEditor">removeEditor</a></li></ul>
126+
</nav>
127+
128+
<br class="clear">
129+
130+
<footer>
131+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Wed Jul 05 2017 15:24:10 GMT+0200 (CEST)
132+
</footer>
133+
134+
<script> prettyPrint(); </script>
135+
<script src="scripts/linenumber.js"> </script>
136+
</body>
137+
</html>

0 commit comments

Comments
 (0)