JavaScript extension support

This commit is contained in:
mmk2410 2015-12-05 18:21:22 +01:00
parent ac67c0fae1
commit fe2e50b3b6
2 changed files with 20 additions and 0 deletions

11
extensions/example.js Normal file
View 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());

View file

@ -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
?> ?>