zoukankan      html  css  js  c++  java
  • It运维项目整理

    String.prototype.toWeek=function(){
    var date = new Date(this);
    var week = "";
    switch (date.getDay()) {
    case 0:week = "周日";break;
    case 1:week = "周一";break;
    case 2:week = "周二";break;
    case 3:week = "周三";break;
    case 4:week = "周四";break;
    case 5:week = "周五";break;
    case 6:week = "周六";break;
    }
    return week;
    };


    上传图片用的是 webuploader.js
    function webUpload(obj,fn) {
    var width=100;
    var height=85;
    var uploader = WebUploader.create({
    swf: './Uploader.swf',
    server: "/itsm/a/file/upload",
    pick: {id:obj.pickId},
    });
    uploader.on('fileQueued', function (file) {
    uploader.md5File(file)
    .progress(function (percentage) {
    console.log('Percentage:', percentage);
    })
    .then(function (val) {
    uploader.options.formData.fileMd5 = val;
    uploader.options.formData.fileName = file.name;
    uploader.options.formData.__sid = getQueryParam('sessionid');
    uploader.options.formData.uploadType="all";
    uploader.options.formData.bizType=obj.bizType;
    uploader.options.formData.bizKey=obj.bizKey;
    console.log(" uploader.options.formData:", uploader.options.formData);
    uploader.upload()
    });
    uploader.makeThumb(file, function (error, src) {
    if (error) {
    console.log("不能预览")
    return;
    }
    var img=new Image();
    img.width=width;
    img.height=height;
    img.src=src
    $(obj.pickId+" .webuploader-pick").html(img);
    }, width, height);
    });
    uploader.on('uploadSuccess', function (file,response ) {
    if(response.result=="true"){
    $(obj.pickId+" .webuploader-pick").addClass("webuploader-pick-success")
    }else{
    $(obj.pickId+" .webuploader-pick").addClass("webuploader-pick-error")
    }
    console.log("上传成功返回值:",JSON.stringify(response))
    fn.call(null,response)
    });
    uploader.on('uploadError', function (file) {
    $(obj.pickId+" .webuploader-pick").addClass("webuploader-pick-error")
    console.log("上传失败")
    });
    }

    function webUploadVoice(obj,fn) {
    var width=100;
    var height=85;
    var uploader = WebUploader.create({
    swf: './js/Uploader.swf',
    server: "/itsm/a/file/upload",
    pick: {id:obj.pickId},
    accept: {
    mimeTypes: 'audio/*'
    }
    });
    setTimeout(function(){
    $(".webuploader-element-invisible").attr("capture","microphone")
    $(".webuploader-element-invisible").removeAttr("multiple")
    })
    uploader.on('fileQueued', function (file) {
    uploader.md5File(file)
    .progress(function (percentage) {
    console.log('Percentage:', percentage);
    })
    .then(function (val) {
    uploader.options.formData.fileMd5 = val;
    uploader.options.formData.fileName = file.name;
    uploader.options.formData.__sid = getQueryParam('sessionid');
    uploader.options.formData.uploadType="all";
    uploader.options.formData.bizType=obj.bizType;
    uploader.options.formData.bizKey=obj.bizKey;
    console.log(" uploader.options.formData:", uploader.options.formData);
    uploader.upload()
    });
    uploader.makeThumb(file, function (error, src) {
    if (error) {
    console.log("不能预览")
    return;
    }
    var img=new Image();
    img.width=width;
    img.height=height;
    img.src=src
    $(obj.pickId+" .webuploader-pick").html(img);
    }, width, height);
    });
    uploader.on('uploadSuccess', function (file,response ) {
    if(response.result=="true"){
    $(obj.pickId+" .webuploader-pick").addClass("webuploader-pick-success")
    }else{
    $(obj.pickId+" .webuploader-pick").addClass("webuploader-pick-error")
    }

    console.log("上传成功返回值:",JSON.stringify(response))
    fn.call(null,response)
    });
    uploader.on('uploadError', function (file) {
    $(obj.pickId+" .webuploader-pick").addClass("webuploader-pick-error")
    console.log("上传失败")
    });
    }



    动态插入js
    document.write(" <script language="javascript" src="js/vconsole.min.js " > </script>");
    document.write(" <script>var aa=new VConsole()</script>");
  • 相关阅读:
    MySQL<事务与存储过程>
    MySQL<多表操作>
    MySQL<表单&集合查询>
    统计 fastq 文件 q20 , GC 含量的软件
    C语言插入排序
    samtools flags 的含义
    vsearch 去除重复序列和singleton 序列
    Fastqc 能够识别的碱基编码格式
    Fastqc 碱基质量分布图
    利用kseq.h parse fasta/fastq 文件
  • 原文地址:https://www.cnblogs.com/liuhao-web/p/10007621.html
Copyright © 2011-2022 走看看