mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-04-14 11:46:10 +00:00
Change script location.
Split js code. Added cache and changed loading mechanism for js sources.
This commit is contained in:
61
script/features/group_rename_handler/index.js
Normal file
61
script/features/group_rename_handler/index.js
Normal file
@@ -0,0 +1,61 @@
|
||||
doInclude ([
|
||||
include ("features/base_handler/index.js")
|
||||
])
|
||||
|
||||
/**
|
||||
* Groupe rename vertices.
|
||||
*
|
||||
*/
|
||||
function GroupRenameVertices(app)
|
||||
{
|
||||
BaseHandler.apply(this, arguments);
|
||||
this.message = "";
|
||||
}
|
||||
|
||||
// inheritance.
|
||||
GroupRenameVertices.prototype = Object.create(BaseHandler.prototype);
|
||||
// First selected.
|
||||
GroupRenameVertices.prototype.firstObject = null;
|
||||
// Path
|
||||
GroupRenameVertices.prototype.pathObjects = null;
|
||||
|
||||
GroupRenameVertices.prototype.show = function()
|
||||
{
|
||||
var handler = this;
|
||||
var dialogButtons = {};
|
||||
var graph = this.app.graph;
|
||||
var app = this.app;
|
||||
|
||||
dialogButtons[g_save] = function() {
|
||||
app.PushToStack("Rename");
|
||||
|
||||
var titlesList = $( "#VertextTitleList" ).val().split('\n');
|
||||
for (i = 0; i < Math.min(graph.vertices.length, titlesList.length); i ++)
|
||||
{
|
||||
graph.vertices[i].mainText = titlesList[i];
|
||||
}
|
||||
app.redrawGraph();
|
||||
$( this ).dialog( "close" );
|
||||
};
|
||||
dialogButtons[g_cancel] = function() {
|
||||
$( this ).dialog( "close" );
|
||||
};
|
||||
|
||||
var titleList = "";
|
||||
for (i = 0; i < graph.vertices.length; i ++)
|
||||
{
|
||||
titleList = titleList + graph.vertices[i].mainText + "\n";
|
||||
}
|
||||
|
||||
$( "#VertextTitleList" ).val(titleList);
|
||||
|
||||
$( "#GroupRenameDialog" ).dialog({
|
||||
resizable: false,
|
||||
height: "auto",
|
||||
width: "auto",
|
||||
modal: true,
|
||||
title: g_groupRename,
|
||||
buttons: dialogButtons,
|
||||
dialogClass: 'EdgeDialog'
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user