hoodcms 5.0.15 → 6.0.2
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 +7 -7
- 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 +16 -4
- package/dist/js/app.property.js +5 -5
- package/dist/js/core/DataList.js +25 -3
- package/dist/js/index.d.ts +10 -0
- package/dist/js/index.js +12 -0
- 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 +835 -664
- package/src/js/admin.js.map +1 -1
- package/src/js/app.js +11546 -5
- package/src/js/app.js.map +1 -1
- package/src/js/app.property.js +175 -129
- package/src/js/app.property.js.map +1 -1
- 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/app/PropertyService.ts +202 -0
- package/src/ts/app.property.ts +4 -5
- package/src/ts/core/DataList.ts +27 -4
- package/src/ts/index.ts +14 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
.hood-image,
|
|
2
2
|
.img {
|
|
3
|
-
position:
|
|
4
|
-
background-repeat:
|
|
3
|
+
position: relative;
|
|
4
|
+
background-repeat: no-repeat;
|
|
5
5
|
background-position: center;
|
|
6
|
-
background-size:
|
|
6
|
+
background-size: cover;
|
|
7
7
|
|
|
8
8
|
img {
|
|
9
9
|
display: none !important;
|
|
@@ -11,48 +11,48 @@
|
|
|
11
11
|
|
|
12
12
|
&.darkened {
|
|
13
13
|
&::before {
|
|
14
|
-
position:
|
|
15
|
-
top:
|
|
16
|
-
right:
|
|
17
|
-
bottom:
|
|
18
|
-
left:
|
|
19
|
-
width:
|
|
20
|
-
height:
|
|
21
|
-
content:
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 0;
|
|
16
|
+
right: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
content: "";
|
|
22
22
|
background-color: rgba(0, 0, 0, .5);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
&.lightened {
|
|
27
27
|
&::before {
|
|
28
|
-
position:
|
|
29
|
-
top:
|
|
30
|
-
right:
|
|
31
|
-
bottom:
|
|
32
|
-
left:
|
|
33
|
-
width:
|
|
34
|
-
height:
|
|
35
|
-
content:
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 0;
|
|
30
|
+
right: 0;
|
|
31
|
+
bottom: 0;
|
|
32
|
+
left: 0;
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
content: "";
|
|
36
36
|
background-color: rgba(255, 255, 255, .5);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
&.loading {
|
|
41
41
|
i {
|
|
42
|
-
position:
|
|
43
|
-
top:
|
|
44
|
-
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 50%;
|
|
44
|
+
transform: translateY(-50%);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
&::before {
|
|
48
|
-
position:
|
|
49
|
-
top:
|
|
50
|
-
right:
|
|
51
|
-
bottom:
|
|
52
|
-
left:
|
|
53
|
-
width:
|
|
54
|
-
height:
|
|
55
|
-
content:
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 0;
|
|
50
|
+
right: 0;
|
|
51
|
+
bottom: 0;
|
|
52
|
+
left: 0;
|
|
53
|
+
width: 100%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
content: "";
|
|
56
56
|
background-color: rgba(255, 255, 255, .5);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -66,38 +66,38 @@
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
&.img-xxs {
|
|
69
|
-
width:
|
|
69
|
+
width: 1.5rem;
|
|
70
70
|
height: 1.5rem;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
&.img-xs {
|
|
74
|
-
width:
|
|
74
|
+
width: 3.25rem;
|
|
75
75
|
height: 3.25rem;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
&.img-sm {
|
|
79
|
-
width:
|
|
79
|
+
width: 5rem;
|
|
80
80
|
height: 5rem;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
&.img-md {
|
|
84
|
-
width:
|
|
84
|
+
width: 10rem;
|
|
85
85
|
height: 10rem;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
&.img-lg {
|
|
89
|
-
width:
|
|
89
|
+
width: 20rem;
|
|
90
90
|
height: 20rem;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
&.img-xl {
|
|
94
|
-
width:
|
|
94
|
+
width: 40rem;
|
|
95
95
|
height: 40rem;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
&.img-full {
|
|
99
99
|
display: block;
|
|
100
|
-
width:
|
|
100
|
+
width: 100%;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
&.img-4x3,
|
|
@@ -110,9 +110,9 @@
|
|
|
110
110
|
&.img-wide,
|
|
111
111
|
&.img-mobile-card {
|
|
112
112
|
&::after {
|
|
113
|
-
display:
|
|
114
|
-
padding-top:
|
|
115
|
-
content:
|
|
113
|
+
display: block;
|
|
114
|
+
padding-top: 100%;
|
|
115
|
+
content: "";
|
|
116
116
|
background-size: contain;
|
|
117
117
|
}
|
|
118
118
|
}
|
|
@@ -168,17 +168,17 @@
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
.hood-bg-image {
|
|
171
|
-
position:
|
|
172
|
-
top:
|
|
173
|
-
right:
|
|
174
|
-
bottom:
|
|
175
|
-
left:
|
|
176
|
-
overflow:
|
|
177
|
-
background-size:
|
|
171
|
+
position: absolute;
|
|
172
|
+
top: 0;
|
|
173
|
+
right: 0;
|
|
174
|
+
bottom: 0;
|
|
175
|
+
left: 0;
|
|
176
|
+
overflow: hidden;
|
|
177
|
+
background-size: cover;
|
|
178
178
|
backface-visibility: hidden;
|
|
179
179
|
backface-visibility: hidden;
|
|
180
180
|
|
|
181
181
|
img {
|
|
182
182
|
display: none !important;
|
|
183
183
|
}
|
|
184
|
-
}
|
|
184
|
+
}
|
package/src/scss/login.scss
CHANGED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/// <reference types="google.maps" />
|
|
2
|
+
|
|
3
|
+
import { Alerts } from "../core/Alerts";
|
|
4
|
+
import { DataList } from "../core/DataList";
|
|
5
|
+
|
|
6
|
+
declare global {
|
|
7
|
+
namespace google.maps {
|
|
8
|
+
interface Marker {
|
|
9
|
+
info: string;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface PropertyServiceOptions {
|
|
15
|
+
|
|
16
|
+
listElementId?: string;
|
|
17
|
+
mapListElementId?: string;
|
|
18
|
+
mapElementId?: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Called before the data is fetched.
|
|
22
|
+
*/
|
|
23
|
+
onListLoad?: (sender?: HTMLElement) => void;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Called before the fetched HTML is rendered to the list. Must return the data back to datalist to render.
|
|
27
|
+
*/
|
|
28
|
+
onListRender?: (html: string, sender?: HTMLElement) => string;
|
|
29
|
+
/**
|
|
30
|
+
* Called before the data is fetched.
|
|
31
|
+
*/
|
|
32
|
+
onMapLoad?: (data: string, sender?: HTMLElement) => void;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Called before the fetched HTML is rendered to the list. Must return the data back to datalist to render.
|
|
36
|
+
*/
|
|
37
|
+
onMapRender?: (sender?: HTMLElement) => string;
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export class PropertyService {
|
|
42
|
+
options: PropertyServiceOptions = {
|
|
43
|
+
listElementId: 'property-list',
|
|
44
|
+
mapListElementId: 'property-map-list',
|
|
45
|
+
mapElementId: 'property-map'
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
constructor(options?: PropertyServiceOptions) {
|
|
49
|
+
|
|
50
|
+
this.options = { ...this.options, ...options };
|
|
51
|
+
|
|
52
|
+
this.initList();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
element: HTMLElement;
|
|
56
|
+
list: DataList;
|
|
57
|
+
mapListElement: HTMLElement;
|
|
58
|
+
mapList: DataList;
|
|
59
|
+
map: google.maps.Map = null;
|
|
60
|
+
center: google.maps.LatLngLiteral = { lat: 30, lng: -110 };
|
|
61
|
+
mapElement: HTMLElement;
|
|
62
|
+
markers: any[];
|
|
63
|
+
|
|
64
|
+
initList() {
|
|
65
|
+
|
|
66
|
+
this.element = document.getElementById(this.options.listElementId);
|
|
67
|
+
if (!this.element) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
this.list = new DataList(this.element, {
|
|
72
|
+
onLoad: function (this: PropertyService, sender: HTMLElement = null) {
|
|
73
|
+
|
|
74
|
+
if (this.options.onListLoad) {
|
|
75
|
+
this.options.onListLoad(sender);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
}.bind(this),
|
|
79
|
+
onComplete: function (this: PropertyService, data: string, sender: HTMLElement = null) {
|
|
80
|
+
|
|
81
|
+
if (this.options.onListRender) {
|
|
82
|
+
this.options.onListRender(data, sender);
|
|
83
|
+
}
|
|
84
|
+
Alerts.log('Finished loading property list.', 'info');
|
|
85
|
+
|
|
86
|
+
}.bind(this)
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
initMapList() {
|
|
92
|
+
|
|
93
|
+
this.mapListElement = document.getElementById(this.options.mapListElementId);
|
|
94
|
+
if (!this.mapElement) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
this.mapList = new DataList(this.mapListElement, {
|
|
99
|
+
onComplete: function (this: PropertyService, data: string, sender: HTMLElement = null) {
|
|
100
|
+
|
|
101
|
+
if (this.options.onMapLoad) {
|
|
102
|
+
this.options.onMapLoad(data, sender);
|
|
103
|
+
}
|
|
104
|
+
Alerts.log('Finished loading map list.', 'info');
|
|
105
|
+
this.reloadMarkers();
|
|
106
|
+
|
|
107
|
+
}.bind(this)
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
initMap() {
|
|
112
|
+
|
|
113
|
+
this.mapElement = document.getElementById(this.options.mapElementId);
|
|
114
|
+
if (!this.mapElement) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
this.center = { lat: +this.mapElement.dataset.lat, lng: +this.mapElement.dataset.long };
|
|
119
|
+
|
|
120
|
+
this.map = new google.maps.Map(this.mapElement, {
|
|
121
|
+
zoom: +this.mapElement.dataset.zoom || 15,
|
|
122
|
+
center: this.center,
|
|
123
|
+
scrollwheel: false
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
$(window).resize(function (this: PropertyService) {
|
|
127
|
+
google.maps.event.trigger(this.map, 'resize');
|
|
128
|
+
}.bind(this));
|
|
129
|
+
|
|
130
|
+
google.maps.event.trigger(this.map, 'resize');
|
|
131
|
+
|
|
132
|
+
this.initMapList();
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
reloadMarkers() {
|
|
137
|
+
|
|
138
|
+
var infowindow: google.maps.InfoWindow = null;
|
|
139
|
+
|
|
140
|
+
if (!this.mapElement) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
var map = this.map;
|
|
145
|
+
|
|
146
|
+
if (this.markers) {
|
|
147
|
+
for (var i = 0; i < this.markers.length; i++) {
|
|
148
|
+
this.markers[i].setMap(null);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
this.markers = [];
|
|
153
|
+
|
|
154
|
+
var locations = $("#property-map-locations").data('locations');
|
|
155
|
+
|
|
156
|
+
locations.map(function (this: PropertyService, location: any, i: number) {
|
|
157
|
+
|
|
158
|
+
let marker = new google.maps.Marker({
|
|
159
|
+
position: new google.maps.LatLng(+location.Latitude, +location.Longitude),
|
|
160
|
+
map: this.map,
|
|
161
|
+
optimized: true // makes SVG icons work in IE
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
if (this.mapElement.dataset.marker) {
|
|
165
|
+
marker.setIcon(this.mapElement.dataset.marker);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
marker.info = `<div class="card border-0" style="max-width:300px">
|
|
169
|
+
<div style="background-image:url(${location.ImageUrl})" class="rounded img-full img img-wide"></div>
|
|
170
|
+
<div class="card-body border-0">
|
|
171
|
+
<p style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
|
|
172
|
+
<strong>${location.Address1}, ${location.Postcode}</strong>
|
|
173
|
+
</p>
|
|
174
|
+
<p>${location.Description}</p>
|
|
175
|
+
<a href="${location.MarkerUrl}" class="btn btn-block btn-primary">Find out more...</a>
|
|
176
|
+
</div>
|
|
177
|
+
</div>`;
|
|
178
|
+
|
|
179
|
+
marker.addListener("click", () => {
|
|
180
|
+
if (infowindow) {
|
|
181
|
+
infowindow.close();
|
|
182
|
+
}
|
|
183
|
+
infowindow = new google.maps.InfoWindow({
|
|
184
|
+
content: marker.info
|
|
185
|
+
});
|
|
186
|
+
infowindow.open({
|
|
187
|
+
anchor: marker,
|
|
188
|
+
map,
|
|
189
|
+
shouldFocus: false,
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
this.markers.push(marker);
|
|
194
|
+
|
|
195
|
+
}.bind(this));
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
if (this.options.onMapRender) {
|
|
199
|
+
this.options.onMapRender();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
package/src/ts/app.property.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/// <reference types="google.maps" />
|
|
2
2
|
|
|
3
|
-
import { HoodApi } from "
|
|
4
|
-
import { PropertyController } from './app/PropertyController';
|
|
3
|
+
import { HoodApi, PropertyService } from ".";
|
|
5
4
|
|
|
6
5
|
export class App extends HoodApi {
|
|
7
|
-
property:
|
|
8
|
-
|
|
6
|
+
property: PropertyService;
|
|
7
|
+
|
|
9
8
|
constructor() {
|
|
10
9
|
super();
|
|
11
10
|
|
|
@@ -13,7 +12,7 @@ export class App extends HoodApi {
|
|
|
13
12
|
this.initialise();
|
|
14
13
|
|
|
15
14
|
// Initialise the property controllers.
|
|
16
|
-
this.property = new
|
|
15
|
+
this.property = new PropertyService();
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
}
|
package/src/ts/core/DataList.ts
CHANGED
|
@@ -46,7 +46,7 @@ export class DataList {
|
|
|
46
46
|
|
|
47
47
|
this.element = element;
|
|
48
48
|
this.element.hoodDataList = this;
|
|
49
|
-
if (typeof(element) == 'undefined' || element == null) {
|
|
49
|
+
if (typeof (element) == 'undefined' || element == null) {
|
|
50
50
|
Alerts.log('Could not DataList to element, element does not exist.', 'error');
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
@@ -54,9 +54,32 @@ export class DataList {
|
|
|
54
54
|
this.options = { ...this.options, ...options };
|
|
55
55
|
|
|
56
56
|
if ($(this.element).hasClass('query')) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
|
|
58
|
+
let r = new RegExp('^(?:[a-z]+:)?//', 'i');
|
|
59
|
+
let pageUrl: URL = null;
|
|
60
|
+
if (r.test(this.element.dataset.url)) {
|
|
61
|
+
pageUrl = new URL(this.element.dataset.url);
|
|
62
|
+
} else {
|
|
63
|
+
pageUrl = new URL(window.location.origin + this.element.dataset.url);
|
|
64
|
+
}
|
|
65
|
+
if ('URLSearchParams' in window) {
|
|
66
|
+
var searchParams = new URLSearchParams(window.location.search);
|
|
67
|
+
var urlParams = new URLSearchParams(pageUrl.search);
|
|
68
|
+
searchParams.forEach((value, key, parent) => {
|
|
69
|
+
urlParams.set(key, value);
|
|
70
|
+
});
|
|
71
|
+
if (urlParams.get("page") == "0") {
|
|
72
|
+
urlParams.set("page", "1");
|
|
73
|
+
}
|
|
74
|
+
pageUrl.search = urlParams.toString();
|
|
75
|
+
} else {
|
|
76
|
+
pageUrl.search = window.location.search;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
let url = pageUrl.pathname + pageUrl.search;
|
|
80
|
+
$(this.element).attr('data-url', url);
|
|
81
|
+
$(this.element).data('url', url);
|
|
82
|
+
|
|
60
83
|
}
|
|
61
84
|
|
|
62
85
|
if (!$(this.element).hasClass('refresh-only')) {
|
package/src/ts/index.ts
CHANGED
|
@@ -23,3 +23,17 @@ export * from './core/Validator'
|
|
|
23
23
|
export * from './extensions/jqueryExtensions'
|
|
24
24
|
export * from './extensions/numberExtensions'
|
|
25
25
|
export * from './extensions/stringExtensions'
|
|
26
|
+
|
|
27
|
+
// Extendables for admin area
|
|
28
|
+
export * from './admin/ContentController'
|
|
29
|
+
export * from './admin/ContentTypeController'
|
|
30
|
+
export * from './admin/HomeController'
|
|
31
|
+
export * from './admin/LogsController'
|
|
32
|
+
export * from './admin/MediaController'
|
|
33
|
+
export * from './admin/PropertyController'
|
|
34
|
+
export * from './admin/PropertyImporter'
|
|
35
|
+
export * from './admin/ThemesController'
|
|
36
|
+
export * from './admin/UsersController'
|
|
37
|
+
|
|
38
|
+
// Extendables for app
|
|
39
|
+
export * from './app/PropertyService'
|