diff --git a/README.md b/README.md index 045294b..aaad175 100644 --- a/README.md +++ b/README.md @@ -1,1030 +1,321 @@ -https://github.com/AutumnsWind/Front-end-tutorial -资源教程: - -1. 综合类 - - - [前端知识体系](http://www.cnblogs.com/sb19871023/p/3894452.html) - - [前端知识结构](https://github.com/JacksonTian/fks) - - [Web前端开发大系概览](https://github.com/unruledboy/WebFrontEndStack) - - [Web前端开发大系概览-中文版](http://www.cnblogs.com/unruledboy/p/WebFrontEndStack.html) - - [Web Front-end Stack v2.2](https://raw.githubusercontent.com/unruledboy/WebFrontEndStack/master/Web%20Front%20End%20Stack.png) - - [免费的编程中文书籍索引](https://github.com/justjavac/free-programming-books-zh_CN) - - [前端书籍](https://github.com/dypsilon/frontend-dev-bookmarks) - - [前端免费书籍大全](https://github.com/vhf/free-programming-books) - - [前端知识体系](http://www.cnblogs.com/sb19871023/p/3894452.html) - - [免费的编程中文书籍索引](https://github.com/justjavac/free-programming-books-zh_CN) - - [智能社 - 精通JavaScript开发](http://study.163.com/course/introduction/224014.htm) - - [重新介绍 JavaScript(JS 教程)](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/A_re-introduction_to_JavaScript) - - [麻省理工学院公开课:计算机科学及编程导论](http://v.163.com/special/opencourse/bianchengdaolun.html) - - [JavaScript中的this陷阱的最全收集--没有之一](http://segmentfault.com/a/1190000002640298) - - [JS函数式编程指南](https://llh911001.gitbooks.io/mostly-adequate-guide-chinese/content/ch1.html) - - [JavaScript Promise迷你书(中文版)](http://liubin.github.io/promises-book/) - - [腾讯移动Web前端知识库](https://github.com/AlloyTeam/Mars) - - [Front-End-Develop-Guide 前端开发指南](https://github.com/Front-End-Developers-Hunan/Front-End-Develop-Guide) - - [前端开发笔记本](https://li-xinyang.gitbooks.io/frontend-notebook/content/) - - [大前端工具集 - 聂微东](https://github.com/nieweidong/fetool) - - [前端开发者手册](https://dwqs.gitbooks.io/frontenddevhandbook/content/) - -2. 入门类 - - - [前端入门教程](http://www.cnblogs.com/jikey/p/3613082.html) - - [瘳雪峰的Javascript教程](http://www.liaoxuefeng.com/wiki/001434446689867b27157e896e74d51a89c25cc8b43bdb3000) - - [jQuery基础教程](http://www.imooc.com/view/11) - - [前端工程师必备的PS技能——切图篇](http://www.imooc.com/view/506) - - [结合个人经历总结的前端入门方法](https://github.com/qiu-deqing/FE-learning) - -3. 效果类 - - - [弹出层](http://www.imooc.com/learn/58) - - [焦点图轮播特效](http://www.imooc.com/learn/18) - -4. 工具类 - - - [css sprite 雪碧图制作](http://www.imooc.com/learn/93) - - [版本控制入门 – 搬进 Github](http://www.imooc.com/learn/390) - - [Grunt-beginner前端自动化工具](http://www.imooc.com/learn/30) - -5. 慕课专题 - - - [张鑫旭 - 慕课系列](http://www.imooc.com/space/teacher/id/197450) - - [lyn - 慕课系列](http://www.imooc.com/space/teacher/id/104593) - - [艾伦 - 慕课系列](http://www.imooc.com/space/teacher/id/290139) - - [碧仔 - Hello,移动WEB](http://www.imooc.com/view/494) - -6. 周报类 - - - [平安科技移动开发二队技术周报](https://github.com/PaicHyperionDev/MobileDevWeekly) - -###六. API: - -####1. 总目录 - -1. 开发中心 - - - [mozilla js参考](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript) - - [chrome开发中心(chrome的内核已转向blink)](https://developer.chrome.com/extensions/api_index.html) - - [safari开发中心](https://developer.apple.com/library/safari/navigation) - - [microsoft js参考](https://msdn.microsoft.com/zh-cn/library/d1et7k7c(v=vs.94).aspx) - - [js秘密花园](http://sanshi.me/articles/JavaScript-Garden-CN/html/index.html) - - [js秘密花园](http://bonsaiden.github.io/JavaScript-Garden/zh/) - - [w3help](http://www.w3help.org/) 综合Bug集合网站 - -2. 综合搜索 - - - [javascripting](http://www.javascripting.com/) - - [各种流行库搜索](http://microjs.com/) - -3. 综合API - - - [runoob.com-包含各种API集合](http://www.runoob.com/) - - [开源中国在线API文档合集](http://tool.oschina.net/apidocs) - - [devdocs](http://devdocs.io/) 英文综合API网站 - -####2. jQuery - -* [jQuery API 中文文档](http://www.jquery123.com/) -* [hemin 在线版](http://hemin.cn/jq/) -* [css88 jq api](http://www.css88.com/jqapi-1.9/on/) -* [css88 jqui api](http://www.css88.com/jquery-ui-api/) -* [学习jquery](http://learn.jquery.com/) -* [jquery 源码查找](http://james.padolsey.com/jquery/) - -####3. Ecmascript - -- [Understanding ECMAScript 6 - Nicholas C. Zakas](https://leanpub.com/understandinges6/read) -- [exploring-es6](https://leanpub.com/exploring-es6/read) -- [exploring-es6翻译](https://github.com/es6-org/exploring-es6) -- [exploring-es6翻译后预览](http://es6-org.github.io/exploring-es6/) -- [阮一峰 es6](http://es6.ruanyifeng.com/) -- [阮一峰 Javascript](http://javascript.ruanyifeng.com/) -- [ECMA-262,第 5 版](http://yanhaijing.com/es5/) -- [es5](http://es5.github.io/) - -####4. Js template - -- [template-chooser](http://garann.github.io/template-chooser/) -- [artTemplate](https://github.com/aui/artTemplate) -- [tomdjs](https://github.com/aui/tmodjs/blob/master/README.md) -- [淘宝模板juicer模板](http://juicer.name/docs/docs_zh_cn.html) -- [Fxtpl v1.0 繁星前端模板引擎](http://koen301.github.io/fxtpl/) -- [laytpl](http://laytpl.layui.com/) -- [mozilla - nunjucks](https://github.com/mozilla/nunjucks) -- [Juicer](https://github.com/PaulGuo/Juicer) -- [dustjs](http://akdubya.github.io/dustjs/) -- [etpl](http://ecomfe.github.io/etpl/) - -####5. 弹出层 - -- [artDialog 最新版](https://github.com/aui/artDialog) -- [artDialog 文档](http://aui.github.io/artDialog/doc/index.html) -- [google code 下载地址](https://code.google.com/p/artdialog/downloads/list) -- [贤心弹出层](http://layer.layui.com/) -- [响应式用户交互组件库](https://github.com/bh-lay/UI) -- [sweetalert-有css3动画弹出层](http://t4t5.github.io/sweetalert/) - -####6. CSS - -- [CSS 语法参考](http://tympanus.net/codrops/css_reference/) -- [CSS3动画手册](http://isux.tencent.com/css3/index.html) -- [腾讯css3动画制作工具](http://isux.tencent.com/css3/tools.html) -- [志爷css小工具集合](http://linxz.github.io/tianyizone/) -- [css3 js 移动大杂烩](http://www.note12.com/category/blog/2014-6-5/538fe0a9f786f1b7019a4dfb) -- [bouncejs 触摸库](http://bouncejs.com/) -- [css3 按钮动画](http://fian.my.id/Waves/) -- [animate.css](http://daneden.github.io/animate.css/) -- [全局CSS的终结(狗带) [译]](http://www.alloyteam.com/2015/10/8536/) - -####7. Angularjs - -- [Angular.js 的一些学习资源](https://github.com/dolymood/AngularLearning) -- [angularjs中文社区](http://angularjs.cn/) -- [Angularjs源码学习](http://www.cnblogs.com/xuwenmin888/p/3739096.html) -- [Angularjs源码学习](http://www.ifeenan.com/?c=AngularJS) -- [angular对bootstrap的封装](http://angular-ui.github.io/bootstrap/) -- [angularjs + nodejs](https://cnodejs.org/topic/51404e0f069911196d2e3923) -- [吕大豹 Angularjs](http://www.cnblogs.com/lvdabao/tag/AngularJs/) -- [AngularJS 最佳实践](http://www.infoq.com/cn/news/2013/02/angular-web-app) -- [Angular的一些扩展指令](http://www.lovelucy.info/angularjs-best-practices.html) -- [Angular数据绑定原理](https://github.com/Pasvaz/bindonce) -- [一些扩展Angular UI组件](https://github.com/angular-ui/) -- [Ember和AngularJS的性能测试](http://voidcanvas.com/emberjs-vs-angularjs-performance-testing/) -- [带你走近AngularJS - 基本功能介绍](http://www.cnblogs.com/powertoolsteam/p/angularjs-introdection.html) -- [Angularjs开发指南](http://angular.duapp.com/docs/guide) -- [Angularjs学习](http://www.cnblogs.com/amosli/p/3710648.html) -- [不要带着jQuery的思维去学习AngularJS](http://www.rainweb.cn/article/angularjs-jquery.html) -- [angularjs 学习笔记](http://wangjiatao.diandian.com/?tag=angularjs) -- [angularjs 开发指南](http://www.angularjs.cn/T008) -- [angularjs 英文资料](https://github.com/jmcunningham/AngularJS-Learning) -- [angular bootstrap](http://angular-ui.github.io/bootstrap/) -- [angular jq mobile](https://github.com/opitzconsulting/jquery-mobile-angular-adapter) -- [angular ui](http://mgcrea.github.io/angular-strap/) -- [整合jQuery Mobile+AngularJS经验谈](http://www.tuicool.com/articles/7ZZVr2) -- [有jQuery背景,该如何用AngularJS编程思想](http://blog.jobbole.com/46589/ ) -- [AngularJS在线教程](http://each.sinaapp.com/angular/) -- [angular学习笔记](http://www.zouyesheng.com/angular.html) - -####8. React -- [react.js 中文论坛](http://www.react-china.org/) -- [react.js 官方网址](https://facebook.github.io/react/index.html) -- [react.js 官方文档](https://facebook.github.io/react/docs/getting-started.html) -- [react.js material UI](http://material-ui.com/#/) -- [react.js TouchstoneJS UI](http://touchstonejs.io/) -- [react.js amazeui UI](http://amazeui.org/react/) -- [React 入门实例教程 - 阮一峰](http://www.ruanyifeng.com/blog/2015/03/react.html) -- [React Native 中文版](http://wiki.jikexueyuan.com/project/react-native/) -- [Webpack 和 React 小书 - 前端乱炖](http://www.html-js.com/article/Fakefish%203053) -- [Webpack 和 React 小书 - gitbook](https://fakefish.github.io/react-webpack-cookbook/) -- [webpack](https://github.com/webpack/webpack) -- [Webpack,101入门体验](http://html-js.com/article/3009) -- [webpack入门教程](http://html-js.com/article/3113) -- [基于webpack搭建前端工程解决方案探索](http://segmentfault.com/a/1190000003499526) -- [React原创实战视频教程](http://www.piliyu.com/) - -####9. 移动端API - -1. API - - [99移动端知识集合](https://github.com/jtyjty99999/mobileTech) - - [移动端前端开发知识库](https://github.com/AlloyTeam/Mars) - - [移动前端的一些坑和解决方法(外观表现)](http://caibaojian.com/mobile-web-bug.html) - - [【原】移动web资源整理](http://www.cnblogs.com/PeunZhang/p/3407453.html) - - [zepto 1.0 中文手册](http://mweb.baidu.com/zeptoapi/) - - [zepto 1.0 中文手册](http://www.html-5.cn/Manual/Zepto/) - - [zepto 1.1.2](http://www.css88.com/doc/zeptojs_api/) - - [zepto 中文注释](http://www.cnblogs.com/sky000/archive/2013/03/29/2988952.html) - - [jqmobile 手册](http://app-framework-software.intel.com/api.php) - - [移动浏览器开发集合](https://github.com/maxzhang/maxzhang.github.com/issues) - - [移动开发大杂烩](https://github.com/hoosin/mobile-web-favorites) - - [微信webview中的一些问题](http://lin-chao.github.io/2014/11/14/%E5%BE%AE%E4%BF%A1webview%E4%B8%AD%E7%9A%84%E4%B8%80%E4%BA%9B%E9%97%AE%E9%A2%98/) -2. 框架 - - [特色的HTML框架可以创建精美的iOS应用](http://framework7.taobao.org/) - - [淘宝SUI](http://m.sui.taobao.org/) - -####10. avalon - -- [avalonjs](http://avalonjs.github.io/) -- [Avalon新一代UI库: OniUI](http://ued.qunar.com/oniui/index.html) -- [avalon.oniui-基于avalon的组件库](https://github.com/RubyLouvre/avalon.oniui) -- []() - -####11. Requriejs - -- [Javascript模块化编程(一):模块的写法 ](http://www.ruanyifeng.com/blog/2012/10/javascript_module.html) -- [Javascript模块化编程(二):AMD规范](http://www.ruanyifeng.com/blog/2012/10/asynchronous_module_definition.html) -- [Javascript模块化编程(三):require.js的用法](http://www.ruanyifeng.com/blog/2012/11/require_js.html) -- [RequireJS入门(一)](http://www.cnblogs.com/snandy/archive/2012/05/22/2513652.html) -- [RequireJS入门(二)](http://www.cnblogs.com/snandy/archive/2012/05/23/2513712.html) -- [RequireJS进阶(三)](http://www.cnblogs.com/snandy/archive/2012/06/08/2538001.html) -- [requrie源码学习](http://www.cnblogs.com/yexiaochai/p/3632580.html ) -- [requrie 入门指南](http://www.oschina.net/translate/getting-started-with-the-requirejs-library ) -- [requrieJS 学习笔记](http://www.cnblogs.com/yexiaochai/p/3214926.html ) -- [requriejs 其一 ](http://cyj.me/why-seajs/requirejs/ ) -- [require backbone结合](http://www.cnblogs.com/yexiaochai/p/3221081.html ) - -####12. Seajs - -- [seajs](http://seajs.org/) -- [seajs 中文手册](http://cyj.me/why-seajs/zh/) - -####13. Less,sass - -- [sass](http://www.w3cplus.com/sassguide/) -- [sass教程-sass中国](http://www.sass.hk/) -- [Sass 中文文档](http://sass.bootcss.com/) -- [less](http://less.bootcss.com/) - -####14. Markdown - -- [Markdown 语法说明 (简体中文版)](http://wowubuntu.com/markdown/) -- [markdown入门参考](https://github.com/LearnShare/Learning-Markdown/blob/master/README.md) -- [gitbook](https://www.gitbook.com/) 国外的在线markdown可编辑成书 -- [mdeditor](https://www.zybuluo.com/mdeditor) 一款国内的在线markdown编辑器 -- [stackedit](https://stackedit.io) 国外的在线markdown编辑器,功能强大,同步云盘 -- [mditor](http://bh-lay.github.io/mditor/) 一款轻量级的markdown编辑器 -- [lepture-editor](https://github.com/lepture/editor) -- [markdown-editor](https://github.com/jbt/markdown-editor) - -####15. D3 - -- [d3 Tutorials](https://github.com/mbostock/d3/wiki/Tutorials) -- [Gallery](https://github.com/mbostock/d3/wiki/Gallery) -- [lofter](http://datavisual.lofter.com/post/40cf3a_188e535) -- [iteye](http://alanland.iteye.com/blog/1878595) -- [ruanyifeng](http://javascript.ruanyifeng.com/library/d3.html) - -####16. 兼容性 - -- [esma 兼容列表](http://kangax.github.io/compat-table/es6/) -- [W3C CSS验证服务](http://jigsaw.w3.org/css-validator/validator.html.zh-cn) -- [caniuse](http://caniuse.com/#index ) -- [csscreator](http://csscreator.com/properties) -- [microsoft](https://msdn.microsoft.com/zh-cn/library/cc351024(v=vs.85).aspx) -- [在线测兼容-移动端](http://www.responsinator.com/) -- [emulators](https://www.manymo.com/emulators) - -####17. UI相关 - -- [bootcss](http://v3.bootcss.com/) -- [MetroUICSS](http://www.w3cplus.com/MetroUICSS/) -- [semantic](http://semantic-ui.com/) -- [Buttons](http://alexwolfe.github.io/Buttons/) -- [kitecss](http://hiloki.github.io/kitecss/) -- [pintuer](http://www.pintuer.com/) -- [amazeui](http://amazeui.org/) -- [worldhello](http://www.worldhello.net/gotgithub/index.html) -- [linuxtoy](http://igit.linuxtoy.org/contents.html) -- [gitmagic](http://www-cs-students.stanford.edu/~blynn/gitmagic/intl/zh_cn/) -- [rogerdudler](http://rogerdudler.github.io/git-guide/index.zh.html) -- [gitref](http://gitref.justjavac.com/) -- [book](http://git-scm.com/book/zh) -- [gogojimmy](http://gogojimmy.net/2012/01/17/how-to-use-git-1-git-basic/) - -####18. HTTP - -- [HTTP API 设计指南](http://segmentfault.com/bookmark/1230000002521721) - -####19. 其它API - -- [javascript流行库汇总](javascriptoo) -- [验证api](http://niceue.com/validator/demo/index.php) -- [underscore 中文手册](http://www.css88.com/doc/underscore/) -- [underscore源码分析](http://www.html-js.com/article/Underscorejs-source-code-analysis-of-underscorejs-source-code-analysis%203031) -- [underscore源码分析-亚里士朱德的博客](http://yalishizhude.github.io/tags/underscore/) -- [underscrejs en api](http://underscorejs.org/) -- [lodash - underscore的代替品](https://lodash.com/) -- [ext4api](http://extjs-doc-cn.github.io/ext4api/) -- [backbone 中文手册](http://www.csser.com/tools/backbone/backbone.js.html) -- [qwrap手册](http://dev.qwrap.com/resource/js/_docs/_youa/#/qw/base/loadJs_.htm) -- [缓动函数](http://easings.net/zh-cn) -- [svg 中文参考](http://www.w3school.com.cn/svg/svg_reference.asp) -- [svg mdn参考](https://developer.mozilla.org/en-US/docs/Web/SVG) -- [svg 导出 canvas](https://github.com/gabelerner/canvg) -- [svg 导出 png](https://github.com/exupero/saveSvgAsPng) -- [ai-to-svg](http://www.zamzar.com/convert/ai-to-svg/) -- [localStorage 库](https://github.com/machao/localStorage) - -####20. 图表类 - -- [Highcharts 中文API](http://www.hcharts.cn/api/index.php) -- [Highcharts 英文API](http://api.highcharts.com/highcharts) -- [ECharts 百度的图表软件](http://echarts.baidu.com/ ) -- [高德地图](http://lbs.amap.com/api/) -- [开源的矢量图脚本框架](http://paperjs.org/) -- [svg 地图](http://jvectormap.com/) - -####21. vue - -- [Vue](http://cn.vuejs.org/) -- [Vue 论坛](http://forum.vuejs.org/) -- [Vue 入门指南](http://www.cnblogs.com/aaronjs/p/3660102.html) -- [Vue 的一些资源索引](http://segmentfault.com/a/1190000000411057) -- []() - -####21. 正则 - -- [JS正则表达式元字符](http://segmentfault.com/a/1190000002471140) -- [正则表达式30分钟入门教程](http://deerchao.net/tutorials/regex/regex.htm) -- [MDN-正则表达式](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Guide/Regular_Expressions) -- [ruanyifeng - RegExp对象](http://javascript.ruanyifeng.com/stdlib/regexp.html) -- [小胡子哥 - 进阶正则表达式](http://div.io/topic/764?page=1) -- [is.js](https://github.com/Cedriking/is.js/blob/master/is.js) -- [正则在线测试](http://regexper.com/) -- []() - -####22. ionic - -- [ionic](https://github.com/ychow/ionic-guide) - -####23. 其它 - -- [Mock.js 是一款模拟数据生成器](http://mockjs.com/) - -###七. 开发规范 - -1. 前端 - - [通过分析github代码库总结出来的工程师代码书写习惯](http://alloyteam.github.io/CodeGuide) - - [HTML&CSS编码规范 by @mdo](http://codeguide.bootcss.com/) - - [团队合作的css命名规范-腾讯AlloyTeam前端团队](http://www.alloyteam.com/2011/10/107/) - - [前端编码规范之js - by yuwenhui](http://yuwenhui.github.io/) - - [前端编码规范之js - by 李靖](http://www.cnblogs.com/hustskyking/p/javascript-spec.html) - - [前端开发规范手册](http://zhibimo.com/read/Ashu/front-end-style-guide/) - - [Airbnb JavaScript 编码规范(简体中文版)](https://github.com/yuche/javascript#table-of-contents) - - [AMD与CMD规范的区别](http://www.zhihu.com/question/20351507) - - [AMD与CMD规范的区别](http://www.cnblogs.com/tugenhua0707/p/3507957.html) - - [KISSY 源码规范](http://docs.kissyui.com/1.4/docs/html/tutorials/style-guide/kissy-source-style.html) - - [bt编码规范](http://codeguide.bootcss.com/) - - [规范加强版](https://github.com/Suxiaogang/Code_Guide) - - [前端代码规范 及 最佳实践](http://blog.jobbole.com/79075/) - - [百度前端规范](http://coderlmn.github.io/code-standards/) - - [百度前端规范](http://isobar-idev.github.io/code-standards/) - - [百度前端规范](http://zhuanlan.zhihu.com/fuyun/19884834) - - [ECMAScript6 编码规范--广发证券前端团队](https://github.com/gf-rd/es6-coding-style) - - [JavaScript 风格指南/编码规范(Airbnb公司版)](http://blog.jobbole.com/79484/) - - [网易前端开发规范](http://nec.netease.com/standard) - - [css模块](http://www.75team.com/archives/1049) - - [前端规范资源列表](https://github.com/ecomfe/spec) - -2. PHP - - - [最流行的PHP 代码规范](http://segmentfault.com/a/1190000000443795) - - [最流行的PHP 代码规范](https://github.com/hfcorriez/fig-standards/blob/zh_CN/%E6%8E%A5%E5%8F%97/PSR-2-coding-style-guide.md) - -3. Android - - - [【敏捷开发】Android团队开发规范](http://www.cnblogs.com/lcw/p/3619181.html) - - [Android 开发规范与应用](http://www.jianshu.com/p/4390f4fe19b3) - -###八. 其它收集 - -####1. 各大公司开源项目 - -- [Facebook Projects](https://code.facebook.com/projects/web/) -- [百度web前端研发部](http://fex.baidu.com/) -- [百度EFE](http://efe.baidu.com/) -- [百度github](https://github.com/fex-team/) -- [alloyteam](http://www.alloyteam.com/) -- [alloyteam-github](http://alloyteam.github.io/) -- [alloyteam-AlloyGameEngine](https://github.com/AlloyTeam/AlloyGameEngine) -- [AlloyDesigner](http://alloyteam.github.io/AlloyDesigner/) 即时修改,即时保存,设计稿较正,其它开发辅助工具 -- [H5交互页编辑器AEditor介绍](http://www.alloyteam.com/2015/06/h5-jiao-hu-ye-bian-ji-qi-aeditor-jie-shao/) H5动画交互页开发的工具介绍 -- [AEditor](http://aeditor.alloyteam.com/) H5动画交互页开发的工具 -- [maka](http://forum.maka.im/wordpress/) -- [值得订阅的weekly](https://github.com/fenbility/weekly-feed) -- [腾讯html5](http://cube.qq.com/) -- [奇舞团开源项目](http://75team.github.io/) -- [Qunar UED](http://ued.qunar.com/) - -####2. Javascript - -1. 常用 - - - [ieBetter.js-让IE6-IE8拥有IE9+,Chrome等浏览器特性](http://www.zhangxinxu.com/wordpress/2013/12/iebetter-js-make-ie6-ie8-like-modern-browser-ie9-chrome/) - - [模拟键盘](http://mottie.github.io/Keyboard/) - - [拼音](https://github.com/hotoo/pinyin) - - [中国个人身份证号验证](https://github.com/mc-zone/IDValidator) - -2. 算法 - - - [数据结构与算法 JavaScript 描述. 章节练习](https://github.com/Ralph-Wang/algorithm.in.js) - - [常见排序算法(JS版)](https://github.com/twobin/twobinSort) - - [经典排序](https://github.com/luofei2011/jsAgm/blob/master/js/sort.js) - - [常见排序算法-js版本](https://github.com/hechangmin/jssort) - - [JavaScript 算法与数据结构 精华集](https://github.com/lightningtgc/JavaScript-Algorithms) - - [面试常考算法题精讲](http://www.nowcoder.com/live/courses) - - []() - -3. 移动端 - - - [fastclick](https://github.com/ftlabs/fastclick) - - [no-click-delay](https://github.com/mmastrac/jquery-noclickdelay) - -4. JSON - - - [模拟生成JSON数据](http://beta.json-generator.com/) - - [返回跨域JSONAPI](http://jsonp.afeld.me/) - -####3. Html5 -- [HTML5 有哪些让你惊艳的 demo?](http://www.zhihu.com/question/24398907) - -####4. CSS -- [browserhacks](http://browserhacks.com/) -- []() - -####5. jQuery - -1. 焦点图 - - - [myfocus](https://github.com/koen301/myfocus) - - [myfocus-官方演示站](http://www.chhua.com/myfocus/) - - [SuperSlidev2.1 -- 大话主席](http://www.superslide2.com/) - - [soChange](http://www.bujichong.com/sojs/soChange/index.html) - -####6. Ext, EasyUI, J-UI 及其它各种UI方案 - -1. Ext - - - [extjs](https://www.sencha.com/products/extjs/) - - [ext4英文api](http://docs.sencha.com/extjs/4.0.7/) - - [ext4中文api](http://extjs-doc-cn.github.io/ext4api/) - - []() - -2. EasyUI - - - [jquery easyui 未压缩源代码](http://jquery-easyui.googlecode.com/svn/trunk/src/) - -3. J-UI - - - [J-UI](http://jui.org/) - -4. Other - - - [MUI-最接近原生APP体验的高性能前端框架](http://dcloudio.github.io/mui/) - - [Amaze UI | 中国首个开源 HTML5 跨屏前端框架](http://amazeui.org/) - - [淘宝 HTML5 前端框架](http://m.sui.taobao.org/) - - [KISSY - 阿里前端JavaScript库](http://docs.kissyui.com/) - - [网易Nej - Nice Easy Javascript](http://nej.netease.com/) - - [Kendo UI MVVM Demo](http://demos.telerik.com/kendo-ui/mvvm/index) - - [Bootstrap](http://www.bootcss.com/) - - [Smart UI](http://smartui.chinamzz.com/) - - [雅虎UI - CSS UI](http://developer.yahoo.com/yui/grids/) - -####7. 页面 社会化 分享功能 - -- [百度分享](http://share.baidu.com/) pc端 -- [JiaThis](http://jiathis.com/) pc端 -- [社会化分享组件](http://developer.baidu.com/soc/share) 移动端 -- [ShareSDK 轻松实现社会化功能](http://www.mob.com/#/index) 移动端 -- [友盟分享](http://dev.umeng.com/social/android/quick-integration) 移动端 - -####8. 富文本编辑器 - -- [百度 ueditor](http://ueditor.baidu.com/website/) -- [经典的ckeditor](http://ckeditor.com/) -- [经典的kindeditor](http://kindeditor.net/) -- [wysiwyg](http://www.bootcss.com/p/bootstrap-wysiwyg/) -- [一个有情怀的编辑器。Bach's Editor](http://integ.github.io/BachEditor/) -- [tower用的编辑器](https://github.com/mycolorway/simditor) -- [summernote 编辑器](https://github.com/summernote/summernote) -- [html5编辑器](http://neilj.github.io/Squire/) -- [XEditor](http://lab.hustlzp.com/XEditor/) -- [wangEditor](https://github.com/wangfupeng1988/wangEditor ) - -####9. 日历 - -1. PC - - - [经典my97](http://www.my97.net/dp/demo/index.htm) - - [强大的独立日期选择器](http://www.cnblogs.com/gbin1/archive/2012/04/16/2452105.html) - - [fullcalendar](http://fullcalendar.io/) - - [fullcalendar日历控件知识点集合 ](http://blog.csdn.net/francislaw/article/details/7740630) - - [中文api](http://blog.sina.com.cn/s/blog_9475b1c101012c5f.html) - - [农历日历](https://github.com/zzyss86/LunarCalendar) - - [超酷的仿百度带节日日历老黄历控件](http://www.sucaisj.com/jiaoben/date/201509/16856.html) - - [日期格式化](http://momentjs.com/) - - [大牛日历控件](https://github.com/Johnqing/QPAYCalendar/) - - [我群某管理作品](https://github.com/Iamlars/dateMarker) - - [input按位替换-官网](http://digitalbush.com/projects/masked-input-plugin/) - - [input按位替换-github](https://github.com/digitalBush/jquery.maskedinput/tree/1.2.2) - - [bootstrap-daterangepicker](https://github.com/dangrossman/bootstrap-daterangepicker) - - [国外30个插件集合](http://www.vandelaydesign.com/30-best-free-jquery-plugins/) - - [JavaScript datepicker](http://dbushell.com/2012/10/09/pikaday-javascript-datepicker/) - - [Datepair.js](http://jonthornton.github.io/Datepair.js/) - - [一个风格多样的日历](https://github.com/glad/glDatePicker) - - [弹出层式的全日历](http://amsul.ca/pickadate.js/date/) - - [jquery双日历](http://www.daterangepicker.com/) - -2. 移动 - - - [大气实用jQuery手机移动端日历日期选择插件](http://www.frankdemo.cn/index.php?c=content&a=show&id=115) - - [jQuery Mobile 移动开发中的日期插件Mobiscroll ](https://mobiscroll.com/) - - -3. Date library - - - [Datejs](https://github.com/datejs/Datejs) - - [sugarjs](http://sugarjs.com/api/Date) - -####10. 综合效果搜索平台 - -- [效果网](http://www.jq22.com) -- [17素材](http://www.17sucai.com/) -- [常用的JavaScript代码片段](http://microjs.com/) - -####11. 前端工程化 - -1. 概述 - - - [前端工具大全](http://www.awesomes.cn/) - - [什么是前端工程化](https://github.com/fouber/blog/issues/10?from=timeline&isappinstalled=0#) - -2. Gulp - - - [Gulp官网](http://gulpjs.com/) - - [Gulp中文网](http://www.gulpjs.com.cn/) - - [gulp资料收集](https://github.com/Platform-CUF/use-gulp) - - [Gulp:任务自动管理工具 - ruanyifeng](http://javascript.ruanyifeng.com/tool/gulp.html) - - [Gulp插件](http://gulpjs.com/plugins/) - - [Gulp不完全入门教程](http://www.ido321.com/1622.html) - - [为什么使用gulp?](https://github.com/hjzheng/CUF_meeting_knowledge_share/issues/33) - - [Gulp安装及配合组件构建前端开发一体化](http://www.dbpoo.com/getting-started-with-gulp/) - - [Gulp 入门指南](https://github.com/nimojs/gulp-book) - - [Gulp 入门指南 - nimojs](https://github.com/nimojs/blog/issues/19) - - [Gulp入门教程](http://markpop.github.io/2014/09/17/Gulp%E5%85%A5%E9%97%A8%E6%95%99%E7%A8%8B/) - - [Gulp in Action](http://www.imooc.com/video/5692) - - [Gulp开发教程(翻译)](http://www.w3ctech.com/topic/134) - - [前端构建工具gulpjs的使用介绍及技巧](http://www.cnblogs.com/2050/p/4198792.html) - -3. Grunt - - - [gruntjs](http://gruntjs.com/) - - [Grunt中文网](http://www.gruntjs.net/) - -4. Fis - - - [fis 官网](http://fex-team.github.io/fis-site/index.html) - - [fis](http://fis.baidu.com/) - -####12. 轮播图 - -1. pc图轮 - - - [单屏轮播sochange](http://www.jsfoot.com/jquery/demo/2011-09-20/192.html) - - [左右按钮多图切换](http://bxslider.com/examples/carousel-demystified) - - [fullpage全屏轮播](https://github.com/alvarotrigo/fullPage.js/) - -2. 移动端 - - - [无缝切换](http://www.swipejs.com/) - - [滑屏效果](http://www.idangero.us/swiper/) - - [全屏fullpage](https://github.com/peunzhang/fullpage) - - [单个图片切换](https://github.com/qiqiboy/touchslider) - - [单个全屏切换](https://github.com/peunzhang/slip.js) - - [百度的切换库](http://touch.code.baidu.com/examples.html?qq-pf-to=pcqq.group) - - [单个全屏切换](https://github.com/peunzhang/iSlider) - - [滑屏效果](https://github.com/saw/touch-interfaces) - - [旋转拖动设置](http://baijs.com/tinycircleslider/) - - [类似于swipe切换](http://touchslider.com/) - - [支持多种形式的触摸滑动](http://www.swiper.com.cn/demo/index.html) - - [滑屏效果](https://github.com/joker-ye/main/blob/master/wap/index.html) - - [大话主席pc移动图片轮换](http://www.superslide2.com/) - - [滑屏效果](https://github.com/hahnzhu/parallax.js) - - [基于zepto的fullpage](https://github.com/yanhaijing/zepto.fullpage) - - [[WebApp]定宽网页设计下,固定宽度布局开发WebApp并实现多终端下WebApp布局自适应](http://www.cnblogs.com/plums/archive/2013/01/10/WebApp-fixed-width-layout-of-multi-terminal-adapter-since.html) - - [判断微信客户端的那些坑](http://loo2k.com/blog/detecting-wechat-client/) - - [可以通过javascript直接调用原生分享的工具](https://github.com/JefferyWang/nativeShare.js) - - [JiaThis 分享到微信代码](http://www.jiathis.com/help/html/weixin-share-code) - - [聊聊移动端跨平台开发的各种技术](http://fex.baidu.com/blog/2015/05/cross-mobile/) - - [前端自动化测试](http://www.zhihu.com/question/29922082) - - [多种轮换图片](http://ajccom.github.io/niceslider/) - - [滑动侧边栏](https://mango.github.io/slideout/) - -####13. 文件上传 - -- [百度上传组件](http://fex.baidu.com/webuploader/) -- [上传](https://blueimp.github.io/jQuery-File-Upload/) -- [flash 头像上传](http://www.hdfu.net/) -- [图片上传预览](http://www.dropzonejs.com/) -- [图片裁剪](http://elemefe.github.io/image-cropper/) -- [图片裁剪-shearphoto](http://www.shearphoto.com/) -- [jQuery图片处理](http://www.oschina.net/project/tag/284/jquery-image-tools?lang=0&os=0&sort=view&p=2) -- []() - -####14. 模拟select - -- [糖饼 select](http://aui.github.io/popupjs/doc/selectbox.html) -- [flexselect](https://github.com/rmm5t/jquery-flexselect) -- [双select](http://loudev.com/) -- [select2](http://select2.github.io/) -- []() - -####15. 取色插件 - -- [类似 Photoshop 的界面取色插件](http://www.jq22.com/plugin/367) -- [jquery color](https://github.com/jquery/jquery-color/) -- [取色插件集合](http://www.oschina.net/project/tag/287/color-picker) -- [farbtastic 圆环+正方形](https://github.com/mattfarina/farbtastic) -- []() - -####16. 城市联动 - -- [jquery.cityselect.js基于jQuery+JSON的省市或自定义联动效果](http://www.ijquery.cn/?p=360) -- []() - -####17. 剪贴板 - -- [剪贴板](https://github.com/zeroclipboard/zeroclipboard) -- [clipboard 最新的剪切方案](http://zenorocha.github.io/clipboard.js/) -- [不是Flash的剪贴板](https://github.com/zenorocha/clipboard.js) - -####18. 简繁转换 - -- [简繁转换](https://github.com/BYVoid/OpenCC) - -####19. 表格 Grid - -- [facebook表格](http://facebook.github.io/fixed-data-table/) -- [类似于Excel编辑表格-handsontable](http://handsontable.com/) -- [bootstrap-table插件](http://bootstrap-table.wenzhixin.net.cn/) -- [datatables](https://www.datatables.net/) - -####20. 在线演示 - -- [js 在线编辑 - runjs](http://runjs.cn/) -- [js 在线编辑 - jsbin](http://jsbin.com/) -- [js 在线编辑 - codepen](http://codepen.io/) -- [js 在线编辑 - jsfiddle](http://jsfiddle.net/) -- [java 在线编辑 - runjs](http://ideone.com/) -- [js 在线编辑 - hcharts](http://code.hcharts.cn/) -- [js 在线编辑 - jsdm](http://jsdm.com/) -- [sql 在线编辑 - sqlfiddle](http://sqlfiddle.com/) -- [mozilla 在线编辑器](https://thimble.mozilla.org) - -####21. 播放器 - -- [Html5 VideoPlayer](https://github.com/zmmbreeze/DeadSimpleVideoPlayer) - -####22. 粒子动画 - -- [Proton 烟花](http://a-jie.github.io/Proton/#example) - -###九. Nodejs - -- [nodejs 篇幅比较巨大](http://liuqing.pw/) -- [Node.js 包教不包会](https://github.com/alsotang/node-lessons) -- [篇幅比较少](http://www.rainweb.cn/article/category/Nodejs) -- [node express 入门教程](http://www.w3cfuns.com/article-5598538-1-1.html) -- [nodejs定时任务](http://my.oschina.net/u/568264/blog/193773) -- [一个nodejs博客](http://60sky.com/) -- [【NodeJS 学习笔记04】新闻发布系统](http://www.cnblogs.com/yexiaochai/p/3536547.html) -- [过年7天乐,学nodejs 也快乐](http://www.cnblogs.com/qqloving/p/3541099.html) -- [七天学会NodeJS](https://github.com/nqdeng/7-days-nodejs) -- [Nodejs学习笔记(二)--- 事件模块](http://www.cnblogs.com/zhongweiv/p/nodejs_events.html) -- [nodejs入门](http://www.cnblogs.com/liusuqi/p/3735491.html) -- [angularjs nodejs](https://github.com/zensh/jsgen) -- [从零开始nodejs系列文章](http://blog.fens.me/series-nodejs/) -- [理解nodejs](http://debuggable.com/posts/understanding-node-js:4bd98440-45e4-4a9a-8ef7-0f7ecbdd56cb) -- [nodejs事件轮询](http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/) -- [node入门](http://www.nodebeginner.org/index-zh-cn.html) -- [nodejs cms](http://ourjs.com/detail/53e1f281c5910a9806000001) -- [Node初学者入门,一本全面的NodeJS教程](http://ourjs.com/detail/529ca5950cb6498814000005) -- [NodeJS的代码调试和性能调优](http://www.barretlee.com/blog/2015/10/07/debug-nodejs-in-command-line/) - -###十. 性能优化 - -1. 常规优化 - - - [Javascript高性能动画与页面渲染](http://www.infoq.com/cn/articles/javascript-high-performance-animation-and-page-rendering) - - [移动H5前端性能优化指南](http://isux.tencent.com/h5-performance.html) - - [5173首页前端性能优化实践](http://ued.5173.com/?p=1731) - - [给网页设计师和前端开发者看的前端性能优化](http://www.uisdc.com/front-end-performance-for-web-designers-and-front-end-developers) - - [复杂应用的 CSS 性能分析和优化建议](http://www.orzpoint.com/profiling-css-and-optimization-notes/) - - [张鑫旭——前端性能](http://www.zhangxinxu.com/wordpress/tag/%E5%89%8D%E7%AB%AF%E6%80%A7%E8%83%BD/) - - [前端性能监控总结](http://www.xiaoqiang.org/javascript/font-end-performance-monitor.html) - - [网站性能优化之CSS无图片技术](http://udc.weibo.com/2013/05/%E7%BD%91%E7%AB%99%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96%E4%B9%8Bcss%E6%97%A0%E5%9B%BE%E7%89%87%E6%8A%80%E6%9C%AF/) - - [web前端性能优化进阶路](http://www.aliued.cn/2013/01/20/web%E5%89%8D%E7%AB%AF%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96%E8%BF%9B%E9%98%B6%E8%B7%AF.html) - - [前端技术:网站性能优化之CSS无图片技术](http://my.eoe.cn/tuwandou/archive/4544.html) - - [浏览器的加载与页面性能优化](http://www.baiduux.com/blog/2011/02/15/browser-loading/) - - [页面加载中的图片性能优化](http://www.w3ctech.com/p/1503) - - [Hey——前端性能](http://www.feelcss.com/tag/%E5%89%8D%E7%AB%AF%E6%80%A7%E8%83%BD) - - [html优化](http://www.baiduux.com/blog/2010/03/15/html%E4%BC%98%E5%8C%96-2/) - - [99css——性能](http://www.99css.com/tag/%e6%80%a7%e8%83%bd) - - [Yslow——性能优化](http://www.yslow.net/category.php?cid=20) - - [YSLOW中文介绍](http://www.cnblogs.com/yslow/) - - [转一篇Yahoo关于网站性能优化的文章,兼谈本站要做的优化](http://www.360ito.com/article/40.html) - - [Yahoo!团队实践分享:网站性能](http://www.360doc.com/content/10/0928/09/2588264_56971287.shtml) - - [网站性能优化指南:什么使我们的网站变慢?](http://blog.jiasule.com/i/153) - - [网站性能优化实践,减少加载时间,提高用户体验](http://www.powereasy.net/helpyou/knowledge/ecommerce/9593.html) - - [浅谈网站性能优化 前端篇](http://www.umtry.com/archives/747.html) - - [前端重构实践之如何对网站性能优化?](http://www.adinnet.cn/blog/designview/2012-7-12/678.html) - - [前端性能优化:使用媒体查询加载指定大小的背景图片](http://www.gbin1.com/technology/javascript/20130708-front-end-performance-optimization-9/) - - [网站性能系列博文](http://www.mykuer.com/post/factors-that-affect-the-speed-of-web-site-open.html) - - [加载,不只是少一点点](http://tgideas.qq.com/webplat/info/news_version3/804/808/811/m579/201109/41355.shtml) - - [前端性能的测试与优化](http://mzhou.me/article/95310/) - - [分享网页加载速度优化的一些技巧?](http://www.gbin1.com/technology/html/20130217-tips-for-speed-up-page-loading/) - - [页面加载中的图片性能优化](http://www.f2es.com/images-bytes-opt/) - - [web前端优化(基于Yslow)](http://www.tcreator.info/webSchool/website/Front-end-Opt-Yslow.html) - - [网站性能优化工具大全](https://www.qianduan.net/website-performance-optimization-tool.html) - - [【高性能前端1】高性能HTML](http://www.alloyteam.com/2012/10/high-performance-html/) - - [【高性能前端2】高性能CSS](http://www.alloyteam.com/2012/10/high-performance-css/) - - [由12306谈谈网站前端性能和后端性能优化](http://coolshell.cn/articles/6470.html) - - [AlloyTeam——前端优化](http://www.alloyteam.com/webfrontend/%E5%89%8D%E7%AB%AF%E4%BC%98%E5%8C%96/) - - [毫秒必争,前端网页性能最佳实践](http://www.cnblogs.com/developersupport/p/3248695.html) - - [网站性能工具Yslow的使用方法](http://blog.sina.com.cn/s/blog_6e9d2e0701017kvu.html) - - [前端工程与性能优化(上):静态资源版本更新与缓存](http://www.infoq.com/cn/articles/front-end-engineering-and-performance-optimization-part1) - - [前端工程与性能优化(下):静态资源管理与模板框架](http://www.infoq.com/cn/articles/front-end-engineering-and-performance-optimization-part2) - - [HTTPS连接的前几毫秒发生了什么](http://blog.jobbole.com/48369/) - - [Yslow](http://uicss.cn/yslow/#more-12319) - - [Essential Web Performance Metrics — A Primer, Part 1](http://blog.smartbear.com/web-performance/essential-web-performance-metrics-a-primer-part-1/) - - [Essential Web Performance Metrics — Part 2](http://blog.smartbear.com/performance/essential-web-performance-metrics-part-2/) - - [YUISlide,针对移动设备的动画性能优化](http://jayli.github.io/blog/data/2011/12/23/yuislide.html) - - [Improving Site Performance](http://joelglovier.com/improving-site-performance/) - - [让网站提速的最佳前端实践](http://segmentfault.com/a/1190000000367899) - - [Why Website Speed is Important](http://sixrevisions.com/web-development/why-website-speed-is-important/) - - [Need for Speed – How to Improve your Website Performance](https://www.devbridge.com/articles/need-for-speed-how-to-improve-your-website-performance/) - - [阿里无线前端性能优化指南 (Pt.1 加载期优化) ](https://github.com/amfe/article/issues/1) - - []() - -2. 优化工具 - - - [JavaScript 性能分析新工具 OneProfile](http://www.html-js.com/article/3083) - - [JavaScript 堆内存分析新工具 OneHeap](http://www.html-js.com/article/3091) - -3. 在线工具 - - - [google在线工具](https://developers.google.com/speed/pagespeed/insights/) - - [阿里测](http://www.alibench.com/) - - [阿里-免费测试服务](http://itest.aliyun.com/) - - [阿里-F2etest多浏览器兼容性测试解决方案](https://github.com/alibaba/f2etest) - - [js性能测试](http://jsperf.com/) - - []() - -###十一. 前端架构 - -- [技术架构](http://www.zhihu.com/topic/19612641) -- [前端架构](http://saito.im/note/The-Architecture-of-F2E/) -- [如何成为前端架构师](http://www.zhihu.com/question/24092572) -- [关于前端架构-张克军](http://hikejun.com/sharing/2010webrebuild/?file=fe-infrastructure.html) -- [百度腾讯offer比较(腾讯游戏VS百度基础架构)](http://www.zhihu.com/question/25583350) -- []() - - -###十二. 个人作品 - -####1. 推荐作品 - -- [winter代码片段需要翻墙](https://gist.github.com/wintercn) -- [fgm](http://www.fgm.cc/learn/) -- [岑安作品集](https://github.com/hongru/hongru.github.com) -- [当耐特demo集合](http://kmdjs.github.io/) -- [米空格 js作品](http://www.laoshu133.com/Lab/) -- [myFocus](http://koen301.github.io/) -- [SeaJS组件库](http://panxuepeng.github.io/seajslib/) -- [颜海镜作品](http://yanhaijing.com/myProject/) -- [脚儿网作品](http://jo2.org/category/myworks/) -- [javascript个人作品](http://www.cnitblog.com/yemoo/category/3107.html) -- [妙味的雷东升游戏作品](http://bbs.miaov.com/forum.php?mod=viewthread&tid=7790) -- [javascript作品集](http://bbs.csdn.net/topics/380227212) -- [云五笔,灰度产生生成工具](https://github.com/TooBug/works) -- [项目主页](http://koen301.github.io/) -- [个性的作品主页](http://zaole.net/) -- [播放器](http://static.tingall.com/v2/player/) -- [ucren js demos 集](http://ucren.com/blog/demos) -- [智能社](http://www.zhinengshe.com/works_list.html) -- [实例陈列架](http://demos.shizuwu.cn/) -- [zoye demo](http://zoye.sinaapp.com/demo) -- [王员外](http://lab.yuanwai.wang/) -- [平凡](http://pingfan1990.sinaapp.com) -- [jyg 游戏案例](http://www.lovewebgames.com/) -- [很多jquery插件](http://www.helloweba.com/list.html) -- [不羁虫 - soJs 作品系列](http://www.bujichong.com/sojs/api/index.html) -- [frozenui](http://frozenui.github.io/case.html) -- [黑白棋](http://js-game.github.io/othello/) -- [fromone](http://yansm.github.io/fromone/index.html) - -####2. 群员作品 - -- [MDialog - [合肥-M.J]](http://demo.webjyh.com/) -- [轮播图 - [上海-冷静]](http://sandbox.runjs.cn/show/do6zlrrk ) -- [[广州—坚壳]](http://www.replace5.com/) -- [[成都 - 无痕] 感恩节专题](http://www.seejs.com/demos/) -- [[球霸天]](http://hacke2.github.io/works) -- [[北京-小数]](http://www.cnblogs.com/mcat/) -- [[ptf] Magix 工具](http://thx.github.io/magix/) -- [[杭州-Pft] Magix 基于 MVC 结构和 Hash 驱动的 OPOA(One Page One Application)应用](http://thx.github.io/magix/) -- [[上海-剧中人]-实验室](http://bh-lay.com/labs/) -- [[上海-豪情 ] 作品集合](http://jikeytang.github.io) -- [[成都-feeling]](http://guoshan.sinaapp.com/) -- [[上海-angela]](http://www.cnblogs.com/liyunhua/) -- [[海南-hank]作品](http://hcjp.github.io/work/demo/) -- [[上海-张力]博客](https://github.com/yibuyisheng/blogs/issues) -- [[上海-zenki]作品](http://zkske121.github.io/) -- [移动端图案解锁](http://01google.sinaapp.com/locker.html) -- [[合肥-M.J] - MPreview 移动端图片预览组](https://github.com/webjyh/MPreview.mobile) -- [[合肥-M.J] - Mexam 移动端在线做题组](https://github.com/webjyh/Mexam) -- [[北京-苏瑞] - dancer小人](http://letyougo.github.io/dancer/) -- [[上海-玄沐]- 个人网站](http://k.swao.cn/js/) -- [[厦门-二哲]- 个人博客](http://www.meckodo.com/) - -####3. 国外大牛精品 - -- [pazguille](http://pazguille.me/) - -###十三. 简历模板 - -- [不错的个人简历](http://learnshare.github.io/about/index.html) -- [简历](http://hcy2367.github.io/resume/) -- [张伦](http://ncuey.sinaapp.com/CrispElite/ ) -- [简历](https://github.com/hacke2/ResumeSample) -- [翁天信](http://blog.dandyweng.com/2013/07/how-my-website-was-created/) -- [动画方式的简历](http://www.webhek.com/misc/interactive-resume/) -- [组件丰富简历](http://www.linqing07.com/resume.html) -- [简历池](http://www.mojianli.com/resume/view) -- [haorooms博客](http://www.haorooms.com/about) -- [Justin Young](http://cv.youngdze.com/) -- []() - -###十四. 面试题 - -- [那几个月在找工作(百度,网易游戏)](http://www.nowcoder.com/discuss/3196) -- [2014最新面试题](http://www.html-js.com/article/1743) -- [阿里前端面试题](http://www.w3cfuns.com/thread-5598563-2-1.html) -- [2016校招内推 -- 阿里巴巴前端 -- 三面面试经历 ](http://www.cnblogs.com/imwtr/p/4685546.html) -- [腾讯面试题](http://www.w3cfuns.com/article-5599657-1-1.html) -- [年后跳槽那点事:乐视+金山+360面试之行](http://www.cnblogs.com/lvdabao/p/3660707.html) -- [阿里前端面试题上线](http://fatesinger.com/2722.html) -- [拉勾网js面试题](http://www.cnblogs.com/52cik/p/js-question-lg.html) -- [前端面试](http://www.cnblogs.com/allenxing/p/3724382.html) -- [Web开发笔试面试题 大全](http://mianshiti.diandian.com/) -- [前端开发面试题](http://segmentfault.com/a/1190000000465431) -- [2014最新前端面试题](https://github.com/markyun/My-blog/tree/master/Front-end-Developer-Questions) -- [百度面试](https://github.com/fex-team/interview-questions) -- [面试题](http://www.w3cfuns.com/forum.php?mod=forumdisplay&fid=51&filter=typeid&typeid=177) -- [前端工作面试问题](https://github.com/darcyclarke/Front-end-Developer-Interview-Questions/tree/master/Chinese) -- [前端开发面试题](http://segmentfault.com/a/1190000000465431) -- [5个经典的前端面试问题](http://ourjs.com/detail/5%E4%B8%AA%E7%BB%8F%E5%85%B8%E7%9A%84%E5%89%8D%E7%AB%AF%E9%9D%A2%E8%AF%95%E9%97%AE%E9%A2%98) -- [最全前端面试问题及答案总结 ](http://segmentfault.com/a/1190000002562454) -- [如何面试一名前端开发工程师?](http://www.html-js.com/article/Large-search-front-team-column%202961) -- [史上最全 前端开发面试问题及答案整理](https://github.com/hawx1993/Front-end-Interview-questions) -- [前端实习生面试总结 ](http://www.cnblogs.com/xiaoruo/p/4665163.html) -- [史上最全 前端开发面试问题及答案整理](https://github.com/hawx1993/Front-end-Interview-questions) -- [BAT及各大互联网公司2014前端笔试面试题:JavaScript篇](http://blog.jobbole.com/78738/) -- [前端开发面试题大收集](https://github.com/paddingme/Front-end-Web-Development-Interview-Question) -- [收集的前端面试题和答案](https://github.com/qiu-deqing/FE-interview) -- [如何面试前端工程师](http://www.zhihu.com/question/19568008) -- [前端开发面试题](https://github.com/markyun/My-blog/blob/master/Front-end-Developer-Questions/Questions-and-Answers/README.md) -- [牛客网-笔试面经](http://www.nowcoder.com/discuss?type=2) - -###十五. iconfont - -- [中文字体](http://www.zhihu.com/question/21253343) -- [淘宝字库](http://iconfont.cn) -- [字体](http://mux.alimama.com/fonts) -- [制作教程](http://iconfont.cn/help/platform.html) -- [zhangxinxu-icommon](http://www.zhangxinxu.com/wordpress/?s=icomoon) -- [icommon](https://icomoon.io/app/) -- [用字体在网页中画ICON图标(推荐教程)](http://imooc.com/learn/243) -- [字体压缩工具](http://font-spider.org/) 感谢初级群 [深圳-小鱼] 的推荐 - -###十六. 开发工具类 - -1. 前端开发工具 - - - [IntelliJ IDEA 简体中文专题教程](https://github.com/judasn/IntelliJ-IDEA-Tutorial) - - [Webstorm,InterllIdea,Phpstorm](http://t.cn/8kZZ1Uy) - - [SublimeText](https://github.com/jikeytang/sublime-text) - - [Atom](https://atom.io/) - - [visual studio code](https://code.visualstudio.com/) - -2. Chrome, Firebug, Filddle 调试 - - 1. Fiddler - - [Fiddler调式使用知多少(一)深入研究](http://www.cnblogs.com/tugenhua0707/p/4623317.html) - - [微信fiddle](http://www.cnblogs.com/strick/p/4570006.html) - - [微信fiddle](http://gaoboy.com/article/26.html) - - []() - - 2. Chrome - - [Google Chrome 官方](https://developer.chrome.com/devtools) - - [Chrome - 基础](http://www.cnblogs.com/constantince/p/4565261.html) - - [Chrome - 进阶](http://www.cnblogs.com/constantince/p/4579121.html) - - [Chrome - 性能](http://www.cnblogs.com/constantince/p/4585983.html) - - [Chrome - 性能进阶](http://www.cnblogs.com/constantince/p/4607497.html) - - [Chrome - 移动](http://www.cnblogs.com/constantince/p/4624241.html) - - [Chrome - 使用技巧](http://www.cnblogs.com/liyunhua/p/4544738.html) - - [Chrome - Console控制台不完全指南](http://www.cnblogs.com/Wayou/p/chrome-console-tips-and-tricks.html) - - [Chrome - Workspace使浏览器变成IDE](http://c7sky.com/chrome-devtools-workspace.html) - - [network面板](http://www.html-js.com/article/Nothing-blind%202975) - - [chrome开发工具快捷键](http://anti-code.com/devtools-cheatsheet/) - - [chrome调试工具常用功能整理](http://www.html-js.com/article/2327) - - [Chrome 开发工具 Workspace 使用](http://www.iinterest.net/2014/05/09/chrome-dev-tool-workspace/) - - [Chrome神器Vimium快捷键学习记录 ](http://www.cppblog.com/deercoder/archive/2011/10/22/158886.html) - - [sass调试-w3cplus](http://www.w3cplus.com/sassguide/debug.html) - - [如何更专业的使用Chrome开发者工具-w3cplus](http://www.w3cplus.com/tools/how-to-use-chrome-devtools-like-a-pro.html) - - [chrome调试canvas](http://sentsin.com/web/253.html) - - [chrome profiles1](https://developer.chrome.com/devtools/index) - - [chrome profiles2](http://h5dev.uc.cn/article-25-1.html) - - [chrome profiles3](http://www.oschina.net/translate/performance-optimisation-with-timeline-profiles) - - [chrome移动版调试](https://developer.chrome.com/devtools/docs/mobile-emulation) - - [chrome调试](http://ued.taobao.org/blog/2012/06/debug-with-chrome-dev-tool/) - - [chrome的调试](http://www.cnblogs.com/QLeelulu/archive/2011/08/28/2156402.html) - - [chrome console 命令详解](https://developer.chrome.com/devtools/docs/commandline-api) - - [查看事件绑定1](http://www.cnblogs.com/leonkao/p/3809655.html) - - [查看事件绑定2](http://www.cnblogs.com/xiaoyao2011/p/3447421.html) - - [神器——Chrome开发者工具(一)](http://segmentfault.com/a/1190000000683599) - - [奇趣百科性能优化(Chrome DevTools 中的 Timeline Profils 等工具使用介绍)](https://xinranliu.me/2015-05-22-qiqu-performance/) - - [chrome 开发者工具的 15 个小技巧](http://frontenddev.org/link/15-tips-of-chrome-developer-tools.html) - - [Chrome开发者工具不完全指南](http://1ke.co/course/361) - - [Chrome 开发者工具使用技巧](http://segmentfault.com/a/1190000003882567) - - 3. Firebug - - [firebug视频教程](http://www.imooc.com/learn/137) - - [firefox 模拟器](https://developer.mozilla.org/zh-CN/docs/Tools/WebIDE) - - [console.log 命令详解](http://www.cnblogs.com/ctriphire/p/4116207.html) - - [Firebug入门指南](http://www.ruanyifeng.com/blog/2008/06/firebug_tutorial.html) - - [Firebug控制台详解](http://www.ruanyifeng.com/blog/2011/03/firebug_console_tutorial.html) - - []() - - 4. 移动,微信调试 - - [浏览器端调试安卓](https://openstf.github.io/) - - [移动端前端开发调试](http://yujiangshui.com/multidevice-frontend-debug/) - - [使用 Chrome 远程调试 Android 设备](https://github.com/yujiangshui/CN-Chrome-DevTools/blob/remote-debugging/md/Use-Tools/remote-debugging.md) - - [mac移动端调试](http://plus.uc.cn/document/webapp/doc5.html) - - [mac移动端调试](http://www.mihtool.com/) - - [无线调试攻略](http://thx.github.io/mobile/debugging-in-mobile/) - - [无线调试攻略](http://yanhaijing.com/mobile/2014/12/17/web-debug-for-mobile/) - - [屌爆了,完美调试 微信webview(x5)](http://www.jianshu.com/p/ccf124f1f74b) - - [微信调试的那些事](http://liyaodong.com/2015/07/06/%E5%BE%AE%E4%BF%A1%E8%B0%83%E8%AF%95%E7%9A%84%E9%82%A3%E4%BA%9B%E4%BA%8B/) - - [远程console](http://jsconsole.com/) - - [微信调试工具](http://blog.qqbrowser.cc/) - - [各种真机远程调试方法汇总](https://github.com/jieyou/remote_inspect_web_on_real_device) - - 5. iOS Simulator - - [Simulator](https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/iOS_Simulator_Guide/Introduction/Introduction.html) - - [Xcode中的iOS模拟器(iOS Simulator)的介绍和使用心得](http://www.crifan.com/intro_ios_simulator_in_xcode_and_usage_summary/) - -3. img - - - [loading img](http://preloaders.net/en/circular) - - [智图-图片优化平台](http://zhitu.isux.us/) - - [在线png优化](https://tinypng.com/) - -4. 生成二维码 - - - [生成二维码](http://cli.im/) - -5. 浏览器同步 - - [puer](https://github.com/leeluolee/puer) - - [liveReload](http://livereload.com/) - - [f5](http://getf5.com/) - - [File Watchers](http://geek100.com/2608/) - -6. 在线PPT制作 - - [nodePPT](http://js8.in/2013/11/16/%E6%8E%A8%E8%8D%90nodeppt%EF%BC%9A%E4%BD%BF%E7%94%A8markdown%E8%AF%AD%E6%B3%95%E6%9D%A5%E5%86%99%E7%BD%91%E9%A1%B5ppt/) - - [PPT](https://github.com/ksky521/nodePPT) - - [reveal](https://github.com/hakimel/reveal.js/) - - [slippy](https://github.com/Seldaek/slippy) - -###十七. 前端导航网站 - -- [界面清爽的前端导航](http://uxbees.com/index.html) -- [前端导航](http://whycss.com/) -- [前端网址导航](http://www.daqianduan.com/nav) -- [前端名录](http://sentsin.com/daohang/) -- [前端导航](http://123.jser.us/) -- [前端开发资源](http://www.css88.com/nav/) -- [网址导航](http://www.haourl.cn/) -- [前端开发仓库 - 众多效果的收集地](http://code.ciaoca.com/) -- [前端资源导航](https://github.com/jnoodle/f2e-collect) -- [F2E 前端导航](http://f2e.im/static/pages/nav/index.html) - -###十八. 常用CDN - -- [新浪CDN](http://lib.sinaapp.com/) -- [百度静态资源公共库](http://cdn.code.baidu.com/) -- [360网站卫士常用前端公共库CDN服务](http://libs.useso.com/) -- [Bootstrap中文网开源项目免费 CDN 服务](http://www.bootcdn.cn/) -- [开放静态文件 CDN - 七牛](http://staticfile.org/) -- [CDN加速 - jq22](http://www.jq22.com/cdn/) -- [jQuery CDN](http://code.jquery.com/) -- [Google jQuery CDN](http://www.google-jquery-cdn.com/) -- [微软CDN](http://www.asp.net/ajax/cdn) - -###十九. Git,SVN,Github - -1. Git - - - [git-scm](http://git-scm.com/) - - [廖雪峰-Git教程](http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000) - - [git-for-windows](https://git-for-windows.github.io/) - - [GitHub 添加 SSH keys](http://daemon369.github.io/git/2015/03/10/add-ssh-keys-for-github/) - - [gogithub](http://www.worldhello.net/gotgithub/index.html) - - [git常规命令练习](http://pcottle.github.io/learnGitBranching/) - - [git的资料整理](https://github.com/xirong/my-git) - - [我所记录的git命令(非常实用)](http://www.cnblogs.com/fanfan259/p/4810517.html) - - [企业开发git工作流模式探索部分休整](https://github.com/xirong/my-git/blob/master/git-workflow-tutorial.md) - - [GitHub 漫游指南](https://github.com/phodal/github-roam) - - [GitHub秘籍](https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.zh-cn.md) - - [使用git和github进行协同开发流程](http://livoras.com/post/28) - - [动画方式练习git](http://onlywei.github.io/explain-git-with-d3/) - -部分内容是出自: -https://github.com/jsfront/src/blob/master/qq.md +:smiley_cat:_These share data are from my usual work and learning,hoping to help you,If you like you can star_ + +更多详情可关注作者:小猫[wscat](https://github.com/Wscats)和猫主人[windiest](https://github.com/windiest),谢谢~ + +## Javascript +| Article | Article | +| --------- | --------- | +|[Javascript深浅拷贝](https://github.com/Wscats/Good-text-Share/issues/57)|[Javascript中的apply和call继承](https://github.com/Wscats/Good-text-Share/issues/56)| +|[Javascript的jsonp原理](https://github.com/Wscats/Good-text-Share/issues/55)|[Javascript监听触摸事件](https://github.com/Wscats/Good-text-Share/issues/49)| +|[Javascript中的var self = this](https://github.com/Wscats/Good-text-Share/issues/52)|[Javascript面向对象编程](https://github.com/Wscats/Good-text-Share/issues/32)| +|[Javascript滑屏切换场景](https://github.com/Wscats/Good-text-Share/issues/14)|[Javascript获取经纬度,关于调用百度API的问题](https://github.com/Wscats/Good-text-Share/issues/16)| +|[妙用Javascript运算符](https://github.com/Wscats/Good-text-Share/issues/3)|[深入理解Javascript函数编程](https://github.com/Wscats/Good-text-Share/issues/1)| +|[Javascript的setTimeout详细用例](https://github.com/Wscats/Good-text-Share/issues/4)|[sessionstorage,localstorage和cookie](https://github.com/Wscats/Good-text-Share/issues/42)| +|[JS日期对比](https://github.com/Wscats/Good-text-Share/issues/11)|[JSONP参考文章](https://github.com/Wscats/Good-text-Share/issues/10)| +|[Javascript的createElement](https://wscats.github.io/angular-demo/createElement.html)|[Javascript的createDocumentFragment](https://wscats.github.io/angular-demo/createDocumentFragment.html)| +|[sessionStorage和localStorage](https://wscats.github.io/angular-demo/sessionStoragelocalStorage.html)|[像素帧动画](https://wscats.github.io/angular-demo/像素动画.html)| +| **Reference** | **Reference** | +|[收集最全前端学习资料](https://github.com/windiest/Front-end-tutorial)|[最全前端教程-猫的回忆录](https://github.com/Wscats/Good-text-Share)| +|[JavaScript中的this陷阱的最全收集--没有之一](https://segmentfault.com/a/1190000002640298)|[JS函数式编程指南](https://llh911001.gitbooks.io/mostly-adequate-guide-chinese/content/ch1.html)| +|[JavaScript Promise迷你书(中文版)](http://liubin.github.io/promises-book)|[阮一峰 Javascript](http://javascript.ruanyifeng.com)| +|[前端 TOP 100](https://www.awesomes.cn/rank)|[小白的零基础JavaScript全栈教程](http://www.liaoxuefeng.com/wiki/001434446689867b27157e896e74d51a89c25cc8b43bdb3000)| + +## UI +| Reference | Reference | +| --------- | --------- | +|[WeUI](https://github.com/weui/weui)|[Bootstrap](http://www.bootcss.com)| +|[MUI-最接近原生APP体验的高性能前端框架](http://dev.dcloud.net.cn/mui/)|[Amaze UI中国首个开源HTML5跨屏前端框架](http://amazeui.org)| +|[Frozen UI](http://frozenui.github.io/)|[Foundation](http://foundation.zurb.com/)| +|[SUI](http://sui.taobao.org/sui/docs/)|[ZUI](https://github.com/easysoft/zui)| +|[淘宝HTML5前端框架](http://m.sui.taobao.org)|[KISSY - 阿里前端JavaScript库](http://docs.kissyui.com)| +|[网易Nej - Nice Easy Javascript](http://nej.netease.com)|[Kendo UI MVVM Demo](http://demos.telerik.com/kendo-ui/mvvm/index)| +|[Smart UI](http://smartui.chinamzz.com)|[雅虎UI - CSS UI](http://developer.yahoo.com/yui/grids)| + +## CSS +| Article | Article | +| --------- | --------- | +|[CSS Flex布局](https://github.com/Wscats/Good-text-Share/issues/41)|[移动前端开发CSS3](https://github.com/Wscats/Good-text-Share/issues/38)| +|[响应式布局 媒体查询](https://github.com/Wscats/Good-text-Share/issues/43)|[CSS图片响应式布局](https://github.com/Wscats/Good-text-Share/issues/34)| +|[lessDemo的less文件](https://wscats.github.io/angular-demo/stylesheets/styles.less)|| +| **Reference** | **Reference** | +|[CSS 语法参考](http://tympanus.net/codrops/css_reference)|[CSS3动画手册](http://isux.tencent.com/css3/index.html)| +|[腾讯css3动画制作工具](http://isux.tencent.com/css3/tools.html)|[animate.css](http://daneden.github.io/animate.css)| +|[Animated Books with CSS 3D Transforms](http://tympanus.net/Development/AnimatedBooks/)|[Browserhacks](http://browserhacks.com/)| + +## HTML +| Article | Article | +| --------- | --------- | +[HTML5有哪些让你惊艳的demo](http://www.zhihu.com/question/24398907)|[Wallpaperbetter](http://www.wallpaperbetter.com/)| + +## Angular +| Article | Angular文档 | +| --------- | --------- | +|[Angular源码解读publishExternalAPI函数](https://github.com/Wscats/Good-text-Share/issues/26)|[Angular源码解读setupModuleLoader函数](https://github.com/Wscats/Good-text-Share/issues/25)| +|[Angular的ng-style用法](https://github.com/Wscats/Good-text-Share/issues/35)|[Angular判断在那个浏览器下打开的服务](https://github.com/Wscats/Good-text-Share/issues/29)| +|[Angular文字折叠展开组件的原理分析](https://github.com/Wscats/Good-text-Share/issues/28)|[Angular服务Request异步请求的详细分析](https://github.com/Wscats/Good-text-Share/issues/21)| +|[Angular自定义service服务详解](https://github.com/Wscats/Good-text-Share/issues/24)|[Angular自定义判断上一页是否存在的服务](https://github.com/Wscats/Good-text-Share/issues/22)| +|[Angular操作cookies方法](https://github.com/Wscats/Good-text-Share/issues/19)|[Angular打印错误的minErr函数](https://github.com/Wscats/Good-text-Share/issues/18)| +|[Angular的fromJson与toJson方法](https://github.com/Wscats/Good-text-Share/issues/17)|[Angular用ng-repeat生成表单并绑定ng-click时的一个细节](https://github.com/Wscats/Good-text-Share/issues/12)| +|[Angular的run方法巧妙运用](https://github.com/Wscats/Good-text-Share/issues/6)|[Angular处理Html转义问题](https://github.com/Wscats/Good-text-Share/issues/5)| +|[ng-repeat绑定事件和嵌套](ng-repeat绑定事件和嵌套)|[Angular的post请求后台接受不了数据的解决方法](https://github.com/Wscats/angular-demo/issues/4)| +|[ionic总结](https://github.com/Wscats/angular-demo/issues/19)|[ui-route和ng-route](https://github.com/Wscats/angular-demo/issues/17)| +|[ng-options&&ng-switch](https://github.com/Wscats/angular-demo/issues/15)|[directive组件作用域](https://github.com/Wscats/angular-demo/issues/14)| +|[表单认证](https://github.com/Wscats/angular-demo/issues/13)|[$broadcast,$emit and $on](https://github.com/Wscats/angular-demo/issues/11)| +|[自定义过滤器](https://github.com/Wscats/angular-demo/issues/9)|[自定义手势指令ng-touch](https://github.com/Wscats/angular-demo/issues/8)| +|[ng-animate](https://github.com/Wscats/angular-demo/issues/7)|[单页面应用的技术点](https://github.com/Wscats/angular-demo/issues/3)| +| **Guess you like** |**AppDemo**| +|[Angular商城Demo](https://wscats.github.io/angular-demo/spa/mobie-b2bdemo1/index.html)|[Angular的Cnode社区](https://wscats.github.io/angular-demo/spa/CNode/index.html)| +|[AngularStovepipe](https://wscats.github.io/angular-demo/spa/Stovepipe/index.html)|[Angular的新闻客户端](https://wscats.github.io/angular-demo/spa/TT/index.html)| +|[Angular商城Demo](https://wscats.github.io/angular-demo/spa/mobie-b2bdemo1/index.html)|[Angular的Cnode社区](https://wscats.github.io/angular-demo/spa/CNode/index.html)| +|[Angular内联编辑器](https://wscats.github.io/angular-demo/angularjs5examples/inline-editor/index.html)|[Angular即时搜索](https://wscats.github.io/angular-demo/angularjs5examples/instant-search/index.html)| +|[Angular导航菜单](https://wscats.github.io/angular-demo/angularjs5examples/navigation-menu/index.html)|[Angular订单表单](https://wscats.github.io/angular-demo/angularjs5examples/order-form/index.html)| +|[Angular切换网格](https://wscats.github.io/angular-demo/angularjs5examples/switchable-grid/index.html)|[Angular新闻+WEUI DEMO](https://wscats.github.io/angular-demo/spa/news/index.html) [源码](https://github.com/Wscats/angular-demo/tree/gh-pages/spa/NodeServerAndApi-Weui-News)| +| **Controller** |**控制器**| +|[Angular控制器demo](https://wscats.github.io/angular-demo/view/student.html)|| +| **SPA DEMO** |**单页面应用**| +|[Angular+Weui单页面应用DEMO-每日笑话](https://wscats.github.io/angular-demo/weui每日笑话.html)|| +| **Service** |**服务**| +|[Angular自定义服务的常用方法](https://github.com/Wscats/angular-demo/blob/gh-pages/%E5%B8%B8%E7%94%A8%E8%87%AA%E5%AE%9A%E4%B9%89%E6%9C%8D%E5%8A%A1%E6%96%B9%E6%B3%95.md)|[Angular部分服务demo](https://wscats.github.io/angular-demo/部分服务demo.html)| +|[Angular自定义Canvas画图服务](https://wscats.github.io/angular-demo/Angular自定义Canvas画图服务.html)|[Angular自定义http服务 面向对象封装](https://wscats.github.io/angular-demo/自定义http服务.html)| +| **Directive** |**组件与指令**| +|[Angular自定义手势指令](https://wscats.github.io/angular-demo/自定义手势事件.html)|[Angular自定义轮播图组件](https://wscats.github.io/angular-demo/自定义directive轮播图.html)| +|[Angular自定义下拉刷新组件1](https://wscats.github.io/angular-demo/下拉刷新.html)|[Angular自定义下拉刷新组件2](https://wscats.github.io/angular-demo/Angular自定义下拉刷新组件.html)| +| **Router** |**路由**| +|[Angular路由嵌套](https://wscats.github.io/angular-demo/UI路由嵌套DEMO.html)|[Angular路由单页多个ui-view](https://wscats.github.io/angular-demo/uiRoute/index.html)| +| **Filter** |**过滤器**| +|[Angular自带过滤器](https://wscats.github.io/angular-demo/angular自带过滤器.html)|[Angular自定义关键词检索过滤器](https://wscats.github.io/angular-demo/自定义关键词检索过滤器.html)| +| **Animate** |**动画**| +|[Angular ng-animate动画1](https://wscats.github.io/angular-demo/ng-animate动画.html)|[Angular ng-animate动画2](https://wscats.github.io/angular-demo/ng-animate动画2.html)| +| **Other** |**其他**| +|[Angular中使用iframe](https://wscats.github.io/angular-demo/iframesdemo.html)|[Angular三级联动(1)](https://wscats.github.io/angular-demo/%E4%B8%89%E7%BA%A7%E8%81%94%E5%8A%A8.html)| +|[Angular中使用ng-switch](https://wscats.github.io/angular-demo/ngSwitch.html)|[百度定位DEMO](https://wscats.github.io/angular-demo/百度地图定位DEMO.html)| +|[Angular三级联动(2)](https://wscats.github.io/angular-demo/三级联动改进.html)|[Angular事件监听](https://wscats.github.io/angular-demo/事件监听.html)| +|[jQuery模拟ng-repeat](https://wscats.github.io/angular-demo/jquery模拟ng-repeat.html)|[lessDemo](https://wscats.github.io/angular-demo/lessDemo.html)| +|[Angular自定义cookie服务和ngCookie的使用](https://wscats.github.io/angular-demo/ngCookie.html)|[图灵机器人](https://wscats.github.io/angular-demo/图灵机器人.html)| +|[Angular利用angular.module()实现模块化](https://wscats.github.io/angular-demo/angular模块化.html)|[Angular的form表单验证](https://wscats.github.io/angular-demo/form表单验证.html)| +|[Angular的ng-repeat嵌套](https://wscats.github.io/angular-demo/ng-repeat嵌套.html)|[Angular利用angular.module()实现模块化2](https://wscats.github.io/angular-demo/angular模块化2.html)| +| **PHP** | **PHP** | +|[PHP CURL请求的小细节](https://github.com/Wscats/Good-text-Share/issues/53)|| +| **Reference** | **Reference** | +|[最流行的PHP 代码规范](https://segmentfault.com/a/1190000000443795)|[最流行的PHP 代码规范](https://github.com/hfcorriez/fig-standards/blob/zh_CN/%E6%8E%A5%E5%8F%97/PSR-2-coding-style-guide.md)| +|[Angular.js的一些学习资源](http://blog.aijc.net/AngularLearning/)|[Angularjs中文社区](http://angularjs.cn)| +|[一些扩展Angular UI组件](https://github.com/angular-ui)|[Angular UI](http://mgcrea.github.io/angular-strap)| +|[AngularJS在线教程](http://each.sinaapp.com/angular)|[Angular学习笔记](http://www.zouyesheng.com/angular.html)| + +## React +| React | Reference | +| --------- | --------- | +|[React教程 菜鸟教程](http://www.runoob.com/react/react-tutorial.html)|[React Router 使用教程](http://www.ruanyifeng.com/blog/2016/05/react_router.html?utm_source=tool.lu)| +|[React开发中文手册-极客学院](http://wiki.jikexueyuan.com/project/react/)|[React教程-汇智网](http://www.hubwiz.com/course/552762019964049d1872fc88/)| +|[React.js快速开始](http://www.phperz.com/article/15/0712/140537.html#)|[Reactjs 2016最佳实践](http://www.alloyteam.com/2016/01/reactjs-best-practices-for-2016/)| +|[React 入门教程](https://hulufei.gitbooks.io/react-tutorial/content/introduction.html)|[汇智网 React教程](http://www.hubwiz.com/course/552762019964049d1872fc88/?ch=alloyteam)| +|[轻松入门React和Webpack](https://segmentfault.com/a/1190000002767365)|[React中文索引](http://nav.react-china.org/#docs)| +|[Redux 中文文档](http://cn.redux.js.org/)|[React Router官方文档中文翻译](https://github.com/react-guide/react-router-cn)| +|[React入门教程](http://www.cnblogs.com/kunyashaw/p/5619256.html)|[React介绍及实践教程](http://www.ibm.com/developerworks/cn/web/1509_dongyue_react/index.html)| +|[React.js 官方网址](https://facebook.github.io/react/index.html)|[React.js 官方文档](https://facebook.github.io/react/docs/getting-started.html)| +|[React.js material UI](http://material-ui.com/#)|[React.js TouchstoneJS UI](http://touchstonejs.io)| +|[React.js amazeui UI](http://amazeui.org/react)|[React 入门实例教程 - 阮一峰](http://www.ruanyifeng.com/blog/2015/03/react.html)| +|[React Native 中文版](http://wiki.jikexueyuan.com/project/react-native)|[Webpack 和 React 小书 - gitbook](https://fakefish.github.io/react-webpack-cookbook)| + +## Vue +| Vue |AppDemo|Demo| +| --------- | --------- | --------- | +|[NewsDemo](https://wscats.github.io/vue-demo/news/index.html)|[vue计算属性](https://wscats.github.io/vue-demo/vue计算属性.html)|[vue生命周期](https://wscats.github.io/vue-demo/vue生命周期.html)| +| **Article** |**Vue文档**|| +|[Vue-cli脚手架](https://github.com/Wscats/vue-demo/issues/2)|[Vue组件](https://github.com/Wscats/vue-demo/issues/3)|[vue自定义指令](https://github.com/Wscats/vue-demo/issues/8)| +|[Vue过渡动画](https://github.com/Wscats/vue-demo/issues/9)|[Vue指令](https://github.com/Wscats/vue-demo/issues/7)|[Vue api文档](https://github.com/Wscats/vue-demo/issues/6)| +|[Vue执行ajax请求](https://github.com/Wscats/vue-demo/issues/5)|[vue实现类似angular服务的方法](https://github.com/Wscats/vue-demo/issues/4)|[Vue源码参考文档](https://github.com/Wscats/vue-demo/issues/10)| +| **Router** |**路由**|| +|[路由demo](https://wscats.github.io/vue-demo/路由.html)|[路由demo2](https://wscats.github.io/vue-demo/路由2.html)|| +| **Directive** |**指令**|| +|[指令demo](https://wscats.github.io/vue-demo/指令.html)|[自定义指令demo](https://wscats.github.io/vue-demo/自定义指令.html)|[滑动手势demo](https://wscats.github.io/vue-demo/滑动手势指令.html)| +| **Filter** |**过滤器**|| +|[过滤器demo](https://wscats.github.io/vue-demo/过滤器.html)|[过滤器实现分页demo](https://wscats.github.io/vue-demo/vue使用过滤器实现分页.html)|[过滤器读写数据](https://wscats.github.io/vue-demo/vue过滤器读写数据.html)| +| **Transition** |**过渡**|| +|[过渡demo](https://wscats.github.io/vue-demo/过渡.html)|[过渡demo2](https://wscats.github.io/vue-demo/过渡2.html)|| +| **Form** |**表单**|| +|[获取表单值](https://wscats.github.io/vue-demo/vue获取表单值.html)||| +| **Computed** |**计算**|| +|[计算属性](https://wscats.github.io/vue-demo/vue计算属性.html)||| +| Component |组件|| +|[组件demo](https://wscats.github.io/vue-demo/组件.html)||| +| **Reference** | **Reference** | **Reference** | +|[Vue官网](http://cn.vuejs.org)|[Vue论坛](http://forum.vuejs.org)|[Awesome-vue](https://github.com/vuejs/awesome-vue)| + + +## Node +| Node | Article | +| --------- | --------- | +|[node技巧](https://github.com/Wscats/Good-text-Share/issues/44)|[NodeJs静态服务器](https://github.com/Wscats/angular-demo/tree/gh-pages/diyNodeServer)| +| **Reference** | **Reference** | +|[Node.js 包教不包会](https://github.com/alsotang/node-lessons)|[七天学会NodeJS](http://nqdeng.github.io/7-days-nodejs/)| +|[从零开始nodejs系列文章](http://blog.fens.me/series-nodejs)|[Node入门](http://www.nodebeginner.org/index-zh-cn.html)| +|[Node初学者入门,一本全面的NodeJS教程](http://ourjs.com/detail/529ca5950cb6498814000005)|| + +## Gulp +| Gulp | Article | +| --------- | --------- | +|[Gulp Demo](https://github.com/Wscats/glup)|| +| **Gulp** | **Reference** | +|[Gulp官网](http://gulpjs.com)|[Gulp中文网](http://www.gulpjs.com.cn)| +|[Gulp资料收集](https://github.com/Platform-CUF/use-gulp)|[Gulp:任务自动管理工具 - ruanyifeng](http://javascript.ruanyifeng.com/tool/gulp.html)| +|[Gulp插件](http://gulpjs.com/plugins])|[Gulp不完全入门教程](http://www.ido321.com/1622.html)| +|[Gulp 入门指南](https://github.com/nimojs/gulp-book)|| + +## 其他 +| Other | Article | +| --------- | --------- | +|[关于Pornographic website的一些前端分析](https://github.com/Wscats/node-demo/issues/4)|[微信公众号开发](https://github.com/Wscats/Good-text-Share/issues/50)| +|[Atom技巧总结](https://github.com/Wscats/Good-text-Share/issues/30)|[Mac小技巧](https://github.com/Wscats/Good-text-Share/issues/46)| +|[CSDN页面内JS跳转脚本](https://github.com/Wscats/Good-text-Share/issues/9)|[CSDN博客隐藏配置](https://github.com/Wscats/Good-text-Share/issues/8)| +|[百度设置小度机器人出现](https://github.com/Wscats/Good-text-Share/issues/7)|[前端冷知识,妙用浏览器地址栏](https://github.com/Wscats/Good-text-Share/issues/2)| +|[Vim笔记](https://github.com/Wscats/Good-text-Share/issues/27)|[Cordova配置&&Ionic配置(WebApp混合开发环境)](https://github.com/Wscats/Good-text-Share/issues/48)| +|[IE8及以下按钮超链接无法跳转的问题](https://github.com/Wscats/Good-text-Share/issues/33)|| + +## 分享功能 +| Share | Reference | +| --------- | --------- | +|[百度分享(PC)](http://share.baidu.com)|[JiaThis(PC)](http://jiathis.com)| +|[社会化分享组件(Mobile)](http://developer.baidu.com/soc/share)|[ShareSDK轻松实现社会化功能(Mobile)](http://www.mob.com)| +|[友盟分享(Mobile)](http://dev.umeng.com/social/android/quick-integration)|| + +## 在线演示 +| Reference | Reference | +| --------- | --------- | +|[js 在线编辑 - runjs](http://runjs.cn)|[js 在线编辑 - jsbin](http://jsbin.com)| +|[js 在线编辑 - codepen](http://codepen.io)|[js 在线编辑 - jsfiddle](http://jsfiddle.net)| +|[java 在线编辑 - runjs](http://ideone.com)|[js 在线编辑 - hcharts](http://code.hcharts.cn)| +|[js 在线编辑 - jsdm](http://jsdm.com)|[sql 在线编辑 - sqlfiddle](http://sqlfiddle.com)| +|[mozilla 在线编辑器](https://thimble.mozilla.org)|| + +## 富文本编辑器 +| Reference | Reference | +| --------- | --------- | +|[百度ueditor](http://ueditor.baidu.com/website)|[ckeditor](http://ckeditor.com)| +|[tinymce](https://www.tinymce.com)|[kindeditor](http://kindeditor.net)| +|[wysiwyg](http://www.bootcss.com/p/bootstrap-wysiwyg)|[BachEditor](http://integ.github.io/BachEditor)| +|[simditor](https://github.com/mycolorway/simditor)|[summernote](https://github.com/summernote/summernote)| +|[Squire](http://neilj.github.io/Squire)|[wangEditor](https://github.com/wangfupeng1988/wangEditor)| + +## Chrome +| Reference | Reference | +| --------- | --------- | +|[Chrome - 基础](http://www.cnblogs.com/constantince/p/4565261.html)|[Chrome - 进阶](http://www.cnblogs.com/constantince/p/4579121.html)| +|[Chrome - 性能](http://www.cnblogs.com/constantince/p/4585983.html)|[Chrome - 性能进阶](http://www.cnblogs.com/constantince/p/4607497.html)| +|[Chrome - 移动](http://www.cnblogs.com/constantince/p/4624241.html)|[Chrome - 使用技巧](http://www.cnblogs.com/liyunhua/p/4544738.html)| +|[Chrome - Console控制台不完全指南](http://www.cnblogs.com/Wayou/p/chrome-console-tips-and-tricks.html)|[chrome开发工具快捷键](http://anti-code.com/devtools-cheatsheet)| +|[Chrome 开发工具 Workspace 使用](http://www.iinterest.net/2014/05/09/chrome-dev-tool-workspace)|[Chrome神器Vimium快捷键学习记录](http://www.cppblog.com/deercoder/archive/2011/10/22/158886.html)| +|[Sass调试-w3cplus](http://www.w3cplus.com/sassguide/debug.html)|[如何更专业的使用Chrome开发者工具-w3cplus](http://www.w3cplus.com/tools/how-to-use-chrome-devtools-like-a-pro.html)| +|[Chrome调试canvas](http://sentsin.com/web/253.html)|[神器——Chrome开发者工具(一)](https://segmentfault.com/a/1190000000683599)| +|[奇趣百科性能优化(Chrome DevTools 中的 Timeline Profils 等工具使用介绍](https://xinranliu.me/2015-05-22-qiqu-performance)|[Chrome 开发者工具的 15 个小技巧](http://frontenddev.org/link/15-tips-of-chrome-developer-tools.html)| +|[Chrome开发者工具不完全指南](http://1ke.co/course/361)|[Chrome 开发者工具使用技巧](http://segmentfault.com/a/1190000003882567)| + +## 性能优化 +| Reference | Reference | +| --------- | --------- | +|[Javascript高性能动画与页面渲染](http://www.infoq.com/cn/articles/javascript-high-performance-animation-and-page-rendering)|[移动H5前端性能优化指南](http://isux.tencent.com/h5-performance.html)| +|[给网页设计师和前端开发者看的前端性能优化](http://www.uisdc.com/front-end-performance-for-web-designers-and-front-end-developers)|[张鑫旭——前端性能](http://www.zhangxinxu.com/wordpress/tag/%E5%89%8D%E7%AB%AF%E6%80%A7%E8%83%BD/)| +|[web前端性能优化进阶路](http://www.aliued.cn/2013/01/20/web%E5%89%8D%E7%AB%AF%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96%E8%BF%9B%E9%98%B6%E8%B7%AF.html)|[Hey——前端性能](http://www.feelcss.com/tag/%E5%89%8D%E7%AB%AF%E6%80%A7%E8%83%BD)| +|[YSLOW中文介绍](http://www.cnblogs.com/yslow)|[Yahoo!团队实践分享:网站性能](http://www.360doc.com/content/10/0928/09/2588264_56971287.shtml)| +|[加载,不只是少一点点](http://tgideas.qq.com/webplat/info/news_version3/804/808/811/m579/201109/41355.shtml)|[由12306谈谈网站前端性能和后端性能优化](http://coolshell.cn/articles/6470.html)| +|[【高性能前端1】高性能HTML](http://www.alloyteam.com/2012/10/high-performance-html)|[【高性能前端2】高性能CSS](http://www.alloyteam.com/2012/10/high-performance-css)| +|[前端工程与性能优化(上):静态资源版本更新与缓存](http://www.infoq.com/cn/articles/front-end-engineering-and-performance-optimization-part1)|[前端工程与性能优化(下):静态资源管理与模板框架](http://www.infoq.com/cn/articles/front-end-engineering-and-performance-optimization-part2)| +|[HTTPS连接的前几毫秒发生了什么](http://blog.jobbole.com/48369)|[Yslow](http://uicss.cn/yslow/#more-12319)| +|[阿里无线前端性能优化指南(Pt.1 加载期优化)](https://github.com/amfe/article/issues/1)|[毫秒必争,前端网页性能最佳实践](http://www.cnblogs.com/developersupport/p/3248695.html)| + +## CDN +| Reference | Reference | +| --------- | --------- | +|[Jquery&Bootstrap中文网开源项目免费 CDN 服务](http://www.bootcdn.cn/jquery)|[Bootstrap中文网开源项目免费 CDN 服务](http://www.bootcdn.cn)| +|[新浪CDN](http://lib.sinaapp.com)|[百度静态资源公共库](http://cdn.code.baidu.com)| +|[开放静态文件 CDN - 七牛](http://staticfile.org)|[CDN加速 - jq22](http://www.jq22.com/cdn)| +|[微软CDN](http://www.asp.net/ajax/cdn)|[Angular CDN](https://code.angularjs.org/1.5.8/)| +|[360网站卫士常用前端公共库CDN服务](http://libs.useso.com)|| + +## Git +| Article | Article | +| --------- | --------- | +|[Git操作](https://github.com/Wscats/Good-text-Share/issues/20)|[Git CSDN Blog](http://blog.csdn.net/qq_27080247/article/details/49942991)| +| **Reference** | **Reference** | +|[Git-scm](http://git-scm.com)|[Git-for-windows](https://git-for-windows.github.io)| +|[廖雪峰-Git教程](http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000)|[Gogithub](http://www.worldhello.net/gotgithub/index.html)| +|[Git常规命令练习](http://pcottle.github.io/learnGitBranching)|[Git的资料整理](https://github.com/xirong/my-git)| +|[我所记录的git命令(非常实用)](http://www.cnblogs.com/fanfan259/p/4810517.html)|[GitHub 漫游指南](https://github.com/phodal/github-roam)| +|[GitHub秘籍](https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.zh-cn.md)|[动画方式练习git](http://onlywei.github.io/explain-git-with-d3)| + +## Sass&Less +| Article | Article | +| --------- | --------- | +|[Less教程](https://github.com/Wscats/less-demo/issues/1)|| +| **Reference** | **Reference** | +|[Sass](http://www.w3cplus.com/sassguide)|[Sass中文文档](http://sass.bootcss.com)| +|[Less](http://less.bootcss.com)|| + +## Markdown +| Reference | Reference | +| --------- | --------- | +|[Markdown 语法说明 (简体中文版)](http://wowubuntu.com/markdown)|[Markdown入门参考](https://github.com/LearnShare/Learning-Markdown/blob/master/README.md)| +|[Mdeditor(一款国内的在线markdown编辑器)](https://www.zybuluo.com/mdeditor)|[Stackedit(国外的在线markdown编辑器,功能强大,同步云盘)](https://stackedit.io)| +|[Mditor一款轻量级的markdown编辑器](http://bh-lay.github.io/mditor)|[lepture-editor](https://github.com/lepture/editor)| +|[Markdown-editor](https://github.com/jbt/markdown-editor)|| + +## 前端文档 +| Reference | Reference | +| --------- | --------- | +|[前端知识结构](https://github.com/JacksonTian/fks)|[Web前端开发大系概览](https://github.com/unruledboy/WebFrontEndStack)| +|[免费的编程中文书籍索](https://github.com/justjavac/free-programming-books-zh_CN)|[前端书籍](https://github.com/dypsilon/frontend-dev-bookmarks)| +|[前端免费书籍大全](https://github.com/vhf/free-programming-books)|[重新介绍JavaScript(JS教程)](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/A_re-introduction_to_JavaScript)| +|[Gitbook](https://www.gitbook.com 国外的在线markdown可编辑成书)|[Front-End-Develop-Guide 前端开发指南](https://github.com/Front-End-Developers-Hunan/Front-End-Develop-Guide)| +|[前端开发笔记本](https://li-xinyang.gitbooks.io/frontend-notebook/content)|[大前端工具集](https://github.com/nieweidong/fetool)| +|[前端开发者手册](https://dwqs.gitbooks.io/frontenddevhandbook/content)|[结合个人经历总结的前端入门方法](https://github.com/qiu-deqing/FE-learning)| +|[2016最新前端学习计划](http://blog.csdn.net/qq_25827845/article/details/53079094)| + +## 前端规范 +| Reference | Reference | +| --------- | --------- | +|[通过分析github代码库总结出来的工程师代码书写习惯](http://alloyteam.github.io/CodeGuide/)|[HTML&CSS编码规范 by @mdo](http://codeguide.bootcss.com)| +|[前端编码规范之js - by yuwenhui](http://yuwenhui.github.io)|[前端编码规范之js - by 李靖](http://www.cnblogs.com/hustskyking/p/javascript-spec.html)| +|[Airbnb JavaScript 编码规范(简体中文版)](https://github.com/yuche/javascript#table-of-contents)|[AMD与CMD规范的区别](http://www.zhihu.com/question/20351507)| +|[AMD与CMD规范的区别](http://www.cnblogs.com/tugenhua0707/p/3507957.html)|[KISSY 源码规范](http://docs.kissyui.com/1.4/docs/html/tutorials/style-guide/kissy-source-style.html)| +|[前端代码规范及最佳实践](http://blog.jobbole.com/79075)|[百度前端规范](http://coderlmn.github.io/code-standards)| +|[JavaScript风格指南/编码规范(Airbnb公司版)](http://blog.jobbole.com/79484)|[网易前端开发规范](http://nec.netease.com/standard)| +|[前端规范资源列表](https://github.com/ecomfe/spec)|[Web 前端开发规范文档](http://codecloud.net/5622.html)| + +## 前端面试 +| Reference | Reference | +| --------- | --------- | +|[2016校招内推 -- 阿里巴巴前端 -- 四面面试经历](http://www.cnblogs.com/imwtr/p/4685546.html)|[那几个月在找工作(百度,网易游戏,华为)](https://www.nowcoder.com/discuss/3196)| +|[前端开发面试题](https://segmentfault.com/a/1190000000465431)|[Front-end-Interview-questions](https://github.com/hawx1993/Front-end-Interview-questions)| +|[5个经典的前端面试问题](http://ourjs.com/detail/5%E4%B8%AA%E7%BB%8F%E5%85%B8%E7%9A%84%E5%89%8D%E7%AB%AF%E)|[Front-end-Developer-Interview-Questions](https://github.com/h5bp/Front-end-Developer-Interview-Questions/tree/master/Translations/Chinese)| +|[BAT及各大互联网公司2014前端笔试面试题:JavaScript篇](http://blog.jobbole.com/78738/)|[前端开发面试题大收集](https://github.com/paddingme/Front-end-Web-Development-Interview-Question)| +|[收集的前端面试题和答案](https://github.com/qiu-deqing/FE-interview)|[前端开发面试题](https://github.com/markyun/My-blog/blob/master/Front-end-Developer-Questions/Questions-and-Answers/README.md)| +|[前端面试大全](https://segmentfault.com/a/1190000005947094)|[关于前端面试](https://mdluo.github.io/blog/about-front-end-interview/)| + +## 前端网站 +| Reference | Reference | +| --------- | --------- | +|[掘金](https://gold.xitu.io/)|[百度FEX](http://fex.baidu.com/)| +|[阿里UED](http://www.aliued.com/)|[菜鸟教程](http://www.runoob.com/)| +|[QDFuns](http://www.qdfuns.com/portal.php)|[幕课网](http://www.imooc.com/)| +|[Codepen](http://codepen.io/)|[Sentsin](http://sentsin.com/daohang/)| +|[CTOLib](http://www.ctolib.com/javascript/)|[CTOLib/Node](http://www.ctolib.com/nodejs/)| + +## JS练习 +| Reference | Reference | +| --------- | --------- | +|[Codewars](https://www.codewars.com/)|[Javascript-puzzlers](http://javascript-puzzlers.herokuapp.com/)| +|[Freecodecamp中文版](https://freecodecamp.cn/)|[ES6katas](http://es6katas.org/)| +|[Now Coder牛客网](https://www.nowcoder.com/ta/js-assessment)|[Leetcode](https://leetcode.com/)| +|[Nodeschool](https://nodeschool.io/)|[Hackerrank](https://www.hackerrank.com/)| + +## 算法 +| Reference | Reference | +| --------- | --------- | +|[数据结构与算法 JavaScript 描述. 章节练习](https://github.com/Ralph-Wang/algorithm.in.js)|[常见排序算法(JS版)](https://github.com/twobin/twobinSort)| +|[经典排序](https://github.com/luofei2011/jsAgm/blob/master/js/sort.js)|[常见排序算法-js版本](https://github.com/hechangmin/jssort)| + +## ES +| Reference | Reference | +| --------- | --------- | +|[Exploring-ES6翻译](http://es6-org.github.io/exploring-es6/)|[阮一峰 ES6](http://es6.ruanyifeng.com)| +|[ECMA-262,第 5 版](http://yanhaijing.com/es5)|[ES5](http://es5.github.io)| diff --git a/README/Cache/Cache.php b/README/Cache/Cache.php deleted file mode 100644 index 0c87a56..0000000 --- a/README/Cache/Cache.php +++ /dev/null @@ -1,255 +0,0 @@ -_adapter = $config['adapter']; - isset($config['backup']) && $this->_backup_driver = $config['backup']; - isset($config['key_prefix']) && $this->key_prefix = $config['key_prefix']; - - // If the specified adapter isn't available, check the backup. - if ( ! $this->is_supported($this->_adapter)) - { - if ( ! $this->is_supported($this->_backup_driver)) - { - // Backup isn't supported either. Default to 'Dummy' driver. - log_message('error', 'Cache adapter "'.$this->_adapter.'" and backup "'.$this->_backup_driver.'" are both unavailable. Cache is now using "Dummy" adapter.'); - $this->_adapter = 'dummy'; - } - else - { - // Backup is supported. Set it to primary. - log_message('debug', 'Cache adapter "'.$this->_adapter.'" is unavailable. Falling back to "'.$this->_backup_driver.'" backup adapter.'); - $this->_adapter = $this->_backup_driver; - } - } - } - - // ------------------------------------------------------------------------ - - /** - * Get - * - * Look for a value in the cache. If it exists, return the data - * if not, return FALSE - * - * @param string $id - * @return mixed value matching $id or FALSE on failure - */ - public function get($id) - { - return $this->{$this->_adapter}->get($this->key_prefix.$id); - } - - // ------------------------------------------------------------------------ - - /** - * Cache Save - * - * @param string $id Cache ID - * @param mixed $data Data to store - * @param int $ttl Cache TTL (in seconds) - * @param bool $raw Whether to store the raw value - * @return bool TRUE on success, FALSE on failure - */ - public function save($id, $data, $ttl = 60, $raw = FALSE) - { - return $this->{$this->_adapter}->save($this->key_prefix.$id, $data, $ttl, $raw); - } - - // ------------------------------------------------------------------------ - - /** - * Delete from Cache - * - * @param string $id Cache ID - * @return bool TRUE on success, FALSE on failure - */ - public function delete($id) - { - return $this->{$this->_adapter}->delete($this->key_prefix.$id); - } - - // ------------------------------------------------------------------------ - - /** - * Increment a raw value - * - * @param string $id Cache ID - * @param int $offset Step/value to add - * @return mixed New value on success or FALSE on failure - */ - public function increment($id, $offset = 1) - { - return $this->{$this->_adapter}->increment($this->key_prefix.$id, $offset); - } - - // ------------------------------------------------------------------------ - - /** - * Decrement a raw value - * - * @param string $id Cache ID - * @param int $offset Step/value to reduce by - * @return mixed New value on success or FALSE on failure - */ - public function decrement($id, $offset = 1) - { - return $this->{$this->_adapter}->decrement($this->key_prefix.$id, $offset); - } - - // ------------------------------------------------------------------------ - - /** - * Clean the cache - * - * @return bool TRUE on success, FALSE on failure - */ - public function clean() - { - return $this->{$this->_adapter}->clean(); - } - - // ------------------------------------------------------------------------ - - /** - * Cache Info - * - * @param string $type = 'user' user/filehits - * @return mixed array containing cache info on success OR FALSE on failure - */ - public function cache_info($type = 'user') - { - return $this->{$this->_adapter}->cache_info($type); - } - - // ------------------------------------------------------------------------ - - /** - * Get Cache Metadata - * - * @param string $id key to get cache metadata on - * @return mixed cache item metadata - */ - public function get_metadata($id) - { - return $this->{$this->_adapter}->get_metadata($this->key_prefix.$id); - } - - // ------------------------------------------------------------------------ - - /** - * Is the requested driver supported in this environment? - * - * @param string $driver The driver to test - * @return array - */ - public function is_supported($driver) - { - static $support; - - if ( ! isset($support, $support[$driver])) - { - $support[$driver] = $this->{$driver}->is_supported(); - } - - return $support[$driver]; - } -} diff --git a/README/Cache/drivers/Cache_apc.php b/README/Cache/drivers/Cache_apc.php deleted file mode 100644 index e0d2ffb..0000000 --- a/README/Cache/drivers/Cache_apc.php +++ /dev/null @@ -1,210 +0,0 @@ - $time + $ttl, - 'mtime' => $time, - 'data' => unserialize($data) - ); - } - - // ------------------------------------------------------------------------ - - /** - * is_supported() - * - * Check to see if APC is available on this system, bail if it isn't. - * - * @return bool - */ - public function is_supported() - { - if ( ! extension_loaded('apc') OR ! ini_get('apc.enabled')) - { - log_message('debug', 'The APC PHP extension must be loaded to use APC Cache.'); - return FALSE; - } - - return TRUE; - } - -} diff --git a/README/Cache/drivers/Cache_dummy.php b/README/Cache/drivers/Cache_dummy.php deleted file mode 100644 index bf80945..0000000 --- a/README/Cache/drivers/Cache_dummy.php +++ /dev/null @@ -1,172 +0,0 @@ -load->helper('file'); - $path = $CI->config->item('cache_path'); - $this->_cache_path = ($path === '') ? APPPATH.'cache/' : $path; - } - - // ------------------------------------------------------------------------ - - /** - * Fetch from cache - * - * @param string $id Cache ID - * @return mixed Data on success, FALSE on failure - */ - public function get($id) - { - $data = $this->_get($id); - return is_array($data) ? $data['data'] : FALSE; - } - - // ------------------------------------------------------------------------ - - /** - * Save into cache - * - * @param string $id Cache ID - * @param mixed $data Data to store - * @param int $ttl Time to live in seconds - * @param bool $raw Whether to store the raw value (unused) - * @return bool TRUE on success, FALSE on failure - */ - public function save($id, $data, $ttl = 60, $raw = FALSE) - { - $contents = array( - 'time' => time(), - 'ttl' => $ttl, - 'data' => $data - ); - - if (write_file($this->_cache_path.$id, serialize($contents))) - { - chmod($this->_cache_path.$id, 0640); - return TRUE; - } - - return FALSE; - } - - // ------------------------------------------------------------------------ - - /** - * Delete from Cache - * - * @param mixed unique identifier of item in cache - * @return bool true on success/false on failure - */ - public function delete($id) - { - return file_exists($this->_cache_path.$id) ? unlink($this->_cache_path.$id) : FALSE; - } - - // ------------------------------------------------------------------------ - - /** - * Increment a raw value - * - * @param string $id Cache ID - * @param int $offset Step/value to add - * @return New value on success, FALSE on failure - */ - public function increment($id, $offset = 1) - { - $data = $this->_get($id); - - if ($data === FALSE) - { - $data = array('data' => 0, 'ttl' => 60); - } - elseif ( ! is_int($data['data'])) - { - return FALSE; - } - - $new_value = $data['data'] + $offset; - return $this->save($id, $new_value, $data['ttl']) - ? $new_value - : FALSE; - } - - // ------------------------------------------------------------------------ - - /** - * Decrement a raw value - * - * @param string $id Cache ID - * @param int $offset Step/value to reduce by - * @return New value on success, FALSE on failure - */ - public function decrement($id, $offset = 1) - { - $data = $this->_get($id); - - if ($data === FALSE) - { - $data = array('data' => 0, 'ttl' => 60); - } - elseif ( ! is_int($data['data'])) - { - return FALSE; - } - - $new_value = $data['data'] - $offset; - return $this->save($id, $new_value, $data['ttl']) - ? $new_value - : FALSE; - } - - // ------------------------------------------------------------------------ - - /** - * Clean the Cache - * - * @return bool false on failure/true on success - */ - public function clean() - { - return delete_files($this->_cache_path, FALSE, TRUE); - } - - // ------------------------------------------------------------------------ - - /** - * Cache Info - * - * Not supported by file-based caching - * - * @param string user/filehits - * @return mixed FALSE - */ - public function cache_info($type = NULL) - { - return get_dir_file_info($this->_cache_path); - } - - // ------------------------------------------------------------------------ - - /** - * Get Cache Metadata - * - * @param mixed key to get cache metadata on - * @return mixed FALSE on failure, array on success. - */ - public function get_metadata($id) - { - if ( ! file_exists($this->_cache_path.$id)) - { - return FALSE; - } - - $data = unserialize(file_get_contents($this->_cache_path.$id)); - - if (is_array($data)) - { - $mtime = filemtime($this->_cache_path.$id); - - if ( ! isset($data['ttl'])) - { - return FALSE; - } - - return array( - 'expire' => $mtime + $data['ttl'], - 'mtime' => $mtime - ); - } - - return FALSE; - } - - // ------------------------------------------------------------------------ - - /** - * Is supported - * - * In the file driver, check to see that the cache directory is indeed writable - * - * @return bool - */ - public function is_supported() - { - return is_really_writable($this->_cache_path); - } - - // ------------------------------------------------------------------------ - - /** - * Get all data - * - * Internal method to get all the relevant data about a cache item - * - * @param string $id Cache ID - * @return mixed Data array on success or FALSE on failure - */ - protected function _get($id) - { - if ( ! is_file($this->_cache_path.$id)) - { - return FALSE; - } - - $data = unserialize(file_get_contents($this->_cache_path.$id)); - - if ($data['ttl'] > 0 && time() > $data['time'] + $data['ttl']) - { - unlink($this->_cache_path.$id); - return FALSE; - } - - return $data; - } - -} diff --git a/README/Cache/drivers/Cache_memcached.php b/README/Cache/drivers/Cache_memcached.php deleted file mode 100644 index 59cf468..0000000 --- a/README/Cache/drivers/Cache_memcached.php +++ /dev/null @@ -1,289 +0,0 @@ - array( - 'host' => '127.0.0.1', - 'port' => 11211, - 'weight' => 1 - ) - ); - - // ------------------------------------------------------------------------ - - /** - * Class constructor - * - * Setup Memcache(d) - * - * @return void - */ - public function __construct() - { - // Try to load memcached server info from the config file. - $CI =& get_instance(); - $defaults = $this->_memcache_conf['default']; - - if ($CI->config->load('memcached', TRUE, TRUE)) - { - if (is_array($CI->config->config['memcached'])) - { - $this->_memcache_conf = array(); - - foreach ($CI->config->config['memcached'] as $name => $conf) - { - $this->_memcache_conf[$name] = $conf; - } - } - } - - if (class_exists('Memcached', FALSE)) - { - $this->_memcached = new Memcached(); - } - elseif (class_exists('Memcache', FALSE)) - { - $this->_memcached = new Memcache(); - } - else - { - log_message('error', 'Cache: Failed to create Memcache(d) object; extension not loaded?'); - } - - foreach ($this->_memcache_conf as $cache_server) - { - isset($cache_server['hostname']) OR $cache_server['hostname'] = $defaults['host']; - isset($cache_server['port']) OR $cache_server['port'] = $defaults['port']; - isset($cache_server['weight']) OR $cache_server['weight'] = $defaults['weight']; - - if (get_class($this->_memcached) === 'Memcache') - { - // Third parameter is persistance and defaults to TRUE. - $this->_memcached->addServer( - $cache_server['hostname'], - $cache_server['port'], - TRUE, - $cache_server['weight'] - ); - } - else - { - $this->_memcached->addServer( - $cache_server['hostname'], - $cache_server['port'], - $cache_server['weight'] - ); - } - } - } - - // ------------------------------------------------------------------------ - - /** - * Fetch from cache - * - * @param string $id Cache ID - * @return mixed Data on success, FALSE on failure - */ - public function get($id) - { - $data = $this->_memcached->get($id); - - return is_array($data) ? $data[0] : $data; - } - - // ------------------------------------------------------------------------ - - /** - * Save - * - * @param string $id Cache ID - * @param mixed $data Data being cached - * @param int $ttl Time to live - * @param bool $raw Whether to store the raw value - * @return bool TRUE on success, FALSE on failure - */ - public function save($id, $data, $ttl = 60, $raw = FALSE) - { - if ($raw !== TRUE) - { - $data = array($data, time(), $ttl); - } - - if (get_class($this->_memcached) === 'Memcached') - { - return $this->_memcached->set($id, $data, $ttl); - } - elseif (get_class($this->_memcached) === 'Memcache') - { - return $this->_memcached->set($id, $data, 0, $ttl); - } - - return FALSE; - } - - // ------------------------------------------------------------------------ - - /** - * Delete from Cache - * - * @param mixed key to be deleted. - * @return bool true on success, false on failure - */ - public function delete($id) - { - return $this->_memcached->delete($id); - } - - // ------------------------------------------------------------------------ - - /** - * Increment a raw value - * - * @param string $id Cache ID - * @param int $offset Step/value to add - * @return mixed New value on success or FALSE on failure - */ - public function increment($id, $offset = 1) - { - return $this->_memcached->increment($id, $offset); - } - - // ------------------------------------------------------------------------ - - /** - * Decrement a raw value - * - * @param string $id Cache ID - * @param int $offset Step/value to reduce by - * @return mixed New value on success or FALSE on failure - */ - public function decrement($id, $offset = 1) - { - return $this->_memcached->decrement($id, $offset); - } - - // ------------------------------------------------------------------------ - - /** - * Clean the Cache - * - * @return bool false on failure/true on success - */ - public function clean() - { - return $this->_memcached->flush(); - } - - // ------------------------------------------------------------------------ - - /** - * Cache Info - * - * @return mixed array on success, false on failure - */ - public function cache_info() - { - return $this->_memcached->getStats(); - } - - // ------------------------------------------------------------------------ - - /** - * Get Cache Metadata - * - * @param mixed key to get cache metadata on - * @return mixed FALSE on failure, array on success. - */ - public function get_metadata($id) - { - $stored = $this->_memcached->get($id); - - if (count($stored) !== 3) - { - return FALSE; - } - - list($data, $time, $ttl) = $stored; - - return array( - 'expire' => $time + $ttl, - 'mtime' => $time, - 'data' => $data - ); - } - - // ------------------------------------------------------------------------ - - /** - * Is supported - * - * Returns FALSE if memcached is not supported on the system. - * If it is, we setup the memcached object & return TRUE - * - * @return bool - */ - public function is_supported() - { - return (extension_loaded('memcached') OR extension_loaded('memcache')); - } -} diff --git a/README/Cache/drivers/Cache_redis.php b/README/Cache/drivers/Cache_redis.php deleted file mode 100644 index ea0059f..0000000 --- a/README/Cache/drivers/Cache_redis.php +++ /dev/null @@ -1,320 +0,0 @@ - - * @link - */ -class CI_Cache_redis extends CI_Driver -{ - /** - * Default config - * - * @static - * @var array - */ - protected static $_default_config = array( - 'socket_type' => 'tcp', - 'host' => '127.0.0.1', - 'password' => NULL, - 'port' => 6379, - 'timeout' => 0 - ); - - /** - * Redis connection - * - * @var Redis - */ - protected $_redis; - - /** - * An internal cache for storing keys of serialized values. - * - * @var array - */ - protected $_serialized = array(); - - // ------------------------------------------------------------------------ - - /** - * Class constructor - * - * Setup Redis - * - * Loads Redis config file if present. Will halt execution - * if a Redis connection can't be established. - * - * @return void - * @see Redis::connect() - */ - public function __construct() - { - $config = array(); - $CI =& get_instance(); - - if ($CI->config->load('redis', TRUE, TRUE)) - { - $config = $CI->config->item('redis'); - } - - $config = array_merge(self::$_default_config, $config); - $this->_redis = new Redis(); - - try - { - if ($config['socket_type'] === 'unix') - { - $success = $this->_redis->connect($config['socket']); - } - else // tcp socket - { - $success = $this->_redis->connect($config['host'], $config['port'], $config['timeout']); - } - - if ( ! $success) - { - log_message('error', 'Cache: Redis connection failed. Check your configuration.'); - } - - if (isset($config['password']) && ! $this->_redis->auth($config['password'])) - { - log_message('error', 'Cache: Redis authentication failed.'); - } - } - catch (RedisException $e) - { - log_message('error', 'Cache: Redis connection refused ('.$e->getMessage().')'); - } - - // Initialize the index of serialized values. - $serialized = $this->_redis->sMembers('_ci_redis_serialized'); - empty($serialized) OR $this->_serialized = array_flip($serialized); - } - - // ------------------------------------------------------------------------ - - /** - * Get cache - * - * @param string Cache ID - * @return mixed - */ - public function get($key) - { - $value = $this->_redis->get($key); - - if ($value !== FALSE && isset($this->_serialized[$key])) - { - return unserialize($value); - } - - return $value; - } - - // ------------------------------------------------------------------------ - - /** - * Save cache - * - * @param string $id Cache ID - * @param mixed $data Data to save - * @param int $ttl Time to live in seconds - * @param bool $raw Whether to store the raw value (unused) - * @return bool TRUE on success, FALSE on failure - */ - public function save($id, $data, $ttl = 60, $raw = FALSE) - { - if (is_array($data) OR is_object($data)) - { - if ( ! $this->_redis->sIsMember('_ci_redis_serialized', $id) && ! $this->_redis->sAdd('_ci_redis_serialized', $id)) - { - return FALSE; - } - - isset($this->_serialized[$id]) OR $this->_serialized[$id] = TRUE; - $data = serialize($data); - } - elseif (isset($this->_serialized[$id])) - { - $this->_serialized[$id] = NULL; - $this->_redis->sRemove('_ci_redis_serialized', $id); - } - - return $this->_redis->set($id, $data, $ttl); - } - - // ------------------------------------------------------------------------ - - /** - * Delete from cache - * - * @param string Cache key - * @return bool - */ - public function delete($key) - { - if ($this->_redis->delete($key) !== 1) - { - return FALSE; - } - - if (isset($this->_serialized[$key])) - { - $this->_serialized[$key] = NULL; - $this->_redis->sRemove('_ci_redis_serialized', $key); - } - - return TRUE; - } - - // ------------------------------------------------------------------------ - - /** - * Increment a raw value - * - * @param string $id Cache ID - * @param int $offset Step/value to add - * @return mixed New value on success or FALSE on failure - */ - public function increment($id, $offset = 1) - { - return $this->_redis->incr($id, $offset); - } - - // ------------------------------------------------------------------------ - - /** - * Decrement a raw value - * - * @param string $id Cache ID - * @param int $offset Step/value to reduce by - * @return mixed New value on success or FALSE on failure - */ - public function decrement($id, $offset = 1) - { - return $this->_redis->decr($id, $offset); - } - - // ------------------------------------------------------------------------ - - /** - * Clean cache - * - * @return bool - * @see Redis::flushDB() - */ - public function clean() - { - return $this->_redis->flushDB(); - } - - // ------------------------------------------------------------------------ - - /** - * Get cache driver info - * - * @param string Not supported in Redis. - * Only included in order to offer a - * consistent cache API. - * @return array - * @see Redis::info() - */ - public function cache_info($type = NULL) - { - return $this->_redis->info(); - } - - // ------------------------------------------------------------------------ - - /** - * Get cache metadata - * - * @param string Cache key - * @return array - */ - public function get_metadata($key) - { - $value = $this->get($key); - - if ($value !== FALSE) - { - return array( - 'expire' => time() + $this->_redis->ttl($key), - 'data' => $value - ); - } - - return FALSE; - } - - // ------------------------------------------------------------------------ - - /** - * Check if Redis driver is supported - * - * @return bool - */ - public function is_supported() - { - return extension_loaded('redis'); - } - - // ------------------------------------------------------------------------ - - /** - * Class destructor - * - * Closes the connection to Redis if present. - * - * @return void - */ - public function __destruct() - { - if ($this->_redis) - { - $this->_redis->close(); - } - } -} diff --git a/README/Cache/drivers/Cache_wincache.php b/README/Cache/drivers/Cache_wincache.php deleted file mode 100644 index 9cc6ff0..0000000 --- a/README/Cache/drivers/Cache_wincache.php +++ /dev/null @@ -1,206 +0,0 @@ - $ttl - $age, - 'hitcount' => $hitcount, - 'age' => $age, - 'ttl' => $ttl - ); - } - - return FALSE; - } - - // ------------------------------------------------------------------------ - - /** - * is_supported() - * - * Check to see if WinCache is available on this system, bail if it isn't. - * - * @return bool - */ - public function is_supported() - { - if ( ! extension_loaded('wincache') OR ! ini_get('wincache.ucenabled')) - { - log_message('debug', 'The Wincache PHP extension must be loaded to use Wincache Cache.'); - return FALSE; - } - - return TRUE; - } - -} diff --git a/README/Cache/drivers/index.html b/README/Cache/drivers/index.html deleted file mode 100644 index b702fbc..0000000 --- a/README/Cache/drivers/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - 403 Forbidden - - - -

Directory access is forbidden.

- - - diff --git a/README/Cache/index.html b/README/Cache/index.html deleted file mode 100644 index b702fbc..0000000 --- a/README/Cache/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - 403 Forbidden - - - -

Directory access is forbidden.

- - - diff --git a/README/Calendar.php b/README/Calendar.php deleted file mode 100644 index f6a0c39..0000000 --- a/README/Calendar.php +++ /dev/null @@ -1,546 +0,0 @@ -CI =& get_instance(); - $this->CI->lang->load('calendar'); - - empty($config) OR $this->initialize($config); - - log_message('info', 'Calendar Class Initialized'); - } - - // -------------------------------------------------------------------- - - /** - * Initialize the user preferences - * - * Accepts an associative array as input, containing display preferences - * - * @param array config preferences - * @return CI_Calendar - */ - public function initialize($config = array()) - { - foreach ($config as $key => $val) - { - if (isset($this->$key)) - { - $this->$key = $val; - } - } - - // Set the next_prev_url to the controller if required but not defined - if ($this->show_next_prev === TRUE && empty($this->next_prev_url)) - { - $this->next_prev_url = $this->CI->config->site_url($this->CI->router->class.'/'.$this->CI->router->method); - } - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Generate the calendar - * - * @param int the year - * @param int the month - * @param array the data to be shown in the calendar cells - * @return string - */ - public function generate($year = '', $month = '', $data = array()) - { - $local_time = time(); - - // Set and validate the supplied month/year - if (empty($year)) - { - $year = date('Y', $local_time); - } - elseif (strlen($year) === 1) - { - $year = '200'.$year; - } - elseif (strlen($year) === 2) - { - $year = '20'.$year; - } - - if (empty($month)) - { - $month = date('m', $local_time); - } - elseif (strlen($month) === 1) - { - $month = '0'.$month; - } - - $adjusted_date = $this->adjust_date($month, $year); - - $month = $adjusted_date['month']; - $year = $adjusted_date['year']; - - // Determine the total days in the month - $total_days = $this->get_total_days($month, $year); - - // Set the starting day of the week - $start_days = array('sunday' => 0, 'monday' => 1, 'tuesday' => 2, 'wednesday' => 3, 'thursday' => 4, 'friday' => 5, 'saturday' => 6); - $start_day = isset($start_days[$this->start_day]) ? $start_days[$this->start_day] : 0; - - // Set the starting day number - $local_date = mktime(12, 0, 0, $month, 1, $year); - $date = getdate($local_date); - $day = $start_day + 1 - $date['wday']; - - while ($day > 1) - { - $day -= 7; - } - - // Set the current month/year/day - // We use this to determine the "today" date - $cur_year = date('Y', $local_time); - $cur_month = date('m', $local_time); - $cur_day = date('j', $local_time); - - $is_current_month = ($cur_year == $year && $cur_month == $month); - - // Generate the template data array - $this->parse_template(); - - // Begin building the calendar output - $out = $this->replacements['table_open']."\n\n".$this->replacements['heading_row_start']."\n"; - - // "previous" month link - if ($this->show_next_prev === TRUE) - { - // Add a trailing slash to the URL if needed - $this->next_prev_url = preg_replace('/(.+?)\/*$/', '\\1/', $this->next_prev_url); - - $adjusted_date = $this->adjust_date($month - 1, $year); - $out .= str_replace('{previous_url}', $this->next_prev_url.$adjusted_date['year'].'/'.$adjusted_date['month'], $this->replacements['heading_previous_cell'])."\n"; - } - - // Heading containing the month/year - $colspan = ($this->show_next_prev === TRUE) ? 5 : 7; - - $this->replacements['heading_title_cell'] = str_replace('{colspan}', $colspan, - str_replace('{heading}', $this->get_month_name($month).' '.$year, $this->replacements['heading_title_cell'])); - - $out .= $this->replacements['heading_title_cell']."\n"; - - // "next" month link - if ($this->show_next_prev === TRUE) - { - $adjusted_date = $this->adjust_date($month + 1, $year); - $out .= str_replace('{next_url}', $this->next_prev_url.$adjusted_date['year'].'/'.$adjusted_date['month'], $this->replacements['heading_next_cell']); - } - - $out .= "\n".$this->replacements['heading_row_end']."\n\n" - // Write the cells containing the days of the week - .$this->replacements['week_row_start']."\n"; - - $day_names = $this->get_day_names(); - - for ($i = 0; $i < 7; $i ++) - { - $out .= str_replace('{week_day}', $day_names[($start_day + $i) %7], $this->replacements['week_day_cell']); - } - - $out .= "\n".$this->replacements['week_row_end']."\n"; - - // Build the main body of the calendar - while ($day <= $total_days) - { - $out .= "\n".$this->replacements['cal_row_start']."\n"; - - for ($i = 0; $i < 7; $i++) - { - if ($day > 0 && $day <= $total_days) - { - $out .= ($is_current_month === TRUE && $day == $cur_day) ? $this->replacements['cal_cell_start_today'] : $this->replacements['cal_cell_start']; - - if (isset($data[$day])) - { - // Cells with content - $temp = ($is_current_month === TRUE && $day == $cur_day) ? - $this->replacements['cal_cell_content_today'] : $this->replacements['cal_cell_content']; - $out .= str_replace(array('{content}', '{day}'), array($data[$day], $day), $temp); - } - else - { - // Cells with no content - $temp = ($is_current_month === TRUE && $day == $cur_day) ? - $this->replacements['cal_cell_no_content_today'] : $this->replacements['cal_cell_no_content']; - $out .= str_replace('{day}', $day, $temp); - } - - $out .= ($is_current_month === TRUE && $day == $cur_day) ? $this->replacements['cal_cell_end_today'] : $this->replacements['cal_cell_end']; - } - elseif ($this->show_other_days === TRUE) - { - $out .= $this->replacements['cal_cell_start_other']; - - if ($day <= 0) - { - // Day of previous month - $prev_month = $this->adjust_date($month - 1, $year); - $prev_month_days = $this->get_total_days($prev_month['month'], $prev_month['year']); - $out .= str_replace('{day}', $prev_month_days + $day, $this->replacements['cal_cell_other']); - } - else - { - // Day of next month - $out .= str_replace('{day}', $day - $total_days, $this->replacements['cal_cell_other']); - } - - $out .= $this->replacements['cal_cell_end_other']; - } - else - { - // Blank cells - $out .= $this->replacements['cal_cell_start'].$this->replacements['cal_cell_blank'].$this->replacements['cal_cell_end']; - } - - $day++; - } - - $out .= "\n".$this->replacements['cal_row_end']."\n"; - } - - return $out .= "\n".$this->replacements['table_close']; - } - - // -------------------------------------------------------------------- - - /** - * Get Month Name - * - * Generates a textual month name based on the numeric - * month provided. - * - * @param int the month - * @return string - */ - public function get_month_name($month) - { - if ($this->month_type === 'short') - { - $month_names = array('01' => 'cal_jan', '02' => 'cal_feb', '03' => 'cal_mar', '04' => 'cal_apr', '05' => 'cal_may', '06' => 'cal_jun', '07' => 'cal_jul', '08' => 'cal_aug', '09' => 'cal_sep', '10' => 'cal_oct', '11' => 'cal_nov', '12' => 'cal_dec'); - } - else - { - $month_names = array('01' => 'cal_january', '02' => 'cal_february', '03' => 'cal_march', '04' => 'cal_april', '05' => 'cal_mayl', '06' => 'cal_june', '07' => 'cal_july', '08' => 'cal_august', '09' => 'cal_september', '10' => 'cal_october', '11' => 'cal_november', '12' => 'cal_december'); - } - - return ($this->CI->lang->line($month_names[$month]) === FALSE) - ? ucfirst(substr($month_names[$month], 4)) - : $this->CI->lang->line($month_names[$month]); - } - - // -------------------------------------------------------------------- - - /** - * Get Day Names - * - * Returns an array of day names (Sunday, Monday, etc.) based - * on the type. Options: long, short, abr - * - * @param string - * @return array - */ - public function get_day_names($day_type = '') - { - if ($day_type !== '') - { - $this->day_type = $day_type; - } - - if ($this->day_type === 'long') - { - $day_names = array('sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'); - } - elseif ($this->day_type === 'short') - { - $day_names = array('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'); - } - else - { - $day_names = array('su', 'mo', 'tu', 'we', 'th', 'fr', 'sa'); - } - - $days = array(); - for ($i = 0, $c = count($day_names); $i < $c; $i++) - { - $days[] = ($this->CI->lang->line('cal_'.$day_names[$i]) === FALSE) ? ucfirst($day_names[$i]) : $this->CI->lang->line('cal_'.$day_names[$i]); - } - - return $days; - } - - // -------------------------------------------------------------------- - - /** - * Adjust Date - * - * This function makes sure that we have a valid month/year. - * For example, if you submit 13 as the month, the year will - * increment and the month will become January. - * - * @param int the month - * @param int the year - * @return array - */ - public function adjust_date($month, $year) - { - $date = array(); - - $date['month'] = $month; - $date['year'] = $year; - - while ($date['month'] > 12) - { - $date['month'] -= 12; - $date['year']++; - } - - while ($date['month'] <= 0) - { - $date['month'] += 12; - $date['year']--; - } - - if (strlen($date['month']) === 1) - { - $date['month'] = '0'.$date['month']; - } - - return $date; - } - - // -------------------------------------------------------------------- - - /** - * Total days in a given month - * - * @param int the month - * @param int the year - * @return int - */ - public function get_total_days($month, $year) - { - $this->CI->load->helper('date'); - return days_in_month($month, $year); - } - - // -------------------------------------------------------------------- - - /** - * Set Default Template Data - * - * This is used in the event that the user has not created their own template - * - * @return array - */ - public function default_template() - { - return array( - 'table_open' => '', - 'heading_row_start' => '', - 'heading_previous_cell' => '', - 'heading_title_cell' => '', - 'heading_next_cell' => '', - 'heading_row_end' => '', - 'week_row_start' => '', - 'week_day_cell' => '', - 'week_row_end' => '', - 'cal_row_start' => '', - 'cal_cell_start' => '', - 'cal_cell_end_today' => '', - 'cal_cell_end_other' => '', - 'cal_row_end' => '', - 'table_close' => '
<<{heading}>>
{week_day}
', - 'cal_cell_start_today' => '', - 'cal_cell_start_other' => '', - 'cal_cell_content' => '{day}', - 'cal_cell_content_today' => '{day}', - 'cal_cell_no_content' => '{day}', - 'cal_cell_no_content_today' => '{day}', - 'cal_cell_blank' => ' ', - 'cal_cell_other' => '{day}', - 'cal_cell_end' => '
' - ); - } - - // -------------------------------------------------------------------- - - /** - * Parse Template - * - * Harvests the data within the template {pseudo-variables} - * used to display the calendar - * - * @return CI_Calendar - */ - public function parse_template() - { - $this->replacements = $this->default_template(); - - if (empty($this->template)) - { - return $this; - } - - if (is_string($this->template)) - { - $today = array('cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today'); - - foreach (array('table_open', 'table_close', 'heading_row_start', 'heading_previous_cell', 'heading_title_cell', 'heading_next_cell', 'heading_row_end', 'week_row_start', 'week_day_cell', 'week_row_end', 'cal_row_start', 'cal_cell_start', 'cal_cell_content', 'cal_cell_no_content', 'cal_cell_blank', 'cal_cell_end', 'cal_row_end', 'cal_cell_start_today', 'cal_cell_content_today', 'cal_cell_no_content_today', 'cal_cell_end_today', 'cal_cell_start_other', 'cal_cell_other', 'cal_cell_end_other') as $val) - { - if (preg_match('/\{'.$val.'\}(.*?)\{\/'.$val.'\}/si', $this->template, $match)) - { - $this->replacements[$val] = $match[1]; - } - elseif (in_array($val, $today, TRUE)) - { - $this->replacements[$val] = $this->replacements[substr($val, 0, -6)]; - } - } - } - elseif (is_array($this->template)) - { - $this->replacements = array_merge($this->replacements, $this->template); - } - - return $this; - } - -} diff --git a/README/Cart.php b/README/Cart.php deleted file mode 100644 index bf27c63..0000000 --- a/README/Cart.php +++ /dev/null @@ -1,567 +0,0 @@ -CI =& get_instance(); - - // Are any config settings being passed manually? If so, set them - $config = is_array($params) ? $params : array(); - - // Load the Sessions class - $this->CI->load->driver('session', $config); - - // Grab the shopping cart array from the session table - $this->_cart_contents = $this->CI->session->userdata('cart_contents'); - if ($this->_cart_contents === NULL) - { - // No cart exists so we'll set some base values - $this->_cart_contents = array('cart_total' => 0, 'total_items' => 0); - } - - log_message('info', 'Cart Class Initialized'); - } - - // -------------------------------------------------------------------- - - /** - * Insert items into the cart and save it to the session table - * - * @param array - * @return bool - */ - public function insert($items = array()) - { - // Was any cart data passed? No? Bah... - if ( ! is_array($items) OR count($items) === 0) - { - log_message('error', 'The insert method must be passed an array containing data.'); - return FALSE; - } - - // You can either insert a single product using a one-dimensional array, - // or multiple products using a multi-dimensional one. The way we - // determine the array type is by looking for a required array key named "id" - // at the top level. If it's not found, we will assume it's a multi-dimensional array. - - $save_cart = FALSE; - if (isset($items['id'])) - { - if (($rowid = $this->_insert($items))) - { - $save_cart = TRUE; - } - } - else - { - foreach ($items as $val) - { - if (is_array($val) && isset($val['id'])) - { - if ($this->_insert($val)) - { - $save_cart = TRUE; - } - } - } - } - - // Save the cart data if the insert was successful - if ($save_cart === TRUE) - { - $this->_save_cart(); - return isset($rowid) ? $rowid : TRUE; - } - - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Insert - * - * @param array - * @return bool - */ - protected function _insert($items = array()) - { - // Was any cart data passed? No? Bah... - if ( ! is_array($items) OR count($items) === 0) - { - log_message('error', 'The insert method must be passed an array containing data.'); - return FALSE; - } - - // -------------------------------------------------------------------- - - // Does the $items array contain an id, quantity, price, and name? These are required - if ( ! isset($items['id'], $items['qty'], $items['price'], $items['name'])) - { - log_message('error', 'The cart array must contain a product ID, quantity, price, and name.'); - return FALSE; - } - - // -------------------------------------------------------------------- - - // Prep the quantity. It can only be a number. Duh... also trim any leading zeros - $items['qty'] = (float) $items['qty']; - - // If the quantity is zero or blank there's nothing for us to do - if ($items['qty'] == 0) - { - return FALSE; - } - - // -------------------------------------------------------------------- - - // Validate the product ID. It can only be alpha-numeric, dashes, underscores or periods - // Not totally sure we should impose this rule, but it seems prudent to standardize IDs. - // Note: These can be user-specified by setting the $this->product_id_rules variable. - if ( ! preg_match('/^['.$this->product_id_rules.']+$/i', $items['id'])) - { - log_message('error', 'Invalid product ID. The product ID can only contain alpha-numeric characters, dashes, and underscores'); - return FALSE; - } - - // -------------------------------------------------------------------- - - // Validate the product name. It can only be alpha-numeric, dashes, underscores, colons or periods. - // Note: These can be user-specified by setting the $this->product_name_rules variable. - if ($this->product_name_safe && ! preg_match('/^['.$this->product_name_rules.']+$/i'.(UTF8_ENABLED ? 'u' : ''), $items['name'])) - { - log_message('error', 'An invalid name was submitted as the product name: '.$items['name'].' The name can only contain alpha-numeric characters, dashes, underscores, colons, and spaces'); - return FALSE; - } - - // -------------------------------------------------------------------- - - // Prep the price. Remove leading zeros and anything that isn't a number or decimal point. - $items['price'] = (float) $items['price']; - - // We now need to create a unique identifier for the item being inserted into the cart. - // Every time something is added to the cart it is stored in the master cart array. - // Each row in the cart array, however, must have a unique index that identifies not only - // a particular product, but makes it possible to store identical products with different options. - // For example, what if someone buys two identical t-shirts (same product ID), but in - // different sizes? The product ID (and other attributes, like the name) will be identical for - // both sizes because it's the same shirt. The only difference will be the size. - // Internally, we need to treat identical submissions, but with different options, as a unique product. - // Our solution is to convert the options array to a string and MD5 it along with the product ID. - // This becomes the unique "row ID" - if (isset($items['options']) && count($items['options']) > 0) - { - $rowid = md5($items['id'].serialize($items['options'])); - } - else - { - // No options were submitted so we simply MD5 the product ID. - // Technically, we don't need to MD5 the ID in this case, but it makes - // sense to standardize the format of array indexes for both conditions - $rowid = md5($items['id']); - } - - // -------------------------------------------------------------------- - - // Now that we have our unique "row ID", we'll add our cart items to the master array - // grab quantity if it's already there and add it on - $old_quantity = isset($this->_cart_contents[$rowid]['qty']) ? (int) $this->_cart_contents[$rowid]['qty'] : 0; - - // Re-create the entry, just to make sure our index contains only the data from this submission - $items['rowid'] = $rowid; - $items['qty'] += $old_quantity; - $this->_cart_contents[$rowid] = $items; - - return $rowid; - } - - // -------------------------------------------------------------------- - - /** - * Update the cart - * - * This function permits the quantity of a given item to be changed. - * Typically it is called from the "view cart" page if a user makes - * changes to the quantity before checkout. That array must contain the - * product ID and quantity for each item. - * - * @param array - * @return bool - */ - public function update($items = array()) - { - // Was any cart data passed? - if ( ! is_array($items) OR count($items) === 0) - { - return FALSE; - } - - // You can either update a single product using a one-dimensional array, - // or multiple products using a multi-dimensional one. The way we - // determine the array type is by looking for a required array key named "rowid". - // If it's not found we assume it's a multi-dimensional array - $save_cart = FALSE; - if (isset($items['rowid'])) - { - if ($this->_update($items) === TRUE) - { - $save_cart = TRUE; - } - } - else - { - foreach ($items as $val) - { - if (is_array($val) && isset($val['rowid'])) - { - if ($this->_update($val) === TRUE) - { - $save_cart = TRUE; - } - } - } - } - - // Save the cart data if the insert was successful - if ($save_cart === TRUE) - { - $this->_save_cart(); - return TRUE; - } - - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Update the cart - * - * This function permits changing item properties. - * Typically it is called from the "view cart" page if a user makes - * changes to the quantity before checkout. That array must contain the - * rowid and quantity for each item. - * - * @param array - * @return bool - */ - protected function _update($items = array()) - { - // Without these array indexes there is nothing we can do - if ( ! isset($items['rowid'], $this->_cart_contents[$items['rowid']])) - { - return FALSE; - } - - // Prep the quantity - if (isset($items['qty'])) - { - $items['qty'] = (float) $items['qty']; - // Is the quantity zero? If so we will remove the item from the cart. - // If the quantity is greater than zero we are updating - if ($items['qty'] == 0) - { - unset($this->_cart_contents[$items['rowid']]); - return TRUE; - } - } - - // find updatable keys - $keys = array_intersect(array_keys($this->_cart_contents[$items['rowid']]), array_keys($items)); - // if a price was passed, make sure it contains valid data - if (isset($items['price'])) - { - $items['price'] = (float) $items['price']; - } - - // product id & name shouldn't be changed - foreach (array_diff($keys, array('id', 'name')) as $key) - { - $this->_cart_contents[$items['rowid']][$key] = $items[$key]; - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Save the cart array to the session DB - * - * @return bool - */ - protected function _save_cart() - { - // Let's add up the individual prices and set the cart sub-total - $this->_cart_contents['total_items'] = $this->_cart_contents['cart_total'] = 0; - foreach ($this->_cart_contents as $key => $val) - { - // We make sure the array contains the proper indexes - if ( ! is_array($val) OR ! isset($val['price'], $val['qty'])) - { - continue; - } - - $this->_cart_contents['cart_total'] += ($val['price'] * $val['qty']); - $this->_cart_contents['total_items'] += $val['qty']; - $this->_cart_contents[$key]['subtotal'] = ($this->_cart_contents[$key]['price'] * $this->_cart_contents[$key]['qty']); - } - - // Is our cart empty? If so we delete it from the session - if (count($this->_cart_contents) <= 2) - { - $this->CI->session->unset_userdata('cart_contents'); - - // Nothing more to do... coffee time! - return FALSE; - } - - // If we made it this far it means that our cart has data. - // Let's pass it to the Session class so it can be stored - $this->CI->session->set_userdata(array('cart_contents' => $this->_cart_contents)); - - // Woot! - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Cart Total - * - * @return int - */ - public function total() - { - return $this->_cart_contents['cart_total']; - } - - // -------------------------------------------------------------------- - - /** - * Remove Item - * - * Removes an item from the cart - * - * @param int - * @return bool - */ - public function remove($rowid) - { - // unset & save - unset($this->_cart_contents[$rowid]); - $this->_save_cart(); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Total Items - * - * Returns the total item count - * - * @return int - */ - public function total_items() - { - return $this->_cart_contents['total_items']; - } - - // -------------------------------------------------------------------- - - /** - * Cart Contents - * - * Returns the entire cart array - * - * @param bool - * @return array - */ - public function contents($newest_first = FALSE) - { - // do we want the newest first? - $cart = ($newest_first) ? array_reverse($this->_cart_contents) : $this->_cart_contents; - - // Remove these so they don't create a problem when showing the cart table - unset($cart['total_items']); - unset($cart['cart_total']); - - return $cart; - } - - // -------------------------------------------------------------------- - - /** - * Get cart item - * - * Returns the details of a specific item in the cart - * - * @param string $row_id - * @return array - */ - public function get_item($row_id) - { - return (in_array($row_id, array('total_items', 'cart_total'), TRUE) OR ! isset($this->_cart_contents[$row_id])) - ? FALSE - : $this->_cart_contents[$row_id]; - } - - // -------------------------------------------------------------------- - - /** - * Has options - * - * Returns TRUE if the rowid passed to this function correlates to an item - * that has options associated with it. - * - * @param string $row_id = '' - * @return bool - */ - public function has_options($row_id = '') - { - return (isset($this->_cart_contents[$row_id]['options']) && count($this->_cart_contents[$row_id]['options']) !== 0); - } - - // -------------------------------------------------------------------- - - /** - * Product options - * - * Returns the an array of options, for a particular product row ID - * - * @param string $row_id = '' - * @return array - */ - public function product_options($row_id = '') - { - return isset($this->_cart_contents[$row_id]['options']) ? $this->_cart_contents[$row_id]['options'] : array(); - } - - // -------------------------------------------------------------------- - - /** - * Format Number - * - * Returns the supplied number with commas and a decimal point. - * - * @param float - * @return string - */ - public function format_number($n = '') - { - return ($n === '') ? '' : number_format( (float) $n, 2, '.', ','); - } - - // -------------------------------------------------------------------- - - /** - * Destroy the cart - * - * Empties the cart and kills the session - * - * @return void - */ - public function destroy() - { - $this->_cart_contents = array('cart_total' => 0, 'total_items' => 0); - $this->CI->session->unset_userdata('cart_contents'); - } - -} diff --git a/README/Driver.php b/README/Driver.php deleted file mode 100644 index da4c548..0000000 --- a/README/Driver.php +++ /dev/null @@ -1,342 +0,0 @@ -load_driver($child); - } - - /** - * Load driver - * - * Separate load_driver call to support explicit driver load by library or user - * - * @param string Driver name (w/o parent prefix) - * @return object Child class - */ - public function load_driver($child) - { - // Get CodeIgniter instance and subclass prefix - $prefix = config_item('subclass_prefix'); - - if ( ! isset($this->lib_name)) - { - // Get library name without any prefix - $this->lib_name = str_replace(array('CI_', $prefix), '', get_class($this)); - } - - // The child will be prefixed with the parent lib - $child_name = $this->lib_name.'_'.$child; - - // See if requested child is a valid driver - if ( ! in_array($child, $this->valid_drivers)) - { - // The requested driver isn't valid! - $msg = 'Invalid driver requested: '.$child_name; - log_message('error', $msg); - show_error($msg); - } - - // Get package paths and filename case variations to search - $CI = get_instance(); - $paths = $CI->load->get_package_paths(TRUE); - - // Is there an extension? - $class_name = $prefix.$child_name; - $found = class_exists($class_name, FALSE); - if ( ! $found) - { - // Check for subclass file - foreach ($paths as $path) - { - // Does the file exist? - $file = $path.'libraries/'.$this->lib_name.'/drivers/'.$prefix.$child_name.'.php'; - if (file_exists($file)) - { - // Yes - require base class from BASEPATH - $basepath = BASEPATH.'libraries/'.$this->lib_name.'/drivers/'.$child_name.'.php'; - if ( ! file_exists($basepath)) - { - $msg = 'Unable to load the requested class: CI_'.$child_name; - log_message('error', $msg); - show_error($msg); - } - - // Include both sources and mark found - include_once($basepath); - include_once($file); - $found = TRUE; - break; - } - } - } - - // Do we need to search for the class? - if ( ! $found) - { - // Use standard class name - $class_name = 'CI_'.$child_name; - if ( ! class_exists($class_name, FALSE)) - { - // Check package paths - foreach ($paths as $path) - { - // Does the file exist? - $file = $path.'libraries/'.$this->lib_name.'/drivers/'.$child_name.'.php'; - if (file_exists($file)) - { - // Include source - include_once($file); - break; - } - } - } - } - - // Did we finally find the class? - if ( ! class_exists($class_name, FALSE)) - { - if (class_exists($child_name, FALSE)) - { - $class_name = $child_name; - } - else - { - $msg = 'Unable to load the requested driver: '.$class_name; - log_message('error', $msg); - show_error($msg); - } - } - - // Instantiate, decorate and add child - $obj = new $class_name(); - $obj->decorate($this); - $this->$child = $obj; - return $this->$child; - } - -} - -// -------------------------------------------------------------------------- - -/** - * CodeIgniter Driver Class - * - * This class enables you to create drivers for a Library based on the Driver Library. - * It handles the drivers' access to the parent library - * - * @package CodeIgniter - * @subpackage Libraries - * @category Libraries - * @author EllisLab Dev Team - * @link - */ -class CI_Driver { - - /** - * Instance of the parent class - * - * @var object - */ - protected $_parent; - - /** - * List of methods in the parent class - * - * @var array - */ - protected $_methods = array(); - - /** - * List of properties in the parent class - * - * @var array - */ - protected $_properties = array(); - - /** - * Array of methods and properties for the parent class(es) - * - * @static - * @var array - */ - protected static $_reflections = array(); - - /** - * Decorate - * - * Decorates the child with the parent driver lib's methods and properties - * - * @param object - * @return void - */ - public function decorate($parent) - { - $this->_parent = $parent; - - // Lock down attributes to what is defined in the class - // and speed up references in magic methods - - $class_name = get_class($parent); - - if ( ! isset(self::$_reflections[$class_name])) - { - $r = new ReflectionObject($parent); - - foreach ($r->getMethods() as $method) - { - if ($method->isPublic()) - { - $this->_methods[] = $method->getName(); - } - } - - foreach ($r->getProperties() as $prop) - { - if ($prop->isPublic()) - { - $this->_properties[] = $prop->getName(); - } - } - - self::$_reflections[$class_name] = array($this->_methods, $this->_properties); - } - else - { - list($this->_methods, $this->_properties) = self::$_reflections[$class_name]; - } - } - - // -------------------------------------------------------------------- - - /** - * __call magic method - * - * Handles access to the parent driver library's methods - * - * @param string - * @param array - * @return mixed - */ - public function __call($method, $args = array()) - { - if (in_array($method, $this->_methods)) - { - return call_user_func_array(array($this->_parent, $method), $args); - } - - throw new BadMethodCallException('No such method: '.$method.'()'); - } - - // -------------------------------------------------------------------- - - /** - * __get magic method - * - * Handles reading of the parent driver library's properties - * - * @param string - * @return mixed - */ - public function __get($var) - { - if (in_array($var, $this->_properties)) - { - return $this->_parent->$var; - } - } - - // -------------------------------------------------------------------- - - /** - * __set magic method - * - * Handles writing to the parent driver library's properties - * - * @param string - * @param array - * @return mixed - */ - public function __set($var, $val) - { - if (in_array($var, $this->_properties)) - { - $this->_parent->$var = $val; - } - } - -} diff --git a/README/Email.php b/README/Email.php deleted file mode 100644 index acf3629..0000000 --- a/README/Email.php +++ /dev/null @@ -1,2314 +0,0 @@ - '1 (Highest)', - 2 => '2 (High)', - 3 => '3 (Normal)', - 4 => '4 (Low)', - 5 => '5 (Lowest)' - ); - - // -------------------------------------------------------------------- - - /** - * Constructor - Sets Email Preferences - * - * The constructor can be passed an array of config values - * - * @param array $config = array() - * @return void - */ - public function __construct(array $config = array()) - { - $this->charset = config_item('charset'); - - if (count($config) > 0) - { - $this->initialize($config); - } - else - { - $this->_smtp_auth = ! ($this->smtp_user === '' && $this->smtp_pass === ''); - } - - $this->_safe_mode = ( ! is_php('5.4') && ini_get('safe_mode')); - $this->charset = strtoupper($this->charset); - - log_message('info', 'Email Class Initialized'); - } - - // -------------------------------------------------------------------- - - /** - * Destructor - Releases Resources - * - * @return void - */ - public function __destruct() - { - if (is_resource($this->_smtp_connect)) - { - $this->_send_command('quit'); - } - } - - // -------------------------------------------------------------------- - - /** - * Initialize preferences - * - * @param array - * @return CI_Email - */ - public function initialize($config = array()) - { - foreach ($config as $key => $val) - { - if (isset($this->$key)) - { - $method = 'set_'.$key; - - if (method_exists($this, $method)) - { - $this->$method($val); - } - else - { - $this->$key = $val; - } - } - } - $this->clear(); - - $this->_smtp_auth = ! ($this->smtp_user === '' && $this->smtp_pass === ''); - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Initialize the Email Data - * - * @param bool - * @return CI_Email - */ - public function clear($clear_attachments = FALSE) - { - $this->_subject = ''; - $this->_body = ''; - $this->_finalbody = ''; - $this->_header_str = ''; - $this->_replyto_flag = FALSE; - $this->_recipients = array(); - $this->_cc_array = array(); - $this->_bcc_array = array(); - $this->_headers = array(); - $this->_debug_msg = array(); - - $this->set_header('User-Agent', $this->useragent); - $this->set_header('Date', $this->_set_date()); - - if ($clear_attachments !== FALSE) - { - $this->_attachments = array(); - } - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set FROM - * - * @param string $from - * @param string $name - * @param string $return_path = NULL Return-Path - * @return CI_Email - */ - public function from($from, $name = '', $return_path = NULL) - { - if (preg_match('/\<(.*)\>/', $from, $match)) - { - $from = $match[1]; - } - - if ($this->validate) - { - $this->validate_email($this->_str_to_array($from)); - if ($return_path) - { - $this->validate_email($this->_str_to_array($return_path)); - } - } - - // prepare the display name - if ($name !== '') - { - // only use Q encoding if there are characters that would require it - if ( ! preg_match('/[\200-\377]/', $name)) - { - // add slashes for non-printing characters, slashes, and double quotes, and surround it in double quotes - $name = '"'.addcslashes($name, "\0..\37\177'\"\\").'"'; - } - else - { - $name = $this->_prep_q_encoding($name); - } - } - - $this->set_header('From', $name.' <'.$from.'>'); - - isset($return_path) OR $return_path = $from; - $this->set_header('Return-Path', '<'.$return_path.'>'); - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set Reply-to - * - * @param string - * @param string - * @return CI_Email - */ - public function reply_to($replyto, $name = '') - { - if (preg_match('/\<(.*)\>/', $replyto, $match)) - { - $replyto = $match[1]; - } - - if ($this->validate) - { - $this->validate_email($this->_str_to_array($replyto)); - } - - if ($name === '') - { - $name = $replyto; - } - - if (strpos($name, '"') !== 0) - { - $name = '"'.$name.'"'; - } - - $this->set_header('Reply-To', $name.' <'.$replyto.'>'); - $this->_replyto_flag = TRUE; - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set Recipients - * - * @param string - * @return CI_Email - */ - public function to($to) - { - $to = $this->_str_to_array($to); - $to = $this->clean_email($to); - - if ($this->validate) - { - $this->validate_email($to); - } - - if ($this->_get_protocol() !== 'mail') - { - $this->set_header('To', implode(', ', $to)); - } - - $this->_recipients = $to; - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set CC - * - * @param string - * @return CI_Email - */ - public function cc($cc) - { - $cc = $this->clean_email($this->_str_to_array($cc)); - - if ($this->validate) - { - $this->validate_email($cc); - } - - $this->set_header('Cc', implode(', ', $cc)); - - if ($this->_get_protocol() === 'smtp') - { - $this->_cc_array = $cc; - } - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set BCC - * - * @param string - * @param string - * @return CI_Email - */ - public function bcc($bcc, $limit = '') - { - if ($limit !== '' && is_numeric($limit)) - { - $this->bcc_batch_mode = TRUE; - $this->bcc_batch_size = $limit; - } - - $bcc = $this->clean_email($this->_str_to_array($bcc)); - - if ($this->validate) - { - $this->validate_email($bcc); - } - - if ($this->_get_protocol() === 'smtp' OR ($this->bcc_batch_mode && count($bcc) > $this->bcc_batch_size)) - { - $this->_bcc_array = $bcc; - } - else - { - $this->set_header('Bcc', implode(', ', $bcc)); - } - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set Email Subject - * - * @param string - * @return CI_Email - */ - public function subject($subject) - { - $subject = $this->_prep_q_encoding($subject); - $this->set_header('Subject', $subject); - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set Body - * - * @param string - * @return CI_Email - */ - public function message($body) - { - $this->_body = rtrim(str_replace("\r", '', $body)); - - /* strip slashes only if magic quotes is ON - if we do it with magic quotes OFF, it strips real, user-inputted chars. - - NOTE: In PHP 5.4 get_magic_quotes_gpc() will always return 0 and - it will probably not exist in future versions at all. - */ - if ( ! is_php('5.4') && get_magic_quotes_gpc()) - { - $this->_body = stripslashes($this->_body); - } - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Assign file attachments - * - * @param string $file Can be local path, URL or buffered content - * @param string $disposition = 'attachment' - * @param string $newname = NULL - * @param string $mime = '' - * @return CI_Email - */ - public function attach($file, $disposition = '', $newname = NULL, $mime = '') - { - if ($mime === '') - { - if (strpos($file, '://') === FALSE && ! file_exists($file)) - { - $this->_set_error_message('lang:email_attachment_missing', $file); - return FALSE; - } - - if ( ! $fp = @fopen($file, 'rb')) - { - $this->_set_error_message('lang:email_attachment_unreadable', $file); - return FALSE; - } - - $file_content = stream_get_contents($fp); - $mime = $this->_mime_types(pathinfo($file, PATHINFO_EXTENSION)); - fclose($fp); - } - else - { - $file_content =& $file; // buffered file - } - - $this->_attachments[] = array( - 'name' => array($file, $newname), - 'disposition' => empty($disposition) ? 'attachment' : $disposition, // Can also be 'inline' Not sure if it matters - 'type' => $mime, - 'content' => chunk_split(base64_encode($file_content)) - ); - - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set and return attachment Content-ID - * - * Useful for attached inline pictures - * - * @param string $filename - * @return string - */ - public function attachment_cid($filename) - { - if ($this->multipart !== 'related') - { - $this->multipart = 'related'; // Thunderbird need this for inline images - } - - for ($i = 0, $c = count($this->_attachments); $i < $c; $i++) - { - if ($this->_attachments[$i]['name'][0] === $filename) - { - $this->_attachments[$i]['cid'] = uniqid(basename($this->_attachments[$i]['name'][0]).'@'); - return $this->_attachments[$i]['cid']; - } - } - - return FALSE; - } - - // -------------------------------------------------------------------- - - /** - * Add a Header Item - * - * @param string - * @param string - * @return CI_Email - */ - public function set_header($header, $value) - { - $this->_headers[$header] = str_replace(array("\n", "\r"), '', $value); - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Convert a String to an Array - * - * @param string - * @return array - */ - protected function _str_to_array($email) - { - if ( ! is_array($email)) - { - return (strpos($email, ',') !== FALSE) - ? preg_split('/[\s,]/', $email, -1, PREG_SPLIT_NO_EMPTY) - : (array) trim($email); - } - - return $email; - } - - // -------------------------------------------------------------------- - - /** - * Set Multipart Value - * - * @param string - * @return CI_Email - */ - public function set_alt_message($str) - { - $this->alt_message = (string) $str; - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set Mailtype - * - * @param string - * @return CI_Email - */ - public function set_mailtype($type = 'text') - { - $this->mailtype = ($type === 'html') ? 'html' : 'text'; - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set Wordwrap - * - * @param bool - * @return CI_Email - */ - public function set_wordwrap($wordwrap = TRUE) - { - $this->wordwrap = (bool) $wordwrap; - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set Protocol - * - * @param string - * @return CI_Email - */ - public function set_protocol($protocol = 'mail') - { - $this->protocol = in_array($protocol, $this->_protocols, TRUE) ? strtolower($protocol) : 'mail'; - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set Priority - * - * @param int - * @return CI_Email - */ - public function set_priority($n = 3) - { - $this->priority = preg_match('/^[1-5]$/', $n) ? (int) $n : 3; - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set Newline Character - * - * @param string - * @return CI_Email - */ - public function set_newline($newline = "\n") - { - $this->newline = in_array($newline, array("\n", "\r\n", "\r")) ? $newline : "\n"; - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set CRLF - * - * @param string - * @return CI_Email - */ - public function set_crlf($crlf = "\n") - { - $this->crlf = ($crlf !== "\n" && $crlf !== "\r\n" && $crlf !== "\r") ? "\n" : $crlf; - return $this; - } - - // -------------------------------------------------------------------- - - /** - * Set Message Boundary - * - * @return void - */ - protected function _set_boundaries() - { - $this->_alt_boundary = 'B_ALT_'.uniqid(''); // multipart/alternative - $this->_atc_boundary = 'B_ATC_'.uniqid(''); // attachment boundary - } - - // -------------------------------------------------------------------- - - /** - * Get the Message ID - * - * @return string - */ - protected function _get_message_id() - { - $from = str_replace(array('>', '<'), '', $this->_headers['Return-Path']); - return '<'.uniqid('').strstr($from, '@').'>'; - } - - // -------------------------------------------------------------------- - - /** - * Get Mail Protocol - * - * @param bool - * @return mixed - */ - protected function _get_protocol($return = TRUE) - { - $this->protocol = strtolower($this->protocol); - in_array($this->protocol, $this->_protocols, TRUE) OR $this->protocol = 'mail'; - - if ($return === TRUE) - { - return $this->protocol; - } - } - - // -------------------------------------------------------------------- - - /** - * Get Mail Encoding - * - * @param bool - * @return string - */ - protected function _get_encoding($return = TRUE) - { - in_array($this->_encoding, $this->_bit_depths) OR $this->_encoding = '8bit'; - - foreach ($this->_base_charsets as $charset) - { - if (strpos($charset, $this->charset) === 0) - { - $this->_encoding = '7bit'; - } - } - - if ($return === TRUE) - { - return $this->_encoding; - } - } - - // -------------------------------------------------------------------- - - /** - * Get content type (text/html/attachment) - * - * @return string - */ - protected function _get_content_type() - { - if ($this->mailtype === 'html') - { - return (count($this->_attachments) === 0) ? 'html' : 'html-attach'; - } - elseif ($this->mailtype === 'text' && count($this->_attachments) > 0) - { - return 'plain-attach'; - } - else - { - return 'plain'; - } - } - - // -------------------------------------------------------------------- - - /** - * Set RFC 822 Date - * - * @return string - */ - protected function _set_date() - { - $timezone = date('Z'); - $operator = ($timezone[0] === '-') ? '-' : '+'; - $timezone = abs($timezone); - $timezone = floor($timezone/3600) * 100 + ($timezone % 3600) / 60; - - return sprintf('%s %s%04d', date('D, j M Y H:i:s'), $operator, $timezone); - } - - // -------------------------------------------------------------------- - - /** - * Mime message - * - * @return string - */ - protected function _get_mime_message() - { - return 'This is a multi-part message in MIME format.'.$this->newline.'Your email application may not support this format.'; - } - - // -------------------------------------------------------------------- - - /** - * Validate Email Address - * - * @param string - * @return bool - */ - public function validate_email($email) - { - if ( ! is_array($email)) - { - $this->_set_error_message('lang:email_must_be_array'); - return FALSE; - } - - foreach ($email as $val) - { - if ( ! $this->valid_email($val)) - { - $this->_set_error_message('lang:email_invalid_address', $val); - return FALSE; - } - } - - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Email Validation - * - * @param string - * @return bool - */ - public function valid_email($email) - { - if (function_exists('idn_to_ascii') && $atpos = strpos($email, '@')) - { - $email = substr($email, 0, ++$atpos).idn_to_ascii(substr($email, $atpos)); - } - - return (bool) filter_var($email, FILTER_VALIDATE_EMAIL); - } - - // -------------------------------------------------------------------- - - /** - * Clean Extended Email Address: Joe Smith - * - * @param string - * @return string - */ - public function clean_email($email) - { - if ( ! is_array($email)) - { - return preg_match('/\<(.*)\>/', $email, $match) ? $match[1] : $email; - } - - $clean_email = array(); - - foreach ($email as $addy) - { - $clean_email[] = preg_match('/\<(.*)\>/', $addy, $match) ? $match[1] : $addy; - } - - return $clean_email; - } - - // -------------------------------------------------------------------- - - /** - * Build alternative plain text message - * - * Provides the raw message for use in plain-text headers of - * HTML-formatted emails. - * If the user hasn't specified his own alternative message - * it creates one by stripping the HTML - * - * @return string - */ - protected function _get_alt_message() - { - if ( ! empty($this->alt_message)) - { - return ($this->wordwrap) - ? $this->word_wrap($this->alt_message, 76) - : $this->alt_message; - } - - $body = preg_match('/\(.*)\<\/body\>/si', $this->_body, $match) ? $match[1] : $this->_body; - $body = str_replace("\t", '', preg_replace('#\n"; - } - - return $r; - } - - // -------------------------------------------------------------------- - - /** - * Executes the Method - * - * @param object - * @return mixed - */ - protected function _execute($m) - { - $methName = $m->method_name; - - // Check to see if it is a system call - $system_call = (strpos($methName, 'system') === 0); - - if ($this->xss_clean === FALSE) - { - $m->xss_clean = FALSE; - } - - //------------------------------------- - // Valid Method - //------------------------------------- - - if ( ! isset($this->methods[$methName]['function'])) - { - return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); - } - - //------------------------------------- - // Check for Method (and Object) - //------------------------------------- - - $method_parts = explode('.', $this->methods[$methName]['function']); - $objectCall = (isset($method_parts[1]) && $method_parts[1] !== ''); - - if ($system_call === TRUE) - { - if ( ! is_callable(array($this,$method_parts[1]))) - { - return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); - } - } - elseif (($objectCall && ! is_callable(array($method_parts[0], $method_parts[1]))) - OR ( ! $objectCall && ! is_callable($this->methods[$methName]['function'])) - ) - { - return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); - } - - //------------------------------------- - // Checking Methods Signature - //------------------------------------- - - if (isset($this->methods[$methName]['signature'])) - { - $sig = $this->methods[$methName]['signature']; - for ($i = 0, $c = count($sig); $i < $c; $i++) - { - $current_sig = $sig[$i]; - - if (count($current_sig) === count($m->params)+1) - { - for ($n = 0, $mc = count($m->params); $n < $mc; $n++) - { - $p = $m->params[$n]; - $pt = ($p->kindOf() === 'scalar') ? $p->scalarval() : $p->kindOf(); - - if ($pt !== $current_sig[$n+1]) - { - $pno = $n+1; - $wanted = $current_sig[$n+1]; - - return new XML_RPC_Response(0, - $this->xmlrpcerr['incorrect_params'], - $this->xmlrpcstr['incorrect_params'] . - ': Wanted '.$wanted.', got '.$pt.' at param '.$pno.')'); - } - } - } - } - } - - //------------------------------------- - // Calls the Function - //------------------------------------- - - if ($objectCall === TRUE) - { - if ($method_parts[0] === 'this' && $system_call === TRUE) - { - return call_user_func(array($this, $method_parts[1]), $m); - } - elseif ($this->object === FALSE) - { - return get_instance()->$method_parts[1]($m); - } - else - { - return $this->object->$method_parts[1]($m); - } - } - else - { - return call_user_func($this->methods[$methName]['function'], $m); - } - } - - // -------------------------------------------------------------------- - - /** - * Server Function: List Methods - * - * @param mixed - * @return object - */ - public function listMethods($m) - { - $v = new XML_RPC_Values(); - $output = array(); - - foreach ($this->methods as $key => $value) - { - $output[] = new XML_RPC_Values($key, 'string'); - } - - foreach ($this->system_methods as $key => $value) - { - $output[] = new XML_RPC_Values($key, 'string'); - } - - $v->addArray($output); - return new XML_RPC_Response($v); - } - - // -------------------------------------------------------------------- - - /** - * Server Function: Return Signature for Method - * - * @param mixed - * @return object - */ - public function methodSignature($m) - { - $parameters = $m->output_parameters(); - $method_name = $parameters[0]; - - if (isset($this->methods[$method_name])) - { - if ($this->methods[$method_name]['signature']) - { - $sigs = array(); - $signature = $this->methods[$method_name]['signature']; - - for ($i = 0, $c = count($signature); $i < $c; $i++) - { - $cursig = array(); - $inSig = $signature[$i]; - for ($j = 0, $jc = count($inSig); $j < $jc; $j++) - { - $cursig[]= new XML_RPC_Values($inSig[$j], 'string'); - } - $sigs[] = new XML_RPC_Values($cursig, 'array'); - } - - return new XML_RPC_Response(new XML_RPC_Values($sigs, 'array')); - } - - return new XML_RPC_Response(new XML_RPC_Values('undef', 'string')); - } - - return new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); - } - - // -------------------------------------------------------------------- - - /** - * Server Function: Doc String for Method - * - * @param mixed - * @return object - */ - public function methodHelp($m) - { - $parameters = $m->output_parameters(); - $method_name = $parameters[0]; - - if (isset($this->methods[$method_name])) - { - $docstring = isset($this->methods[$method_name]['docstring']) ? $this->methods[$method_name]['docstring'] : ''; - - return new XML_RPC_Response(new XML_RPC_Values($docstring, 'string')); - } - else - { - return new XML_RPC_Response(0, $this->xmlrpcerr['introspect_unknown'], $this->xmlrpcstr['introspect_unknown']); - } - } - - // -------------------------------------------------------------------- - - /** - * Server Function: Multi-call - * - * @param mixed - * @return object - */ - public function multicall($m) - { - // Disabled - return new XML_RPC_Response(0, $this->xmlrpcerr['unknown_method'], $this->xmlrpcstr['unknown_method']); - - $parameters = $m->output_parameters(); - $calls = $parameters[0]; - - $result = array(); - - foreach ($calls as $value) - { - $m = new XML_RPC_Message($value[0]); - $plist = ''; - - for ($i = 0, $c = count($value[1]); $i < $c; $i++) - { - $m->addParam(new XML_RPC_Values($value[1][$i], 'string')); - } - - $attempt = $this->_execute($m); - - if ($attempt->faultCode() !== 0) - { - return $attempt; - } - - $result[] = new XML_RPC_Values(array($attempt->value()), 'array'); - } - - return new XML_RPC_Response(new XML_RPC_Values($result, 'array')); - } - - // -------------------------------------------------------------------- - - /** - * Multi-call Function: Error Handling - * - * @param mixed - * @return object - */ - public function multicall_error($err) - { - $str = is_string($err) ? $this->xmlrpcstr["multicall_${err}"] : $err->faultString(); - $code = is_string($err) ? $this->xmlrpcerr["multicall_${err}"] : $err->faultCode(); - - $struct['faultCode'] = new XML_RPC_Values($code, 'int'); - $struct['faultString'] = new XML_RPC_Values($str, 'string'); - - return new XML_RPC_Values($struct, 'struct'); - } - - // -------------------------------------------------------------------- - - /** - * Multi-call Function: Processes method - * - * @param mixed - * @return object - */ - public function do_multicall($call) - { - if ($call->kindOf() !== 'struct') - { - return $this->multicall_error('notstruct'); - } - elseif ( ! $methName = $call->me['struct']['methodName']) - { - return $this->multicall_error('nomethod'); - } - - list($scalar_type, $scalar_value) = each($methName->me); - $scalar_type = $scalar_type === $this->xmlrpcI4 ? $this->xmlrpcInt : $scalar_type; - - if ($methName->kindOf() !== 'scalar' OR $scalar_type !== 'string') - { - return $this->multicall_error('notstring'); - } - elseif ($scalar_value === 'system.multicall') - { - return $this->multicall_error('recursion'); - } - elseif ( ! $params = $call->me['struct']['params']) - { - return $this->multicall_error('noparams'); - } - elseif ($params->kindOf() !== 'array') - { - return $this->multicall_error('notarray'); - } - - list($a, $b) = each($params->me); - - $msg = new XML_RPC_Message($scalar_value); - for ($i = 0, $numParams = count($b); $i < $numParams; $i++) - { - $msg->params[] = $params->me['array'][$i]; - } - - $result = $this->_execute($msg); - - if ($result->faultCode() !== 0) - { - return $this->multicall_error($result); - } - - return new XML_RPC_Values(array($result->value()), 'array'); - } - -} diff --git a/README/Zip.php b/README/Zip.php deleted file mode 100644 index 3e98ac5..0000000 --- a/README/Zip.php +++ /dev/null @@ -1,484 +0,0 @@ -now = time(); - log_message('info', 'Zip Compression Class Initialized'); - } - - // -------------------------------------------------------------------- - - /** - * Add Directory - * - * Lets you add a virtual directory into which you can place files. - * - * @param mixed $directory the directory name. Can be string or array - * @return void - */ - public function add_dir($directory) - { - foreach ((array) $directory as $dir) - { - if ( ! preg_match('|.+/$|', $dir)) - { - $dir .= '/'; - } - - $dir_time = $this->_get_mod_time($dir); - $this->_add_dir($dir, $dir_time['file_mtime'], $dir_time['file_mdate']); - } - } - - // -------------------------------------------------------------------- - - /** - * Get file/directory modification time - * - * If this is a newly created file/dir, we will set the time to 'now' - * - * @param string $dir path to file - * @return array filemtime/filemdate - */ - protected function _get_mod_time($dir) - { - // filemtime() may return false, but raises an error for non-existing files - $date = file_exists($dir) ? getdate(filemtime($dir)) : getdate($this->now); - - return array( - 'file_mtime' => ($date['hours'] << 11) + ($date['minutes'] << 5) + $date['seconds'] / 2, - 'file_mdate' => (($date['year'] - 1980) << 9) + ($date['mon'] << 5) + $date['mday'] - ); - } - - // -------------------------------------------------------------------- - - /** - * Add Directory - * - * @param string $dir the directory name - * @param int $file_mtime - * @param int $file_mdate - * @return void - */ - protected function _add_dir($dir, $file_mtime, $file_mdate) - { - $dir = str_replace('\\', '/', $dir); - - $this->zipdata .= - "\x50\x4b\x03\x04\x0a\x00\x00\x00\x00\x00" - .pack('v', $file_mtime) - .pack('v', $file_mdate) - .pack('V', 0) // crc32 - .pack('V', 0) // compressed filesize - .pack('V', 0) // uncompressed filesize - .pack('v', strlen($dir)) // length of pathname - .pack('v', 0) // extra field length - .$dir - // below is "data descriptor" segment - .pack('V', 0) // crc32 - .pack('V', 0) // compressed filesize - .pack('V', 0); // uncompressed filesize - - $this->directory .= - "\x50\x4b\x01\x02\x00\x00\x0a\x00\x00\x00\x00\x00" - .pack('v', $file_mtime) - .pack('v', $file_mdate) - .pack('V',0) // crc32 - .pack('V',0) // compressed filesize - .pack('V',0) // uncompressed filesize - .pack('v', strlen($dir)) // length of pathname - .pack('v', 0) // extra field length - .pack('v', 0) // file comment length - .pack('v', 0) // disk number start - .pack('v', 0) // internal file attributes - .pack('V', 16) // external file attributes - 'directory' bit set - .pack('V', $this->offset) // relative offset of local header - .$dir; - - $this->offset = strlen($this->zipdata); - $this->entries++; - } - - // -------------------------------------------------------------------- - - /** - * Add Data to Zip - * - * Lets you add files to the archive. If the path is included - * in the filename it will be placed within a directory. Make - * sure you use add_dir() first to create the folder. - * - * @param mixed $filepath A single filepath or an array of file => data pairs - * @param string $data Single file contents - * @return void - */ - public function add_data($filepath, $data = NULL) - { - if (is_array($filepath)) - { - foreach ($filepath as $path => $data) - { - $file_data = $this->_get_mod_time($path); - $this->_add_data($path, $data, $file_data['file_mtime'], $file_data['file_mdate']); - } - } - else - { - $file_data = $this->_get_mod_time($filepath); - $this->_add_data($filepath, $data, $file_data['file_mtime'], $file_data['file_mdate']); - } - } - - // -------------------------------------------------------------------- - - /** - * Add Data to Zip - * - * @param string $filepath the file name/path - * @param string $data the data to be encoded - * @param int $file_mtime - * @param int $file_mdate - * @return void - */ - protected function _add_data($filepath, $data, $file_mtime, $file_mdate) - { - $filepath = str_replace('\\', '/', $filepath); - - $uncompressed_size = strlen($data); - $crc32 = crc32($data); - $gzdata = substr(gzcompress($data, $this->compression_level), 2, -4); - $compressed_size = strlen($gzdata); - - $this->zipdata .= - "\x50\x4b\x03\x04\x14\x00\x00\x00\x08\x00" - .pack('v', $file_mtime) - .pack('v', $file_mdate) - .pack('V', $crc32) - .pack('V', $compressed_size) - .pack('V', $uncompressed_size) - .pack('v', strlen($filepath)) // length of filename - .pack('v', 0) // extra field length - .$filepath - .$gzdata; // "file data" segment - - $this->directory .= - "\x50\x4b\x01\x02\x00\x00\x14\x00\x00\x00\x08\x00" - .pack('v', $file_mtime) - .pack('v', $file_mdate) - .pack('V', $crc32) - .pack('V', $compressed_size) - .pack('V', $uncompressed_size) - .pack('v', strlen($filepath)) // length of filename - .pack('v', 0) // extra field length - .pack('v', 0) // file comment length - .pack('v', 0) // disk number start - .pack('v', 0) // internal file attributes - .pack('V', 32) // external file attributes - 'archive' bit set - .pack('V', $this->offset) // relative offset of local header - .$filepath; - - $this->offset = strlen($this->zipdata); - $this->entries++; - $this->file_num++; - } - - // -------------------------------------------------------------------- - - /** - * Read the contents of a file and add it to the zip - * - * @param string $path - * @param bool $archive_filepath - * @return bool - */ - public function read_file($path, $archive_filepath = FALSE) - { - if (file_exists($path) && FALSE !== ($data = file_get_contents($path))) - { - if (is_string($archive_filepath)) - { - $name = str_replace('\\', '/', $archive_filepath); - } - else - { - $name = str_replace('\\', '/', $path); - - if ($archive_filepath === FALSE) - { - $name = preg_replace('|.*/(.+)|', '\\1', $name); - } - } - - $this->add_data($name, $data); - return TRUE; - } - - return FALSE; - } - - // ------------------------------------------------------------------------ - - /** - * Read a directory and add it to the zip. - * - * This function recursively reads a folder and everything it contains (including - * sub-folders) and creates a zip based on it. Whatever directory structure - * is in the original file path will be recreated in the zip file. - * - * @param string $path path to source directory - * @param bool $preserve_filepath - * @param string $root_path - * @return bool - */ - public function read_dir($path, $preserve_filepath = TRUE, $root_path = NULL) - { - $path = rtrim($path, '/\\').DIRECTORY_SEPARATOR; - if ( ! $fp = @opendir($path)) - { - return FALSE; - } - - // Set the original directory root for child dir's to use as relative - if ($root_path === NULL) - { - $root_path = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, dirname($path)).DIRECTORY_SEPARATOR; - } - - while (FALSE !== ($file = readdir($fp))) - { - if ($file[0] === '.') - { - continue; - } - - if (is_dir($path.$file)) - { - $this->read_dir($path.$file.DIRECTORY_SEPARATOR, $preserve_filepath, $root_path); - } - elseif (FALSE !== ($data = file_get_contents($path.$file))) - { - $name = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $path); - if ($preserve_filepath === FALSE) - { - $name = str_replace($root_path, '', $name); - } - - $this->add_data($name.$file, $data); - } - } - - closedir($fp); - return TRUE; - } - - // -------------------------------------------------------------------- - - /** - * Get the Zip file - * - * @return string (binary encoded) - */ - public function get_zip() - { - // Is there any data to return? - if ($this->entries === 0) - { - return FALSE; - } - - return $this->zipdata - .$this->directory."\x50\x4b\x05\x06\x00\x00\x00\x00" - .pack('v', $this->entries) // total # of entries "on this disk" - .pack('v', $this->entries) // total # of entries overall - .pack('V', strlen($this->directory)) // size of central dir - .pack('V', strlen($this->zipdata)) // offset to start of central dir - ."\x00\x00"; // .zip file comment length - } - - // -------------------------------------------------------------------- - - /** - * Write File to the specified directory - * - * Lets you write a file - * - * @param string $filepath the file name - * @return bool - */ - public function archive($filepath) - { - if ( ! ($fp = @fopen($filepath, 'w+b'))) - { - return FALSE; - } - - flock($fp, LOCK_EX); - - for ($result = $written = 0, $data = $this->get_zip(), $length = strlen($data); $written < $length; $written += $result) - { - if (($result = fwrite($fp, substr($data, $written))) === FALSE) - { - break; - } - } - - flock($fp, LOCK_UN); - fclose($fp); - - return is_int($result); - } - - // -------------------------------------------------------------------- - - /** - * Download - * - * @param string $filename the file name - * @return void - */ - public function download($filename = 'backup.zip') - { - if ( ! preg_match('|.+?\.zip$|', $filename)) - { - $filename .= '.zip'; - } - - get_instance()->load->helper('download'); - $get_zip = $this->get_zip(); - $zip_content =& $get_zip; - - force_download($filename, $zip_content); - } - - // -------------------------------------------------------------------- - - /** - * Initialize Data - * - * Lets you clear current zip data. Useful if you need to create - * multiple zips with different data. - * - * @return CI_Zip - */ - public function clear_data() - { - $this->zipdata = ''; - $this->directory = ''; - $this->entries = 0; - $this->file_num = 0; - $this->offset = 0; - return $this; - } - -} diff --git a/README/index.html b/README/index.html deleted file mode 100644 index b702fbc..0000000 --- a/README/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - 403 Forbidden - - - -

Directory access is forbidden.

- - -