diff --git a/LICENSE b/LICENSE index 4645bc4bc6..4d747eb68c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013-2015 Yuxi Evan You +Copyright (c) 2013-present Yuxi Evan You Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 93a8c0a3d5..f1643e288e 100644 --- a/README.md +++ b/README.md @@ -11,16 +11,9 @@ $ npm start # dev server at http://localhost:4000 ## Deploying -The site is deployed using GitHub pages, therefore you need push access to the vuejs.org repo to run the deploy script: +The site is automatically deployed when commits land in `master`, via [Netlify](https://www.netlify.com/). -``` bash -$ npm run deploy -``` - -If you are working on a fork and deploying to a different URL, you need to update the following accordingly: - -- `url` and `deploy` sections in `_config.yml` -- `src/CNAME` +If you are the maintainer of a community translation fork and would like to deploy via Netlify instead of GitHub pages, please ping @yyx990803 in an issue to request a Netlify team membership and DNS update. ## On Translations diff --git a/assets/why-vue/chinese.js.srt b/assets/why-vue/chinese.js.srt new file mode 100644 index 0000000000..6659c436ac --- /dev/null +++ b/assets/why-vue/chinese.js.srt @@ -0,0 +1,547 @@ +1 +00:00:00,000 --> 00:00:02,418 +- 在过去的 10 年时间里 +我们的网页变得 + +2 +00:00:02,418 --> 00:00:05,600 +更加动态化和强大了 +多亏有 JavaScript + +3 +00:00:05,600 --> 00:00:07,541 +我们已经把很多传统的 + +4 +00:00:07,541 --> 00:00:10,120 +服务端代码放到了浏览器中 + +5 +00:00:10,120 --> 00:00:13,051 +这样就产生了成千上万行的 JavaScript 代码 + +6 +00:00:13,051 --> 00:00:15,691 +它们连接了各式各样的 HTML 和 CSS 文件 + +7 +00:00:15,691 --> 00:00:17,821 +但缺乏正规的组织形式 + +8 +00:00:17,821 --> 00:00:19,781 +这也是为什么越来越多的开发者使用 + +9 +00:00:19,781 --> 00:00:23,948 +诸如 Angular、React 或 Vue 这样的 +JavaScript 框架 + +10 +00:00:24,821 --> 00:00:27,829 +Vue 是一款友好的、多用途且高性能的 + +11 +00:00:27,829 --> 00:00:29,860 +JavaScript 框架 +它能够帮助你创建 + +12 +00:00:29,860 --> 00:00:33,381 +可维护性和可测试性更强的代码库 + +13 +00:00:33,381 --> 00:00:36,229 +Vue 是渐进式的 JavaScript 框架 +也就是说 + +14 +00:00:36,229 --> 00:00:38,621 +如果你已经有一个现成的服务端应用 + +15 +00:00:38,621 --> 00:00:41,627 +你可以将 Vue 作为该应用的一部分嵌入其中 + +16 +00:00:41,627 --> 00:00:44,381 +带来更加丰富的交互体验 + +17 +00:00:44,381 --> 00:00:46,269 +或者,如果你希望将更多业务逻辑 + +18 +00:00:46,269 --> 00:00:48,240 +放到前端来实现 + +19 +00:00:48,240 --> 00:00:50,611 +那么 Vue 的核心库及其生态系统 + +20 +00:00:50,611 --> 00:00:52,421 +也可以满足你的各式需求 + +21 +00:00:52,421 --> 00:00:53,829 +和其它前端框架一样 + +22 +00:00:53,829 --> 00:00:55,960 +Vue 允许你将一个网页分割成 + +23 +00:00:55,960 --> 00:01:00,000 +可复用的组件 +每个组件都包含属于自己的 HTML + +24 +00:01:00,000 --> 00:01:02,291 +CSS、JavaScript 以用来渲染 + +25 +00:01:02,291 --> 00:01:04,269 +网页中相应的地方 + +26 +00:01:04,269 --> 00:01:06,260 +接下来我们就亲自动手感受一下 Vue + +27 +00:01:06,260 --> 00:01:08,301 +构建一个商品库存的页面 + +28 +00:01:08,301 --> 00:01:10,187 +也敬请关注视频结尾 + +29 +00:01:10,187 --> 00:01:13,571 +来自 Vue 的作者尤雨溪发来的信息 + +30 +00:01:13,571 --> 00:01:15,301 +我们不是教你如何使用 Vue + +31 +00:01:15,301 --> 00:01:16,981 +而是介绍一些核心概念 + +32 +00:01:16,981 --> 00:01:19,460 +正是这些东西让 Vue 如此实用 + +33 +00:01:19,460 --> 00:01:21,200 +和许多 JavaScript 应用一样 + +34 +00:01:21,200 --> 00:01:24,272 +我们从网页中需要展示的数据开始 + +35 +00:01:24,272 --> 00:01:26,591 +使用 Vue 的起步非常简单 + +36 +00:01:26,591 --> 00:01:29,745 +我们引入 Vue 库 +创建一个 Vue 的实例 + +37 +00:01:29,745 --> 00:01:33,673 +然后通过应用的 id 嵌入到我们的根元素中 + +38 +00:01:33,673 --> 00:01:36,032 +“el”是元素 (element) 的缩写 + +39 +00:01:36,032 --> 00:01:39,505 +我们还要将数据放入一个对象 + +40 +00:01:39,505 --> 00:01:41,993 +并且将 X 修改为一个表达式 + +41 +00:01:41,993 --> 00:01:44,544 +用双大括号括起来 + +42 +00:01:44,544 --> 00:01:46,945 +如你所看到的,它已经工作起来了 + +43 +00:01:46,945 --> 00:01:50,695 +很酷,但是 Vue 的魔力在数据变更时才会出现 + +44 +00:01:50,695 --> 00:01:51,975 +如果我们打开控制台 + +45 +00:01:51,975 --> 00:01:54,735 +改变 product 的值 + +46 +00:01:54,735 --> 00:01:57,324 +注意在 product 的值改变的同时 + +47 +00:01:57,324 --> 00:01:59,953 +Vue 自动更新了我们的 HTML + +48 +00:01:59,953 --> 00:02:01,745 +这是因为 Vue 是响应式的 + +49 +00:02:01,745 --> 00:02:03,273 +也就是说当我们的数据变更时 + +50 +00:02:03,273 --> 00:02:05,193 +Vue 会帮你更新所有 + +51 +00:02:05,193 --> 00:02:07,255 +网页中用到它的地方 + +52 +00:02:07,255 --> 00:02:10,305 +除了字符串,Vue 对其它类型的数据也是如此 + +53 +00:02:10,305 --> 00:02:11,604 +所以我们把这个简单的商品换成 + +54 +00:02:11,604 --> 00:02:14,604 +一个商品数组试试看 + +55 +00:02:14,604 --> 00:02:17,865 +然后我们将
{{ coins[type].name }} Address:
{{ coins[type].address }}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -### OpenCollective Gold - - - -If you run a business and are using Vue in a revenue-generating product, it makes business sense to sponsor Vue development: **it ensures the project that your product relies on stays healthy and actively maintained.** It can also help your exposure in the Vue community and makes it easier to attract Vue developers. - -If you are a business that is building core products using Vue.js, I am also open to conversations regarding custom sponsorship / consulting arrangements. [Get in touch on Twitter](https://twitter.com/youyuxi). - -If you are an individual user and have enjoyed the productivity of using Vue, consider donating as a sign of appreciation - like buying me coffee once in a while :) +--- +sponsors: true +--- diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 5e99f20c28..af9ae26b9a 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -327,6 +327,8 @@ type: api var myFilter = Vue.filter('my-filter') ``` +- **See also:** [Filters](../guide/filters.html) + ### Vue.component( id, [definition] ) - **Arguments:** @@ -592,7 +594,7 @@ type: api ### watch -- **Type:** `{ [key: string]: string | Function | Object }` +- **Type:** `{ [key: string]: string | Function | Object | Array}` - **Details:** @@ -606,7 +608,12 @@ type: api a: 1, b: 2, c: 3, - d: 4 + d: 4, + e: { + f: { + g: 5 + } + } }, watch: { a: function (val, oldVal) { @@ -623,7 +630,13 @@ type: api d: { handler: function (val, oldVal) { /* ... */ }, immediate: true - } + }, + e: [ + function handle1 (val, oldVal) { /* ... */ }, + function handle2 (val, oldVal) { /* ... */ } + ], + // watch vm.e.f's value: {g: 5} + 'e.f': function (val, oldVal) { /* ... */ } } }) vm.a = 2 // => new: 2, old: 1 @@ -781,11 +794,9 @@ type: api - **Details:** - Called when the data changes, before the virtual DOM is re-rendered and patched. - - You can perform further state changes in this hook and they will not trigger additional re-renders. + Called when data changes, before the DOM is patched. This is a good place to access the existing DOM before an update, e.g. to remove manually added event listeners. - **This hook is not called during server-side rendering.** + **This hook is not called during server-side rendering, because only the initial render is performed server-side.** - **See also:** [Lifecycle Diagram](../guide/instance.html#Lifecycle-Diagram) @@ -1708,7 +1719,7 @@ type: api - **Usage:** - Toggle's the element's `display` CSS property based on the truthy-ness of the expression value. + Toggles the element's `display` CSS property based on the truthy-ness of the expression value. This directive triggers transitions when its condition changes. diff --git a/src/v2/cookbook/adding-instance-properties.md b/src/v2/cookbook/adding-instance-properties.md index b9b03d6abb..6c67dc369b 100644 --- a/src/v2/cookbook/adding-instance-properties.md +++ b/src/v2/cookbook/adding-instance-properties.md @@ -1,7 +1,7 @@ --- title: Adding Instance Properties type: cookbook -order: 1.1 +order: 1.3 --- ## Simple Example diff --git a/src/v2/cookbook/unit-testing-vue-components.md b/src/v2/cookbook/unit-testing-vue-components.md new file mode 100644 index 0000000000..e8c5a95825 --- /dev/null +++ b/src/v2/cookbook/unit-testing-vue-components.md @@ -0,0 +1,247 @@ +--- +title: Unit Testing Vue Components +type: cookbook +order: 1.4 +--- + +## Simple Example + +Unit testing is a fundamental part of software development. Unit tests execute the smallest units of code in isolation, in order to increase ease of adding new features and track down bugs. Vue's [single-file components](./single-file-components.html) make it straight forward to write unit tests for components in isolation. This lets you develop new features with confidence you are not breaking existing ones, and helps other developers understand what your component does. + +This simple example tests whether some text is rendered: + +```html + +Don't use `.passive` and `.prevent` together. Passive handler can't prevent default event.
+Don't use `.passive` and `.prevent` together, because `.prevent` will be ignored and your browser will probably show you a warning. Remember, `.passive` communicates to the browser that you _don't_ want to prevent the event's default behavior.
## Key Modifiers @@ -256,7 +258,7 @@ You can also [define custom key modifier aliases](../api/#keyCodes) via the glob Vue.config.keyCodes.f1 = 112 ``` -### Automatic Key Modifers +### Automatic Key Modifiers > New in 2.5.0+ diff --git a/src/v2/guide/filters.md b/src/v2/guide/filters.md index 529efaddd9..4a6eecdbf2 100644 --- a/src/v2/guide/filters.md +++ b/src/v2/guide/filters.md @@ -26,7 +26,7 @@ filters: { } ``` -or define a filter globally: +or define a filter globally before creating the Vue instance: ``` js Vue.filter('capitalize', function (value) { @@ -34,6 +34,10 @@ Vue.filter('capitalize', function (value) { value = value.toString() return value.charAt(0).toUpperCase() + value.slice(1) }) + +new Vue({ + // ... +}) ``` Below is an example of our `capitalize` filter being used: diff --git a/src/v2/guide/index.md b/src/v2/guide/index.md index f2b3e9d703..a19df7a4fa 100644 --- a/src/v2/guide/index.md +++ b/src/v2/guide/index.md @@ -8,6 +8,8 @@ order: 2 Vue (pronounced /vjuː/, like **view**) is a **progressive framework** for building user interfaces. Unlike other monolithic frameworks, Vue is designed from the ground up to be incrementally adoptable. The core library is focused on the view layer only, and is easy to pick up and integrate with other libraries or existing projects. On the other hand, Vue is also perfectly capable of powering sophisticated Single-Page Applications when used in combination with [modern tooling](single-file-components.html) and [supporting libraries](https://github.com/vuejs/awesome-vue#components--libraries). +If you’d like to learn more about Vue before diving in, we created a video walking through the core principles and a sample project. + If you are an experienced frontend developer and want to know how Vue compares to other libraries/frameworks, check out the [Comparison with Other Frameworks](comparison.html). ## Getting Started @@ -374,3 +376,5 @@ You may have noticed that Vue components are very similar to **Custom Elements** ## Ready for More? We've briefly introduced the most basic features of Vue.js core - the rest of this guide will cover them and other advanced features with much finer details, so make sure to read through it all! + ++Recurring pledges come with exclusive perks, e.g. having your name listed in the Vue GitHub repository, or have your company logo placed on this website. +
+ ++<%_ for (const sponsor of theme.platinum_sponsors) {_%> + + + +<%_ } _%> +
+ ++<%_ for (let i = 0; i < 3; i++) {_%> + + + +<%_ } _%> +
+ ++<%_ for (const sponsor of theme.gold_sponsors) {_%> + + + +<%_ } _%> +
+ ++<%_ for (let i = 0; i < 10; i++) {_%> + + + +<%_ } _%> +
+ ++If you run a business and are using Vue in a revenue-generating product, it makes business sense to sponsor Vue development: it ensures the project that your product relies on stays healthy and actively maintained. It can also help your exposure in the Vue community and makes it easier to attract Vue developers. +
+ ++If you are an individual user and have enjoyed the productivity of using Vue, consider donating as a sign of appreciation - like buying me coffee once in a while :) +
diff --git a/themes/vue/source/css/_sponsor.styl b/themes/vue/source/css/_sponsor.styl index 7ad2371345..10f177fe5e 100644 --- a/themes/vue/source/css/_sponsor.styl +++ b/themes/vue/source/css/_sponsor.styl @@ -52,6 +52,14 @@ // support-vuejs page .content + .platinum + text-align center + a + display inline-block + margin 20px + img + width 250px + .sponsor-section text-align center margin-top 0 @@ -59,7 +67,7 @@ .patreon-sponsors a, img - width: 120px + width: 140px display: inline-block vertical-align: middle a diff --git a/themes/vue/source/css/page.styl b/themes/vue/source/css/page.styl index 76b3705f4b..b0cc59ddd4 100644 --- a/themes/vue/source/css/page.styl +++ b/themes/vue/source/css/page.styl @@ -9,6 +9,7 @@ @import "_offline-menu" @import "_team" @import "_style-guide" +@import "_modal" #header box-shadow: 0 0 1px rgba(0,0,0,.25) @@ -53,7 +54,7 @@ margin: 0 0 1em h2, h3 pointer-events: none - a + a, button pointer-events: auto color: $dark &:before @@ -215,7 +216,7 @@ .highlight pre padding: 1.2em 1em .content - padding-left 0 + padding-left: 0 &.with-sidebar margin: auto h2, h3 diff --git a/themes/vue/source/images/100offer.png b/themes/vue/source/images/100offer.png index 3fb9759bb1..4f7f4fe9c0 100644 Binary files a/themes/vue/source/images/100offer.png and b/themes/vue/source/images/100offer.png differ diff --git a/themes/vue/source/images/2mhost.png b/themes/vue/source/images/2mhost.png index 41aa89f234..8569af1692 100644 Binary files a/themes/vue/source/images/2mhost.png and b/themes/vue/source/images/2mhost.png differ diff --git a/themes/vue/source/images/actualize.png b/themes/vue/source/images/actualize.png index eaa4ccbe83..08a918e77d 100644 Binary files a/themes/vue/source/images/actualize.png and b/themes/vue/source/images/actualize.png differ diff --git a/themes/vue/source/images/anymod.png b/themes/vue/source/images/anymod.png index c3bec55661..20d0b8b3aa 100644 Binary files a/themes/vue/source/images/anymod.png and b/themes/vue/source/images/anymod.png differ diff --git a/themes/vue/source/images/chaitin.png b/themes/vue/source/images/chaitin.png index ec5f8d5a6b..e2b41a92cf 100644 Binary files a/themes/vue/source/images/chaitin.png and b/themes/vue/source/images/chaitin.png differ diff --git a/themes/vue/source/images/check.png b/themes/vue/source/images/check.png index 4b364ff36d..298e2b713d 100644 Binary files a/themes/vue/source/images/check.png and b/themes/vue/source/images/check.png differ diff --git a/themes/vue/source/images/coin-bch.png b/themes/vue/source/images/coin-bch.png index 816e5d3307..26c2d0d3e2 100644 Binary files a/themes/vue/source/images/coin-bch.png and b/themes/vue/source/images/coin-bch.png differ diff --git a/themes/vue/source/images/coin-btc.png b/themes/vue/source/images/coin-btc.png index a50459c4ad..e07feece1f 100644 Binary files a/themes/vue/source/images/coin-btc.png and b/themes/vue/source/images/coin-btc.png differ diff --git a/themes/vue/source/images/coin-eth.png b/themes/vue/source/images/coin-eth.png index 40aef76acd..dc3ac5558a 100644 Binary files a/themes/vue/source/images/coin-eth.png and b/themes/vue/source/images/coin-eth.png differ diff --git a/themes/vue/source/images/coin-ltc.png b/themes/vue/source/images/coin-ltc.png index 3f2fbbacd7..a1142e54d0 100644 Binary files a/themes/vue/source/images/coin-ltc.png and b/themes/vue/source/images/coin-ltc.png differ diff --git a/themes/vue/source/images/conf.png b/themes/vue/source/images/conf.png index cb11b01ba2..e23bbf9f3c 100644 Binary files a/themes/vue/source/images/conf.png and b/themes/vue/source/images/conf.png differ diff --git a/themes/vue/source/images/datacamp.png b/themes/vue/source/images/datacamp.png new file mode 100644 index 0000000000..f92a9e98f0 Binary files /dev/null and b/themes/vue/source/images/datacamp.png differ diff --git a/themes/vue/source/images/down.png b/themes/vue/source/images/down.png index 9b742087c4..4027b0f717 100644 Binary files a/themes/vue/source/images/down.png and b/themes/vue/source/images/down.png differ diff --git a/themes/vue/source/images/famebroker.png b/themes/vue/source/images/famebroker.png index 827989b192..e137b2df2f 100644 Binary files a/themes/vue/source/images/famebroker.png and b/themes/vue/source/images/famebroker.png differ diff --git a/themes/vue/source/images/feed.png b/themes/vue/source/images/feed.png index b0da35058b..cbf39571ed 100644 Binary files a/themes/vue/source/images/feed.png and b/themes/vue/source/images/feed.png differ diff --git a/themes/vue/source/images/frontend-love.png b/themes/vue/source/images/frontend-love.png index bdfc5623b8..a2f69923a0 100644 Binary files a/themes/vue/source/images/frontend-love.png and b/themes/vue/source/images/frontend-love.png differ diff --git a/themes/vue/source/images/frontend-meetups.png b/themes/vue/source/images/frontend-meetups.png index 75ad3e0e2f..388bb14d2e 100644 Binary files a/themes/vue/source/images/frontend-meetups.png and b/themes/vue/source/images/frontend-meetups.png differ diff --git a/themes/vue/source/images/htmlburger.png b/themes/vue/source/images/htmlburger.png index d623de96f8..7f6a026a05 100644 Binary files a/themes/vue/source/images/htmlburger.png and b/themes/vue/source/images/htmlburger.png differ diff --git a/themes/vue/source/images/icons.png b/themes/vue/source/images/icons.png index 1866ac5621..ec9aa451a0 100644 Binary files a/themes/vue/source/images/icons.png and b/themes/vue/source/images/icons.png differ diff --git a/themes/vue/source/images/icons/android-icon-144x144.png b/themes/vue/source/images/icons/android-icon-144x144.png index c30cbd9253..c4b2a7425b 100644 Binary files a/themes/vue/source/images/icons/android-icon-144x144.png and b/themes/vue/source/images/icons/android-icon-144x144.png differ diff --git a/themes/vue/source/images/icons/android-icon-192x192.png b/themes/vue/source/images/icons/android-icon-192x192.png index 3a85b3d2a6..9d1d5fe059 100644 Binary files a/themes/vue/source/images/icons/android-icon-192x192.png and b/themes/vue/source/images/icons/android-icon-192x192.png differ diff --git a/themes/vue/source/images/icons/android-icon-36x36.png b/themes/vue/source/images/icons/android-icon-36x36.png index 5ab689783d..8d8696d2b8 100644 Binary files a/themes/vue/source/images/icons/android-icon-36x36.png and b/themes/vue/source/images/icons/android-icon-36x36.png differ diff --git a/themes/vue/source/images/icons/android-icon-48x48.png b/themes/vue/source/images/icons/android-icon-48x48.png index cbfc235969..508524bab7 100644 Binary files a/themes/vue/source/images/icons/android-icon-48x48.png and b/themes/vue/source/images/icons/android-icon-48x48.png differ diff --git a/themes/vue/source/images/icons/android-icon-72x72.png b/themes/vue/source/images/icons/android-icon-72x72.png index e9fc0eb9ea..7dda937b24 100644 Binary files a/themes/vue/source/images/icons/android-icon-72x72.png and b/themes/vue/source/images/icons/android-icon-72x72.png differ diff --git a/themes/vue/source/images/icons/android-icon-96x96.png b/themes/vue/source/images/icons/android-icon-96x96.png index d798f3bdd6..a4756ba4f4 100644 Binary files a/themes/vue/source/images/icons/android-icon-96x96.png and b/themes/vue/source/images/icons/android-icon-96x96.png differ diff --git a/themes/vue/source/images/icons/apple-icon-114x114.png b/themes/vue/source/images/icons/apple-icon-114x114.png index 2c2c15cfc1..f678b645d3 100644 Binary files a/themes/vue/source/images/icons/apple-icon-114x114.png and b/themes/vue/source/images/icons/apple-icon-114x114.png differ diff --git a/themes/vue/source/images/icons/apple-icon-120x120.png b/themes/vue/source/images/icons/apple-icon-120x120.png index ee088e37d8..983cb6b7aa 100644 Binary files a/themes/vue/source/images/icons/apple-icon-120x120.png and b/themes/vue/source/images/icons/apple-icon-120x120.png differ diff --git a/themes/vue/source/images/icons/apple-icon-144x144.png b/themes/vue/source/images/icons/apple-icon-144x144.png index c30cbd9253..c4b2a7425b 100644 Binary files a/themes/vue/source/images/icons/apple-icon-144x144.png and b/themes/vue/source/images/icons/apple-icon-144x144.png differ diff --git a/themes/vue/source/images/icons/apple-icon-152x152.png b/themes/vue/source/images/icons/apple-icon-152x152.png index 6009b97c2c..a0b6ec6dc2 100644 Binary files a/themes/vue/source/images/icons/apple-icon-152x152.png and b/themes/vue/source/images/icons/apple-icon-152x152.png differ diff --git a/themes/vue/source/images/icons/apple-icon-180x180.png b/themes/vue/source/images/icons/apple-icon-180x180.png index 83b1577dc5..997e6156ea 100644 Binary files a/themes/vue/source/images/icons/apple-icon-180x180.png and b/themes/vue/source/images/icons/apple-icon-180x180.png differ diff --git a/themes/vue/source/images/icons/apple-icon-57x57.png b/themes/vue/source/images/icons/apple-icon-57x57.png index acf8558564..0ec32b3fc4 100644 Binary files a/themes/vue/source/images/icons/apple-icon-57x57.png and b/themes/vue/source/images/icons/apple-icon-57x57.png differ diff --git a/themes/vue/source/images/icons/apple-icon-60x60.png b/themes/vue/source/images/icons/apple-icon-60x60.png index 2d5bac8510..0f272ef695 100644 Binary files a/themes/vue/source/images/icons/apple-icon-60x60.png and b/themes/vue/source/images/icons/apple-icon-60x60.png differ diff --git a/themes/vue/source/images/icons/apple-icon-72x72.png b/themes/vue/source/images/icons/apple-icon-72x72.png index e9fc0eb9ea..7dda937b24 100644 Binary files a/themes/vue/source/images/icons/apple-icon-72x72.png and b/themes/vue/source/images/icons/apple-icon-72x72.png differ diff --git a/themes/vue/source/images/icons/apple-icon-76x76.png b/themes/vue/source/images/icons/apple-icon-76x76.png index 8a16d37dc9..bb87549207 100644 Binary files a/themes/vue/source/images/icons/apple-icon-76x76.png and b/themes/vue/source/images/icons/apple-icon-76x76.png differ diff --git a/themes/vue/source/images/icons/apple-icon-precomposed.png b/themes/vue/source/images/icons/apple-icon-precomposed.png index 701d462c3b..9b0c56e10c 100644 Binary files a/themes/vue/source/images/icons/apple-icon-precomposed.png and b/themes/vue/source/images/icons/apple-icon-precomposed.png differ diff --git a/themes/vue/source/images/icons/apple-icon.png b/themes/vue/source/images/icons/apple-icon.png index 701d462c3b..9b0c56e10c 100644 Binary files a/themes/vue/source/images/icons/apple-icon.png and b/themes/vue/source/images/icons/apple-icon.png differ diff --git a/themes/vue/source/images/icons/favicon-16x16.png b/themes/vue/source/images/icons/favicon-16x16.png index 1d30e35310..60be03c855 100644 Binary files a/themes/vue/source/images/icons/favicon-16x16.png and b/themes/vue/source/images/icons/favicon-16x16.png differ diff --git a/themes/vue/source/images/icons/favicon-32x32.png b/themes/vue/source/images/icons/favicon-32x32.png index 81cb15fd71..ce327e8681 100644 Binary files a/themes/vue/source/images/icons/favicon-32x32.png and b/themes/vue/source/images/icons/favicon-32x32.png differ diff --git a/themes/vue/source/images/icons/favicon-96x96.png b/themes/vue/source/images/icons/favicon-96x96.png index d798f3bdd6..a4756ba4f4 100644 Binary files a/themes/vue/source/images/icons/favicon-96x96.png and b/themes/vue/source/images/icons/favicon-96x96.png differ diff --git a/themes/vue/source/images/icons/ms-icon-144x144.png b/themes/vue/source/images/icons/ms-icon-144x144.png index c30cbd9253..c4b2a7425b 100644 Binary files a/themes/vue/source/images/icons/ms-icon-144x144.png and b/themes/vue/source/images/icons/ms-icon-144x144.png differ diff --git a/themes/vue/source/images/icons/ms-icon-150x150.png b/themes/vue/source/images/icons/ms-icon-150x150.png index bb94b67c91..962e04fece 100644 Binary files a/themes/vue/source/images/icons/ms-icon-150x150.png and b/themes/vue/source/images/icons/ms-icon-150x150.png differ diff --git a/themes/vue/source/images/icons/ms-icon-310x310.png b/themes/vue/source/images/icons/ms-icon-310x310.png index c896c12065..264c3f83ab 100644 Binary files a/themes/vue/source/images/icons/ms-icon-310x310.png and b/themes/vue/source/images/icons/ms-icon-310x310.png differ diff --git a/themes/vue/source/images/icons/ms-icon-70x70.png b/themes/vue/source/images/icons/ms-icon-70x70.png index f680d46f05..fde6d8188f 100644 Binary files a/themes/vue/source/images/icons/ms-icon-70x70.png and b/themes/vue/source/images/icons/ms-icon-70x70.png differ diff --git a/themes/vue/source/images/infinitynewtab.png b/themes/vue/source/images/infinitynewtab.png index d46b6bb76e..bfe5a8c48a 100644 Binary files a/themes/vue/source/images/infinitynewtab.png and b/themes/vue/source/images/infinitynewtab.png differ diff --git a/themes/vue/source/images/itunescn.png b/themes/vue/source/images/itunescn.png index 85beefcdc3..7f89ffa8f5 100644 Binary files a/themes/vue/source/images/itunescn.png and b/themes/vue/source/images/itunescn.png differ diff --git a/themes/vue/source/images/jsfiddle.png b/themes/vue/source/images/jsfiddle.png index fe86bd3122..09774391a1 100644 Binary files a/themes/vue/source/images/jsfiddle.png and b/themes/vue/source/images/jsfiddle.png differ diff --git a/themes/vue/source/images/juejin.png b/themes/vue/source/images/juejin.png index 07933faa88..afc07f75af 100644 Binary files a/themes/vue/source/images/juejin.png and b/themes/vue/source/images/juejin.png differ diff --git a/themes/vue/source/images/laravel.png b/themes/vue/source/images/laravel.png index fd15af5cc2..1533073c73 100644 Binary files a/themes/vue/source/images/laravel.png and b/themes/vue/source/images/laravel.png differ diff --git a/themes/vue/source/images/logo.png b/themes/vue/source/images/logo.png index 74389d8ca0..60e17006ad 100644 Binary files a/themes/vue/source/images/logo.png and b/themes/vue/source/images/logo.png differ diff --git a/themes/vue/source/images/menu.png b/themes/vue/source/images/menu.png index 3d6156541a..5ee84638aa 100644 Binary files a/themes/vue/source/images/menu.png and b/themes/vue/source/images/menu.png differ diff --git a/themes/vue/source/images/monterail.png b/themes/vue/source/images/monterail.png index ddc9ad4b75..ab641a54e1 100644 Binary files a/themes/vue/source/images/monterail.png and b/themes/vue/source/images/monterail.png differ diff --git a/themes/vue/source/images/neds.png b/themes/vue/source/images/neds.png new file mode 100644 index 0000000000..6169a0ff07 Binary files /dev/null and b/themes/vue/source/images/neds.png differ diff --git a/themes/vue/source/images/onsen-ui.png b/themes/vue/source/images/onsen-ui.png index 6a2b210402..9c7653c57f 100644 Binary files a/themes/vue/source/images/onsen-ui.png and b/themes/vue/source/images/onsen-ui.png differ diff --git a/themes/vue/source/images/patreon.png b/themes/vue/source/images/patreon.png index 15ab835f66..95d3a7e698 100644 Binary files a/themes/vue/source/images/patreon.png and b/themes/vue/source/images/patreon.png differ diff --git a/themes/vue/source/images/paypal.png b/themes/vue/source/images/paypal.png index 589e98d4b6..aa7213b778 100644 Binary files a/themes/vue/source/images/paypal.png and b/themes/vue/source/images/paypal.png differ diff --git a/themes/vue/source/images/search.png b/themes/vue/source/images/search.png index 98b4e421c5..09b41535f9 100644 Binary files a/themes/vue/source/images/search.png and b/themes/vue/source/images/search.png differ diff --git a/themes/vue/source/images/someline.png b/themes/vue/source/images/someline.png index f0b633879f..b8b160a74b 100644 Binary files a/themes/vue/source/images/someline.png and b/themes/vue/source/images/someline.png differ diff --git a/themes/vue/source/images/stdlib.png b/themes/vue/source/images/stdlib.png index 78d0067a58..990387f96c 100644 Binary files a/themes/vue/source/images/stdlib.png and b/themes/vue/source/images/stdlib.png differ diff --git a/themes/vue/source/images/strikingly.png b/themes/vue/source/images/strikingly.png index 0991b49f16..d2c33aaa7c 100644 Binary files a/themes/vue/source/images/strikingly.png and b/themes/vue/source/images/strikingly.png differ diff --git a/themes/vue/source/images/tde.png b/themes/vue/source/images/tde.png index db75ae4e1b..7e20dce2b6 100644 Binary files a/themes/vue/source/images/tde.png and b/themes/vue/source/images/tde.png differ diff --git a/themes/vue/source/images/tmvuejs2.png b/themes/vue/source/images/tmvuejs2.png index f7ea881a09..3874c04a7c 100644 Binary files a/themes/vue/source/images/tmvuejs2.png and b/themes/vue/source/images/tmvuejs2.png differ diff --git a/themes/vue/source/images/tooltwist.png b/themes/vue/source/images/tooltwist.png index 4749efb7fd..0767889f1f 100644 Binary files a/themes/vue/source/images/tooltwist.png and b/themes/vue/source/images/tooltwist.png differ diff --git a/themes/vue/source/images/vuejobs.png b/themes/vue/source/images/vuejobs.png index bc346238d1..831017c077 100644 Binary files a/themes/vue/source/images/vuejobs.png and b/themes/vue/source/images/vuejobs.png differ diff --git a/themes/vue/source/images/vuejsadmin.png b/themes/vue/source/images/vuejsadmin.png index 81afb1b63d..9b034daabb 100644 Binary files a/themes/vue/source/images/vuejsadmin.png and b/themes/vue/source/images/vuejsadmin.png differ diff --git a/themes/vue/source/images/vueschool.png b/themes/vue/source/images/vueschool.png index 9b7f47d702..28ab527577 100644 Binary files a/themes/vue/source/images/vueschool.png and b/themes/vue/source/images/vueschool.png differ diff --git a/themes/vue/source/images/vuetify.png b/themes/vue/source/images/vuetify.png index 78151a85be..3f1b65703e 100644 Binary files a/themes/vue/source/images/vuetify.png and b/themes/vue/source/images/vuetify.png differ diff --git a/themes/vue/source/images/xfive.png b/themes/vue/source/images/xfive.png index 2c97bcf3d4..e2af1999f6 100644 Binary files a/themes/vue/source/images/xfive.png and b/themes/vue/source/images/xfive.png differ diff --git a/themes/vue/source/js/common.js b/themes/vue/source/js/common.js index 9ba7686c81..c2ab9e794b 100644 --- a/themes/vue/source/js/common.js +++ b/themes/vue/source/js/common.js @@ -3,8 +3,8 @@ initVideoModal() if (PAGE_TYPE) { initVersionSelect() - initSubHeaders() initApiSpecLinks() + initSubHeaders() initLocationHashFuzzyMatching() } @@ -144,15 +144,18 @@ * Modal Video Player */ function initVideoModal () { - if (typeof Vimeo === 'undefined') return - var modalButton = document.getElementById('modal-player') var videoModal = document.getElementById('video-modal') - var iframe = document.querySelector('iframe'); - var player = new Vimeo.Player(iframe); + + if (!modalButton || !videoModal) { + return + } + + var iframe = document.querySelector('iframe') + var player = new Vimeo.Player(iframe) var overlay = document.createElement('div') overlay.className = 'overlay' - + var isOpen = false modalButton.addEventListener('click', function(event) { event.stopPropagation() @@ -160,14 +163,16 @@ document.body.classList.toggle('stop-scroll') document.body.appendChild(overlay) player.play() + isOpen = true }) document.body.addEventListener('click', function(e) { - if (e.target !== modalButton && !videoModal.contains(e.target)) { + if (isOpen && e.target !== modalButton && !videoModal.contains(e.target)) { videoModal.classList.remove('open') document.body.classList.remove('stop-scroll') document.body.removeChild(overlay) player.unload() + isOpen = false } }) }