summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorYukai Huang2017-01-13 22:53:33 +0800
committerYukai Huang2017-01-13 22:53:33 +0800
commit3d6b31921651e71ef68fdc88af4ddef50cc9bcb3 (patch)
tree8ba3e2a5e57a5d54be071475a96b20f78957eff2 /public
parent3566d71aea5486709f73ba7fac5a421993b41f00 (diff)
parent3cf40a8dec96af3710a5945dde693fdc949f31af (diff)
Merge branch 'master' into frontend-next
Diffstat (limited to '')
-rw-r--r--public/css/index.css3
-rw-r--r--public/css/site.css2
-rw-r--r--public/js/cover.js2
-rw-r--r--public/js/index.js30
-rw-r--r--public/views/body.ejs2
-rw-r--r--public/views/index.ejs4
-rw-r--r--public/views/signin-modal.ejs31
7 files changed, 63 insertions, 11 deletions
diff --git a/public/css/index.css b/public/css/index.css
index da1823f2..8f483aa7 100644
--- a/public/css/index.css
+++ b/public/css/index.css
@@ -240,6 +240,9 @@ body {
}
.dropdown-menu > li > a {
cursor: pointer;
+ text-overflow: ellipsis;
+ max-width: calc(100vw - 30px);
+ overflow: hidden;
}
.dropdown-menu.CodeMirror-other-cursor {
transition: none;
diff --git a/public/css/site.css b/public/css/site.css
index 3685149b..d88f8429 100644
--- a/public/css/site.css
+++ b/public/css/site.css
@@ -3,7 +3,7 @@ body {
font-smoothing: subpixel-antialiased !important;
-webkit-font-smoothing: subpixel-antialiased !important;
-moz-osx-font-smoothing: auto !important;
- text-shadow: 1px 1px 1.2px rgba(0, 0, 0, 0.004);
+ text-shadow: 0 0 1em transparent, 1px 1px 1.2px rgba(0, 0, 0, 0.004);
/*text-rendering: optimizeLegibility;*/
-webkit-overflow-scrolling: touch;
font-family: "Source Sans Pro", Helvetica, Arial, sans-serif;
diff --git a/public/js/cover.js b/public/js/cover.js
index 677d82eb..08e0d225 100644
--- a/public/js/cover.js
+++ b/public/js/cover.js
@@ -118,9 +118,11 @@ $(".ui-history").click(() => {
function checkHistoryList() {
if ($("#history-list").children().length > 0) {
+ $('.pagination').show();
$(".ui-nohistory").hide();
$(".ui-import-from-browser").hide();
} else if ($("#history-list").children().length == 0) {
+ $('.pagination').hide();
$(".ui-nohistory").slideDown();
getStorageHistory(data => {
if (data && data.length > 0 && getLoginState() && historyList.items.length == 0) {
diff --git a/public/js/index.js b/public/js/index.js
index 660f73e4..946dfc3e 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -861,7 +861,9 @@ window.ui = {
freely: $(".ui-permission-freely"),
editable: $(".ui-permission-editable"),
locked: $(".ui-permission-locked"),
- private: $(".ui-permission-private")
+ private: $(".ui-permission-private"),
+ limited: $(".ui-permission-limited"),
+ protected: $(".ui-permission-protected")
},
delete: $(".ui-delete-note")
},
@@ -2251,6 +2253,14 @@ ui.infobar.permission.locked.click(function () {
ui.infobar.permission.private.click(function () {
emitPermission("private");
});
+//limited
+ui.infobar.permission.limited.click(function() {
+ emitPermission("limited");
+});
+//protected
+ui.infobar.permission.protected.click(function() {
+ emitPermission("protected");
+});
// delete note
ui.infobar.delete.click(function () {
$('.delete-modal').modal('show');
@@ -2281,10 +2291,18 @@ function updatePermission(newPermission) {
label = '<i class="fa fa-shield"></i> Editable';
title = "Signed people can edit";
break;
+ case "limited":
+ label = '<i class="fa fa-id-card"></i> Limited';
+ title = "Signed people can edit (forbid guest)"
+ break;
case "locked":
label = '<i class="fa fa-lock"></i> Locked';
title = "Only owner can edit";
break;
+ case "protected":
+ label = '<i class="fa fa-umbrella"></i> Protected';
+ title = "Only owner can edit (forbid guest)";
+ break;
case "private":
label = '<i class="fa fa-hand-stop-o"></i> Private';
title = "Only owner can view & edit";
@@ -2306,6 +2324,7 @@ function havePermission() {
bool = true;
break;
case "editable":
+ case "limited":
if (!personalInfo.login) {
bool = false;
} else {
@@ -2314,6 +2333,7 @@ function havePermission() {
break;
case "locked":
case "private":
+ case "protected":
if (!owner || personalInfo.userid != owner) {
bool = false;
} else {
@@ -2930,14 +2950,14 @@ function sortOnlineUserList(list) {
else if (usera.idle && !userb.idle)
return 1;
else {
- if (usera.name && usera.name.toLowerCase() < userb.name.toLowerCase()) {
+ if (usera.name && userb.name && usera.name.toLowerCase() < userb.name.toLowerCase()) {
return -1;
- } else if (usera.name && usera.name.toLowerCase() > userb.name.toLowerCase()) {
+ } else if (usera.name && userb.name && usera.name.toLowerCase() > userb.name.toLowerCase()) {
return 1;
} else {
- if (usera.color && usera.color.toLowerCase() < userb.color.toLowerCase())
+ if (usera.color && userb.color && usera.color.toLowerCase() < userb.color.toLowerCase())
return -1;
- else if (usera.color && usera.color.toLowerCase() > userb.color.toLowerCase())
+ else if (usera.color && userb.color && usera.color.toLowerCase() > userb.color.toLowerCase())
return 1;
else
return 0;
diff --git a/public/views/body.ejs b/public/views/body.ejs
index 83a82fa3..5ad1733e 100644
--- a/public/views/body.ejs
+++ b/public/views/body.ejs
@@ -17,7 +17,9 @@
<ul class="dropdown-menu" aria-labelledby="permissionLabel">
<li class="ui-permission-freely"<% if(!allowAnonymous) { %> style="display: none;"<% } %>><a><i class="fa fa-leaf fa-fw"></i> Freely - Anyone can edit</a></li>
<li class="ui-permission-editable"><a><i class="fa fa-shield fa-fw"></i> Editable - Signed people can edit</a></li>
+ <li class="ui-permission-limited"><a><i class="fa fa-id-card fa-fw"></i> Limited - Signed people can edit (forbid guest)</a></li>
<li class="ui-permission-locked"><a><i class="fa fa-lock fa-fw"></i> Locked - Only owner can edit</a></li>
+ <li class="ui-permission-protected"><a><i class="fa fa-umbrella fa-fw"></i> Protected - Only owner can edit (forbid guest)</a></li>
<li class="ui-permission-private"><a><i class="fa fa-hand-stop-o fa-fw"></i> Private - Only owner can view &amp; edit</a></li>
<li class="divider"></li>
<li class="ui-delete-note"><a><i class="fa fa-trash-o fa-fw"></i> Delete this note</a></li>
diff --git a/public/views/index.ejs b/public/views/index.ejs
index fe900673..b1a1feb4 100644
--- a/public/views/index.ejs
+++ b/public/views/index.ejs
@@ -58,7 +58,7 @@
<% if (errorMessage && errorMessage.length > 0) { %>
<div class="alert alert-danger" style="max-width: 400px; margin: 0 auto;"><%= errorMessage %></div>
<% } %>
- <% if(facebook || twitter || github || gitlab || dropbox || google || email) { %>
+ <% if(facebook || twitter || github || gitlab || dropbox || google || ldap || email) { %>
<span class="ui-signin">
<br>
<a type="button" class="btn btn-lg btn-success ui-signin" data-toggle="modal" data-target=".signin-modal" style="min-width: 170px;"><%= __('Sign In') %></a>
@@ -98,7 +98,7 @@
</div>
<div id="history" class="section"<% if(!signin) { %> style="display:none;"<% } %>>
- <% if(facebook || twitter || github || gitlab || dropbox || google || email) { %>
+ <% if(facebook || twitter || github || gitlab || dropbox || google || ldap || email) { %>
<div class="ui-signin">
<p><%= __('Below is the history from browser') %></p>
</div>
diff --git a/public/views/signin-modal.ejs b/public/views/signin-modal.ejs
index 58d8a690..a8af62e7 100644
--- a/public/views/signin-modal.ejs
+++ b/public/views/signin-modal.ejs
@@ -38,7 +38,32 @@
<i class="fa fa-google"></i> <%= __('Sign in via %s', 'Google') %>
</a>
<% } %>
- <% if((facebook || twitter || github || gitlab || dropbox || google) && email) { %>
+ <% if((facebook || twitter || github || gitlab || dropbox || google) && ldap) { %>
+ <hr>
+ <% }%>
+ <% if(ldap) { %>
+ <h4>Via <% if (ldap.providerName) { %> <%- ldap.providerName %> (LDAP) <% } else { %> LDAP <% } %></h4>
+ <form data-toggle="validator" role="form" class="form-horizontal" method="post" enctype="application/x-www-form-urlencoded">
+ <div class="form-group">
+ <div class="col-sm-12">
+ <input type="username" class="form-control" name="username" placeholder="Username" required>
+ <span class="help-block control-label with-errors" style="display: inline;"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="col-sm-12">
+ <input type="password" class="form-control" name="password" placeholder="Password" required>
+ <span class="help-block control-label with_errors" style="display: inline;"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="col-sm-12">
+ <button type="submit" class="btn btn-primary" formaction="<%- url %>/auth/ldap">Sign in</button>
+ </div>
+ </div>
+ </form>
+ <% } %>
+ <% if((facebook || twitter || github || gitlab || dropbox || google || ldap) && email) { %>
<hr>
<% }%>
<% if(email) { %>
@@ -59,7 +84,7 @@
<div class="form-group">
<div class="col-sm-12">
<button type="submit" class="btn btn-primary" formaction="<%- url %>/login">Sign in</button>
- <button type="submit" class="btn btn-default" formaction="<%- url %>/register">Register</button>
+ <% if(allowemailregister) { %><button type="submit" class="btn btn-default" formaction="<%- url %>/register">Register</button><% }%>
</div>
</div>
</form>
@@ -67,4 +92,4 @@
</div>
</div>
</div>
-</div> \ No newline at end of file
+</div>