Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hdoc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Stephane Crozat
hdoc
Commits
04b3fbfe
Commit
04b3fbfe
authored
Jan 07, 2017
by
Nyashes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ajout de la barre de recherche & bugfix
parent
f11dc640
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
31 deletions
+30
-31
hdoc_to_mongo/web/config.json
hdoc_to_mongo/web/config.json
+0
-4
hdoc_to_mongo/web/config.jsonp
hdoc_to_mongo/web/config.jsonp
+1
-0
hdoc_to_mongo/web/index.html
hdoc_to_mongo/web/index.html
+22
-22
hdoc_to_mongo/web/title.html
hdoc_to_mongo/web/title.html
+3
-3
hdoc_to_mongo/xsl/subroutines/config.xsl
hdoc_to_mongo/xsl/subroutines/config.xsl
+3
-1
hdoc_to_mongo/xsl/xsl-import/string.xsl
hdoc_to_mongo/xsl/xsl-import/string.xsl
+1
-1
No files found.
hdoc_to_mongo/web/config.json
deleted
100644 → 0
View file @
f11dc640
{
"url"
:
"http://localhost:28017/test"
,
"collection"
:
"nf29"
}
\ No newline at end of file
hdoc_to_mongo/web/config.jsonp
0 → 100644
View file @
04b3fbfe
var config = {"url" : "http://localhost:28017/test","collection" : "nf29"}
\ No newline at end of file
hdoc_to_mongo/web/index.html
View file @
04b3fbfe
...
...
@@ -2,34 +2,34 @@
<head>
<title>
page principale
</title>
<script
type=
"text/javascript"
src=
"https://code.jquery.com/jquery-3.1.1.min.js"
></script>
<script
type=
"text/javascript"
src=
"config.jsonp"
></script>
<script
type=
"text/javascript"
>
jQuery
(
"
document
"
).
ready
(
function
()
{
$
.
getJSON
(
'
config.json
'
,
function
(
config
)
{
$
.
ajax
({
url
:
config
.
url
+
"
/
"
+
config
.
collection
+
"
/
"
,
type
:
'
get
'
,
dataType
:
'
jsonp
'
,
jsonp
:
'
jsonp
'
,
// mongod is expecting the parameter name to be called "jsonp"
cache
:
false
,
success
:
function
(
myData
)
{
for
(
var
item
in
myData
.
rows
)
{
var
model
=
jQuery
(
"
div[name='toFill']
"
).
first
().
clone
();
model
.
find
(
"
a[name='link']
"
).
attr
(
"
href
"
,
"
title.html#
"
+
encodeURI
(
JSON
.
stringify
(
myData
.
rows
[
item
])));
model
.
find
(
"
span[name='title']
"
).
text
(
myData
.
rows
[
item
].
title
);
model
.
css
(
"
display
"
,
"
block
"
)
model
.
appendTo
(
jQuery
(
"
body
"
).
first
());
}
},
error
:
function
(
XMLHttpRequest
,
textStatus
,
errorThrown
)
{
console
.
log
(
'
error
'
,
errorThrown
+
"
"
+
textStatus
);
function
request
()
{
$
.
ajax
({
url
:
config
.
url
+
"
/
"
+
config
.
collection
+
"
/?
"
+
decodeURI
(
document
.
location
.
href
.
split
(
'
#
'
)[
1
]),
type
:
'
get
'
,
dataType
:
'
jsonp
'
,
jsonp
:
'
jsonp
'
,
// mongod is expecting the parameter name to be called "jsonp"
cache
:
false
,
success
:
function
(
myData
)
{
for
(
var
item
in
myData
.
rows
)
{
var
model
=
jQuery
(
"
div[name='toFill']
"
).
first
().
clone
();
model
.
find
(
"
a[name='link']
"
).
attr
(
"
href
"
,
"
title.html#
"
+
encodeURI
(
JSON
.
stringify
(
myData
.
rows
[
item
])));
model
.
find
(
"
span[name='title']
"
).
text
(
myData
.
rows
[
item
].
title
);
model
.
css
(
"
display
"
,
"
block
"
)
model
.
appendTo
(
jQuery
(
"
body
"
).
first
());
}
});
},
error
:
function
(
XMLHttpRequest
,
textStatus
,
errorThrown
)
{
console
.
log
(
'
error
'
,
errorThrown
+
"
"
+
textStatus
);
}
});
});
}
jQuery
(
"
document
"
).
ready
(
request
);
</script>
</head>
<body>
<
input
type=
"text"
id=
"search"
style=
"width:100%"
/
>
<
form
onsubmit=
"document.location.href = document.location.href.split('#')[0] + '#' + encodeURI($('#search').val()); document.location.reload(); return false;"
><input
type=
"text"
id=
"search"
style=
"width:100%"
/></form
>
<div
name=
"toFill"
style=
"display:none;"
>
<a
href=
""
name=
"link"
>
<div
style=
"width:100%; text-align: center; border: solid 1px black; padding: 5px; margin: 3px;"
>
...
...
hdoc_to_mongo/web/title.html
View file @
04b3fbfe
...
...
@@ -1852,16 +1852,16 @@
<p
id=
"spData"
>
</p>
<div
style=
"text-align:center;"
><a
href=
"
#todo
"
>
Lien de tlchargement
</a></div>
<div
style=
"text-align:center;"
><a
href=
"
javascript:void()
"
>
Lien de tlchargement
</a></div>
</div>
<div
id=
"rwData"
style=
"width: 35%; margin-top:0px; float:right;
%
"
>
<div
id=
"rwData"
style=
"width: 35%; margin-top:0px; float:right;"
>
<h2>
Tags
</h2>
</div>
</div>
<div
id=
"preview"
style=
"clear:both"
>
<div
id=
"introduction"
></div>
<div
style=
"text-align:center;"
>
<a
href=
"
#
"
onclick=
"loadFullText()"
>
Lire plus ...
</a>
<a
href=
"
javascript:void()
"
onclick=
"loadFullText()"
>
Lire plus ...
</a>
</div>
</div>
</div>
...
...
hdoc_to_mongo/xsl/subroutines/config.xsl
View file @
04b3fbfe
...
...
@@ -6,7 +6,9 @@
<xsl:template
name=
"config-main"
>
<xsl:param
name=
"fileName"
/>
<xsl:param
name=
"inputPath"
/>
"link" :
<xsl:value-of
select=
"h2m:escape-string(document('C:\Users\Kapil\Documents\Projets\github\hdoc\hdoc_to_mongo/input/config.xml')/config/file[@name = $fileName]/link)"
/>
,
<xsl:if
test=
"document('../../input/config.xml')/config/file[@name = $fileName]/link"
>
"link" :
<xsl:value-of
select=
"h2m:escape-string(document('../../input/config.xml')/config/file[@name = $fileName]/link)"
/>
,
</xsl:if>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
hdoc_to_mongo/xsl/xsl-import/string.xsl
View file @
04b3fbfe
...
...
@@ -4,6 +4,6 @@
xmlns:h2m=
"http://www.utc.fr/hdoc/hdoc_to_mongo"
>
<xsl:function
name=
"h2m:escape-string"
>
<xsl:param
name=
"value"
/>
"
<xsl:value-of
select=
"
replace($value, '"', '\\"
')"
/>
"
"
<xsl:value-of
select=
"
translate(replace($value, '"', '\\"'), ' 	', '
')"
/>
"
</xsl:function>
</xsl:stylesheet>
\ 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