diff options
author | Phie <phie@phie.ovh> | 2018-08-21 18:39:12 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2018-08-21 18:39:12 +0300 |
commit | 7d24cc0120859fc4e46b301c08effc97ddfbb1bb (patch) | |
tree | 94b5b52074022ceccd4c91073f217feaec38ca40 /templates |
first commit for Carnet NC server
Diffstat (limited to 'templates')
-rwxr-xr-x | templates/content/index.php | 1 | ||||
-rwxr-xr-x | templates/index.php | 18 | ||||
-rwxr-xr-x | templates/navigation/index.php | 10 | ||||
-rwxr-xr-x | templates/settings/index.php | 10 | ||||
-rwxr-xr-x | templates/writer.php | 20 |
5 files changed, 59 insertions, 0 deletions
diff --git a/templates/content/index.php b/templates/content/index.php new file mode 100755 index 0000000..159202e --- /dev/null +++ b/templates/content/index.php @@ -0,0 +1 @@ +<h1>Hello world</h1> diff --git a/templates/index.php b/templates/index.php new file mode 100755 index 0000000..7bff5a8 --- /dev/null +++ b/templates/index.php @@ -0,0 +1,18 @@ +<?php + +$currentpath = substr(get_defined_vars()["file"],strlen(getcwd())+1, -strlen("index.php"))."/CarnetElectron/"; + +$file = file_get_contents($currentpath."index.html"); +// +$file = str_replace("href=\"","href=\"".substr(__DIR__, strlen($_SERVER['DOCUMENT_ROOT']))."/CarnetElectron/",$file); + +preg_match_all('/<script.*?src=\"(.*?\.js(?:\?.*?)?)"/si', $file, $matches, PREG_PATTERN_ORDER); +for ($i = 0; $i < count($matches[1]); $i++) { + script("carnet","../templates/CarnetElectron/".substr($matches[1][$i],0,-3)); +} +$file = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $file); +$root = substr(__DIR__, strlen($_SERVER['DOCUMENT_ROOT'])); +$file = str_replace("src=\"","defer src=\"".$root."/CarnetElectron/",$file); +echo $file; +echo "<span style=\"display:none;\" id=\"root-url\">".$root."/CarnetElectron/</span>"; +?>
\ No newline at end of file diff --git a/templates/navigation/index.php b/templates/navigation/index.php new file mode 100755 index 0000000..efa95c6 --- /dev/null +++ b/templates/navigation/index.php @@ -0,0 +1,10 @@ +<ul> + <li><a href="#">First level entry</a></li> + <li> + <a href="#">First level container</a> + <ul> + <li><a href="#">Second level entry</a></li> + <li><a href="#">Second level entry</a></li> + </ul> + </li> +</ul> diff --git a/templates/settings/index.php b/templates/settings/index.php new file mode 100755 index 0000000..ac7c671 --- /dev/null +++ b/templates/settings/index.php @@ -0,0 +1,10 @@ +<div id="app-settings"> + <div id="app-settings-header"> + <button class="settings-button" + data-apps-slide-toggle="#app-settings-content" + ></button> + </div> + <div id="app-settings-content"> + <!-- Your settings in here --> + </div> +</div> diff --git a/templates/writer.php b/templates/writer.php new file mode 100755 index 0000000..7c46252 --- /dev/null +++ b/templates/writer.php @@ -0,0 +1,20 @@ +<?php +$currentpath = substr(get_defined_vars()["file"],strlen(getcwd())+1, -strlen("writer.php"))."/CarnetElectron/"; + +$file = file_get_contents($currentpath."reader/reader.html"); +// +$file = str_replace("href=\"","href=\"".substr(__DIR__, strlen($_SERVER['DOCUMENT_ROOT']))."/CarnetElectron/",$file); +$file = str_replace("<!ROOTPATH>", "", $file); +preg_match_all('/<script.*?src=\"(.*?\.js(?:\?.*?)?)"/si', $file, $matches, PREG_PATTERN_ORDER); +for ($i = 0; $i < count($matches[1]); $i++) { + + $url = substr($matches[1][$i],0,-3); + if (strpos($url, 'jquery.min') == false) //jquery already in nextcloud + script("carnet","../templates/CarnetElectron/".$url); +} +$file = preg_replace('#<script(.*?)>(.*?)</script>#is', '', $file); +$root = substr(__DIR__, strlen($_SERVER['DOCUMENT_ROOT'])); +$file = str_replace("src=\"","defer src=\"".$root."/CarnetElectron/",$file); +echo $file; +echo "<span style=\"display:none;\" id=\"root-url\">".$root."/CarnetElectron/</span>"; +?>
\ No newline at end of file |