Yurik has uploaded a new change for review. https://gerrit.wikimedia.org/r/266195
Change subject: bumped mapbox.js to 2.2.4 ...................................................................... bumped mapbox.js to 2.2.4 Change-Id: Id3fbd4f5bea94877839190d958f037c2657c9f83 --- M lib/images/icons-000...@2x.png M lib/images/icons-fff...@2x.png M lib/mapbox-lib.js 3 files changed, 166 insertions(+), 142 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer refs/changes/95/266195/1 diff --git a/lib/images/icons-000...@2x.png b/lib/images/icons-000...@2x.png index 7562b88..d65438c 100644 --- a/lib/images/icons-000...@2x.png +++ b/lib/images/icons-000...@2x.png Binary files differ diff --git a/lib/images/icons-fff...@2x.png b/lib/images/icons-fff...@2x.png index 4779a54..734d052 100644 --- a/lib/images/icons-fff...@2x.png +++ b/lib/images/icons-fff...@2x.png Binary files differ diff --git a/lib/mapbox-lib.js b/lib/mapbox-lib.js index b23f514..8a39a40 100644 --- a/lib/mapbox-lib.js +++ b/lib/mapbox-lib.js @@ -7,106 +7,6 @@ var L = require('mapbox.js'); },{"mapbox.js":18}],2:[function(require,module,exports){ -function corslite(url, callback, cors) { - var sent = false; - - if (typeof window.XMLHttpRequest === 'undefined') { - return callback(Error('Browser not supported')); - } - - if (typeof cors === 'undefined') { - var m = url.match(/^\s*https?:\/\/[^\/]*/); - cors = m && (m[0] !== location.protocol + '//' + location.domain + - (location.port ? ':' + location.port : '')); - } - - var x = new window.XMLHttpRequest(); - - function isSuccessful(status) { - return status >= 200 && status < 300 || status === 304; - } - - if (cors && !('withCredentials' in x)) { - // IE8-9 - x = new window.XDomainRequest(); - - // Ensure callback is never called synchronously, i.e., before - // x.send() returns (this has been observed in the wild). - // See https://github.com/mapbox/mapbox.js/issues/472 - var original = callback; - callback = function() { - if (sent) { - original.apply(this, arguments); - } else { - var that = this, args = arguments; - setTimeout(function() { - original.apply(that, args); - }, 0); - } - } - } - - function loaded() { - if ( - // XDomainRequest - x.status === undefined || - // modern browsers - isSuccessful(x.status)) callback.call(x, null, x); - else callback.call(x, x, null); - } - - // Both `onreadystatechange` and `onload` can fire. `onreadystatechange` - // has [been supported for longer](http://stackoverflow.com/a/9181508/229001). - if ('onload' in x) { - x.onload = loaded; - } else { - x.onreadystatechange = function readystate() { - if (x.readyState === 4) { - loaded(); - } - }; - } - - // Call the callback with the XMLHttpRequest object as an error and prevent - // it from ever being called again by reassigning it to `noop` - x.onerror = function error(evt) { - // XDomainRequest provides no evt parameter - callback.call(this, evt || true, null); - callback = function() { }; - }; - - // IE9 must have onprogress be set to a unique function. - x.onprogress = function() { }; - - x.ontimeout = function(evt) { - callback.call(this, evt, null); - callback = function() { }; - }; - - x.onabort = function(evt) { - callback.call(this, evt, null); - callback = function() { }; - }; - - // GET is the only supported HTTP Verb by XDomainRequest and is the - // only one supported here. - x.open('GET', url, true); - - // Send the request. Sending data is not supported. - x.send(null); - sent = true; - - return x; -} - -if (typeof module !== 'undefined') module.exports = corslite; - -},{}],3:[function(require,module,exports){ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; - -},{}],4:[function(require,module,exports){ /* Leaflet, a JavaScript library for mobile-friendly interactive maps. http://leafletjs.com (c) 2010-2013, Vladimir Agafonkin @@ -9275,6 +9175,106 @@ }(window, document)); +},{}],3:[function(require,module,exports){ +function corslite(url, callback, cors) { + var sent = false; + + if (typeof window.XMLHttpRequest === 'undefined') { + return callback(Error('Browser not supported')); + } + + if (typeof cors === 'undefined') { + var m = url.match(/^\s*https?:\/\/[^\/]*/); + cors = m && (m[0] !== location.protocol + '//' + location.domain + + (location.port ? ':' + location.port : '')); + } + + var x = new window.XMLHttpRequest(); + + function isSuccessful(status) { + return status >= 200 && status < 300 || status === 304; + } + + if (cors && !('withCredentials' in x)) { + // IE8-9 + x = new window.XDomainRequest(); + + // Ensure callback is never called synchronously, i.e., before + // x.send() returns (this has been observed in the wild). + // See https://github.com/mapbox/mapbox.js/issues/472 + var original = callback; + callback = function() { + if (sent) { + original.apply(this, arguments); + } else { + var that = this, args = arguments; + setTimeout(function() { + original.apply(that, args); + }, 0); + } + } + } + + function loaded() { + if ( + // XDomainRequest + x.status === undefined || + // modern browsers + isSuccessful(x.status)) callback.call(x, null, x); + else callback.call(x, x, null); + } + + // Both `onreadystatechange` and `onload` can fire. `onreadystatechange` + // has [been supported for longer](http://stackoverflow.com/a/9181508/229001). + if ('onload' in x) { + x.onload = loaded; + } else { + x.onreadystatechange = function readystate() { + if (x.readyState === 4) { + loaded(); + } + }; + } + + // Call the callback with the XMLHttpRequest object as an error and prevent + // it from ever being called again by reassigning it to `noop` + x.onerror = function error(evt) { + // XDomainRequest provides no evt parameter + callback.call(this, evt || true, null); + callback = function() { }; + }; + + // IE9 must have onprogress be set to a unique function. + x.onprogress = function() { }; + + x.ontimeout = function(evt) { + callback.call(this, evt, null); + callback = function() { }; + }; + + x.onabort = function(evt) { + callback.call(this, evt, null); + callback = function() { }; + }; + + // GET is the only supported HTTP Verb by XDomainRequest and is the + // only one supported here. + x.open('GET', url, true); + + // Send the request. Sending data is not supported. + x.send(null); + sent = true; + + return x; +} + +if (typeof module !== 'undefined') module.exports = corslite; + +},{}],4:[function(require,module,exports){ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; + },{}],5:[function(require,module,exports){ /*! * mustache.js - Logic-less {{mustache}} templates with JavaScript @@ -12304,7 +12304,7 @@ }, "name": "mapbox.js", "description": "mapbox javascript api", - "version": "2.2.3", + "version": "2.2.4", "homepage": "http://mapbox.com/", "repository": { "type": "git", @@ -12341,19 +12341,23 @@ "engines": { "node": "*" }, - "gitHead": "09f45092b28d60072a37a400dc44faf04c980108", + "gitHead": "562aafee5a30c112df5f2c2e4abc6df8662301a9", "bugs": { "url": "https://github.com/mapbox/mapbox.js/issues" }, - "_id": "mapbox.js@2.2.3", - "_shasum": "3f7fb12be220382d3ed821aee38016f1d34d6105", - "_from": "mapbox.js@", + "_id": "mapbox.js@2.2.4", + "_shasum": "72e64514ed34b539da33869ee28fbacbd1474159", + "_from": "mapbox.js@^2.2.3", "_npmVersion": "1.4.28", "_npmUser": { - "name": "karenzshea", - "email": "ka...@mapbox.com" + "name": "alulsh", + "email": "alexandra.u...@gmail.com" }, "maintainers": [ + { + "name": "1ec5", + "email": "m...@1ec5.org" + }, { "name": "aaronlidman", "email": "aaronlid...@gmail.com" @@ -12363,8 +12367,16 @@ "email": "aj.ash...@gmail.com" }, { + "name": "alulsh", + "email": "u...@mapbox.com" + }, + { "name": "ansis", "email": "ansis.bramma...@gmail.com" + }, + { + "name": "apendleton", + "email": "and...@mapbox.com" }, { "name": "bergwerkgis", @@ -12391,14 +12403,6 @@ "email": "dthomp...@gmail.com" }, { - "name": "dvncan", - "email": "dun...@mapbox.com" - }, - { - "name": "edenh", - "email": "e...@mapbox.com" - }, - { "name": "emilymcafee", "email": "em...@mapbox.com" }, @@ -12413,10 +12417,6 @@ { "name": "gretacb", "email": "ca...@mapbox.com" - }, - { - "name": "heyitsgarrett", - "email": "heyitsgarr...@gmail.com" }, { "name": "ian29", @@ -12443,6 +12443,10 @@ "email": "ka...@mapbox.com" }, { + "name": "kelvinabrokwa", + "email": "kelvinabro...@gmail.com" + }, + { "name": "kkaefer", "email": "kkae...@gmail.com" }, @@ -12463,7 +12467,7 @@ "email": "l...@mapbox.com" }, { - "name": "mapbox", + "name": "mapbox-admin", "email": "accou...@mapbox.com" }, { @@ -12491,12 +12495,12 @@ "email": "agafon...@gmail.com" }, { - "name": "nickidlugash", - "email": "ni...@mapbox.com" + "name": "mtirwin", + "email": "ir...@mapbox.com" }, { - "name": "planemad", - "email": "arun.plane...@gmail.com" + "name": "nickidlugash", + "email": "ni...@mapbox.com" }, { "name": "rclark", @@ -12544,11 +12548,11 @@ } ], "dist": { - "shasum": "3f7fb12be220382d3ed821aee38016f1d34d6105", - "tarball": "http://registry.npmjs.org/mapbox.js/-/mapbox.js-2.2.3.tgz" + "shasum": "72e64514ed34b539da33869ee28fbacbd1474159", + "tarball": "http://registry.npmjs.org/mapbox.js/-/mapbox.js-2.2.4.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/mapbox.js/-/mapbox.js-2.2.3.tgz" + "_resolved": "https://registry.npmjs.org/mapbox.js/-/mapbox.js-2.2.4.tgz" } },{}],9:[function(require,module,exports){ @@ -12879,7 +12883,7 @@ return geocoder; }; -},{"./feedback":11,"./format_url":12,"./request":27,"./util":31,"isarray":3}],14:[function(require,module,exports){ +},{"./feedback":11,"./format_url":12,"./request":27,"./util":31,"isarray":4}],14:[function(require,module,exports){ 'use strict'; var geocoder = require('./geocoder'), @@ -13653,7 +13657,7 @@ },{"sanitize-caja":6}],20:[function(require,module,exports){ module.exports = window.L = require('leaflet/dist/leaflet-src'); -},{"leaflet/dist/leaflet-src":4}],21:[function(require,module,exports){ +},{"leaflet/dist/leaflet-src":2}],21:[function(require,module,exports){ 'use strict'; var LegendControl = L.Control.extend({ @@ -14172,7 +14176,7 @@ return corslite(url, onload); }; -},{"./config":9,"./util":31,"corslite":2}],28:[function(require,module,exports){ +},{"./config":9,"./util":31,"corslite":3}],28:[function(require,module,exports){ 'use strict'; var format_url = require('./format_url'); @@ -14232,23 +14236,43 @@ name = encodeURIComponent(tilejson.name), image = format_url('/v4/' + tilejson.id + '/' + this._map.getCenter().lng + ',' + this._map.getCenter().lat + ',' + this._map.getZoom() + '/600x600.png', this.options.accessToken), embed = format_url('/v4/' + tilejson.id + '.html', this.options.accessToken), - twitter = '//twitter.com/intent/tweet?status=' + name + ' ' + url, - facebook = '//www.facebook.com/sharer.php?u=' + url + '&t=' + encodeURIComponent(tilejson.name), - pinterest = '//www.pinterest.com/pin/create/button/?url=' + url + '&media=' + image + '&description=' + tilejson.name, - share = ('<h3>Share this map</h3>' + - '<div class="mapbox-share-buttons"><a class="mapbox-button mapbox-button-icon mapbox-icon-facebook" target="_blank" href="{{facebook}}">Facebook</a>' + - '<a class="mapbox-button mapbox-button-icon mapbox-icon-twitter" target="_blank" href="{{twitter}}">Twitter</a>' + - '<a class="mapbox-button mapbox-button-icon mapbox-icon-pinterest" target="_blank" href="{{pinterest}}">Pinterest</a></div>') - .replace('{{twitter}}', twitter) - .replace('{{facebook}}', facebook) - .replace('{{pinterest}}', pinterest), - embedValue = '<iframe width="100%" height="500px" frameBorder="0" src="{{embed}}"></iframe>'.replace('{{embed}}', embed), + twitterURL = '//twitter.com/intent/tweet?status=' + name + ' ' + url, + facebookURL = '//www.facebook.com/sharer.php?u=' + url + '&t=' + name, + pinterestURL = '//www.pinterest.com/pin/create/button/?url=' + url + '&media=' + image + '&description=' + name, + embedValue = '<iframe width="100%" height="500px" frameBorder="0" src="' + embed + '"></iframe>', embedLabel = 'Copy and paste this <strong>HTML code</strong> into documents to embed this map on web pages.'; + + function createShareButton(buttonClass, href, socialMediaName) { + var elem = document.createElement('a'); + elem.setAttribute('class', buttonClass); + elem.setAttribute('href', href); + elem.setAttribute('target', '_blank'); + socialMediaName = document.createTextNode(socialMediaName); + elem.appendChild(socialMediaName); + + return elem; + } L.DomUtil.addClass(this._modal, 'active'); this._sharing = L.DomUtil.create('div', 'mapbox-modal-body', this._content); - this._sharing.innerHTML = share; + + var twitterButton = createShareButton('mapbox-button mapbox-button-icon mapbox-icon-twitter', twitterURL, 'Twitter'); + var facebookButton = createShareButton('mapbox-button mapbox-button-icon mapbox-icon-facebook', facebookURL, 'Facebook'); + var pinterestButton = createShareButton('mapbox-button mapbox-button-icon mapbox-icon-pinterest', pinterestURL, 'Pinterest'); + + var shareHeader = document.createElement('h3'); + var shareText = document.createTextNode('Share this map'); + shareHeader.appendChild(shareText); + + var shareButtons = document.createElement('div'); + shareButtons.setAttribute('class', 'mapbox-share-buttons'); + shareButtons.appendChild(facebookButton); + shareButtons.appendChild(twitterButton); + shareButtons.appendChild(pinterestButton); + + this._sharing.appendChild(shareHeader); + this._sharing.appendChild(shareButtons); var input = L.DomUtil.create('input', 'mapbox-embed', this._sharing); input.type = 'text'; -- To view, visit https://gerrit.wikimedia.org/r/266195 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id3fbd4f5bea94877839190d958f037c2657c9f83 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: master Gerrit-Owner: Yurik <yu...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits