Skip to content

Commit

Permalink
script: Fix spacing around (curly) braces
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Jan 19, 2020
1 parent bb3344c commit 2d79474
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions script/console/__init__.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ __setupPackage__(__extension__);
*/

console = {
"log": function(){
"log": function() {
var out = [],
i = 0;
for (; i<arguments.length; i++){
for (; i<arguments.length; i++) {
out.push(JSON.stringify(arguments[i]));
}
print(out.join(" "));
Expand Down
16 changes: 8 additions & 8 deletions script/svg/__init__.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var isNumber = function(n) {
(function() {
svg.templateHooks = {};

svg.regexpQuote = function (str, delimiter) {
svg.regexpQuote = function(str, delimiter) {
return String(str).replace(
new RegExp(
"[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\" + (delimiter || "") + "-]",
Expand All @@ -21,33 +21,33 @@ var isNumber = function(n) {
);
};

svg.getHooksPattern = function(){
svg.getHooksPattern = function() {
var hookNames = [];
for (var i in this.templateHooks)
hookNames.push(i);

// hook_name( arg1 [, arg2]... )
if (hookNames.length){
if (hookNames.length) {
var pattern = "("+hookNames.join("|")+")\\(([^\\(\\)]+)\\)\\s*;?";
return pattern;
}
};

var global = this;
svg.templateHooks.variable = function(varName){
if (varName in global){
svg.templateHooks.variable = function(varName) {
if (varName in global) {
return global[varName];
}
return "";
};

svg.templateHooks.prop = function(propName, varName){
svg.templateHooks.prop = function(propName, varName) {
var out = "";

if ((varName in global)){
if ((varName in global)) {
var value = global[varName];

if (isNumber(value)){
if (isNumber(value)) {
out = propName + ":" + value + ";";
} else if (value.length) {
out = propName + ":" + value + ";";
Expand Down

0 comments on commit 2d79474

Please sign in to comment.