commit
3d2f006a6c
|
@ -1,7 +1,9 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Contact</title>
|
||||
<script src='https://www.google.com/recaptcha/api.js'></script>
|
||||
<link rel="stylesheet" href="main.css"/>
|
||||
<link rel="stylesheet" href="form.css"/>
|
||||
|
||||
<script>
|
||||
function sendMessage() {
|
||||
|
@ -25,7 +27,7 @@
|
|||
var email = document.getElementById('email').value;
|
||||
var message = document.getElementById('message').value;
|
||||
|
||||
window.location = 'http://mine-modinstaller.esy.es/send.php?subject=New Modinstaller message&message=Hello dear modinstaller admin.|The following message was sent to you by ' + email + ':'
|
||||
window.location = 'send.php?subject=New Modinstaller message&message=Hello dear modinstaller admin.|The following message was sent to you by ' + email + ':'
|
||||
+ '||' + message
|
||||
+ '||Sincerly yours|TOTALLY NOT A BOT';
|
||||
}
|
||||
|
@ -69,12 +71,12 @@
|
|||
<div class="no-robot" onclick="robot();">
|
||||
<input type="checkbox" class="robot-check" id="robot-check" checksum="k3jabsd2asd3uibash3dva9skjhd5uzf6gcvkehj1wdhqwz7qvusjdh8b">
|
||||
<label for="robot-check">
|
||||
<box></box>
|
||||
<span class="checkmark">
|
||||
<div class="checkmark_stem"></div>
|
||||
<div class="checkmark_kick"></div>
|
||||
</span>
|
||||
<a>I am not a robot</a>
|
||||
<box></box>
|
||||
<a>I'm not a robot</a>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Download</title>
|
||||
<link rel="stylesheet" href="main.css"/>
|
||||
<style>
|
||||
td {
|
||||
|
@ -21,24 +22,32 @@
|
|||
|
||||
<div class="content">
|
||||
Choose the download that fits your operating system below:<br>
|
||||
<h2>Universal (Windows, Linux, MacOS)</h2>
|
||||
<table width="300px">
|
||||
<h2>Windows</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Jar: </td>
|
||||
<td><a href="https://github.com/DevsWithoutHobbies/minetest-modinstaller/releases" style="color: #5882FA;">Download</a></td><!-- TODO: -->
|
||||
<td>Exe: </td>
|
||||
<td><a href="https://github.com/DevsWithoutHobbies/minetest-modinstaller/releases/download/v1.4/Minetest.Modinstaller-1.4.zip" style="color: #5882FA;">Download</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>MacOS</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<td>Installer: </td>
|
||||
<td><a href="https://github.com/DevsWithoutHobbies/minetest-modinstaller/releases" style="color: #5882FA;">Download</a></td><!-- TODO: -->
|
||||
<td><a href="https://github.com/DevsWithoutHobbies/minetest-modinstaller/releases/download/v1.4/Minetest.Modinstaller-1.4.pkg" style="color: #5882FA;">Download</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>App: </td>
|
||||
<td><a href="https://github.com/DevsWithoutHobbies/minetest-modinstaller/releases" style="color: #5882FA;">Download</a></td><!-- TODO: -->
|
||||
<td><a href="https://github.com/DevsWithoutHobbies/minetest-modinstaller/releases/download/v1.4/Minetest.Modinstaller-1.4.dmg" style="color: #5882FA;">Download</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Universal (Windows, Linux, MacOS)</h2>
|
||||
<table width="300px">
|
||||
<tr>
|
||||
<td>Jar: </td>
|
||||
<td><a href="https://github.com/DevsWithoutHobbies/minetest-modinstaller/releases/download/v1.4/Minetest.Modinstaller-1.4.jar" style="color: #5882FA;">Download</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,126 @@
|
|||
.form {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
tr {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.first {
|
||||
width: 20%;
|
||||
text-align: right;
|
||||
font-size: 20px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
input {
|
||||
border-radius: 10px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: black;
|
||||
height: 30px;
|
||||
width: 100%;
|
||||
font-size: 20px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
textarea {
|
||||
border-radius: 10px;
|
||||
border-width: 1px;
|
||||
height: 100px;
|
||||
width: 100%;
|
||||
font-size: 20px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.second {
|
||||
width: 80%;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.no-robot {
|
||||
background-color: white;
|
||||
border-radius: 2px;
|
||||
border-color: #999;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
width: 250px;
|
||||
height: 44px;
|
||||
padding: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
input[type="checkbox"] + label {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
input[type="checkbox"] + label a {
|
||||
position: relative;
|
||||
left: -49px;
|
||||
}
|
||||
|
||||
input[type="checkbox"] + label span {
|
||||
/*display: none;*/
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
input[type="checkbox"] + label box {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
input[type="checkbox"]:checked + label a {
|
||||
/*left: -39px;*/
|
||||
}
|
||||
|
||||
input[type="checkbox"]:checked + label span {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
z-index: 1
|
||||
}
|
||||
|
||||
input[type="checkbox"]:checked + label box {
|
||||
/*left: -49px;*/
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
box {
|
||||
position: relative;
|
||||
left: -49;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border: 1px solid #555;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.checkmark {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.checkmark_stem {
|
||||
position: absolute;
|
||||
width: 6px;
|
||||
height: 18px;
|
||||
background-color: #3e3;
|
||||
left: 22px;
|
||||
top: 12px;
|
||||
}
|
||||
|
||||
.checkmark_kick {
|
||||
position: absolute;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
background-color:#3e3;
|
||||
left: 16px;
|
||||
top: 24px;
|
||||
}
|
29
index.html
29
index.html
|
@ -1,8 +1,34 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Home</title>
|
||||
<link rel="stylesheet" href="main.css"/>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
|
||||
<script src="notify.js"></script>
|
||||
<script>
|
||||
function getQueryParams(qs) {
|
||||
qs = qs.split('+').join(' ');
|
||||
|
||||
var params = {},
|
||||
tokens,
|
||||
re = /[?&]?([^=]+)=([^&]*)/g;
|
||||
|
||||
while (tokens = re.exec(qs)) {
|
||||
params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]);
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
function load() {
|
||||
var success = getQueryParams(document.location.search).success;
|
||||
if (success == 'true') {
|
||||
$.notify('Youre request was sent successfully', 'success');
|
||||
} else if (success == 'false') {
|
||||
$.notify('There was an error with your request', 'warn');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<body onload="load();">
|
||||
<div class="header">
|
||||
<h1>Minetest Modinstaller</h1>
|
||||
</div>
|
||||
|
@ -16,6 +42,7 @@
|
|||
<div class="content">
|
||||
The Minetest Modinstaller is a tool, that allows you to easily install,
|
||||
manage and update all your favorite Minetest mods.
|
||||
<center><img src="gnp.png" width="100%"/></center>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
.instruction_header {
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100px;
|
||||
margin-top: 20px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.instruction_content {
|
||||
width: 90%;
|
||||
position: relative;
|
||||
left: 5%;
|
||||
top: 20px;
|
||||
padding: 40px;
|
||||
margin: 0;
|
||||
background-color: #EEEEEE;
|
||||
font-family: "Segoe UI", Arial, sans-serif;
|
||||
font-size: 23px;
|
||||
color: #222;
|
||||
box-sizing: border-box;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="main.css"/>
|
||||
<link rel="stylesheet" href="instructions.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="instruction_header">
|
||||
<h1>Modinstaller</h1>
|
||||
</div>
|
||||
|
||||
<div class="instruction_content">
|
||||
<h2>Instructions</h2>
|
||||
Left-click name to view info<br><br>
|
||||
Right- or double-click name to enable a mod<br>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
123
main.css
123
main.css
|
@ -71,129 +71,6 @@ a {
|
|||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.form {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
tr {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.first {
|
||||
width: 20%;
|
||||
text-align: right;
|
||||
font-size: 20px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
input {
|
||||
border-radius: 10px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: black;
|
||||
height: 30px;
|
||||
width: 100%;
|
||||
font-size: 20px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
textarea {
|
||||
border-radius: 10px;
|
||||
border-width: 1px;
|
||||
height: 100px;
|
||||
width: 100%;
|
||||
font-size: 20px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.second {
|
||||
width: 80%;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.no-robot {
|
||||
background-color: white;
|
||||
border-radius: 2px;
|
||||
border-color: #999;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
width: 250px;
|
||||
height: 44px;
|
||||
padding: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
input[type="checkbox"] + label {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
input[type="checkbox"] + label a {
|
||||
position: relative;
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
input[type="checkbox"] + label span {
|
||||
display: none;
|
||||
}
|
||||
|
||||
input[type="checkbox"] + label box {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
input[type="checkbox"]:checked + label a {
|
||||
left: -38px;
|
||||
}
|
||||
|
||||
input[type="checkbox"]:checked + label span {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
left: -49px;
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
input[type="checkbox"]:checked + label box {
|
||||
|
||||
}
|
||||
|
||||
box {
|
||||
position: relative;
|
||||
left: 0;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border: 1px solid #555;
|
||||
}
|
||||
|
||||
.checkmark {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.checkmark_stem {
|
||||
position: absolute;
|
||||
width: 6px;
|
||||
height: 18px;
|
||||
background-color: #3e3;
|
||||
left: 22px;
|
||||
top: 12px;
|
||||
}
|
||||
|
||||
.checkmark_kick {
|
||||
position: absolute;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
background-color:#3e3;
|
||||
left: 16px;
|
||||
top: 24px;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 715px) {
|
||||
.header {
|
||||
top: 0;
|
||||
|
|
34
modinfo.css
34
modinfo.css
|
@ -7,11 +7,31 @@
|
|||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
color: #33cc33;
|
||||
font-size: 5vw;
|
||||
font-family: "Segoe UI", Arial, sans-serif;
|
||||
}
|
||||
|
||||
.mod_header {
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100px;
|
||||
margin-top: 80px;
|
||||
width: 100%;
|
||||
}
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin-top: 20px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mod_content {
|
||||
width: 90%;
|
||||
position: relative;
|
||||
left: 5%;
|
||||
top: 20px;
|
||||
padding: 40px;
|
||||
margin: 0;
|
||||
background-color: #EEEEEE;
|
||||
font-family: "Segoe UI", Arial, sans-serif;
|
||||
font-size: 23px;
|
||||
color: #222;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
|
19
modinfo.html
19
modinfo.html
|
@ -1,6 +1,5 @@
|
|||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="main.css"/>
|
||||
<link rel="stylesheet" href="modinfo.css"/>
|
||||
|
||||
<script>
|
||||
|
@ -25,26 +24,26 @@
|
|||
// 3: image url
|
||||
// 4: description
|
||||
document.getElementById("name").innerHTML = modData[0];
|
||||
document.getElementById("author").innerHTML = modData[2];
|
||||
if (modData[3] !== "") {
|
||||
document.getElementById("mod_img").src = modData[3];
|
||||
document.getElementById("author").innerHTML = modData[4];
|
||||
if (modData[5] !== "") {
|
||||
document.getElementById("mod_img").src = modData[5];
|
||||
}
|
||||
document.getElementById("description").innerHTML = modData[4];
|
||||
document.getElementById("description").innerHTML = modData[6];
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="showContent();">
|
||||
<div class="mod_header">
|
||||
<h1 id="name">Minetest Modinstaller</h1>
|
||||
<h1 id="name">Loading...</h1>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<div class="mod_content">
|
||||
<div style="text-align: center;">
|
||||
<img id="mod_img" src="" />
|
||||
<div id="description"></div>
|
||||
<img id="mod_img" src="">
|
||||
<div id="description">Loading...</div>
|
||||
<br>
|
||||
<div class="mod_author">
|
||||
Author: <span id="author"></span>
|
||||
Author: <span id="author">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,630 @@
|
|||
/* Notify.js - http://notifyjs.com/ Copyright (c) 2015 MIT */
|
||||
(function (factory) {
|
||||
// UMD start
|
||||
// https://github.com/umdjs/umd/blob/master/jqueryPluginCommonjs.js
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node/CommonJS
|
||||
module.exports = function( root, jQuery ) {
|
||||
if ( jQuery === undefined ) {
|
||||
// require('jQuery') returns a factory that requires window to
|
||||
// build a jQuery instance, we normalize how we use modules
|
||||
// that require this pattern but the window provided is a noop
|
||||
// if it's defined (how jquery works)
|
||||
if ( typeof window !== 'undefined' ) {
|
||||
jQuery = require('jquery');
|
||||
}
|
||||
else {
|
||||
jQuery = require('jquery')(root);
|
||||
}
|
||||
}
|
||||
factory(jQuery);
|
||||
return jQuery;
|
||||
};
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
//IE8 indexOf polyfill
|
||||
var indexOf = [].indexOf || function(item) {
|
||||
for (var i = 0, l = this.length; i < l; i++) {
|
||||
if (i in this && this[i] === item) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
|
||||
var pluginName = "notify";
|
||||
var pluginClassName = pluginName + "js";
|
||||
var blankFieldName = pluginName + "!blank";
|
||||
|
||||
var positions = {
|
||||
t: "top",
|
||||
m: "middle",
|
||||
b: "bottom",
|
||||
l: "left",
|
||||
c: "center",
|
||||
r: "right"
|
||||
};
|
||||
var hAligns = ["l", "c", "r"];
|
||||
var vAligns = ["t", "m", "b"];
|
||||
var mainPositions = ["t", "b", "l", "r"];
|
||||
var opposites = {
|
||||
t: "b",
|
||||
m: null,
|
||||
b: "t",
|
||||
l: "r",
|
||||
c: null,
|
||||
r: "l"
|
||||
};
|
||||
|
||||
var parsePosition = function(str) {
|
||||
var pos;
|
||||
pos = [];
|
||||
$.each(str.split(/\W+/), function(i, word) {
|
||||
var w;
|
||||
w = word.toLowerCase().charAt(0);
|
||||
if (positions[w]) {
|
||||
return pos.push(w);
|
||||
}
|
||||
});
|
||||
return pos;
|
||||
};
|
||||
|
||||
var styles = {};
|
||||
|
||||
var coreStyle = {
|
||||
name: "core",
|
||||
html: "<div class=\"" + pluginClassName + "-wrapper\">\n <div class=\"" + pluginClassName + "-arrow\"></div>\n <div class=\"" + pluginClassName + "-container\"></div>\n</div>",
|
||||
css: "." + pluginClassName + "-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n." + pluginClassName + "-corner ." + pluginClassName + "-wrapper,\n." + pluginClassName + "-corner ." + pluginClassName + "-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n." + pluginClassName + "-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n." + pluginClassName + "-container {\n display: none;\n z-index: 1;\n position: absolute;\n}\n\n." + pluginClassName + "-hidable {\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n." + pluginClassName + "-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}"
|
||||
};
|
||||
|
||||
var stylePrefixes = {
|
||||
"border-radius": ["-webkit-", "-moz-"]
|
||||
};
|
||||
|
||||
var getStyle = function(name) {
|
||||
return styles[name];
|
||||
};
|
||||
|
||||
var removeStyle = function(name) {
|
||||
if (!name) {
|
||||
throw "Missing Style name";
|
||||
}
|
||||
if (styles[name]) {
|
||||
delete styles[name];
|
||||
}
|
||||
};
|
||||
|
||||
var addStyle = function(name, def) {
|
||||
if (!name) {
|
||||
throw "Missing Style name";
|
||||
}
|
||||
if (!def) {
|
||||
throw "Missing Style definition";
|
||||
}
|
||||
if (!def.html) {
|
||||
throw "Missing Style HTML";
|
||||
}
|
||||
//remove existing style
|
||||
var existing = styles[name];
|
||||
if (existing && existing.cssElem) {
|
||||
if (window.console) {
|
||||
console.warn(pluginName + ": overwriting style '" + name + "'");
|
||||
}
|
||||
styles[name].cssElem.remove();
|
||||
}
|
||||
def.name = name;
|
||||
styles[name] = def;
|
||||
var cssText = "";
|
||||
if (def.classes) {
|
||||
$.each(def.classes, function(className, props) {
|
||||
cssText += "." + pluginClassName + "-" + def.name + "-" + className + " {\n";
|
||||
$.each(props, function(name, val) {
|
||||
if (stylePrefixes[name]) {
|
||||
$.each(stylePrefixes[name], function(i, prefix) {
|
||||
return cssText += " " + prefix + name + ": " + val + ";\n";
|
||||
});
|
||||
}
|
||||
return cssText += " " + name + ": " + val + ";\n";
|
||||
});
|
||||
return cssText += "}\n";
|
||||
});
|
||||
}
|
||||
if (def.css) {
|
||||
cssText += "/* styles for " + def.name + " */\n" + def.css;
|
||||
}
|
||||
if (cssText) {
|
||||
def.cssElem = insertCSS(cssText);
|
||||
def.cssElem.attr("id", "notify-" + def.name);
|
||||
}
|
||||
var fields = {};
|
||||
var elem = $(def.html);
|
||||
findFields("html", elem, fields);
|
||||
findFields("text", elem, fields);
|
||||
def.fields = fields;
|
||||
};
|
||||
|
||||
var insertCSS = function(cssText) {
|
||||
var e, elem, error;
|
||||
elem = createElem("style");
|
||||
elem.attr("type", 'text/css');
|
||||
$("head").append(elem);
|
||||
try {
|
||||
elem.html(cssText);
|
||||
} catch (_) {
|
||||
elem[0].styleSheet.cssText = cssText;
|
||||
}
|
||||
return elem;
|
||||
};
|
||||
|
||||
var findFields = function(type, elem, fields) {
|
||||
var attr;
|
||||
if (type !== "html") {
|
||||
type = "text";
|
||||
}
|
||||
attr = "data-notify-" + type;
|
||||
return find(elem, "[" + attr + "]").each(function() {
|
||||
var name;
|
||||
name = $(this).attr(attr);
|
||||
if (!name) {
|
||||
name = blankFieldName;
|
||||
}
|
||||
fields[name] = type;
|
||||
});
|
||||
};
|
||||
|
||||
var find = function(elem, selector) {
|
||||
if (elem.is(selector)) {
|
||||
return elem;
|
||||
} else {
|
||||
return elem.find(selector);
|
||||
}
|
||||
};
|
||||
|
||||
var pluginOptions = {
|
||||
clickToHide: true,
|
||||
autoHide: true,
|
||||
autoHideDelay: 5000,
|
||||
arrowShow: true,
|
||||
arrowSize: 5,
|
||||
breakNewLines: true,
|
||||
elementPosition: "bottom",
|
||||
globalPosition: "top right",
|
||||
style: "bootstrap",
|
||||
className: "error",
|
||||
showAnimation: "slideDown",
|
||||
showDuration: 400,
|
||||
hideAnimation: "slideUp",
|
||||
hideDuration: 200,
|
||||
gap: 5
|
||||
};
|
||||
|
||||
var inherit = function(a, b) {
|
||||
var F;
|
||||
F = function() {};
|
||||
F.prototype = a;
|
||||
return $.extend(true, new F(), b);
|
||||
};
|
||||
|
||||
var defaults = function(opts) {
|
||||
return $.extend(pluginOptions, opts);
|
||||
};
|
||||
|
||||
var createElem = function(tag) {
|
||||
return $("<" + tag + "></" + tag + ">");
|
||||
};
|
||||
|
||||
var globalAnchors = {};
|
||||
|
||||
var getAnchorElement = function(element) {
|
||||
var radios;
|
||||
if (element.is('[type=radio]')) {
|
||||
radios = element.parents('form:first').find('[type=radio]').filter(function(i, e) {
|
||||
return $(e).attr("name") === element.attr("name");
|
||||
});
|
||||
element = radios.first();
|
||||
}
|
||||
return element;
|
||||
};
|
||||
|
||||
var incr = function(obj, pos, val) {
|
||||
var opp, temp;
|
||||
if (typeof val === "string") {
|
||||
val = parseInt(val, 10);
|
||||
} else if (typeof val !== "number") {
|
||||
return;
|
||||
}
|
||||
if (isNaN(val)) {
|
||||
return;
|
||||
}
|
||||
opp = positions[opposites[pos.charAt(0)]];
|
||||
temp = pos;
|
||||
if (obj[opp] !== undefined) {
|
||||
pos = positions[opp.charAt(0)];
|
||||
val = -val;
|
||||
}
|
||||
if (obj[pos] === undefined) {
|
||||
obj[pos] = val;
|
||||
} else {
|
||||
obj[pos] += val;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
var realign = function(alignment, inner, outer) {
|
||||
if (alignment === "l" || alignment === "t") {
|
||||
return 0;
|
||||
} else if (alignment === "c" || alignment === "m") {
|
||||
return outer / 2 - inner / 2;
|
||||
} else if (alignment === "r" || alignment === "b") {
|
||||
return outer - inner;
|
||||
}
|
||||
throw "Invalid alignment";
|
||||
};
|
||||
|
||||
var encode = function(text) {
|
||||
encode.e = encode.e || createElem("div");
|
||||
return encode.e.text(text).html();
|
||||
};
|
||||
|
||||
function Notification(elem, data, options) {
|
||||
if (typeof options === "string") {
|
||||
options = {
|
||||
className: options
|
||||
};
|
||||
}
|
||||
this.options = inherit(pluginOptions, $.isPlainObject(options) ? options : {});
|
||||
this.loadHTML();
|
||||
this.wrapper = $(coreStyle.html);
|
||||
if (this.options.clickToHide) {
|
||||
this.wrapper.addClass(pluginClassName + "-hidable");
|
||||
}
|
||||
this.wrapper.data(pluginClassName, this);
|
||||
this.arrow = this.wrapper.find("." + pluginClassName + "-arrow");
|
||||
this.container = this.wrapper.find("." + pluginClassName + "-container");
|
||||
this.container.append(this.userContainer);
|
||||
if (elem && elem.length) {
|
||||
this.elementType = elem.attr("type");
|
||||
this.originalElement = elem;
|
||||
this.elem = getAnchorElement(elem);
|
||||
this.elem.data(pluginClassName, this);
|
||||
this.elem.before(this.wrapper);
|
||||
}
|
||||
this.container.hide();
|
||||
this.run(data);
|
||||
}
|
||||
|
||||
Notification.prototype.loadHTML = function() {
|
||||
var style;
|
||||
style = this.getStyle();
|
||||
this.userContainer = $(style.html);
|
||||
this.userFields = style.fields;
|
||||
};
|
||||
|
||||
Notification.prototype.show = function(show, userCallback) {
|
||||
var args, callback, elems, fn, hidden;
|
||||
callback = (function(_this) {
|
||||
return function() {
|
||||
if (!show && !_this.elem) {
|
||||
_this.destroy();
|
||||
}
|
||||
if (userCallback) {
|
||||
return userCallback();
|
||||
}
|
||||
};
|
||||
})(this);
|
||||
hidden = this.container.parent().parents(':hidden').length > 0;
|
||||
elems = this.container.add(this.arrow);
|
||||
args = [];
|
||||
if (hidden && show) {
|
||||
fn = "show";
|
||||
} else if (hidden && !show) {
|
||||
fn = "hide";
|
||||
} else if (!hidden && show) {
|
||||
fn = this.options.showAnimation;
|
||||
args.push(this.options.showDuration);
|
||||
} else if (!hidden && !show) {
|
||||
fn = this.options.hideAnimation;
|
||||
args.push(this.options.hideDuration);
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
args.push(callback);
|
||||
return elems[fn].apply(elems, args);
|
||||
};
|
||||
|
||||
Notification.prototype.setGlobalPosition = function() {
|
||||
var p = this.getPosition();
|
||||
var pMain = p[0];
|
||||
var pAlign = p[1];
|
||||
var main = positions[pMain];
|
||||
var align = positions[pAlign];
|
||||
var key = pMain + "|" + pAlign;
|
||||
var anchor = globalAnchors[key];
|
||||
if (!anchor || !document.body.contains(anchor[0])) {
|
||||
anchor = globalAnchors[key] = createElem("div");
|
||||
var css = {};
|
||||
css[main] = 0;
|
||||
if (align === "middle") {
|
||||
css.top = '45%';
|
||||
} else if (align === "center") {
|
||||
css.left = '45%';
|
||||
} else {
|
||||
css[align] = 0;
|
||||
}
|
||||
anchor.css(css).addClass(pluginClassName + "-corner");
|
||||
$("body").append(anchor);
|
||||
}
|
||||
return anchor.prepend(this.wrapper);
|
||||
};
|
||||
|
||||
Notification.prototype.setElementPosition = function() {
|
||||
var arrowColor, arrowCss, arrowSize, color, contH, contW, css, elemH, elemIH, elemIW, elemPos, elemW, gap, j, k, len, len1, mainFull, margin, opp, oppFull, pAlign, pArrow, pMain, pos, posFull, position, ref, wrapPos;
|
||||
position = this.getPosition();
|
||||
pMain = position[0];
|
||||
pAlign = position[1];
|
||||
pArrow = position[2];
|
||||
elemPos = this.elem.position();
|
||||
elemH = this.elem.outerHeight();
|
||||
elemW = this.elem.outerWidth();
|
||||
elemIH = this.elem.innerHeight();
|
||||
elemIW = this.elem.innerWidth();
|
||||
wrapPos = this.wrapper.position();
|
||||
contH = this.container.height();
|
||||
contW = this.container.width();
|
||||
mainFull = positions[pMain];
|
||||
opp = opposites[pMain];
|
||||
oppFull = positions[opp];
|
||||
css = {};
|
||||
css[oppFull] = pMain === "b" ? elemH : pMain === "r" ? elemW : 0;
|
||||
incr(css, "top", elemPos.top - wrapPos.top);
|
||||
incr(css, "left", elemPos.left - wrapPos.left);
|
||||
ref = ["top", "left"];
|
||||
for (j = 0, len = ref.length; j < len; j++) {
|
||||
pos = ref[j];
|
||||
margin = parseInt(this.elem.css("margin-" + pos), 10);
|
||||
if (margin) {
|
||||
incr(css, pos, margin);
|
||||
}
|
||||
}
|
||||
gap = Math.max(0, this.options.gap - (this.options.arrowShow ? arrowSize : 0));
|
||||
incr(css, oppFull, gap);
|
||||
if (!this.options.arrowShow) {
|
||||
this.arrow.hide();
|
||||
} else {
|
||||
arrowSize = this.options.arrowSize;
|
||||
arrowCss = $.extend({}, css);
|
||||
arrowColor = this.userContainer.css("border-color") || this.userContainer.css("border-top-color") || this.userContainer.css("background-color") || "white";
|
||||
for (k = 0, len1 = mainPositions.length; k < len1; k++) {
|
||||
pos = mainPositions[k];
|
||||
posFull = positions[pos];
|
||||
if (pos === opp) {
|
||||
continue;
|
||||
}
|
||||
color = posFull === mainFull ? arrowColor : "transparent";
|
||||
arrowCss["border-" + posFull] = arrowSize + "px solid " + color;
|
||||
}
|
||||
incr(css, positions[opp], arrowSize);
|
||||
if (indexOf.call(mainPositions, pAlign) >= 0) {
|
||||
incr(arrowCss, positions[pAlign], arrowSize * 2);
|
||||
}
|
||||
}
|
||||
if (indexOf.call(vAligns, pMain) >= 0) {
|
||||
incr(css, "left", realign(pAlign, contW, elemW));
|
||||
if (arrowCss) {
|
||||
incr(arrowCss, "left", realign(pAlign, arrowSize, elemIW));
|
||||
}
|
||||
} else if (indexOf.call(hAligns, pMain) >= 0) {
|
||||
incr(css, "top", realign(pAlign, contH, elemH));
|
||||
if (arrowCss) {
|
||||
incr(arrowCss, "top", realign(pAlign, arrowSize, elemIH));
|
||||
}
|
||||
}
|
||||
if (this.container.is(":visible")) {
|
||||
css.display = "block";
|
||||
}
|
||||
this.container.removeAttr("style").css(css);
|
||||
if (arrowCss) {
|
||||
return this.arrow.removeAttr("style").css(arrowCss);
|
||||
}
|
||||
};
|
||||
|
||||
Notification.prototype.getPosition = function() {
|
||||
var pos, ref, ref1, ref2, ref3, ref4, ref5, text;
|
||||
text = this.options.position || (this.elem ? this.options.elementPosition : this.options.globalPosition);
|
||||
pos = parsePosition(text);
|
||||
if (pos.length === 0) {
|
||||
pos[0] = "b";
|
||||
}
|
||||
if (ref = pos[0], indexOf.call(mainPositions, ref) < 0) {
|
||||
throw "Must be one of [" + mainPositions + "]";
|
||||
}
|
||||
if (pos.length === 1 || ((ref1 = pos[0], indexOf.call(vAligns, ref1) >= 0) && (ref2 = pos[1], indexOf.call(hAligns, ref2) < 0)) || ((ref3 = pos[0], indexOf.call(hAligns, ref3) >= 0) && (ref4 = pos[1], indexOf.call(vAligns, ref4) < 0))) {
|
||||
pos[1] = (ref5 = pos[0], indexOf.call(hAligns, ref5) >= 0) ? "m" : "l";
|
||||
}
|
||||
if (pos.length === 2) {
|
||||
pos[2] = pos[1];
|
||||
}
|
||||
return pos;
|
||||
};
|
||||
|
||||
Notification.prototype.getStyle = function(name) {
|
||||
var style;
|
||||
if (!name) {
|
||||
name = this.options.style;
|
||||
}
|
||||
if (!name) {
|
||||
name = "default";
|
||||
}
|
||||
style = styles[name];
|
||||
if (!style) {
|
||||
throw "Missing style: " + name;
|
||||
}
|
||||
return style;
|
||||
};
|
||||
|
||||
Notification.prototype.updateClasses = function() {
|
||||
var classes, style;
|
||||
classes = ["base"];
|
||||
if ($.isArray(this.options.className)) {
|
||||
classes = classes.concat(this.options.className);
|
||||
} else if (this.options.className) {
|
||||
classes.push(this.options.className);
|
||||
}
|
||||
style = this.getStyle();
|
||||
classes = $.map(classes, function(n) {
|
||||
return pluginClassName + "-" + style.name + "-" + n;
|
||||
}).join(" ");
|
||||
return this.userContainer.attr("class", classes);
|
||||
};
|
||||
|
||||
Notification.prototype.run = function(data, options) {
|
||||
var d, datas, name, type, value;
|
||||
if ($.isPlainObject(options)) {
|
||||
$.extend(this.options, options);
|
||||
} else if ($.type(options) === "string") {
|
||||
this.options.className = options;
|
||||
}
|
||||
if (this.container && !data) {
|
||||
this.show(false);
|
||||
return;
|
||||
} else if (!this.container && !data) {
|
||||
return;
|
||||
}
|
||||
datas = {};
|
||||
if ($.isPlainObject(data)) {
|
||||
datas = data;
|
||||
} else {
|
||||
datas[blankFieldName] = data;
|
||||
}
|
||||
for (name in datas) {
|
||||
d = datas[name];
|
||||
type = this.userFields[name];
|
||||
if (!type) {
|
||||
continue;
|
||||
}
|
||||
if (type === "text") {
|
||||
d = encode(d);
|
||||
if (this.options.breakNewLines) {
|
||||
d = d.replace(/\n/g, '<br/>');
|
||||
}
|
||||
}
|
||||
value = name === blankFieldName ? '' : '=' + name;
|
||||
find(this.userContainer, "[data-notify-" + type + value + "]").html(d);
|
||||
}
|
||||
this.updateClasses();
|
||||
if (this.elem) {
|
||||
this.setElementPosition();
|
||||
} else {
|
||||
this.setGlobalPosition();
|
||||
}
|
||||
this.show(true);
|
||||
if (this.options.autoHide) {
|
||||
clearTimeout(this.autohideTimer);
|
||||
this.autohideTimer = setTimeout(this.show.bind(this, false), this.options.autoHideDelay);
|
||||
}
|
||||
};
|
||||
|
||||
Notification.prototype.destroy = function() {
|
||||
this.wrapper.data(pluginClassName, null);
|
||||
this.wrapper.remove();
|
||||
};
|
||||
|
||||
$[pluginName] = function(elem, data, options) {
|
||||
if ((elem && elem.nodeName) || elem.jquery) {
|
||||
$(elem)[pluginName](data, options);
|
||||
} else {
|
||||
options = data;
|
||||
data = elem;
|
||||
new Notification(null, data, options);
|
||||
}
|
||||
return elem;
|
||||
};
|
||||
|
||||
$.fn[pluginName] = function(data, options) {
|
||||
$(this).each(function() {
|
||||
var prev = getAnchorElement($(this)).data(pluginClassName);
|
||||
if (prev) {
|
||||
prev.destroy();
|
||||
}
|
||||
var curr = new Notification($(this), data, options);
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
$.extend($[pluginName], {
|
||||
defaults: defaults,
|
||||
addStyle: addStyle,
|
||||
removeStyle: removeStyle,
|
||||
pluginOptions: pluginOptions,
|
||||
getStyle: getStyle,
|
||||
insertCSS: insertCSS
|
||||
});
|
||||
|
||||
//always include the default bootstrap style
|
||||
addStyle("bootstrap", {
|
||||
html: "<div>\n<span data-notify-text></span>\n</div>",
|
||||
classes: {
|
||||
base: {
|
||||
"font-family": "Arial",
|
||||
"font-weight": "bold",
|
||||
"padding": "8px 15px 8px 14px",
|
||||
"text-shadow": "0 1px 0 rgba(255, 255, 255, 0.5)",
|
||||
"background-color": "#fcf8e3",
|
||||
"border": "1px solid #fbeed5",
|
||||
"border-radius": "4px",
|
||||
"white-space": "nowrap",
|
||||
"padding-left": "25px",
|
||||
"background-repeat": "no-repeat",
|
||||
"background-position": "3px 7px"
|
||||
},
|
||||
error: {
|
||||
"font-family": "Arial",
|
||||
"color": "#B94A48",
|
||||
"background-color": "#F2DEDE",
|
||||
"border-color": "#EED3D7",
|
||||
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtRJREFUeNqkVc1u00AQHq+dOD+0poIQfkIjalW0SEGqRMuRnHos3DjwAH0ArlyQeANOOSMeAA5VjyBxKBQhgSpVUKKQNGloFdw4cWw2jtfMOna6JOUArDTazXi/b3dm55socPqQhFka++aHBsI8GsopRJERNFlY88FCEk9Yiwf8RhgRyaHFQpPHCDmZG5oX2ui2yilkcTT1AcDsbYC1NMAyOi7zTX2Agx7A9luAl88BauiiQ/cJaZQfIpAlngDcvZZMrl8vFPK5+XktrWlx3/ehZ5r9+t6e+WVnp1pxnNIjgBe4/6dAysQc8dsmHwPcW9C0h3fW1hans1ltwJhy0GxK7XZbUlMp5Ww2eyan6+ft/f2FAqXGK4CvQk5HueFz7D6GOZtIrK+srupdx1GRBBqNBtzc2AiMr7nPplRdKhb1q6q6zjFhrklEFOUutoQ50xcX86ZlqaZpQrfbBdu2R6/G19zX6XSgh6RX5ubyHCM8nqSID6ICrGiZjGYYxojEsiw4PDwMSL5VKsC8Yf4VRYFzMzMaxwjlJSlCyAQ9l0CW44PBADzXhe7xMdi9HtTrdYjFYkDQL0cn4Xdq2/EAE+InCnvADTf2eah4Sx9vExQjkqXT6aAERICMewd/UAp/IeYANM2joxt+q5VI+ieq2i0Wg3l6DNzHwTERPgo1ko7XBXj3vdlsT2F+UuhIhYkp7u7CarkcrFOCtR3H5JiwbAIeImjT/YQKKBtGjRFCU5IUgFRe7fF4cCNVIPMYo3VKqxwjyNAXNepuopyqnld602qVsfRpEkkz+GFL1wPj6ySXBpJtWVa5xlhpcyhBNwpZHmtX8AGgfIExo0ZpzkWVTBGiXCSEaHh62/PoR0p/vHaczxXGnj4bSo+G78lELU80h1uogBwWLf5YlsPmgDEd4M236xjm+8nm4IuE/9u+/PH2JXZfbwz4zw1WbO+SQPpXfwG/BBgAhCNZiSb/pOQAAAAASUVORK5CYII=)"
|
||||
},
|
||||
success: {
|
||||
"font-family": "Arial",
|
||||
"color": "#468847",
|
||||
"background-color": "#DFF0D8",
|
||||
"border-color": "#D6E9C6",
|
||||
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAutJREFUeNq0lctPE0Ecx38zu/RFS1EryqtgJFA08YCiMZIAQQ4eRG8eDGdPJiYeTIwHTfwPiAcvXIwXLwoXPaDxkWgQ6islKlJLSQWLUraPLTv7Gme32zoF9KSTfLO7v53vZ3d/M7/fIth+IO6INt2jjoA7bjHCJoAlzCRw59YwHYjBnfMPqAKWQYKjGkfCJqAF0xwZjipQtA3MxeSG87VhOOYegVrUCy7UZM9S6TLIdAamySTclZdYhFhRHloGYg7mgZv1Zzztvgud7V1tbQ2twYA34LJmF4p5dXF1KTufnE+SxeJtuCZNsLDCQU0+RyKTF27Unw101l8e6hns3u0PBalORVVVkcaEKBJDgV3+cGM4tKKmI+ohlIGnygKX00rSBfszz/n2uXv81wd6+rt1orsZCHRdr1Imk2F2Kob3hutSxW8thsd8AXNaln9D7CTfA6O+0UgkMuwVvEFFUbbAcrkcTA8+AtOk8E6KiQiDmMFSDqZItAzEVQviRkdDdaFgPp8HSZKAEAL5Qh7Sq2lIJBJwv2scUqkUnKoZgNhcDKhKg5aH+1IkcouCAdFGAQsuWZYhOjwFHQ96oagWgRoUov1T9kRBEODAwxM2QtEUl+Wp+Ln9VRo6BcMw4ErHRYjH4/B26AlQoQQTRdHWwcd9AH57+UAXddvDD37DmrBBV34WfqiXPl61g+vr6xA9zsGeM9gOdsNXkgpEtTwVvwOklXLKm6+/p5ezwk4B+j6droBs2CsGa/gNs6RIxazl4Tc25mpTgw/apPR1LYlNRFAzgsOxkyXYLIM1V8NMwyAkJSctD1eGVKiq5wWjSPdjmeTkiKvVW4f2YPHWl3GAVq6ymcyCTgovM3FzyRiDe2TaKcEKsLpJvNHjZgPNqEtyi6mZIm4SRFyLMUsONSSdkPeFtY1n0mczoY3BHTLhwPRy9/lzcziCw9ACI+yql0VLzcGAZbYSM5CCSZg1/9oc/nn7+i8N9p/8An4JMADxhH+xHfuiKwAAAABJRU5ErkJggg==)"
|
||||
},
|
||||
info: {
|
||||
"font-family": "Arial",
|
||||
"color": "#3A87AD",
|
||||
"background-color": "#D9EDF7",
|
||||
"border-color": "#BCE8F1",
|
||||
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QYFAhkSsdes/QAAA8dJREFUOMvVlGtMW2UYx//POaWHXg6lLaW0ypAtw1UCgbniNOLcVOLmAjHZolOYlxmTGXVZdAnRfXQm+7SoU4mXaOaiZsEpC9FkiQs6Z6bdCnNYruM6KNBw6YWewzl9z+sHImEWv+vz7XmT95f/+3/+7wP814v+efDOV3/SoX3lHAA+6ODeUFfMfjOWMADgdk+eEKz0pF7aQdMAcOKLLjrcVMVX3xdWN29/GhYP7SvnP0cWfS8caSkfHZsPE9Fgnt02JNutQ0QYHB2dDz9/pKX8QjjuO9xUxd/66HdxTeCHZ3rojQObGQBcuNjfplkD3b19Y/6MrimSaKgSMmpGU5WevmE/swa6Oy73tQHA0Rdr2Mmv/6A1n9w9suQ7097Z9lM4FlTgTDrzZTu4StXVfpiI48rVcUDM5cmEksrFnHxfpTtU/3BFQzCQF/2bYVoNbH7zmItbSoMj40JSzmMyX5qDvriA7QdrIIpA+3cdsMpu0nXI8cV0MtKXCPZev+gCEM1S2NHPvWfP/hL+7FSr3+0p5RBEyhEN5JCKYr8XnASMT0xBNyzQGQeI8fjsGD39RMPk7se2bd5ZtTyoFYXftF6y37gx7NeUtJJOTFlAHDZLDuILU3j3+H5oOrD3yWbIztugaAzgnBKJuBLpGfQrS8wO4FZgV+c1IxaLgWVU0tMLEETCos4xMzEIv9cJXQcyagIwigDGwJgOAtHAwAhisQUjy0ORGERiELgG4iakkzo4MYAxcM5hAMi1WWG1yYCJIcMUaBkVRLdGeSU2995TLWzcUAzONJ7J6FBVBYIggMzmFbvdBV44Corg8vjhzC+EJEl8U1kJtgYrhCzgc/vvTwXKSib1paRFVRVORDAJAsw5FuTaJEhWM2SHB3mOAlhkNxwuLzeJsGwqWzf5TFNdKgtY5qHp6ZFf67Y/sAVadCaVY5YACDDb3Oi4NIjLnWMw2QthCBIsVhsUTU9tvXsjeq9+X1d75/KEs4LNOfcdf/+HthMnvwxOD0wmHaXr7ZItn2wuH2SnBzbZAbPJwpPx+VQuzcm7dgRCB57a1uBzUDRL4bfnI0RE0eaXd9W89mpjqHZnUI5Hh2l2dkZZUhOqpi2qSmpOmZ64Tuu9qlz/SEXo6MEHa3wOip46F1n7633eekV8ds8Wxjn37Wl63VVa+ej5oeEZ/82ZBETJjpJ1Rbij2D3Z/1trXUvLsblCK0XfOx0SX2kMsn9dX+d+7Kf6h8o4AIykuffjT8L20LU+w4AZd5VvEPY+XpWqLV327HR7DzXuDnD8r+ovkBehJ8i+y8YAAAAASUVORK5CYII=)"
|
||||
},
|
||||
warn: {
|
||||
"font-family": "Arial",
|
||||
"color": "#C09853",
|
||||
"background-color": "#FCF8E3",
|
||||
"border-color": "#FBEED5",
|
||||
"background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABJlBMVEXr6eb/2oD/wi7/xjr/0mP/ykf/tQD/vBj/3o7/uQ//vyL/twebhgD/4pzX1K3z8e349vK6tHCilCWbiQymn0jGworr6dXQza3HxcKkn1vWvV/5uRfk4dXZ1bD18+/52YebiAmyr5S9mhCzrWq5t6ufjRH54aLs0oS+qD751XqPhAybhwXsujG3sm+Zk0PTwG6Shg+PhhObhwOPgQL4zV2nlyrf27uLfgCPhRHu7OmLgAafkyiWkD3l49ibiAfTs0C+lgCniwD4sgDJxqOilzDWowWFfAH08uebig6qpFHBvH/aw26FfQTQzsvy8OyEfz20r3jAvaKbhgG9q0nc2LbZxXanoUu/u5WSggCtp1anpJKdmFz/zlX/1nGJiYmuq5Dx7+sAAADoPUZSAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfdBgUBGhh4aah5AAAAlklEQVQY02NgoBIIE8EUcwn1FkIXM1Tj5dDUQhPU502Mi7XXQxGz5uVIjGOJUUUW81HnYEyMi2HVcUOICQZzMMYmxrEyMylJwgUt5BljWRLjmJm4pI1hYp5SQLGYxDgmLnZOVxuooClIDKgXKMbN5ggV1ACLJcaBxNgcoiGCBiZwdWxOETBDrTyEFey0jYJ4eHjMGWgEAIpRFRCUt08qAAAAAElFTkSuQmCC)"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(function() {
|
||||
insertCSS(coreStyle.css).attr("id", "core-notify");
|
||||
$(document).on("click", "." + pluginClassName + "-hidable", function(e) {
|
||||
$(this).trigger("notify-hide");
|
||||
});
|
||||
$(document).on("notify-hide", "." + pluginClassName + "-wrapper", function(e) {
|
||||
var elem = $(this).data(pluginClassName);
|
||||
if(elem) {
|
||||
elem.show(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}));
|
10
send.php
10
send.php
|
@ -5,9 +5,9 @@
|
|||
ini_set('display_errors', 'On');
|
||||
set_error_handler("var_dump");
|
||||
|
||||
$from = 'info@mine-modinstaller.esy.es';
|
||||
$from = 'devswithouthobbies@gmail.com';
|
||||
|
||||
$to = 'jonaspeeters.de@gmail.com';
|
||||
$to = 'devswithouthobbies@gmail.com';
|
||||
|
||||
$subject = $_GET['subject'];
|
||||
|
||||
|
@ -16,11 +16,11 @@
|
|||
$headers = 'From:' . $from;
|
||||
|
||||
if(mail($to, $subject, $message, $headers))
|
||||
echo('t');
|
||||
echo "<meta http-equiv='refresh' content='0; URL=index.html?success=true'>";
|
||||
else
|
||||
echo('f');
|
||||
echo "<meta http-equiv='refresh' content='0; URL=index.html?success=false'>";
|
||||
|
||||
|
||||
echo "<meta http-equiv='refresh' content='0; URL=index.html?success=true'>";
|
||||
?>
|
||||
</head>
|
||||
</html>
|
||||
|
|
61
submit.html
61
submit.html
|
@ -1,8 +1,10 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src='https://www.google.com/recaptcha/api.js'></script>
|
||||
<title>Submit Mod</title>
|
||||
<link rel="stylesheet" href="main.css"/>
|
||||
|
||||
<link rel="stylesheet" href="form.css"/>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
|
||||
<script src="notify.js"></script>
|
||||
<script>
|
||||
function sendMessage() {
|
||||
var send = true;
|
||||
|
@ -42,6 +44,12 @@
|
|||
} else {
|
||||
document.getElementById('ziplink').style.borderColor = '#000000';
|
||||
}
|
||||
if (document.getElementById('folder').value === '') {
|
||||
send = false;
|
||||
document.getElementById('folder').style.borderColor = '#FF4444';
|
||||
} else {
|
||||
document.getElementById('folder').style.borderColor = '#000000';
|
||||
}
|
||||
if (document.getElementById('robot-check').checksum != 'stfh1tr8fh6srtf56hnbrtsfxhb1rtx81fh5tr1xf6gh15xnrtf51hgnft') {
|
||||
send = false;
|
||||
}
|
||||
|
@ -52,20 +60,27 @@
|
|||
var description = document.getElementById('description').value;
|
||||
var imagelink = document.getElementById('imagelink').value;
|
||||
var ziplink = document.getElementById('ziplink').value;
|
||||
var folder = document.getElementById('folder').value;
|
||||
var library = '0';
|
||||
if (document.getElementById('library').checked) {
|
||||
library = '1';
|
||||
}
|
||||
var other = document.getElementById('other').value;
|
||||
var pack = document.getElementById('package').value;
|
||||
|
||||
window.location = 'http://mine-modinstaller.esy.es/send.php?subject=Modinstaller ' + title + '&message=Hello dear modinstaller admin.|There is a new request to add a mod to the list:'
|
||||
window.location = 'send.php?subject=Modinstaller ' + title + '&message=Hello dear modinstaller admin.|There is a new request to add a mod to the list:'
|
||||
+ '||Author: ' + name
|
||||
+ '|E-Mail: ' + email
|
||||
+ '|Title: ' + title
|
||||
+ '|Description: ' + description
|
||||
+ '|Link to image: ' + imagelink
|
||||
+ '|Link to zip: ' + ziplink
|
||||
+ '|Foldername in zip: ' + folder
|
||||
+ '|As library: ' + library
|
||||
+ '|Other: ' + other
|
||||
+ '|Package: ' + pack
|
||||
+ '||Here is the line that will be added to the index list in the Github repository:|'
|
||||
+ title + ':::' + ziplink + ':::' + name + ':::' + imagelink + ':::' + description
|
||||
+ title + ':::' + ziplink + ':::' + folder + ':::' + library + ':::' + name + ':::' + imagelink + ':::' + description
|
||||
+ '||Here is a link to this file: https://github.com/DevsWithoutHobbies/minetest-modinstaller-data/blob/master/index'
|
||||
+ '||If everything seems fine, you can add it.||Sincerly yours|TOTALLY NOT A BOT';
|
||||
}
|
||||
|
@ -97,35 +112,53 @@
|
|||
<table class="form">
|
||||
<tr>
|
||||
<td class="first">Author/-s</td>
|
||||
<td class="second"><input type="text" id="name"/></td>
|
||||
<td class="second"><input type="text" id="name" placeholder="Comma separated list of names"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="first">E-Mail (Not public)</td>
|
||||
<td class="second"><input type="mail" id="email"/></td>
|
||||
<td class="second"><input type="mail" id="email" placeholder="Contact e-mail"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="first">Mod title</td>
|
||||
<td class="second"><input type="text" id="title"/></td>
|
||||
<td class="second"><input type="text" id="title" placeholder="Will be the name in the list in the modinstaller"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="first">Description</td>
|
||||
<td class="second"><textarea type="text" id="description"></textarea></td>
|
||||
<td class="second"><textarea type="text" id="description" placeholder="Describe your mod as good as possible and as short as possible"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="first">Link to image</td>
|
||||
<td class="second"><input type="url" id="imagelink"/></td>
|
||||
<td class="second"><input type="url" id="imagelink" placeholder="Image that depicts your mod well"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="first">Link to .zip</td>
|
||||
<td class="second"><input type="url" id="ziplink"/></td>
|
||||
<td class="second"><input type="url" id="ziplink" placeholder="URL to latest stable version"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="first">Foldername in zip</td>
|
||||
<td class="second"><input type="text" id="folder" placeholder="Relative path in the zip file"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="first">As library</td>
|
||||
<td class="second">
|
||||
<input type="checkbox" id="library"/>
|
||||
<label for="library">
|
||||
<span class="checkmark">
|
||||
<div class="checkmark_stem"></div>
|
||||
<div class="checkmark_kick"></div>
|
||||
</span>
|
||||
<box></box>
|
||||
<a>Won't be show in list. Will only be installed as dependency.</a>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="first">Other information (optional)<br>(Not public)</td>
|
||||
<td class="second"><textarea type="text" id="other"></textarea></td>
|
||||
<td class="second"><textarea type="text" id="other" placeholder="Private message to the modinstaller admins"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="first">Package name (optional)</td>
|
||||
<td class="second"><input type="text" id="package"/></td>
|
||||
<td class="second"><input type="text" id="package" placeholder="Leave blank for simple mod"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="first"></td>
|
||||
|
@ -133,12 +166,12 @@
|
|||
<div class="no-robot" onclick="robot();">
|
||||
<input type="checkbox" class="robot-check" id="robot-check" checksum="k3jabsd2asd3uibash3dva9skjhd5uzf6gcvkehj1wdhqwz7qvusjdh8b">
|
||||
<label for="robot-check">
|
||||
<box></box>
|
||||
<span class="checkmark">
|
||||
<div class="checkmark_stem"></div>
|
||||
<div class="checkmark_kick"></div>
|
||||
</span>
|
||||
<a>I am not a robot</a>
|
||||
<box></box>
|
||||
<a>I'm not a robot</a>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
|
|
Loading…
Reference in New Issue