mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-15 04:40:02 +01:00
Allow saving onto Publiclab.org (#1353)
* Allow saving onto Publiclab.org * success to primary * fixing merge conflictx
This commit is contained in:
committed by
Jeffrey Warren
parent
5421a80fb3
commit
86dca0400e
@@ -118,6 +118,9 @@ window.onload = function () {
|
|||||||
} else if(dropDownValue == 'save-pdf') {
|
} else if(dropDownValue == 'save-pdf') {
|
||||||
savePDF(getLastImage());
|
savePDF(getLastImage());
|
||||||
}
|
}
|
||||||
|
else if (dropDownValue == 'save-to-publiclab.org' ){
|
||||||
|
SaveToPubliclab();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let isWorkingOnGifGeneration = false;
|
let isWorkingOnGifGeneration = false;
|
||||||
@@ -251,6 +254,18 @@ window.onload = function () {
|
|||||||
download(image, 'index.gif', 'image/gif');// downloadjs library function
|
download(image, 'index.gif', 'image/gif');// downloadjs library function
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function SaveToPubliclab() {
|
||||||
|
function postToPL(imgSrc) {
|
||||||
|
var uniq = Date.now();
|
||||||
|
$('body').append('<form method="post" id="postToPL' + uniq + '" action="https://publiclab.org/post" target="postToPLWindow"><input type="hidden" name="datauri_main_image" /></form>');
|
||||||
|
f = $('#postToPL' + uniq)[0];
|
||||||
|
f.datauri_main_image.value = imgSrc;
|
||||||
|
window.open('', 'postToPLWindow');
|
||||||
|
f.submit();
|
||||||
|
}
|
||||||
|
postToPL($('img')[sequencer.steps.length - 1].src);
|
||||||
|
}
|
||||||
|
|
||||||
// image selection and drag/drop handling from examples/lib/imageSelection.js
|
// image selection and drag/drop handling from examples/lib/imageSelection.js
|
||||||
sequencer.setInputStep({
|
sequencer.setInputStep({
|
||||||
dropZoneSelector: '#dropzone',
|
dropZoneSelector: '#dropzone',
|
||||||
@@ -289,4 +304,4 @@ window.onload = function () {
|
|||||||
} else {
|
} else {
|
||||||
insertPreview.updatePreviews('images/tulips.png', '#addStep');
|
insertPreview.updatePreviews('images/tulips.png', '#addStep');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -196,6 +196,7 @@
|
|||||||
<option value="save-pdf">Save as PDF</option>
|
<option value="save-pdf">Save as PDF</option>
|
||||||
<option value="save-seq">Save sequence</option>
|
<option value="save-seq">Save sequence</option>
|
||||||
<option value="save-seq-string">Save sequence string</option>
|
<option value="save-seq-string">Save sequence string</option>
|
||||||
|
<option value="save-to-publiclab.org">Save to PublicLab.org</option>>
|
||||||
</select>
|
</select>
|
||||||
<p><button id="saveButton" class="btn btn-primary btn-lg save-button">Save</button></p>
|
<p><button id="saveButton" class="btn btn-primary btn-lg save-button">Save</button></p>
|
||||||
<p><button class="btn btn-default btn-lg js-view-as-gif" id="gif">Preview GIF</button></p>
|
<p><button class="btn btn-default btn-lg js-view-as-gif" id="gif">Preview GIF</button></p>
|
||||||
@@ -240,4 +241,4 @@
|
|||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user