forked from Evarisk/dolicar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a23e7d
commit 78e03c9
Showing
7 changed files
with
208 additions
and
148 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,129 @@ | ||
/* Javascript library of module DoliCar */ | ||
/* Copyright (C) 2023-2024 EVARISK <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* Library javascript to enable Browser notifications | ||
*/ | ||
|
||
/** | ||
* \file js/dolicar.js | ||
* \ingroup dolicar | ||
* \brief JavaScript file for module DoliCar | ||
*/ | ||
|
||
/** | ||
* @namespace Saturne_Framework_Init | ||
* | ||
* @author Evarisk <[email protected]> | ||
* @copyright 2015-2023 Evarisk | ||
* @author Evarisk <[email protected]> | ||
* @copyright 2021-2024 Evarisk | ||
*/ | ||
|
||
if ( ! window.dolicar ) { | ||
/** | ||
* [dolicar description] | ||
* | ||
* @memberof Saturne_Framework_Init | ||
* | ||
* @type {Object} | ||
*/ | ||
window.dolicar = {}; | ||
|
||
/** | ||
* [scriptsLoaded description] | ||
* | ||
* @memberof Saturne_Framework_Init | ||
* | ||
* @type {Boolean} | ||
*/ | ||
window.dolicar.scriptsLoaded = false; | ||
} | ||
|
||
if ( ! window.dolicar.scriptsLoaded ) { | ||
/** | ||
* [description] | ||
* | ||
* @memberof Saturne_Framework_Init | ||
* | ||
* @returns {void} [description] | ||
*/ | ||
window.dolicar.init = function() { | ||
window.dolicar.load_list_script(); | ||
}; | ||
'use strict'; | ||
|
||
/** | ||
* [description] | ||
* | ||
* @memberof Saturne_Framework_Init | ||
* | ||
* @returns {void} [description] | ||
*/ | ||
window.dolicar.load_list_script = function() { | ||
if ( ! window.dolicar.scriptsLoaded) { | ||
var key = undefined, slug = undefined; | ||
for ( key in window.dolicar ) { | ||
if (!window.dolicar) { | ||
/** | ||
* Init Dolicar JS | ||
* | ||
* @memberof Saturne_Framework_Init | ||
* | ||
* @since 1.0.0 | ||
* @version 1.2.0 | ||
* | ||
* @type {Object} | ||
*/ | ||
window.dolicar = {}; | ||
|
||
if ( window.dolicar[key].init ) { | ||
window.dolicar[key].init(); | ||
} | ||
|
||
for ( slug in window.dolicar[key] ) { | ||
/** | ||
* Init load script dolicar JS | ||
* | ||
* @memberof Saturne_Framework_Init | ||
* | ||
* @since 1.0.0 | ||
* @version 1.2.0 | ||
* | ||
* @type {Boolean} | ||
*/ | ||
window.dolicar.scriptsLoaded = false; | ||
} | ||
|
||
if ( window.dolicar[key] && window.dolicar[key][slug] && window.dolicar[key][slug].init ) { | ||
window.dolicar[key][slug].init(); | ||
} | ||
if (!window.dolicar.scriptsLoaded) { | ||
/** | ||
* Dolicar init | ||
* | ||
* @memberof Saturne_Framework_Init | ||
* | ||
* @since 1.0.0 | ||
* @version 1.2.0 | ||
* | ||
* @returns {void} | ||
*/ | ||
window.dolicar.init = function() { | ||
window.dolicar.load_list_script(); | ||
}; | ||
|
||
} | ||
} | ||
/** | ||
* Load script/module of dolicar | ||
* | ||
* @memberof Saturne_Framework_Init | ||
* | ||
* @since 1.0.0 | ||
* @version 1.2.0 | ||
* | ||
* @returns {void} | ||
*/ | ||
window.dolicar.load_list_script = function() { | ||
if (!window.dolicar.scriptsLoaded) { | ||
for (let key in window.dolicar) { | ||
if (window.dolicar.hasOwnProperty(key) && typeof window.dolicar[key] === 'object') { | ||
if (typeof window.dolicar[key].init === 'function') { | ||
window.dolicar[key].init(); | ||
} | ||
|
||
window.dolicar.scriptsLoaded = true; | ||
} | ||
}; | ||
for (let slug in window.dolicar[key]) { | ||
if (window.dolicar[key].hasOwnProperty(slug) && typeof window.dolicar[key][slug] === 'object' && typeof window.dolicar[key][slug].init === 'function') { | ||
window.dolicar[key][slug].init(); | ||
} | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* [description] | ||
* | ||
* @memberof Saturne_Framework_Init | ||
* | ||
* @returns {void} [description] | ||
*/ | ||
window.dolicar.refresh = function() { | ||
var key = undefined; | ||
var slug = undefined; | ||
for ( key in window.dolicar ) { | ||
if ( window.dolicar[key].refresh ) { | ||
window.dolicar[key].refresh(); | ||
} | ||
window.dolicar.scriptsLoaded = true; | ||
} | ||
}; | ||
|
||
for ( slug in window.dolicar[key] ) { | ||
/** | ||
* Reload script/module of dolicar | ||
* | ||
* @memberof Saturne_Framework_Init | ||
* | ||
* @returns {void} | ||
*/ | ||
window.dolicar.refresh = function() { | ||
for (let key in window.dolicar) { | ||
if (window.dolicar.hasOwnProperty(key) && typeof window.dolicar[key] === 'object') { | ||
if (typeof window.dolicar[key].refresh === 'function') { | ||
window.dolicar[key].refresh(); | ||
} | ||
|
||
if ( window.dolicar[key] && window.dolicar[key][slug] && window.dolicar[key][slug].refresh ) { | ||
window.dolicar[key][slug].refresh(); | ||
} | ||
} | ||
} | ||
}; | ||
for (let slug in window.dolicar[key]) { | ||
if (window.dolicar[key].hasOwnProperty(slug) && window.dolicar[key][slug] && typeof window.dolicar[key][slug].refresh === 'function') { | ||
window.dolicar[key][slug].refresh(); | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
$( document ).ready( window.dolicar.init ); | ||
$(document).ready(window.dolicar.init); | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
//Silence is golden apple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
//Silence is golden apple |
Oops, something went wrong.