Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions content/src/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ view.on('share', function() {
var shortfilename = modelatpos('left').filename.replace(/^.*\//, '');
if (!shortfilename) { shortfilename = 'clip'; }
var doc = view.getPaneEditorData(paneatpos('left'));
if (isEmptyDoc(doc)) { return; }
if(newdata.data===''){shareAction();}
// First save if needed (including login user if necessary)
if (view.isPaneEditorDirty(paneatpos('left'))) {
saveAction(false, 'Log in to share', shareAction);
Expand All @@ -358,7 +358,7 @@ view.on('share', function() {
// There is no editor on the left (or it is misbehaving) - do nothing.
console.log("Nothing to share.");
return;
} else if (doc.data !== '') { // If program is not empty, generate thumbnail.
} else if (doc.data !== '' || (newdata.data ==='' && window.downloadhtml!=='') || (newdata.data ==='' && window.downloadcss!=='')) { // If program is not empty, generate thumbnail.
if (model.tempThumbnail) {
postThumbnailGeneration(model.tempThumbnail);
} else {
Expand Down
5 changes: 4 additions & 1 deletion content/src/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function htmlEscape(s) {
return s.replace(/[<>&"]/g, function(c) {
return c=='<'?'&lt;':c=='>'?'&gt;':c=='&'?'&amp;':'&quot;';});
}

var downloadhtml;
var downloadcss;
// The view has three panes, #left, #right, and #back (the offscreen pane).
//
// Any of the three panes can show:
Expand Down Expand Up @@ -2924,9 +2925,11 @@ function updateMeta(paneState) {
// Grab the html and the CSS from the editors.
if (paneState.htmlEditor) {
paneState.meta.html = paneState.htmlEditor.getValue();
window.downloadhtml=paneState.meta.html;
}
if (paneState.cssEditor) {
paneState.meta.css = paneState.cssEditor.getValue();
window.downloadcss=paneState.meta.css;
}
}
function getPaneEditorData(pane) {
Expand Down