Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexander Emmerich
erp5
Commits
3a0b0d64
Commit
3a0b0d64
authored
Jun 07, 2011
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Highlight search words if coming from search page.
parent
ad5e66e0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
6 deletions
+99
-6
bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/km_css/km.css.xml
...TemplateItem/portal_skins/erp5_km_theme/km_css/km.css.xml
+6
-1
bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/km_js/erp5_km.js.xml
...plateItem/portal_skins/erp5_km_theme/km_js/erp5_km.js.xml
+92
-4
bt5/erp5_km/bt/revision
bt5/erp5_km/bt/revision
+1
-1
No files found.
bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/km_css/km.css.xml
View file @
3a0b0d64
...
...
@@ -1300,6 +1300,11 @@ button.formbt > span{\n
display:none;\n
}\n
\n
/* Search words highliting */\n
.highlight{\n
background-color: yellow;\n
}\n
\n
</tal:block>
]]>
</unicode>
</value>
...
...
@@ -1318,7 +1323,7 @@ button.formbt > span{\n
</item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<value>
<string>
utf-8
</string>
</value>
<value>
<string>
iso-8859-15
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
...
...
bt5/erp5_km/SkinTemplateItem/portal_skins/erp5_km_theme/km_js/erp5_km.js.xml
View file @
3a0b0d64
...
...
@@ -12,7 +12,7 @@
</item>
<item>
<key>
<string>
_EtagSupport__etag
</string>
</key>
<value>
<string>
ts0
0782283.0
2
</string>
</value>
<value>
<string>
ts0
7451662.4
2
</string>
</value>
</item>
<item>
<key>
<string>
__name__
</string>
</key>
...
...
@@ -171,8 +171,96 @@ function initialize_form(){\n
})\n
}\n
}\n
\n
$(document).ready(initialize_form);
\n
// function make_pdf_navigation_asynchronous_form(){\n
// /*\n
// Make default PDF navigation in preview in asynchronous way.\n
// */\n
// \n
// function splitUrl(url){\n
// jQuery.url.setUrl(image_src)\n
// base_url = jQuery.url.attr("base") + jQuery.url.attr("path");\n
// query_dict = {"display": jQuery.url.param("display"), \n
// "format": jQuery.url.param("format"),\n
// "resolution:int": jQuery.url.param("resolution:int"),\n
// "frame": parseInt(jQuery.url.param("frame"))};\n
// query_string = $.param(query_dict);\n
// console.log(base_url);\n
// console.log(query_string); \n
// }\n
// \n
// function loadThumbnail(event){\n
// event.preventDefault();\n
// navigation_url = this.href;\n
// \n
// image = $("div.pdf-preview-content img");\n
// image_url = image.attr("src");\n
// \n
// // read current image URL\n
// jQuery.url.setUrl(image_url);\n
// base_url = jQuery.url.attr("base") + jQuery.url.attr("path");\n
// query_dict = {"display": jQuery.url.param("display"), \n
// "format": jQuery.url.param("format"),\n
// "resolution:int": jQuery.url.param("resolution:int")};\n
// \n
// \n
// // get frame index from navigation link\n
// jQuery.url.setUrl(navigation_url);\n
// frame = parseInt(jQuery.url.param("selection_index"))\n
// query_dict["frame"]=frame;\n
// \n
// // construct new thumbnail URL\n
// query_string = $.param(query_dict);\n
// new_image_url = base_url + "?" +query_string;\n
// console.log(new_image_url);\n
// \n
// image.attr("src", new_image_url);\n
// \n
// }\n
// \n
// pdf_preview_navigation = $(\'div.pdf-preview-navigation\');\n
// if(pdf_preview_navigation.length){\n
// \n
// // XXX: set hooks\n
// $("div.pdf-preview-navigation a img.first").parent("a").click(loadThumbnail);\n
// $("div.pdf-preview-navigation a img.previous").parent("a").click(loadThumbnail);\n
// $("div.pdf-preview-navigation a img.next").parent("a").click(loadThumbnail);\n
// $("div.pdf-preview-navigation a img.last").parent("a").click(loadThumbnail); \n
// \n
// }\n
// }\n
// $(document).ready(make_pdf_navigation_asynchronous_form);\n
\n
\n
jQuery.fn.highlight = function (str, className) {\n
/*\n
Highlight search word in HTML content.\n
*/\n
var regex = new RegExp(str, "gi");\n
return this.each(function () {\n
this.innerHTML = this.innerHTML.replace(regex, function(matched) {return "
<span
class=
\\""
+
className
+
"\\"
>
" + matched + "
</span>
";});\n
});\n
};\n
\n
function highlight_search_word(){\n
/*\n
Use referer to get search text (if coming from GET search page) and highlight found words.\n
*/\n
query_array = queryStringToArray(document.referrer)\n
search_text = query_array["search_text"]\n
if (search_text!=undefined){\n
container = $("div.content")\n
// multiple words\n
search_word_list = search_text.split("%20")\n
for(var i=0; i
<search_word_list.length
;
i++)
{\n
container.highlight(search_word_list[i],
"highlight")\n
}\n
}\n
}\n
\n
$(document).ready(highlight_search_word);\n
$(document).ready(initialize_form);\n
]]
></string>
</value>
</item>
...
...
@@ -182,7 +270,7 @@ $(document).ready(initialize_form);
</item>
<item>
<key>
<string>
size
</string>
</key>
<value>
<int>
5038
</int>
</value>
<value>
<int>
8097
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
...
...
bt5/erp5_km/bt/revision
View file @
3a0b0d64
1799
\ No newline at end of file
1800
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment