Skip to content

Commit

Permalink
Item14397: preparing new release
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Jun 20, 2017
1 parent bdc8cce commit 2fb2eb5
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 86 deletions.
21 changes: 14 additions & 7 deletions data/System/GoogleMapsPlugin.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="BramVanOosterhout" comment="" date="1495161447" format="1.1" reprev="4" version="6"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1495161447" format="1.1" reprev="4" version="6"}%
---+!! %TOPIC%
%FORMFIELD{"Description"}%

Expand All @@ -7,6 +7,7 @@
---++ Examples

---+++ TML example

You type:

<verbatim class="tml">
Expand Down Expand Up @@ -187,7 +188,8 @@ while opening up a few more possibilities.

---++ Syntax

| *%<nop>GOOGLEMAPS{...}%* |||
=%<nop>GOOGLEMAPS{...}%=

| *Parameter* | *Description* | *Default* |
| =height="..."= | integer zoom factor | 350px |
| =width="..."= | integer zoom factor | |
Expand All @@ -210,7 +212,9 @@ See [[#DetailsForMarkerAddress][examples]] below. | |

#DetailsForMarkerAddress
---+++ Details for the =markeraddress=

=markeraddress= accepts three different formats:

| *Format* | *Example* | *Result* |
| A location | Hanford | <img src="%ATTACHURLPATH%/TheHanfordSite.jpg" alt="TheHanfordSite.jpg" width='133' height='122' /> |
| A location followed by an equal sign (=) | Oak Ridge= | <img src="%ATTACHURLPATH%/TheOakRidgeSite.jpg" alt="TheOakRidgeSite.jpg" width='351' height='128' /> |
Expand All @@ -227,6 +231,7 @@ See
* https://developers.google.com/maps/documentation/javascript/reference

---++ Installation Instructions

%$INSTALL_INSTRUCTIONS%

If you are using [[Foswiki:Extensions/SecurityHeadersPlugin][SecurityHeadersPlugin]] then you need to allow a few google resources to be loaded by Foswiki:
Expand All @@ -236,9 +241,11 @@ If you are using [[Foswiki:Extensions/SecurityHeadersPlugin][SecurityHeadersPlug
* add =fonts.gstatic.com= to =font-src=

---++ Dependencies

%$DEPENDENCIES%

---++ Change History

| 02 Sep 2016: | repackaged to contain a missing js file in the examples |
| 21 Apr 2016: | upgraded to latest version of gmap3 |
| 07 Nov 2013: | fixed issue mixing HTTP and HTTPS assets |
Expand All @@ -260,8 +267,8 @@ If you are using [[Foswiki:Extensions/SecurityHeadersPlugin][SecurityHeadersPlug
%META:FIELD{name="Support" title="Support" value="Foswiki:Support/%25TOPIC%25"}%
%META:FILEATTACHMENT{name="GoogleMapsSnap1.png" attachment="GoogleMapsSnap1.png" attr="" comment="" date="1468241409" size="270907" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="script.js" attachment="script.js" attr="" comment="Generated by <nop>AttachContentPlugin" date="1468241409" path="script.js" size="2705" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="TheHanfordSite.jpg" attachment="TheHanfordSite.jpg" attr="" comment="The Hanford site" date="1494650666" path="TheHanfordSite.jpg" size="11767" user="BramVanOosterhout" version="1"}%
%META:FILEATTACHMENT{name="TheOakRidgeSite.jpg" attachment="TheOakRidgeSite.jpg" attr="" comment="The Oak Ridge site" date="1494650698" path="TheOakRidgeSite.jpg" size="19369" user="BramVanOosterhout" version="1"}%
%META:FILEATTACHMENT{name="TheTrinityTestSite.jpg" attachment="TheTrinityTestSite.jpg" attr="" comment="The Trinity test site" date="1494650726" path="TheTrinityTestSite.jpg" size="16415" user="BramVanOosterhout" version="1"}%
%META:FILEATTACHMENT{name="TheManhattanProject.jpg" attachment="TheManhattanProject.jpg" attr="" comment="The Manhattan project map" date="1494650754" path="TheManhattanProject.jpg" size="54727" user="BramVanOosterhout" version="1"}%
%META:FILEATTACHMENT{name="JavaScriptExample.jpg" attachment="JavaScriptExample.jpg" attr="" comment="JavaScript example" date="1494653037" path="JavaScriptExample.jpg" size="46313" user="BramVanOosterhout" version="1"}%
%META:FILEATTACHMENT{name="TheHanfordSite.jpg" attachment="TheHanfordSite.jpg" attr="" comment="The Hanford site" date="1494650666" path="TheHanfordSite.jpg" size="11767" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="TheOakRidgeSite.jpg" attachment="TheOakRidgeSite.jpg" attr="" comment="The Oak Ridge site" date="1494650698" path="TheOakRidgeSite.jpg" size="19369" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="TheTrinityTestSite.jpg" attachment="TheTrinityTestSite.jpg" attr="" comment="The Trinity test site" date="1494650726" path="TheTrinityTestSite.jpg" size="16415" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="TheManhattanProject.jpg" attachment="TheManhattanProject.jpg" attr="" comment="The Manhattan project map" date="1494650754" path="TheManhattanProject.jpg" size="54727" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="JavaScriptExample.jpg" attachment="JavaScriptExample.jpg" attr="" comment="JavaScript example" date="1494653037" path="JavaScriptExample.jpg" size="46313" user="ProjectContributor" version="1"}%
6 changes: 6 additions & 0 deletions lib/Foswiki/Plugins/GoogleMapsPlugin/MANIFEST
@@ -1,3 +1,4 @@
!noci
data/System/GoogleMapsPlugin.txt 0644
lib/Foswiki/Plugins/GoogleMapsPlugin/Config.spec 0644
lib/Foswiki/Plugins/GoogleMapsPlugin/Core.pm 0644
Expand All @@ -6,8 +7,13 @@ lib/Foswiki/Plugins/GoogleMapsPlugin.pm 0644
pub/System/GoogleMapsPlugin/gmap3.init.uncompressed.js 0644
pub/System/GoogleMapsPlugin/gmap3.uncompressed.js 0644
pub/System/GoogleMapsPlugin/GoogleMapsSnap1.png 0644
pub/System/GoogleMapsPlugin/JavaScriptExample.jpg 0644
pub/System/GoogleMapsPlugin/Makefile 0644
pub/System/GoogleMapsPlugin/pkg.js 0644
pub/System/GoogleMapsPlugin/pkg.js.gz 0644
pub/System/GoogleMapsPlugin/pkg.uncompressed.js 0644
pub/System/GoogleMapsPlugin/script.js 0644
pub/System/GoogleMapsPlugin/TheHanfordSite.jpg 0644
pub/System/GoogleMapsPlugin/TheManhattanProject.jpg 0644
pub/System/GoogleMapsPlugin/TheOakRidgeSite.jpg 0644
pub/System/GoogleMapsPlugin/TheTrinityTestSite.jpg 0644
5 changes: 4 additions & 1 deletion pub/System/GoogleMapsPlugin/Makefile
Expand Up @@ -4,11 +4,14 @@ PKG_SOURCE=gmap3.uncompressed.js gmap3.init.uncompressed.js

-include $(FOSWIKI_ROOT)/pub/System/JQueryPlugin/Makefile.include

.PHONY: git
.PHONY: git clean

git:
git clone https://github.com/jbdemonte/gmap3.git git

clean:
rm $(TARGET) pkg.uncompressed.js *.gz *.jslint

pkg.uncompressed.js: $(PKG_SOURCE)
cat $(PKG_SOURCE) > $@

Expand Down
79 changes: 39 additions & 40 deletions pub/System/GoogleMapsPlugin/gmap3.init.uncompressed.js
Expand Up @@ -6,52 +6,51 @@ jQuery(function($) {
opts = $this.data();

if (typeof(opts.marker) !== 'undefined') {
$.each(opts.marker.values, function(index, item) {
opts.marker.events = {
"click": function(marker) {
var $this = $(this),
infowindow = $this.gmap3({get:{name:"infowindow"}}),
content;

if (item.address) {
content = item.address.replace(/, */g, '<br />');

if (infowindow) {
infowindow.open($this.gmap3("get"), marker);
infowindow.setContent(content);
} else {
$this.gmap3({
infowindow: {
anchor:marker,
options:{ content: content }
}
});
}

opts.marker.events = {
"click": function(marker, event, context) {
var $this = $(this),
infowindow = $this.gmap3({get:{name:"infowindow"}}),
content;

if (context.data) {
content = context.data.replace(/, */g, '<br />');

if (infowindow) {
infowindow.open($this.gmap3("get"), marker);
infowindow.setContent(content);
} else {
$this.gmap3({
getaddress: {
latLng:marker.getPosition(),
callback:function(results){
var content = results && results[0] ? results[0].formatted_address : "no address";

if (infowindow){
infowindow.open($this.gmap3("get"), marker);
infowindow.setContent(content);
} else {
$this.gmap3({
infowindow: {
anchor:marker,
options:{ content: content }
}
});
}
}
infowindow: {
anchor:marker,
options:{ content: content }
}
});
}
} else {
$this.gmap3({
getaddress: {
latLng:marker.getPosition(),
callback:function(results){
var content = results && results[0] ? results[0].formatted_address : "no address";

if (infowindow){
infowindow.open($this.gmap3("get"), marker);
infowindow.setContent(content);
} else {
$this.gmap3({
infowindow: {
anchor:marker,
options:{ content: content }
}
});
}
}
}
});
}
};
});
}
};
}


Expand Down
76 changes: 38 additions & 38 deletions pub/System/GoogleMapsPlugin/pkg.uncompressed.js
Expand Up @@ -2564,50 +2564,50 @@ jQuery(function($) {

if (typeof(opts.marker) !== 'undefined') {

opts.marker.events = {
"click": function(marker,event,context) {
var $this = $(this),
infowindow = $this.gmap3({get:{name:"infowindow"}}),
content;

if (context.data) {
content = context.data.replace(/, */g, '<br />');

if (infowindow) {
infowindow.open($this.gmap3("get"), marker);
infowindow.setContent(content);
} else {
$this.gmap3({
infowindow: {
anchor:marker,
options:{ content: content }
}
});
}
opts.marker.events = {
"click": function(marker, event, context) {
var $this = $(this),
infowindow = $this.gmap3({get:{name:"infowindow"}}),
content;

if (context.data) {
content = context.data.replace(/, */g, '<br />');

if (infowindow) {
infowindow.open($this.gmap3("get"), marker);
infowindow.setContent(content);
} else {
$this.gmap3({
getaddress: {
latLng:marker.getPosition(),
callback:function(results){
var content = results && results[0] ? results[0].formatted_address : "no address";

if (infowindow){
infowindow.open($this.gmap3("get"), marker);
infowindow.setContent(content);
} else {
$this.gmap3({
infowindow: {
anchor:marker,
options:{ content: content }
}
});
}
}
infowindow: {
anchor:marker,
options:{ content: content }
}
});
}
} else {
$this.gmap3({
getaddress: {
latLng:marker.getPosition(),
callback:function(results){
var content = results && results[0] ? results[0].formatted_address : "no address";

if (infowindow){
infowindow.open($this.gmap3("get"), marker);
infowindow.setContent(content);
} else {
$this.gmap3({
infowindow: {
anchor:marker,
options:{ content: content }
}
});
}
}
}
});
}
};
}
};
}


Expand Down

0 comments on commit 2fb2eb5

Please sign in to comment.