Commit 04b3fbfe authored by Nyashes's avatar Nyashes

ajout de la barre de recherche & bugfix

parent f11dc640
{
"url" : "http://localhost:28017/test",
"collection" : "nf29"
}
\ No newline at end of file
var config = {"url" : "http://localhost:28017/test","collection" : "nf29"}
\ No newline at end of file
......@@ -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;">
......
......@@ -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>
......
......@@ -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
......@@ -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, '&quot;', '\\&quot;')"/>"
"<xsl:value-of select="translate(replace($value, '&quot;', '\\&quot;'), '&#13;&#10;&#x9;', ' ')"/>"
</xsl:function>
</xsl:stylesheet>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment