mirror of
https://github.com/nikdoof/ohayodash.git
synced 2025-12-13 18:12:17 +00:00
Strip down templates and JS
This commit is contained in:
@@ -20,7 +20,7 @@ function handleKeyPress(e) {
|
||||
if (key == 13) { // Search functions
|
||||
search(text);
|
||||
}
|
||||
if(key == 32){ //Space to go to search
|
||||
if (key == 32) { //Space to go to search
|
||||
document.getElementById("keywords").focus();
|
||||
}
|
||||
sindex = 0;
|
||||
@@ -28,42 +28,7 @@ function handleKeyPress(e) {
|
||||
}
|
||||
|
||||
function search(text) {
|
||||
var option = text.substr(1, text.indexOf(' ') - 1) || text.substr(1);
|
||||
var subtext = text.substr(2 + option.length);
|
||||
if (text[0] === '/') {
|
||||
if (text.indexOf(' ') > -1) {
|
||||
switch (option) {
|
||||
case "d":
|
||||
window.location = "https://duckduckgo.com/?q=" + subtext;
|
||||
break;
|
||||
case "i":
|
||||
window.location = "https://www.imdb.com/find?q=" + subtext;
|
||||
break;
|
||||
case "r":
|
||||
window.location = "https://www.reddit.com/search?q=" + subtext;
|
||||
break;
|
||||
case "y":
|
||||
window.location = "https://www.youtube.com/results?search_query=" + subtext;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
var option = text.substr(1);
|
||||
switch (option) {
|
||||
case "d":
|
||||
window.location = "https://www.duckduckgo.com";
|
||||
break;
|
||||
case "y":
|
||||
window.location = "https://www.youtube.com";
|
||||
break;
|
||||
case "r":
|
||||
window.location = "https://reddit.com";
|
||||
break;
|
||||
case "s":
|
||||
window.location = "https://open.spotify.com";
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (validURL(text)) {
|
||||
if (validURL(text)) {
|
||||
if (containsProtocol(text))
|
||||
window.location = text;
|
||||
else
|
||||
@@ -89,7 +54,7 @@ function containsProtocol(str) {
|
||||
return !!pattern.test(str);
|
||||
}
|
||||
|
||||
String.prototype.replaceAll = function(search, replacement) {
|
||||
String.prototype.replaceAll = function (search, replacement) {
|
||||
var target = this;
|
||||
return target.split(search).join(replacement);
|
||||
};
|
||||
|
||||
@@ -101,7 +101,7 @@ for (let i = 0; i < dataThemeButtons.length; i++) {
|
||||
'color-text-acc': '#6EE2FF'
|
||||
});
|
||||
return;
|
||||
|
||||
|
||||
case 'blues':
|
||||
setTheme({
|
||||
'color-background': '#2B2C56',
|
||||
@@ -109,7 +109,7 @@ for (let i = 0; i < dataThemeButtons.length; i++) {
|
||||
'color-text-acc': '#6677EB'
|
||||
});
|
||||
return;
|
||||
|
||||
|
||||
case 'passion':
|
||||
setTheme({
|
||||
'color-background': '#f5f5f5',
|
||||
@@ -117,7 +117,7 @@ for (let i = 0; i < dataThemeButtons.length; i++) {
|
||||
'color-text-acc': '#8e24aa'
|
||||
});
|
||||
return;
|
||||
|
||||
|
||||
case 'chalk':
|
||||
setTheme({
|
||||
'color-background': '#263238',
|
||||
@@ -125,7 +125,7 @@ for (let i = 0; i < dataThemeButtons.length; i++) {
|
||||
'color-text-acc': '#FF869A'
|
||||
});
|
||||
return;
|
||||
|
||||
|
||||
case 'paper':
|
||||
setTheme({
|
||||
'color-background': '#F8F6F1',
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
|
||||
<link type="text/css" rel="stylesheet" href="./static/css/styles.css" media="screen,projection" />
|
||||
<link href="//fonts.googleapis.com/css?family=Roboto:400,500,700,900" rel="stylesheet">
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.62.2/codemirror.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.62.2/addon/lint/lint.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.62.2/theme/dracula.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.62.2/addon/fold/foldgutter.min.css" rel="stylesheet" type="text/css">
|
||||
<script src="//code.iconify.design/1/1.0.7/iconify.min.js"></script>
|
||||
</head>
|
||||
|
||||
@@ -102,14 +98,6 @@
|
||||
|
||||
<script src="./static/js/themer.js" type="text/javascript"></script>
|
||||
<script src="./static/js/search.js" type="text/javascript"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.62.2/codemirror.min.js" type="text/javascript"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.62.2/mode/yaml/yaml.min.js" type="text/javascript"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.62.2/addon/lint/yaml-lint.min.js" type="text/javascript"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.62.2/addon/lint/lint.min.js" type="text/javascript"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.62.2/addon/fold/foldcode.min.js" type="text/javascript"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.62.2/addon/fold/foldgutter.min.js" type="text/javascript"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.62.2/addon/fold/indent-fold.min.js" type="text/javascript"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js" type="text/javascript"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user