summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Bergren2009-02-11 18:53:18 (GMT)
committer Brandon Bergren2009-02-11 18:53:18 (GMT)
commitd7c7bb3b9cd7b8f70e6a89bf960a2921b388a5b2 (patch)
tree23d70beb173947992b6b7fc73eac6c03960e22af
parent219dcc830d965f6dce0408cd54175f025abeb313 (diff)
JSLint run.
== -> === changes.
-rwxr-xr-xjs/macro.js45
1 files 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);
}
};