# iframe_embed_settings 標簽
這個標簽在文件:horizon\openstack_dashboard\templatetags\context_selection.py中被 定義。其代碼 如下:
~~~
@register.inclusion_tag('context_selection/_anti_clickjack.html', takes_context=True)
def iframe_embed_settings(context):
disallow_iframe_embed = getattr(settings, 'DISALLOW_IFRAME_EMBED',True)
context = {'disallow_iframe_embed': disallow_iframe_embed}
return context
~~~
'context_selection/_anti_clickjack.html' 這個文件對就路徑為: horizon\openstack_dashboard\templates\context_selection\_anti_clickjack.html 。其里面的內容為:
~~~
{% if disallow_iframe_embed %}
<style id="anti-clickjack">body{display:none !important;}</style>
<script type='text/javascript' charset="utf-8">
if (self === top) {
var antiClickjack = document.getElementById("anti-clickjack");
antiClickjack.parentNode.removeChild(antiClickjack);
} else {
top.location = self.location;
}
</script>
{% endif %}
~~~
這段JS代碼就被引入了。
- 1.概述
- 2.CSS樣式引入
- 2.1 My Themes
- 2.2 Horizon
- 2.3 Angular
- 2.4 HORIZON_CONFIG.scss_files
- 2.5 Custom Styles
- 3. JS文件引入
- 31. iframe_embed_settings 標簽
- 3.2 horizon/_conf.html
- 3.3 _script_loader.html
- 3.4 _custom_head_js.html
- 3.5 horizon/_scripts.html
- 4. 主題替換
- 4.1 ACE主題
- 4.2 引入ACE主題的CSS樣式
- 4.3 引入ACE主題的JS文件
- 4.4 收集和壓縮
- 4.5 總結
- 4.6 錯誤與沖突收集
- 5.錯誤修正
- 6.openstack里所有功能瀏覽
- 7.前端hightchart.js分析
- 8.命令使用