Skip to content

Commit e4704d3

Browse files
author
FoxInFlame
committed
Changed ReadMe to fit version 3.7
1 parent 5f97580 commit e4704d3

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

README.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@ Example:
2020
```
2121
<script>
2222
var yourMOTD = "§d§lnerd.nu§8: §6§oCreative Rev 28";
23-
replaceColorCodes(yourMOTD, "outputDiv");
23+
var newMOTD = yourMOTD.replaceColorCodes();
24+
console.log(newMOTD);
2425
<script>
25-
<div id="outputDiv"></div>
2626
```
27-
Simple enough. Put the string you want in the function ```replaceColorCodes()```, and place the ID or class of the output element, and voila! You can then do whatever you like with it!
28-
When using a class, the script will find the first match.
27+
Simple enough. Get your string, attach the function at the end (Don't forget the brackets, they are essential) and voila! You can then do whatever you like with it!
2928

30-
Do note that the script will probably overwrite anything inside the element. I would suggest you use a ```span``` element with the class or id of your choice.
3129

3230
##Extras
3331
You might want to get your server's MOTD, but you don't know how to access the server from your website?
@@ -36,9 +34,10 @@ Use this code! (jQuery needed)
3634
$(document).ready(function(){
3735
$.getJSON('https://mcapi.us/server/status?ip=c.nerd.nu', function(obj){
3836
if(obj.online === true){
39-
motdHTML = replaceColorCodes(obj.motd, "myDiv");
37+
motdHTML = obj.motd.replaceColorCodes();
38+
console.log(motdHTML);
4039
} else {
41-
document.getElementById("myDiv").innerHTML = "Server is offline...";
40+
console.log("Server is offline...");
4241
}
4342
});
4443
})
@@ -48,15 +47,17 @@ https://mcapi.us provides JSON responses from the server provided in the URL. By
4847

4948
##Bugs / ToDo
5049

51-
- #1 §k does not work.
52-
- #2 Having multiple formatting codes does not work.
53-
- #3 The spaces disappear, and the output is a whole big chunk of letters.
54-
- #4 Color Codes should reset previous occuring formatting codes, yet they seem to keep the formatting.
50+
- #1 §k does not work. (FIXED IN VERSION 3.0)
51+
- #2 Having multiple formatting codes does not work. (FIXED IN VERSION 2.0)
52+
- #3 The spaces disappear, and the output is a whole big chunk of letters. (FIXED IN VERSION 3.5)
53+
- #4 Color Codes should reset previous occuring formatting codes, yet they seem to keep the formatting. (FIXED IN VERSION 3.7)
5554

56-
If you find one, please submit a ticket.
55+
If you find one, please submit a ticket or a pull request.
5756

58-
- Add Class support (DONE!)
59-
- Add Support for custom class, like first match, second match, etc... (Coming Soon)
57+
- Add Class support (DROPPED!)
58+
- Add Support for custom class, like first match, second match, etc... (DROPPED!)
59+
- Put everything in a huge String.prototype function. (DONE!)
60+
- Fix Bugs (DONE FOR ALL LISTED)
6061

6162
##Updates
6263
v1.0 - Created this file, added replacements for color codes
@@ -73,7 +74,9 @@ v3.0 - Added §k, §r, and \n support. Now also requires the output element ID.
7374

7475
v3.1 - Finally! Support for class names too!
7576

76-
v3.5 - Fixed Bug #3, 'Spaces dissappear', by adding a CSS property to the output element.
77+
v3.5 - Fixed Bug #3, 'Spaces dissappear', by adding a CSS property to the output element.'
78+
79+
v3.7 - Fixed Bug #4, put everything in a huge ```String.prototype``` function, so now you can't input your output element ID/Class. I mean come on, what if you just wanted to output to the console? I also changed a few tweaks here and there.
7780

7881
##Legal
7982
You can modify this file in any way, but if you want, create a pull request so I can have a look. Also, try not sell this file/work for a price. I mean come on, if you really want money, go get a proper job. Thirdly and lastly, you can not give away this file/work without giving credit to me, and possibly giving the URL to this Github page. Due to the informality of this piece of text, you could ignore this if you want to.

0 commit comments

Comments
 (0)