mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 10:17:40 +02:00
Merge pull request #8424 from howard-stearns/discovery-cleanup
Discovery cleanup
This commit is contained in:
commit
b88ef3cf6d
3 changed files with 22 additions and 15 deletions
|
@ -197,7 +197,8 @@ void SnapshotUploader::uploadSuccess(QNetworkReply& reply) {
|
||||||
QJsonObject userStoryObject;
|
QJsonObject userStoryObject;
|
||||||
QJsonObject detailsObject;
|
QJsonObject detailsObject;
|
||||||
detailsObject.insert("image_url", imageUrl);
|
detailsObject.insert("image_url", imageUrl);
|
||||||
userStoryObject.insert("details", detailsObject);
|
QString pickledDetails = QJsonDocument(detailsObject).toJson();
|
||||||
|
userStoryObject.insert("details", pickledDetails);
|
||||||
userStoryObject.insert("thumbnail_url", thumbnailUrl);
|
userStoryObject.insert("thumbnail_url", thumbnailUrl);
|
||||||
userStoryObject.insert("place_name", placeName);
|
userStoryObject.insert("place_name", placeName);
|
||||||
userStoryObject.insert("path", currentPath);
|
userStoryObject.insert("path", currentPath);
|
||||||
|
|
|
@ -35,16 +35,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.snapsection{
|
.snapsection{
|
||||||
width:95% !important;
|
width:95% !important;
|
||||||
padding-right:0px;
|
padding-right:0px;
|
||||||
|
}
|
||||||
|
div#sharing {
|
||||||
|
margin-top:50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.clear { clear: both; }
|
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script>
|
<script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script>
|
||||||
<script type="text/javascript" src="js/eventBridgeLoader.js"></script>
|
<script type="text/javascript" src="js/eventBridgeLoader.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var paths = [], idCounter = 0;
|
var paths = [], idCounter = 0, useCheckboxes;
|
||||||
function addImage(data) {
|
function addImage(data) {
|
||||||
var div = document.createElement("DIV"),
|
var div = document.createElement("DIV"),
|
||||||
input = document.createElement("INPUT"),
|
input = document.createElement("INPUT"),
|
||||||
|
@ -54,15 +56,18 @@
|
||||||
function toggle() { data.share = input.checked; }
|
function toggle() { data.share = input.checked; }
|
||||||
img.src = data.localPath;
|
img.src = data.localPath;
|
||||||
div.appendChild(img);
|
div.appendChild(img);
|
||||||
// Our stylesheet(?) requires input.id to match label.for. Otherwise input doesn't display the check state.
|
data.share = true;
|
||||||
label.setAttribute('for', id); // cannot do label.for =
|
if (useCheckboxes) { // I'd rather use css, but the included stylesheet is quite particular.
|
||||||
input.id = id;
|
// Our stylesheet(?) requires input.id to match label.for. Otherwise input doesn't display the check state.
|
||||||
input.type = "checkbox";
|
label.setAttribute('for', id); // cannot do label.for =
|
||||||
input.checked = data.share = true;
|
input.id = id;
|
||||||
input.addEventListener('change', toggle);
|
input.type = "checkbox";
|
||||||
div.class = "property checkbox";
|
input.checked = true;
|
||||||
div.appendChild(input);
|
input.addEventListener('change', toggle);
|
||||||
div.appendChild(label);
|
div.class = "property checkbox";
|
||||||
|
div.appendChild(input);
|
||||||
|
div.appendChild(label);
|
||||||
|
}
|
||||||
document.getElementById("snapshot-images").appendChild(div);
|
document.getElementById("snapshot-images").appendChild(div);
|
||||||
paths.push(data);
|
paths.push(data);
|
||||||
|
|
||||||
|
@ -91,6 +96,7 @@
|
||||||
handleShareButtons(shareMsg);
|
handleShareButtons(shareMsg);
|
||||||
|
|
||||||
// rest are image paths which we add
|
// rest are image paths which we add
|
||||||
|
useCheckboxes = message.length > 1;
|
||||||
message.forEach(addImage);
|
message.forEach(addImage);
|
||||||
});
|
});
|
||||||
EventBridge.emitWebEvent('ready');
|
EventBridge.emitWebEvent('ready');
|
||||||
|
|
|
@ -21,7 +21,7 @@ var button = toolBar.addButton({
|
||||||
});
|
});
|
||||||
|
|
||||||
function confirmShare(data) {
|
function confirmShare(data) {
|
||||||
var dialog = new OverlayWebWindow('Snapshot', Script.resolvePath("html/ShareSnapshot.html"), 800, 300);
|
var dialog = new OverlayWebWindow('Snapshot', Script.resolvePath("html/ShareSnapshot.html"), 800, 470);
|
||||||
function onMessage(message) {
|
function onMessage(message) {
|
||||||
if (message == 'ready') { // The window can now receive data from us.
|
if (message == 'ready') { // The window can now receive data from us.
|
||||||
dialog.emitScriptEvent(data); // Send it.
|
dialog.emitScriptEvent(data); // Send it.
|
||||||
|
|
Loading…
Reference in a new issue