253 lines
9.0 KiB
HTML
253 lines
9.0 KiB
HTML
{extend name="public/base"/}
|
|
{block name="style"}
|
|
|
|
<link rel="stylesheet" href="__PUBLIC__/plugs/tagsinput/bootstrap-tagsinput.css">
|
|
<script src="__PUBLIC__/plugs/tagsinput/bootstrap-tagsinput.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/plugs/webuploader/webuploader.css">
|
|
<!-- 配置文件 -->
|
|
<script type="text/javascript" src="__PUBLIC__/plugs/ueditor/ueditor.config.js"></script>
|
|
|
|
<!-- datepicker statr -->
|
|
<link href="__PUBLIC__/plugs/datepicker/css/foundation-datepicker.min.css" rel="stylesheet" type="text/css">
|
|
<script src="__PUBLIC__/plugs/datepicker/js/foundation-datepicker.js"></script>
|
|
<script src="__PUBLIC__/plugs/datepicker/js/foundation-datepicker.zh-CN.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/plugs/board/board.min.css">
|
|
<!-- datepicker end -->
|
|
{/block}
|
|
{block name="body"}
|
|
<div class="main-box clearfix">
|
|
<header class="main-box-header clearfix">
|
|
<div class="pull-left">
|
|
<h2>{$meta_title}</h2>
|
|
</div>
|
|
</header>
|
|
<div class="main-box-body clearfix">
|
|
<div class="tab-content">
|
|
<h3>小说:{$book.title}</h3>
|
|
<p style="margin-top:10px;font-size:13px;margin-bottom:20px;">章节数:<font color='red'>{$book.chapters}</font></p>
|
|
<div class="form-group col-md-12">
|
|
<label class="col-lg-2" style="margin-bottom:10px;">查找的文字</label>
|
|
<input type="text" class="form-control" name="str" id="str" placeholder="不要输入特殊符号">
|
|
<div class="help-block" style="color:red;">匹配的文字</div>
|
|
|
|
<button type="button" class="btn btn-primary" id="myButton4" data-complete-text="查找中。。。">查找
|
|
</button>
|
|
<div class="glyphicon glyphicon-refresh" onclick="sxso()" style="cursor: pointer;margin-left:20px;"></div>
|
|
</div>
|
|
<div class="form-group col-md-12">
|
|
<label class="col-lg-2" style="margin-bottom:10px;">替换的文字</label>
|
|
<input type="text" class="form-control" name="repstr" id="repstr" placeholder="不要输入特殊符号">
|
|
<div class="help-block" style="color:red;">匹配上面后替换的文字</div>
|
|
</div>
|
|
|
|
<div class="form-group col-md-12">
|
|
<label class="col-lg-2">电子书</label>
|
|
<div class="col-lg-11 col-sm-10"><input type="file" class="input" size="30" id="upload_ebook" /><input type="hidden" name="ebook" id="ebook" value="" />
|
|
</div>
|
|
</div>
|
|
|
|
<button type="button" class="btn btn-danger" style="" id="replacebook">替换整本书</button>
|
|
|
|
<button type="button" class="btn btn-danger" style="display: block;margin:0 auto;width:120px;margin-bottom:20px;" id="substr">替换</button>
|
|
|
|
<div class="progress progress-striped active" style="display:none;" id="jdt">
|
|
<div class="progress-bar progress-bar-success" role="progressbar"
|
|
aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
|
|
style="width: 0%;" id="jd">
|
|
<span class="sr-only"></span>
|
|
</div>
|
|
</div>
|
|
|
|
<p class="text-warning" id="tstext"></p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
{/block}
|
|
{block name="script"}
|
|
<script type="text/javascript" src="__PUBLIC__/plugs/webuploader/webuploader.min.js"></script>
|
|
<script type="text/javascript" src="__PUBLIC__/plugs/webuploader/webuploader.custom.js"></script>
|
|
<script type="text/javascript" src="__PUBLIC__/js/droppable.js"></script>
|
|
<script type="text/javascript" src="__PUBLIC__/plugs/board/board.min.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/plugs/uploadify/uploadify.css">
|
|
<script type="text/javascript" src="__PUBLIC__/plugs/uploadify/jquery.uploadify.min.js"></script>
|
|
<script language="javascript" type="text/javascript">
|
|
$(document).ready(function() {
|
|
$("#upload_ebook").uploadify({
|
|
swf : '__PUBLIC__/plugs/uploadify/uploadify.swf',
|
|
uploader : "{:url('Upload/Uploadtxt')}",
|
|
formData : {
|
|
session : '{:session_id()}',
|
|
type : 'ebook',
|
|
userid : '1'
|
|
},
|
|
buttonText : '选择电子书',
|
|
buttonImage: "",
|
|
width: "124",
|
|
height: "33",
|
|
fileObjName : 'ebook',
|
|
fileTypeDesc : '支持格式:',
|
|
fileTypeExts : '*.txt',
|
|
fileSizeLimit : '100MB',
|
|
queueSizeLimit : 1,
|
|
multi : false,
|
|
removeCompleted : false,
|
|
onSelect : function(file) {
|
|
$("#ebook").val("");
|
|
var queuedFile = {};
|
|
for (var n in this.queueData.files) {
|
|
queuedFile = this.queueData.files[n];
|
|
if (queuedFile.id !== file.id) {
|
|
$('#' + queuedFile.id).remove();
|
|
this.cancelUpload(queuedFile.id);
|
|
delete this.queueData.files[n];
|
|
}
|
|
}
|
|
},
|
|
onUploadSuccess : function(file, data) {
|
|
$("#ebook").val(data);
|
|
$('#' + file.id).find('.cancel').hide();
|
|
$('#' + file.id).find('.uploadify-progress').hide();
|
|
if (data == "") {
|
|
$('#' + file.id).find('.data').html(' - <font color="red">上传失败!</font>');
|
|
return false;
|
|
}
|
|
$('#' + file.id).find('.data').html(' - <font color="green">上传成功!</font>');
|
|
}
|
|
});
|
|
});
|
|
|
|
</script>
|
|
<script type="text/javascript">
|
|
function sxso(){
|
|
var str = $('#str').val();
|
|
if(str==''){
|
|
alert('不能为空')
|
|
}else{
|
|
$("#myButton4").button('loading');
|
|
var str = $('#str').val();
|
|
var url="{:url('admin/Novel/saestr')}";
|
|
var id="{$id}";
|
|
$.ajax({
|
|
url: url,
|
|
type: 'post',
|
|
data: {str:str,id:id},
|
|
dataType: 'json',
|
|
success:function(data){
|
|
if(data.status==1){
|
|
$("#myButton4").text(data.msg);
|
|
}else{
|
|
$("#myButton4").text(data.msg);
|
|
}
|
|
}
|
|
});
|
|
|
|
}
|
|
}
|
|
|
|
function jd(jd){
|
|
var btn = document.getElementById('jd')
|
|
var len = jd;
|
|
btn.style.width = len+'%';
|
|
}
|
|
|
|
$("#myButton4").click(function(){
|
|
var str = $('#str').val();
|
|
if(str==''){
|
|
alert('不能为空')
|
|
}else{
|
|
|
|
$(this).button('loading').delay(1000).queue(function() {
|
|
var str = $('#str').val();
|
|
var url="{:url('admin/Novel/saestr')}";
|
|
var id="{$id}";
|
|
$.ajax({
|
|
url: url,
|
|
type: 'post',
|
|
data: {str:str,id:id},
|
|
dataType: 'json',
|
|
success:function(data){
|
|
if(data.status==1){
|
|
$("#myButton4").text(data.msg);
|
|
}else{
|
|
$("#myButton4").text(data.msg);
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
});
|
|
|
|
}
|
|
})
|
|
|
|
$('#substr').on('click',function () {
|
|
var url="{:url('admin/Novel/arepstr')}"
|
|
var that = this;
|
|
var str = $('#str').val();
|
|
var repstr = $('#repstr').val();
|
|
var id = "{$id}";
|
|
if(str==''){
|
|
alert('不能为空')
|
|
}else if(repstr==''){
|
|
alert('不能为空')
|
|
}else{
|
|
$('#jdt').show();
|
|
$('#tstext').text('替换中');
|
|
$(this).off('click')
|
|
$.ajax({
|
|
url: url,
|
|
type: 'post',
|
|
data: {str:str,repstr:repstr,id:id},
|
|
dataType: 'json',
|
|
success:function(data){
|
|
if(data==1){
|
|
jd(100)
|
|
$('#tstext').text('替换成功');
|
|
window.setTimeout(function(){
|
|
window.location.href = '';
|
|
},2000);
|
|
}else{
|
|
jd(20)
|
|
$('#tstext').text('替换失败');
|
|
window.setTimeout(function(){
|
|
window.location.href = '';
|
|
},2000);
|
|
}
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$('#replacebook').on('click',function () {
|
|
var url="{:url('admin/Novel/replacebook')}";
|
|
var id = "{$id}";
|
|
var ebook = $('#ebook').val();
|
|
if(ebook==''){
|
|
$('#tstext').text('电子书为空');
|
|
}else{
|
|
$.ajax({
|
|
url: url,
|
|
type: 'post',
|
|
data: {ebook:ebook,id:id},
|
|
dataType: 'json',
|
|
success:function(data){
|
|
if(data==1){
|
|
$('#tstext').text('整本替换成功');
|
|
}else{
|
|
$('#tstext').text('替换失败');
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
</script>
|
|
|
|
{/block} |