sibu 1.1.2 → 1.1.3
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/rails-ujs/rails-ujs.js +630 -0
- data/app/assets/javascripts/sibu/common.js +1 -1
- data/app/assets/stylesheets/sibu/defaults.scss +26 -23
- data/app/assets/stylesheets/sibu/sibu.css +1 -4
- data/app/controllers/sibu/pages_controller.rb +5 -0
- data/app/models/sibu/document.rb +2 -2
- data/app/views/layouts/sibu/application.html.erb +1 -0
- data/app/views/layouts/sibu/edit_content.html.erb +6 -1
- data/app/views/sibu/images/index.html.erb +1 -1
- data/app/views/sibu/images/new.html.erb +1 -1
- data/app/views/sibu/pages/_new_section_panel.html.erb +1 -1
- data/lib/sibu/version.rb +1 -1
- metadata +4 -8
- data/app/assets/fonts/sibu/Sibu.eot +0 -0
- data/app/assets/fonts/sibu/Sibu.svg +0 -14
- data/app/assets/fonts/sibu/Sibu.ttf +0 -0
- data/app/assets/fonts/sibu/Sibu.woff +0 -0
- data/app/assets/stylesheets/sibu/icons.scss +0 -41
- /data/app/assets/javascripts/sibu/{sibu.js.erb → sibu.js} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1b9ee6e34d42002024c68e606379220857d08c8432e1fe351934e969b2a94d12
|
|
4
|
+
data.tar.gz: d9dfcdf1df03c1b0f09e7cba1915359579cdc29a9b04aaf1515baa6e6db5133d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 99d1c1d032b9a64a60ed0768a957702c484e208f52ca5b0463536a6c0dea5deb3b1ed3ad0bc7ad839f3a3fd4103616eb833fb5226ff311fba851f76ccc15c1be
|
|
7
|
+
data.tar.gz: 7ae1bcb90d17a022e57f46b550d694cbaaa589a5746e9b63830239bd65baedf642296c6631e2fb949015d6a086580bc5e670c5174451636e0f6dbb133783163b
|
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Unobtrusive JavaScript
|
|
3
|
+
https://github.com/rails/rails/blob/main/actionview/app/javascript
|
|
4
|
+
Released under the MIT license
|
|
5
|
+
*/
|
|
6
|
+
(function(global, factory) {
|
|
7
|
+
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self,
|
|
8
|
+
global.Rails = factory());
|
|
9
|
+
})(this, (function() {
|
|
10
|
+
"use strict";
|
|
11
|
+
const linkClickSelector = "a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]";
|
|
12
|
+
const buttonClickSelector = {
|
|
13
|
+
selector: "button[data-remote]:not([form]), button[data-confirm]:not([form])",
|
|
14
|
+
exclude: "form button"
|
|
15
|
+
};
|
|
16
|
+
const inputChangeSelector = "select[data-remote], input[data-remote], textarea[data-remote]";
|
|
17
|
+
const formSubmitSelector = "form:not([data-turbo=true])";
|
|
18
|
+
const formInputClickSelector = "form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])";
|
|
19
|
+
const formDisableSelector = "input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled";
|
|
20
|
+
const formEnableSelector = "input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled";
|
|
21
|
+
const fileInputSelector = "input[name][type=file]:not([disabled])";
|
|
22
|
+
const linkDisableSelector = "a[data-disable-with], a[data-disable]";
|
|
23
|
+
const buttonDisableSelector = "button[data-remote][data-disable-with], button[data-remote][data-disable]";
|
|
24
|
+
let nonce = null;
|
|
25
|
+
const loadCSPNonce = () => {
|
|
26
|
+
const metaTag = document.querySelector("meta[name=csp-nonce]");
|
|
27
|
+
return nonce = metaTag && metaTag.content;
|
|
28
|
+
};
|
|
29
|
+
const cspNonce = () => nonce || loadCSPNonce();
|
|
30
|
+
const m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector;
|
|
31
|
+
const matches = function(element, selector) {
|
|
32
|
+
if (selector.exclude) {
|
|
33
|
+
return m.call(element, selector.selector) && !m.call(element, selector.exclude);
|
|
34
|
+
} else {
|
|
35
|
+
return m.call(element, selector);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const EXPANDO = "_ujsData";
|
|
39
|
+
const getData = (element, key) => element[EXPANDO] ? element[EXPANDO][key] : undefined;
|
|
40
|
+
const setData = function(element, key, value) {
|
|
41
|
+
if (!element[EXPANDO]) {
|
|
42
|
+
element[EXPANDO] = {};
|
|
43
|
+
}
|
|
44
|
+
return element[EXPANDO][key] = value;
|
|
45
|
+
};
|
|
46
|
+
const $ = selector => Array.prototype.slice.call(document.querySelectorAll(selector));
|
|
47
|
+
const isContentEditable = function(element) {
|
|
48
|
+
var isEditable = false;
|
|
49
|
+
do {
|
|
50
|
+
if (element.isContentEditable) {
|
|
51
|
+
isEditable = true;
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
element = element.parentElement;
|
|
55
|
+
} while (element);
|
|
56
|
+
return isEditable;
|
|
57
|
+
};
|
|
58
|
+
const csrfToken = () => {
|
|
59
|
+
const meta = document.querySelector("meta[name=csrf-token]");
|
|
60
|
+
return meta && meta.content;
|
|
61
|
+
};
|
|
62
|
+
const csrfParam = () => {
|
|
63
|
+
const meta = document.querySelector("meta[name=csrf-param]");
|
|
64
|
+
return meta && meta.content;
|
|
65
|
+
};
|
|
66
|
+
const CSRFProtection = xhr => {
|
|
67
|
+
const token = csrfToken();
|
|
68
|
+
if (token) {
|
|
69
|
+
return xhr.setRequestHeader("X-CSRF-Token", token);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const refreshCSRFTokens = () => {
|
|
73
|
+
const token = csrfToken();
|
|
74
|
+
const param = csrfParam();
|
|
75
|
+
if (token && param) {
|
|
76
|
+
return $('form input[name="' + param + '"]').forEach((input => input.value = token));
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const AcceptHeaders = {
|
|
80
|
+
"*": "*/*",
|
|
81
|
+
text: "text/plain",
|
|
82
|
+
html: "text/html",
|
|
83
|
+
xml: "application/xml, text/xml",
|
|
84
|
+
json: "application/json, text/javascript",
|
|
85
|
+
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
|
|
86
|
+
};
|
|
87
|
+
const ajax = options => {
|
|
88
|
+
options = prepareOptions(options);
|
|
89
|
+
var xhr = createXHR(options, (function() {
|
|
90
|
+
const response = processResponse(xhr.response != null ? xhr.response : xhr.responseText, xhr.getResponseHeader("Content-Type"));
|
|
91
|
+
if (Math.floor(xhr.status / 100) === 2) {
|
|
92
|
+
if (typeof options.success === "function") {
|
|
93
|
+
options.success(response, xhr.statusText, xhr);
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
if (typeof options.error === "function") {
|
|
97
|
+
options.error(response, xhr.statusText, xhr);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return typeof options.complete === "function" ? options.complete(xhr, xhr.statusText) : undefined;
|
|
101
|
+
}));
|
|
102
|
+
if (options.beforeSend && !options.beforeSend(xhr, options)) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
if (xhr.readyState === XMLHttpRequest.OPENED) {
|
|
106
|
+
return xhr.send(options.data);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
var prepareOptions = function(options) {
|
|
110
|
+
options.url = options.url || location.href;
|
|
111
|
+
options.type = options.type.toUpperCase();
|
|
112
|
+
if (options.type === "GET" && options.data) {
|
|
113
|
+
if (options.url.indexOf("?") < 0) {
|
|
114
|
+
options.url += "?" + options.data;
|
|
115
|
+
} else {
|
|
116
|
+
options.url += "&" + options.data;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (!(options.dataType in AcceptHeaders)) {
|
|
120
|
+
options.dataType = "*";
|
|
121
|
+
}
|
|
122
|
+
options.accept = AcceptHeaders[options.dataType];
|
|
123
|
+
if (options.dataType !== "*") {
|
|
124
|
+
options.accept += ", */*; q=0.01";
|
|
125
|
+
}
|
|
126
|
+
return options;
|
|
127
|
+
};
|
|
128
|
+
var createXHR = function(options, done) {
|
|
129
|
+
const xhr = new XMLHttpRequest;
|
|
130
|
+
xhr.open(options.type, options.url, true);
|
|
131
|
+
xhr.setRequestHeader("Accept", options.accept);
|
|
132
|
+
if (typeof options.data === "string") {
|
|
133
|
+
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
|
|
134
|
+
}
|
|
135
|
+
if (!options.crossDomain) {
|
|
136
|
+
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
|
|
137
|
+
CSRFProtection(xhr);
|
|
138
|
+
}
|
|
139
|
+
xhr.withCredentials = !!options.withCredentials;
|
|
140
|
+
xhr.onreadystatechange = function() {
|
|
141
|
+
if (xhr.readyState === XMLHttpRequest.DONE) {
|
|
142
|
+
return done(xhr);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
return xhr;
|
|
146
|
+
};
|
|
147
|
+
var processResponse = function(response, type) {
|
|
148
|
+
if (typeof response === "string" && typeof type === "string") {
|
|
149
|
+
if (type.match(/\bjson\b/)) {
|
|
150
|
+
try {
|
|
151
|
+
response = JSON.parse(response);
|
|
152
|
+
} catch (error) {}
|
|
153
|
+
} else if (type.match(/\b(?:java|ecma)script\b/)) {
|
|
154
|
+
const script = document.createElement("script");
|
|
155
|
+
script.setAttribute("nonce", cspNonce());
|
|
156
|
+
script.text = response;
|
|
157
|
+
document.head.appendChild(script).parentNode.removeChild(script);
|
|
158
|
+
} else if (type.match(/\b(xml|html|svg)\b/)) {
|
|
159
|
+
const parser = new DOMParser;
|
|
160
|
+
type = type.replace(/;.+/, "");
|
|
161
|
+
try {
|
|
162
|
+
response = parser.parseFromString(response, type);
|
|
163
|
+
} catch (error1) {}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return response;
|
|
167
|
+
};
|
|
168
|
+
const href = element => element.href;
|
|
169
|
+
const isCrossDomain = function(url) {
|
|
170
|
+
const originAnchor = document.createElement("a");
|
|
171
|
+
originAnchor.href = location.href;
|
|
172
|
+
const urlAnchor = document.createElement("a");
|
|
173
|
+
try {
|
|
174
|
+
urlAnchor.href = url;
|
|
175
|
+
return !((!urlAnchor.protocol || urlAnchor.protocol === ":") && !urlAnchor.host || originAnchor.protocol + "//" + originAnchor.host === urlAnchor.protocol + "//" + urlAnchor.host);
|
|
176
|
+
} catch (e) {
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
let preventDefault;
|
|
181
|
+
let {CustomEvent: CustomEvent} = window;
|
|
182
|
+
if (typeof CustomEvent !== "function") {
|
|
183
|
+
CustomEvent = function(event, params) {
|
|
184
|
+
const evt = document.createEvent("CustomEvent");
|
|
185
|
+
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
186
|
+
return evt;
|
|
187
|
+
};
|
|
188
|
+
CustomEvent.prototype = window.Event.prototype;
|
|
189
|
+
({preventDefault: preventDefault} = CustomEvent.prototype);
|
|
190
|
+
CustomEvent.prototype.preventDefault = function() {
|
|
191
|
+
const result = preventDefault.call(this);
|
|
192
|
+
if (this.cancelable && !this.defaultPrevented) {
|
|
193
|
+
Object.defineProperty(this, "defaultPrevented", {
|
|
194
|
+
get() {
|
|
195
|
+
return true;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
return result;
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
const fire = (obj, name, data) => {
|
|
203
|
+
const event = new CustomEvent(name, {
|
|
204
|
+
bubbles: true,
|
|
205
|
+
cancelable: true,
|
|
206
|
+
detail: data
|
|
207
|
+
});
|
|
208
|
+
obj.dispatchEvent(event);
|
|
209
|
+
return !event.defaultPrevented;
|
|
210
|
+
};
|
|
211
|
+
const stopEverything = e => {
|
|
212
|
+
fire(e.target, "ujs:everythingStopped");
|
|
213
|
+
e.preventDefault();
|
|
214
|
+
e.stopPropagation();
|
|
215
|
+
e.stopImmediatePropagation();
|
|
216
|
+
};
|
|
217
|
+
const delegate = (element, selector, eventType, handler) => element.addEventListener(eventType, (function(e) {
|
|
218
|
+
let {target: target} = e;
|
|
219
|
+
while (!!(target instanceof Element) && !matches(target, selector)) {
|
|
220
|
+
target = target.parentNode;
|
|
221
|
+
}
|
|
222
|
+
if (target instanceof Element && handler.call(target, e) === false) {
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
e.stopPropagation();
|
|
225
|
+
}
|
|
226
|
+
}));
|
|
227
|
+
const toArray = e => Array.prototype.slice.call(e);
|
|
228
|
+
const serializeElement = (element, additionalParam) => {
|
|
229
|
+
let inputs = [ element ];
|
|
230
|
+
if (matches(element, "form")) {
|
|
231
|
+
inputs = toArray(element.elements);
|
|
232
|
+
}
|
|
233
|
+
const params = [];
|
|
234
|
+
inputs.forEach((function(input) {
|
|
235
|
+
if (!input.name || input.disabled) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (matches(input, "fieldset[disabled] *")) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
if (matches(input, "select")) {
|
|
242
|
+
toArray(input.options).forEach((function(option) {
|
|
243
|
+
if (option.selected) {
|
|
244
|
+
params.push({
|
|
245
|
+
name: input.name,
|
|
246
|
+
value: option.value
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}));
|
|
250
|
+
} else if (input.checked || [ "radio", "checkbox", "submit" ].indexOf(input.type) === -1) {
|
|
251
|
+
params.push({
|
|
252
|
+
name: input.name,
|
|
253
|
+
value: input.value
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}));
|
|
257
|
+
if (additionalParam) {
|
|
258
|
+
params.push(additionalParam);
|
|
259
|
+
}
|
|
260
|
+
return params.map((function(param) {
|
|
261
|
+
if (param.name) {
|
|
262
|
+
return `${encodeURIComponent(param.name)}=${encodeURIComponent(param.value)}`;
|
|
263
|
+
} else {
|
|
264
|
+
return param;
|
|
265
|
+
}
|
|
266
|
+
})).join("&");
|
|
267
|
+
};
|
|
268
|
+
const formElements = (form, selector) => {
|
|
269
|
+
if (matches(form, "form")) {
|
|
270
|
+
return toArray(form.elements).filter((el => matches(el, selector)));
|
|
271
|
+
} else {
|
|
272
|
+
return toArray(form.querySelectorAll(selector));
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
const handleConfirmWithRails = rails => function(e) {
|
|
276
|
+
if (!allowAction(this, rails)) {
|
|
277
|
+
stopEverything(e);
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
const confirm = (message, element) => window.confirm(message);
|
|
281
|
+
var allowAction = function(element, rails) {
|
|
282
|
+
let callback;
|
|
283
|
+
const message = element.getAttribute("data-confirm");
|
|
284
|
+
if (!message) {
|
|
285
|
+
return true;
|
|
286
|
+
}
|
|
287
|
+
let answer = false;
|
|
288
|
+
if (fire(element, "confirm")) {
|
|
289
|
+
try {
|
|
290
|
+
answer = rails.confirm(message, element);
|
|
291
|
+
} catch (error) {}
|
|
292
|
+
callback = fire(element, "confirm:complete", [ answer ]);
|
|
293
|
+
}
|
|
294
|
+
return answer && callback;
|
|
295
|
+
};
|
|
296
|
+
const handleDisabledElement = function(e) {
|
|
297
|
+
const element = this;
|
|
298
|
+
if (element.disabled) {
|
|
299
|
+
stopEverything(e);
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
const enableElement = e => {
|
|
303
|
+
let element;
|
|
304
|
+
if (e instanceof Event) {
|
|
305
|
+
if (isXhrRedirect(e)) {
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
element = e.target;
|
|
309
|
+
} else {
|
|
310
|
+
element = e;
|
|
311
|
+
}
|
|
312
|
+
if (isContentEditable(element)) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
if (matches(element, linkDisableSelector)) {
|
|
316
|
+
return enableLinkElement(element);
|
|
317
|
+
} else if (matches(element, buttonDisableSelector) || matches(element, formEnableSelector)) {
|
|
318
|
+
return enableFormElement(element);
|
|
319
|
+
} else if (matches(element, formSubmitSelector)) {
|
|
320
|
+
return enableFormElements(element);
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
const disableElement = e => {
|
|
324
|
+
const element = e instanceof Event ? e.target : e;
|
|
325
|
+
if (isContentEditable(element)) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
if (matches(element, linkDisableSelector)) {
|
|
329
|
+
return disableLinkElement(element);
|
|
330
|
+
} else if (matches(element, buttonDisableSelector) || matches(element, formDisableSelector)) {
|
|
331
|
+
return disableFormElement(element);
|
|
332
|
+
} else if (matches(element, formSubmitSelector)) {
|
|
333
|
+
return disableFormElements(element);
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
var disableLinkElement = function(element) {
|
|
337
|
+
if (getData(element, "ujs:disabled")) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
const replacement = element.getAttribute("data-disable-with");
|
|
341
|
+
if (replacement != null) {
|
|
342
|
+
setData(element, "ujs:enable-with", element.innerHTML);
|
|
343
|
+
element.innerHTML = replacement;
|
|
344
|
+
}
|
|
345
|
+
element.addEventListener("click", stopEverything);
|
|
346
|
+
return setData(element, "ujs:disabled", true);
|
|
347
|
+
};
|
|
348
|
+
var enableLinkElement = function(element) {
|
|
349
|
+
const originalText = getData(element, "ujs:enable-with");
|
|
350
|
+
if (originalText != null) {
|
|
351
|
+
element.innerHTML = originalText;
|
|
352
|
+
setData(element, "ujs:enable-with", null);
|
|
353
|
+
}
|
|
354
|
+
element.removeEventListener("click", stopEverything);
|
|
355
|
+
return setData(element, "ujs:disabled", null);
|
|
356
|
+
};
|
|
357
|
+
var disableFormElements = form => formElements(form, formDisableSelector).forEach(disableFormElement);
|
|
358
|
+
var disableFormElement = function(element) {
|
|
359
|
+
if (getData(element, "ujs:disabled")) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
const replacement = element.getAttribute("data-disable-with");
|
|
363
|
+
if (replacement != null) {
|
|
364
|
+
if (matches(element, "button")) {
|
|
365
|
+
setData(element, "ujs:enable-with", element.innerHTML);
|
|
366
|
+
element.innerHTML = replacement;
|
|
367
|
+
} else {
|
|
368
|
+
setData(element, "ujs:enable-with", element.value);
|
|
369
|
+
element.value = replacement;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
element.disabled = true;
|
|
373
|
+
return setData(element, "ujs:disabled", true);
|
|
374
|
+
};
|
|
375
|
+
var enableFormElements = form => formElements(form, formEnableSelector).forEach((element => enableFormElement(element)));
|
|
376
|
+
var enableFormElement = function(element) {
|
|
377
|
+
const originalText = getData(element, "ujs:enable-with");
|
|
378
|
+
if (originalText != null) {
|
|
379
|
+
if (matches(element, "button")) {
|
|
380
|
+
element.innerHTML = originalText;
|
|
381
|
+
} else {
|
|
382
|
+
element.value = originalText;
|
|
383
|
+
}
|
|
384
|
+
setData(element, "ujs:enable-with", null);
|
|
385
|
+
}
|
|
386
|
+
element.disabled = false;
|
|
387
|
+
return setData(element, "ujs:disabled", null);
|
|
388
|
+
};
|
|
389
|
+
var isXhrRedirect = function(event) {
|
|
390
|
+
const xhr = event.detail ? event.detail[0] : undefined;
|
|
391
|
+
return xhr && xhr.getResponseHeader("X-Xhr-Redirect");
|
|
392
|
+
};
|
|
393
|
+
const handleMethodWithRails = rails => function(e) {
|
|
394
|
+
const link = this;
|
|
395
|
+
const method = link.getAttribute("data-method");
|
|
396
|
+
if (!method) {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
if (isContentEditable(this)) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
const href = rails.href(link);
|
|
403
|
+
const csrfToken$1 = csrfToken();
|
|
404
|
+
const csrfParam$1 = csrfParam();
|
|
405
|
+
const form = document.createElement("form");
|
|
406
|
+
let formContent = `<input name='_method' value='${method}' type='hidden' />`;
|
|
407
|
+
if (csrfParam$1 && csrfToken$1 && !isCrossDomain(href)) {
|
|
408
|
+
formContent += `<input name='${csrfParam$1}' value='${csrfToken$1}' type='hidden' />`;
|
|
409
|
+
}
|
|
410
|
+
formContent += '<input type="submit" />';
|
|
411
|
+
form.method = "post";
|
|
412
|
+
form.action = href;
|
|
413
|
+
form.target = link.target;
|
|
414
|
+
form.innerHTML = formContent;
|
|
415
|
+
form.style.display = "none";
|
|
416
|
+
document.body.appendChild(form);
|
|
417
|
+
form.querySelector('[type="submit"]').click();
|
|
418
|
+
stopEverything(e);
|
|
419
|
+
};
|
|
420
|
+
const isRemote = function(element) {
|
|
421
|
+
const value = element.getAttribute("data-remote");
|
|
422
|
+
return value != null && value !== "false";
|
|
423
|
+
};
|
|
424
|
+
const handleRemoteWithRails = rails => function(e) {
|
|
425
|
+
let data, method, url;
|
|
426
|
+
const element = this;
|
|
427
|
+
if (!isRemote(element)) {
|
|
428
|
+
return true;
|
|
429
|
+
}
|
|
430
|
+
if (!fire(element, "ajax:before")) {
|
|
431
|
+
fire(element, "ajax:stopped");
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
if (isContentEditable(element)) {
|
|
435
|
+
fire(element, "ajax:stopped");
|
|
436
|
+
return false;
|
|
437
|
+
}
|
|
438
|
+
const withCredentials = element.getAttribute("data-with-credentials");
|
|
439
|
+
const dataType = element.getAttribute("data-type") || "script";
|
|
440
|
+
if (matches(element, formSubmitSelector)) {
|
|
441
|
+
const button = getData(element, "ujs:submit-button");
|
|
442
|
+
method = getData(element, "ujs:submit-button-formmethod") || element.getAttribute("method") || "get";
|
|
443
|
+
url = getData(element, "ujs:submit-button-formaction") || element.getAttribute("action") || location.href;
|
|
444
|
+
if (method.toUpperCase() === "GET") {
|
|
445
|
+
url = url.replace(/\?.*$/, "");
|
|
446
|
+
}
|
|
447
|
+
if (element.enctype === "multipart/form-data") {
|
|
448
|
+
data = new FormData(element);
|
|
449
|
+
if (button != null) {
|
|
450
|
+
data.append(button.name, button.value);
|
|
451
|
+
}
|
|
452
|
+
} else {
|
|
453
|
+
data = serializeElement(element, button);
|
|
454
|
+
}
|
|
455
|
+
setData(element, "ujs:submit-button", null);
|
|
456
|
+
setData(element, "ujs:submit-button-formmethod", null);
|
|
457
|
+
setData(element, "ujs:submit-button-formaction", null);
|
|
458
|
+
} else if (matches(element, buttonClickSelector) || matches(element, inputChangeSelector)) {
|
|
459
|
+
method = element.getAttribute("data-method");
|
|
460
|
+
url = element.getAttribute("data-url");
|
|
461
|
+
data = serializeElement(element, element.getAttribute("data-params"));
|
|
462
|
+
} else {
|
|
463
|
+
method = element.getAttribute("data-method");
|
|
464
|
+
url = rails.href(element);
|
|
465
|
+
data = element.getAttribute("data-params");
|
|
466
|
+
}
|
|
467
|
+
ajax({
|
|
468
|
+
type: method || "GET",
|
|
469
|
+
url: url,
|
|
470
|
+
data: data,
|
|
471
|
+
dataType: dataType,
|
|
472
|
+
beforeSend(xhr, options) {
|
|
473
|
+
if (fire(element, "ajax:beforeSend", [ xhr, options ])) {
|
|
474
|
+
return fire(element, "ajax:send", [ xhr ]);
|
|
475
|
+
} else {
|
|
476
|
+
fire(element, "ajax:stopped");
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
success(...args) {
|
|
481
|
+
return fire(element, "ajax:success", args);
|
|
482
|
+
},
|
|
483
|
+
error(...args) {
|
|
484
|
+
return fire(element, "ajax:error", args);
|
|
485
|
+
},
|
|
486
|
+
complete(...args) {
|
|
487
|
+
return fire(element, "ajax:complete", args);
|
|
488
|
+
},
|
|
489
|
+
crossDomain: isCrossDomain(url),
|
|
490
|
+
withCredentials: withCredentials != null && withCredentials !== "false"
|
|
491
|
+
});
|
|
492
|
+
stopEverything(e);
|
|
493
|
+
};
|
|
494
|
+
const formSubmitButtonClick = function(e) {
|
|
495
|
+
const button = this;
|
|
496
|
+
const {form: form} = button;
|
|
497
|
+
if (!form) {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
if (button.name) {
|
|
501
|
+
setData(form, "ujs:submit-button", {
|
|
502
|
+
name: button.name,
|
|
503
|
+
value: button.value
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
setData(form, "ujs:formnovalidate-button", button.formNoValidate);
|
|
507
|
+
setData(form, "ujs:submit-button-formaction", button.getAttribute("formaction"));
|
|
508
|
+
return setData(form, "ujs:submit-button-formmethod", button.getAttribute("formmethod"));
|
|
509
|
+
};
|
|
510
|
+
const preventInsignificantClick = function(e) {
|
|
511
|
+
const link = this;
|
|
512
|
+
const method = (link.getAttribute("data-method") || "GET").toUpperCase();
|
|
513
|
+
const data = link.getAttribute("data-params");
|
|
514
|
+
const metaClick = e.metaKey || e.ctrlKey;
|
|
515
|
+
const insignificantMetaClick = metaClick && method === "GET" && !data;
|
|
516
|
+
const nonPrimaryMouseClick = e.button != null && e.button !== 0;
|
|
517
|
+
if (nonPrimaryMouseClick || insignificantMetaClick) {
|
|
518
|
+
e.stopImmediatePropagation();
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
const Rails = {
|
|
522
|
+
$: $,
|
|
523
|
+
ajax: ajax,
|
|
524
|
+
buttonClickSelector: buttonClickSelector,
|
|
525
|
+
buttonDisableSelector: buttonDisableSelector,
|
|
526
|
+
confirm: confirm,
|
|
527
|
+
cspNonce: cspNonce,
|
|
528
|
+
csrfToken: csrfToken,
|
|
529
|
+
csrfParam: csrfParam,
|
|
530
|
+
CSRFProtection: CSRFProtection,
|
|
531
|
+
delegate: delegate,
|
|
532
|
+
disableElement: disableElement,
|
|
533
|
+
enableElement: enableElement,
|
|
534
|
+
fileInputSelector: fileInputSelector,
|
|
535
|
+
fire: fire,
|
|
536
|
+
formElements: formElements,
|
|
537
|
+
formEnableSelector: formEnableSelector,
|
|
538
|
+
formDisableSelector: formDisableSelector,
|
|
539
|
+
formInputClickSelector: formInputClickSelector,
|
|
540
|
+
formSubmitButtonClick: formSubmitButtonClick,
|
|
541
|
+
formSubmitSelector: formSubmitSelector,
|
|
542
|
+
getData: getData,
|
|
543
|
+
handleDisabledElement: handleDisabledElement,
|
|
544
|
+
href: href,
|
|
545
|
+
inputChangeSelector: inputChangeSelector,
|
|
546
|
+
isCrossDomain: isCrossDomain,
|
|
547
|
+
linkClickSelector: linkClickSelector,
|
|
548
|
+
linkDisableSelector: linkDisableSelector,
|
|
549
|
+
loadCSPNonce: loadCSPNonce,
|
|
550
|
+
matches: matches,
|
|
551
|
+
preventInsignificantClick: preventInsignificantClick,
|
|
552
|
+
refreshCSRFTokens: refreshCSRFTokens,
|
|
553
|
+
serializeElement: serializeElement,
|
|
554
|
+
setData: setData,
|
|
555
|
+
stopEverything: stopEverything
|
|
556
|
+
};
|
|
557
|
+
const handleConfirm = handleConfirmWithRails(Rails);
|
|
558
|
+
Rails.handleConfirm = handleConfirm;
|
|
559
|
+
const handleMethod = handleMethodWithRails(Rails);
|
|
560
|
+
Rails.handleMethod = handleMethod;
|
|
561
|
+
const handleRemote = handleRemoteWithRails(Rails);
|
|
562
|
+
Rails.handleRemote = handleRemote;
|
|
563
|
+
const start = function() {
|
|
564
|
+
if (window._rails_loaded) {
|
|
565
|
+
throw new Error("rails-ujs has already been loaded!");
|
|
566
|
+
}
|
|
567
|
+
window.addEventListener("pageshow", (function() {
|
|
568
|
+
$(formEnableSelector).forEach((function(el) {
|
|
569
|
+
if (getData(el, "ujs:disabled")) {
|
|
570
|
+
enableElement(el);
|
|
571
|
+
}
|
|
572
|
+
}));
|
|
573
|
+
$(linkDisableSelector).forEach((function(el) {
|
|
574
|
+
if (getData(el, "ujs:disabled")) {
|
|
575
|
+
enableElement(el);
|
|
576
|
+
}
|
|
577
|
+
}));
|
|
578
|
+
}));
|
|
579
|
+
delegate(document, linkDisableSelector, "ajax:complete", enableElement);
|
|
580
|
+
delegate(document, linkDisableSelector, "ajax:stopped", enableElement);
|
|
581
|
+
delegate(document, buttonDisableSelector, "ajax:complete", enableElement);
|
|
582
|
+
delegate(document, buttonDisableSelector, "ajax:stopped", enableElement);
|
|
583
|
+
delegate(document, linkClickSelector, "click", preventInsignificantClick);
|
|
584
|
+
delegate(document, linkClickSelector, "click", handleDisabledElement);
|
|
585
|
+
delegate(document, linkClickSelector, "click", handleConfirm);
|
|
586
|
+
delegate(document, linkClickSelector, "click", disableElement);
|
|
587
|
+
delegate(document, linkClickSelector, "click", handleRemote);
|
|
588
|
+
delegate(document, linkClickSelector, "click", handleMethod);
|
|
589
|
+
delegate(document, buttonClickSelector, "click", preventInsignificantClick);
|
|
590
|
+
delegate(document, buttonClickSelector, "click", handleDisabledElement);
|
|
591
|
+
delegate(document, buttonClickSelector, "click", handleConfirm);
|
|
592
|
+
delegate(document, buttonClickSelector, "click", disableElement);
|
|
593
|
+
delegate(document, buttonClickSelector, "click", handleRemote);
|
|
594
|
+
delegate(document, inputChangeSelector, "change", handleDisabledElement);
|
|
595
|
+
delegate(document, inputChangeSelector, "change", handleConfirm);
|
|
596
|
+
delegate(document, inputChangeSelector, "change", handleRemote);
|
|
597
|
+
delegate(document, formSubmitSelector, "submit", handleDisabledElement);
|
|
598
|
+
delegate(document, formSubmitSelector, "submit", handleConfirm);
|
|
599
|
+
delegate(document, formSubmitSelector, "submit", handleRemote);
|
|
600
|
+
delegate(document, formSubmitSelector, "submit", (e => setTimeout((() => disableElement(e)), 13)));
|
|
601
|
+
delegate(document, formSubmitSelector, "ajax:send", disableElement);
|
|
602
|
+
delegate(document, formSubmitSelector, "ajax:complete", enableElement);
|
|
603
|
+
delegate(document, formInputClickSelector, "click", preventInsignificantClick);
|
|
604
|
+
delegate(document, formInputClickSelector, "click", handleDisabledElement);
|
|
605
|
+
delegate(document, formInputClickSelector, "click", handleConfirm);
|
|
606
|
+
delegate(document, formInputClickSelector, "click", formSubmitButtonClick);
|
|
607
|
+
document.addEventListener("DOMContentLoaded", refreshCSRFTokens);
|
|
608
|
+
document.addEventListener("DOMContentLoaded", loadCSPNonce);
|
|
609
|
+
return window._rails_loaded = true;
|
|
610
|
+
};
|
|
611
|
+
Rails.start = start;
|
|
612
|
+
if (typeof jQuery !== "undefined" && jQuery && jQuery.ajax) {
|
|
613
|
+
if (jQuery.rails) {
|
|
614
|
+
throw new Error("If you load both jquery_ujs and rails-ujs, use rails-ujs only.");
|
|
615
|
+
}
|
|
616
|
+
jQuery.rails = Rails;
|
|
617
|
+
jQuery.ajaxPrefilter((function(options, originalOptions, xhr) {
|
|
618
|
+
if (!options.crossDomain) {
|
|
619
|
+
return CSRFProtection(xhr);
|
|
620
|
+
}
|
|
621
|
+
}));
|
|
622
|
+
}
|
|
623
|
+
if (typeof exports !== "object" && typeof module === "undefined") {
|
|
624
|
+
window.Rails = Rails;
|
|
625
|
+
if (fire(document, "rails:attachBindings")) {
|
|
626
|
+
start();
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
return Rails;
|
|
630
|
+
}));
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
.sibu_edit_content {
|
|
2
|
+
--sibu-color1: #acb3c2;
|
|
3
|
+
--sibu-color2: #727e96;
|
|
4
|
+
--sibu-color3: #333;
|
|
5
|
+
--sibu-fonts: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
6
|
+
}
|
|
4
7
|
|
|
5
8
|
.sibu_view {
|
|
6
9
|
padding: 2rem;
|
|
7
|
-
font-family: -
|
|
10
|
+
font-family: var(--sibu-fonts);
|
|
8
11
|
|
|
9
12
|
h2 {
|
|
10
13
|
padding-bottom: 1rem;
|
|
11
|
-
border-bottom: 2px solid
|
|
14
|
+
border-bottom: 2px solid var(--sibu-color1);
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
> .actions {
|
|
@@ -33,7 +36,7 @@ $sibu-color3 : #333 !default;
|
|
|
33
36
|
height: calc(100vh - 160px);
|
|
34
37
|
float: right;
|
|
35
38
|
width: 30%;
|
|
36
|
-
background-color:
|
|
39
|
+
background-color: var(--sibu-color2);
|
|
37
40
|
|
|
38
41
|
.sibu_field {
|
|
39
42
|
margin-top: 1rem;
|
|
@@ -54,13 +57,13 @@ $sibu-color3 : #333 !default;
|
|
|
54
57
|
|
|
55
58
|
img {
|
|
56
59
|
padding: 5px;
|
|
57
|
-
border: 1px solid
|
|
60
|
+
border: 1px solid var(--sibu-color3);
|
|
58
61
|
height: 100px;
|
|
59
62
|
width: auto;
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
&.selected {
|
|
63
|
-
background-color:
|
|
66
|
+
background-color: var(--sibu-color3);
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
&:hover {
|
|
@@ -117,7 +120,7 @@ $sibu-color3 : #333 !default;
|
|
|
117
120
|
margin-right: 0.5rem;
|
|
118
121
|
|
|
119
122
|
&.selected {
|
|
120
|
-
border: 2px solid
|
|
123
|
+
border: 2px solid var(--sibu-color3);
|
|
121
124
|
outline: solid white 2px;
|
|
122
125
|
outline-offset: -3px;
|
|
123
126
|
}
|
|
@@ -174,7 +177,7 @@ $sibu-color3 : #333 !default;
|
|
|
174
177
|
}
|
|
175
178
|
|
|
176
179
|
.sibu_selected_image {
|
|
177
|
-
background-color:
|
|
180
|
+
background-color: var(--sibu-color2);
|
|
178
181
|
width: 30%;
|
|
179
182
|
margin-bottom: 2rem;
|
|
180
183
|
text-align: center;
|
|
@@ -208,7 +211,7 @@ $sibu-color3 : #333 !default;
|
|
|
208
211
|
}
|
|
209
212
|
|
|
210
213
|
#editor-container .ql-editor {
|
|
211
|
-
color:
|
|
214
|
+
color: var(--sibu-color2);
|
|
212
215
|
}
|
|
213
216
|
}
|
|
214
217
|
|
|
@@ -230,7 +233,7 @@ $sibu-color3 : #333 !default;
|
|
|
230
233
|
|
|
231
234
|
img {
|
|
232
235
|
margin-bottom: 2rem;
|
|
233
|
-
border-top: 2px solid
|
|
236
|
+
border-top: 2px solid var(--sibu-color1);
|
|
234
237
|
box-shadow: 0 0 5px #ccc;
|
|
235
238
|
}
|
|
236
239
|
}
|
|
@@ -268,7 +271,7 @@ $sibu-color3 : #333 !default;
|
|
|
268
271
|
margin-bottom: -2px;
|
|
269
272
|
padding: 1rem 2.5rem;
|
|
270
273
|
border-bottom: 4px solid transparent;
|
|
271
|
-
color:
|
|
274
|
+
color: var(--sibu-color1);
|
|
272
275
|
text-decoration: none;
|
|
273
276
|
border-radius: 0 0 0 0;
|
|
274
277
|
transition: .25s;
|
|
@@ -276,15 +279,15 @@ $sibu-color3 : #333 !default;
|
|
|
276
279
|
font-size: 2rem;
|
|
277
280
|
|
|
278
281
|
&:focus {
|
|
279
|
-
border-bottom-color:
|
|
280
|
-
color:
|
|
282
|
+
border-bottom-color: var(--sibu-color2);
|
|
283
|
+
color: var(--sibu-color2);
|
|
281
284
|
outline: 0;
|
|
282
285
|
}
|
|
283
286
|
}
|
|
284
287
|
|
|
285
288
|
[aria-selected="true"].tabs__link {
|
|
286
|
-
border-bottom-color:
|
|
287
|
-
color:
|
|
289
|
+
border-bottom-color: var(--sibu-color2);
|
|
290
|
+
color: var(--sibu-color2);
|
|
288
291
|
outline: 0;
|
|
289
292
|
}
|
|
290
293
|
}
|
|
@@ -303,12 +306,12 @@ $sibu-color3 : #333 !default;
|
|
|
303
306
|
|
|
304
307
|
&:hover {
|
|
305
308
|
cursor: pointer;
|
|
306
|
-
outline: dashed
|
|
309
|
+
outline: dashed var(--sibu-color2) 4px;
|
|
307
310
|
outline-offset: -5px;
|
|
308
311
|
}
|
|
309
312
|
|
|
310
313
|
&.selected {
|
|
311
|
-
outline: solid
|
|
314
|
+
outline: solid var(--sibu-color1) 5px;
|
|
312
315
|
outline-offset: -5px;
|
|
313
316
|
}
|
|
314
317
|
|
|
@@ -333,14 +336,14 @@ $sibu-color3 : #333 !default;
|
|
|
333
336
|
|
|
334
337
|
form {
|
|
335
338
|
.sibu_panel.sibu_view {
|
|
336
|
-
border-top: 2px solid
|
|
339
|
+
border-top: 2px solid var(--sibu-color3);
|
|
337
340
|
}
|
|
338
341
|
}
|
|
339
342
|
}
|
|
340
343
|
|
|
341
344
|
#edit_panel {
|
|
342
345
|
background-color: white;
|
|
343
|
-
border-top: 1px solid
|
|
346
|
+
border-top: 1px solid var(--sibu-color3);
|
|
344
347
|
max-height: 100%;
|
|
345
348
|
overflow: auto;
|
|
346
349
|
|
|
@@ -354,7 +357,7 @@ $sibu-color3 : #333 !default;
|
|
|
354
357
|
|
|
355
358
|
#edit_mode_overlay {
|
|
356
359
|
.overlay_top, .overlay_bottom, .overlay_left, .overlay_right {
|
|
357
|
-
background-color:
|
|
360
|
+
background-color: var(--sibu-color2);
|
|
358
361
|
}
|
|
359
362
|
|
|
360
363
|
.edit_mode_actions {
|
|
@@ -366,7 +369,7 @@ $sibu-color3 : #333 !default;
|
|
|
366
369
|
|
|
367
370
|
p {
|
|
368
371
|
font-weight: bold;
|
|
369
|
-
font-size: 2rem;
|
|
372
|
+
font-size: 1.2rem;
|
|
370
373
|
flex: 1 1 0%;
|
|
371
374
|
margin: 0;
|
|
372
375
|
}
|
|
@@ -143,6 +143,11 @@ module Sibu
|
|
|
143
143
|
|
|
144
144
|
def create_section
|
|
145
145
|
@created = @entity.create_section(*@section_id.split('|'), params[:after], section_params)
|
|
146
|
+
if @created
|
|
147
|
+
redirect_to site_page_edit_content_url(@entity.site_id, @entity.id), notice: "Le bloc a bien été créé."
|
|
148
|
+
else
|
|
149
|
+
redirect_to site_page_edit_content_url(@entity.site_id, @entity.id), alert: "Une erreur s'est produite lors de l'enregistrement."
|
|
150
|
+
end
|
|
146
151
|
end
|
|
147
152
|
|
|
148
153
|
def edit_section
|
data/app/models/sibu/document.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
module Sibu
|
|
2
2
|
class Document < ApplicationRecord
|
|
3
|
-
include DocumentUploader::Attachment
|
|
3
|
+
include DocumentUploader::Attachment(:file, cache: :documents_cache, store: :documents_store)
|
|
4
4
|
extend Sibu::UserConcern
|
|
5
5
|
|
|
6
|
-
validates_presence_of :
|
|
6
|
+
validates_presence_of :file
|
|
7
7
|
|
|
8
8
|
def metadata
|
|
9
9
|
JSON.parse(file_data, symbolize_names: true)[:metadata]
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
<title><%= conf[:title] %></title>
|
|
5
5
|
<%= stylesheet_link_tag conf[:stylesheet], media: 'all' %>
|
|
6
6
|
<%= javascript_include_tag conf[:javascript] %>
|
|
7
|
+
<%= javascript_include_tag 'rails-ujs/rails-ujs' %>
|
|
7
8
|
<%= javascript_include_tag 'sibu/common' %>
|
|
8
9
|
<%= csrf_meta_tags %>
|
|
9
10
|
</head>
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
<% end %>
|
|
14
14
|
<%= javascript_include_tag "#{conf[:javascript]}-edit" %>
|
|
15
15
|
<%= csrf_meta_tags %>
|
|
16
|
-
<%= yield :
|
|
16
|
+
<%= yield :included_styles %>
|
|
17
|
+
<%= yield :included_scripts %>
|
|
17
18
|
<% if @site && !@site.header_code.blank? %>
|
|
18
19
|
<%= raw @site.header_code %>
|
|
19
20
|
<% end %>
|
|
@@ -50,11 +51,15 @@
|
|
|
50
51
|
</div>
|
|
51
52
|
<% end %>
|
|
52
53
|
<% end %>
|
|
54
|
+
<%= javascript_include_tag 'sibu/common' %>
|
|
55
|
+
<%= javascript_include_tag 'quill/quill' %>
|
|
56
|
+
<%= javascript_include_tag 'tabs/van11y-accessible-tab-panel-aria' %>
|
|
53
57
|
<%= javascript_include_tag 'sibu/sibu' %>
|
|
54
58
|
<script>
|
|
55
59
|
var sectionsState = {};
|
|
56
60
|
|
|
57
61
|
document.addEventListener("DOMContentLoaded", function() {
|
|
62
|
+
Turbo.session.drive = false;
|
|
58
63
|
initOverlays("<%= @edit_section || '' %>");
|
|
59
64
|
sibuCallback("editContent");
|
|
60
65
|
});
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<tbody>
|
|
15
15
|
<% @images.each do |image| %>
|
|
16
16
|
<tr>
|
|
17
|
-
<td><%= link_to image_tag(image.file_url(:small)), edit_image_path(image.id), class: 'sibu_image', id: "sibu_image_#{image.id}", remote: true %></td>
|
|
17
|
+
<td><%= link_to image_tag(image.file_url(:small)), edit_image_path(image.id, format: :js), class: 'sibu_image', id: "sibu_image_#{image.id}", remote: true %></td>
|
|
18
18
|
<td><%= image.alt %></td>
|
|
19
19
|
<td><%= image.credits %></td>
|
|
20
20
|
</tr>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
</div>
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
30
|
-
<%= form_tag(create_section_site_page_path(@site.id, @page.id), method: :post, remote:
|
|
30
|
+
<%= form_tag(create_section_site_page_path(@site.id, @page.id), method: :post, data: {remote: false, turbo: false}) do |f| %>
|
|
31
31
|
<%= hidden_field_tag 'section[template]', '' %>
|
|
32
32
|
<%= hidden_field_tag 'section[category]', '' %>
|
|
33
33
|
<%= hidden_field_tag :section_id, @section_id %>
|
data/lib/sibu/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sibu
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jean-Baptiste Vilain
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-02-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -106,15 +106,12 @@ files:
|
|
|
106
106
|
- README.md
|
|
107
107
|
- Rakefile
|
|
108
108
|
- app/assets/config/sibu_manifest.js
|
|
109
|
-
- app/assets/fonts/sibu/Sibu.eot
|
|
110
|
-
- app/assets/fonts/sibu/Sibu.svg
|
|
111
|
-
- app/assets/fonts/sibu/Sibu.ttf
|
|
112
|
-
- app/assets/fonts/sibu/Sibu.woff
|
|
113
109
|
- app/assets/images/sibu/empty.png
|
|
114
110
|
- app/assets/javascripts/cropper/cropper.js
|
|
115
111
|
- app/assets/javascripts/quill/quill.js
|
|
112
|
+
- app/assets/javascripts/rails-ujs/rails-ujs.js
|
|
116
113
|
- app/assets/javascripts/sibu/common.js
|
|
117
|
-
- app/assets/javascripts/sibu/sibu.js
|
|
114
|
+
- app/assets/javascripts/sibu/sibu.js
|
|
118
115
|
- app/assets/javascripts/tabs/van11y-accessible-tab-panel-aria.js
|
|
119
116
|
- app/assets/javascripts/tarteaucitron/advertising.js
|
|
120
117
|
- app/assets/javascripts/tarteaucitron/lang/tarteaucitron.cs.js
|
|
@@ -133,7 +130,6 @@ files:
|
|
|
133
130
|
- app/assets/stylesheets/cropper/cropper.css
|
|
134
131
|
- app/assets/stylesheets/quill/quill.snow.css
|
|
135
132
|
- app/assets/stylesheets/sibu/defaults.scss
|
|
136
|
-
- app/assets/stylesheets/sibu/icons.scss
|
|
137
133
|
- app/assets/stylesheets/sibu/sibu.css
|
|
138
134
|
- app/assets/stylesheets/tarteaucitron/tarteaucitron.css
|
|
139
135
|
- app/controllers/sibu/application_controller.rb
|
|
Binary file
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" standalone="no"?>
|
|
2
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg">
|
|
4
|
-
<metadata>Generated by IcoMoon</metadata>
|
|
5
|
-
<defs>
|
|
6
|
-
<font id="Sibu" horiz-adv-x="1024">
|
|
7
|
-
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
|
8
|
-
<missing-glyph horiz-adv-x="1024" />
|
|
9
|
-
<glyph unicode=" " horiz-adv-x="512" d="" />
|
|
10
|
-
<glyph unicode="" glyph-name="facebook" d="M771.755 960h-132.779c-149.163 0-245.76-98.987-245.76-251.904v-116.053h-133.461c-0.001 0-0.002 0-0.003 0-11.499 0-20.821-9.322-20.821-20.821 0-0.12 0.001-0.24 0.003-0.359v0.018-168.277c0-11.499 9.322-20.821 20.821-20.821h133.461v-424.96c0-11.499 9.322-20.821 20.821-20.821h174.080c11.499 0 20.821 9.322 20.821 20.821v0 424.96h156.331c11.499 0 20.821 9.322 20.821 20.821v0 168.277c0 11.499-9.322 20.821-20.821 20.821v0h-155.989v98.645c0 47.445 11.264 71.339 73.045 71.339h89.429c0.102-0.002 0.221-0.003 0.341-0.003 11.499 0 20.821 9.322 20.821 20.821 0 0.001 0 0.002 0 0.003v0 156.331c0.002 0.102 0.003 0.223 0.003 0.344 0 11.499-9.322 20.821-20.821 20.821-0.121 0-0.242-0.001-0.362-0.003h0.018z" />
|
|
11
|
-
<glyph unicode="" glyph-name="pinterest" d="M802.816 854.869c-69.838 64.965-163.785 104.836-267.044 104.836-2.118 0-4.231-0.017-6.341-0.050l0.318 0.004c-4.907 0.2-10.667 0.314-16.454 0.314-117.598 0-224.216-47.012-302.085-123.267l0.075 0.073c-65.636-64.324-106.924-153.279-108.88-251.88l-0.006-0.365c0-114.005 47.787-201.387 127.659-234.155 4.726-2.078 10.227-3.326 16.010-3.413h0.033c0.131-0.002 0.285-0.003 0.439-0.003 16.924 0 30.971 12.317 33.667 28.475l0.027 0.199c2.731 10.24 8.875 34.133 11.605 46.080 1.664 4.4 2.627 9.488 2.627 14.8 0 12.669-5.478 24.059-14.194 31.929l-0.038 0.034c-21.351 25.578-34.315 58.804-34.315 95.058 0 2.582 0.066 5.15 0.196 7.7l-0.015-0.358c-0.004 0.509-0.006 1.11-0.006 1.712 0 140.787 113.648 255.030 254.207 255.994h11.697c136.533 0 221.867-77.824 221.867-202.752 0.070-2.87 0.11-6.25 0.11-9.64 0-71.34-17.722-138.542-49.003-197.442l1.106 2.282c-21.355-45.576-65.026-77.523-116.556-81.884l-0.521-0.036c-0.508-0.012-1.107-0.019-1.708-0.019-24.13 0-45.694 10.982-59.969 28.22l-0.104 0.13c-9.346 11.908-14.989 27.111-14.989 43.631 0 6.453 0.861 12.706 2.474 18.648l-0.115-0.497c6.144 25.941 14.336 52.907 22.528 78.848 14.36 37.026 24.631 79.974 28.864 124.68l0.15 1.955c0.322 2.907 0.505 6.277 0.505 9.691 0 48.156-36.528 87.78-83.388 92.675l-0.402 0.034h-10.24c-71.339 0-126.976-72.363-126.976-164.523-0.042-1.69-0.066-3.679-0.066-5.675 0-31.077 5.784-60.803 16.335-88.161l-0.568 1.676-70.997-305.493c-5.803-24.917-40.96-221.525 17.067-237.227 65.536-17.749 124.245 173.739 130.048 195.584s21.845 83.968 32.085 124.928c34.35-31.666 80.16-51.36 130.558-52.222l0.173-0.002c0.91-0.010 1.984-0.016 3.060-0.016 96.167 0 181.57 46.082 235.333 117.369l0.54 0.748c55.806 76.896 89.272 173.161 89.272 277.243 0 4.653-0.067 9.29-0.2 13.911l0.015-0.679c-1.113 94.744-41.363 179.873-105.305 240.142l-0.167 0.156z" />
|
|
12
|
-
<glyph unicode="" glyph-name="twitter" d="M1024 759.296c-35.043-16.331-75.7-28.326-118.374-33.907l-2.117-0.226c43.313 26.322 75.883 66.637 91.733 114.563l0.427 1.49c-38.425-23.098-83.134-40.74-130.741-50.398l-2.72-0.461c-38.389 40.374-92.502 65.487-152.48 65.487-116.124 0-210.261-94.137-210.261-210.261 0-16.193 1.831-31.959 5.296-47.102l-0.272 1.412c-175.064 8.961-329.067 92.127-432.307 218.411l-0.845 1.066c-17.885-30.274-28.451-66.711-28.451-105.617 0-72.662 36.858-136.715 92.897-174.484l0.749-0.475c-35.125 1.149-67.771 10.753-96.282 26.827l1.050-0.544v-2.731c0.642-100.85 72.185-184.805 167.255-204.563l1.363-0.237c-16.564-4.704-35.596-7.44-55.257-7.509h-0.039c-0.251-0.001-0.549-0.002-0.846-0.002-13.709 0-27.099 1.367-40.040 3.973l1.291-0.217c27.574-84.217 104.673-144.304 196.058-146.087l0.208-0.003c-70.883-55.966-161.519-89.771-260.051-89.771-0.256 0-0.511 0-0.767 0.001h0.039c-1.248-0.013-2.723-0.020-4.2-0.020-16.315 0-32.425 0.875-48.286 2.581l1.968-0.172c90.847-59.286 202.061-94.549 321.512-94.549 0.129 0 0.257 0 0.386 0h-0.021c386.389 0 597.675 320.171 597.675 597.675v27.307c41.225 29.917 75.903 65.899 103.494 107.033l0.954 1.511z" />
|
|
13
|
-
<glyph unicode="" glyph-name="instagram" d="M741.376 960h-458.752c-156.011-0.194-282.43-126.613-282.624-282.606v-458.77c0.194-156.011 126.613-282.43 282.606-282.624h458.77c156.011 0.194 282.43 126.613 282.624 282.606v458.77c-0.194 156.011-126.613 282.43-282.606 282.624h-0.018zM933.205 218.624c0-105.944-85.885-191.829-191.829-191.829v0h-458.752c-105.944 0-191.829 85.885-191.829 191.829v458.752c0 105.944 85.885 191.829 191.829 191.829v0h458.752c105.944 0 191.829-85.885 191.829-191.829v0-458.752zM512 711.851c-145.721 0-263.851-118.13-263.851-263.851s118.13-263.851 263.851-263.851c145.721 0 263.851 118.13 263.851 263.851v0c-0.194 145.643-118.208 263.657-263.832 263.851h-0.019zM512 274.944c-95.576 0-173.056 77.48-173.056 173.056s77.48 173.056 173.056 173.056c95.576 0 173.056-77.48 173.056-173.056v0c0-95.576-77.48-173.056-173.056-173.056v0zM786.773 789.333c-0.186 0.002-0.406 0.003-0.626 0.003-37.703 0-68.267-30.564-68.267-68.267s30.564-68.267 68.267-68.267c37.703 0 68.267 30.564 68.267 68.267 0 19.119-7.86 36.403-20.525 48.796l-0.012 0.012c-12.152 11.891-28.748 19.282-47.071 19.456h-0.033z" />
|
|
14
|
-
</font></defs></svg>
|
|
Binary file
|
|
Binary file
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
@font-face {
|
|
2
|
-
font-family: 'Sibu';
|
|
3
|
-
src: font-url('sibu/Sibu.eot');
|
|
4
|
-
src: font-url('sibu/Sibu.eot') format('embedded-opentype'), font-url('sibu/Sibu.ttf') format('truetype'),
|
|
5
|
-
font-url('sibu/Sibu.woff') format('woff'), font-url('sibu/Sibu.svg') format('svg');
|
|
6
|
-
font-weight: normal;
|
|
7
|
-
font-style: normal;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
a[class^="sb-"]:before, a[class*=" sb-"]:before {
|
|
11
|
-
/* use !important to prevent issues with browser extensions that change fonts */
|
|
12
|
-
font-family: 'Sibu' !important;
|
|
13
|
-
speak: none;
|
|
14
|
-
font-style: normal;
|
|
15
|
-
font-weight: normal;
|
|
16
|
-
font-variant: normal;
|
|
17
|
-
text-transform: none;
|
|
18
|
-
line-height: 1;
|
|
19
|
-
display: inline-block;
|
|
20
|
-
margin-right: 3px;
|
|
21
|
-
|
|
22
|
-
/* Better Font Rendering =========== */
|
|
23
|
-
-webkit-font-smoothing: antialiased;
|
|
24
|
-
-moz-osx-font-smoothing: grayscale;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.sb-facebook:before {
|
|
28
|
-
content: "\e900";
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.sb-pinterest:before {
|
|
32
|
-
content: "\e901";
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.sb-twitter:before {
|
|
36
|
-
content: "\e902";
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.sb-instagram:before {
|
|
40
|
-
content: "\e903";
|
|
41
|
-
}
|
|
File without changes
|