Merge pull request #676 from daeks/672.2

add old projectname to rename project
This commit is contained in:
daeks
2014-07-13 13:08:21 +02:00
4 changed files with 9 additions and 8 deletions

View File

@@ -81,7 +81,7 @@
"title": "Rename Project",
"icon": "icon-pencil",
"applies-to" : "root-only",
"onclick": "codiad.project.rename($('#context-menu').attr('data-path'));"
"onclick": "codiad.project.rename($('#context-menu').attr('data-path'),$('#context-menu').attr('data-name'));"
},
{
"title": "Break",

View File

@@ -108,7 +108,8 @@
e.preventDefault();
_this.contextMenuShow(e, $(this)
.attr('data-path'), $(this)
.attr('data-type'));
.attr('data-type'), $(this)
.html());
$(this)
.addClass('context-menu-active');
});
@@ -118,8 +119,7 @@
// Context Menu
//////////////////////////////////////////////////////////////////
contextMenuShow: function(e, path, type) {
contextMenuShow: function(e, path, type, name) {
var _this = this;
// Selective options
@@ -162,7 +162,8 @@
})
.fadeIn(200)
.attr('data-path', path)
.attr('data-type', type);
.attr('data-type', type)
.attr('data-name', name);
// Show faded 'paste' if nothing in clipboard
if (this.clipboard === '') {
$('#context-menu a[content="Paste"]')

View File

@@ -185,7 +185,7 @@
<form>
<input type="hidden" name="project_path" value="<?php echo($_GET['path']); ?>">
<label><span class="icon-pencil"></span><?php i18n("Rename Project"); ?></label>
<input type="text" name="project_name" autofocus="autofocus" autocomplete="off" value="">
<input type="text" name="project_name" autofocus="autofocus" autocomplete="off" value="<?php echo($_GET['name']); ?>">
<button class="btn-left"><?php i18n("Rename"); ?></button>&nbsp;<button class="btn-right" onclick="codiad.modal.unload(); return false;"><?php i18n("Cancel"); ?></button>
<form>
<?php

View File

@@ -163,9 +163,9 @@
// Rename Project
//////////////////////////////////////////////////////////////////
rename: function(path) {
rename: function(path,name) {
var _this = this;
codiad.modal.load(500, this.dialog + '?action=rename&path=' + escape(path));
codiad.modal.load(500, this.dialog + '?action=rename&path=' + escape(path) + '&name='+name);
$('#modal-content form')
.live('submit', function(e) {
e.preventDefault();