You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ja...@apache.org on 2018/08/10 09:30:07 UTC

[cordova-docs] branch master updated: Remove deprecated platforms from plugin page (#848)

This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-docs.git


The following commit(s) were added to refs/heads/master by this push:
     new 16757ec  Remove deprecated platforms from plugin page (#848)
16757ec is described below

commit 16757ecd04b0cdb4b6d61c427ea2dc6a741f6003
Author: エリス <er...@users.noreply.github.com>
AuthorDate: Fri Aug 10 18:30:03 2018 +0900

    Remove deprecated platforms from plugin page (#848)
    
    * Remove deprecated platforms from plugin page
    - Additionally, added ASF license
---
 www/static/plugins/app.js                 |  33 ++++++---
 www/static/plugins/supportedplatforms.jsx | 110 +++++++++++-------------------
 2 files changed, 64 insertions(+), 79 deletions(-)

diff --git a/www/static/plugins/app.js b/www/static/plugins/app.js
index 57da20e..77b7df3 100755
--- a/www/static/plugins/app.js
+++ b/www/static/plugins/app.js
@@ -1,3 +1,22 @@
+/**
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+*/
+
 var Preact          = window.Preact = require('preact'),
     h               = require('preact').h,
     createClass     = require('preact-compat').createClass,
@@ -476,15 +495,11 @@ var App = createClass({
                         <div className="col-sm-9">
                             <div className="filter-by-platform-label"><span>Must Support Platform(s):</span></div>
                             <div className="filter-by-platform-filters">
-                                {createPlatformButton("Android", "cordova-android", this.state)}
-                                {createPlatformButton("iOS", "cordova-ios", this.state)}
-                                {createPlatformButton("Windows", "cordova-windows", this.state)}
-                                {createPlatformButton("Blackberry", "cordova-blackberry10", this.state)}
-                                {createPlatformButton("Ubuntu", "cordova-ubuntu", this.state)}
-                                {createPlatformButton("Firefox OS", "cordova-firefoxos", this.state)}
-                                {createPlatformButton("macOS", "cordova-osx", this.state)}
-                                {createPlatformButton("WP8", "cordova-wp8", this.state)}
-                                {createPlatformButton("Browser", "cordova-browser", this.state)}
+                                {createPlatformButton('Android', 'cordova-android', this.state)}
+                                {createPlatformButton('iOS', 'cordova-ios', this.state)}
+                                {createPlatformButton('Windows', 'cordova-windows', this.state)}
+                                {createPlatformButton('macOS', 'cordova-osx', this.state)}
+                                {createPlatformButton('Browser', 'cordova-browser', this.state)}
                             </div>
                         </div>
                         <div className="col-sm-3">
diff --git a/www/static/plugins/supportedplatforms.jsx b/www/static/plugins/supportedplatforms.jsx
index 66f41e2..db0d49f 100755
--- a/www/static/plugins/supportedplatforms.jsx
+++ b/www/static/plugins/supportedplatforms.jsx
@@ -1,83 +1,53 @@
-var Preact = require('preact'),
-    h = require('preact').h,
-    createClass = require('preact-compat').createClass,
-    PlatformButton = require('./platformbutton.jsx');
+/**
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
 
-var SupportedPlatforms = createClass({
-    render: function() {
-        var keywords = this.props.keywords;
-        var sortedPlatforms = [
-            {present:false, icon: "android", alt:"Android"},
-            {present:false, icon: "ios", alt:"iOS"},
-            {present:false, icon: "windows", alt:"Windows"},
-            {present:false, icon: "blackberry", alt:"Blackberry"},
-            {present:false, icon: "ubuntu", alt:"Ubuntu"},
-            {present:false, icon: "firefox", alt:"FirefoxOS"},
-            {present:false, icon: "webos", alt:"webOS"},
-            {present:false, icon: "fireos", alt:"FireOS"},
-            {present:false, icon: "osx", alt:"OS X"},
-            {present:false, icon: "browser", alt:"Browser"}
-        ];
+    http://www.apache.org/licenses/LICENSE-2.0
 
-        var platformsSupported = [];
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+*/
 
-        // remove windows8 & windows dupe
-        if (keywords.indexOf('cordova-windows') > -1 && keywords.indexOf('cordova-windows8') > -1) {
-            keywords.splice(keywords.indexOf('cordova-windows8'), 1);
-        }
-        keywords.forEach(function(keyword) {
-            switch (keyword) {
-                case 'cordova-android':
-                    sortedPlatforms[0].present = true;
-                    break;
-                case 'cordova-ios':
-                    sortedPlatforms[1].present = true;
-                    break;
-                case 'cordova-windows8':
-                case 'cordova-windows':
-                    sortedPlatforms[2].present = true;
-                    break;
-                case 'cordova-blackberry10':
-                    sortedPlatforms[3].present = true;
-                    break;
-                case 'cordova-ubuntu':
-                    sortedPlatforms[4].present = true;
-                    break;
-                case 'cordova-firefoxos':
-                    sortedPlatforms[5].present = true;
-                    break;
-                case 'cordova-webos':
-                    sortedPlatforms[6].present = true;
-                    break;
-                case 'cordova-amazon-fireos':
-                    sortedPlatforms[7].present = true;
-                    break;
-                case 'cordova-osx':
-                    sortedPlatforms[8].present = true;
-                    break;
-                case 'cordova-browser':
-                    sortedPlatforms[9].present = true;
-                    break;
-            }
-        });
+const Preact = require('preact'); // eslint-disable-line
+const h = require('preact').h; // eslint-disable-line
+const createClass = require('preact-compat').createClass;
+const PlatformButton = require('./platformbutton.jsx'); // eslint-disable-line
 
-        var that = this;
+const SupportedPlatforms = createClass({
+    render: function () {
+        const sortedPlatforms = [
+            {keyword: 'cordova-android', icon: 'android', alt: 'Android'},
+            {keyword: 'cordova-ios', icon: 'ios', alt: 'iOS'},
+            {keyword: 'cordova-windows', icon: 'windows', alt: 'Windows'},
+            {keyword: 'cordova-osx', icon: 'osx', alt: 'macOS'},
+            {keyword: 'cordova-browser', icon: 'browser', alt: 'Browser'}
+        ];
 
-        sortedPlatforms.forEach(function(platform) {
-            if(platform.present) {
-                // Becuase these images are taken from a sprite sheet, we have
+        const platformsSupported = sortedPlatforms
+            .filter(function (platform) {
+                return this.props.keywords.indexOf(platform.keyword) > -1;
+            }.bind(this))
+            .map(function (platform) {
+                // Because these images are taken from a sprite sheet, we have
                 // to use title rather than alt-text
-                platformsSupported.push(
-                    <li key={that.props.plugin + "-" + platform.alt}>
+                return (
+                    <li key={this.props.plugin + '-' + platform.alt}>
                         <div className={platform.icon} title={platform.alt}></div>
                     </li>
                 );
-            }
-        });
+            }.bind(this));
+
         return (
-            <ul className="results-supported-platforms">
-                {platformsSupported}
-            </ul>
+            <ul className="results-supported-platforms">{platformsSupported}</ul>
         );
     }
 });


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org