[Pkg-javascript-commits] [less.js] 220/285: improve support to read options from script tag data attr - part 2

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:23:56 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.0.0
in repository less.js.

commit e2b30eb1b35ccdbca87cfb0e2b5b67d4c622db7a
Author: Moez Bouhlel <bmoez.j at gmail.com>
Date:   Wed Oct 22 18:57:29 2014 +0100

    improve support to read options from script tag data attr - part 2
---
 lib/less-browser/utils.js | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/lib/less-browser/utils.js b/lib/less-browser/utils.js
index 7fbfba3..5a881c8 100644
--- a/lib/less-browser/utils.js
+++ b/lib/less-browser/utils.js
@@ -8,19 +8,12 @@ module.exports = {
             .replace(/\./g,                 ':'); // Replace dots with colons(for valid id)
     },
     addDataAttr: function(options) {
-        function reformatOptionName(option) {
-            return String.replace(option , /_(.)/g, function( match, p1) {
-                return p1.toUpperCase();
-            });
-        }
-
         var script = document.currentScript || (function() {
             var scripts = document.getElementsByTagName("script");
             return scripts[scripts.length - 1];
         })();
         for (var opt in script.dataset)
             if (script.dataset.hasOwnProperty(opt)) {
-                opt = reformatOptionName(opt);
                 if (opt === "env" || opt === "dumpLineNumbers" || opt === "rootpath" || opt === "errorReporting")
                     options[opt] = script.dataset[opt];
                 else

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list