JavaScript extension support
This commit is contained in:
parent
ac67c0fae1
commit
fe2e50b3b6
2 changed files with 20 additions and 0 deletions
11
extensions/example.js
Normal file
11
extensions/example.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/**
|
||||||
|
* Created by mmk2410 on 12/5/15.
|
||||||
|
*
|
||||||
|
* Example JavaScript file to demonstrate the rangitaki extension support
|
||||||
|
*/
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
console.log("Welcome Developer! \nYou're seeing the output of a javascript extension for the rangitaki blogging engine.")
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(main());
|
|
@ -268,6 +268,15 @@ if ($nav_drawer == "yes") {
|
||||||
</div>
|
</div>
|
||||||
<script src="./res/js/jquery-2.1.4.min.js"></script> <!-- include jquery-->
|
<script src="./res/js/jquery-2.1.4.min.js"></script> <!-- include jquery-->
|
||||||
<script src="./res/js/app.js"></script> <!--include main javascript-->
|
<script src="./res/js/app.js"></script> <!--include main javascript-->
|
||||||
|
<!-- JS extension support -->
|
||||||
|
<?php
|
||||||
|
$extensions = scandir('./extensions');
|
||||||
|
foreach ($extensions as $extension) {
|
||||||
|
if (substr($extension, -3) == ".js") {
|
||||||
|
echo "<script src='./extensions/$extension'></script>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
<?php
|
<?php
|
||||||
require './res/php/GoogleAnalytics.php'; // include google analytics
|
require './res/php/GoogleAnalytics.php'; // include google analytics
|
||||||
?>
|
?>
|
||||||
|
|
Reference in a new issue