浏览代码

Csp compat (#695)

* Remove some inline CSS style to improve CSP compatibility

* update changelog
Mathias Ertl 8 年之前
父节点
当前提交
1ba68dc8b2
共有 5 个文件被更改,包括 14 次插入2 次删除
  1. 1 0
      docs/CHANGES.md
  2. 6 0
      sass/_controlbox.scss
  3. 5 0
      sass/_roster.scss
  4. 1 1
      src/templates/add_contact_dropdown.html
  5. 1 1
      src/templates/controlbox_toggle.html

+ 1 - 0
docs/CHANGES.md

@@ -6,6 +6,7 @@
 - New event ['rosterContactsFetched'](https://conversejs.org/docs/html/development.html#rosterContactsFetched) [jcbrand]
 - New event ['rosterGroupsFetched'](https://conversejs.org/docs/html/development.html#rosterGroupsFetched) [jcbrand]
 - HTML templates are now loaded in the respective modules/plugins. [jcbrand]
+- Start improving Content-Security-Policy compatibility by removing inline CSS.
 
 ## 2.0.0 (2016-09-16)
 - #656 Online users count not shown initially [amanzur]

+ 6 - 0
sass/_controlbox.scss

@@ -201,6 +201,12 @@
                     }
                 }
             }
+
+            /* Custom addition for CSP */
+            dd.search-xmpp {
+                display: none;
+            }
+
             dd.search-xmpp ul {
                 box-shadow: 1px 4px 10px 1px rgba(0, 0, 0, 0.4);
                 li:hover {

+ 5 - 0
sass/_roster.scss

@@ -13,6 +13,11 @@
         height: calc(100% - #{$controlbox-dropdown-height} - 20px);
     }
 
+    /* Custom addition for CSP */
+    #online-count {
+        display: none;
+    }
+
     .search-xmpp {
         ul {
             li.chat-info {

+ 1 - 1
src/templates/add_contact_dropdown.html

@@ -2,5 +2,5 @@
     <dt id="xmpp-contact-search" class="fancy-dropdown">
         <a class="toggle-xmpp-contact-form icon-plus" href="#" title="{{label_click_to_chat}}"> {{label_add_contact}}</a>
     </dt>
-    <dd class="search-xmpp" style="display:none"><ul></ul></dd>
+    <dd class="search-xmpp"><ul></ul></dd>
 </dl>

+ 1 - 1
src/templates/controlbox_toggle.html

@@ -1,2 +1,2 @@
 <span class="conn-feedback">{{label_toggle}}</span>
-<span style="display: none" id="online-count">(0)</span>
+<span id="online-count">(0)</span>