Skip to content
This repository was archived by the owner on May 25, 2019. It is now read-only.

Commit 3f27db3

Browse files
committed
Merge pull request #10 from douglasduteil/ft-autodoc
Adding the Angular UI Doc
2 parents 254939a + 7b0b0ff commit 3f27db3

File tree

13 files changed

+468
-206
lines changed

13 files changed

+468
-206
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "out"]
2+
path = out
3+
url = git://github.com/angular-ui/angular-ui-docs.git

.travis.yml

Lines changed: 135 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,135 @@
1-
language: node_js
2-
node_js:
3-
- "0.8"
4-
5-
before_install:
6-
- export DISPLAY=:99.0
7-
- sh -e /etc/init.d/xvfb start
8-
- npm install -g bower karma
9-
- bower install
10-
11-
script: "karma start test/test.conf.js --browsers=Firefox,PhantomJS"
1+
---
2+
language: node_js
3+
node_js:
4+
- '0.10'
5+
- '0.8'
6+
before_install:
7+
- export DISPLAY=:99.0
8+
- sh -e /etc/init.d/xvfb start
9+
- npm install -g bower grunt-cli
10+
- npm install
11+
- bower install
12+
before_script: out/.travis/before_script.sh
13+
script: grunt
14+
after_success: out/.travis/after_success.sh
15+
branches:
16+
only:
17+
- master
18+
env:
19+
global:
20+
- REPO="[email protected]:angular-ui/ui-map.git"
21+
- secure: ! 'Ggzx5RFlcrU4HGtp43dfikwDEyAz5KyMd5IHZOmqh+fsE0XHHyRSUHKXBwLw
22+
23+
XIdERDdDgcx/Uy/gG07hdc3bm9uBCebtf2TUiC10Morv4X4gYq9fmNEiqYFs
24+
25+
ZuMam+e9j8iyFa8zV0ptDPUfiwtMc4sbc8Yj2MniNsi0t602mNc='
26+
- secure: ! 'axLcS6fl7aKTiklqZ0f9hg64iY8MZqSXN+DOoIEZCyCGSzPk0B58wd1HoA/D
27+
28+
T2WhbZIA7TMVFRWywtYv8kaTvaqjO5PJClwxhx/vR3KbQniMG2pbzubmTV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lpIKj1A94sKAUCRlh03LJGFmn+ZvKMXnnCK0rp4ZRnIreUh9+bUKsV
84+
85+
KfzLUXzbSt7PSBih9XnPxsWyL4kL7yOrX3eSV+EmxGsnp8JPpLg='
86+
- secure: ! 'G6dkglxW/y+SLk3zEdAs/RTnZNAHjNHx3qAZmcYuDwGH9742zeQiyiZ87Vbm
87+
88+
d/MbYz/dW5EerLWXoIcHfbpxntSObp7qClUHewDqaFCuN3nbQseiDpLNK0TY
89+
90+
7LI1iAaDI/sY2tstX3FIK8wJJedawU7jUBBpoff5+yhpt48XZro='
91+
- secure: ! 'eecQmGE+09JuVNCj86Ce47NWmOTewNQbfVlpjeHa6Im7mHMai0+eaHEcKAjw
92+
93+
qVcSYjpbc9qhhfUprc2MWf8HyYmBGSYq0b2xOgXVd2gHRhc2ICeQrEOz7f8b
94+
95+
73OSRPnCDrg8avjZTy6sJec2VwMY4L/Hz1C2+LpNjvXMt5Ltb+A='
96+
- secure: ! 'JB8YGDVta+qdMSsSCK67/1TNokZl4pE82ka/ED2KB3jChFN5252FVjwFUlxx
97+
98+
DfWqyEpzm3HtOGXIX9B+sM+vFKT/GIReOx14iSiZEoZ0+MJIZplRsDN2PgiO
99+
100+
1l+HVxiDFFTBPd/0lfkl+cvBJ7vHuV8fKIq5QcWC4W8fyw7BO/U='
101+
- secure: ! 'b4xVLXL58muqBhZzYznwXrsdPzEBONMaXtulg74NcaTA357GTleKkPfLD/lQ
102+
103+
xR7SN9wAH395xR1CxqeUgILG4h/PANjGfTxf+YBaNybu+pkjiCACePE/rgPV
104+
105+
oa6HftkvU7unPg1Qsy89w9+TO3RbLObl2LgmABdKXAni3cHTfJE='
106+
- secure: ! 'ScGiDn76Ewnk/JaSe7xORoMloAle1jQKRcdMi3oEJpKTboMrqhJEybJ3lfhX
107+
108+
F/IdDVaneTAqXe2X2Dtutj6RN146/xyJiE1wLwzRTv6OifZVDBRhbZzdhrtb
109+
110+
Dyb5OE7G8/cEwhD/ZSLgOBugWSsi+74TJCQeymM22MhDClWd+sY='
111+
- secure: ! 'SKSDcZb4Z0tRz54VIweY8HheagPFrEp14EdKX+MUSDKl3orWK9NyX5ZF1Acz
112+
113+
tiYDG+PhXysYVXq4iCs9odGxy5UyQyGvwkf8vKFG/4Q5LF0OQOpWC7btrzie
114+
115+
+sdWbFizB6FxCBFhsUocnmtvD4+oZWcu4KMxztKPdPdPv7r70cw='
116+
- secure: ! 'KhcTRrGY8763gw9Lxy0E5iDp2a2tTS7CO/z9gX3kvw2uWIPnggaAxdsrDMae
117+
118+
rdFDAE2zNpDRxM67pPmeVrisRCRmdgJBz9RW6dTrRM5o5WJktEO5vYQRsibB
119+
120+
bHvhr/2q7qS8ynCTyD4UDi0PMlyy2pEI6mmAyCwiU9yj0viwWFo='
121+
- secure: ! 'NYWbuzljMVP3rMIa2XwSAdNo+d4M8hkLnTleERyseH7F+/7FwTawylq+58aC
122+
123+
ejN34Xg1gAB2Ci33eFTIp4NKN7MzqGQRZNpD6J0QqO+s32PNJDDymCe40W++
124+
125+
Tv+mBlICsZ+7wmY2MenzcoLXj8YWMPI9dZ5AgkjqA3Qn7Cf0caM='
126+
- secure: ! 'YO1+kO5biLPAczwVZe7hDSh5XbYHVhv9nL4yETljaHT65ou8euZfgqs/DwV/
127+
128+
O94cnYi2B6CXMS6IdbIBjxns1yTF2e5fymrtmqGyZh6APBXc+VItSht3Oapd
129+
130+
oz/QGN2jriGOyhr4DgT5SQMH89gFaodpnDCQep7mlOGkx31vLeA='
131+
- secure: ! 'JiFeeeu4Z1KrXuEGotp/4/anTuN33Eo9NPSNrvo7yrRv1B3IJshUlMwbfqHo
132+
133+
xFvluSnmkT48hcbSUN4eXHwtOhjCGZxjMeJsHPzrwNQTzJWRSKn8Nqs9ZxMj
134+
135+
jKp/vvb4c3Hf33TmgMHdqrOGbvf+tmghzkrXgZ/zRmAU6PUgk0k='

component.json renamed to bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"angularui",
99
"map"
1010
],
11-
"main": "./src/map.js",
11+
"main": "./ui-map.js",
1212
"dependencies": {
1313
"angular": ">= 1.0.2",
1414
"angular-ui-utils": "latest"

demo/demo.html

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<script>
2+
requirejs(['core/demo.js']);
3+
</script>
4+
5+
<!-- Le loading
6+
================================================== -->
7+
8+
<div id="map-l" class="loadingAnimation" >
9+
<div class="bowl_ringG">
10+
<div class="ball_holderG">
11+
<div class="ballG">
12+
</div>
13+
</div>
14+
</div>
15+
</div>
16+
17+
<!-- Le directive
18+
================================================== -->
19+
20+
<section id="map" ng-non-bindable ng-controller="MapCtrl" ng-cloak>
21+
<div class="page-header">
22+
<h1>Google Maps</h1>
23+
</div>
24+
<div class="well">
25+
<div class="row">
26+
<div class="span3">
27+
<h4>Click to add a marker!</h4>
28+
<p>{{zoomMessage}}</p>
29+
<ul>
30+
<li ng-repeat="marker in myMarkers">
31+
<a class="btn" ng-click="myMap.panTo(marker.getPosition())">
32+
Pan to Marker {{$index}}
33+
</a>
34+
</li>
35+
</ul>
36+
37+
<!-- this is the confusing part. we have to point the map marker directive
38+
at an existing google.maps.Marker object, so it can hook up events -->
39+
<div ng-repeat="marker in myMarkers" ui-map-marker="myMarkers[$index]"
40+
ui-event="{'map-click': 'openMarkerInfo(marker)'}">
41+
</div>
42+
43+
<div ui-map-info-window="myInfoWindow">
44+
<h1>Marker</h1>
45+
Lat: <input ng-model="currentMarkerLat">, Lng: <input ng-model="currentMarkerLng">
46+
<a class="btn btn-primary" ng-click="setMarkerPosition(currentMarker, currentMarkerLat, currentMarkerLng)">Set Position</a>
47+
</div>
48+
</div>
49+
50+
<!--Giving the div an id="map_canvas" fix problems with twitter bootstrap affecting
51+
google maps-->
52+
<div id="map_canvas" ui-map="myMap" class="span8 map"
53+
ui-event="{'map-click': 'addMarker($event)', 'map-zoom_changed': 'setZoomMessage(myMap.getZoom())' }"
54+
ui-options="mapOptions">
55+
</div>
56+
</div>
57+
</div>
58+
<h3>How?</h3>
59+
<p class="alert alert-info"><i class="icon-info-sign"></i> Remember that you can pass a variable containing an object to <code>ui-event</code></p>
60+
<pre class="prettyprint">
61+
&lt;h4&gt;Click to add a marker!&lt;/h4&gt;
62+
&lt;p&gt;{{zoomMessage}}&lt;/p&gt;
63+
&lt;ul&gt;
64+
&lt;li ng-repeat=&quot;marker in myMarkers&quot;&gt;
65+
&lt;a ng-click=&quot;myMap.panTo(marker.getPosition())&quot;&gt;Pan to Marker {{$index}}&lt;/a&gt;
66+
&lt;/li&gt;
67+
&lt;/ul&gt;
68+
69+
&lt;!-- this is the confusing part. we have to point the map marker directive
70+
at an existing google.maps.Marker object, so it can hook up events --&gt;
71+
&lt;div ng-repeat=&quot;marker in myMarkers&quot; ui-map-marker=&quot;myMarkers[$index]&quot;
72+
ui-event=&quot;{&#x27;map-click&#x27;: &#x27;openMarkerInfo(marker)&#x27;}&quot;&gt;
73+
&lt;/div&gt;
74+
75+
&lt;div ui-map-info-window=&quot;myInfoWindow&quot;&gt;
76+
&lt;h1&gt;Marker&lt;/h1&gt;
77+
Lat: &lt;input ng-model=&quot;currentMarkerLat&quot;&gt;, Lng: &lt;input ng-model=&quot;currentMarkerLng&quot;&gt;
78+
&lt;a ng-click=&quot;setMarkerPosition(currentMarker, currentMarkerLat, currentMarkerLng)&quot;&gt;Set Position&lt;/a&gt;
79+
&lt;/div&gt;
80+
81+
&lt;!-- Giving the div an id="map_canvas" fix problems with twitter bootstrap affecting
82+
google maps --&gt;
83+
&lt;div id=&quot;map_canvas&quot; ui-map=&quot;myMap&quot; class=&quot;map&quot;
84+
ui-event=&quot;{&#x27;map-click&#x27;: &#x27;addMarker($event)&#x27;, &#x27;map-zoom_changed&#x27;: &#x27;setZoomMessage(myMap.getZoom())&#x27; }&quot;
85+
ui-options=&quot;mapOptions&quot;&gt;
86+
&lt;/div&gt;
87+
88+
&lt;script&gt;
89+
$scope.myMarkers = [];
90+
91+
$scope.mapOptions = {
92+
center: new google.maps.LatLng(35.784, -78.670),
93+
zoom: 15,
94+
mapTypeId: google.maps.MapTypeId.ROADMAP
95+
};
96+
97+
$scope.addMarker = function($event) {
98+
$scope.myMarkers.push(new google.maps.Marker({
99+
map: $scope.myMap,
100+
position: $event.latLng
101+
}));
102+
};
103+
104+
$scope.setZoomMessage = function(zoom) {
105+
$scope.zoomMessage = &#x27;You just zoomed to &#x27;+zoom+&#x27;!&#x27;;
106+
console.log(zoom,&#x27;zoomed&#x27;)
107+
};
108+
109+
$scope.openMarkerInfo = function(marker) {
110+
$scope.currentMarker = marker;
111+
$scope.currentMarkerLat = marker.getPosition().lat();
112+
$scope.currentMarkerLng = marker.getPosition().lng();
113+
$scope.myInfoWindow.open($scope.myMap, marker);
114+
};
115+
116+
$scope.setMarkerPosition = function(marker, lat, lng) {
117+
marker.setPosition(new google.maps.LatLng(lat, lng));
118+
};
119+
&lt;/script&gt;
120+
121+
&lt;style&gt;
122+
.map {
123+
height: 400px;
124+
width: 600px;
125+
}
126+
&lt;/style&gt;
127+
</pre>
128+
</section>

demo/demo.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
2+
$("#map").hide();
3+
requireCss('assets/css/demos.css');
4+
5+
function initCall(){ console.log("Google maps api initialized.");}
6+
7+
requirejs(
8+
{
9+
paths: {
10+
'ui.map': "build/ui-map"
11+
},
12+
shim: {
13+
'ui.map': { deps: [
14+
'https://rawgithub.com/angular-ui/ui-utils/master/modules/event/event.js',
15+
'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&callback=initCall'
16+
] }
17+
}
18+
},
19+
['ui.map'],
20+
function () {
21+
22+
angular.module('doc.ui-map', ['ui.map', 'prettifyDirective'])
23+
.controller('MapCtrl', ['$scope', function ($scope) {
24+
25+
$scope.myMarkers = [];
26+
27+
$scope.mapOptions = {
28+
center: new google.maps.LatLng(35.784, -78.670),
29+
zoom: 15,
30+
mapTypeId: google.maps.MapTypeId.ROADMAP
31+
};
32+
33+
$scope.addMarker = function($event) {
34+
$scope.myMarkers.push(new google.maps.Marker({
35+
map: $scope.myMap,
36+
position: $event.latLng
37+
}));
38+
};
39+
40+
$scope.setZoomMessage = function(zoom) {
41+
$scope.zoomMessage = 'You just zoomed to '+zoom+'!';
42+
console.log(zoom,'zoomed');
43+
};
44+
45+
$scope.openMarkerInfo = function(marker) {
46+
$scope.currentMarker = marker;
47+
$scope.currentMarkerLat = marker.getPosition().lat();
48+
$scope.currentMarkerLng = marker.getPosition().lng();
49+
$scope.myInfoWindow.open($scope.myMap, marker);
50+
};
51+
52+
$scope.setMarkerPosition = function(marker, lat, lng) {
53+
marker.setPosition(new google.maps.LatLng(lat, lng));
54+
};
55+
}])
56+
;
57+
e$ = $("#map");
58+
e$.removeAttr("ng-non-bindable");
59+
60+
angular.bootstrap(e$[0], ['doc.ui-map']);
61+
e$.show();
62+
$("#map-l").slideUp();
63+
64+
65+
}
66+
);

0 commit comments

Comments
 (0)