janpio closed pull request #848: Remove deprecated platforms from plugin page
URL: https://github.com/apache/cordova-docs/pull/848
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/www/static/plugins/app.js b/www/static/plugins/app.js
index 57da20eb1..77b7df384 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 66f41e285..db0d49ffc 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>
         );
     }
 });


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to