initial commit

This commit is contained in:
Lucas 2023-03-04 01:18:55 +01:00
commit e3b5e6ce01
10 changed files with 11303 additions and 0 deletions

0
README Normal file
View file

72
index.html Normal file
View file

@ -0,0 +1,72 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="">
<title>fateforge-tools</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">
</head>
<body>
<button onclick="changeLangEN()">English</button>
<button onclick="changeLangFR()">French</button>
<div data-localize="title">FateforgeTools</div>
<div data-localize="desc">
A suite of tools for Fateforge players and Masters.
</div>
<footnote>
<p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/">
<a property="dct:title" rel="cc:attributionURL" href="http://fateforge.tool">fateforge.tool</a>
by <span property="cc:attributionName">Lucas Peter</span> is licensed
under
<a href="http://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1" target="_blank"
rel="license noopener noreferrer" style="display: inline-block">CC BY-NC 4.0<img style="
height: 22px !important;
margin-left: 3px;
vertical-align: text-bottom;
" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" /><img style="
height: 22px !important;
margin-left: 3px;
vertical-align: text-bottom;
" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" /><img style="
height: 22px !important;
margin-left: 3px;
vertical-align: text-bottom;
" src="https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1" /></a>
</p>
</footnote>
<script type="text/javascript" src="lib/jquery.min.js"></script>
<script type="text/javascript" src="lib/jquery.localize.js"></script>
<script>
// In a browser where the language is set to French
$("[data-localize]").localize("main", { pathPrefix: "lang" });
// You can also override the language detection, and pass in a language code
//$("[data-localize]").localize("main", { language: "fr" });
function changeLangFR() {
$("[data-localize]").localize("main", {
pathPrefix: "lang",
language: "fr",
});
}
function changeLangEN() {
$("[data-localize]").localize("main", {
pathPrefix: "lang",
language: "en",
});
}
</script>
</body>
</html>

0
js/spells.js Normal file
View file

7
lang/main-en.json Normal file
View file

@ -0,0 +1,7 @@
{
"title": "FateforgeTools",
"desc": "A suite of tools for Fateforge players and Masters.",
"terms": {
"Fateforge": "Fateforge"
}
}

7
lang/main-fr.json Normal file
View file

@ -0,0 +1,7 @@
{
"title": "FateforgeTools",
"desc": "Une gamme d'outils pour les joueurs et les meneurs de Dragons.",
"terms": {
"Fateforge": "Dragons"
}
}

10993
lib/jquery.js vendored Normal file

File diff suppressed because it is too large Load diff

194
lib/jquery.localize-dev.js Normal file
View file

@ -0,0 +1,194 @@
/*
Copyright (c) Jim Garvin (http://github.com/coderifous), 2008.
Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
Written by Jim Garvin (@coderifous) for use on LMGTFY.com.
http://github.com/coderifous/jquery-localize
Based off of Keith Wood's Localisation jQuery plugin.
http://keith-wood.name/localisation.html
*/
(function($) {
var normaliseLang;
normaliseLang = function(lang) {
lang = lang.replace(/_/, '-').toLowerCase();
if (lang.length > 3) {
lang = lang.substring(0, 3) + lang.substring(3).toUpperCase();
}
return lang;
};
$.defaultLanguage = normaliseLang(navigator.languages && navigator.languages.length > 0 ? navigator.languages[0] : navigator.language || navigator.userLanguage);
$.localize = function(pkg, options) {
var defaultCallback, deferred, fileExtension, intermediateLangData, jsonCall, lang, loadLanguage, localizeElement, localizeForSpecialKeys, localizeImageElement, localizeInputElement, localizeOptgroupElement, notifyDelegateLanguageLoaded, regexify, setAttrFromValueForKey, setTextFromValueForKey, valueForKey, wrappedSet;
if (options == null) {
options = {};
}
wrappedSet = this;
intermediateLangData = {};
fileExtension = options.fileExtension || "json";
deferred = $.Deferred();
loadLanguage = function(pkg, lang, level) {
var file;
if (level == null) {
level = 1;
}
switch (level) {
case 1:
intermediateLangData = {};
if (options.loadBase) {
file = pkg + ("." + fileExtension);
return jsonCall(file, pkg, lang, level);
} else {
return loadLanguage(pkg, lang, 2);
}
break;
case 2:
file = "" + pkg + "-" + (lang.split('-')[0]) + "." + fileExtension;
return jsonCall(file, pkg, lang, level);
case 3:
file = "" + pkg + "-" + (lang.split('-').slice(0, 2).join('-')) + "." + fileExtension;
return jsonCall(file, pkg, lang, level);
default:
return deferred.resolve();
}
};
jsonCall = function(file, pkg, lang, level) {
var ajaxOptions, errorFunc, successFunc;
if (options.pathPrefix != null) {
file = "" + options.pathPrefix + "/" + file;
}
successFunc = function(d) {
$.extend(intermediateLangData, d);
notifyDelegateLanguageLoaded(intermediateLangData);
return loadLanguage(pkg, lang, level + 1);
};
errorFunc = function() {
if (level === 2 && lang.indexOf('-') > -1) {
return loadLanguage(pkg, lang, level + 1);
} else if (options.fallback && options.fallback !== lang) {
return loadLanguage(pkg, options.fallback);
}
};
ajaxOptions = {
url: file,
dataType: "json",
async: true,
timeout: options.timeout != null ? options.timeout : 500,
success: successFunc,
error: errorFunc
};
if (window.location.protocol === "file:") {
ajaxOptions.error = function(xhr) {
return successFunc($.parseJSON(xhr.responseText));
};
}
return $.ajax(ajaxOptions);
};
notifyDelegateLanguageLoaded = function(data) {
if (options.callback != null) {
return options.callback(data, defaultCallback);
} else {
return defaultCallback(data);
}
};
defaultCallback = function(data) {
$.localize.data[pkg] = data;
return wrappedSet.each(function() {
var elem, key, value;
elem = $(this);
key = elem.data("localize");
key || (key = elem.attr("rel").match(/localize\[(.*?)\]/)[1]);
value = valueForKey(key, data);
if (value != null) {
return localizeElement(elem, key, value);
}
});
};
localizeElement = function(elem, key, value) {
if (elem.is('input')) {
localizeInputElement(elem, key, value);
} else if (elem.is('textarea')) {
localizeInputElement(elem, key, value);
} else if (elem.is('img')) {
localizeImageElement(elem, key, value);
} else if (elem.is('optgroup')) {
localizeOptgroupElement(elem, key, value);
} else if (!$.isPlainObject(value)) {
elem.html(value);
}
if ($.isPlainObject(value)) {
return localizeForSpecialKeys(elem, value);
}
};
localizeInputElement = function(elem, key, value) {
var val;
val = $.isPlainObject(value) ? value.value : value;
if (elem.is("[placeholder]")) {
return elem.attr("placeholder", val);
} else {
return elem.val(val);
}
};
localizeForSpecialKeys = function(elem, value) {
setAttrFromValueForKey(elem, "title", value);
setAttrFromValueForKey(elem, "href", value);
return setTextFromValueForKey(elem, "text", value);
};
localizeOptgroupElement = function(elem, key, value) {
return elem.attr("label", value);
};
localizeImageElement = function(elem, key, value) {
setAttrFromValueForKey(elem, "alt", value);
return setAttrFromValueForKey(elem, "src", value);
};
valueForKey = function(key, data) {
var keys, value, _i, _len;
keys = key.split(/\./);
value = data;
for (_i = 0, _len = keys.length; _i < _len; _i++) {
key = keys[_i];
value = value != null ? value[key] : null;
}
return value;
};
setAttrFromValueForKey = function(elem, key, value) {
value = valueForKey(key, value);
if (value != null) {
return elem.attr(key, value);
}
};
setTextFromValueForKey = function(elem, key, value) {
value = valueForKey(key, value);
if (value != null) {
return elem.text(value);
}
};
regexify = function(string_or_regex_or_array) {
var thing;
if (typeof string_or_regex_or_array === "string") {
return "^" + string_or_regex_or_array + "$";
} else if (string_or_regex_or_array.length != null) {
return ((function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = string_or_regex_or_array.length; _i < _len; _i++) {
thing = string_or_regex_or_array[_i];
_results.push(regexify(thing));
}
return _results;
})()).join("|");
} else {
return string_or_regex_or_array;
}
};
lang = normaliseLang(options.language ? options.language : $.defaultLanguage);
if (options.skipLanguage && lang.match(regexify(options.skipLanguage))) {
deferred.resolve();
} else {
loadLanguage(pkg, lang, 1);
}
wrappedSet.localizePromise = deferred;
return wrappedSet;
};
$.fn.localize = $.localize;
return $.localize.data = {};
})(jQuery);

4
lib/jquery.localize.js Normal file
View file

@ -0,0 +1,4 @@
/*! Localize - v0.2.0 - 2016-10-13
* https://github.com/coderifous/jquery-localize
* Copyright (c) 2016 coderifous; Licensed MIT */
!function(a){var b;return b=function(a){return a=a.replace(/_/,"-").toLowerCase(),a.length>3&&(a=a.substring(0,3)+a.substring(3).toUpperCase()),a},a.defaultLanguage=b(navigator.languages&&navigator.languages.length>0?navigator.languages[0]:navigator.language||navigator.userLanguage),a.localize=function(c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;return null==d&&(d={}),v=this,h={},g=d.fileExtension||"json",f=a.Deferred(),k=function(a,b,c){var e;switch(null==c&&(c=1),c){case 1:return h={},d.loadBase?(e=a+("."+g),i(e,a,b,c)):k(a,b,2);case 2:return e=""+a+"-"+b.split("-")[0]+"."+g,i(e,a,b,c);case 3:return e=""+a+"-"+b.split("-").slice(0,2).join("-")+"."+g,i(e,a,b,c);default:return f.resolve()}},i=function(b,c,e,f){var g,i,j;return null!=d.pathPrefix&&(b=""+d.pathPrefix+"/"+b),j=function(b){return a.extend(h,b),q(h),k(c,e,f+1)},i=function(){return 2===f&&e.indexOf("-")>-1?k(c,e,f+1):d.fallback&&d.fallback!==e?k(c,d.fallback):void 0},g={url:b,dataType:"json",async:!0,timeout:null!=d.timeout?d.timeout:500,success:j,error:i},"file:"===window.location.protocol&&(g.error=function(b){return j(a.parseJSON(b.responseText))}),a.ajax(g)},q=function(a){return null!=d.callback?d.callback(a,e):e(a)},e=function(b){return a.localize.data[c]=b,v.each(function(){var c,d,e;return c=a(this),d=c.data("localize"),d||(d=c.attr("rel").match(/localize\[(.*?)\]/)[1]),e=u(d,b),null!=e?l(c,d,e):void 0})},l=function(b,c,d){return b.is("input")?o(b,c,d):b.is("textarea")?o(b,c,d):b.is("img")?n(b,c,d):b.is("optgroup")?p(b,c,d):a.isPlainObject(d)||b.html(d),a.isPlainObject(d)?m(b,d):void 0},o=function(b,c,d){var e;return e=a.isPlainObject(d)?d.value:d,b.is("[placeholder]")?b.attr("placeholder",e):b.val(e)},m=function(a,b){return s(a,"title",b),s(a,"href",b),t(a,"text",b)},p=function(a,b,c){return a.attr("label",c)},n=function(a,b,c){return s(a,"alt",c),s(a,"src",c)},u=function(a,b){var c,d,e,f;for(c=a.split(/\./),d=b,e=0,f=c.length;f>e;e++)a=c[e],d=null!=d?d[a]:null;return d},s=function(a,b,c){return c=u(b,c),null!=c?a.attr(b,c):void 0},t=function(a,b,c){return c=u(b,c),null!=c?a.text(c):void 0},r=function(a){var b;return"string"==typeof a?"^"+a+"$":null!=a.length?function(){var c,d,e;for(e=[],c=0,d=a.length;d>c;c++)b=a[c],e.push(r(b));return e}().join("|"):a},j=b(d.language?d.language:a.defaultLanguage),d.skipLanguage&&j.match(r(d.skipLanguage))?f.resolve():k(c,j,1),v.localizePromise=f,v},a.fn.localize=a.localize,a.localize.data={}}(jQuery);

2
lib/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

24
spells.html Normal file
View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="description" content="">
<title>Spells - fateforge.tools</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">
<!-- Favicons -->
</head>
<body>
<script type="text/javascript" src="lib/jquery.min.js"></script>
</html>