资源简介

Bootstrap+BootstrapTable+x-editable(css和js)整合包 内含 jq,js Bootstrap+BootstrapTable+x-editable内部的js 和css文件,一个整合包满足你的所有需求

资源截图

代码片段和文件信息

#!/usr/bin/python2

# Minify tableExport.jquery.plugin file(s)
# using Simon Georget‘s python script to minify javascript files
# https://github.com/simogeo/Filemanager/blob/master/utils/minify.py
# Usage : $ python ./tools/minify.py

class bcolors:
    HEADER = ‘\033[95m‘
    OKBLUE = ‘\033[94m‘
    OKGREEN = ‘\033[92m‘
    WARNING = ‘\033[93m‘
    FAIL = ‘\033[91m‘
    ENDC = ‘\033[0m‘

    def disable(self):
        self.HEADER = ‘‘
        self.OKBLUE = ‘‘
        self.OKGREEN = ‘‘
        self.WARNING = ‘‘
        self.FAIL = ‘‘
        self.ENDC = ‘‘

import httplib urllib sys os


fmRootFolder = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) + “/“

os.chdir(fmRootFolder) # set working directory

toMinify = [“tableExport.js“]

print bcolors.HEADER + “-------------------------------------“ + bcolors.ENDC

# we loop on JS languages files
for index item in enumerate(toMinify):
  # print index item
  
  dir = os.path.dirname(item)
  file = os.path.basename(item)
  
  with open (fmRootFolder + item “r“) as myfile:
          js_input=myfile.read()

          # Define the parameters for the POST request and encode them in
          # a URL-safe format.

          params = urllib.urlencode([
          (‘js_code‘ js_input)
          #   (‘compilation_level‘ ‘WHITESPACE_ONLY‘)
          (‘compilation_level‘ ‘SIMPLE_OPTIMIZATIONS‘)
          (‘output_format‘ ‘text‘)
          (‘output_info‘ ‘compiled_code‘)
          ])

          params2 = urllib.urlencode([
          (‘js_code‘ js_input)
          #   (‘compilation_level‘ ‘WHITESPACE_ONLY‘)
          (‘compilation_level‘ ‘SIMPLE_OPTIMIZATIONS‘)
          (‘output_format‘ ‘text‘)
          (‘output_info‘ ‘errors‘)
          ])

          # 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‘ ‘/compile‘ params headers)
          response = conn.getresponse()
          data = response.read()

          # we write the minified file - os.path.splitext(file)[0]  return filename without extension
          with open(fmRootFolder + dir + ‘/‘ + os.path.splitext(file)[0] + “.min.js“ “w“) as text_file:
                  text_file.write(data)

          # We retrieve errors
          conn.request(‘POST‘ ‘/compile‘ params2 headers)
          response = conn.getresponse()
          errors = response.read()

          
          if errors == ““:
                    print bcolors.OKBLUE + file + “ has been minified. No error found.“
          else:
                    print bcolors.FAIL + file + “ : the code contains errors : “
                    print ““
                    print errors + bcolors.ENDC

          conn.close()

print bcolors.HEADER + “-------------------------------------“ + bcolors.ENDC

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-02-06 15:34  img\
     目录           0  2018-02-06 15:53  js\
     目录           0  2018-02-06 15:34  js\bootstrap_above\
     目录           0  2018-02-06 15:34  js\bootstrap_above\bootstrap\
     目录           0  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\
     目录           0  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\.github\
     文件         705  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\.github\ISSUE_TEMPLATE.md
     文件         334  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\.gitignore
     文件          89  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\.travis.yml
     文件         860  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\bootstrap-table.jquery.json
     文件         639  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\bower.json
     文件       18884  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\CHANGELOG.md
     文件         519  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\composer.json
     文件        9868  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\CONTRIBUTING.md
     目录           0  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\
     文件       58529  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\bootstrap-table-locale-all.js
     文件       33641  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\bootstrap-table-locale-all.min.js
     文件        7149  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\bootstrap-table.css
     文件      109621  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\bootstrap-table.js
     文件        5713  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\bootstrap-table.min.css
     文件       54644  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\bootstrap-table.min.js
     目录           0  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\extensions\
     目录           0  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\extensions\accent-neutralise\
     文件       11731  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\extensions\accent-neutralise\bootstrap-table-accent-neutralise.js
     文件        5660  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\extensions\accent-neutralise\bootstrap-table-accent-neutralise.min.js
     目录           0  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\extensions\angular\
     文件        4067  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\extensions\angular\bootstrap-table-angular.js
     文件        2122  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\extensions\angular\bootstrap-table-angular.min.js
     目录           0  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\extensions\auto-refresh\
     文件          46  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\extensions\auto-refresh\bootstrap-table-auto-refresh.css
     文件        2742  2018-02-06 15:34  js\bootstrap_above\bootstrap-table-develop\dist\extensions\auto-refresh\bootstrap-table-auto-refresh.js
............此处省略1205个文件信息

评论

共有 条评论