1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <html>
- <head>
- <script src="../../../script/jquery.min.js"></script>
- <script src="../../../script/ao_module.js"></script>
- <title>NotepadA Test Window</title>
- <style>
- body{
- font-family: Arial !important;
- background-color:#ebebeb;
- }
- .menu{
- position:fixed;
- top:0;
- left:0;
- width:100%;
- height:18px;
- background-color:#3d3d3d;
- padding:5px;
- color:white;
- font-size:80%;
- }
- .urlinput{
- display:inline;
- }
- .toRight{
- position:absolute;
- right:15px;
- top:3px;
- }
- .previewArea{
- width:100%;
- position:fixed;
- top:27px;
- left:0px;
- }
- #previewWindow{
- position:absolute;
- left:0px;
- top:0px;
- }
- </style>
- </head>
- <body>
- <div id="toolbar" class="menu">
- Window Size: <div id="windowsize" style="display:inline;">loading...</div><button class="toRight" onClick="document.getElementById('previewWindow').contentWindow.location.reload();">Refresh</button>
- </div>
- <div class="previewArea">
- <iframe id="previewWindow" frameBorder="0" width="100%" src="nothing.html"></iframe>
- </div>
- </body>
- <script>
- var bottomPadding = 8; //In pixel
- adjustIframeSize();
- function adjustIframeSize(){
- var w = window.innerWidth;
- var h = window.innerHeight;
- $("#windowsize").html(w + "px x " + (h - parseInt($("#toolbar").height()) - bottomPadding) + "px");
- $("#previewWindow").attr("width",w + "px");
- $("#previewWindow").attr("height",(h - parseInt($("#toolbar").height()) - bottomPadding) + "px")
-
- }
-
- $( window ).resize(function() {
- adjustIframeSize();
- });
- //Check if anyfile are passed in
- var inputFile = ao_module_loadInputFiles();
- if (inputFile != null){
- inputFile = inputFile[0];
- //Contains input file. Check if it can be opened (.html / .htm)
- var ext = inputFile.filename.split(".");
- ext = ext.pop();
- if (ext == "html" || ext == "htm"){
- //Open it
- $("#previewWindow").attr('src', "../../../media?file=" + inputFile.filepath)
- }else{
- $("#previewWindow").attr('src', "./notviewable.html");
- }
- }
- </script>
- </html>
|