mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 09:08:37 +02:00
new snapshot review behavior
This commit is contained in:
parent
17d9db487d
commit
8823f48666
2 changed files with 67 additions and 28 deletions
|
@ -21,6 +21,15 @@
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height:auto;
|
height:auto;
|
||||||
}
|
}
|
||||||
|
.prompt {
|
||||||
|
font-family: Raleway-SemiBold;
|
||||||
|
text-transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub-section-header > div > input {
|
||||||
|
margin-top:20px;
|
||||||
|
}
|
||||||
|
span.inline-checkbox { display:inline; }
|
||||||
|
|
||||||
@media (max-width: 768px){
|
@media (max-width: 768px){
|
||||||
.snapshot-column-left{
|
.snapshot-column-left{
|
||||||
|
@ -37,6 +46,8 @@
|
||||||
.snapsection{
|
.snapsection{
|
||||||
width:95% !important;
|
width:95% !important;
|
||||||
padding-right:0px;
|
padding-right:0px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
div#sharing {
|
div#sharing {
|
||||||
margin-top:50px;
|
margin-top:50px;
|
||||||
|
@ -104,11 +115,14 @@
|
||||||
|
|
||||||
};
|
};
|
||||||
// beware of bug: Cannot send objects at top level. (Nested in arrays is fine.)
|
// beware of bug: Cannot send objects at top level. (Nested in arrays is fine.)
|
||||||
shareSelected = function() {
|
shareSelected = function () {
|
||||||
EventBridge.emitWebEvent(paths);
|
EventBridge.emitWebEvent(paths.concat({openFeed: document.getElementById("openFeed").checked}));
|
||||||
};
|
};
|
||||||
doNotShare = function() {
|
doNotShare = function () {
|
||||||
EventBridge.emitWebEvent([]);
|
EventBridge.emitWebEvent([{openFeed: document.getElementById("openFeed").checked}]);
|
||||||
|
};
|
||||||
|
snapshotSettings = function () {
|
||||||
|
EventBridge.emitWebEvent("openSettings");
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -120,16 +134,23 @@
|
||||||
<div class="section-header snapsection">
|
<div class="section-header snapsection">
|
||||||
<label>Snapshots sucessfully saved!</label>
|
<label>Snapshots sucessfully saved!</label>
|
||||||
</div>
|
</div>
|
||||||
<div id="sharing">
|
<div class="sub-section-header snapsection">
|
||||||
<div class="sub-section-header snapsection">
|
<div id="sharing">
|
||||||
<label>Would you like to share?</label>
|
<div class="prompt">Would you like to share your pic in the Snapshots feed?</div>
|
||||||
</div>
|
<div>
|
||||||
<div class="sub-section-header snapsection">
|
<input type="button" class="blue" id="share" value="SHARE IN FEED" onclick="shareSelected()"/>
|
||||||
<input type="button" id="share" value="SHARE IN FEED" onclick="shareSelected()"/>
|
|
||||||
</div>
|
|
||||||
<div class="sub-section-header snapsection">
|
|
||||||
<input type="button" class="red" id="close" value="DON'T SHARE" onclick="doNotShare()"/>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input type="button" class="red" id="close" value="DON'T SHARE" onclick="doNotShare()"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sub-section-header snapsection">
|
||||||
|
<input type="button" value="Snapshot setttings" onclick="snapshotSettings()"/>
|
||||||
|
<span class="inline-checkbox property checkbox">
|
||||||
|
<input id="openFeed" type="checkbox" checked/>
|
||||||
|
<label for="openFeed">Open feed after</label>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="snapshot-images" class="snapshot-column-right"/>
|
<div id="snapshot-images" class="snapshot-column-right"/>
|
||||||
|
|
|
@ -20,24 +20,39 @@ var button = toolBar.addButton({
|
||||||
alpha: 0.9,
|
alpha: 0.9,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function showFeedWindow() {
|
||||||
|
DialogsManager.showFeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
var openFeed, outstanding;
|
||||||
function confirmShare(data) {
|
function confirmShare(data) {
|
||||||
var dialog = new OverlayWebWindow('Snapshot', Script.resolvePath("html/ShareSnapshot.html"), 800, 470);
|
var dialog = new OverlayWebWindow('Snapshot Review', Script.resolvePath("html/ShareSnapshot.html"), 800, 470);
|
||||||
function onMessage(message) {
|
function onMessage(message) {
|
||||||
if (message == 'ready') { // The window can now receive data from us.
|
switch (message) {
|
||||||
|
case 'ready':
|
||||||
dialog.emitScriptEvent(data); // Send it.
|
dialog.emitScriptEvent(data); // Send it.
|
||||||
return;
|
openFeed = false;
|
||||||
} // Rest is confirmation processing
|
outstanding = 0;
|
||||||
dialog.webEventReceived.disconnect(onMessage); // I'm not certain that this is necessary. If it is, what do we do on normal close?
|
break;
|
||||||
dialog.close();
|
case 'openSettings':
|
||||||
dialog.deleteLater();
|
Desktop.show("hifi/dialogs/GeneralPreferencesDialog.qml", "GeneralPreferencesDialog");
|
||||||
message = message.filter(function (picture) { return picture.share; });
|
break;
|
||||||
if (message.length) {
|
default:
|
||||||
print('sharing', message.map(function (picture) { return picture.localPath; }).join(', '));
|
dialog.webEventReceived.disconnect(onMessage); // I'm not certain that this is necessary. If it is, what do we do on normal close?
|
||||||
message.forEach(function (data) {
|
dialog.close();
|
||||||
Window.shareSnapshot(data.localPath);
|
dialog.deleteLater();
|
||||||
|
message.forEach(function (submessage) {
|
||||||
|
if (submessage.share) {
|
||||||
|
print('sharing', submessage.localPath);
|
||||||
|
outstanding++;
|
||||||
|
Window.shareSnapshot(submessage.localPath);
|
||||||
|
} else if (submessage.openFeed) {
|
||||||
|
openFeed = true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
if (openFeed && !outstanding) {
|
||||||
print('declined to share', JSON.stringify(data));
|
showFeedWindow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dialog.webEventReceived.connect(onMessage);
|
dialog.webEventReceived.connect(onMessage);
|
||||||
|
@ -51,7 +66,10 @@ function snapshotShared(success) {
|
||||||
} else {
|
} else {
|
||||||
// for now just print an error.
|
// for now just print an error.
|
||||||
print('snapshot upload/share failed');
|
print('snapshot upload/share failed');
|
||||||
}
|
}
|
||||||
|
if ((--outstanding <= 0) && openFeed) {
|
||||||
|
showFeedWindow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClicked() {
|
function onClicked() {
|
||||||
|
|
Loading…
Reference in a new issue