| 1: | <?php
|
| 2: |
|
| 3: | final class SphpJsM{
|
| 4: | public function __construct() {
|
| 5: | $this->init();
|
| 6: | }
|
| 7: | public function init() {
|
| 8: | global $jslibpath;
|
| 9: |
|
| 10: |
|
| 11: |
|
| 12: |
|
| 13: | addFileLink("{$jslibpath}/jquery/jquery-3.2.1.min.js", true, "jquery-min","js","jquery:3.2.1");
|
| 14: |
|
| 15: |
|
| 16: |
|
| 17: |
|
| 18: | addFileLink("{$jslibpath}/jquery/jslib.js", true);
|
| 19: |
|
| 20: |
|
| 21: |
|
| 22: | addHeaderJSFunction('ready', "$(document).ready(function() {", "});", true);
|
| 23: | addHeaderJSFunction('ready', "$(document).ready(function() {", "});");
|
| 24: | addHeaderJSFunction('pageload', "$(window).on('load',function() {", "});", true);
|
| 25: | addFileLink('sphpjq = window.jQuery = window.$ = jql;',true,"jquery-js-code","js");
|
| 26: |
|
| 27: | addHeaderJSFunction('onconsole', "window['onconsole'] = function(msg,type='l'){var nooutput = false;", " if(!nooutput){switch(type){
|
| 28: | case \"i\": {sconsole.info(msg); break;}
|
| 29: | case \"w\": {sconsole.warn(msg); break;}
|
| 30: | case \"e\": {sconsole.error(msg);break;}
|
| 31: | default: {sconsole.log(msg);break;}
|
| 32: | }
|
| 33: | }};", true);
|
| 34: |
|
| 35: | }
|
| 36: |
|
| 37: | public static function addAlertDialog() {
|
| 38: | global $jslibpath;
|
| 39: | addFileLink("$jslibpath/jquery/jquery-confirm.min.css", true);
|
| 40: | addFileLink("$jslibpath/jquery/jquery-confirm.min.js", true);
|
| 41: | addFileLink("$jslibpath/jquery/alertDialog.js", true);
|
| 42: | }
|
| 43: | public static function addjQueryl($default=false,$replaceVar="") {
|
| 44: | global $jslibpath;
|
| 45: | updateFileLink("$jslibpath/jquery/jquery-3.4.1.min.js", true, "jquery-min","js","jquery:3.4.1");
|
| 46: | addHeaderJSFunction('ready', "jql(document).ready(function() {", "});", true);
|
| 47: | addHeaderJSFunction('ready', "jql(document).ready(function() {", "});");
|
| 48: | addHeaderJSFunction('pageload', "jql(window).on('load',function() {", "});", true);
|
| 49: |
|
| 50: | if($default){
|
| 51: | updateFileLink('sphpjq = window.jQuery = window.$ '. $replaceVar .' = jql;',true,"jquery-js-code","js");
|
| 52: | }
|
| 53: | }
|
| 54: | public static function addjQuery2($default=false) {
|
| 55: | global $jslibpath;
|
| 56: | addFileLink("$jslibpath/jquery/jquery-2.2.4.min.js", true, "jquery-min2","js");
|
| 57: | addHeaderJSFunction('readyjq2', "jq2(document).ready(function() {", "});", true);
|
| 58: | addHeaderJSFunction('readyjq2', "jq2(document).ready(function() {", "});");
|
| 59: | addHeaderJSFunction('pageloadjq2', "jq2(window).on('load',function() {", "});", true);
|
| 60: | if($default){
|
| 61: | updateFileLink('sphpjq = window.jQuery = window.$ = jq2;',true,"jquery-js-code","js");
|
| 62: | }
|
| 63: |
|
| 64: | }
|
| 65: | public static function addjQuery1($default=false,$latest=false) {
|
| 66: | global $jslibpath;
|
| 67: | if($latest){
|
| 68: | updateFileLink("$jslibpath/jquery/jquery-min1.10.js", true, "jquery-min","js","jquery:1.10.0");
|
| 69: | }else{
|
| 70: | addFileLink("$jslibpath/jquery/jquery-min1.10.js", true, "jquery-min1","js");
|
| 71: | }
|
| 72: | addHeaderJSFunction('readyjq1', "jq1(document).ready(function() {", "});", true);
|
| 73: | addHeaderJSFunction('readyjq1', "jq1(document).ready(function() {", "});");
|
| 74: | addHeaderJSFunction('pageloadjq1', "jq1(window).on('load',function() {", "});", true);
|
| 75: | if($default){
|
| 76: | if($latest){
|
| 77: | updateFileLink('sphpjq = window.jQuery = window.$ = jq1 = jql;',true,"jquery-js-code","js");
|
| 78: | }else{
|
| 79: | updateFileLink('sphpjq = window.jQuery = window.$ = jq1;',true,"jquery-js-code","js");
|
| 80: | }
|
| 81: | }
|
| 82: |
|
| 83: | }
|
| 84: | public static function addjQueryUI($version="1.12.1") {
|
| 85: | global $jslibpath;
|
| 86: | addFileLink("$jslibpath/jquery-ui-" . $version . "/jquery-ui.min.css", true);
|
| 87: |
|
| 88: |
|
| 89: |
|
| 90: | addFileLink("$jslibpath/jquery-ui-" . $version . "/jquery-ui.min.js", true,"jquery-ui","","jqueryui:" . $version);
|
| 91: | }
|
| 92: |
|
| 93: | public static function addReact() {
|
| 94: | global $jslibpath;
|
| 95: | addFileLink("$jslibpath/react/react.production18.min.js", true,"","","react:18");
|
| 96: | addFileLink("$jslibpath/react/react-dom.production18.min.js", true,"","","reactdom:18");
|
| 97: | addFileLink("$jslibpath/react/babel6.26.0.min.js", true,"","","babel:6.26.0");
|
| 98: |
|
| 99: | }
|
| 100: |
|
| 101: | public static function addBootStrap5() {
|
| 102: | global $jslibpath;
|
| 103: | addFileLink("$jslibpath/twitter/bootstrap5/css/bootstrap.min.css", true,"","","bootstrap:5");
|
| 104: | addFileLink("$jslibpath/twitter/bootstrap5/js/bootstrap.bundle.min.js", true);
|
| 105: | SphpJsM::addAlertDialog();
|
| 106: |
|
| 107: | }
|
| 108: | public static function addBootStrap4() {
|
| 109: | SphpJsM::addBootStrap();
|
| 110: | }
|
| 111: | public static function addBootStrap() {
|
| 112: | global $jslibpath;
|
| 113: | addFileLink("$jslibpath/twitter/bootstrap4/css/bootstrap.min.css", true,"","","bootstrap:4");
|
| 114: |
|
| 115: |
|
| 116: |
|
| 117: |
|
| 118: | addFileLink("$jslibpath/twitter/bootstrap4/js/bootstrap.bundle.min.js", true);
|
| 119: |
|
| 120: | SphpJsM::addAlertDialog();
|
| 121: | }
|
| 122: | public static function addBootStrapKit() {
|
| 123: | global $jslibpath;
|
| 124: | SphpJsM::addFontAwesome();
|
| 125: | addFileLink("$jslibpath/twitter/bootstrap4/css/bootstrap.min.css", true,"","","bootstrap:4");
|
| 126: | addFileLink("$jslibpath/twitter/bootstrap4/css/bootstrap-grid.min.css", true);
|
| 127: | addFileLink("$jslibpath/twitter/bootstrap4/css/bootstrap-reboot.min.css", true);
|
| 128: | addFileLink("$jslibpath/fonts/Roboto.css",true);
|
| 129: | addFileLink("$jslibpath/twitter/bootstrap4/css/mdb.min.css",true);
|
| 130: | addFileLink("$jslibpath/twitter/bootstrap4/css/style.css",true);
|
| 131: | addFileLink("$jslibpath/twitter/bootstrap4/js/popper.min.js", true);
|
| 132: | addFileLink("$jslibpath/twitter/bootstrap4/js/bootstrap.min.js", true);
|
| 133: | addFileLink("$jslibpath/twitter/bootstrap4/js/bootstrap.bundle.min.js", true);
|
| 134: | addFileLink("$jslibpath/twitter/bootstrap4/js/mdb.min.js",true);
|
| 135: | }
|
| 136: |
|
| 137: | public static function addFontAwesome() {
|
| 138: | global $jslibpath;
|
| 139: | addFileLink("$jslibpath/fontawesome/css/font-awesome.min.css", true);
|
| 140: | }
|
| 141: |
|
| 142: | public static function addBootStrap3() {
|
| 143: | global $jslibpath;
|
| 144: | addFileLink("$jslibpath/twitter/bootstrap3/css/bootstrap.min.css", true,"","","bootstrap:3");
|
| 145: | addFileLink("$jslibpath/twitter/bootstrap3/css/bootstrap-theme.min.css", true);
|
| 146: | addFileLink("$jslibpath/twitter/bootstrap3/js/bootstrap.min.js", true);
|
| 147: | }
|
| 148: |
|
| 149: | public static function addAngular() {
|
| 150: | global $jslibpath;
|
| 151: | addFileLink("$jslibpath/angular/angular.js", true);
|
| 152: | addFileLink("$jslibpath/angular/angular-mocks.js", true);
|
| 153: | }
|
| 154: |
|
| 155: | public static function addjQueryMobile() {
|
| 156: | global $jslibpath;
|
| 157: |
|
| 158: | addFileLink("$jslibpath/jquery.mobile/jquery.mobile-1.4.5.min.css", true);
|
| 159: |
|
| 160: | addFileLink("$jslibpath/jquery.mobile/jquery.mobile-1.4.5.min.js", true);
|
| 161: | }
|
| 162: |
|
| 163: | }
|
| 164: | |