From d7c7bb3b9cd7b8f70e6a89bf960a2921b388a5b2 Mon Sep 17 00:00:00 2001 From: Brandon Bergren <bdragon@rtk0.net> Date: Wed, 11 Feb 2009 18:53:18 +0000 Subject: [PATCH] JSLint run. == -> === changes. --- js/macro.js | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/js/macro.js b/js/macro.js index 5a2823d..afca5f4 100755 --- a/js/macro.js +++ b/js/macro.js @@ -1,44 +1,47 @@ /* $Id$ */ -//////////////////////////////////////// -// Macro widget // -//////////////////////////////////////// +/** + * @file + * GMap macro widget and macro compiler. + */ + +/*global Drupal */ /** * Widget handler. */ -Drupal.gmap.addHandler('macrotext', function(elem) { +Drupal.gmap.addHandler('macrotext', function (elem) { var obj = this; obj.macrostorage = {}; - obj.bind("widthchange", function(w){ + obj.bind("widthchange", function (w) { obj.macrostorage.width = w; }); - obj.bind("heightchange", function(h){ + obj.bind("heightchange", function (h) { obj.macrostorage.height = h; }); // Basic macros. - obj.bind('buildmacro',function(add) { - add.push('zoom='+obj.vars.zoom); - add.push('center='+obj.vars.latitude+','+obj.vars.longitude); - add.push('width='+obj.macrostorage.width); - add.push('height='+obj.macrostorage.height); - if (obj.vars.macro_mapid && obj.vars.macro_mapid != '') { - add.push('id='+obj.vars.macro_mapid); + obj.bind('buildmacro', function (add) { + add.push('zoom=' + obj.vars.zoom); + add.push('center=' + obj.vars.latitude + ',' + obj.vars.longitude); + add.push('width=' + obj.macrostorage.width); + add.push('height=' + obj.macrostorage.height); + if (obj.vars.macro_mapid && obj.vars.macro_mapid !== '') { + add.push('id=' + obj.vars.macro_mapid); } - add.push('control='+obj.vars.controltype); + add.push('control=' + obj.vars.controltype); // @@@ Use maptype instead, accept old and new. - add.push('type='+obj.vars.maptype); + add.push('type=' + obj.vars.maptype); }); // Update macro every time something happens. - obj.bind('all',function(name){ - if (name != 'buildmacro') { + obj.bind('all', function (name) { + if (name !== 'buildmacro') { var add = []; // Collect macro pieces. - obj.change('buildmacro',-1,add); + obj.change('buildmacro', -1, add); elem.value = '[gmap ' + add.join(' |') + ']'; } }); @@ -47,9 +50,9 @@ Drupal.gmap.addHandler('macrotext', function(elem) { /** * Extensible macros @@@ */ -Drupal.gmap.map.prototype.parse = function(m) { +Drupal.gmap.map.prototype.parse = function (m) { // Trim off outside tag - if (m.substr(0,5)=='[gmap') { - m = m.slice(6,-1); + if (m.substr(0, 5) === '[gmap') { + m = m.slice(6, -1); } }; -- GitLab