@ -53,10 +53,11 @@ INSTALLED_APPS = [
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'app_admin',
|
||||
'app_doc',
|
||||
'app_api',
|
||||
'django.contrib.sitemaps',
|
||||
'haystack', # 全文搜索
|
||||
'app_admin', # 管理APP
|
||||
'app_doc', # 文档APP
|
||||
'app_api', # API APP
|
||||
'django.contrib.sitemaps', # 站点地图
|
||||
'rest_framework',
|
||||
]
|
||||
|
||||
@ -200,4 +201,20 @@ except:
|
||||
try:
|
||||
CHROMIUM_ARGS = CONFIG['chromium']['args'].split(',')
|
||||
except:
|
||||
CHROMIUM_ARGS = []
|
||||
CHROMIUM_ARGS = []
|
||||
|
||||
|
||||
# 全文检索配置
|
||||
HAYSTACK_CONNECTIONS = {
|
||||
'default': {
|
||||
# 使用whoosh引擎
|
||||
'ENGINE': 'app_doc.search.whoosh_cn_backend.WhooshEngine',
|
||||
# 索引文件路径
|
||||
'PATH': os.path.join(BASE_DIR, 'whoosh_index'),
|
||||
}
|
||||
}
|
||||
|
||||
# 当添加、修改、删除数据时,自动生成索引
|
||||
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
|
||||
# 自定义高亮
|
||||
HAYSTACK_CUSTOM_HIGHLIGHTER = "app_doc.search.highlight.MyHighLighter"
|
||||
29
app_doc/search/chinese_analyzer.py
Normal file
@ -0,0 +1,29 @@
|
||||
# coding:utf-8
|
||||
# @文件: chinese_analyzer.py
|
||||
# @创建者:州的先生
|
||||
# #日期:2020/11/22
|
||||
# 博客地址:zmister.com
|
||||
|
||||
import jieba
|
||||
from whoosh.analysis import Tokenizer, Token
|
||||
|
||||
class ChineseTokenizer(Tokenizer):
|
||||
def __call__(self, value, positions=False, chars=False,
|
||||
keeporiginal=False, removestops=True,
|
||||
start_pos=0, start_char=0, mode='', **kwargs):
|
||||
t = Token(positions, chars, removestops=removestops, mode=mode,
|
||||
**kwargs)
|
||||
seglist = jieba.cut(value, cut_all=True)
|
||||
for w in seglist:
|
||||
t.original = t.text = w
|
||||
t.boost = 1.0
|
||||
if positions:
|
||||
t.pos = start_pos + value.find(w)
|
||||
if chars:
|
||||
t.startchar = start_char + value.find(w)
|
||||
t.endchar = start_char + value.find(w) + len(w)
|
||||
yield t
|
||||
|
||||
|
||||
def ChineseAnalyzer():
|
||||
return ChineseTokenizer()
|
||||
172
app_doc/search/highlight.py
Normal file
@ -0,0 +1,172 @@
|
||||
# coding:utf-8
|
||||
# @文件: highlight.py
|
||||
# @创建者:州的先生
|
||||
# #日期:2020/11/24
|
||||
# 博客地址:zmister.com
|
||||
from haystack.utils import Highlighter
|
||||
from django.utils.html import strip_tags
|
||||
from app_doc.search.chinese_analyzer import ChineseAnalyzer as StemmingAnalyzer
|
||||
|
||||
|
||||
class MyHighLighter(Highlighter):
|
||||
|
||||
def __init__(self, query, **kwargs):
|
||||
|
||||
# self.query = [token.text for token in sa(query)]
|
||||
self.query = query
|
||||
|
||||
if "max_length" in kwargs:
|
||||
self.max_length = int(kwargs["max_length"])
|
||||
|
||||
if "html_tag" in kwargs:
|
||||
self.html_tag = kwargs["html_tag"]
|
||||
|
||||
if "css_class" in kwargs:
|
||||
self.css_class = kwargs["css_class"]
|
||||
|
||||
# self.query_words = set(
|
||||
# [word.lower() for word in self.query.split() if not word.startswith("-")]
|
||||
# )
|
||||
sa = StemmingAnalyzer()
|
||||
self.query_words = set(
|
||||
[token.text.lower() for token in sa(query) if token.text.replace(" ",'') != '']
|
||||
)
|
||||
# print(self.query_words)
|
||||
|
||||
def highlight(self, text_block):
|
||||
self.text_block = strip_tags(text_block)
|
||||
highlight_locations = self.find_highlightable_words()
|
||||
start_offset, end_offset = self.find_window(highlight_locations)
|
||||
if len(text_block) < self.max_length:
|
||||
start_offset = 0
|
||||
return self.render_html(highlight_locations, start_offset, end_offset)
|
||||
|
||||
def find_window(self, highlight_locations):
|
||||
best_start = 0
|
||||
best_end = self.max_length
|
||||
|
||||
# First, make sure we have words.
|
||||
if not len(highlight_locations):
|
||||
return (best_start, best_end)
|
||||
|
||||
words_found = []
|
||||
|
||||
# Next, make sure we found any words at all.
|
||||
for word, offset_list in highlight_locations.items():
|
||||
if len(offset_list):
|
||||
# Add all of the locations to the list.
|
||||
words_found.extend(offset_list)
|
||||
|
||||
if not len(words_found):
|
||||
return (best_start, best_end)
|
||||
|
||||
# 只有一个搜索词被发现
|
||||
if len(words_found) == 1:
|
||||
# return (words_found[0], words_found[0] + self.max_length) #
|
||||
# new added
|
||||
best_start = words_found[0]
|
||||
best_end = words_found[0] + self.max_length
|
||||
|
||||
if best_end > len(self.text_block):
|
||||
current_length = len(self.text_block) - best_start
|
||||
move_forward_steps = self.max_length - current_length
|
||||
best_start = best_start - move_forward_steps
|
||||
if best_start < 0:
|
||||
best_start = 0
|
||||
return (best_start, best_end)
|
||||
|
||||
# Sort the list so it's in ascending order.
|
||||
words_found = sorted(words_found)
|
||||
|
||||
# We now have a denormalized list of all positions were a word was
|
||||
# found. We'll iterate through and find the densest window we can by
|
||||
# counting the number of found offsets (-1 to fit in the window).
|
||||
highest_density = 0
|
||||
|
||||
if words_found[:-1][0] > self.max_length:
|
||||
best_start = words_found[:-1][0]
|
||||
best_end = best_start + self.max_length
|
||||
|
||||
for count, start in enumerate(words_found[:-1]):
|
||||
current_density = 1
|
||||
|
||||
for end in words_found[count + 1:]:
|
||||
if end - start < self.max_length:
|
||||
current_density += 1
|
||||
else:
|
||||
current_density = 0
|
||||
|
||||
# Only replace if we have a bigger (not equal density) so we
|
||||
# give deference to windows earlier in the document.
|
||||
if current_density > highest_density:
|
||||
# print(start)
|
||||
if start == 0:
|
||||
best_start = start
|
||||
else:
|
||||
best_start = start
|
||||
best_end = start + self.max_length
|
||||
highest_density = current_density
|
||||
if best_start < 10:
|
||||
best_start = 0
|
||||
best_end = 200
|
||||
else:
|
||||
best_start -= 10
|
||||
best_end -= 10
|
||||
|
||||
return (best_start, best_end)
|
||||
|
||||
def render_html(self, highlight_locations=None, start_offset=None, end_offset=None):
|
||||
# Start by chopping the block down to the proper window.
|
||||
text = self.text_block[start_offset:end_offset]
|
||||
|
||||
# Invert highlight_locations to a location -> term list
|
||||
term_list = []
|
||||
|
||||
for term, locations in highlight_locations.items():
|
||||
term_list += [(loc - start_offset, term) for loc in locations]
|
||||
|
||||
loc_to_term = sorted(term_list)
|
||||
|
||||
# Prepare the highlight template
|
||||
if self.css_class:
|
||||
hl_start = '<%s class="%s">' % (self.html_tag, self.css_class)
|
||||
else:
|
||||
hl_start = "<%s>" % (self.html_tag)
|
||||
|
||||
hl_end = "</%s>" % self.html_tag
|
||||
|
||||
# Copy the part from the start of the string to the first match,
|
||||
# and there replace the match with a highlighted version.
|
||||
highlighted_chunk = ""
|
||||
matched_so_far = 0
|
||||
prev = 0
|
||||
prev_str = ""
|
||||
|
||||
for cur, cur_str in loc_to_term:
|
||||
# This can be in a different case than cur_str
|
||||
actual_term = text[cur : cur + len(cur_str)]
|
||||
|
||||
# Handle incorrect highlight_locations by first checking for the term
|
||||
if actual_term.lower() == cur_str:
|
||||
if cur < prev + len(prev_str):
|
||||
continue
|
||||
|
||||
highlighted_chunk += (
|
||||
text[prev + len(prev_str) : cur] + hl_start + actual_term + hl_end
|
||||
)
|
||||
prev = cur
|
||||
prev_str = cur_str
|
||||
|
||||
# Keep track of how far we've copied so far, for the last step
|
||||
matched_so_far = cur + len(actual_term)
|
||||
|
||||
# Don't forget the chunk after the last term
|
||||
highlighted_chunk += text[matched_so_far:]
|
||||
|
||||
if start_offset > 0:
|
||||
highlighted_chunk = "%s" % highlighted_chunk
|
||||
|
||||
if end_offset < len(self.text_block):
|
||||
highlighted_chunk = "%s..." % highlighted_chunk
|
||||
|
||||
return highlighted_chunk
|
||||
1073
app_doc/search/whoosh_cn_backend.py
Normal file
20
app_doc/search_indexes.py
Normal file
@ -0,0 +1,20 @@
|
||||
# coding:utf-8
|
||||
# @文件: search_indexes.py
|
||||
# @创建者:州的先生
|
||||
# #日期:2020/11/22
|
||||
# 博客地址:zmister.com
|
||||
|
||||
from haystack import indexes
|
||||
from app_doc.models import *
|
||||
|
||||
# 文档索引
|
||||
class DocIndex(indexes.SearchIndex,indexes.Indexable):
|
||||
text = indexes.CharField(document=True, use_template=True)
|
||||
top_doc = indexes.IntegerField(model_attr='top_doc')
|
||||
modify_time = indexes.DateTimeField(model_attr='modify_time')
|
||||
|
||||
def get_model(self):
|
||||
return Doc
|
||||
|
||||
def index_queryset(self, using=None):
|
||||
return self.get_model().objects.filter(status=1)
|
||||
@ -1,5 +1,5 @@
|
||||
from django.urls import path,re_path
|
||||
from app_doc import views,views_user,util_upload_img,import_views
|
||||
from django.urls import path,re_path,include
|
||||
from app_doc import views,views_user,views_search,util_upload_img,import_views
|
||||
|
||||
urlpatterns = [
|
||||
path('',views.project_list,name='pro_list'),# 文档首页
|
||||
@ -22,6 +22,7 @@ urlpatterns = [
|
||||
path('manage_project_import/',import_views.import_project,name="import_project"), # 导入文集
|
||||
path('manage_project_doc_sort/',import_views.project_doc_sort,name='project_doc_sort'), # 导入文集文档排序
|
||||
path('manage_project_transfer/<int:pro_id>/',views.manage_project_transfer,name='manage_pro_transfer'), # 文集转让
|
||||
path('manage_pro_doc_sort/<int:pro_id>/',views.manage_project_doc_sort,name='manage_pro_doc_sort'), # 文集排序
|
||||
#################文档相关
|
||||
path('project-<int:pro_id>/doc-<int:doc_id>/', views.doc, name='doc'), # 文档浏览页
|
||||
path('create_doc/', views.create_doc, name="create_doc"), # 新建文档
|
||||
@ -57,6 +58,8 @@ urlpatterns = [
|
||||
path('user/center_menu/',views_user.user_center_menu,name="user_center_menu"), # 个人中心菜单数据
|
||||
path('upload_doc_img/',util_upload_img.upload_img,name="upload_doc_img"), # 上传图片
|
||||
path('search/',views.search,name="search"), # 搜索功能
|
||||
# path('doc_search/', include('haystack.urls')), # 全文检索框架
|
||||
path('doc_search/', views_search.DocSearchView(),name="doc_search"), # 全文检索框架
|
||||
path('manage_overview/',views.manage_overview,name="manage_overview"), # 个人中心概览
|
||||
path('manage_self/',views.manage_self,name="manage_self"), # 个人设置
|
||||
]
|
||||
88
app_doc/views_search.py
Normal file
@ -0,0 +1,88 @@
|
||||
# coding:utf-8
|
||||
# @文件: views_search.py
|
||||
# @创建者:州的先生
|
||||
# #日期:2020/11/22
|
||||
# 博客地址:zmister.com
|
||||
|
||||
|
||||
# from haystack.generic_views import SearchView
|
||||
from django.db.models import Q
|
||||
from haystack.views import SearchView
|
||||
from haystack.query import SearchQuerySet
|
||||
from app_doc.models import *
|
||||
import datetime
|
||||
|
||||
# 文档搜索 - 基于Haystack全文搜索
|
||||
class DocSearchView(SearchView):
|
||||
results_per_page = 10
|
||||
|
||||
def __call__(self, request):
|
||||
self.request = request
|
||||
date_type = self.request.GET.get('d_type', 'recent')
|
||||
date_range = self.request.GET.get('d_range', 'all') # 时间范围,默认不限,all
|
||||
|
||||
# 处理时间范围
|
||||
if date_type == 'recent':
|
||||
if date_range == 'recent1': # 最近1天
|
||||
start_date = datetime.datetime.now() - datetime.timedelta(days=1)
|
||||
elif date_range == 'recent7': # 最近7天
|
||||
start_date = datetime.datetime.now() - datetime.timedelta(days=7)
|
||||
elif date_range == 'recent30': # 最近30天
|
||||
start_date = datetime.datetime.now() - datetime.timedelta(days=30)
|
||||
elif date_range == 'recent365': # 最近一年
|
||||
start_date = datetime.datetime.now() - datetime.timedelta(days=365)
|
||||
else:
|
||||
start_date = datetime.datetime.strptime('1900-01-01', '%Y-%m-%d')
|
||||
end_date = datetime.datetime.now()
|
||||
elif date_type == 'day':
|
||||
try:
|
||||
date_list = date_range.split('|')
|
||||
start_date = datetime.datetime.strptime(date_list[0], '%Y-%m-%d')
|
||||
end_date = datetime.datetime.strptime(date_list[1], '%Y-%m-%d')
|
||||
except:
|
||||
start_date = datetime.datetime.now() - datetime.timedelta(days=1)
|
||||
end_date = datetime.datetime.now()
|
||||
|
||||
# 是否时间筛选
|
||||
if date_range == 'all':
|
||||
is_date_range = False
|
||||
else:
|
||||
is_date_range = True
|
||||
|
||||
# 是否认证
|
||||
if self.request.user.is_authenticated:
|
||||
is_auth = True
|
||||
else:
|
||||
is_auth = False
|
||||
|
||||
# 获取可搜索的文集列表
|
||||
if is_auth:
|
||||
colla_list = [i.project.id for i in
|
||||
ProjectCollaborator.objects.filter(user=self.request.user)] # 用户的协作文集
|
||||
open_list = [i.id for i in Project.objects.filter(
|
||||
Q(role=0) | Q(create_user=self.request.user)
|
||||
)] # 公开文集
|
||||
|
||||
view_list = list(set(open_list).union(set(colla_list))) # 合并上述两个文集ID列表
|
||||
else:
|
||||
view_list = [i.id for i in Project.objects.filter(role=0)] # 公开文集
|
||||
|
||||
sqs = SearchQuerySet().filter(
|
||||
top_doc__in=view_list
|
||||
).filter(
|
||||
modify_time__gte=start_date,
|
||||
modify_time__lte=end_date).order_by('-modify_time')
|
||||
self.form = self.build_form(form_kwargs={'searchqueryset':sqs})
|
||||
self.query = self.get_query()
|
||||
self.results = self.get_results()
|
||||
return self.create_response()
|
||||
|
||||
def extra_context(self):
|
||||
context = {
|
||||
'date_range':self.request.GET.get('d_range', 'all')
|
||||
}
|
||||
return context
|
||||
|
||||
|
||||
|
||||
|
||||
@ -5,4 +5,6 @@ pillow==7.1.0
|
||||
pyppeteer==0.0.25
|
||||
loguru==0.4.1
|
||||
djangorestframework==3.9.1
|
||||
requests
|
||||
requests==2.24.0
|
||||
whoosh==2.7.4
|
||||
django-haystack==3.0
|
||||
|
Before Width: | Height: | Size: 197 KiB |
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 55 KiB |
39
static/icon_img/file-gitbook.svg
Normal file
@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="64px" height="64px" viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 56.3 (81716) - https://sketch.com -->
|
||||
<title>icon-gitbook</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs>
|
||||
<path d="M43.2769832,10.1619526 C43.375583,10.1099979 43.5234828,10.0320659 43.7206825,9.9281565 C44.0452767,9.80537011 44.426134,9.48524846 44.426134,9.00725859 C44.426134,8.34070392 43.74665,8.07759023 43.7423221,8.07759023 C42.4785685,7.46365829 40.5310029,6.53837515 38.6353725,5.63940338 C34.5801082,3.71867346 29.9881814,1.53921508 27.9670412,0.469219411 C26.2228881,-0.456063726 24.8206409,0.324506882 24.5739492,0.482375095 L24.0892218,0.727947871 C15.0049105,5.27542945 2.85210154,11.3708966 2.15963379,11.8006489 C0.92184769,12.5636786 0.15147732,14.0853528 0.0519350811,15.9753861 C-0.103870162,18.9704969 1.40657511,22.0927794 3.56188098,23.2373239 L16.6841448,30.0958207 C16.9784436,32.1700336 18.7399084,33.7224044 20.8173117,33.7224044 C23.1024553,33.7224044 24.9634623,31.8586824 24.9980857,29.5520524 L39.4490221,21.6147895 C40.1804411,22.1936396 41.089305,22.5137613 42.0198086,22.5137613 C44.3265918,22.5137613 46.2005826,20.6149575 46.2005826,18.2776309 C46.2005826,16.3949153 44.9846819,14.7967263 43.3083589,14.2462533" id="path-1"></path>
|
||||
<filter x="-18.4%" y="-19.3%" width="136.8%" height="150.4%" filterUnits="objectBoundingBox" id="filter-2">
|
||||
<feOffset dx="0" dy="2" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
|
||||
<feGaussianBlur stdDeviation="2.5" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0" type="matrix" in="shadowBlurOuter1" result="shadowMatrixOuter1"></feColorMatrix>
|
||||
<feOffset dx="0" dy="0" in="SourceAlpha" result="shadowOffsetOuter2"></feOffset>
|
||||
<feGaussianBlur stdDeviation="1" in="shadowOffsetOuter2" result="shadowBlurOuter2"></feGaussianBlur>
|
||||
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0" type="matrix" in="shadowBlurOuter2" result="shadowMatrixOuter2"></feColorMatrix>
|
||||
<feMerge>
|
||||
<feMergeNode in="shadowMatrixOuter1"></feMergeNode>
|
||||
<feMergeNode in="shadowMatrixOuter2"></feMergeNode>
|
||||
</feMerge>
|
||||
</filter>
|
||||
</defs>
|
||||
<g id="icon-gitbook" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="编组-16备份">
|
||||
<rect id="矩形备份-7" stroke="#D9D9D9" stroke-width="1.77777778" fill="#FFFFFF" opacity="0" x="0.888888889" y="0.888888889" width="62.2222222" height="62.2222222" rx="3.55555556"></rect>
|
||||
<g id="Group-27" transform="translate(9.000000, 15.000000)">
|
||||
<g id="Path">
|
||||
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
|
||||
<use fill="#FFFFFF" fill-rule="evenodd" xlink:href="#path-1"></use>
|
||||
</g>
|
||||
<polygon id="Path-24" fill="#FAFAFA" points="2.88888889 13.3726776 1.15555556 15.1169399 2.88888889 20.9311475 20.2222222 30.2338798 43.3333333 17.4448941 43.3333333 9.30273224"></polygon>
|
||||
<polygon id="Path-24" fill="#EDEDED" points="2.88888889 13.3726776 1.15555556 15.1169399 2.88888889 20.9311475 20.2222222 30.2338798 20.2222222 20.9322414"></polygon>
|
||||
<ellipse id="Oval" fill="#FFFFFF" cx="20.8" cy="29.652459" rx="2.31111111" ry="2.32568306"></ellipse>
|
||||
<ellipse id="Oval-Copy" fill="#FFFFFF" cx="42.7555556" cy="18.0240437" rx="2.31111111" ry="2.32568306"></ellipse>
|
||||
<g id="gitbook" fill="#3884FF" fill-rule="nonzero">
|
||||
<path d="M20.8173117,28.1180828 C21.5617145,28.1180828 22.1676238,28.7320148 22.1676238,29.486274 C22.1676238,30.2405332 21.5617145,30.8544652 20.8173117,30.8544652 C20.0729089,30.8544652 19.4669996,30.2405332 19.4669996,29.486274 C19.4669996,28.7320148 20.0729089,28.1180828 20.8173117,28.1180828 M42.0241365,19.6458221 C41.2797337,19.6458221 40.6738244,19.0318901 40.6738244,18.2776309 C40.6738244,17.5233716 41.2797337,16.9094397 42.0241365,16.9094397 C42.7685393,16.9094397 43.3744486,17.5233716 43.3744486,18.2776309 C43.3744486,19.0318901 42.7685393,19.6458221 42.0241365,19.6458221 M42.0241365,14.0415005 C39.7173533,14.0415005 37.8433625,15.9403043 37.8433625,18.2776309 C37.8433625,18.7336946 37.9169372,19.1853731 38.0640866,19.6238959 L24.249355,27.0743985 C23.4660008,25.929854 22.1935913,25.2501436 20.8173117,25.2501436 C19.2246359,25.2501436 17.7704536,26.1754267 17.06933,27.6181668 L4.66117353,20.9877019 C3.34981273,20.2904506 2.36737412,18.1022217 2.47124428,16.1113282 C2.52317936,15.0720291 2.87806908,14.2651471 3.41905951,13.9537959 C3.76096546,13.7564607 4.17211819,13.7740016 4.60923845,14.0064187 L4.691469,14.050271 C7.9806908,15.8043622 18.7399084,21.5490111 19.1943404,21.759502 C19.895464,22.0883941 20.2806492,22.219951 21.4751561,21.6498713 L43.7206825,9.9281565 C44.0452767,9.80537011 44.426134,9.48524846 44.426134,9.00725859 C44.426134,8.34070392 43.74665,8.07759023 43.7423221,8.07759023 C42.4785685,7.46365829 40.5310029,6.53837515 38.6353725,5.63940338 C34.5801082,3.71867346 29.9881814,1.53921508 27.9670412,0.469219411 C26.2228881,-0.456063726 24.8206409,0.324506882 24.5739492,0.482375095 L24.0892218,0.727947871 C15.0049105,5.27542945 2.85210154,11.3708966 2.15963379,11.8006489 C0.92184769,12.5636786 0.15147732,14.0853528 0.0519350811,15.9753861 C-0.103870162,18.9704969 1.40657511,22.0927794 3.56188098,23.2373239 L16.6841448,30.0958207 C16.9784436,32.1700336 18.7399084,33.7224044 20.8173117,33.7224044 C23.1024553,33.7224044 24.9634623,31.8586824 24.9980857,29.5520524 L39.4490221,21.6147895 C40.1804411,22.1936396 41.089305,22.5137613 42.0198086,22.5137613 C44.3265918,22.5137613 46.2005826,20.6149575 46.2005826,18.2776309 C46.2005826,15.9403043 44.3265918,14.0415005 42.0241365,14.0415005" id="Shape"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.0 KiB |
1
static/icon_img/file-yuque.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1606400715008" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3366" width="64" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M228.7 643.9c-0.1 0.1-0.2 0.3-0.3 0.4 3.9-4.4 8-9 12-13.5-7.5 8.4-11.7 13.1-11.7 13.1z" fill="#1590E9" p-id="3367"></path><path d="M894 298.1l25.6-15.1c10.4-6.1 9.1-21.5-2.1-25.9l-12.3-4.8c-18-7.1-34.2-18.2-46.7-33-15.7-18.5-44.7-45.1-90.9-60.8-52.7-18-142.9-14.4-193.2-10.5-15.9 1.2-25 18.4-17.4 32.5 42.6 78.6 16.7 114.3-5.7 140.7-34.3 40.4-97.4 112.2-160.7 183.6 21.9-24.5 41.8-46.8 58.1-65.1 36.4-40.8 91.3-61.5 145.1-51.7 171.5 31.3 191 253.4-9.2 385.6 26.1-1.4 52.6-3.3 79.2-6 252.6-26 272.6-232.1 218-333.9-19.4-36.1-22.2-60.5-20.1-83.9 2-21.5 13.8-40.8 32.3-51.7z" fill="#99C236" p-id="3368"></path><path d="M212.8 704.5C241.1 672.9 316 589 390.7 504.7c-54.6 61.2-121.8 136.7-177.9 199.8z" fill="#1590E9" p-id="3369"></path><path d="M216.3 758.6c-19.5-2.5-28.2-25.6-15.5-40.6-51.7 58.3-91.7 103.5-99.1 112.6-24.1 29.5 247.7 97.9 482.6-56.8 0.1-0.1 0.3-0.2 0.4-0.3-156.5 8.2-298.5-5.9-368.4-14.9z" fill="#CAC134" p-id="3370"></path><path d="M593.9 387.9c-53.8-9.8-108.7 10.9-145.1 51.7-16.3 18.2-36.2 40.5-58.1 65.1C316 589 241.1 672.9 212.8 704.5c-4.1 4.6-8.1 9.1-12 13.5-12.7 14.9-4 38 15.5 40.6 69.9 9 211.9 23.1 368.3 15 200.2-132.3 180.8-354.4 9.3-385.7z" fill="#029F40" p-id="3371"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
1
static/icon_img/file-zip.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1606398104775" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3014" width="64" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M960 960a64 64 0 0 1-64 64H128a64 64 0 0 1-64-64V64a64 64 0 0 1 64-64h768a64 64 0 0 1 64 64v896z" fill="#EDD87E" p-id="3015"></path><path d="M576 224l-64 64h64zM448 288h64v64h-64zM512 352h64v64h-64zM448 416h64v64h-64z" fill="" p-id="3016"></path><path d="M608 480h-192a32 32 0 0 0-32 32v352a32 32 0 0 0 32 32h192a32 32 0 0 0 32-32V512a32 32 0 0 0-32-32z m-32 352h-128v-128h128v128z" fill="#FFFFFF" p-id="3017"></path><path d="M448 704h128v32h-128zM608 896h-192a32 32 0 0 1-32-32v32a32 32 0 0 0 32 32h192a32 32 0 0 0 32-32v-32a32 32 0 0 1-32 32z" fill="" p-id="3018"></path><path d="M800 0l-288 288-288-288z" fill="#434854" p-id="3019"></path></svg>
|
||||
|
After Width: | Height: | Size: 1023 B |
92
static/mrdoc/mrdoc-docs.css
Normal file
@ -0,0 +1,92 @@
|
||||
/*一级无序li显示实心圆点*/
|
||||
.doc-content ul li{
|
||||
list-style:disc;
|
||||
}
|
||||
/*二级无序li显示空心圆点*/
|
||||
.doc-content ul > li > ul > li{
|
||||
list-style-type: circle;
|
||||
}
|
||||
/*有序li显示数字*/
|
||||
.doc-content ol li{
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.doc-content ol ol ul,.doc-content ol ul ul,.doc-content ul ol ul,.doc-content ul ul ul {
|
||||
list-style-type: square;
|
||||
}
|
||||
/* 三级及以下无序li显示小方块 */
|
||||
.doc-content ul ul ul li{
|
||||
list-style-type: square;
|
||||
}
|
||||
/* 下拉目录隐藏li样式 */
|
||||
.editormd-toc-menu ul.markdown-toc-list li{
|
||||
/*list-style:none;*/
|
||||
}
|
||||
/* 弹出框文档目录样式 */
|
||||
ul.markdown-toc-list{
|
||||
list-style-position:inside;
|
||||
}
|
||||
ul.markdown-toc-list li{
|
||||
list-style: none!important;
|
||||
line-height: 24px;
|
||||
}
|
||||
ul.markdown-toc-list > li > ul > li,ul.markdown-toc-list > li > ul li{
|
||||
padding-left:15px;
|
||||
}
|
||||
ul.markdown-toc-list a{
|
||||
/* text-decoration: underline!important; */
|
||||
}
|
||||
/* 块级代码和行内代码去除边框 */
|
||||
.markdown-body p code{
|
||||
border:none;
|
||||
}
|
||||
/* HTML预览样式 */
|
||||
.markdown-body h1{
|
||||
font-size: 1.7em;
|
||||
}
|
||||
.markdown-body h2{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.markdown-body h3{
|
||||
font-size: 1.25em;
|
||||
}
|
||||
.markdown-body h4{
|
||||
font-size: 1em;
|
||||
}
|
||||
.markdown-body h5{
|
||||
font-size: .875em;
|
||||
}
|
||||
.markdown-body h6{
|
||||
font-size: .85em;
|
||||
}
|
||||
{% if img_scale %}
|
||||
.markdown-body p img{
|
||||
max-width: 350px;
|
||||
}
|
||||
{% endif %}
|
||||
#url_qrcode img{
|
||||
margin: auto;
|
||||
}
|
||||
/* 文档代码块样式 */
|
||||
ol.linenums li{
|
||||
width: max-content;
|
||||
}
|
||||
pre.linenums{
|
||||
max-height: 500px;
|
||||
}
|
||||
li.L1, li.L3, li.L5, li.L7, li.L9 {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
/* layui弹出框颜色 */
|
||||
.layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after{
|
||||
border-bottom: 2px solid #333;
|
||||
}
|
||||
.layui-tab-brief>.layui-tab-title .layui-this{
|
||||
color: #333;
|
||||
}
|
||||
/* 覆盖vditor样式 */
|
||||
.vditor-outline__item{
|
||||
padding: 0;
|
||||
padding-bottom: 5px;
|
||||
color: #333;
|
||||
}
|
||||
104
static/mrdoc/mrdoc-editor.css
Normal file
@ -0,0 +1,104 @@
|
||||
/* 编辑器图标样式 */
|
||||
.editormd-menu i{
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
}
|
||||
ul.editormd-menu{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
/* 编辑器预览列表样式 */
|
||||
.markdown-body ul li{
|
||||
list-style:disc;
|
||||
}
|
||||
.markdown-body ul > li > ul > li{
|
||||
list-style-type: circle;
|
||||
}
|
||||
.markdown-body ol li{
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.markdown-body ol ol ul,.markdown-body ol ul ul,.markdown-body ul ol ul,.markdown-body ul ul ul li{
|
||||
list-style-type: square;
|
||||
}
|
||||
/* 选择上级文档样式 */
|
||||
.selected-parent-doc{
|
||||
text-decoration-line: underline;
|
||||
font-weight: 700;
|
||||
color: black;
|
||||
}
|
||||
/* 选择图片 - 图片列表样式 */
|
||||
.select-img-list{
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
display:flex;
|
||||
float: left;
|
||||
align-items:center;
|
||||
width: 120px;
|
||||
height:120px;
|
||||
margin: 0 20px 30px 0;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.select-img-list:hover{
|
||||
background-color: #EAFFEA;
|
||||
}
|
||||
.select-img-list-i{
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
-webkit-background-size: contain;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px;
|
||||
overflow: hidden;
|
||||
}
|
||||
/* layui分页组件样式 */
|
||||
.layui-laypage .layui-laypage-curr .layui-laypage-em{
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
.layui-form-select dl dd.layui-this{
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
/* layui单选样式 */
|
||||
.layui-form-radio>i:hover, .layui-form-radioed>i{
|
||||
color: #2176ff;
|
||||
}
|
||||
/* HTML预览样式 */
|
||||
.markdown-body h1{
|
||||
font-size: 1.7em;
|
||||
}
|
||||
.markdown-body h2{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.markdown-body h3{
|
||||
font-size: 1.25em;
|
||||
}
|
||||
.markdown-body h4{
|
||||
font-size: 1em;
|
||||
}
|
||||
.markdown-body h5{
|
||||
font-size: .875em;
|
||||
}
|
||||
.markdown-body h6{
|
||||
font-size: .85em;
|
||||
}
|
||||
/* 编辑器行号宽度 */
|
||||
.CodeMirror-linenumber{
|
||||
width: auto !important;
|
||||
}
|
||||
li.L1, li.L3, li.L5, li.L7, li.L9 {
|
||||
background: none !important;
|
||||
}
|
||||
/* layui 折叠面板 边框颜色 - 用在左侧文集结构 */
|
||||
.layui-badge-rim, .layui-colla-content, .layui-colla-item, .layui-collapse, .layui-elem-field, .layui-form-pane .layui-form-item[pane], .layui-form-pane .layui-form-label, .layui-input, .layui-layedit, .layui-layedit-tool, .layui-quote-nm, .layui-select, .layui-tab-bar, .layui-tab-card, .layui-tab-title, .layui-tab-title .layui-this:after, .layui-textarea{
|
||||
border-color: #f8f8f8;
|
||||
}
|
||||
.layui-colla-content{
|
||||
padding: 0px;
|
||||
}
|
||||
/* 预览代码宽度 */
|
||||
ol.linenums li{
|
||||
width: max-content;
|
||||
}
|
||||
#doc-tree{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
101
static/mrdoc/mrdoc-search-result.css
Normal file
@ -0,0 +1,101 @@
|
||||
.layui-nav .layui-this:after, .layui-nav-bar, .layui-nav-tree .layui-nav-itemed:after{
|
||||
background-color: #0885ff !important;
|
||||
}
|
||||
.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this{
|
||||
background-color: #0885ff !important;
|
||||
}
|
||||
/* layui分页组件样式 */
|
||||
.layui-laypage .layui-laypage-curr .layui-laypage-em{
|
||||
background-color: #0885ff !important;
|
||||
}
|
||||
.index-control .layui-input{
|
||||
height: 25px;
|
||||
border: none;
|
||||
}
|
||||
.index-control .layui-form-select dl {
|
||||
top: 30px;
|
||||
}
|
||||
.index-control .layui-form-item{
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
/* 文集列表样式 */
|
||||
.project-item-list{
|
||||
/* float: left; */
|
||||
min-width: 0;
|
||||
width: 100vw;
|
||||
height: 120px;
|
||||
/* margin-top: 20px; */
|
||||
/* margin-left: 20px; */
|
||||
margin: 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,.055);
|
||||
}
|
||||
/* 搜索类型 */
|
||||
a.search_type{
|
||||
color: #999;
|
||||
margin-left: 15px;
|
||||
font-size: 16px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
a.search_type:hover{
|
||||
color: #333;
|
||||
}
|
||||
/* 当前搜索类型链接样式 */
|
||||
.current_search_type{
|
||||
color: #333 !important;
|
||||
border-bottom: 2px solid#007fff !important;
|
||||
}
|
||||
/* 搜索结果标题 */
|
||||
.search_result_title{
|
||||
color: #00c;
|
||||
font-weight: 400;
|
||||
font-size: medium;
|
||||
line-height:26px;
|
||||
}
|
||||
.search_result_title:hover{
|
||||
color: #00c;
|
||||
}
|
||||
/* 搜索结果简介 */
|
||||
.search_result_pre{
|
||||
font-size: 13px;
|
||||
color: #333;
|
||||
line-height: 20px;
|
||||
word-break: break-word;
|
||||
}
|
||||
/* 搜索结果归属 */
|
||||
.search_result_info a{
|
||||
color: green;
|
||||
}
|
||||
/* 时间筛选下拉框 */
|
||||
.layui-form-select dl dd.layui-this{
|
||||
background-color:#0885ff;
|
||||
}
|
||||
|
||||
/* 搜索词高亮 */
|
||||
.highlighted{
|
||||
color:#c00;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1200px){
|
||||
.layui-container {
|
||||
width: 970px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 移动端筛选控制栏样式 */
|
||||
@media screen and (max-width: 768px){
|
||||
/* 控制栏样式 */
|
||||
.index-control .layui-form-item .layui-inline{
|
||||
display: -webkit-inline-box;
|
||||
}
|
||||
.index-control .layui-form-item .layui-input-inline{
|
||||
display: -webkit-inline-box;
|
||||
float: none;
|
||||
left: -3px;
|
||||
/* width: auto; */
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
}
|
||||
314
static/mrdoc/mrdoc-search.css
Normal file
@ -0,0 +1,314 @@
|
||||
* {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
outline: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: 'Noto Sans SC Sliced', PingFangSC-Light, Microsoft YaHei UI, Microsoft YaHei, helvetica, sans-serif;
|
||||
font-weight: 300;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
form,
|
||||
input,
|
||||
button {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: none;
|
||||
outline: none;
|
||||
background: none;
|
||||
}
|
||||
|
||||
input::-webkit-input-placeholder {
|
||||
color: #ccc;
|
||||
letter-spacing: 2px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
ul,
|
||||
li {
|
||||
display: block;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.con {
|
||||
width: 100%;
|
||||
transition: 1s all;
|
||||
margin: auto;
|
||||
min-width: 320px;
|
||||
height: 380px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: -100px;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.con .shlogo {
|
||||
position: relative;
|
||||
width: 480px;
|
||||
height: 120px;
|
||||
margin: 20px auto;
|
||||
background: url(/static/search/mrdoc_search_logo.svg) no-repeat center/cover;
|
||||
}
|
||||
|
||||
.con .shlogo a {
|
||||
width: 100%;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.con .sou {
|
||||
max-width: 680px;
|
||||
position: relative;
|
||||
width: calc(100% - 60px);
|
||||
min-width: 320px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.con .sou form {
|
||||
width: 100%;
|
||||
/*border: 1px solid #ddd;*/
|
||||
height: 50px;
|
||||
display: block;
|
||||
margin: 10px auto 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.con .sou form .wd {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 25px;
|
||||
line-height: 100%;
|
||||
text-indent: 20px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.con .sou form .wd:focus {
|
||||
background: #fff;
|
||||
box-shadow: 0 1px 6px 0 rgba(32, 33, 36, 0.28);
|
||||
border-color: #fff
|
||||
}
|
||||
|
||||
.con .sou form button {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
right: 6px;
|
||||
top: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 22px;
|
||||
line-height: 40px;
|
||||
border-radius: 50%;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
.con .sou ul {
|
||||
height: 40px;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.con .sou ul li {
|
||||
width: 120px;
|
||||
margin: 0 10px;
|
||||
float: left;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
background: #eee;
|
||||
font-size: 16px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
text-indent: 30px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.con .sou ul li:active {
|
||||
background: #fff;
|
||||
box-shadow: 0 1px 20px 0 rgba(0, 0, 0, .1);
|
||||
}
|
||||
|
||||
.con .sou ul li i {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
left: 0;
|
||||
/* border-radius: 50%; */
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
/* background-color: #fff; */
|
||||
transform: scale(0.7);
|
||||
}
|
||||
|
||||
.foot {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
z-index: 1000;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
color: #999;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.home {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
position: absolute;
|
||||
right: 70px;
|
||||
top: 10px;
|
||||
z-index: 200;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.home a {
|
||||
font-size: 20px;
|
||||
color: #999;
|
||||
line-height: 50px;
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
svg.icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin: 0 5px 0 8px;
|
||||
vertical-align: -0.15em;
|
||||
fill: currentColor;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.con {
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
.con .shlogo {
|
||||
width: 320px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.con .sou form .wd:focus {
|
||||
background: #f1f1f1;
|
||||
box-shadow: none;
|
||||
border-color: #ccc
|
||||
}
|
||||
|
||||
.con .sou form button {
|
||||
border-radius: 25px;
|
||||
}
|
||||
|
||||
.con .sou ul li {
|
||||
width: 100px;
|
||||
font-size: 12px;
|
||||
text-indent: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 420px) {
|
||||
.con {
|
||||
margin: 0;
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
.con .sou form .wd {
|
||||
text-indent: 50px;
|
||||
}
|
||||
|
||||
.con .sou form:after {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
top: 10px;
|
||||
background: url(/static/search/search.svg) no-repeat center/cover;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.con .shlogo {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.foot {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
background-color: #162035;
|
||||
}
|
||||
|
||||
.con .sou ul li {
|
||||
background: #293550;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.con .sou form .wd:focus {
|
||||
background: #293550;
|
||||
border: 1px solid #162035;
|
||||
}
|
||||
|
||||
.con .sou form .wd {
|
||||
border: 1px solid #293550;
|
||||
color: #bbb;
|
||||
}
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: #222d46;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #293550;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #293550;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-corner {
|
||||
background: #222d46;
|
||||
}
|
||||
@ -23,4 +23,4 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/.vditor-reset{color:rgba(0,0,0,.85);font-size:14px;line-height:2}.vditor-reset img{max-width:calc(100% - 32px)}.vditor-reset p>img{margin:34px 0;box-shadow:0 8px 20px rgba(143,168,191,.35)}.vditor-reset h1{margin-bottom:20px;color:rgba(0,0,0,.85);font-weight:500;font-size:30px;font-family:Avenir,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol,noto color emoji;line-height:38px}.vditor-reset h2{font-size:24px;line-height:32px}.vditor-reset h2,.vditor-reset h3,.vditor-reset h4,.vditor-reset h5,.vditor-reset h6{clear:both;margin:1.6em 0 .6em;color:rgba(0,0,0,.85);font-weight:500;font-family:Avenir,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol,noto color emoji}.vditor-reset h3{font-size:18px}.vditor-reset h4{font-size:16px}.vditor-reset h5{font-size:14px}.vditor-reset h6{font-size:12px}.vditor-reset hr{clear:both;height:1px;margin:56px 0;background:#f0f0f0;border:0}.vditor-reset p,.vditor-reset pre{margin:1em 0}.vditor-reset ul>li{margin-left:20px;padding-left:4px;list-style-type:circle}.vditor-reset ol>li{margin-left:20px;padding-left:4px;list-style-type:decimal}.vditor-reset ol>li>p,.vditor-reset ul>li>p{margin:.2em 0}.vditor-reset code{margin:0 1px;padding:.2em .4em;font-size:.9em;border-radius:3px;border:1px solid #f0f0f0;font-family:sfmono-regular,Consolas,liberation mono,Menlo,Courier,monospace}.vditor-reset code:not(.hljs):not(.highlight-chroma){background:#f2f4f5;color:rgba(0,0,0,.65);--code-background-color:#f2f4f5}.vditor-reset pre{font-family:sfmono-regular,Consolas,liberation mono,Menlo,Courier,monospace;border-radius:2px}.vditor-reset .language-abc,.vditor-reset pre code:not(.hljs):not(.highlight-chroma){margin:0;padding:16px 32px;overflow:auto;color:rgba(0,0,0,.85);font-size:13px;direction:ltr;text-align:left;background:#f6f8fa}.vditor-reset b,.vditor-reset strong{font-weight:500}.vditor-reset>table{width:100%;margin:8px 0 16px;direction:ltr;empty-cells:show;border:1px solid #f0f0f0;border-collapse:collapse;border-spacing:0}.vditor-reset>table th{color:#5c6b77;font-weight:500;white-space:nowrap;background:rgba(0,0,0,.02)}.vditor-reset>table td,.vditor-reset>table th{padding:16px 24px;text-align:left;border:1px solid #f0f0f0}.vditor-reset blockquote{margin:1em 0;padding-left:.8em;color:rgba(0,0,0,.45);font-size:90%;border-left:4px solid #f0f0f0}.vditor-reset blockquote p{margin:0}.vditor-reset .vditor-anchor{margin-left:8px;opacity:0;transition:opacity .3s}.vditor-reset h1:hover .vditor-anchor,.vditor-reset h2:hover .vditor-anchor,.vditor-reset h3:hover .vditor-anchor,.vditor-reset h4:hover .vditor-anchor,.vditor-reset h5:hover .vditor-anchor,.vditor-reset h6:hover .vditor-anchor{display:inline-block;opacity:1}.vditor-reset>br,.vditor-reset>p>br{clear:both}.vditor-ir__link,.vditor-reset a{color:#1890ff;text-decoration:none;outline:none;cursor:pointer}
|
||||
*/.vditor-reset{color:rgba(0,0,0,.85);font-size:14px;line-height:2}.vditor-reset img{max-width:calc(100% - 32px)}.vditor-reset p>img{margin:34px 0;box-shadow:0 8px 20px rgba(143,168,191,.35)}.vditor-reset h1{margin-bottom:20px;color:rgba(0,0,0,.85);font-weight:500;font-size:30px;font-family:Avenir,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol,noto color emoji;line-height:38px}.vditor-reset h2{font-size:24px;line-height:32px}.vditor-reset h2,.vditor-reset h3,.vditor-reset h4,.vditor-reset h5,.vditor-reset h6{clear:both;margin:1.6em 0 .6em;color:rgba(0,0,0,.85);font-weight:500;font-family:Avenir,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol,noto color emoji}.vditor-reset h3{font-size:18px}.vditor-reset h4{font-size:16px}.vditor-reset h5{font-size:14px}.vditor-reset h6{font-size:12px}.vditor-reset hr{clear:both;height:1px;margin:56px 0;background:#f0f0f0;border:0}.vditor-reset p,.vditor-reset pre{margin:1em 0}.vditor-reset ul>li{margin-left:20px;padding-left:4px;list-style-type:circle}.vditor-reset ol>li{margin-left:20px;padding-left:4px;list-style-type:decimal}.vditor-reset ol>li>p,.vditor-reset ul>li>p{margin:.2em 0}.vditor-reset code{margin:0 1px;padding:.2em .4em;font-size:.9em;border-radius:3px;border:1px solid #f0f0f0;font-family:sfmono-regular,Consolas,liberation mono,Menlo,Courier,monospace}.vditor-reset code:not(.hljs):not(.highlight-chroma){background:#f2f4f5;color:rgba(0,0,0,.65)}.vditor-reset pre{font-family:sfmono-regular,Consolas,liberation mono,Menlo,Courier,monospace;border-radius:2px}.vditor-reset .language-abc path,.vditor-reset .language-abc svg{fill:currentColor;color:rgba(0,0,0,.85)}.vditor-reset .language-graphviz polygon{fill:transparent}.vditor-reset b,.vditor-reset strong{font-weight:500}.vditor-reset>table{width:100%;margin:8px 0 16px;direction:ltr;empty-cells:show;border:1px solid #f0f0f0;border-collapse:collapse;border-spacing:0}.vditor-reset>table th{color:#5c6b77;font-weight:500;white-space:nowrap;background:rgba(0,0,0,.02)}.vditor-reset>table td,.vditor-reset>table th{padding:16px 24px;text-align:left;border:1px solid #f0f0f0}.vditor-reset blockquote{margin:1em 0;padding-left:.8em;color:rgba(0,0,0,.45);font-size:90%;border-left:4px solid #f0f0f0}.vditor-reset blockquote p{margin:0}.vditor-reset .vditor-anchor{margin-left:8px;opacity:0;transition:opacity .3s}.vditor-reset h1:hover .vditor-anchor,.vditor-reset h2:hover .vditor-anchor,.vditor-reset h3:hover .vditor-anchor,.vditor-reset h4:hover .vditor-anchor,.vditor-reset h5:hover .vditor-anchor,.vditor-reset h6:hover .vditor-anchor{display:inline-block;opacity:1}.vditor-reset>br,.vditor-reset>p>br{clear:both}.vditor-ir__link,.vditor-reset a{color:#1890ff;text-decoration:none;outline:none;cursor:pointer}
|
||||
@ -23,4 +23,4 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/.vditor-reset{color:#d1d5da}.vditor-ir__link,.vditor-reset a{color:#4285f4}.vditor-reset h1,.vditor-reset h2{padding-bottom:.3em;border-bottom:1px solid #d1d5da}.vditor-reset hr{background-color:#d1d5da}.vditor-reset blockquote{padding:0 1em;color:#b9b9b9;border-left:.25em solid #d1d5da}.vditor-reset iframe{border:1px solid #141414}.vditor-reset table tr{background-color:#2f363d}.vditor-reset table td,.vditor-reset table th{border:1px solid #dfe2e5}.vditor-reset table tbody tr:nth-child(2n){background-color:#24292e}.vditor-reset code:not(.hljs):not(.highlight-chroma){background-color:rgba(66,133,244,.36);--code-background-color:rgba(66,133,244,0.36)}.vditor-reset .language-abc,.vditor-reset pre code:not(.hljs):not(.highlight-chroma){background-color:rgba(120,146,190,.55)}.vditor-reset kbd{color:#d1d5da;background-color:#2f363d;border:1px solid #141414;box-shadow:inset 0 -1px 0 #141414}.vditor-copy svg{color:#b9b9b9}.vditor-speech{background-color:#1d2125;border:1px solid #141414;color:#b9b9b9}.vditor-speech--current,.vditor-speech:hover{color:#fff}.vditor-linkcard a{background-color:#1d2125}.vditor-linkcard a:visited .vditor-linkcard__abstract{color:hsla(0,0%,72.5%,.36)}.vditor-linkcard__title{color:#d1d5da}.vditor-linkcard__abstract{color:#b9b9b9}.vditor-linkcard__site{color:#fff}.vditor-linkcard__image{background-color:hsla(0,0%,72.5%,.36)}
|
||||
*/.vditor-reset{color:#d1d5da}.vditor-ir__link,.vditor-reset a{color:#4285f4}.vditor-reset h1,.vditor-reset h2{padding-bottom:.3em;border-bottom:1px solid #d1d5da}.vditor-reset hr{background-color:#d1d5da}.vditor-reset blockquote{padding:0 1em;color:#b9b9b9;border-left:.25em solid #d1d5da}.vditor-reset iframe{border:1px solid #141414}.vditor-reset table tr{background-color:#2f363d}.vditor-reset table td,.vditor-reset table th{border:1px solid #dfe2e5}.vditor-reset table tbody tr:nth-child(2n){background-color:#24292e}.vditor-reset code:not(.hljs):not(.highlight-chroma){background-color:rgba(66,133,244,.36)}.vditor-reset .language-abc path,.vditor-reset .language-abc svg{fill:currentColor;color:#d1d5da}.language-graphviz polygon{fill:rgba(66,133,244,.36)}.vditor-reset kbd{color:#d1d5da;background-color:#2f363d;border:1px solid #141414;box-shadow:inset 0 -1px 0 #141414}.vditor-copy svg{color:#b9b9b9}.vditor-speech{background-color:#1d2125;border:1px solid #141414;color:#b9b9b9}.vditor-speech--current,.vditor-speech:hover{color:#fff}.vditor-linkcard a{background-color:#1d2125}.vditor-linkcard a:visited .vditor-linkcard__abstract{color:hsla(0,0%,72.5%,.36)}.vditor-linkcard__title{color:#d1d5da}.vditor-linkcard__abstract{color:#b9b9b9}.vditor-linkcard__site{color:#fff}.vditor-linkcard__image{background-color:hsla(0,0%,72.5%,.36)}
|
||||
@ -23,4 +23,4 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/.vditor-reset h1,.vditor-reset h2{padding-bottom:.3em;border-bottom:1px solid #eaecef}.vditor-reset hr{background-color:#eaecef}.vditor-reset blockquote{color:#6a737d;border-left:.25em solid #eaecef}.vditor-reset iframe{border:1px solid #d1d5da}.vditor-reset table tr{border-top:1px solid #c6cbd1;background-color:#fafbfc}.vditor-reset table td,.vditor-reset table th{border:1px solid #dfe2e5}.vditor-reset table tbody tr:nth-child(2n){background-color:#fff}.vditor-reset code:not(.hljs):not(.highlight-chroma){background-color:rgba(27,31,35,.05);--code-background-color:rgba(27,31,35,0.05)}.vditor-reset .language-abc,.vditor-reset pre code:not(.hljs):not(.highlight-chroma){background-color:rgba(27,31,35,.02)}.vditor-reset kbd{color:#24292e;background-color:#fafbfc;border:1px solid #d1d5da;box-shadow:inset 0 -1px 0 #d1d5da}.vditor-speech{background-color:#f6f8fa;border:1px solid #d1d5da;color:#586069}.vditor-speech--current,.vditor-speech:hover{color:#4285f4}.vditor-linkcard a{background-color:#f6f8fa}.vditor-linkcard a:visited .vditor-linkcard__abstract{color:rgba(88,96,105,.36)}.vditor-linkcard__title{color:#24292e}.vditor-linkcard__abstract{color:#586069}.vditor-linkcard__site{color:#4285f4}.vditor-linkcard__image{background-color:rgba(88,96,105,.36)}
|
||||
*/.vditor-reset h1,.vditor-reset h2{padding-bottom:.3em;border-bottom:1px solid #eaecef}.vditor-reset hr{background-color:#eaecef}.vditor-reset blockquote{color:#6a737d;border-left:.25em solid #eaecef}.vditor-reset iframe{border:1px solid #d1d5da}.vditor-reset table tr{border-top:1px solid #c6cbd1;background-color:#fafbfc}.vditor-reset table td,.vditor-reset table th{border:1px solid #dfe2e5}.vditor-reset table tbody tr:nth-child(2n){background-color:#fff}.vditor-reset code:not(.hljs):not(.highlight-chroma){background-color:rgba(27,31,35,.05)}.vditor-reset kbd{color:#24292e;background-color:#fafbfc;border:1px solid #d1d5da;box-shadow:inset 0 -1px 0 #d1d5da}.vditor-speech{background-color:#f6f8fa;border:1px solid #d1d5da;color:#586069}.vditor-speech--current,.vditor-speech:hover{color:#4285f4}.vditor-linkcard a{background-color:#f6f8fa}.vditor-linkcard a:visited .vditor-linkcard__abstract{color:rgba(88,96,105,.36)}.vditor-linkcard__title{color:#24292e}.vditor-linkcard__abstract{color:#586069}.vditor-linkcard__site{color:#4285f4}.vditor-linkcard__image{background-color:rgba(88,96,105,.36)}
|
||||
@ -23,4 +23,4 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*/.vditor-reset{font-family:mp-quote,-apple-system-font,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Hiragino Sans GB,Microsoft YaHei UI,Microsoft YaHei,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Noto Color Emoji,Segoe UI Symbol,Android Emoji,EmojiSymbols;color:#3e3e3e}.vditor-ir__link,.vditor-reset a{color:#576b95}.vditor-reset h1{font-weight:400;text-align:center;color:#1aad19;font-size:24px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAYAAABYBvyLAAAAGElEQVQImWNkXs/wn4GKgImahjEwMDAAAA6aAbVUOzXRAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:bottom}.vditor-reset h2{font-weight:400;text-align:center;font-size:20px}.vditor-reset h3,.vditor-reset h4,.vditor-reset h5,.vditor-reset h6{font-weight:400}.vditor-reset hr{border-bottom:1px solid rgba(0,0,0,.1);transform-origin:0 0;transform:scaleY(.5);height:0}.vditor-reset blockquote{padding:4px 0 0 10px;border-left:3px solid #dbdbdb;color:#9a9a9a;line-height:1.6;font-size:15px;margin:1em 0}.vditor-reset code{font-size:14px;border:1px solid #f0f0f0;border-radius:2px}.vditor-reset code:not(.hljs):not(.highlight-chroma){background-color:rgba(0,0,0,.03);color:#333;--code-background-color:rgba(0,0,0,0.03)}.vditor-reset .language-abc,.vditor-reset pre code:not(.hljs):not(.highlight-chroma){background-color:rgba(0,0,0,.02);font-size:14px;border:1px solid #f0f0f0;border-radius:2px}
|
||||
*/.vditor-reset{font-family:mp-quote,-apple-system-font,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Hiragino Sans GB,Microsoft YaHei UI,Microsoft YaHei,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Noto Color Emoji,Segoe UI Symbol,Android Emoji,EmojiSymbols;color:#3e3e3e}.vditor-ir__link,.vditor-reset a{color:#576b95}.vditor-reset h1{font-weight:400;text-align:center;color:#1aad19;font-size:24px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAACCAYAAABYBvyLAAAAGElEQVQImWNkXs/wn4GKgImahjEwMDAAAA6aAbVUOzXRAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:bottom}.vditor-reset h2{font-weight:400;text-align:center;font-size:20px}.vditor-reset h3,.vditor-reset h4,.vditor-reset h5,.vditor-reset h6{font-weight:400}.vditor-reset hr{border-bottom:1px solid rgba(0,0,0,.1);transform-origin:0 0;transform:scaleY(.5);height:0}.vditor-reset blockquote{padding:4px 0 0 10px;border-left:3px solid #dbdbdb;color:#9a9a9a;line-height:1.6;font-size:15px;margin:1em 0}.vditor-reset code{font-size:14px;border:1px solid #f0f0f0;border-radius:2px}.vditor-reset code:not(.hljs):not(.highlight-chroma){background-color:rgba(0,0,0,.03);color:#333}.vditor-reset .language-abc path,.vditor-reset .language-abc svg{fill:currentColor;color:#3e3e3e}.vditor-reset .language-graphviz polygon{fill:transparent}
|
||||
4
static/vditor/dist/index.css
vendored
10
static/vditor/dist/js/lute/lute.min.js
vendored
4
static/vditor/dist/method.min.js
vendored
@ -10,7 +10,6 @@
|
||||
<link rel="icon" href="{% static 'favicon_16.png' %}"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>请输入访问码 - {% if site_name != None and site_name != '' %}{{site_name}} {% else %}站点标题{% endif %}</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="stylesheet" href="{% static 'layui/css/layui.css' %}" crossorigin="anonymous">
|
||||
<style>
|
||||
|
||||
@ -15,100 +15,9 @@
|
||||
<link rel="stylesheet" href="{% static 'katex/katex.min.css' %}?version={{mrdoc_version}}" />
|
||||
<link rel="icon" href="{% static 'favicon_16.png' %}"/>
|
||||
<link href="{% static 'mrdoc/mrdoc.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link href="{% static 'mrdoc/mrdoc-editor.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link href="{% static 'tagsInput/tagsinput.css' %}" rel="stylesheet" type="text/css"/>
|
||||
<style>
|
||||
/* 编辑器图标样式 */
|
||||
.editormd-menu i{
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
}
|
||||
ul.editormd-menu{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
/* 编辑器预览列表样式 */
|
||||
.markdown-body ul li{
|
||||
list-style:disc;
|
||||
}
|
||||
.markdown-body ul > li > ul > li{
|
||||
list-style-type: circle;
|
||||
}
|
||||
.markdown-body ol li{
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.markdown-body ol ol ul,.markdown-body ol ul ul,.markdown-body ul ol ul,.markdown-body ul ul ul li{
|
||||
list-style-type: square;
|
||||
}
|
||||
/* 选择上级文档样式 */
|
||||
.selected-parent-doc{
|
||||
text-decoration-line: underline;
|
||||
font-weight: 700;
|
||||
color: black;
|
||||
}
|
||||
/* 选择图片 - 图片列表样式 */
|
||||
.select-img-list{
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
display:flex;
|
||||
float: left;
|
||||
align-items:center;
|
||||
width: 120px;
|
||||
height:120px;
|
||||
margin: 0 20px 30px 0;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
.select-img-list:hover{
|
||||
background-color: #EAFFEA;
|
||||
}
|
||||
.select-img-list-i{
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
-webkit-background-size: contain;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px;
|
||||
overflow: hidden;
|
||||
}
|
||||
/* HTML预览样式 */
|
||||
.markdown-body h1{
|
||||
font-size: 1.7em;
|
||||
}
|
||||
.markdown-body h2{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.markdown-body h3{
|
||||
font-size: 1.25em;
|
||||
}
|
||||
.markdown-body h4{
|
||||
font-size: 1em;
|
||||
}
|
||||
.markdown-body h5{
|
||||
font-size: .875em;
|
||||
}
|
||||
.markdown-body h6{
|
||||
font-size: .85em;
|
||||
}
|
||||
/* 编辑器行号宽度 */
|
||||
.CodeMirror-linenumber{
|
||||
width: auto !important;
|
||||
}
|
||||
li.L1, li.L3, li.L5, li.L7, li.L9 {
|
||||
background: none !important;
|
||||
}
|
||||
/* layui 折叠面板 边框颜色 - 用在左侧文集结构 */
|
||||
.layui-badge-rim, .layui-colla-content, .layui-colla-item, .layui-collapse, .layui-elem-field, .layui-form-pane .layui-form-item[pane], .layui-form-pane .layui-form-label, .layui-input, .layui-layedit, .layui-layedit-tool, .layui-quote-nm, .layui-select, .layui-tab-bar, .layui-tab-card, .layui-tab-title, .layui-tab-title .layui-this:after, .layui-textarea{
|
||||
border-color: #f8f8f8;
|
||||
}
|
||||
.layui-colla-content{
|
||||
padding: 0px;
|
||||
}
|
||||
/* 预览代码宽度 */
|
||||
ol.linenums li{
|
||||
width: max-content;
|
||||
}
|
||||
#doc-tree{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
@ -635,7 +544,7 @@
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<div class="layui-row">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-fluid" id="upload_img"><i class="layui-icon layui-icon-upload"></i> 点击上传图片</button>
|
||||
<button class="layui-btn layui-btn-primary layui-btn-fluid" id="upload_img"><i class="layui-icon layui-icon-upload"></i> 上传图片</button>
|
||||
</div>
|
||||
<fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
|
||||
<legend style="font-size: 12px;">或 插入外链图片链接</legend>
|
||||
@ -659,8 +568,8 @@
|
||||
<div id="upload-attach" style="display:none;margin:20px;">
|
||||
<span>* 仅支持 {% if attachment_suffix and attachment_suffix != '' %}{{attachment_suffix}}{% else %}zip{% endif %} 格式文件,文件大小不超过 {% if attachment_size and attachment_size != '' %}{{attachment_size}}{% else %}50{% endif %}MB</span>
|
||||
<div style="margin: 10px 0 0 10px;">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" id="upload_attachment"><i class="layui-icon layui-icon-upload"></i> 点击上传附件</button>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm" href="{% url 'manage_attachment' %}" target="_blank"><i class="fa fa-cubes"></i> 管理附件</a>
|
||||
<button class="layui-btn layui-btn-primary layui-btn-sm" id="upload_attachment"><i class="layui-icon layui-icon-upload"></i> 上传附件</button>
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm" href="{% url 'manage_attachment' %}" target="_blank"><i class="fa fa-cubes"></i> 管理附件</a>
|
||||
</div>
|
||||
<table class="layui-table" id="attach_table" style="margin: 10px;width:90%;">
|
||||
<thead>
|
||||
|
||||
@ -15,112 +15,10 @@
|
||||
<link rel="stylesheet" href="{% static 'vditor/dist/index.css' %}?version={{mrdoc_version}}" />
|
||||
<link rel="icon" href="{% static 'favicon_16.png' %}"/>
|
||||
<link href="{% static 'mrdoc/mrdoc.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link href="{% static 'mrdoc/mrdoc-editor.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link href="{% static 'tagsInput/tagsinput.css' %}" rel="stylesheet" type="text/css"/>
|
||||
<style>
|
||||
/* 编辑器图标样式 */
|
||||
.editormd-menu i{
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
}
|
||||
ul.editormd-menu{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
/* 编辑器预览列表样式 */
|
||||
.markdown-body ul li{
|
||||
list-style:disc;
|
||||
}
|
||||
.markdown-body ul > li > ul > li{
|
||||
list-style-type: circle;
|
||||
}
|
||||
.markdown-body ol li{
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.markdown-body ol ol ul,.markdown-body ol ul ul,.markdown-body ul ol ul,.markdown-body ul ul ul li{
|
||||
list-style-type: square;
|
||||
}
|
||||
/* 选择上级文档样式 */
|
||||
.selected-parent-doc{
|
||||
text-decoration-line: underline;
|
||||
font-weight: 700;
|
||||
color: black;
|
||||
}
|
||||
/* 选择图片 - 图片列表样式 */
|
||||
.select-img-list{
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
display:flex;
|
||||
float: left;
|
||||
align-items:center;
|
||||
width: 120px;
|
||||
height:120px;
|
||||
margin: 0 20px 30px 0;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.select-img-list:hover{
|
||||
background-color: #EAFFEA;
|
||||
}
|
||||
.select-img-list-i{
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
-webkit-background-size: contain;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px;
|
||||
overflow: hidden;
|
||||
}
|
||||
/* layui分页组件样式 */
|
||||
.layui-laypage .layui-laypage-curr .layui-laypage-em{
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
.layui-form-select dl dd.layui-this{
|
||||
background-color: #2176ff !important;
|
||||
}
|
||||
/* layui单选样式 */
|
||||
.layui-form-radio>i:hover, .layui-form-radioed>i{
|
||||
color: #2176ff;
|
||||
}
|
||||
/* HTML预览样式 */
|
||||
.markdown-body h1{
|
||||
font-size: 1.7em;
|
||||
}
|
||||
.markdown-body h2{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.markdown-body h3{
|
||||
font-size: 1.25em;
|
||||
}
|
||||
.markdown-body h4{
|
||||
font-size: 1em;
|
||||
}
|
||||
.markdown-body h5{
|
||||
font-size: .875em;
|
||||
}
|
||||
.markdown-body h6{
|
||||
font-size: .85em;
|
||||
}
|
||||
/* 编辑器行号宽度 */
|
||||
.CodeMirror-linenumber{
|
||||
width: auto !important;
|
||||
}
|
||||
li.L1, li.L3, li.L5, li.L7, li.L9 {
|
||||
background: none !important;
|
||||
}
|
||||
/* layui 折叠面板 边框颜色 - 用在左侧文集结构 */
|
||||
.layui-badge-rim, .layui-colla-content, .layui-colla-item, .layui-collapse, .layui-elem-field, .layui-form-pane .layui-form-item[pane], .layui-form-pane .layui-form-label, .layui-input, .layui-layedit, .layui-layedit-tool, .layui-quote-nm, .layui-select, .layui-tab-bar, .layui-tab-card, .layui-tab-title, .layui-tab-title .layui-this:after, .layui-textarea{
|
||||
border-color: #f8f8f8;
|
||||
}
|
||||
.layui-colla-content{
|
||||
padding: 0px;
|
||||
}
|
||||
/* 预览代码宽度 */
|
||||
ol.linenums li{
|
||||
width: max-content;
|
||||
}
|
||||
#doc-tree{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
</style>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
@ -552,7 +450,7 @@
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<div class="layui-row">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-fluid" id="upload_img"><i class="layui-icon layui-icon-upload"></i> 点击上传图片</button>
|
||||
<button class="layui-btn layui-btn-primary layui-btn-fluid" id="upload_img"><i class="layui-icon layui-icon-upload"></i> 上传图片</button>
|
||||
</div>
|
||||
<fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
|
||||
<legend style="font-size: 12px;">或 插入外链图片链接</legend>
|
||||
@ -576,8 +474,8 @@
|
||||
<div id="upload-attach" style="display:none;margin:20px;">
|
||||
<span>* 仅支持 {% if attachment_suffix and attachment_suffix != '' %}{{attachment_suffix}}{% else %}zip{% endif %} 格式文件,文件大小不超过 {% if attachment_size and attachment_size != '' %}{{attachment_size}}{% else %}50{% endif %}MB</span>
|
||||
<div style="margin: 10px 0 0 10px;">
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" id="upload_attachment"><i class="layui-icon layui-icon-upload"></i> 点击上传附件</button>
|
||||
<a class="layui-btn layui-btn-normal layui-btn-sm" href="{% url 'manage_attachment' %}" target="_blank"><i class="fa fa-cubes"></i> 管理附件</a>
|
||||
<button class="layui-btn layui-btn-primary layui-btn-sm" id="upload_attachment"><i class="layui-icon layui-icon-upload"></i> 上传附件</button>
|
||||
<a class="layui-btn layui-btn-primary layui-btn-sm" href="{% url 'manage_attachment' %}" target="_blank"><i class="fa fa-cubes"></i> 管理附件</a>
|
||||
</div>
|
||||
<table class="layui-table" id="attach_table" style="margin: 10px;width:90%;">
|
||||
<thead>
|
||||
|
||||
@ -88,7 +88,7 @@
|
||||
<div class="layui-collapse" style="margin-top: 10px;margin-bottom: 10px;">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">标签</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
<div class="layui-colla-content">
|
||||
<div class="layui-row layui-col-space5" style="padding: 5px;background-color: #fff;">
|
||||
<input name="tagsinput" id="tagsinputval" class="tagsinput" data-role="tagsinput" value="" placeholder="输入标签名">
|
||||
</div>
|
||||
|
||||
@ -87,7 +87,7 @@
|
||||
<div class="layui-collapse" style="margin-top: 10px;margin-bottom: 10px;">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">标签</h2>
|
||||
<div class="layui-colla-content layui-show">
|
||||
<div class="layui-colla-content">
|
||||
<div class="layui-row layui-col-space5" style="padding: 5px;background-color: #fff;">
|
||||
<input name="tagsinput" id="tagsinputval" class="tagsinput" data-role="tagsinput" value="" placeholder="输入标签名">
|
||||
</div>
|
||||
|
||||
@ -21,99 +21,8 @@
|
||||
<link href="{% static 'viewerjs/viewer.min.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link rel="icon" href="{% static 'search/mrdoc_logo_300.png' %}" sizes="192x192" />
|
||||
<link href="{% static 'mrdoc/mrdoc.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link href="{% static 'mrdoc/mrdoc-docs.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<style>
|
||||
/*一级无序li显示实心圆点*/
|
||||
.doc-content ul li{
|
||||
list-style:disc;
|
||||
}
|
||||
/*二级无序li显示空心圆点*/
|
||||
.doc-content ul > li > ul > li{
|
||||
list-style-type: circle;
|
||||
}
|
||||
/*有序li显示数字*/
|
||||
.doc-content ol li{
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.doc-content ol ol ul,.doc-content ol ul ul,.doc-content ul ol ul,.doc-content ul ul ul {
|
||||
list-style-type: square;
|
||||
}
|
||||
/* 三级及以下无序li显示小方块 */
|
||||
.doc-content ul ul ul li{
|
||||
list-style-type: square;
|
||||
}
|
||||
/* 下拉目录隐藏li样式 */
|
||||
.editormd-toc-menu ul.markdown-toc-list li{
|
||||
/*list-style:none;*/
|
||||
}
|
||||
/* 弹出框文档目录样式 */
|
||||
ul.markdown-toc-list{
|
||||
list-style-position:inside;
|
||||
}
|
||||
ul.markdown-toc-list li{
|
||||
list-style: none!important;
|
||||
line-height: 24px;
|
||||
}
|
||||
ul.markdown-toc-list > li > ul > li,ul.markdown-toc-list > li > ul li{
|
||||
padding-left:15px;
|
||||
}
|
||||
ul.markdown-toc-list a{
|
||||
/* text-decoration: underline!important; */
|
||||
}
|
||||
/* 块级代码和行内代码去除边框 */
|
||||
.markdown-body p code{
|
||||
border:none;
|
||||
}
|
||||
/* HTML预览样式 */
|
||||
.markdown-body h1{
|
||||
font-size: 1.7em;
|
||||
}
|
||||
.markdown-body h2{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.markdown-body h3{
|
||||
font-size: 1.25em;
|
||||
}
|
||||
.markdown-body h4{
|
||||
font-size: 1em;
|
||||
}
|
||||
.markdown-body h5{
|
||||
font-size: .875em;
|
||||
}
|
||||
.markdown-body h6{
|
||||
font-size: .85em;
|
||||
}
|
||||
{% if img_scale %}
|
||||
.markdown-body p img{
|
||||
max-width: 350px;
|
||||
}
|
||||
{% endif %}
|
||||
#url_qrcode img{
|
||||
margin: auto;
|
||||
}
|
||||
/* 文档代码块样式 */
|
||||
ol.linenums li{
|
||||
width: max-content;
|
||||
}
|
||||
pre.linenums{
|
||||
max-height: 500px;
|
||||
}
|
||||
li.L1, li.L3, li.L5, li.L7, li.L9 {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
/* layui弹出框颜色 */
|
||||
.layui-tab-brief>.layui-tab-more li.layui-this:after, .layui-tab-brief>.layui-tab-title .layui-this:after{
|
||||
border-bottom: 2px solid #333;
|
||||
}
|
||||
.layui-tab-brief>.layui-tab-title .layui-this{
|
||||
color: #333;
|
||||
}
|
||||
/* 覆盖vditor样式 */
|
||||
.vditor-outline__item{
|
||||
padding: 0;
|
||||
padding-bottom: 5px;
|
||||
color: #333;
|
||||
}
|
||||
</style>
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
|
||||
@ -1,18 +1,17 @@
|
||||
{% load staticfiles %}
|
||||
{% load static %}
|
||||
<div class="layui-header layui-fluid">
|
||||
<div class="" style="display:flex;flex-direction:row;justify-content:space-between;">
|
||||
<!-- LOGO -->
|
||||
<div class="">
|
||||
<a class="logo" href="{% url 'pro_list' %}">
|
||||
<img src="{% static 'logo.jpg' %}" style="height: 32px;width: auto;">
|
||||
<!-- <h1><strong>MrDoc</strong></h1> -->
|
||||
</a>
|
||||
</div>
|
||||
<!-- 搜索框 -->
|
||||
<div style="margin:12px;" class="layui-hide-xs">
|
||||
<form method="get" action="{% url 'search' %}" target="_blank">
|
||||
<form method="get" action="{% url 'doc_search' %}" target="_blank">
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input mrdoc-search-input" placeholder="搜索文集或文档" name="kw"/>
|
||||
<input class="layui-input mrdoc-search-input" placeholder="搜索文档" name="q"/>
|
||||
<button type="submit" style="position: absolute;top:12px;right: 8px;border: none;background-color: white;">
|
||||
<i class="layui-icon layui-icon-search" ></i>
|
||||
</button>
|
||||
@ -33,6 +32,12 @@
|
||||
<i class="layui-icon layui-icon-add-circle" style="color:black;"></i> <span>新建</span>
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a href="{% url 'create_doc' %}" target="_blank">
|
||||
<img src="{% static 'icon_img/create-doc-icon.svg' %}" height="14px" width="14px"></img>
|
||||
<span class="layui-hide-xs">新建文档</span>
|
||||
</a>
|
||||
</dd>
|
||||
{% if request.user.is_authenticated %}
|
||||
<dd>
|
||||
<a href="javascript:void(0);" onclick="createPro();">
|
||||
@ -41,12 +46,6 @@
|
||||
</a>
|
||||
</dd>
|
||||
{% endif %}
|
||||
<dd>
|
||||
<a href="{% url 'create_doc' %}" target="_blank">
|
||||
<img src="{% static 'icon_img/create-doc-icon.svg' %}" height="14px" width="14px"></img>
|
||||
<span class="layui-hide-xs">新建文档</span>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
{% block custom_link %}
|
||||
{% endblock %}
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body class="layui-layout-body">
|
||||
|
||||
@ -5,10 +5,37 @@
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-card-header" style="margin-bottom: 10px;">
|
||||
<span style="font-size:18px;">导入文集到MrDoc</span>
|
||||
<span style="font-size:18px;">导入文集到MrDoc</span>
|
||||
</div>
|
||||
<div class="layui-row" >
|
||||
<button class="layui-btn layui-btn-normal layui-btn-sm" id="upload-zip"><i class="layui-icon layui-icon-upload"></i>导入Markdown压缩包(.Zip)</button>
|
||||
<div>
|
||||
<div style="width: 142px;cursor: pointer;display: inline-block;" id="upload-zip" tooltip="导入Markdown文件压缩包" placement="bottom">
|
||||
<div style="width: 70px;height: 70px;margin: 0 auto;">
|
||||
<img src="{% static 'icon_img/file-zip.svg' %}">
|
||||
</div>
|
||||
<div style="text-align: center;">
|
||||
<div style="color: #262626;font-size:14px;">Markdown</div>
|
||||
<div style="color: #8c8c8c;font-size:12px;">.zip</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 142px;cursor: pointer;display: inline-block;" id="import-yuque" tooltip="导入语雀知识库,功能开发中" placement="bottom">
|
||||
<div style="width: 70px;height: 70px;margin: 0 auto;">
|
||||
<img src="{% static 'icon_img/file-yuque.svg' %}">
|
||||
</div>
|
||||
<div style="text-align: center;">
|
||||
<div style="color: #262626;font-size:14px;">语雀知识库</div>
|
||||
<div style="color: #8c8c8c;font-size:12px;">api</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 142px;cursor: pointer;display: inline-block;" id="import-yuque" tooltip="导入GitBook,功能开发中" placement="bottom">
|
||||
<div style="width: 70px;height: 70px;margin: 0 auto;">
|
||||
<img src="{% static 'icon_img/file-gitbook.svg' %}">
|
||||
</div>
|
||||
<div style="text-align: center;">
|
||||
<div style="color: #262626;font-size:14px;">GitBook</div>
|
||||
<div style="color: #8c8c8c;font-size:12px;">.zip</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <button class="layui-btn layui-btn-normal layui-btn-sm" id="upload-zip"><i class="layui-icon layui-icon-upload"></i>导入Markdown压缩包(.Zip)</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body class="layui-container">
|
||||
|
||||
@ -142,7 +142,7 @@
|
||||
font-family:inherit;
|
||||
}
|
||||
</style>
|
||||
<script src="{% static 'vditor/dist/index.min.js' %}?version={{mrdoc_version}}"></script>
|
||||
<script src="{% static 'vditor/dist/index.min.js' %}"></script>
|
||||
<script>
|
||||
// 生成文集目录大纲
|
||||
var tree = layui.tree;
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp">
|
||||
<link href="{% static 'mrdoc/mrdoc-search.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link rel="icon" href="{% static 'search/mrdoc_logo_300.png' %}" sizes="192x192" />
|
||||
<link rel="apple-touch-icon-precomposed" href="{% static 'search/mrdoc_logo_300.png' %}" />
|
||||
<meta name="msapplication-TileImage" content="{% static 'search/mrdoc_logo_300.png' %}" />
|
||||
@ -23,320 +24,6 @@
|
||||
<!--QQ应用模式-->
|
||||
<title>觅道搜索{% if site_name != None and site_name != '' %} - {{site_name}}{% endif %}</title>
|
||||
<style>
|
||||
* {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
outline: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: 'Noto Sans SC Sliced', PingFangSC-Light, Microsoft YaHei UI, Microsoft YaHei, helvetica, sans-serif;
|
||||
font-weight: 300;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
form,
|
||||
input,
|
||||
button {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: none;
|
||||
outline: none;
|
||||
background: none;
|
||||
}
|
||||
|
||||
input::-webkit-input-placeholder {
|
||||
color: #ccc;
|
||||
letter-spacing: 2px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
ul,
|
||||
li {
|
||||
display: block;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.con {
|
||||
width: 100%;
|
||||
transition: 1s all;
|
||||
margin: auto;
|
||||
min-width: 320px;
|
||||
height: 380px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: -100px;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.con .shlogo {
|
||||
position: relative;
|
||||
width: 480px;
|
||||
height: 120px;
|
||||
margin: 20px auto;
|
||||
background: url(/static/search/mrdoc_search_logo.svg) no-repeat center/cover;
|
||||
}
|
||||
|
||||
.con .shlogo a {
|
||||
width: 100%;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.con .sou {
|
||||
max-width: 680px;
|
||||
position: relative;
|
||||
width: calc(100% - 60px);
|
||||
min-width: 320px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.con .sou form {
|
||||
width: 100%;
|
||||
/*border: 1px solid #ddd;*/
|
||||
height: 50px;
|
||||
display: block;
|
||||
margin: 10px auto 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.con .sou form .wd {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 25px;
|
||||
line-height: 100%;
|
||||
text-indent: 20px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.con .sou form .wd:focus {
|
||||
background: #fff;
|
||||
box-shadow: 0 1px 6px 0 rgba(32, 33, 36, 0.28);
|
||||
border-color: #fff
|
||||
}
|
||||
|
||||
.con .sou form button {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
right: 6px;
|
||||
top: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 22px;
|
||||
line-height: 40px;
|
||||
border-radius: 50%;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
.con .sou ul {
|
||||
height: 40px;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.con .sou ul li {
|
||||
width: 120px;
|
||||
margin: 0 10px;
|
||||
float: left;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
background: #eee;
|
||||
font-size: 16px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
text-indent: 30px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.con .sou ul li:active {
|
||||
background: #fff;
|
||||
box-shadow: 0 1px 20px 0 rgba(0, 0, 0, .1);
|
||||
}
|
||||
|
||||
.con .sou ul li i {
|
||||
position: absolute;
|
||||
display: block;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
left: 0;
|
||||
/* border-radius: 50%; */
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
/* background-color: #fff; */
|
||||
transform: scale(0.7);
|
||||
}
|
||||
|
||||
.foot {
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
z-index: 1000;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
color: #999;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.home {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
position: absolute;
|
||||
right: 70px;
|
||||
top: 10px;
|
||||
z-index: 200;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.home a {
|
||||
font-size: 20px;
|
||||
color: #999;
|
||||
line-height: 50px;
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
svg.icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin: 0 5px 0 8px;
|
||||
vertical-align: -0.15em;
|
||||
fill: currentColor;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.con {
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
.con .shlogo {
|
||||
width: 320px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.con .sou form .wd:focus {
|
||||
background: #f1f1f1;
|
||||
box-shadow: none;
|
||||
border-color: #ccc
|
||||
}
|
||||
|
||||
.con .sou form button {
|
||||
border-radius: 25px;
|
||||
}
|
||||
|
||||
.con .sou ul li {
|
||||
width: 100px;
|
||||
font-size: 12px;
|
||||
text-indent: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-height: 420px) {
|
||||
.con {
|
||||
margin: 0;
|
||||
top: 0px;
|
||||
}
|
||||
|
||||
.con .sou form .wd {
|
||||
text-indent: 50px;
|
||||
}
|
||||
|
||||
.con .sou form:after {
|
||||
content: "";
|
||||
display: block;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
top: 10px;
|
||||
background: url(/static/search/search.svg) no-repeat center/cover;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.con .shlogo {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.foot {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
background-color: #162035;
|
||||
}
|
||||
|
||||
.con .sou ul li {
|
||||
background: #293550;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.con .sou form .wd:focus {
|
||||
background: #293550;
|
||||
border: 1px solid #162035;
|
||||
}
|
||||
|
||||
.con .sou form .wd {
|
||||
border: 1px solid #293550;
|
||||
color: #bbb;
|
||||
}
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: #222d46;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #293550;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #293550;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-corner {
|
||||
background: #222d46;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@ -345,9 +32,9 @@
|
||||
<div class="con">
|
||||
<div class="shlogo"></div>
|
||||
<div class="sou">
|
||||
<form action="{% url 'search' %}" method="get" target="_self">
|
||||
<input class="wd" type="text" placeholder="请输入搜索内容" name="kw" x-webkit-speech lang="zh-CN">
|
||||
<input name="type" value="doc" hidden>
|
||||
<form action="{% url 'doc_search' %}" method="get" target="_self">
|
||||
<input class="wd" type="text" placeholder="请输入搜索内容" name="q" x-webkit-speech lang="zh-CN">
|
||||
<!-- <input name="type" value="doc" hidden> -->
|
||||
<input name="d_range" value="all" hidden>
|
||||
<button type="submit" style="background-image: url(/static/search/search_btn.svg);"></button>
|
||||
</form>
|
||||
|
||||
@ -13,109 +13,9 @@
|
||||
<title>{{ kw }} - 觅道搜索 - {% if site_name != None and site_name != '' %}{{ site_name }}{% endif %}</title>
|
||||
<link href="{% static 'layui/css/layui.css' %}" rel="stylesheet">
|
||||
<link href="{% static 'mrdoc/mrdoc.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link href="{% static 'mrdoc/mrdoc-search-result.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link rel="icon" href="{% static 'search/mrdoc_logo_300.png' %}" sizes="192x192" />
|
||||
<style>
|
||||
.layui-nav .layui-this:after, .layui-nav-bar, .layui-nav-tree .layui-nav-itemed:after{
|
||||
background-color: #0885ff !important;
|
||||
}
|
||||
.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this{
|
||||
background-color: #0885ff !important;
|
||||
}
|
||||
/* layui分页组件样式 */
|
||||
.layui-laypage .layui-laypage-curr .layui-laypage-em{
|
||||
background-color: #0885ff !important;
|
||||
}
|
||||
/* 控制栏表单下拉框样式 */
|
||||
.index-control .layui-input-inline{
|
||||
/* width: 100px; */
|
||||
}
|
||||
.index-control .layui-input{
|
||||
height: 25px;
|
||||
border: none;
|
||||
}
|
||||
.index-control .layui-form-select dl {
|
||||
top: 30px;
|
||||
}
|
||||
.index-control .layui-form-item{
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
/* 文集列表样式 */
|
||||
.project-item-list{
|
||||
/* float: left; */
|
||||
min-width: 0;
|
||||
width: 100vw;
|
||||
height: 120px;
|
||||
/* margin-top: 20px; */
|
||||
/* margin-left: 20px; */
|
||||
margin: 10px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,.055);
|
||||
}
|
||||
/* 搜索类型 */
|
||||
a.search_type{
|
||||
color: #999;
|
||||
margin-left: 15px;
|
||||
font-size: 16px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
a.search_type:hover{
|
||||
color: #333;
|
||||
}
|
||||
/* 当前搜索类型链接样式 */
|
||||
.current_search_type{
|
||||
color: #333 !important;
|
||||
border-bottom: 2px solid#007fff !important;
|
||||
}
|
||||
/* 搜索结果标题 */
|
||||
.search_result_title{
|
||||
color: #00c;
|
||||
font-weight: 400;
|
||||
font-size: medium;
|
||||
line-height:26px;
|
||||
}
|
||||
.search_result_title:hover{
|
||||
color: #00c;
|
||||
}
|
||||
/* 搜索结果简介 */
|
||||
.search_result_pre{
|
||||
font-size: 13px;
|
||||
color: #333;
|
||||
line-height: 20px;
|
||||
word-break: break-word;
|
||||
}
|
||||
/* 搜索结果归属 */
|
||||
.search_result_info a{
|
||||
color: green;
|
||||
}
|
||||
/* 时间筛选下拉框 */
|
||||
.layui-form-select dl dd.layui-this{
|
||||
background-color:#0885ff;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1200px){
|
||||
.layui-container {
|
||||
width: 970px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 移动端筛选控制栏样式 */
|
||||
@media screen and (max-width: 768px){
|
||||
/* 控制栏样式 */
|
||||
.index-control .layui-form-item .layui-inline{
|
||||
display: -webkit-inline-box;
|
||||
}
|
||||
.index-control .layui-form-item .layui-input-inline{
|
||||
display: -webkit-inline-box;
|
||||
float: none;
|
||||
left: -3px;
|
||||
/* width: auto; */
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body class="layui-container">
|
||||
@ -239,7 +139,7 @@
|
||||
<div class="layui-inline">
|
||||
<!-- 文档搜索 -->
|
||||
<div class="layui-input-inline" style="width: inherit;">
|
||||
<a href="{% url 'search' %}?kw={{kw}}&type=doc&d_range={{d_range}}" class="search_type" id="search_doc"><i class="layui-icon layui-icon-search"></i>文档</a>
|
||||
<a href="{% url 'doc_search' %}?q={{kw}}&d_range={{d_range}}" class="search_type" id="search_doc"><i class="layui-icon layui-icon-search"></i>文档</a>
|
||||
<a href="{% url 'search' %}?kw={{kw}}&type=pro&d_range={{d_range}}" class="search_type" id="search_project"><i class="layui-icon layui-icon-list"></i>文集</a>
|
||||
<a href="{% url 'search' %}?kw={{kw}}&type=tag&d_range={{d_range}}" class="search_type" id="search_tag"><i class="layui-icon layui-icon-note"></i>标签</a>
|
||||
</div>
|
||||
@ -312,7 +212,7 @@
|
||||
<div class="search_result_pre">{{ result.intro|get_key_context:kw }}</div>
|
||||
<!-- 所属文集 -->
|
||||
<p class="search_result_info">
|
||||
<a>{{ result.create_user }}</a> - <span style="font-size: 14px;color: #999;">{{result.modify_time}}</span></p>
|
||||
<a>{% if result.create_user.first_name != '' %}{{ result.create_user.first_name }}{% else %}{{result.create_user}}{% endif %}</a> - <span style="font-size: 14px;color: #999;">{{result.modify_time}}</span></p>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<!-- 标签搜索结果 -->
|
||||
|
||||
2
template/search/indexes/app_doc/doc_text.txt
Normal file
@ -0,0 +1,2 @@
|
||||
{{object.name}}
|
||||
{{object.pre_content}}
|
||||
327
template/search/search.html
Normal file
@ -0,0 +1,327 @@
|
||||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
||||
<meta http-equiv="Cache-Control" content="no-transform" />
|
||||
<meta http-equiv="Cache-Control" content="no-siteapp" />
|
||||
<meta http-equiv="Cache-Control" content="max-age=7200" />
|
||||
<meta name="keywords" content="{% if site_keywords != None %}{{site_keywords}}{% endif %}"/>
|
||||
<meta name="description" content="{% if site_desc != None %}{{site_desc}}{% endif %}" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>{{ query }} - 觅道搜索 - {% if site_name != None and site_name != '' %}{{ site_name }}{% endif %}</title>
|
||||
<link href="{% static 'layui/css/layui.css' %}" rel="stylesheet">
|
||||
<link href="{% static 'mrdoc/mrdoc.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link href="{% static 'mrdoc/mrdoc-search-result.css' %}?version={{mrdoc_version}}" rel="stylesheet">
|
||||
<link rel="icon" href="{% static 'search/mrdoc_logo_300.png' %}" sizes="192x192" />
|
||||
<style>
|
||||
</style>
|
||||
</head>
|
||||
<body class="layui-container">
|
||||
<!-- 页头 -->
|
||||
<div class="layui-header layui-fluid">
|
||||
<div class="" style="display:flex;flex-direction:row;justify-content:space-between;">
|
||||
<!-- LOGO -->
|
||||
<div class="">
|
||||
<a class="logo" href="{% url 'search' %}">
|
||||
<img src="{% static 'search/mrdoc_search_logo_2.svg' %}" style="height: 32px;width: auto;">
|
||||
</a>
|
||||
</div>
|
||||
<!-- 搜索框 -->
|
||||
<div style="margin:12px;" class="layui-hide-xs">
|
||||
<form method="get" action="">
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input mrdoc-search-input"
|
||||
placeholder="搜索文集或文档" name="q" style="width: 500px;border-radius:5px" value="{{query}}"/>
|
||||
<input name="type" value="{{search_type}}" hidden>
|
||||
<button type="submit"
|
||||
style="position: absolute;top:12px;right: 8px;border: none;background-color: white;">
|
||||
<i class="layui-icon layui-icon-search" ></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- 用户菜单 -->
|
||||
<div class="">
|
||||
<ul class="layui-nav layui-layout-right">
|
||||
{% if request.user.is_authenticated %}
|
||||
<li class="layui-nav-item">
|
||||
<a href="javascript:void(0);">
|
||||
<i class="layui-icon layui-icon-friends"></i>
|
||||
<span class="layui-hide-xs">{% if request.user.first_name != '' %}{{request.user.first_name}}{% else %}{{request.user.username}}{% endif %}</span>
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<!-- <dd><a href="">基本资料</a></dd> -->
|
||||
{% if request.user.is_superuser %}
|
||||
<dd>
|
||||
<a href="{% url 'pro_list' %}">
|
||||
<i class="layui-icon layui-icon-console layui-hide-md"></i>
|
||||
<span class="layui-hide-xs">返回首页</span>
|
||||
</a>
|
||||
</dd>
|
||||
{% endif %}
|
||||
<dd class="layui-hide-md">
|
||||
<a href="{% url 'create_doc' %}">
|
||||
<i class="layui-icon layui-icon-add-1 layui-hide-md"></i>
|
||||
</a>
|
||||
</dd>
|
||||
<dd>
|
||||
<a href="{% url 'manage_doc' %}">
|
||||
<i class="layui-icon layui-icon-app layui-hide-md"></i>
|
||||
<span class="layui-hide-xs">个人中心</span>
|
||||
</a>
|
||||
</dd>
|
||||
<dd>
|
||||
<a href="{% url 'logout' %}">
|
||||
<i class="layui-icon layui-icon-release layui-hide-md"></i>
|
||||
<span class="layui-hide-xs">退出登录</span>
|
||||
</a>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="layui-nav-item">
|
||||
<a href="javascript:void(0);">
|
||||
<i class="layui-icon layui-icon-username"></i> 游客
|
||||
</a>
|
||||
<dl class="layui-nav-child">
|
||||
<!-- <dd><a href="">基本资料</a></dd> -->
|
||||
{% if close_register == 'on' %}
|
||||
<dd><a href="{% url 'login' %}">登录</a></dd>
|
||||
{% else %}
|
||||
<dd><a href="{% url 'register' %}">注册</a></dd>
|
||||
<dd><a href="{% url 'login' %}">登录</a></dd>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 页头结束 -->
|
||||
|
||||
<!-- 小屏下的搜索框 -->
|
||||
<div class="" style="margin-top:10px;padding-left:15px;">
|
||||
<!-- 搜索框 -->
|
||||
<div style="margin:12px 0 12px 0;" class="layui-hide-md layui-hide-lg layui-hide-sm">
|
||||
<form method="get" action="">
|
||||
<div class="layui-inline">
|
||||
<div class="layui-input-inline">
|
||||
<input class="layui-input mrdoc-search-input"
|
||||
placeholder="搜索文集或文档" name="q" style="border-radius:5px" value="{{kw}}"/>
|
||||
<input name="type" value="{{search_type}}" hidden>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<button type="submit" class="layui-btn layui-btn-sm layui-btn-normal">
|
||||
<i class="layui-icon layui-icon-search" ></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 筛选栏 -->
|
||||
<div class="layui-container" style="margin-top: 10px;">
|
||||
<!-- 表单风格开始 -->
|
||||
<div class="layui-row">
|
||||
<form class="index-control layui-form" lay-filter="filter-time-form">
|
||||
<div class="layui-form-item">
|
||||
<!-- 筛选开始 -->
|
||||
<div class="layui-inline">
|
||||
<!-- 文档搜索 -->
|
||||
<div class="layui-input-inline" style="width: inherit;">
|
||||
<a href="?q={{query}}&type=doc&d_range={{d_range}}" class="search_type current_search_type" id="search_doc"><i class="layui-icon layui-icon-search"></i>文档</a>
|
||||
<a href="{% url 'search' %}?kw={{query}}&type=pro&d_range={{d_range}}" class="search_type" id="search_project"><i class="layui-icon layui-icon-list"></i>文集</a>
|
||||
<a href="{% url 'search' %}?kw={{query}}&type=tag&d_range={{d_range}}" class="search_type" id="search_tag"><i class="layui-icon layui-icon-note"></i>标签</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 筛选结束 -->
|
||||
<div class="layui-input-inline" style="float: right;">
|
||||
<select name="d_range" lay-verify="sel_recent" id="sel_recent">
|
||||
<option value="">时间筛选</option>
|
||||
<option value="all">全部时间</option>
|
||||
<option value="recent1">近1天</option>
|
||||
<option value="recent7">近7天</option>
|
||||
<option value="recent30">近30天</option>
|
||||
<option value="recent365">近1年</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- 表单风格结束 -->
|
||||
</div>
|
||||
|
||||
<!-- 搜索结果提示 -->
|
||||
{% if query != '' %}
|
||||
<div style="padding: 0 15px;margin-top: 10px;margin-bottom: 10px;color: #999;">
|
||||
觅道文档在
|
||||
{% if date_range == 'recent1' %}
|
||||
近1天内
|
||||
{% elif date_range == 'recent7' %}
|
||||
近7天内
|
||||
{% elif date_range == 'recent30' %}
|
||||
近30天内
|
||||
{% elif date_range == 'recent365' %}
|
||||
近一年内
|
||||
{% else %}
|
||||
全部时间内
|
||||
{% endif %}
|
||||
搜索到 {{ page.paginator.count }} 条结果
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- 主体 -->
|
||||
<div class="layui-container search_result" style="padding: 0 20px;">
|
||||
<!-- 遍历搜索结果列表 -->
|
||||
{% if query %}
|
||||
{% load doc_filter %}
|
||||
{% load highlight %}
|
||||
{% for result in page.object_list %}
|
||||
<div style="margin-bottom: 18px;">
|
||||
<!-- 标题 -->
|
||||
<h3>
|
||||
<a href="{{ result.object.get_absolute_url }}" target="_blank" class="search_result_title">{% highlight result.object.name with query %}</a>
|
||||
</h3>
|
||||
<!-- 简介 -->
|
||||
{% highlight result.object.pre_content with query %}
|
||||
<!-- 所属文集 -->
|
||||
<p class="search_result_info">
|
||||
<a href="{% url 'pro_index' pro_id=result.object.top_doc %}" target="_blank">{{ result.object.top_doc | get_doc_top }}</a> - <span style="font-size: 14px;color: #999;">{{result.object.modify_time}}</span></p>
|
||||
</div>
|
||||
{% empty %}
|
||||
<p>没有搜索结果。</p>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{# Show some example queries to run, maybe query syntax, something else? #}
|
||||
{% endif %}
|
||||
<!-- 文档搜索结果 -->
|
||||
</div>
|
||||
|
||||
<!-- 主体结束 -->
|
||||
<!-- 分页 -->
|
||||
<div class="layui-row project-list-page" style="text-align: center;">
|
||||
<div class="layui-box layui-laypage layui-laypage-default">
|
||||
<!-- 上一页 -->
|
||||
{% if page.has_previous %}
|
||||
<a href="?page={{ page.previous_page_number }}&q={{query}}&d_range={{date_range}}" class="layui-btn layui-btn-xs layui-btn-normal">上一页</a>
|
||||
{% else %}
|
||||
<a href="javascript:;" class="layui-btn layui-btn-xs layui-btn-disabled">上一页</a>
|
||||
{% endif %}
|
||||
<!-- 当前页 -->
|
||||
<span class="layui-laypage-curr">
|
||||
<em class="layui-laypage-em"></em>
|
||||
<em>{{ page.number }}/{{ page.paginator.num_pages }}</em>
|
||||
</span>
|
||||
<!-- 下一页 -->
|
||||
{% if page.has_next %}
|
||||
<a href="?page={{ page.next_page_number }}&q={{query}}&d_range={{date_range}}" class="layui-btn layui-btn-xs layui-btn-normal">下一页</a>
|
||||
{% else %}
|
||||
<a class="layui-btn layui-btn-xs layui-btn-disabled">下一页</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 分页结束 -->
|
||||
|
||||
<!-- 页脚 -->
|
||||
{% include 'app_doc/foot_base.html' %}
|
||||
<!-- 页脚结束 -->
|
||||
|
||||
<script src="{% static 'jquery/3.1.1/jquery.min.js' %}"></script>
|
||||
<script src="{% static 'layui/layui.all.js' %}"></script>
|
||||
{% block custom_script %}
|
||||
<script>
|
||||
$.ajaxSetup({
|
||||
data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
|
||||
});
|
||||
var layer = layui.layer;
|
||||
var form = layui.form;
|
||||
function positionFooter() {
|
||||
// 获取页脚的高度
|
||||
footerHeight = $(".layui-footer").height();
|
||||
// 获取页脚的高度
|
||||
// scrollTop() 设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
|
||||
footerTop = ($(window).scrollTop() + $(window).height() - footerHeight - 35)+"px";
|
||||
//如果页面内容高度小于屏幕高度,div#footer将绝对定位到屏幕底部,否则div#footer保留它的正常静态定位
|
||||
if(($(".layui-header").height() + $(".index-control").height() + $(".project-list-content").height() + $(".project-list-page").height() + 16) < $(window).height()) {
|
||||
console.log("页脚置底")
|
||||
$(".layui-footer").css({ position: "absolute",left:"0" }).stop().css({top:footerTop});
|
||||
}else{
|
||||
$(".layui-footer").css({ position: ""})
|
||||
}
|
||||
};
|
||||
$(window).bind("load", function() {
|
||||
// 设置页脚位置
|
||||
var footerHeight = 0;
|
||||
var footerTop = 0;
|
||||
positionFooter();
|
||||
//$(window).scroll(positionFooter).resize(positionFooter);
|
||||
//设置条件栏选中值
|
||||
var url = layui.url();
|
||||
// console.log(url)
|
||||
$("#sel-role").val(url.search.role);
|
||||
$("#sel-sort").val(url.search.sort);
|
||||
layui.form.render('select');
|
||||
});
|
||||
|
||||
// 搜索词高亮
|
||||
function keyLight(id, key, bgColor){
|
||||
var oDiv = document.getElementById(id),
|
||||
sText = oDiv.innerHTML,
|
||||
bgColor = bgColor || "#c00",
|
||||
sKey = "<span name='addSpan' style='color: "+bgColor+";'>"+key+"</span>",
|
||||
num = -1,
|
||||
rStr = new RegExp(key, "ig"),
|
||||
rHtml = new RegExp("\<.*?\>","ig"), //匹配html元素
|
||||
aHtml = sText.match(rHtml); //存放html元素的数组
|
||||
sText = sText.replace(rHtml, '{~}'); //替换html标签
|
||||
// sText = sText.replace(rStr,sKey); //替换key
|
||||
sText = sText.replace(rStr,function(text){
|
||||
return "<span name='addSpan' style='color: "+bgColor+";'>"+text+"</span>"
|
||||
}); //替换key
|
||||
sText = sText.replace(/{~}/g,function(){ //恢复html标签
|
||||
num++;
|
||||
return aHtml[num];
|
||||
});
|
||||
oDiv.innerHTML = sText;
|
||||
};
|
||||
// keyLight('search_result',"{{query}}")
|
||||
|
||||
// 侦听Select下拉框的选择事件
|
||||
form.on('select()', function(data){
|
||||
var filter_data = form.val("filter-time-form");
|
||||
console.log(filter_data)
|
||||
window.location.href = '?q={{query}}&d_range=' + filter_data['d_range']
|
||||
});
|
||||
|
||||
// 当前搜索类型动态设置
|
||||
tagCurrentSearchType = function(){
|
||||
if('{{ search_type }}' == 'doc'){
|
||||
$('#search_doc').addClass('current_search_type')
|
||||
$('#search_project').removeClass('current_search_type')
|
||||
$('#search_tag').removeClass('current_search_type')
|
||||
}else if('{{ search_type }}' == 'pro'){
|
||||
$('#search_project').addClass('current_search_type')
|
||||
$('#search_doc').removeClass('current_search_type')
|
||||
$('#search_tag').removeClass('current_search_type')
|
||||
}else if('{{ search_type }}' == 'tag'){
|
||||
$('#search_tag').addClass('current_search_type')
|
||||
$('#search_doc').removeClass('current_search_type')
|
||||
$('#search_project').removeClass('current_search_type')
|
||||
}
|
||||
}
|
||||
tagCurrentSearchType();
|
||||
|
||||
</script>
|
||||
<!-- 统计代码开始 -->
|
||||
{% if debug %}
|
||||
{% else %}
|
||||
{{ static_code | safe }}
|
||||
{% endif %}
|
||||
<!-- 统计代码结束 -->
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||