Yuki Takei 7 лет назад
Родитель
Сommit
5a1dba310a
3 измененных файлов с 81 добавлено и 74 удалено
  1. 11 1
      lib/locales/en-US/translation.json
  2. 7 9
      lib/locales/ja/translation.json
  3. 63 64
      lib/views/admin/markdown.html

+ 11 - 1
lib/locales/en-US/translation.json

@@ -400,7 +400,17 @@
     "Enable Line Break": "Enable Line Break",
     "Enable Line Break desc": "Treat line break in the text page as <code>&lt;br&gt;</code> in HTML",
     "Enable Line Break for comment": "Enable Line Break in comment",
-    "Enable Line Break for comment desc": "Treat line break in comment as <code>&lt;br&gt;</code> in HTML"
+    "Enable Line Break for comment desc": "Treat line break in comment as <code>&lt;br&gt;</code> in HTML",
+    "XSS_setting": "Prevent XSS(Cross Site Scripting) Setting",
+    "XSS_setting_desc": "You can change the handling of HTML tags in markdown text.",
+    "Prevent XSS(Cross Site Scripting)": "Suppress HTML tag rendering",
+    "Prevent XSS(Cross Site Scripting)desc": "(TBD) 以下のオプション設定により、<code>&lt;iframe&gt;</code>等の一部のタグの描画を有効化します",
+    "Ignore all tags": "Ignore all tags",
+    "Recommended setting": "Recommended setting",
+    "Custom Whitelist": "Custom Whitelist",
+    "Tag names":"Tag names",
+    "Tag attributes":"Tag attributes",
+    "Add white list desc":"(TBD) ホワイトリストに追加したい要素をカンマ&lt;,&gt;で区切って追加してください"
   },
 
   "customize_page": {

+ 7 - 9
lib/locales/ja/translation.json

@@ -418,16 +418,14 @@
     "Enable Line Break for comment": "コメント欄で Line Break を有効にする",
     "Enable Line Break for comment desc": "コメント中の改行を、HTML内で<code>&lt;br&gt;</code>として扱います",
     "XSS_setting": "XSS(Cross Site Scripting)対策設定",
-    "XSS_setting_desc": "マークダウンテキスト内の HTML タグへの対処を変更できます。",
-    "Prevent XSS(Cross Site Scripting)": "マークダウンテキスト内のHTMLタグを有効にする",
-    "Prevent XSS(Cross Site Scripting)desc": "悪意のあるプログラムからの攻撃を防ぎます",
-    "Prevent XSS(Cross Site Scripting)desc2": "無効にすることで、<code>&lt;iframe&gt;</code>等の一部ソースの表示を可能にします",
-    "Allow all": "すべて許可する",
-    "Ignore all": "すべて許可しない",
+    "XSS_setting_desc": "マークダウンテキスト内の HTML タグの扱いを設定し、悪意のあるプログラムからの攻撃を防ぎます",
+    "Prevent XSS(Cross Site Scripting)": "HTML タグの描画を抑制する",
+    "Prevent XSS(Cross Site Scripting)desc": "以下のオプション設定により、<code>&lt;iframe&gt;</code>等の一部のタグの描画を有効化します",
+    "Ignore all tags": "すべてのタグを抑制する",
     "Recommended setting": "おすすめ設定",
-    "Whitelist setting": "ホワイトリスト設定",
-    "tag":"タグ",
-    "tag attribute":"タグの属性",
+    "Custom Whitelist": "カスタムホワイトリスト",
+    "Tag names":"タグ名のリスト",
+    "Tag attributes":"タグ属性のリスト",
     "Add white list desc":"ホワイトリストに追加したい要素をカンマ&lt;,&gt;で区切って追加してください"
   },
 

+ 63 - 64
lib/views/admin/markdown.html

@@ -108,79 +108,78 @@
               </div>
 
               <fieldset id="xss-hide-when-disabled" {%if !isXssEnabled %}style="display: none;"{% endif %}>
-                <p class="help-block">{{ t("markdown_setting.Prevent XSS(Cross Site Scripting)desc") }}<br>
-                {{ t("markdown_setting.Prevent XSS(Cross Site Scripting)desc2") }}</p>
+                <p class="help-block">{{ t("markdown_setting.Prevent XSS(Cross Site Scripting)desc") }}</p>
 
                 {% set nameForIsXss2Enabled = "settingForm[security:xss2-prevent:isEnabled]" %}
 
-                  <div>
-                    <div class="form-group">
-                      <div class="col-xs-6">
-                        <div class="btn-group btn-toggle" data-toggle="buttons">
-                          <div>
-                            <label data-active-class="primary">
-                              <input name="{{nameForIsXss2Enabled}}" value="1" type="radio"
-                              {% if !isXssEnabled %}checked{% endif %}>
-                              {{ t('markdown_setting.Ignore all') }}
-                            </label>
-                          </div>
-                          <div>
-                            <label data-active-class="primary">
-                                <input name="{{nameForIsXss2Enabled}}" value="2" type="radio"
-                                {% if true === isXssEnabled %}checked{% endif %}>
-                              {{ t('markdown_setting.Recommended setting') }}<br>
-                            </label>
-                          </div>
-                          <div>
-                            <label data-active-class="primary">
-                              <input name="{{nameForIsXss2Enabled}}" value="3" type="radio"
+                <div>
+                  <div class="form-group">
+                    <div class="col-xs-6">
+                      <div class="btn-group btn-toggle" data-toggle="buttons">
+                        <div>
+                          <label data-active-class="primary">
+                            <input name="{{nameForIsXss2Enabled}}" value="1" type="radio"
+                            {% if !isXssEnabled %}checked{% endif %}>
+                            {{ t('markdown_setting.Ignore all tags') }}
+                          </label>
+                        </div>
+                        <div>
+                          <label data-active-class="primary">
+                              <input name="{{nameForIsXss2Enabled}}" value="2" type="radio"
                               {% if true === isXssEnabled %}checked{% endif %}>
-                              {{ t('markdown_setting.Whitelist setting') }}
-                            </label>
-                          </div>
+                            {{ t('markdown_setting.Recommended setting') }}<br>
+                          </label>
+                        </div>
+                        <div>
+                          <label data-active-class="primary">
+                            <input name="{{nameForIsXss2Enabled}}" value="3" type="radio"
+                            {% if true === isXssEnabled %}checked{% endif %}>
+                            {{ t('markdown_setting.Custom Whitelist') }}
+                          </label>
                         </div>
                       </div>
                     </div>
-
-                    <fieldset id="xss2-hide-when-disabled" {%if !isXssEnabled %}style="display: none;"{% endif %}>
-                        <form>
-                            <div>
-                              {{ t('markdown_setting.tag') }}
-                              <div>
-                                <textarea type="text" name="tag" rows="5" cols="40" value="" readonly></textarea>
-                              </div>
-                            </div>
-                            <div>
-                              {{ t('markdown_setting.tag attribute') }}
-                              <div>
-                                <textarea name="tagattribute" rows="5" cols="40" value="" readonly></textarea>
-                              </div>
-                            </div>
-                        </form>
-                    </fieldset>
-
-                    <fieldset id="xss3-hide-when-disabled" {%if !isXssEnabled %}style="display: none;"{% endif %}>
-                        <form>
-                            <div>
-                              {{ t('markdown_setting.tag') }}
-                              <div>
-                                <textarea type="text" name="tag" rows="5" cols="40" value="" placeholder="span, iframe, input"></textarea>
-                                <input type="button" value="おすすめ設定をインポート" />
-                              </div>
-                            </div>
-                            <div>
-                              {{ t('markdown_setting.tag attribute') }}
-                              <div>
-                                <textarea name="tagattribute" rows="5" cols="40" value="" placeholder="class, type, placeholder, name, required"></textarea>
-                                <input type="button" value="おすすめ設定をインポート" />
-                              </div>
-                            </div>
-                        </form>
-                    </fieldset>
                   </div>
 
-      </fieldset>
-      </form>
+                  <fieldset id="xss2-hide-when-disabled" {%if !isXssEnabled %}style="display: none;" {% endif %}>
+                    <form>
+                      <div>
+                        {{ t('markdown_setting.Tag names') }}
+                        <div>
+                          <textarea type="text" name="tag" rows="5" cols="40" readonly>span, iframe, input</textarea>
+                        </div>
+                      </div>
+                      <div>
+                        {{ t('markdown_setting.Tag attributes') }}
+                        <div>
+                          <textarea name="tagattribute" rows="5" cols="40" readonly>class, type, placeholder, name, required</textarea>
+                        </div>
+                      </div>
+                    </form>
+                  </fieldset>
+
+                  <fieldset id="xss3-hide-when-disabled" {%if !isXssEnabled %}style="display: none;" {% endif %}>
+                    <form>
+                      <div>
+                        {{ t('markdown_setting.Tag names') }}
+                        <div>
+                          <textarea type="text" name="tag" rows="5" cols="40" value="" placeholder="span, iframe, input"></textarea>
+                          <input type="button" class="btn btn-default" value="おすすめ設定をインポート" />
+                        </div>
+                      </div>
+                      <div>
+                        {{ t('markdown_setting.Tag attributes') }}
+                        <div>
+                          <textarea name="tagattribute" rows="5" cols="40" value="" placeholder="class, type, placeholder, name, required"></textarea>
+                          <input type="button" class="btn btn-default" value="おすすめ設定をインポート" />
+                        </div>
+                      </div>
+                    </form>
+                  </fieldset>
+                </div>
+
+              </fieldset>
+            </form>
 
 
             <script>