appquery 0.7.0.rc4 → 0.7.0.rc6
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/.yard/templates/default/fulldoc/html/js/app.js +12 -66
- data/lib/app_query/version.rb +1 -1
- metadata +1 -2
- data/lib/app_query/base.rb +0 -45
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 811c036b6f593980742222e1eb4258264094cc7deb9f5987ffb1abd06d5b924e
|
|
4
|
+
data.tar.gz: 2f6ceb792f5f9e6750f58bf5def6d146a94d170eaaf2b2947fe91aa7d1df8d7e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cd21a8613375c8286fe9b6450de52d5929d49d27b3131b010dec397ff882ff3b61bc162f7aa54440f4242d2e14f47495b5492c3236e648beeed3945fcf16f1fc
|
|
7
|
+
data.tar.gz: 84e54499537d462923b85ed5ec2224cd367b6c13a2c47f6cdea37a120536a8939718162150dad82bd5781948612223f7cee799b585ac3cf2f177b006f316394d
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Simplified YARD app.js - disabled SPA navigation in favor of regular links
|
|
2
|
+
// The original SPA navigation was broken for nested pages
|
|
3
|
+
|
|
1
4
|
window.__app = function () {
|
|
2
5
|
var localStorage = {},
|
|
3
6
|
sessionStorage = {};
|
|
@@ -151,7 +154,6 @@ window.__app = function () {
|
|
|
151
154
|
$(this).addClass("deprecated");
|
|
152
155
|
}
|
|
153
156
|
});
|
|
154
|
-
// Add the value of the constant as "Tooltip" to the summary object
|
|
155
157
|
list.find("pre.code").each(function () {
|
|
156
158
|
var dt_element = $(this).parent().prev();
|
|
157
159
|
var tooltip = $(this).text();
|
|
@@ -316,16 +318,6 @@ window.__app = function () {
|
|
|
316
318
|
}, 10);
|
|
317
319
|
}
|
|
318
320
|
|
|
319
|
-
function navigationChange() {
|
|
320
|
-
// This works around the broken anchor navigation with the YARD template.
|
|
321
|
-
window.onpopstate = function () {
|
|
322
|
-
var hash = window.location.hash;
|
|
323
|
-
if (hash !== "" && $(hash)[0]) {
|
|
324
|
-
$(hash)[0].scrollIntoView();
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
|
|
329
321
|
$(document).ready(function () {
|
|
330
322
|
navResizer();
|
|
331
323
|
navExpander();
|
|
@@ -338,62 +330,16 @@ window.__app = function () {
|
|
|
338
330
|
constantSummaryToggle();
|
|
339
331
|
generateTOC();
|
|
340
332
|
mainFocus();
|
|
341
|
-
navigationChange();
|
|
342
333
|
});
|
|
343
334
|
};
|
|
344
335
|
window.__app();
|
|
345
336
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
const text = await response.text();
|
|
356
|
-
const parser = new DOMParser();
|
|
357
|
-
const doc = parser.parseFromString(text, "text/html");
|
|
358
|
-
|
|
359
|
-
const classListLink =
|
|
360
|
-
document.getElementById("class_list_link").classList;
|
|
361
|
-
|
|
362
|
-
const content = doc.querySelector("#main").innerHTML;
|
|
363
|
-
document.querySelector("#main").innerHTML = content;
|
|
364
|
-
document.title = doc.head.querySelector("title").innerText;
|
|
365
|
-
document.head.querySelectorAll("script").forEach((script) => {
|
|
366
|
-
if (
|
|
367
|
-
!script.type ||
|
|
368
|
-
(script.type.includes("text/javascript") && !script.src)
|
|
369
|
-
) {
|
|
370
|
-
script.remove();
|
|
371
|
-
}
|
|
372
|
-
});
|
|
373
|
-
|
|
374
|
-
doc.head.querySelectorAll("script").forEach((script) => {
|
|
375
|
-
if (
|
|
376
|
-
!script.type ||
|
|
377
|
-
(script.type.includes("text/javascript") && !script.src)
|
|
378
|
-
) {
|
|
379
|
-
const newScript = document.createElement("script");
|
|
380
|
-
newScript.type = "text/javascript";
|
|
381
|
-
newScript.textContent = script.textContent;
|
|
382
|
-
document.head.appendChild(newScript);
|
|
383
|
-
}
|
|
384
|
-
});
|
|
385
|
-
|
|
386
|
-
window.__app();
|
|
387
|
-
|
|
388
|
-
document.getElementById("class_list_link").classList = classListLink;
|
|
389
|
-
|
|
390
|
-
const url = new URL(e.data.url, "https://localhost");
|
|
391
|
-
const hash = decodeURIComponent(url.hash ?? "");
|
|
392
|
-
if (hash) {
|
|
393
|
-
document.getElementById(hash.substring(1)).scrollIntoView();
|
|
394
|
-
}
|
|
395
|
-
history.pushState({}, document.title, absoluteUrl);
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
false
|
|
399
|
-
);
|
|
337
|
+
// Force sidebar links to do full page navigation instead of broken SPA
|
|
338
|
+
window.addEventListener("message", function (e) {
|
|
339
|
+
if (e.data.action === "navigate") {
|
|
340
|
+
// Calculate the correct absolute URL and do a real navigation
|
|
341
|
+
const nav = document.getElementById("nav");
|
|
342
|
+
const baseUrl = new URL(nav.src, window.location.href).href.replace(/[^/]*$/, '');
|
|
343
|
+
window.location.href = new URL(e.data.url, baseUrl).href;
|
|
344
|
+
}
|
|
345
|
+
}, false);
|
data/lib/app_query/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: appquery
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.0.
|
|
4
|
+
version: 0.7.0.rc6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gert Goet
|
|
@@ -56,7 +56,6 @@ files:
|
|
|
56
56
|
- assets/banner-dark.svg
|
|
57
57
|
- assets/banner-light.svg
|
|
58
58
|
- lib/app_query.rb
|
|
59
|
-
- lib/app_query/base.rb
|
|
60
59
|
- lib/app_query/base_query.rb
|
|
61
60
|
- lib/app_query/mappable.rb
|
|
62
61
|
- lib/app_query/paginatable.rb
|
data/lib/app_query/base.rb
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
module AppQuery
|
|
2
|
-
class Base
|
|
3
|
-
class_attribute :_cast, default: true, instance_predicate: false
|
|
4
|
-
class_attribute :_default_binds, default: {}, instance_predicate: false
|
|
5
|
-
|
|
6
|
-
class << self
|
|
7
|
-
def run(build_only: false, binds: {}, vars: {}, cast: self.cast, select: nil, **)
|
|
8
|
-
_build(binds:, vars:, cast:, select:).then do
|
|
9
|
-
build_only ? _1 : _1.select_all
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def build(**opts)
|
|
14
|
-
run(build_only: true, **opts)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def default_binds(v = nil)
|
|
18
|
-
return _default_binds if v.nil?
|
|
19
|
-
self._default_binds = v
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def cast(v = nil)
|
|
23
|
-
return _cast if v.nil?
|
|
24
|
-
self._cast = v
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def query_name
|
|
28
|
-
derive_query_name unless defined?(@query_name)
|
|
29
|
-
@query_name
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
attr_writer :query_name
|
|
33
|
-
|
|
34
|
-
private
|
|
35
|
-
|
|
36
|
-
def _build(cast:, binds: {}, select: nil, vars: {})
|
|
37
|
-
AppQuery[query_name, binds:, cast:].render(vars).with_select(select)
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def derive_query_name
|
|
41
|
-
self.query_name = name.underscore.sub(/_query$/, "")
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
end
|