├── .gitattributes
├── .gitignore
├── .nojekyll
├── LICENSE.md
├── README.md
├── build.cmd
├── changelog
└── index.html
├── debug.js
├── demos
├── animation
│ └── index.html
├── dom
│ └── index.html
├── event
│ └── index.html
├── index.html
├── navigator
│ └── index.html
├── request
│ ├── data.txt
│ ├── data.xml
│ └── index.html
└── storage
│ ├── another_path
│ └── index.html
│ └── index.html
├── dev.js
├── docs
├── api.html
├── colors.html
├── events.html
├── index.html
└── selectors.html
├── download
└── index.html
├── guide
└── index.html
├── images
├── close.png
├── comment.png
├── folder.png
├── github.png
├── link.gif
├── logger.png
└── logo.png
├── index.html
├── intro
└── index.html
├── jsdoc.cmd
├── log.txt
├── our.js
├── scripts
├── api.js
├── api_data.js
├── api_list.js
├── common.js
├── common_loader.js
├── prettify.js
├── publish.js
├── widget-demoarea.html
├── widget-demoarea.js
├── widget-demobutton.js
├── widget-logger.js
├── widgets.js
└── widgets_loader.js
├── src
├── animation.js
├── browser.js
├── dom.js
├── integrated
│ ├── json2.js
│ └── sizzle.js
├── jseventmodule.js
├── lang.js
├── request.js
└── widget.js
├── stylesheets
├── api.css
├── common.css
├── prettify.css
├── reset.css
└── widgets.css
├── tests
├── Math.randomRange.html
├── Object.clone.html
├── Object.toQueryString.html
├── Overlay.html
├── String.prorotype.camelize.html
├── _beforeunload.html
├── _colors.html
├── _countdown.html
├── _firebug.html
├── _iFrameAutoResize-iframe.html
├── _iFrameAutoResize.html
├── _include-1.html
├── _include-2.html
├── _include.html
├── _include.js
├── _showHint.html
├── _smcp.html
├── _smcp.txt
├── createElement.css
├── createElement.html
├── createElement.js
├── document.addStyleRules.html
├── document.preloadImages.html
├── dom_features.html
├── dom_test.html
├── domready-frame-frame.html
├── domready-frame.html
├── domready.html
├── event_types.html
├── freezeInteractionArea.html
├── getClientRect.html
├── getEventAttributes.html
├── htmlunknownelement.html
├── ie6_memory_leak.html
├── ie6_png-iframe.html
├── ie6_png.html
├── ie6_png.png
├── jQuery.html
├── toInteger.html
├── typeOf.html
└── viewport.html
├── utilities
├── DD_belatedPNG.js
├── adapter-highcharts.js
├── console.js
└── swf.js
└── widgets
├── autocue.js
├── autocue
├── index.html
├── message_queue
│ ├── add.html
│ └── add_more.html
├── multiple_messages
│ ├── index.html
│ └── messages.txt
└── scrolling
│ ├── down.html
│ └── up.html
├── calendar.js
├── calendar
├── custom_styles
│ └── index.html
├── first_day
│ └── index.html
├── index.html
└── month
│ └── index.html
├── carousel.js
├── carousel
├── index.html
└── scrolling
│ ├── auto_view.html
│ ├── bg.png
│ ├── btn.png
│ └── quick_view.html
├── datepicker.js
├── datepicker
├── date_range
│ ├── automatically.html
│ ├── datepicker.png
│ ├── limit.html
│ └── no_limit.html
└── index.html
├── dialog.js
├── dialog
├── animation
│ └── slide.html
├── grouping
│ └── index.html
├── index.html
├── overlay
│ ├── parent_is_body.html
│ └── parent_is_not_body.html
├── positioning
│ ├── offset_specified.html
│ ├── pinned_target_is_body.html
│ ├── pinned_target_is_not_body.html
│ └── repositon.html
└── upgrade
│ ├── close.png
│ ├── content.html
│ ├── dialog-x.js
│ ├── index.html
│ └── title.png
├── index.html
├── paginator.js
├── paginator
├── dynamic
│ ├── index.html
│ └── remote_data.txt
├── index.html
├── links
│ └── index.html
└── static
│ └── index.html
├── photowall.js
├── photowall
├── index.html
└── scrolling
│ ├── active_photo.html
│ ├── auto_loop.html
│ └── static.html
├── scrollbox.js
├── scrollbox
├── content_size
│ └── index.html
├── index.html
├── scrollbar_min_height
│ ├── index.html
│ ├── scrollbar.png
│ └── track.png
└── update
│ └── index.html
├── slideshow.js
├── slideshow
├── animation
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ ├── 4.jpg
│ ├── 5.jpg
│ ├── 6.jpg
│ ├── 7.jpg
│ ├── pointer.png
│ ├── slide.html
│ ├── thumbnail_1.jpg
│ ├── thumbnail_2.jpg
│ ├── thumbnail_3.jpg
│ ├── thumbnail_4.jpg
│ ├── thumbnail_5.jpg
│ ├── thumbnail_6.jpg
│ └── thumbnail_7.jpg
├── customizing
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ ├── 4.jpg
│ ├── 5.jpg
│ ├── buttons.png
│ └── index.html
├── index.html
└── show
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ ├── auto.html
│ ├── by_click.html
│ ├── by_hover.html
│ ├── by_script.html
│ └── single.html
├── tabpanel.js
├── tabpanel
├── activate
│ ├── by_click.html
│ ├── by_hover.html
│ └── by_script.html
├── index.html
└── nested
│ └── index.html
├── validator.js
└── validator
├── custom
└── index.html
├── events
├── index.html
└── remote.txt
├── index.html
└── rules
├── add_client.html
├── add_remote.html
├── captcha.png
├── captcha.txt
├── correct.png
├── error.png
├── info.png
└── remove.html
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 |
--------------------------------------------------------------------------------
/.nojekyll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s79/OurJS/837281e29856b35a4f6fd4e6cd42822e7ba290aa/.nojekyll
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License
2 | ===============
3 |
4 | Copyright (c) 2012 [s79](https://github.com/s79)
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # OurJS #
2 |
3 | OurJS 是一个适用于 WEB 开发的 JavaScript 框架,它提供了覆盖面广、细节完善的功能,并能让开发者使用可预期的 API,写出具备良好的兼容性、可读性和扩展性的代码。
4 |
5 | > 完全兼容 PC 端的 IE6+、Firefox、Chrome、Safari、Opera 以及其他使用 Trident 和 WebKit 内核的浏览器。
6 |
7 | *[更多内容请参考 OurJS 简介/演示/文档](http://s79.github.com/OurJS/)*
8 |
9 |
10 | ## 特点 ##
11 |
12 | * **化繁为简** —— 以简单直接的方式,提供易于理解和使用的功能。
13 | * **功能完善** —— 提供的功能覆盖面广、细节完善,可以满足 WEB 开发中的绝大多数需求。
14 | * **风格一致** —— 提供的 API 与原生 JS 和 DOM 的语法习惯一致,便于理解和记忆。
15 | * **易于扩展** —— 不论是要扩展框架本身,还是扩展应用,OurJS 均提供了简易的方式。
16 |
17 |
18 | ## 要求和限制 ##
19 |
20 | OurJS 要求浏览器运行在“标准模式”下。
21 |
22 | OurJS 不能和其他对原型进行了扩展的框架或类库共存。
23 |
24 |
25 | ## 文件列表 ##
26 |
27 | `our.js` 中包含以下列出的所有文件:
28 |
29 |
30 |
31 | 描述 | 文件名 |
32 |
33 |
34 | Integrated | src/integrated/sizzle.js src/integrated/json2.js |
35 |
36 |
37 | Widget | src/widget.js |
38 |
39 |
40 | Request | src/request.js |
41 |
42 |
43 | Animation | src/animation.js |
44 |
45 |
46 | JS Event Module | src/jseventmodule.js |
47 |
48 |
49 | DOM API Enhancements | src/dom.js |
50 |
51 |
52 | Browser API Enhancements | src/browser.js |
53 |
54 |
55 | JS API Enhancements | src/lang.js |
56 |
57 |
58 |
59 | 以下文件均为可选的附加项:
60 |
61 |
62 |
63 | Widgets | widgets/*.js |
64 |
65 |
66 | Utilities | utilities/*.js |
67 |
68 |
69 |
70 |
71 | ## 许可 ##
72 |
73 | OurJS 基于 MIT 许可协议发布,关于此协议的细节请查看 `LICENSE.md`。
74 |
--------------------------------------------------------------------------------
/build.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | set debug=..\debug.js
3 | set our=..\our.js
4 | cd src
5 | echo /*!>%debug%
6 | echo. * OurJS>>%debug%
7 | echo. * sundongguo>>%debug%
8 | echo. * http://s79.github.com/OurJS/>>%debug%
9 | echo. * %date%>>%debug%
10 | echo. * Released under the MIT License.>>%debug%
11 | echo. */>>%debug%
12 | copy/y/b %debug% + lang.js + browser.js + dom.js + jseventmodule.js + animation.js + request.js + widget.js + integrated\json2.js + integrated\sizzle.js %debug%
13 | set yuicompressor_path=D:\SkyDrive\ProgramFiles\JSFileCompressor\yuicompressor-2.4.7\build
14 | java -jar %yuicompressor_path%\yuicompressor-2.4.7.jar %debug% -o %our% --charset UTF-8
15 | pause
16 |
--------------------------------------------------------------------------------
/changelog/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 更新日志
6 |
7 |
8 |
9 |
10 |
11 |
更新日志
12 |
13 |
2013-12-03
14 |
增加 Widget.parseAs 方法
15 |
使用此方法代替以前的内部方法 Widget.parsers.parse,Widget.parsers 属性现在不存在了。
16 |
17 |
2013-10-24
18 |
修改 String.prorotype.camelize 的转换方式
19 |
20 |
2013-10-17
21 |
修复 jsEventTarget.on 方法解析带括号的选择符出错的 bug
22 |
现在可以正常的使用如 click:relay(tr:not(:nth-child(2))>td:nth-child(even))
的选择符了。
23 |
修复 Request 的 start 事件触发时 ongoing 未更新的 bug
24 |
25 |
2013-08-19
26 |
简化 widget-validator 的设计使其更灵活
27 |
不再支持内置的类型判断,这样可以简化使用方式,并可以更灵活的进行验证。
28 |
29 |
2013-07-24
30 |
将 Request 的 useCache 和 async 选项修改为相反的含义
31 |
useCache 修改为 noCache,async 修改为 sync,当省略这些选项时,将直接取 false 值。
32 |
33 |
2013-07-11
34 |
注册 Widget 时 selector 的格式限制为 <nodeName>.<className>
35 |
使代码可以在 Strict Mode 正常运行
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/demos/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | OurJS
6 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/demos/navigator/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 浏览器信息
6 |
7 |
8 |
9 |
11 |
12 |
13 |
14 |
浏览器信息
15 |
16 |
在 navigator 上扩展的属性
17 |
18 |
22 |
26 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/demos/request/data.txt:
--------------------------------------------------------------------------------
1 | {"result": "ok"}
2 |
--------------------------------------------------------------------------------
/demos/request/data.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 成功
5 |
6 |
7 | Success
8 |
9 |
10 |
--------------------------------------------------------------------------------
/demos/storage/another_path/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | localStorage
6 |
7 |
8 |
9 |
17 |
18 |
19 |
20 |
21 |
这是另一个路径下的页面(IE6 IE7 可跨路径)
22 |
42 |
62 |
76 |
82 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/dev.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @fileOverview OurJS 开发版
3 | * @author sundongguo@gmail.com
4 | * @version 20120213
5 | */
6 |
7 | (function() {
8 | var ourjs = [
9 | 'src/lang.js',
10 | 'src/browser.js',
11 | 'src/dom.js',
12 | 'src/jseventmodule.js',
13 | 'src/animation.js',
14 | 'src/request.js',
15 | 'src/widget.js',
16 | 'src/integrated/json2.js',
17 | 'src/integrated/sizzle.js'
18 | ];
19 | if (document.documentElement.currentStyle && !document.documentElement.currentStyle.minWidth) {
20 | ourjs.push('utilities/console.js');
21 | }
22 | var path = function() {
23 | var scripts = document.getElementsByTagName('script');
24 | var i = 0;
25 | var script;
26 | var index;
27 | while (script = scripts[i++]) {
28 | index = script.src.indexOf('dev.js');
29 | if (index > -1) {
30 | return script.src.slice(0, index);
31 | }
32 | }
33 | return '';
34 | }();
35 | var file;
36 | while (file = ourjs.shift()) {
37 | document.writeln('');
38 | }
39 | })();
40 |
--------------------------------------------------------------------------------
/docs/api.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | OurJS API Reference
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
API 参考
19 |
20 |
21 | - 构造函数
22 | - 静态属性/方法
23 | - 实例属性/方法
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | OurJS
6 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/download/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 下载 OurJS
6 |
7 |
8 |
11 |
12 |
13 |
14 |
下载
15 |
16 |
OurJS
17 |
OurJS 的所有基本功能均被打包到一个文件 our.js 中:
18 |
21 |
22 |
23 |
24 |
25 |
26 |
Widgets
27 |
Widgets 提供了常见的功能,能够简化开发,请根据情况选用:
28 |
41 |
42 |
实用工具
43 |
这些工具并没有集成到 OurJS 中,可以根据情况选用:
44 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/images/close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s79/OurJS/837281e29856b35a4f6fd4e6cd42822e7ba290aa/images/close.png
--------------------------------------------------------------------------------
/images/comment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s79/OurJS/837281e29856b35a4f6fd4e6cd42822e7ba290aa/images/comment.png
--------------------------------------------------------------------------------
/images/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s79/OurJS/837281e29856b35a4f6fd4e6cd42822e7ba290aa/images/folder.png
--------------------------------------------------------------------------------
/images/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s79/OurJS/837281e29856b35a4f6fd4e6cd42822e7ba290aa/images/github.png
--------------------------------------------------------------------------------
/images/link.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s79/OurJS/837281e29856b35a4f6fd4e6cd42822e7ba290aa/images/link.gif
--------------------------------------------------------------------------------
/images/logger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s79/OurJS/837281e29856b35a4f6fd4e6cd42822e7ba290aa/images/logger.png
--------------------------------------------------------------------------------
/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s79/OurJS/837281e29856b35a4f6fd4e6cd42822e7ba290aa/images/logo.png
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | OurJS
6 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/jsdoc.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | set jsdoc_path=D:\SkyDrive\ProgramFiles\JSDocToolkit
3 | java -jar %jsdoc_path%\jsrun.jar %jsdoc_path%\app\run.js src src\integrated -s -n -d=scripts -t=scripts
4 | pause
5 |
--------------------------------------------------------------------------------
/scripts/common_loader.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | var pathPrefix = location.pathname.indexOf('OurJS') === 1 ? '/OurJS' : '';
3 | document.writeln('');
4 | document.writeln('');
5 | })();
6 |
--------------------------------------------------------------------------------
/scripts/widget-demoarea.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | DEMO
6 |
7 |
8 |
9 |
10 |
14 |
15 |
16 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/scripts/widget-demobutton.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @fileOverview Widget - 演示按钮
3 | * @author sundongguo@gmail.com
4 | * @version 20130418
5 | */
6 |
7 | (function() {
8 | //==================================================[Widget - 演示按钮]
9 | //--------------------------------------------------[ExecuteCode]
10 | // 在页面内所有的 domready 监听器被调用之后才启用点击“演示按钮”执行代码的功能。
11 | document.on('afterdomready:once.demobutton', function() {
12 | document.$('body').on('click:relay(button.widget-demobutton).demobutton', function() {
13 | if (!this.disabled) {
14 | eval(this.code || this.innerText);
15 | }
16 | });
17 | });
18 |
19 | //--------------------------------------------------[DemoButton]
20 | /**
21 | * 演示按钮。
22 | * @name DemoButton
23 | * @constructor
24 | * @description 启用方式
25 | * 为一个 BUTTON 元素添加 'widget-demobutton' 类,即可使该元素成为“演示按钮”。
26 | * @description 新增行为
27 | * 当点击一个“演示按钮”时,该按钮内的文本(或该按钮的 data-code 属性中的文本)将被作为 JS 代码被执行,执行时的作用域为全局作用域。
28 | * @description 可配置项
29 | * data-code
30 | * 点击该按钮后执行的代码。
31 | * 如果不指定本属性,则点击该按钮时,以该按钮内的文本作为代码执行。
32 | */
33 |
34 | var styleRules = [
35 | 'button.widget-demobutton { margin: 1px 0; padding: 6px 12px; overflow: visible; border: none; background: #323232; color: gainsboro; font: bold 14px/14px Verdana, Helvetica, Arial, "Microsoft YaHei", SimSun, sans-serif; text-align: left; }',
36 | 'button.widget-demobutton:hover { background: black; }',
37 | 'button.widget-demobutton:active { color: white; }',
38 | 'button.widget-demobutton code { font-weight: normal; font-family: Consolas, "Lucida Console", Courier, "Microsoft YaHei", SimSun, monospace; }',
39 | 'button.widget-demobutton strong { color: #64D5EB; }',
40 | 'button.widget-demobutton em { color: #A4C639; font-style: italic; }',
41 | 'button.widget-demobutton var { color: #FF6767; font-style: normal; }',
42 | 'button.widget-demobutton[disabled], button.widget-demobutton[disabled]:hover, button.widget-demobutton[disabled]:active { color: gray; background: #323232; }'
43 | ];
44 | if (navigator.isIE6) {
45 | styleRules.pop();
46 | }
47 | Widget.register({
48 | type: 'demobutton',
49 | selector: 'button.widget-demobutton',
50 | styleRules: styleRules,
51 | config: {
52 | code: ''
53 | },
54 | initialize: function() {
55 | this.setAttribute('type', 'button');
56 | }
57 | });
58 |
59 | })();
60 |
--------------------------------------------------------------------------------
/scripts/widgets_loader.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | var pathPrefix = location.pathname.indexOf('OurJS') === 1 ? '/OurJS' : '';
3 | document.writeln('');
4 | document.writeln('');
5 | document.writeln('');
6 | document.writeln('');
7 | document.writeln('');
8 | document.writeln('');
9 | document.writeln('');
10 | document.writeln('');
11 | })();
12 |
--------------------------------------------------------------------------------
/stylesheets/prettify.css:
--------------------------------------------------------------------------------
1 | /* Pretty printing styles. Used with prettify.js. */
2 |
3 | /* SPAN elements with the classes below are added by prettyprint. */
4 | .pln { color: #000 } /* plain text */
5 |
6 | @media screen {
7 | .str { color: #C41A16 } /* string content */
8 | .kwd { color: #AA0D91 } /* a keyword */
9 | .com { color: #007400 } /* a comment */
10 | .typ { font-style: italic; font-weight: bold } /* a type name */
11 | .lit { color: #1C00CF } /* a literal value */
12 | /* punctuation, lisp open bracket, lisp close bracket */
13 | .pun, .opn, .clo { color: #666 }
14 | .tag { color: #008 } /* a markup tag name */
15 | .atn { color: #606 } /* a markup attribute name */
16 | .atv { color: #080 } /* a markup attribute value */
17 | .dec, .var { color: #606 } /* a declaration; a variable name */
18 | .fun { color: red } /* a function name */
19 | }
20 |
21 | /* Use higher contrast and text-weight for printable form. */
22 | @media print, projection {
23 | .str { color: #060 }
24 | .kwd { color: #006; font-weight: bold }
25 | .com { color: #600; font-style: italic }
26 | .typ { color: #404; font-weight: bold }
27 | .lit { color: #044 }
28 | .pun, .opn, .clo { color: #440 }
29 | .tag { color: #006; font-weight: bold }
30 | .atn { color: #404 }
31 | .atv { color: #060 }
32 | }
33 |
34 | /* Put a border around prettyprinted code snippets. */
35 | /* pre.prettyprint { padding: 2px; border: 1px solid #888 } */
36 |
37 | /* Specify class=linenums on a pre to get line numbering */
38 | ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
39 | li.L0,
40 | li.L1,
41 | li.L2,
42 | li.L3,
43 | li.L5,
44 | li.L6,
45 | li.L7,
46 | li.L8 { list-style-type: none }
47 | /* Alternate shading for lines */
48 | li.L1,
49 | li.L3,
50 | li.L5,
51 | li.L7,
52 | li.L9 { background: #eee }
53 |
--------------------------------------------------------------------------------
/stylesheets/reset.css:
--------------------------------------------------------------------------------
1 | /* --------------------------------------------------[Reset] */
2 | body, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, p, blockquote, pre, form, fieldset, legend, button, input, textarea, th, td { margin: 0; padding: 0; }
3 | ul, ol { list-style: outside none; }
4 | fieldset, img { border: 0; }
5 | table { border-collapse: collapse; border-spacing: 0; }
6 | body, small, sup, sub, button, input, textarea, select { font: 12px/1 Arial, Helvetica, Verdana, SimSun, sans-serif; }
7 | body { line-height: 1.5; }
8 | h1, h2, h3, h4, h5, h6 { font-size: 100%; }
9 | address, cite, dfn, em, var { font-style: normal; }
10 | code, kbd, pre, samp { font-family: Consolas, "Lucida Console", Courier, SimSun, monospace; }
11 | sup, sub { position: relative; vertical-align: baseline; }
12 | sup { top: -3px; }
13 | sub { bottom: -3px; }
14 | button { padding: 5px 10px; overflow: visible; }
15 |
--------------------------------------------------------------------------------
/stylesheets/widgets.css:
--------------------------------------------------------------------------------
1 | /* --------------------------------------------------[Widgets] */
2 | h4 { margin: 15px 0 0; }
3 |
4 | #api { margin-top: 50px; }
5 | #api li { margin: 10px 0; }
6 | #api table { width: 932px; border-collapse: collapse; }
7 | #api table tr:nth-child(even) { background: whitesmoke; }
8 | #api table th { background: gainsboro; }
9 | #api table th,
10 | #api table td { border: 0 none; vertical-align: top; }
11 | #api table td:last-child { width: 100%; }
12 | #api kbd,
13 | #api samp { font-style: italic; font-family: Verdana, Helvetica, Arial, "Microsoft YaHei", SimSun, sans-serif; white-space: nowrap; }
14 | #api kbd { color: #666; font-weight: normal; }
15 | #api samp { color: gray; }
16 | #api dfn { color: steelblue; white-space: nowrap; }
17 | #api var { color: sienna; font-style: italic; }
18 | #api var em { margin-left: 5px; padding: 0 2px; border-radius: 5px 0; background: gold; color: maroon; font: italic 12px Arial; }
19 | #api table kbd,
20 | #api table samp,
21 | #api table dfn,
22 | #api table var { display: inline-block; margin: 10px 0; }
23 | #api table p dfn,
24 | #api table p var,
25 | #api table table dfn,
26 | #api table table var { display: inline; margin: 0; }
27 | #api table table { width: auto; margin-left: 0; }
28 | #api table table th,
29 | #api table table td { padding: 2px 5px; border: 1px solid silver; }
30 | #api .list { overflow: hidden; }
31 | #api .list div { margin-bottom: -1px; padding: 0 0 10px; border-bottom: 1px solid gainsboro; -border-bottom-width: 0; }
32 |
33 | #api .list .anchor { color: #666; font-weight: bold; font-size: 16px; }
34 | #api .list .anchor kbd { padding-right: 5px; }
35 |
--------------------------------------------------------------------------------
/tests/Math.randomRange.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Math.randomRange
6 |
7 |
19 |
20 |
21 |
71 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/tests/Object.clone.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Object.clone
6 |
7 |
8 |
12 |
13 |
14 |
15 |
16 |
17 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/tests/Object.toQueryString.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Object.toQueryString
6 |
7 |
8 |
11 |
12 |
13 |
14 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/tests/String.prorotype.camelize.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | String.prorotype.camelize
6 |
7 |
8 |
11 |
12 |
13 |
14 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/tests/_beforeunload.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | beforeunload
6 |
7 |
8 |
9 |
10 | 点击伪协议的超链接在 IE6 IE7 IE8 IE9 中也会触发 beforeunload 事件
11 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/tests/_colors.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | colors
6 |
7 |
11 |
12 |
13 | Colors
14 |
15 | orangered
16 | tomato
17 | greenyellow
18 | yellowgreen
19 | cornflowerblue
20 | steelblue
21 | springgreen
22 | mediumseagreen
23 | orchid
24 | mediumorchid
25 | gold
26 | goldenrod
27 | whitesmoke
28 | gainsboro
29 | silver
30 | darkgray
31 | gray
32 | dimgray
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/tests/_countdown.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Countdown
6 |
7 |
12 |
13 |
14 |
15 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/tests/_firebug.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | console-ie6_firebug
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/tests/_iFrameAutoResize-iframe.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | iFrameAutoResize
6 |
11 |
12 |
13 |
17 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/tests/_iFrameAutoResize.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | iFrameAutoResize
6 |
11 |
12 |
13 |
14 |
15 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/tests/_include-1.html:
--------------------------------------------------------------------------------
1 |
2 | - 列表一
3 | - 列表二
4 | - 列表三
5 |
6 |
9 |
12 |
--------------------------------------------------------------------------------
/tests/_include-2.html:
--------------------------------------------------------------------------------
1 |
2 | - 另一个模版
3 | -
4 | 模版还可以嵌套
5 | 模版一
6 |
7 |
8 |
--------------------------------------------------------------------------------
/tests/_include.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | include
6 |
7 |
8 |
9 | include
10 | 模版一
11 | 模版二
12 |
13 | END
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/tests/_include.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 使用 注释信息 引入模版文件。
3 | * 注意避免模版文件之间的循环引用。
4 | * 另外模版文件中不能有脚本调用 document.write 方法,也不应该监听 document 的 domready 事件。
5 | */
6 | document.on('beforedomready', function() {
7 | function include(target) {
8 | var $target = $(target);
9 | new Request($target.getData('src'), {noCache: true, sync: true})
10 | .on('finish', function(e) {
11 | var scripts = [];
12 | var text = e.text.replace(/(?:
7 |
8 |
9 |
38 |
39 |