瀏覽代碼

Fixed Scrub Relative URLs to include url(something), styling

version-14
Anand Doshi 11 年之前
父節點
當前提交
adbfc48d99
共有 4 個文件被更改,包括 10 次插入5 次删除
  1. +1
    -1
      frappe/templates/pages/style_settings.py
  2. +4
    -1
      frappe/website/css/website.css
  3. +2
    -2
      frappe/website/doctype/style_settings/style_settings.txt
  4. +3
    -1
      frappe/website/utils.py

+ 1
- 1
frappe/templates/pages/style_settings.py 查看文件

@@ -32,7 +32,7 @@ def prepare(doc):
doc.fields[d] = default_colours[d]
if not doc.font_size:
doc.font_size = "13px"
doc.font_size = "14px"
doc.small_font_size = cstr(cint(doc.font_size[:-2])-2) + 'px'
doc.page_border = cint(doc.page_border)


+ 4
- 1
frappe/website/css/website.css 查看文件

@@ -248,6 +248,10 @@ fieldset {
border-bottom: 2px solid #999;
}

.sidebar-item a.active {
border-bottom: 2px solid #999;
}

html,
body {
height: 100%;
@@ -392,7 +396,6 @@ a.no-decoration {
a.active {
pointer-events: none;
cursor: default;
border-bottom: inherit;
}

.page-breadcrumbs .breadcrumb {


+ 2
- 2
frappe/website/doctype/style_settings/style_settings.txt 查看文件

@@ -2,7 +2,7 @@
{
"creation": "2013-03-25 16:01:33",
"docstatus": 0,
"modified": "2013-12-20 19:21:48",
"modified": "2013-12-20 19:22:48",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -136,7 +136,7 @@
"fieldname": "font_size",
"fieldtype": "Select",
"label": "Font Size (Text)",
"options": "\n12px\n13px\n14px\n15px\n16px"
"options": "\n12px\n13px\n14px\n15px\n16px\n17px\n18px"
},
{
"doctype": "DocField",


+ 3
- 1
frappe/website/utils.py 查看文件

@@ -6,7 +6,9 @@ import frappe, re

def scrub_relative_urls(html):
"""prepend a slash before a relative url"""
return re.sub("""(src|href)[^\w'"]*['"](?!http|ftp|/|#)([^'" >]+)['"]""", '\g<1> = "/\g<2>"', html)
html = re.sub("""(src|href)[^\w'"]*['"](?!http|ftp|/|#)([^'" >]+)['"]""", '\g<1> = "/\g<2>"', html)
html = re.sub("""url\((?!http|ftp|/|#)([^\(\)]+)\)""", 'url(/\g<1>)', html)
return html

def can_cache(no_cache=False):
return not (frappe.conf.disable_website_cache or no_cache)


Loading…
取消
儲存