Merge branch 'wosch' of ssh://git.indexdata.com:222/home/git/private/mkws into wosch
authorWolfram Schneider <wosch@indexdata.dk>
Thu, 22 Aug 2013 11:53:29 +0000 (13:53 +0200)
committerWolfram Schneider <wosch@indexdata.dk>
Thu, 22 Aug 2013 11:53:29 +0000 (13:53 +0200)
examples/apache2/mkws-examples-mike [new file with mode: 0644]
examples/htdocs/index-jquery.html
examples/htdocs/index-mike.html
tools/apache2/mkws-live
tools/htdocs/Makefile
tools/htdocs/README.markdown
tools/htdocs/mkws.js

diff --git a/examples/apache2/mkws-examples-mike b/examples/apache2/mkws-examples-mike
new file mode 100644 (file)
index 0000000..47d2ef5
--- /dev/null
@@ -0,0 +1,18 @@
+<VirtualHost *:80>
+    ServerName x.example.indexdata.com
+    DocumentRoot /usr/local/src/git/mkws/examples/htdocs/
+    ErrorLog /var/log/apache2/mkws-examples-error.log
+    CustomLog /var/log/apache2/mkws-examples-access.log combined
+
+    ProxyPass        /service-proxy-auth-mike http://mkws.indexdata.com/service-proxy/?command=auth&action=login&username=demo&password=demo
+    ProxyPassReverse /service-proxy-auth-mike http://mkws.indexdata.com/service-proxy/?command=auth&action=login&username=demo&password=demo
+</VirtualHost>
+
+<VirtualHost *:80>
+    ServerName x.mkws.indexdata.com
+    DocumentRoot /usr/local/src/git/mkws/tools/htdocs/
+    ErrorLog /var/log/apache2/mkws-tools-error.log
+    CustomLog /var/log/apache2/mkws-tools-access.log combined
+
+    Alias /libjs-pz2/ /usr/local/src/git/libjs-pz2/
+</VirtualHost>
index 183d3da..0ca2c5b 100644 (file)
@@ -2,10 +2,20 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <title>MKWS demo: jQuery plugin</title>
+    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
     <link rel="stylesheet" type="text/css" href="http://mkws.indexdata.com/mkwsStyle.css" />
     <script type="text/javascript" src="http://mkws.indexdata.com/mkws-complete.js"></script>
+    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
   </head>
   <body>
-    <script type="text/javascript">jQuery.pazpar2()</script>
+    <script type="text/javascript">
+    jQuery.pazpar2({
+        "layout": "popup",               /* "table" [default], "div", "popup" */
+        "id_button": "input#mkwsButton", /* submit button id in search field */
+        "id_popup": "#mkwsPopup",        /* internal id of popup window */
+        "width": 880,                    /* popup width, should be at least 800 */ 
+        "height": 760                    /* popup height, should be at least 600 */
+    });
+    </script>
   </body>
 </html>
index 22b4624..0a8bb12 100644 (file)
@@ -2,20 +2,21 @@
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <title>MKWS demo: Mike's playground</title>
-    <link rel="stylesheet" type="text/css" href="../../tools/htdocs/mkwsStyle.css" />
+    <link rel="stylesheet" type="text/css" href="http://x.mkws.indexdata.com/mkwsStyle.css" />
     <script type="text/javascript">
       var mkws_config = {
        responsive_design: true,
        responsive_design_width: 600,
-       switch_menu: true
+       switch_menu: true,
+        service_proxy_auth: "/service-proxy-auth-mike"
       };
     </script>
     <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
-    <script type="text/javascript" src="http://mkws.indexdata.com/libjs-pz2/pz2api.1.js"></script>
-    <script type="text/javascript" src="../../tools/htdocs/mkws.js"></script>
+    <script type="text/javascript" src="http://x.mkws.indexdata.com/libjs-pz2/pz2api.1.js"></script>
+    <script type="text/javascript" src="http://x.mkws.indexdata.com/mkws.js"></script>
   </head>
   <body>
-    <div id="mkwsSwitch"></div><!-- ### does not work -->
+    <div id="mkwsSwitch"></div><!-- optional, must be enabled by switch_menu:true  -->
     <div id="mkwsLang"></div><!-- optional -->
     <div id="mkwsSearch"></div><!-- MANDATORY -->
     <div id="mkwsResults"></div><!-- MANDATORY but components may be used -->
index aac6d2a..64215c2 100644 (file)
@@ -14,6 +14,7 @@
     RewriteLogLevel 1
     RewriteLog /var/log/apache2/mkws-rewrite.log 
     RewriteRule /service-proxy-auth /service-proxy/?command=auth&action=login&username=demo&password=demo [P] # [NE,P]
+    RewriteRule /service-proxy/%3F /service-proxy/? [P] # [NE,P]
 
     Header set Access-Control-Allow-Credentials true
 
index b0cfa24..bf8af85 100644 (file)
@@ -45,7 +45,7 @@ pz2api-git-checkout:
 mkws-js ${MKWS_JS}: pz2api-check ${PZ2API_JS} mkws.js
        ( echo "/* created at: $$(date)"; \
          echo "   mkws.js GIT id: $$(git log mkws.js | head -n 1 | perl -npe 's,\S+\s+,,') */"; \
-         curl -sSf ${JQUERY_URL}; \
+         curl -sSf ${JQUERY_URL} | perl -npe 's,sourceMappingURL=jquery.*map,,'; \
          cat ../../../libjs-pz2/pz2api.1.js mkws.js ) > ${MKWS_JS}.new 
        mv -f ${MKWS_JS}.new ${MKWS_JS}
 
index 7ca160f..b6ce2d3 100644 (file)
@@ -134,6 +134,23 @@ New Features since jsdemo
 - The search page is fully configurable by a JSON object
 
 
+Checklist before doing a release
+---------------------------------
+- open the site, e.g. http://mkws-dev.indexdata.com/index-mike.html
+- open the debug/error console in your browser (alt-cmd-J, shift-cmd-J)
+- check the language links ("de", "da", "en")
+- run a search with few, but not to few results, e.g.: freebsd
+- check "Targets" | "Records" links
+- check "Next" and "Prev" links
+- click on the first hit and display details, click on an "URL" to jump to
+  the local catalog or full text
+- limit search to a "Source"
+- limit search to an "Author"
+- sort results by "Title" and "newest"
+- what else?
+
+
+
 What next?
 ----------
 
index 87decb6..d5eb267 100644 (file)
@@ -727,7 +727,10 @@ function mkws_service_proxy_auth(auth_url) {
 
     debug("Run service proxy auth URL: " + auth_url);
 
-    var request = new pzHttpRequest(auth_url);
+    var request = new pzHttpRequest(auth_url, function(err) {
+       alert("HTTP call for authentication failed: " + err)
+       return;
+    });
     request.get(null, function(data) {
        if (!$.isXMLDoc(data)) {
            alert("service proxy auth response document is not valid XML document, give up!");
@@ -842,6 +845,9 @@ $.extend({
 
     // service-proxy or pazpar2
     pazpar2: function(config) {
+       var id_popup = config.id_popup || "#mkwsPopup";
+       id_popup = id_popup.replace(/^#/, "");
+
        // simple layout
        var div = '<div id="mkwsSwitch"></div>\
        <div id="mkwsLang"></div>\
@@ -898,7 +904,7 @@ $.extend({
 
        var popup = '\
          <div id="mkwsSearch"></div>\
-         <div id="mkwsPopup">\
+         <div id="' + id_popup + '">\
            <div id="mkwsSwitch"></div>\
            <div id="mkwsLang"></div>\
            <div id="mkwsResults"></div>\
@@ -910,7 +916,7 @@ $.extend({
            this.debug2("jquery plugin layout: div");
            document.write(div);
        } else if (config && config.layout == 'popup') {
-           this.debug2("jquery plugin layout: popup");
+           this.debug2("jquery plugin layout: popup with id: " + id_popup);
            document.write(popup);
            $(document).ready( function() { init_popup(config); } );
        } else {
@@ -925,11 +931,18 @@ function init_popup(obj) {
 
     var height = config.height || 760;
     var width = config.width || 880;
-    var id_button = config.button || "input#mkwsButton";
-    var id_popup = config.popup || "#mkwsPopup";
+    var id_button = config.id_button || "input#mkwsButton";
+    var id_popup = config.id_popup || "#mkwsPopup";
 
     debug("popup height: " + height + ", width: " + width);
 
+    // make sure that jquery-ui was loaded afte jQuery core lib, e.g.:
+    // <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
+    if (!$.ui) {
+       debug("Error: jquery-ui.js is missing, did you included it after jquery core in the HTML file?");
+       return;
+    }
+
     $(id_popup).dialog({
       closeOnEscape: true,
       autoOpen: false,