Added examples of "IFrame Resizer"

master
Hauke D 7 years ago
parent 25a5ca99ad
commit 96a5016e22

@ -40,6 +40,7 @@ iframe.perleditor {
margin: 0.2em 0; margin: 0.2em 0;
} }
</style> </style>
<!--cacheable--><!-- Optional "IFrame Resizer": <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/3.6.2/iframeResizer.min.js" integrity="sha256-aYf0FZGWqOuKNPJ4HkmnMZeODgj3DVslnYf+8dCN9/k=" crossorigin="anonymous"></script-->
</head> </head>
<body> <body>
@ -95,7 +96,9 @@ tag, for example using the "Copy Frame URL" link shown in the editor.
Note that implementing an automatic resize of the IFrame to fit its Note that implementing an automatic resize of the IFrame to fit its
contents is nontrivial when sandboxing is enabled, which is why a contents is nontrivial when sandboxing is enabled, which is why a
fixed height is used below. fixed height is used below. However, see for example
http://davidjbradshaw.github.io/iframe-resizer/ - examples of how
to use this are included in the source files here.
--> -->
<iframe id="perl1" sandbox="allow-scripts" class="perleditor" style="height:20em;"></iframe> <iframe id="perl1" sandbox="allow-scripts" class="perleditor" style="height:20em;"></iframe>
@ -105,6 +108,8 @@ document.getElementById('perl1').src =
inputs: [ { fn:"in.txt", text:"Foo\nBar\nQuz" } ], inputs: [ { fn:"in.txt", text:"Foo\nBar\nQuz" } ],
cmdline: "perl -CSD -pe 's/[aeiou]/_/g' in.txt", cmdline: "perl -CSD -pe 's/[aeiou]/_/g' in.txt",
} )); } ));
// Example of how to use the Optional "IFrame Resizer":
//iFrameResize({checkOrigin:false}, document.getElementById('perl1'));
</script> </script>
<p>This example includes several files:</p> <p>This example includes several files:</p>

@ -29,6 +29,7 @@ If not, see http://perldoc.perl.org/index-licence.html
<!--cacheable--><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/codemirror.min.css" integrity="sha256-I8NyGs4wjbMuBSUE40o55W6k6P7tu/7G28/JGUUYCIs=" crossorigin="anonymous" /> <!--cacheable--><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/codemirror.min.css" integrity="sha256-I8NyGs4wjbMuBSUE40o55W6k6P7tu/7G28/JGUUYCIs=" crossorigin="anonymous" />
<link rel="stylesheet" href="perleditor.css" /> <link rel="stylesheet" href="perleditor.css" />
<!--cacheable--><!-- Optional "IFrame Resizer": <script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/3.6.2/iframeResizer.contentWindow.min.js" integrity="sha256-dEPtZVO6cj6PAmBeDzFskohUob+woyzF6TaNcYpAk84=" crossorigin="anonymous"></script-->
<!--cacheable--><script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/codemirror.min.js" integrity="sha256-uRIJ6Wfou5cTtmcCvQNA9lvsYl8sUbZXxnfG+P79ssY=" crossorigin="anonymous"></script> <!--cacheable--><script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/codemirror.min.js" integrity="sha256-uRIJ6Wfou5cTtmcCvQNA9lvsYl8sUbZXxnfG+P79ssY=" crossorigin="anonymous"></script>
<!--cacheable--><script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/mode/perl/perl.min.js" integrity="sha256-Uu9QBfi8gU6J/MzQunal8ewmY+i/BbCkBrcAXA5bcCM=" crossorigin="anonymous"></script> <!--cacheable--><script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2/mode/perl/perl.min.js" integrity="sha256-Uu9QBfi8gU6J/MzQunal8ewmY+i/BbCkBrcAXA5bcCM=" crossorigin="anonymous"></script>
<!--cacheable--><script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> <!--cacheable--><script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
@ -146,6 +147,7 @@ window.addEventListener('message', function (event) {
$('#runnererrors').show(); $('#runnererrors').show();
$('#runnererrors>pre').append(data.perlRunnerError+"\n"); $('#runnererrors>pre').append(data.perlRunnerError+"\n");
} }
else if (data.substring(0,13)=="[iFrameSizer]") {} // ignore quietly
else console.warn("Perl Editor ignoring unknown message:",data); else console.warn("Perl Editor ignoring unknown message:",data);
}); });

Loading…
Cancel
Save