Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stephane Crozat
hdoc
Commits
04b3fbfe
Commit
04b3fbfe
authored
Jan 07, 2017
by
Nyashes
Browse files
ajout de la barre de recherche & bugfix
parent
f11dc640
Changes
6
Hide whitespace changes
Inline
Side-by-side
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