Merge pull request #275 from 0ip/patch-5

Mobile Patch [New]
This commit is contained in:
John McLear 2011-12-06 12:10:59 -08:00
commit a444f11900
4 changed files with 147 additions and 32 deletions

View file

@ -472,12 +472,10 @@ table#otheruserstable { display: none; }
background: url(../../static/img/connectingbar.gif) no-repeat center 60px; background: url(../../static/img/connectingbar.gif) no-repeat center 60px;
height: 100px; height: 100px;
} }
.modaldialog.cboxreconnecting { .modaldialog.cboxreconnecting,
background: #fed;
}
.modaldialog.cboxconnecting, .modaldialog.cboxconnecting,
.modaldialog.cboxdisconnected { .modaldialog.cboxdisconnected {
background: #fdd; background: #8FCDE0;
} }
.cboxdisconnected #connectionboxinner div { display: none; } .cboxdisconnected #connectionboxinner div { display: none; }
.cboxdisconnected_userdup #connectionboxinner #disconnected_userdup { display: block; } .cboxdisconnected_userdup #connectionboxinner #disconnected_userdup { display: block; }
@ -1150,11 +1148,6 @@ label[for=readonlyinput] {
margin: 0 10px 0 2px; margin: 0 10px 0 2px;
} }
@media screen and (max-width: 600px) {
#editbar ul li {
padding: 4px 1px;
}
}
#qr_center { #qr_center {
margin: 10px 10px auto 0; margin: 10px 10px auto 0;
@ -1164,3 +1157,93 @@ label[for=readonlyinput] {
#qrcode{ #qrcode{
margin-left:10px; margin-left:10px;
} }
@media screen and (max-width: 960px) {
.modaldialog {
position: relative;
margin: 0 auto;
width: 80%;
top: 40px;
left: 0;
}
}
@media screen and (max-width: 600px) {
#editbar ul li {
padding: 4px 1px;
}
}
@media only screen and (min-device-width: 320px) and (max-device-width: 600px) {
#editbar ul li {
padding: 4px 3px;
}
#editbar ul#menu_right > li {
padding: 4px 8px;
margin-top: 2px;
}
#chaticon {
opacity: .8;
}
#users {
right: none;
left: 30px;
}
#mycolorpicker {
right: 0;
left: 0 !important;
}
#editorcontainer {
margin-bottom: 33px;
}
#editbar ul#menu_right {
background: #f7f7f7;
background: -moz-linear-gradient(#f7f7f7, #f1f1f1 80%);
background: -ms-linear-gradient(#f7f7f7, #f1f1f1 80%);
background: -o-linear-gradient(#f7f7f7, #f1f1f1 80%);
background: -webkit-linear-gradient(#f7f7f7, #f1f1f1 80%);
width: 100%;
overflow: hidden;
height: 32px;
position: fixed;
bottom: 0;
border-top: 1px solid #ccc;
}
#editbar ul#menu_right li:not(:last-child) {
display: none;
}
#editbar ul#menu_right li:last-child {
height: 24px;
border-radius: 0;
margin-top: 0;
border: 0;
float: right;
}
#chaticon {
bottom: 0;
right: 55px;
border-right: none;
border-radius: 0;
background: #f7f7f7;
background: -moz-linear-gradient(#f7f7f7, #f1f1f1 80%);
background: -ms-linear-gradient(#f7f7f7, #f1f1f1 80%);
background: -o-linear-gradient(#f7f7f7, #f1f1f1 80%);
background: -webkit-linear-gradient(#f7f7f7, #f1f1f1 80%);
border: 0;
}
#chatbox {
bottom: 32px;
right: 0;
border-top-right-radius: 0;
}
#editbar ul li a span {
top: -3px;
}
#usericonback {
margin-top: 4px;
}
#sidediv {
display:none;
}
}

View file

@ -1,6 +1,8 @@
<!doctype html> <!doctype html>
<html> <html>
<title>Etherpad Lite</title> <title>Etherpad Lite</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<style> <style>
*{ margin:0;padding:0; } *{ margin:0;padding:0; }
body { body {
@ -13,13 +15,12 @@
background: -ms-radial-gradient(circle,#aaa,#eee 60%) center fixed; background: -ms-radial-gradient(circle,#aaa,#eee 60%) center fixed;
background: -o-radial-gradient(circle,#aaa,#eee 60%) center fixed; background: -o-radial-gradient(circle,#aaa,#eee 60%) center fixed;
overflow-x: hidden; overflow-x: hidden;
border-top: 8px solid rgba(51,51,51,.8) border-top: 8px solid rgba(51,51,51,.8);
} }
#container { #container {
text-shadow: 0 1px 1px #fff; text-shadow: 0 1px 1px #fff;
border-top: 1px solid #999; border-top: 1px solid #999;
margin-top: 160px; margin-top: 160px;
width: 100%;
text-align: center; text-align: center;
padding: 15px; padding: 15px;
background: #eee; background: #eee;
@ -28,7 +29,7 @@
background: -ms-linear-gradient(#fff,#ccc); background: -ms-linear-gradient(#fff,#ccc);
background: -o-linear-gradient(#fff,#ccc); background: -o-linear-gradient(#fff,#ccc);
opacity: .9; opacity: .9;
box-shadow: 0px 1px 8px rgba(0,0,0,0.3) box-shadow: 0px 1px 8px rgba(0,0,0,0.3);
} }
#button { #button {
margin: 0 auto; margin: 0 auto;
@ -45,7 +46,7 @@
background: -moz-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737); background: -moz-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737);
background: -ms-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737); background: -ms-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737);
background: -o-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737); background: -o-linear-gradient(#5F5F5F,#565656 50%,#4C4C4C 51%,#373737);
box-shadow: inset 0 1px 3px rgba(0,0,0,0.9) box-shadow: inset 0 1px 3px rgba(0,0,0,0.9);
} }
#button:hover { #button:hover {
cursor: pointer; cursor: pointer;
@ -53,21 +54,21 @@
background: -webkit-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747); background: -webkit-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
background: -moz-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747); background: -moz-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
background: -ms-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747); background: -ms-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
background: -o-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747) background: -o-linear-gradient(#707070,#666666 50%,#5B5B5B 51%,#474747);
} }
#button:active { #button:active {
box-shadow: inset 0 1px 12px rgba(0,0,0,0.9); box-shadow: inset 0 1px 12px rgba(0,0,0,0.9);
background: #444 background: #444;
} }
#label { #label {
text-align: left; text-align: left;
margin: 0 auto; margin: 0 auto;
width: 300px width: 300px;
} }
input { input {
vertical-align: middle; vertical-align: middle;
font-weight: bold; font-weight: bold;
font-size: 15px font-size: 15px;
} }
input[type="text"] { input[type="text"] {
width: 243px; width: 243px;
@ -76,23 +77,43 @@
border: 1px solid #bbb; border: 1px solid #bbb;
outline: none; outline: none;
border-radius: 3px; border-radius: 3px;
text-shadow: 0 0 1px #fff text-shadow: 0 0 1px #fff;
} }
input[type="submit"] { input[type="submit"] {
width: 45px; width: 45px;
margin-left: -50px; margin-left: -50px;
padding: 8px padding: 8px;
} }
input[type="submit"]::-moz-focus-inner { border: 0 } input[type="submit"]::-moz-focus-inner { border: 0 }
@-moz-document url-prefix() { input[type="submit"] { padding: 7px } } @-moz-document url-prefix() { input[type="submit"] { padding: 7px } }
@media only screen and (min-device-width: 320px) and (max-device-width: 600px) {
body {
background: #bbb;
background: -webkit-linear-gradient(#aaa,#eee 60%) center fixed;
height: 100%;
}
#container {
margin-top: 0;
text-align: left;
}
#button, #label {
text-align: center;
width: 95%;
}
form {
text-align: center;
}
input[type=text] {
width: 75%;
}
}
</style> </style>
<body onload="document.mainform.padname.focus();">
<link href="static/custom/index.css" rel="stylesheet"> <link href="static/custom/index.css" rel="stylesheet">
<script src="static/custom/index.js"></script> <script src="static/custom/index.js"></script>
<div id="container"> <div id="container">
<div id="button" onclick="go2Random()">New Pad</div><br><div id="label">or create/open a Pad with the name</div> <div id="button" onclick="go2Random()" class="translate">New Pad</div><br><div id="label" class="translate">or create/open a Pad with the name</div>
<form action="#" name="mainform" onsubmit="go2Name();return false;"> <form action="#" onsubmit="go2Name();return false;">
<input type="text" name="padname" id="padname" autofocus> <input type="text" id="padname" autofocus>
<input type="submit" value="OK"> <input type="submit" value="OK">
</form> </form>
</div> </div>
@ -124,5 +145,4 @@
//start the costum js //start the costum js
if(typeof costumStart == "function") costumStart(); if(typeof costumStart == "function") costumStart();
</script> </script>
</body>
</html> </html>

View file

@ -16,6 +16,10 @@
var chat = (function() var chat = (function()
{ {
var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1;
var isMobileSafari = ua.indexOf("mobile") > -1;
var bottomMargin = "0px";
var chatMentions = 0; var chatMentions = 0;
var title = document.title; var title = document.title;
var self = { var self = {
@ -41,7 +45,10 @@ var chat = (function()
{ {
$("#focusprotector").hide(); $("#focusprotector").hide();
$("#chatbox").css({right: "20px", bottom: "0px", left: "", top: ""}); if(isAndroid || isMobileSafari)
bottommargin = "32px";
$("#chatbox").css({right: "20px", bottom: bottomMargin, left: "", top: ""});
self.scrollDown(); self.scrollDown();
} }
@ -53,10 +60,14 @@ var chat = (function()
hide: function () hide: function ()
{ {
$("#chatcounter").text("0"); $("#chatcounter").text("0");
$("#chatbox").hide("slide", { direction: "down" }, 750, function() if(isAndroid || isMobileSafari) {
$("#chatbox").toggle();
}
else
{ {
$("#chaticon").show("slide", { direction: "down" }, 500); $("#chatbox").toggle("slide", { direction: "down" }, 625);
}); }
}, },
scrollDown: function() scrollDown: function()
{ {

View file

@ -4,6 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="robots" content="noindex, nofollow"> <meta name="robots" content="noindex, nofollow">
<title>Etherpad Lite</title> <title>Etherpad Lite</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<!-- CSS --> <!-- CSS -->
<link href="../static/css/pad.css" rel="stylesheet"> <link href="../static/css/pad.css" rel="stylesheet">
<!-- javascript --> <!-- javascript -->
@ -57,7 +58,7 @@
<li onClick="window.pad&&pad.editbarClick('outdent');return false;" > <li onClick="window.pad&&pad.editbarClick('outdent');return false;" >
<a title="Unindent"> <a title="Unindent">
<div class="buttonicon" style="background-position:0px -134px"></div> <div class="buttonicon" style="background-position:0px -134px"></div>
</a> </a>
</li> </li>
<li class="separator"></li> <li class="separator"></li>
<li onClick="window.pad&&pad.editbarClick('undo');return false;" > <li onClick="window.pad&&pad.editbarClick('undo');return false;" >