more shit
This commit is contained in:
parent
3d93375bf4
commit
443887dc10
13 changed files with 170 additions and 24 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
*replit*
|
*replit*
|
||||||
|
data/index
|
21
assets/themes/default/index.css
Normal file
21
assets/themes/default/index.css
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
h1 {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 15%;
|
||||||
|
font-size: 14vw;
|
||||||
|
}
|
||||||
|
div {
|
||||||
|
white-space: nowrap;
|
||||||
|
width: auto;
|
||||||
|
display: block;
|
||||||
|
margin-left: 30%;
|
||||||
|
margin-right: 30%;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
input[type="submit"]{
|
||||||
|
/*margin: 0;*/
|
||||||
|
margin-right: 30;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
input[type="text"]{
|
||||||
|
width: 85%;
|
||||||
|
}
|
22
assets/themes/default/main.css
Normal file
22
assets/themes/default/main.css
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
body {
|
||||||
|
background-color: #262631;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
a:link {
|
||||||
|
color: cyan;
|
||||||
|
}
|
||||||
|
a:visited{
|
||||||
|
color: mediumpurple;
|
||||||
|
}
|
||||||
|
a:hover {
|
||||||
|
color: rebeccapurple;
|
||||||
|
}
|
||||||
|
sts-icon.bracket {
|
||||||
|
color: #4f4f4f;
|
||||||
|
}
|
||||||
|
sts-icon.s{
|
||||||
|
color: darkolivegreen;
|
||||||
|
}
|
||||||
|
sts-icon.t{
|
||||||
|
color: saddlebrown;
|
||||||
|
}
|
5
data/locale/en_US/strings/aboutpage.ini
Normal file
5
data/locale/en_US/strings/aboutpage.ini
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
a = '<hr><a href="%s">%s</a>: %s'
|
||||||
|
b = 'running v%s'
|
||||||
|
ca = 'if there are problems with this page or any other page, contact'
|
||||||
|
cb = 'if there are problems with this page or any other page, contact either'
|
||||||
|
d = ' %s (<a href="mailto:%s">email</a>)'
|
|
@ -1,5 +1,15 @@
|
||||||
interactions[basic][cancel] = "Cancel"
|
locale_en_native = "English"
|
||||||
interactions[basic][no] = "No"
|
locale_en_this = "English"
|
||||||
interactions[basic][okay] = "OK"
|
region_us_native = "United States"
|
||||||
interactions[basic][yes] = "Yes"
|
region_us_this = "United States"
|
||||||
|
misc_stslogohover = "sts logo"
|
||||||
|
meta_project_name = "super tiny search"
|
||||||
|
meta_project_desc = "a super lightweight and privacy-centered search engine!"
|
||||||
|
interactions_basic_cancel = "Cancel"
|
||||||
|
interactions_basic_no = "No"
|
||||||
|
interactions_basic_okay = "OK"
|
||||||
|
interactions_basic_yes = "Yes"
|
||||||
|
interactions_basic_search = "Search"
|
||||||
|
interactions_basic_about = "About"
|
||||||
|
interactions_adv_aboutx = "About $"
|
||||||
|
interactions_searcharea_hint = "Search query"
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
results[found] = "found $ results"
|
results_found = "found $ results"
|
||||||
results[foundonlyone] = "found 1 result"
|
results_foundonlyone = "found 1 result"
|
||||||
results[none] = "no results found"
|
results_none = "no results found"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
interactions[choose][tp][acceptnew] = "Accept"
|
interactions_choose_tp_acceptnew = "Accept"
|
1
data/misc/icon/html.html
Normal file
1
data/misc/icon/html.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<i><sts-icon class="bracket left">[</sts-icon><sts-icon class="s left">s</sts-icon><sts-icon class="t">t</sts-icon><sts-icon class="s right">s</sts-icon><sts-icon class="bracket right">]</sts-icon></i>
|
1
data/misc/icon/text.txt
Normal file
1
data/misc/icon/text.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
[sts]
|
16
dynamicGen.php
Normal file
16
dynamicGen.php
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
if(!$_GET && !$_POST){
|
||||||
|
http_response_code(400);
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
if($_GET['content']=='aboutserver'){
|
||||||
|
require 'src/pages/aboutPage.php';
|
||||||
|
echo '<html><head>';
|
||||||
|
echo "<link rel=\"stylesheet\" href=\"assets/themes/".$_COOKIE['sts_theme']."/main.css\">";
|
||||||
|
echo '</head><body>';
|
||||||
|
$out = genAbout('en_US') or die('something went wrong! go piss of tyler!');
|
||||||
|
echo $out;
|
||||||
|
echo '</body></html>';
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
?>
|
44
index.php
44
index.php
|
@ -1,15 +1,43 @@
|
||||||
|
<?php
|
||||||
|
// load config
|
||||||
|
$cfg=parse_ini_file("serve.ini", true);
|
||||||
|
|
||||||
|
// load locale
|
||||||
|
#$lang=locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||||
|
|
||||||
|
$lang="en_US";
|
||||||
|
$strings=parse_ini_file("data/locale/".$lang."/strings/main.ini");
|
||||||
|
|
||||||
|
// cookies
|
||||||
|
if(!isset($_COOKIE['sts_theme'])){
|
||||||
|
setcookie('sts_theme','default');
|
||||||
|
$_COOKIE['sts_theme'] = 'default';
|
||||||
|
}
|
||||||
|
if(!isset($_COOKIE['sts_scripting'])){
|
||||||
|
setcookie('sts_scripting','none');
|
||||||
|
$_COOKIE['sts_scripting'] = 'none';
|
||||||
|
}
|
||||||
|
?>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title><?</title>
|
<title><?php echo $cfg['META']['name']; ?></title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<?php
|
||||||
|
echo "<link rel=\"stylesheet\" href=\"assets/themes/".$_COOKIE['sts_theme']."/main.css\">";
|
||||||
|
echo "<link rel=\"stylesheet\" href=\"assets/themes/".$_COOKIE['sts_theme']."/index.css\">";
|
||||||
|
?>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<?php echo '<p>Hello World</p>'; ?>
|
<?php
|
||||||
|
echo "<h1 title=\"".$strings['misc_stslogohover']."\">".file_get_contents("data/misc/icon/html.html")."</h1><br>";
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
|
echo "<div class=\"searchbox\"><form id=\"searchbox\">\n";
|
||||||
|
echo "<input class=\"sbox\" type=\"text\" placeholder=\"".$strings['interactions_searcharea_hint']."\" name=\"query\">";
|
||||||
|
echo "<input type=\"submit\" value=\"".$strings['interactions_basic_search']."\">\n";
|
||||||
|
echo "</form></div>"
|
||||||
|
?>
|
||||||
|
|
||||||
<!--
|
<iframe style="position:absolute;bottom:30px;right:10px;" src="dynamicGen.php?content=aboutserver" width="376" height="276"></iframe>
|
||||||
This script places a badge on your repl's full-browser view back to your repl's cover
|
|
||||||
page. Try various colors for the theme: dark, light, red, orange, yellow, lime, green,
|
|
||||||
teal, blue, blurple, magenta, pink!
|
|
||||||
-->
|
|
||||||
<script src="https://replit.com/public/js/replit-badge.js" theme="blue" defer></script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
18
serve.ini
18
serve.ini
|
@ -1,22 +1,26 @@
|
||||||
[META]
|
[META]
|
||||||
name = "superTinySearch"
|
name = "superTinySearch"
|
||||||
version = [0, 0, 0]
|
version = [0, 0, 0]
|
||||||
maintain[][name] = "brendan Berger"
|
svn = 'https://basedwa.re/elburg/sts'
|
||||||
maintain[][email] = "whotookelburg"
|
|
||||||
svn = "<>"
|
[MAINTAINERS]
|
||||||
|
vals = 1
|
||||||
|
|
||||||
|
[MAINTAINERS_0]
|
||||||
|
name = 'brendan Berger'
|
||||||
|
email = 'whotookelburg@hotmail.com'
|
||||||
|
|
||||||
[FEATURES]
|
[FEATURES]
|
||||||
langs[] = "en_US"
|
langs[] = "en_US"
|
||||||
regions[] = "us"
|
regions[] = "us"
|
||||||
|
|
||||||
[FEATURES.APPLETS]
|
[APPLETS]
|
||||||
enabled = false
|
enabled = false
|
||||||
runtimes[] = "ecmascript"
|
|
||||||
|
|
||||||
[FEATURES.UI]
|
[UI]
|
||||||
themes[] = "default"
|
themes[] = "default"
|
||||||
default = "default"
|
default = "default"
|
||||||
|
icon = "text"
|
||||||
|
|
||||||
[INDEX]
|
[INDEX]
|
||||||
sites[] = "none"
|
sites[] = "none"
|
||||||
|
|
||||||
|
|
37
src/pages/aboutPage.php
Normal file
37
src/pages/aboutPage.php
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
function &genAbout($language): ?string{
|
||||||
|
$strings=array_merge(
|
||||||
|
parse_ini_file(__DIR__.'/../../data/locale/'.$language.'/strings/aboutpage.ini'),
|
||||||
|
parse_ini_file(__DIR__.'/../../data/locale/'.$language.'/strings/main.ini')
|
||||||
|
);
|
||||||
|
$conf=parse_ini_file(__DIR__.'./../../serve.ini',true);
|
||||||
|
$output="<h1 title=\"".$strings['misc_stslogohover']."\">".file_get_contents(__DIR__."/../../data/misc/icon/html.html")."</h1>";
|
||||||
|
$output=$output.sprintf(
|
||||||
|
$strings['a'],
|
||||||
|
$conf['META']['svn'],
|
||||||
|
$strings['meta_project_name'],
|
||||||
|
$strings['meta_project_desc']
|
||||||
|
).
|
||||||
|
'<br>'.
|
||||||
|
sprintf(
|
||||||
|
$strings['b'],
|
||||||
|
sprintf(
|
||||||
|
'%d.%d.%d',
|
||||||
|
$conf['META']['version'][0],
|
||||||
|
$conf['META']['version'][1],
|
||||||
|
$conf['META']['version'][2]
|
||||||
|
)
|
||||||
|
).
|
||||||
|
'<hr>'.
|
||||||
|
$strings['ca'].
|
||||||
|
'<br>'.
|
||||||
|
sprintf(
|
||||||
|
$strings['d'],
|
||||||
|
$conf['MAINTAINERS_0']['name'],
|
||||||
|
$conf['MAINTAINERS_0']['email'],
|
||||||
|
$conf['MAINTAINERS_0']['email']
|
||||||
|
);
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
?>
|
Loading…
Reference in a new issue