diff --git a/backend/Database.php b/backend/Database.php index 807e0633a7eec06751f40dd7eddccdb852444e27..17b68fe0cfc242f431fd66ad44ff27a76acb6c0b 100644 --- a/backend/Database.php +++ b/backend/Database.php @@ -154,7 +154,7 @@ class Backend { $user = new User($result); if (!AuthHelper::initialAuthenticateUser($password, $user->password, $user->hashversion)) { - syslog(LOG_ERR, "Password does not match for user ".$username); + syslog(LOG_ERR, "Password does not match for user " . $username); return false; } diff --git a/res/login.css b/res/login.css index 1923abc6b1e4f9c0db55433df082fcf5d6aff4da..a85552c94720d48dc63edf55a33045cd7dff3246 100644 --- a/res/login.css +++ b/res/login.css @@ -80,13 +80,13 @@ input[type=submit] { cursor: default; border: 1px solid #3079ed; color: #fff; - text-shadow: 0 1px rgba(0,0,0,0.1); + text-shadow: 0 1px rgba(0, 0, 0, 0.1); background-color: #4d90fe; - background-image: -webkit-linear-gradient(top,#4d90fe,#4787ed); - background-image: -moz-linear-gradient(top,#4d90fe,#4787ed); - background-image: -ms-linear-gradient(top,#4d90fe,#4787ed); - background-image: -o-linear-gradient(top,#4d90fe,#4787ed); - background-image: linear-gradient(top,#4d90fe,#4787ed); + background-image: -webkit-linear-gradient(top, #4d90fe, #4787ed); + background-image: -moz-linear-gradient(top, #4d90fe, #4787ed); + background-image: -ms-linear-gradient(top, #4d90fe, #4787ed); + background-image: -o-linear-gradient(top, #4d90fe, #4787ed); + background-image: linear-gradient(top, #4d90fe, #4787ed); width: 100%; display: block; margin-bottom: 10px; diff --git a/res/search.css b/res/search.css index 41cbbc0068e95ffa80e398a31363ffa296c70b69..96c8c192b7e7598f1d846e3bfc16fb021a73b118 100644 --- a/res/search.css +++ b/res/search.css @@ -102,7 +102,7 @@ nav .wrapper { top: 0; left: 0; right: 0; - box-shadow: 0 -1px 0 #e0e0e0,0 0 2px rgba(0,0,0,.12),0 2px 4px rgba(0,0,0,.24); + box-shadow: 0 -1px 0 #e0e0e0, 0 0 2px rgba(0, 0, 0, .12), 0 2px 4px rgba(0, 0, 0, .24); transition: background .15s; } @@ -210,7 +210,7 @@ message:before, inline-button:before { message > content > b { font-weight: initial; - background-color: rgba(251,246,167,0.5); + background-color: rgba(251, 246, 167, 0.5); } section > inline-button { @@ -400,8 +400,8 @@ nav.search #actions > * { opacity: 0.6; } -#actions >*:hover:before { - background-color: rgba(0,0,0,.12); +#actions > *:hover:before { + background-color: rgba(0, 0, 0, .12); bottom: -4px; content: ' '; left: -4px; @@ -423,7 +423,7 @@ nav.search #actions > * { margin: 0; padding: 6px 0; background: #fff; - box-shadow: 0 -1px 0 #e0e0e0,0 0 2px rgba(0,0,0,.12),0 2px 4px rgba(0,0,0,.24); + box-shadow: 0 -1px 0 #e0e0e0, 0 0 2px rgba(0, 0, 0, .12), 0 2px 4px rgba(0, 0, 0, .24); } #autocomplete li { @@ -458,7 +458,7 @@ nav.search #actions > * { } #autocomplete li:hover, #autocomplete li:focus, #autocomplete li.selected { - background: rgba(0,0,0,0.03); + background: rgba(0, 0, 0, 0.03); } #results { @@ -478,6 +478,6 @@ nav.search #actions > * { display: none; } -#results.hidden+#modal-background { +#results.hidden + #modal-background { display: block; } \ No newline at end of file diff --git a/res/search.js b/res/search.js index 115ff7cb721900cdc013b3650d7b8406a78c794d..4d657c1c454708cd0de595eec611f1b457c091fb 100644 --- a/res/search.js +++ b/res/search.js @@ -8,7 +8,9 @@ var add_to_history = function (query) { if (!query) return; - var history = get_history().filter(function (x) { return x != query; }); + var history = get_history().filter(function (x) { + return x != query; + }); history.push(query); history = history.slice(Math.max(0, history.length - max_history_size)); localStorage.setItem('history', JSON.stringify(history)); @@ -31,24 +33,24 @@ $("#q").keypress(function (e) { search(); } if (key === 40) { - $("#history"+state.selected_history_entry).removeClass("selected"); + $("#history" + state.selected_history_entry).removeClass("selected"); state.selected_history_entry = (state.selected_history_entry + 1) % get_history().length; $("#q").val(get_history().reverse()[state.selected_history_entry]); - $("#history"+state.selected_history_entry).addClass("selected"); + $("#history" + state.selected_history_entry).addClass("selected"); } else if (key === 38) { - $("#history"+state.selected_history_entry).removeClass("selected"); + $("#history" + state.selected_history_entry).removeClass("selected"); if (state.selected_history_entry === 0) { state.selected_history_entry = -1; $("#q").val(""); } else { state.selected_history_entry = (state.selected_history_entry - 1) % get_history().length; $("#q").val(get_history().reverse()[state.selected_history_entry]); - $("#history"+state.selected_history_entry).addClass("selected"); + $("#history" + state.selected_history_entry).addClass("selected"); } } }); -$("#q").focus(function (){ +$("#q").focus(function () { $("#autocomplete").addClass("active"); $("#results").addClass("hidden"); $("nav").addClass("search"); @@ -79,7 +81,7 @@ var sendercolor = function (nick) { "#3176b3" ]; - var reflect = function(crc, n) { + var reflect = function (crc, n) { var j = 1, crcout = 0; for (var i = (1 << (n - 1)); i > 0; i >>= 1) { if ((crc & i) > 0) { @@ -90,7 +92,7 @@ var sendercolor = function (nick) { return crcout; }; - var qChecksum = function(str) { + var qChecksum = function (str) { var crc = 0xffff; var crcHighBitMask = 0x8000; @@ -191,10 +193,10 @@ var render_context_full = function (context) { var render_history_item = function (id, query) { return ( - "<li id='history"+id+"' data-query='"+btoa(query)+"'>" + ( + "<li id='history" + id + "' data-query='" + btoa(query) + "'>" + ( "<span class='icon'>history</span>" + query - ) +"</li>" + ) + "</li>" ) }; @@ -205,7 +207,7 @@ var update_history = function () { var history = get_history().reverse(); for (var i = 0; i < history.length; i++) { container.append(render_history_item(i, history[i])); - attach_history_item($("#history"+i)); + attach_history_item($("#history" + i)); } if (history.length == 0) { container.append("<p>No search history available</p>"); @@ -233,8 +235,10 @@ var attach_context = function (elem) { console.log("Undefined buffer: " + bufferid); } - elem.click(wrap_click_handler(function (e) {e.stopPropagation(); })); - $("#message"+buffers[bufferid].contexts[id].original.messageid).click(wrap_click_handler(make_toggle_context(bufferid, id))); + elem.click(wrap_click_handler(function (e) { + e.stopPropagation(); + })); + $("#message" + buffers[bufferid].contexts[id].original.messageid).click(wrap_click_handler(make_toggle_context(bufferid, id))); elem.find(".load_before").click(wrap_click_handler(function (e) { earlier(bufferid, id, 5); e.stopPropagation(); @@ -333,7 +337,7 @@ var search = function () { "query": $("#q").val(), "selected_history_entry": -1 }; - location = "#"+encodeURIComponent(state.query); + location = "#" + encodeURIComponent(state.query); if (state.query) { show_loader(); load_search_overview(state.query, show_overview); @@ -464,7 +468,6 @@ var sort_messages = function (arr) { update_history(); - $("body").click(function (e) { if (open.length) open[open.length - 1](e); @@ -474,7 +477,7 @@ $("nav").click(function (e) { e.stopPropagation(); }); -var hashChange = function() { +var hashChange = function () { $("#q").val(decodeURIComponent(location.hash.substr(1))); search(); };