ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject [4/4] incubator-ponymail git commit: regen JS
Date Tue, 06 Sep 2016 14:12:15 GMT
regen JS


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/62ea9663
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/62ea9663
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/62ea9663

Branch: refs/heads/coffee-and-cake
Commit: 62ea9663d5bbf6e64486fc64f295732048b6db9a
Parents: 5d93014
Author: Daniel Gruno <humbedooh@apache.org>
Authored: Tue Sep 6 16:11:59 2016 +0200
Committer: Daniel Gruno <humbedooh@apache.org>
Committed: Tue Sep 6 16:11:59 2016 +0200

----------------------------------------------------------------------
 site/js/ponymail-coffee.js | 98 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 93 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/62ea9663/site/js/ponymail-coffee.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail-coffee.js b/site/js/ponymail-coffee.js
index f9db991..f873618 100644
--- a/site/js/ponymail-coffee.js
+++ b/site/js/ponymail-coffee.js
@@ -1,5 +1,5 @@
 // Generated by CoffeeScript 1.9.3
-var BasicEmailDisplay, BasicListView, Calendar, DateEmailDisplay, HTML, HTTPRequest, SingleListView,
ThreadedEmailDisplay, calendar_months, cog, dbRead, dbWrite, dealWithKeyboard, e, footerScaffolding,
genColors, get, hasRead, headerScaffolding, hsl2rgb, isArray, isHash, listView, listviewScaffolding,
markRead, maxLists, parseURL, pendingURLStatus, pending_spinner_at, pending_url_operations,
pm_snap, pm_storage_available, pm_storage_globvar, ponymail_current_email, ponymail_current_listview,
ponymail_display_models, ponymail_domain, ponymail_email_open, ponymail_list, ponymail_list_json,
ponymail_listname, ponymail_lists, ponymail_listview_models, ponymail_month, ponymail_preferences,
ponymail_query, ponymail_quote_regex, ponymail_register_display, ponymail_register_listview,
ponymail_stored_email, ponymail_url_regex, ponymail_version, readEmail, renderListView, scaffoldingEmailCallback,
set, setupAccount, spinCheck, testCoffee, testToggle, threadScaffolding, toggleMonth, toggleQuot
 e, toggleYear, txt,
+var BasicEmailDisplay, BasicListView, Calendar, DateEmailDisplay, HTML, HTTPRequest, SingleListView,
ThreadedEmailDisplay, calendar_months, cog, dbRead, dbWrite, dealWithKeyboard, e, footerScaffolding,
genColors, get, hasRead, headerScaffolding, hsl2rgb, isArray, isHash, listView, listviewScaffolding,
markRead, maxLists, parseURL, pendingURLStatus, pending_spinner_at, pending_url_operations,
pm_snap, pm_storage_available, pm_storage_globvar, ponymail_current_email, ponymail_current_listview,
ponymail_display_models, ponymail_domain, ponymail_email_open, ponymail_list, ponymail_list_json,
ponymail_listname, ponymail_lists, ponymail_listview_models, ponymail_month, ponymail_preferences,
ponymail_query, ponymail_quote_regex, ponymail_register_display, ponymail_register_listview,
ponymail_stored_email, ponymail_url_regex, ponymail_version, quickSearch, quickSearchBar,
readEmail, renderListView, scaffoldingEmailCallback, set, setupAccount, spinCheck, testCoffee,
testToggle, threadScaffol
 ding, toggleMonth, toggleQuote, toggleYear, txt,
   extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key))
child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype =
parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return
child; },
   hasProp = {}.hasOwnProperty;
 
@@ -1893,7 +1893,7 @@ BasicListView = (function() {
             fontWeight: readStyle
           },
           href: "thread.html/" + thread.tid,
-          onclick: "readEmail(this.parentNode.parentNode.parentNode); return false;"
+          onclick: "readEmail(this.parentNode.parentNode.parentNode); this.style.fontWeight
= 'normal'; return false;"
         }, original.subject), new HTML('br'), new HTML('span', {
           "class": "listview_item_body"
         }, thread.body)
@@ -2308,7 +2308,7 @@ SingleListView = (function(superClass) {
             fontWeight: readStyle
           },
           href: "thread.html/" + original.id,
-          onclick: "readEmail(this.parentNode.parentNode.parentNode); return false;"
+          onclick: "readEmail(this.parentNode.parentNode.parentNode); this.style.fontWeight
= 'normal'; return false;"
         }, original.subject)
       ]);
 
@@ -2386,8 +2386,16 @@ try {
 dbWrite = function(key, value) {
 
   /* Can we use localStorage? */
+  var rv;
   if (pm_storage_available) {
-    return window.localStorage.setItem(key, value);
+    try {
+      rv = window.localStorage.setItem(key, value);
+      return rv;
+    } catch (_error) {
+      e = _error;
+      console.log("Could not save data to DB: " + e);
+      return null;
+    }
   } else {
 
     /* Guess not, fall back to (ineffective) global var */
@@ -2676,9 +2684,10 @@ footerScaffolding = function() {
 };
 
 listviewScaffolding = function() {
+  var calHolder, header, listDiv, mainDiv, qs, r;
+  parseURL(true);
 
   /* Header scaffolding */
-  var calHolder, header, listDiv, mainDiv, r;
   headerScaffolding();
 
   /* Now, make the base div */
@@ -2693,6 +2702,10 @@ listviewScaffolding = function() {
   }, "Loading list data...");
   mainDiv.inject(header);
 
+  /* Quick Search Bar */
+  qs = quickSearchBar();
+  mainDiv.inject(qs);
+
   /* Then make the calendar placeholder */
   calHolder = new HTML('div', {
     id: "calendar"
@@ -2754,6 +2767,81 @@ threadScaffolding = function() {
   });
 };
 
+
+/*
+ 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.
+ */
+
+quickSearchBar = function() {
+  var button, datedata, input, list, listdata, listname, options, qs, span;
+  qs = new HTML('form', {
+    "class": "quicksearch",
+    onsubmit: 'quickSearch(); return false;'
+  });
+
+  /* Options area */
+  options = new HTML('div', {
+    "class": 'qs_options'
+  });
+
+  /* Timespan to search within */
+  datedata = "lte=1M";
+  span = new HTML('a', {
+    id: 'qs_span',
+    data: datedata,
+    href: 'javascript:void(0);'
+  }, "Less than 1 month ago");
+
+  /* Lists(s) to search */
+  listname = 'This list';
+  listdata = ponymail_listname;
+  if (ponymail_listname.length === 0) {
+    listname = 'All lists';
+    listdata = "*@*";
+  }
+  list = new HTML('a', {
+    id: 'qs_list',
+    href: 'javascript:void(0);',
+    data: listdata
+  }, listname);
+  options.inject([span, new HTML('br'), list]);
+  input = new HTML('input', {
+    type: "text",
+    id: 'qs_input',
+    "class": "qs_input",
+    placeholder: "Type search terms..."
+  });
+  button = new HTML('input', {
+    type: 'submit',
+    "class": 'qs_button'
+  });
+  qs.inject(options);
+  qs.inject(input);
+  qs.inject(button);
+  return qs;
+};
+
+
+/* Quick Search function */
+
+quickSearch = function() {
+
+  /* Get the QS input */
+};
+
 testCoffee = function() {
 
   /* Get main div from HTML */


Mime
View raw message