Author: yradtsevich
Date: 2011-09-23 09:26:18 -0400 (Fri, 23 Sep 2011)
New Revision: 34997
Added:
workspace/yradtsevich/browsersim/browsersim-frame.html
Log:
https://issues.jboss.org/browse/JBIDE-9539
Added: workspace/yradtsevich/browsersim/browsersim-frame.html
===================================================================
--- workspace/yradtsevich/browsersim/browsersim-frame.html (rev
0)
+++ workspace/yradtsevich/browsersim/browsersim-frame.html 2011-09-23 13:26:18 UTC (rev
34997)
@@ -0,0 +1,87 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js&quo...
+ <script
src="http://swip.codylindley.com/jquery.popupWindow.js"><...
+ <script>
+ $(function(){
+ $('#height').val(800);
+ $('#width').val(480);
+ $('.size-field').blur(function(){
+ update_size();
+ });
+ update_size();
+
+ $('#user-agent').val('Mozilla/5.0 (Linux; U; Android 2.1-update1; en-us;)
AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17');
+
+ $('#url').val('http://www.yahoo.com');
+ $('#iframe-browse').click(function() {
+ go_to_url_iframe();
+ });
+ $('#new-window-browse').click(function() {
+ go_to_url_new_window();
+ });
+ });
+
+ function update_size() {
+ var width = $('#width').val();
+ var height = $('#height').val();
+ if (96 <= height && height <= 2048 &&
+ 96 <= width && width <= 2048) {
+ $('#sim-frame').width(width);
+ $('#sim-frame').height(height);
+ }
+ }
+
+ function go_to_url_iframe() {
+ $('#sim-frame').attr('src', $('#url').val());
+ }
+
+ function go_to_url_new_window() {
+ var width = $('#width').val();
+ var height = $('#height').val();
+ if (96 <= height && height <= 2048 &&
+ 96 <= width && width <= 2048) {
+ window.open($('#url').val(), '', 'width=' + width
+',height=' + height);
+ }
+ }
+ </script>
+</head>
+<body>
+ NOTE: To change the user-agent header, you need to run Chrome/Chromium with the
following parameters:
+ <pre>chrome.exe --user-agent="Mozilla/5.0 (Linux; U; Android 2.1-update1;
en-us;) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile
Safari/530.17"</pre>
+ <table>
+ <tr>
+ <td>Height:</td>
+ <td><input id="height" class="size-field"
type="text"/></td>
+ <td>Must be between 96 and 2048. Would be selectable.</td>
+ </tr>
+ <tr>
+ <td>Width:</td>
+ <td><input id="width" class="size-field"
type="text"/></td>
+ <td>Must be between 96 and 2048. Would be selectable.</td>
+ </tr>
+ <tr>
+ <td>User-Agent:</td>
+ <td><input id="user-agent" type="text"/></td>
+ <td>Does not affect anything yet (see the note above). Would be
selectable.</td>
+ </tr>
+ <tr>
+ <td>URL:</td>
+ <td><input id="url" type="text"/></td>
+ <td>
+ <input id="iframe-browse" type="button" value="Browse in
iframe">
+ <input id="new-window-browse" type="button" value="Browse
in new window">
+ </td>
+
+ </tr>
+ </table>
+ <div style="text-align:center">
+ <div>
+ <input type="button" onclick="parent.simFrame.history.back();"
value="<">
+ <input type="button"
onclick="parent.simFrame.history.forward();" value=">">
+ </div>
+ <iframe name="simFrame" id="sim-frame"></iframe>
+ </div>
+</body>
+</html>
\ No newline at end of file