diff --git a/public/css/part_facets.css b/public/css/part_facets.css new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/public/css/part_facets.css diff --git a/public/css/part_results.css b/public/css/part_results.css new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/public/css/part_results.css diff --git a/public/css/part_search.css b/public/css/part_search.css index fe44133..2c5a4d9 100644 --- a/public/css/part_search.css +++ b/public/css/part_search.css @@ -1,3 +1,10 @@ .form-group { - max-width: 250px; + max-width: 250px; +} +.input-group-addon { + background-color: #EEEEEE; + background-image: url(http://caron.ads.intra.inist.fr:53390/img/istex-logo.svg); + background-repeat: no-repeat; + background-position: center; + background-size: 100%; } \ No newline at end of file diff --git a/public/html/part_results.html b/public/html/part_results.html index b8ca9ff..0a282f5 100644 --- a/public/html/part_results.html +++ b/public/html/part_results.html @@ -22,7 +22,7 @@ - +
*/ diff --git a/public/html/part_search.html b/public/html/part_search.html index 38f236d..49372df 100644 --- a/public/html/part_search.html +++ b/public/html/part_search.html @@ -3,10 +3,9 @@
- + - diff --git a/public/img/istex-logo-min.png b/public/img/istex-logo-min.png new file mode 100644 index 0000000..69b2f63 --- /dev/null +++ b/public/img/istex-logo-min.png Binary files differ diff --git a/public/img/istex-logo-min2.png b/public/img/istex-logo-min2.png new file mode 100644 index 0000000..89bce48 --- /dev/null +++ b/public/img/istex-logo-min2.png Binary files differ diff --git a/public/index.html b/public/index.html index 7346f4c..054fe0e 100644 --- a/public/index.html +++ b/public/index.html @@ -1,7 +1,7 @@ - Hello World Trop Cool + Test du widget diff --git a/public/js/app.js b/public/js/app.js index 5f0e5f7..d85e361 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -34,7 +34,7 @@ $("#result").removeClass('hide'); $("#paginRow").removeClass('hide'); - $("#pageNumber").removeClass('hide'); + $("#pageNumber").removeClass('hide'); }; }); \ No newline at end of file diff --git a/public/js/conf.js b/public/js/conf.js deleted file mode 100644 index c4ff393..0000000 --- a/public/js/conf.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Created with IntelliJ IDEA. - * User: billey - * Date: 19/02/14 - * Time: 16:11. - */ -define({ - apiUrl: "http://api.istex.fr/" -}); \ No newline at end of file diff --git a/public/js/istex-widget.js b/public/js/istex-widget.js index 08fc757..53602e7 100644 --- a/public/js/istex-widget.js +++ b/public/js/istex-widget.js @@ -1,39 +1,71 @@ +'use strict' + var IstexWidget = function() {}; IstexWidget.prototype = { injectHTML: function() { + addHtml("istex-widget-search", "http://caron.ads.intra.inist.fr:53390/html/part_search.html"); + addHtml("istex-widget-results", "http://caron.ads.intra.inist.fr:53390/html/part_results.html"); + //addHtml("istex-widget-facets", "http://caron.ads.intra.inist.fr:53390/html/part_facets.html"); - var searchWidget = document.getElementById("istex-widget-search"); - var request = new XMLHttpRequest(); - request.open("GET", "http://caron.ads.intra.inist.fr:53390/html/part_search.html"); - request.onload = function() { - searchWidget.innerHTML = request.responseText; - }; - request.send(); + }, + + injectAngularDirective: function(){ + document.body.setAttribute("ng-app","istex-widget"); + document.body.setAttribute("ng-controller","istexWidgetCtrl"); }, injectCSS: function() { + addCSS("//caron.ads.intra.inist.fr:53390/css/part_search.css"); + addCSS("//caron.ads.intra.inist.fr:53390/css/part_results.css"); + addCSS("//caron.ads.intra.inist.fr:53390/css/part_facets.css"); + addCSS("//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"); + }, - var header = document.head; - - var customCss = document.createElement("link"); - customCss.href = "http://caron.ads.intra.inist.fr:53390/css/part_search.css"; - customCss.rel = "stylesheet"; - customCss.type = "text/css"; - - header.appendChild(customCss); - - var bootstrapCss = document.createElement("link"); - bootstrapCss.href = "//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"; - bootstrapCss.rel = "stylesheet"; - bootstrapCss.type = "text/css"; - - header.appendChild(bootstrapCss); + injectJS: function() { + addJS([ + "//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js", + "//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js", + "//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js", + "//caron.ads.intra.inist.fr:53390/js/app.js" + ]); } +}; +var addJS = function(jsLinks) { + var body = document.body; + var js = document.createElement("script"); + js.src = jsLinks.shift(); + js.type = "text/javascript"; + if (jsLinks.length > 0) { + js.onload = function() { + addJS(jsLinks); + body.appendChild(js); + }; + }; + body.appendChild(js); +}; +var addCSS = function(cssLink) { + var header = document.head; + var customCss = document.createElement("link"); + customCss.href = cssLink; + customCss.rel = "stylesheet"; + customCss.type = "text/css"; + header.appendChild(customCss); +}; + +var addHtml = function(id, htmlLink) { + var searchWidget = document.getElementById(id); + var request = new XMLHttpRequest(); + request.open("GET", htmlLink); + request.onload = function() { + searchWidget.innerHTML = request.responseText; + }; + request.send(); }; var istexWidget = new IstexWidget(); istexWidget.injectHTML(); -istexWidget.injectCSS(); \ No newline at end of file +istexWidget.injectCSS(); +istexWidget.injectJS(); \ No newline at end of file diff --git a/server.js b/server.js index a6cdcab..ec84540 100644 --- a/server.js +++ b/server.js @@ -10,5 +10,4 @@ }); app.use(express.static(__dirname + '/public')); -app.listen(53390); - +app.listen(53390); \ No newline at end of file diff --git a/test/testpage.html b/test/testpage.html index 32eaf7a..dc31210 100644 --- a/test/testpage.html +++ b/test/testpage.html @@ -6,7 +6,7 @@ Test de la widget ISTEX - +