Skip to content
This repository has been archived by the owner on Sep 22, 2018. It is now read-only.

Commit

Permalink
Build und Installer Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kimbtech committed Dec 25, 2017
1 parent bf6c889 commit d7b9c16
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 239 deletions.
2 changes: 1 addition & 1 deletion build/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ console.log( "=> 1. Minify" );
{
//JS
console.log( "===> 1.1 JavaScript" );
var UglifyJS = require("uglify-js");
var UglifyJS = require("uglify-es");

[
__dirname + "/../system/load/backend",
Expand Down
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"license": "GPL-3.0",
"dependencies": {
"clean-css": "^4.1.9",
"uglify-js": "^3.2.2"
"uglify-es": "^3.3.1"
}
}
122 changes: 20 additions & 102 deletions install/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,31 +162,22 @@ public function __destruct(){
$abfr .= '<p>URL zu Impressum/ Support: <input type="text" value="http://example.com/impressum-datenschutz" name="impressumURL"></p>';
$abfr .= '<p>Beschriftung des Links zu Impressum/ Support: <input type="text" value="Impressum &amp; Datenschutz" name="impressumName"></p>';
$abfr .= '<p>Hinweise zur Syntax der Notizen anzeigen: <input type="radio" value="true" name="showMarkdownInfo" checked="checked"> Anzeigen <input type="radio" value="false" name="showMarkdownInfo"> Ausblenden </p>';
$abfr .= '<p>Prüfen nach Ändrungen alle <input type="number" value="60" name="sysPoll"> Sekunden.</p>';
$abfr .= '<p>OfflineApp durch CacheManifest anbieten: <input type="radio" value="true" name="AppCache" checked="checked"> Aktvieren <input type="radio" value="false" name="AppCache"> Deaktivieren</p>';
$abfr .= '<p><input type="hidden" value="yes" name="from2"></p>';
$abfr .= '<p><input type="submit" value="&rarr; Weiter"></p></form>';

$out->addBox( $abfr );

//Konfiguration Gerüst erstellen:
$_SESSION['confarray'] = array(
"config" => array(
"domain" => "",
"JSdevmin" => "",
"impressumURL" => "",
"impressumName" => "",
"showMarkdownInfo" => ""
),
"externeLibs" => array(
"",
array(
"fonts" => "",
"jqueryuiCSS" => "",
"jqueryui" => "",
"jquery" => "",
"sjcl" => "",
"qrcode" => ""
)
)
"domain" => "",
"JSdevmin" => "",
"impressumURL" => "",
"impressumName" => "",
"showMarkdownInfo" => "",
"sysPoll" => "",
"AppCache" => ""
);
}
else if( $step == 3 ){
Expand All @@ -204,99 +195,26 @@ public function __destruct(){
!empty( $_POST['impressumName'] )
&&
( $_POST['showMarkdownInfo'] == 'true' || $_POST['showMarkdownInfo'] == 'false' )
&&
is_numeric( $_POST['sysPoll'] )
&&
( $_POST['AppCache'] == 'true' || $_POST['AppCache'] == 'false' )
)
){
if( !empty( $_POST['from2'] ) ){
//Werte von 2 verarbeiten
$_SESSION['confarray']["config"] = array(
$_SESSION['confarray'] = array(
"domain" => $_POST['domain'],
"JSdevmin" => ( $_POST['JSdemvin'] == "dev" ? "dev" : "min" ),
"impressumURL" => $_POST["impressumURL"],
"impressumName" => $_POST["impressumName"],
"showMarkdownInfo" => ( $_POST['showMarkdownInfo'] == 'false' ? false : true )
"showMarkdownInfo" => ( $_POST['showMarkdownInfo'] == 'false' ? false : true ),
"sysPoll" => intval( $_POST['sysPoll'] ),
"AppCache" => ( $_POST['AppCache'] == 'false' ? false : true ),
);
}

//Libraries abfragen
$out->addBox( '<h2>External Libraries</h2>' );

$out->addBox(
'KIMB-Notes benötigt externe JS-Bibilotheken, die Quelle dieser muss hier angegeben werden.<br />'
.'Siehe <a href="https://github.com/kimbtech/KIMB-Notes/blob/master/js-libs/README.md" target="_blank">ReadMe</a><br />'
.'Es gibt zwei Möglichkeiten, entweder geben Sie zu jeder dieser Bibilotheken die genaue URL an oder Sie definieren ein Verzeichnis'
.'in dem die Bibilotheken nach vorgegebener Struktur liegen (ein solches Verzeichnis finden sie unter <code>/js-libs/</code>).'
);

$abfr = '<form action="?step=4" method="post">';
$abfr .= '<p><input type="radio" value="verzeichnis" name="modus" checked="checked" onclick="document.getElementById(\'libsVerzeichnis\').style.display = \'block\'; document.getElementById(\'libsEinzeln\').style.display = \'none\';"> Verzeichnis angeben <input type="radio" value="einzeln" name="modus" onclick="document.getElementById(\'libsVerzeichnis\').style.display = \'none\'; document.getElementById(\'libsEinzeln\').style.display = \'block\'; document.getElementById(\'libsVerzeichnisInput\').value = \'\';"> Einzeln angeben</p>';

$abfr .= '<div id="libsVerzeichnis">';
$abfr .= '<input type="text" id="libsVerzeichnisInput" name="libfolder" value="'.$siteurl.'/js-libs">';
$abfr .= '</div><div id="libsEinzeln" style="display:none;">';
$abfr .= '<input type="text" name="fonts" placeholder="Fonts"><br />';
$abfr .= '<input type="text" name="jqueryuiCSS" placeholder="jQuery-UI CSS"><br />';
$abfr .= '<input type="text" name="jqueryui" placeholder="jQuery-UI"><br />';
$abfr .= '<input type="text" name="jquery" placeholder="jQuery"><br />';
$abfr .= '<input type="text" name="sjcl" placeholder="SJCL"><br />';
$abfr .= '<input type="text" name="qrcode" placeholder="QR-Code"><br />';
$abfr .= '</div>';

$abfr .= '<p><input type="submit" value="&rarr; Weiter"></p></form>';

$out->addBox( $abfr );

}
else{
$out->addBox( '<div class="message error">Konnte Systemkonfiguration nicht sichern!</div>' );
$out->addBox( '<a href="?step=2"><button>&larr; Zurück</button></a>' );
}
}
else if( $step == 4 ){
//Übergaben okay?
if(
!empty( $_POST['modus'] )
&&
(
!empty( $_POST['libfolder'] )
||
(
!empty( $_POST['fonts'] )
&&
!empty( $_POST['jqueryuiCSS'] )
&&
!empty( $_POST['jqueryui'] )
&&
!empty( $_POST['jquery'] )
&&
!empty( $_POST['sjcl'] )
&&
!empty( $_POST['qrcode'] )
)
)
){
//Werte von 3 verarbeiten
$extarray = array();
// Verzeichnis oder einzeln?
if( !empty( $_POST['libfolder'] ) ){
$extarray = array( $_POST['libfolder'] );
}
else{
$extarray = array(
false,
array(
"fonts" => $_POST['fonts'],
"jqueryuiCSS" => $_POST['jqueryuiCSS'],
"jqueryui" => $_POST['jqueryui'],
"jquery" => $_POST['jquery'],
"sjcl" => $_POST['sjcl'],
"qrcode" => $_POST['qrcode']
)
);
}
//in die Config rein
$_SESSION['confarray']["externeLibs"] = $extarray;



//neue Config öffnen und schreiben
$conf = new JSONReader( 'config' );
// schreiben
Expand All @@ -311,8 +229,8 @@ public function __destruct(){
}
}
else{
$out->addBox( '<div class="message error">Konnte External Libraries nicht übernehmen!</div>' );
$out->addBox( '<a href="?step=3"><button>&larr; Zurück</button></a>' );
$out->addBox( '<div class="message error">Konnte Systemkonfiguration nicht sichern!</div>' );
$out->addBox( '<a href="?step=2"><button>&larr; Zurück</button></a>' );
}
}
else if( $step == 5 ){
Expand Down
4 changes: 3 additions & 1 deletion system/appcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@

echo "CACHE MANIFEST"."\r\n";
echo "# Version ".$versnum."\r\n";
// Code fuer JS dev
if( $jsdevmin == 'dev' ){
// Weiterer Versionscode für JS dev
foreach( scandir( __DIR__ . '/load/devjs/' ) as $fona ){
if( $fona != '.' && $fona != '..' && is_file( __DIR__ . '/load/devjs/'. $fona ) ){
echo "# ". $fona ." ".filemtime( __DIR__ . '/load/devjs/'. $fona )."\r\n";
}
}
}
echo "\r\n";
echo "CACHE:"."\r\n";
echo $domain."/index.php"."\r\n";
Expand Down
40 changes: 7 additions & 33 deletions system/data/config.example.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,9 @@
{
"config": {
"domain": "http:\/\/notes.example.com",
"JSdevmin": "min",
"impressumURL": "http:\/\/example.com\/impressum-datenschutz",
"impressumName": "Impressum &amp; Datenschutz",
"showMarkdownInfo" : true
},
"externeLibs": [
"https:\/\/data.example.com"
]
}

// Oder auch

{
"config": {
"domain": "http:\/\/notes.example.com",
"JSdevmin": "min",
"impressumURL": "http:\/\/example.com\/impressum-datenschutz",
"impressumName": "Impressum &amp; Datenschutz",
"showMarkdownInfo" : true
},
"externeLibs": [
false,
{
"fonts": "https:\/\/fonts.example.com\/fonts.css",
"jqueryuiCSS": "https:\/\/jquery.example.com\/jquery-ui.min.css",
"jqueryui": "https:\/\/jquery.example.com\/jquery-ui.mn.js",
"jquery": "https:\/\/jquery.example.com\/jquery.min.js",
"sjcl": "https:\/\/other.example.com\/sjcl.min.js",
"qrcode": "https:\/\/other.example.com\/qrcoe.min.js"
}
]
"domain": "http:\/\/notes.example.com",
"JSdevmin": "min",
"impressumURL": "http:\/\/example.com\/impressum-datenschutz",
"impressumName": "Impressum &amp; Datenschutz",
"showMarkdownInfo" : true,
"sysPoll" : 60,
"AppCache" : true
}

This file was deleted.

4 changes: 1 addition & 3 deletions system/data/notes/noteslist.json
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
[
"dbcd2987d264971c919982c79259c197815362fed683df428e1a881fcce22426b4a87ae8505a9b5f21160f3fc69e133f6860"
]
[]
7 changes: 0 additions & 7 deletions system/data/user/user_qassixxeldvqflejmkbmsmkbixaonp.json

This file was deleted.

4 changes: 1 addition & 3 deletions system/data/user/userslist.json
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
[
"qassixxeldvqflejmkbmsmkbixaonp"
]
[]
11 changes: 1 addition & 10 deletions system/data/userlist.json
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
[
{
"username": "admin",
"password": "6ae659ef03c9b9785dc49b9e9219b4f84be64eaa758477ed8ac87971ab928afd",
"salt": "BDtssPP9UfZpAkxF5vT52LMmHCIsXDmWpam3yCOI",
"userid": "qassixxeldvqflejmkbmsmkbixaonp",
"admin": true,
"authcodes": []
}
]
[]
8 changes: 5 additions & 3 deletions system/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@
require_once( __DIR__ . '/php/systemInit.php' );
//Domain holen
$domain = SystemInit::get( 'domain' );
//JSdivmin
//JSdevmin
$jsdevmin = SystemInit::get( 'JSdevmin' );
//AppCache
$manifest = SystemInit::get( 'AppCache' ) ? ' manifest="'.$domain.'/appcache.php"' : '';

?>
<!DOCTYPE html>
<html manifest="<?php echo $domain; ?>/appcache.php">
<html<?php echo $manifest ?>>
<head>
<title>KIMB-Notes</title>
<link rel="shortcut icon" href="<?php echo $domain; ?>/favicon.ico" type="image/x-icon; charset=binary">
Expand Down Expand Up @@ -90,7 +92,7 @@
<script src="<?php echo $domain; ?>/load/prism/prism.js"></script>

<link rel="stylesheet" type="text/css" href="<?php echo $domain; ?>/load/notes.<?php echo $jsdevmin; ?>.css">
<script>var domain = "<?php echo $domain; ?>", jsdevmin = "<?php echo $jsdevmin; ?>", global_polling_secs = 60; </script>
<script>var domain = "<?php echo $domain; ?>", jsdevmin = "<?php echo $jsdevmin; ?>", global_polling_secs = <?php echo SystemInit::get( 'sysPoll' ); ?> </script>
<script src="<?php echo $domain; ?>/load/notes.<?php echo $jsdevmin; ?>.js"></script>
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion system/load/backend.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d7b9c16

Please sign in to comment.