community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1768116 - /comdev/projects.apache.org/site/js/projects.js
Date Fri, 04 Nov 2016 22:34:42 GMT
Author: hboutemy
Date: Fri Nov  4 22:34:42 2016
New Revision: 1768116

URL: http://svn.apache.org/viewvc?rev=1768116&view=rev
Log:
improve browser compatibility for String.startsWith

Modified:
    comdev/projects.apache.org/site/js/projects.js

Modified: comdev/projects.apache.org/site/js/projects.js
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/site/js/projects.js?rev=1768116&r1=1768115&r2=1768116&view=diff
==============================================================================
--- comdev/projects.apache.org/site/js/projects.js (original)
+++ comdev/projects.apache.org/site/js/projects.js Fri Nov  4 22:34:42 2016
@@ -1539,7 +1539,14 @@ function fixProjectName(project) {
 
 // Add content by id to projects
 function weaveInProjects(json) {
-    var pfx = "incubator-"
+    var pfx = "incubator-";
+    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
+    if (!String.prototype.startsWith) {
+      String.prototype.startsWith = function (searchString, position) {
+          position = position || 0;
+          return this.substr(position, searchString.length) === searchString;
+      };
+    }
     for (p in json) {
         // podlings are stored without the prefix, so we strip it from the podling DOAPs
         // Since podlings are loaded first, DOAPs take precedence



Mime
View raw message