From ca342b2c1da07e39edd1ed60281e76c7dda374ea Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Mon, 2 Jan 2012 16:04:15 +0100 Subject: [PATCH] added tablesupport, this code is from Gedion Wolde --- static/css/pad.css | 2492 +++++++++++++-------------- static/js/ace2_inner.js | 466 ++++- static/js/contentcollector.js | 17 +- static/js/domline.js | 71 +- static/js/domline_client.js | 82 +- static/js/linestylefilter.js | 3 +- static/js/linestylefilter_client.js | 3 +- static/js/pad2.js | 3 + static/js/pad_editbar.js | 14 +- static/js/pad_editor.js | 5 +- static/pad.html | 131 +- 11 files changed, 1980 insertions(+), 1307 deletions(-) diff --git a/static/css/pad.css b/static/css/pad.css index a1c48ce28c2..73e0aae1622 100644 --- a/static/css/pad.css +++ b/static/css/pad.css @@ -1,1255 +1,1237 @@ -*,html,body,p{ margin: 0; padding: 0; } -.clear { clear: both; } -html { font-size: 62.5%; } -body, textarea { font-family: Helvetica, Arial, sans-serif; } -iframe {position:absolute;} - -#users -{ - position: absolute; - z-index: 10; - background-color: #000; - background-color: rgba(0,0,0,0.7); - width: 160px; - right: 20px; - top: 40px; - color: #fff; - padding: 5px; - -moz-border-radius: 6px; - border-radius: 6px; -} - -a img -{ - border: 0; -} - -/* menu */ -#editbar ul -{ - position: relative; - list-style: none; - padding-right: 3px; - padding-left: 1px; - z-index: 2; - overflow: hidden; - -} - -#editbar -{ - 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-bottom: 1px solid #ccc; - height: 32px; - overflow: hidden; - padding-top: 3px; - width: 100%; -} - -#editbar ul li -{ - background: #fff; - background: -moz-linear-gradient(#fff, #f0f0f0); - background: -ms-linear-gradient(#fff, #f0f0f0); - background: -o-linear-gradient(#fff, #f0f0f0); - background: -webkit-linear-gradient(#fff, #f0f0f0); - border: 1px solid #ccc; - border-radius: 4px; - cursor: pointer; - float: left; - height: 18px; - margin-left: 2px; - overflow: hidden; - padding: 4px 5px; - width: 18px; -} - -#editbar ul li a -{ - text-decoration: none; - color: #ccc; -} - -#editbar ul li a span -{ - position: relative; - top:-2px -} - -#editbar ul li:hover { - background: #fff; -} - -#editbar ul li:active { - background: #eee; - background: -moz-linear-gradient(#ddd, #fff); - background: -ms-linear-gradient(#ddd, #fff); - background: -o-linear-gradient(#ddd, #fff); - background: -webkit-linear-gradient(#ddd, #fff); -} - -input[type="file"] { - color: #000; -} - -#editbar ul li.separator -{ - border: inherit; - background: inherit; - visibility:hidden; - width: 0px; -} -#editbar ul li a -{ - display: block; -} -#editbar ul li a img -{ - padding: 1px; -} - - -#editbar ul -{ - float: left; -} -#editbar ul#menu_right -{ - float: right; -} - -#users -{ - display: none; -} - -#editorcontainer -{ - position: absolute; - - width: 100%; - - top: 36px; - left: 0px; - bottom: 0px; - - z-index: 1; -} - -#editorcontainer iframe { - height: 100%; - width: 100%; - padding: 0; - margin: 0; -} - -#editorloadingbox { padding-top: 100px; padding-bottom: 100px; font-size: 2.5em; color: #aaa; - text-align: center; position: absolute; width: 100%; height: 30px; z-index: 100; } - -#editorcontainerbox{ - position:absolute; - bottom:0; - top:0; - width:100%; -} - - -#padpage { - position: absolute; - top: 0px; - bottom: 0px; - width: 100%; -} - -.maximized #padpage { - left: 8px; - right: 8px; - width: auto; - margin-left: 0; -} - -body.fullwidth #padpage { width: auto; margin-left: 6px; margin-right: 6px; } -body.squish1width #padpage { width: 800px; } -body.squish2width #padpage { width: 700px; } - -a#backtoprosite, #accountnav { - display: block; position: absolute; height: 15px; line-height: 15px; - width: auto; top: 5px; font-size: 1.2em; display:none; -} -a#backtoprosite, #accountnav a { color: #cde7ff; text-decoration: underline; } - -a#backtoprosite { padding-left: 20px; left: 6px; - background: url(static/img/protop.gif) no-repeat -5px -6px; } -#accountnav { right: 30px; color: #fff; } - -.propad a#topbaretherpad { background: url(static/img/protop.gif) no-repeat -397px -3px; } - -#specialkeyarea { top: 5px; left: 250px; color: yellow; font-weight: bold; - font-size: 1.5em; position: absolute; } - -#alertbar { - margin-top: 6px; - opacity: 0; - filter: alpha(opacity = 0); /* IE */ - display: none; - position:absolute; - left:0; - right:0; - z-index:53; -} - -#servermsg { position: relative; zoom: 1; border: 1px solid #992; - background: #ffc; padding: 0.8em; font-size: 1.2em; } -#servermsg h3 { font-weight: bold; margin-right: 10px; - margin-bottom: 1em; float: left; width: auto; } -#servermsg #servermsgdate { font-style: italic; font-weight: normal; color: #666; } -a#hidetopmsg { position: absolute; right: 5px; bottom: 5px; } - -#shuttingdown { position: relative; zoom: 1; border: 1px solid #992; - background: #ffc; padding: 0.6em; font-size: 1.2em; margin-top: 6px; } - -#docbar { margin-top: 6px; height: 25px; position: relative; zoom: 1; - background: #fbfbfb url(static/img/padtopback2.gif) repeat-x 0 -31px; } - -.docbarbutton -{ - padding-top: 2px; - padding-bottom: 2px; - padding-left: 4px; - padding-right: 4px; - border-left: 1px solid #CCC; - white-space: nowrap; -} - -.docbarbutton img -{ - border: 0px; - width: 13px; - margin-right: 2px; - vertical-align: middle; - margin-top: 3px; - margin-bottom: 2px; -} - -.menu, -.menu ul { - font-size: 10pt; - list-style-type: none; -} - -.menu ul { - padding-left: 20px; -} - -.menu a { - font-size: 10px; - line-height: 18px; - text-decoration: none; - color: #444; - font-weight: bold; -} - -.docbarbutton.highlight -{ - background-color: #fef2bd; - border: 1px solid #CCC; - border-right: 0px; -} - -#docbarleft { position: absolute; left: 0; top: 0; height: 100%; - overflow: hidden; - background: url(static/img/padtop5.gif) no-repeat left -31px; width: 7px; } - - - -#docbarpadtitle { position: absolute; height: auto; left: 9px; - width: 280px; font-size: 1.6em; color: #444; font-weight: normal; - line-height: 22px; margin-left: 2px; height: 22px; top: 2px; - overflow: hidden; text-overflow: ellipsis /*not supported in FF*/; - white-space:nowrap; } -.docbar-public #docbarpadtitle { padding-left: 22px; - background: url(static/img/public.gif) no-repeat left center; } - -#docbarrenamelink { position: absolute; top: 6px; - font-size: 1.1em; display: none; } -#docbarrenamelink a { color: #999; } -#docbarrenamelink a:hover { color: #48d; } -#padtitlebuttons { position: absolute; width: 74px; zoom: 1; - height: 17px; top: 4px; left: 170px; display: none; - background: url(static/img/ok_or_cancel.gif) 0px 0px; } -#padtitlesave { position: absolute; display: block; - height: 0; padding-top: 17px; overflow: hidden; - width: 23px; left: 0; top: 0; } -#padtitlecancel { position: absolute; display: block; - height: 0; padding-top: 17px; overflow: hidden; - width: 35px; right: 0; top: 0; } -#padtitleedit { position: absolute; top: 2px; left: 5px; - height: 15px; padding: 2px; font-size: 1.4em; - background: white; border-left: 1px solid #c3c3c3; - border-top: 1px solid #c3c3c3; - border-right: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6; - width: 150px; display: none; -} - -#padmain { - margin-top: 0px; - position: absolute; - top: 63px !important; - left: 0px; - right: 0px; - bottom: 0px; - zoom: 1; -} - -#padeditor { - bottom:0px; - left:0; - position:absolute; - right:0px; - top:0; - zoom: 1; -} -.hidesidebar #padeditor { right: 0; } - -#vdraggie { -/* background: url(static/img/vdraggie.gif) no-repeat top center;*/ - width:16px; - height:16px; - background-image:url('../../static/img/etherpad_lite_icons.png'); - background-repeat: no-repeat; - background-position: 0px -300px; - - cursor: W-resize; - bottom:0; - position:absolute; - right:268px; - top:0; - width:56px; - z-index: 10; -} - -#editbarsavetable -{ - position:absolute; - top: 6px; - right: 8px; - height: 24px; -} - -#editbarsavetable td, #editbartable td -{ - white-space: nowrap; -} - -#myswatchbox { - position: absolute; - left: 5px; - top: 5px; - width: 24px; - height: 24px; - border: 1px solid #000; - background: transparent; - cursor: pointer; -} - -#myswatch { width: 100%; height: 100%; background: transparent;/*...initially*/ } - -#mycolorpicker { - width: 232px; height: 265px; - position: absolute; - left: -250px; top: 0px; z-index: 101; - display: none; - border-radius: 5px; - background: rgba(0, 0, 0, 0.7); - padding-left:10px; - padding-top:10px; -} -/* -#mycolorpicker ul li -{ - float: left; -} -#mycolorpicker .picked { border: 1px solid #000 !important; } - -#mycolorpicker .picked .pickerswatch { border: 1px solid #fff; } -*/ -#mycolorpickersave { - left: 10px; - font-weight: bold; -} - -#mycolorpickercancel { - left: 85px; -} - -#mycolorpickersave, #mycolorpickercancel { - background: #fff; - background: -moz-linear-gradient(#fff, #ccc); - background: -ms-linear-gradient(#fff, #ccc); - background: -o-linear-gradient(#fff, #ccc); - background: -webkit-linear-gradient(#fff, #ccc); - border: 1px solid #ccc; - border-radius: 4px; - font-size:12px; - cursor: pointer; - color:#000; - overflow: hidden; - padding: 4px; - top: 240px; - text-align:center; - position: absolute; - width: 60px; -} - -#mycolorpickerpreview { - position: absolute; - left: 207px; - top: 240px; - width:16px; - height:16px; - padding:4px; - overflow: hidden; - color: #fff; - border-radius:5px; -} - - -#myusernameform { margin-left: 35px; } -#myusernameedit { font-size: 1.3em; color: #fff; - padding: 3px; height: 18px; margin: 0; border: 0; - width: 117px; background: transparent; } -#myusernameform input.editable { border: 1px solid #444; } -#myuser .myusernameedithoverable:hover { background: white; color: black} -#mystatusform { margin-left: 35px; margin-top: 5px; } -#mystatusedit { font-size: 1.2em; color: #777; - font-style: italic; display: none; - padding: 2px; height: 14px; margin: 0; border: 1px solid #bbb; - width: 199px; background: transparent; } -#myusernameform .editactive, #myusernameform .editempty { - background: white; border-left: 1px solid #c3c3c3; - border-top: 1px solid #c3c3c3; - border-right: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6; - color: #000 -} -#myusernameform .editempty { color: #333; } - -table#otheruserstable { display: none; } -#nootherusers { padding: 10px; font-size: 1.2em; color: #eee; font-weight: bold;} -#nootherusers a { color: #3C88FF; } - -#otheruserstable td { - border-top: 1px solid #555; - height: 26px; - vertical-align: middle; - padding: 0 2px; - color: #fff; -} - -#otheruserstable .swatch { - border: 1px solid #000; width: 13px; height: 13px; overflow: hidden; - margin: 0 4px; -} - -.usertdswatch { width: 1%; } -.usertdname { font-size: 1.3em; color: #444; } -.usertdstatus { font-size: 1.1em; font-style: italic; color: #999; } -.usertdactivity { font-size: 1.1em; color: #777; } - -.usertdname input { border: 1px solid #bbb; width: 80px; padding: 2px; } -.usertdname input.editactive, .usertdname input.editempty { - background: white; border-left: 1px solid #c3c3c3; - border-top: 1px solid #c3c3c3; - border-right: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6; -} -.usertdname input.editempty { color: #888; font-style: italic;} - -.modaldialog.cboxreconnecting .modaldialog-inner, -.modaldialog.cboxconnecting .modaldialog-inner { - background: url(../../static/img/connectingbar.gif) no-repeat center 60px; - height: 100px; -} -.modaldialog.cboxreconnecting, -.modaldialog.cboxconnecting, -.modaldialog.cboxdisconnected { - background: #8FCDE0; -} -.cboxdisconnected #connectionboxinner div { display: none; } -.cboxdisconnected_userdup #connectionboxinner #disconnected_userdup { display: block; } -.cboxdisconnected_deleted #connectionboxinner #disconnected_deleted { display: block; } -.cboxdisconnected_initsocketfail #connectionboxinner #disconnected_initsocketfail { display: block; } -.cboxdisconnected_looping #connectionboxinner #disconnected_looping { display: block; } -.cboxdisconnected_slowcommit #connectionboxinner #disconnected_slowcommit { display: block; } -.cboxdisconnected_unauth #connectionboxinner #disconnected_unauth { display: block; } -.cboxdisconnected_unknown #connectionboxinner #disconnected_unknown { display: block; } -.cboxdisconnected_initsocketfail #connectionboxinner #reconnect_advise, -.cboxdisconnected_looping #connectionboxinner #reconnect_advise, -.cboxdisconnected_slowcommit #connectionboxinner #reconnect_advise, -.cboxdisconnected_unknown #connectionboxinner #reconnect_advise { display: block; } -.cboxdisconnected div#reconnect_form { display: block; } -.cboxdisconnected .disconnected h2 { display: none; } -.cboxdisconnected .disconnected .h2_disconnect { display: block; } -.cboxdisconnected_userdup .disconnected h2.h2_disconnect { display: none; } -.cboxdisconnected_userdup .disconnected h2.h2_userdup { display: block; } -.cboxdisconnected_unauth .disconnected h2.h2_disconnect { display: none; } -.cboxdisconnected_unauth .disconnected h2.h2_unauth { display: block; } - -#connectionstatus { - position: absolute; width: 37px; height: 41px; overflow: hidden; - right: 0; - z-index: 11; -} -#connectionboxinner .connecting { - margin-top: 20px; - font-size: 2.0em; color: #555; - text-align: center; display: none; -} -.cboxconnecting #connectionboxinner .connecting { display: block; } - -#connectionboxinner .disconnected h2 { - font-size: 1.8em; color: #333; - text-align: left; - margin-top: 10px; margin-left: 10px; margin-right: 10px; - margin-bottom: 10px; -} -#connectionboxinner .disconnected p { - margin: 10px 10px; - font-size: 1.2em; - line-height: 1.1; - color: #333; -} -#connectionboxinner .disconnected { display: none; } -.cboxdisconnected #connectionboxinner .disconnected { display: block; } - -#connectionboxinner .reconnecting { - margin-top: 20px; - font-size: 1.6em; color: #555; - text-align: center; display: none; -} -.cboxreconnecting #connectionboxinner .reconnecting { display: block; } - -#reconnect_form button { - font-size: 12pt; - padding: 5px; -} - -/* We give docbar a higher z-index than its descendant impexp-wrapper in - order to allow the Import/Export panel to be on top of stuff lower - down on the page in IE. Strange but it works! */ -#docbar { z-index: 52; } - -#impexp-wrapper { width: 650px; right: 10px; } -#impexp-panel { height: 160px; } -.docbarimpexp-closing #impexp-wrapper { z-index: 50; } - -#savedrevs-wrapper { width: 100%; left: 0; } -#savedrevs-panel { height: 79px; } -.docbarsavedrevs-closing #savedrevs-wrapper { z-index: 50; } -#savedrevs-wrapper .dbpanel-rightedge { background-position: 0 -10px; } - -#options-wrapper { width: 340px; right: 200px; } -#options-panel { height: 114px; } -.docbaroptions-closing #options-wrapper { z-index: 50; } - -#security-wrapper { width: 320px; right: 300px; } -#security-panel { height: 130px; } -.docbarsecurity-closing #security-wrapper { z-index: 50; } - -#revision-notifier { position: absolute; right: 8px; top: 25px; - width: auto; height: auto; font-size: 1.2em; background: #ffc; - border: 1px solid #aaa; color: #444; padding: 3px 5px; - display: none; z-index: 55; } -#revision-notifier .label { color: #777; font-weight: bold; } - -/* We don't ever actually hide the wrapper, even when the panel is - cloased, so that its contents can always be manipulated accurately. */ - - -#padoptions { position: absolute; top: 0; left: 0; font-size: 1.2em; - color: #444; height: 100%; width: 100%; line-height: 15px; } -#options-viewhead { font-weight: bold; position: absolute; top: 10px; left: 15px; - width: auto; height: auto; } -#padoptions label { display: block; } -#padoptions input { padding: 0; margin: 0; } -#options-colorscheck { position: absolute; left: 15px; top: 34px; width: 15px; height: 15px; } -#options-colorslabel { position: absolute; left: 35px; top: 34px; } -#options-linenoscheck { position: absolute; left: 15px; top: 57px; width: 15px; height: 15px; } -#options-linenoslabel { position: absolute; left: 35px; top: 57px; } -#options-fontlabel { position: absolute; left: 15px; top: 82px; } -#viewfontmenu { position: absolute; top: 80px; left: 90px; width: 110px; } -#options-viewexplain { position: absolute; left: 215px; top: 15px; width: 100px; height: 70px; font-size: .7em; - padding-left: 10px; padding-top: 10px; border-left: 1px solid #ccc; - line-height: 20px; font-weight: bold; color: #999; } -#options-close { display: block; position: absolute; right: 7px; bottom: 8px; - width: auto; height: auto; font-size: 85%; color: #444; } - -#mainmodals { z-index: 600; /* higher than the modals themselves - so that modals are on top in IE */ } -.modalfield { font-size: 1.2em; padding: 1px; border: 1px solid #bbb;} -#mainmodals .editempty { color: #aaa; } - -.expand-collapse { - height: 22px; - background-image: url(static/img/sharedistri.gif); - background-repeat: no-repeat; - background-position: 0 3px; - padding-left: 17px; - text-decoration: none; -} -.expand-collapse.expanded { - background-position: 0 -31px; -} - - -.modaldialog { - position: absolute; - top: 100px; - left:50%; - margin-left:-243px; - width: 485px; - display: none; - z-index: 501; - zoom: 1; - overflow: hidden; - background: white; - border: 1px solid #999; -} -.modaldialog .modaldialog-inner { padding: 10pt; } -.modaldialog .modaldialog-hide { - float: right; - background-repeat: no-repeat; - background-image: url(static/img/sharebox4.gif); - display: block; - width: 22px; height: 22px; - background-position: -454px -6px; - margin-right:-5px; - margin-top:-5px; -} - -.modaldialog label, -.modaldialog h1 { - color:#222222; - font-size:125%; - font-weight:bold; -} - -.modaldialog th { - vertical-align: top; - text-align: left; -} - -.nonprouser #sharebox-stripe { display: none; } - -.sharebox-url { - width: 440px; height: 18px; - text-align: left; - font-size: 1.3em; - line-height: 18px; - padding: 2px; -} - -#sharebox-send { - float: right; - background-repeat: no-repeat; - background-image: url(static/img/sharebox4.gif); - display: block; - width: 87px; height: 22px; - background-position: -383px -289px; -} - - -#viewbarcontents { display: none; } -#viewzoomtitle { - position: absolute; left: 10px; top: 4px; height: 20px; line-height: 20px; - width: auto; -} -#viewzoommenu { - width: 65px; -} -#bottomarea { - height: 28px; - overflow: hidden; - position: absolute; - height: 28px; - bottom: 0px; - left: 0px; - right: 0px; - font-size: 1.2em; - color: #444; -} -#widthprefcheck { position: absolute; - background-image: url(static/img/layoutbuttons.gif); - background-repeat: no-repeat; cursor: pointer; - width: 86px; height: 20px; top: 4px; right: 2px; } -.widthprefunchecked { background-position: -1px -1px; } -.widthprefchecked { background-position: -1px -23px; } -#sidebarcheck { position: absolute; - background-image: url(static/img/layoutbuttons.gif); - background-repeat: no-repeat; cursor: pointer; - width: 86px; height: 20px; top: 4px; right: 90px; } -.sidebarunchecked { background-position: -1px -45px; } -.sidebarchecked { background-position: -1px -67px; } -#feedbackbutton { display: block; position: absolute; width: 68px; - height: 0; padding-top: 17px; overflow: hidden; - background: url(static/img/bottomareagfx.gif); - top: 5px; right: 220px; -} - -#modaloverlay { - z-index: 500; display: none; - background-repeat: repeat-both; - width: 100%; position: absolute; - height: 100%; left: 0; top: 0; -} - -* html #modaloverlay { /* for IE 6+ */ - opacity: 1; /* in case this is looked at */ - background-image: none; - background-repeat: no-repeat; - /* scale the image */ -} - -a#topbarmaximize { - float: right; - width: 16px; - height: 16px; - margin-right:-143px; - margin-top:4px; - background: url(static/img/maximize_normal.png); -} - -.maximized a#topbarmaximize { - background: url(static/img/maximize_maximized.png); -} - -#editbarinner h1 { - line-height: 29px; - font-size: 16px; - padding-left: 6pt; - margin-top: 0; -} - -#editbarinner h1 a { - font-size: 12px; -} - -.bigbutton { - display: block; - background-color: #a3bde0; - color: #555555; - border-style: solid; - border-width: 2px; - border-left-color: #d6e2f1; - border-right-color: #86aee1; - border-top-color: #d6e2f1; - border-bottom-color: #86aee1; - margin: 10pt; - text-align: center; - text-decoration: none; - padding: 50pt; - font-size: 20pt; - -moz-border-radius-topleft: 3pt; - -moz-border-radius-topright: 3pt; - -moz-border-radius-bottomleft: 3pt; - -moz-border-radius-bottomright: 3pt; - -webkit-border-top-left-radius: 3pt; - -webkit-border-top-right-radius: 3pt; - -webkit-border-bottom-left-radius: 3pt; - -webkit-border-bottom-right-radius: 3pt; -} - -.modaldialog .bigbutton { - padding-left: 0; - padding-right: 0; - width: 100%; -} - -#embed, #readonly { -display:none; -position:absolute; -top:40px; -font-size:14px; -width:400px; -right: 20px; -z-index: 500; -background-color: #000; -color: white; -background-color: rgb(0,0,0); -background-color: rgba(0,0,0,0.7); -padding: 10px; --moz-border-radius: 6px; -border-radius: 6px; -} - -#embedreadonly { -float:right; -} - -#embedcode, #readonlyUrl, #linkcode { -margin-left:10px; -} - -#embedinput, #readonlyInput, #linkinput { -width:375px; -height:24px; -display:inline; -margin-top: 10px; -padding-left:4px; -} - -ul#colorpickerswatches -{ - padding-left: 3px; - padding-top: 5px; -} - -ul#colorpickerswatches li -{ - border: 1px solid #ccc; - width: 14px; - height: 14px; - overflow: hidden; - margin: 3px 6px; - padding: 0px; -} - -ul#colorpickerswatches li:hover -{ - border: 1px solid #000; - cursor: pointer; -} - - - -#chatbox -{ - position:absolute; - bottom:0px; - right: 20px; - width: 180px; - height: 200px; - z-index: 400; - background-color:#f7f7f7; - border-left: 1px solid #999; - border-right: 1px solid #999; - border-top: 1px solid #999; - padding: 3px; - padding-bottom: 10px; - border-top-left-radius: 5px; - border-top-right-radius: 5px; - display:none; -} - -#chattext -{ - background-color: white; - border: 1px solid white; - overflow-y:scroll; - font-size: 12px; - position:absolute; - right:0px; - left:0px; - top:25px; - bottom:25px; -} - -#chattext p -{ - padding: 3px; - overflow-x: hidden; -} - -#chatinputbox -{ - padding: 3px 2px; - position: absolute; - bottom:0px; - right:0px; - left:3px; -} - -#chatlabel -{ - font-size:13px; - line-height:16px; - font-weight:bold; - color:#555; - text-decoration: none; - position: relative; - bottom: 3px; -} - -#chatinput -{ - border: 1px solid #BBBBBB; - width: 100%; - float:right; -} - -#chaticon -{ - z-index: 400; - position:absolute; - bottom:0px; - right: 20px; - padding: 5px; - border-left: 1px solid #999; - border-right: 1px solid #999; - border-top: 1px solid #999; - border-top-left-radius: 5px; - border-top-right-radius: 5px; - background-color:#fff; - cursor: pointer; -} - -#chaticon a -{ - text-decoration: none; -} - -#chatcounter -{ - color:#555; - font-size:9px; - position:relative; - bottom: 2px; -} - -#titlebar -{ - line-height:16px; - font-weight:bold; - color:#555; - position: relative; - bottom: 2px; -} - -#titlelabel -{ - font-size:13px; - margin-left:20px; - padding-top:3px; - position:absolute; -} - -#titlecross -{ - font-size:25px; - float:right; - text-align: right; - text-decoration: none; - cursor: pointer; - color:#555; -} - -.time -{ - float:right; - color:#333; - font-style:italic; - font-size: 10px; - margin-left: 3px; - margin-right: 3px; - margin-top:2px; -} - - -/* resizable stuff for chat */ -.ui-resizable { -position: relative; -} -.ui-resizable-handle { - position: absolute; - font-size: 0.1px; - z-index: 99999; - display: block; - -} - -.ui-resizable-nw { - background-image: url("../img/nw-resize.png"); - background-repeat: no-repeat; - background-size: 100% auto; - cursor: nw-resize; - height: 22px; - left: 0; - top: 0; - width: 22px; -} - -.ui-resizable-ne -{ - cursor: ne-resize; - width: 9px; - height: 9px; - right: -5px; - top: -5px; -} - -#importexport{ - position:absolute; - top:40px; - font-size:14px; - width:450px; - right: 20px; - z-index: 500; - background-color: #000; - color: white; - background-color: rgb(0,0,0); - background-color: rgba(0,0,0,0.7); - padding: 10px; - -moz-border-radius: 6px; - border-radius: 6px; - height:190px; - display:none; -} - -#import{ - position:absolute; - width:250px; - left:10px; - line-height:20px; -} - -#export{ - position:absolute; - width:180px; - right:10px; - line-height:20px; -} - -.exporttype{ - line-height:25px; - background-repeat:no-repeat; - padding-left:25px; - background-image: url("../img/fileicons.gif"); - color:#fff; - text-decoration:none; -} - -#importexportline{ - border: dotted 1px; - height: 185px; - position:absolute; - width:0px; - left:260px; - opacity:.8; -} - -.impexpbutton{ - background-image: -moz-linear-gradient(center top , #EEEEEE, white 20%, white 20%); - padding:3px; -} - -#exporthtml{ - background-position: 2px -25px; -} - -#exportplain{ - background-position: 2px -121px; -} - -#exportword{ - background-position: 2px -0px; -} - -#exportpdf{ - background-position: 2px -97px; -} - -#exportopen{ - background-position: 2px -74px; -} - -#exportwordle{ - background-position: 2px -49px; -} - -#exportdokuwiki{ - background-position: 2px -144px; -} - -#export a{ - text-decoration: none; -} - -#importstatusball{ - display:none; -} - -#importarrow{ - display:none; -} - -#importmessagesuccess{ - display:none; -} - -#importsubmitinput{ - height:25px; - width:85px; - margin-top:12px; -} - -#importstatusball{ - height:50px; -} - -#chatthrob{ -display:none; -position:absolute; -bottom:40px; -font-size:14px; -width:150px; -height:40px; -right: 20px; -z-index: 200; -background-color: #000; -color: white; -background-color: rgb(0,0,0); -background-color: rgba(0,0,0,0.7); -padding: 10px; --moz-border-radius: 6px; -border-radius: 6px; -opacity:.8; -} - -.buttonicon{ -width:16px; -height:16px; -background-image:url('../../static/img/etherpad_lite_icons.png'); -background-repeat: no-repeat; -margin-left: 1px; -margin-top: 1px; -} - -#usericon -{ -width:33px !important; -} - -#focusprotector -{ - z-index: 100; - position: absolute; - bottom: 0px; - top: 0px; - left: 0px; - right: 0px; - background-color: white; - opacity:0.01; - display:none; -} - -#online_count{ - color: #999; -} - -label[for=readonlyinput] { - margin: 0 10px 0 2px; -} - - -#qr_center { - margin: 10px 10px auto 0; - text-align: center; -} - -#qrcode{ - 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; - } -} -.rtl{ - direction:RTL; -} +*,html,body,p{ margin: 0; padding: 0; } +.clear { clear: both; } +html { font-size: 62.5%; } +body, textarea { font-family: Helvetica, Arial, sans-serif; } +iframe {position:absolute;} + +#users +{ + position: absolute; + z-index: 10; + background-color: #000; + background-color: rgba(0,0,0,0.7); + width: 160px; + right: 20px; + top: 40px; + color: #fff; + padding: 5px; + -moz-border-radius: 6px; + border-radius: 6px; +} + +a img +{ + border: 0; +} + +/* menu */ +#editbar ul +{ + position: relative; + list-style: none; + padding-right: 3px; + padding-left: 1px; + z-index: 2; + overflow: hidden; + +} + +#editbar +{ + 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-bottom: 1px solid #ccc; + height: 32px; + overflow: hidden; + padding-top: 3px; + width: 100%; +} + +#editbar ul li +{ + background: #fff; + background: -moz-linear-gradient(#fff, #f0f0f0); + background: -ms-linear-gradient(#fff, #f0f0f0); + background: -o-linear-gradient(#fff, #f0f0f0); + background: -webkit-linear-gradient(#fff, #f0f0f0); + border: 1px solid #ccc; + border-radius: 4px; + cursor: pointer; + float: left; + height: 18px; + margin-left: 2px; + overflow: hidden; + padding: 4px 5px; + width: 18px; +} + +#editbar ul li a +{ + text-decoration: none; + color: #ccc; +} + +#editbar ul li a span +{ + position: relative; + top:-2px +} + +#editbar ul li:hover { + background: #fff; +} + +#editbar ul li:active { + background: #eee; + background: -moz-linear-gradient(#ddd, #fff); + background: -ms-linear-gradient(#ddd, #fff); + background: -o-linear-gradient(#ddd, #fff); + background: -webkit-linear-gradient(#ddd, #fff); +} + +input[type="file"] { + color: #fff; +} + +#editbar ul li.separator +{ + border: inherit; + background: inherit; + visibility:hidden; + width: 0px; +} +#editbar ul li a +{ + display: block; +} +#editbar ul li a img +{ + padding: 1px; +} + + +#editbar ul +{ + float: left; +} +#editbar ul#menu_right +{ + float: right; +} + +#users +{ + display: none; +} + +#editorcontainer +{ + position: absolute; + + width: 100%; + + top: 36px; + left: 0px; + bottom: 0px; + + z-index: 1; +} + +#editorcontainer iframe { + height: 100%; + width: 100%; + padding: 0; + margin: 0; +} + +#editorloadingbox { padding-top: 100px; padding-bottom: 100px; font-size: 2.5em; color: #aaa; + text-align: center; position: absolute; width: 100%; height: 30px; z-index: 100; } + +#editorcontainerbox{ + position:absolute; + bottom:0; + top:0; + width:100%; +} + + +#padpage { + position: absolute; + top: 0px; + bottom: 0px; + width: 100%; +} + +.maximized #padpage { + left: 8px; + right: 8px; + width: auto; + margin-left: 0; +} + +body.fullwidth #padpage { width: auto; margin-left: 6px; margin-right: 6px; } +body.squish1width #padpage { width: 800px; } +body.squish2width #padpage { width: 700px; } + +a#backtoprosite, #accountnav { + display: block; position: absolute; height: 15px; line-height: 15px; + width: auto; top: 5px; font-size: 1.2em; display:none; +} +a#backtoprosite, #accountnav a { color: #cde7ff; text-decoration: underline; } + +a#backtoprosite { padding-left: 20px; left: 6px; + background: url(static/img/protop.gif) no-repeat -5px -6px; } +#accountnav { right: 30px; color: #fff; } + +.propad a#topbaretherpad { background: url(static/img/protop.gif) no-repeat -397px -3px; } + +#specialkeyarea { top: 5px; left: 250px; color: yellow; font-weight: bold; + font-size: 1.5em; position: absolute; } + +#alertbar { + margin-top: 6px; + opacity: 0; + filter: alpha(opacity = 0); /* IE */ + display: none; + position:absolute; + left:0; + right:0; + z-index:53; +} + +#servermsg { position: relative; zoom: 1; border: 1px solid #992; + background: #ffc; padding: 0.8em; font-size: 1.2em; } +#servermsg h3 { font-weight: bold; margin-right: 10px; + margin-bottom: 1em; float: left; width: auto; } +#servermsg #servermsgdate { font-style: italic; font-weight: normal; color: #666; } +a#hidetopmsg { position: absolute; right: 5px; bottom: 5px; } + +#shuttingdown { position: relative; zoom: 1; border: 1px solid #992; + background: #ffc; padding: 0.6em; font-size: 1.2em; margin-top: 6px; } + +#docbar { margin-top: 6px; height: 25px; position: relative; zoom: 1; + background: #fbfbfb url(static/img/padtopback2.gif) repeat-x 0 -31px; } + +.docbarbutton +{ + padding-top: 2px; + padding-bottom: 2px; + padding-left: 4px; + padding-right: 4px; + border-left: 1px solid #CCC; + white-space: nowrap; +} + +.docbarbutton img +{ + border: 0px; + width: 13px; + margin-right: 2px; + vertical-align: middle; + margin-top: 3px; + margin-bottom: 2px; +} + +.menu, +.menu ul { + font-size: 10pt; + list-style-type: none; +} + +.menu ul { + padding-left: 20px; +} + +.menu a { + font-size: 10px; + line-height: 18px; + text-decoration: none; + color: #444; + font-weight: bold; +} + +.docbarbutton.highlight +{ + background-color: #fef2bd; + border: 1px solid #CCC; + border-right: 0px; +} + +#docbarleft { position: absolute; left: 0; top: 0; height: 100%; + overflow: hidden; + background: url(static/img/padtop5.gif) no-repeat left -31px; width: 7px; } + + + +#docbarpadtitle { position: absolute; height: auto; left: 9px; + width: 280px; font-size: 1.6em; color: #444; font-weight: normal; + line-height: 22px; margin-left: 2px; height: 22px; top: 2px; + overflow: hidden; text-overflow: ellipsis /*not supported in FF*/; + white-space:nowrap; } +.docbar-public #docbarpadtitle { padding-left: 22px; + background: url(static/img/public.gif) no-repeat left center; } + +#docbarrenamelink { position: absolute; top: 6px; + font-size: 1.1em; display: none; } +#docbarrenamelink a { color: #999; } +#docbarrenamelink a:hover { color: #48d; } +#padtitlebuttons { position: absolute; width: 74px; zoom: 1; + height: 17px; top: 4px; left: 170px; display: none; + background: url(static/img/ok_or_cancel.gif) 0px 0px; } +#padtitlesave { position: absolute; display: block; + height: 0; padding-top: 17px; overflow: hidden; + width: 23px; left: 0; top: 0; } +#padtitlecancel { position: absolute; display: block; + height: 0; padding-top: 17px; overflow: hidden; + width: 35px; right: 0; top: 0; } +#padtitleedit { position: absolute; top: 2px; left: 5px; + height: 15px; padding: 2px; font-size: 1.4em; + background: white; border-left: 1px solid #c3c3c3; + border-top: 1px solid #c3c3c3; + border-right: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6; + width: 150px; display: none; +} + +#padmain { + margin-top: 0px; + position: absolute; + top: 63px !important; + left: 0px; + right: 0px; + bottom: 0px; + zoom: 1; +} + +#padeditor { + bottom:0px; + left:0; + position:absolute; + right:0px; + top:0; + zoom: 1; +} +.hidesidebar #padeditor { right: 0; } + +#vdraggie { +/* background: url(static/img/vdraggie.gif) no-repeat top center;*/ + width:16px; + height:16px; + background-image:url('../../static/img/etherpad_lite_icons.png'); + background-repeat: no-repeat; + background-position: 0px -300px; + + cursor: W-resize; + bottom:0; + position:absolute; + right:268px; + top:0; + width:56px; + z-index: 10; +} + +#editbarsavetable +{ + position:absolute; + top: 6px; + right: 8px; + height: 24px; +} + +#editbarsavetable td, #editbartable td +{ + white-space: nowrap; +} + +#myswatchbox { + position: absolute; + left: 5px; + top: 5px; + width: 24px; + height: 24px; + border: 1px solid #000; + background: transparent; + cursor: pointer; +} + +#myswatch { width: 100%; height: 100%; background: transparent;/*...initially*/ } + +#mycolorpicker { + width: 232px; height: 265px; + position: absolute; + left: -250px; top: 0px; z-index: 101; + display: none; + border-radius: 5px; + background: rgba(0, 0, 0, 0.7); + padding-left:10px; + padding-top:10px; +} +/* +#mycolorpicker ul li +{ + float: left; +} +#mycolorpicker .picked { border: 1px solid #000 !important; } + +#mycolorpicker .picked .pickerswatch { border: 1px solid #fff; } +*/ +#mycolorpickersave { + left: 10px; + font-weight: bold; +} + +#mycolorpickercancel { + left: 85px; +} + +#mycolorpickersave, #mycolorpickercancel { + background: #fff; + background: -moz-linear-gradient(#fff, #ccc); + background: -ms-linear-gradient(#fff, #ccc); + background: -o-linear-gradient(#fff, #ccc); + background: -webkit-linear-gradient(#fff, #ccc); + border: 1px solid #ccc; + border-radius: 4px; + font-size:12px; + cursor: pointer; + color:#000; + overflow: hidden; + padding: 4px; + top: 240px; + text-align:center; + position: absolute; + width: 60px; +} + +#mycolorpickerpreview { + position: absolute; + left: 207px; + top: 240px; + width:16px; + height:16px; + padding:4px; + overflow: hidden; + color: #fff; + border-radius:5px; +} + + +#myusernameform { margin-left: 35px; } +#myusernameedit { font-size: 1.3em; color: #fff; + padding: 3px; height: 18px; margin: 0; border: 0; + width: 117px; background: transparent; } +#myusernameform input.editable { border: 1px solid #444; } +#myuser .myusernameedithoverable:hover { background: white; color: black} +#mystatusform { margin-left: 35px; margin-top: 5px; } +#mystatusedit { font-size: 1.2em; color: #777; + font-style: italic; display: none; + padding: 2px; height: 14px; margin: 0; border: 1px solid #bbb; + width: 199px; background: transparent; } +#myusernameform .editactive, #myusernameform .editempty { + background: white; border-left: 1px solid #c3c3c3; + border-top: 1px solid #c3c3c3; + border-right: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6; + color: #000 +} +#myusernameform .editempty { color: #333; } + +table#otheruserstable { display: none; } +#nootherusers { padding: 10px; font-size: 1.2em; color: #eee; font-weight: bold;} +#nootherusers a { color: #3C88FF; } + +#otheruserstable td { + border-top: 1px solid #555; + height: 26px; + vertical-align: middle; + padding: 0 2px; + color: #fff; +} + +#otheruserstable .swatch { + border: 1px solid #000; width: 13px; height: 13px; overflow: hidden; + margin: 0 4px; +} + +.usertdswatch { width: 1%; } +.usertdname { font-size: 1.3em; color: #444; } +.usertdstatus { font-size: 1.1em; font-style: italic; color: #999; } +.usertdactivity { font-size: 1.1em; color: #777; } + +.usertdname input { border: 1px solid #bbb; width: 80px; padding: 2px; } +.usertdname input.editactive, .usertdname input.editempty { + background: white; border-left: 1px solid #c3c3c3; + border-top: 1px solid #c3c3c3; + border-right: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6; +} +.usertdname input.editempty { color: #888; font-style: italic;} + +.modaldialog.cboxreconnecting .modaldialog-inner, +.modaldialog.cboxconnecting .modaldialog-inner { + background: url(static/img/connectingbar.gif) no-repeat center 60px; + height: 100px; +} +.modaldialog.cboxreconnecting { + background: #fed; +} +.modaldialog.cboxconnecting, +.modaldialog.cboxdisconnected { + background: #fdd; +} +.cboxdisconnected #connectionboxinner div { display: none; } +.cboxdisconnected_userdup #connectionboxinner #disconnected_userdup { display: block; } +.cboxdisconnected_deleted #connectionboxinner #disconnected_deleted { display: block; } +.cboxdisconnected_initsocketfail #connectionboxinner #disconnected_initsocketfail { display: block; } +.cboxdisconnected_looping #connectionboxinner #disconnected_looping { display: block; } +.cboxdisconnected_slowcommit #connectionboxinner #disconnected_slowcommit { display: block; } +.cboxdisconnected_unauth #connectionboxinner #disconnected_unauth { display: block; } +.cboxdisconnected_unknown #connectionboxinner #disconnected_unknown { display: block; } +.cboxdisconnected_initsocketfail #connectionboxinner #reconnect_advise, +.cboxdisconnected_looping #connectionboxinner #reconnect_advise, +.cboxdisconnected_slowcommit #connectionboxinner #reconnect_advise, +.cboxdisconnected_unknown #connectionboxinner #reconnect_advise { display: block; } +.cboxdisconnected div#reconnect_form { display: block; } +.cboxdisconnected .disconnected h2 { display: none; } +.cboxdisconnected .disconnected .h2_disconnect { display: block; } +.cboxdisconnected_userdup .disconnected h2.h2_disconnect { display: none; } +.cboxdisconnected_userdup .disconnected h2.h2_userdup { display: block; } +.cboxdisconnected_unauth .disconnected h2.h2_disconnect { display: none; } +.cboxdisconnected_unauth .disconnected h2.h2_unauth { display: block; } + +#connectionstatus { + position: absolute; width: 37px; height: 41px; overflow: hidden; + right: 0; + z-index: 11; +} +#connectionboxinner .connecting { + margin-top: 20px; + font-size: 2.0em; color: #555; + text-align: center; display: none; +} +.cboxconnecting #connectionboxinner .connecting { display: block; } + +#connectionboxinner .disconnected h2 { + font-size: 1.8em; color: #333; + text-align: left; + margin-top: 10px; margin-left: 10px; margin-right: 10px; + margin-bottom: 10px; +} +#connectionboxinner .disconnected p { + margin: 10px 10px; + font-size: 1.2em; + line-height: 1.1; + color: #333; +} +#connectionboxinner .disconnected { display: none; } +.cboxdisconnected #connectionboxinner .disconnected { display: block; } + +#connectionboxinner .reconnecting { + margin-top: 20px; + font-size: 1.6em; color: #555; + text-align: center; display: none; +} +.cboxreconnecting #connectionboxinner .reconnecting { display: block; } + +#reconnect_form button { + font-size: 12pt; + padding: 5px; +} + +/* We give docbar a higher z-index than its descendant impexp-wrapper in + order to allow the Import/Export panel to be on top of stuff lower + down on the page in IE. Strange but it works! */ +#docbar { z-index: 52; } + +#impexp-wrapper { width: 650px; right: 10px; } +#impexp-panel { height: 160px; } +.docbarimpexp-closing #impexp-wrapper { z-index: 50; } + +#savedrevs-wrapper { width: 100%; left: 0; } +#savedrevs-panel { height: 79px; } +.docbarsavedrevs-closing #savedrevs-wrapper { z-index: 50; } +#savedrevs-wrapper .dbpanel-rightedge { background-position: 0 -10px; } + +#options-wrapper { width: 340px; right: 200px; } +#options-panel { height: 114px; } +.docbaroptions-closing #options-wrapper { z-index: 50; } + +#security-wrapper { width: 320px; right: 300px; } +#security-panel { height: 130px; } +.docbarsecurity-closing #security-wrapper { z-index: 50; } + +#revision-notifier { position: absolute; right: 8px; top: 25px; + width: auto; height: auto; font-size: 1.2em; background: #ffc; + border: 1px solid #aaa; color: #444; padding: 3px 5px; + display: none; z-index: 55; } +#revision-notifier .label { color: #777; font-weight: bold; } + +/* We don't ever actually hide the wrapper, even when the panel is + cloased, so that its contents can always be manipulated accurately. */ + + +#padoptions { position: absolute; top: 0; left: 0; font-size: 1.2em; + color: #444; height: 100%; width: 100%; line-height: 15px; } +#options-viewhead { font-weight: bold; position: absolute; top: 10px; left: 15px; + width: auto; height: auto; } +#padoptions label { display: block; } +#padoptions input { padding: 0; margin: 0; } +#options-colorscheck { position: absolute; left: 15px; top: 34px; width: 15px; height: 15px; } +#options-colorslabel { position: absolute; left: 35px; top: 34px; } +#options-linenoscheck { position: absolute; left: 15px; top: 57px; width: 15px; height: 15px; } +#options-linenoslabel { position: absolute; left: 35px; top: 57px; } +#options-fontlabel { position: absolute; left: 15px; top: 82px; } +#viewfontmenu { position: absolute; top: 80px; left: 90px; width: 110px; } +#options-viewexplain { position: absolute; left: 215px; top: 15px; width: 100px; height: 70px; font-size: .7em; + padding-left: 10px; padding-top: 10px; border-left: 1px solid #ccc; + line-height: 20px; font-weight: bold; color: #999; } +#options-close { display: block; position: absolute; right: 7px; bottom: 8px; + width: auto; height: auto; font-size: 85%; color: #444; } + +#mainmodals { z-index: 600; /* higher than the modals themselves + so that modals are on top in IE */ } +.modalfield { font-size: 1.2em; padding: 1px; border: 1px solid #bbb;} +#mainmodals .editempty { color: #aaa; } + +.expand-collapse { + height: 22px; + background-image: url(static/img/sharedistri.gif); + background-repeat: no-repeat; + background-position: 0 3px; + padding-left: 17px; + text-decoration: none; +} +.expand-collapse.expanded { + background-position: 0 -31px; +} + + +.modaldialog { + position: absolute; + top: 100px; + left:50%; + margin-left:-243px; + width: 485px; + display: none; + z-index: 501; + zoom: 1; + overflow: hidden; + background: white; + border: 1px solid #999; +} +.modaldialog .modaldialog-inner { padding: 10pt; } +.modaldialog .modaldialog-hide { + float: right; + background-repeat: no-repeat; + background-image: url(static/img/sharebox4.gif); + display: block; + width: 22px; height: 22px; + background-position: -454px -6px; + margin-right:-5px; + margin-top:-5px; +} + +.modaldialog label, +.modaldialog h1 { + color:#222222; + font-size:125%; + font-weight:bold; +} + +.modaldialog th { + vertical-align: top; + text-align: left; +} + +.nonprouser #sharebox-stripe { display: none; } + +.sharebox-url { + width: 440px; height: 18px; + text-align: left; + font-size: 1.3em; + line-height: 18px; + padding: 2px; +} + +#sharebox-send { + float: right; + background-repeat: no-repeat; + background-image: url(static/img/sharebox4.gif); + display: block; + width: 87px; height: 22px; + background-position: -383px -289px; +} + + +#viewbarcontents { display: none; } +#viewzoomtitle { + position: absolute; left: 10px; top: 4px; height: 20px; line-height: 20px; + width: auto; +} +#viewzoommenu { + width: 65px; +} +#bottomarea { + height: 28px; + overflow: hidden; + position: absolute; + height: 28px; + bottom: 0px; + left: 0px; + right: 0px; + font-size: 1.2em; + color: #444; +} +#widthprefcheck { position: absolute; + background-image: url(static/img/layoutbuttons.gif); + background-repeat: no-repeat; cursor: pointer; + width: 86px; height: 20px; top: 4px; right: 2px; } +.widthprefunchecked { background-position: -1px -1px; } +.widthprefchecked { background-position: -1px -23px; } +#sidebarcheck { position: absolute; + background-image: url(static/img/layoutbuttons.gif); + background-repeat: no-repeat; cursor: pointer; + width: 86px; height: 20px; top: 4px; right: 90px; } +.sidebarunchecked { background-position: -1px -45px; } +.sidebarchecked { background-position: -1px -67px; } +#feedbackbutton { display: block; position: absolute; width: 68px; + height: 0; padding-top: 17px; overflow: hidden; + background: url(static/img/bottomareagfx.gif); + top: 5px; right: 220px; +} + +#modaloverlay { + z-index: 500; display: none; + background-repeat: repeat-both; + width: 100%; position: absolute; + height: 100%; left: 0; top: 0; +} + +* html #modaloverlay { /* for IE 6+ */ + opacity: 1; /* in case this is looked at */ + background-image: none; + background-repeat: no-repeat; + /* scale the image */ +} + +a#topbarmaximize { + float: right; + width: 16px; + height: 16px; + margin-right:-143px; + margin-top:4px; + background: url(static/img/maximize_normal.png); +} + +.maximized a#topbarmaximize { + background: url(static/img/maximize_maximized.png); +} + +#editbarinner h1 { + line-height: 29px; + font-size: 16px; + padding-left: 6pt; + margin-top: 0; +} + +#editbarinner h1 a { + font-size: 12px; +} + +.bigbutton { + display: block; + background-color: #a3bde0; + color: #555555; + border-style: solid; + border-width: 2px; + border-left-color: #d6e2f1; + border-right-color: #86aee1; + border-top-color: #d6e2f1; + border-bottom-color: #86aee1; + margin: 10pt; + text-align: center; + text-decoration: none; + padding: 50pt; + font-size: 20pt; + -moz-border-radius-topleft: 3pt; + -moz-border-radius-topright: 3pt; + -moz-border-radius-bottomleft: 3pt; + -moz-border-radius-bottomright: 3pt; + -webkit-border-top-left-radius: 3pt; + -webkit-border-top-right-radius: 3pt; + -webkit-border-bottom-left-radius: 3pt; + -webkit-border-bottom-right-radius: 3pt; +} + +.modaldialog .bigbutton { + padding-left: 0; + padding-right: 0; + width: 100%; +} + +#embed, #readonly { +display:none; +position:absolute; +top:40px; +font-size:14px; +width:400px; +right: 20px; +z-index: 500; +background-color: #000; +color: white; +background-color: rgb(0,0,0); +background-color: rgba(0,0,0,0.7); +padding: 10px; +-moz-border-radius: 6px; +border-radius: 6px; +} + +#embedcode, #readonlyUrl { +margin-left:10px; +} + +#embedinput, #readonlyInput{ +width:375px; +height:24px; +display:inline; +margin-top: 10px; +padding-left:4px; +} + +ul#colorpickerswatches +{ + padding-left: 3px; + padding-top: 5px; +} + +ul#colorpickerswatches li +{ + border: 1px solid #ccc; + width: 14px; + height: 14px; + overflow: hidden; + margin: 3px 6px; + padding: 0px; +} + +ul#colorpickerswatches li:hover +{ + border: 1px solid #000; + cursor: pointer; +} + + + +#chatbox +{ + position:absolute; + bottom:0px; + right: 20px; + width: 180px; + height: 200px; + z-index: 400; + background-color:#f7f7f7; + border-left: 1px solid #999; + border-right: 1px solid #999; + border-top: 1px solid #999; + padding: 3px; + padding-bottom: 10px; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + display:none; +} + +#chattext +{ + background-color: white; + border: 1px solid white; + overflow-y:scroll; + font-size: 12px; + position:absolute; + right:0px; + left:0px; + top:25px; + bottom:25px; +} + +#chattext p +{ + padding: 3px; + overflow-x: hidden; +} + +#chatinputbox +{ + padding: 3px 2px; + position: absolute; + bottom:0px; + right:0px; + left:3px; +} + +#chatlabel +{ + font-size:13px; + line-height:16px; + font-weight:bold; + color:#555; + text-decoration: none; + position: relative; + bottom: 3px; +} + +#chatinput +{ + border: 1px solid #BBBBBB; + width: 100%; + float:right; +} + +#chaticon +{ + z-index: 400; + position:absolute; + bottom:0px; + right: 20px; + padding: 5px; + border-left: 1px solid #999; + border-right: 1px solid #999; + border-top: 1px solid #999; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + background-color:#fff; + cursor: pointer; +} + +#chaticon a +{ + text-decoration: none; +} + +#chatcounter +{ + color:#555; + font-size:9px; + position:relative; + bottom: 2px; +} + +#titlebar +{ + line-height:16px; + font-weight:bold; + color:#555; + position: relative; + bottom: 2px; +} + +#titlelabel +{ + font-size:13px; + margin-left:20px; + padding-top:3px; + position:absolute; +} + +#titlecross +{ + font-size:25px; + float:right; + text-align: right; + text-decoration: none; + cursor: pointer; + color:#555; +} + +.time +{ + float:right; + color:#333; + font-style:italic; + font-size: 10px; + margin-left: 3px; + margin-right: 3px; + margin-top:2px; +} + + +/* resizable stuff for chat */ +.ui-resizable { +position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + z-index: 99999; + display: block; + +} + +.ui-resizable-nw { + background-image: url("../img/nw-resize.png"); + background-repeat: no-repeat; + background-size: 100% auto; + cursor: nw-resize; + height: 22px; + left: 0; + top: 0; + width: 22px; +} + +.ui-resizable-ne +{ + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} + +#importexport{ + position:absolute; + top:40px; + font-size:14px; + width:450px; + right: 20px; + z-index: 500; + background-color: #000; + color: white; + background-color: rgb(0,0,0); + background-color: rgba(0,0,0,0.7); + padding: 10px; + -moz-border-radius: 6px; + border-radius: 6px; + height:1000px !important; + display:none; + width:700px; +} + +#import{ + position:absolute; + width:250px; + left:10px; + line-height:20px; +} + +#import2{ + position:absolute; + width:250px; + left:10px; + line-height:20px; + +} + +#export{ + position:absolute; + width:180px; + right:10px; + line-height:20px; +} + +.exporttype{ + line-height:25px; + background-repeat:no-repeat; + padding-left:25px; + background-image: url("../img/fileicons.gif"); + color:#fff; + text-decoration:none; +} + +#importexportline{ + border: dotted 1px; + height: 165px; + position:absolute; + width:0px; + left:260px; + opacity:.8; +} + +.impexpbutton{ + background-image: -moz-linear-gradient(center top , #EEEEEE, white 20%, white 20%); + padding:3px; +} + +#exporthtml{ + background-position: 2px -25px; +} + +#exportplain{ + background-position: 2px -121px; +} + +#exportword{ + background-position: 2px -0px; +} + +#exportpdf{ + background-position: 2px -97px; +} + +#exportopen{ + background-position: 2px -74px; +} + +#exportwordle{ + background-position: 2px -49px; +} + +#export a{ + text-decoration: none; +} + +#importstatusball{ + display:none; +} + +#importarrow{ + display:none; +} + +#importmessagesuccess{ + display:none; +} + +#importsubmitinput{ + height:25px; + width:85px; + margin-top:12px; +} + +#importstatusball{ + height:50px; +} + +#chatthrob{ +display:none; +position:absolute; +bottom:40px; +font-size:14px; +width:150px; +height:40px; +right: 20px; +z-index: 200; +background-color: #000; +color: white; +background-color: rgb(0,0,0); +background-color: rgba(0,0,0,0.7); +padding: 10px; +-moz-border-radius: 6px; +border-radius: 6px; +opacity:.8; +} + +.buttonicon{ +width:16px; +height:16px; +background-image:url('../../static/img/etherpad_lite_icons.png'); +background-repeat: no-repeat; +margin-left: 1px; +margin-top: 1px; +} + +#usericon +{ +width:33px !important; +} + +#focusprotector +{ + z-index: 100; + position: absolute; + bottom: 0px; + top: 0px; + left: 0px; + right: 0px; + background-color: white; + opacity:0.01; + display:none; +} + +#online_count{ + color: #999; +} + +@media screen and (max-width: 600px) { + #editbar ul li { + padding: 4px 1px; + } +} + + + +.data-tables +{ +font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; +width:500px; +border-collapse:collapse; +table-layout: fixed; +overflow: hidden; +border: 1px solid #bbb; +} +.data-tables td, .data-tables th +{ +font-size:1em; +border:1px solid #98bf21; +padding:3px 7px 2px 7px; +max-width:30px; +word-wrap: break-word; +height:20px; +} +.data-tables th +{ +font-size:1.1em; +text-align:left; +padding-top:5px; +padding-bottom:4px; +background-color:#A7C942; +color:#ffffff; +} +.data-tables tr.alt td +{ +color:#000000; +background-color:#EAF2D3; +} + +.data-tables th { + color: #000; + background-color: #bbb; + border: 1px outset; +} + +.data-tables td { + color: #000; + background-color: #E6E6FA; +} +.hide-el{ +display:none; +} + +.overhead { + background-color: white !important; + color: gray !important; + overflow: hidden; + word-wrap: normal !important; +} +.import-tbl{ + background-color: white; + background-position: 0 -75px; + height: 8px; + cursor:pointer; +} +.table-menu{ +width:30px !important; +} + +#matrix_table tr td { + border: 1px solid grey; + height: 30px; + width: 30px; + padding: 10px; +} +#matrix_table tr td.selected { + background-color: rgb(200, 200, 255); +} + +.ft { + background-color: HoneyDew; +} \ No newline at end of file diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index 65f8ec7e76a..baf52de52e2 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -20,6 +20,8 @@ * limitations under the License. */ +var OPTIONS_TBL = ['addTbl','addTblRowA','addTblRowB','addTblColL','addTblColR','delTbl','delTblRow','delTblCol'] +var tempErrorMessage = "Hmm...something went wrong. ctrl-z is the best thing a man can have. Reporting it to WLOS developers is the 2nd best thing!"; function OUTER(gscope) { @@ -35,7 +37,7 @@ function OUTER(gscope) var MIN_LINEDIV_WIDTH = 20; var EDIT_BODY_PADDING_TOP = 8; var EDIT_BODY_PADDING_LEFT = 8; - + var caughtErrors = []; var thisAuthor = ''; @@ -308,6 +310,10 @@ function OUTER(gscope) function inCallStack(type, action) { + + if(typeof(type.importTbl)!='undefined'){ + type=type.importTbl; + } if (disposed) return; if (currentCallStack) @@ -324,7 +330,7 @@ function OUTER(gscope) } function newEditEvent(eventType) - { + { return { eventType: eventType, backset: null @@ -417,7 +423,9 @@ function OUTER(gscope) } finally { + var cs = currentCallStack; + //console.log("Finished action for: "+type); if (cleanExit) { @@ -3482,7 +3490,7 @@ function OUTER(gscope) { //hide the dropdowns window.top.padeditbar.toogleDropDown("none"); - + window.top.padeditor.hideTblContextMenu(); inCallStack("handleClick", function() { idleWorkTimer.atMost(200); @@ -3519,8 +3527,68 @@ function OUTER(gscope) } } - function doReturnKey() + function createCellAttrObj(currTdInfo){ + var thisCellAttr = {}; + thisCellAttr.breaks = {}; //[break offset,numOfBrs] + thisCellAttr.breaks [currTdInfo.cellCaretPos]=1; + return thisCellAttr; + } + function doTableReturnKey() { + var currLine = rep.lines.atIndex(rep.selStart[0]); + var currLineText = currLine.text; + if (currLineText.indexOf('],"tblId"') == -1) return false; + else { + try { + var tblJSONObj = JSON.parse(currLineText); + var table = tblJSONObj.payload; + var currTdInfo = getFocusedTdInfo(table); + var leftOverTdTxtLen = currTdInfo.leftOverTdTxtLen; + var currRow = currTdInfo.row; + var currTd = currTdInfo.td; + var attributes = tblJSONObj.cellAttr; + var rowAttrs = attributes[currRow]; + if(typeof (rowAttrs) != 'undefined' && rowAttrs==null){ + rowAttrs = []; + attributes[currRow] = rowAttrs; + } + if (typeof (rowAttrs) == 'undefined') {//make new row entry + rowAttrs =[] + rowAttrs[currTd]=createCellAttrObj(currTdInfo); + } + else {//update previous entry + var thisCellAttr = rowAttrs[currTd]; + if(typeof (thisCellAttr) != 'undefined' && thisCellAttr==null){ + thisCellAttr = {}; + rowAttrs[currTd] = thisCellAttr; + } + if (typeof (thisCellAttr) == 'undefined') {//make new cell attr entry + rowAttrs[currTd]=createCellAttrObj(currTdInfo); + }else{ + if(typeof(thisCellAttr.breaks [currTdInfo.cellCaretPos]) != 'undefined'){//multiple breaks + thisCellAttr.breaks [currTdInfo.cellCaretPos] += 1; + } + else{ + thisCellAttr.breaks [currTdInfo.cellCaretPos]=1; + } + rowAttrs[currTd] = thisCellAttr; + } + } + attributes[currRow]=rowAttrs; + rep.selStart[1] = currLineText.indexOf("cellAttr"); + //rep.selStart[1] = 0; + rep.selEnd[1] = currLineText.length; + tblJSONObj.cellAttr = attributes; + var newText = JSON.stringify(tblJSONObj); + performDocumentReplaceRange(rep.selStart, rep.selEnd, newText.substring(newText.indexOf("cellAttr"))); + } catch (error) { + performDocumentReplaceRange(rep.selStart, rep.selEnd, tempErrorMessage); + } + return true + } + } + function doReturnKey(insertTable) { + if(insertTable != 'insertTable' && doTableReturnKey())return; if (!(rep.selStart && rep.selEnd)) { return; @@ -3585,19 +3653,46 @@ function OUTER(gscope) } editorInfo.ace_doIndentOutdent = doIndentOutdent; - function doTabKey(shiftDown) - { - if (!doIndentOutdent(shiftDown)) - { - performDocumentReplaceSelection(THE_TAB); - } + function doTabKey(shiftDown) + { + var currLine = rep.lines.atIndex(rep.selStart[0]); + var currLineText = currLine.text; + if(currLineText.indexOf('tblId')!=-1){ + performDocumentTableTabKey(); + } + else if (!doIndentOutdent(shiftDown)){ + performDocumentReplaceSelection(THE_TAB); + } + } + + + + function isTblCellDeleteOk(){ + + var currLine = rep.lines.atIndex(rep.selStart[0]); + var currLineText = currLine.text; + if(currLineText.indexOf('],"tblId"') == -1)return true; + var isDeleteAccepted = false; + try{ + var tblJSONObj = JSON.parse(currLineText); + var table = tblJSONObj.payload; + var currTdInfo = getFocusedTdInfo(table); + cellEntryLen = table[currTdInfo.row][currTdInfo.td].length; + if(cellEntryLen != 0 && cellEntryLen > (currTdInfo.leftOverTdTxtLen - OVERHEAD_LEN_MID)){ + isDeleteAccepted = true; + } + + }catch(error){ + isDeleteAccepted = false; + } + return isDeleteAccepted; } - function doDeleteKey(optEvt) { var evt = optEvt || {}; var handled = false; if (rep.selStart) + if(!isTblCellDeleteOk()){return;} { if (isCaret()) { @@ -5731,6 +5826,355 @@ function OUTER(gscope) } } + + +var OVERHEAD_LEN_PRE = '{"payload":[["'.length; +var OVERHEAD_LEN_MID = '","'.length; +var OVERHEAD_LEN_ROW_START = '["'.length; +var OVERHEAD_LEN_ROW_END = '"],'.length; + + +/* Helper function. not meant to be used as a standalone function + requires rowStartOffset + */ +function _getRowEndOffset(rowStartOffset,tds){ + var rowEndOffset = rowStartOffset+OVERHEAD_LEN_ROW_START; + for(var i =0,len=tds.length;i=payloadOffset){ + if(payloadSum==payloadOffset){ + tIndex++; + } + var leftOverTdTxtLen = payloadSum - payloadOffset==0?table[rIndex][tIndex].length+OVERHEAD_LEN_MID:payloadSum - payloadOffset; + var cellCaretPos = tds[tIndex].length - (leftOverTdTxtLen - overHeadLen); + var rowEndOffset = _getRowEndOffset(rowStartOffset ,tds) ; + return { + row:rIndex, + td:tIndex, + leftOverTdTxtLen:leftOverTdTxtLen, + rowStartOffset:rowStartOffset, + rowEndOffset:rowEndOffset, + cellStartOffset:payloadSum - tds[tIndex].length - overHeadLen, + cellEndOffset:payloadSum, + cellCaretPos:cellCaretPos + }; + } + } + rowStartOffset =payloadSum; + payloadSum += OVERHEAD_LEN_ROW_START; + } +} +/* handles tab key within a table */ +function performDocumentTableTabKey() { + var newText = ""; + var currLine = rep.lines.atIndex(rep.selStart[0]); + var currLineText = currLine.text; + try { + var payload = JSON.parse(currLineText).payload; + var currTdInfo = getFocusedTdInfo(payload); + var leftOverTdTxtLen = currTdInfo.leftOverTdTxtLen; + var currRow = currTdInfo.row; + var currTd = currTdInfo.td; + var nextTdTxtLen = 0; + if (typeof (payload[currRow][currTd + 1]) == "undefined") { //next row + currRow += 1; + if (typeof (payload[currRow]) == "undefined") { //create new row and move caret to this new row + newText = createRowText(payload); + var endOfPayloadOffset = currLineText.indexOf('],"tblId"'); + rep.selStart[1] = rep.selStart[1] = rep.selEnd[1] = endOfPayloadOffset; + newText = "," + newText; + performDocumentReplaceRange(rep.selStart, rep.selEnd, newText); + rep.selStart[1] = rep.selStart[1] = rep.selEnd[1] = endOfPayloadOffset + OVERHEAD_LEN_ROW_START + 1; + newText = ""; + currTd = -1; + + } else { //just move caret to existing next row + currTd = -1; + leftOverTdTxtLen += OVERHEAD_LEN_ROW_START; + } + } + nextTdTxtLen = typeof (payload[currRow]) == 'undefined' ? -leftOverTdTxtLen : payload[currRow][currTd + 1].length; + rep.selStart[1] = rep.selEnd[1] = rep.selEnd[1] + nextTdTxtLen + leftOverTdTxtLen; + performDocumentReplaceRange(rep.selStart, rep.selEnd, newText); + } catch (error) { + performDocumentReplaceRange(rep.selStart, rep.selEnd, tempErrorMessage); + } +} + + + //tbl functions + + function isFocusWithinTbl(){ + var currLineText = rep.lines.atIndex(rep.selStart[0]).text; + if (currLineText.indexOf("data-tables") == -1) { + return false; + } + return true; + } + editorInfo.ace_isFocusWithinTbl = isFocusWithinTbl; + function doInsertOrDeleteTableRowCol(cmd, xByY) { + switch (cmd) { + case OPTIONS_TBL[0]:addTable(xByY);break; + case OPTIONS_TBL[1]:insertTblRow("addA");break; + case OPTIONS_TBL[2]:insertTblRow("addB");break; + case OPTIONS_TBL[3]:insertTblColumn("addL");break; + case OPTIONS_TBL[4]:insertTblColumn("addR");break; + case OPTIONS_TBL[5]:deleteTable();break; + case OPTIONS_TBL[6]:deleteTblRow();break; + case OPTIONS_TBL[7]:deleteColumn();break; + } + } +editorInfo.ace_doInsertOrDeleteTableRowCol = doInsertOrDeleteTableRowCol; + +function addTable(tableObj) { + var currLineText = rep.lines.atIndex(rep.selStart[0]).text; + //if the carret is within a table, add the new table at the bottom + if (currLineText.indexOf("data-tables") != -1) { + rep.selEnd[1] = rep.selStart[1] = currLineText.length; + doReturnKey('insertTable'); + doReturnKey('insertTable'); + } + //if no col/row specified, create a default 3X3 empty table + if (tableObj == null) { + tableObj = { + "payload": [ + [" ", " ", " "], + [" ", " ", " "], + [" ", " ", " "], ], + "tblId": 1, + "tblClass": "data-tables", + "trClass": "alst", + "tdClass": "hide-el", + "cellAttr": [] + } + } + //xbyy cols and rows have been specified or an actual payload object is present, for the former, create the payload of such size. + xByYSelect = typeof (tableObj) == "object" ? null : tableObj.split("X"); + if (xByYSelect != null && xByYSelect.length == 3) { + var cols = parseInt(xByYSelect[1]); + var rows = parseInt(xByYSelect[2]); + tableObj = { + "payload": [], + "tblId": 1, + "tblClass": "data-tables", + "trClass": "alst", + "tdClass": "hide-el", + "cellAttr": [] + } + var payload = []; + for (var i = 0; i < rows; i++) { + colsArr = []; + for (var j = 0; j < cols; j++) { + colsArr[j] = " "; + } + payload[i] = colsArr; + } + tableObj.payload = payload; + } + var newText = JSON.stringify(tableObj); + var start = rep.selStart[1]; + performDocumentReplaceRange(rep.selStart, rep.selEnd, newText); + //position the caret to the cell 0. + rep.selEnd[1] = rep.selStart[1] = start + OVERHEAD_LEN_PRE; + performDocumentReplaceRange(rep.selStart, rep.selEnd, ""); + return newText; +} +editorInfo.ace_addTable = addTable; + +//delete a table, also removes table overhead +function deleteTable(){ + try{ + rep.selStart[1] = 0; + rep.selEnd[1] = rep.lines.atIndex(rep.selStart[0]).text.length; + performDocumentReplaceRange(rep.selStart, rep.selEnd, ""); + }catch(error){ + performDocumentReplaceRange(rep.selStart, rep.selEnd, tempErrorMessage); + } +} + +//insert a row +function insertTblRow(aboveOrBelow) { + try { + var newText = ""; + var currLineText = rep.lines.atIndex(rep.selStart[0]).text; + var payload = JSON.parse(currLineText).payload; + var currTdInfo = getFocusedTdInfo(payload); + var currRow = currTdInfo.row; + var lastRowOffSet = 0; + if (aboveOrBelow == 'addA') { + newText = createRowText(payload) + ","; + rep.selStart[1] = rep.selEnd[1] = OVERHEAD_LEN_PRE + currTdInfo.rowStartOffset; + if (currRow == 0) { //first row has special rowStartOffset + // because the OVERHEAD_LEN_PRE constant also includes the the starting bracket and quote of the payload, we must subtract by 2. + rep.selStart[1] = rep.selEnd[1] = OVERHEAD_LEN_PRE + currTdInfo.rowStartOffset - 2; + } + } else { //below curr row ( aboveOrBelow = 'addB') + newText = createRowText(payload); + rep.selStart[1] = rep.selEnd[1] = OVERHEAD_LEN_PRE + currTdInfo.rowEndOffset; + if (currRow == 0 && typeof (payload[currRow + 1]) == "undefined") { //only one existed + rep.selStart[1] = rep.selEnd[1] = OVERHEAD_LEN_PRE + currTdInfo.rowEndOffset - 3; + newText = "," + newText; + } else if (currRow == 0) { //first row has special rowStartOffset + rep.selStart[1] = rep.selEnd[1] = OVERHEAD_LEN_PRE + currTdInfo.rowEndOffset - 2; + newText = newText + ","; + } else if (typeof (payload[currRow + 1]) == "undefined") { //last row has special rowEndOffset + rep.selStart[1] = rep.selEnd[1] = OVERHEAD_LEN_PRE + currTdInfo.rowEndOffset - 1; + newText = "," + newText; + lastRowOffSet = 1; + } else { //for new row between existing rows + newText = newText + ","; + } + } + performDocumentReplaceRange(rep.selStart, rep.selEnd, newText); + //fix caret + rep.selStart[1] = rep.selEnd[1] = rep.selEnd[1] - newText.length + OVERHEAD_LEN_ROW_START + lastRowOffSet; + newText = ""; + performDocumentReplaceRange(rep.selStart, rep.selEnd, newText); + } catch (error) { + performDocumentReplaceRange(rep.selStart, rep.selEnd, tempErrorMessage); + } +} + +//delete a row +function deleteTblRow() { + try { + var currLineText = rep.lines.atIndex(rep.selStart[0]).text; + var payload = JSON.parse(currLineText).payload; + var currTdInfo = getFocusedTdInfo(payload); + var currRow = currTdInfo.row; + var caretOffSet = 0; //for updating caret position + //delete middle rows + if (currRow != 0 && typeof (payload[currRow + 1]) != "undefined") { + rep.selStart[1] = OVERHEAD_LEN_PRE + currTdInfo.rowStartOffset; + rep.selEnd[1] = OVERHEAD_LEN_PRE + currTdInfo.rowEndOffset; + caretOffSet = OVERHEAD_LEN_ROW_START; + } + //only one row is present, delete the entire table, including overhead + else if (currRow == 0 && typeof (payload[currRow + 1]) == "undefined") { + rep.selStart[1] = 0; + rep.selEnd[1] = currLineText.length; + } + //delete first or last row + else { + rep.selStart[1] = OVERHEAD_LEN_PRE + currTdInfo.rowStartOffset - 1; + rep.selEnd[1] = OVERHEAD_LEN_PRE + currTdInfo.rowEndOffset - 1; + caretOffSet = -OVERHEAD_LEN_ROW_END; + } + performDocumentReplaceRange(rep.selStart, rep.selEnd, ""); + rep.selEnd[1] = rep.selStart[1] = rep.selStart[1] + caretOffSet; + performDocumentReplaceRange(rep.selStart, rep.selEnd, ""); + } catch (error) { + performDocumentReplaceRange(rep.selStart, rep.selEnd, tempErrorMessage); + } +} + + +//insert a column...not the most efficient implementation...resets entire table string +function insertTblColumn(leftOrRight){ + try{ + var currLineText = rep.lines.atIndex(rep.selStart[0]).text; + var tblJSONObj = JSON.parse(currLineText); + var payload = tblJSONObj.payload; + var currTdInfo = getFocusedTdInfo(payload); + var currRow = currTdInfo.row; + var currTd = currTdInfo.td; + if(leftOrRight=="addR"){ + currTd += 1; + } + tblJSONObj.payload =tblJSONObj.payload = updatePayload(payload,currTd,'add');; + var originalSelStart = rep.selStart[1]; + rep.selStart[1] = 0; + rep.selEnd[1] = currLineText.length; + performDocumentReplaceRange(rep.selStart, rep.selEnd, JSON.stringify(tblJSONObj)); + //update caret position + rep.selStart[1] = rep.selEnd[1]=originalSelStart + currTdInfo.leftOverTdTxtLen; + performDocumentReplaceRange(rep.selStart, rep.selEnd, ""); + }catch(error){ + performDocumentReplaceRange(rep.selStart, rep.selEnd, tempErrorMessage); + } +} +function updatePayload(payload, currTd, addOrDel) { + for (var rIndex = 0, rLen = payload.length; rIndex < rLen; rIndex++) { + var row = payload[rIndex]; + if (addOrDel == 'add') {//insert column + row.splice(currTd, 0, " "); + } else { //remove column + row.splice(currTd, 1); + } + payload[rIndex] = row; + } + return payload; +} + +function deleteColumn() { + try { + var currLineText = rep.lines.atIndex(rep.selStart[0]).text; + var tblJSONObj = JSON.parse(currLineText); + var payload = tblJSONObj.payload; + var currTdInfo = getFocusedTdInfo(payload); + var currRow = currTdInfo.row; + var currTd = currTdInfo.td; + tblJSONObj.payload = updatePayload(payload,currTd,'del'); + rep.selStart[1] = 0; + rep.selEnd[1] = currLineText.length; + performDocumentReplaceRange(rep.selStart, rep.selEnd, JSON.stringify(tblJSONObj)); + //update caret position + rep.selStart[1] = rep.selEnd[1] = OVERHEAD_LEN_PRE; + performDocumentReplaceRange(rep.selStart, rep.selEnd, ""); + + } catch (error) { + performDocumentReplaceRange(rep.selStart, rep.selEnd, tempErrorMessage); + } +} + +function createRowText(payload) { + var rowText = ""; + var numOfTdTags = typeof (payload) == "undefined" ? 2 : payload[0].length; + if (numOfTdTags <= 0) { + rowText = '[" "," "," "]'; + } else { + var rowText = "["; + for (var i = 0; i < numOfTdTags; i++) { + rowText += "\" \""; + if (i < numOfTdTags - 1) { + rowText += ","; + } + } + rowText += "]"; + } + return rowText; +} + }; OUTER(this); diff --git a/static/js/contentcollector.js b/static/js/contentcollector.js index 69036ba2560..26d0e4d485f 100644 --- a/static/js/contentcollector.js +++ b/static/js/contentcollector.js @@ -80,15 +80,19 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class }; var _blockElems = { - "div": 1, + "div": 1, "p": 1, "pre": 1, "li": 1 }; function isBlockElement(n) - { - return !!_blockElems[(dom.nodeTagName(n) || "").toLowerCase()]; + { + /*tAttr = dom.nodeAttr(n,'value'); + if(tAttr == null || tAttr!='tblBreak'){ + return !!_blockElems[(dom.nodeTagName(n) || "").toLowerCase()]; + }*/ + return !!_blockElems[(dom.nodeTagName(n) || "").toLowerCase()];; } function textify(str) @@ -430,9 +434,12 @@ function makeContentCollector(collectStyles, browser, apool, domInterface, class else { var tname = (dom.nodeTagName(node) || "").toLowerCase(); - if (tname == "br") - { + if (tname == "br") + { + tAttr = dom.nodeAttr(node,'value'); + if(tAttr == null || tAttr!='tblBreak'){ cc.startNewLine(state); + } } else if (tname == "script" || tname == "style") { diff --git a/static/js/domline.js b/static/js/domline.js index 56f74a1cd00..ad863793922 100644 --- a/static/js/domline.js +++ b/static/js/domline.js @@ -164,14 +164,26 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) } extraOpenTags = extraOpenTags + ''; extraCloseTags = '' + extraCloseTags; + html.push('', extraOpenTags, perTextNodeProcess(domline.escapeHTML(txt)), extraCloseTags, ''); } - if (simpleTags) + else if(txt.indexOf("data-tables")!=-1){ + try{ + tblJSONObj = JSON.parse(txt); + var htmlTbl = buildText(tblJSONObj); + html.push('',htmlTbl, perTextNodeProcess(""), ''); + }catch(error){ + html.push('',"hmm...something went wrong. ctrl-z is the best thing a man could have. Reporting it to WLOS developers is the 2nd best thing!", perTextNodeProcess(""), ''); + } + } + else if (simpleTags) { simpleTags.sort(); extraOpenTags = extraOpenTags + '<' + simpleTags.join('><') + '>'; simpleTags.reverse(); extraCloseTags = '' + extraCloseTags; + html.push('', extraOpenTags, perTextNodeProcess(domline.escapeHTML(txt)), extraCloseTags, ''); } + else html.push('', extraOpenTags, perTextNodeProcess(domline.escapeHTML(txt)), extraCloseTags, ''); } }; @@ -182,6 +194,63 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) result.lineMarker = 0; }; + function buildText(tblJSONObj){ + var htmlTbl = ""; + var tblId = tblJSONObj.tblId; + var tblClass = tblJSONObj.tblClass; + var tdClass = tblJSONObj.tdClass; + var trClass = tblJSONObj.trClass; + var payload = tblJSONObj.payload; + var cellAttr = tblJSONObj.cellAttr; + var htmlTbl = ""; + + var rows = tblJSONObj.payload; + for (var j = 0, rl = rows.length; j < rl; j++) { + var tds = rows[j]; + trClassName = ""; + if(j % 2 == 0){ + trClassName = "alt"; + } + htmlTbl += ""; + var preHeader = ""; + if(j==0){ + preHeader = "{\"payload\":[" + } + htmlTbl += ""; + for (var i = 0, tl = tds.length; i < tl; i++) { + var quoteAndComma = ",\""; + var bracketAndcomma = ""; + if(i==tl-1){ + quoteAndComma = ""; + bracketAndcomma = "],"; + if(j==rl-1){ + bracketAndcomma = "]],\"tblId\":\""+tblId+"\",\"tblClass\":\""+tblClass+"\",\"trClass\":\""+trClass+"\",\"tdClass\":\""+tdClass+"\",\"cellAttr\":"+JSON.stringify(cellAttr)+"}"; + } + } + var allCellAttrs = typeof(cellAttr[j])=='undefined'||cellAttr[j]==null?null:cellAttr[j][i]; + if(allCellAttrs == null || typeof(allCellAttrs) == 'undefined'){ + htmlTbl += ""; + } + else{ + cellsWithBr = ""; + var tdText = tds[i]; + for(var k =0;k"; + } + } + htmlTbl += ""; + } + htmlTbl += "
" +preHeader+ "[\"" + "" + domline.escapeHTML(tds[i]+"") + "
\"" + quoteAndComma + bracketAndcomma + "\"" + quoteAndComma + bracketAndcomma + "
"; + return htmlTbl; + }; function writeHTML() { var newHTML = perHtmlLineProcess(html.join('')); diff --git a/static/js/domline_client.js b/static/js/domline_client.js index a152412c967..5903145a61f 100644 --- a/static/js/domline_client.js +++ b/static/js/domline_client.js @@ -156,18 +156,57 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) } else if (txt) { - if (href) + if (href) { + if(!~href.indexOf("http")) // if the url doesn't include http or https etc prefix it. + { + href = "http://"+href; + } extraOpenTags = extraOpenTags + ''; extraCloseTags = '' + extraCloseTags; + html.push('', extraOpenTags, perTextNodeProcess(domline.escapeHTML(txt)), extraCloseTags, ''); + } + else if (txt.indexOf("$")!=-1) + { + var delTr = "%"; + var delTd = "$"; + var htmlTbl = ""; + + var rows = txt.split(delTr); + for(var j=0;j"; + } + + htmlTbl += ""; + htmlTbl += ""; + } + + htmlTbl += "
"+delTd+"
"+delTr+"
"; + html.push('',htmlTbl, perTextNodeProcess(""), ''); } - if (simpleTags) + else if(txt.indexOf("data-tables")!=-1){ + try{ + tblJSONObj = JSON.parse(txt); + var htmlTbl = buildText(tblJSONObj); + html.push('',htmlTbl, perTextNodeProcess(""), ''); + }catch(error){ + //failed to jsonfiy + } + } + else if (simpleTags) { simpleTags.sort(); extraOpenTags = extraOpenTags + '<' + simpleTags.join('><') + '>'; simpleTags.reverse(); extraCloseTags = '' + extraCloseTags; + html.push('', extraOpenTags, perTextNodeProcess(domline.escapeHTML(txt)), extraCloseTags, ''); } + else html.push('', extraOpenTags, perTextNodeProcess(domline.escapeHTML(txt)), extraCloseTags, ''); } }; @@ -177,7 +216,44 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) lineClass = ''; // non-null to cause update result.lineMarker = 0; }; - + function buildText(tblJSONObj){ + var htmlTbl = ""; + var tblId = tblJSONObj.tblId; + var tblClass = tblJSONObj.tblClass; + var tdClass = tblJSONObj.tdClass; + var trClass = tblJSONObj.trClass; + var payload = tblJSONObj.payload; + var htmlTbl = ""; + var rows = tblJSONObj.payload; + for (var j = 0, rl = rows.length; j < rl; j++) { + var tds = rows[j]; + trClassName = ""; + if(j % 2 == 0){ + trClassName = "alt"; + } + htmlTbl += ""; + var preHeader = ""; + if(j==0){ + preHeader = "{\"payload\":[" + } + htmlTbl += ""; + for (var i = 0, tl = tds.length; i < tl; i++) { + var quoteAndComma = ",\""; + var bracketAndcomma = ""; + if(i==tl-1){ + quoteAndComma = ""; + bracketAndcomma = "],"; + if(j==rl-1){ + bracketAndcomma = "]],\"tblId\":\""+tblId+"\",\"tblClass\":\""+tblClass+"\",\"trClass\":\""+trClass+"\",\"tdClass\":\""+tdClass+"\"}"; + } + } + htmlTbl += ""; + } + htmlTbl += ""; + } + htmlTbl += "
" +preHeader+ "[\"" + "" + domline.escapeHTML(tds[i]+"") + "\"" + quoteAndComma + bracketAndcomma + "
"; + return htmlTbl; + }; function writeHTML() { var newHTML = perHtmlLineProcess(html.join('')); diff --git a/static/js/linestylefilter.js b/static/js/linestylefilter.js index 9164d42f01d..6b4f641807b 100644 --- a/static/js/linestylefilter.js +++ b/static/js/linestylefilter.js @@ -143,7 +143,8 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun // prevent infinite loop if something funny's going on return nextAfterAuthorColors(txt, cls); } - var spanSize = txt.length; + var spanSize = leftInAuthor = txt.length; + //var spanSize = txt.length; if (spanSize > leftInAuthor) { spanSize = leftInAuthor; diff --git a/static/js/linestylefilter_client.js b/static/js/linestylefilter_client.js index 69c3f124248..961ca4d60f2 100644 --- a/static/js/linestylefilter_client.js +++ b/static/js/linestylefilter_client.js @@ -141,7 +141,8 @@ linestylefilter.getLineStyleFilter = function(lineLength, aline, textAndClassFun // prevent infinite loop if something funny's going on return nextAfterAuthorColors(txt, cls); } - var spanSize = txt.length; + var spanSize = leftInAuthor = txt.length; + //var spanSize = txt.length; if (spanSize > leftInAuthor) { spanSize = leftInAuthor; diff --git a/static/js/pad2.js b/static/js/pad2.js index b75c1f9cc71..8fbd26cc5ee 100644 --- a/static/js/pad2.js +++ b/static/js/pad2.js @@ -658,6 +658,9 @@ var pad = { padeditbar.toolbarClick(cmd); } }, + isFocusWithinTbl:function (){ + padeditbar.toolbarClick('isFocusWithinTbl'); + }, dmesg: function(m) { if (pad.getIsDebugEnabled()) diff --git a/static/js/pad_editbar.js b/static/js/pad_editbar.js index 9de23f82e27..17d43aec878 100644 --- a/static/js/pad_editbar.js +++ b/static/js/pad_editbar.js @@ -96,6 +96,7 @@ var padeditbar = (function() { $("#editbar").addClass('disabledtoolbar').removeClass("enabledtoolbar"); }, + toolbarClick: function(cmd) { if (self.isEnabled()) @@ -123,8 +124,19 @@ var padeditbar = (function() { padeditor.ace.callWithAce(function(ace) { - if (cmd == 'bold' || cmd == 'italic' || cmd == 'underline' || cmd == 'strikethrough') ace.ace_toggleAttributeOnSelection(cmd); + var OPTIONS_TBL = ['addTbl','addTblRowA','addTblRowB','addTblColL','addTblColR','delTbl','delTblRow','delTblCol']; + if(typeof(cmd.payload)!='undefined'){ace.ace_addTable(cmd);} + else if (cmd == 'bold' || cmd == 'italic' || cmd == 'underline' || cmd == 'strikethrough') ace.ace_toggleAttributeOnSelection(cmd); else if (cmd == 'undo' || cmd == 'redo') ace.ace_doUndoRedo(cmd); + else if (cmd == 'isFocusWithinTbl'){ padeditor.isFocusWithinTbl = ace.ace_isFocusWithinTbl();} + else if (cmd !=null){ + if($.inArray(cmd,OPTIONS_TBL) != -1){ + ace.ace_doInsertOrDeleteTableRowCol(cmd); + } + else if(cmd.indexOf('addTbl') != -1){ + ace.ace_doInsertOrDeleteTableRowCol('addTbl',cmd); + } + } else if (cmd == 'insertunorderedlist') ace.ace_doInsertUnorderedList(); else if (cmd == 'indent') { diff --git a/static/js/pad_editor.js b/static/js/pad_editor.js index 183de948df0..89a1563f061 100644 --- a/static/js/pad_editor.js +++ b/static/js/pad_editor.js @@ -146,7 +146,10 @@ var padeditor = (function() { pad.addHistoricalAuthors(dataFromServer.historicalAuthorData); self.ace.importAText(dataFromServer.atext, dataFromServer.apool, true); - } + }, + hideTblContextMenu:function(){ + $.tblContextMenu.hide(); + } }; return self; }()); diff --git a/static/pad.html b/static/pad.html index 146d39cf180..dc802046b50 100644 --- a/static/pad.html +++ b/static/pad.html @@ -4,23 +4,34 @@ Etherpad Lite - + + + - + + + + + + - - + +
+