mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 03:26:15 +02:00
Fix up library link from Clara item page
This commit is contained in:
parent
f7503ba46c
commit
c7c3dfef3e
1 changed files with 16 additions and 0 deletions
|
@ -96,6 +96,17 @@ Rectangle {
|
|||
});
|
||||
}';
|
||||
|
||||
// In item page:
|
||||
// - Fix up library link URL.
|
||||
property string updateItemPage: 'if ($) {
|
||||
var element = $("a[href=\'/library\']")[0];
|
||||
var parameters = "?gameCheck=true&public=true";
|
||||
var href = element.getAttribute("href");
|
||||
if (href.slice(-parameters.length) !== parameters) {
|
||||
element.setAttribute("href", href + parameters);
|
||||
}
|
||||
}';
|
||||
|
||||
// Overload Clara FBX download link action.
|
||||
property string replaceFBXDownload: 'var element = $("a.download-file");
|
||||
element.removeClass("download-file");
|
||||
|
@ -117,6 +128,11 @@ Rectangle {
|
|||
// Catalog page.
|
||||
runJavaScript(updateLibraryPage, function() { console.log("Library link JS injection"); });
|
||||
}
|
||||
|
||||
if (location.indexOf("clara.io/view/") !== -1) {
|
||||
// Item page.
|
||||
runJavaScript(updateItemPage, function() { console.log("Item link JS injection"); });
|
||||
}
|
||||
}
|
||||
|
||||
onLinkHovered: {
|
||||
|
|
Loading…
Reference in a new issue