Skip to content
Snippets Groups Projects
Commit d7c7bb3b authored by Brandon Bergren's avatar Brandon Bergren
Browse files

JSLint run.

== -> === changes.
parent 219dcc83
No related branches found
No related tags found
No related merge requests found
/* $Id$ */ /* $Id$ */
//////////////////////////////////////// /**
// Macro widget // * @file
//////////////////////////////////////// * GMap macro widget and macro compiler.
*/
/*global Drupal */
/** /**
* Widget handler. * Widget handler.
*/ */
Drupal.gmap.addHandler('macrotext', function(elem) { Drupal.gmap.addHandler('macrotext', function (elem) {
var obj = this; var obj = this;
obj.macrostorage = {}; obj.macrostorage = {};
obj.bind("widthchange", function(w){ obj.bind("widthchange", function (w) {
obj.macrostorage.width = w; obj.macrostorage.width = w;
}); });
obj.bind("heightchange", function(h){ obj.bind("heightchange", function (h) {
obj.macrostorage.height = h; obj.macrostorage.height = h;
}); });
// Basic macros. // Basic macros.
obj.bind('buildmacro',function(add) { obj.bind('buildmacro', function (add) {
add.push('zoom='+obj.vars.zoom); add.push('zoom=' + obj.vars.zoom);
add.push('center='+obj.vars.latitude+','+obj.vars.longitude); add.push('center=' + obj.vars.latitude + ',' + obj.vars.longitude);
add.push('width='+obj.macrostorage.width); add.push('width=' + obj.macrostorage.width);
add.push('height='+obj.macrostorage.height); add.push('height=' + obj.macrostorage.height);
if (obj.vars.macro_mapid && obj.vars.macro_mapid != '') { if (obj.vars.macro_mapid && obj.vars.macro_mapid !== '') {
add.push('id='+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. // @@@ 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. // Update macro every time something happens.
obj.bind('all',function(name){ obj.bind('all', function (name) {
if (name != 'buildmacro') { if (name !== 'buildmacro') {
var add = []; var add = [];
// Collect macro pieces. // Collect macro pieces.
obj.change('buildmacro',-1,add); obj.change('buildmacro', -1, add);
elem.value = '[gmap ' + add.join(' |') + ']'; elem.value = '[gmap ' + add.join(' |') + ']';
} }
}); });
...@@ -47,9 +50,9 @@ Drupal.gmap.addHandler('macrotext', function(elem) { ...@@ -47,9 +50,9 @@ Drupal.gmap.addHandler('macrotext', function(elem) {
/** /**
* Extensible macros @@@ * Extensible macros @@@
*/ */
Drupal.gmap.map.prototype.parse = function(m) { Drupal.gmap.map.prototype.parse = function (m) {
// Trim off outside tag // Trim off outside tag
if (m.substr(0,5)=='[gmap') { if (m.substr(0, 5) === '[gmap') {
m = m.slice(6,-1); m = m.slice(6, -1);
} }
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment