├── .gitignore ├── README.md ├── _config.yml ├── package.json ├── scaffolds ├── draft.md ├── page.md └── post.md ├── scripts ├── generate-alphabet.js ├── generate-titles.js └── render-markdown.js ├── source ├── _posts │ ├── ajax.md │ ├── amd.md │ ├── arity.md │ ├── babel.md │ ├── bus-factor.md │ ├── canvas.md │ ├── commonjs.md │ ├── coroutine.md │ ├── design-pattern.md │ ├── dom.md │ ├── electron.md │ ├── fetch-api.md │ ├── high-order-function.md │ ├── http-451.md │ ├── http2.md │ ├── left-pad.md │ ├── page-rank.md │ ├── sfc.md │ ├── surge-sh.md │ ├── surge.md │ ├── vue.md │ ├── webpack.md │ └── yin-lang.md └── about.md ├── themes ├── bw │ ├── layout │ │ ├── alphabet.jade │ │ ├── base.jade │ │ ├── index.jade │ │ ├── mixins.jade │ │ └── post.jade │ └── source │ │ ├── css │ │ ├── main.styl │ │ ├── markdown.styl │ │ ├── prism.styl │ │ └── responsive.styl │ │ └── js │ │ ├── app.js │ │ └── post.js └── landscape │ ├── .gitignore │ ├── Gruntfile.js │ ├── LICENSE │ ├── README.md │ ├── _config.yml │ ├── languages │ ├── default.yml │ ├── fr.yml │ ├── nl.yml │ ├── no.yml │ ├── ru.yml │ ├── zh-CN.yml │ └── zh-TW.yml │ ├── layout │ ├── _partial │ │ ├── after-footer.ejs │ │ ├── archive-post.ejs │ │ ├── archive.ejs │ │ ├── article.ejs │ │ ├── footer.ejs │ │ ├── google-analytics.ejs │ │ ├── head.ejs │ │ ├── header.ejs │ │ ├── mobile-nav.ejs │ │ ├── post │ │ │ ├── category.ejs │ │ │ ├── date.ejs │ │ │ ├── gallery.ejs │ │ │ ├── nav.ejs │ │ │ ├── tag.ejs │ │ │ └── title.ejs │ │ └── sidebar.ejs │ ├── _widget │ │ ├── archive.ejs │ │ ├── category.ejs │ │ ├── recent_posts.ejs │ │ ├── tag.ejs │ │ └── tagcloud.ejs │ ├── archive.ejs │ ├── category.ejs │ ├── index.ejs │ ├── layout.ejs │ ├── page.ejs │ ├── post.ejs │ └── tag.ejs │ ├── package.json │ ├── scripts │ └── fancybox.js │ └── source │ ├── css │ ├── _extend.styl │ ├── _partial │ │ ├── archive.styl │ │ ├── article.styl │ │ ├── comment.styl │ │ ├── footer.styl │ │ ├── header.styl │ │ ├── highlight.styl │ │ ├── mobile.styl │ │ ├── sidebar-aside.styl │ │ ├── sidebar-bottom.styl │ │ └── sidebar.styl │ ├── _util │ │ ├── grid.styl │ │ └── mixin.styl │ ├── _variables.styl │ ├── fonts │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ ├── images │ │ └── banner.jpg │ └── style.styl │ ├── fancybox │ ├── blank.gif │ ├── fancybox_loading.gif │ ├── fancybox_loading@2x.gif │ ├── fancybox_overlay.png │ ├── fancybox_sprite.png │ ├── fancybox_sprite@2x.png │ ├── helpers │ │ ├── fancybox_buttons.png │ │ ├── jquery.fancybox-buttons.css │ │ ├── jquery.fancybox-buttons.js │ │ ├── jquery.fancybox-media.js │ │ ├── jquery.fancybox-thumbs.css │ │ └── jquery.fancybox-thumbs.js │ ├── jquery.fancybox.css │ ├── jquery.fancybox.js │ └── jquery.fancybox.pack.js │ └── js │ └── script.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | Thumbs.db 3 | db.json 4 | *.log 5 | node_modules/ 6 | public/ 7 | .deploy*/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 简明编程术语 2 | 3 | 简明编程术语是由社区驱动的编程知识分享网站,主要提供各类编程专业术语的解释。 4 | 5 | ## 贡献 6 | 7 | 请提交 Pull Request 添加词条,具体格式可以参考目录 [/source/_posts](/source/_posts) 中的现有词条格式。 8 | 9 | ## 开发 10 | 11 | ```bash 12 | # 预览网站 13 | $ npm run dev 14 | 15 | # 添加词条 16 | $ ./node_modules/.bin/hexo new post {item_name} 17 | ``` 18 | 19 | ## 内容共享 20 | 21 | 词条以 CC-BY-NC 4.0 协议授权,代码以 MIT 协议授权。 22 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # Hexo Configuration 2 | ## Docs: https://hexo.io/docs/configuration.html 3 | ## Source: https://github.com/hexojs/hexo/ 4 | 5 | # Site 6 | title: 简明编程术语 7 | subtitle: Code Jargon 8 | description: 简明编程术语是由社区驱动的编程知识分享网站 9 | author: EGOIST 10 | language: zh-CN 11 | timezone: 12 | version: 0.3.0 13 | 14 | # URL 15 | ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' 16 | url: http://codejargon.net 17 | root: / 18 | permalink: jargon/:title/ 19 | permalink_defaults: 20 | 21 | # Directory 22 | source_dir: source 23 | public_dir: public 24 | tag_dir: tags 25 | archive_dir: archives 26 | category_dir: categories 27 | code_dir: downloads/code 28 | i18n_dir: :lang 29 | skip_render: 30 | 31 | # Writing 32 | new_post_name: :title.md # File name of new posts 33 | default_layout: post 34 | titlecase: false # Transform title into titlecase 35 | external_link: true # Open external links in new tab 36 | filename_case: 0 37 | render_drafts: false 38 | post_asset_folder: false 39 | relative_link: false 40 | future: true 41 | highlight: 42 | enable: false 43 | line_number: false 44 | auto_detect: false 45 | tab_replace: 46 | 47 | # Category & Tag 48 | default_category: uncategorized 49 | category_map: 50 | tag_map: 51 | 52 | # Date / Time format 53 | ## Hexo uses Moment.js to parse and display date 54 | ## You can customize the date format as defined in 55 | ## http://momentjs.com/docs/#/displaying/format/ 56 | date_format: YYYY-MM-DD 57 | time_format: HH:mm:ss 58 | 59 | # Pagination 60 | ## Set per_page to 0 to disable pagination 61 | per_page: 50 62 | pagination_dir: page 63 | 64 | # Extensions 65 | ## Plugins: https://hexo.io/plugins/ 66 | ## Themes: https://hexo.io/themes/ 67 | theme: bw 68 | 69 | # Deployment 70 | ## Docs: https://hexo.io/docs/deployment.html 71 | deploy: 72 | type: git 73 | repo: git@git.coding.net:egoist/codejargon.git 74 | branch: coding-pages 75 | 76 | stylus: 77 | compress: true 78 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hexo-site", 3 | "version": "0.0.0", 4 | "private": true, 5 | "hexo": { 6 | "version": "3.3.7" 7 | }, 8 | "scripts": { 9 | "build": "hexo g", 10 | "deploy": "hexo g && hexo d", 11 | "dev": "hexo s --watch" 12 | }, 13 | "dependencies": { 14 | "hexo": "^3.2.0", 15 | "hexo-deployer-git": "^0.3.0", 16 | "hexo-generator-archive": "^0.1.4", 17 | "hexo-generator-async": "^0.1.1", 18 | "hexo-generator-category": "^0.1.3", 19 | "hexo-generator-index": "^0.2.0", 20 | "hexo-generator-tag": "^0.2.0", 21 | "hexo-pagination": "^0.1.0", 22 | "hexo-renderer-buble": "^0.3.0", 23 | "hexo-renderer-ejs": "^0.3.0", 24 | "hexo-renderer-jade": "^0.4.1", 25 | "hexo-renderer-stylus": "^0.3.1", 26 | "hexo-server": "^0.2.0", 27 | "markdown-it": "^8.3.1", 28 | "markdown-it-footnote": "^3.0.1", 29 | "markdown-it-prettier": "^1.0.2", 30 | "prismjs": "^1.6.0" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /scaffolds/draft.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: {{ title }} 3 | tags: 4 | --- 5 | -------------------------------------------------------------------------------- /scaffolds/page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: {{ title }} 3 | date: {{ date }} 4 | --- 5 | -------------------------------------------------------------------------------- /scaffolds/post.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: {{ title }} 3 | date: {{ date }} 4 | tags: 5 | categories: 6 | summary: 7 | --- 8 | -------------------------------------------------------------------------------- /scripts/generate-alphabet.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const pagination = require('hexo-pagination') 4 | 5 | hexo.extend.generator.register('generate-alphabet', function (locals) { 6 | const config = { 7 | perPage: hexo.config.per_page || 50, 8 | base: path.join(path.sep, 'alphabet', path.sep), 9 | url: hexo.config.url 10 | } 11 | const alphabetList = 'abcdefghijklmnopqrstuvwxyz'.split('') 12 | return locals.categories.filter(v => alphabetList.indexOf(v.slug) !== -1).reduce((result, category) => { 13 | if (!category.length) return result 14 | const posts = category.posts.sort('slug') 15 | const data = pagination(path.join(config.base, category.slug), posts, { 16 | perPage: 10, 17 | layout: ['alphabet', 'index'], 18 | data: { 19 | category: category.name, 20 | alphabet: true, 21 | alphabetList 22 | } 23 | }) 24 | return result.concat(data) 25 | }, []) 26 | }) 27 | -------------------------------------------------------------------------------- /scripts/generate-titles.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | 4 | hexo.extend.generator.register('generate-title', function (locals) { 5 | const titles = locals.posts.data.map(p => p.title.toLowerCase()) 6 | return { 7 | path: path.join(path.sep, 'async', path.sep, 'title.json'), 8 | data: JSON.stringify(titles) 9 | } 10 | }) 11 | -------------------------------------------------------------------------------- /scripts/render-markdown.js: -------------------------------------------------------------------------------- 1 | const Prism = require('prismjs') 2 | const MD = require('markdown-it') 3 | 4 | require('prismjs/components/prism-javascript') 5 | 6 | const md = new MD({ 7 | html: true, 8 | linkify: true, 9 | typographer: true, 10 | highlight(str, lang) { 11 | return Prism.highlight(str, Prism.languages[lang] || Prism.languages.markup) 12 | } 13 | }) 14 | 15 | md.use(require('markdown-it-prettier'), { 16 | singleQuote: true, 17 | semi: false 18 | }) 19 | md.use(require('markdown-it-footnote')) 20 | 21 | function renderer(data, options) { 22 | return md.render(data.text) 23 | } 24 | 25 | hexo.extend.renderer.register('md', 'html', renderer, true) -------------------------------------------------------------------------------- /source/_posts/ajax.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AJAX 3 | date: 2016-06-19 17:50:45 4 | categories: 5 | - a 6 | tags: 7 | - javascript 8 | - network 9 | - ajax 10 | summary: 异步 HTTP 请求技术。 11 | --- 12 | 13 | AJAX 是一项用过异步数据传输来实现服务器与客户端之间交互操作的技术。使用 AJAX 更新页面部分内容而不是传统地刷新整个页面,这样极大提升了客户端与服务器之间的数据通信效率。 14 | 15 | 实例,使用 jQuery 提供的 AJAX 方法更新添加评论后的新评论列表: 16 | 17 | ```js 18 | $.post('/add-comment', {comment}, function (err, addedComment) { 19 | $('.comment-list').append(`
${addedComment.body}
`) 20 | }) 21 | ``` 22 | 23 | ## 外部链接 24 | 25 | - [MDN 上关于 AJAX 的介绍](https://developer.mozilla.org/zh-CN/docs/AJAX/Getting_Started) 26 | -------------------------------------------------------------------------------- /source/_posts/amd.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: AMD 3 | date: 2016-06-20 03:36:27 4 | tags: 5 | - amd 6 | - javascript 7 | categories: 8 | - a 9 | summary: 一种异步加载 JavaScript 库或模块的规范。 10 | --- 11 | AMD 全称为 Asynchronous Module Definition(异步模块定义),主要针对浏览器端 JS 模块的异步加载。 12 | 13 | 类似的 CommonJS 规范主要用于 Node.js 等服务器端环境,由于其加载机制决定无法在浏览器端使用(依赖网络请求),从而有了 AMD 规范的诞生。 14 | 15 | ## 外部链接 16 | 17 | - [AMD 中文版](https://github.com/amdjs/amdjs-api/wiki/AMD-(%E4%B8%AD%E6%96%87%E7%89%88)) 18 | - [Javascript模块化编程(二):AMD规范](http://www.ruanyifeng.com/blog/2012/10/asynchronous_module_definition.html) 19 | -------------------------------------------------------------------------------- /source/_posts/arity.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Arity 3 | date: 2016-06-20 11:35:48 4 | tags: 5 | - javascript 6 | categories: 7 | - a 8 | summary: 代指一个函数的参数数量。 9 | --- 10 | 你可能会在计算机领域遇到这个概念,已废弃的 API `Function.arity` 是其具体实现,现已被 `Function.length` 替代。 11 | 12 | 实例: 13 | 14 | ```js 15 | function foo(a, b, c) {} 16 | 17 | console.log(foo.length) 18 | //=> 3 19 | ``` 20 | 21 | ## 外部链接 22 | 23 | - [Function.arity](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Function/arity) 24 | - [Function.length](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Function/length) 25 | -------------------------------------------------------------------------------- /source/_posts/babel.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Babel 3 | date: 2016-06-19 18:04:19 4 | categories: 5 | - b 6 | tags: 7 | - javascript 8 | - babel 9 | - transpiler 10 | summary: 一个 ES6 代码转换器。 11 | --- 12 | 13 | Babel 最开始是一个 ES6 到 ES5 的代码转换器,经过发展现在可以借用其 AST 结构实现更多的代码转换需求。 14 | 15 | ## 外部链接 16 | 17 | - [Babel 官方网站](http://babeljs.io/) 18 | - [在线运行 ES6 代码](http://babeljs.io/repl/) 19 | - [Babel 插件编写手册](https://github.com/thejameskyle/babel-handbook) 20 | -------------------------------------------------------------------------------- /source/_posts/bus-factor.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Bus factor 3 | date: 2017-06-07 20:48:01 4 | tags: 5 | categories: b 6 | summary: 用于衡量团队中信息不对等所造成的风险。 7 | --- 8 | 9 | 如果你的团队中失去至少 Y 人就可能导致项目由于缺乏有能力的人而失败,那么这里的 Y 就是所谓的 Bus factor,抑或译为「公交因子」。 10 | 11 | Bus factor 是从「hit by a bus」衍生来的,代指由于一切不确定的因素而离开团队,并不一定非得被车撞。原因也可以是某个成员「找到了新工作」、「生孩子」或者「生活方式改变了」。 12 | 13 | 另外一个对 Bus factor 的解释是:指代一个团队中不可或缺的人数。 14 | 15 | ## 外部链接 16 | 17 | - [Bus factor (维基百科)](https://en.wikipedia.org/wiki/Bus_factor) -------------------------------------------------------------------------------- /source/_posts/canvas.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Canvas 3 | date: 2016-06-20 15:10:04 4 | tags: 5 | - html 6 | - graphic 7 | categories: 8 | - c 9 | summary: 用于绘制 2D/3D 界面的 HTML 元素。 10 | --- 11 | Canvas 的 API 能让你通过 WebGL 绘制 3D 图像、通过 [CanvasRenderingContext2D](https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D) 绘制 2D 图像。 12 | -------------------------------------------------------------------------------- /source/_posts/commonjs.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: CommonJS 3 | date: 2016-06-20 03:48:10 4 | tags: 5 | - commonjs 6 | - cjs 7 | - javascript 8 | categories: 9 | - c 10 | summary: 以单文件作为单独模块的 JavaScript 模块规范。 11 | --- 12 | CommonJS 是以在浏览器环境之外构建 JavaScript 生态系统为目标而产生的项目,比如在服务器和桌面环境中。 13 | 14 | ## 历史 15 | 16 | 这个项目最开始是由 Mozilla 的工程师 Kevin Dangoor 在2009年1月创建的,当时的名字是 ServerJS。 17 | 18 | > 我在这里描述的并不是一个技术问题,而是一件重大的事情,让大家走到一起来做决定,迈出第一步,来建立一个更大更酷的东西。 —— Kevin Dangoor's [What Server Side JavaScript needs](http://www.blueskyonmars.com/2009/01/29/what-server-side-javascript-needs/) 19 | 20 | 2009年8月,这个项目改名为 CommonJS,以显示其 API 的更广泛实用性。CommonJS 是一套规范,它的创建和核准是开放的。这个规范已经有很多版本和具体实现。CommonJS 并不是属于 ECMAScript TC39 小组的工作,但 TC39 中的一些成员参与 CommonJS 的制定。2013年5月,Node.js 的包管理器 NPM 的作者 Isaac Z. Schlueter 说 [CommonJS 已经过时,Node.js 的内核开发者已经废弃了该规范](https://github.com/nodejs/node-v0.x-archive/issues/5132#issuecomment-15432598)。 21 | 22 | CommonJS 规范是为了解决 JavaScript 的作用域问题而定义的模块形式,可以使每个模块它自身的命名空间中执行。该规范的主要内容是,模块必须通过 `module.exports` 导出对外的变量或接口,通过 `require()` 来导入其他模块的输出到当前模块作用域中。 23 | 24 | 一个直观的例子: 25 | 26 | ```js 27 | // moduleA.js 28 | module.exports = function( value ){ 29 | return value * 2; 30 | } 31 | ``` 32 | 33 | ```js 34 | // moduleB.js 35 | var multiplyBy2 = require('./moduleA'); 36 | var result = multiplyBy2(4); 37 | ``` 38 | 39 | CommonJS 是同步地加载模块,但其实也有浏览器端的实现,其原理是现将所有模块都定义好并通过 id 索引,这样就可以方便的在浏览器环境中解析了,可以参考 [require1k](https://github.com/Stuk/require1k) 和 [tiny-browser-require](https://github.com/ruanyf/tiny-browser-require) 的源码来理解其解析 `resolve` 的过程。 40 | 41 | ## 外部链接 42 | 43 | - [CommonJS 规范](http://javascript.ruanyifeng.com/nodejs/module.html) 44 | - [Node.js modules](https://nodejs.org/docs/latest/api/modules.html) 45 | -------------------------------------------------------------------------------- /source/_posts/coroutine.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Coroutine 3 | date: 2016-06-21 15:56:02 4 | tags: 5 | - coroutine 6 | categories: 7 | - c 8 | summary: 协作式的用户态线程。 9 | --- 10 | 11 | 中文译作「协程」,根据协程的各种不同实现,协程起着不同的作用: 12 | 13 | - 状态机: 控制过程当前的出口/入口点,有助于将异步、回调方式的代码用同步的方式写出来,增强可读性。 14 | - 角色模型: 并行的角色模型,例如计算机游戏。每个角色有自己的过程(这又在逻辑上分离了代码),但他们自愿地向顺序执行各角色过程的中央调度器交出控制(这是合作式多任务的一种形式)。 15 | - 产生器: 它有助于输入/输出和对数据结构的通用遍历。 16 | 17 | ## 外部链接 18 | 19 | - [协程(维基百科)](https://zh.wikipedia.org/wiki/%E5%8D%8F%E7%A8%8B) 20 | - [怎么理解coroutine?(知乎)](https://www.zhihu.com/question/21483863) 21 | -------------------------------------------------------------------------------- /source/_posts/design-pattern.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 设计模式 3 | date: 2016-06-20 22:14:51 4 | tags: 5 | - design-pattern 6 | category: 7 | - d 8 | summary: 在软件开发中对于常见问题的解决方案。 9 | --- 10 | 设计模式常常和「最佳实践」一起出现,它是前人经过相当长的一段时间的试验和错误总结出来的。 11 | 12 | ## 外部链接 13 | 14 | - [设计模式(维基百科)](https://zh.wikipedia.org/zh/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F_(%E8%AE%A1%E7%AE%97%E6%9C%BA)) 15 | - [什么是设计模式(知乎)](https://www.zhihu.com/question/19558521) 16 | -------------------------------------------------------------------------------- /source/_posts/dom.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: DOM 3 | date: 2016-06-20 23:33:10 4 | tags: 5 | - javascript 6 | - browser 7 | categories: 8 | - d 9 | summary: HTML 和 XML 文档的编程接口。 10 | --- 11 | 12 | 13 | 一个网页就是一个文档,而 DOM 给文档(结构树)提供了一个结构化的表述并且定义了一种方式 —— 程序可以对结构树进行访问,以改变文档的结构,样式和内容。 14 | 15 | DOM 不是一种编程语言而是一个标准,它有很多具体实现,比如在各个浏览器 JS 引擎上的实现,尽管遵循统一标准,你可以通过相同的 API 接口访问,但各种实现也存在着些许差异。 16 | 17 | 实例代码,使用 DOM 操作元素: 18 | 19 | ```js 20 | const p = document.querySelector('p') 21 | p.innerHTML = 'hack by codejargon' 22 | ``` 23 | 24 | ## 外部链接 25 | 26 | - [DOM 概述](https://developer.mozilla.org/zh-CN/docs/Web/API/Document_Object_Model/Introduction) 27 | - [DOM 接口](https://developer.mozilla.org/zh-CN/docs/Web/API/Document_Object_Model#DOM_接口) 28 | -------------------------------------------------------------------------------- /source/_posts/electron.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Electron 3 | date: 2016-06-20 22:27:20 4 | tags: 5 | - node.js 6 | - javascript 7 | - desktop 8 | - chrome 9 | categories: 10 | - e 11 | summary: 基于 HTML/CSS/JS 技术开发跨平台桌面应用的框架。 12 | --- 13 | Electron 由 GitHub 公司基于 Node.js 和 Chromium 开发,被很多流行应用比如 Atom、VSCode 编辑器使用。 14 | 15 | 你可以从官方[快速上手](https://github.com/electron/electron-quick-start)项目开始了解: 16 | 17 | {% codeblock lang:bash %} 18 | # Clone the Quick Start repository 19 | $ git clone https://github.com/electron/electron-quick-start 20 | 21 | # Go into the repository 22 | $ cd electron-quick-start 23 | 24 | # Install the dependencies and run 25 | $ npm install && npm start 26 | {% endcodeblock %} 27 | 28 | 有开发者把 Electron 更抽象地封装成一个 [menubar](https://github.com/maxogden/menubar) 模块,方便用户快速创建桌面 menubar(状态栏/菜单栏) 应用。 29 | 30 | ## 外部链接 31 | 32 | - [Electron 官网](http://electron.atom.io/) 33 | - [Atom 编辑器](https://atom.io/) 34 | -------------------------------------------------------------------------------- /source/_posts/fetch-api.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Fetch API 3 | date: 2016-06-20 22:42:50 4 | tags: 5 | - javascript 6 | - network 7 | categories: 8 | - f 9 | summary: 更现代化的浏览器网络请求接口,相比 XMLHttpRequest 增加了灵活性并使用了 Promise 技术。 10 | --- 11 | `fetch()` 接受一个资源路径作为第一个参数,无论请求成功与否,它都返回一个 `Promise` 对象。 12 | 13 | 第二个参数是配置项,你可以指定提交类型比如 `POST` 或者 `GET`,或者指定需要传递的 header 参数等等。 14 | 15 | 实例代码: 16 | 17 | ```js 18 | const body = JSON.stringify({ 19 | title: 'New Post' 20 | }) 21 | 22 | fetch('/posts', {type: 'POST', body}) 23 | .then(data => data.json()) 24 | .then(data => console.log(data)) 25 | ``` 26 | 27 | ## 浏览器兼容性 28 | 29 | 基于 [caniuse](http://caniuse.com/#feat=fetch) 的结果: 30 | 31 | IE ✘ 32 | Edge ✘ 33 | Firefox ✘ 2+ ✘ 34+¹ ✔ 39+⁴ ✔ 40+ 34 | Chrome ✘ 4+ ◒ 40+² ◒ 41+² ✔ 42+ 35 | Safari ✘ 36 | Opera ✘ 9+ ◒ 27+² ◒ 28+² ✔ 29+ 37 | 38 | 不过已经有相关 polyfill 让 Fetch API 能够运行在大部分浏览器和服务器端环境上。 39 | 40 | ## 外部链接 41 | 42 | - [Fetch API 在 MDN 上的介绍](https://developer.mozilla.org/zh-CN/docs/Web/API/Fetch_API) 43 | - [服务器端 Fetch API polyfill](https://github.com/bitinn/node-fetch) 44 | - [浏览器端 Fetch API polyfill](https://github.com/github/fetch) 45 | -------------------------------------------------------------------------------- /source/_posts/high-order-function.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 高阶函数 3 | date: 2016-06-20 15:23:13 4 | tags: 5 | - function 6 | - high-order-function 7 | categories: 8 | - h 9 | summary: 以函数作为参数或返回值的函数。 10 | --- 11 | 英文 Higher order function,在 JavaScript 中,`[].map` 就是一个高阶函数: 12 | 13 | ```js 14 | // 以一个箭头函数作为参数 15 | [1, 2, 3].map(v => v * 2) 16 | ``` 17 | 18 | ```js 19 | // 返回一个函数 20 | function divideBy(n) { 21 | return function (d) { 22 | return n / d 23 | } 24 | } 25 | 26 | divideBy(10)(2) 27 | //=> 5 28 | ``` 29 | 30 | JavaScript 的回调函数就是典型的高阶函数,在 Web 编程中网络请求往往可以带有一个回调函数,可以在成功获得返回结果时执行回调函数来处理结果: 31 | 32 | ```js 33 | $.get('/url', function (err, data) { 34 | console.log(data) 35 | }) 36 | ``` 37 | 38 | ## 外部链接 39 | 40 | - [Higher-Order Functions in JavaScript](http://www.sitepoint.com/higher-order-functions-javascript/) 41 | -------------------------------------------------------------------------------- /source/_posts/http-451.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: HTTP 451 3 | date: 2016-06-27 22:41:05 4 | tags: 5 | - 451 6 | - http 7 | categories: 8 | - h 9 | summary: 因法律原因不可用时服务器返回的状态码。 10 | --- 11 | 在电脑网络领域中,HTTP 451 因法律原因不可用(英语:HTTP 451 Unavailable For Legal Reasons)是一种 HTTP 协议的错误状态代码,当用户请求访问某个经政府审核等查核方法后认定不合法的来源时,就会显示这个错误代码。 12 | 13 | ## 外部链接 14 | 15 | - [HTTP 451(维基百科)](https://zh.wikipedia.org/zh/HTTP_451) 16 | - [HTTP状态码451:基于法律上的原因,我不能向你展示网页内容](https://zhuanlan.zhihu.com/p/21432458) 17 | -------------------------------------------------------------------------------- /source/_posts/http2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: HTTP/2 3 | date: 2016-06-19 23:02:44 4 | categories: 5 | - h 6 | tags: 7 | - http 8 | - network 9 | - server 10 | summary: HTTP 协议的的第二个主要版本,其最为显著的新特性「多路复用」让请求相互独立,一个请求不会阻塞其它请求。 11 | --- 12 | 13 | HTTP/2 协议基于 SPDY 演化而来,在保证与 HTTP 1.1 的语义兼容的进行了多项改进: 14 | 15 | - 多路复用: 单个连接上可以并行交错的请求和响应,之间互不干扰 16 | - 优先级请求: 可以在请求中设置优先值,确保最重要的请求优先获得处理 17 | - 服务器推送: 服务器能推送消息给客户端 18 | - 头部压缩: 压缩头部(HEAD)减少请求和响应的大小 19 | 20 | ## 外部链接 21 | 22 | - [HTTP/2 讲解](https://ye11ow.gitbooks.io/http2-explained/content/) 23 | -------------------------------------------------------------------------------- /source/_posts/left-pad.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: left-pad 3 | date: 2016-06-20 12:48:39 4 | tags: 5 | - left-pad 6 | - npm 7 | - javascript 8 | - node.js 9 | categories: 10 | - l 11 | summary: 一个开发者对 NPM 公司不满,unpublish 了自己的所有模块,其中包括被广泛使用的 left-pad。 12 | --- 13 | 14 | Azer 在《[I’ve Just Liberated My Modules](https://medium.com/@azerbike/i-ve-just-liberated-my-modules-9045c06be67c)》一文中写道: 15 | 16 | > 几个星期前有位专利律师给我发了一封电子邮件,要求我取消发布 NPM 上的 “KIK” 模块。我的回答是“不”,于是他回复我说:“I don’t wanna be dick about it(这句就不翻译了,你只需要知道 dick 是什么意思就够了),但 “KIK” 是我们的注册品牌,并且我们的律师遍布世界各地。”
17 | > 当我开始编写 kik 时,并不知道有同名的公司。而我也不希望因为这个公司而被迫改变项目的名字。在遭到了我的拒绝后,他们联系了 NPM 的技术支持,为了强调他们的律师权力,每一个电子邮件都抄送给了我。在未经我允许的情况下,@izs 更改了此模块的所有权。
18 | > 鉴于此我才意识到,NPM 是某个人的私有地盘,他比其他人有更多的控制权,但是我是做开源的,因为权力属于人民。(Power To The People 是约翰·列侬的同名歌曲)
19 | >概述一下就是; NPM 不再是我分享开源工作的地方,所以,我取消了曾经发布的所有模块)。(一共取消了 273 个) 20 | 这不是一个下意识的行为。我喜欢开源,相信开源社区将最终创造一个真正自由的 NPM。
21 | > 如果你的项目因此而构建失败,我向你道歉。你可以在仓库(azer/dependency)指出你的依赖,或者如果你自愿参加我的 Github 上的任何模块,我会高兴地转移所有权。 22 | 干杯,再见。
23 | > —— 援引自 《[开发者对 npm 公司不满,unpublish 了自己的所有模](https://medium.com/@azerbike/i-ve-just-liberated-my-modules-9045c06be67c#.74d3ql425)》 24 | 25 | 这个事件以 `left-pad` 的名称流传最广,这是 Azer 删除的 273 个模块之一,该模块被大量流行开源项目使用,比如 Babel 和 React Native 项目。[目前此模块已被作者转让给新的开发者](https://github.com/stevemao/left-pad)。 26 | 27 | ## 外部链接 28 | 29 | - [I’ve Just Liberated My Modules](https://medium.com/@azerbike/i-ve-just-liberated-my-modules-9045c06be67c#.74d3ql425) 30 | - [开发者对 npm 公司不满,unpublish 了自己的所有模块](http://mp.weixin.qq.com/s?__biz=MzI0NTAyNjE0NQ==&mid=427175657&idx=1&sn=57c0cda917797198df18552f7d8f4eca&scene=0#wechat_redirect) 31 | - [如何看待 Azer Koçulu 删除了自己的所有 npm 库?](https://www.zhihu.com/question/41694868) 32 | - [kik, left-pad, and npm](http://blog.npmjs.org/post/141577284765/kik-left-pad-and-npm) 33 | -------------------------------------------------------------------------------- /source/_posts/page-rank.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Page Rank 3 | date: 2016-06-28 21:04:40 4 | tags: 5 | - page-rank 6 | - google 7 | categories: 8 | - p 9 | summary: Google 用来计算网页排名的一种算法。 10 | --- 11 | 一个页面的“得票数”由所有链向它的页面的重要性来决定,到一个页面的超链接相当于对该页投一票。一个页面的 PageRank 是由所有链向它的页面(“链入页面”)的重要性经过递归算法得到的。一个有较多链入的页面会有较高的等级,相反如果一个页面没有任何链入页面,那么它没有等级。 12 | 13 | 2005 年初,Google 为网页链接推出一项新属性 nofollow,使得网站管理员和网志作者可以做出一些 Google 不计票的链接,也就是说这些链接不算作“投票”。nofollow 的设置可以抵制垃圾评论。 14 | 15 | Google 工具条上的 PageRank 指针从 0 到 10。它似乎是一个对数标度算法,细节未知。虽然 PageRank 是 Google 的商标,其技术亦已经申请专利,但是专利权属于斯坦福大学,而非 Google。 16 | 17 | ## 自 Google 网站管理员工具移除 18 | 19 | 2009 年 10 月 14 日,Google 员工苏珊·莫斯科(Susan Moskwa)确认该公司已自其网站管理员工具部分移除 PageRank。她对这部分移除的公告表示:“我们长久以来一直在告诫人们不应该过分注重 PageRank;很多网站站主似乎认为对他们来说得时时追踪的网站最重要指标,而这简直是个误解。” 20 | 21 | 然而在苏珊确认后两天,PageRank 仍旧在 Google 工具栏上显示。 2014 年 10 月 7 日,Google 员工 John Mueller 表示 :“我们可能不会继续更新 PageRank,至少在 Toolbar PageRank是这样。” 22 | 23 | —— 内容参考维基百科 24 | 25 | ## 外部链接 26 | 27 | - [PageRank (维基百科)](https://zh.wikipedia.org/wiki/PageRank) 28 | - [Google Toolbar PageRank Finally & Officially Dead?](http://searchengineland.com/google-toolbar-pagerank-finally-officially-dead-205277) 29 | -------------------------------------------------------------------------------- /source/_posts/sfc.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: SFC 3 | date: 2017-06-08 00:52:21 4 | tags: 5 | - vue 6 | categories: 7 | - s 8 | summary: Vue 单文件组件。 9 | --- 10 | 将一个组件所需要的 HTML 模板、JS 逻辑、CSS 样式分割的同时写在同一个文件中,并借用 Webpack / Browserify 等打包工具让其充分利用 npm 生态中的各种预处理工具,比如 Babel、PostCSS 等等。 11 | 12 | 示例 `Counter.vue` 文件: 13 | 14 | ```vue 15 | 22 | 23 | 32 | 33 | 38 | ``` 39 | 40 | ## 外部链接 41 | 42 | - [Vue 中文文档: 单文件组件](https://cn.vuejs.org/v2/guide/single-file-components.html) -------------------------------------------------------------------------------- /source/_posts/surge-sh.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Surge.sh 3 | date: 2016-06-21 15:39:46 4 | tags: 5 | - tool 6 | - static website 7 | categories: 8 | - s 9 | summary: 前端开发者的静态网站发布工具。 10 | --- 11 | Surge.sh 让你通过命令行快速发布本地的静态网页,提供域名绑定等功能,并且一切都是免费的。 12 | 13 | 命令行预览: 14 | 15 | ![surge cli](https://o68eee1f9.qnssl.com/image/cj/surge.sh-preview.png) 16 | 17 | ## 外部链接 18 | 19 | - [Surge.sh](https://surge.sh/) 20 | - [Surge CLI 代码](https://github.com/sintaxi/surge) 21 | -------------------------------------------------------------------------------- /source/_posts/surge.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Surge 3 | date: 2016-06-21 15:33:27 4 | tags: 5 | - proxy 6 | categories: 7 | - s 8 | summary: 基于 iOS 9 的新特性 Network Extension 开发的一款网络调试工具。 9 | --- 10 | ## 外部链接: 11 | 12 | - [Surge 新手使用指南](https://medium.com/@scomper/surge-%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6-a1533c10e80b#.fvgh6mb3n) 13 | - [Surge 安装步骤导览](https://medium.com/@scomper/surge-%E5%AE%89%E8%A3%85%E6%AD%A5%E9%AA%A4%E5%AF%BC%E8%A7%88-81bbce87d54a) 14 | -------------------------------------------------------------------------------- /source/_posts/vue.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Vue 3 | date: 2016-06-19 22:37:10 4 | categories: 5 | - v 6 | tags: 7 | - vue 8 | - javascript 9 | - mvvm 10 | - framework 11 | summary: 简单却功能强大的前端 MVVM 框架,Vue(2) 由 Virtual DOM 技术驱动。 12 | --- 13 | 14 | 你只需要提供一个模板(template)并绑定数据(data),Vue 会检测数据变化来更新 DOM 内容。 15 | 16 | 同时提供双向数据绑定、过滤器、指令、组件等功能,且能和 Webpack、Browserify 等构建工具无缝衔接使用。 17 | 18 | ## Vue 2 19 | 20 | 新的 Vue 使用 Virtual DOM 解除了对 DOM 的强耦合依赖,并将使用场景拓展到移动平台等领域。同时性能和大小都有显著改进。 21 | 22 | ## 外部链接 23 | 24 | - [Vue 中文官网](http://cn.vuejs.org/) 25 | - [Vue 项目代码](https://github.com/vuejs/vue) 26 | - [Vue gitter 聊天组](https://gitter.im/vuejs/vue) 27 | -------------------------------------------------------------------------------- /source/_posts/webpack.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Webpack 3 | date: 2016-06-22 14:25:57 4 | tags: 5 | - javascript 6 | - bundler 7 | categories: 8 | - w 9 | summary: JavaScript 构建工具和依赖管理工具,提供了很多常见构建方式的解决方案。 10 | --- 11 | 众所周知 JavaScript 项目没有一个通用的模块依赖管理机制,而浏览器方面则更是紧紧停留在实现阶段。Webpack 让你可以使用 CommonJS/AMD/UMD/ES6 modules 管理模块,并且可以生成浏览器可用的前端静态文件。 12 | 13 | Webpack 的重要卖点「热替换」可以让浏览器自动更新生成的代码中需要替换的部分而无需刷新浏览器,并且保存应用状态,比如表单输入的内容。 14 | 15 | Webpack 2 的新功能「Tree Shaking」则能过滤模块中没有被使用的代码,不会将其打包进生成的文件中。 16 | 17 | ## 外部链接 18 | 19 | - [Webpack](https://github.com/webpack/webpack) 20 | - [What's new in webpack 2](https://gist.github.com/sokra/27b24881210b56bbaff7) 21 | -------------------------------------------------------------------------------- /source/_posts/yin-lang.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Yin 语言 3 | date: 2016-06-20 23:04:44 4 | tags: 5 | - wangyin 6 | categories: 7 | - y 8 | summary: 基于 Java 并完全独立于操作系统之上的编程语言。 9 | --- 10 | 11 | > Yin 语言是完全独立的系统,它的设计目标是高于操作系统,数据库,WEB 等概念的。也就是说,Yin 语言最终将独立于任何操作系统,完全独立地运行于硬件之上。
12 | > 最终,操作系统这个概念将趋于“透明”,它的精髓将无缝的成为语言的运行时系统,而数据库则成为它的永久性数据存储。Yin 语言不仅将成为这种操作系统的应用语言,也是它的 shell,而且还是这种数据库系统的查询语言。这样一来不但大大的简化了学习的过程,而且使得系统的各个部件可以几乎无缝的的协同工作甚至嵌入应用,而不需要复杂的编码解码过程。
13 | > —— 援引自王垠博客 14 | 15 | Yin 语言已经不再公开开发,并且作者王垠已经删除相关博文和 GitHub 项目,详见 [我为什么不再公开开发Yin语言](http://www.yinwang.org/blog-cn/2015/03/18/yin-lang-secret)。 16 | 17 | ## 外部链接 18 | 19 | - [如何评价王垠正在设计和开发的 Yin 语言?](https://www.zhihu.com/question/23701222) 20 | -------------------------------------------------------------------------------- /source/about.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 关于 3 | date: 2016-06-19 21:56:36 4 | --- 5 | 欢迎来到新世界。 6 | 7 | 你是否已经在编程中厌倦了接触各种所谓的新词汇? 8 | 各种长篇累牍、啰里啰嗦的描述让你招架不能。 9 | 10 | 神奇的「简明编程术语」可以帮到你,有些特定的词汇在维基百科上甚至有没有收录,而我们希望你能在这里找到它。 11 | 12 | 相比维基百科和搜索引擎,这里—— 13 | 14 | - 没有纷繁复杂的内容,不会影响你的阅读初衷 15 | - 小而精。每一个词条第一段都是能充分概括该词条的总结,如果不够,我们会用最简练的语言继续介绍它。 16 | -------------------------------------------------------------------------------- /themes/bw/layout/alphabet.jade: -------------------------------------------------------------------------------- 1 | extends base 2 | 3 | block title 4 | title #{page.category} - #{config.title} 5 | 6 | block page 7 | .alphabet-table.box 8 | each i in page.alphabetList 9 | a.alphabet-item(href="/alphabet/#{i}" class=page.category===i?'active':'')=i 10 | .main.box 11 | .box-heading 12 | h3 字母表 13 | if page.posts.length > 0 14 | ul.post-list 15 | - page.posts.each(function(post) { 16 | +article(post) 17 | - }) 18 | -------------------------------------------------------------------------------- /themes/bw/layout/base.jade: -------------------------------------------------------------------------------- 1 | include mixins 2 | 3 | doctype html 4 | html 5 | head 6 | meta(charset="utf-8") 7 | meta(name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no") 8 | block title 9 | title=config.title 10 | block description 11 | meta(name="description" content=config.description) 12 | block styles 13 | link(href="/css/main.css?v=#{config.version}" rel="stylesheet") 14 | body 15 | .page.container 16 | block header 17 | header.header.box 18 | .header-inner 19 | h2.site-name 20 | a(href="/")=config.title 21 | sup CODE JARGON 22 | +nav(page) 23 | block page 24 | | hi 25 | footer.footer. 26 | 简明编程术语是由社区驱动的编程知识分享网站,主要提供各类编程专业术语的解释。
27 | 这个项目的目的并不是取代各种现有文档,而是提供一个更为直接方便的术语表。
28 | 欢迎到 GitHub 上贡献内容。 29 | block scripts 30 | script(src="/js/app.js?v=#{config.version}") 31 | div(style="display:none") 32 | script(src="https://tajs.qq.com/stats?sId=62499700", charset="UTF-8") 33 | -------------------------------------------------------------------------------- /themes/bw/layout/index.jade: -------------------------------------------------------------------------------- 1 | extends base 2 | 3 | block page 4 | .main.box 5 | .box-heading 6 | h3 最近新增 7 | ul.post-list 8 | - page.posts.each(function(post) { 9 | +article(post) 10 | - }) 11 | -------------------------------------------------------------------------------- /themes/bw/layout/mixins.jade: -------------------------------------------------------------------------------- 1 | mixin article(post) 2 | li.post-item 3 | a.post-title(href=url_for(post.path)) #{post.title} 4 | | : 5 | span.post-summary #{post.summary} 6 | 7 | mixin nav(page) 8 | nav.nav 9 | ul 10 | li 11 | a(href="/" class=page.path==='index.html'?'active':'') 首页 12 | li 13 | a(href="/about.html" class=page.path==='about.html'?'active':'') 关于 14 | li 15 | a(href="/alphabet/a/" class=page.alphabet?'active':'') 字母表 16 | -------------------------------------------------------------------------------- /themes/bw/layout/post.jade: -------------------------------------------------------------------------------- 1 | extends base 2 | 3 | block title 4 | title #{page.title } - #{config.title} 5 | 6 | if page.summary 7 | block description 8 | meta(name="description" content=page.summary) 9 | 10 | block page 11 | .main.box 12 | article.article 13 | h1.article-title=page.title 14 | .article-content.markdown-body 15 | if page.summary 16 | p=page.summary 17 | | !{page.content} 18 | if page.layout === 'post' 19 | .article-report 20 | | *如果你对本词条有更好的见解可以直接修改 源文件 或者 提交 ISSUE。 -------------------------------------------------------------------------------- /themes/bw/source/css/main.styl: -------------------------------------------------------------------------------- 1 | html 2 | font-size: 16px 3 | 4 | body 5 | font-size: 1rem 6 | line-height: 1.5 7 | font-family: -apple-system, BlinkMacSystemFont, 8 | 'avenir next', avenir, 9 | helvetica, 'helvetica neue', 10 | Ubuntu, 11 | 'segoe ui', arial, 12 | sans-serif 13 | background-color: #f0f0f0 14 | padding: 2rem 0 15 | 16 | body, h1, h2, h3, h4, h4, ul, p, figure 17 | margin: 0 18 | 19 | a 20 | color: black 21 | 22 | .container 23 | max-width: 40rem 24 | margin: 0 auto 25 | 26 | .box 27 | border: 1px solid #ccc 28 | background-color: white 29 | .box-heading 30 | padding: 1.25rem 31 | h3 32 | font-size: 1rem 33 | 34 | .header 35 | .header-inner 36 | padding: 1.25rem 37 | .site-name 38 | font-size: 2rem 39 | display: inline-block 40 | a 41 | text-decoration: none 42 | sup 43 | font-size: .875rem 44 | position: relative 45 | top: -5px 46 | left: 5px 47 | color: #f0db4f 48 | 49 | nav.nav 50 | border-top: 1px solid #ccc 51 | padding: 0 1.25rem 52 | background-color: #f0f0f0 53 | ul 54 | overflow: hidden 55 | list-style: none 56 | padding-left: 0 57 | li 58 | float: left 59 | height: 2rem 60 | line-height: @height 61 | &:not(:last-child) 62 | margin-right: 1rem 63 | a 64 | text-decoration: none 65 | font-size: .875rem 66 | height: 1rem 67 | line-height: @height 68 | color: #a7a7a7 69 | padding: 3px 8px 70 | border: 1px solid #ccc 71 | background-color: white 72 | &:hover 73 | color: #666 74 | &.active 75 | color: #333 76 | 77 | .main 78 | margin-top: .625rem 79 | 80 | .post-list 81 | margin-top: .5rem 82 | list-style: none 83 | padding-left: 0 84 | .post-item 85 | &:not(:last-child) 86 | margin-bottom: 3px 87 | &:before 88 | content '→ ' 89 | display: inline-block 90 | margin-right: .5rem 91 | .post-summary 92 | color: #666 93 | margin-left: .5rem 94 | 95 | article.article 96 | padding: 1.25rem 97 | .article-title 98 | font-size: 2.25rem 99 | .article-content 100 | margin-top: 1.25rem 101 | ul 102 | padding-left: 20px 103 | .highlight 104 | background-color: #f7f7f7 105 | .article-report 106 | margin-top: 20px 107 | color: #999 108 | font-size: 13px 109 | a 110 | color: @color 111 | 112 | .alphabet-table 113 | margin-top: .625rem 114 | overflow: hidden 115 | .alphabet-item 116 | display: block 117 | float: left 118 | width: 3.8461538461538463% 119 | text-align: center 120 | text-decoration: none 121 | color: #a7a7a7 122 | &:hover 123 | color: #666 124 | &.active 125 | background-color: black 126 | color: white 127 | 128 | .footer 129 | margin-top: 2rem 130 | font-size: .875rem 131 | 132 | @import "./markdown.styl" 133 | @import "./prism.styl" 134 | @import "./responsive.styl" 135 | -------------------------------------------------------------------------------- /themes/bw/source/css/markdown.styl: -------------------------------------------------------------------------------- 1 | .markdown-body { 2 | -ms-text-size-adjust: 100%; 3 | -webkit-text-size-adjust: 100%; 4 | line-height: 1.5; 5 | color: #24292e; 6 | font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; 7 | font-size: 16px; 8 | line-height: 1.5; 9 | word-wrap: break-word; 10 | } 11 | 12 | .markdown-body .pl-c { 13 | color: #969896; 14 | } 15 | 16 | .markdown-body .pl-c1, 17 | .markdown-body .pl-s .pl-v { 18 | color: #0086b3; 19 | } 20 | 21 | .markdown-body .pl-e, 22 | .markdown-body .pl-en { 23 | color: #795da3; 24 | } 25 | 26 | .markdown-body .pl-smi, 27 | .markdown-body .pl-s .pl-s1 { 28 | color: #333; 29 | } 30 | 31 | .markdown-body .pl-ent { 32 | color: #63a35c; 33 | } 34 | 35 | .markdown-body .pl-k { 36 | color: #a71d5d; 37 | } 38 | 39 | .markdown-body .pl-s, 40 | .markdown-body .pl-pds, 41 | .markdown-body .pl-s .pl-pse .pl-s1, 42 | .markdown-body .pl-sr, 43 | .markdown-body .pl-sr .pl-cce, 44 | .markdown-body .pl-sr .pl-sre, 45 | .markdown-body .pl-sr .pl-sra { 46 | color: #183691; 47 | } 48 | 49 | .markdown-body .pl-v, 50 | .markdown-body .pl-smw { 51 | color: #ed6a43; 52 | } 53 | 54 | .markdown-body .pl-bu { 55 | color: #b52a1d; 56 | } 57 | 58 | .markdown-body .pl-ii { 59 | color: #f8f8f8; 60 | background-color: #b52a1d; 61 | } 62 | 63 | .markdown-body .pl-c2 { 64 | color: #f8f8f8; 65 | background-color: #b52a1d; 66 | } 67 | 68 | .markdown-body .pl-c2::before { 69 | content: "^M"; 70 | } 71 | 72 | .markdown-body .pl-sr .pl-cce { 73 | font-weight: bold; 74 | color: #63a35c; 75 | } 76 | 77 | .markdown-body .pl-ml { 78 | color: #693a17; 79 | } 80 | 81 | .markdown-body .pl-mh, 82 | .markdown-body .pl-mh .pl-en, 83 | .markdown-body .pl-ms { 84 | font-weight: bold; 85 | color: #1d3e81; 86 | } 87 | 88 | .markdown-body .pl-mq { 89 | color: #008080; 90 | } 91 | 92 | .markdown-body .pl-mi { 93 | font-style: italic; 94 | color: #333; 95 | } 96 | 97 | .markdown-body .pl-mb { 98 | font-weight: bold; 99 | color: #333; 100 | } 101 | 102 | .markdown-body .pl-md { 103 | color: #bd2c00; 104 | background-color: #ffecec; 105 | } 106 | 107 | .markdown-body .pl-mi1 { 108 | color: #55a532; 109 | background-color: #eaffea; 110 | } 111 | 112 | .markdown-body .pl-mc { 113 | color: #ef9700; 114 | background-color: #ffe3b4; 115 | } 116 | 117 | .markdown-body .pl-mi2 { 118 | color: #d8d8d8; 119 | background-color: #808080; 120 | } 121 | 122 | .markdown-body .pl-mdr { 123 | font-weight: bold; 124 | color: #795da3; 125 | } 126 | 127 | .markdown-body .pl-mo { 128 | color: #1d3e81; 129 | } 130 | 131 | .markdown-body .pl-ba { 132 | color: #595e62; 133 | } 134 | 135 | .markdown-body .pl-sg { 136 | color: #c0c0c0; 137 | } 138 | 139 | .markdown-body .pl-corl { 140 | text-decoration: underline; 141 | color: #183691; 142 | } 143 | 144 | .markdown-body .octicon { 145 | display: inline-block; 146 | vertical-align: text-top; 147 | fill: currentColor; 148 | } 149 | 150 | .markdown-body a { 151 | background-color: transparent; 152 | -webkit-text-decoration-skip: objects; 153 | } 154 | 155 | .markdown-body a:active, 156 | .markdown-body a:hover { 157 | outline-width: 0; 158 | } 159 | 160 | .markdown-body strong { 161 | font-weight: inherit; 162 | } 163 | 164 | .markdown-body strong { 165 | font-weight: bolder; 166 | } 167 | 168 | .markdown-body h1 { 169 | font-size: 2em; 170 | margin: 0.67em 0; 171 | } 172 | 173 | .markdown-body img { 174 | border-style: none; 175 | } 176 | 177 | .markdown-body svg:not(:root) { 178 | overflow: hidden; 179 | } 180 | 181 | .markdown-body code, 182 | .markdown-body kbd, 183 | .markdown-body pre { 184 | font-family: monospace, monospace; 185 | font-size: 1em; 186 | } 187 | 188 | .markdown-body hr { 189 | box-sizing: content-box; 190 | height: 0; 191 | overflow: visible; 192 | } 193 | 194 | .markdown-body input { 195 | font: inherit; 196 | margin: 0; 197 | } 198 | 199 | .markdown-body input { 200 | overflow: visible; 201 | } 202 | 203 | .markdown-body [type="checkbox"] { 204 | box-sizing: border-box; 205 | padding: 0; 206 | } 207 | 208 | .markdown-body * { 209 | box-sizing: border-box; 210 | } 211 | 212 | .markdown-body input { 213 | font-family: inherit; 214 | font-size: inherit; 215 | line-height: inherit; 216 | } 217 | 218 | .markdown-body a { 219 | color: #0366d6; 220 | text-decoration: none; 221 | } 222 | 223 | .markdown-body a:hover { 224 | text-decoration: underline; 225 | } 226 | 227 | .markdown-body strong { 228 | font-weight: 600; 229 | } 230 | 231 | .markdown-body hr { 232 | height: 0; 233 | margin: 15px 0; 234 | overflow: hidden; 235 | background: transparent; 236 | border: 0; 237 | border-bottom: 1px solid #dfe2e5; 238 | } 239 | 240 | .markdown-body hr::before { 241 | display: table; 242 | content: ""; 243 | } 244 | 245 | .markdown-body hr::after { 246 | display: table; 247 | clear: both; 248 | content: ""; 249 | } 250 | 251 | .markdown-body table { 252 | border-spacing: 0; 253 | border-collapse: collapse; 254 | } 255 | 256 | .markdown-body td, 257 | .markdown-body th { 258 | padding: 0; 259 | } 260 | 261 | .markdown-body h1, 262 | .markdown-body h2, 263 | .markdown-body h3, 264 | .markdown-body h4, 265 | .markdown-body h5, 266 | .markdown-body h6 { 267 | margin-top: 0; 268 | margin-bottom: 0; 269 | } 270 | 271 | .markdown-body h1 { 272 | font-size: 32px; 273 | font-weight: 600; 274 | } 275 | 276 | .markdown-body h2 { 277 | font-size: 24px; 278 | font-weight: 600; 279 | } 280 | 281 | .markdown-body h3 { 282 | font-size: 20px; 283 | font-weight: 600; 284 | } 285 | 286 | .markdown-body h4 { 287 | font-size: 16px; 288 | font-weight: 600; 289 | } 290 | 291 | .markdown-body h5 { 292 | font-size: 14px; 293 | font-weight: 600; 294 | } 295 | 296 | .markdown-body h6 { 297 | font-size: 12px; 298 | font-weight: 600; 299 | } 300 | 301 | .markdown-body p { 302 | margin-top: 0; 303 | margin-bottom: 10px; 304 | } 305 | 306 | .markdown-body blockquote { 307 | margin: 0; 308 | } 309 | 310 | .markdown-body ul, 311 | .markdown-body ol { 312 | padding-left: 0; 313 | margin-top: 0; 314 | margin-bottom: 0; 315 | } 316 | 317 | .markdown-body ol ol, 318 | .markdown-body ul ol { 319 | list-style-type: lower-roman; 320 | } 321 | 322 | .markdown-body ul ul ol, 323 | .markdown-body ul ol ol, 324 | .markdown-body ol ul ol, 325 | .markdown-body ol ol ol { 326 | list-style-type: lower-alpha; 327 | } 328 | 329 | .markdown-body dd { 330 | margin-left: 0; 331 | } 332 | 333 | .markdown-body code { 334 | font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; 335 | font-size: 12px; 336 | } 337 | 338 | .markdown-body pre { 339 | margin-top: 0; 340 | margin-bottom: 0; 341 | font: 12px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; 342 | } 343 | 344 | .markdown-body .octicon { 345 | vertical-align: text-bottom; 346 | } 347 | 348 | .markdown-body .pl-0 { 349 | padding-left: 0 !important; 350 | } 351 | 352 | .markdown-body .pl-1 { 353 | padding-left: 4px !important; 354 | } 355 | 356 | .markdown-body .pl-2 { 357 | padding-left: 8px !important; 358 | } 359 | 360 | .markdown-body .pl-3 { 361 | padding-left: 16px !important; 362 | } 363 | 364 | .markdown-body .pl-4 { 365 | padding-left: 24px !important; 366 | } 367 | 368 | .markdown-body .pl-5 { 369 | padding-left: 32px !important; 370 | } 371 | 372 | .markdown-body .pl-6 { 373 | padding-left: 40px !important; 374 | } 375 | 376 | .markdown-body::before { 377 | display: table; 378 | content: ""; 379 | } 380 | 381 | .markdown-body::after { 382 | display: table; 383 | clear: both; 384 | content: ""; 385 | } 386 | 387 | .markdown-body>*:first-child { 388 | margin-top: 0 !important; 389 | } 390 | 391 | .markdown-body>*:last-child { 392 | margin-bottom: 0 !important; 393 | } 394 | 395 | .markdown-body a:not([href]) { 396 | color: inherit; 397 | text-decoration: none; 398 | } 399 | 400 | .markdown-body .anchor { 401 | float: left; 402 | padding-right: 4px; 403 | margin-left: -20px; 404 | line-height: 1; 405 | } 406 | 407 | .markdown-body .anchor:focus { 408 | outline: none; 409 | } 410 | 411 | .markdown-body p, 412 | .markdown-body blockquote, 413 | .markdown-body ul, 414 | .markdown-body ol, 415 | .markdown-body dl, 416 | .markdown-body table, 417 | .markdown-body pre { 418 | margin-top: 0; 419 | margin-bottom: 16px; 420 | } 421 | 422 | .markdown-body hr { 423 | height: 0.25em; 424 | padding: 0; 425 | margin: 24px 0; 426 | background-color: #e1e4e8; 427 | border: 0; 428 | } 429 | 430 | .markdown-body blockquote { 431 | padding: 0 1em; 432 | color: #6a737d; 433 | border-left: 0.25em solid #dfe2e5; 434 | } 435 | 436 | .markdown-body blockquote>:first-child { 437 | margin-top: 0; 438 | } 439 | 440 | .markdown-body blockquote>:last-child { 441 | margin-bottom: 0; 442 | } 443 | 444 | .markdown-body kbd { 445 | display: inline-block; 446 | padding: 3px 5px; 447 | font-size: 11px; 448 | line-height: 10px; 449 | color: #444d56; 450 | vertical-align: middle; 451 | background-color: #fafbfc; 452 | border: solid 1px #c6cbd1; 453 | border-bottom-color: #959da5; 454 | border-radius: 3px; 455 | box-shadow: inset 0 -1px 0 #959da5; 456 | } 457 | 458 | .markdown-body h1, 459 | .markdown-body h2, 460 | .markdown-body h3, 461 | .markdown-body h4, 462 | .markdown-body h5, 463 | .markdown-body h6 { 464 | margin-top: 24px; 465 | margin-bottom: 16px; 466 | font-weight: 600; 467 | line-height: 1.25; 468 | } 469 | 470 | .markdown-body h1 .octicon-link, 471 | .markdown-body h2 .octicon-link, 472 | .markdown-body h3 .octicon-link, 473 | .markdown-body h4 .octicon-link, 474 | .markdown-body h5 .octicon-link, 475 | .markdown-body h6 .octicon-link { 476 | color: #1b1f23; 477 | vertical-align: middle; 478 | visibility: hidden; 479 | } 480 | 481 | .markdown-body h1:hover .anchor, 482 | .markdown-body h2:hover .anchor, 483 | .markdown-body h3:hover .anchor, 484 | .markdown-body h4:hover .anchor, 485 | .markdown-body h5:hover .anchor, 486 | .markdown-body h6:hover .anchor { 487 | text-decoration: none; 488 | } 489 | 490 | .markdown-body h1:hover .anchor .octicon-link, 491 | .markdown-body h2:hover .anchor .octicon-link, 492 | .markdown-body h3:hover .anchor .octicon-link, 493 | .markdown-body h4:hover .anchor .octicon-link, 494 | .markdown-body h5:hover .anchor .octicon-link, 495 | .markdown-body h6:hover .anchor .octicon-link { 496 | visibility: visible; 497 | } 498 | 499 | .markdown-body h1 { 500 | padding-bottom: 0.3em; 501 | font-size: 2em; 502 | border-bottom: 1px solid #eaecef; 503 | } 504 | 505 | .markdown-body h2 { 506 | padding-bottom: 0.3em; 507 | font-size: 1.5em; 508 | border-bottom: 1px solid #eaecef; 509 | } 510 | 511 | .markdown-body h3 { 512 | font-size: 1.25em; 513 | } 514 | 515 | .markdown-body h4 { 516 | font-size: 1em; 517 | } 518 | 519 | .markdown-body h5 { 520 | font-size: 0.875em; 521 | } 522 | 523 | .markdown-body h6 { 524 | font-size: 0.85em; 525 | color: #6a737d; 526 | } 527 | 528 | .markdown-body ul, 529 | .markdown-body ol { 530 | padding-left: 2em; 531 | } 532 | 533 | .markdown-body ul ul, 534 | .markdown-body ul ol, 535 | .markdown-body ol ol, 536 | .markdown-body ol ul { 537 | margin-top: 0; 538 | margin-bottom: 0; 539 | } 540 | 541 | .markdown-body li>p { 542 | margin-top: 16px; 543 | } 544 | 545 | .markdown-body li+li { 546 | margin-top: 0.25em; 547 | } 548 | 549 | .markdown-body dl { 550 | padding: 0; 551 | } 552 | 553 | .markdown-body dl dt { 554 | padding: 0; 555 | margin-top: 16px; 556 | font-size: 1em; 557 | font-style: italic; 558 | font-weight: 600; 559 | } 560 | 561 | .markdown-body dl dd { 562 | padding: 0 16px; 563 | margin-bottom: 16px; 564 | } 565 | 566 | .markdown-body table { 567 | display: block; 568 | width: 100%; 569 | overflow: auto; 570 | } 571 | 572 | .markdown-body table th { 573 | font-weight: 600; 574 | } 575 | 576 | .markdown-body table th, 577 | .markdown-body table td { 578 | padding: 6px 13px; 579 | border: 1px solid #dfe2e5; 580 | } 581 | 582 | .markdown-body table tr { 583 | background-color: #fff; 584 | border-top: 1px solid #c6cbd1; 585 | } 586 | 587 | .markdown-body table tr:nth-child(2n) { 588 | background-color: #f6f8fa; 589 | } 590 | 591 | .markdown-body img { 592 | max-width: 100%; 593 | box-sizing: content-box; 594 | background-color: #fff; 595 | } 596 | 597 | .markdown-body code { 598 | padding: 0; 599 | padding-top: 0.2em; 600 | padding-bottom: 0.2em; 601 | margin: 0; 602 | font-size: 85%; 603 | background-color: rgba(27,31,35,0.05); 604 | border-radius: 3px; 605 | } 606 | 607 | .markdown-body code::before, 608 | .markdown-body code::after { 609 | letter-spacing: -0.2em; 610 | content: "\00a0"; 611 | } 612 | 613 | .markdown-body pre { 614 | word-wrap: normal; 615 | } 616 | 617 | .markdown-body pre>code { 618 | padding: 0; 619 | margin: 0; 620 | font-size: 100%; 621 | word-break: normal; 622 | white-space: pre; 623 | background: transparent; 624 | border: 0; 625 | } 626 | 627 | .markdown-body .highlight { 628 | margin-bottom: 16px; 629 | } 630 | 631 | .markdown-body .highlight pre { 632 | margin-bottom: 0; 633 | word-break: normal; 634 | } 635 | 636 | .markdown-body .highlight pre, 637 | .markdown-body pre { 638 | padding: 16px; 639 | overflow: auto; 640 | font-size: 85%; 641 | line-height: 1.45; 642 | background-color: #f6f8fa; 643 | border-radius: 3px; 644 | } 645 | 646 | .markdown-body pre code { 647 | display: inline; 648 | max-width: auto; 649 | padding: 0; 650 | margin: 0; 651 | overflow: visible; 652 | line-height: inherit; 653 | word-wrap: normal; 654 | background-color: transparent; 655 | border: 0; 656 | } 657 | 658 | .markdown-body pre code::before, 659 | .markdown-body pre code::after { 660 | content: normal; 661 | } 662 | 663 | .markdown-body .full-commit .btn-outline:not(:disabled):hover { 664 | color: #005cc5; 665 | border-color: #005cc5; 666 | } 667 | 668 | .markdown-body kbd { 669 | display: inline-block; 670 | padding: 3px 5px; 671 | font: 11px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; 672 | line-height: 10px; 673 | color: #444d56; 674 | vertical-align: middle; 675 | background-color: #fcfcfc; 676 | border: solid 1px #c6cbd1; 677 | border-bottom-color: #959da5; 678 | border-radius: 3px; 679 | box-shadow: inset 0 -1px 0 #959da5; 680 | } 681 | 682 | .markdown-body :checked+.radio-label { 683 | position: relative; 684 | z-index: 1; 685 | border-color: #0366d6; 686 | } 687 | 688 | .markdown-body .task-list-item { 689 | list-style-type: none; 690 | } 691 | 692 | .markdown-body .task-list-item+.task-list-item { 693 | margin-top: 3px; 694 | } 695 | 696 | .markdown-body .task-list-item input { 697 | margin: 0 0.2em 0.25em -1.6em; 698 | vertical-align: middle; 699 | } 700 | 701 | .markdown-body hr { 702 | border-bottom-color: #eee; 703 | } -------------------------------------------------------------------------------- /themes/bw/source/css/prism.styl: -------------------------------------------------------------------------------- 1 | /** 2 | * prism.js default theme for JavaScript, CSS and HTML 3 | * Based on dabblet (http://dabblet.com) 4 | * @author Lea Verou 5 | */ 6 | 7 | code[class*="language-"], 8 | pre[class*="language-"] { 9 | color: black; 10 | background: none; 11 | text-shadow: 0 1px white; 12 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; 13 | text-align: left; 14 | white-space: pre; 15 | word-spacing: normal; 16 | word-break: normal; 17 | word-wrap: normal; 18 | line-height: 1.5; 19 | 20 | -moz-tab-size: 4; 21 | -o-tab-size: 4; 22 | tab-size: 4; 23 | 24 | -webkit-hyphens: none; 25 | -moz-hyphens: none; 26 | -ms-hyphens: none; 27 | hyphens: none; 28 | } 29 | 30 | pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection, 31 | code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection { 32 | text-shadow: none; 33 | background: #b3d4fc; 34 | } 35 | 36 | pre[class*="language-"]::selection, pre[class*="language-"] ::selection, 37 | code[class*="language-"]::selection, code[class*="language-"] ::selection { 38 | text-shadow: none; 39 | background: #b3d4fc; 40 | } 41 | 42 | @media print { 43 | code[class*="language-"], 44 | pre[class*="language-"] { 45 | text-shadow: none; 46 | } 47 | } 48 | 49 | /* Code blocks */ 50 | pre[class*="language-"] { 51 | padding: 1em; 52 | margin: .5em 0; 53 | overflow: auto; 54 | } 55 | 56 | :not(pre) > code[class*="language-"], 57 | pre[class*="language-"] { 58 | background: #f5f2f0; 59 | } 60 | 61 | /* Inline code */ 62 | :not(pre) > code[class*="language-"] { 63 | padding: .1em; 64 | border-radius: .3em; 65 | white-space: normal; 66 | } 67 | 68 | .token.comment, 69 | .token.prolog, 70 | .token.doctype, 71 | .token.cdata { 72 | color: slategray; 73 | } 74 | 75 | .token.punctuation { 76 | color: #999; 77 | } 78 | 79 | .namespace { 80 | opacity: .7; 81 | } 82 | 83 | .token.property, 84 | .token.tag, 85 | .token.boolean, 86 | .token.number, 87 | .token.constant, 88 | .token.symbol, 89 | .token.deleted { 90 | color: #905; 91 | } 92 | 93 | .token.selector, 94 | .token.attr-name, 95 | .token.string, 96 | .token.char, 97 | .token.builtin, 98 | .token.inserted { 99 | color: #690; 100 | } 101 | 102 | .token.operator, 103 | .token.entity, 104 | .token.url, 105 | .language-css .token.string, 106 | .style .token.string { 107 | color: #a67f59; 108 | background: hsla(0, 0%, 100%, .5); 109 | } 110 | 111 | .token.atrule, 112 | .token.attr-value, 113 | .token.keyword { 114 | color: #07a; 115 | } 116 | 117 | .token.function { 118 | color: #DD4A68; 119 | } 120 | 121 | .token.regex, 122 | .token.important, 123 | .token.variable { 124 | color: #e90; 125 | } 126 | 127 | .token.important, 128 | .token.bold { 129 | font-weight: bold; 130 | } 131 | .token.italic { 132 | font-style: italic; 133 | } 134 | 135 | .token.entity { 136 | cursor: help; 137 | } -------------------------------------------------------------------------------- /themes/bw/source/css/responsive.styl: -------------------------------------------------------------------------------- 1 | @media screen and (max-width: 48rem) 2 | body 3 | margin: 5px 4 | padding: 0 5 | .header .header-inner, 6 | nav.nav, 7 | .box .box-heading, 8 | article.article 9 | padding-left: .625rem 10 | padding-right: @padding-left 11 | .alphabet-table .alphabet-item 12 | width: 7.6923076923076925% 13 | -------------------------------------------------------------------------------- /themes/bw/source/js/app.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | !(function () { 3 | const $ = document.querySelector.bind(document) 4 | 5 | document.addEventListener('DOMContentLoaded', function ready() { 6 | autoComplete($('.global-search')) 7 | }) 8 | 9 | function autoComplete(el) { 10 | 11 | } 12 | })(); 13 | -------------------------------------------------------------------------------- /themes/bw/source/js/post.js: -------------------------------------------------------------------------------- 1 | hljs.initHighlightingOnLoad(); 2 | -------------------------------------------------------------------------------- /themes/landscape/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | tmp -------------------------------------------------------------------------------- /themes/landscape/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt){ 2 | grunt.initConfig({ 3 | gitclone: { 4 | fontawesome: { 5 | options: { 6 | repository: 'https://github.com/FortAwesome/Font-Awesome.git', 7 | directory: 'tmp/fontawesome' 8 | }, 9 | }, 10 | fancybox: { 11 | options: { 12 | repository: 'https://github.com/fancyapps/fancyBox.git', 13 | directory: 'tmp/fancybox' 14 | } 15 | } 16 | }, 17 | copy: { 18 | fontawesome: { 19 | expand: true, 20 | cwd: 'tmp/fontawesome/fonts/', 21 | src: ['**'], 22 | dest: 'source/css/fonts/' 23 | }, 24 | fancybox: { 25 | expand: true, 26 | cwd: 'tmp/fancybox/source/', 27 | src: ['**'], 28 | dest: 'source/fancybox/' 29 | } 30 | }, 31 | _clean: { 32 | tmp: ['tmp'], 33 | fontawesome: ['source/css/fonts'], 34 | fancybox: ['source/fancybox'] 35 | } 36 | }); 37 | 38 | require('load-grunt-tasks')(grunt); 39 | 40 | grunt.renameTask('clean', '_clean'); 41 | 42 | grunt.registerTask('fontawesome', ['gitclone:fontawesome', 'copy:fontawesome', '_clean:tmp']); 43 | grunt.registerTask('fancybox', ['gitclone:fancybox', 'copy:fancybox', '_clean:tmp']); 44 | grunt.registerTask('default', ['gitclone', 'copy', '_clean:tmp']); 45 | grunt.registerTask('clean', ['_clean']); 46 | }; -------------------------------------------------------------------------------- /themes/landscape/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Tommy Chen 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /themes/landscape/README.md: -------------------------------------------------------------------------------- 1 | # Landscape 2 | 3 | A brand new default theme for [Hexo]. 4 | 5 | - [Preview](http://hexo.io/hexo-theme-landscape/) 6 | 7 | ## Installation 8 | 9 | ### Install 10 | 11 | ``` bash 12 | $ git clone https://github.com/hexojs/hexo-theme-landscape.git themes/landscape 13 | ``` 14 | 15 | **Landscape requires Hexo 2.4 and above.** 16 | 17 | ### Enable 18 | 19 | Modify `theme` setting in `_config.yml` to `landscape`. 20 | 21 | ### Update 22 | 23 | ``` bash 24 | cd themes/landscape 25 | git pull 26 | ``` 27 | 28 | ## Configuration 29 | 30 | ``` yml 31 | # Header 32 | menu: 33 | Home: / 34 | Archives: /archives 35 | rss: /atom.xml 36 | 37 | # Content 38 | excerpt_link: Read More 39 | fancybox: true 40 | 41 | # Sidebar 42 | sidebar: right 43 | widgets: 44 | - category 45 | - tag 46 | - tagcloud 47 | - archives 48 | - recent_posts 49 | 50 | # Miscellaneous 51 | google_analytics: 52 | favicon: /favicon.png 53 | twitter: 54 | google_plus: 55 | ``` 56 | 57 | - **menu** - Navigation menu 58 | - **rss** - RSS link 59 | - **excerpt_link** - "Read More" link at the bottom of excerpted articles. `false` to hide the link. 60 | - **fancybox** - Enable [Fancybox] 61 | - **sidebar** - Sidebar style. You can choose `left`, `right`, `bottom` or `false`. 62 | - **widgets** - Widgets displaying in sidebar 63 | - **google_analytics** - Google Analytics ID 64 | - **favicon** - Favicon path 65 | - **twitter** - Twiiter ID 66 | - **google_plus** - Google+ ID 67 | 68 | ## Features 69 | 70 | ### Fancybox 71 | 72 | Landscape uses [Fancybox] to showcase your photos. You can use Markdown syntax or fancybox tag plugin to add your photos. 73 | 74 | ``` 75 | ![img caption](img url) 76 | 77 | {% fancybox img_url [img_thumbnail] [img_caption] %} 78 | ``` 79 | 80 | ### Sidebar 81 | 82 | You can put your sidebar in left side, right side or bottom of your site by editing `sidebar` setting. 83 | 84 | Landscape provides 5 built-in widgets: 85 | 86 | - category 87 | - tag 88 | - tagcloud 89 | - archives 90 | - recent_posts 91 | 92 | All of them are enabled by default. You can edit them in `widget` setting. 93 | 94 | ## Development 95 | 96 | ### Requirements 97 | 98 | - [Grunt] 0.4+ 99 | - Hexo 2.4+ 100 | 101 | ### Grunt tasks 102 | 103 | - **default** - Download [Fancybox] and [Font Awesome]. 104 | - **fontawesome** - Only download [Font Awesome]. 105 | - **fancybox** - Only download [Fancybox]. 106 | - **clean** - Clean temporarily files and downloaded files. 107 | 108 | [Hexo]: http://zespia.tw/hexo/ 109 | [Fancybox]: http://fancyapps.com/fancybox/ 110 | [Font Awesome]: http://fontawesome.io/ 111 | [Grunt]: http://gruntjs.com/ 112 | -------------------------------------------------------------------------------- /themes/landscape/_config.yml: -------------------------------------------------------------------------------- 1 | # Header 2 | menu: 3 | Home: / 4 | Archives: /archives 5 | rss: /atom.xml 6 | 7 | # Content 8 | excerpt_link: Read More 9 | fancybox: true 10 | 11 | # Sidebar 12 | sidebar: right 13 | widgets: 14 | - category 15 | - tag 16 | - tagcloud 17 | - archive 18 | - recent_posts 19 | 20 | # display widgets at the bottom of index pages (pagination == 2) 21 | index_widgets: 22 | # - category 23 | # - tagcloud 24 | # - archive 25 | 26 | # widget behavior 27 | archive_type: 'monthly' 28 | show_count: false 29 | 30 | # Miscellaneous 31 | google_analytics: 32 | favicon: /favicon.png 33 | twitter: 34 | google_plus: 35 | fb_admins: 36 | fb_app_id: 37 | -------------------------------------------------------------------------------- /themes/landscape/languages/default.yml: -------------------------------------------------------------------------------- 1 | categories: Categories 2 | search: Search 3 | tags: Tags 4 | tagcloud: Tag Cloud 5 | tweets: Tweets 6 | prev: Prev 7 | next: Next 8 | comment: Comments 9 | archive_a: Archives 10 | archive_b: "Archives: %s" 11 | page: Page %d 12 | recent_posts: Recent Posts 13 | newer: Newer 14 | older: Older 15 | share: Share 16 | powered_by: Powered by 17 | rss_feed: RSS Feed 18 | category: Category 19 | tag: Tag -------------------------------------------------------------------------------- /themes/landscape/languages/fr.yml: -------------------------------------------------------------------------------- 1 | categories: Catégories 2 | search: Rechercher 3 | tags: Mot-clés 4 | tagcloud: Nuage de mot-clés 5 | tweets: Tweets 6 | prev: Précédent 7 | next: Suivant 8 | comment: Commentaires 9 | archive_a: Archives 10 | archive_b: "Archives: %s" 11 | page: Page %d 12 | recent_posts: Articles récents 13 | newer: Récent 14 | older: Ancien 15 | share: Partager 16 | powered_by: Propulsé by 17 | rss_feed: Flux RSS 18 | category: Catégorie 19 | tag: Mot-clé 20 | -------------------------------------------------------------------------------- /themes/landscape/languages/nl.yml: -------------------------------------------------------------------------------- 1 | 2 | categories: Categorieën 3 | search: Zoeken 4 | tags: Labels 5 | tagcloud: Tag Cloud 6 | tweets: Tweets 7 | prev: Vorige 8 | next: Volgende 9 | comment: Commentaren 10 | archive_a: Archieven 11 | archive_b: "Archieven: %s" 12 | page: Pagina %d 13 | recent_posts: Recente berichten 14 | newer: Nieuwer 15 | older: Ouder 16 | share: Delen 17 | powered_by: Powered by 18 | rss_feed: RSS Feed 19 | category: Categorie 20 | tag: Label 21 | -------------------------------------------------------------------------------- /themes/landscape/languages/no.yml: -------------------------------------------------------------------------------- 1 | categories: Kategorier 2 | search: Søk 3 | tags: Tags 4 | tagcloud: Tag Cloud 5 | tweets: Tweets 6 | prev: Forrige 7 | next: Neste 8 | comment: Kommentarer 9 | archive_a: Arkiv 10 | archive_b: "Arkiv: %s" 11 | page: Side %d 12 | recent_posts: Siste innlegg 13 | newer: Newer 14 | older: Older 15 | share: Share 16 | powered_by: Powered by 17 | rss_feed: RSS Feed 18 | category: Category 19 | tag: Tag -------------------------------------------------------------------------------- /themes/landscape/languages/ru.yml: -------------------------------------------------------------------------------- 1 | categories: Категории 2 | search: Поиск 3 | tags: Метки 4 | tagcloud: Облако меток 5 | tweets: Твиты 6 | prev: Назад 7 | next: Вперед 8 | comment: Комментарии 9 | archive_a: Архив 10 | archive_b: "Архив: %s" 11 | page: Страница %d 12 | recent_posts: Недавние записи 13 | newer: Следующий 14 | older: Предыдущий 15 | share: Поделиться 16 | powered_by: Создано с помощью 17 | rss_feed: RSS-каналы 18 | category: Категория 19 | tag: Метка -------------------------------------------------------------------------------- /themes/landscape/languages/zh-CN.yml: -------------------------------------------------------------------------------- 1 | categories: 分类 2 | search: 搜索 3 | tags: 标签 4 | tagcloud: 标签云 5 | tweets: 推文 6 | prev: 上一页 7 | next: 下一页 8 | comment: 留言 9 | archive_a: 归档 10 | archive_b: 归档:%s 11 | page: 第 %d 页 12 | recent_posts: 最新文章 13 | newer: Newer 14 | older: Older 15 | share: Share 16 | powered_by: Powered by 17 | rss_feed: RSS Feed 18 | category: Category 19 | tag: Tag -------------------------------------------------------------------------------- /themes/landscape/languages/zh-TW.yml: -------------------------------------------------------------------------------- 1 | categories: 分類 2 | search: 搜尋 3 | tags: 標籤 4 | tagcloud: 標籤雲 5 | tweets: 推文 6 | prev: 上一頁 7 | next: 下一頁 8 | comment: 留言 9 | archive_a: 彙整 10 | archive_b: 彙整:%s 11 | page: 第 %d 頁 12 | recent_posts: 最新文章 13 | newer: Newer 14 | older: Older 15 | share: Share 16 | powered_by: Powered by 17 | rss_feed: RSS Feed 18 | category: Category 19 | tag: Tag -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/after-footer.ejs: -------------------------------------------------------------------------------- 1 | <% if (config.disqus_shortname){ %> 2 | 15 | <% } %> 16 | 17 | 18 | 19 | <% if (theme.fancybox){ %> 20 | <%- css('fancybox/jquery.fancybox') %> 21 | <%- js('fancybox/jquery.fancybox.pack') %> 22 | <% } %> 23 | 24 | <%- js('js/script') %> 25 | -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/archive-post.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | <%- partial('post/date', {class_name: 'archive-article-date', date_format: 'MMM D'}) %> 5 | <%- partial('post/title', {class_name: 'archive-article-title'}) %> 6 |
7 |
8 |
-------------------------------------------------------------------------------- /themes/landscape/layout/_partial/archive.ejs: -------------------------------------------------------------------------------- 1 | <% if (pagination == 2){ %> 2 | <% page.posts.each(function(post){ %> 3 | <%- partial('article', {post: post, index: true}) %> 4 | <% }) %> 5 | <% } else { %> 6 | <% var last; %> 7 | <% page.posts.each(function(post, i){ %> 8 | <% var year = post.date.year(); %> 9 | <% if (last != year){ %> 10 | <% if (last != null){ %> 11 | 12 | <% } %> 13 | <% last = year; %> 14 |
15 |
16 | <%= year %> 17 |
18 |
19 | <% } %> 20 | <%- partial('archive-post', {post: post, even: i % 2 == 0}) %> 21 | <% }) %> 22 | <% if (page.posts.length){ %> 23 |
24 | <% } %> 25 | <% } %> 26 | <% if (page.total > 1){ %> 27 | 33 | <% } %> -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/article.ejs: -------------------------------------------------------------------------------- 1 |
2 |
3 | <%- partial('post/date', {class_name: 'article-date', date_format: null}) %> 4 | <%- partial('post/category') %> 5 |
6 |
7 | <%- partial('post/gallery') %> 8 | <% if (post.link || post.title){ %> 9 |
10 | <%- partial('post/title', {class_name: 'article-title'}) %> 11 |
12 | <% } %> 13 |
14 | <% if (post.excerpt && index){ %> 15 | <%- post.excerpt %> 16 | <% if (theme.excerpt_link){ %> 17 |

18 | <%= theme.excerpt_link %> 19 |

20 | <% } %> 21 | <% } else { %> 22 | <%- post.content %> 23 | <% } %> 24 |
25 | 32 |
33 | <% if (!index){ %> 34 | <%- partial('post/nav') %> 35 | <% } %> 36 |
37 | 38 | <% if (!index && post.comments && config.disqus_shortname){ %> 39 |
40 |
41 | 42 |
43 |
44 | <% } %> -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/footer.ejs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/google-analytics.ejs: -------------------------------------------------------------------------------- 1 | <% if (theme.google_analytics){ %> 2 | 3 | 13 | 14 | <% } %> 15 | -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/head.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <% 6 | var title = page.title; 7 | 8 | if (is_archive()){ 9 | title = __('archive_a'); 10 | 11 | if (is_month()){ 12 | title += ': ' + page.year + '/' + page.month; 13 | } else if (is_year()){ 14 | title += ': ' + page.year; 15 | } 16 | } else if (is_category()){ 17 | title = __('category') + ': ' + page.category; 18 | } else if (is_tag()){ 19 | title = __('tag') + ': ' + page.tag; 20 | } 21 | %> 22 | <% if (title){ %><%= title %> | <% } %><%= config.title %> 23 | 24 | <%- open_graph({twitter_id: theme.twitter, google_plus: theme.google_plus, fb_admins: theme.fb_admins, fb_app_id: theme.fb_app_id}) %> 25 | <% if (theme.rss){ %> 26 | 27 | <% } %> 28 | <% if (theme.favicon){ %> 29 | 30 | <% } %> 31 | <% if (config.highlight.enable){ %> 32 | 33 | <% } %> 34 | <%- css('css/style') %> 35 | <%- partial('google-analytics') %> 36 | 37 | -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/header.ejs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/mobile-nav.ejs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/post/category.ejs: -------------------------------------------------------------------------------- 1 | <% if (post.categories && post.categories.length){ %> 2 |
3 | <%- list_categories(post.categories, { 4 | show_count: false, 5 | class: 'article-category', 6 | style: 'none', 7 | separator: '►' 8 | }) %> 9 |
10 | <% } %> -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/post/date.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/post/gallery.ejs: -------------------------------------------------------------------------------- 1 | <% if (post.photos && post.photos.length){ %> 2 |
3 |
4 | <% post.photos.forEach(function(photo, i){ %> 5 | 6 | 7 | 8 | <% }) %> 9 |
10 |
11 | <% } %> -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/post/nav.ejs: -------------------------------------------------------------------------------- 1 | <% if (post.prev || post.next){ %> 2 | 22 | <% } %> -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/post/tag.ejs: -------------------------------------------------------------------------------- 1 | <% if (post.tags && post.tags.length){ %> 2 | <%- list_tags(post.tags, { 3 | show_count: false, 4 | class: 'article-tag' 5 | }) %> 6 | <% } %> -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/post/title.ejs: -------------------------------------------------------------------------------- 1 | <% if (post.link){ %> 2 |

3 | 4 |

5 | <% } else if (post.title){ %> 6 | <% if (index){ %> 7 |

8 | <%= post.title %> 9 |

10 | <% } else { %> 11 |

12 | <%= post.title %> 13 |

14 | <% } %> 15 | <% } %> -------------------------------------------------------------------------------- /themes/landscape/layout/_partial/sidebar.ejs: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /themes/landscape/layout/_widget/archive.ejs: -------------------------------------------------------------------------------- 1 | <% if (site.posts.length){ %> 2 |
3 |

<%= __('archive_a') %>

4 |
5 | <%- list_archives({show_count: theme.show_count, type: theme.archive_type}) %> 6 |
7 |
8 | <% } %> 9 | -------------------------------------------------------------------------------- /themes/landscape/layout/_widget/category.ejs: -------------------------------------------------------------------------------- 1 | <% if (site.categories.length){ %> 2 |
3 |

<%= __('categories') %>

4 |
5 | <%- list_categories({show_count: theme.show_count}) %> 6 |
7 |
8 | <% } %> 9 | -------------------------------------------------------------------------------- /themes/landscape/layout/_widget/recent_posts.ejs: -------------------------------------------------------------------------------- 1 | <% if (site.posts.length){ %> 2 |
3 |

<%= __('recent_posts') %>

4 |
5 | 12 |
13 |
14 | <% } %> -------------------------------------------------------------------------------- /themes/landscape/layout/_widget/tag.ejs: -------------------------------------------------------------------------------- 1 | <% if (site.tags.length){ %> 2 |
3 |

<%= __('tags') %>

4 |
5 | <%- list_tags({show_count: theme.show_count}) %> 6 |
7 |
8 | <% } %> 9 | -------------------------------------------------------------------------------- /themes/landscape/layout/_widget/tagcloud.ejs: -------------------------------------------------------------------------------- 1 | <% if (site.tags.length){ %> 2 |
3 |

<%= __('tagcloud') %>

4 |
5 | <%- tagcloud() %> 6 |
7 |
8 | <% } %> -------------------------------------------------------------------------------- /themes/landscape/layout/archive.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_partial/archive', {pagination: config.archive, index: true}) %> -------------------------------------------------------------------------------- /themes/landscape/layout/category.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_partial/archive', {pagination: config.category, index: true}) %> -------------------------------------------------------------------------------- /themes/landscape/layout/index.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_partial/archive', {pagination: 2, index: true}) %> -------------------------------------------------------------------------------- /themes/landscape/layout/layout.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_partial/head') %> 2 | 3 |
4 |
5 | <%- partial('_partial/header', null, {cache: !config.relative_link}) %> 6 |
7 |
<%- body %>
8 | <% if (theme.sidebar && theme.sidebar !== 'bottom'){ %> 9 | <%- partial('_partial/sidebar', null, {cache: !config.relative_link}) %> 10 | <% } %> 11 |
12 | <%- partial('_partial/footer', null, {cache: !config.relative_link}) %> 13 |
14 | <%- partial('_partial/mobile-nav', null, {cache: !config.relative_link}) %> 15 | <%- partial('_partial/after-footer') %> 16 |
17 | 18 | -------------------------------------------------------------------------------- /themes/landscape/layout/page.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_partial/article', {post: page, index: false}) %> -------------------------------------------------------------------------------- /themes/landscape/layout/post.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_partial/article', {post: page, index: false}) %> -------------------------------------------------------------------------------- /themes/landscape/layout/tag.ejs: -------------------------------------------------------------------------------- 1 | <%- partial('_partial/archive', {pagination: config.tag, index: true}) %> -------------------------------------------------------------------------------- /themes/landscape/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hexo-theme-landscape", 3 | "version": "0.0.1", 4 | "private": true, 5 | "devDependencies": { 6 | "grunt": "~0.4.2", 7 | "load-grunt-tasks": "~0.2.0", 8 | "grunt-git": "~0.2.2", 9 | "grunt-contrib-clean": "~0.5.0", 10 | "grunt-contrib-copy": "~0.4.1" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /themes/landscape/scripts/fancybox.js: -------------------------------------------------------------------------------- 1 | var rUrl = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[.\!\/\\w]*))?)/; 2 | 3 | /** 4 | * Fancybox tag 5 | * 6 | * Syntax: 7 | * {% fancybox /path/to/image [/path/to/thumbnail] [title] %} 8 | */ 9 | 10 | hexo.extend.tag.register('fancybox', function(args){ 11 | var original = args.shift(), 12 | thumbnail = ''; 13 | 14 | if (args.length && rUrl.test(args[0])){ 15 | thumbnail = args.shift(); 16 | } 17 | 18 | var title = args.join(' '); 19 | 20 | return '' + 21 | '' + title + '' 22 | '' + 23 | (title ? '' + title + '' : ''); 24 | }); -------------------------------------------------------------------------------- /themes/landscape/source/css/_extend.styl: -------------------------------------------------------------------------------- 1 | $block-caption 2 | text-decoration: none 3 | text-transform: uppercase 4 | letter-spacing: 2px 5 | color: color-grey 6 | margin-bottom: 1em 7 | margin-left: 5px 8 | line-height: 1em 9 | text-shadow: 0 1px #fff 10 | font-weight: bold 11 | 12 | $block 13 | background: #fff 14 | box-shadow: 1px 2px 3px #ddd 15 | border: 1px solid color-border 16 | border-radius: 3px 17 | 18 | $base-style 19 | h1 20 | font-size: 2em 21 | h2 22 | font-size: 1.5em 23 | h3 24 | font-size: 1.3em 25 | h4 26 | font-size: 1.2em 27 | h5 28 | font-size: 1em 29 | h6 30 | font-size: 1em 31 | color: color-grey 32 | hr 33 | border: 1px dashed color-border 34 | strong 35 | font-weight: bold 36 | em, cite 37 | font-style: italic 38 | sup, sub 39 | font-size: 0.75em 40 | line-height: 0 41 | position: relative 42 | vertical-align: baseline 43 | sup 44 | top: -0.5em 45 | sub 46 | bottom: -0.2em 47 | small 48 | font-size: 0.85em 49 | acronym, abbr 50 | border-bottom: 1px dotted 51 | ul, ol, dl 52 | margin: 0 20px 53 | line-height: line-height 54 | ul, ol 55 | ul, ol 56 | margin-top: 0 57 | margin-bottom: 0 58 | ul 59 | list-style: disc 60 | ol 61 | list-style: decimal 62 | dt 63 | font-weight: bold -------------------------------------------------------------------------------- /themes/landscape/source/css/_partial/archive.styl: -------------------------------------------------------------------------------- 1 | .archives-wrap 2 | margin: block-margin 0 3 | 4 | .archives 5 | clearfix() 6 | 7 | .archive-year-wrap 8 | margin-bottom: 1em 9 | 10 | .archive-year 11 | @extend $block-caption 12 | 13 | .archives 14 | column-gap: 10px 15 | @media mq-tablet 16 | column-count: 2 17 | @media mq-normal 18 | column-count: 3 19 | 20 | .archive-article 21 | avoid-column-break() 22 | 23 | .archive-article-inner 24 | @extend $block 25 | padding: 10px 26 | margin-bottom: 15px 27 | 28 | .archive-article-title 29 | text-decoration: none 30 | font-weight: bold 31 | color: color-default 32 | transition: color 0.2s 33 | line-height: line-height 34 | &:hover 35 | color: color-link 36 | 37 | .archive-article-footer 38 | margin-top: 1em 39 | 40 | .archive-article-date 41 | color: color-grey 42 | text-decoration: none 43 | font-size: 0.85em 44 | line-height: 1em 45 | margin-bottom: 0.5em 46 | display: block 47 | 48 | #page-nav 49 | clearfix() 50 | margin: block-margin auto 51 | background: #fff 52 | box-shadow: 1px 2px 3px #ddd 53 | border: 1px solid color-border 54 | border-radius: 3px 55 | text-align: center 56 | color: color-grey 57 | overflow: hidden 58 | a, span 59 | padding: 10px 20px 60 | line-height: 1 61 | height: 2ex 62 | a 63 | color: color-grey 64 | text-decoration: none 65 | &:hover 66 | background: color-grey 67 | color: #fff 68 | .prev 69 | float: left 70 | .next 71 | float: right 72 | .page-number 73 | display: inline-block 74 | @media mq-mobile 75 | display: none 76 | .current 77 | color: color-default 78 | font-weight: bold 79 | .space 80 | color: color-border -------------------------------------------------------------------------------- /themes/landscape/source/css/_partial/article.styl: -------------------------------------------------------------------------------- 1 | .article 2 | margin: block-margin 0 3 | 4 | .article-inner 5 | @extend $block 6 | overflow: hidden 7 | 8 | .article-meta 9 | clearfix() 10 | 11 | .article-date 12 | @extend $block-caption 13 | float: left 14 | 15 | .article-category 16 | float: left 17 | line-height: 1em 18 | color: #ccc 19 | text-shadow: 0 1px #fff 20 | margin-left: 8px 21 | &:before 22 | content: "\2022" 23 | 24 | .article-category-link 25 | @extend $block-caption 26 | margin: 0 12px 1em 27 | 28 | .article-header 29 | padding: article-padding article-padding 0 30 | 31 | .article-title 32 | text-decoration: none 33 | font-size: 2em 34 | font-weight: bold 35 | color: color-default 36 | line-height: line-height-title 37 | transition: color 0.2s 38 | a&:hover 39 | color: color-link 40 | 41 | .article-entry 42 | @extend $base-style 43 | clearfix() 44 | color: color-default 45 | padding: 0 article-padding 46 | p, table 47 | line-height: line-height 48 | margin: line-height 0 49 | h1, h2, h3, h4, h5, h6 50 | font-weight: bold 51 | h1, h2, h3, h4, h5, h6 52 | line-height: line-height-title 53 | margin: line-height-title 0 54 | a 55 | color: color-link 56 | text-decoration: none 57 | &:hover 58 | text-decoration: underline 59 | ul, ol, dl 60 | margin-top: line-height 61 | margin-bottom: line-height 62 | img, video 63 | max-width: 100% 64 | height: auto 65 | display: block 66 | margin: auto 67 | iframe 68 | border: none 69 | table 70 | width: 100% 71 | border-collapse: collapse 72 | border-spacing: 0 73 | th 74 | font-weight: bold 75 | border-bottom: 3px solid color-border 76 | padding-bottom: 0.5em 77 | td 78 | border-bottom: 1px solid color-border 79 | padding: 10px 0 80 | blockquote 81 | font-family: font-serif 82 | font-size: 1.4em 83 | margin: line-height 20px 84 | text-align: center 85 | footer 86 | font-size: font-size 87 | margin: line-height 0 88 | font-family: font-sans 89 | cite 90 | &:before 91 | content: "—" 92 | padding: 0 0.5em 93 | .pullquote 94 | text-align: left 95 | width: 45% 96 | margin: 0 97 | &.left 98 | margin-left: 0.5em 99 | margin-right: 1em 100 | &.right 101 | margin-right: 0.5em 102 | margin-left: 1em 103 | .caption 104 | color: color-grey 105 | display: block 106 | font-size: 0.9em 107 | margin-top: 0.5em 108 | position: relative 109 | text-align: center 110 | // http://webdesignerwall.com/tutorials/css-elastic-videos 111 | .video-container 112 | position: relative 113 | padding-top: (9 / 16 * 100)% // 16:9 ratio 114 | height: 0 115 | overflow: hidden 116 | iframe, object, embed 117 | position: absolute 118 | top: 0 119 | left: 0 120 | width: 100% 121 | height: 100% 122 | margin-top: 0 123 | 124 | .article-more-link a 125 | display: inline-block 126 | line-height: 1em 127 | padding: 6px 15px 128 | border-radius: 15px 129 | background: color-background 130 | color: color-grey 131 | text-shadow: 0 1px #fff 132 | text-decoration: none 133 | &:hover 134 | background: color-link 135 | color: #fff 136 | text-decoration: none 137 | text-shadow: 0 1px darken(color-link, 20%) 138 | 139 | .article-footer 140 | clearfix() 141 | font-size: 0.85em 142 | line-height: line-height 143 | border-top: 1px solid color-border 144 | padding-top: line-height 145 | margin: 0 article-padding article-padding 146 | a 147 | color: color-grey 148 | text-decoration: none 149 | &:hover 150 | color: color-default 151 | 152 | .article-tag-list-item 153 | float: left 154 | margin-right: 10px 155 | 156 | .article-tag-list-link 157 | &:before 158 | content: "#" 159 | 160 | .article-comment-link 161 | float: right 162 | &:before 163 | content: "\f075" 164 | font-family: font-icon 165 | padding-right: 8px 166 | 167 | .article-share-link 168 | cursor: pointer 169 | float: right 170 | margin-left: 20px 171 | &:before 172 | content: "\f064" 173 | font-family: font-icon 174 | padding-right: 6px 175 | 176 | #article-nav 177 | clearfix() 178 | position: relative 179 | @media mq-normal 180 | margin: block-margin 0 181 | &:before 182 | absolute-center(8px) 183 | content: "" 184 | border-radius: 50% 185 | background: color-border 186 | box-shadow: 0 1px 2px #fff 187 | 188 | .article-nav-link-wrap 189 | text-decoration: none 190 | text-shadow: 0 1px #fff 191 | color: color-grey 192 | box-sizing: border-box 193 | margin-top: block-margin 194 | text-align: center 195 | display: block 196 | &:hover 197 | color: color-default 198 | @media mq-normal 199 | width: 50% 200 | margin-top: 0 201 | 202 | #article-nav-newer 203 | @media mq-normal 204 | float: left 205 | text-align: right 206 | padding-right: 20px 207 | 208 | #article-nav-older 209 | @media mq-normal 210 | float: right 211 | text-align: left 212 | padding-left: 20px 213 | 214 | .article-nav-caption 215 | text-transform: uppercase 216 | letter-spacing: 2px 217 | color: color-border 218 | line-height: 1em 219 | font-weight: bold 220 | #article-nav-newer & 221 | margin-right: -2px 222 | 223 | .article-nav-title 224 | font-size: 0.85em 225 | line-height: line-height 226 | margin-top: 0.5em 227 | 228 | .article-share-box 229 | position: absolute 230 | display: none 231 | background: #fff 232 | box-shadow: 1px 2px 10px rgba(0, 0, 0, 0.2) 233 | border-radius: 3px 234 | margin-left: -145px 235 | overflow: hidden 236 | z-index: 1 237 | &.on 238 | display: block 239 | 240 | .article-share-input 241 | width: 100% 242 | background: none 243 | box-sizing: border-box 244 | font: 14px font-sans 245 | padding: 0 15px 246 | color: color-default 247 | outline: none 248 | border: 1px solid color-border 249 | border-radius: 3px 3px 0 0 250 | height: 36px 251 | line-height: 36px 252 | 253 | .article-share-links 254 | clearfix() 255 | background: color-background 256 | 257 | $article-share-link 258 | width: 50px 259 | height: 36px 260 | display: block 261 | float: left 262 | position: relative 263 | color: #999 264 | text-shadow: 0 1px #fff 265 | &:before 266 | font-size: 20px 267 | font-family: font-icon 268 | absolute-center(@font-size) 269 | text-align: center 270 | &:hover 271 | color: #fff 272 | 273 | .article-share-twitter 274 | @extend $article-share-link 275 | &:before 276 | content: "\f099" 277 | &:hover 278 | background: color-twitter 279 | text-shadow: 0 1px darken(color-twitter, 20%) 280 | 281 | .article-share-facebook 282 | @extend $article-share-link 283 | &:before 284 | content: "\f09a" 285 | &:hover 286 | background: color-facebook 287 | text-shadow: 0 1px darken(color-facebook, 20%) 288 | 289 | .article-share-pinterest 290 | @extend $article-share-link 291 | &:before 292 | content: "\f0d2" 293 | &:hover 294 | background: color-pinterest 295 | text-shadow: 0 1px darken(color-pinterest, 20%) 296 | 297 | .article-share-google 298 | @extend $article-share-link 299 | &:before 300 | content: "\f0d5" 301 | &:hover 302 | background: color-google 303 | text-shadow: 0 1px darken(color-google, 20%) 304 | 305 | .article-gallery 306 | background: #000 307 | position: relative 308 | 309 | .article-gallery-photos 310 | position: relative 311 | overflow: hidden 312 | 313 | .article-gallery-img 314 | display: none 315 | max-width: 100% 316 | &:first-child 317 | display: block 318 | &.loaded 319 | position: absolute 320 | display: block 321 | img 322 | display: block 323 | max-width: 100% 324 | margin: 0 auto 325 | /* 326 | $article-gallery-ctrl 327 | position: absolute 328 | top: 0 329 | height: 100% 330 | width: 60px 331 | color: #fff 332 | text-shadow: 0 0 3px rgba(0, 0, 0, 0.3) 333 | opacity: 0.3 334 | transition: opacity 0.2s 335 | cursor: pointer 336 | &:hover 337 | opacity: 0.8 338 | &:before 339 | font-size: 30px 340 | font-family: font-icon 341 | position: absolute 342 | top: 50% 343 | margin-top: @font-size * -0.5 344 | 345 | .article-gallery-prev 346 | @extend $article-gallery-ctrl 347 | left: 0 348 | &:before 349 | content: "\f053" 350 | left: 15px 351 | 352 | .article-gallery-next 353 | @extend $article-gallery-ctrl 354 | right: 0 355 | &:before 356 | content: "\f054" 357 | right: 15px*/ -------------------------------------------------------------------------------- /themes/landscape/source/css/_partial/comment.styl: -------------------------------------------------------------------------------- 1 | #comments 2 | background: #fff 3 | box-shadow: 1px 2px 3px #ddd 4 | padding: article-padding 5 | border: 1px solid color-border 6 | border-radius: 3px 7 | margin: block-margin 0 8 | a 9 | color: color-link -------------------------------------------------------------------------------- /themes/landscape/source/css/_partial/footer.styl: -------------------------------------------------------------------------------- 1 | #footer 2 | background: color-footer-background 3 | padding: 50px 0 4 | border-top: 1px solid color-border 5 | color: color-grey 6 | a 7 | color: color-link 8 | text-decoration: none 9 | &:hover 10 | text-decoration: underline 11 | 12 | #footer-info 13 | line-height: line-height 14 | font-size: 0.85em -------------------------------------------------------------------------------- /themes/landscape/source/css/_partial/header.styl: -------------------------------------------------------------------------------- 1 | #header 2 | height: banner-height 3 | position: relative 4 | border-bottom: 1px solid color-border 5 | &:before, &:after 6 | content: "" 7 | position: absolute 8 | left: 0 9 | right: 0 10 | height: 40px 11 | &:before 12 | top: 0 13 | background: linear-gradient(rgba(0, 0, 0, 0.2), transparent) 14 | &:after 15 | bottom: 0 16 | background: linear-gradient(transparent, rgba(0, 0, 0, 0.2)) 17 | 18 | #header-outer 19 | height: 100% 20 | position: relative 21 | 22 | #header-inner 23 | position: relative 24 | overflow: hidden 25 | 26 | #banner 27 | position: absolute 28 | top: 0 29 | left: 0 30 | width: 100% 31 | height: 100% 32 | background: url(banner-url) center #000 33 | background-size: cover 34 | z-index: -1 35 | 36 | #header-title 37 | text-align: center 38 | height: logo-size 39 | position: absolute 40 | top: 50% 41 | left: 0 42 | margin-top: logo-size * -0.5 43 | 44 | $logo-text 45 | text-decoration: none 46 | color: #fff 47 | font-weight: 300 48 | text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) 49 | 50 | #logo 51 | @extend $logo-text 52 | font-size: logo-size 53 | line-height: logo-size 54 | letter-spacing: 2px 55 | 56 | #subtitle 57 | @extend $logo-text 58 | font-size: subtitle-size 59 | line-height: subtitle-size 60 | letter-spacing: 1px 61 | 62 | #subtitle-wrap 63 | margin-top: subtitle-size 64 | 65 | #main-nav 66 | float: left 67 | margin-left: -15px 68 | 69 | $nav-link 70 | float: left 71 | color: #fff 72 | opacity: 0.6 73 | text-decoration: none 74 | text-shadow: 0 1px rgba(0, 0, 0, 0.2) 75 | transition: opacity 0.2s 76 | display: block 77 | padding: 20px 15px 78 | &:hover 79 | opacity: 1 80 | 81 | .nav-icon 82 | @extend $nav-link 83 | font-family: font-icon 84 | text-align: center 85 | font-size: font-size 86 | width: font-size 87 | height: font-size 88 | padding: 20px 15px 89 | position: relative 90 | cursor: pointer 91 | 92 | .main-nav-link 93 | @extend $nav-link 94 | font-weight: 300 95 | letter-spacing: 1px 96 | @media mq-mobile 97 | display: none 98 | 99 | #main-nav-toggle 100 | display: none 101 | &:before 102 | content: "\f0c9" 103 | @media mq-mobile 104 | display: block 105 | 106 | #sub-nav 107 | float: right 108 | margin-right: -15px 109 | 110 | #nav-rss-link 111 | &:before 112 | content: "\f09e" 113 | 114 | #nav-search-btn 115 | &:before 116 | content: "\f002" 117 | 118 | #search-form-wrap 119 | position: absolute 120 | top: 15px 121 | width: 150px 122 | height: 30px 123 | right: -150px 124 | opacity: 0 125 | transition: 0.2s ease-out 126 | &.on 127 | opacity: 1 128 | right: 0 129 | @media mq-mobile 130 | width: 100% 131 | right: -100% 132 | 133 | .search-form 134 | position: absolute 135 | top: 0 136 | left: 0 137 | right: 0 138 | background: #fff 139 | padding: 5px 15px 140 | border-radius: 15px 141 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.3) 142 | 143 | .search-form-input 144 | border: none 145 | background: none 146 | color: color-default 147 | width: 100% 148 | font: 13px font-sans 149 | outline: none 150 | &::-webkit-search-results-decoration 151 | &::-webkit-search-cancel-button 152 | -webkit-appearance: none 153 | 154 | .search-form-submit 155 | position: absolute 156 | top: 50% 157 | right: 10px 158 | margin-top: -7px 159 | font: 13px font-icon 160 | border: none 161 | background: none 162 | color: #bbb 163 | cursor: pointer 164 | &:hover, &:focus 165 | color: #777 -------------------------------------------------------------------------------- /themes/landscape/source/css/_partial/highlight.styl: -------------------------------------------------------------------------------- 1 | // https://github.com/chriskempson/tomorrow-theme 2 | highlight-background = #2d2d2d 3 | highlight-current-line = #393939 4 | highlight-selection = #515151 5 | highlight-foreground = #cccccc 6 | highlight-comment = #999999 7 | highlight-red = #f2777a 8 | highlight-orange = #f99157 9 | highlight-yellow = #ffcc66 10 | highlight-green = #99cc99 11 | highlight-aqua = #66cccc 12 | highlight-blue = #6699cc 13 | highlight-purple = #cc99cc 14 | 15 | $code-block 16 | background: highlight-background 17 | margin: 0 article-padding * -1 18 | padding: 15px article-padding 19 | border-style: solid 20 | border-color: color-border 21 | border-width: 1px 0 22 | overflow: auto 23 | color: highlight-foreground 24 | line-height: font-size * line-height 25 | 26 | $line-numbers 27 | color: #666 28 | font-size: 0.85em 29 | 30 | .article-entry 31 | pre, code 32 | font-family: font-mono 33 | code 34 | background: color-background 35 | text-shadow: 0 1px #fff 36 | padding: 0 0.3em 37 | pre 38 | @extend $code-block 39 | code 40 | background: none 41 | text-shadow: none 42 | padding: 0 43 | .highlight 44 | @extend $code-block 45 | pre 46 | border: none 47 | margin: 0 48 | padding: 0 49 | table 50 | margin: 0 51 | width: auto 52 | td 53 | border: none 54 | padding: 0 55 | figcaption 56 | clearfix() 57 | font-size: 0.85em 58 | color: highlight-comment 59 | line-height: 1em 60 | margin-bottom: 1em 61 | a 62 | float: right 63 | .gutter pre 64 | @extend $line-numbers 65 | text-align: right 66 | padding-right: 20px 67 | .line 68 | height: font-size * line-height 69 | .line.marked 70 | background: highlight-selection 71 | .gist 72 | margin: 0 article-padding * -1 73 | border-style: solid 74 | border-color: color-border 75 | border-width: 1px 0 76 | background: highlight-background 77 | padding: 15px article-padding 15px 0 78 | .gist-file 79 | border: none 80 | font-family: font-mono 81 | margin: 0 82 | .gist-data 83 | background: none 84 | border: none 85 | .line-numbers 86 | @extend $line-numbers 87 | background: none 88 | border: none 89 | padding: 0 20px 0 0 90 | .line-data 91 | padding: 0 !important 92 | .highlight 93 | margin: 0 94 | padding: 0 95 | border: none 96 | .gist-meta 97 | background: highlight-background 98 | color: highlight-comment 99 | font: 0.85em font-sans 100 | text-shadow: 0 0 101 | padding: 0 102 | margin-top: 1em 103 | margin-left: article-padding 104 | a 105 | color: color-link 106 | font-weight: normal 107 | &:hover 108 | text-decoration: underline 109 | 110 | pre 111 | .comment 112 | .title 113 | color: highlight-comment 114 | .variable 115 | .attribute 116 | .tag 117 | .regexp 118 | .ruby .constant 119 | .xml .tag .title 120 | .xml .pi 121 | .xml .doctype 122 | .html .doctype 123 | .css .id 124 | .css .class 125 | .css .pseudo 126 | color: highlight-red 127 | .number 128 | .preprocessor 129 | .built_in 130 | .literal 131 | .params 132 | .constant 133 | color: highlight-orange 134 | .class 135 | .ruby .class .title 136 | .css .rules .attribute 137 | color: highlight-green 138 | .string 139 | .value 140 | .inheritance 141 | .header 142 | .ruby .symbol 143 | .xml .cdata 144 | color: highlight-green 145 | .css .hexcolor 146 | color: highlight-aqua 147 | .function 148 | .python .decorator 149 | .python .title 150 | .ruby .function .title 151 | .ruby .title .keyword 152 | .perl .sub 153 | .javascript .title 154 | .coffeescript .title 155 | color: highlight-blue 156 | .keyword 157 | .javascript .function 158 | color: highlight-purple 159 | -------------------------------------------------------------------------------- /themes/landscape/source/css/_partial/mobile.styl: -------------------------------------------------------------------------------- 1 | @media mq-mobile 2 | #mobile-nav 3 | position: absolute 4 | top: 0 5 | left: 0 6 | width: mobile-nav-width 7 | height: 100% 8 | background: color-mobile-nav-background 9 | border-right: 1px solid #fff 10 | 11 | @media mq-mobile 12 | .mobile-nav-link 13 | display: block 14 | color: color-grey 15 | text-decoration: none 16 | padding: 15px 20px 17 | font-weight: bold 18 | &:hover 19 | color: #fff 20 | -------------------------------------------------------------------------------- /themes/landscape/source/css/_partial/sidebar-aside.styl: -------------------------------------------------------------------------------- 1 | #sidebar 2 | @media mq-normal 3 | column(sidebar-column) 4 | 5 | .widget-wrap 6 | margin: block-margin 0 7 | 8 | .widget-title 9 | @extend $block-caption 10 | 11 | .widget 12 | color: color-sidebar-text 13 | text-shadow: 0 1px #fff 14 | background: color-widget-background 15 | box-shadow: 0 -1px 4px color-widget-border inset 16 | border: 1px solid color-widget-border 17 | padding: 15px 18 | border-radius: 3px 19 | a 20 | color: color-link 21 | text-decoration: none 22 | &:hover 23 | text-decoration: underline 24 | ul, ol, dl 25 | ul, ol, dl 26 | margin-left: 15px 27 | list-style: disc -------------------------------------------------------------------------------- /themes/landscape/source/css/_partial/sidebar-bottom.styl: -------------------------------------------------------------------------------- 1 | .widget-wrap 2 | margin-bottom: block-margin !important 3 | @media mq-normal 4 | column(main-column) 5 | 6 | .widget-title 7 | color: #ccc 8 | text-transform: uppercase 9 | letter-spacing: 2px 10 | margin-bottom: .5em 11 | line-height: 1em 12 | font-weight: bold 13 | 14 | .widget 15 | color: color-grey 16 | ul, ol 17 | li 18 | display: inline-block 19 | zoom:1 20 | *display:inline 21 | padding-right: .75em 22 | /* Having problems getting balanced white space between items 23 | li:before 24 | content: " | " 25 | li:first-child:before 26 | content: none 27 | */ 28 | -------------------------------------------------------------------------------- /themes/landscape/source/css/_partial/sidebar.styl: -------------------------------------------------------------------------------- 1 | if sidebar is bottom 2 | @import "sidebar-bottom" 3 | else 4 | @import "sidebar-aside" 5 | 6 | .widget 7 | @extend $base-style 8 | line-height: line-height 9 | word-wrap: break-word 10 | font-size: 0.9em 11 | ul, ol 12 | list-style: none 13 | margin: 0 14 | ul, ol 15 | margin: 0 20px 16 | ul 17 | list-style: disc 18 | ol 19 | list-style: decimal 20 | 21 | .category-list-count 22 | .tag-list-count 23 | .archive-list-count 24 | padding-left: 5px 25 | color: color-grey 26 | font-size: 0.85em 27 | &:before 28 | content: "(" 29 | &:after 30 | content: ")" 31 | 32 | .tagcloud 33 | a 34 | margin-right: 5px 35 | display: inline-block 36 | -------------------------------------------------------------------------------- /themes/landscape/source/css/_util/grid.styl: -------------------------------------------------------------------------------- 1 | ///////////////// 2 | // Semantic.gs // for Stylus: http://learnboost.github.com/stylus/ 3 | ///////////////// 4 | 5 | // Utility function — you should never need to modify this 6 | // _gridsystem-width = (column-width + gutter-width) * columns 7 | gridsystem-width(_columns = columns) 8 | (column-width + gutter-width) * _columns 9 | 10 | // Set @total-width to 100% for a fluid layout 11 | // total-width = gridsystem-width(columns) 12 | total-width = 100% 13 | 14 | ////////// 15 | // GRID // 16 | ////////// 17 | 18 | body 19 | clearfix() 20 | width: 100% 21 | 22 | row(_columns = columns) 23 | clearfix() 24 | display: block 25 | width: total-width * ((gutter-width + gridsystem-width(_columns)) / gridsystem-width(_columns)) 26 | margin: 0 total-width * (((gutter-width * .5) / gridsystem-width(_columns)) * -1) 27 | 28 | column(x, _columns = columns) 29 | display: inline 30 | float: left 31 | width: total-width * ((((gutter-width + column-width) * x) - gutter-width) / gridsystem-width(_columns)) 32 | margin: 0 total-width * ((gutter-width * .5) / gridsystem-width(_columns)) 33 | 34 | push(offset = 1) 35 | margin-left: total-width * (((gutter-width + column-width) * offset) / gridsystem-width(columns)) 36 | 37 | pull(offset = 1) 38 | margin-right: total-width * (((gutter-width + column-width) * offset) / gridsystem-width(columns)) -------------------------------------------------------------------------------- /themes/landscape/source/css/_util/mixin.styl: -------------------------------------------------------------------------------- 1 | // http://www.zeldman.com/2012/03/01/replacing-the-9999px-hack-new-image-replacement/ 2 | hide-text() 3 | text-indent: 100% 4 | white-space: nowrap 5 | overflow: hidden 6 | 7 | // http://codepen.io/shshaw/full/gEiDt 8 | absolute-center(width, height = width) 9 | // margin: auto 10 | // position: absolute 11 | // top: 50% 12 | // top: 0 13 | // left: 0 14 | // bottom: 0 15 | // right: 0 16 | // width: width 17 | // height: height 18 | // overflow: auto 19 | width: width 20 | height: height 21 | position: absolute 22 | top: 50% 23 | left: 50% 24 | margin-top: width * -0.5 25 | margin-left: height * -0.5 26 | 27 | avoid-column-break() 28 | vendor("column-break-inside", avoid, only: webkit) 29 | page-break-inside: avoid // for firefox 30 | overflow: hidden // fix for firefox 31 | break-inside: avoid-column 32 | -------------------------------------------------------------------------------- /themes/landscape/source/css/_variables.styl: -------------------------------------------------------------------------------- 1 | // Config 2 | support-for-ie = false 3 | vendor-prefixes = webkit moz ms official 4 | 5 | // Colors 6 | color-default = #555 7 | color-grey = #999 8 | color-border = #ddd 9 | color-link = #258fb8 10 | color-background = #eee 11 | color-sidebar-text = #777 12 | color-widget-background = #ddd 13 | color-widget-border = #ccc 14 | color-footer-background = #262a30 15 | color-mobile-nav-background = #191919 16 | color-twitter = #00aced 17 | color-facebook = #3b5998 18 | color-pinterest = #cb2027 19 | color-google = #dd4b39 20 | 21 | // Fonts 22 | font-sans = "Helvetica Neue", Helvetica, Arial, sans-serif 23 | font-serif = Georgia, "Times New Roman", serif 24 | font-mono = "Source Code Pro", Consolas, Monaco, Menlo, Consolas, monospace 25 | font-icon = FontAwesome 26 | font-icon-path = "fonts/fontawesome-webfont" 27 | font-icon-version = "4.0.3" 28 | font-size = 14px 29 | line-height = 1.6em 30 | line-height-title = 1.1em 31 | 32 | // Header 33 | logo-size = 40px 34 | subtitle-size = 16px 35 | banner-height = 300px 36 | banner-url = "images/banner.jpg" 37 | 38 | sidebar = hexo-config("sidebar") 39 | 40 | // Layout 41 | block-margin = 50px 42 | article-padding = 20px 43 | mobile-nav-width = 280px 44 | main-column = 9 45 | sidebar-column = 3 46 | 47 | if sidebar and sidebar isnt bottom 48 | _sidebar-column = sidebar-column 49 | else 50 | _sidebar-column = 0 51 | 52 | // Grids 53 | column-width = 80px 54 | gutter-width = 20px 55 | columns = main-column + _sidebar-column 56 | 57 | // Media queries 58 | mq-mobile = "screen and (max-width: 479px)" 59 | mq-tablet = "screen and (min-width: 480px) and (max-width: 767px)" 60 | mq-normal = "screen and (min-width: 768px)" -------------------------------------------------------------------------------- /themes/landscape/source/css/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egoist/codejargon/960a897bb9063b7e448a7f8f2a4f1d0481d57bb3/themes/landscape/source/css/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /themes/landscape/source/css/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egoist/codejargon/960a897bb9063b7e448a7f8f2a4f1d0481d57bb3/themes/landscape/source/css/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /themes/landscape/source/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egoist/codejargon/960a897bb9063b7e448a7f8f2a4f1d0481d57bb3/themes/landscape/source/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /themes/landscape/source/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egoist/codejargon/960a897bb9063b7e448a7f8f2a4f1d0481d57bb3/themes/landscape/source/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /themes/landscape/source/css/images/banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egoist/codejargon/960a897bb9063b7e448a7f8f2a4f1d0481d57bb3/themes/landscape/source/css/images/banner.jpg -------------------------------------------------------------------------------- /themes/landscape/source/css/style.styl: -------------------------------------------------------------------------------- 1 | @import "nib" 2 | @import "_variables" 3 | @import "_util/mixin" 4 | @import "_util/grid" 5 | 6 | global-reset() 7 | 8 | input, button 9 | margin: 0 10 | padding: 0 11 | &::-moz-focus-inner 12 | border: 0 13 | padding: 0 14 | 15 | @font-face 16 | font-family: FontAwesome 17 | font-style: normal 18 | font-weight: normal 19 | src: url(font-icon-path + ".eot?v=#" + font-icon-version) 20 | src: url(font-icon-path + ".eot?#iefix&v=#" + font-icon-version) format("embedded-opentype"), 21 | url(font-icon-path + ".woff?v=#" + font-icon-version) format("woff"), 22 | url(font-icon-path + ".ttf?v=#" + font-icon-version) format("truetype"), 23 | url(font-icon-path + ".svg#fontawesomeregular?v=#" + font-icon-version) format("svg") 24 | 25 | html, body, #container 26 | height: 100% 27 | 28 | body 29 | background: color-background 30 | font: font-size font-sans 31 | -webkit-text-size-adjust: 100% 32 | 33 | .outer 34 | clearfix() 35 | max-width: (column-width + gutter-width) * columns + gutter-width 36 | margin: 0 auto 37 | padding: 0 gutter-width 38 | 39 | .inner 40 | column(columns) 41 | 42 | .left, .alignleft 43 | float: left 44 | 45 | .right, .alignright 46 | float: right 47 | 48 | .clear 49 | clear: both 50 | 51 | #container 52 | position: relative 53 | 54 | .mobile-nav-on 55 | overflow: hidden 56 | 57 | #wrap 58 | height: 100% 59 | width: 100% 60 | position: absolute 61 | top: 0 62 | left: 0 63 | transition: 0.2s ease-out 64 | z-index: 1 65 | background: color-background 66 | .mobile-nav-on & 67 | left: mobile-nav-width 68 | 69 | if sidebar and sidebar isnt bottom 70 | #main 71 | @media mq-normal 72 | column(main-column) 73 | 74 | if sidebar is left 75 | @media mq-normal 76 | #main 77 | float: right 78 | 79 | @import "_extend" 80 | @import "_partial/header" 81 | @import "_partial/article" 82 | @import "_partial/comment" 83 | @import "_partial/archive" 84 | @import "_partial/footer" 85 | @import "_partial/highlight" 86 | @import "_partial/mobile" 87 | 88 | if sidebar 89 | @import "_partial/sidebar" -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egoist/codejargon/960a897bb9063b7e448a7f8f2a4f1d0481d57bb3/themes/landscape/source/fancybox/blank.gif -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/fancybox_loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egoist/codejargon/960a897bb9063b7e448a7f8f2a4f1d0481d57bb3/themes/landscape/source/fancybox/fancybox_loading.gif -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/fancybox_loading@2x.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egoist/codejargon/960a897bb9063b7e448a7f8f2a4f1d0481d57bb3/themes/landscape/source/fancybox/fancybox_loading@2x.gif -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/fancybox_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egoist/codejargon/960a897bb9063b7e448a7f8f2a4f1d0481d57bb3/themes/landscape/source/fancybox/fancybox_overlay.png -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/fancybox_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egoist/codejargon/960a897bb9063b7e448a7f8f2a4f1d0481d57bb3/themes/landscape/source/fancybox/fancybox_sprite.png -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/fancybox_sprite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egoist/codejargon/960a897bb9063b7e448a7f8f2a4f1d0481d57bb3/themes/landscape/source/fancybox/fancybox_sprite@2x.png -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/helpers/fancybox_buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egoist/codejargon/960a897bb9063b7e448a7f8f2a4f1d0481d57bb3/themes/landscape/source/fancybox/helpers/fancybox_buttons.png -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/helpers/jquery.fancybox-buttons.css: -------------------------------------------------------------------------------- 1 | #fancybox-buttons { 2 | position: fixed; 3 | left: 0; 4 | width: 100%; 5 | z-index: 8050; 6 | } 7 | 8 | #fancybox-buttons.top { 9 | top: 10px; 10 | } 11 | 12 | #fancybox-buttons.bottom { 13 | bottom: 10px; 14 | } 15 | 16 | #fancybox-buttons ul { 17 | display: block; 18 | width: 166px; 19 | height: 30px; 20 | margin: 0 auto; 21 | padding: 0; 22 | list-style: none; 23 | border: 1px solid #111; 24 | border-radius: 3px; 25 | -webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); 26 | -moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); 27 | box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); 28 | background: rgb(50,50,50); 29 | background: -moz-linear-gradient(top, rgb(68,68,68) 0%, rgb(52,52,52) 50%, rgb(41,41,41) 50%, rgb(51,51,51) 100%); 30 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(68,68,68)), color-stop(50%,rgb(52,52,52)), color-stop(50%,rgb(41,41,41)), color-stop(100%,rgb(51,51,51))); 31 | background: -webkit-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); 32 | background: -o-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); 33 | background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); 34 | background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); 35 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 ); 36 | } 37 | 38 | #fancybox-buttons ul li { 39 | float: left; 40 | margin: 0; 41 | padding: 0; 42 | } 43 | 44 | #fancybox-buttons a { 45 | display: block; 46 | width: 30px; 47 | height: 30px; 48 | text-indent: -9999px; 49 | background-color: transparent; 50 | background-image: url('fancybox_buttons.png'); 51 | background-repeat: no-repeat; 52 | outline: none; 53 | opacity: 0.8; 54 | } 55 | 56 | #fancybox-buttons a:hover { 57 | opacity: 1; 58 | } 59 | 60 | #fancybox-buttons a.btnPrev { 61 | background-position: 5px 0; 62 | } 63 | 64 | #fancybox-buttons a.btnNext { 65 | background-position: -33px 0; 66 | border-right: 1px solid #3e3e3e; 67 | } 68 | 69 | #fancybox-buttons a.btnPlay { 70 | background-position: 0 -30px; 71 | } 72 | 73 | #fancybox-buttons a.btnPlayOn { 74 | background-position: -30px -30px; 75 | } 76 | 77 | #fancybox-buttons a.btnToggle { 78 | background-position: 3px -60px; 79 | border-left: 1px solid #111; 80 | border-right: 1px solid #3e3e3e; 81 | width: 35px 82 | } 83 | 84 | #fancybox-buttons a.btnToggleOn { 85 | background-position: -27px -60px; 86 | } 87 | 88 | #fancybox-buttons a.btnClose { 89 | border-left: 1px solid #111; 90 | width: 35px; 91 | background-position: -56px 0px; 92 | } 93 | 94 | #fancybox-buttons a.btnDisabled { 95 | opacity : 0.4; 96 | cursor: default; 97 | } -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/helpers/jquery.fancybox-buttons.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Buttons helper for fancyBox 3 | * version: 1.0.5 (Mon, 15 Oct 2012) 4 | * @requires fancyBox v2.0 or later 5 | * 6 | * Usage: 7 | * $(".fancybox").fancybox({ 8 | * helpers : { 9 | * buttons: { 10 | * position : 'top' 11 | * } 12 | * } 13 | * }); 14 | * 15 | */ 16 | ;(function ($) { 17 | //Shortcut for fancyBox object 18 | var F = $.fancybox; 19 | 20 | //Add helper object 21 | F.helpers.buttons = { 22 | defaults : { 23 | skipSingle : false, // disables if gallery contains single image 24 | position : 'top', // 'top' or 'bottom' 25 | tpl : '
' 26 | }, 27 | 28 | list : null, 29 | buttons: null, 30 | 31 | beforeLoad: function (opts, obj) { 32 | //Remove self if gallery do not have at least two items 33 | 34 | if (opts.skipSingle && obj.group.length < 2) { 35 | obj.helpers.buttons = false; 36 | obj.closeBtn = true; 37 | 38 | return; 39 | } 40 | 41 | //Increase top margin to give space for buttons 42 | obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30; 43 | }, 44 | 45 | onPlayStart: function () { 46 | if (this.buttons) { 47 | this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn'); 48 | } 49 | }, 50 | 51 | onPlayEnd: function () { 52 | if (this.buttons) { 53 | this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn'); 54 | } 55 | }, 56 | 57 | afterShow: function (opts, obj) { 58 | var buttons = this.buttons; 59 | 60 | if (!buttons) { 61 | this.list = $(opts.tpl).addClass(opts.position).appendTo('body'); 62 | 63 | buttons = { 64 | prev : this.list.find('.btnPrev').click( F.prev ), 65 | next : this.list.find('.btnNext').click( F.next ), 66 | play : this.list.find('.btnPlay').click( F.play ), 67 | toggle : this.list.find('.btnToggle').click( F.toggle ), 68 | close : this.list.find('.btnClose').click( F.close ) 69 | } 70 | } 71 | 72 | //Prev 73 | if (obj.index > 0 || obj.loop) { 74 | buttons.prev.removeClass('btnDisabled'); 75 | } else { 76 | buttons.prev.addClass('btnDisabled'); 77 | } 78 | 79 | //Next / Play 80 | if (obj.loop || obj.index < obj.group.length - 1) { 81 | buttons.next.removeClass('btnDisabled'); 82 | buttons.play.removeClass('btnDisabled'); 83 | 84 | } else { 85 | buttons.next.addClass('btnDisabled'); 86 | buttons.play.addClass('btnDisabled'); 87 | } 88 | 89 | this.buttons = buttons; 90 | 91 | this.onUpdate(opts, obj); 92 | }, 93 | 94 | onUpdate: function (opts, obj) { 95 | var toggle; 96 | 97 | if (!this.buttons) { 98 | return; 99 | } 100 | 101 | toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn'); 102 | 103 | //Size toggle button 104 | if (obj.canShrink) { 105 | toggle.addClass('btnToggleOn'); 106 | 107 | } else if (!obj.canExpand) { 108 | toggle.addClass('btnDisabled'); 109 | } 110 | }, 111 | 112 | beforeClose: function () { 113 | if (this.list) { 114 | this.list.remove(); 115 | } 116 | 117 | this.list = null; 118 | this.buttons = null; 119 | } 120 | }; 121 | 122 | }(jQuery)); 123 | -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/helpers/jquery.fancybox-media.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Media helper for fancyBox 3 | * version: 1.0.6 (Fri, 14 Jun 2013) 4 | * @requires fancyBox v2.0 or later 5 | * 6 | * Usage: 7 | * $(".fancybox").fancybox({ 8 | * helpers : { 9 | * media: true 10 | * } 11 | * }); 12 | * 13 | * Set custom URL parameters: 14 | * $(".fancybox").fancybox({ 15 | * helpers : { 16 | * media: { 17 | * youtube : { 18 | * params : { 19 | * autoplay : 0 20 | * } 21 | * } 22 | * } 23 | * } 24 | * }); 25 | * 26 | * Or: 27 | * $(".fancybox").fancybox({, 28 | * helpers : { 29 | * media: true 30 | * }, 31 | * youtube : { 32 | * autoplay: 0 33 | * } 34 | * }); 35 | * 36 | * Supports: 37 | * 38 | * Youtube 39 | * http://www.youtube.com/watch?v=opj24KnzrWo 40 | * http://www.youtube.com/embed/opj24KnzrWo 41 | * http://youtu.be/opj24KnzrWo 42 | * http://www.youtube-nocookie.com/embed/opj24KnzrWo 43 | * Vimeo 44 | * http://vimeo.com/40648169 45 | * http://vimeo.com/channels/staffpicks/38843628 46 | * http://vimeo.com/groups/surrealism/videos/36516384 47 | * http://player.vimeo.com/video/45074303 48 | * Metacafe 49 | * http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/ 50 | * http://www.metacafe.com/watch/7635964/ 51 | * Dailymotion 52 | * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people 53 | * Twitvid 54 | * http://twitvid.com/QY7MD 55 | * Twitpic 56 | * http://twitpic.com/7p93st 57 | * Instagram 58 | * http://instagr.am/p/IejkuUGxQn/ 59 | * http://instagram.com/p/IejkuUGxQn/ 60 | * Google maps 61 | * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17 62 | * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16 63 | * http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56 64 | */ 65 | ;(function ($) { 66 | "use strict"; 67 | 68 | //Shortcut for fancyBox object 69 | var F = $.fancybox, 70 | format = function( url, rez, params ) { 71 | params = params || ''; 72 | 73 | if ( $.type( params ) === "object" ) { 74 | params = $.param(params, true); 75 | } 76 | 77 | $.each(rez, function(key, value) { 78 | url = url.replace( '$' + key, value || '' ); 79 | }); 80 | 81 | if (params.length) { 82 | url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params; 83 | } 84 | 85 | return url; 86 | }; 87 | 88 | //Add helper object 89 | F.helpers.media = { 90 | defaults : { 91 | youtube : { 92 | matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i, 93 | params : { 94 | autoplay : 1, 95 | autohide : 1, 96 | fs : 1, 97 | rel : 0, 98 | hd : 1, 99 | wmode : 'opaque', 100 | enablejsapi : 1 101 | }, 102 | type : 'iframe', 103 | url : '//www.youtube.com/embed/$3' 104 | }, 105 | vimeo : { 106 | matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/, 107 | params : { 108 | autoplay : 1, 109 | hd : 1, 110 | show_title : 1, 111 | show_byline : 1, 112 | show_portrait : 0, 113 | fullscreen : 1 114 | }, 115 | type : 'iframe', 116 | url : '//player.vimeo.com/video/$1' 117 | }, 118 | metacafe : { 119 | matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/, 120 | params : { 121 | autoPlay : 'yes' 122 | }, 123 | type : 'swf', 124 | url : function( rez, params, obj ) { 125 | obj.swf.flashVars = 'playerVars=' + $.param( params, true ); 126 | 127 | return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf'; 128 | } 129 | }, 130 | dailymotion : { 131 | matcher : /dailymotion.com\/video\/(.*)\/?(.*)/, 132 | params : { 133 | additionalInfos : 0, 134 | autoStart : 1 135 | }, 136 | type : 'swf', 137 | url : '//www.dailymotion.com/swf/video/$1' 138 | }, 139 | twitvid : { 140 | matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i, 141 | params : { 142 | autoplay : 0 143 | }, 144 | type : 'iframe', 145 | url : '//www.twitvid.com/embed.php?guid=$1' 146 | }, 147 | twitpic : { 148 | matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i, 149 | type : 'image', 150 | url : '//twitpic.com/show/full/$1/' 151 | }, 152 | instagram : { 153 | matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, 154 | type : 'image', 155 | url : '//$1/p/$2/media/?size=l' 156 | }, 157 | google_maps : { 158 | matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i, 159 | type : 'iframe', 160 | url : function( rez ) { 161 | return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed'); 162 | } 163 | } 164 | }, 165 | 166 | beforeLoad : function(opts, obj) { 167 | var url = obj.href || '', 168 | type = false, 169 | what, 170 | item, 171 | rez, 172 | params; 173 | 174 | for (what in opts) { 175 | if (opts.hasOwnProperty(what)) { 176 | item = opts[ what ]; 177 | rez = url.match( item.matcher ); 178 | 179 | if (rez) { 180 | type = item.type; 181 | params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null)); 182 | 183 | url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params ); 184 | 185 | break; 186 | } 187 | } 188 | } 189 | 190 | if (type) { 191 | obj.href = url; 192 | obj.type = type; 193 | 194 | obj.autoHeight = false; 195 | } 196 | } 197 | }; 198 | 199 | }(jQuery)); -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/helpers/jquery.fancybox-thumbs.css: -------------------------------------------------------------------------------- 1 | #fancybox-thumbs { 2 | position: fixed; 3 | left: 0; 4 | width: 100%; 5 | overflow: hidden; 6 | z-index: 8050; 7 | } 8 | 9 | #fancybox-thumbs.bottom { 10 | bottom: 2px; 11 | } 12 | 13 | #fancybox-thumbs.top { 14 | top: 2px; 15 | } 16 | 17 | #fancybox-thumbs ul { 18 | position: relative; 19 | list-style: none; 20 | margin: 0; 21 | padding: 0; 22 | } 23 | 24 | #fancybox-thumbs ul li { 25 | float: left; 26 | padding: 1px; 27 | opacity: 0.5; 28 | } 29 | 30 | #fancybox-thumbs ul li.active { 31 | opacity: 0.75; 32 | padding: 0; 33 | border: 1px solid #fff; 34 | } 35 | 36 | #fancybox-thumbs ul li:hover { 37 | opacity: 1; 38 | } 39 | 40 | #fancybox-thumbs ul li a { 41 | display: block; 42 | position: relative; 43 | overflow: hidden; 44 | border: 1px solid #222; 45 | background: #111; 46 | outline: none; 47 | } 48 | 49 | #fancybox-thumbs ul li img { 50 | display: block; 51 | position: relative; 52 | border: 0; 53 | padding: 0; 54 | max-width: none; 55 | } -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/helpers/jquery.fancybox-thumbs.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Thumbnail helper for fancyBox 3 | * version: 1.0.7 (Mon, 01 Oct 2012) 4 | * @requires fancyBox v2.0 or later 5 | * 6 | * Usage: 7 | * $(".fancybox").fancybox({ 8 | * helpers : { 9 | * thumbs: { 10 | * width : 50, 11 | * height : 50 12 | * } 13 | * } 14 | * }); 15 | * 16 | */ 17 | ;(function ($) { 18 | //Shortcut for fancyBox object 19 | var F = $.fancybox; 20 | 21 | //Add helper object 22 | F.helpers.thumbs = { 23 | defaults : { 24 | width : 50, // thumbnail width 25 | height : 50, // thumbnail height 26 | position : 'bottom', // 'top' or 'bottom' 27 | source : function ( item ) { // function to obtain the URL of the thumbnail image 28 | var href; 29 | 30 | if (item.element) { 31 | href = $(item.element).find('img').attr('src'); 32 | } 33 | 34 | if (!href && item.type === 'image' && item.href) { 35 | href = item.href; 36 | } 37 | 38 | return href; 39 | } 40 | }, 41 | 42 | wrap : null, 43 | list : null, 44 | width : 0, 45 | 46 | init: function (opts, obj) { 47 | var that = this, 48 | list, 49 | thumbWidth = opts.width, 50 | thumbHeight = opts.height, 51 | thumbSource = opts.source; 52 | 53 | //Build list structure 54 | list = ''; 55 | 56 | for (var n = 0; n < obj.group.length; n++) { 57 | list += '
  • '; 58 | } 59 | 60 | this.wrap = $('
    ').addClass(opts.position).appendTo('body'); 61 | this.list = $('').appendTo(this.wrap); 62 | 63 | //Load each thumbnail 64 | $.each(obj.group, function (i) { 65 | var el = obj.group[ i ], 66 | href = thumbSource( el ); 67 | 68 | if (!href) { 69 | return; 70 | } 71 | 72 | $("").load(function () { 73 | var width = this.width, 74 | height = this.height, 75 | widthRatio, heightRatio, parent; 76 | 77 | if (!that.list || !width || !height) { 78 | return; 79 | } 80 | 81 | //Calculate thumbnail width/height and center it 82 | widthRatio = width / thumbWidth; 83 | heightRatio = height / thumbHeight; 84 | 85 | parent = that.list.children().eq(i).find('a'); 86 | 87 | if (widthRatio >= 1 && heightRatio >= 1) { 88 | if (widthRatio > heightRatio) { 89 | width = Math.floor(width / heightRatio); 90 | height = thumbHeight; 91 | 92 | } else { 93 | width = thumbWidth; 94 | height = Math.floor(height / widthRatio); 95 | } 96 | } 97 | 98 | $(this).css({ 99 | width : width, 100 | height : height, 101 | top : Math.floor(thumbHeight / 2 - height / 2), 102 | left : Math.floor(thumbWidth / 2 - width / 2) 103 | }); 104 | 105 | parent.width(thumbWidth).height(thumbHeight); 106 | 107 | $(this).hide().appendTo(parent).fadeIn(300); 108 | 109 | }) 110 | .attr('src', href) 111 | .attr('title', el.title); 112 | }); 113 | 114 | //Set initial width 115 | this.width = this.list.children().eq(0).outerWidth(true); 116 | 117 | this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))); 118 | }, 119 | 120 | beforeLoad: function (opts, obj) { 121 | //Remove self if gallery do not have at least two items 122 | if (obj.group.length < 2) { 123 | obj.helpers.thumbs = false; 124 | 125 | return; 126 | } 127 | 128 | //Increase bottom margin to give space for thumbs 129 | obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15); 130 | }, 131 | 132 | afterShow: function (opts, obj) { 133 | //Check if exists and create or update list 134 | if (this.list) { 135 | this.onUpdate(opts, obj); 136 | 137 | } else { 138 | this.init(opts, obj); 139 | } 140 | 141 | //Set active element 142 | this.list.children().removeClass('active').eq(obj.index).addClass('active'); 143 | }, 144 | 145 | //Center list 146 | onUpdate: function (opts, obj) { 147 | if (this.list) { 148 | this.list.stop(true).animate({ 149 | 'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)) 150 | }, 150); 151 | } 152 | }, 153 | 154 | beforeClose: function () { 155 | if (this.wrap) { 156 | this.wrap.remove(); 157 | } 158 | 159 | this.wrap = null; 160 | this.list = null; 161 | this.width = 0; 162 | } 163 | } 164 | 165 | }(jQuery)); -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/jquery.fancybox.css: -------------------------------------------------------------------------------- 1 | /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ 2 | .fancybox-wrap, 3 | .fancybox-skin, 4 | .fancybox-outer, 5 | .fancybox-inner, 6 | .fancybox-image, 7 | .fancybox-wrap iframe, 8 | .fancybox-wrap object, 9 | .fancybox-nav, 10 | .fancybox-nav span, 11 | .fancybox-tmp 12 | { 13 | padding: 0; 14 | margin: 0; 15 | border: 0; 16 | outline: none; 17 | vertical-align: top; 18 | } 19 | 20 | .fancybox-wrap { 21 | position: absolute; 22 | top: 0; 23 | left: 0; 24 | z-index: 8020; 25 | } 26 | 27 | .fancybox-skin { 28 | position: relative; 29 | background: #f9f9f9; 30 | color: #444; 31 | text-shadow: none; 32 | -webkit-border-radius: 4px; 33 | -moz-border-radius: 4px; 34 | border-radius: 4px; 35 | } 36 | 37 | .fancybox-opened { 38 | z-index: 8030; 39 | } 40 | 41 | .fancybox-opened .fancybox-skin { 42 | -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); 43 | -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); 44 | box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); 45 | } 46 | 47 | .fancybox-outer, .fancybox-inner { 48 | position: relative; 49 | } 50 | 51 | .fancybox-inner { 52 | overflow: hidden; 53 | } 54 | 55 | .fancybox-type-iframe .fancybox-inner { 56 | -webkit-overflow-scrolling: touch; 57 | } 58 | 59 | .fancybox-error { 60 | color: #444; 61 | font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; 62 | margin: 0; 63 | padding: 15px; 64 | white-space: nowrap; 65 | } 66 | 67 | .fancybox-image, .fancybox-iframe { 68 | display: block; 69 | width: 100%; 70 | height: 100%; 71 | } 72 | 73 | .fancybox-image { 74 | max-width: 100%; 75 | max-height: 100%; 76 | } 77 | 78 | #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { 79 | background-image: url(fancybox_sprite.png); 80 | } 81 | 82 | #fancybox-loading { 83 | position: fixed; 84 | top: 50%; 85 | left: 50%; 86 | margin-top: -22px; 87 | margin-left: -22px; 88 | background-position: 0 -108px; 89 | opacity: 0.8; 90 | cursor: pointer; 91 | z-index: 8060; 92 | } 93 | 94 | #fancybox-loading div { 95 | width: 44px; 96 | height: 44px; 97 | background: url(fancybox_loading.gif) center center no-repeat; 98 | } 99 | 100 | .fancybox-close { 101 | position: absolute; 102 | top: -18px; 103 | right: -18px; 104 | width: 36px; 105 | height: 36px; 106 | cursor: pointer; 107 | z-index: 8040; 108 | } 109 | 110 | .fancybox-nav { 111 | position: absolute; 112 | top: 0; 113 | width: 40%; 114 | height: 100%; 115 | cursor: pointer; 116 | text-decoration: none; 117 | background: transparent url(blank.gif); /* helps IE */ 118 | -webkit-tap-highlight-color: rgba(0,0,0,0); 119 | z-index: 8040; 120 | } 121 | 122 | .fancybox-prev { 123 | left: 0; 124 | } 125 | 126 | .fancybox-next { 127 | right: 0; 128 | } 129 | 130 | .fancybox-nav span { 131 | position: absolute; 132 | top: 50%; 133 | width: 36px; 134 | height: 34px; 135 | margin-top: -18px; 136 | cursor: pointer; 137 | z-index: 8040; 138 | visibility: hidden; 139 | } 140 | 141 | .fancybox-prev span { 142 | left: 10px; 143 | background-position: 0 -36px; 144 | } 145 | 146 | .fancybox-next span { 147 | right: 10px; 148 | background-position: 0 -72px; 149 | } 150 | 151 | .fancybox-nav:hover span { 152 | visibility: visible; 153 | } 154 | 155 | .fancybox-tmp { 156 | position: absolute; 157 | top: -99999px; 158 | left: -99999px; 159 | max-width: 99999px; 160 | max-height: 99999px; 161 | overflow: visible !important; 162 | } 163 | 164 | /* Overlay helper */ 165 | 166 | .fancybox-lock { 167 | overflow: visible !important; 168 | width: auto; 169 | } 170 | 171 | .fancybox-lock body { 172 | overflow: hidden !important; 173 | } 174 | 175 | .fancybox-lock-test { 176 | overflow-y: hidden !important; 177 | } 178 | 179 | .fancybox-overlay { 180 | position: absolute; 181 | top: 0; 182 | left: 0; 183 | overflow: hidden; 184 | display: none; 185 | z-index: 8010; 186 | background: url(fancybox_overlay.png); 187 | } 188 | 189 | .fancybox-overlay-fixed { 190 | position: fixed; 191 | bottom: 0; 192 | right: 0; 193 | } 194 | 195 | .fancybox-lock .fancybox-overlay { 196 | overflow: auto; 197 | overflow-y: scroll; 198 | } 199 | 200 | /* Title helper */ 201 | 202 | .fancybox-title { 203 | visibility: hidden; 204 | font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; 205 | position: relative; 206 | text-shadow: none; 207 | z-index: 8050; 208 | } 209 | 210 | .fancybox-opened .fancybox-title { 211 | visibility: visible; 212 | } 213 | 214 | .fancybox-title-float-wrap { 215 | position: absolute; 216 | bottom: 0; 217 | right: 50%; 218 | margin-bottom: -35px; 219 | z-index: 8050; 220 | text-align: center; 221 | } 222 | 223 | .fancybox-title-float-wrap .child { 224 | display: inline-block; 225 | margin-right: -100%; 226 | padding: 2px 20px; 227 | background: transparent; /* Fallback for web browsers that doesn't support RGBa */ 228 | background: rgba(0, 0, 0, 0.8); 229 | -webkit-border-radius: 15px; 230 | -moz-border-radius: 15px; 231 | border-radius: 15px; 232 | text-shadow: 0 1px 2px #222; 233 | color: #FFF; 234 | font-weight: bold; 235 | line-height: 24px; 236 | white-space: nowrap; 237 | } 238 | 239 | .fancybox-title-outside-wrap { 240 | position: relative; 241 | margin-top: 10px; 242 | color: #fff; 243 | } 244 | 245 | .fancybox-title-inside-wrap { 246 | padding-top: 10px; 247 | } 248 | 249 | .fancybox-title-over-wrap { 250 | position: absolute; 251 | bottom: 0; 252 | left: 0; 253 | color: #fff; 254 | padding: 10px; 255 | background: #000; 256 | background: rgba(0, 0, 0, .8); 257 | } 258 | 259 | /*Retina graphics!*/ 260 | @media only screen and (-webkit-min-device-pixel-ratio: 1.5), 261 | only screen and (min--moz-device-pixel-ratio: 1.5), 262 | only screen and (min-device-pixel-ratio: 1.5){ 263 | 264 | #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { 265 | background-image: url(fancybox_sprite@2x.png); 266 | background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/ 267 | } 268 | 269 | #fancybox-loading div { 270 | background-image: url(fancybox_loading@2x.gif); 271 | background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/ 272 | } 273 | } -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/jquery.fancybox.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * fancyBox - jQuery Plugin 3 | * version: 2.1.5 (Fri, 14 Jun 2013) 4 | * requires jQuery v1.6 or later 5 | * 6 | * Examples at http://fancyapps.com/fancybox/ 7 | * License: www.fancyapps.com/fancybox/#license 8 | * 9 | * Copyright 2012 Janis Skarnelis - janis@fancyapps.com 10 | * 11 | */ 12 | 13 | ;(function (window, document, $, undefined) { 14 | "use strict"; 15 | 16 | var H = $("html"), 17 | W = $(window), 18 | D = $(document), 19 | F = $.fancybox = function () { 20 | F.open.apply( this, arguments ); 21 | }, 22 | IE = navigator.userAgent.match(/msie/i), 23 | didUpdate = null, 24 | isTouch = document.createTouch !== undefined, 25 | 26 | isQuery = function(obj) { 27 | return obj && obj.hasOwnProperty && obj instanceof $; 28 | }, 29 | isString = function(str) { 30 | return str && $.type(str) === "string"; 31 | }, 32 | isPercentage = function(str) { 33 | return isString(str) && str.indexOf('%') > 0; 34 | }, 35 | isScrollable = function(el) { 36 | return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight))); 37 | }, 38 | getScalar = function(orig, dim) { 39 | var value = parseInt(orig, 10) || 0; 40 | 41 | if (dim && isPercentage(orig)) { 42 | value = F.getViewport()[ dim ] / 100 * value; 43 | } 44 | 45 | return Math.ceil(value); 46 | }, 47 | getValue = function(value, dim) { 48 | return getScalar(value, dim) + 'px'; 49 | }; 50 | 51 | $.extend(F, { 52 | // The current version of fancyBox 53 | version: '2.1.5', 54 | 55 | defaults: { 56 | padding : 15, 57 | margin : 20, 58 | 59 | width : 800, 60 | height : 600, 61 | minWidth : 100, 62 | minHeight : 100, 63 | maxWidth : 9999, 64 | maxHeight : 9999, 65 | pixelRatio: 1, // Set to 2 for retina display support 66 | 67 | autoSize : true, 68 | autoHeight : false, 69 | autoWidth : false, 70 | 71 | autoResize : true, 72 | autoCenter : !isTouch, 73 | fitToView : true, 74 | aspectRatio : false, 75 | topRatio : 0.5, 76 | leftRatio : 0.5, 77 | 78 | scrolling : 'auto', // 'auto', 'yes' or 'no' 79 | wrapCSS : '', 80 | 81 | arrows : true, 82 | closeBtn : true, 83 | closeClick : false, 84 | nextClick : false, 85 | mouseWheel : true, 86 | autoPlay : false, 87 | playSpeed : 3000, 88 | preload : 3, 89 | modal : false, 90 | loop : true, 91 | 92 | ajax : { 93 | dataType : 'html', 94 | headers : { 'X-fancyBox': true } 95 | }, 96 | iframe : { 97 | scrolling : 'auto', 98 | preload : true 99 | }, 100 | swf : { 101 | wmode: 'transparent', 102 | allowfullscreen : 'true', 103 | allowscriptaccess : 'always' 104 | }, 105 | 106 | keys : { 107 | next : { 108 | 13 : 'left', // enter 109 | 34 : 'up', // page down 110 | 39 : 'left', // right arrow 111 | 40 : 'up' // down arrow 112 | }, 113 | prev : { 114 | 8 : 'right', // backspace 115 | 33 : 'down', // page up 116 | 37 : 'right', // left arrow 117 | 38 : 'down' // up arrow 118 | }, 119 | close : [27], // escape key 120 | play : [32], // space - start/stop slideshow 121 | toggle : [70] // letter "f" - toggle fullscreen 122 | }, 123 | 124 | direction : { 125 | next : 'left', 126 | prev : 'right' 127 | }, 128 | 129 | scrollOutside : true, 130 | 131 | // Override some properties 132 | index : 0, 133 | type : null, 134 | href : null, 135 | content : null, 136 | title : null, 137 | 138 | // HTML templates 139 | tpl: { 140 | wrap : '
    ', 141 | image : '', 142 | iframe : '', 143 | error : '

    The requested content cannot be loaded.
    Please try again later.

    ', 144 | closeBtn : '', 145 | next : '', 146 | prev : '' 147 | }, 148 | 149 | // Properties for each animation type 150 | // Opening fancyBox 151 | openEffect : 'fade', // 'elastic', 'fade' or 'none' 152 | openSpeed : 250, 153 | openEasing : 'swing', 154 | openOpacity : true, 155 | openMethod : 'zoomIn', 156 | 157 | // Closing fancyBox 158 | closeEffect : 'fade', // 'elastic', 'fade' or 'none' 159 | closeSpeed : 250, 160 | closeEasing : 'swing', 161 | closeOpacity : true, 162 | closeMethod : 'zoomOut', 163 | 164 | // Changing next gallery item 165 | nextEffect : 'elastic', // 'elastic', 'fade' or 'none' 166 | nextSpeed : 250, 167 | nextEasing : 'swing', 168 | nextMethod : 'changeIn', 169 | 170 | // Changing previous gallery item 171 | prevEffect : 'elastic', // 'elastic', 'fade' or 'none' 172 | prevSpeed : 250, 173 | prevEasing : 'swing', 174 | prevMethod : 'changeOut', 175 | 176 | // Enable default helpers 177 | helpers : { 178 | overlay : true, 179 | title : true 180 | }, 181 | 182 | // Callbacks 183 | onCancel : $.noop, // If canceling 184 | beforeLoad : $.noop, // Before loading 185 | afterLoad : $.noop, // After loading 186 | beforeShow : $.noop, // Before changing in current item 187 | afterShow : $.noop, // After opening 188 | beforeChange : $.noop, // Before changing gallery item 189 | beforeClose : $.noop, // Before closing 190 | afterClose : $.noop // After closing 191 | }, 192 | 193 | //Current state 194 | group : {}, // Selected group 195 | opts : {}, // Group options 196 | previous : null, // Previous element 197 | coming : null, // Element being loaded 198 | current : null, // Currently loaded element 199 | isActive : false, // Is activated 200 | isOpen : false, // Is currently open 201 | isOpened : false, // Have been fully opened at least once 202 | 203 | wrap : null, 204 | skin : null, 205 | outer : null, 206 | inner : null, 207 | 208 | player : { 209 | timer : null, 210 | isActive : false 211 | }, 212 | 213 | // Loaders 214 | ajaxLoad : null, 215 | imgPreload : null, 216 | 217 | // Some collections 218 | transitions : {}, 219 | helpers : {}, 220 | 221 | /* 222 | * Static methods 223 | */ 224 | 225 | open: function (group, opts) { 226 | if (!group) { 227 | return; 228 | } 229 | 230 | if (!$.isPlainObject(opts)) { 231 | opts = {}; 232 | } 233 | 234 | // Close if already active 235 | if (false === F.close(true)) { 236 | return; 237 | } 238 | 239 | // Normalize group 240 | if (!$.isArray(group)) { 241 | group = isQuery(group) ? $(group).get() : [group]; 242 | } 243 | 244 | // Recheck if the type of each element is `object` and set content type (image, ajax, etc) 245 | $.each(group, function(i, element) { 246 | var obj = {}, 247 | href, 248 | title, 249 | content, 250 | type, 251 | rez, 252 | hrefParts, 253 | selector; 254 | 255 | if ($.type(element) === "object") { 256 | // Check if is DOM element 257 | if (element.nodeType) { 258 | element = $(element); 259 | } 260 | 261 | if (isQuery(element)) { 262 | obj = { 263 | href : element.data('fancybox-href') || element.attr('href'), 264 | title : $('
    ').text( element.data('fancybox-title') || element.attr('title') ).html(), 265 | isDom : true, 266 | element : element 267 | }; 268 | 269 | if ($.metadata) { 270 | $.extend(true, obj, element.metadata()); 271 | } 272 | 273 | } else { 274 | obj = element; 275 | } 276 | } 277 | 278 | href = opts.href || obj.href || (isString(element) ? element : null); 279 | title = opts.title !== undefined ? opts.title : obj.title || ''; 280 | 281 | content = opts.content || obj.content; 282 | type = content ? 'html' : (opts.type || obj.type); 283 | 284 | if (!type && obj.isDom) { 285 | type = element.data('fancybox-type'); 286 | 287 | if (!type) { 288 | rez = element.prop('class').match(/fancybox\.(\w+)/); 289 | type = rez ? rez[1] : null; 290 | } 291 | } 292 | 293 | if (isString(href)) { 294 | // Try to guess the content type 295 | if (!type) { 296 | if (F.isImage(href)) { 297 | type = 'image'; 298 | 299 | } else if (F.isSWF(href)) { 300 | type = 'swf'; 301 | 302 | } else if (href.charAt(0) === '#') { 303 | type = 'inline'; 304 | 305 | } else if (isString(element)) { 306 | type = 'html'; 307 | content = element; 308 | } 309 | } 310 | 311 | // Split url into two pieces with source url and content selector, e.g, 312 | // "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id" 313 | if (type === 'ajax') { 314 | hrefParts = href.split(/\s+/, 2); 315 | href = hrefParts.shift(); 316 | selector = hrefParts.shift(); 317 | } 318 | } 319 | 320 | if (!content) { 321 | if (type === 'inline') { 322 | if (href) { 323 | content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7 324 | 325 | } else if (obj.isDom) { 326 | content = element; 327 | } 328 | 329 | } else if (type === 'html') { 330 | content = href; 331 | 332 | } else if (!type && !href && obj.isDom) { 333 | type = 'inline'; 334 | content = element; 335 | } 336 | } 337 | 338 | $.extend(obj, { 339 | href : href, 340 | type : type, 341 | content : content, 342 | title : title, 343 | selector : selector 344 | }); 345 | 346 | group[ i ] = obj; 347 | }); 348 | 349 | // Extend the defaults 350 | F.opts = $.extend(true, {}, F.defaults, opts); 351 | 352 | // All options are merged recursive except keys 353 | if (opts.keys !== undefined) { 354 | F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false; 355 | } 356 | 357 | F.group = group; 358 | 359 | return F._start(F.opts.index); 360 | }, 361 | 362 | // Cancel image loading or abort ajax request 363 | cancel: function () { 364 | var coming = F.coming; 365 | 366 | if (coming && false === F.trigger('onCancel')) { 367 | return; 368 | } 369 | 370 | F.hideLoading(); 371 | 372 | if (!coming) { 373 | return; 374 | } 375 | 376 | if (F.ajaxLoad) { 377 | F.ajaxLoad.abort(); 378 | } 379 | 380 | F.ajaxLoad = null; 381 | 382 | if (F.imgPreload) { 383 | F.imgPreload.onload = F.imgPreload.onerror = null; 384 | } 385 | 386 | if (coming.wrap) { 387 | coming.wrap.stop(true, true).trigger('onReset').remove(); 388 | } 389 | 390 | F.coming = null; 391 | 392 | // If the first item has been canceled, then clear everything 393 | if (!F.current) { 394 | F._afterZoomOut( coming ); 395 | } 396 | }, 397 | 398 | // Start closing animation if is open; remove immediately if opening/closing 399 | close: function (event) { 400 | F.cancel(); 401 | 402 | if (false === F.trigger('beforeClose')) { 403 | return; 404 | } 405 | 406 | F.unbindEvents(); 407 | 408 | if (!F.isActive) { 409 | return; 410 | } 411 | 412 | if (!F.isOpen || event === true) { 413 | $('.fancybox-wrap').stop(true).trigger('onReset').remove(); 414 | 415 | F._afterZoomOut(); 416 | 417 | } else { 418 | F.isOpen = F.isOpened = false; 419 | F.isClosing = true; 420 | 421 | $('.fancybox-item, .fancybox-nav').remove(); 422 | 423 | F.wrap.stop(true, true).removeClass('fancybox-opened'); 424 | 425 | F.transitions[ F.current.closeMethod ](); 426 | } 427 | }, 428 | 429 | // Manage slideshow: 430 | // $.fancybox.play(); - toggle slideshow 431 | // $.fancybox.play( true ); - start 432 | // $.fancybox.play( false ); - stop 433 | play: function ( action ) { 434 | var clear = function () { 435 | clearTimeout(F.player.timer); 436 | }, 437 | set = function () { 438 | clear(); 439 | 440 | if (F.current && F.player.isActive) { 441 | F.player.timer = setTimeout(F.next, F.current.playSpeed); 442 | } 443 | }, 444 | stop = function () { 445 | clear(); 446 | 447 | D.unbind('.player'); 448 | 449 | F.player.isActive = false; 450 | 451 | F.trigger('onPlayEnd'); 452 | }, 453 | start = function () { 454 | if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) { 455 | F.player.isActive = true; 456 | 457 | D.bind({ 458 | 'onCancel.player beforeClose.player' : stop, 459 | 'onUpdate.player' : set, 460 | 'beforeLoad.player' : clear 461 | }); 462 | 463 | set(); 464 | 465 | F.trigger('onPlayStart'); 466 | } 467 | }; 468 | 469 | if (action === true || (!F.player.isActive && action !== false)) { 470 | start(); 471 | } else { 472 | stop(); 473 | } 474 | }, 475 | 476 | // Navigate to next gallery item 477 | next: function ( direction ) { 478 | var current = F.current; 479 | 480 | if (current) { 481 | if (!isString(direction)) { 482 | direction = current.direction.next; 483 | } 484 | 485 | F.jumpto(current.index + 1, direction, 'next'); 486 | } 487 | }, 488 | 489 | // Navigate to previous gallery item 490 | prev: function ( direction ) { 491 | var current = F.current; 492 | 493 | if (current) { 494 | if (!isString(direction)) { 495 | direction = current.direction.prev; 496 | } 497 | 498 | F.jumpto(current.index - 1, direction, 'prev'); 499 | } 500 | }, 501 | 502 | // Navigate to gallery item by index 503 | jumpto: function ( index, direction, router ) { 504 | var current = F.current; 505 | 506 | if (!current) { 507 | return; 508 | } 509 | 510 | index = getScalar(index); 511 | 512 | F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ]; 513 | F.router = router || 'jumpto'; 514 | 515 | if (current.loop) { 516 | if (index < 0) { 517 | index = current.group.length + (index % current.group.length); 518 | } 519 | 520 | index = index % current.group.length; 521 | } 522 | 523 | if (current.group[ index ] !== undefined) { 524 | F.cancel(); 525 | 526 | F._start(index); 527 | } 528 | }, 529 | 530 | // Center inside viewport and toggle position type to fixed or absolute if needed 531 | reposition: function (e, onlyAbsolute) { 532 | var current = F.current, 533 | wrap = current ? current.wrap : null, 534 | pos; 535 | 536 | if (wrap) { 537 | pos = F._getPosition(onlyAbsolute); 538 | 539 | if (e && e.type === 'scroll') { 540 | delete pos.position; 541 | 542 | wrap.stop(true, true).animate(pos, 200); 543 | 544 | } else { 545 | wrap.css(pos); 546 | 547 | current.pos = $.extend({}, current.dim, pos); 548 | } 549 | } 550 | }, 551 | 552 | update: function (e) { 553 | var type = (e && e.originalEvent && e.originalEvent.type), 554 | anyway = !type || type === 'orientationchange'; 555 | 556 | if (anyway) { 557 | clearTimeout(didUpdate); 558 | 559 | didUpdate = null; 560 | } 561 | 562 | if (!F.isOpen || didUpdate) { 563 | return; 564 | } 565 | 566 | didUpdate = setTimeout(function() { 567 | var current = F.current; 568 | 569 | if (!current || F.isClosing) { 570 | return; 571 | } 572 | 573 | F.wrap.removeClass('fancybox-tmp'); 574 | 575 | if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) { 576 | F._setDimension(); 577 | } 578 | 579 | if (!(type === 'scroll' && current.canShrink)) { 580 | F.reposition(e); 581 | } 582 | 583 | F.trigger('onUpdate'); 584 | 585 | didUpdate = null; 586 | 587 | }, (anyway && !isTouch ? 0 : 300)); 588 | }, 589 | 590 | // Shrink content to fit inside viewport or restore if resized 591 | toggle: function ( action ) { 592 | if (F.isOpen) { 593 | F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView; 594 | 595 | // Help browser to restore document dimensions 596 | if (isTouch) { 597 | F.wrap.removeAttr('style').addClass('fancybox-tmp'); 598 | 599 | F.trigger('onUpdate'); 600 | } 601 | 602 | F.update(); 603 | } 604 | }, 605 | 606 | hideLoading: function () { 607 | D.unbind('.loading'); 608 | 609 | $('#fancybox-loading').remove(); 610 | }, 611 | 612 | showLoading: function () { 613 | var el, viewport; 614 | 615 | F.hideLoading(); 616 | 617 | el = $('
    ').click(F.cancel).appendTo('body'); 618 | 619 | // If user will press the escape-button, the request will be canceled 620 | D.bind('keydown.loading', function(e) { 621 | if ((e.which || e.keyCode) === 27) { 622 | e.preventDefault(); 623 | 624 | F.cancel(); 625 | } 626 | }); 627 | 628 | if (!F.defaults.fixed) { 629 | viewport = F.getViewport(); 630 | 631 | el.css({ 632 | position : 'absolute', 633 | top : (viewport.h * 0.5) + viewport.y, 634 | left : (viewport.w * 0.5) + viewport.x 635 | }); 636 | } 637 | 638 | F.trigger('onLoading'); 639 | }, 640 | 641 | getViewport: function () { 642 | var locked = (F.current && F.current.locked) || false, 643 | rez = { 644 | x: W.scrollLeft(), 645 | y: W.scrollTop() 646 | }; 647 | 648 | if (locked && locked.length) { 649 | rez.w = locked[0].clientWidth; 650 | rez.h = locked[0].clientHeight; 651 | 652 | } else { 653 | // See http://bugs.jquery.com/ticket/6724 654 | rez.w = isTouch && window.innerWidth ? window.innerWidth : W.width(); 655 | rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height(); 656 | } 657 | 658 | return rez; 659 | }, 660 | 661 | // Unbind the keyboard / clicking actions 662 | unbindEvents: function () { 663 | if (F.wrap && isQuery(F.wrap)) { 664 | F.wrap.unbind('.fb'); 665 | } 666 | 667 | D.unbind('.fb'); 668 | W.unbind('.fb'); 669 | }, 670 | 671 | bindEvents: function () { 672 | var current = F.current, 673 | keys; 674 | 675 | if (!current) { 676 | return; 677 | } 678 | 679 | // Changing document height on iOS devices triggers a 'resize' event, 680 | // that can change document height... repeating infinitely 681 | W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update); 682 | 683 | keys = current.keys; 684 | 685 | if (keys) { 686 | D.bind('keydown.fb', function (e) { 687 | var code = e.which || e.keyCode, 688 | target = e.target || e.srcElement; 689 | 690 | // Skip esc key if loading, because showLoading will cancel preloading 691 | if (code === 27 && F.coming) { 692 | return false; 693 | } 694 | 695 | // Ignore key combinations and key events within form elements 696 | if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) { 697 | $.each(keys, function(i, val) { 698 | if (current.group.length > 1 && val[ code ] !== undefined) { 699 | F[ i ]( val[ code ] ); 700 | 701 | e.preventDefault(); 702 | return false; 703 | } 704 | 705 | if ($.inArray(code, val) > -1) { 706 | F[ i ] (); 707 | 708 | e.preventDefault(); 709 | return false; 710 | } 711 | }); 712 | } 713 | }); 714 | } 715 | 716 | if ($.fn.mousewheel && current.mouseWheel) { 717 | F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) { 718 | var target = e.target || null, 719 | parent = $(target), 720 | canScroll = false; 721 | 722 | while (parent.length) { 723 | if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) { 724 | break; 725 | } 726 | 727 | canScroll = isScrollable( parent[0] ); 728 | parent = $(parent).parent(); 729 | } 730 | 731 | if (delta !== 0 && !canScroll) { 732 | if (F.group.length > 1 && !current.canShrink) { 733 | if (deltaY > 0 || deltaX > 0) { 734 | F.prev( deltaY > 0 ? 'down' : 'left' ); 735 | 736 | } else if (deltaY < 0 || deltaX < 0) { 737 | F.next( deltaY < 0 ? 'up' : 'right' ); 738 | } 739 | 740 | e.preventDefault(); 741 | } 742 | } 743 | }); 744 | } 745 | }, 746 | 747 | trigger: function (event, o) { 748 | var ret, obj = o || F.coming || F.current; 749 | 750 | if (obj) { 751 | if ($.isFunction( obj[event] )) { 752 | ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1)); 753 | } 754 | 755 | if (ret === false) { 756 | return false; 757 | } 758 | 759 | if (obj.helpers) { 760 | $.each(obj.helpers, function (helper, opts) { 761 | if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) { 762 | F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj); 763 | } 764 | }); 765 | } 766 | } 767 | 768 | D.trigger(event); 769 | }, 770 | 771 | isImage: function (str) { 772 | return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i); 773 | }, 774 | 775 | isSWF: function (str) { 776 | return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i); 777 | }, 778 | 779 | _start: function (index) { 780 | var coming = {}, 781 | obj, 782 | href, 783 | type, 784 | margin, 785 | padding; 786 | 787 | index = getScalar( index ); 788 | obj = F.group[ index ] || null; 789 | 790 | if (!obj) { 791 | return false; 792 | } 793 | 794 | coming = $.extend(true, {}, F.opts, obj); 795 | 796 | // Convert margin and padding properties to array - top, right, bottom, left 797 | margin = coming.margin; 798 | padding = coming.padding; 799 | 800 | if ($.type(margin) === 'number') { 801 | coming.margin = [margin, margin, margin, margin]; 802 | } 803 | 804 | if ($.type(padding) === 'number') { 805 | coming.padding = [padding, padding, padding, padding]; 806 | } 807 | 808 | // 'modal' propery is just a shortcut 809 | if (coming.modal) { 810 | $.extend(true, coming, { 811 | closeBtn : false, 812 | closeClick : false, 813 | nextClick : false, 814 | arrows : false, 815 | mouseWheel : false, 816 | keys : null, 817 | helpers: { 818 | overlay : { 819 | closeClick : false 820 | } 821 | } 822 | }); 823 | } 824 | 825 | // 'autoSize' property is a shortcut, too 826 | if (coming.autoSize) { 827 | coming.autoWidth = coming.autoHeight = true; 828 | } 829 | 830 | if (coming.width === 'auto') { 831 | coming.autoWidth = true; 832 | } 833 | 834 | if (coming.height === 'auto') { 835 | coming.autoHeight = true; 836 | } 837 | 838 | /* 839 | * Add reference to the group, so it`s possible to access from callbacks, example: 840 | * afterLoad : function() { 841 | * this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : ''); 842 | * } 843 | */ 844 | 845 | coming.group = F.group; 846 | coming.index = index; 847 | 848 | // Give a chance for callback or helpers to update coming item (type, title, etc) 849 | F.coming = coming; 850 | 851 | if (false === F.trigger('beforeLoad')) { 852 | F.coming = null; 853 | 854 | return; 855 | } 856 | 857 | type = coming.type; 858 | href = coming.href; 859 | 860 | if (!type) { 861 | F.coming = null; 862 | 863 | //If we can not determine content type then drop silently or display next/prev item if looping through gallery 864 | if (F.current && F.router && F.router !== 'jumpto') { 865 | F.current.index = index; 866 | 867 | return F[ F.router ]( F.direction ); 868 | } 869 | 870 | return false; 871 | } 872 | 873 | F.isActive = true; 874 | 875 | if (type === 'image' || type === 'swf') { 876 | coming.autoHeight = coming.autoWidth = false; 877 | coming.scrolling = 'visible'; 878 | } 879 | 880 | if (type === 'image') { 881 | coming.aspectRatio = true; 882 | } 883 | 884 | if (type === 'iframe' && isTouch) { 885 | coming.scrolling = 'scroll'; 886 | } 887 | 888 | // Build the neccessary markup 889 | coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent || 'body' ); 890 | 891 | $.extend(coming, { 892 | skin : $('.fancybox-skin', coming.wrap), 893 | outer : $('.fancybox-outer', coming.wrap), 894 | inner : $('.fancybox-inner', coming.wrap) 895 | }); 896 | 897 | $.each(["Top", "Right", "Bottom", "Left"], function(i, v) { 898 | coming.skin.css('padding' + v, getValue(coming.padding[ i ])); 899 | }); 900 | 901 | F.trigger('onReady'); 902 | 903 | // Check before try to load; 'inline' and 'html' types need content, others - href 904 | if (type === 'inline' || type === 'html') { 905 | if (!coming.content || !coming.content.length) { 906 | return F._error( 'content' ); 907 | } 908 | 909 | } else if (!href) { 910 | return F._error( 'href' ); 911 | } 912 | 913 | if (type === 'image') { 914 | F._loadImage(); 915 | 916 | } else if (type === 'ajax') { 917 | F._loadAjax(); 918 | 919 | } else if (type === 'iframe') { 920 | F._loadIframe(); 921 | 922 | } else { 923 | F._afterLoad(); 924 | } 925 | }, 926 | 927 | _error: function ( type ) { 928 | $.extend(F.coming, { 929 | type : 'html', 930 | autoWidth : true, 931 | autoHeight : true, 932 | minWidth : 0, 933 | minHeight : 0, 934 | scrolling : 'no', 935 | hasError : type, 936 | content : F.coming.tpl.error 937 | }); 938 | 939 | F._afterLoad(); 940 | }, 941 | 942 | _loadImage: function () { 943 | // Reset preload image so it is later possible to check "complete" property 944 | var img = F.imgPreload = new Image(); 945 | 946 | img.onload = function () { 947 | this.onload = this.onerror = null; 948 | 949 | F.coming.width = this.width / F.opts.pixelRatio; 950 | F.coming.height = this.height / F.opts.pixelRatio; 951 | 952 | F._afterLoad(); 953 | }; 954 | 955 | img.onerror = function () { 956 | this.onload = this.onerror = null; 957 | 958 | F._error( 'image' ); 959 | }; 960 | 961 | img.src = F.coming.href; 962 | 963 | if (img.complete !== true) { 964 | F.showLoading(); 965 | } 966 | }, 967 | 968 | _loadAjax: function () { 969 | var coming = F.coming; 970 | 971 | F.showLoading(); 972 | 973 | F.ajaxLoad = $.ajax($.extend({}, coming.ajax, { 974 | url: coming.href, 975 | error: function (jqXHR, textStatus) { 976 | if (F.coming && textStatus !== 'abort') { 977 | F._error( 'ajax', jqXHR ); 978 | 979 | } else { 980 | F.hideLoading(); 981 | } 982 | }, 983 | success: function (data, textStatus) { 984 | if (textStatus === 'success') { 985 | coming.content = data; 986 | 987 | F._afterLoad(); 988 | } 989 | } 990 | })); 991 | }, 992 | 993 | _loadIframe: function() { 994 | var coming = F.coming, 995 | iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime())) 996 | .attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling) 997 | .attr('src', coming.href); 998 | 999 | // This helps IE 1000 | $(coming.wrap).bind('onReset', function () { 1001 | try { 1002 | $(this).find('iframe').hide().attr('src', '//about:blank').end().empty(); 1003 | } catch (e) {} 1004 | }); 1005 | 1006 | if (coming.iframe.preload) { 1007 | F.showLoading(); 1008 | 1009 | iframe.one('load', function() { 1010 | $(this).data('ready', 1); 1011 | 1012 | // iOS will lose scrolling if we resize 1013 | if (!isTouch) { 1014 | $(this).bind('load.fb', F.update); 1015 | } 1016 | 1017 | // Without this trick: 1018 | // - iframe won't scroll on iOS devices 1019 | // - IE7 sometimes displays empty iframe 1020 | $(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show(); 1021 | 1022 | F._afterLoad(); 1023 | }); 1024 | } 1025 | 1026 | coming.content = iframe.appendTo( coming.inner ); 1027 | 1028 | if (!coming.iframe.preload) { 1029 | F._afterLoad(); 1030 | } 1031 | }, 1032 | 1033 | _preloadImages: function() { 1034 | var group = F.group, 1035 | current = F.current, 1036 | len = group.length, 1037 | cnt = current.preload ? Math.min(current.preload, len - 1) : 0, 1038 | item, 1039 | i; 1040 | 1041 | for (i = 1; i <= cnt; i += 1) { 1042 | item = group[ (current.index + i ) % len ]; 1043 | 1044 | if (item.type === 'image' && item.href) { 1045 | new Image().src = item.href; 1046 | } 1047 | } 1048 | }, 1049 | 1050 | _afterLoad: function () { 1051 | var coming = F.coming, 1052 | previous = F.current, 1053 | placeholder = 'fancybox-placeholder', 1054 | current, 1055 | content, 1056 | type, 1057 | scrolling, 1058 | href, 1059 | embed; 1060 | 1061 | F.hideLoading(); 1062 | 1063 | if (!coming || F.isActive === false) { 1064 | return; 1065 | } 1066 | 1067 | if (false === F.trigger('afterLoad', coming, previous)) { 1068 | coming.wrap.stop(true).trigger('onReset').remove(); 1069 | 1070 | F.coming = null; 1071 | 1072 | return; 1073 | } 1074 | 1075 | if (previous) { 1076 | F.trigger('beforeChange', previous); 1077 | 1078 | previous.wrap.stop(true).removeClass('fancybox-opened') 1079 | .find('.fancybox-item, .fancybox-nav') 1080 | .remove(); 1081 | } 1082 | 1083 | F.unbindEvents(); 1084 | 1085 | current = coming; 1086 | content = coming.content; 1087 | type = coming.type; 1088 | scrolling = coming.scrolling; 1089 | 1090 | $.extend(F, { 1091 | wrap : current.wrap, 1092 | skin : current.skin, 1093 | outer : current.outer, 1094 | inner : current.inner, 1095 | current : current, 1096 | previous : previous 1097 | }); 1098 | 1099 | href = current.href; 1100 | 1101 | switch (type) { 1102 | case 'inline': 1103 | case 'ajax': 1104 | case 'html': 1105 | if (current.selector) { 1106 | content = $('
    ').html(content).find(current.selector); 1107 | 1108 | } else if (isQuery(content)) { 1109 | if (!content.data(placeholder)) { 1110 | content.data(placeholder, $('
    ').insertAfter( content ).hide() ); 1111 | } 1112 | 1113 | content = content.show().detach(); 1114 | 1115 | current.wrap.bind('onReset', function () { 1116 | if ($(this).find(content).length) { 1117 | content.hide().replaceAll( content.data(placeholder) ).data(placeholder, false); 1118 | } 1119 | }); 1120 | } 1121 | break; 1122 | 1123 | case 'image': 1124 | content = current.tpl.image.replace(/\{href\}/g, href); 1125 | break; 1126 | 1127 | case 'swf': 1128 | content = ''; 1129 | embed = ''; 1130 | 1131 | $.each(current.swf, function(name, val) { 1132 | content += ''; 1133 | embed += ' ' + name + '="' + val + '"'; 1134 | }); 1135 | 1136 | content += ''; 1137 | break; 1138 | } 1139 | 1140 | if (!(isQuery(content) && content.parent().is(current.inner))) { 1141 | current.inner.append( content ); 1142 | } 1143 | 1144 | // Give a chance for helpers or callbacks to update elements 1145 | F.trigger('beforeShow'); 1146 | 1147 | // Set scrolling before calculating dimensions 1148 | current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling)); 1149 | 1150 | // Set initial dimensions and start position 1151 | F._setDimension(); 1152 | 1153 | F.reposition(); 1154 | 1155 | F.isOpen = false; 1156 | F.coming = null; 1157 | 1158 | F.bindEvents(); 1159 | 1160 | if (!F.isOpened) { 1161 | $('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove(); 1162 | 1163 | } else if (previous.prevMethod) { 1164 | F.transitions[ previous.prevMethod ](); 1165 | } 1166 | 1167 | F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ](); 1168 | 1169 | F._preloadImages(); 1170 | }, 1171 | 1172 | _setDimension: function () { 1173 | var viewport = F.getViewport(), 1174 | steps = 0, 1175 | canShrink = false, 1176 | canExpand = false, 1177 | wrap = F.wrap, 1178 | skin = F.skin, 1179 | inner = F.inner, 1180 | current = F.current, 1181 | width = current.width, 1182 | height = current.height, 1183 | minWidth = current.minWidth, 1184 | minHeight = current.minHeight, 1185 | maxWidth = current.maxWidth, 1186 | maxHeight = current.maxHeight, 1187 | scrolling = current.scrolling, 1188 | scrollOut = current.scrollOutside ? current.scrollbarWidth : 0, 1189 | margin = current.margin, 1190 | wMargin = getScalar(margin[1] + margin[3]), 1191 | hMargin = getScalar(margin[0] + margin[2]), 1192 | wPadding, 1193 | hPadding, 1194 | wSpace, 1195 | hSpace, 1196 | origWidth, 1197 | origHeight, 1198 | origMaxWidth, 1199 | origMaxHeight, 1200 | ratio, 1201 | width_, 1202 | height_, 1203 | maxWidth_, 1204 | maxHeight_, 1205 | iframe, 1206 | body; 1207 | 1208 | // Reset dimensions so we could re-check actual size 1209 | wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp'); 1210 | 1211 | wPadding = getScalar(skin.outerWidth(true) - skin.width()); 1212 | hPadding = getScalar(skin.outerHeight(true) - skin.height()); 1213 | 1214 | // Any space between content and viewport (margin, padding, border, title) 1215 | wSpace = wMargin + wPadding; 1216 | hSpace = hMargin + hPadding; 1217 | 1218 | origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width; 1219 | origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height; 1220 | 1221 | if (current.type === 'iframe') { 1222 | iframe = current.content; 1223 | 1224 | if (current.autoHeight && iframe.data('ready') === 1) { 1225 | try { 1226 | if (iframe[0].contentWindow.document.location) { 1227 | inner.width( origWidth ).height(9999); 1228 | 1229 | body = iframe.contents().find('body'); 1230 | 1231 | if (scrollOut) { 1232 | body.css('overflow-x', 'hidden'); 1233 | } 1234 | 1235 | origHeight = body.outerHeight(true); 1236 | } 1237 | 1238 | } catch (e) {} 1239 | } 1240 | 1241 | } else if (current.autoWidth || current.autoHeight) { 1242 | inner.addClass( 'fancybox-tmp' ); 1243 | 1244 | // Set width or height in case we need to calculate only one dimension 1245 | if (!current.autoWidth) { 1246 | inner.width( origWidth ); 1247 | } 1248 | 1249 | if (!current.autoHeight) { 1250 | inner.height( origHeight ); 1251 | } 1252 | 1253 | if (current.autoWidth) { 1254 | origWidth = inner.width(); 1255 | } 1256 | 1257 | if (current.autoHeight) { 1258 | origHeight = inner.height(); 1259 | } 1260 | 1261 | inner.removeClass( 'fancybox-tmp' ); 1262 | } 1263 | 1264 | width = getScalar( origWidth ); 1265 | height = getScalar( origHeight ); 1266 | 1267 | ratio = origWidth / origHeight; 1268 | 1269 | // Calculations for the content 1270 | minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth); 1271 | maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth); 1272 | 1273 | minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight); 1274 | maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight); 1275 | 1276 | // These will be used to determine if wrap can fit in the viewport 1277 | origMaxWidth = maxWidth; 1278 | origMaxHeight = maxHeight; 1279 | 1280 | if (current.fitToView) { 1281 | maxWidth = Math.min(viewport.w - wSpace, maxWidth); 1282 | maxHeight = Math.min(viewport.h - hSpace, maxHeight); 1283 | } 1284 | 1285 | maxWidth_ = viewport.w - wMargin; 1286 | maxHeight_ = viewport.h - hMargin; 1287 | 1288 | if (current.aspectRatio) { 1289 | if (width > maxWidth) { 1290 | width = maxWidth; 1291 | height = getScalar(width / ratio); 1292 | } 1293 | 1294 | if (height > maxHeight) { 1295 | height = maxHeight; 1296 | width = getScalar(height * ratio); 1297 | } 1298 | 1299 | if (width < minWidth) { 1300 | width = minWidth; 1301 | height = getScalar(width / ratio); 1302 | } 1303 | 1304 | if (height < minHeight) { 1305 | height = minHeight; 1306 | width = getScalar(height * ratio); 1307 | } 1308 | 1309 | } else { 1310 | width = Math.max(minWidth, Math.min(width, maxWidth)); 1311 | 1312 | if (current.autoHeight && current.type !== 'iframe') { 1313 | inner.width( width ); 1314 | 1315 | height = inner.height(); 1316 | } 1317 | 1318 | height = Math.max(minHeight, Math.min(height, maxHeight)); 1319 | } 1320 | 1321 | // Try to fit inside viewport (including the title) 1322 | if (current.fitToView) { 1323 | inner.width( width ).height( height ); 1324 | 1325 | wrap.width( width + wPadding ); 1326 | 1327 | // Real wrap dimensions 1328 | width_ = wrap.width(); 1329 | height_ = wrap.height(); 1330 | 1331 | if (current.aspectRatio) { 1332 | while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) { 1333 | if (steps++ > 19) { 1334 | break; 1335 | } 1336 | 1337 | height = Math.max(minHeight, Math.min(maxHeight, height - 10)); 1338 | width = getScalar(height * ratio); 1339 | 1340 | if (width < minWidth) { 1341 | width = minWidth; 1342 | height = getScalar(width / ratio); 1343 | } 1344 | 1345 | if (width > maxWidth) { 1346 | width = maxWidth; 1347 | height = getScalar(width / ratio); 1348 | } 1349 | 1350 | inner.width( width ).height( height ); 1351 | 1352 | wrap.width( width + wPadding ); 1353 | 1354 | width_ = wrap.width(); 1355 | height_ = wrap.height(); 1356 | } 1357 | 1358 | } else { 1359 | width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_))); 1360 | height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_))); 1361 | } 1362 | } 1363 | 1364 | if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) { 1365 | width += scrollOut; 1366 | } 1367 | 1368 | inner.width( width ).height( height ); 1369 | 1370 | wrap.width( width + wPadding ); 1371 | 1372 | width_ = wrap.width(); 1373 | height_ = wrap.height(); 1374 | 1375 | canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight; 1376 | canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight)); 1377 | 1378 | $.extend(current, { 1379 | dim : { 1380 | width : getValue( width_ ), 1381 | height : getValue( height_ ) 1382 | }, 1383 | origWidth : origWidth, 1384 | origHeight : origHeight, 1385 | canShrink : canShrink, 1386 | canExpand : canExpand, 1387 | wPadding : wPadding, 1388 | hPadding : hPadding, 1389 | wrapSpace : height_ - skin.outerHeight(true), 1390 | skinSpace : skin.height() - height 1391 | }); 1392 | 1393 | if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) { 1394 | inner.height('auto'); 1395 | } 1396 | }, 1397 | 1398 | _getPosition: function (onlyAbsolute) { 1399 | var current = F.current, 1400 | viewport = F.getViewport(), 1401 | margin = current.margin, 1402 | width = F.wrap.width() + margin[1] + margin[3], 1403 | height = F.wrap.height() + margin[0] + margin[2], 1404 | rez = { 1405 | position: 'absolute', 1406 | top : margin[0], 1407 | left : margin[3] 1408 | }; 1409 | 1410 | if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) { 1411 | rez.position = 'fixed'; 1412 | 1413 | } else if (!current.locked) { 1414 | rez.top += viewport.y; 1415 | rez.left += viewport.x; 1416 | } 1417 | 1418 | rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio))); 1419 | rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio))); 1420 | 1421 | return rez; 1422 | }, 1423 | 1424 | _afterZoomIn: function () { 1425 | var current = F.current; 1426 | 1427 | if (!current) { 1428 | return; 1429 | } 1430 | 1431 | F.isOpen = F.isOpened = true; 1432 | 1433 | F.wrap.css('overflow', 'visible').addClass('fancybox-opened').hide().show(0); 1434 | 1435 | F.update(); 1436 | 1437 | // Assign a click event 1438 | if ( current.closeClick || (current.nextClick && F.group.length > 1) ) { 1439 | F.inner.css('cursor', 'pointer').bind('click.fb', function(e) { 1440 | if (!$(e.target).is('a') && !$(e.target).parent().is('a')) { 1441 | e.preventDefault(); 1442 | 1443 | F[ current.closeClick ? 'close' : 'next' ](); 1444 | } 1445 | }); 1446 | } 1447 | 1448 | // Create a close button 1449 | if (current.closeBtn) { 1450 | $(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e) { 1451 | e.preventDefault(); 1452 | 1453 | F.close(); 1454 | }); 1455 | } 1456 | 1457 | // Create navigation arrows 1458 | if (current.arrows && F.group.length > 1) { 1459 | if (current.loop || current.index > 0) { 1460 | $(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev); 1461 | } 1462 | 1463 | if (current.loop || current.index < F.group.length - 1) { 1464 | $(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next); 1465 | } 1466 | } 1467 | 1468 | F.trigger('afterShow'); 1469 | 1470 | // Stop the slideshow if this is the last item 1471 | if (!current.loop && current.index === current.group.length - 1) { 1472 | 1473 | F.play( false ); 1474 | 1475 | } else if (F.opts.autoPlay && !F.player.isActive) { 1476 | F.opts.autoPlay = false; 1477 | 1478 | F.play(true); 1479 | } 1480 | }, 1481 | 1482 | _afterZoomOut: function ( obj ) { 1483 | obj = obj || F.current; 1484 | 1485 | $('.fancybox-wrap').trigger('onReset').remove(); 1486 | 1487 | $.extend(F, { 1488 | group : {}, 1489 | opts : {}, 1490 | router : false, 1491 | current : null, 1492 | isActive : false, 1493 | isOpened : false, 1494 | isOpen : false, 1495 | isClosing : false, 1496 | wrap : null, 1497 | skin : null, 1498 | outer : null, 1499 | inner : null 1500 | }); 1501 | 1502 | F.trigger('afterClose', obj); 1503 | } 1504 | }); 1505 | 1506 | /* 1507 | * Default transitions 1508 | */ 1509 | 1510 | F.transitions = { 1511 | getOrigPosition: function () { 1512 | var current = F.current, 1513 | element = current.element, 1514 | orig = current.orig, 1515 | pos = {}, 1516 | width = 50, 1517 | height = 50, 1518 | hPadding = current.hPadding, 1519 | wPadding = current.wPadding, 1520 | viewport = F.getViewport(); 1521 | 1522 | if (!orig && current.isDom && element.is(':visible')) { 1523 | orig = element.find('img:first'); 1524 | 1525 | if (!orig.length) { 1526 | orig = element; 1527 | } 1528 | } 1529 | 1530 | if (isQuery(orig)) { 1531 | pos = orig.offset(); 1532 | 1533 | if (orig.is('img')) { 1534 | width = orig.outerWidth(); 1535 | height = orig.outerHeight(); 1536 | } 1537 | 1538 | } else { 1539 | pos.top = viewport.y + (viewport.h - height) * current.topRatio; 1540 | pos.left = viewport.x + (viewport.w - width) * current.leftRatio; 1541 | } 1542 | 1543 | if (F.wrap.css('position') === 'fixed' || current.locked) { 1544 | pos.top -= viewport.y; 1545 | pos.left -= viewport.x; 1546 | } 1547 | 1548 | pos = { 1549 | top : getValue(pos.top - hPadding * current.topRatio), 1550 | left : getValue(pos.left - wPadding * current.leftRatio), 1551 | width : getValue(width + wPadding), 1552 | height : getValue(height + hPadding) 1553 | }; 1554 | 1555 | return pos; 1556 | }, 1557 | 1558 | step: function (now, fx) { 1559 | var ratio, 1560 | padding, 1561 | value, 1562 | prop = fx.prop, 1563 | current = F.current, 1564 | wrapSpace = current.wrapSpace, 1565 | skinSpace = current.skinSpace; 1566 | 1567 | if (prop === 'width' || prop === 'height') { 1568 | ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start); 1569 | 1570 | if (F.isClosing) { 1571 | ratio = 1 - ratio; 1572 | } 1573 | 1574 | padding = prop === 'width' ? current.wPadding : current.hPadding; 1575 | value = now - padding; 1576 | 1577 | F.skin[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) ) ); 1578 | F.inner[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) ); 1579 | } 1580 | }, 1581 | 1582 | zoomIn: function () { 1583 | var current = F.current, 1584 | startPos = current.pos, 1585 | effect = current.openEffect, 1586 | elastic = effect === 'elastic', 1587 | endPos = $.extend({opacity : 1}, startPos); 1588 | 1589 | // Remove "position" property that breaks older IE 1590 | delete endPos.position; 1591 | 1592 | if (elastic) { 1593 | startPos = this.getOrigPosition(); 1594 | 1595 | if (current.openOpacity) { 1596 | startPos.opacity = 0.1; 1597 | } 1598 | 1599 | } else if (effect === 'fade') { 1600 | startPos.opacity = 0.1; 1601 | } 1602 | 1603 | F.wrap.css(startPos).animate(endPos, { 1604 | duration : effect === 'none' ? 0 : current.openSpeed, 1605 | easing : current.openEasing, 1606 | step : elastic ? this.step : null, 1607 | complete : F._afterZoomIn 1608 | }); 1609 | }, 1610 | 1611 | zoomOut: function () { 1612 | var current = F.current, 1613 | effect = current.closeEffect, 1614 | elastic = effect === 'elastic', 1615 | endPos = {opacity : 0.1}; 1616 | 1617 | if (elastic) { 1618 | endPos = this.getOrigPosition(); 1619 | 1620 | if (current.closeOpacity) { 1621 | endPos.opacity = 0.1; 1622 | } 1623 | } 1624 | 1625 | F.wrap.animate(endPos, { 1626 | duration : effect === 'none' ? 0 : current.closeSpeed, 1627 | easing : current.closeEasing, 1628 | step : elastic ? this.step : null, 1629 | complete : F._afterZoomOut 1630 | }); 1631 | }, 1632 | 1633 | changeIn: function () { 1634 | var current = F.current, 1635 | effect = current.nextEffect, 1636 | startPos = current.pos, 1637 | endPos = { opacity : 1 }, 1638 | direction = F.direction, 1639 | distance = 200, 1640 | field; 1641 | 1642 | startPos.opacity = 0.1; 1643 | 1644 | if (effect === 'elastic') { 1645 | field = direction === 'down' || direction === 'up' ? 'top' : 'left'; 1646 | 1647 | if (direction === 'down' || direction === 'right') { 1648 | startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance); 1649 | endPos[ field ] = '+=' + distance + 'px'; 1650 | 1651 | } else { 1652 | startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance); 1653 | endPos[ field ] = '-=' + distance + 'px'; 1654 | } 1655 | } 1656 | 1657 | // Workaround for http://bugs.jquery.com/ticket/12273 1658 | if (effect === 'none') { 1659 | F._afterZoomIn(); 1660 | 1661 | } else { 1662 | F.wrap.css(startPos).animate(endPos, { 1663 | duration : current.nextSpeed, 1664 | easing : current.nextEasing, 1665 | complete : F._afterZoomIn 1666 | }); 1667 | } 1668 | }, 1669 | 1670 | changeOut: function () { 1671 | var previous = F.previous, 1672 | effect = previous.prevEffect, 1673 | endPos = { opacity : 0.1 }, 1674 | direction = F.direction, 1675 | distance = 200; 1676 | 1677 | if (effect === 'elastic') { 1678 | endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px'; 1679 | } 1680 | 1681 | previous.wrap.animate(endPos, { 1682 | duration : effect === 'none' ? 0 : previous.prevSpeed, 1683 | easing : previous.prevEasing, 1684 | complete : function () { 1685 | $(this).trigger('onReset').remove(); 1686 | } 1687 | }); 1688 | } 1689 | }; 1690 | 1691 | /* 1692 | * Overlay helper 1693 | */ 1694 | 1695 | F.helpers.overlay = { 1696 | defaults : { 1697 | closeClick : true, // if true, fancyBox will be closed when user clicks on the overlay 1698 | speedOut : 200, // duration of fadeOut animation 1699 | showEarly : true, // indicates if should be opened immediately or wait until the content is ready 1700 | css : {}, // custom CSS properties 1701 | locked : !isTouch, // if true, the content will be locked into overlay 1702 | fixed : true // if false, the overlay CSS position property will not be set to "fixed" 1703 | }, 1704 | 1705 | overlay : null, // current handle 1706 | fixed : false, // indicates if the overlay has position "fixed" 1707 | el : $('html'), // element that contains "the lock" 1708 | 1709 | // Public methods 1710 | create : function(opts) { 1711 | var parent; 1712 | 1713 | opts = $.extend({}, this.defaults, opts); 1714 | 1715 | if (this.overlay) { 1716 | this.close(); 1717 | } 1718 | 1719 | parent = F.coming ? F.coming.parent : opts.parent; 1720 | 1721 | this.overlay = $('
    ').appendTo( parent && parent.lenth ? parent : 'body' ); 1722 | this.fixed = false; 1723 | 1724 | if (opts.fixed && F.defaults.fixed) { 1725 | this.overlay.addClass('fancybox-overlay-fixed'); 1726 | 1727 | this.fixed = true; 1728 | } 1729 | }, 1730 | 1731 | open : function(opts) { 1732 | var that = this; 1733 | 1734 | opts = $.extend({}, this.defaults, opts); 1735 | 1736 | if (this.overlay) { 1737 | this.overlay.unbind('.overlay').width('auto').height('auto'); 1738 | 1739 | } else { 1740 | this.create(opts); 1741 | } 1742 | 1743 | if (!this.fixed) { 1744 | W.bind('resize.overlay', $.proxy( this.update, this) ); 1745 | 1746 | this.update(); 1747 | } 1748 | 1749 | if (opts.closeClick) { 1750 | this.overlay.bind('click.overlay', function(e) { 1751 | if ($(e.target).hasClass('fancybox-overlay')) { 1752 | if (F.isActive) { 1753 | F.close(); 1754 | } else { 1755 | that.close(); 1756 | } 1757 | 1758 | return false; 1759 | } 1760 | }); 1761 | } 1762 | 1763 | this.overlay.css( opts.css ).show(); 1764 | }, 1765 | 1766 | close : function() { 1767 | W.unbind('resize.overlay'); 1768 | 1769 | if (this.el.hasClass('fancybox-lock')) { 1770 | $('.fancybox-margin').removeClass('fancybox-margin'); 1771 | 1772 | this.el.removeClass('fancybox-lock'); 1773 | 1774 | W.scrollTop( this.scrollV ).scrollLeft( this.scrollH ); 1775 | } 1776 | 1777 | $('.fancybox-overlay').remove().hide(); 1778 | 1779 | $.extend(this, { 1780 | overlay : null, 1781 | fixed : false 1782 | }); 1783 | }, 1784 | 1785 | // Private, callbacks 1786 | 1787 | update : function () { 1788 | var width = '100%', offsetWidth; 1789 | 1790 | // Reset width/height so it will not mess 1791 | this.overlay.width(width).height('100%'); 1792 | 1793 | // jQuery does not return reliable result for IE 1794 | if (IE) { 1795 | offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); 1796 | 1797 | if (D.width() > offsetWidth) { 1798 | width = D.width(); 1799 | } 1800 | 1801 | } else if (D.width() > W.width()) { 1802 | width = D.width(); 1803 | } 1804 | 1805 | this.overlay.width(width).height(D.height()); 1806 | }, 1807 | 1808 | // This is where we can manipulate DOM, because later it would cause iframes to reload 1809 | onReady : function (opts, obj) { 1810 | var overlay = this.overlay; 1811 | 1812 | $('.fancybox-overlay').stop(true, true); 1813 | 1814 | if (!overlay) { 1815 | this.create(opts); 1816 | } 1817 | 1818 | if (opts.locked && this.fixed && obj.fixed) { 1819 | obj.locked = this.overlay.append( obj.wrap ); 1820 | obj.fixed = false; 1821 | } 1822 | 1823 | if (opts.showEarly === true) { 1824 | this.beforeShow.apply(this, arguments); 1825 | } 1826 | }, 1827 | 1828 | beforeShow : function(opts, obj) { 1829 | if (obj.locked && !this.el.hasClass('fancybox-lock')) { 1830 | if (this.fixPosition !== false) { 1831 | $('*').filter(function(){ 1832 | return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap") ); 1833 | }).addClass('fancybox-margin'); 1834 | } 1835 | 1836 | this.el.addClass('fancybox-margin'); 1837 | 1838 | this.scrollV = W.scrollTop(); 1839 | this.scrollH = W.scrollLeft(); 1840 | 1841 | this.el.addClass('fancybox-lock'); 1842 | 1843 | W.scrollTop( this.scrollV ).scrollLeft( this.scrollH ); 1844 | } 1845 | 1846 | this.open(opts); 1847 | }, 1848 | 1849 | onUpdate : function() { 1850 | if (!this.fixed) { 1851 | this.update(); 1852 | } 1853 | }, 1854 | 1855 | afterClose: function (opts) { 1856 | // Remove overlay if exists and fancyBox is not opening 1857 | // (e.g., it is not being open using afterClose callback) 1858 | if (this.overlay && !F.coming) { 1859 | this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this )); 1860 | } 1861 | } 1862 | }; 1863 | 1864 | /* 1865 | * Title helper 1866 | */ 1867 | 1868 | F.helpers.title = { 1869 | defaults : { 1870 | type : 'float', // 'float', 'inside', 'outside' or 'over', 1871 | position : 'bottom' // 'top' or 'bottom' 1872 | }, 1873 | 1874 | beforeShow: function (opts) { 1875 | var current = F.current, 1876 | text = current.title, 1877 | type = opts.type, 1878 | title, 1879 | target; 1880 | 1881 | if ($.isFunction(text)) { 1882 | text = text.call(current.element, current); 1883 | } 1884 | 1885 | if (!isString(text) || $.trim(text) === '') { 1886 | return; 1887 | } 1888 | 1889 | title = $('
    ' + text + '
    '); 1890 | 1891 | switch (type) { 1892 | case 'inside': 1893 | target = F.skin; 1894 | break; 1895 | 1896 | case 'outside': 1897 | target = F.wrap; 1898 | break; 1899 | 1900 | case 'over': 1901 | target = F.inner; 1902 | break; 1903 | 1904 | default: // 'float' 1905 | target = F.skin; 1906 | 1907 | title.appendTo('body'); 1908 | 1909 | if (IE) { 1910 | title.width( title.width() ); 1911 | } 1912 | 1913 | title.wrapInner(''); 1914 | 1915 | //Increase bottom margin so this title will also fit into viewport 1916 | F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) ); 1917 | break; 1918 | } 1919 | 1920 | title[ (opts.position === 'top' ? 'prependTo' : 'appendTo') ](target); 1921 | } 1922 | }; 1923 | 1924 | // jQuery plugin initialization 1925 | $.fn.fancybox = function (options) { 1926 | var index, 1927 | that = $(this), 1928 | selector = this.selector || '', 1929 | run = function(e) { 1930 | var what = $(this).blur(), idx = index, relType, relVal; 1931 | 1932 | if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) { 1933 | relType = options.groupAttr || 'data-fancybox-group'; 1934 | relVal = what.attr(relType); 1935 | 1936 | if (!relVal) { 1937 | relType = 'rel'; 1938 | relVal = what.get(0)[ relType ]; 1939 | } 1940 | 1941 | if (relVal && relVal !== '' && relVal !== 'nofollow') { 1942 | what = selector.length ? $(selector) : that; 1943 | what = what.filter('[' + relType + '="' + relVal + '"]'); 1944 | idx = what.index(this); 1945 | } 1946 | 1947 | options.index = idx; 1948 | 1949 | // Stop an event from bubbling if everything is fine 1950 | if (F.open(what, options) !== false) { 1951 | e.preventDefault(); 1952 | } 1953 | } 1954 | }; 1955 | 1956 | options = options || {}; 1957 | index = options.index || 0; 1958 | 1959 | if (!selector || options.live === false) { 1960 | that.unbind('click.fb-start').bind('click.fb-start', run); 1961 | 1962 | } else { 1963 | D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run); 1964 | } 1965 | 1966 | this.filter('[data-fancybox-start=1]').trigger('click'); 1967 | 1968 | return this; 1969 | }; 1970 | 1971 | // Tests that need a body at doc ready 1972 | D.ready(function() { 1973 | var w1, w2; 1974 | 1975 | if ( $.scrollbarWidth === undefined ) { 1976 | // http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth 1977 | $.scrollbarWidth = function() { 1978 | var parent = $('
    ').appendTo('body'), 1979 | child = parent.children(), 1980 | width = child.innerWidth() - child.height( 99 ).innerWidth(); 1981 | 1982 | parent.remove(); 1983 | 1984 | return width; 1985 | }; 1986 | } 1987 | 1988 | if ( $.support.fixedPosition === undefined ) { 1989 | $.support.fixedPosition = (function() { 1990 | var elem = $('
    ').appendTo('body'), 1991 | fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 ); 1992 | 1993 | elem.remove(); 1994 | 1995 | return fixed; 1996 | }()); 1997 | } 1998 | 1999 | $.extend(F.defaults, { 2000 | scrollbarWidth : $.scrollbarWidth(), 2001 | fixed : $.support.fixedPosition, 2002 | parent : $('body') 2003 | }); 2004 | 2005 | //Get real width of page scroll-bar 2006 | w1 = $(window).width(); 2007 | 2008 | H.addClass('fancybox-lock-test'); 2009 | 2010 | w2 = $(window).width(); 2011 | 2012 | H.removeClass('fancybox-lock-test'); 2013 | 2014 | $("").appendTo("head"); 2015 | }); 2016 | 2017 | }(window, document, jQuery)); -------------------------------------------------------------------------------- /themes/landscape/source/fancybox/jquery.fancybox.pack.js: -------------------------------------------------------------------------------- 1 | /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ 2 | (function(s,H,f,w){var K=f("html"),q=f(s),p=f(H),b=f.fancybox=function(){b.open.apply(this,arguments)},J=navigator.userAgent.match(/msie/i),C=null,t=H.createTouch!==w,u=function(a){return a&&a.hasOwnProperty&&a instanceof f},r=function(a){return a&&"string"===f.type(a)},F=function(a){return r(a)&&0
    ',image:'',iframe:'",error:'

    The requested content cannot be loaded.
    Please try again later.

    ',closeBtn:'',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0, 6 | openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1, 7 | isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=u(a)?f(a).get():[a]),f.each(a,function(e,c){var l={},g,h,k,n,m;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),u(c)?(l={href:c.data("fancybox-href")||c.attr("href"),title:f("
    ").text(c.data("fancybox-title")||c.attr("title")).html(),isDom:!0,element:c}, 8 | f.metadata&&f.extend(!0,l,c.metadata())):l=c);g=d.href||l.href||(r(c)?c:null);h=d.title!==w?d.title:l.title||"";n=(k=d.content||l.content)?"html":d.type||l.type;!n&&l.isDom&&(n=c.data("fancybox-type"),n||(n=(n=c.prop("class").match(/fancybox\.(\w+)/))?n[1]:null));r(g)&&(n||(b.isImage(g)?n="image":b.isSWF(g)?n="swf":"#"===g.charAt(0)?n="inline":r(c)&&(n="html",k=c)),"ajax"===n&&(m=g.split(/\s+/,2),g=m.shift(),m=m.shift()));k||("inline"===n?g?k=f(r(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):l.isDom&&(k=c): 9 | "html"===n?k=g:n||g||!l.isDom||(n="inline",k=c));f.extend(l,{href:g,type:n,content:k,title:h,selector:m});a[e]=l}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==w&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1===b.trigger("onCancel")||(b.hideLoading(),a&&(b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(), 10 | b.coming=null,b.current||b._afterZoomOut(a)))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(b.isOpen&&!0!==a?(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]()):(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&& 11 | (b.player.timer=setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};!0===a||!b.player.isActive&&!1!==a?b.current&&(b.current.loop||b.current.index=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==w&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,l;c&&(l=b._getPosition(d),a&&"scroll"===a.type?(delete l.position,c.stop(!0,!0).animate(l,200)):(c.css(l),e.pos=f.extend({},e.dim,l)))}, 13 | update:function(a){var d=a&&a.originalEvent&&a.originalEvent.type,e=!d||"orientationchange"===d;e&&(clearTimeout(C),C=null);b.isOpen&&!C&&(C=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),C=null)},e&&!t?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,t&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"), 14 | b.trigger("onUpdate")),b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('
    ').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){27===(a.which||a.keyCode)&&(a.preventDefault(),b.cancel())});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}));b.trigger("onLoading")},getViewport:function(){var a=b.current&& 15 | b.current.locked||!1,d={x:q.scrollLeft(),y:q.scrollTop()};a&&a.length?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=t&&s.innerWidth?s.innerWidth:q.width(),d.h=t&&s.innerHeight?s.innerHeight:q.height());return d},unbindEvents:function(){b.wrap&&u(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");q.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(q.bind("orientationchange.fb"+(t?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c= 16 | e.which||e.keyCode,l=e.target||e.srcElement;if(27===c&&b.coming)return!1;e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||l&&(l.type||f(l).is("[contenteditable]"))||f.each(d,function(d,l){if(1h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();0!==c&&!k&&1g||0>l)&&b.next(0>g?"up":"right"),d.preventDefault())}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&& 18 | b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0,{},b.helpers[d].defaults,e),c)})}p.trigger(a)},isImage:function(a){return r(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return r(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=m(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c, 19 | c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"=== 20 | c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=!0);"iframe"===c&&t&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(t?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,x(d.padding[a]))});b.trigger("onReady"); 21 | if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width= 22 | this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming, 23 | d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",t?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);t||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload|| 24 | b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,l,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()); 25 | b.unbindEvents();e=a.content;c=a.type;l=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("
    ").html(e).find(a.selector):u(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('
    ').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder", 26 | !1)}));break;case "image":e=a.tpl.image.replace(/\{href\}/g,g);break;case "swf":e='',h="",f.each(a.swf,function(a,b){e+='';h+=" "+a+'="'+b+'"'}),e+='"}u(e)&&e.parent().is(a.inner)||a.inner.append(e);b.trigger("beforeShow"); 27 | a.inner.css("overflow","yes"===l?"scroll":"no"===l?"hidden":l);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(!b.isOpened)f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();else if(d.prevMethod)b.transitions[d.prevMethod]();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,l=b.skin,g=b.inner,h=b.current,c=h.width,k=h.height,n=h.minWidth,v=h.minHeight,p=h.maxWidth, 28 | q=h.maxHeight,t=h.scrolling,r=h.scrollOutside?h.scrollbarWidth:0,y=h.margin,z=m(y[1]+y[3]),s=m(y[0]+y[2]),w,A,u,D,B,G,C,E,I;e.add(l).add(g).width("auto").height("auto").removeClass("fancybox-tmp");y=m(l.outerWidth(!0)-l.width());w=m(l.outerHeight(!0)-l.height());A=z+y;u=s+w;D=F(c)?(a.w-A)*m(c)/100:c;B=F(k)?(a.h-u)*m(k)/100:k;if("iframe"===h.type){if(I=h.content,h.autoHeight&&1===I.data("ready"))try{I[0].contentWindow.document.location&&(g.width(D).height(9999),G=I.contents().find("body"),r&&G.css("overflow-x", 29 | "hidden"),B=G.outerHeight(!0))}catch(H){}}else if(h.autoWidth||h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(D),h.autoHeight||g.height(B),h.autoWidth&&(D=g.width()),h.autoHeight&&(B=g.height()),g.removeClass("fancybox-tmp");c=m(D);k=m(B);E=D/B;n=m(F(n)?m(n,"w")-A:n);p=m(F(p)?m(p,"w")-A:p);v=m(F(v)?m(v,"h")-u:v);q=m(F(q)?m(q,"h")-u:q);G=p;C=q;h.fitToView&&(p=Math.min(a.w-A,p),q=Math.min(a.h-u,q));A=a.w-z;s=a.h-s;h.aspectRatio?(c>p&&(c=p,k=m(c/E)),k>q&&(k=q,c=m(k*E)),cA||z>s)&&c>n&&k>v&&!(19p&&(c=p,k=m(c/E)),g.width(c).height(k),e.width(c+y),a=e.width(),z=e.height();else c=Math.max(n,Math.min(c,c-(a-A))),k=Math.max(v,Math.min(k,k-(z-s)));r&&"auto"===t&&kA||z>s)&&c>n&&k>v;c=h.aspectRatio?cv&&k
    ').appendTo(d&&d.lenth?d:"body");this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(q.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay", 40 | function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive?b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){q.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),this.el.removeClass("fancybox-lock"),q.scrollTop(this.scrollV).scrollLeft(this.scrollH));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%"); 41 | J?(b=Math.max(H.documentElement.offsetWidth,H.body.offsetWidth),p.width()>b&&(a=p.width())):p.width()>q.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&this.fixed&&b.fixed&&(b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){b.locked&&!this.el.hasClass("fancybox-lock")&&(!1!==this.fixPosition&&f("*").filter(function(){return"fixed"=== 42 | f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin"),this.scrollV=q.scrollTop(),this.scrollH=q.scrollLeft(),this.el.addClass("fancybox-lock"),q.scrollTop(this.scrollV).scrollLeft(this.scrollH));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float", 43 | position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(r(e)&&""!==f.trim(e)){d=f('
    '+e+"
    ");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),J&&d.width(d.width()),d.wrapInner(''),b.current.margin[2]+=Math.abs(m(d.css("margin-bottom")))}d["top"===a.position?"prependTo": 44 | "appendTo"](c)}}};f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",l=function(g){var h=f(this).blur(),k=d,l,m;g.ctrlKey||g.altKey||g.shiftKey||g.metaKey||h.is(".fancybox-wrap")||(l=a.groupAttr||"data-fancybox-group",m=h.attr(l),m||(l="rel",m=h.get(0)[l]),m&&""!==m&&"nofollow"!==m&&(h=c.length?f(c):e,h=h.filter("["+l+'="'+m+'"]'),k=h.index(this)),a.index=k,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;c&&!1!==a.live?p.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')", 45 | "click.fb-start",l):e.unbind("click.fb-start").bind("click.fb-start",l);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===w&&(f.scrollbarWidth=function(){var a=f('
    ').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});f.support.fixedPosition===w&&(f.support.fixedPosition=function(){var a=f('
    ').appendTo("body"), 46 | b=20===a[0].offsetTop||15===a[0].offsetTop;a.remove();return b}());f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(s).width();K.addClass("fancybox-lock-test");d=f(s).width();K.removeClass("fancybox-lock-test");f("").appendTo("head")})})(window,document,jQuery); -------------------------------------------------------------------------------- /themes/landscape/source/js/script.js: -------------------------------------------------------------------------------- 1 | (function($){ 2 | // Search 3 | var $searchWrap = $('#search-form-wrap'), 4 | isSearchAnim = false, 5 | searchAnimDuration = 200; 6 | 7 | var startSearchAnim = function(){ 8 | isSearchAnim = true; 9 | }; 10 | 11 | var stopSearchAnim = function(callback){ 12 | setTimeout(function(){ 13 | isSearchAnim = false; 14 | callback && callback(); 15 | }, searchAnimDuration); 16 | }; 17 | 18 | $('#nav-search-btn').on('click', function(){ 19 | if (isSearchAnim) return; 20 | 21 | startSearchAnim(); 22 | $searchWrap.addClass('on'); 23 | stopSearchAnim(function(){ 24 | $('.search-form-input').focus(); 25 | }); 26 | }); 27 | 28 | $('.search-form-input').on('blur', function(){ 29 | startSearchAnim(); 30 | $searchWrap.removeClass('on'); 31 | stopSearchAnim(); 32 | }); 33 | 34 | // Share 35 | $('body').on('click', function(){ 36 | $('.article-share-box.on').removeClass('on'); 37 | }).on('click', '.article-share-link', function(e){ 38 | e.stopPropagation(); 39 | 40 | var $this = $(this), 41 | url = $this.attr('data-url'), 42 | encodedUrl = encodeURIComponent(url), 43 | id = 'article-share-box-' + $this.attr('data-id'), 44 | offset = $this.offset(); 45 | 46 | if ($('#' + id).length){ 47 | var box = $('#' + id); 48 | 49 | if (box.hasClass('on')){ 50 | box.removeClass('on'); 51 | return; 52 | } 53 | } else { 54 | var html = [ 55 | '
    ', 56 | '', 57 | '
    ', 58 | '', 59 | '', 60 | '', 61 | '', 62 | '
    ', 63 | '
    ' 64 | ].join(''); 65 | 66 | var box = $(html); 67 | 68 | $('body').append(box); 69 | } 70 | 71 | $('.article-share-box.on').hide(); 72 | 73 | box.css({ 74 | top: offset.top + 25, 75 | left: offset.left 76 | }).addClass('on'); 77 | }).on('click', '.article-share-box', function(e){ 78 | e.stopPropagation(); 79 | }).on('click', '.article-share-box-input', function(){ 80 | $(this).select(); 81 | }).on('click', '.article-share-box-link', function(e){ 82 | e.preventDefault(); 83 | e.stopPropagation(); 84 | 85 | window.open(this.href, 'article-share-box-window-' + Date.now(), 'width=500,height=450'); 86 | }); 87 | 88 | // Caption 89 | $('.article-entry').each(function(i){ 90 | $(this).find('img').each(function(){ 91 | if ($(this).parent().hasClass('fancybox')) return; 92 | 93 | var alt = this.alt; 94 | 95 | if (alt) $(this).after('' + alt + ''); 96 | 97 | $(this).wrap(''); 98 | }); 99 | 100 | $(this).find('.fancybox').each(function(){ 101 | $(this).attr('rel', 'article' + i); 102 | }); 103 | }); 104 | 105 | if ($.fancybox){ 106 | $('.fancybox').fancybox(); 107 | } 108 | 109 | // Mobile nav 110 | var $container = $('#container'), 111 | isMobileNavAnim = false, 112 | mobileNavAnimDuration = 200; 113 | 114 | var startMobileNavAnim = function(){ 115 | isMobileNavAnim = true; 116 | }; 117 | 118 | var stopMobileNavAnim = function(){ 119 | setTimeout(function(){ 120 | isMobileNavAnim = false; 121 | }, mobileNavAnimDuration); 122 | } 123 | 124 | $('#main-nav-toggle').on('click', function(){ 125 | if (isMobileNavAnim) return; 126 | 127 | startMobileNavAnim(); 128 | $container.toggleClass('mobile-nav-on'); 129 | stopMobileNavAnim(); 130 | }); 131 | 132 | $('#wrap').on('click', function(){ 133 | if (isMobileNavAnim || !$container.hasClass('mobile-nav-on')) return; 134 | 135 | $container.removeClass('mobile-nav-on'); 136 | }); 137 | })(jQuery); --------------------------------------------------------------------------------