Skip to content

Commit 3638775

Browse files
authored
Merge pull request #494 from asolove/asolove/publish-dialog
[WIP] Share modal updates
2 parents 07d1c86 + f9814c6 commit 3638775

File tree

1 file changed

+1
-66
lines changed

1 file changed

+1
-66
lines changed

src/web/js/share.js

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ window.makeShareAPI = function makeShareAPI(pyretVersion) {
124124
text: importCode
125125
},
126126
{
127-
message: "You can also click Update below to copy the current version to the published version, or click Close to exit this window."
127+
message: "You can also click Update below to copy the current version to the published version, or click Cancel to exit this window."
128128
}
129129
]
130130
});
@@ -181,71 +181,6 @@ window.makeShareAPI = function makeShareAPI(pyretVersion) {
181181
}
182182
}
183183

184-
function autoHighlightBox(text) {
185-
var textBox = $("<input type='text'>").addClass("auto-highlight");
186-
textBox.attr("size", text.length);
187-
textBox.attr("editable", false);
188-
textBox.on("focus", function() { $(this).select(); });
189-
textBox.on("mouseup", function() { $(this).select(); });
190-
textBox.val(text);
191-
return textBox;
192-
}
193-
194-
function getLanguage() {
195-
if(typeof navigator !== "undefined") {
196-
return navigator.language || "en-US"; // Biased towards USA
197-
}
198-
else {
199-
return "en-US";
200-
}
201-
}
202-
203-
var dateOptions = {
204-
weekday: "short",
205-
year: "numeric",
206-
month: "short",
207-
day: "numeric",
208-
hour: "numeric",
209-
minute: "numeric"
210-
};
211-
212-
function drawShareRow(f) {
213-
var container = $("<div>").addClass("sharebox");
214-
var shareUrl = makeShareUrl(f.getUniqueId());
215-
var displayDate = new Date(f.getModifiedTime()).toLocaleString(getLanguage, dateOptions);
216-
var hoverDate = String(new Date(f.getModifiedTime()));
217-
container.append($("<label>").text(displayDate).attr("alt", hoverDate));
218-
var shareLink = $("<a href='javascript:void()'>").text("(Share Link)").addClass("copy-link");
219-
var importLink = $("<a href='javascript:void()'>").text("(Import Code)").addClass("copy-link");
220-
container.append(shareLink);
221-
container.append(importLink);
222-
function showCopyText(title, text) {
223-
var linkDiv = $("<div>").css({"z-index": 15000});
224-
linkDiv.dialog({
225-
title: title,
226-
modal: true,
227-
overlay : { opacity: 0.5, background: 'black'},
228-
width : "70%",
229-
height : "auto",
230-
closeOnEscape : true
231-
});
232-
var box = autoHighlightBox(text);
233-
linkDiv.append(box);
234-
box.focus();
235-
}
236-
shareLink.click(function() {
237-
showCopyText("Copy Share Link", shareUrl);
238-
});
239-
240-
var importLetter = getImportLetter(f.getName()[0]);
241-
var importCode = "import shared-gdrive(\"" + f.getName() +
242-
"\", \"" + f.getUniqueId() + "\") as " + importLetter;
243-
importLink.click(function() {
244-
showCopyText("Copy Import Code", importCode);
245-
});
246-
return container;
247-
}
248-
249184
return {
250185
makeShareLink: makeShareLink,
251186
//makeHoverMenu: makeHoverMenu,

0 commit comments

Comments
 (0)