* Change the upload file control to uploader.
This commit is contained in:
+2
-13
@@ -319,19 +319,8 @@ class doc extends control
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $docID));
|
||||
$objectID = zget($lib, $lib->type, 0);
|
||||
$params = "type={$lib->type}&objectID=$objectID&libID={$lib->id}&docID=" . $docResult['id'];
|
||||
$link = isonlybody() ? 'parent' : $this->createLink('doc', 'objectLibs', $params, 'html') . '#app=' . $this->app->tab;
|
||||
$response = array('result' => 'success', 'message' => $this->lang->saveSuccess);
|
||||
|
||||
if(isonlybody() and $docResult['docType'] == 'text')
|
||||
{
|
||||
$link = helper::createLink('doc', 'edit', "docID=$docID&comment=false&objectType=$objectType&objectID=$objectID&libID={$docResult['libID']}");
|
||||
|
||||
$response['callback'] = "redirect2Edit($docID, \"$objectType\", $objectID, {$docResult['libID']})";
|
||||
}
|
||||
else
|
||||
{
|
||||
$response['locate'] = "$link";
|
||||
}
|
||||
$link = isonlybody() ? 'parent' : $this->createLink('doc', 'objectLibs', $params) . '#app=' . $this->app->tab;
|
||||
$response = array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link);
|
||||
|
||||
return $this->send($response);
|
||||
}
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
#whiteListBox .input-group:last-child {margin-top: 10px;}
|
||||
.fullscreen-save, .markdown-fullscreen-save {position: fixed; top: 10px; right: 30px; z-index: 999999;}
|
||||
#uploader {margin-bottom: 0 !important;}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#uploader {margin-bottom: 0 !important;}
|
||||
+16
-9
@@ -64,12 +64,6 @@ $(function()
|
||||
|
||||
if(!fromGlobal)
|
||||
{
|
||||
var basicInfo = JSON.parse(sessionStorage.getItem('docBasicInfo'));
|
||||
var docFiles = JSON.parse(sessionStorage.getItem('docFiles'));
|
||||
var fileNames = [];
|
||||
var mailto = [];
|
||||
var groups = [];
|
||||
var users = [];
|
||||
var libID = 0;
|
||||
var moduleID = 0;
|
||||
var title = '';
|
||||
@@ -77,6 +71,13 @@ $(function()
|
||||
var type = '';
|
||||
var acl = '';
|
||||
var contentType = '';
|
||||
var fileNames = [];
|
||||
var mailto = [];
|
||||
var groups = [];
|
||||
var users = [];
|
||||
var basicInfo = JSON.parse(sessionStorage.getItem('docBasicInfo'));
|
||||
var docFiles = JSON.parse(sessionStorage.getItem('docFiles'));
|
||||
console.log(docFiles);
|
||||
|
||||
$.each(basicInfo, function(index, value)
|
||||
{
|
||||
@@ -103,9 +104,6 @@ $(function()
|
||||
case 'contentType':
|
||||
contentType = value.value;
|
||||
break;
|
||||
case 'labels[]':
|
||||
fileNames.push(value.value);
|
||||
break;
|
||||
case 'mailto[]':
|
||||
mailto.push(value.value);
|
||||
break;
|
||||
@@ -118,12 +116,21 @@ $(function()
|
||||
}
|
||||
})
|
||||
|
||||
$('#title').val(title);
|
||||
$('#modalBasicInfo #keywords').val(keywords);
|
||||
$('#modalBasicInfo #mailto').data('zui.picker').setValue(mailto);
|
||||
$('#modalBasicInfo input:radio[value='+ acl +']').attr('checked', 'checked');
|
||||
toggleAcl($('input[name="acl"]:checked').val(), 'doc');
|
||||
setTimeout(function(){$('#modalBasicInfo #groups').data('zui.picker').setValue(groups)}, 1000);
|
||||
setTimeout(function(){$('#modalBasicInfo #users').data('zui.picker').setValue(users)}, 1000);
|
||||
|
||||
$('#uploader').uploader({
|
||||
autoUpload: true,
|
||||
deleteActionOnDone: function(file, doRemoveFile) {
|
||||
doRemoveFile();
|
||||
},
|
||||
staticFiles: docFiles
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
$(function()
|
||||
{
|
||||
config.onlybody = 'no';
|
||||
|
||||
toggleAcl($('input[name="acl"]:checked').val(), 'doc');
|
||||
|
||||
if($(".createCustomLib").length == 1) $(".createCustomLib").click(); // Fix bug #15139.
|
||||
@@ -7,12 +9,7 @@ $(function()
|
||||
$('#saveBtn').click(function()
|
||||
{
|
||||
var params = $('#dataform').serializeArray();
|
||||
|
||||
var files = [];
|
||||
$("input[name^='file']").each(function()
|
||||
{
|
||||
files.push($(this).val());
|
||||
});
|
||||
var files = $('#uploader').data('zui.uploader').getFiles();
|
||||
|
||||
sessionStorage.setItem('docBasicInfo', JSON.stringify(params));
|
||||
sessionStorage.setItem('docFiles', JSON.stringify(files));
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::import($jsRoot . 'uploader/min.js');?>
|
||||
<?php css::import($jsRoot . 'uploader/min.css');?>
|
||||
<?php js::set('holders', $lang->doc->placeholder);?>
|
||||
<?php js::set('type', 'doc');?>
|
||||
<div id="mainContent" class="main-content">
|
||||
@@ -36,7 +38,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->title;?></th>
|
||||
<td colspan='2'><?php echo html::input('title', '', "class='form-control' required");?></td>
|
||||
<td colspan='2'><?php echo html::input('title', '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->keywords;?></th>
|
||||
@@ -52,7 +54,19 @@
|
||||
</tr>
|
||||
<tr id='fileBox'>
|
||||
<th><?php echo $lang->doc->files;?></th>
|
||||
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
|
||||
<td colspan='2'>
|
||||
<div id='uploader' class="uploader" data-ride="uploader" data-url="<?php echo $this->createLink('file', 'ajaxUpload', "uid=" . uniqid());?>">
|
||||
<div class="uploader-message text-center">
|
||||
<div class="content"></div>
|
||||
<button type="button" class="close">×</button>
|
||||
</div>
|
||||
<div class="uploader-files file-list file-list-lg" data-drag-placeholder="请拖拽文件到此处"></div>
|
||||
<div class="uploader-actions">
|
||||
<div class="uploader-status pull-right text-muted"></div>
|
||||
<button type="button" class="btn btn-link uploader-btn-browse"><i class="icon icon-plus"></i> 选择文件</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->mailto;?></th>
|
||||
@@ -102,4 +116,12 @@
|
||||
<?php js::set('objectID', $objectID);?>
|
||||
<?php js::set('docType', $docType);?>
|
||||
<?php js::set('noticeAcl', $lang->doc->noticeAcl['doc']);?>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#uploaderExample').uploader({
|
||||
autoUpload: true
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php include '../../common/view/markdown.html.php';?>
|
||||
<?php js::import($jsRoot . 'uploader/min.js');?>
|
||||
<?php css::import($jsRoot . 'uploader/min.css');?>
|
||||
<?php js::set('holders', $lang->doc->placeholder);?>
|
||||
<?php js::set('type', 'doc');?>
|
||||
<style>
|
||||
@@ -120,7 +122,19 @@
|
||||
</tr>
|
||||
<tr id='fileBox'>
|
||||
<th><?php echo $lang->doc->files;?></th>
|
||||
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
|
||||
<td colspan='2'>
|
||||
<div id='uploader' class="uploader" data-ride="uploader" data-url="<?php echo $this->createLink('file', 'ajaxUpload', "uid=" . uniqid());?>">
|
||||
<div class="uploader-message text-center">
|
||||
<div class="content"></div>
|
||||
<button type="button" class="close">×</button>
|
||||
</div>
|
||||
<div class="uploader-files file-list file-list-lg" data-drag-placeholder="请拖拽文件到此处"></div>
|
||||
<div class="uploader-actions">
|
||||
<div class="uploader-status pull-right text-muted"></div>
|
||||
<button type="button" class="btn btn-link uploader-btn-browse"><i class="icon icon-plus"></i> 选择文件</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->doc->mailto;?></th>
|
||||
@@ -175,21 +189,48 @@ $(function()
|
||||
setTimeout(function(){$('.ke-edit-iframe, .ke-edit').height(contentHeight);}, 100);
|
||||
setTimeout(function(){$('.CodeMirror').height(contentHeight);}, 100);
|
||||
|
||||
//basicInfoContent = '';
|
||||
//$('#basicInfoLink').click(function()
|
||||
//{
|
||||
// basicInfoContent = $('#basicInfoBox').html();
|
||||
//});
|
||||
initialLibID = 0;
|
||||
initialModuleID = 0;
|
||||
initialKeywords = '';
|
||||
initialAcl = '';
|
||||
initialFilesName = [];
|
||||
initialFilesPath = [];
|
||||
initialMailto = [];
|
||||
initialGroups = [];
|
||||
initialUsers = [];
|
||||
|
||||
//$('#modalBasicInfo .modal-header .close').click(function()
|
||||
//{
|
||||
// $('#basicInfoBox').html(basicInfoContent);
|
||||
//});
|
||||
$('#basicInfoLink').click(function()
|
||||
{
|
||||
initialLibID = $('#modalBasicInfo #lib').val();
|
||||
initialModuleID = $('#modalBasicInfo #module').val();
|
||||
initialKeywords = $('#modalBasicInfo #keywords').val();
|
||||
initialAcl = $('#modalBasicInfo input[name=acl]:checked').val();
|
||||
initialMailto = $('#modalBasicInfo #mailto').data('zui.picker').getValue();
|
||||
initialGroups = $('#modalBasicInfo #groups').data('zui.picker').getValue();
|
||||
initialUsers = $('#modalBasicInfo #users').data('zui.picker').getValue();
|
||||
|
||||
$("input[name^='file']").each(function(){initialFilesPath.push($(this).val());});
|
||||
$("input[name^='label']").each(function(){initialFilesName.push($(this).val());});
|
||||
});
|
||||
|
||||
$('#modalBasicInfo .modal-header .close').click(function()
|
||||
{
|
||||
$('#modalBasicInfo #lib').val(initialLibID).trigger('chosen:updated');
|
||||
$('#modalBasicInfo #lib').trigger('change');
|
||||
$('#modalBasicInfo #module').val(initialModuleID).trigger('chosen:updated');
|
||||
$('#modalBasicInfo #keywords').val(initialKeywords);
|
||||
$('#modalBasicInfo input:radio[value='+ initialAcl +']').attr('checked', 'checked');
|
||||
toggleAcl($('input[name="acl"]:checked').val(), 'doc');
|
||||
$('#modalBasicInfo #mailto').data('zui.picker').setValue(initialMailto);
|
||||
setTimeout(function(){$('#modalBasicInfo #groups').data('zui.picker').setValue(initialGroups)}, 1000);
|
||||
setTimeout(function(){$('#modalBasicInfo #users').data('zui.picker').setValue(initialUsers)}, 1000);
|
||||
});
|
||||
|
||||
$(document).on('click', '#modalBasicInfo tfoot .btn', function() {$('#modalBasicInfo').modal('hide');});
|
||||
})
|
||||
</script>
|
||||
<?php js::set('docType', $docType);?>
|
||||
<?php js::set('fromGlobal', $fromGlobal);?>
|
||||
<?php js::set('uid', uniqid());?>
|
||||
<?php js::set('noticeAcl', $lang->doc->noticeAcl['doc']);?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
@@ -176,16 +176,42 @@ $(function()
|
||||
setTimeout(function(){$('.ke-edit-iframe, .ke-edit').height(contentHeight);}, 100);
|
||||
setTimeout(function(){$('.CodeMirror').height(contentHeight);}, 100);
|
||||
|
||||
//basicInfoContent = '';
|
||||
//$('#basicInfoLink').click(function()
|
||||
//{
|
||||
// basicInfoContent = $('#basicInfoBox').html();
|
||||
//});
|
||||
initialLibID = 0;
|
||||
initialModuleID = 0;
|
||||
initialKeywords = '';
|
||||
initialAcl = '';
|
||||
initialFilesName = [];
|
||||
initialFilesPath = [];
|
||||
initialMailto = [];
|
||||
initialGroups = [];
|
||||
initialUsers = [];
|
||||
|
||||
//$('#modalBasicInfo .modal-header .close').click(function()
|
||||
//{
|
||||
// $('#basicInfoBox').html(basicInfoContent);
|
||||
//});
|
||||
$('#basicInfoLink').click(function()
|
||||
{
|
||||
initialLibID = $('#modalBasicInfo #lib').val();
|
||||
initialModuleID = $('#modalBasicInfo #module').val();
|
||||
initialKeywords = $('#modalBasicInfo #keywords').val();
|
||||
initialAcl = $('#modalBasicInfo input[name=acl]:checked').val();
|
||||
initialMailto = $('#modalBasicInfo #mailto').data('zui.picker').getValue();
|
||||
initialGroups = $('#modalBasicInfo #groups').data('zui.picker').getValue();
|
||||
initialUsers = $('#modalBasicInfo #users').data('zui.picker').getValue();
|
||||
|
||||
$("input[name^='file']").each(function(){initialFilesPath.push($(this).val());});
|
||||
$("input[name^='label']").each(function(){initialFilesName.push($(this).val());});
|
||||
});
|
||||
|
||||
$('#modalBasicInfo .modal-header .close').click(function()
|
||||
{
|
||||
$('#modalBasicInfo #lib').val(initialLibID).trigger('chosen:updated');
|
||||
$('#modalBasicInfo #lib').trigger('change');
|
||||
$('#modalBasicInfo #module').val(initialModuleID).trigger('chosen:updated');
|
||||
$('#modalBasicInfo #keywords').val(initialKeywords);
|
||||
$('#modalBasicInfo input:radio[value='+ initialAcl +']').attr('checked', 'checked');
|
||||
toggleAcl($('input[name="acl"]:checked').val(), 'doc');
|
||||
$('#modalBasicInfo #mailto').data('zui.picker').setValue(initialMailto);
|
||||
setTimeout(function(){$('#modalBasicInfo #groups').data('zui.picker').setValue(initialGroups)}, 1000);
|
||||
setTimeout(function(){$('#modalBasicInfo #users').data('zui.picker').setValue(initialUsers)}, 1000);
|
||||
});
|
||||
|
||||
$(document).on('click', '#modalBasicInfo tfoot .btn', function() {$('#modalBasicInfo').modal('hide');});
|
||||
})
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<td><?php echo html::radio('type', $lang->doc->types, 'text');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'><?php echo html::submitButton($lang->confirm);?></td>
|
||||
<td colspan='3' class='text-center form-actions'><?php echo html::submitButton($lang->doc->nextStep);?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user