touched up the file and directory adding interface in the code folder view
This commit is contained in:
parent
a696b3be30
commit
e1d111f026
@ -180,8 +180,7 @@ function render_readme()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var new_file_item_no = 0;
|
var new_item_no = 0;
|
||||||
var new_dir_item_no = 0;
|
|
||||||
|
|
||||||
function get_new_item_html(no, type, name)
|
function get_new_item_html(no, type, name)
|
||||||
{
|
{
|
||||||
@ -192,25 +191,27 @@ $(function () {
|
|||||||
|
|
||||||
<?php if (isset($login['id']) && $login['id'] != ''): ?>
|
<?php if (isset($login['id']) && $login['id'] != ''): ?>
|
||||||
|
|
||||||
new_file_item_no = 0;
|
new_item_no = 0;
|
||||||
new_dir_item_no = 0;
|
$('#code_folder_mainarea_new_file_form_item_list').append (get_new_item_html(new_item_no, 'file', 'file'));
|
||||||
$('#code_folder_mainarea_new_file_form_item_list').append (get_new_item_html(new_file_item_no, 'file', 'file'));
|
$('#code_folder_mainarea_new_dir_form_item_list').append (get_new_item_html(new_item_no, 'text', 'dir'));
|
||||||
$('#code_folder_mainarea_new_dir_form_item_list').append (get_new_item_html(new_dir_item_no, 'text', 'dir'));
|
|
||||||
|
|
||||||
$("#code_folder_mainarea_new_file_form_div").dialog (
|
$("#code_folder_mainarea_new_form_tabs").tabs ();
|
||||||
|
|
||||||
|
$("#code_folder_mainarea_new_form_div").dialog (
|
||||||
{
|
{
|
||||||
title: '<?php print $this->lang->line('File');?>',
|
title: '<?php print $this->lang->line('New');?>',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
autoOpen: false,
|
autoOpen: false,
|
||||||
modal: true,
|
modal: true,
|
||||||
buttons: {
|
buttons: {
|
||||||
'More': function () {
|
'More': function () {
|
||||||
++new_file_item_no;
|
++new_item_no;
|
||||||
$('#code_folder_mainarea_new_file_form_item_list').append (get_new_item_html(new_file_item_no, 'file', 'file'));
|
$('#code_folder_mainarea_new_file_form_item_list').append (get_new_item_html(new_item_no, 'file', 'file'));
|
||||||
|
$('#code_folder_mainarea_new_dir_form_item_list').append (get_new_item_html(new_item_no, 'text', 'dir'));
|
||||||
},
|
},
|
||||||
'<?php print $this->lang->line('OK')?>': function () {
|
'<?php print $this->lang->line('OK')?>': function () {
|
||||||
$('#code_folder_mainarea_new_file_item_count').val (new_file_item_no + 1);
|
$('#code_folder_mainarea_new_item_count').val (new_item_no + 1);
|
||||||
$('#code_folder_mainarea_new_file_form').submit();
|
$('#code_folder_mainarea_new_form').submit();
|
||||||
$(this).dialog('close');
|
$(this).dialog('close');
|
||||||
},
|
},
|
||||||
'<?php print $this->lang->line('Cancel')?>': function () {
|
'<?php print $this->lang->line('Cancel')?>': function () {
|
||||||
@ -222,37 +223,10 @@ $(function () {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$("#code_folder_mainarea_new_dir_form_div").dialog (
|
$("#code_folder_mainarea_new_button").button().click (function() {
|
||||||
{
|
$("#code_folder_mainarea_new_form_div").dialog('open');
|
||||||
title: '<?php print $this->lang->line('Directory');?>',
|
|
||||||
resizable: true,
|
|
||||||
autoOpen: false,
|
|
||||||
modal: true,
|
|
||||||
buttons: {
|
|
||||||
'More': function () {
|
|
||||||
++new_dir_item_no;
|
|
||||||
$('#code_folder_mainarea_new_dir_form_item_list').append (get_new_item_html(new_dir_item_no, 'text', 'dir'));
|
|
||||||
},
|
|
||||||
'<?php print $this->lang->line('OK')?>': function () {
|
|
||||||
$('#code_folder_mainarea_new_dir_item_count').val (new_dir_item_no + 1);
|
|
||||||
$('#code_folder_mainarea_new_dir_form').submit();
|
|
||||||
$(this).dialog('close');
|
|
||||||
},
|
|
||||||
'<?php print $this->lang->line('Cancel')?>': function () {
|
|
||||||
$(this).dialog('close');
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
clsoe: function() {}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
$("#code_folder_mainarea_new_file_button").button().click (function() {
|
|
||||||
$("#code_folder_mainarea_new_file_form_div").dialog('open');
|
|
||||||
});
|
|
||||||
$("#code_folder_mainarea_new_dir_button").button().click (function() {
|
|
||||||
$("#code_folder_mainarea_new_dir_form_div").dialog('open');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($file_count > 0): ?>
|
<?php if ($file_count > 0): ?>
|
||||||
@ -547,8 +521,7 @@ $this->load->view (
|
|||||||
|
|
||||||
if (isset($login['id']) && $login['id'] != '')
|
if (isset($login['id']) && $login['id'] != '')
|
||||||
{
|
{
|
||||||
printf ('<a id="code_folder_mainarea_new_file_button" href="#">%s</a>', $this->lang->line('New file'));
|
printf ('<a id="code_folder_mainarea_new_button" href="#">%s</a>', $this->lang->line('New'));
|
||||||
printf ('<a id="code_folder_mainarea_new_dir_button" href="#">%s</a>', $this->lang->line('New directory'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($file_count > 0)
|
if ($file_count > 0)
|
||||||
@ -780,35 +753,37 @@ $this->load->view (
|
|||||||
|
|
||||||
|
|
||||||
<?php if (isset($login['id']) && $login['id'] != ''): ?>
|
<?php if (isset($login['id']) && $login['id'] != ''): ?>
|
||||||
<div id="code_folder_mainarea_new_file_form_div">
|
|
||||||
|
<div id="code_folder_mainarea_new_form_div">
|
||||||
<?php
|
<?php
|
||||||
$attrs = array ('id' => 'code_folder_mainarea_new_file_form');
|
$attrs = array ('id' => 'code_folder_mainarea_new_form');
|
||||||
// this posts to the head revision regardless of the revision being shown
|
// this form posts to the head revision regardless of the revision being shown currently
|
||||||
print form_open_multipart("code/file/{$project->id}/".$this->converter->AsciiToHex($headpath), $attrs);
|
print form_open_multipart("code/file/{$project->id}/".$this->converter->AsciiToHex($headpath), $attrs);
|
||||||
?>
|
?>
|
||||||
<input type='hidden' name='code_folder_new_item_count' id='code_folder_mainarea_new_file_item_count' />
|
<input type='hidden' name='code_folder_new_item_count' id='code_folder_mainarea_new_item_count' />
|
||||||
|
|
||||||
<div><?php print $this->lang->line('Message'); ?>:</div>
|
<div><?php print $this->lang->line('Message'); ?>:</div>
|
||||||
<div><textarea type='textarea' name='code_folder_new_message' style='width:100%;'></textarea></div>
|
<div><textarea type='textarea' name='code_folder_new_message' style='width:100%;'></textarea></div>
|
||||||
<div><input type='checkbox' name='code_folder_new_item_unzip' value='yes'/><?php print $this->lang->line('Unzip a zip file'); ?></div>
|
|
||||||
<div><ul id='code_folder_mainarea_new_file_form_item_list'></ul></div>
|
<div id="code_folder_mainarea_new_form_tabs" style="width:100%;">
|
||||||
|
<ul>
|
||||||
|
<li><a href="#code_folder_mainarea_new_file_div">File</a></li>
|
||||||
|
<li><a href="#code_folder_mainarea_new_dir_div">Directory</a></li>
|
||||||
|
</ul>
|
||||||
|
<div id="code_folder_mainarea_new_file_div">
|
||||||
|
<div><input type='checkbox' name='code_folder_new_item_unzip' value='yes'/><?php print $this->lang->line('Unzip a zip file'); ?></div>
|
||||||
|
<div><ul id='code_folder_mainarea_new_file_form_item_list'></ul></div>
|
||||||
|
</div>
|
||||||
|
<div id="code_folder_mainarea_new_dir_div">
|
||||||
|
<div><ul id='code_folder_mainarea_new_dir_form_item_list'></ul></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php print form_close();?>
|
<?php print form_close();?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="code_folder_mainarea_new_dir_form_div">
|
|
||||||
<?php
|
|
||||||
$attrs = array ('id' => 'code_folder_mainarea_new_dir_form');
|
|
||||||
// this posts to the head revision regardless of the revision being shown
|
|
||||||
print form_open_multipart("code/file/{$project->id}/".$this->converter->AsciiToHex($headpath), $attrs);
|
|
||||||
?>
|
|
||||||
<input type='hidden' name='code_folder_new_item_count' id='code_folder_mainarea_new_dir_item_count' />
|
|
||||||
<div><?php print $this->lang->line('Message'); ?>:</div>
|
|
||||||
<div><textarea type='textarea' name='code_folder_new_message' style='width:100%;'></textarea></div>
|
|
||||||
<div><ul id='code_folder_mainarea_new_dir_form_item_list'></ul></div>
|
|
||||||
<?php print form_close();?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
</div> <!-- code_folder_mainarea -->
|
</div> <!-- code_folder_mainarea -->
|
||||||
|
|
||||||
<div class='footer-pusher'></div> <!-- for sticky footer -->
|
<div class='footer-pusher'></div> <!-- for sticky footer -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user