2020-02-09 23:02:19 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Elements;
|
|
|
|
|
2020-04-03 15:56:04 +02:00
|
|
|
class Script extends \View {
|
2020-02-09 23:02:19 +01:00
|
|
|
|
|
|
|
const MIME_TEXT_JAVASCRIPT = "text/javascript";
|
|
|
|
|
|
|
|
const CORE = "/js/script.js";
|
|
|
|
// const HOME = "/js/home.js";
|
2020-02-10 00:52:25 +01:00
|
|
|
const ADMIN = "/js/admin.js";
|
2020-02-09 23:02:19 +01:00
|
|
|
// const SORTTABLE = "/js/sorttable.js";
|
|
|
|
const JQUERY = "/js/jquery.min.js";
|
|
|
|
// const JQUERY_UI = "/js/jquery-ui.js";
|
|
|
|
// const JQUERY_MASKED_INPUT = "/js/jquery.maskedinput.min.js";
|
|
|
|
// const JQUERY_CONTEXT_MENU = "/js/jquery.contextmenu.min.js";
|
|
|
|
// const JQUERY_TERMINAL = "/js/jquery.terminal.min.js";
|
|
|
|
// const JQUERY_TERMINAL_UNIX = "/js/unix_formatting.js";
|
|
|
|
// const JSCOLOR = "/js/jscolor.min.js";
|
|
|
|
// const SYNTAX_HIGHLIGHTER = "/js/syntaxhighlighter.js";
|
|
|
|
// const HIGHLIGHT = "/js/highlight.pack.js";
|
|
|
|
// const GOOGLE_CHARTS = "/js/loader.js";
|
2020-04-03 22:10:21 +02:00
|
|
|
// const BOOTSTRAP = "/js/bootstrap.min.js";
|
2020-02-09 23:02:19 +01:00
|
|
|
// const BOOTSTRAP_DATEPICKER_JS = "/js/bootstrap-datepicker.min.js";
|
|
|
|
// const POPPER = "/js/popper.min.js";
|
|
|
|
// const JSMPEG = "/js/jsmpeg.min.js";
|
|
|
|
// const MOMENT = "/js/moment.min.js";
|
|
|
|
// const CHART = "/js/chart.js";
|
|
|
|
// const REVEALJS = "/js/reveal.js";
|
|
|
|
// const REVEALJS_PLUGIN_NOTES = "/js/reveal_notes.js";
|
|
|
|
const INSTALL = "/js/install.js";
|
2020-04-03 22:10:21 +02:00
|
|
|
const BOOTSTRAP = "/js/bootstrap.bundle.min.js";
|
2020-02-09 23:02:19 +01:00
|
|
|
|
|
|
|
const HIGHLIGHT_JS_LOADER = "\$(document).ready(function(){\$('code').each(function(i, block) { hljs.highlightBlock(block); }); })";
|
2020-04-03 22:10:21 +02:00
|
|
|
const ADMINLTE = "/js/adminlte.min.js";
|
2020-02-09 23:02:19 +01:00
|
|
|
|
2020-04-03 15:56:04 +02:00
|
|
|
private string $type;
|
|
|
|
private string $content;
|
2020-04-03 17:39:58 +02:00
|
|
|
private string $src;
|
2020-02-09 23:02:19 +01:00
|
|
|
|
|
|
|
function __construct($type, $src, $content = "") {
|
2020-04-03 17:39:58 +02:00
|
|
|
$this->src = $src;
|
2020-02-09 23:02:19 +01:00
|
|
|
$this->type = $type;
|
|
|
|
$this->content = $content;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getCode() {
|
2020-04-03 17:39:58 +02:00
|
|
|
$src = (empty($this->src) ? "" : " src=\"$this->src\"");
|
|
|
|
return "<script type=\"$this->type\"$src>$this->content</script>";
|
2020-02-09 23:02:19 +01:00
|
|
|
}
|
2020-04-03 15:56:04 +02:00
|
|
|
}
|