├── .node-version ├── .gitignore ├── assets ├── img │ ├── about.png │ ├── about@2x.png │ ├── diagram.png │ ├── loading.gif │ └── ui-terminology.png ├── app-icon │ ├── png │ │ ├── 16.png │ │ ├── 24.png │ │ ├── 32.png │ │ ├── 48.png │ │ ├── 64.png │ │ ├── 1024.png │ │ ├── 128.png │ │ ├── 256.png │ │ └── 512.png │ ├── mac │ │ └── app.icns │ └── win │ │ └── app.ico ├── jquery │ ├── img │ │ ├── new.gif │ │ ├── zfb.png │ │ └── favicon.ico │ ├── TOC-Created-By-Easy-CHM.HHC │ ├── jQuery.noop.html │ ├── event.type.html │ ├── event.currentTarget.html │ ├── jQuery.boxModel.html │ ├── jQuery.toArray.html │ ├── event.data.html │ ├── root.html │ ├── animated.html │ ├── empty.html │ ├── event.relatedTarget.html │ ├── ajaxStart.html │ ├── ajaxStop.html │ ├── size.html │ ├── deferred.isRejected.html │ ├── event.isDefaultPrevented.html │ ├── deferred.isResolved.html │ ├── length.html │ ├── deferred.progress.html │ ├── all.html │ ├── jQuery.trim.html │ ├── deferred.reject.html │ ├── enabled.html │ ├── jQuery.error.html │ ├── jQuery.browser.version.html │ ├── jQuery.isArray.html │ ├── jQuery.isPlainObject.html │ ├── deferred.resolve.html │ ├── disabled.html │ ├── lastOfType.html │ ├── jQuery.unique.html │ ├── ajaxSuccess.html │ ├── ajaxSend.html │ ├── firstOfType.html │ ├── innerWidth.html │ ├── innerHeight.html │ ├── visible.html │ ├── jQuery.isEmptyObject.html │ ├── jQuery.fx.off.html │ ├── last.html │ ├── last_1.html │ ├── empty_1.html │ ├── first.html │ ├── first_1.html │ ├── odd.html │ ├── clearQueue.html │ ├── context.html │ ├── parent_1.html │ ├── unwrap.html │ ├── header.html │ ├── onlyChild.html │ ├── selector.html │ ├── deferred.rejectWith.html │ ├── position.html │ ├── deferred.resolveWith.html │ ├── selected.html │ ├── jQuery.ajaxSetup.html │ ├── even.html │ ├── finish.html │ ├── jQuery.merge.html │ ├── removeData.html │ ├── element.html │ ├── jQuery.contains.html │ ├── jQuery.type.html │ ├── lang.html │ ├── not_1.html │ ├── removeAttr.html │ ├── deferred.notify.html │ ├── has_1.html │ ├── attributeHas.html │ ├── offsetParent.html │ ├── firstChild.html │ ├── jQuery.isWindow.html │ ├── lastChild.html │ ├── delay.html │ ├── jQuery.fx.interval.html │ ├── ajaxError.html │ ├── jQuery.parseJSON.html │ ├── eq_1.html │ ├── end.html │ ├── keyup.html │ ├── mouseup.html │ ├── target.html │ ├── callbacks.fired.html │ ├── contains.html │ ├── event.pageY.html │ ├── callbacks.disable.html │ ├── event.pageX.html │ ├── event.result.html │ ├── jquery.html │ └── deferred.always.html ├── tiles │ ├── SampleAppx.44x44.png │ ├── SampleAppx.50x50.png │ ├── SampleAppx.150x150.png │ └── SampleAppx.310x150.png ├── colorpicker │ ├── images │ │ ├── _bgs.png │ │ ├── _blank.cur │ │ ├── _blank.png │ │ ├── _icons.png │ │ ├── _patches.png │ │ ├── favicon.ico │ │ ├── _horizontal.png │ │ ├── _vertical.png │ │ ├── screen-shot-L.png │ │ ├── screen-shot-M.png │ │ ├── screen-shot-XS.png │ │ ├── screen-shot-XXS.png │ │ └── screen-shot-all.png │ ├── developer │ │ ├── _bgs.png │ │ ├── _blank.cur │ │ ├── _blank.png │ │ ├── _icons.png │ │ ├── _patches.png │ │ ├── _vertical.png │ │ ├── _horizontal.png │ │ ├── patches.html │ │ ├── patches.js │ │ └── fusion.html │ ├── package.json │ ├── javascript_implementation │ │ ├── jsColor.css │ │ └── README.md │ ├── jQuery_implementation │ │ ├── jqColor.css │ │ └── README.md │ ├── Gruntfile.js │ └── LICENSE.md ├── markdown │ ├── fonts │ │ └── icomoon.woff │ └── index.html ├── css │ ├── fonts │ │ ├── SourceSansPro-It.otf │ │ ├── SourceSansPro-Black.otf │ │ ├── SourceSansPro-Bold.otf │ │ ├── SourceSansPro-BoldIt.otf │ │ ├── SourceSansPro-Light.otf │ │ ├── SourceCodePro-Regular.ttf │ │ ├── SourceSansPro-BlackIt.otf │ │ ├── SourceSansPro-LightIt.otf │ │ ├── SourceSansPro-Regular.otf │ │ ├── SourceSansPro-Semibold.otf │ │ ├── SourceSansPro-ExtraLight.otf │ │ ├── SourceSansPro-SemiboldIt.otf │ │ └── SourceSansPro-ExtraLightIt.otf │ ├── font-awesome │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ ├── less │ │ │ ├── fixed-width.less │ │ │ ├── screen-reader.less │ │ │ ├── larger.less │ │ │ ├── list.less │ │ │ ├── core.less │ │ │ ├── stacked.less │ │ │ ├── font-awesome.less │ │ │ ├── bordered-pulled.less │ │ │ ├── rotated-flipped.less │ │ │ ├── path.less │ │ │ └── animated.less │ │ ├── scss │ │ │ ├── _fixed-width.scss │ │ │ ├── _screen-reader.scss │ │ │ ├── _larger.scss │ │ │ ├── _list.scss │ │ │ ├── _core.scss │ │ │ ├── font-awesome.scss │ │ │ ├── _stacked.scss │ │ │ ├── _bordered-pulled.scss │ │ │ ├── _rotated-flipped.scss │ │ │ ├── _path.scss │ │ │ └── _animated.scss │ │ └── HELP-US-OUT.txt │ ├── print.css │ ├── variables.css │ ├── nativize.css │ ├── section.css │ └── github.css ├── normalize-shortcuts.js ├── mac │ ├── child.plist │ ├── parent.plist │ └── info.plist ├── ex-links.js ├── imports.js ├── demo-btns.js └── plugins │ └── compress │ └── words.js ├── main-process ├── native-ui │ ├── tray │ │ ├── iconTemplate.png │ │ ├── iconTemplate@2x.png │ │ └── windows-icon@2x.png │ └── dialogs │ │ ├── error.js │ │ ├── open-file.js │ │ ├── save.js │ │ └── information.js ├── system │ ├── app-information.js │ └── protocol-handler.js └── menus │ └── shortcuts.js ├── sections ├── native-ui │ ├── nodejs.html │ ├── jquery.html │ └── bootstrap.html ├── menus │ ├── color.html │ └── docs.html ├── system │ ├── markdown.html │ └── calendar.html ├── about.html └── windows │ └── ip-search.html ├── .travis.yml ├── package.json └── LICENSE /.node-version: -------------------------------------------------------------------------------- 1 | v4.3.2 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | out 3 | npm-debug.log 4 | .idea -------------------------------------------------------------------------------- /assets/img/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/img/about.png -------------------------------------------------------------------------------- /assets/img/about@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/img/about@2x.png -------------------------------------------------------------------------------- /assets/img/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/img/diagram.png -------------------------------------------------------------------------------- /assets/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/img/loading.gif -------------------------------------------------------------------------------- /assets/app-icon/png/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/app-icon/png/16.png -------------------------------------------------------------------------------- /assets/app-icon/png/24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/app-icon/png/24.png -------------------------------------------------------------------------------- /assets/app-icon/png/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/app-icon/png/32.png -------------------------------------------------------------------------------- /assets/app-icon/png/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/app-icon/png/48.png -------------------------------------------------------------------------------- /assets/app-icon/png/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/app-icon/png/64.png -------------------------------------------------------------------------------- /assets/jquery/img/new.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/jquery/img/new.gif -------------------------------------------------------------------------------- /assets/jquery/img/zfb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/jquery/img/zfb.png -------------------------------------------------------------------------------- /assets/app-icon/mac/app.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/app-icon/mac/app.icns -------------------------------------------------------------------------------- /assets/app-icon/png/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/app-icon/png/1024.png -------------------------------------------------------------------------------- /assets/app-icon/png/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/app-icon/png/128.png -------------------------------------------------------------------------------- /assets/app-icon/png/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/app-icon/png/256.png -------------------------------------------------------------------------------- /assets/app-icon/png/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/app-icon/png/512.png -------------------------------------------------------------------------------- /assets/app-icon/win/app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/app-icon/win/app.ico -------------------------------------------------------------------------------- /assets/img/ui-terminology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/img/ui-terminology.png -------------------------------------------------------------------------------- /assets/jquery/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/jquery/img/favicon.ico -------------------------------------------------------------------------------- /assets/tiles/SampleAppx.44x44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/tiles/SampleAppx.44x44.png -------------------------------------------------------------------------------- /assets/tiles/SampleAppx.50x50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/tiles/SampleAppx.50x50.png -------------------------------------------------------------------------------- /assets/colorpicker/images/_bgs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/images/_bgs.png -------------------------------------------------------------------------------- /assets/colorpicker/images/_blank.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/images/_blank.cur -------------------------------------------------------------------------------- /assets/colorpicker/images/_blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/images/_blank.png -------------------------------------------------------------------------------- /assets/colorpicker/images/_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/images/_icons.png -------------------------------------------------------------------------------- /assets/markdown/fonts/icomoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/markdown/fonts/icomoon.woff -------------------------------------------------------------------------------- /assets/tiles/SampleAppx.150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/tiles/SampleAppx.150x150.png -------------------------------------------------------------------------------- /assets/tiles/SampleAppx.310x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/tiles/SampleAppx.310x150.png -------------------------------------------------------------------------------- /assets/colorpicker/developer/_bgs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/developer/_bgs.png -------------------------------------------------------------------------------- /assets/colorpicker/images/_patches.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/images/_patches.png -------------------------------------------------------------------------------- /assets/colorpicker/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/images/favicon.ico -------------------------------------------------------------------------------- /assets/css/fonts/SourceSansPro-It.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/fonts/SourceSansPro-It.otf -------------------------------------------------------------------------------- /assets/colorpicker/developer/_blank.cur: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/developer/_blank.cur -------------------------------------------------------------------------------- /assets/colorpicker/developer/_blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/developer/_blank.png -------------------------------------------------------------------------------- /assets/colorpicker/developer/_icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/developer/_icons.png -------------------------------------------------------------------------------- /assets/colorpicker/developer/_patches.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/developer/_patches.png -------------------------------------------------------------------------------- /assets/colorpicker/images/_horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/images/_horizontal.png -------------------------------------------------------------------------------- /assets/colorpicker/images/_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/images/_vertical.png -------------------------------------------------------------------------------- /assets/css/fonts/SourceSansPro-Black.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/fonts/SourceSansPro-Black.otf -------------------------------------------------------------------------------- /assets/css/fonts/SourceSansPro-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/fonts/SourceSansPro-Bold.otf -------------------------------------------------------------------------------- /assets/css/fonts/SourceSansPro-BoldIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/fonts/SourceSansPro-BoldIt.otf -------------------------------------------------------------------------------- /assets/css/fonts/SourceSansPro-Light.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/fonts/SourceSansPro-Light.otf -------------------------------------------------------------------------------- /assets/jquery/TOC-Created-By-Easy-CHM.HHC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/jquery/TOC-Created-By-Easy-CHM.HHC -------------------------------------------------------------------------------- /assets/colorpicker/developer/_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/developer/_vertical.png -------------------------------------------------------------------------------- /assets/colorpicker/images/screen-shot-L.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/images/screen-shot-L.png -------------------------------------------------------------------------------- /assets/colorpicker/images/screen-shot-M.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/images/screen-shot-M.png -------------------------------------------------------------------------------- /assets/css/fonts/SourceCodePro-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/fonts/SourceCodePro-Regular.ttf -------------------------------------------------------------------------------- /assets/css/fonts/SourceSansPro-BlackIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/fonts/SourceSansPro-BlackIt.otf -------------------------------------------------------------------------------- /assets/css/fonts/SourceSansPro-LightIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/fonts/SourceSansPro-LightIt.otf -------------------------------------------------------------------------------- /assets/css/fonts/SourceSansPro-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/fonts/SourceSansPro-Regular.otf -------------------------------------------------------------------------------- /assets/css/fonts/SourceSansPro-Semibold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/fonts/SourceSansPro-Semibold.otf -------------------------------------------------------------------------------- /assets/colorpicker/developer/_horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/developer/_horizontal.png -------------------------------------------------------------------------------- /assets/colorpicker/images/screen-shot-XS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/images/screen-shot-XS.png -------------------------------------------------------------------------------- /assets/colorpicker/images/screen-shot-XXS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/images/screen-shot-XXS.png -------------------------------------------------------------------------------- /assets/colorpicker/images/screen-shot-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/colorpicker/images/screen-shot-all.png -------------------------------------------------------------------------------- /assets/css/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /assets/css/fonts/SourceSansPro-ExtraLight.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/fonts/SourceSansPro-ExtraLight.otf -------------------------------------------------------------------------------- /assets/css/fonts/SourceSansPro-SemiboldIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/fonts/SourceSansPro-SemiboldIt.otf -------------------------------------------------------------------------------- /main-process/native-ui/tray/iconTemplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/main-process/native-ui/tray/iconTemplate.png -------------------------------------------------------------------------------- /assets/css/fonts/SourceSansPro-ExtraLightIt.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/fonts/SourceSansPro-ExtraLightIt.otf -------------------------------------------------------------------------------- /main-process/native-ui/tray/iconTemplate@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/main-process/native-ui/tray/iconTemplate@2x.png -------------------------------------------------------------------------------- /main-process/native-ui/tray/windows-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/main-process/native-ui/tray/windows-icon@2x.png -------------------------------------------------------------------------------- /assets/css/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /assets/css/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /assets/css/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /assets/css/font-awesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hisune/hisune-coder-tools/HEAD/assets/css/font-awesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /assets/css/font-awesome/less/fixed-width.less: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .@{fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /assets/css/font-awesome/less/screen-reader.less: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { .sr-only(); } 5 | .sr-only-focusable { .sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /assets/css/font-awesome/scss/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /assets/css/font-awesome/scss/_screen-reader.scss: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { @include sr-only(); } 5 | .sr-only-focusable { @include sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /main-process/system/app-information.js: -------------------------------------------------------------------------------- 1 | const app = require('electron').app 2 | const ipc = require('electron').ipcMain 3 | 4 | ipc.on('get-app-path', function (event) { 5 | event.sender.send('got-app-path', app.getAppPath()) 6 | }) 7 | -------------------------------------------------------------------------------- /main-process/native-ui/dialogs/error.js: -------------------------------------------------------------------------------- 1 | const ipc = require('electron').ipcMain 2 | const dialog = require('electron').dialog 3 | 4 | ipc.on('open-error-dialog', function (event) { 5 | dialog.showErrorBox('An Error Message', 'Demonstrating an error message.') 6 | }) 7 | -------------------------------------------------------------------------------- /assets/normalize-shortcuts.js: -------------------------------------------------------------------------------- 1 | let normalize = require('electron-shortcut-normalizer') 2 | let shortcuts = document.querySelectorAll('kbd.normalize-to-platform') 3 | 4 | Array.prototype.forEach.call(shortcuts, function (shortcut) { 5 | shortcut.innerText = normalize(shortcut.innerText, process.platform) 6 | }) 7 | -------------------------------------------------------------------------------- /main-process/system/protocol-handler.js: -------------------------------------------------------------------------------- 1 | const app = require('electron').app 2 | const dialog = require('electron').dialog 3 | 4 | app.setAsDefaultProtocolClient('electron-api-demos') 5 | 6 | app.on('open-url', function (event, url) { 7 | dialog.showErrorBox('Welcome Back', `You arrived from: ${url}`) 8 | }) 9 | -------------------------------------------------------------------------------- /assets/colorpicker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "colorPicker", 3 | "version": "1.0.0", 4 | "repository": { 5 | "type": "git", 6 | "url": "http://github.com/PitPik/colorPicker.git" 7 | }, 8 | "devDependencies": { 9 | "grunt": "^0.4.5", 10 | "grunt-contrib-uglify": "^0.5.1" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /assets/mac/child.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.inherit 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sections/native-ui/nodejs.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /sections/menus/color.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /sections/native-ui/jquery.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /assets/css/font-awesome/HELP-US-OUT.txt: -------------------------------------------------------------------------------- 1 | I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project, 2 | Fort Awesome (https://fortawesome.com). It makes it easy to put the perfect icons on your website. Choose from our awesome, 3 | comprehensive icon sets or copy and paste your own. 4 | 5 | Please. Check it out. 6 | 7 | -Dave Gandy 8 | -------------------------------------------------------------------------------- /main-process/native-ui/dialogs/open-file.js: -------------------------------------------------------------------------------- 1 | const ipc = require('electron').ipcMain 2 | const dialog = require('electron').dialog 3 | 4 | ipc.on('open-file-dialog', function (event) { 5 | dialog.showOpenDialog({ 6 | properties: ['openFile', 'openDirectory'] 7 | }, function (files) { 8 | if (files) event.sender.send('selected-directory', files) 9 | }) 10 | }) 11 | -------------------------------------------------------------------------------- /sections/native-ui/bootstrap.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /sections/system/markdown.html: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /assets/ex-links.js: -------------------------------------------------------------------------------- 1 | const shell = require('electron').shell 2 | 3 | const links = document.querySelectorAll('a[href]') 4 | 5 | Array.prototype.forEach.call(links, function (link) { 6 | const url = link.getAttribute('href') 7 | if (url.indexOf('http') === 0) { 8 | link.addEventListener('click', function (e) { 9 | e.preventDefault() 10 | shell.openExternal(url) 11 | }) 12 | } 13 | }) 14 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | node_js: "4" 4 | 5 | before_script: 6 | - export DISPLAY=:99.0 7 | - sh -e /etc/init.d/xvfb start 8 | - sleep 3 9 | 10 | script: 11 | - npm test 12 | - npm run pack-linux 13 | 14 | branches: 15 | only: 16 | - master 17 | 18 | cache: 19 | directories: 20 | - node_modules 21 | 22 | notifications: 23 | email: 24 | on_success: never 25 | on_failure: change 26 | -------------------------------------------------------------------------------- /assets/css/font-awesome/less/larger.less: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .@{fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .@{fa-css-prefix}-2x { font-size: 2em; } 11 | .@{fa-css-prefix}-3x { font-size: 3em; } 12 | .@{fa-css-prefix}-4x { font-size: 4em; } 13 | .@{fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /main-process/native-ui/dialogs/save.js: -------------------------------------------------------------------------------- 1 | const ipc = require('electron').ipcMain 2 | const dialog = require('electron').dialog 3 | 4 | ipc.on('save-dialog', function (event) { 5 | const options = { 6 | title: 'Save an Image', 7 | filters: [ 8 | { name: 'Images', extensions: ['jpg', 'png', 'gif'] } 9 | ] 10 | } 11 | dialog.showSaveDialog(options, function (filename) { 12 | event.sender.send('saved-file', filename) 13 | }) 14 | }) 15 | -------------------------------------------------------------------------------- /assets/css/font-awesome/scss/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /assets/colorpicker/javascript_implementation/jsColor.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #ccc; 3 | padding: .5em 2em; 4 | font: normal normal normal .9em/1.35em Georgia, "Times New Roman", Times, serif; 5 | } 6 | input:focus { 7 | outline: none; 8 | } 9 | pre { 10 | display: inline; 11 | background-color: rgba(255, 255, 255, .2); 12 | padding: .5em; 13 | } 14 | .color { 15 | padding: .5em; 16 | margin-right: .4em; 17 | border: 1px solid #aaa; 18 | border-radius: 3px; 19 | width: 140px; 20 | } -------------------------------------------------------------------------------- /assets/css/font-awesome/less/list.less: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: @fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .@{fa-css-prefix}-li { 11 | position: absolute; 12 | left: -@fa-li-width; 13 | width: @fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.@{fa-css-prefix}-lg { 17 | left: (-@fa-li-width + (4em / 14)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /assets/css/font-awesome/scss/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /assets/imports.js: -------------------------------------------------------------------------------- 1 | const links = document.querySelectorAll('link[rel="import"]') 2 | 3 | // Import and add each page to the DOM 4 | Array.prototype.forEach.call(links, function (link) { 5 | let template = link.import.querySelector('.task-template') 6 | let clone = document.importNode(template.content, true) 7 | if (link.href.match('about.html')) { 8 | document.querySelector('body').appendChild(clone) 9 | } else { 10 | document.querySelector('.content').appendChild(clone) 11 | } 12 | }) 13 | -------------------------------------------------------------------------------- /assets/mac/parent.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.application-groups 8 | VEKTX9H2N7.com.github.electron-api-demos 9 | com.apple.security.files.user-selected.read-write 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /main-process/native-ui/dialogs/information.js: -------------------------------------------------------------------------------- 1 | const ipc = require('electron').ipcMain 2 | const dialog = require('electron').dialog 3 | 4 | ipc.on('open-information-dialog', function (event) { 5 | const options = { 6 | type: 'info', 7 | title: 'Information', 8 | message: "This is an information dialog. Isn't it nice?", 9 | buttons: ['Yes', 'No'] 10 | } 11 | dialog.showMessageBox(options, function (index) { 12 | event.sender.send('information-dialog-selection', index) 13 | }) 14 | }) 15 | -------------------------------------------------------------------------------- /assets/css/font-awesome/less/core.less: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /assets/colorpicker/jQuery_implementation/jqColor.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #ccc; 3 | padding: .5em 2em; 4 | font: normal normal normal .9em/1.35em Georgia, "Times New Roman", Times, serif; 5 | } 6 | input:focus { 7 | outline: none; 8 | } 9 | pre { 10 | display: inline; 11 | background-color: rgba(255, 255, 255, .2); 12 | padding: .5em; 13 | } 14 | .color { 15 | padding: .5em; 16 | margin-right: .4em; 17 | border: 1px solid #aaa; 18 | border-radius: 3px; 19 | width: 140px; 20 | } 21 | .the-paragraph { 22 | position: relative; 23 | } -------------------------------------------------------------------------------- /assets/css/font-awesome/scss/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /assets/css/font-awesome/scss/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | @import "screen-reader"; 19 | -------------------------------------------------------------------------------- /assets/css/print.css: -------------------------------------------------------------------------------- 1 | @media print { 2 | body { 3 | background: none; 4 | color: black !important; 5 | font-size: 70%; 6 | margin: 0; padding: 0; 7 | } 8 | 9 | h1 { 10 | font-size: 22px; 11 | } 12 | 13 | .nav, button, .demo-box:before, 14 | #pdf-path, header p { 15 | display: none; 16 | } 17 | 18 | .demo-box, h2, 19 | pre, code { 20 | padding: 0 !important; 21 | margin: 0 !important; 22 | } 23 | 24 | header { 25 | padding: 0 0 10px 0; 26 | } 27 | 28 | code, .support { 29 | font-size: 10px; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /assets/css/font-awesome/less/stacked.less: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; } 21 | -------------------------------------------------------------------------------- /main-process/menus/shortcuts.js: -------------------------------------------------------------------------------- 1 | const electron = require('electron') 2 | const app = electron.app 3 | const dialog = electron.dialog 4 | const globalShortcut = electron.globalShortcut 5 | 6 | app.on('ready', function () { 7 | globalShortcut.register('CommandOrControl+Alt+K', function () { 8 | dialog.showMessageBox({ 9 | type: 'info', 10 | message: 'Success!', 11 | detail: 'You pressed the registered global shortcut keybinding.', 12 | buttons: ['OK'] 13 | }) 14 | }) 15 | }) 16 | 17 | app.on('will-quit', function () { 18 | globalShortcut.unregisterAll() 19 | }) 20 | -------------------------------------------------------------------------------- /assets/css/font-awesome/scss/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /assets/css/font-awesome/less/font-awesome.less: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables.less"; 7 | @import "mixins.less"; 8 | @import "path.less"; 9 | @import "core.less"; 10 | @import "larger.less"; 11 | @import "fixed-width.less"; 12 | @import "list.less"; 13 | @import "bordered-pulled.less"; 14 | @import "animated.less"; 15 | @import "rotated-flipped.less"; 16 | @import "stacked.less"; 17 | @import "icons.less"; 18 | @import "screen-reader.less"; 19 | -------------------------------------------------------------------------------- /assets/mac/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleURLTypes 6 | 7 | 8 | CFBundleURLSchemes 9 | 10 | electron-api-demos 11 | 12 | CFBundleURLName 13 | Electron API Demos Protocol 14 | 15 | 16 | ElectronTeamID 17 | VEKTX9H2N7 18 | 19 | 20 | -------------------------------------------------------------------------------- /assets/colorpicker/developer/patches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | patches 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /assets/css/font-awesome/less/bordered-pulled.less: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em @fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .@{fa-css-prefix}-pull-left { float: left; } 11 | .@{fa-css-prefix}-pull-right { float: right; } 12 | 13 | .@{fa-css-prefix} { 14 | &.@{fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.@{fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .@{fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /assets/css/font-awesome/scss/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .#{$fa-css-prefix}-pull-left { float: left; } 11 | .#{$fa-css-prefix}-pull-right { float: right; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .#{$fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /assets/css/font-awesome/less/rotated-flipped.less: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } 5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } 6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } 7 | 8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } 9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .@{fa-css-prefix}-rotate-90, 15 | :root .@{fa-css-prefix}-rotate-180, 16 | :root .@{fa-css-prefix}-rotate-270, 17 | :root .@{fa-css-prefix}-flip-horizontal, 18 | :root .@{fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /assets/css/font-awesome/scss/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /assets/css/variables.css: -------------------------------------------------------------------------------- 1 | 2 | /* Custom Properties */ 3 | 4 | :root { 5 | --color: hsl(0,0%,22%); 6 | --color-subtle: hsl(0,0%,44%); 7 | --color-strong: hsl(0,0%,11%); 8 | --color-link: hsl(0,0%,22%); 9 | 10 | --color-border: hsl(0,0%,88%); 11 | --color-bg: hsl(0,0%,96%); 12 | 13 | --color-accent: black; /* Fallback */ 14 | } 15 | 16 | 17 | /* Category Colors */ 18 | 19 | .u-category-windows { --color-accent: hsl(116, 30%, 36%); } 20 | .u-category-menu { --color-accent: hsl(194, 60%, 36%); } 21 | .u-category-native-ui { --color-accent: hsl(222, 53%, 50%); } 22 | .u-category-communication { --color-accent: hsl(285, 47%, 46%); } 23 | .u-category-system { --color-accent: hsl(330, 65%, 48%); } 24 | .u-category-media { --color-accent: hsl( 36, 77%, 34%); } 25 | -------------------------------------------------------------------------------- /sections/system/calendar.html: -------------------------------------------------------------------------------- 1 | 22 | -------------------------------------------------------------------------------- /assets/css/font-awesome/less/path.less: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); 7 | src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), 8 | url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), 9 | url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), 10 | url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), 11 | url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /assets/css/font-awesome/scss/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), 9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /assets/demo-btns.js: -------------------------------------------------------------------------------- 1 | const storage = require('electron-json-storage') 2 | 3 | const demoBtns = document.querySelectorAll('.js-container-target') 4 | // Listen for demo button clicks 5 | Array.prototype.forEach.call(demoBtns, function (btn) { 6 | btn.addEventListener('click', function (event) { 7 | event.target.parentElement.classList.toggle('is-open') 8 | 9 | // Save currently active demo button in localStorage 10 | storage.set('activeDemoButtonId', event.target.getAttribute('id'), function (err) { 11 | if (err) return console.error(err) 12 | }) 13 | }) 14 | }) 15 | 16 | // Default to the demo that was active the last time the app was open 17 | storage.get('activeDemoButtonId', function (err, id) { 18 | if (err) return console.error(err) 19 | if (id && id.length) { 20 | var dom = document.getElementById(id); 21 | dom && dom.click() 22 | } 23 | }) 24 | -------------------------------------------------------------------------------- /assets/css/font-awesome/less/animated.less: -------------------------------------------------------------------------------- 1 | // Animated Icons 2 | // -------------------------- 3 | 4 | .@{fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .@{fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /assets/css/font-awesome/scss/_animated.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .#{$fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "HCT", 3 | "productName": "Hisune Coder Tools", 4 | "version": "0.0.3", 5 | "description": "Hisune Coder Tools", 6 | "private": true, 7 | "main": "main.js", 8 | "keywords": [ 9 | "Hisune", 10 | "Coder", 11 | "Tools" 12 | ], 13 | "author": "Hisune", 14 | "license": "MIT", 15 | "homepage": "https://hisune.com", 16 | "dependencies": { 17 | "dialogs": "git://github.com/hisune/dialogs.git", 18 | "electron-json-storage": "^2.0.0", 19 | "electron-shortcut-normalizer": "^1.0.0", 20 | "geoip-lite": "1.1.6", 21 | "glob": "^6.0.4", 22 | "highlight.js": "^9.3.0", 23 | "html-minifier": "3.0.2", 24 | "nodemailer": "2.5.0", 25 | "pinyin": "^2.8.3", 26 | "request": "2.74.0", 27 | "shadowsocks": "1.5.3", 28 | "uglify-js": "2.7.3" 29 | }, 30 | "devDependencies": { 31 | "electron-prebuilt": "^1.2.6" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /assets/colorpicker/jQuery_implementation/README.md: -------------------------------------------------------------------------------- 1 | 2 | # jQuery implementation 3 | 4 | Some description follows soon... 5 | 6 | ##Demo 7 | See **demo** at [dematte.at/cpn/jQuery_implementation](http://dematte.at/cpn/jQuery_implementation) 8 | 9 | ##Usage 10 | 11 | ```javascript 12 | $('input.color').colorPicker(); 13 | // description of option will follow 14 | $('input.color').colorPicker({ 15 | klass: window.ColorPicker, 16 | input: elm, 17 | patch: elm, 18 | init: function(elm, colors){}, // initialization callback (before colorPicker gets initialized though) 19 | animationSpeed: 200, 20 | draggable: true, 21 | multipleInstances: false 22 | margin: {left: -1, top: 2}, 23 | initStyle: 'display: none', 24 | mode: 'hsv-h', 25 | size: 1, 26 | renderCallback: renderCallback 27 | // and all other options from color and colorPicker 28 | }); 29 | ``` -------------------------------------------------------------------------------- /sections/menus/docs.html: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /assets/markdown/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 37 | 38 | -------------------------------------------------------------------------------- /assets/colorpicker/javascript_implementation/README.md: -------------------------------------------------------------------------------- 1 | 2 | # javaScript implementation (IE8+ or with querySelectorAll polyfill) 3 | 4 | Some description follows soon... 5 | 6 | ##Demo 7 | See **demo** at [dematte.at/cpn/javaScript_implementation](http://dematte.at/cpn/javaScript_implementation) 8 | 9 | ##Usage 10 | 11 | ```javascript 12 | jsColorPicker('input.color'); 13 | // description of option will follow 14 | jsColorPicker('input.color', { 15 | klass: window.ColorPicker, 16 | input: elm, 17 | patch: elm, 18 | init: function(elm, colors){}, // initialization callback (before colorPicker gets initialized though) 19 | // animationSpeed: 200, will be supported soon 20 | // draggable: true, 21 | multipleInstances: false 22 | margin: {left: -1, top: 2}, 23 | initStyle: 'display: none', 24 | mode: 'hsv-h', 25 | size: 1, 26 | renderCallback: renderCallback 27 | // and all other options from color and colorPicker 28 | }); 29 | ``` 30 | -------------------------------------------------------------------------------- /assets/css/nativize.css: -------------------------------------------------------------------------------- 1 | /* 2 | ** nativize.css 3 | ** Makes the UI feel more native 4 | */ 5 | 6 | html { 7 | font-family: sans-serif; 8 | -webkit-user-select: none; /* disable selection */ 9 | -webkit-user-drag: none; /* disable dragging */ 10 | cursor: default; /* use default cursor */ 11 | } 12 | 13 | body { 14 | margin: 0; /* remove default margin */ 15 | } 16 | 17 | 18 | /* enable text selection */ 19 | 20 | .is-selectable, 21 | pre, 22 | code { 23 | -webkit-user-select: auto; 24 | cursor: auto; 25 | } 26 | 27 | 28 | /* Buttons and links */ 29 | 30 | button{ 31 | cursor: default; 32 | } 33 | 34 | /* Internal links */ 35 | a { 36 | cursor: pointer; 37 | text-decoration: none; 38 | border-bottom: 1px dashed; 39 | outline: none; 40 | } 41 | 42 | /* New window (target) + external links */ 43 | a[target], 44 | a[href^="https://"], 45 | a[href^="http://"] { 46 | border-bottom: 1px solid; 47 | } 48 | 49 | a:hover, 50 | a:focus { 51 | border-bottom: none; 52 | } 53 | 54 | 55 | /* Images */ 56 | 57 | img { 58 | -webkit-user-drag: none; /* disable dragging */ 59 | } 60 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.noop.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.noop 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:ArrayjQuery.noop

17 |

V1.4概述

18 |
19 |

一个空函数

20 |
21 |

当你仅仅想要传递一个空函数的时候,就用他吧。这对一些插件作者很有用,当插件提供了一个可选的回调函数接口,那么如果调用的时候没有传递这个回调函数,就用jQuery.noop来代替执行。

22 |
23 |
24 |
25 |
26 | 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Hisune.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /assets/colorpicker/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | 3 | // Project configuration. 4 | grunt.initConfig({ 5 | pkg: grunt.file.readJSON('package.json'), 6 | uglify: { 7 | options: { 8 | banner: '/*! <%= pkg.name %> - v<%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n', 9 | sourceMap: true, 10 | // sourceMapIncludeSources: true, 11 | sourceMapName: 'colorPicker.js.map', 12 | report: 'gzip' 13 | }, 14 | my_target: { 15 | files: [{ 16 | 'color.all.min.js': ['colors.js', 'colorPicker.data.js', 'colorPicker.js'] 17 | },{ 18 | 'jQuery_implementation/jQueryColorPicker.min.js': 19 | ['colors.js', 'colorPicker.data.js', 'colorPicker.js','jQuery_implementation/jqColor.js'] 20 | },{ 21 | 'javascript_implementation/jsColorPicker.min.js': 22 | ['colors.js', 'colorPicker.data.js', 'colorPicker.js','javascript_implementation/jsColor.js'] 23 | }] 24 | } 25 | } 26 | }); 27 | 28 | // Load the plugin that provides the "uglify" task. 29 | grunt.loadNpmTasks('grunt-contrib-uglify'); 30 | 31 | // Default task(s). 32 | grunt.registerTask('default', ['uglify']); 33 | 34 | }; -------------------------------------------------------------------------------- /assets/colorpicker/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Peter Dematté 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /assets/css/section.css: -------------------------------------------------------------------------------- 1 | /* Section ------------------ */ 2 | 3 | .section { 4 | position: absolute; 5 | top: 0; 6 | left: 0; 7 | right: 0; 8 | bottom: 0; 9 | overflow-x: hidden; 10 | overflow-y: auto; 11 | color: var(--color-accent); 12 | 13 | /* Hide */ 14 | pointer-events: none; 15 | visibility: hidden; 16 | opacity: 0; 17 | transform: translateX(-20px); 18 | transition: visibility 0s .12s linear , opacity .12s ease-in, transform .12s ease-in; 19 | } 20 | .section.is-shown { 21 | pointer-events: auto; 22 | visibility: visible; 23 | opacity: 1; 24 | transform: translateX(0); 25 | transition: visibility 0s 0s linear , opacity .36s ease-out, transform .36s ease-out; 26 | } 27 | 28 | .section h3, 29 | .section p { 30 | color: var(--color); 31 | } 32 | 33 | .section-wrapper { 34 | position: relative; 35 | margin: 0 auto; 36 | padding: 2rem 2rem 1rem 2rem; 37 | border-bottom: 1px solid var(--color-border); 38 | } 39 | @media (min-width: 940px) { 40 | .section-wrapper { 41 | padding-top: 4rem; 42 | } 43 | } 44 | 45 | .section-icon { 46 | width: 32px; 47 | height: 32px; 48 | vertical-align: middle; 49 | margin-right: .5em; 50 | } 51 | -------------------------------------------------------------------------------- /sections/about.html: -------------------------------------------------------------------------------- 1 | 30 | -------------------------------------------------------------------------------- /assets/colorpicker/developer/patches.js: -------------------------------------------------------------------------------- 1 | ;(function(window, undefined){ 2 | "use strict" 3 | 4 | var shades = document.getElementById('shades'), 5 | ctx = shades.getContext('2d'), 6 | myImage, 7 | counter = 1, 8 | scale = 1, 9 | dim = 256 / scale, 10 | DIM = 255, 11 | imageData = ctx.createImageData(dim * counter, dim), 12 | data = imageData.data, 13 | x = 0, y = 0, count = 0, z = 0; 14 | 15 | shades.width = dim * counter; 16 | shades.height = dim; 17 | 18 | for (x = 0; x < dim; x += 1) { 19 | for (y = 0; y < dim; y += 1) { 20 | count = (x * dim * 4 * counter) + (y * 4); 21 | z = 0; 22 | 23 | 24 | // data[z + count++] = DIM - x * scale; 25 | // data[z + count++] = DIM - x * scale; 26 | // data[z + count++] = DIM - x * scale; 27 | // data[z + count++] = Math.abs(DIM - x * 2 * scale); 28 | 29 | data[z + count++] = 128; // 127 ??? 30 | data[z + count++] = 128; 31 | data[z + count++] = 128; 32 | data[z + count++] = Math.abs(DIM - y * scale); 33 | 34 | z += DIM * 4; 35 | } 36 | } 37 | 38 | ctx.putImageData(imageData, 0, 0); 39 | 40 | myImage = shades.toDataURL("image/png"); 41 | console.log(myImage.length) 42 | document.getElementById("MyPix").src = myImage; 43 | })(window); -------------------------------------------------------------------------------- /assets/colorpicker/developer/fusion.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fusion technologie 6 | 7 | 8 | 9 | 10 |
11 | 12 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /assets/jquery/event.type.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | event.type 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Stringevent.type

17 |

V1.0概述

18 |
19 |

 

20 |
21 |
22 |
23 |

示例

24 | 25 |

描述:

26 |

点击所有锚点后弹出事件类型。

27 |
jQuery 代码:
28 |
$("a").click(function(event) {
29 |     alert(event.type); // "click"
30 |   }); 
31 |
32 |
33 |
34 | 35 | -------------------------------------------------------------------------------- /sections/windows/ip-search.html: -------------------------------------------------------------------------------- 1 | 28 | -------------------------------------------------------------------------------- /assets/jquery/event.currentTarget.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | event.currentTarget 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Elementevent.currentTarget

17 |

V1.3概述

18 |
19 |

在事件冒泡阶段中的当前DOM元素

20 |
21 |
22 |
23 |

示例

24 | 25 |

描述:

26 |

警报currentTarget的匹配`this`关键字。

27 |
jQuery 代码:
28 |
$("p").click(function(event) {
29 |     alert( event.currentTarget === this ); // true  
30 | });  
31 |
32 |
33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.boxModel.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.boxModel 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:BooleanjQuery.boxModel

17 |

V1.0概述

18 |
19 |

在jQuery 1.3中不建议使用。当前页面中浏览器是否使用标准盒模型渲染页面。 建议使用 jQuery.support.boxModel 代替。W3C CSS 盒模型.

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

在 Internet Explorer 怪癖模式(QuirksMode)中返回 False。

29 |
jQuery 代码:
30 |
$.boxModel
31 |
32 |
33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.toArray.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.toArray() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:NumberjQuery.toArray()

17 |

V1.4概述

18 |
19 |

把jQuery集合中所有DOM元素恢复成一个数组。

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

得到所有li的元素数组

29 |
jQuery 代码:
30 |
alert($('li').toArray());
31 |
结果:
32 |
[<li id="foo">, <li id="bar">]
33 |
34 |
35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /assets/jquery/event.data.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | event.data 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Anythingevent.data

17 |

V1.1概述

18 |
19 |

当前执行的处理器被绑定的时候,包含可选的数据传递给jQuery.fn.bind。

20 |
21 |
22 |
23 |

示例

24 | 25 |

描述:

26 |

The description of the example.

27 |
jQuery 代码:
28 |
$("a").each(function(i) {
29 |     $(this).bind('click', {index:i}, function(e){
30 |        alert('my index is ' + e.data.index);
31 |     });
32 |   });   
33 |
34 |
35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /assets/jquery/root.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :root 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQuery:root

17 |

V1.9概述

18 |
19 |

选择该文档的根元素。

20 |
21 |

在HTML中,文档的根元素,和$(":root")选择的元素一样, 永远是<html>元素。

22 |
23 |
24 | 29 |
30 |

示例

31 |

设置<html>背景颜色为黄色

32 |
$(":root").css("background-color","yellow");
33 |
34 |
35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /assets/jquery/animated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :animated 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:animated

17 |

V1.2概述

18 |
19 |

匹配所有正在执行动画效果的元素

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

只有对不在执行动画效果的元素执行一个动画特效

29 |
HTML 代码:
30 |
<button id="run">Run</button><div></div>
31 |
jQuery 代码:
32 |
$("#run").click(function(){
33 |   $("div:not(:animated)").animate({ left: "+=20" }, 1000);
34 | });
35 |
36 |
37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /assets/jquery/empty.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | empty() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQueryempty()

17 |

V1.0概述

18 |
19 |

删除匹配的元素集合中所有的子节点。

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

把所有段落的子元素(包括文本节点)删除

29 |
HTML 代码:
30 |
<p>Hello, <span>Person</span> <a href="#">and person</a></p>
31 |
jQuery 代码:
32 |
$("p").empty();
33 |
结果:
34 |
<p></p>
35 |
36 |
37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /assets/jquery/event.relatedTarget.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | event.relatedTarget 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值: Elementevent.relatedTarget

17 |

V1.1.4概述

18 |
19 |

在事件中涉及的其它任何DOM元素。

20 |
21 |

对于 mouseout 事件,它指向被进入的元素;对于 mousein 事件,它指向被离开的元素。

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

On mouseout of anchors, alert the element type being entered.

29 |
jQuery 代码:
30 |
$("a").mouseout(function(event) {
31 |     alert(event.relatedTarget.nodeName); // "DIV"
32 |   });  
33 |
34 |
35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /assets/jquery/ajaxStart.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ajaxStart(callback) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQueryajaxStart(callback)

17 |

概述

18 |
19 |

AJAX 请求开始时执行函数。Ajax 事件。

20 |
21 |

22 |
23 |
24 |

参数

25 |
26 |

callbackFunctionV1.0

27 |

待执行函数

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

AJAX 请求开始时显示信息。

34 |
jQuery 代码:
35 |
 $("#loading").ajaxStart(function(){
36 |    $(this).show();
37 |  });
38 |
39 |
40 |
41 | 42 | -------------------------------------------------------------------------------- /assets/jquery/ajaxStop.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ajaxStop(callback) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQueryajaxStop(callback)

17 |

概述

18 |
19 |

AJAX 请求结束时执行函数。Ajax 事件。

20 |
21 |

22 |
23 |
24 |

参数

25 |
26 |

callbackFunctionV1.0

27 |

待执行函数

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

AJAX 请求结束后隐藏信息。

34 |
jQuery 代码:
35 |
 $("#loading").ajaxStop(function(){
36 |    $(this).hide();
37 |  });
38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/jquery/size.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | size() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Numbersize()

17 |

V1.0概述

18 |
19 |

jQuery 对象中元素的个数。

20 |
21 |

当前匹配的元素个数。 <span title="Core/size">size</span> 将返回相同的值。

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

计算文档中所有图片数量

29 |
HTML 代码:
30 |
<img src="test1.jpg"/> <img src="test2.jpg"/>
31 |
jQuery 代码:
32 |
$("img").size();
33 |
结果:
34 |
2
35 |
36 |
37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /assets/jquery/deferred.isRejected.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | deferred.isRejected() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Booleandeferred.isRejected()

17 |

V1.5概述

18 |
19 |

确定延迟对象是否已被拒绝。

20 |
21 |

注意:jquery1.7API中已弃用,请用deferred.state()替代。

22 |

如果延迟对象是在被拒绝的状态则返回true,这意味着要么deferred.reject()或者deferred.rejectWith()被调用的对象和failCallbacks被访问(或称正在这一进程中的)。

23 |

请注意,延迟的对象可以有三种状态:未解决(unresolved),解决(resolved),或拒绝(rejected);使用deferred.isResolved()来判断延迟对象是否在解决状态 。这些方法主要用于调试时非常有用,例如,以确定是否递延已经解决,即使你在代码中打算拒绝。

24 |
25 |
26 |
27 |
28 | 29 | -------------------------------------------------------------------------------- /assets/jquery/event.isDefaultPrevented.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | event.isDefaultPrevented() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值: Booleanevent.isDefaultPrevented()

17 |

V1.3概述

18 |
19 |

根据事件对象中是否调用过 event.preventDefault() 方法来返回一个布尔值。

20 |
21 |
22 |
23 |

示例

24 | 25 |

描述:

26 |

检测 event.preventDefault() 是否被调用过。

27 |
jQuery 代码:
28 |
$("a").click(function(event){
29 |     alert( event.isDefaultPrevented() ); // false
30 |     event.preventDefault();
31 |     alert( event.isDefaultPrevented() ); // true
32 |   });  
33 |
34 |
35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /assets/jquery/deferred.isResolved.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | deferred.isResolved() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Deferred Objectdeferred.isResolved()

17 |

概述

18 |
19 |

确定延迟对象是否已得到解决。

20 |
21 |

注意:jquery1.7API中已弃用,请用deferred.state()替代。

22 |

如果延迟对象是在被解决的状态则返回true,这意味着要么deferred.reject()或者deferred.rejectWith()被调用的对象和failCallbacks被访问(或称正在这一进程中的)。

23 |

请注意,延迟的对象可以有三种状态:未解决(unresolved),解决(resolved),或拒绝(rejected);使用deferred.isResolved()来判断延迟对象是否在解决状态 。这些方法主要用于调试时非常有用,例如,以确定是否递延已经解决,即使你在代码中打算拒绝。

24 |
25 |
26 |
27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /assets/jquery/length.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | length 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Numberlength

17 |

V1.0概述

18 |
19 |

jQuery 对象中元素的个数。

20 |
21 |

这个函数的返回值与 jQuery 对象的'<span title="Core/length">length</span>' 属性一致。

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

计算文档中所有图片数量

29 |
HTML 代码:
30 |
<img src="test1.jpg"/> <img src="test2.jpg"/>
31 |
jQuery 代码:
32 |
$("img").length;
33 |
结果:
34 |
2
35 |
36 |
37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /assets/jquery/deferred.progress.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | deferred.progress(progressCallbacks) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Deferred Objectdeferred.progress(progressCallbacks)

17 |

概述

18 |
19 |

当Deferred对象时生成进度通知时添加被访问处理程序。

20 |
21 |

这个参数可以是一个单一的功能或功能的阵列。当递延通过调用生成的进度通知notify或notifyWith,progressCallbacks 被访问。后来deferred.progress()返回Deferred对象。Deferred对象有方法可以链接到这一个。当递延解决或拒绝,进展回调将不再被调用。欲了解更多信息,请参阅文档Deferred object

22 |
23 |
24 |

参数

25 |
26 |

progressCallbacks V1.7

27 |

一个函数或函数数组,被呼叫递延生成进度通知。

28 |
29 |
30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /assets/jquery/all.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | * 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>*

17 |

V1.0概述

18 |
19 |

匹配所有元素

20 |
21 |

多用于结合上下文来搜索。

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

找到每一个元素

29 |
HTML 代码:
30 |
<div>DIV</div>
31 | <span>SPAN</span>
32 | <p>P</p>
33 |
jQuery 代码:
34 |
$("*")
35 |
结果:
36 |
[ <div>DIV</div>, <span>SPAN</span>, <p>P</p> ]
37 |
38 |
39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.trim.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.trim(str) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:StringjQuery.trim(str)

17 |

概述

18 |
19 |

去掉字符串起始和结尾的空格。

20 |
21 |

22 |
23 |
24 |

参数

25 |
26 |

strStringV1.0

27 |

需要处理的字符串

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

去掉字符串起始和结尾的空格。

34 |
jQuery 代码:
35 |
$.trim("  hello, how are you?  ");
36 |
结果:
37 |
"hello, how are you?"
38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/plugins/compress/words.js: -------------------------------------------------------------------------------- 1 | 2 | var Words = Collection.extend({ 3 | constructor: function(script) { 4 | this.base(); 5 | forEach (script.match(WORDS), this.add, this); 6 | this.encode(); 7 | }, 8 | 9 | add: function(word) { 10 | if (!this.has(word)) this.base(word); 11 | word = this.get(word); 12 | word.count++; 13 | return word; 14 | }, 15 | 16 | encode: function() { 17 | // sort by frequency 18 | this.sort(function(word1, word2) { 19 | return word2.count - word1.count; 20 | }); 21 | 22 | eval("var a=62,e=" + Packer.ENCODE62); 23 | var encode = e; 24 | var encoded = new Collection; // a dictionary of base62 -> base10 25 | var count = this.size(); 26 | for (var i = 0; i < count; i++) { 27 | encoded.put(encode(i), i); 28 | } 29 | 30 | var empty = function() {return ""}; 31 | var index = 0; 32 | forEach (this, function(word) { 33 | if (encoded.has(word)) { 34 | word.index = encoded.get(word); 35 | word.toString = empty; 36 | } else { 37 | while (this.has(encode(index))) index++; 38 | word.index = index++; 39 | } 40 | word.encoded = encode(word.index); 41 | }, this); 42 | 43 | // sort by encoding 44 | this.sort(function(word1, word2) { 45 | return word1.index - word2.index; 46 | }); 47 | }, 48 | 49 | toString: function() { 50 | return this.getValues().join("|"); 51 | } 52 | }, { 53 | Item: { 54 | constructor: function(word) { 55 | this.toString = function() {return word}; 56 | }, 57 | 58 | count: 0, 59 | encoded: "", 60 | index: -1 61 | } 62 | }); -------------------------------------------------------------------------------- /assets/jquery/deferred.reject.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | deferred.reject(args) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Deferred Objectdeferred.reject(args)

17 |

概述

18 |
19 |

拒绝延迟对象,并根据给定的参数调用任何失败的回调函数。

20 |
21 |

当延迟被拒绝,任何failCallbacks添加的deferred.thendeferred.fail被调用。回调按他们添加的顺序执行。每个回调传递的args在deferred.reject()中调用。之后添加任何failCallbacks递延被拒绝进入状态时,立即执行添加,使用的参数被传递给.reject()调用。有关详细信息,请参阅文件Deferred object

22 |
23 |
24 |

参数

25 |
26 |

argsV1.5

27 |

传递给failCallbacks的可选参数。

28 |
29 |
30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /assets/jquery/enabled.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :enabled 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:enabled

17 |

V1.0概述

18 |
19 |

匹配所有可用元素

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

查找所有可用的input元素

29 |
HTML 代码:
30 |
<form>
31 |   <input name="email" disabled="disabled" />
32 |   <input name="id" />
33 | </form>
34 |
jQuery 代码:
35 |
$("input:enabled")
36 |
结果:
37 |
[ <input name="id" /> ]
38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.error(message) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:StringjQuery.error(message)

17 |

概述

18 |
19 |

接受一个字符串,并且直接抛出一个包含这个字符串的异常。

20 |
21 |

这个方法的主要目的是提供给插件开发人员,让他们可以重载这个方法,并以更好的方式显示错误,或者提供更多信息。

22 |
23 |
24 |

参数

25 |
26 |

messageStringV1.4.1

27 |

要抛出的消息

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

重载jQuery.error,以便可以在Firebug里显示

34 |
jQuery 代码:
35 |
jQuery.error = console.error;
36 |
37 |
38 |
39 | 40 | 41 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.browser.version.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.browser.version 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:StringjQuery.browser.version

17 |

V1.1.3概述

18 |
19 |

在jQuery 1.3中不建议使用。浏览器渲染引擎版本号。

20 |
21 |

典型结果: Internet Explorer: 6.0, 7.0

22 |

Mozilla/Firefox/Flock/Camino: 1.7.12, 1.8.1.3

23 |

Opera: 9.20

24 |

Safari/Webkit: 312.8, 418.9

25 |
26 |
27 |
28 |

示例

29 | 30 |

描述:

31 |

显示当前 IE 浏览器版本号。

32 |
jQuery 代码:
33 |
if ( $.browser.msie )
34 |  alert( $.browser.version );
35 |
36 |
37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.isArray.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.isArray(obj) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:BooleanjQuery.isArray(obj)

17 |

概述

18 |
19 |

jQuery 1.3 新增。测试对象是否为数组。

20 |
21 |

22 |
23 |
24 |

参数

25 |
26 |

objObjectV1.3

27 |

用于测试是否为数组的对象

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

检测是否为数组

34 |
jQuery 代码:
35 |
$("b").append( " + $.isArray([]) );
36 |
结果:
37 |
<b>true</b>
38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.isPlainObject.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.isPlainObject(obj) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:BooleanjQuery.isPlainObject(obj)

17 |

概述

18 |
19 |

测试对象是否是纯粹的对象(通过 "{}" 或者 "new Object" 创建的)。

20 |
21 |

22 |
23 |
24 |

参数

25 |
26 |

objObjectV1.4

27 |

用于测试是否为纯粹的对象

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

测试是否为纯粹的对象

34 |
jQuery 代码:
35 |
jQuery.isPlainObject({}) // true
36 | jQuery.isPlainObject("test") // false
37 |
38 |
39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /assets/jquery/deferred.resolve.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | deferred.resolve(args) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Deferred Objectdeferred.resolve(args)

17 |

概述

18 |
19 |

解决递延对象,并根据给定的参数调用任何完成的回调函数。

20 |
21 |

当递延被解决,任何failCallbacks添加的deferred.thendeferred.fail被调用。回调按他们添加的顺序执行。每个回调传递的args在deferred.reject()中调用。之后添加任何failCallbacks递延被拒绝进入状态时,立即执行添加,使用的参数被传递给.reject()调用。有关详细信息,请参阅文件Deferred object

22 |
23 |
24 |

参数

25 |
26 |

argsStringV1.5

27 |

传递给doneCallbacks的可选参数

28 |
29 |
30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /assets/jquery/disabled.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :disabled 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:disabled

17 |

V1.0概述

18 |
19 |

匹配所有不可用元素

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

查找所有不可用的input元素

29 |
HTML 代码:
30 |
<form>
31 |   <input name="email" disabled="disabled" />
32 |   <input name="id" />
33 | </form>
34 |
jQuery 代码:
35 |
$("input:disabled")
36 |
结果:
37 |
[ <input name="email" disabled="disabled" /> ]
38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/jquery/lastOfType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :last-of-type 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQuery:last-of-type

17 |

V1.9概述

18 |
19 |

选择的所有元素之间具有相同元素名称的最后一个兄弟元素。

20 |
21 |

:last-of-type 选择器匹配在文档树中具有相同的父元素并且相同的元素名称,后面没有任何其他元素 的元素。

22 |
23 |
24 | 29 |
30 |

示例

31 |

在每一个匹配的<p>中找到最后一个span

32 |
33 | <p>
34 | 	<span>1</span>
35 | 	<span>2</span>
36 | 	<span>3</span>
37 | </p>
38 | $("p:last-of-type")
39 |
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.unique.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.unique(array) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:ArrayjQuery.unique(array)

17 |

概述

18 |
19 |

删除数组中重复元素。只处理删除DOM元素数组,而不能处理字符串或者数字数组。

20 |
21 |

22 |
23 |
24 |

参数

25 |
26 |

arrayArrayV1.1.3

27 |

待处理数组。

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

删除重复 div 标签。

34 |
jQuery 代码:
35 |
$.unique(document.getElementsByTagName("div"));
36 |
结果:
37 |
[<div>, <div>, ...]
38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/jquery/ajaxSuccess.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ajaxSuccess(callback) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQueryajaxSuccess(callback)

17 |

概述

18 |
19 |

AJAX 请求成功时执行函数。Ajax 事件。

20 |
21 |

XMLHttpRequest 对象和设置作为参数传递给回调函数。

22 |
23 |
24 |

参数

25 |
26 |

callbackFunctionV1.0

27 |

待执行函数

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

当 AJAX 请求成功后显示消息。

34 |
jQuery 代码:
35 |
 $("#msg").ajaxSuccess(function(evt, request, settings){
36 |    $(this).append("<li>请求成功!</li>");
37 |  });
38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/jquery/ajaxSend.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ajaxSend(callback) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQueryajaxSend(callback)

17 |

概述

18 |
19 |

AJAX 请求发送前执行函数。Ajax 事件。

20 |
21 |

XMLHttpRequest 对象和设置作为参数传递给回调函数。

22 |
23 |
24 |

参数

25 |
26 |

callbackFunctionV1.0

27 |

待执行函数

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

AJAX 请求发送前显示信息。

34 |
jQuery 代码:
35 |
 $("#msg").ajaxSend(function(evt, request, settings){
36 |    $(this).append("<li>开始请求: " + settings.url + "</li>");
37 |  });
38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/jquery/firstOfType.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :first-of-type 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQuery:first-of-type

17 |

V1.9概述

18 |
19 |

选择所有相同的元素名称的第一个兄弟元素。

20 |
21 |

:first-of-type 选择器匹配元素,在文档树中,相同的父元素并且在其他相同的元素名称之前。

22 |
23 |
24 | 29 |
30 |

示例

31 | 32 |

在每一个匹配的div中查找第一个span

33 |
34 | <div>
35 | 	<span>1</span>
36 | 	<span>2</span>
37 | 	<span>3</span>
38 | </div>
39 | 
40 | $("div:first-of-type")
41 |
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/jquery/innerWidth.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | innerWidth() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:IntegerinnerWidth()

17 |

V1.2.6概述

18 |
19 |

获取第一个匹配元素内部区域宽度(包括补白、不包括边框)。

20 |
21 |

此方法对可见和隐藏元素均有效。

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

获取第一段落内部区域宽度。

29 |
HTML 代码:
30 |
<p>Hello</p><p>2nd Paragraph</p>
31 |
jQuery 代码:
32 |
var p = $("p:first");
33 | $("p:last").text( "innerWidth:" + p.innerWidth() );
34 |
结果:
35 |
<p>Hello</p><p>innerWidth: 40</p>
36 |
37 |
38 |
39 | 40 | 41 | -------------------------------------------------------------------------------- /assets/jquery/innerHeight.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | innerHeight() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:IntegerinnerHeight()

17 |

V1.2.6概述

18 |
19 |

获取第一个匹配元素内部区域高度(包括补白、不包括边框)。

20 |
21 |

此方法对可见和隐藏元素均有效。

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

获取第一段落内部区域高度。

29 |
HTML 代码:
30 |
<p>Hello</p><p>2nd Paragraph</p>
31 |
jQuery 代码:
32 |
var p = $("p:first");
33 | $("p:last").text( "innerHeight:" + p.innerHeight() );
34 |
结果:
35 |
<p>Hello</p><p>innerHeight: 16</p>
36 |
37 |
38 |
39 | 40 | 41 | -------------------------------------------------------------------------------- /assets/jquery/visible.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :visible 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:visible

17 |

V1.0概述

18 |
19 |

匹配所有的可见元素

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

查找所有可见的 tr 元素

29 |
HTML 代码:
30 |
<table>
31 |   <tr style="display:none"><td>Value 1</td></tr>
32 |   <tr><td>Value 2</td></tr>
33 | </table>
34 |
jQuery 代码:
35 |
$("tr:visible")
36 |
结果:
37 |
[ <tr><td>Value 2</td></tr> ]
38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.isEmptyObject.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.isEmptyObject(obj) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:BooleanjQuery.isEmptyObject(obj)

17 |

概述

18 |
19 |

jQuery 1.4 新增。测试对象是否是空对象(不包含任何属性)。

20 |
21 |

jQuery 1.4 中,这个方法既检测对象本身的属性,也检测从原型继承的属性(因此没有使用hasOwnProperty)。

22 |
23 |
24 |

参数

25 |
26 |

objObjectV1.4

27 |

用于测试是否为空对象

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

测试是否为空对象

34 |
jQuery 代码:
35 |
jQuery.isEmptyObject({}) // true
36 | jQuery.isEmptyObject({ foo: "bar" }) // false
37 |
38 |
39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.fx.off.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.fx.off 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:BooleanjQuery.fx.off

17 |

V1.3概述

18 |
19 |

关闭页面上所有的动画。

20 |
21 |

把这个属性设置为true可以立即关闭所有动画(所有效果会立即执行完毕)。有些情况下可能需要这样,比如:

22 |

* 你在配置比较低的电脑上使用jQuery。

23 |

* 你的一些用户由于动画效果而遇到了 可访问性问题

24 |

当把这个属性设成false之后,可以重新开启所有动画。

25 |
26 |
27 |
28 |

示例

29 | 30 |

描述:

31 |

执行一个禁用的动画

32 |
jQuery 代码:
33 |
  jQuery.fx.off = true;
34 |   $("input").click(function(){
35 |       $("div").toggle("slow");
36 |   });
37 |
38 |
39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /assets/jquery/last.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | last() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQuerylast()

17 |

V1.4概述

18 |
19 |

获取最后个元素

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

获取匹配的最后个元素

29 |
HTML 代码:
30 |
<ul>
31 |     <li>list item 1</li>
32 |     <li>list item 2</li>
33 |     <li>list item 3</li>
34 |     <li>list item 4</li>
35 |     <li>list item 5</li>
36 | </ul>
37 |
jQuery 代码:
38 |
$('li').last()
39 |
结果:
40 |
[ <li>list item 5</li> ]
41 |
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/jquery/last_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :last 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQuery:last()

17 |

V1.0概述

18 |
19 |

获取最后个元素

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

获取匹配的最后个元素

29 |
HTML 代码:
30 |
<ul>
31 |     <li>list item 1</li>
32 |     <li>list item 2</li>
33 |     <li>list item 3</li>
34 |     <li>list item 4</li>
35 |     <li>list item 5</li>
36 | </ul>
37 |
jQuery 代码:
38 |
$('li:last')
39 |
结果:
40 |
[ <li>list item 5</li> ]
41 |
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/jquery/empty_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :empty 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:empty

17 |

V1.0概述

18 |
19 |

匹配所有不包含子元素或者文本的空元素

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

查找所有不包含子元素或者文本的空元素

29 |
HTML 代码:
30 |
<table>
31 |   <tr><td>Value 1</td><td></td></tr>
32 |   <tr><td>Value 2</td><td></td></tr>
33 | </table>
34 |
jQuery 代码:
35 |
$("td:empty")
36 |
结果:
37 |
[ <td></td>, <td></td> ]
38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/jquery/first.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | first() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQueryfirst()

17 |

V1.4概述

18 |
19 |

获取第一个元素

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

获取匹配的第一个元素

29 |
HTML 代码:
30 |
<ul>
31 |     <li>list item 1</li>
32 |     <li>list item 2</li>
33 |     <li>list item 3</li>
34 |     <li>list item 4</li>
35 |     <li>list item 5</li>
36 | </ul>
37 |
jQuery 代码:
38 |
$('li').first()
39 |
结果:
40 |
[ <li>list item 1</li> ]
41 |
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/jquery/first_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :first 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQuery:first

17 |

V1.0概述

18 |
19 |

获取第一个元素

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

获取匹配的第一个元素

29 |
HTML 代码:
30 |
<ul>
31 |     <li>list item 1</li>
32 |     <li>list item 2</li>
33 |     <li>list item 3</li>
34 |     <li>list item 4</li>
35 |     <li>list item 5</li>
36 | </ul>
37 |
jQuery 代码:
38 |
$('li:first');
39 |
结果:
40 |
[ <li>list item 1</li> ]
41 |
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/jquery/odd.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :odd 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:odd

17 |

概述

18 |
19 |

匹配所有索引值为奇数的元素,从 0 开始计数

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

查找表格的2、4、6行(即索引值1、3、5...)

29 |
HTML 代码:
30 |
<table>
31 |   <tr><td>Header 1</td></tr>
32 |   <tr><td>Value 1</td></tr>
33 |   <tr><td>Value 2</td></tr>
34 | </table>
35 |
jQuery 代码:
36 |
$("tr:odd")
37 |
结果:
38 |
[ <tr><td>Value 1</td></tr> ]
39 |
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /assets/jquery/clearQueue.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | clearQueue([queueName]) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 |

返回值:jQueryclearQueue([queueName])

18 |

概述

19 |
20 |

清空对象上尚未执行的所有队列

21 |
22 |

如果不带参数,则默认清空的是动画队列。这跟stop(true)类似,但stop()只能清空动画队列,而这个可以清空所有通过 .queue() 创建的队列。

23 |
24 |
25 |

参数

26 |
27 |

queueName BooleanV1.4

28 |

含有队列名的字符串。默认是"Fx",动画队列。

29 |
30 |
31 |

示例

32 | 33 |

描述:

34 |

停止当前正在运行的动画:

35 |
jQuery 代码:
36 |
$("#stop").click(function(){
37 |   $("#box").clearQueue();
38 | });
39 |
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /assets/jquery/context.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | context 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Elementcontext

17 |

V1.3概述

18 |
19 |

返回传给jQuery()的原始的DOM节点内容,即jQuery()的第二个参数。如果没有指定,那么context指向当前的文档(document)。

20 |
21 |

可以与selector一起使用,用于精确检测选择器查询情况。这两个属性对插件开发人员很有用。

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

检测使用的文档内容

29 |
jQuery 代码:
30 |
$("ul")
31 |   .append("<li>" + $("ul").context + "</li>")
32 |   .append("<li>" + $("ul", document.body).context.nodeName + "</li>");
33 |
结果:
34 |
[object HTMLDocument]  //如果是IE浏览器,则返回[object]
35 | BODY
36 |
37 |
38 |
39 | 40 | 41 | -------------------------------------------------------------------------------- /assets/jquery/parent_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :parent 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:parent

17 |

V1.0概述

18 |
19 |

匹配含有子元素或者文本的元素

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

查找所有含有子元素或者文本的 td 元素

29 |
HTML 代码:
30 |
<table>
31 |   <tr><td>Value 1</td><td></td></tr>
32 |   <tr><td>Value 2</td><td></td></tr>
33 | </table>
34 |
jQuery 代码:
35 |
$("td:parent")
36 |
结果:
37 |
[ <td>Value 1</td>, <td>Value 2</td> ]
38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/jquery/unwrap.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | unwrap() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQueryunwrap()

17 |

概述

18 |
19 |

这个方法将移出元素的父元素。这能快速取消 .wrap()方法的效果。匹配的元素(以及他们的同辈元素)会在DOM结构上替换他们的父元素。

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

用ID是"content"的div将每一个段落包裹起来

29 |
HTML 代码:
30 |
<div>
31 |     <p>Hello</p>
32 |     <p>cruel</p>
33 |     <p>World</p>
34 | </div>
35 |
jQuery 代码:
36 |
 $("p").unwrap()
37 |
结果:
38 |
    <p>Hello</p>
39 |     <p>cruel</p>
40 |     <p>World</p>
41 |
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/jquery/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :header 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:header

17 |

V1.2概述

18 |
19 |

匹配如 h1, h2, h3之类的标题元素

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

给页面内所有标题加上背景色

29 |
HTML 代码:
30 |
<h1>Header 1</h1>
31 | <p>Contents 1</p>
32 | <h2>Header 2</h2>
33 | <p>Contents 2</p>
34 |
jQuery 代码:
35 |
$(":header").css("background", "#EEE");
36 |
结果:
37 |
[ <h1 style="background:#EEE;">Header 1</h1>, <h2 style="background:#EEE;">Header 2</h2> ]
38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/jquery/onlyChild.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :only-child 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:only-child

17 |

V1.1.4概述

18 |
19 |

如果某个元素是父元素中唯一的子元素,那将会被匹配

20 |
21 |

如果父元素中含有其他元素,那将不会被匹配。

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

在 ul 中查找是唯一子元素的 li

29 |
HTML 代码:
30 |
<ul>
31 |   <li>John</li>
32 |   <li>Karl</li>
33 |   <li>Brandon</li>
34 | </ul>
35 | <ul>
36 |   <li>Glen</li>
37 | </ul>
38 |
jQuery 代码:
39 |
$("ul li:only-child")
40 |
结果:
41 |
[ <li>Glen</li> ]
42 |
43 |
44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /assets/jquery/selector.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | selector 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Striingselector

17 |

V1.3概述

18 |
19 |

返回传给jQuery()的原始选择器。

20 |
21 |

换句话说,就是返回你用什么选择器来找到这个元素的。可以与context一起使用,用于精确检测选择器查询情况。这两个属性对插件开发人员很有用。

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

确定查询的选择器

29 |
jQuery 代码:
30 |
$("ul")
31 |   .append("<li>" + $("ul").selector + "</li>")
32 |   .append("<li>" + $("ul li").selector + "</li>")
33 |   .append("<li>" + $("div#foo ul:not([class])").selector + "</li>");
34 |
结果:
35 |
ul
36 | ul li
37 | div#foo ul:not([class])
38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/jquery/deferred.rejectWith.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | deferred.rejectWith(context,[args]) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Deferred Objectdeferred.rejectWith(context,[args])

17 |

概述

18 |
19 |

拒绝延迟的对象,并根据给定的上下文和参数调用任何失败的回调函数。。

20 |
21 |

当延迟被拒绝,任何doneCallbacks添加的deferred.thendeferred.fail被调用。回调按他们添加的顺序执行。每个回调传递的args在deferred.reject()中调用。之后添加任何failCallbacks递延被拒绝进入状态时,立即执行添加,使用的参数被传递给.reject()调用。有关详细信息,请参阅文件Deferred object

22 |
23 |
24 |
25 |

参数

26 |
27 |

contextV1.5

28 |

上下文作为this对象传递给failCallbacks 。

29 |

argsV1.5

30 |

传递给failCallbacks的可选参数。

31 |
32 |
33 | 34 | 35 | -------------------------------------------------------------------------------- /assets/jquery/position.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | position() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Object{top,left}position()

17 |

V1.2概述

18 |
19 |

获取匹配元素相对父元素的偏移。

20 |
21 |

返回的对象包含两个整型属性:top 和 left。为精确计算结果,请在补白、边框和填充属性上使用像素单位。此方法只对可见元素有效。

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

获取第一段的偏移

29 |
HTML 代码:
30 |
<p>Hello</p><p>2nd Paragraph</p>
31 |
jQuery 代码:
32 |
var p = $("p:first");
33 | var position = p.position();
34 | $("p:last").html( "left: " + position.left + ", top: " + position.top );
35 |
结果:
36 |
<p>Hello</p><p>left: 15, top: 15</p>
37 |
38 |
39 |
40 | 41 | 42 | -------------------------------------------------------------------------------- /assets/css/github.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | github.com style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | color: #333; 12 | background: #f8f8f8; 13 | } 14 | 15 | .hljs-comment, 16 | .hljs-quote { 17 | color: #998; 18 | font-style: italic; 19 | } 20 | 21 | .hljs-keyword, 22 | .hljs-selector-tag, 23 | .hljs-subst { 24 | color: #333; 25 | font-weight: bold; 26 | } 27 | 28 | .hljs-number, 29 | .hljs-literal, 30 | .hljs-variable, 31 | .hljs-template-variable, 32 | .hljs-tag .hljs-attr { 33 | color: #008080; 34 | } 35 | 36 | .hljs-string, 37 | .hljs-doctag { 38 | color: #d14; 39 | } 40 | 41 | .hljs-title, 42 | .hljs-section, 43 | .hljs-selector-id { 44 | color: #900; 45 | font-weight: bold; 46 | } 47 | 48 | .hljs-subst { 49 | font-weight: normal; 50 | } 51 | 52 | .hljs-type, 53 | .hljs-class .hljs-title { 54 | color: #458; 55 | font-weight: bold; 56 | } 57 | 58 | .hljs-tag, 59 | .hljs-name, 60 | .hljs-attribute { 61 | color: #000080; 62 | font-weight: normal; 63 | } 64 | 65 | .hljs-regexp, 66 | .hljs-link { 67 | color: #009926; 68 | } 69 | 70 | .hljs-symbol, 71 | .hljs-bullet { 72 | color: #990073; 73 | } 74 | 75 | .hljs-built_in, 76 | .hljs-builtin-name { 77 | color: #0086b3; 78 | } 79 | 80 | .hljs-meta { 81 | color: #999; 82 | font-weight: bold; 83 | } 84 | 85 | .hljs-deletion { 86 | background: #fdd; 87 | } 88 | 89 | .hljs-addition { 90 | background: #dfd; 91 | } 92 | 93 | .hljs-emphasis { 94 | font-style: italic; 95 | } 96 | 97 | .hljs-strong { 98 | font-weight: bold; 99 | } 100 | -------------------------------------------------------------------------------- /assets/jquery/deferred.resolveWith.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | deferred.resolveWith(context,[args]) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Deferred Objectdeferred.resolveWith(context,[args])

17 |

概述

18 |
19 |

解决递延对象,并根据给定的上下文和参数调用任何完成的回调函数。

20 |
21 |

当递延被解决,任何doneCallbacks 添加的deferred.thendeferred.fail被调用。回调按他们添加的顺序执行。每个回调传递的args在deferred.reject()中调用。之后添加任何failCallbacks递延被拒绝进入状态时,立即执行添加,使用的参数被传递给.reject()调用。有关详细信息,请参阅文件Deferred object

22 |
23 |
24 |

参数

25 |
26 |

contextV1.5

27 |

上下文作为this对象传递给 doneCallbacks 。

28 |

argsV1.5

29 |

传递给doneCallbacks的可选参数

30 |
31 |
32 |
33 | 34 | -------------------------------------------------------------------------------- /assets/jquery/selected.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :selected 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:selected

17 |

V1.0概述

18 |
19 |

匹配所有选中的option元素

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

查找所有选中的选项元素

29 |
HTML 代码:
30 |
<select>
31 |   <option value="1">Flowers</option>
32 |   <option value="2" selected="selected">Gardens</option>
33 |   <option value="3">Trees</option>
34 | </select>
35 |
jQuery 代码:
36 |
$("select option:selected")
37 |
结果:
38 |
[ <option value="2" selected="selected">Gardens</option> ]
39 |
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.ajaxSetup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.ajaxSetup([options]) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQueryjQuery.ajaxSetup([options])

17 |

概述

18 |
19 |

设置全局 AJAX 默认选项。

20 |
21 |

参数见 '$.ajax' 说明。

22 |
23 |
24 |

参数

25 |
26 |

options ObjectV1.1

27 |

选项设置。所有设置项均为可选设置。.

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

设置 AJAX 请求默认地址为 "/xmlhttp/",禁止触发全局 AJAX 事件,用 POST 代替默认 GET 方法。其后的 AJAX 请求不再设置任何选项参数。

34 |
jQuery 代码:
35 |
$.ajaxSetup({
36 |   url: "/xmlhttp/",
37 |   global: false,
38 |   type: "POST"
39 | });
40 | $.ajax({ data: myData });
41 |
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/jquery/even.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :even 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:even

17 |

V1.0概述

18 |
19 |

匹配所有索引值为偶数的元素,从 0 开始计数

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

查找表格的1、3、5...行(即索引值0、2、4...)

29 |
HTML 代码:
30 |
<table>
31 |   <tr><td>Header 1</td></tr>
32 |   <tr><td>Value 1</td></tr>
33 |   <tr><td>Value 2</td></tr>
34 | </table>
35 |
jQuery 代码:
36 |
$("tr:even")
37 |
结果:
38 |
[ <tr><td>Header 1</td></tr>, <tr><td>Value 2</td></tr> ]
39 |
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /assets/jquery/finish.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | finish( [queue ] ) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQueryfinish( [queue ] )

17 |

概述

18 |
19 |

停止当前正在运行的动画,删除所有排队的动画,并完成匹配元素所有的动画。

20 |
21 |

当.finish()在一个元素上被调用,立即停止当前正在运行的动画和所有排队的动画(如果有的话),并且他们的CSS属性设置为它们的目标值(所有动画的目标值)。所有排队的动画将被删除。

22 |

如果第一个参数提供,该字符串表示的队列中的动画将被停止。

23 |

.finish()方法和.stop(true, true)很相似,.stop(true, true)将清除队列,并且目前的动画跳转到其最终值。但是,不同的是,.finish() 会导致所有排队的动画的CSS属性跳转到他们的最终值。

24 |
25 |
26 |

参数

27 |
28 |

queueStringV1.0

29 |

停止动画队列中的名称。

30 | 31 |
32 |
33 |

示例

34 |

停止当前正在运行的动画

35 |
$("#complete").click(function(){
  $("div").finish();
});
36 |
37 |
38 |
39 | 40 | 41 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.merge.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.merge(first,second) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:ArrayjQuery.merge(first,second)

17 |

概述

18 |
19 |

合并两个数组

20 |
21 |

返回的结果会修改第一个数组的内容——第一个数组的元素后面跟着第二个数组的元素。要去除重复项,请使用$.unique()

22 |
23 |
24 |

参数

25 |
26 |

first,secondArray,ArrayV1.0

27 |

first:第一个待处理数组,会改变其中的元素。

28 |

second:第二个待处理数组,不会改变其中的元素。

29 |
30 |
31 |

示例

32 | 33 |

描述:

34 |

合并两个数组到第一个数组上。

35 |
jQuery 代码:
36 |
$.merge( [0,1,2], [2,3,4] )
37 |
结果:
38 |
[0,1,2,2,3,4]
39 |
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /assets/jquery/removeData.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | removeData([name|list]) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQueryremoveData([name|list])

17 |

概述

18 |
19 |

在元素上移除存放的数据

20 |
21 |

与$(...).data(name, value)函数作用相反

22 |
23 |
24 |

参数

25 |
26 |

[name]StringV1.2.3

27 |

存储的数据名

28 |

[list]Array,StringV1.7

29 |

移除数组或以空格分开的字符串

30 |
31 |
32 |

示例

33 | 34 |

描述:

35 |

从元素中删除之前添加的数据:

36 |
jQuery 代码:
37 |
$("#btn2").click(function(){
38 |   $("div").removeData("greeting");
39 |   alert("Greeting is: " + $("div").data("greeting"));
40 | });
41 |
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/jquery/element.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | element 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>element

17 |

概述

18 |
19 |

根据给定的元素名匹配所有元素

20 |
21 |

22 |
23 |
24 |

参数

25 |
26 |

elementStringV1.0

27 |

一个用于搜索的元素。指向 DOM 节点的标签名。

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

查找一个 DIV 元素。

34 |
HTML 代码:
35 |
<div>DIV1</div>
36 | <div>DIV2</div>
37 | <span>SPAN</span>
38 |
jQuery 代码:
39 |
$("div");
40 |
结果:
41 |
[ <div>DIV1</div>, <div>DIV2</div> ]
42 |
43 |
44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.contains.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.contains(container,contained) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:BooleanjQuery.contains(container,contained)

17 |

概述

18 |
19 |

一个DOM节点是否包含另一个DOM节点。

20 |
21 |

22 |
23 |
24 |

参数

25 |
26 |

container,containedObject,ObjectV1.4

27 |

container:DOM元素作为容器,可以包含其他元素

28 |

contained:DOM节点,可能被其他元素所包含

29 |
30 |
31 |

示例

32 | 33 |

描述:

34 |

检测一个元素是否包含另一个元素

35 |
jQuery 代码:
36 |
jQuery.contains(document.documentElement, document.body); // true
37 | jQuery.contains(document.body, document.documentElement); // false
38 |
39 |
40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.type.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.type(obj) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:StringjQuery.type(obj)

17 |

概述

18 |
19 |

检测obj的数据类型。

20 |
21 |

参数

22 |
23 |

objObjectV1.4.3

24 |

用于测试类型的对象

25 |
26 |
27 |

示例

28 | 29 |

描述:

30 |

以下obj的类型如下:

31 |

 

32 |
    33 |
  • jQuery.type(true) === "boolean"
  • 34 |
  • jQuery.type(3) === "number" 35 |
  • jQuery.type("test") === "string"
  • 36 |
  • jQuery.type(function(){}) === "function" 37 |
  • jQuery.type([]) === "array"
  • 38 |
  • jQuery.type(new Date()) === "date" 39 |
  • jQuery.type(/test/) === "regexp"
  • 40 |
41 |
42 |
43 |
44 | 45 | -------------------------------------------------------------------------------- /assets/jquery/lang.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :lang(language) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQuery:lang(language)

17 |

概述

18 |
19 |

选择指定语言的所有元素。

20 |
21 |

:lang选择器,匹配有一个语言值等于所提供的语言代码,或以提供的语言代码开始,后面马上跟一个“ - ”的元素。例如,选择器$("div:lang(en)")将匹配<div lang="en"> and <div lang="en-us">(和他们的后代<div>),但不包括<div lang="fr">

22 |

对于HTML元素,语言值由lang属性决定,也可能由来自meta元素或HTTP头信息决定。

23 |

这种用法的进一步讨论可以在 W3C CSS规范中找到。

24 |
25 |
26 |

参数

27 |
28 |

languageV1.9

29 |

语言代码

30 | 31 |
32 |
33 |

示例

34 |

选择所有<P> 的语言属性:

35 |
$("p:lang(it)")
36 |
37 |
38 |
39 | 40 | 41 | -------------------------------------------------------------------------------- /assets/jquery/not_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :not(selector) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:not(selector)

17 |

概述

18 |
19 |

去除所有与给定选择器匹配的元素

20 |
21 |

在jQuery 1.3中,已经支持复杂选择器了(例如:not(div a) 和 :not(div,a))

22 |
23 |
24 |

参数

25 |
26 |

selectorSelectorV1.0

27 |

用于筛选的选择器

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

查找所有未选中的 input 元素

34 |
HTML 代码:
35 |
<input name="apple" />
36 | <input name="flower" checked="checked" />
37 |
jQuery 代码:
38 |
$("input:not(:checked)")
39 |
结果:
40 |
[ <input name="apple" /> ]
41 |
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/jquery/removeAttr.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | removeAttr(name) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQueryremoveAttr(name)

17 |

概述

18 |
19 |

从每一个匹配的元素中删除一个属性

20 |
21 |

1.6以下版本在IE6使用JQuery的removeAttr方法删除disabled是无效的。解决的方法就是使用$("XX").prop("disabled",false);
22 | 1.7版本在IE6下已支持删除disabled。

23 |
24 |
25 |

参数

26 |
27 |

nameStringV1.0

28 |

要删除的属性名

29 |
30 |
31 |

示例

32 | 33 |

描述:

34 |

将文档中图像的src属性删除

35 |
HTML 代码:
36 |
<img src="test.jpg"/>
37 |
jQuery 代码:
38 |
$("img").removeAttr("src");
39 |
结果:
40 |
[ <img /> ]
41 |
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/jquery/deferred.notify.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | deferred.notify(args) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Deferred Objectdeferred.notify(args)

17 |

概述

18 |
19 |

调用一个给定args的递延对象上的进行中的回调 (progressCallbacks)

20 |
21 |

通常情况下,只有一个递延的创建者,应调用此方法;你可以防止其他代码改变Deferred的状态或者通过deferred.promise()返回一个受限制的承诺对象报告状态

22 |

当 deferred.notify 被访问, 任何progressCallbacks 可以通过访问deferred.then 好或者 deferred.progress来添加。回调是在它们被添加的顺序执行。每次通过来自.notify()的args回调。任何为.notify()后递延是解决或拒绝(或之后添加任何progressCallbacks )被忽略。欲了解更多信息,请参阅文档 Deferred object.

23 |
24 |
25 |

参数

26 |
27 |

argsV1.7

28 |

可选参数传递到进行中的回调(progressCallbacks)

29 |
30 |
31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /assets/jquery/has_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :has(selector) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:has(selector)

17 |

概述

18 |
19 |

匹配含有选择器所匹配的元素的元素

20 |
21 |

22 |
23 |
24 |

参数

25 |
26 |

selectorSelectorV1.1.4

27 |

一个用于筛选的选择器

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

给所有包含 p 元素的 div 元素添加一个 text 类

34 |
HTML 代码:
35 |
<div><p>Hello</p></div>
36 | <div>Hello again!</div>
37 |
jQuery 代码:
38 |
$("div:has(p)").addClass("test");
39 |
结果:
40 |
[ <div class="test"><p>Hello</p></div> ]
41 |
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/jquery/attributeHas.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | [attribute] 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>[attribute]

17 |

概述

18 |
19 |

匹配包含给定属性的元素。注意,在jQuery 1.3中,前导的@符号已经被废除!如果想要兼容最新版本,只需要简单去掉@符号即可。

20 |
21 |

22 |
23 |
24 |

参数

25 |
26 |

attributeStringV1.0

27 |

属性名

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

查找所有含有 id 属性的 div 元素

34 |
HTML 代码:
35 |
<div>
36 |   <p>Hello!</p>
37 | </div>
38 | <div id="test2"></div>
39 |
jQuery 代码:
40 |
$("div[id]")
41 |
结果:
42 |
[ <div id="test2"></div> ]
43 |
44 |
45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /assets/jquery/offsetParent.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | offsetParent() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQueryoffsetParent()

17 |

V1.2.6概述

18 |
19 |

返回第一个匹配元素用于定位的父节点。

20 |
21 |

这返回父元素中第一个其position设为relative或者absolute的元素。此方法仅对可见元素有效。

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

设置最近的祖先定位元素的背景颜色

29 |
HTML 代码:
30 |
<div style="width:70%;position:absolute;left:100px;top:100px">
31 |   <div style="margin:50px;background-color:yellow">
32 |      <p>点击下面的按钮可以设置本段落的最近的父(祖先)元素的背景色。</p>
33 |    <div>
34 | </div>
35 | <button>点击这里</button>
36 |
jQuery 代码:
37 |
$("button").click(function(){
38 |     $("p").offsetParent().css("background-color","red");
39 | });
40 | 
41 |
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/jquery/firstChild.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :first-child 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:first-child

17 |

V1.1.4概述

18 |
19 |

匹配第一个子元素

20 |
21 |

':first' 只匹配一个元素,而此选择符将为每个父元素匹配一个子元素

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

在每个 ul 中查找第一个 li

29 |
HTML 代码:
30 |
<ul>
31 |   <li>John</li>
32 |   <li>Karl</li>
33 |   <li>Brandon</li>
34 | </ul>
35 | <ul>
36 |   <li>Glen</li>
37 |   <li>Tane</li>
38 |   <li>Ralph</li>
39 | </ul>
40 |
jQuery 代码:
41 |
$("ul li:first-child")
42 |
结果:
43 |
[ <li>John</li>, <li>Glen</li> ]
44 |
45 |
46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.isWindow.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.isWindow(obj) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:BooleanjQuery.isWindow(obj)

17 |

概述

18 |
19 |

测试对象是否是窗口(有可能是Frame)。

20 |
21 |

参数

22 |
23 |

objObjectV1.4.3

24 |

用于测试是否为窗口的对象

25 |
26 |
27 |

示例

28 | 29 |

描述:

30 |

测试是否为窗口

31 |

 

32 |

jQuery 代码:

33 |
<!DOCTYPE html>
34 | <html>
35 | <head>
36 |   <script src="http://code.jquery.com/jquery-1.5.2.js"></script>
37 | </head>
38 | <body>
39 |   Is 'window' a window? <b></b>
40 | <script>$("b").append( "" + $.isWindow(window) );</script>
41 | 
42 | </body>
43 | </html> 
44 |   
45 |
46 |
47 |
48 | 49 | -------------------------------------------------------------------------------- /assets/jquery/lastChild.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :last-child 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:last-child

17 |

V1.1.4概述

18 |
19 |

匹配最后一个子元素

20 |
21 |

':last'只匹配一个元素,而此选择符将为每个父元素匹配一个子元素

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

在每个 ul 中查找最后一个 li

29 |
HTML 代码:
30 |
<ul>
31 |   <li>John</li>
32 |   <li>Karl</li>
33 |   <li>Brandon</li>
34 | </ul>
35 | <ul>
36 |   <li>Glen</li>
37 |   <li>Tane</li>
38 |   <li>Ralph</li>
39 | </ul>
40 |
jQuery 代码:
41 |
$("ul li:last-child")
42 |
结果:
43 |
[ <li>Brandon</li>, <li>Ralph</li> ]
44 |
45 |
46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /assets/jquery/delay.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | delay(duration,[queueName]) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQuerydelay(duration,[queueName])

17 |

概述

18 |
19 |

设置一个延时来推迟执行队列中之后的项目。

20 |
21 |

jQuery 1.4新增。用于将队列中的函数延时执行。他既可以推迟动画队列的执行,也可以用于自定义队列。

22 |
23 |
24 |

参数

25 |
26 |

duration,[queueName]Integer,StringV1.4

27 |

duration:延时时间,单位:毫秒

28 |

queueName:队列名词,默认是Fx,动画队列。

29 |
30 |
31 |

示例

32 | 33 |

描述:

34 |

在.slideUp() 和 .fadeIn()之间延时800毫秒。

35 |
HTML 代码:
36 |
<div id="foo /">
37 |
jQuery 代码:
38 |
$('#foo').slideUp(300).delay(800).fadeIn(400);
39 |
40 |
41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.fx.interval.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.fx.interval 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:NumberjQuery.fx.interval

17 |

V1.4.3概述

18 |
19 |

设置动画的显示帧速。

20 |
21 |
22 |

示例

23 | 24 |

描述: 帧速设置为100ms

25 |

jQuery 代码:

26 |
<!DOCTYPE html>
27 | <html>
28 | <head>
29 |   <style>
30 |     div { width:50px; height:30px; margin:5px; float:left;
31 |           background:green; }
32 |     </style>
33 |   <script src="http://code.jquery.com/jquery-1.5.2.js"></script>
34 | </head>
35 | <body>
36 |   <p><input type="button" value="Run"/></p>
37 | <div></div>
38 | <script>
39 | jQuery.fx.interval = 100;
40 | 
41 | $("input").click(function(){
42 |   $("div").toggle( 3000 );
43 | });
44 |   </script>
45 | 
46 | </body>
47 | </html>
48 |
49 |
50 |
51 | 52 | -------------------------------------------------------------------------------- /assets/jquery/ajaxError.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ajaxError(callback) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQueryajaxError(callback)

17 |

概述

18 |
19 |

AJAX 请求发生错误时执行函数。Ajax 事件。

20 |
21 |

XMLHttpRequest 对象和设置作为参数传递给回调函数。捕捉到的错误可作为最后一个参数传递。

22 |
23 |
24 |

参数

25 |
26 |

callbackFunctionV1.0

27 |

待执行函数 28 |

function (event, XMLHttpRequest, ajaxOptions, thrownError) {
29 |       // thrownError 只有当异常发生时才会被传递
30 |       this; // 监听的 dom 元素
31 | }
32 |

33 |
34 |
35 |

示例

36 | 37 |

描述:

38 |

AJAX 请求失败时显示信息。

39 |
jQuery 代码:
40 |
$("#msg").ajaxError(function(event,request, settings){
41 |      $(this).append("<li>出错页面:" + settings.url + "</li>");
42 | });
43 |
44 |
45 |
46 | 47 | -------------------------------------------------------------------------------- /assets/jquery/jQuery.parseJSON.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | jQuery.parseJSON(json) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:StringjQuery.parseJSON(json)

17 |

概述

18 |
19 |

接受一个JSON字符串,返回解析后的对象。

20 |
21 |

传入一个畸形的JSON字符串会抛出一个异常。比如下面的都是畸形的JSON字符串:

22 |
    23 |
  • {test: 1} ( test 没有包围双引号)
  • 24 |
  • {'test': 1} (使用了单引号而不是双引号)
  • 25 |
26 |

另外,如果你什么都不传入,或者一个空字符串、null或undefined,parseJSON都会返回 null 。

27 |
28 |
29 |

参数

30 |
31 |

jsonStringV1.4.1

32 |

要解析的JSON字符串

33 |
34 |
35 |

示例

36 | 37 |

描述:

38 |

解析一个JSON字符串

39 |
jQuery 代码:
40 |
var obj = jQuery.parseJSON('{"name":"John"}');
41 | alert( obj.name === "John" );
42 |
43 |
44 |
45 | 46 | 47 | -------------------------------------------------------------------------------- /assets/jquery/eq_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :eq(index) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element>:eq(index)

17 |

概述

18 |
19 |

匹配一个给定索引值的元素

20 |
21 |

22 |
23 |
24 |

参数

25 |
26 |

indexNumberV1.0

27 |

从 0 开始计数

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

查找第二行

34 |
HTML 代码:
35 |
<table>
36 |   <tr><td>Header 1</td></tr>
37 |   <tr><td>Value 1</td></tr>
38 |   <tr><td>Value 2</td></tr>
39 | </table>
40 |
jQuery 代码:
41 |
$("tr:eq(1)")
42 |
结果:
43 |
[ <tr><td>Value 1</td></tr> ]
44 |
45 |
46 |
47 | 48 | 49 | -------------------------------------------------------------------------------- /assets/jquery/end.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | end() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQueryend()

17 |

V1.0概述

18 |
19 |

回到最近的一个"破坏性"操作之前。即,将匹配的元素列表变为前一次的状态。

20 |
21 |

如果之前没有破坏性操作,则返回一个空集。所谓的"破坏性"就是指任何改变所匹配的jQuery元素的操作。这包括在 Traversing 中任何返回一个jQuery对象的函数--'add', 'andSelf', 'children', 'filter', 'find', 'map', 'next', 'nextAll', 'not', 'parent', 'parents', 'prev', 'prevAll', 'siblings' and 'slice'--再加上 Manipulation 中的 'clone'。

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

选取所有的p元素,查找并选取span子元素,然后再回过来选取p元素

29 |
HTML 代码:
30 |
<p><span>Hello</span>,how are you?</p>
31 |
jQuery 代码:
32 |
$("p").find("span").end()
33 |
结果:
34 |
[ <p><span>Hello</span> how are you?</p> ]
35 |
36 |
37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /assets/jquery/keyup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | keyup([[data],fn]) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQuerykeyup([[data],fn])

17 |

概述

18 |
19 |

当按钮被松开时,发生 keyup 事件。它发生在当前获得焦点的元素上。

20 |
21 |

注释:如果在文档元素上进行设置,则无论元素是否获得焦点,该事件都会发生。

22 |
23 |
24 |

参数

25 |
26 |

fnFunctionV1.0

27 |

在每一个匹配元素的keyup事件中绑定的处理函数。

28 |

[data],fnString,FunctionV1.4.3

29 |

data:keyup([Data], fn) 可传入data供函数fn处理。

30 |

fn:在每一个匹配元素的keyup事件中绑定的处理函数。

31 |
32 |
33 |

示例

34 | 35 |

描述:

36 |

当按下按键时,改变文本域的颜色:

37 |
jQuery 代码:
38 |
$("input").keyup(function(){
39 |   $("input").css("background-color","#D6D6FF");
40 | });
41 |
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/jquery/mouseup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mouseup([[data],fn]) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQuerymouseup([[data],fn])

17 |

概述

18 |
19 |

当在元素上放松鼠标按钮时,会发生 mouseup 事件。

20 |
21 |

与 click 事件不同,mouseup 事件仅需要放松按钮。当鼠标指针位于元素上方时,放松鼠标按钮就会触发该事件。

22 |
23 |
24 |

参数

25 |
26 |

fnFunctionV1.0

27 |

在每一个匹配元素的mouseup事件中绑定的处理函数。

28 |

[data],fnString,FunctionV1.4.3

29 |

data:mouseup([Data], fn) 可传入data供函数fn处理。

30 |

fn:在每一个匹配元素的mouseup事件中绑定的处理函数。

31 |
32 |
33 |

示例

34 | 35 |

描述:

36 |

当松开鼠标按钮时,隐藏或显示元素:

37 |
jQuery 代码:
38 |
$("button").mouseup(function(){
39 |   $("p").slideToggle();
40 | });
41 |
42 |
43 |
44 | 45 | -------------------------------------------------------------------------------- /assets/jquery/target.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :target 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:jQuery:target

17 |

V1.9概述

18 |
19 |

选择由文档URI的格式化识别码表示的目标元素。

20 |
21 |

如果文档的URI包含一个格式化的标识符,或hash(哈希), 然后:target选择器将匹配ID和标识符相匹配的元素。  例如,给定的URI http://example.com/#foo, $( "p:target" ),将选择<p id="foo">元素。

22 |

这个不寻常的用法,可进一步讨论中找到 W3C CSS specification.

23 |
24 |
25 | 30 |
31 |

示例

32 |

Return which DOM element triggered the event

33 |
$("p, button, h1, h2").click(function(event){
  $("div").html("Triggered by a " + event.target.nodeName + " element.");
});
34 |
35 |
36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /assets/jquery/callbacks.fired.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | callbacks.fired() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Booleancallbacks.fired()

17 |

V1.7概述

18 |
19 |

用给定的参数调用所有的回调。

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

使用callbacks.fired() 确定,如果列表中的回调至少有一次被呼叫

29 |
jQuery 代码:
30 |
// a sample logging function to be added to a callbacks list
31 | var foo = function( value ){
32 |     console.log( 'foo:' + value );
33 | }
34 | 
35 | var callbacks = $.Callbacks();
36 | 
37 | // add the function 'foo' to the list
38 | callbacks.add( foo );
39 | 
40 | // fire the items on the list
41 | callbacks.fire( 'hello' ); // outputs: 'foo: hello'
42 | callbacks.fire( 'world '); // outputs: 'foo: world'
43 | 
44 | // test to establish if the callbacks have been called
45 | console.log( callbacks.fired() );
46 |
47 |
48 |
49 | 50 | -------------------------------------------------------------------------------- /assets/jquery/contains.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | :contains(text) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Array<Element(s)>:contains(text)

17 |

概述

18 |
19 |

匹配包含给定文本的元素

20 |
21 |

22 |
23 |
24 |

参数

25 |
26 |

textStringV1.1.4

27 |

一个用以查找的字符串

28 |
29 |
30 |

示例

31 | 32 |

描述:

33 |

查找所有包含 "John" 的 div 元素

34 |
HTML 代码:
35 |
<div>John Resig</div>
36 | <div>George Martin</div>
37 | <div>Malcom John Sinclair</div>
38 | <div>J. Ohn
39 |
jQuery 代码:
40 |
$("div:contains('John')")
41 |
结果:
42 |
[ <div>John Resig</div>, <div>Malcom John Sinclair</div> ]
43 |
44 |
45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /assets/jquery/event.pageY.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | event.pageY 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Numberevent.pageX

17 |

V1.0.4概述

18 |
19 |

鼠标相对于文档的左边缘的位置。

20 |
21 |
22 |
23 |

示例

24 | 25 |

描述:

26 |

显示鼠标相对于文件的左侧和顶部边缘的位置(在iframe中)。

27 |
代码:
28 |
<!DOCTYPE html>
29 |   <html>
30 |   <head>
31 |     <style>body{ background-color: #eef; }div{ padding: 20px; }</style>
32 |     <script src="http://code.jquery.com/jquery-latest.min.js"></script>
33 |   </head>
34 |   <body>
35 |     <div id="log"></div>
36 |   <script>
37 |    $(document).bind('mousemove',function(e){
38 |        $("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
39 |    });
40 |  </script>
41 |     </body>
42 |   </html>
43 |
44 |
45 |
46 | 47 | -------------------------------------------------------------------------------- /assets/jquery/callbacks.disable.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | callbacks.disable() 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:undefinedcallbacks.disable()

17 |

V1.7概述

18 |
19 |

禁用回调列表中的回调

20 |
21 |

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

使用 callbacks.disable() 禁用回调列表:

29 |
jQuery 代码:
30 |
// a sample logging function to be added to a callbacks list
31 | var foo = function( value ){
32 |     console.log( value );
33 | }
34 | 
35 | var callbacks = $.Callbacks();
36 | 
37 | // add the above function to the list
38 | callbacks.add( foo );
39 | 
40 | // fire the items on the list
41 | callbacks.fire( 'foo' ); // outputs: foo
42 | 
43 | // disable further calls being possible
44 | callbacks.disable();
45 | 
46 | // attempt to fire with 'foobar' as an argument
47 | callbacks.fire( 'foobar' ); // foobar isn't output
48 |
49 |
50 |
51 | 52 | -------------------------------------------------------------------------------- /assets/jquery/event.pageX.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | event.pageX 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Numberevent.pageX

17 |

V1.0.4概述

18 |
19 |

鼠标相对于文档的左边缘的位置。

20 |
21 |
22 |
23 |

示例

24 | 25 |

描述:

26 |

显示鼠标相对于文件的左侧和顶部边缘的位置(在iframe中)。

27 |
代码:
28 |
<!DOCTYPE html>
29 |   <html>
30 |   <head>
31 |     <style>body{ background-color: #eef; }div{ padding: 20px; }</style>
32 |     <script src="http://code.jquery.com/jquery-latest.min.js"></script>
33 |   </head>
34 |   <body>
35 |     <div id="log"></div>
36 |   <script>
37 |    $(document).bind('mousemove',function(e){
38 |        $("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY);
39 |    });
40 |  </script>
41 |     </body>
42 |   </html>
43 |
44 |
45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /assets/jquery/event.result.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | event.result 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Objectevent.result

17 |

V1.3概述

18 |
19 |

这个属性包含了当前事件事件最后触发的那个处理函数的返回值,除非值是 undefined 。

20 |
21 |
22 |
23 |

示例

24 | 25 |

描述:

26 |

显示前一个事件处理函数的返回值。

27 |
代码:
28 |
<!DOCTYPE html>
29 |   <html>
30 |   <head>
31 |     <script src="http://code.jquery.com/jquery-latest.min.js"></script>
32 |   </head>
33 |   <body>
34 |       <button>display event.result</button>
35 |       <p></p>
36 |       <script>
37 |        $("button").click(function(event) {    return "hey";  });
38 |        $("button").click(function(event) {
39 |            $("p").html( event.result );
40 |        });
41 |     </script>
42 |     </body>
43 |   </html>
44 |
45 |
46 |
47 | 48 | -------------------------------------------------------------------------------- /assets/jquery/jquery.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $.fn.jquery 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:String$.fn.jquery

17 |

V1.0概述

18 |
19 |

代表 jQuery 版本号的字符串。

20 |
21 |

.jquery 属性是通过 jQuery 原型赋值的,通过使用它的别名 $.fn 进行引用。它是一个含有 jQuery 版本号的字符串,例如 "1.5.0" 或 "1.4.4".

22 |
23 |
24 |
25 |

示例

26 | 27 |

描述:

28 |

判断一个对象是否是 jQuery 对象。

29 |
jQuery 代码:
30 |
var a = { what: "A regular JS object" },
31 |       b = $('body');
32 |          if ( a.jquery ) { // falsy, since it's undefined
33 |       alert(' a is a jQuery object! ');
34 |       }    if ( b.jquery ) { // truthy, since it's a string
35 |       alert(' b is a jQuery object! ');
36 |   }
37 |

描述:

38 |

取得页面上当前使用的 jQuery 的版本号。

39 |
jQuery 代码:
40 |
alert( 'You are running jQuery version: ' + $.fn.jquery );
41 |
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /assets/jquery/deferred.always.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | deferred.always(alwaysCallbacks,[alwaysCallbacks]) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |

返回值:Deferred Objectdeferred.always(alwaysCallbacks,[alwaysCallbacks])

17 |

概述

18 |
19 |

当递延对象是解决或拒绝时被调用添加处理程序。

20 |
21 |

22 |
23 |
24 |

参数

25 |
26 |

alwaysCallbacksV1.6

27 |

一个函数,或者函数数组,当递延对象是解决或拒绝时被调用。

28 |

alwaysCallbacksV1.6

29 |

附加可选的一个函数,或者函数数组,当递延对象是解决或拒绝时被调用。

30 |
31 |
32 |

示例

33 | 34 |

描述:

35 |

jQuery.get()方法返回一个来自一个延迟的对象的jqXHR对象,我们可以附加一个成功和错误使用deferred.always()方法的回调。

36 |
jQuery 代码:
37 |
$.get("test.php").always( function() { 
38 |   alert("$.get completed with success or error callback arguments"); 
39 | } );
40 |
41 |
42 |
43 | 44 | 45 | --------------------------------------------------------------------------------