This repository has been archived by the owner on Dec 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathswr-sense-navigation.js
51 lines (46 loc) · 2.02 KB
/
swr-sense-navigation.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
Many users don't read the README ;-)
Then it happens that they download the entire GitHub repository of this extension
and then weird things happen as I created several builds for the extension in the
./build directory, see also here: https://github.com/stefanwalther/sense-extension-install#i-am-getting-error-xyz
This all results in frustration:
- On the user side: Because it does not work out of the box
- On my side: Because I get the same "issues" again an again
The solution:
- I am providing a "default version" of this extension if somebody downloads and imports the entire repo
- Showing a default helping message, what went wrong ...
*/
/* global define,window */
define(
[
'jquery'
],
function ($) { // eslint-disable-line max-params
'use strict';
return {
support: {
export: false,
exportData: false,
snapshot: false
},
initialProperties: {},
snapshot: {canTakeSnapshot: false},
paint: function ($element /* , layout */) {
var msg = $(document.createElement('div'));
msg.attr('style', 'padding: 10px; background-image: linear-gradient(135deg, #ffdbe6 7.14%, #ffffff 7.14%, #ffffff 50%, #ffdbe6 50%, #ffdbe6 57.14%, #ffffff 57.14%, #ffffff 100%);background-size: 7.00px 7.00px;');
var html = '<strong>Thanks for using <i>sense-navigation</i></strong>';
html += '<br/><br/>';
html += '<div style="color:red;">Unfortunately something went wrong ...</div>';
html += '<br/>';
html += '<strong>Resolution:</strong>';
html += '<ul style="padding: 10px; margin-left: 20px;">'
html += '<li>Don\'t download the entire GitHub repository ...</li>';
html += '<li><a href="https://github.com/stefanwalther/sense-extension-install#i-am-getting-error-xyz" target="_blank">See here to resolve the issue ...</a></li>';
html += '</ul>';
html += '<br/>';
html += '<strong>Good luck!</strong>';
msg.html(html);
$element.html(msg);
}
};
});