From 5156cbd479bd462f57df2c1989b1741d66644569 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Tue, 30 Apr 2013 17:07:14 +0200 Subject: [PATCH] Fine tuning on the editor and the boardgame. --- js/h5p.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/h5p.js b/js/h5p.js index d02b5ce..a8b585a 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -190,6 +190,16 @@ H5P.cloneObject = function (object, recursive, array) { return clone; }; +/** + * Remove all empty spaces before and after the value. + * + * @param {String} value + * @returns {@exp;value@call;replace} + */ +H5P.trim = function (value) { + return value.replace(/^\s+|\s+$/g, ''); +}; + // We have several situations where we want to shuffle an array, extend array // to do so. Array.prototype.shuffle = function() {