GithubHelp home page GithubHelp logo

cmui / gearbox Goto Github PK

View Code? Open in Web Editor NEW
16.0 4.0 2.0 125 KB

Lightweight JavaScript utilities for web development, based on `_` and `$`.

License: MIT License

JavaScript 93.10% HTML 6.90%
library utility javascript lightweight-javascript-utilities ua string template mobile-web event cmui

gearbox's Introduction

Gearbox

Lightweight JavaScript utilities for web development, based on _ (Underscore) and $ (jQuery/Zepto).

为 Web 开发打造的轻量级 Javascript 工具库,基于 _(Underscore)和 $(jQuery/Zepto)。

兼容性

浏览器支持

  • 支持以下移动平台的主流浏览器:

    • iOS 7+
    • Android 4+
  • 同样支持以下桌面浏览器:

    • Firefox (Latest)
    • Chrome (Latest)
    • Safari (Latest)
    • IE 8+(需要 jQuery 1.x)

外部依赖

  • _(Underscore 1.6+)
  • $(Zepto 1.1+ 或 jQuery)

安装

  1. 通过 npm 3 安装:

    $ npm install cmui-gearbox
  2. 在页面中加载 Gearbox 以及必要的依赖:

    <script src="node_modules/underscore/underscore-min.js"></script>
    <script src="node_modules/zepto.js/dist/zepto.min.js"></script>
    <script src="node_modules/cmui-gearbox/dist/gearbox.min.js"></script>

API 文档

所有文档入口在 Wiki 页面,快去看吧!

谁在用?

移动 UI 框架 CMUI 采用 Gearbox 作为全局的工具库,因此所有 CMUI 用户都在使用它:

  • 百姓网 - 手机版
  • 优e网 - 手机版 (m.uemall.com)(已下线)
  • 薇姿官方电子商城 - 手机版 (m.vichy.com.cn)(已改版)

以下桌面网站也在用 Gearbox:


参与开发

功能模块

Gearbox 的部分功能模块已经分离出去,成为独立项目。这些模块以开发依赖的方式引入,并打包到发布文件中。因此,参与这些独立项目的开发即可修改这些模块。

构建

  1. 把本项目的代码 fork 并 clone 到本地。
  2. 在项目根目录执行 npm install,安装必要的依赖。
  3. 在项目根目录执行 npm run dist,运行构建脚本。
  4. 构建生成的发布文件将存放在 /dist 目录下。

单元测试

  1. 把本项目的代码 fork 并 clone 到本地。
  2. 在项目根目录执行 bower install,安装必要的依赖。
  3. 在浏览器中打开以下文件即可运行单元测试:
    • test/test-dev.html - 测试源码(用于开发阶段的测试)
    • test/test-dist-trad.html - 测试发布文件(用于测试 Zepto 的兼容性)
    • test/test-dist-trad-jquery.html - 测试发布文件(用于测试 jQuery 的兼容性)

License

MIT License

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.