]> dev.renevier.net Git - syj.git/commitdiff
better print support
authorarno <arno@renevier.net>
Thu, 24 Mar 2011 14:10:44 +0000 (15:10 +0100)
committerarno <arno@renevier.net>
Thu, 24 Mar 2011 14:34:16 +0000 (15:34 +0100)
application/controllers/IdxController.php
public/css/syj.css
public/css/syjprint.css [new file with mode: 0644]
public/js/syj.js
public/js/syjraw.js

index 2c0e4d702f1e97d9879b04ab591b5a306629822a..d24b71ca82a79e38d301c085b3fbc63c40f189c0 100644 (file)
@@ -7,17 +7,19 @@ class IdxController extends Zend_Controller_Action
 
     public function init() {
         $this->_helper->SyjMedias->addScripts('idx');
-        $this->view->headLink()->appendStylesheet('css/olstyle.css', "all");
-        $this->view->headLink()->appendStylesheet('css/generic.css', "all");
-        $this->view->headLink()->appendStylesheet('css/syj.css', "all");
+        $this->view->headLink()->appendStylesheet('css/olstyle.css', "screen");
+        $this->view->headLink()->appendStylesheet('css/generic.css', "screen");
+        $this->view->headLink()->appendStylesheet('css/syj.css', "screen");
+        $this->view->headLink()->appendStylesheet('css/syjprint.css', "print");
     }
 
     public function rawmode(Syj_Model_Path $path) {
         $this->_helper->SyjReset->resetPlaceHolders();
         $this->_helper->SyjMedias->addScripts('rawidx');
 
-        $this->view->headLink()->appendStylesheet('css/generic.css', 'all');
-        $this->view->headLink()->appendStylesheet('css/syjraw.css', 'all');
+        $this->view->headLink()->appendStylesheet('css/generic.css', "screen");
+        $this->view->headLink()->appendStylesheet('css/syjraw.css', "screen");
+        $this->view->headLink()->appendStylesheet('css/syjprint.css', "print");
         $this->view->headTitle($path->displayTitle);
 
         $this->_jsRawLocaleStrings();
index ffa450ab4d2bf3968d8627f59d73bc8b4d3ea50b..d6ce283c0a4f76b380b6eb82b72586f41f598425 100644 (file)
@@ -262,7 +262,7 @@ body, html {
       size: landscape;
     }
 
-    #message, #data_controls, #login_controls, #user_area, #login_area, #newpwd_area, .olControlPanZoom{
+    #message, #menu, #user_area, #login_area, #newpwd_area, .olControlPanZoom{
         display: none;
     }
 }
diff --git a/public/css/syjprint.css b/public/css/syjprint.css
new file mode 100644 (file)
index 0000000..5a1c664
--- /dev/null
@@ -0,0 +1,47 @@
+/*  This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
+    and is published under the AGPL license. */
+
+.olControlPanZoom, .olControlAttribution {
+    display: none;
+}
+#message, #other-language, #menu, #user_area, #login_area, #newpwd_area, #termsofusearea, #footer, #map-overlay {
+    display: none;
+}
+
+div.olMap {
+    z-index: 0;
+}
+
+body, html {
+    width: 100%;
+    height: 100%;
+}
+
+#map {
+    position: absolute;
+    top: 0; left: 0; right: 0; bottom: 0;
+    width: 100%;
+    height: 100%;
+    border: 1px solid;
+}
+
+#path-length {
+    display: none;
+    text-align: center;
+    position: absolute;
+    top: 1em;
+    left: 5em;
+    opacity: 0.85;
+    margin-right: 12px;
+    filter:alpha(opacity=85);
+    background-color: white;
+    padding: 2px 15px 2px 15px;
+    -moz-border-radius: 5px;
+    -webkit-border-radius: 5px;
+    border-radius: 5px;
+    background-color: white;
+}
+
+@page {
+  size: landscape;
+}
index a297706556f1b0f0c406de57e3d208724e2c5ea8..a72dbb71ff6a99d114bf93c1985f1da665cc59f3 100644 (file)
@@ -441,6 +441,13 @@ var SYJView = {
         } else {
             this.map.setCenter(center, zoom);
         }
+        this.resizeMap();
+    },
+
+    resizeMap: function() {
+        var map = $('map');
+        map.style.width = map.offsetWidth.toString() + 'px';
+        map.style.height = map.offsetHeight.toString() + 'px';
     },
 
     observer: function(evt) {
@@ -1272,3 +1279,7 @@ window.onbeforeunload = function() {
         return undefined;
     }
 };
+
+window.onresize = function() {
+    SYJView.resizeMap();
+};
index ec783f4d677685ddf82e1d4cb5fc5d267940e5eb..cf6be9c37eb8e964d3ea010be1581735d046a28c 100644 (file)
@@ -11,6 +11,12 @@ var styleMap = {
     })
 };
 
+function resizeMap() {
+    var map = document.getElementById('map');
+    map.style.width = map.offsetWidth.toString() + 'px';
+    map.style.height = map.offsetHeight.toString() + 'px';
+}
+
 function init() {
     var map = new OpenLayers.Map('map', {
                 controls: [ new OpenLayers.Control.Attribution() ],
@@ -31,9 +37,13 @@ function init() {
     extent = viewLayer.getDataExtent();
     map.updateSize();
     map.zoomToExtent(extent);
-
+    resizeMap();
 }
 
+window.onresize = function() {
+    resizeMap();
+};
+
 if (window.addEventListener) {
     window.addEventListener("load", init, false);
 } else {