mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
Issue 2377: Admin Ui Refactoring - Settings - File Box
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11566 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7b101f0175
commit
ab1372b514
2 changed files with 77 additions and 1 deletions
|
|
@ -112,3 +112,45 @@ function clearRow(target){
|
|||
$controlGroup.remove();
|
||||
$('.__attribute').last().find('.__addBtn').show();
|
||||
}
|
||||
|
||||
var $current_filebox;
|
||||
|
||||
jQuery(document).ready(function($){
|
||||
$('.filebox').bind('before-open.mw', function(){
|
||||
var $attributes = $('.__attribute');
|
||||
var count = $attributes.length;
|
||||
for(var i = count - 1; i > 0; i--){
|
||||
clearRow($($attributes.get(i)));
|
||||
}
|
||||
$('#new_filebox_upload').find('input[name^=attribute_name], input[name^=attribute_value], input[name=addfile]').val('');
|
||||
});
|
||||
|
||||
$('.filebox').click(function(){
|
||||
$current_filebox = $(this);
|
||||
});
|
||||
|
||||
$('#new_filebox_upload').submit(function(){
|
||||
if ($('iframe[name=iframeTarget]').length < 1){
|
||||
var $iframe = $(document.createElement('iframe'));
|
||||
|
||||
$iframe.css('display', 'none');
|
||||
$iframe.attr('src', '#');
|
||||
$iframe.attr('name', 'iframeTarget');
|
||||
$iframe.load(function(){
|
||||
var data = eval('(' + $(window.iframeTarget.document.getElementsByTagName("body")[0]).html() + ')');
|
||||
|
||||
if (data.error){
|
||||
alert(data.message);
|
||||
return;
|
||||
}
|
||||
|
||||
$current_filebox.trigger('filebox.selected', [data.save_filename]);
|
||||
$current_filebox.trigger('close.mw');
|
||||
});
|
||||
|
||||
$('body').append($iframe.get(0));
|
||||
|
||||
$(this).attr('target', 'iframeTarget');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -10,7 +10,41 @@
|
|||
</div>
|
||||
|
||||
<div class="x_modal-body">
|
||||
<div class="filebox_list"></div>
|
||||
<section class="section">
|
||||
<h4>{$lang->upload_file}</h4>
|
||||
<form id="new_filebox_upload" action="./" class="x_form-horizontal" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="module" value="module" />
|
||||
<input type="hidden" name="act" value="procModuleFileBoxAdd" />
|
||||
<input type="hidden" name="vid" value="{$vid}" />
|
||||
<input type="hidden" name="filter" value="{$filter}" />
|
||||
<input type="hidden" name="input" value="{$input}" />
|
||||
<input type="hidden" name="ajax" value="true" />
|
||||
|
||||
<div class="x_control-group __attribute" data-count="1">
|
||||
<label for="attribute_name1" class="x_control-label __attribute_name_label">{$lang->attribute_name}</label>
|
||||
<div class="x_controls">
|
||||
<input type="text" name="attribute_name[]" id="attribute_name1" class="__attribute_name" />
|
||||
<label for="attribute_value1" class="x_inline __attribute_value_label">{$lang->attribute_value} <input type="text" name="attribute_value[]" id="attribute_value1" class="__attribute_value" /></label>
|
||||
|
||||
<button type="button" class="x_btn x_btn-mini __addBtn" onclick="addRow('fileUp');">{$lang->cmd_add}</button>
|
||||
<button type="button" class="x_btn x_btn-mini __deleteBtn" onclick="clearRow(this);">{$lang->cmd_delete}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="file" class="x_control-label">{$lang->file}</label>
|
||||
<div class="x_controls">
|
||||
<input type="file" name="addfile" id="file" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
<button type="submit" class="x_btn x_btn-primary">{$lang->cmd_save}</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
<section>
|
||||
<h4>List</h4>
|
||||
<div class="filebox_list"></div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="x_modal-footer">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue