mirror of
https://github.com/UnickSoft/graphonline.git
synced 2025-07-03 00:06:40 +00:00
Added saved image preview to save image dialog.
This commit is contained in:
parent
6f58737160
commit
1236fc4c1a
@ -256,6 +256,13 @@
|
||||
color: #0649a6!important;
|
||||
}
|
||||
|
||||
.showShareImage
|
||||
{
|
||||
max-width:100%;
|
||||
max-height:200px;
|
||||
max-width:350px;
|
||||
}
|
||||
|
||||
|
||||
@media only screen and (max-width: 650px) {
|
||||
#canvasSection
|
||||
|
@ -98,4 +98,5 @@
|
||||
|
||||
$g_lang["group_rename"] = "Group rename";
|
||||
$g_lang["enter_vertices_text_in_each_line"] = "Enter text for each vertex in separate line";
|
||||
$g_lang["or"] = "or";
|
||||
?>
|
||||
|
@ -102,6 +102,6 @@
|
||||
|
||||
$g_lang["group_rename"] = "Групповое переименование";
|
||||
$g_lang["enter_vertices_text_in_each_line"] = "Введите текст для каждой вершины в отдельную строку";
|
||||
|
||||
$g_lang["or"] = "или";
|
||||
|
||||
?>
|
||||
|
@ -765,7 +765,7 @@ Application.prototype.SaveGraphOnDisk = function ()
|
||||
});
|
||||
}
|
||||
|
||||
Application.prototype.SaveGraphImageOnDisk = function ()
|
||||
Application.prototype.SaveGraphImageOnDisk = function (showDialogCallback)
|
||||
{
|
||||
var imageName = this.GetNewGraphName();
|
||||
|
||||
@ -797,7 +797,10 @@ Application.prototype.SaveGraphImageOnDisk = function ()
|
||||
data: {
|
||||
base64data : imageBase64Data
|
||||
},
|
||||
dataType: "text"
|
||||
dataType: "text",
|
||||
success: function(data){
|
||||
showDialogCallback();
|
||||
}
|
||||
});
|
||||
|
||||
return imageName;
|
||||
|
@ -642,8 +642,8 @@ SavedDialogGraphImageHandler.prototype.objects = null;
|
||||
|
||||
SavedDialogGraphImageHandler.prototype.show = function(object)
|
||||
{
|
||||
var imageName = this.app.SaveGraphImageOnDisk();
|
||||
|
||||
var showDialogCallback = function ()
|
||||
{
|
||||
var dialogButtons = {};
|
||||
|
||||
dialogButtons[g_close] = function() {
|
||||
@ -652,7 +652,9 @@ SavedDialogGraphImageHandler.prototype.show = function(object)
|
||||
|
||||
var fileLocation = "tmp/saved/" + imageName.substr(0, 2) + "/"+ imageName + ".png"
|
||||
|
||||
|
||||
document.getElementById("showSavedImageGraph").src = "/" + fileLocation;
|
||||
document.getElementById("showSavedImageGraphRef").href = "/" + fileLocation;
|
||||
//document.getElementById("showSavedImageGraph").src = document.getElementById("showSavedImageGraph").src.replace(/tmp\/saved\/([A-Za-z]*)\/([A-Za-z]*).png/g, fileLocation);
|
||||
document.getElementById("ShareSavedImageGraph").innerHTML =
|
||||
document.getElementById("ShareSavedImageGraph").innerHTML.replace(/tmp\/saved\/([A-Za-z]*)\/([A-Za-z]*).png/g, fileLocation);
|
||||
|
||||
@ -671,6 +673,9 @@ SavedDialogGraphImageHandler.prototype.show = function(object)
|
||||
|
||||
}
|
||||
|
||||
var imageName = this.app.SaveGraphImageOnDisk(showDialogCallback);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Algorithm Graph handler.
|
||||
|
@ -239,7 +239,11 @@
|
||||
<form>
|
||||
<fieldset>
|
||||
<? $shareImagePageURL = $_SERVER['SERVER_NAME'] . "/";?>
|
||||
<p id="SaveImageLinks"><a href="http://<?= $shareImagePageURL ?>tmp/saved/XX/XXXXX.png" target="_blank"><?= L('open_saved_image_browser')?></a> or <a href="http://<?= $shareImagePageURL ?>tmp/saved/XX/XXXXX.png" download><?= L('download_saved_image')?></a></p>
|
||||
<p id="SaveImageLinks"><a href="http://<?= $shareImagePageURL ?>tmp/saved/XX/XXXXX.png" target="_blank"><?= L('open_saved_image_browser')?></a> <?= L('or')?> <a href="http://<?= $shareImagePageURL ?>tmp/saved/XX/XXXXX.png" download><?= L('download_saved_image')?></a>
|
||||
</p>
|
||||
<p class="hidden-phone">
|
||||
<a href="http://<?= $shareImagePageURL ?>tmp/saved/XX/XXXXX.png" target="_blank" class="hidden-phone showShareImage" id="showSavedImageGraphRef"><img src="http://<?= $shareImagePageURL ?>tmp/saved/XX/XXXXX.png" id="showSavedImageGraph" class="showShareImage"></a>
|
||||
</p>
|
||||
<p><?= L('share_graph_description') ?></p>
|
||||
<ul class="share-buttons" id="ShareSavedImageGraph">
|
||||
<li><a href="http://vkontakte.ru/share.php?url=http://<?= $shareImagePageURL ?>tmp/saved/XX/XXXXX.png&text=<?= L('share_graph_text') ?>" target="_blank" title="Share on Vkontate"><i class="fa fa-vk fa-2x"></i></a></li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user