Changeset 663


Ignore:
Timestamp:
11/05/12 18:26:34 (12 years ago)
Author:
vmipsl
Message:

print ok pour mozilla & chrome

Location:
ether_statistics/web
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • ether_statistics/web/project/statistics-script.jsp

    r661 r663  
    209209    { 
    210210        var printContent = new PrintContent(); 
     211        printContent.addContent( $( "#title" ).clone() ); 
     212        printContent.addContent( this.leftTopSlide.getDivContainer().clone().animate( {'marginLeft' : "+=80px"} ) ); 
     213        printContent.addContent( this.leftMiddleSlide.getDivContainer().clone().animate( {'marginLeft' : "+=80px"} ) ); 
     214        printContent.addContent( this.leftBottomSlide.getDivContainer().clone().animate( {'marginLeft' : "+=80px"} ) ); 
     215        printContent.addContent( this.middleSlide.getDivContainer().clone().animate( {'marginLeft' : "+=120px"} ) ); 
    211216        printContent.displayPrintPreview(); 
    212  
    213 //        $( "#containerMiddle" ).printPreview(); 
    214 //        $( 'a.print-preview' ).printPreview(); 
    215 //        $("#containerMiddle").jqprint(); 
    216  
    217 //        var printContent =$( "#containerMiddle" ); 
    218 //        var windowUrl = 'about:blank'; 
    219 //        var windowName = 'Print'; 
    220 //        var printWindow = window.open( windowUrl, windowName, 'left=50000,top=50000,width=0,height=0' ); 
    221 //        printWindow.document.write( "slkdfjlsdkfjsdlf" ); 
    222 //        printWindow.document.close(); 
    223 //        printWindow.focus(); 
    224 //        printWindow.print(); 
    225 //        printWindow.close(); 
    226 // 
    227         // TODO export PDF 
    228217    }, 
    229218 
  • ether_statistics/web/project/statistics.jsp

    r661 r663  
    1414 
    1515    <ether:htmlCss cssFile="button"/> 
    16     <%--<ether:htmlCss cssFile="jquery-ui-1.8.16.custom/jquery-ui-1.8.16.custom"/>--%> 
    1716    <%-- WIJMO --%> 
    1817    <ether:htmlCss cssFile="Wijmo/rocket/jquery-wijmo"/> 
     
    3736 
    3837    <ether:htmlJsp jspFile="statistics-script"/> 
    39  
    40     <%--<ether:htmlCss cssFile="etimbo-jquery-print-preview-plugin/960"/>--%> 
    41     <%--<ether:htmlCss cssFile="etimbo-jquery-print-preview-plugin/screen"/>--%> 
    42     <%--<ether:htmlCss cssFile="etimbo-jquery-print-preview-plugin/print"/>--%> 
    43     <%--<ether:htmlCss cssFile="etimbo-jquery-print-preview-plugin/print-preview"/>--%> 
    44     <%--<script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script>--%> 
    45     <%--<ether:htmlJs jsFile="etimbo-jquery-print-preview-plugin/src/jquery.print-preview"/>--%> 
    4638</HEAD> 
    4739 
  • ether_statistics/web/resources/css/printContent.css

    r662 r663  
    99    -moz-box-shadow: 0 0 20px #000; 
    1010    -webkit-box-shadow: 0 0 10px #000; 
     11    min-height: 700px; 
    1112} 
    1213 
     
    5960#printContent { 
    6061    margin-left: 10px; 
     62    min-height: 500px; 
    6163} 
  • ether_statistics/web/resources/js/classesForJQuery/DragSlide.js

    r661 r663  
    8383    }, 
    8484 
     85    getDivContainer: function() 
     86    { 
     87        return this.divContainer; 
     88    }, 
     89 
    8590    isContentVisible: function() 
    8691    { 
  • ether_statistics/web/resources/js/classesForJQuery/PrintContent.js

    r662 r663  
    1515        this.divButtons = $( '<div id="printButtons"></div>' ); 
    1616        this.divContent = $( '<div id="printContent"></div>' ); 
    17  
    18 //        this.print_frame = $( '<iframe id="print-modal-content" scrolling="no" border="0" frameborder="0" name="print-frame" />' ); 
    19         this.divContent.append( $( "#title" ).clone() ); 
    20         this.divContent.append( $( "#leftTop" ).clone().animate( {'marginLeft' : "+=80px"} ) ); 
    21         this.divContent.append( $( "#leftMiddleSlide" ).clone().animate( {'marginLeft' : "+=80px"} ) ); 
    22         this.divContent.append( $( "#leftBottomSlide" ).clone().animate( {'marginLeft' : "+=80px"} ) ); 
    23         this.divContent.append( $( "#middle" ).clone().animate( {'marginLeft' : "+=120px"} ) ); 
    2417    }, 
    2518 
     
    2922        this.divWrapper.append( this.divButtons ); 
    3023        this.divWrapper.append( this.divContent ); 
    31 //        this.divWrapper.append( this.print_frame ); 
    3224        $( 'body' ).append( this.divWrapper ); 
    3325 
    34         // The frame lives 
    35 //        for( var i = 0; i < window.frames.length; i++ ) 
    36 //        { 
    37 //            if( window.frames[i].name == "print-frame" ) 
    38 //            { 
    39 //                this.print_frame_ref = window.frames[i].document; 
    40 //                break; 
    41 //            } 
    42 //        } 
    43  
    44 //        this.print_frame_ref.open(); 
    45 //        this.print_frame_ref.write( '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' + 
    46 //                '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">' + 
    47 //                '<head><title>zzzzzzzzzzz</title></head>' + 
    48 //                '<body></body>' + 
    49 //                '</html>' ); 
    50 //        this.print_frame_ref.close(); 
    51  
    52 //        if( !$.browser.msie && !($.browser.version < 7) ) 
    53 //        { 
    54 //            $( 'head', this.print_frame_ref ).append( "headhhhhh" ); 
    55 //            $( 'body', this.print_frame_ref ).append( this.content ); 
    56 //        } 
    57 //        else 
    58 //        { 
    59 //            $( 'body > *:not(#printWrapper):not(script)' ).clone().each( function() 
    60 //            { 
    61 //                $( 'body', this.print_frame_ref ).append( this.outerHTML ); 
    62 //            } ); 
    63 //            $( 'head link[media*=print], head link[media=all]' ).each( function() 
    64 //            { 
    65 //                $( 'head', this.print_frame_ref ).append( $( this ).clone().attr( 'media', 'all' )[0].outerHTML ); 
    66 //            } ); 
    67 //        } 
    68  
     26        // Display mask 
    6927        this.loadMask(); 
    70  
    71         // Disable scrolling 
    72 //        $( 'body' ).css( {overflowY: 'hidden', height: '100%'} ); 
    73 //        $( 'img', this.print_frame_ref ).load( function() 
    74 //        { 
    75 //            this.print_frame.height( $( 'body', this.print_frame.contents() )[0].scrollHeight ); 
    76 //        } ); 
    7728 
    7829        // Position modal 
     
    9142        }, this ) ); 
    9243 
    93 //        this.print_frame.height( $( 'body', this.print_frame.contents() )[0].scrollHeight ); 
    94 //        this.print_frame.height( $( 'body', this.print_frame.contents() )[0].scrollHeight ); 
    9544        this.createButtons(); 
    9645    }, 
     
    10352        this.printButton.bind( "click", jQuery.proxy( function() 
    10453        { 
    105 //            this.mask.animate( { opacity: 1}, 400, jQuery.proxy( function() 
    106 //            { 
    107             window.print(); 
    108 //            }, this ) ); 
    109  
    110 //            var thePopup = window.open( '', "Customer Listing", "menubar=0,location=0,height=700,width=700" ); 
    111 //            thePopup.document.body.innerHTML = this.content; 
    112 //            this.divWrapper.clone().appendTo( thePopup.document.body ); 
    113 //            thePopup.print(); 
    114 //            window.open() 
    115 //            window.document.body.innerHTML = "paf"; 
    116 //            document.location.href = ""; 
     54            this.mask.animate( { opacity: 1}, 400, jQuery.proxy( function() 
     55            { 
     56                window.print(); 
     57            }, this ) ); 
     58//            window.print(); 
    11759        }, this ) ); 
    11860        this.divButtons.append( this.printButton ); 
     
    12668        this.divButtons.append( this.closeButton ); 
    12769    }, 
    128  
    129 //    printdiv: function( printpage ) 
    130 //    { 
    131 //        var headstr = "<html><head><title></title></head><body>"; 
    132 //        var footstr = "</body>"; 
    133 //        var newstr = document.all.item( printpage ).innerHTML; 
    134 //        var newstr = "<div>qsdqmsdkqsmdkqsd</div>"; 
    135 //        var oldstr = document.body.innerHTML; 
    136 //        document.body.innerHTML = headstr + newstr + footstr; 
    137 //        window.print(); 
    138 //        document.body.innerHTML = oldstr; 
    139 //        return false; 
    140 //    }, 
    14170 
    14271    distroyPrintPreview: function() 
     
    189118        { 
    190119            if( e.keyCode == 27 ) 
    191             { 
    192120                this.distroyPrintPreview(); 
    193             } 
    194121        }, this ) ); 
    195122    }, 
     
    204131                window.innerWidth || // ie7+ 
    205132                        document.documentElement.clientWidth || // ie6 
    206                         document.body.clientWidth,                     // ie6 quirks mode 
     133                        document.body.clientWidth, // ie6 quirks mode 
    207134                d - w < 20 ? w : d 
    208135            ]; 
     
    216143        this.size = this.getMaskSize(); 
    217144        this.mask.css( {width: this.size[0], height: this.size[1]} ); 
     145    }, 
     146 
     147    setContent: function( content ) 
     148    { 
     149        this.divContent.append( content ); 
     150    }, 
     151 
     152    addContent: function( content ) 
     153    { 
     154        this.divContent.append( content ); 
    218155    } 
     156 
    219157} ); 
Note: See TracChangeset for help on using the changeset viewer.