Browse Source

Improved code layout.

Martin Edenhofer 8 years ago
parent
commit
15a23f3723

+ 9 - 9
app/assets/javascripts/app/lib/app_post/global_search.coffee

@@ -13,15 +13,15 @@ class _globalSearchSingleton extends Spine.Module
     @apiPath = App.Config.get('api_path')
 
   execute: (params) ->
-    query     = params.query
-    render    = params.render
-    limit     = params.limit || 10
-    cache_key = query + '_' + limit
+    query    = params.query
+    render   = params.render
+    limit    = params.limit || 10
+    cacheKey = "#{query}_#{limit}"
 
     # use cache for search result
     currentTime = new Date
-    if @searchResultCache[cache_key] && @searchResultCache[cache_key].time > currentTime.setSeconds(currentTime.getSeconds() - 20)
-      render(@searchResultCache[cache_key].result)
+    if @searchResultCache[cacheKey] && @searchResultCache[cacheKey].time > currentTime.setSeconds(currentTime.getSeconds() - 20)
+      render(@searchResultCache[cacheKey].result)
       return
 
     App.Ajax.request(
@@ -49,11 +49,11 @@ class _globalSearchSingleton extends Spine.Module
             App.Log.error('_globalSearchSingleton', "No such model App.#{item.type}")
 
         diff = false
-        if @searchResultCache[cache_key]
-          diff = difference(@searchResultCache[cache_key].resultRaw, data.result)
+        if @searchResultCache[cacheKey]
+          diff = difference(@searchResultCache[cacheKey].resultRaw, data.result)
 
         # cache search result
-        @searchResultCache[cache_key] =
+        @searchResultCache[cacheKey] =
           result: result
           resultRaw: data.result
           limit: limit

+ 1 - 1
app/assets/javascripts/app/views/profile/token_access.jst.eco

@@ -14,7 +14,7 @@
   <thead>
     <tr>
       <th><%- @T('Name') %></th>
-      <th><%- @T('Permission') %></th>
+      <th><%- @T('Permissions') %></th>
       <th><%- @T('Created') %></th>
       <th><%- @T('Expires') %></th>
       <th><%- @T('Last used') %></th>

+ 1 - 1
app/models/channel/driver/pop3.rb

@@ -47,7 +47,7 @@ returns
   def fetch (options, channel, check_type = '', verify_string = '')
     ssl  = true
     port = 995
-    if options.key?(:ssl) && options[:ssl].to_s == 'false'
+    if options.key?(:ssl) && options[:ssl] == false
       ssl  = false
       port = 110
     end