cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblot...@apache.org
Subject docs commit: Adding JIRA search from original site's Contribute page.
Date Sat, 08 Aug 2015 02:57:10 GMT
Repository: cordova-docs
Updated Branches:
  refs/heads/cordova-website 27aa83a2a -> 17d4f54c2


Adding JIRA search from original site's Contribute page.


Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/17d4f54c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/17d4f54c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/17d4f54c

Branch: refs/heads/cordova-website
Commit: 17d4f54c22bba15b1c4069be93b2034ee1ec7c97
Parents: 27aa83a
Author: Dmitry Blotsky <dmitry.blotsky@gmail.com>
Authored: Fri Aug 7 19:57:04 2015 -0700
Committer: Dmitry Blotsky <dmitry.blotsky@gmail.com>
Committed: Fri Aug 7 19:57:04 2015 -0700

----------------------------------------------------------------------
 www/static/js/index.js | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/17d4f54c/www/static/js/index.js
----------------------------------------------------------------------
diff --git a/www/static/js/index.js b/www/static/js/index.js
index edd48d1..46c3a48 100644
--- a/www/static/js/index.js
+++ b/www/static/js/index.js
@@ -15,5 +15,44 @@
 // specific language governing permissions and limitations
 // under the License.
 
+function submitJiraSearchForm() {
+    var queryTemplate1 = '(summary ~ "%1" OR description ~ "%1" OR comment ~ "%1") AND ';
+    var queryTemplate2 = 'project = CB AND resolution = Unresolved %2ORDER BY created';
+    var componentKeywords = [
+        /\b(ios|iphone|ipad|ipod)\b/ig, 'iOS',
+        /\b(android)\b/ig, 'Android',
+        /\b(blackberry|rim|bb.?|bb10|webworks)\b/ig, 'BlackBerry',
+        /\b(webos)\b/ig, 'webOS',
+        /\b(wp7|windows phone)\b/ig, 'WP7',
+        /\b(wp8|windows phone)\b/ig, 'WP8'
+        ];
+    var query = document.getElementById('jira-search-box').value;
+    // Check for some platform keywords:
+    var components = [];
+    for (var i = 0; i < componentKeywords.length; i += 2) {
+        if (query.match(componentKeywords[i])) {
+            query = query.replace(componentKeywords[i], '');
+            components.push(componentKeywords[i + 1]);
+        }
+    }
+    var componentsQuery = '';
+    if (components.length) {
+        // Add in components that apply to all platforms.
+        components.push('Docs', 'mobile-spec', 'CordovaJS');
+        componentsQuery = 'AND component in (' + components.join(', ') + ') ';
+    }
+    // Remove quotes since we are adding them in.
+    query = query.replace(/"/g, '');
+    var tokens = query.split(/\s+/);
+    query = '';
+    for (var i = 0; i < tokens.length; ++i) {
+        if (tokens[i]) {
+            query += queryTemplate1.replace(/%1/g, tokens[i]);
+        }
+    }
+    query += queryTemplate2.replace('%2', componentsQuery)
+    window.open('https://issues.apache.org/jira/secure/IssueNavigator.jspa?mode=show&reset=true&navType=simple&jqlQuery='
+ encodeURIComponent(query), '_newtab' + new Date);
+}
+
 $(document).ready(function () {
 });


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


Mime
View raw message