mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-02-16 10:40:57 +00:00
Added button to recommend new algorithm.
This commit is contained in:
@@ -93,6 +93,11 @@ FindConnectedComponentNew.prototype.getObjectSelectedGroup = function(object)
|
||||
return (object.id in this.selectedObjects) ? this.selectedObjects[object.id] : 0;
|
||||
}
|
||||
|
||||
FindConnectedComponentNew.prototype.getPriority = function()
|
||||
{
|
||||
return -9;
|
||||
}
|
||||
|
||||
|
||||
// Factory for connected components.
|
||||
function CreateConnectedComponetsNew(graph, app)
|
||||
|
||||
@@ -77,6 +77,11 @@ FindEulerianLoop.prototype.getObjectSelectedGroup = function(object)
|
||||
return (object.id in this.selectedObjects) ? this.selectedObjects[object.id] : 0;
|
||||
}
|
||||
|
||||
FindEulerianLoop.prototype.getPriority = function()
|
||||
{
|
||||
return -7;
|
||||
}
|
||||
|
||||
// Factory for connected components.
|
||||
function CreateFindEulerianLoop(graph, app)
|
||||
{
|
||||
|
||||
84
script/plugins/NeedAlgorithm.js
Normal file
84
script/plugins/NeedAlgorithm.js
Normal file
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Default handler.
|
||||
* Select using mouse, drag.
|
||||
*
|
||||
*/
|
||||
function NeedAlgorithm(graph, app)
|
||||
{
|
||||
BaseAlgorithm.apply(this, arguments);
|
||||
}
|
||||
|
||||
|
||||
// inheritance.
|
||||
NeedAlgorithm.prototype = Object.create(BaseAlgorithm.prototype);
|
||||
|
||||
|
||||
NeedAlgorithm.prototype.getName = function(local)
|
||||
{
|
||||
return local == "ru" ? "Не нашли нужный алгоритм?" : "Didn't find needed algorithm?";
|
||||
}
|
||||
|
||||
NeedAlgorithm.prototype.getId = function()
|
||||
{
|
||||
return "OlegSh.NeedAlgorithm";
|
||||
}
|
||||
|
||||
// @return message for user.
|
||||
NeedAlgorithm.prototype.getMessage = function(local)
|
||||
{
|
||||
return local == "ru" ? "Спасибо" : "Thank you";
|
||||
}
|
||||
|
||||
NeedAlgorithm.prototype.result = function(resultCallback)
|
||||
{
|
||||
var dialogButtons = {};
|
||||
|
||||
dialogButtons[g_send] = function() {
|
||||
console.log("Message" + $( "#NeedAlgorithmMessage" ).val());
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/cgi-bin/sendEmail.php?text=" + $( "#NeedAlgorithmMessage" ).val(),
|
||||
dataType: "text"
|
||||
});
|
||||
|
||||
$( this ).dialog( "close" );
|
||||
};
|
||||
|
||||
dialogButtons[g_close] = function() {
|
||||
$( this ).dialog( "close" );
|
||||
};
|
||||
|
||||
$( "#NeedAlgorithm" ).dialog({
|
||||
resizable: false,
|
||||
title: g_recommendAlgorithm,
|
||||
width: 400,
|
||||
modal: true,
|
||||
dialogClass: 'EdgeDialog',
|
||||
buttons: dialogButtons,
|
||||
});
|
||||
|
||||
var result = {};
|
||||
result["version"] = 1;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
NeedAlgorithm.prototype.getObjectSelectedGroup = function(object)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
NeedAlgorithm.prototype.getPriority = function()
|
||||
{
|
||||
return 100;
|
||||
}
|
||||
|
||||
|
||||
// Factory for connected components.
|
||||
function CreateNeedAlgorithm(graph, app)
|
||||
{
|
||||
return new NeedAlgorithm(graph)
|
||||
}
|
||||
|
||||
// Gerister connected component.
|
||||
RegisterAlgorithm (CreateNeedAlgorithm);
|
||||
@@ -199,7 +199,10 @@ FindShortPathNew.prototype.updateUpText = function()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FindShortPathNew.prototype.getPriority = function()
|
||||
{
|
||||
return -10;
|
||||
}
|
||||
|
||||
|
||||
// Factory for connected components.
|
||||
|
||||
Reference in New Issue
Block a user