widget fix
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 1 Sep 2010 09:11:22 +0000 (11:11 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 1 Sep 2010 09:22:10 +0000 (11:22 +0200)
wolnelektury/static/css/master.css
wolnelektury/static/js/catalogue.js
wolnelektury/static/js/widget.js
wolnelektury/static/js/widgetInit.js
wolnelektury/static/widget.html
wolnelektury/templates/catalogue/main_page.html

index cfa644f..80677d2 100644 (file)
@@ -948,3 +948,7 @@ div.shown-tags p, div.all-tags p {
 #createNewShelf {
 display: none;
 }
+
+.widget-code {
+    overflow: hidden;
+}
index 31bad6e..1d90e10 100644 (file)
@@ -462,5 +462,15 @@ function serverTime() {
             $(this).data('drag', false);
         });
 
+        $('.widget-code').focus(
+            function(){
+                $(this).animate({rows: '11'}, 100)
+            } 
+        ).blur(
+            function(){
+                $(this).animate({rows: '1'}, 300)
+            } 
+        );
+
     });
 })(jQuery)
index 8a82024..7012e64 100644 (file)
@@ -9,13 +9,15 @@ var inputSubmit = document.createElement('input');
 var body        = document.getElementsByTagName('body')
 var stylesheet = document.createElement('link');
 
+var host = 'www.wolnelektury.pl';
+
 /* set attributes of created elements */
 stylesheet.setAttribute('type', 'text/css');
 stylesheet.setAttribute('rel', 'stylesheet');
-stylesheet.setAttribute('href', 'http://lektury.staging.nowoczesnapolska.org.pl/static/css/widget.css');
-linkLogo.setAttribute('href', 'http://lektury.staging.nowoczesnapolska.org.pl');
-logo.setAttribute('src', 'http://lektury.staging.nowoczesnapolska.org.pl/static/img/logo.png');
-form.setAttribute('action', 'http://lektury.staging.nowoczesnapolska.org.pl/katalog/szukaj/');
+stylesheet.setAttribute('href', 'http://'+host+'/static/css/widget.css');
+linkLogo.setAttribute('href', 'http://'+host);
+logo.setAttribute('src', 'http://'+host+'/static/img/logo.png');
+form.setAttribute('action', 'http://'+host+'/katalog/szukaj/');
 form.setAttribute('method', 'get');
 form.setAttribute('accept-charset', 'utf-8');
 form.setAttribute('id', 'wl-form');
@@ -26,21 +28,21 @@ inputText.setAttribute('name', 'q');
 inputText.setAttribute('id', 'id_qq');
 inputText.setAttribute('size', '13');
 inputSubmit.setAttribute('type', 'image');
-inputSubmit.setAttribute('src', 'http://lektury.staging.nowoczesnapolska.org.pl/static/img/search.png');
+inputSubmit.setAttribute('src', 'http://'+host+'/static/img/search.png');
 inputSubmit.setAttribute('style', 'position:relative; top:5px; margin-left:5px');
 
 /* import jquery and autocomplete */
 var scriptJ = document.createElement('script');
 scriptJ.setAttribute('type', 'text/javascript');
-scriptJ.setAttribute('src', 'http://lektury.staging.nowoczesnapolska.org.pl/static/js/jquery.js');
+scriptJ.setAttribute('src', 'http://'+host+'/static/js/jquery.js');
 
 var scriptAutoComplete = document.createElement('script');
 scriptAutoComplete.setAttribute('type', 'text/javascript');
-scriptAutoComplete.setAttribute('src', 'http://lektury.staging.nowoczesnapolska.org.pl/static/js/jquery-ui-1.8.2.custom.min.js');
+scriptAutoComplete.setAttribute('src', 'http://'+host+'/static/js/jquery-ui-1.8.2.custom.min.js');
 
 var scriptInit = document.createElement('script');
 scriptInit.setAttribute('type', 'text/javascript');
-scriptInit.setAttribute('src', 'http://lektury.staging.nowoczesnapolska.org.pl/static/js/widgetInit.js');
+scriptInit.setAttribute('src', 'http://'+host+'/static/js/widgetInit.js');
 
 body[0].appendChild(scriptJ);
 body[0].appendChild(scriptAutoComplete);
index 0a6e405..ab57a30 100644 (file)
@@ -2,7 +2,7 @@
                $("#id_qq").autocomplete({
                        source: function(request, response) {
                                $.ajax({
-                                       url: "http://lektury.staging.nowoczesnapolska.org.pl/katalog/jtags/",
+                                       url: "http://www.wolnelektury.pl/katalog/jtags/",
                                        dataType: "jsonp",
                                        data: {
                                                featureClass: "P",
index 67e5009..890184d 100644 (file)
@@ -5,7 +5,7 @@
 <!-- KONIEC -->
 
 <!-- START Umiescic ten element zaraz przed zamknieciem taga body: </body> -->
-<script type="text/javascript" src="http://lektury.staging.nowoczesnapolska.org.pl/static/js/widget.js"></script>
+<script type="text/javascript" src="http://www.wolnelektury.pl/static/js/widget.js"></script>
 <!-- KONIEC -->
 
 </body>
index cef3604..b3ba6c5 100644 (file)
@@ -18,7 +18,7 @@
         <div id="propaganda">
             <h2>{% trans "Wolne Lektury Widget" %}</h2>
             <p>{% trans "Place our widget - search engine for Wolne Lektury which gives access to free books and audiobooks - on your homepage! Just copy the HTML code below onto your page:" %}</p>
-            <textarea rows="2" cols="35"><!-- START {% trans "Insert this element in place where you want display the widget" %} -->
+            <textarea rows="1" cols="35" class='widget-code'><!-- START {% trans "Insert this element in place where you want display the widget" %} -->
 <div id="wl" />
 <!-- END -->
 <!-- START {% trans "Place this element just before closing body tag: </body>" %} -->