From 35443e67343ec93b83398106ee3696b8a0f70fd4 Mon Sep 17 00:00:00 2001 From: walterhiggins Date: Sun, 10 Feb 2013 18:05:07 +0000 Subject: [PATCH] documentation --- src/main/javascript/signs/menu.js | 4 +-- src/main/javascript/utils/text.js | 42 ++++++++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/src/main/javascript/signs/menu.js b/src/main/javascript/signs/menu.js index c1054e9..605e7de 100644 --- a/src/main/javascript/signs/menu.js +++ b/src/main/javascript/signs/menu.js @@ -1,3 +1,4 @@ + load(__folder + "../utils/text.js"); /* Define the signs module - signs are persistent @@ -207,14 +208,13 @@ var signs = signs || plugin("signs", { */ if (! event.clickedBlock.state instanceof org.bukkit.block.Sign) return; - var evtLocStr = locationToString(event.clickedBlock.location); + var evtLocStr = utils.locationToString(event.clickedBlock.location); var signUpdater = signs._updaters[evtLocStr] if (signUpdater) signUpdater(event.player, event.clickedBlock.state); }); }); - }()); diff --git a/src/main/javascript/utils/text.js b/src/main/javascript/utils/text.js index 83ad1ad..32b66c8 100644 --- a/src/main/javascript/utils/text.js +++ b/src/main/javascript/utils/text.js @@ -1,6 +1,42 @@ -/* - Just a bunch of text-related extensions to the String class -*/ +/************************************************************************ +String class extensions +----------------------- +The following chat-formatting methods are added to the javascript String class.. + + * black() + * darkblue() + * blue() + * darkgreen() + * darkaqua() + * darkred() + * purple() + * gold() + * gray() + * darkgray() + * indigo() + * brightgreen() + * green() + * aqua() + * red() + * pink() + * yellow() + * white() + * bold() + * random() + * strike() + * underline() + * italic() + * reset() + +Example +------- + + var boldGoldText = "Hello World".bold().gold(); + self.sendMessage(boldGoldText); + +

Hello World

+ +***/ (function(){ var formattingCodes = { black: 0,