Skip to content

Commit

Permalink
Official release! Version 1.0.0 (Amur Tiger)
Browse files Browse the repository at this point in the history
We go from Polar Bear (Alpha) to Amur Tiger (Version 1.x.x)
In the Amur Tiger Version we included the following functions:
isset
squareroot
minmax
tothepower
convert
getMoreFunctions
isArray
startClock
userVersion
userOS
userLang
userJavaOn
userOnline
WebHostName
webUrl
webPath
webIsProtected
actionRedirect
actionLog
actionError
actionScroll
actionStopHere
getContent
getMFstyles
getTitle
setCookie
getCookie
cookie
delCookie
write
writeTo
  • Loading branch information
ImmanuelNL authored Sep 25, 2017
1 parent 9f8a382 commit 08fb5f0
Showing 1 changed file with 84 additions and 7 deletions.
91 changes: 84 additions & 7 deletions src/morefunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@
*
* Version Polar Bear
*
* Still In Alpha Stages
* Version 1.0.0
* MoreFunctions official release!
* 25/09/2017
*/



var version = "A1.9.0";
var vNickName = "Polar Bear";
var errorCount = "21";
var noticeCount = "4";
var version = "1.0.0";
var vNickName = "Amur Tiger";
var errorCount = "25";
var noticeCount = "5";
var included = [
// NO CATEGORY
"isset",
Expand Down Expand Up @@ -50,11 +52,14 @@ var included = [
"getContent",
"getMFstyles",
"getTitle",
// COOKIE category
// COOKIE Category
"setCookie",
"getCookie",
"cookie",
"delCookie"
"delCookie",
// WRITE Category
"write",
"writeTo"
];


Expand Down Expand Up @@ -781,3 +786,75 @@ function delCookie(cookie) {
}
}
}

/**
* Used to write (html) to a page
* @param text
* --> What has to be written?
* @returns
* --> Log's to the console
* --> writes to user "MF: NOTICE 5: text was not set"
* --> returns false
*/
function write(text) {
if (!isset(text)) {
document.writeln('MF: NOTICE: text was not set!');
console.log('MF: NOTICE 5: Nothing was written.')
throw 'MF: err 22: text was not set! So nothing was written.';
return false;
} else {
document.writeln(text);
return true;
}
}

/**
*
* @param text
* --> is going to replace the current content of @param id
* @param id
* --> what is the id of the element whose content has to be changed to @param text
* @returns
* --> true when content was changed
* --> false when content was NOT changed
* @code
* --> when action fails the first time MF will retry to change @param id for 3 times more
* --> Success?
* --> @returns true
* --> Failure
* --> @returns false and an error
*/

function writeTo(text, id) {
// Check if everything is set
if (!isset(text)) {
throw 'MF: err 23: text was not set';
return false;
} else if (!isset(id)) {
throw 'MF: err 24: id was not set';
} else {
document.getElementById(id).innerHTML = text;
// Is @code id realy @code text?
if (document.getElementById(id).value == text) {
// Yes?
return true
} else {
// No?
var x;
while (document.getElementById(id).value != text && x > 3) {
// retry 3 times
$x++;
document.getElementById(id).innerHTML = text;
}
// Is @code id realy @code text?
if (document.getElementById(id).value == text) {
// Yes?
return true;
} else {
// No? (error 25)
return false;
throw 'MF: err 25: Something went wrong, while changing (element\'s ID) "' + id + '"\'s content to "' + text + '"';
}
}
}
}

0 comments on commit 08fb5f0

Please sign in to comment.