Commit 01a9eee9 authored by Joel Martin's avatar Joel Martin

HTML, CSS and Javascript indent/formatting.

- 4 space indenting for HTML and Javascript.
- 2 space indenting for CSS
- Use hanging start curly for conditional blocks
parent 0911173a
......@@ -125,7 +125,7 @@ html {
.noVNC_status_error {
background: #f44;
}
.norVNC_status_warn {
.noVNC_status_warn {
background: #ff4;
}
......
......@@ -73,9 +73,9 @@ load: function() {
//iOS Safari does not support CSS position:fixed.
//This detects iOS devices and enables javascript workaround.
if((navigator.userAgent.match(/iPhone/i))
||(navigator.userAgent.match(/iPod/i))
|| (navigator.userAgent.match(/iPad/i))) {
if ((navigator.userAgent.match(/iPhone/i)) ||
(navigator.userAgent.match(/iPod/i)) ||
(navigator.userAgent.match(/iPad/i))) {
UI.setOnscroll();
UI.setResize();
}
......@@ -106,11 +106,7 @@ updateSetting: function(name, value) {
if (typeof value !== 'undefined') {
WebUtil.createCookie(name, value);
}
if(name === 'host')
{
}
// Update the settings control
value = UI.getSetting(name);
......@@ -127,8 +123,7 @@ updateSetting: function(name, value) {
} else {
/*Weird IE9 error leads to 'null' appearring
in textboxes instead of ''.*/
if(value === null)
{
if (value === null) {
value = "";
}
ctrl.value = value;
......@@ -193,12 +188,11 @@ clickSettingsMenu: function() {
// Open menu
openSettingsMenu: function() {
if(UI.clipboardOpen == true)
{
if (UI.clipboardOpen == true) {
UI.showClipboard();
}
//Close connection settings if open
if(UI.connSettingsOpen == true) {
if (UI.connSettingsOpen == true) {
UI.connectPanelbutton();
}
$D('noVNC_Settings').style.display = "block";
......@@ -417,16 +411,16 @@ clipSend: function() {
showClipboard: function() {
//Close settings if open
if(UI.settingsOpen == true) {
if (UI.settingsOpen == true) {
UI.closeSettingsMenu();
}
//Close connection settings if open
if(UI.connSettingsOpen == true) {
if (UI.connSettingsOpen == true) {
UI.connectPanelbutton();
}
//Toggle Connection Panel
if(UI.clipboardOpen == true)
{ $D('noVNC_clipboard').style.display = "none";
if (UI.clipboardOpen == true) {
$D('noVNC_clipboard').style.display = "none";
UI.clipboardOpen = false;
} else {
$D('noVNC_clipboard').style.display = "block";
......@@ -468,14 +462,14 @@ changeViewportMeta: function (newattributes) {
// Update only the Viewport meta tag
for (var cnt = 0; cnt < metatags.length; cnt++)
{
var name = metatags[cnt].getAttribute("name");
var content = metatags[cnt].getAttribute("content");
// Update the Viewport meta tag
if (metatags[cnt].getAttribute("name") == "viewport")
if (metatags[cnt].getAttribute("name") == "viewport") {
metatags[cnt].setAttribute("content", newattributes);
}
}
},
//iOS < Version 5 does not support position fixed. Javascript workaround:
......@@ -511,17 +505,15 @@ setBarPosition: function() {
connectPanelbutton: function() {
//Close connection settings if open
if(UI.settingsOpen == true) {
if (UI.settingsOpen == true) {
UI.closeSettingsMenu();
}
if(UI.clipboardOpen == true)
{
if (UI.clipboardOpen == true) {
UI.showClipboard();
}
//Toggle Connection Panel
if(UI.connSettingsOpen == true)
{
if (UI.connSettingsOpen == true) {
$D('noVNC_controls').style.display = "none";
UI.connSettingsOpen = false;
} else {
......
......@@ -7,18 +7,19 @@
Copyright (C) 2011 Joel Martin
Licensed under LGPL-3 (see LICENSE.txt)
-->
<title>noVNC</title>
<meta charset="utf-8">
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
Remove this if you use the .htaccess -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>noVNC</title>
<meta name="viewport" content="user-scalable=1" />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<!--
<meta name="viewport" content="width=device-width,height=device-height" />
-->
<!-- Stylesheets -->
<link rel="stylesheet" href="include/base.css" />
......@@ -27,6 +28,12 @@
<!-- Google web fonts -->
<link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz|Nova+Square|Orbitron:400,500,700,900|Nova+Round|Nova+Mono|Nova+Slim|Nova+Oval|Nova+Flat|Nova+Cut' rel='stylesheet' type='text/css'>
<!-- App Start Icon -->
<link rel="apple-touch-startup-image" href="images/screen_640x435.png" />
<!-- For iOS devices set the icon to use if user bookmarks app on their homescreen -->
<link rel="apple-touch-icon" href="images/mobileicon.png">
<link rel="apple-touch-icon-precomposed" href="images/mobileicon.png" />
<!--
<script type='text/javascript'
......@@ -36,18 +43,6 @@
<script src="include/vnc.js"></script>
<script src="include/ui.js"></script>
<meta name="apple-mobile-web-app-capable" content="yes" />
<!--
<meta name="viewport" content="width=device-width,height=device-height" />
-->
<!-- App Start Icon -->
<link rel="apple-touch-startup-image" href="images/screen_640x435.png" />
<!-- For iOS devices set the icon to use if user bookmarks app on their homescreen -->
<link rel="apple-touch-icon" href="images/mobileicon.png">
<link rel="apple-touch-icon-precomposed" href="images/mobileicon.png" />
</head>
<body>
......@@ -56,33 +51,52 @@
<div id="noVNC_mobile_buttons">
<nobr>
<span class="noVNC_mouse_buttons">
<input type="button" class="noVNC_status_button" id="noVNC_mouse_button1" value="L" onclick="UI.setMouseButton(1);">
<input type="button" class="noVNC_status_button" id="noVNC_mouse_button2" value="M" onclick="UI.setMouseButton(2);">
<input type="button" class="noVNC_status_button" id="noVNC_mouse_button4" value="R" onclick="UI.setMouseButton(4);">
<input type="button" id="showKeyboard" onclick="UI.showKeyboard()" value="Keyboard" class="noVNC_status_button"/>
<input type="button" class="noVNC_status_button"
id="noVNC_mouse_button1" value="L"
onclick="UI.setMouseButton(1);">
<input type="button" class="noVNC_status_button"
id="noVNC_mouse_button2" value="M"
onclick="UI.setMouseButton(2);">
<input type="button" class="noVNC_status_button"
id="noVNC_mouse_button4" value="R"
onclick="UI.setMouseButton(4);">
<input type="button" id="showKeyboard"
value="Keyboard" class="noVNC_status_button"
onclick="UI.showKeyboard()"/>
</span>
</nobr>
</div>
<!--noVNC Buttons-->
<div class="noVNC_mobile_buttons_right">
<input type="button" class="noVNC_status_button" style="float:left;" value="CtrlAltDel" id="sendCtrlAltDelButton" onclick="UI.sendCtrlAltDel();">
<input type="button" id="clipboardbutton" onclick="UI.showClipboard();" value="Clipboard" />
<input type="button" class="VNC_status_button" value="Settings" id="menuButton" onclick="UI.clickSettingsMenu();">
<input type="button" id="connectPanelbutton" class="VNC_status_button" style="width:100px;" onclick="UI.connectPanelbutton()" value="Connection" />
<input type="button" class="noVNC_status_button"
style="float:left;" value="CtrlAltDel" id="sendCtrlAltDelButton"
onclick="UI.sendCtrlAltDel();">
<input type="button" id="clipboardbutton" value="Clipboard"
onclick="UI.showClipboard();"/>
<input type="button" class="VNC_status_button"
value="Settings" id="menuButton"
onclick="UI.clickSettingsMenu();">
<input type="button" id="connectPanelbutton"
class="VNC_status_button" style="width:100px;"
onclick="UI.connectPanelbutton()" value="Connection" />
</div>
<!-- Clipboard Panel -->
<div id="noVNC_clipboard" class="triangle-right top">
<textarea id="noVNC_clipboard_text" cols=88 rows=5 onfocus="UI.displayBlur();" onblur="UI.displayFocus();" onchange="UI.clipSend();">
<textarea id="noVNC_clipboard_text" cols=88 rows=5
onfocus="UI.displayBlur();" onblur="UI.displayFocus();"
onchange="UI.clipSend();">
</textarea>
<br />
<input id="noVNC_clipboard_clear_button" type="button" value="Clear" onclick="UI.clipClear();">
<input id="noVNC_clipboard_clear_button" type="button"
value="Clear" onclick="UI.clipClear();">
</div>
<!-- Settings Panel -->
<div id="noVNC_Settings" class="triangle-right top">
<span id="noVNC_settings_menu" onmouseover="UI.displayBlur();" onmouseout="UI.displayFocus();">
<span id="noVNC_settings_menu" onmouseover="UI.displayBlur();"
onmouseout="UI.displayFocus();">
<ul>
<li><input id="noVNC_encrypt" type="checkbox"> Encrypt</li>
<li><input id="noVNC_true_color" type="checkbox" checked> True Color</li>
......@@ -103,7 +117,8 @@
</select></label>
</li>
<hr>
<li><input type="button" id="noVNC_apply" value="Apply" onclick="UI.settingsApply()"></li>
<li><input type="button" id="noVNC_apply" value="Apply"
onclick="UI.settingsApply()"></li>
</ul>
</span>
</div>
......@@ -118,7 +133,7 @@
</ul>
</div>
</div>
</div> <!-- End of noVNC-control-bar -->
<div id="noVNC_screen">
<div id="noVNC_status_bar" class="noVNC_status_bar" style="margin-top: 0px;">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment