hoodcms 5.0.14 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/login.css +1 -1
- package/dist/js/admin/ContentController.d.ts +30 -0
- package/dist/js/admin/ContentController.js +188 -0
- package/dist/js/admin/ContentTypeController.d.ts +15 -0
- package/dist/js/admin/ContentTypeController.js +140 -0
- package/dist/js/admin/HomeController.d.ts +17 -0
- package/dist/js/admin/HomeController.js +111 -0
- package/dist/js/admin/LogsController.d.ts +6 -0
- package/dist/js/admin/LogsController.js +14 -0
- package/dist/js/admin/MediaController.d.ts +7 -0
- package/dist/js/admin/MediaController.js +29 -0
- package/dist/js/admin/PropertyController.d.ts +18 -0
- package/dist/js/admin/PropertyController.js +118 -0
- package/dist/js/admin/PropertyImporter.d.ts +31 -0
- package/dist/js/admin/PropertyImporter.js +95 -0
- package/dist/js/admin/ThemesController.d.ts +8 -0
- package/dist/js/admin/ThemesController.js +37 -0
- package/dist/js/admin/UsersController.d.ts +17 -0
- package/dist/js/admin/UsersController.js +176 -0
- package/dist/js/admin.js +23 -5
- package/dist/js/app/PropertyService.d.ts +46 -0
- package/{src/ts/app/PropertyController.ts → dist/js/app/PropertyService.js} +44 -76
- package/dist/js/app.js +23 -5
- package/dist/js/app.property.js +24 -0
- package/dist/js/core/DataList.js +25 -3
- package/dist/js/core/HoodApi.d.ts +17 -7
- package/dist/js/core/HoodApi.js +71 -10
- package/dist/js/core/Validator.js +1 -1
- package/dist/js/index.d.ts +10 -1
- package/dist/js/index.js +12 -1
- package/dist/js/login.js +1 -1
- package/images/hood-small.png +0 -0
- package/images/hood.png +0 -0
- package/package.json +108 -108
- package/src/css/admin.css +0 -3
- package/src/css/admin.css.map +1 -1
- package/src/css/app.css +0 -3
- package/src/css/app.css.map +1 -1
- package/src/css/login.css +165 -0
- package/src/css/login.css.map +1 -1
- package/src/html/auth0/login.html +100 -0
- package/src/html/auth0/passwordless-email.html +184 -0
- package/src/js/admin.js +43455 -1820
- package/src/js/admin.js.map +1 -1
- package/src/js/app.js +41910 -906
- package/src/js/app.js.map +1 -1
- package/src/js/app.property.js +1169 -0
- package/src/js/app.property.js.map +1 -0
- package/src/js/login.js +1 -1
- package/src/scss/core/_images.scss +48 -48
- package/src/scss/login.scss +1 -0
- package/src/ts/admin.ts +3 -0
- package/src/ts/app/PropertyService.ts +202 -0
- package/src/ts/app.property.ts +20 -0
- package/src/ts/app.ts +3 -81
- package/src/ts/core/DataList.ts +27 -4
- package/src/ts/core/HoodApi.ts +96 -14
- package/src/ts/core/Validator.ts +1 -1
- package/src/ts/index.ts +14 -1
- package/temp.txt +1 -0
- package/dist/js/core/BaseSite.d.ts +0 -6
- package/dist/js/core/BaseSite.js +0 -14
- package/src/ts/core/BaseSite.ts +0 -21
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/// <reference types="google.maps" />
|
|
2
|
+
import { DataList } from "../core/DataList";
|
|
3
|
+
declare global {
|
|
4
|
+
namespace google.maps {
|
|
5
|
+
interface Marker {
|
|
6
|
+
info: string;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export interface PropertyServiceOptions {
|
|
11
|
+
listElementId?: string;
|
|
12
|
+
mapListElementId?: string;
|
|
13
|
+
mapElementId?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Called before the data is fetched.
|
|
16
|
+
*/
|
|
17
|
+
onListLoad?: (sender?: HTMLElement) => void;
|
|
18
|
+
/**
|
|
19
|
+
* Called before the fetched HTML is rendered to the list. Must return the data back to datalist to render.
|
|
20
|
+
*/
|
|
21
|
+
onListRender?: (html: string, sender?: HTMLElement) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Called before the data is fetched.
|
|
24
|
+
*/
|
|
25
|
+
onMapLoad?: (data: string, sender?: HTMLElement) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Called before the fetched HTML is rendered to the list. Must return the data back to datalist to render.
|
|
28
|
+
*/
|
|
29
|
+
onMapRender?: (sender?: HTMLElement) => string;
|
|
30
|
+
}
|
|
31
|
+
export declare class PropertyService {
|
|
32
|
+
options: PropertyServiceOptions;
|
|
33
|
+
constructor(options?: PropertyServiceOptions);
|
|
34
|
+
element: HTMLElement;
|
|
35
|
+
list: DataList;
|
|
36
|
+
mapListElement: HTMLElement;
|
|
37
|
+
mapList: DataList;
|
|
38
|
+
map: google.maps.Map;
|
|
39
|
+
center: google.maps.LatLngLiteral;
|
|
40
|
+
mapElement: HTMLElement;
|
|
41
|
+
markers: any[];
|
|
42
|
+
initList(): void;
|
|
43
|
+
initMapList(): void;
|
|
44
|
+
initMap(): void;
|
|
45
|
+
reloadMarkers(): void;
|
|
46
|
+
}
|
|
@@ -1,125 +1,91 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
|
-
|
|
3
2
|
import { Alerts } from "../core/Alerts";
|
|
4
3
|
import { DataList } from "../core/DataList";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
constructor() {
|
|
4
|
+
export class PropertyService {
|
|
5
|
+
constructor(options) {
|
|
6
|
+
this.options = {
|
|
7
|
+
listElementId: 'property-list',
|
|
8
|
+
mapListElementId: 'property-map-list',
|
|
9
|
+
mapElementId: 'property-map'
|
|
10
|
+
};
|
|
11
|
+
this.map = null;
|
|
12
|
+
this.center = { lat: 30, lng: -110 };
|
|
13
|
+
this.options = Object.assign(Object.assign({}, this.options), options);
|
|
16
14
|
this.initList();
|
|
17
15
|
}
|
|
18
|
-
|
|
19
|
-
element: HTMLElement;
|
|
20
|
-
list: DataList;
|
|
21
|
-
mapListElement: HTMLElement;
|
|
22
|
-
mapList: DataList;
|
|
23
|
-
map: google.maps.Map = null;
|
|
24
|
-
center: google.maps.LatLngLiteral = { lat: 30, lng: -110 };
|
|
25
|
-
mapElement: HTMLElement;
|
|
26
|
-
markers: any[];
|
|
27
|
-
|
|
28
16
|
initList() {
|
|
29
|
-
|
|
30
|
-
this.element = document.getElementById('property-list');
|
|
17
|
+
this.element = document.getElementById(this.options.listElementId);
|
|
31
18
|
if (!this.element) {
|
|
32
19
|
return;
|
|
33
20
|
}
|
|
34
|
-
|
|
35
21
|
this.list = new DataList(this.element, {
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
onLoad: function (sender = null) {
|
|
23
|
+
if (this.options.onListLoad) {
|
|
24
|
+
this.options.onListLoad(sender);
|
|
25
|
+
}
|
|
26
|
+
}.bind(this),
|
|
27
|
+
onComplete: function (data, sender = null) {
|
|
28
|
+
if (this.options.onListRender) {
|
|
29
|
+
this.options.onListRender(data, sender);
|
|
30
|
+
}
|
|
38
31
|
Alerts.log('Finished loading property list.', 'info');
|
|
39
|
-
|
|
40
32
|
}.bind(this)
|
|
41
33
|
});
|
|
42
|
-
|
|
43
34
|
}
|
|
44
|
-
|
|
45
35
|
initMapList() {
|
|
46
|
-
|
|
47
|
-
this.mapListElement = document.getElementById('property-map-list');
|
|
36
|
+
this.mapListElement = document.getElementById(this.options.mapListElementId);
|
|
48
37
|
if (!this.mapElement) {
|
|
49
38
|
return;
|
|
50
39
|
}
|
|
51
|
-
|
|
52
40
|
this.mapList = new DataList(this.mapListElement, {
|
|
53
|
-
onComplete: function (
|
|
54
|
-
|
|
41
|
+
onComplete: function (data, sender = null) {
|
|
42
|
+
if (this.options.onMapLoad) {
|
|
43
|
+
this.options.onMapLoad(data, sender);
|
|
44
|
+
}
|
|
55
45
|
Alerts.log('Finished loading map list.', 'info');
|
|
56
46
|
this.reloadMarkers();
|
|
57
|
-
|
|
58
47
|
}.bind(this)
|
|
59
48
|
});
|
|
60
49
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
this.mapElement = document.getElementById(mapElementId);
|
|
50
|
+
initMap() {
|
|
51
|
+
this.mapElement = document.getElementById(this.options.mapElementId);
|
|
65
52
|
if (!this.mapElement) {
|
|
66
53
|
return;
|
|
67
54
|
}
|
|
68
|
-
|
|
69
55
|
this.center = { lat: +this.mapElement.dataset.lat, lng: +this.mapElement.dataset.long };
|
|
70
|
-
|
|
71
56
|
this.map = new google.maps.Map(this.mapElement, {
|
|
72
57
|
zoom: +this.mapElement.dataset.zoom || 15,
|
|
73
58
|
center: this.center,
|
|
74
59
|
scrollwheel: false
|
|
75
60
|
});
|
|
76
|
-
|
|
77
|
-
$(window).resize(function (this: PropertyController) {
|
|
61
|
+
$(window).resize(function () {
|
|
78
62
|
google.maps.event.trigger(this.map, 'resize');
|
|
79
63
|
}.bind(this));
|
|
80
|
-
|
|
81
64
|
google.maps.event.trigger(this.map, 'resize');
|
|
82
|
-
|
|
83
65
|
this.initMapList();
|
|
84
|
-
|
|
85
66
|
}
|
|
86
|
-
|
|
87
67
|
reloadMarkers() {
|
|
88
|
-
|
|
89
|
-
var infowindow: google.maps.InfoWindow = null;
|
|
90
|
-
|
|
68
|
+
var infowindow = null;
|
|
91
69
|
if (!this.mapElement) {
|
|
92
70
|
return;
|
|
93
71
|
}
|
|
94
|
-
|
|
95
72
|
var map = this.map;
|
|
96
|
-
|
|
97
73
|
if (this.markers) {
|
|
98
74
|
for (var i = 0; i < this.markers.length; i++) {
|
|
99
75
|
this.markers[i].setMap(null);
|
|
100
76
|
}
|
|
101
77
|
}
|
|
102
|
-
|
|
103
78
|
this.markers = [];
|
|
104
|
-
|
|
105
79
|
var locations = $("#property-map-locations").data('locations');
|
|
106
|
-
|
|
107
|
-
locations.map(function (this: PropertyController, location: any, i: number) {
|
|
108
|
-
|
|
80
|
+
locations.map(function (location, i) {
|
|
109
81
|
let marker = new google.maps.Marker({
|
|
110
82
|
position: new google.maps.LatLng(+location.Latitude, +location.Longitude),
|
|
111
83
|
map: this.map,
|
|
112
84
|
optimized: true // makes SVG icons work in IE
|
|
113
85
|
});
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
//marker.setIcon({
|
|
118
|
-
// url: '/images/marker.png',
|
|
119
|
-
// size: new google.maps.Size(30, 41),
|
|
120
|
-
// scaledSize: new google.maps.Size(30, 41)
|
|
121
|
-
//});
|
|
122
|
-
|
|
86
|
+
if (this.mapElement.dataset.marker) {
|
|
87
|
+
marker.setIcon(this.mapElement.dataset.marker);
|
|
88
|
+
}
|
|
123
89
|
marker.info = `<div class="card border-0" style="max-width:300px">
|
|
124
90
|
<div style="background-image:url(${location.ImageUrl})" class="rounded img-full img img-wide"></div>
|
|
125
91
|
<div class="card-body border-0">
|
|
@@ -130,21 +96,23 @@ export class PropertyController {
|
|
|
130
96
|
<a href="${location.MarkerUrl}" class="btn btn-block btn-primary">Find out more...</a>
|
|
131
97
|
</div>
|
|
132
98
|
</div>`;
|
|
133
|
-
|
|
134
|
-
google.maps.event.addListener(marker, 'click', function (this: google.maps.Marker) {
|
|
135
|
-
|
|
99
|
+
marker.addListener("click", () => {
|
|
136
100
|
if (infowindow) {
|
|
137
101
|
infowindow.close();
|
|
138
102
|
}
|
|
139
103
|
infowindow = new google.maps.InfoWindow({
|
|
140
|
-
content:
|
|
104
|
+
content: marker.info
|
|
105
|
+
});
|
|
106
|
+
infowindow.open({
|
|
107
|
+
anchor: marker,
|
|
108
|
+
map,
|
|
109
|
+
shouldFocus: false,
|
|
141
110
|
});
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}.bind(this));
|
|
145
|
-
|
|
111
|
+
});
|
|
146
112
|
this.markers.push(marker);
|
|
147
|
-
|
|
148
113
|
}.bind(this));
|
|
114
|
+
if (this.options.onMapRender) {
|
|
115
|
+
this.options.onMapRender();
|
|
116
|
+
}
|
|
149
117
|
}
|
|
150
118
|
}
|