Customize Clara item menu

This commit is contained in:
David Rowe 2016-11-10 20:28:41 +13:00 committed by Seth Alves
parent c7c3dfef3e
commit e40b71b3dd

View file

@ -98,13 +98,24 @@ Rectangle {
// In item page:
// - Fix up library link URL.
// - Reuse FBX download button as HiFi download button.
// - Remove "Edit Online", "Get Embed Code", and other download buttons.
property string updateItemPage: 'if ($) {
var element = $("a[href=\'/library\']")[0];
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);
}
var buttons = $("a.embed-button").parent("div");
if (buttons.length > 0) {
var downloadFBX = buttons.find("a[data-extension=\'fbx\']")[0];
var firstButton = buttons.children(":first-child")[0];
buttons[0].insertBefore(downloadFBX, firstButton);
downloadFBX.setAttribute("class", "btn btn-primary download");
downloadFBX.innerHTML = "<i class=\'glyphicon glyphicon-download-alt\'></i> Download to High Fidelity";
buttons.children(":nth-child(2), .btn-group , .embed-button").each(function () { this.remove(); });
}
}';
// Overload Clara FBX download link action.