You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2016/05/31 12:13:19 UTC

[1/2] incubator-ponymail git commit: add some null checks for a search.html feature

Repository: incubator-ponymail
Updated Branches:
  refs/heads/master a8a62f67d -> 0f9e5261c


add some null checks for a search.html feature


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

Branch: refs/heads/master
Commit: 035de78917c43d5d2a9c460c29799de8dcda718e
Parents: a8a62f6
Author: humbedooh <hu...@apache.org>
Authored: Tue May 31 14:11:45 2016 +0200
Committer: humbedooh <hu...@apache.org>
Committed: Tue May 31 14:11:45 2016 +0200

----------------------------------------------------------------------
 site/js/dev/ponymail_pagebuilder.js | 6 +++++-
 site/js/ponymail.js                 | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/035de789/site/js/dev/ponymail_pagebuilder.js
----------------------------------------------------------------------
diff --git a/site/js/dev/ponymail_pagebuilder.js b/site/js/dev/ponymail_pagebuilder.js
index 5723043..56a8188 100644
--- a/site/js/dev/ponymail_pagebuilder.js
+++ b/site/js/dev/ponymail_pagebuilder.js
@@ -371,7 +371,7 @@ function getListInfo(list, xdomain, nopush) {
             }
         }
     }
-    if (xdomain == undefined || xdomain == "" && list) {
+    if ((xdomain == undefined || xdomain == "") && list) {
         xdomain = list.replace(/^.*?@/, "")
         
     }
@@ -415,6 +415,10 @@ function getListInfo(list, xdomain, nopush) {
     }
 
     //buildCalendar()
+    // Bail if no list is still found - search.html probably
+    if (!list) {
+        return
+    }
     mbox_month = null;
     var dp = document.getElementById('d')
     dp.value = datePickerValue(current_retention)

http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/035de789/site/js/ponymail.js
----------------------------------------------------------------------
diff --git a/site/js/ponymail.js b/site/js/ponymail.js
index 3528b58..8bfb63c 100644
--- a/site/js/ponymail.js
+++ b/site/js/ponymail.js
@@ -3922,7 +3922,7 @@ function getListInfo(list, xdomain, nopush) {
             }
         }
     }
-    if (xdomain == undefined || xdomain == "" && list) {
+    if ((xdomain == undefined || xdomain == "") && list) {
         xdomain = list.replace(/^.*?@/, "")
         
     }
@@ -3966,6 +3966,10 @@ function getListInfo(list, xdomain, nopush) {
     }
 
     //buildCalendar()
+    // Bail if no list is still found - search.html probably
+    if (!list) {
+        return
+    }
     mbox_month = null;
     var dp = document.getElementById('d')
     dp.value = datePickerValue(current_retention)


[2/2] incubator-ponymail git commit: start work on a generic search page

Posted by hu...@apache.org.
start work on a generic search page


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

Branch: refs/heads/master
Commit: 0f9e5261c5771efd0eb4eaaa09095062c0eea185
Parents: 035de78
Author: humbedooh <hu...@apache.org>
Authored: Tue May 31 14:12:54 2016 +0200
Committer: humbedooh <hu...@apache.org>
Committed: Tue May 31 14:12:54 2016 +0200

----------------------------------------------------------------------
 site/search.html | 194 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 194 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/0f9e5261/site/search.html
----------------------------------------------------------------------
diff --git a/site/search.html b/site/search.html
new file mode 100644
index 0000000..769f589
--- /dev/null
+++ b/site/search.html
@@ -0,0 +1,194 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=1280, initial-scale=1">
+    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
+    <title>Pony Mail!</title>
+
+    <!-- Bootstrap -->
+    
+    <link href="css/bootstrap.min.css" rel="stylesheet" media="all">
+    <link href="css/popup.css" rel="stylesheet" media="all">
+    <link href="css/solar.css" rel="alternate stylesheet" type="text/css" title="Solar theme" media="all">
+    <link href="css/metro.css" rel="alternate stylesheet" type="text/css" title="Metropolis" media="all">
+    <link rel="alternate" href="/api/static.lua"/>
+    <link rel="stylesheet" href="//cdn.jsdelivr.net/font-hack/2.013/css/hack.min.css">
+
+    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
+    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
+    <!--[if lt IE 9]>
+      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
+      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
+    <![endif]-->
+  </head>
+  <body onload="preGetListInfo(null, null, true)">
+    <header class="navbar navbar-default" style="margin-bottom: 5px; background: linear-gradient(to bottom, rgba(229,229,229,1) 0%,rgba(191,191,191,1) 100%);">
+    <div class="container-fluid">
+      <!-- Brand and toggle get grouped for better mobile display -->
+      <div class="navbar-header collapse navbar-collapse">
+      <a class="navbar-brand" href="./"><span><img src="images/logo.png" style="margin-top: -10px !important;" height="30" width="32"/>&nbsp;<span class='hidden-xs hidden-sm'>Pony Mail!</span></a>
+      </div>
+    
+    
+    <!-- Quick search -->
+    
+            
+    
+      <form style="padding-top: 8px; float: left; page-break-before: avoid; page-break-after: avoid;" id="quickform" action="search.html" method="get" onsubmit="xlist = '*'; xdomain='*'; return search(this.elements['q'].value,this.elements['d'].getAttribute('data'), false, this.elements['checkall'].checked);">
+        <big style="padding-top: 4px; padding-right: 5px; float: left;">Search:</big>
+        <div class="unifiedsearch">
+        
+        <input type="checkbox" style="display: none" id="checkall" name="checkall"/>
+                <div class="form-group" style="display: inline; float: left;">
+          <div class="input-group" style="float: left;"> 
+        <a href="" aria-haspopup="true" aria-expanded="false" style="min-width: 145px; text-align: left; font-size: 9pt; line-height: 8.5pt !important; padding: 3px 4px 4px 0px !important; background: #333; color: #EEE; height: 31px; border-radius: 10px; border: none; border-right-style: none; border-top-right-radius: 0px;border-bottom-right-radius: 0px;" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
+            &nbsp;-<span id="qs_list" style="padding-left: 5px;">All lists<br/></span>
+            &nbsp;-<span id="qs_date" style="padding-left: 5px;">Less than 1 month ago</span> <span style="font-size: 14pt !important;" class="caret"></span>
+        </a>
+        <ul class="dropdown-menu" id="slo" role="menu">
+          <li><b>Where to search:</b></li>
+          <li><a href="javascript:void(0);" onclick="document.getElementById('checkall').checked = true; document.getElementById('qs_list').innerHTML = this.innerHTML + '<br/>';"  id="sloa">All lists</a></li>
+          <li class="divider"></li>
+          <li><b>Date range:</b></li>
+          <li id='drh'><input title="Click to change the date range" style="padding-left: 20px; border: none; cursor: url(images/daterange.ico), text; min-width: 200px; margin-right: 10px; font-size: 9pt;" name="d" id='d' data="lte=1M" value="Less than 1 month ago" onclick="datePicker(this);" readonly="readonly"/></li>
+        </ul>
+        </div>
+                </div>
+        <input type="text" name="q" id="q" placeholder="Type search terms..." style="border-top: none; border-bottom: none;"/>
+        
+        
+        <button type="submit" title="Search!" value="Search!" class="btn btn-primary"><span class="glyphicon glyphicon-chevron-right"> </span></button>
+        </div>
+        &nbsp;
+        <input type="button" value="Advanced" onclick="toggleView('advanced');toggleView('quicksearch');" style="float: left; margin-left: 4px;" class="btn btn-warning"/>
+        <a href="javascript:void(0);" onclick="addSearchEngine();"><img src="images/opensearch.png" id="opensearch" title="Add these MLs as a search engine in your browser"/></a> &nbsp;
+      </form>
+           
+    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" style="float: left;">
+      <ul class="nav navbar-nav" id="listslist">
+
+      </ul>
+      <ul class="nav navbar-nav" id="otherstuff">
+      <li class="dropdown navbar-right" id="listchoice">
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Available projects: <span class="caret"></span></a>
+            <ul class="dropdown-menu should-scroll" id="lc_dropdown">
+
+          </ul>
+      </li>
+      </ul>
+      <div class="nav navbar-nav hidden-large" id="filler" style="float: right; width: 128px;"></div>
+      <ul class="nav navbar-nav" id="userprefs" style="position: absolute; right: 8px;">
+        <li class="dropdown navbar-right">
+          <!-- themes -->
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><img id="timg" src="images/themes.png" title="Theme selector"/>
+            <span class="caret"></span></a>
+            <ul class="dropdown-menu" id="themes_dropdown">
+              <li><a href="javascript:void(0)" onclick="setTheme('default')">Default theme</a></li>
+              <li><a href="javascript:void(0)" onclick="setTheme('social')">Social theme</a></li>
+              <li><a href="javascript:void(0)" onclick="setTheme('compact')">Compact theme</a></li>
+              <li><a href="api/static.lua/" onclick="location.href='/api/static.lua/' + xlist;return false;">Static HTML lists</a></li>
+          </ul>
+        </li>
+      <li class="dropdown navbar-right" id="listchoice">
+          
+            
+          <!-- user prefs -->
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><img id="uimg" src="images/user_loggedout.png" title="Not logged in"/>
+            <span class="caret"></span></a>
+            <ul class="dropdown-menu" id="prefs_dropdown">
+            <li><a href="oauth.html">Log in</a></li>
+          </ul>
+      </li>
+      </ul>
+      
+    </div>
+    
+    </div>
+    </header>
+    <div class="container-fluid">
+       <noscript>
+          <div class="bs-callout bs-callout-alert">
+            This site requires JavaScript enabled. Please enable it.
+          </div>
+      </noscript>
+      <div class="row">
+      
+      
+      <!-- Advanced search -->
+      <div class="bs-callout bs-callout-danger fade-in" id="advanced" style="margin: 2px !important; padding: 5px;">
+      <form action="list.html" method="get" onsubmit="return searchAll(this.elements['aq'].value,this.elements['dp'].getAttribute('data'), this.elements['header_from'].value, this.elements['header_subject'].value, this.elements['lookwhere'].value);">
+        <p>This search allows you to search all archives you have access to at once. Use with care.</p>
+        <p>You may search for whole sentences using <code>"sentence goes here"</code> or omit certain words by prepending a - to them, such as: <code>apples -oranges</code> to search for apples but exclude emails with oranges.</p>
+        <div style="float: left; width: 100%;">
+          <div style="width: 120px; float: left;">When:</div>
+          <div style="width: 300px; float: left; page-break-after: always;">
+            <input name="dp" id='dp' data="lte=1M" value="Less than 1 month ago" onclick="datePicker(this);" style="min-width: 32px;" readonly="readonly"/>
+          </div>
+        </div>
+        
+        <div style="float: left; width: 100%;">
+          <div style="width: 120px; float: left;">Quick query:</div>
+          <div style="width: 300px; float: left; page-break-after: always;"><input type="text" name="aq" id="aq"/></div>
+        </div>
+        <div style="float: left; width: 100%;">
+          <div style="width: 120px; float: left;">From:</div>
+          <div style="width: 300px; float: left;"><input type="text" name="header_from" id="header_from"/></div>
+        </div>
+        <div style="float: left; width: 100%;">
+          <div style="width: 120px; float: left;">Subject:</div>
+          <div style="width: 300px; float: left;"><input type="text" name="header_subject" id="header_subject"/></div>
+        </div>
+        <div style="float: left; width: 100%;">
+          <div style="width: 120px; float: left;">Look in:</div>
+          <div style="width: 300px; float: left;">
+            <!--<input type="radio" name="lookwhere" checked="checked" id="lookwhere_this" value="xlist"/> <label for="lookwhere_this">Current list</label>-->
+            <input type="radio" name="lookwhere" id="lookwhere_all" checked="checked" value="*"/> <label for="lookwhere_all">All list</label> 
+          </div>
+        </div>
+        <input type="submit" value="Search!" class="btn btn-primary"/> &nbsp;
+        <input type="button" value="Hide this panel" onclick="toggleView('advanced');toggleView('quicksearch');" style="float: right;" class="btn btn-warning"/>
+      </form>
+    </div>
+      
+      <!-- Popup box for various notices -->
+      <div style="display: none;" class="bs-callout bs-callout-success" id="popupper" style="margin: 2px !important; padding: 5px;">
+      </div>
+    </div>
+      
+    <div class="row">
+      <div id="datepicker" style="display: none;" class="hidden-xs hidden-sm col-md-2" style="float: left;">
+        &nbsp;
+      </div>
+      
+      <div id="stats" class="hidden-xs hidden-sm hidden-md col-lg-3" style="font-size: 9pt;">
+        &nbsp;
+      </div>
+      <div id="datepicker_mobile_parent" style="margin-bottom: 5px;" class="col-xs-10 col-sm-10 hidden-md hidden-lg" style="float: left;">
+          Pick a month: <select onchange="toggleEmail(this.value);" id="datepicker_mobile"></select>
+      </div>
+      <div id="emails_parent" class="col-xs-10 col-md-8 col-lg-7" style="float: left;">
+        
+        <div style="min-height: 36px;">
+          <div style="width: 170px; float: left;"><small>View mode: <select onchange="prefs.displayMode=this.value; saveEphemeral(); buildPage();" id="viewmode"></select></small></div>
+          <div style="width: calc(100% - 170px);">
+            <h3 id="listtitle" style="text-align: center; margin: 3px; padding: 0px;"><a href="#">&nbsp;</a></h3>
+          </div>
+        </div>
+        <div id="emails">
+          &nbsp;
+        </div>
+      </div>
+      </div>
+    </div>
+  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
+    <!-- Include all compiled plugins (below), or include individual files as needed -->
+    <script src="js/bootstrap.min.js"></script>
+    <script src="js/config.js"></script>
+    <script src="js/wordcloud.js"></script>
+    <script src="js/ponymail.js"></script>
+    <script src="js/weburl.js"></script>
+    <div id="splash" class="splash fade-in"> &nbsp; </div>
+  </body>
+</html>
\ No newline at end of file