• 大小: 177KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-10
  • 语言: Html/CSS
  • 标签: 手写签名  

资源简介

jSignature 在网页上手写签名的插件(html5手写签名) 在IE7~IE8这种不支持HTML5的浏览器上,是利用Flash嵌入的方式实现的签名处理,在支持的HTML5的浏览器上默认采用canvas标签处理签名,可以生成 PNG格式、SVG格式的签名图片。非常适合在IPAD等移动客户端上实现手写签名的,该插件基于JQuery

资源截图

代码片段和文件信息

#! /usr/bin/env python
import subprocess

def default(context):
    minifyfiles(context)

def minifyfiles(context):
    src = context.Node(‘src/jSignature.js‘)

    distfolder = context.Node(‘libs/‘)
    pluginsfolder = context.Node(‘src/plugins/‘)

    # Compressing jSignature + some plugins into one mini
    minified = distfolder + src.name - ‘.js‘ + ‘.min.js‘
    print(“=== Compressing “ + src.name + “ into “ + minified.fullpath)
    minified.text = compress_with_closure_compiler(
        src.text.replace(
            “${buildDate}“ timeUTC()
        ).replace(
            “${commitID}“ getCommitIDstring()
        ) + \
        (pluginsfolder + ‘jSignature.UndoButton.js‘).text + \
        # context.Node(‘plugins/signhere/jSignature.SignHere.js‘).text + \
        (pluginsfolder + ‘jSignature.Compressorbase30.js‘).text + \
        (pluginsfolder + ‘jSignature.CompressorSVG.js‘).text
    )

    # wrapping that mini into “jQuery.NoConflict“ prefix + suffix
    # and hosting it as separate mini
    (minified - ‘.js‘ + ‘.noconflict.js‘).text = “;(function($){\n“ + minified.text + “\n})(jQuery);“

def timeUTC():
    import datetime
    return datetime.datetime.utcnow().strftime(“%Y-%m-%dT%H:%M“)

def getCommitIDstring():
    import subprocess

    if not subprocess.check_output:
        # let‘s not bother emulating it. Not important
        return ““
    else:
        return “commit ID “ + subprocess.check_output(
            [
                ‘git‘
                 ‘rev-parse‘
                 ‘HEAD‘
            ]
        ).strip()

def compress_with_closure_compiler(code compression_level = None):
    ‘‘‘Sends text of javascript code to Google‘s Closure Compiler API
    Returns text of compressed code.
    ‘‘‘
    # script (with some modifications) from 
    # https://developers.google.com/closure/compiler/docs/api-tutorial1

    import httplib urllib sys

    compression_levels = [
        ‘WHITESPACE_ONLY‘
         ‘SIMPLE_OPTIMIZATIONS‘
         ‘ADVANCED_OPTIMIZATIONS‘
    ]

    if compression_level not in compression_levels:
        compression_level = compression_levels[1] # simple optimizations

    # Define the parameters for the POST request and encode them in
    # a URL-safe format.
    params = urllib.urlencode([
        (‘js_code‘ code)
         (‘compilation_level‘ compression_level)
         (‘output_format‘ ‘json‘)
         (‘output_info‘ ‘compiled_code‘)
         (‘output_info‘ ‘warnings‘)
         (‘output_info‘ ‘errors‘)
         (‘output_info‘ ‘statistics‘)
        #  (‘output_file_name‘ ‘default.js‘)
        #  (‘js_externs‘ ‘javascript with externs‘) # only used on Advanced. 
      ])

    # Always use the following value for the Content-type header.
    headers = { “Content-type“: “application/x-www-form-urlencoded“ }
    conn = httplib.HTTPConnection(‘closure-compiler.appspot.com‘)
    conn.request(‘POST‘ ‘/compil

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-11-01 22:51  jSignature-master\
     文件         334  2012-11-01 22:51  jSignature-master\.gitignore
     文件       15507  2012-11-01 22:51  jSignature-master\README.md
     目录           0  2012-11-01 22:51  jSignature-master\examples\
     文件         806  2012-11-01 22:51  jSignature-master\examples\index.html
     文件        7299  2012-11-01 22:51  jSignature-master\examples\noconflict.html
     文件        7468  2012-11-01 22:51  jSignature-master\examples\unmini.html
     目录           0  2012-11-01 22:51  jSignature-master\extras\
     目录           0  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_PHP\
     目录           0  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_PHP\core\
     文件        5693  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_PHP\core\jSignature_Tools_base30.php
     文件        3387  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_PHP\core\jSignature_Tools_SVG.php
     目录           0  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_PHP\tests\
     文件        2982  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_PHP\tests\test.png
     文件         490  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_PHP\tests\test.svg
     文件        3522  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_PHP\tests\test_jSignature_Tools.php
     目录           0  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\
     文件        1463  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\SignatureDataConversion.sln
     文件         337  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\SignatureDataConversion_Debug.nunit
     目录           0  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\core\
     文件           8  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\core\.gitignore
     目录           0  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\core\Properties\
     文件        1472  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\core\Properties\AssemblyInfo.cs
     文件        2162  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\core\SignatureDataConversionCore.csproj
     文件        5050  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\core\converter_alphanum_base30.cs
     文件       12818  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\core\converter_toSVG.cs
     文件        2620  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\core\imagingtools_Stats.cs
     目录           0  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\tests\
     目录           0  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\tests\Properties\
     文件        1468  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\tests\Properties\AssemblyInfo.cs
     文件        2644  2012-11-01 22:51  jSignature-master\extras\SignatureDataConversion_dotNet\tests\SignatureDataConversionTests.csproj
............此处省略30个文件信息

评论

共有 条评论

相关资源