Show More
@@ -1,973 +1,976 b'' | |||
|
1 | 1 | article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;} |
|
2 | 2 | audio,canvas,video{display:inline-block;*display:inline;*zoom:1;} |
|
3 | 3 | audio:not([controls]){display:none;} |
|
4 | 4 | html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;} |
|
5 | 5 | a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} |
|
6 | 6 | a:hover,a:active{outline:0;} |
|
7 | 7 | sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline;} |
|
8 | 8 | sup{top:-0.5em;} |
|
9 | 9 | sub{bottom:-0.25em;} |
|
10 | 10 | img{max-width:100%;width:auto\9;height:auto;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic;} |
|
11 | 11 | #map_canvas img,.google-maps img{max-width:none;} |
|
12 | 12 | button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;} |
|
13 | 13 | button,input{*overflow:visible;line-height:normal;} |
|
14 | 14 | button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0;} |
|
15 | 15 | button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;} |
|
16 | 16 | label,select,button,input[type="button"],input[type="reset"],input[type="submit"],input[type="radio"],input[type="checkbox"]{cursor:pointer;} |
|
17 | 17 | input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield;} |
|
18 | 18 | input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none;} |
|
19 | 19 | textarea{overflow:auto;vertical-align:top;} |
|
20 | 20 | @media print{*{text-shadow:none !important;color:#000 !important;background:transparent !important;box-shadow:none !important;} a,a:visited{text-decoration:underline;} a[href]:after{content:" (" attr(href) ")";} abbr[title]:after{content:" (" attr(title) ")";} .ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:"";} pre,blockquote{border:1px solid #999;page-break-inside:avoid;} thead{display:table-header-group;} tr,img{page-break-inside:avoid;} img{max-width:100% !important;} @page {margin:0.5cm;}p,h2,h3{orphans:3;widows:3;} h2,h3{page-break-after:avoid;}}.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0;} |
|
21 | 21 | .clearfix:after{clear:both;} |
|
22 | 22 | .hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;} |
|
23 | 23 | .input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} |
|
24 | 24 | body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:20px;color:#000000;background-color:#ffffff;} |
|
25 | 25 | a{color:#0088cc;text-decoration:none;} |
|
26 | 26 | a:hover{color:#005580;text-decoration:underline;} |
|
27 | 27 | .img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} |
|
28 | 28 | .img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.2);-webkit-box-shadow:0 1px 3px rgba(0, 0, 0, 0.1);-moz-box-shadow:0 1px 3px rgba(0, 0, 0, 0.1);box-shadow:0 1px 3px rgba(0, 0, 0, 0.1);} |
|
29 | 29 | .img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px;} |
|
30 | 30 | .row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:"";line-height:0;} |
|
31 | 31 | .row:after{clear:both;} |
|
32 | 32 | [class*="span"]{float:left;min-height:1px;margin-left:20px;} |
|
33 | 33 | .container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;} |
|
34 | 34 | .span12{width:940px;} |
|
35 | 35 | .span11{width:860px;} |
|
36 | 36 | .span10{width:780px;} |
|
37 | 37 | .span9{width:700px;} |
|
38 | 38 | .span8{width:620px;} |
|
39 | 39 | .span7{width:540px;} |
|
40 | 40 | .span6{width:460px;} |
|
41 | 41 | .span5{width:380px;} |
|
42 | 42 | .span4{width:300px;} |
|
43 | 43 | .span3{width:220px;} |
|
44 | 44 | .span2{width:140px;} |
|
45 | 45 | .span1{width:60px;} |
|
46 | 46 | .offset12{margin-left:980px;} |
|
47 | 47 | .offset11{margin-left:900px;} |
|
48 | 48 | .offset10{margin-left:820px;} |
|
49 | 49 | .offset9{margin-left:740px;} |
|
50 | 50 | .offset8{margin-left:660px;} |
|
51 | 51 | .offset7{margin-left:580px;} |
|
52 | 52 | .offset6{margin-left:500px;} |
|
53 | 53 | .offset5{margin-left:420px;} |
|
54 | 54 | .offset4{margin-left:340px;} |
|
55 | 55 | .offset3{margin-left:260px;} |
|
56 | 56 | .offset2{margin-left:180px;} |
|
57 | 57 | .offset1{margin-left:100px;} |
|
58 | 58 | .row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";line-height:0;} |
|
59 | 59 | .row-fluid:after{clear:both;} |
|
60 | 60 | .row-fluid [class*="span"]{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;} |
|
61 | 61 | .row-fluid [class*="span"]:first-child{margin-left:0;} |
|
62 | 62 | .row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.127659574468085%;} |
|
63 | 63 | .row-fluid .span12{width:100%;*width:99.94680851063829%;} |
|
64 | 64 | .row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%;} |
|
65 | 65 | .row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%;} |
|
66 | 66 | .row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%;} |
|
67 | 67 | .row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%;} |
|
68 | 68 | .row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%;} |
|
69 | 69 | .row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%;} |
|
70 | 70 | .row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%;} |
|
71 | 71 | .row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%;} |
|
72 | 72 | .row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%;} |
|
73 | 73 | .row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%;} |
|
74 | 74 | .row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%;} |
|
75 | 75 | .row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%;} |
|
76 | 76 | .row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%;} |
|
77 | 77 | .row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%;} |
|
78 | 78 | .row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%;} |
|
79 | 79 | .row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%;} |
|
80 | 80 | .row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%;} |
|
81 | 81 | .row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%;} |
|
82 | 82 | .row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%;} |
|
83 | 83 | .row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%;} |
|
84 | 84 | .row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%;} |
|
85 | 85 | .row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%;} |
|
86 | 86 | .row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%;} |
|
87 | 87 | .row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%;} |
|
88 | 88 | .row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%;} |
|
89 | 89 | .row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%;} |
|
90 | 90 | .row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%;} |
|
91 | 91 | .row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%;} |
|
92 | 92 | .row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%;} |
|
93 | 93 | .row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%;} |
|
94 | 94 | .row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%;} |
|
95 | 95 | .row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%;} |
|
96 | 96 | .row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%;} |
|
97 | 97 | .row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%;} |
|
98 | 98 | .row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%;} |
|
99 | 99 | [class*="span"].hide,.row-fluid [class*="span"].hide{display:none;} |
|
100 | 100 | [class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right;} |
|
101 | 101 | .container{margin-right:auto;margin-left:auto;*zoom:1;}.container:before,.container:after{display:table;content:"";line-height:0;} |
|
102 | 102 | .container:after{clear:both;} |
|
103 | 103 | .container-fluid{padding-right:20px;padding-left:20px;*zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";line-height:0;} |
|
104 | 104 | .container-fluid:after{clear:both;} |
|
105 | 105 | p{margin:0 0 10px;} |
|
106 | 106 | .lead{margin-bottom:20px;font-size:19.5px;font-weight:200;line-height:30px;} |
|
107 | 107 | small{font-size:85%;} |
|
108 | 108 | strong{font-weight:bold;} |
|
109 | 109 | em{font-style:italic;} |
|
110 | 110 | cite{font-style:normal;} |
|
111 | 111 | .muted{color:#999999;} |
|
112 | 112 | a.muted:hover{color:#808080;} |
|
113 | 113 | .text-warning{color:#c09853;} |
|
114 | 114 | a.text-warning:hover{color:#a47e3c;} |
|
115 | 115 | .text-error{color:#b94a48;} |
|
116 | 116 | a.text-error:hover{color:#953b39;} |
|
117 | 117 | .text-info{color:#3a87ad;} |
|
118 | 118 | a.text-info:hover{color:#2d6987;} |
|
119 | 119 | .text-success{color:#468847;} |
|
120 | 120 | a.text-success:hover{color:#356635;} |
|
121 | 121 | h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:20px;color:inherit;text-rendering:optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999999;} |
|
122 | 122 | h1,h2,h3{line-height:40px;} |
|
123 | 123 | h1{font-size:35.75px;} |
|
124 | 124 | h2{font-size:29.25px;} |
|
125 | 125 | h3{font-size:22.75px;} |
|
126 | 126 | h4{font-size:16.25px;} |
|
127 | 127 | h5{font-size:13px;} |
|
128 | 128 | h6{font-size:11.049999999999999px;} |
|
129 | 129 | h1 small{font-size:22.75px;} |
|
130 | 130 | h2 small{font-size:16.25px;} |
|
131 | 131 | h3 small{font-size:13px;} |
|
132 | 132 | h4 small{font-size:13px;} |
|
133 | 133 | .page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eeeeee;} |
|
134 | 134 | ul,ol{padding:0;margin:0 0 10px 25px;} |
|
135 | 135 | ul ul,ul ol,ol ol,ol ul{margin-bottom:0;} |
|
136 | 136 | li{line-height:20px;} |
|
137 | 137 | ul.unstyled,ol.unstyled{margin-left:0;list-style:none;} |
|
138 | 138 | ul.inline,ol.inline{margin-left:0;list-style:none;}ul.inline>li,ol.inline>li{display:inline-block;padding-left:5px;padding-right:5px;} |
|
139 | 139 | dl{margin-bottom:20px;} |
|
140 | 140 | dt,dd{line-height:20px;} |
|
141 | 141 | dt{font-weight:bold;} |
|
142 | 142 | dd{margin-left:10px;} |
|
143 | 143 | .dl-horizontal{*zoom:1;}.dl-horizontal:before,.dl-horizontal:after{display:table;content:"";line-height:0;} |
|
144 | 144 | .dl-horizontal:after{clear:both;} |
|
145 | 145 | .dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} |
|
146 | 146 | .dl-horizontal dd{margin-left:180px;} |
|
147 | 147 | hr{margin:20px 0;border:0;border-top:1px solid #eeeeee;border-bottom:1px solid #ffffff;} |
|
148 | 148 | abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999999;} |
|
149 | 149 | abbr.initialism{font-size:90%;text-transform:uppercase;} |
|
150 | 150 | blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eeeeee;}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px;} |
|
151 | 151 | blockquote small{display:block;line-height:20px;color:#999999;}blockquote small:before{content:'\2014 \00A0';} |
|
152 | 152 | blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eeeeee;border-left:0;}blockquote.pull-right p,blockquote.pull-right small{text-align:right;} |
|
153 | 153 | blockquote.pull-right small:before{content:'';} |
|
154 | 154 | blockquote.pull-right small:after{content:'\00A0 \2014';} |
|
155 | 155 | q:before,q:after,blockquote:before,blockquote:after{content:"";} |
|
156 | 156 | address{display:block;margin-bottom:20px;font-style:normal;line-height:20px;} |
|
157 | 157 | form{margin:0 0 20px;} |
|
158 | 158 | fieldset{padding:0;margin:0;border:0;} |
|
159 | 159 | legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:19.5px;line-height:40px;color:#333333;border:0;border-bottom:1px solid #e5e5e5;}legend small{font-size:15px;color:#999999;} |
|
160 | 160 | label,input,button,select,textarea{font-size:13px;font-weight:normal;line-height:20px;} |
|
161 | 161 | input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;} |
|
162 | 162 | label{display:block;margin-bottom:5px;} |
|
163 | 163 | select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:13px;line-height:20px;color:#555555;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;vertical-align:middle;} |
|
164 | 164 | input,textarea,.uneditable-input{width:206px;} |
|
165 | 165 | textarea{height:auto;} |
|
166 | 166 | textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#ffffff;border:1px solid #cccccc;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-webkit-transition:border linear .2s, box-shadow linear .2s;-moz-transition:border linear .2s, box-shadow linear .2s;-o-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82, 168, 236, 0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);} |
|
167 | 167 | input[type="radio"],input[type="checkbox"]{margin:4px 0 0;*margin-top:0;margin-top:1px \9;line-height:normal;} |
|
168 | 168 | input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto;} |
|
169 | 169 | select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px;} |
|
170 | 170 | select{width:220px;border:1px solid #cccccc;background-color:#ffffff;} |
|
171 | 171 | select[multiple],select[size]{height:auto;} |
|
172 | 172 | select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} |
|
173 | 173 | .uneditable-input,.uneditable-textarea{color:#999999;background-color:#fcfcfc;border-color:#cccccc;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);cursor:not-allowed;} |
|
174 | 174 | .uneditable-input{overflow:hidden;white-space:nowrap;} |
|
175 | 175 | .uneditable-textarea{width:auto;height:auto;} |
|
176 | 176 | input:-moz-placeholder,textarea:-moz-placeholder{color:#999999;} |
|
177 | 177 | input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999999;} |
|
178 | 178 | input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999999;} |
|
179 | 179 | .radio,.checkbox{min-height:20px;padding-left:20px;} |
|
180 | 180 | .radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-20px;} |
|
181 | 181 | .controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px;} |
|
182 | 182 | .radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle;} |
|
183 | 183 | .radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px;} |
|
184 | 184 | .input-mini{width:60px;} |
|
185 | 185 | .input-small{width:90px;} |
|
186 | 186 | .input-medium{width:150px;} |
|
187 | 187 | .input-large{width:210px;} |
|
188 | 188 | .input-xlarge{width:270px;} |
|
189 | 189 | .input-xxlarge{width:530px;} |
|
190 | 190 | input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0;} |
|
191 | 191 | .input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block;} |
|
192 | 192 | input,textarea,.uneditable-input{margin-left:0;} |
|
193 | 193 | .controls-row [class*="span"]+[class*="span"]{margin-left:20px;} |
|
194 | 194 | input.span12, textarea.span12, .uneditable-input.span12{width:926px;} |
|
195 | 195 | input.span11, textarea.span11, .uneditable-input.span11{width:846px;} |
|
196 | 196 | input.span10, textarea.span10, .uneditable-input.span10{width:766px;} |
|
197 | 197 | input.span9, textarea.span9, .uneditable-input.span9{width:686px;} |
|
198 | 198 | input.span8, textarea.span8, .uneditable-input.span8{width:606px;} |
|
199 | 199 | input.span7, textarea.span7, .uneditable-input.span7{width:526px;} |
|
200 | 200 | input.span6, textarea.span6, .uneditable-input.span6{width:446px;} |
|
201 | 201 | input.span5, textarea.span5, .uneditable-input.span5{width:366px;} |
|
202 | 202 | input.span4, textarea.span4, .uneditable-input.span4{width:286px;} |
|
203 | 203 | input.span3, textarea.span3, .uneditable-input.span3{width:206px;} |
|
204 | 204 | input.span2, textarea.span2, .uneditable-input.span2{width:126px;} |
|
205 | 205 | input.span1, textarea.span1, .uneditable-input.span1{width:46px;} |
|
206 | 206 | .controls-row{*zoom:1;}.controls-row:before,.controls-row:after{display:table;content:"";line-height:0;} |
|
207 | 207 | .controls-row:after{clear:both;} |
|
208 | 208 | .controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left;} |
|
209 | 209 | .controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px;} |
|
210 | 210 | input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eeeeee;} |
|
211 | 211 | input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent;} |
|
212 | 212 | .control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853;} |
|
213 | 213 | .control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853;} |
|
214 | 214 | .control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #dbc59e;} |
|
215 | 215 | .control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853;} |
|
216 | 216 | .control-group.error .control-label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48;} |
|
217 | 217 | .control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48;} |
|
218 | 218 | .control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #d59392;} |
|
219 | 219 | .control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48;} |
|
220 | 220 | .control-group.success .control-label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847;} |
|
221 | 221 | .control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847;} |
|
222 | 222 | .control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #7aba7b;} |
|
223 | 223 | .control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847;} |
|
224 | 224 | .control-group.info .control-label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad;} |
|
225 | 225 | .control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad;} |
|
226 | 226 | .control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 6px #7ab5d3;} |
|
227 | 227 | .control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad;} |
|
228 | 228 | input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#b94a48;border-color:#ee5f5b;}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7;} |
|
229 | 229 | .form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1;}.form-actions:before,.form-actions:after{display:table;content:"";line-height:0;} |
|
230 | 230 | .form-actions:after{clear:both;} |
|
231 | 231 | .help-block,.help-inline{color:#262626;} |
|
232 | 232 | .help-block{display:block;margin-bottom:10px;} |
|
233 | 233 | .help-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding-left:5px;} |
|
234 | 234 | .input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap;}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu{font-size:13px;} |
|
235 | 235 | .input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2;} |
|
236 | 236 | .input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:13px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #ffffff;background-color:#eeeeee;border:1px solid #ccc;} |
|
237 | 237 | .input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn,.input-append .btn-group>.dropdown-toggle,.input-prepend .btn-group>.dropdown-toggle{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} |
|
238 | 238 | .input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546;} |
|
239 | 239 | .input-prepend .add-on,.input-prepend .btn{margin-right:-1px;} |
|
240 | 240 | .input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;} |
|
241 | 241 | .input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;}.input-append input+.btn-group .btn:last-child,.input-append select+.btn-group .btn:last-child,.input-append .uneditable-input+.btn-group .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;} |
|
242 | 242 | .input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px;} |
|
243 | 243 | .input-append .add-on:last-child,.input-append .btn:last-child,.input-append .btn-group:last-child>.dropdown-toggle{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;} |
|
244 | 244 | .input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.input-prepend.input-append input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;} |
|
245 | 245 | .input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;} |
|
246 | 246 | .input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;} |
|
247 | 247 | .input-prepend.input-append .btn-group:first-child{margin-left:0;} |
|
248 | 248 | input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;} |
|
249 | 249 | .form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} |
|
250 | 250 | .form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px;} |
|
251 | 251 | .form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0;} |
|
252 | 252 | .form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0;} |
|
253 | 253 | .form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px;} |
|
254 | 254 | .form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;*zoom:1;margin-bottom:0;vertical-align:middle;} |
|
255 | 255 | .form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none;} |
|
256 | 256 | .form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block;} |
|
257 | 257 | .form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0;} |
|
258 | 258 | .form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle;} |
|
259 | 259 | .form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0;} |
|
260 | 260 | .control-group{margin-bottom:10px;} |
|
261 | 261 | legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate;} |
|
262 | 262 | .form-horizontal .control-group{margin-bottom:20px;*zoom:1;}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;content:"";line-height:0;} |
|
263 | 263 | .form-horizontal .control-group:after{clear:both;} |
|
264 | 264 | .form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right;} |
|
265 | 265 | .form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0;}.form-horizontal .controls:first-child{*padding-left:180px;} |
|
266 | 266 | .form-horizontal .help-block{margin-bottom:0;} |
|
267 | 267 | .form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block,.form-horizontal .uneditable-input+.help-block,.form-horizontal .input-prepend+.help-block,.form-horizontal .input-append+.help-block{margin-top:10px;} |
|
268 | 268 | .form-horizontal .form-actions{padding-left:180px;} |
|
269 | 269 | table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0;} |
|
270 | 270 | .table{width:100%;margin-bottom:20px;}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #dddddd;} |
|
271 | 271 | .table th{font-weight:bold;} |
|
272 | 272 | .table thead th{vertical-align:bottom;} |
|
273 | 273 | .table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0;} |
|
274 | 274 | .table tbody+tbody{border-top:2px solid #dddddd;} |
|
275 | 275 | .table .table{background-color:#ffffff;} |
|
276 | 276 | .table-condensed th,.table-condensed td{padding:4px 5px;} |
|
277 | 277 | .table-bordered{border:1px solid #dddddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.table-bordered th,.table-bordered td{border-left:1px solid #dddddd;} |
|
278 | 278 | .table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0;} |
|
279 | 279 | .table-bordered thead:first-child tr:first-child>th:first-child,.table-bordered tbody:first-child tr:first-child>td:first-child{-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;} |
|
280 | 280 | .table-bordered thead:first-child tr:first-child>th:last-child,.table-bordered tbody:first-child tr:first-child>td:last-child{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;} |
|
281 | 281 | .table-bordered thead:last-child tr:last-child>th:first-child,.table-bordered tbody:last-child tr:last-child>td:first-child,.table-bordered tfoot:last-child tr:last-child>td:first-child{-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;} |
|
282 | 282 | .table-bordered thead:last-child tr:last-child>th:last-child,.table-bordered tbody:last-child tr:last-child>td:last-child,.table-bordered tfoot:last-child tr:last-child>td:last-child{-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;} |
|
283 | 283 | .table-bordered tfoot+tbody:last-child tr:last-child td:first-child{-webkit-border-bottom-left-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;} |
|
284 | 284 | .table-bordered tfoot+tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:0;-moz-border-radius-bottomright:0;border-bottom-right-radius:0;} |
|
285 | 285 | .table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;} |
|
286 | 286 | .table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;} |
|
287 | 287 | .table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f9f9f9;} |
|
288 | 288 | .table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5;} |
|
289 | 289 | table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span"],.row-fluid table th[class*="span"]{display:table-cell;float:none;margin-left:0;} |
|
290 | 290 | .table td.span1,.table th.span1{float:none;width:44px;margin-left:0;} |
|
291 | 291 | .table td.span2,.table th.span2{float:none;width:124px;margin-left:0;} |
|
292 | 292 | .table td.span3,.table th.span3{float:none;width:204px;margin-left:0;} |
|
293 | 293 | .table td.span4,.table th.span4{float:none;width:284px;margin-left:0;} |
|
294 | 294 | .table td.span5,.table th.span5{float:none;width:364px;margin-left:0;} |
|
295 | 295 | .table td.span6,.table th.span6{float:none;width:444px;margin-left:0;} |
|
296 | 296 | .table td.span7,.table th.span7{float:none;width:524px;margin-left:0;} |
|
297 | 297 | .table td.span8,.table th.span8{float:none;width:604px;margin-left:0;} |
|
298 | 298 | .table td.span9,.table th.span9{float:none;width:684px;margin-left:0;} |
|
299 | 299 | .table td.span10,.table th.span10{float:none;width:764px;margin-left:0;} |
|
300 | 300 | .table td.span11,.table th.span11{float:none;width:844px;margin-left:0;} |
|
301 | 301 | .table td.span12,.table th.span12{float:none;width:924px;margin-left:0;} |
|
302 | 302 | .table tbody tr.success td{background-color:#dff0d8;} |
|
303 | 303 | .table tbody tr.error td{background-color:#f2dede;} |
|
304 | 304 | .table tbody tr.warning td{background-color:#fcf8e3;} |
|
305 | 305 | .table tbody tr.info td{background-color:#d9edf7;} |
|
306 | 306 | .table-hover tbody tr.success:hover td{background-color:#d0e9c6;} |
|
307 | 307 | .table-hover tbody tr.error:hover td{background-color:#ebcccc;} |
|
308 | 308 | .table-hover tbody tr.warning:hover td{background-color:#faf2cc;} |
|
309 | 309 | .table-hover tbody tr.info:hover td{background-color:#c4e3f3;} |
|
310 | 310 | [class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat;margin-top:1px;} |
|
311 | 311 | .icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png");} |
|
312 | 312 | .icon-glass{background-position:0 0;} |
|
313 | 313 | .icon-music{background-position:-24px 0;} |
|
314 | 314 | .icon-search{background-position:-48px 0;} |
|
315 | 315 | .icon-envelope{background-position:-72px 0;} |
|
316 | 316 | .icon-heart{background-position:-96px 0;} |
|
317 | 317 | .icon-star{background-position:-120px 0;} |
|
318 | 318 | .icon-star-empty{background-position:-144px 0;} |
|
319 | 319 | .icon-user{background-position:-168px 0;} |
|
320 | 320 | .icon-film{background-position:-192px 0;} |
|
321 | 321 | .icon-th-large{background-position:-216px 0;} |
|
322 | 322 | .icon-th{background-position:-240px 0;} |
|
323 | 323 | .icon-th-list{background-position:-264px 0;} |
|
324 | 324 | .icon-ok{background-position:-288px 0;} |
|
325 | 325 | .icon-remove{background-position:-312px 0;} |
|
326 | 326 | .icon-zoom-in{background-position:-336px 0;} |
|
327 | 327 | .icon-zoom-out{background-position:-360px 0;} |
|
328 | 328 | .icon-off{background-position:-384px 0;} |
|
329 | 329 | .icon-signal{background-position:-408px 0;} |
|
330 | 330 | .icon-cog{background-position:-432px 0;} |
|
331 | 331 | .icon-trash{background-position:-456px 0;} |
|
332 | 332 | .icon-home{background-position:0 -24px;} |
|
333 | 333 | .icon-file{background-position:-24px -24px;} |
|
334 | 334 | .icon-time{background-position:-48px -24px;} |
|
335 | 335 | .icon-road{background-position:-72px -24px;} |
|
336 | 336 | .icon-download-alt{background-position:-96px -24px;} |
|
337 | 337 | .icon-download{background-position:-120px -24px;} |
|
338 | 338 | .icon-upload{background-position:-144px -24px;} |
|
339 | 339 | .icon-inbox{background-position:-168px -24px;} |
|
340 | 340 | .icon-play-circle{background-position:-192px -24px;} |
|
341 | 341 | .icon-repeat{background-position:-216px -24px;} |
|
342 | 342 | .icon-refresh{background-position:-240px -24px;} |
|
343 | 343 | .icon-list-alt{background-position:-264px -24px;} |
|
344 | 344 | .icon-lock{background-position:-287px -24px;} |
|
345 | 345 | .icon-flag{background-position:-312px -24px;} |
|
346 | 346 | .icon-headphones{background-position:-336px -24px;} |
|
347 | 347 | .icon-volume-off{background-position:-360px -24px;} |
|
348 | 348 | .icon-volume-down{background-position:-384px -24px;} |
|
349 | 349 | .icon-volume-up{background-position:-408px -24px;} |
|
350 | 350 | .icon-qrcode{background-position:-432px -24px;} |
|
351 | 351 | .icon-barcode{background-position:-456px -24px;} |
|
352 | 352 | .icon-tag{background-position:0 -48px;} |
|
353 | 353 | .icon-tags{background-position:-25px -48px;} |
|
354 | 354 | .icon-book{background-position:-48px -48px;} |
|
355 | 355 | .icon-bookmark{background-position:-72px -48px;} |
|
356 | 356 | .icon-print{background-position:-96px -48px;} |
|
357 | 357 | .icon-camera{background-position:-120px -48px;} |
|
358 | 358 | .icon-font{background-position:-144px -48px;} |
|
359 | 359 | .icon-bold{background-position:-167px -48px;} |
|
360 | 360 | .icon-italic{background-position:-192px -48px;} |
|
361 | 361 | .icon-text-height{background-position:-216px -48px;} |
|
362 | 362 | .icon-text-width{background-position:-240px -48px;} |
|
363 | 363 | .icon-align-left{background-position:-264px -48px;} |
|
364 | 364 | .icon-align-center{background-position:-288px -48px;} |
|
365 | 365 | .icon-align-right{background-position:-312px -48px;} |
|
366 | 366 | .icon-align-justify{background-position:-336px -48px;} |
|
367 | 367 | .icon-list{background-position:-360px -48px;} |
|
368 | 368 | .icon-indent-left{background-position:-384px -48px;} |
|
369 | 369 | .icon-indent-right{background-position:-408px -48px;} |
|
370 | 370 | .icon-facetime-video{background-position:-432px -48px;} |
|
371 | 371 | .icon-picture{background-position:-456px -48px;} |
|
372 | 372 | .icon-pencil{background-position:0 -72px;} |
|
373 | 373 | .icon-map-marker{background-position:-24px -72px;} |
|
374 | 374 | .icon-adjust{background-position:-48px -72px;} |
|
375 | 375 | .icon-tint{background-position:-72px -72px;} |
|
376 | 376 | .icon-edit{background-position:-96px -72px;} |
|
377 | 377 | .icon-share{background-position:-120px -72px;} |
|
378 | 378 | .icon-check{background-position:-144px -72px;} |
|
379 | 379 | .icon-move{background-position:-168px -72px;} |
|
380 | 380 | .icon-step-backward{background-position:-192px -72px;} |
|
381 | 381 | .icon-fast-backward{background-position:-216px -72px;} |
|
382 | 382 | .icon-backward{background-position:-240px -72px;} |
|
383 | 383 | .icon-play{background-position:-264px -72px;} |
|
384 | 384 | .icon-pause{background-position:-288px -72px;} |
|
385 | 385 | .icon-stop{background-position:-312px -72px;} |
|
386 | 386 | .icon-forward{background-position:-336px -72px;} |
|
387 | 387 | .icon-fast-forward{background-position:-360px -72px;} |
|
388 | 388 | .icon-step-forward{background-position:-384px -72px;} |
|
389 | 389 | .icon-eject{background-position:-408px -72px;} |
|
390 | 390 | .icon-chevron-left{background-position:-432px -72px;} |
|
391 | 391 | .icon-chevron-right{background-position:-456px -72px;} |
|
392 | 392 | .icon-plus-sign{background-position:0 -96px;} |
|
393 | 393 | .icon-minus-sign{background-position:-24px -96px;} |
|
394 | 394 | .icon-remove-sign{background-position:-48px -96px;} |
|
395 | 395 | .icon-ok-sign{background-position:-72px -96px;} |
|
396 | 396 | .icon-question-sign{background-position:-96px -96px;} |
|
397 | 397 | .icon-info-sign{background-position:-120px -96px;} |
|
398 | 398 | .icon-screenshot{background-position:-144px -96px;} |
|
399 | 399 | .icon-remove-circle{background-position:-168px -96px;} |
|
400 | 400 | .icon-ok-circle{background-position:-192px -96px;} |
|
401 | 401 | .icon-ban-circle{background-position:-216px -96px;} |
|
402 | 402 | .icon-arrow-left{background-position:-240px -96px;} |
|
403 | 403 | .icon-arrow-right{background-position:-264px -96px;} |
|
404 | 404 | .icon-arrow-up{background-position:-289px -96px;} |
|
405 | 405 | .icon-arrow-down{background-position:-312px -96px;} |
|
406 | 406 | .icon-share-alt{background-position:-336px -96px;} |
|
407 | 407 | .icon-resize-full{background-position:-360px -96px;} |
|
408 | 408 | .icon-resize-small{background-position:-384px -96px;} |
|
409 | 409 | .icon-plus{background-position:-408px -96px;} |
|
410 | 410 | .icon-minus{background-position:-433px -96px;} |
|
411 | 411 | .icon-asterisk{background-position:-456px -96px;} |
|
412 | 412 | .icon-exclamation-sign{background-position:0 -120px;} |
|
413 | 413 | .icon-gift{background-position:-24px -120px;} |
|
414 | 414 | .icon-leaf{background-position:-48px -120px;} |
|
415 | 415 | .icon-fire{background-position:-72px -120px;} |
|
416 | 416 | .icon-eye-open{background-position:-96px -120px;} |
|
417 | 417 | .icon-eye-close{background-position:-120px -120px;} |
|
418 | 418 | .icon-warning-sign{background-position:-144px -120px;} |
|
419 | 419 | .icon-plane{background-position:-168px -120px;} |
|
420 | 420 | .icon-calendar{background-position:-192px -120px;} |
|
421 | 421 | .icon-random{background-position:-216px -120px;width:16px;} |
|
422 | 422 | .icon-comment{background-position:-240px -120px;} |
|
423 | 423 | .icon-magnet{background-position:-264px -120px;} |
|
424 | 424 | .icon-chevron-up{background-position:-288px -120px;} |
|
425 | 425 | .icon-chevron-down{background-position:-313px -119px;} |
|
426 | 426 | .icon-retweet{background-position:-336px -120px;} |
|
427 | 427 | .icon-shopping-cart{background-position:-360px -120px;} |
|
428 | 428 | .icon-folder-close{background-position:-384px -120px;} |
|
429 | 429 | .icon-folder-open{background-position:-408px -120px;width:16px;} |
|
430 | 430 | .icon-resize-vertical{background-position:-432px -119px;} |
|
431 | 431 | .icon-resize-horizontal{background-position:-456px -118px;} |
|
432 | 432 | .icon-hdd{background-position:0 -144px;} |
|
433 | 433 | .icon-bullhorn{background-position:-24px -144px;} |
|
434 | 434 | .icon-bell{background-position:-48px -144px;} |
|
435 | 435 | .icon-certificate{background-position:-72px -144px;} |
|
436 | 436 | .icon-thumbs-up{background-position:-96px -144px;} |
|
437 | 437 | .icon-thumbs-down{background-position:-120px -144px;} |
|
438 | 438 | .icon-hand-right{background-position:-144px -144px;} |
|
439 | 439 | .icon-hand-left{background-position:-168px -144px;} |
|
440 | 440 | .icon-hand-up{background-position:-192px -144px;} |
|
441 | 441 | .icon-hand-down{background-position:-216px -144px;} |
|
442 | 442 | .icon-circle-arrow-right{background-position:-240px -144px;} |
|
443 | 443 | .icon-circle-arrow-left{background-position:-264px -144px;} |
|
444 | 444 | .icon-circle-arrow-up{background-position:-288px -144px;} |
|
445 | 445 | .icon-circle-arrow-down{background-position:-312px -144px;} |
|
446 | 446 | .icon-globe{background-position:-336px -144px;} |
|
447 | 447 | .icon-wrench{background-position:-360px -144px;} |
|
448 | 448 | .icon-tasks{background-position:-384px -144px;} |
|
449 | 449 | .icon-filter{background-position:-408px -144px;} |
|
450 | 450 | .icon-briefcase{background-position:-432px -144px;} |
|
451 | 451 | .icon-fullscreen{background-position:-456px -144px;} |
|
452 | 452 | .dropup,.dropdown{position:relative;} |
|
453 | 453 | .dropdown-toggle{*margin-bottom:-3px;} |
|
454 | 454 | .dropdown-toggle:active,.open .dropdown-toggle{outline:0;} |
|
455 | 455 | .caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000000;border-right:4px solid transparent;border-left:4px solid transparent;content:"";} |
|
456 | 456 | .dropdown .caret{margin-top:8px;margin-left:2px;} |
|
457 | 457 | .dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#ffffff;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;}.dropdown-menu.pull-right{right:0;left:auto;} |
|
458 | 458 | .dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;} |
|
459 | 459 | .dropdown-menu li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333333;white-space:nowrap;} |
|
460 | 460 | .dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{text-decoration:none;color:#ffffff;background-color:#0081c2;background-image:-moz-linear-gradient(top, #0088cc, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));background-image:-webkit-linear-gradient(top, #0088cc, #0077b3);background-image:-o-linear-gradient(top, #0088cc, #0077b3);background-image:linear-gradient(to bottom, #0088cc, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);} |
|
461 | 461 | .dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#ffffff;text-decoration:none;outline:0;background-color:#0081c2;background-image:-moz-linear-gradient(top, #0088cc, #0077b3);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0077b3));background-image:-webkit-linear-gradient(top, #0088cc, #0077b3);background-image:-o-linear-gradient(top, #0088cc, #0077b3);background-image:linear-gradient(to bottom, #0088cc, #0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0077b3', GradientType=0);} |
|
462 | 462 | .dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999999;} |
|
463 | 463 | .dropdown-menu .disabled>a:hover{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:default;} |
|
464 | 464 | .open{*z-index:1000;}.open>.dropdown-menu{display:block;} |
|
465 | 465 | .pull-right>.dropdown-menu{right:0;left:auto;} |
|
466 | 466 | .dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000000;content:"";} |
|
467 | 467 | .dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px;} |
|
468 | 468 | .dropdown-submenu{position:relative;} |
|
469 | 469 | .dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;} |
|
470 | 470 | .dropdown-submenu:hover>.dropdown-menu{display:block;} |
|
471 | 471 | .dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0;} |
|
472 | 472 | .dropdown-submenu>a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#cccccc;margin-top:5px;margin-right:-10px;} |
|
473 | 473 | .dropdown-submenu:hover>a:after{border-left-color:#ffffff;} |
|
474 | 474 | .dropdown-submenu.pull-left{float:none;}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px;} |
|
475 | 475 | .dropdown .dropdown-menu .nav-header{padding-left:20px;padding-right:20px;} |
|
476 | 476 | .typeahead{z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} |
|
477 | 477 | .well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);} |
|
478 | 478 | .well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} |
|
479 | 479 | .well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} |
|
480 | 480 | .fade{opacity:0;-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;}.fade.in{opacity:1;} |
|
481 | 481 | .collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height 0.35s ease;-moz-transition:height 0.35s ease;-o-transition:height 0.35s ease;transition:height 0.35s ease;}.collapse.in{height:auto;} |
|
482 | 482 | .close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000000;text-shadow:0 1px 0 #ffffff;opacity:0.2;filter:alpha(opacity=20);}.close:hover{color:#000000;text-decoration:none;cursor:pointer;opacity:0.4;filter:alpha(opacity=40);} |
|
483 | 483 | button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none;} |
|
484 | 484 | .btn{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;margin-bottom:0;font-size:13px;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333333;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top, #ffffff, #e6e6e6);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(top, #ffffff, #e6e6e6);background-image:-o-linear-gradient(top, #ffffff, #e6e6e6);background-image:linear-gradient(to bottom, #ffffff, #e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border:1px solid #bbbbbb;*border:0;border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333333;background-color:#e6e6e6;*background-color:#d9d9d9;} |
|
485 | 485 | .btn:active,.btn.active{background-color:#cccccc \9;} |
|
486 | 486 | .btn:first-child{*margin-left:0;} |
|
487 | 487 | .btn:hover{color:#333333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position 0.1s linear;-moz-transition:background-position 0.1s linear;-o-transition:background-position 0.1s linear;transition:background-position 0.1s linear;} |
|
488 | 488 | .btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} |
|
489 | 489 | .btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);} |
|
490 | 490 | .btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} |
|
491 | 491 | .btn-large{padding:11px 19px;font-size:16.25px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} |
|
492 | 492 | .btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px;} |
|
493 | 493 | .btn-small{padding:2px 10px;font-size:11.049999999999999px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} |
|
494 | 494 | .btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0;} |
|
495 | 495 | .btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px;} |
|
496 | 496 | .btn-mini{padding:0 6px;font-size:9.75px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} |
|
497 | 497 | .btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;} |
|
498 | 498 | .btn-block+.btn-block{margin-top:5px;} |
|
499 | 499 | input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%;} |
|
500 | 500 | .btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255, 255, 255, 0.75);} |
|
501 | 501 | .btn{border-color:#c5c5c5;border-color:rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);} |
|
502 | 502 | .btn-primary{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top, #0088cc, #0044cc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));background-image:-webkit-linear-gradient(top, #0088cc, #0044cc);background-image:-o-linear-gradient(top, #0088cc, #0044cc);background-image:linear-gradient(to bottom, #0088cc, #0044cc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);border-color:#0044cc #0044cc #002a80;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#0044cc;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#ffffff;background-color:#0044cc;*background-color:#003bb3;} |
|
503 | 503 | .btn-primary:active,.btn-primary.active{background-color:#003399 \9;} |
|
504 | 504 | .btn-warning{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(to bottom, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#f89406;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#ffffff;background-color:#f89406;*background-color:#df8505;} |
|
505 | 505 | .btn-warning:active,.btn-warning.active{background-color:#c67605 \9;} |
|
506 | 506 | .btn-danger{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#da4f49;background-image:-moz-linear-gradient(top, #ee5f5b, #bd362f);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));background-image:-webkit-linear-gradient(top, #ee5f5b, #bd362f);background-image:-o-linear-gradient(top, #ee5f5b, #bd362f);background-image:linear-gradient(to bottom, #ee5f5b, #bd362f);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);border-color:#bd362f #bd362f #802420;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#bd362f;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#ffffff;background-color:#bd362f;*background-color:#a9302a;} |
|
507 | 507 | .btn-danger:active,.btn-danger.active{background-color:#942a25 \9;} |
|
508 | 508 | .btn-success{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#5bb75b;background-image:-moz-linear-gradient(top, #62c462, #51a351);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));background-image:-webkit-linear-gradient(top, #62c462, #51a351);background-image:-o-linear-gradient(top, #62c462, #51a351);background-image:linear-gradient(to bottom, #62c462, #51a351);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);border-color:#51a351 #51a351 #387038;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#51a351;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#ffffff;background-color:#51a351;*background-color:#499249;} |
|
509 | 509 | .btn-success:active,.btn-success.active{background-color:#408140 \9;} |
|
510 | 510 | .btn-info{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#49afcd;background-image:-moz-linear-gradient(top, #5bc0de, #2f96b4);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));background-image:-webkit-linear-gradient(top, #5bc0de, #2f96b4);background-image:-o-linear-gradient(top, #5bc0de, #2f96b4);background-image:linear-gradient(to bottom, #5bc0de, #2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#2f96b4;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#ffffff;background-color:#2f96b4;*background-color:#2a85a0;} |
|
511 | 511 | .btn-info:active,.btn-info.active{background-color:#24748c \9;} |
|
512 | 512 | .btn-inverse{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#363636;background-image:-moz-linear-gradient(top, #444444, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));background-image:-webkit-linear-gradient(top, #444444, #222222);background-image:-o-linear-gradient(top, #444444, #222222);background-image:linear-gradient(to bottom, #444444, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);border-color:#222222 #222222 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#222222;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#ffffff;background-color:#222222;*background-color:#151515;} |
|
513 | 513 | .btn-inverse:active,.btn-inverse.active{background-color:#080808 \9;} |
|
514 | 514 | button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px;}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0;} |
|
515 | 515 | button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px;} |
|
516 | 516 | button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px;} |
|
517 | 517 | button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px;} |
|
518 | 518 | .btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} |
|
519 | 519 | .btn-link{border-color:transparent;cursor:pointer;color:#0088cc;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} |
|
520 | 520 | .btn-link:hover{color:#005580;text-decoration:underline;background-color:transparent;} |
|
521 | 521 | .btn-link[disabled]:hover{color:#333333;text-decoration:none;} |
|
522 | 522 | .btn-group{position:relative;display:inline-block;*display:inline;*zoom:1;font-size:0;vertical-align:middle;white-space:nowrap;*margin-left:.3em;}.btn-group:first-child{*margin-left:0;} |
|
523 | 523 | .btn-group+.btn-group{margin-left:5px;} |
|
524 | 524 | .btn-toolbar{font-size:0;margin-top:10px;margin-bottom:10px;}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group{margin-left:5px;} |
|
525 | 525 | .btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} |
|
526 | 526 | .btn-group>.btn+.btn{margin-left:-1px;} |
|
527 | 527 | .btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:13px;} |
|
528 | 528 | .btn-group>.btn-mini{font-size:9.75px;} |
|
529 | 529 | .btn-group>.btn-small{font-size:11.049999999999999px;} |
|
530 | 530 | .btn-group>.btn-large{font-size:16.25px;} |
|
531 | 531 | .btn-group>.btn:first-child{margin-left:0;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;} |
|
532 | 532 | .btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;} |
|
533 | 533 | .btn-group>.btn.large:first-child{margin-left:0;-webkit-border-top-left-radius:6px;-moz-border-radius-topleft:6px;border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-moz-border-radius-bottomleft:6px;border-bottom-left-radius:6px;} |
|
534 | 534 | .btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;-moz-border-radius-topright:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;-moz-border-radius-bottomright:6px;border-bottom-right-radius:6px;} |
|
535 | 535 | .btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2;} |
|
536 | 536 | .btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0;} |
|
537 | 537 | .btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);*padding-top:5px;*padding-bottom:5px;} |
|
538 | 538 | .btn-group>.btn-mini+.dropdown-toggle{padding-left:5px;padding-right:5px;*padding-top:2px;*padding-bottom:2px;} |
|
539 | 539 | .btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px;} |
|
540 | 540 | .btn-group>.btn-large+.dropdown-toggle{padding-left:12px;padding-right:12px;*padding-top:7px;*padding-bottom:7px;} |
|
541 | 541 | .btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);} |
|
542 | 542 | .btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6;} |
|
543 | 543 | .btn-group.open .btn-primary.dropdown-toggle{background-color:#0044cc;} |
|
544 | 544 | .btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406;} |
|
545 | 545 | .btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f;} |
|
546 | 546 | .btn-group.open .btn-success.dropdown-toggle{background-color:#51a351;} |
|
547 | 547 | .btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4;} |
|
548 | 548 | .btn-group.open .btn-inverse.dropdown-toggle{background-color:#222222;} |
|
549 | 549 | .btn .caret{margin-top:8px;margin-left:0;} |
|
550 | 550 | .btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px;} |
|
551 | 551 | .btn-large .caret{border-left-width:5px;border-right-width:5px;border-top-width:5px;} |
|
552 | 552 | .dropup .btn-large .caret{border-bottom-width:5px;} |
|
553 | 553 | .btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;} |
|
554 | 554 | .btn-group-vertical{display:inline-block;*display:inline;*zoom:1;} |
|
555 | 555 | .btn-group-vertical>.btn{display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} |
|
556 | 556 | .btn-group-vertical>.btn+.btn{margin-left:0;margin-top:-1px;} |
|
557 | 557 | .btn-group-vertical>.btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;} |
|
558 | 558 | .btn-group-vertical>.btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;} |
|
559 | 559 | .btn-group-vertical>.btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0;} |
|
560 | 560 | .btn-group-vertical>.btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;} |
|
561 | 561 | .alert{padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} |
|
562 | 562 | .alert,.alert h4{color:#c09853;} |
|
563 | 563 | .alert h4{margin:0;} |
|
564 | 564 | .alert .close{position:relative;top:-2px;right:-21px;line-height:20px;} |
|
565 | 565 | .alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#468847;} |
|
566 | 566 | .alert-success h4{color:#468847;} |
|
567 | 567 | .alert-danger,.alert-error{background-color:#f2dede;border-color:#eed3d7;color:#b94a48;} |
|
568 | 568 | .alert-danger h4,.alert-error h4{color:#b94a48;} |
|
569 | 569 | .alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#3a87ad;} |
|
570 | 570 | .alert-info h4{color:#3a87ad;} |
|
571 | 571 | .alert-block{padding-top:14px;padding-bottom:14px;} |
|
572 | 572 | .alert-block>p,.alert-block>ul{margin-bottom:0;} |
|
573 | 573 | .alert-block p+p{margin-top:5px;} |
|
574 | 574 | .nav{margin-left:0;margin-bottom:20px;list-style:none;} |
|
575 | 575 | .nav>li>a{display:block;} |
|
576 | 576 | .nav>li>a:hover{text-decoration:none;background-color:#eeeeee;} |
|
577 | 577 | .nav>li>a>img{max-width:none;} |
|
578 | 578 | .nav>.pull-right{float:right;} |
|
579 | 579 | .nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999999;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);text-transform:uppercase;} |
|
580 | 580 | .nav li+.nav-header{margin-top:9px;} |
|
581 | 581 | .nav-list{padding-left:15px;padding-right:15px;margin-bottom:0;} |
|
582 | 582 | .nav-list>li>a,.nav-list .nav-header{margin-left:-15px;margin-right:-15px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);} |
|
583 | 583 | .nav-list>li>a{padding:3px 15px;} |
|
584 | 584 | .nav-list>.active>a,.nav-list>.active>a:hover{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.2);background-color:#0088cc;} |
|
585 | 585 | .nav-list [class^="icon-"],.nav-list [class*=" icon-"]{margin-right:2px;} |
|
586 | 586 | .nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;} |
|
587 | 587 | .nav-tabs,.nav-pills{*zoom:1;}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;content:"";line-height:0;} |
|
588 | 588 | .nav-tabs:after,.nav-pills:after{clear:both;} |
|
589 | 589 | .nav-tabs>li,.nav-pills>li{float:left;} |
|
590 | 590 | .nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px;} |
|
591 | 591 | .nav-tabs{border-bottom:1px solid #ddd;} |
|
592 | 592 | .nav-tabs>li{margin-bottom:-1px;} |
|
593 | 593 | .nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;}.nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #dddddd;} |
|
594 | 594 | .nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555555;background-color:#ffffff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default;} |
|
595 | 595 | .nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} |
|
596 | 596 | .nav-pills>.active>a,.nav-pills>.active>a:hover{color:#ffffff;background-color:#0088cc;} |
|
597 | 597 | .nav-stacked>li{float:none;} |
|
598 | 598 | .nav-stacked>li>a{margin-right:0;} |
|
599 | 599 | .nav-tabs.nav-stacked{border-bottom:0;} |
|
600 | 600 | .nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} |
|
601 | 601 | .nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;} |
|
602 | 602 | .nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;} |
|
603 | 603 | .nav-tabs.nav-stacked>li>a:hover{border-color:#ddd;z-index:2;} |
|
604 | 604 | .nav-pills.nav-stacked>li>a{margin-bottom:3px;} |
|
605 | 605 | .nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px;} |
|
606 | 606 | .nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;} |
|
607 | 607 | .nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} |
|
608 | 608 | .nav .dropdown-toggle .caret{border-top-color:#0088cc;border-bottom-color:#0088cc;margin-top:6px;} |
|
609 | 609 | .nav .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580;} |
|
610 | 610 | .nav-tabs .dropdown-toggle .caret{margin-top:8px;} |
|
611 | 611 | .nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff;} |
|
612 | 612 | .nav-tabs .active .dropdown-toggle .caret{border-top-color:#555555;border-bottom-color:#555555;} |
|
613 | 613 | .nav>.dropdown.active>a:hover{cursor:pointer;} |
|
614 | 614 | .nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#ffffff;background-color:#999999;border-color:#999999;} |
|
615 | 615 | .nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;opacity:1;filter:alpha(opacity=100);} |
|
616 | 616 | .tabs-stacked .open>a:hover{border-color:#999999;} |
|
617 | 617 | .tabbable{*zoom:1;}.tabbable:before,.tabbable:after{display:table;content:"";line-height:0;} |
|
618 | 618 | .tabbable:after{clear:both;} |
|
619 | 619 | .tab-content{overflow:auto;} |
|
620 | 620 | .tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0;} |
|
621 | 621 | .tab-content>.tab-pane,.pill-content>.pill-pane{display:none;} |
|
622 | 622 | .tab-content>.active,.pill-content>.active{display:block;} |
|
623 | 623 | .tabs-below>.nav-tabs{border-top:1px solid #ddd;} |
|
624 | 624 | .tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0;} |
|
625 | 625 | .tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.tabs-below>.nav-tabs>li>a:hover{border-bottom-color:transparent;border-top-color:#ddd;} |
|
626 | 626 | .tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd;} |
|
627 | 627 | .tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none;} |
|
628 | 628 | .tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px;} |
|
629 | 629 | .tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd;} |
|
630 | 630 | .tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;} |
|
631 | 631 | .tabs-left>.nav-tabs>li>a:hover{border-color:#eeeeee #dddddd #eeeeee #eeeeee;} |
|
632 | 632 | .tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#ffffff;} |
|
633 | 633 | .tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd;} |
|
634 | 634 | .tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;} |
|
635 | 635 | .tabs-right>.nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #eeeeee #dddddd;} |
|
636 | 636 | .tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#ffffff;} |
|
637 | 637 | .nav>.disabled>a{color:#999999;} |
|
638 | 638 | .nav>.disabled>a:hover{text-decoration:none;background-color:transparent;cursor:default;} |
|
639 | 639 | .navbar{overflow:visible;margin-bottom:20px;*position:relative;*z-index:2;} |
|
640 | 640 | .navbar-inner{min-height:40px;padding-left:20px;padding-right:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top, #ffffff, #f2f2f2);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f2f2f2));background-image:-webkit-linear-gradient(top, #ffffff, #f2f2f2);background-image:-o-linear-gradient(top, #ffffff, #f2f2f2);background-image:linear-gradient(to bottom, #ffffff, #f2f2f2);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff2f2f2', GradientType=0);border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 4px rgba(0, 0, 0, 0.065);-moz-box-shadow:0 1px 4px rgba(0, 0, 0, 0.065);box-shadow:0 1px 4px rgba(0, 0, 0, 0.065);*zoom:1;}.navbar-inner:before,.navbar-inner:after{display:table;content:"";line-height:0;} |
|
641 | 641 | .navbar-inner:after{clear:both;} |
|
642 | 642 | .navbar .container{width:auto;} |
|
643 | 643 | .nav-collapse.collapse{height:auto;overflow:visible;} |
|
644 | 644 | .navbar .brand{float:left;display:block;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777777;text-shadow:0 1px 0 #ffffff;}.navbar .brand:hover{text-decoration:none;} |
|
645 | 645 | .navbar-text{margin-bottom:0;line-height:40px;color:#777777;} |
|
646 | 646 | .navbar-link{color:#777777;}.navbar-link:hover{color:#333333;} |
|
647 | 647 | .navbar .divider-vertical{height:40px;margin:0 9px;border-left:1px solid #f2f2f2;border-right:1px solid #ffffff;} |
|
648 | 648 | .navbar .btn,.navbar .btn-group{margin-top:5px;} |
|
649 | 649 | .navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn{margin-top:0;} |
|
650 | 650 | .navbar-form{margin-bottom:0;*zoom:1;}.navbar-form:before,.navbar-form:after{display:table;content:"";line-height:0;} |
|
651 | 651 | .navbar-form:after{clear:both;} |
|
652 | 652 | .navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px;} |
|
653 | 653 | .navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0;} |
|
654 | 654 | .navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px;} |
|
655 | 655 | .navbar-form .input-append,.navbar-form .input-prepend{margin-top:5px;white-space:nowrap;}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0;} |
|
656 | 656 | .navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0;}.navbar-search .search-query{margin-bottom:0;padding:4px 14px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;} |
|
657 | 657 | .navbar-static-top{position:static;margin-bottom:0;}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} |
|
658 | 658 | .navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0;} |
|
659 | 659 | .navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px;} |
|
660 | 660 | .navbar-fixed-bottom .navbar-inner{border-width:1px 0 0;} |
|
661 | 661 | .navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-left:0;padding-right:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} |
|
662 | 662 | .navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;} |
|
663 | 663 | .navbar-fixed-top{top:0;} |
|
664 | 664 | .navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:0 1px 10px rgba(0,0,0,.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,.1);box-shadow:0 1px 10px rgba(0,0,0,.1);} |
|
665 | 665 | .navbar-fixed-bottom{bottom:0;}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:0 -1px 10px rgba(0,0,0,.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,.1);box-shadow:0 -1px 10px rgba(0,0,0,.1);} |
|
666 | 666 | .navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0;} |
|
667 | 667 | .navbar .nav.pull-right{float:right;margin-right:0;} |
|
668 | 668 | .navbar .nav>li{float:left;} |
|
669 | 669 | .navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777777;text-decoration:none;text-shadow:0 1px 0 #ffffff;} |
|
670 | 670 | .navbar .nav .dropdown-toggle .caret{margin-top:8px;} |
|
671 | 671 | .navbar .nav>li>a:focus,.navbar .nav>li>a:hover{background-color:transparent;color:#333333;text-decoration:none;} |
|
672 | 672 | .navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0, 0, 0, 0.125);-moz-box-shadow:inset 0 3px 8px rgba(0, 0, 0, 0.125);box-shadow:inset 0 3px 8px rgba(0, 0, 0, 0.125);} |
|
673 | 673 | .navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-left:5px;margin-right:5px;color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#ededed;background-image:-moz-linear-gradient(top, #f2f2f2, #e5e5e5);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#e5e5e5));background-image:-webkit-linear-gradient(top, #f2f2f2, #e5e5e5);background-image:-o-linear-gradient(top, #f2f2f2, #e5e5e5);background-image:linear-gradient(to bottom, #f2f2f2, #e5e5e5);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2', endColorstr='#ffe5e5e5', GradientType=0);border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#e5e5e5;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#ffffff;background-color:#e5e5e5;*background-color:#d9d9d9;} |
|
674 | 674 | .navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#cccccc \9;} |
|
675 | 675 | .navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);-moz-box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);} |
|
676 | 676 | .btn-navbar .icon-bar+.icon-bar{margin-top:3px;} |
|
677 | 677 | .navbar .nav>li>.dropdown-menu:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0, 0, 0, 0.2);position:absolute;top:-7px;left:9px;} |
|
678 | 678 | .navbar .nav>li>.dropdown-menu:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #ffffff;position:absolute;top:-6px;left:10px;} |
|
679 | 679 | .navbar-fixed-bottom .nav>li>.dropdown-menu:before{border-top:7px solid #ccc;border-top-color:rgba(0, 0, 0, 0.2);border-bottom:0;bottom:-7px;top:auto;} |
|
680 | 680 | .navbar-fixed-bottom .nav>li>.dropdown-menu:after{border-top:6px solid #ffffff;border-bottom:0;bottom:-6px;top:auto;} |
|
681 | 681 | .navbar .nav li.dropdown>a:hover .caret{border-top-color:#555555;border-bottom-color:#555555;} |
|
682 | 682 | .navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{background-color:#e5e5e5;color:#555555;} |
|
683 | 683 | .navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777777;border-bottom-color:#777777;} |
|
684 | 684 | .navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555555;border-bottom-color:#555555;} |
|
685 | 685 | .navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{left:auto;right:0;}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{left:auto;right:12px;} |
|
686 | 686 | .navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{left:auto;right:13px;} |
|
687 | 687 | .navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{left:auto;right:100%;margin-left:0;margin-right:-1px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px;} |
|
688 | 688 | .navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top, #222222, #111111);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#222222), to(#111111));background-image:-webkit-linear-gradient(top, #222222, #111111);background-image:-o-linear-gradient(top, #222222, #111111);background-image:linear-gradient(to bottom, #222222, #111111);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0);border-color:#252525;} |
|
689 | 689 | .navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999999;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#ffffff;} |
|
690 | 690 | .navbar-inverse .brand{color:#999999;} |
|
691 | 691 | .navbar-inverse .navbar-text{color:#999999;} |
|
692 | 692 | .navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{background-color:transparent;color:#ffffff;} |
|
693 | 693 | .navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#ffffff;background-color:#111111;} |
|
694 | 694 | .navbar-inverse .navbar-link{color:#999999;}.navbar-inverse .navbar-link:hover{color:#ffffff;} |
|
695 | 695 | .navbar-inverse .divider-vertical{border-left-color:#111111;border-right-color:#222222;} |
|
696 | 696 | .navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{background-color:#111111;color:#ffffff;} |
|
697 | 697 | .navbar-inverse .nav li.dropdown>a:hover .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;} |
|
698 | 698 | .navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999999;border-bottom-color:#999999;} |
|
699 | 699 | .navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;} |
|
700 | 700 | .navbar-inverse .navbar-search .search-query{color:#ffffff;background-color:#515151;border-color:#111111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15);box-shadow:inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none;}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#cccccc;} |
|
701 | 701 | .navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#cccccc;} |
|
702 | 702 | .navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#cccccc;} |
|
703 | 703 | .navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333333;text-shadow:0 1px 0 #ffffff;background-color:#ffffff;border:0;-webkit-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);-moz-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);box-shadow:0 0 3px rgba(0, 0, 0, 0.15);outline:0;} |
|
704 | 704 | .navbar-inverse .btn-navbar{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#0e0e0e;background-image:-moz-linear-gradient(top, #151515, #040404);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#151515), to(#040404));background-image:-webkit-linear-gradient(top, #151515, #040404);background-image:-o-linear-gradient(top, #151515, #040404);background-image:linear-gradient(to bottom, #151515, #040404);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515', endColorstr='#ff040404', GradientType=0);border-color:#040404 #040404 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#040404;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#ffffff;background-color:#040404;*background-color:#000000;} |
|
705 | 705 | .navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000000 \9;} |
|
706 | 706 | .breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.breadcrumb>li{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 0 #ffffff;}.breadcrumb>li>.divider{padding:0 5px;color:#ccc;} |
|
707 | 707 | .breadcrumb>.active{color:#999999;} |
|
708 | 708 | .pagination{margin:20px 0;} |
|
709 | 709 | .pagination ul{display:inline-block;*display:inline;*zoom:1;margin-left:0;margin-bottom:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);} |
|
710 | 710 | .pagination ul>li{display:inline;} |
|
711 | 711 | .pagination ul>li>a,.pagination ul>li>span{float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#ffffff;border:1px solid #dddddd;border-left-width:0;} |
|
712 | 712 | .pagination ul>li>a:hover,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5;} |
|
713 | 713 | .pagination ul>.active>a,.pagination ul>.active>span{color:#999999;cursor:default;} |
|
714 | 714 | .pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover{color:#999999;background-color:transparent;cursor:default;} |
|
715 | 715 | .pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;} |
|
716 | 716 | .pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;} |
|
717 | 717 | .pagination-centered{text-align:center;} |
|
718 | 718 | .pagination-right{text-align:right;} |
|
719 | 719 | .pagination-large ul>li>a,.pagination-large ul>li>span{padding:11px 19px;font-size:16.25px;} |
|
720 | 720 | .pagination-large ul>li:first-child>a,.pagination-large ul>li:first-child>span{-webkit-border-top-left-radius:6px;-moz-border-radius-topleft:6px;border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-moz-border-radius-bottomleft:6px;border-bottom-left-radius:6px;} |
|
721 | 721 | .pagination-large ul>li:last-child>a,.pagination-large ul>li:last-child>span{-webkit-border-top-right-radius:6px;-moz-border-radius-topright:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;-moz-border-radius-bottomright:6px;border-bottom-right-radius:6px;} |
|
722 | 722 | .pagination-mini ul>li:first-child>a,.pagination-small ul>li:first-child>a,.pagination-mini ul>li:first-child>span,.pagination-small ul>li:first-child>span{-webkit-border-top-left-radius:3px;-moz-border-radius-topleft:3px;border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-moz-border-radius-bottomleft:3px;border-bottom-left-radius:3px;} |
|
723 | 723 | .pagination-mini ul>li:last-child>a,.pagination-small ul>li:last-child>a,.pagination-mini ul>li:last-child>span,.pagination-small ul>li:last-child>span{-webkit-border-top-right-radius:3px;-moz-border-radius-topright:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;-moz-border-radius-bottomright:3px;border-bottom-right-radius:3px;} |
|
724 | 724 | .pagination-small ul>li>a,.pagination-small ul>li>span{padding:2px 10px;font-size:11.049999999999999px;} |
|
725 | 725 | .pagination-mini ul>li>a,.pagination-mini ul>li>span{padding:0 6px;font-size:9.75px;} |
|
726 | 726 | .pager{margin:20px 0;list-style:none;text-align:center;*zoom:1;}.pager:before,.pager:after{display:table;content:"";line-height:0;} |
|
727 | 727 | .pager:after{clear:both;} |
|
728 | 728 | .pager li{display:inline;} |
|
729 | 729 | .pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;} |
|
730 | 730 | .pager li>a:hover{text-decoration:none;background-color:#f5f5f5;} |
|
731 | 731 | .pager .next>a,.pager .next>span{float:right;} |
|
732 | 732 | .pager .previous>a,.pager .previous>span{float:left;} |
|
733 | 733 | .pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>span{color:#999999;background-color:#fff;cursor:default;} |
|
734 | 734 | .modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000;}.modal-backdrop.fade{opacity:0;} |
|
735 | 735 | .modal-backdrop,.modal-backdrop.fade.in{opacity:0.8;filter:alpha(opacity=80);} |
|
736 | 736 | .modal{position:fixed;top:10%;left:50%;z-index:1050;width:560px;margin-left:-280px;background-color:#ffffff;border:1px solid #999;border:1px solid rgba(0, 0, 0, 0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;outline:none;}.modal.fade{-webkit-transition:opacity .3s linear, top .3s ease-out;-moz-transition:opacity .3s linear, top .3s ease-out;-o-transition:opacity .3s linear, top .3s ease-out;transition:opacity .3s linear, top .3s ease-out;top:-25%;} |
|
737 | 737 | .modal.fade.in{top:10%;} |
|
738 | 738 | .modal-header{padding:9px 15px;border-bottom:1px solid #eee;}.modal-header .close{margin-top:2px;} |
|
739 | 739 | .modal-header h3{margin:0;line-height:30px;} |
|
740 | 740 | .modal-body{position:relative;overflow-y:auto;max-height:400px;padding:15px;} |
|
741 | 741 | .modal-form{margin-bottom:0;} |
|
742 | 742 | .modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;*zoom:1;}.modal-footer:before,.modal-footer:after{display:table;content:"";line-height:0;} |
|
743 | 743 | .modal-footer:after{clear:both;} |
|
744 | 744 | .modal-footer .btn+.btn{margin-left:5px;margin-bottom:0;} |
|
745 | 745 | .modal-footer .btn-group .btn+.btn{margin-left:-1px;} |
|
746 | 746 | .modal-footer .btn-block+.btn-block{margin-left:0;} |
|
747 | 747 | .tooltip{position:absolute;z-index:1030;display:block;visibility:visible;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);}.tooltip.in{opacity:0.8;filter:alpha(opacity=80);} |
|
748 | 748 | .tooltip.top{margin-top:-3px;} |
|
749 | 749 | .tooltip.right{margin-left:3px;} |
|
750 | 750 | .tooltip.bottom{margin-top:3px;} |
|
751 | 751 | .tooltip.left{margin-left:-3px;} |
|
752 | 752 | .tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;text-decoration:none;background-color:#000000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} |
|
753 | 753 | .tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid;} |
|
754 | 754 | .tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000000;} |
|
755 | 755 | .tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000000;} |
|
756 | 756 | .tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000000;} |
|
757 | 757 | .tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000000;} |
|
758 | 758 | .popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;text-align:left;background-color:#ffffff;-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);white-space:normal;}.popover.top{margin-top:-10px;} |
|
759 | 759 | .popover.right{margin-left:10px;} |
|
760 | 760 | .popover.bottom{margin-top:10px;} |
|
761 | 761 | .popover.left{margin-left:-10px;} |
|
762 | 762 | .popover-title{margin:0;padding:8px 14px;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0;} |
|
763 | 763 | .popover-content{padding:9px 14px;} |
|
764 | 764 | .popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid;} |
|
765 | 765 | .popover .arrow{border-width:11px;} |
|
766 | 766 | .popover .arrow:after{border-width:10px;content:"";} |
|
767 | 767 | .popover.top .arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0, 0, 0, 0.25);bottom:-11px;}.popover.top .arrow:after{bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#ffffff;} |
|
768 | 768 | .popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0, 0, 0, 0.25);}.popover.right .arrow:after{left:1px;bottom:-10px;border-left-width:0;border-right-color:#ffffff;} |
|
769 | 769 | .popover.bottom .arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0, 0, 0, 0.25);top:-11px;}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#ffffff;} |
|
770 | 770 | .popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0, 0, 0, 0.25);}.popover.left .arrow:after{right:1px;border-right-width:0;border-left-color:#ffffff;bottom:-10px;} |
|
771 | 771 | .thumbnails{margin-left:-20px;list-style:none;*zoom:1;}.thumbnails:before,.thumbnails:after{display:table;content:"";line-height:0;} |
|
772 | 772 | .thumbnails:after{clear:both;} |
|
773 | 773 | .row-fluid .thumbnails{margin-left:0;} |
|
774 | 774 | .thumbnails>li{float:left;margin-bottom:20px;margin-left:20px;} |
|
775 | 775 | .thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0, 0, 0, 0.055);-moz-box-shadow:0 1px 3px rgba(0, 0, 0, 0.055);box-shadow:0 1px 3px rgba(0, 0, 0, 0.055);-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;-o-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;} |
|
776 | 776 | a.thumbnail:hover{border-color:#0088cc;-webkit-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);-moz-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);} |
|
777 | 777 | .thumbnail>img{display:block;max-width:100%;margin-left:auto;margin-right:auto;} |
|
778 | 778 | .thumbnail .caption{padding:9px;color:#555555;} |
|
779 | 779 | .media,.media-body{overflow:hidden;*overflow:visible;zoom:1;} |
|
780 | 780 | .media,.media .media{margin-top:15px;} |
|
781 | 781 | .media:first-child{margin-top:0;} |
|
782 | 782 | .media-object{display:block;} |
|
783 | 783 | .media-heading{margin:0 0 5px;} |
|
784 | 784 | .media .pull-left{margin-right:10px;} |
|
785 | 785 | .media .pull-right{margin-left:10px;} |
|
786 | 786 | .media-list{margin-left:0;list-style:none;} |
|
787 | 787 | .label,.badge{display:inline-block;padding:2px 4px;font-size:10.998px;font-weight:bold;line-height:14px;color:#ffffff;vertical-align:baseline;white-space:nowrap;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#999999;} |
|
788 | 788 | .label{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} |
|
789 | 789 | .badge{padding-left:9px;padding-right:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;} |
|
790 | 790 | .label:empty,.badge:empty{display:none;} |
|
791 | 791 | a.label:hover,a.badge:hover{color:#ffffff;text-decoration:none;cursor:pointer;} |
|
792 | 792 | .label-important,.badge-important{background-color:#b94a48;} |
|
793 | 793 | .label-important[href],.badge-important[href]{background-color:#953b39;} |
|
794 | 794 | .label-warning,.badge-warning{background-color:#f89406;} |
|
795 | 795 | .label-warning[href],.badge-warning[href]{background-color:#c67605;} |
|
796 | 796 | .label-success,.badge-success{background-color:#468847;} |
|
797 | 797 | .label-success[href],.badge-success[href]{background-color:#356635;} |
|
798 | 798 | .label-info,.badge-info{background-color:#3a87ad;} |
|
799 | 799 | .label-info[href],.badge-info[href]{background-color:#2d6987;} |
|
800 | 800 | .label-inverse,.badge-inverse{background-color:#333333;} |
|
801 | 801 | .label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a;} |
|
802 | 802 | .btn .label,.btn .badge{position:relative;top:-1px;} |
|
803 | 803 | .btn-mini .label,.btn-mini .badge{top:0;} |
|
804 | 804 | @-webkit-keyframes progress-bar-stripes{from{background-position:40px 0;} to{background-position:0 0;}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0;} to{background-position:0 0;}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0;} to{background-position:0 0;}}@-o-keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}@keyframes progress-bar-stripes{from{background-position:40px 0;} to{background-position:0 0;}}.progress{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f7f7f7;background-image:-moz-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));background-image:-webkit-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-o-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:linear-gradient(to bottom, #f5f5f5, #f9f9f9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#fff9f9f9', GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} |
|
805 | 805 | .progress .bar{width:0%;height:100%;color:#ffffff;float:left;font-size:12px;text-align:center;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top, #149bdf, #0480be);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));background-image:-webkit-linear-gradient(top, #149bdf, #0480be);background-image:-o-linear-gradient(top, #149bdf, #0480be);background-image:linear-gradient(to bottom, #149bdf, #0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf', endColorstr='#ff0480be', GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width 0.6s ease;-moz-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease;} |
|
806 | 806 | .progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,.15), inset 0 -1px 0 rgba(0,0,0,.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,.15), inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 1px 0 0 rgba(0,0,0,.15), inset 0 -1px 0 rgba(0,0,0,.15);} |
|
807 | 807 | .progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px;} |
|
808 | 808 | .progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite;} |
|
809 | 809 | .progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top, #ee5f5b, #c43c35);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));background-image:-webkit-linear-gradient(top, #ee5f5b, #c43c35);background-image:-o-linear-gradient(top, #ee5f5b, #c43c35);background-image:linear-gradient(to bottom, #ee5f5b, #c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffc43c35', GradientType=0);} |
|
810 | 810 | .progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} |
|
811 | 811 | .progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top, #62c462, #57a957);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));background-image:-webkit-linear-gradient(top, #62c462, #57a957);background-image:-o-linear-gradient(top, #62c462, #57a957);background-image:linear-gradient(to bottom, #62c462, #57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff57a957', GradientType=0);} |
|
812 | 812 | .progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} |
|
813 | 813 | .progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top, #5bc0de, #339bb9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));background-image:-webkit-linear-gradient(top, #5bc0de, #339bb9);background-image:-o-linear-gradient(top, #5bc0de, #339bb9);background-image:linear-gradient(to bottom, #5bc0de, #339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff339bb9', GradientType=0);} |
|
814 | 814 | .progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} |
|
815 | 815 | .progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(to bottom, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);} |
|
816 | 816 | .progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} |
|
817 | 817 | .accordion{margin-bottom:20px;} |
|
818 | 818 | .accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} |
|
819 | 819 | .accordion-heading{border-bottom:0;} |
|
820 | 820 | .accordion-heading .accordion-toggle{display:block;padding:8px 15px;} |
|
821 | 821 | .accordion-toggle{cursor:pointer;} |
|
822 | 822 | .accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5;} |
|
823 | 823 | .carousel{position:relative;margin-bottom:20px;line-height:1;} |
|
824 | 824 | .carousel-inner{overflow:hidden;width:100%;position:relative;} |
|
825 | 825 | .carousel-inner>.item{display:none;position:relative;-webkit-transition:0.6s ease-in-out left;-moz-transition:0.6s ease-in-out left;-o-transition:0.6s ease-in-out left;transition:0.6s ease-in-out left;} |
|
826 | 826 | .carousel-inner>.item>img{display:block;line-height:1;} |
|
827 | 827 | .carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block;} |
|
828 | 828 | .carousel-inner>.active{left:0;} |
|
829 | 829 | .carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%;} |
|
830 | 830 | .carousel-inner>.next{left:100%;} |
|
831 | 831 | .carousel-inner>.prev{left:-100%;} |
|
832 | 832 | .carousel-inner>.next.left,.carousel-inner>.prev.right{left:0;} |
|
833 | 833 | .carousel-inner>.active.left{left:-100%;} |
|
834 | 834 | .carousel-inner>.active.right{left:100%;} |
|
835 | 835 | .carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#ffffff;text-align:center;background:#222222;border:3px solid #ffffff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:0.5;filter:alpha(opacity=50);}.carousel-control.right{left:auto;right:15px;} |
|
836 | 836 | .carousel-control:hover{color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90);} |
|
837 | 837 | .carousel-caption{position:absolute;left:0;right:0;bottom:0;padding:15px;background:#333333;background:rgba(0, 0, 0, 0.75);} |
|
838 | 838 | .carousel-caption h4,.carousel-caption p{color:#ffffff;line-height:20px;} |
|
839 | 839 | .carousel-caption h4{margin:0 0 5px;} |
|
840 | 840 | .carousel-caption p{margin-bottom:0;} |
|
841 | 841 | .hero-unit{padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eeeeee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;color:inherit;letter-spacing:-1px;} |
|
842 | 842 | .hero-unit li{line-height:30px;} |
|
843 | 843 | .pull-right{float:right;} |
|
844 | 844 | .pull-left{float:left;} |
|
845 | 845 | .hide{display:none;} |
|
846 | 846 | .show{display:block;} |
|
847 | 847 | .invisible{visibility:hidden;} |
|
848 | 848 | .affix{position:fixed;} |
|
849 | 849 | .corner-all{border-radius:4px;} |
|
850 | 850 | .hbox{display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:horizontal;-moz-box-align:stretch;display:box;box-orient:horizontal;box-align:stretch;} |
|
851 | 851 | .hbox>*{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;} |
|
852 | 852 | .vbox{display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;width:100%;} |
|
853 | 853 | .vbox>*{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;} |
|
854 | 854 | .reverse{-webkit-box-direction:reverse;-moz-box-direction:reverse;box-direction:reverse;} |
|
855 | 855 | .box-flex0{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;} |
|
856 | 856 | .box-flex1{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;} |
|
857 | 857 | .box-flex{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;} |
|
858 | 858 | .box-flex2{-webkit-box-flex:2;-moz-box-flex:2;box-flex:2;} |
|
859 | 859 | .box-group1{-webkit-box-flex-group:1;-moz-box-flex-group:1;box-flex-group:1;} |
|
860 | 860 | .box-group2{-webkit-box-flex-group:2;-moz-box-flex-group:2;box-flex-group:2;} |
|
861 | 861 | .start{-webkit-box-pack:start;-moz-box-pack:start;box-pack:start;} |
|
862 | 862 | .end{-webkit-box-pack:end;-moz-box-pack:end;box-pack:end;} |
|
863 | 863 | .center{-webkit-box-pack:center;-moz-box-pack:center;box-pack:center;} |
|
864 | 864 | .corner-all{border-radius:4px;} |
|
865 | 865 | body{background-color:#ffffff;} |
|
866 | 866 | body.notebook_app{overflow:hidden;} |
|
867 | 867 | blockquote{border-left:4px solid #DDD;padding:0 15px;color:#777;} |
|
868 | 868 | span#save_widget{padding:5px;margin:0px 0px 0px 300px;display:inline-block;} |
|
869 | 869 | span#notebook_name{height:1em;line-height:1em;padding:3px;border:none;font-size:146.5%;} |
|
870 | 870 | .ui-menubar-item .ui-button .ui-button-text{padding:0.4em 1.0em;font-size:100%;} |
|
871 | 871 | .ui-menu{-moz-box-shadow:0px 6px 10px -1px #adadad;-webkit-box-shadow:0px 6px 10px -1px #adadad;box-shadow:0px 6px 10px -1px #adadad;} |
|
872 | 872 | .ui-menu .ui-menu-item a{border:1px solid transparent;padding:2px 1.6em;} |
|
873 | 873 | .ui-menu .ui-menu-item a.ui-state-focus{margin:0;} |
|
874 | 874 | .ui-menu hr{margin:0.3em 0;} |
|
875 | 875 | #menubar_container{position:relative;} |
|
876 | 876 | #notification_area{position:absolute;right:0px;top:0px;height:25px;padding:3px 0px;padding-right:3px;z-index:10;} |
|
877 | 877 | .notification_widget{float:right;right:0px;top:1px;height:25px;padding:3px 6px;z-index:10;} |
|
878 | 878 | .toolbar{padding:3px 15px;border-bottom:1px #ababab solid;}.toolbar button{margin-top:2px;margin-bottom:2px;} |
|
879 | 879 | .toolbar select,.toolbar label{height:19px;vertical-align:middle;margin-right:2px;margin-bottom:0;display:inline;font-size:92%;margin-left:0.3em;margin-right:0.3em;padding:0px;} |
|
880 | 880 | .toolbar select{width:auto;} |
|
881 | 881 | #ipython-main-app{width:100%;position:relative;font-size:110%;} |
|
882 | 882 | span#quick_help_area{position:static;padding:5px 0px;margin:0px 0px 0px 0px;} |
|
883 | 883 | .help_string{float:right;width:170px;padding:0px 5px;text-align:left;font-size:85%;} |
|
884 | 884 | .help_string_label{float:right;font-size:85%;} |
|
885 | 885 | div#notebook_panel{margin:0px 0px 0px 0px;padding:0px;} |
|
886 | 886 | div#notebook{overflow-y:scroll;overflow-x:auto;width:100%;padding:5px 5px 15px 5px;margin:0px;} |
|
887 | 887 | div#pager_splitter{height:8px;} |
|
888 | 888 | #pager_container{position:relative;} |
|
889 | 889 | div#pager{padding:15px;overflow:auto;display:none;} |
|
890 | 890 | div.ui-widget-content{border:1px solid #ababab;outline:none;} |
|
891 | 891 | .cell{border:1px solid transparent;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;width:100%;}.cell.selected{border-radius:4px;border:thin #ababab solid;} |
|
892 | 892 | div.cell{width:100%;padding:5px 5px 5px 0px;margin:2px 0px 2px 0px;outline:none;} |
|
893 | 893 | div.prompt{width:11ex;padding:0.4em;margin:0px;font-family:monospace;text-align:right;line-height:1.231;} |
|
894 | 894 | div.input{page-break-inside:avoid;display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:horizontal;-moz-box-align:stretch;display:box;box-orient:horizontal;box-align:stretch;} |
|
895 | 895 | div.input_area{border:1px solid #cfcfcf;border-radius:4px;background:#f7f7f7;} |
|
896 | 896 | div.input_prompt{color:navy;border-top:1px solid transparent;} |
|
897 | 897 | div.output_wrapper{margin-top:5px;margin-left:5px;width:100%;position:relative;} |
|
898 | 898 | div.output_scroll{height:24em;width:100%;overflow:auto;border-radius:4px;box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);} |
|
899 | 899 | div.output_collapsed{margin-right:5px;} |
|
900 | 900 | div.out_prompt_overlay{height:100%;padding:0px;position:absolute;border-radius:4px;} |
|
901 | 901 | div.out_prompt_overlay:hover{box-shadow:inset 0 0 1px #000;background:rgba(240, 240, 240, 0.5);} |
|
902 | 902 | div.output_prompt{color:darkred;margin:0 5px 0 -5px;} |
|
903 | 903 | div.output_area{padding:0px;page-break-inside:avoid;display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:horizontal;-moz-box-align:stretch;display:box;box-orient:horizontal;box-align:stretch;} |
|
904 | 904 | div.output_area pre{font-family:monospace;margin:0;padding:0;border:0;font-size:100%;vertical-align:baseline;color:black;} |
|
905 | 905 | div.output_subarea{padding:0.44em 0.4em 0.4em 1px;-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;} |
|
906 | 906 | div.output_text{text-align:left;color:#000000;font-family:monospace;line-height:1.231;} |
|
907 | 907 | div.output_stream{padding-top:0.0em;padding-bottom:0.0em;} |
|
908 | 908 | div.output_stderr{background:#fdd;} |
|
909 | 909 | div.output_latex{text-align:left;} |
|
910 | 910 | div.text_cell{padding:5px 5px 5px 5px;} |
|
911 | 911 | div.text_cell_input{color:#000000;border:1px solid #cfcfcf;border-radius:4px;background:#f7f7f7;} |
|
912 | 912 | div.text_cell_render{outline:none;resize:none;width:inherit;border-style:none;padding:5px;color:#000000;} |
|
913 | 913 | .CodeMirror{line-height:1.231;} |
|
914 | 914 | .CodeMirror-scroll{height:auto;overflow-y:hidden;overflow-x:auto;} |
|
915 | 915 | .ansiblack{color:#000000;} |
|
916 | 916 | .ansired{color:darkred;} |
|
917 | 917 | .ansigreen{color:darkgreen;} |
|
918 | 918 | .ansiyellow{color:brown;} |
|
919 | 919 | .ansiblue{color:darkblue;} |
|
920 | 920 | .ansipurple{color:darkviolet;} |
|
921 | 921 | .ansicyan{color:steelblue;} |
|
922 | 922 | .ansigrey{color:grey;} |
|
923 | 923 | .ansibold{font-weight:bold;} |
|
924 | 924 | .completions{position:absolute;z-index:10;overflow:hidden;border:1px solid #ababab;} |
|
925 | 925 | .completions select{background:white;outline:none;border:none;padding:0px;margin:0px;overflow:auto;font-family:monospace;} |
|
926 | 926 | option.context{background-color:#DEF7FF;} |
|
927 | 927 | option.introspection{background-color:#EBF4EB;} |
|
928 | 928 | .completions p b{font-weight:bold;} |
|
929 | 929 | .completions p{background:#DDF;border-bottom:black solid 1px;padding:1px;font-family:monospace;} |
|
930 | 930 | pre.dialog{background-color:#f7f7f7;border:1px solid #ddd;border-radius:4px;padding:0.4em;padding-left:2em;} |
|
931 | 931 | p.dialog{padding:0.2em;} |
|
932 | 932 | .shortcut_key{display:inline-block;width:15ex;text-align:right;font-family:monospace;} |
|
933 | 933 | pre,code,kbd,samp{white-space:pre-wrap;} |
|
934 | 934 | #fonttest{font-family:monospace;} |
|
935 | 935 | .js-error{color:darkred;} |
|
936 | 936 | a{text-decoration:underline;} |
|
937 | 937 | p{margin-bottom:0;} |
|
938 | 938 | a.heading-anchor:link,a.heading-anchor:visited{text-decoration:none;color:inherit;} |
|
939 | span.input_prompt{font-family:monospace;} | |
|
940 | input.raw_input{width: auto; font-family: monospace;} | |
|
941 | ||
|
939 | 942 | @media print{body{overflow:visible !important;} div#notebook{overflow:visible !important;} .ui-widget-content{border:0px;} #save_widget{margin:0px !important;} #header,#pager,#pager_splitter,#menubar,#toolbar{display:none !important;} .cell{border:none !important;} .toolbar{display:none;}}.rendered_html{color:black;}.rendered_html em{font-style:italic;} |
|
940 | 943 | .rendered_html strong{font-weight:bold;} |
|
941 | 944 | .rendered_html u{text-decoration:underline;} |
|
942 | 945 | .rendered_html :link{text-decoration:underline;} |
|
943 | 946 | .rendered_html :visited{text-decoration:underline;} |
|
944 | 947 | .rendered_html h1{font-size:197%;margin:.65em 0;font-weight:bold;} |
|
945 | 948 | .rendered_html h2{font-size:153.9%;margin:.75em 0;font-weight:bold;} |
|
946 | 949 | .rendered_html h3{font-size:123.1%;margin:.85em 0;font-weight:bold;} |
|
947 | 950 | .rendered_html h4{font-size:100%;margin:0.95em 0;font-weight:bold;} |
|
948 | 951 | .rendered_html h5{font-size:85%;margin:1.5em 0;font-weight:bold;} |
|
949 | 952 | .rendered_html h6{font-size:77%;margin:1.65em 0;font-weight:bold;} |
|
950 | 953 | .rendered_html ul{list-style:disc;margin:1em 2em;} |
|
951 | 954 | .rendered_html ul ul{list-style:square;margin:0em 2em;} |
|
952 | 955 | .rendered_html ul ul ul{list-style:circle;margin:0em 2em;} |
|
953 | 956 | .rendered_html ol{list-style:decimal;margin:1em 2em;} |
|
954 | 957 | .rendered_html ol ol{list-style:upper-alpha;margin:0em 2em;} |
|
955 | 958 | .rendered_html ol ol ol{list-style:lower-alpha;margin:0em 2em;} |
|
956 | 959 | .rendered_html ol ol ol ol{list-style:lower-roman;margin:0em 2em;} |
|
957 | 960 | .rendered_html ol ol ol ol ol{list-style:decimal;margin:0em 2em;} |
|
958 | 961 | .rendered_html hr{color:black;background-color:black;} |
|
959 | 962 | .rendered_html pre{margin:1em 2em;} |
|
960 | 963 | .rendered_html blockquote{margin:1em 2em;} |
|
961 | 964 | .rendered_html table,.rendered_html tr,.rendered_html th,.rendered_html td{border:1px solid black;border-collapse:collapse;margin:1em 2em;} |
|
962 | 965 | .rendered_html td,.rendered_html th{text-align:left;vertical-align:middle;padding:4px;} |
|
963 | 966 | .rendered_html th{font-weight:bold;} |
|
964 | 967 | .rendered_html p{text-align:justify;} |
|
965 | 968 | .rendered_html p+p{margin-top:1em;} |
|
966 | 969 | .corner-all{border-radius:4px;} |
|
967 | 970 | @-moz-keyframes fadeOut{from{opacity:1;} to{opacity:0;}}@-webkit-keyframes fadeOut{from{opacity:1;} to{opacity:0;}}@-moz-keyframes fadeIn{from{opacity:0;} to{opacity:1;}}@-webkit-keyframes fadeIn{from{opacity:0;} to{opacity:1;}}.bigtooltip{overflow:auto;height:200px;-webkit-transition-property:height;-webkit-transition-duration:500ms;-moz-transition-property:height;-moz-transition-duration:500ms;transition-property:height;transition-duration:500ms;} |
|
968 | 971 | .smalltooltip{-webkit-transition-property:height;-webkit-transition-duration:500ms;-moz-transition-property:height;-moz-transition-duration:500ms;transition-property:height;transition-duration:500ms;text-overflow:ellipsis;overflow:hidden;height:80px;} |
|
969 | 972 | .tooltipbuttons{position:absolute;padding-right:15px;top:0px;right:0px;} |
|
970 | 973 | .tooltiptext{padding-right:30px;} |
|
971 | 974 | .ipython_tooltip{max-width:700px;-webkit-animation:fadeOut 400ms;-moz-animation:fadeOut 400ms;animation:fadeOut 400ms;-webkit-animation:fadeIn 400ms;-moz-animation:fadeIn 400ms;animation:fadeIn 400ms;vertical-align:middle;background-color:#f7f7f7;overflow:visible;border:#ababab 1px solid;outline:none;padding:3px;margin:0px;padding-left:7px;font-family:monospace;min-height:50px;-moz-box-shadow:0px 6px 10px -1px #adadad;-webkit-box-shadow:0px 6px 10px -1px #adadad;box-shadow:0px 6px 10px -1px #adadad;border-radius:4px;position:absolute;}.ipython_tooltip a{float:right;} |
|
972 | 975 | .pretooltiparrow{left:0px;margin:0px;top:-16px;width:40px;height:16px;overflow:hidden;position:absolute;} |
|
973 | 976 | .pretooltiparrow:before{background-color:#f7f7f7;border:1px #ababab solid;z-index:11;content:"";position:absolute;left:15px;top:10px;width:25px;height:25px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);} |
@@ -1,425 +1,439 b'' | |||
|
1 | 1 | //---------------------------------------------------------------------------- |
|
2 | 2 | // Copyright (C) 2008-2011 The IPython Development Team |
|
3 | 3 | // |
|
4 | 4 | // Distributed under the terms of the BSD License. The full license is in |
|
5 | 5 | // the file COPYING, distributed as part of this software. |
|
6 | 6 | //---------------------------------------------------------------------------- |
|
7 | 7 | |
|
8 | 8 | //============================================================================ |
|
9 | 9 | // CodeCell |
|
10 | 10 | //============================================================================ |
|
11 | 11 | /** |
|
12 | 12 | * An extendable module that provide base functionnality to create cell for notebook. |
|
13 | 13 | * @module IPython |
|
14 | 14 | * @namespace IPython |
|
15 | 15 | * @submodule CodeCell |
|
16 | 16 | */ |
|
17 | 17 | |
|
18 | 18 | |
|
19 | 19 | /* local util for codemirror */ |
|
20 | 20 | var posEq = function(a, b) {return a.line == b.line && a.ch == b.ch;} |
|
21 | 21 | |
|
22 | 22 | /** |
|
23 | 23 | * |
|
24 | 24 | * function to delete until previous non blanking space character |
|
25 | 25 | * or first multiple of 4 tabstop. |
|
26 | 26 | * @private |
|
27 | 27 | */ |
|
28 | 28 | CodeMirror.commands.delSpaceToPrevTabStop = function(cm){ |
|
29 | 29 | var from = cm.getCursor(true), to = cm.getCursor(false), sel = !posEq(from, to); |
|
30 | 30 | if (!posEq(from, to)) {cm.replaceRange("", from, to); return} |
|
31 | 31 | var cur = cm.getCursor(), line = cm.getLine(cur.line); |
|
32 | 32 | var tabsize = cm.getOption('tabSize'); |
|
33 | 33 | var chToPrevTabStop = cur.ch-(Math.ceil(cur.ch/tabsize)-1)*tabsize; |
|
34 | 34 | var from = {ch:cur.ch-chToPrevTabStop,line:cur.line} |
|
35 | 35 | var select = cm.getRange(from,cur) |
|
36 | 36 | if( select.match(/^\ +$/) != null){ |
|
37 | 37 | cm.replaceRange("",from,cur) |
|
38 | 38 | } else { |
|
39 | 39 | cm.deleteH(-1,"char") |
|
40 | 40 | } |
|
41 | 41 | }; |
|
42 | 42 | |
|
43 | 43 | |
|
44 | 44 | var IPython = (function (IPython) { |
|
45 | 45 | "use strict"; |
|
46 | 46 | |
|
47 | 47 | var utils = IPython.utils; |
|
48 | 48 | var key = IPython.utils.keycodes; |
|
49 | 49 | CodeMirror.modeURL = "/static/codemirror/mode/%N/%N.js"; |
|
50 | 50 | |
|
51 | 51 | /** |
|
52 | 52 | * A Cell conceived to write code. |
|
53 | 53 | * |
|
54 | 54 | * The kernel doesn't have to be set at creation time, in that case |
|
55 | 55 | * it will be null and set_kernel has to be called later. |
|
56 | 56 | * @class CodeCell |
|
57 | 57 | * @extends IPython.Cell |
|
58 | 58 | * |
|
59 | 59 | * @constructor |
|
60 | 60 | * @param {Object|null} kernel |
|
61 | 61 | * @param {object|undefined} [options] |
|
62 | 62 | * @param [options.cm_config] {object} config to pass to CodeMirror |
|
63 | 63 | */ |
|
64 | 64 | var CodeCell = function (kernel, options) { |
|
65 | 65 | this.kernel = kernel || null; |
|
66 | 66 | this.code_mirror = null; |
|
67 | 67 | this.input_prompt_number = null; |
|
68 | 68 | this.collapsed = false; |
|
69 | 69 | this.default_mode = 'python'; |
|
70 | 70 | |
|
71 | 71 | |
|
72 | 72 | var cm_overwrite_options = { |
|
73 | 73 | onKeyEvent: $.proxy(this.handle_codemirror_keyevent,this) |
|
74 | 74 | }; |
|
75 | 75 | |
|
76 | 76 | options = this.mergeopt(CodeCell, options, {cm_config:cm_overwrite_options}); |
|
77 | 77 | |
|
78 | 78 | IPython.Cell.apply(this,[options]); |
|
79 | 79 | |
|
80 | 80 | var that = this; |
|
81 | 81 | this.element.focusout( |
|
82 | 82 | function() { that.auto_highlight(); } |
|
83 | 83 | ); |
|
84 | 84 | }; |
|
85 | 85 | |
|
86 | 86 | CodeCell.options_default = { |
|
87 | 87 | cm_config : { |
|
88 | 88 | extraKeys: {"Tab": "indentMore","Shift-Tab" : "indentLess",'Backspace':"delSpaceToPrevTabStop"}, |
|
89 | 89 | mode: 'python', |
|
90 | 90 | theme: 'ipython', |
|
91 | 91 | matchBrackets: true |
|
92 | 92 | } |
|
93 | 93 | }; |
|
94 | 94 | |
|
95 | 95 | |
|
96 | 96 | CodeCell.prototype = new IPython.Cell(); |
|
97 | 97 | |
|
98 | 98 | /** |
|
99 | 99 | * @method auto_highlight |
|
100 | 100 | */ |
|
101 | 101 | CodeCell.prototype.auto_highlight = function () { |
|
102 | 102 | this._auto_highlight(IPython.config.cell_magic_highlight) |
|
103 | 103 | }; |
|
104 | 104 | |
|
105 | 105 | /** @method create_element */ |
|
106 | 106 | CodeCell.prototype.create_element = function () { |
|
107 | 107 | IPython.Cell.prototype.create_element.apply(this, arguments); |
|
108 | 108 | |
|
109 | 109 | var cell = $('<div></div>').addClass('cell border-box-sizing code_cell'); |
|
110 | 110 | cell.attr('tabindex','2'); |
|
111 | 111 | |
|
112 | 112 | this.celltoolbar = new IPython.CellToolbar(this); |
|
113 | 113 | |
|
114 | 114 | var input = $('<div></div>').addClass('input'); |
|
115 | 115 | var vbox = $('<div/>').addClass('vbox box-flex1') |
|
116 | 116 | input.append($('<div/>').addClass('prompt input_prompt')); |
|
117 | 117 | vbox.append(this.celltoolbar.element); |
|
118 | 118 | var input_area = $('<div/>').addClass('input_area'); |
|
119 | 119 | this.code_mirror = CodeMirror(input_area.get(0), this.cm_config); |
|
120 | 120 | $(this.code_mirror.getInputField()).attr("spellcheck", "false"); |
|
121 | 121 | vbox.append(input_area); |
|
122 | 122 | input.append(vbox); |
|
123 | 123 | var output = $('<div></div>'); |
|
124 | 124 | cell.append(input).append(output); |
|
125 | 125 | this.element = cell; |
|
126 | 126 | this.output_area = new IPython.OutputArea(output, true); |
|
127 | 127 | |
|
128 | 128 | // construct a completer only if class exist |
|
129 | 129 | // otherwise no print view |
|
130 | 130 | if (IPython.Completer !== undefined) |
|
131 | 131 | { |
|
132 | 132 | this.completer = new IPython.Completer(this); |
|
133 | 133 | } |
|
134 | 134 | }; |
|
135 | 135 | |
|
136 | 136 | /** |
|
137 | 137 | * This method gets called in CodeMirror's onKeyDown/onKeyPress |
|
138 | 138 | * handlers and is used to provide custom key handling. Its return |
|
139 | 139 | * value is used to determine if CodeMirror should ignore the event: |
|
140 | 140 | * true = ignore, false = don't ignore. |
|
141 | 141 | * @method handle_codemirror_keyevent |
|
142 | 142 | */ |
|
143 | 143 | CodeCell.prototype.handle_codemirror_keyevent = function (editor, event) { |
|
144 | 144 | |
|
145 | 145 | if (this.read_only){ |
|
146 | 146 | return false; |
|
147 | 147 | } |
|
148 | 148 | |
|
149 | 149 | var that = this; |
|
150 | 150 | // whatever key is pressed, first, cancel the tooltip request before |
|
151 | 151 | // they are sent, and remove tooltip if any, except for tab again |
|
152 | 152 | if (event.type === 'keydown' && event.which != key.TAB ) { |
|
153 | 153 | IPython.tooltip.remove_and_cancel_tooltip(); |
|
154 | 154 | }; |
|
155 | 155 | |
|
156 | 156 | var cur = editor.getCursor(); |
|
157 | 157 | if (event.keyCode === key.ENTER){ |
|
158 | 158 | this.auto_highlight(); |
|
159 | 159 | } |
|
160 | 160 | |
|
161 | 161 | if (event.keyCode === key.ENTER && (event.shiftKey || event.ctrlKey)) { |
|
162 | 162 | // Always ignore shift-enter in CodeMirror as we handle it. |
|
163 | 163 | return true; |
|
164 | 164 | } else if (event.which === 40 && event.type === 'keypress' && IPython.tooltip.time_before_tooltip >= 0) { |
|
165 | 165 | // triger on keypress (!) otherwise inconsistent event.which depending on plateform |
|
166 | 166 | // browser and keyboard layout ! |
|
167 | 167 | // Pressing '(' , request tooltip, don't forget to reappend it |
|
168 | 168 | IPython.tooltip.pending(that); |
|
169 | 169 | } else if (event.which === key.UPARROW && event.type === 'keydown') { |
|
170 | 170 | // If we are not at the top, let CM handle the up arrow and |
|
171 | 171 | // prevent the global keydown handler from handling it. |
|
172 | 172 | if (!that.at_top()) { |
|
173 | 173 | event.stop(); |
|
174 | 174 | return false; |
|
175 | 175 | } else { |
|
176 | 176 | return true; |
|
177 | 177 | }; |
|
178 | 178 | } else if (event.which === key.ESC) { |
|
179 | 179 | IPython.tooltip.remove_and_cancel_tooltip(true); |
|
180 | 180 | return true; |
|
181 | 181 | } else if (event.which === key.DOWNARROW && event.type === 'keydown') { |
|
182 | 182 | // If we are not at the bottom, let CM handle the down arrow and |
|
183 | 183 | // prevent the global keydown handler from handling it. |
|
184 | 184 | if (!that.at_bottom()) { |
|
185 | 185 | event.stop(); |
|
186 | 186 | return false; |
|
187 | 187 | } else { |
|
188 | 188 | return true; |
|
189 | 189 | }; |
|
190 | 190 | } else if (event.keyCode === key.TAB && event.type == 'keydown' && event.shiftKey) { |
|
191 | 191 | if (editor.somethingSelected()){ |
|
192 | 192 | var anchor = editor.getCursor("anchor"); |
|
193 | 193 | var head = editor.getCursor("head"); |
|
194 | 194 | if( anchor.line != head.line){ |
|
195 | 195 | return false; |
|
196 | 196 | } |
|
197 | 197 | } |
|
198 | 198 | IPython.tooltip.request(that); |
|
199 | 199 | event.stop(); |
|
200 | 200 | return true; |
|
201 | 201 | } else if (event.keyCode === key.TAB && event.type == 'keydown') { |
|
202 | 202 | // Tab completion. |
|
203 | 203 | //Do not trim here because of tooltip |
|
204 | 204 | if (editor.somethingSelected()){return false} |
|
205 | 205 | var pre_cursor = editor.getRange({line:cur.line,ch:0},cur); |
|
206 | 206 | if (pre_cursor.trim() === "") { |
|
207 | 207 | // Don't autocomplete if the part of the line before the cursor |
|
208 | 208 | // is empty. In this case, let CodeMirror handle indentation. |
|
209 | 209 | return false; |
|
210 | 210 | } else if ((pre_cursor.substr(-1) === "("|| pre_cursor.substr(-1) === " ") && IPython.config.tooltip_on_tab ) { |
|
211 | 211 | IPython.tooltip.request(that); |
|
212 | 212 | // Prevent the event from bubbling up. |
|
213 | 213 | event.stop(); |
|
214 | 214 | // Prevent CodeMirror from handling the tab. |
|
215 | 215 | return true; |
|
216 | 216 | } else { |
|
217 | 217 | event.stop(); |
|
218 | 218 | this.completer.startCompletion(); |
|
219 | 219 | return true; |
|
220 | 220 | }; |
|
221 | 221 | } else { |
|
222 | 222 | // keypress/keyup also trigger on TAB press, and we don't want to |
|
223 | 223 | // use those to disable tab completion. |
|
224 | 224 | return false; |
|
225 | 225 | }; |
|
226 | 226 | return false; |
|
227 | 227 | }; |
|
228 | 228 | |
|
229 | 229 | |
|
230 | 230 | // Kernel related calls. |
|
231 | 231 | |
|
232 | 232 | CodeCell.prototype.set_kernel = function (kernel) { |
|
233 | 233 | this.kernel = kernel; |
|
234 | 234 | } |
|
235 | 235 | |
|
236 | 236 | /** |
|
237 | 237 | * Execute current code cell to the kernel |
|
238 | 238 | * @method execute |
|
239 | 239 | */ |
|
240 | 240 | CodeCell.prototype.execute = function () { |
|
241 | 241 | this.output_area.clear_output(true, true, true); |
|
242 | 242 | this.set_input_prompt('*'); |
|
243 | 243 | this.element.addClass("running"); |
|
244 | 244 | var callbacks = { |
|
245 | 245 | 'execute_reply': $.proxy(this._handle_execute_reply, this), |
|
246 | 246 | 'output': $.proxy(this.output_area.handle_output, this.output_area), |
|
247 | 247 | 'clear_output': $.proxy(this.output_area.handle_clear_output, this.output_area), |
|
248 | 'set_next_input': $.proxy(this._handle_set_next_input, this) | |
|
248 | 'set_next_input': $.proxy(this._handle_set_next_input, this), | |
|
249 | 'input_request': $.proxy(this._handle_input_request, this) | |
|
249 | 250 | }; |
|
250 | 251 | var msg_id = this.kernel.execute(this.get_text(), callbacks, {silent: false}); |
|
251 | 252 | }; |
|
252 | 253 | |
|
253 | 254 | /** |
|
254 | 255 | * @method _handle_execute_reply |
|
255 | 256 | * @private |
|
256 | 257 | */ |
|
257 | 258 | CodeCell.prototype._handle_execute_reply = function (content) { |
|
258 | 259 | this.set_input_prompt(content.execution_count); |
|
259 | 260 | this.element.removeClass("running"); |
|
260 | 261 | $([IPython.events]).trigger('set_dirty.Notebook', {'value': true}); |
|
261 | 262 | } |
|
262 | 263 | |
|
264 | /** | |
|
265 | * @method _handle_set_next_input | |
|
266 | * @private | |
|
267 | */ | |
|
263 | 268 | CodeCell.prototype._handle_set_next_input = function (text) { |
|
264 | 269 | var data = {'cell': this, 'text': text} |
|
265 | 270 | $([IPython.events]).trigger('set_next_input.Notebook', data); |
|
266 | 271 | } |
|
272 | ||
|
273 | /** | |
|
274 | * @method _handle_input_request | |
|
275 | * @private | |
|
276 | */ | |
|
277 | CodeCell.prototype._handle_input_request = function (content) { | |
|
278 | this.output_area.append_raw_input(content); | |
|
279 | } | |
|
280 | ||
|
267 | 281 | |
|
268 | 282 | // Basic cell manipulation. |
|
269 | 283 | |
|
270 | 284 | CodeCell.prototype.select = function () { |
|
271 | 285 | IPython.Cell.prototype.select.apply(this); |
|
272 | 286 | this.code_mirror.refresh(); |
|
273 | 287 | this.code_mirror.focus(); |
|
274 | 288 | this.auto_highlight(); |
|
275 | 289 | // We used to need an additional refresh() after the focus, but |
|
276 | 290 | // it appears that this has been fixed in CM. This bug would show |
|
277 | 291 | // up on FF when a newly loaded markdown cell was edited. |
|
278 | 292 | }; |
|
279 | 293 | |
|
280 | 294 | |
|
281 | 295 | CodeCell.prototype.select_all = function () { |
|
282 | 296 | var start = {line: 0, ch: 0}; |
|
283 | 297 | var nlines = this.code_mirror.lineCount(); |
|
284 | 298 | var last_line = this.code_mirror.getLine(nlines-1); |
|
285 | 299 | var end = {line: nlines-1, ch: last_line.length}; |
|
286 | 300 | this.code_mirror.setSelection(start, end); |
|
287 | 301 | }; |
|
288 | 302 | |
|
289 | 303 | |
|
290 | 304 | CodeCell.prototype.collapse = function () { |
|
291 | 305 | this.collapsed = true; |
|
292 | 306 | this.output_area.collapse(); |
|
293 | 307 | }; |
|
294 | 308 | |
|
295 | 309 | |
|
296 | 310 | CodeCell.prototype.expand = function () { |
|
297 | 311 | this.collapsed = false; |
|
298 | 312 | this.output_area.expand(); |
|
299 | 313 | }; |
|
300 | 314 | |
|
301 | 315 | |
|
302 | 316 | CodeCell.prototype.toggle_output = function () { |
|
303 | 317 | this.collapsed = Boolean(1 - this.collapsed); |
|
304 | 318 | this.output_area.toggle_output(); |
|
305 | 319 | }; |
|
306 | 320 | |
|
307 | 321 | |
|
308 | 322 | CodeCell.prototype.toggle_output_scroll = function () { |
|
309 | 323 | this.output_area.toggle_scroll(); |
|
310 | 324 | }; |
|
311 | 325 | |
|
312 | 326 | |
|
313 | 327 | CodeCell.input_prompt_classical = function (prompt_value, lines_number) { |
|
314 | 328 | var ns = prompt_value || " "; |
|
315 | 329 | return 'In [' + ns + ']:' |
|
316 | 330 | }; |
|
317 | 331 | |
|
318 | 332 | CodeCell.input_prompt_continuation = function (prompt_value, lines_number) { |
|
319 | 333 | var html = [CodeCell.input_prompt_classical(prompt_value, lines_number)]; |
|
320 | 334 | for(var i=1; i < lines_number; i++){html.push(['...:'])}; |
|
321 | 335 | return html.join('</br>') |
|
322 | 336 | }; |
|
323 | 337 | |
|
324 | 338 | CodeCell.input_prompt_function = CodeCell.input_prompt_classical; |
|
325 | 339 | |
|
326 | 340 | |
|
327 | 341 | CodeCell.prototype.set_input_prompt = function (number) { |
|
328 | 342 | var nline = 1 |
|
329 | 343 | if( this.code_mirror != undefined) { |
|
330 | 344 | nline = this.code_mirror.lineCount(); |
|
331 | 345 | } |
|
332 | 346 | this.input_prompt_number = number; |
|
333 | 347 | var prompt_html = CodeCell.input_prompt_function(this.input_prompt_number, nline); |
|
334 | 348 | this.element.find('div.input_prompt').html(prompt_html); |
|
335 | 349 | }; |
|
336 | 350 | |
|
337 | 351 | |
|
338 | 352 | CodeCell.prototype.clear_input = function () { |
|
339 | 353 | this.code_mirror.setValue(''); |
|
340 | 354 | }; |
|
341 | 355 | |
|
342 | 356 | |
|
343 | 357 | CodeCell.prototype.get_text = function () { |
|
344 | 358 | return this.code_mirror.getValue(); |
|
345 | 359 | }; |
|
346 | 360 | |
|
347 | 361 | |
|
348 | 362 | CodeCell.prototype.set_text = function (code) { |
|
349 | 363 | return this.code_mirror.setValue(code); |
|
350 | 364 | }; |
|
351 | 365 | |
|
352 | 366 | |
|
353 | 367 | CodeCell.prototype.at_top = function () { |
|
354 | 368 | var cursor = this.code_mirror.getCursor(); |
|
355 | 369 | if (cursor.line === 0 && cursor.ch === 0) { |
|
356 | 370 | return true; |
|
357 | 371 | } else { |
|
358 | 372 | return false; |
|
359 | 373 | } |
|
360 | 374 | }; |
|
361 | 375 | |
|
362 | 376 | |
|
363 | 377 | CodeCell.prototype.at_bottom = function () { |
|
364 | 378 | var cursor = this.code_mirror.getCursor(); |
|
365 | 379 | if (cursor.line === (this.code_mirror.lineCount()-1) && cursor.ch === this.code_mirror.getLine(cursor.line).length) { |
|
366 | 380 | return true; |
|
367 | 381 | } else { |
|
368 | 382 | return false; |
|
369 | 383 | } |
|
370 | 384 | }; |
|
371 | 385 | |
|
372 | 386 | |
|
373 | 387 | CodeCell.prototype.clear_output = function (stdout, stderr, other) { |
|
374 | 388 | this.output_area.clear_output(stdout, stderr, other); |
|
375 | 389 | }; |
|
376 | 390 | |
|
377 | 391 | |
|
378 | 392 | // JSON serialization |
|
379 | 393 | |
|
380 | 394 | CodeCell.prototype.fromJSON = function (data) { |
|
381 | 395 | IPython.Cell.prototype.fromJSON.apply(this, arguments); |
|
382 | 396 | if (data.cell_type === 'code') { |
|
383 | 397 | if (data.input !== undefined) { |
|
384 | 398 | this.set_text(data.input); |
|
385 | 399 | // make this value the starting point, so that we can only undo |
|
386 | 400 | // to this state, instead of a blank cell |
|
387 | 401 | this.code_mirror.clearHistory(); |
|
388 | 402 | this.auto_highlight(); |
|
389 | 403 | } |
|
390 | 404 | if (data.prompt_number !== undefined) { |
|
391 | 405 | this.set_input_prompt(data.prompt_number); |
|
392 | 406 | } else { |
|
393 | 407 | this.set_input_prompt(); |
|
394 | 408 | }; |
|
395 | 409 | this.output_area.fromJSON(data.outputs); |
|
396 | 410 | if (data.collapsed !== undefined) { |
|
397 | 411 | if (data.collapsed) { |
|
398 | 412 | this.collapse(); |
|
399 | 413 | } else { |
|
400 | 414 | this.expand(); |
|
401 | 415 | }; |
|
402 | 416 | }; |
|
403 | 417 | }; |
|
404 | 418 | }; |
|
405 | 419 | |
|
406 | 420 | |
|
407 | 421 | CodeCell.prototype.toJSON = function () { |
|
408 | 422 | var data = IPython.Cell.prototype.toJSON.apply(this); |
|
409 | 423 | data.input = this.get_text(); |
|
410 | 424 | data.cell_type = 'code'; |
|
411 | 425 | if (this.input_prompt_number) { |
|
412 | 426 | data.prompt_number = this.input_prompt_number; |
|
413 | 427 | }; |
|
414 | 428 | var outputs = this.output_area.toJSON(); |
|
415 | 429 | data.outputs = outputs; |
|
416 | 430 | data.language = 'python'; |
|
417 | 431 | data.collapsed = this.collapsed; |
|
418 | 432 | return data; |
|
419 | 433 | }; |
|
420 | 434 | |
|
421 | 435 | |
|
422 | 436 | IPython.CodeCell = CodeCell; |
|
423 | 437 | |
|
424 | 438 | return IPython; |
|
425 | 439 | }(IPython)); |
@@ -1,468 +1,479 b'' | |||
|
1 | 1 | //---------------------------------------------------------------------------- |
|
2 | 2 | // Copyright (C) 2008-2011 The IPython Development Team |
|
3 | 3 | // |
|
4 | 4 | // Distributed under the terms of the BSD License. The full license is in |
|
5 | 5 | // the file COPYING, distributed as part of this software. |
|
6 | 6 | //---------------------------------------------------------------------------- |
|
7 | 7 | |
|
8 | 8 | //============================================================================ |
|
9 | 9 | // Kernel |
|
10 | 10 | //============================================================================ |
|
11 | 11 | |
|
12 | 12 | /** |
|
13 | 13 | * @module IPython |
|
14 | 14 | * @namespace IPython |
|
15 | 15 | * @submodule Kernel |
|
16 | 16 | */ |
|
17 | 17 | |
|
18 | 18 | var IPython = (function (IPython) { |
|
19 | 19 | |
|
20 | 20 | var utils = IPython.utils; |
|
21 | 21 | |
|
22 | 22 | // Initialization and connection. |
|
23 | 23 | /** |
|
24 | 24 | * A Kernel Class to communicate with the Python kernel |
|
25 | 25 | * @Class Kernel |
|
26 | 26 | */ |
|
27 | 27 | var Kernel = function (base_url) { |
|
28 | 28 | this.kernel_id = null; |
|
29 | 29 | this.shell_channel = null; |
|
30 | 30 | this.iopub_channel = null; |
|
31 | 31 | this.stdin_channel = null; |
|
32 | 32 | this.base_url = base_url; |
|
33 | 33 | this.running = false; |
|
34 | 34 | this.username = "username"; |
|
35 | 35 | this.session_id = utils.uuid(); |
|
36 | 36 | this._msg_callbacks = {}; |
|
37 | 37 | |
|
38 | 38 | if (typeof(WebSocket) !== 'undefined') { |
|
39 | 39 | this.WebSocket = WebSocket; |
|
40 | 40 | } else if (typeof(MozWebSocket) !== 'undefined') { |
|
41 | 41 | this.WebSocket = MozWebSocket; |
|
42 | 42 | } else { |
|
43 | 43 | alert('Your browser does not have WebSocket support, please try Chrome, Safari or Firefox β₯ 6. Firefox 4 and 5 are also supported by you have to enable WebSockets in about:config.'); |
|
44 | 44 | }; |
|
45 | 45 | }; |
|
46 | 46 | |
|
47 | 47 | |
|
48 | 48 | Kernel.prototype._get_msg = function (msg_type, content) { |
|
49 | 49 | var msg = { |
|
50 | 50 | header : { |
|
51 | 51 | msg_id : utils.uuid(), |
|
52 | 52 | username : this.username, |
|
53 | 53 | session : this.session_id, |
|
54 | 54 | msg_type : msg_type |
|
55 | 55 | }, |
|
56 | 56 | metadata : {}, |
|
57 | 57 | content : content, |
|
58 | 58 | parent_header : {} |
|
59 | 59 | }; |
|
60 | 60 | return msg; |
|
61 | 61 | }; |
|
62 | 62 | |
|
63 | 63 | /** |
|
64 | 64 | * Start the Python kernel |
|
65 | 65 | * @method start |
|
66 | 66 | */ |
|
67 | 67 | Kernel.prototype.start = function (notebook_id) { |
|
68 | 68 | var that = this; |
|
69 | 69 | if (!this.running) { |
|
70 | 70 | var qs = $.param({notebook:notebook_id}); |
|
71 | 71 | var url = this.base_url + '?' + qs; |
|
72 | 72 | $.post(url, |
|
73 | 73 | $.proxy(that._kernel_started,that), |
|
74 | 74 | 'json' |
|
75 | 75 | ); |
|
76 | 76 | }; |
|
77 | 77 | }; |
|
78 | 78 | |
|
79 | 79 | /** |
|
80 | 80 | * Restart the python kernel. |
|
81 | 81 | * |
|
82 | 82 | * Emit a 'status_restarting.Kernel' event with |
|
83 | 83 | * the current object as parameter |
|
84 | 84 | * |
|
85 | 85 | * @method restart |
|
86 | 86 | */ |
|
87 | 87 | Kernel.prototype.restart = function () { |
|
88 | 88 | $([IPython.events]).trigger('status_restarting.Kernel', {kernel: this}); |
|
89 | 89 | var that = this; |
|
90 | 90 | if (this.running) { |
|
91 | 91 | this.stop_channels(); |
|
92 | 92 | var url = this.kernel_url + "/restart"; |
|
93 | 93 | $.post(url, |
|
94 | 94 | $.proxy(that._kernel_started, that), |
|
95 | 95 | 'json' |
|
96 | 96 | ); |
|
97 | 97 | }; |
|
98 | 98 | }; |
|
99 | 99 | |
|
100 | 100 | |
|
101 | 101 | Kernel.prototype._kernel_started = function (json) { |
|
102 | 102 | console.log("Kernel started: ", json.kernel_id); |
|
103 | 103 | this.running = true; |
|
104 | 104 | this.kernel_id = json.kernel_id; |
|
105 | 105 | this.ws_url = json.ws_url; |
|
106 | 106 | this.kernel_url = this.base_url + "/" + this.kernel_id; |
|
107 | 107 | this.start_channels(); |
|
108 | 108 | $([IPython.events]).trigger('status_started.Kernel', {kernel: this}); |
|
109 | 109 | }; |
|
110 | 110 | |
|
111 | 111 | |
|
112 | 112 | Kernel.prototype._websocket_closed = function(ws_url, early) { |
|
113 | 113 | this.stop_channels(); |
|
114 | 114 | $([IPython.events]).trigger('websocket_closed.Kernel', |
|
115 | 115 | {ws_url: ws_url, kernel: this, early: early} |
|
116 | 116 | ); |
|
117 | 117 | }; |
|
118 | 118 | |
|
119 | 119 | /** |
|
120 | 120 | * Start the `shell`and `iopub` channels. |
|
121 | 121 | * Will stop and restart them if they already exist. |
|
122 | 122 | * |
|
123 | 123 | * @method start_channels |
|
124 | 124 | */ |
|
125 | 125 | Kernel.prototype.start_channels = function () { |
|
126 | 126 | var that = this; |
|
127 | 127 | this.stop_channels(); |
|
128 | 128 | var ws_url = this.ws_url + this.kernel_url; |
|
129 | 129 | console.log("Starting WebSockets:", ws_url); |
|
130 | 130 | this.shell_channel = new this.WebSocket(ws_url + "/shell"); |
|
131 | 131 | this.stdin_channel = new this.WebSocket(ws_url + "/stdin"); |
|
132 | 132 | this.iopub_channel = new this.WebSocket(ws_url + "/iopub"); |
|
133 | 133 | send_cookie = function(){ |
|
134 | 134 | this.send(that.session_id + ':' + document.cookie); |
|
135 | 135 | }; |
|
136 | 136 | var already_called_onclose = false; // only alert once |
|
137 | 137 | var ws_closed_early = function(evt){ |
|
138 | 138 | if (already_called_onclose){ |
|
139 | 139 | return; |
|
140 | 140 | } |
|
141 | 141 | already_called_onclose = true; |
|
142 | 142 | if ( ! evt.wasClean ){ |
|
143 | 143 | that._websocket_closed(ws_url, true); |
|
144 | 144 | } |
|
145 | 145 | }; |
|
146 | 146 | var ws_closed_late = function(evt){ |
|
147 | 147 | if (already_called_onclose){ |
|
148 | 148 | return; |
|
149 | 149 | } |
|
150 | 150 | already_called_onclose = true; |
|
151 | 151 | if ( ! evt.wasClean ){ |
|
152 | 152 | that._websocket_closed(ws_url, false); |
|
153 | 153 | } |
|
154 | 154 | }; |
|
155 | 155 | var channels = [this.shell_channel, this.iopub_channel, this.stdin_channel]; |
|
156 | 156 | for (var i=0; i < channels.length; i++) { |
|
157 | 157 | channels[i].onopen = send_cookie; |
|
158 | 158 | channels[i].onclose = ws_closed_early; |
|
159 | 159 | } |
|
160 | 160 | // switch from early-close to late-close message after 1s |
|
161 | 161 | setTimeout(function() { |
|
162 | 162 | for (var i=0; i < channels.length; i++) { |
|
163 | 163 | if (channels[i] !== null) { |
|
164 | 164 | channels[i].onclose = ws_closed_late; |
|
165 | 165 | } |
|
166 | 166 | } |
|
167 | 167 | }, 1000); |
|
168 | 168 | this.shell_channel.onmessage = $.proxy(this._handle_shell_reply, this); |
|
169 | 169 | this.iopub_channel.onmessage = $.proxy(this._handle_iopub_reply, this); |
|
170 | 170 | this.stdin_channel.onmessage = $.proxy(this._handle_input_request, this); |
|
171 | ||
|
172 | $([IPython.events]).on('send_input_reply.Kernel', function(evt, data) { | |
|
173 | that.send_input_reply(data); | |
|
174 | }); | |
|
171 | 175 | }; |
|
172 | 176 | |
|
173 | 177 | /** |
|
174 | 178 | * Start the `shell`and `iopub` channels. |
|
175 | 179 | * @method stop_channels |
|
176 | 180 | */ |
|
177 | 181 | Kernel.prototype.stop_channels = function () { |
|
178 | 182 | var channels = [this.shell_channel, this.iopub_channel, this.stdin_channel]; |
|
179 | 183 | for (var i=0; i < channels.length; i++) { |
|
180 | 184 | if ( channels[i] !== null ) { |
|
181 | 185 | channels[i].onclose = function (evt) {}; |
|
182 | 186 | channels[i].close(); |
|
183 | 187 | } |
|
184 | 188 | }; |
|
185 | 189 | this.shell_channel = this.iopub_channel = this.stdin_channel = null; |
|
186 | 190 | }; |
|
187 | 191 | |
|
188 | 192 | // Main public methods. |
|
189 | 193 | |
|
190 | 194 | /** |
|
191 | 195 | * Get info on object asynchronoulsy |
|
192 | 196 | * |
|
193 | 197 | * @async |
|
194 | 198 | * @param objname {string} |
|
195 | 199 | * @param callback {dict} |
|
196 | 200 | * @method object_info_request |
|
197 | 201 | * |
|
198 | 202 | * @example |
|
199 | 203 | * |
|
200 | 204 | * When calling this method pass a callbacks structure of the form: |
|
201 | 205 | * |
|
202 | 206 | * callbacks = { |
|
203 | 207 | * 'object_info_reply': object_info_reply_callback |
|
204 | 208 | * } |
|
205 | 209 | * |
|
206 | 210 | * The `object_info_reply_callback` will be passed the content object of the |
|
207 | 211 | * |
|
208 | 212 | * `object_into_reply` message documented in |
|
209 | 213 | * [IPython dev documentation](http://ipython.org/ipython-doc/dev/development/messaging.html#object-information) |
|
210 | 214 | */ |
|
211 | 215 | Kernel.prototype.object_info_request = function (objname, callbacks) { |
|
212 | 216 | if(typeof(objname)!=null && objname!=null) |
|
213 | 217 | { |
|
214 | 218 | var content = { |
|
215 | 219 | oname : objname.toString(), |
|
216 | 220 | }; |
|
217 | 221 | var msg = this._get_msg("object_info_request", content); |
|
218 | 222 | this.shell_channel.send(JSON.stringify(msg)); |
|
219 | 223 | this.set_callbacks_for_msg(msg.header.msg_id, callbacks); |
|
220 | 224 | return msg.header.msg_id; |
|
221 | 225 | } |
|
222 | 226 | return; |
|
223 | 227 | } |
|
224 | 228 | |
|
225 | 229 | /** |
|
226 | 230 | * Execute given code into kernel, and pass result to callback. |
|
227 | 231 | * |
|
228 | 232 | * @async |
|
229 | 233 | * @method execute |
|
230 | 234 | * @param {string} code |
|
231 | 235 | * @param callback {Object} With the following keys |
|
232 | 236 | * @param callback.'execute_reply' {function} |
|
233 | 237 | * @param callback.'output' {function} |
|
234 | 238 | * @param callback.'clear_output' {function} |
|
235 | 239 | * @param callback.'set_next_input' {function} |
|
236 | 240 | * @param {object} [options] |
|
237 | 241 | * @param [options.silent=false] {Boolean} |
|
238 | 242 | * @param [options.user_expressions=empty_dict] {Dict} |
|
239 | 243 | * @param [options.user_variables=empty_list] {List od Strings} |
|
240 | 244 | * @param [options.allow_stdin=false] {Boolean} true|false |
|
241 | 245 | * |
|
242 | 246 | * @example |
|
243 | 247 | * |
|
244 | 248 | * The options object should contain the options for the execute call. Its default |
|
245 | 249 | * values are: |
|
246 | 250 | * |
|
247 | 251 | * options = { |
|
248 | 252 | * silent : true, |
|
249 | 253 | * user_variables : [], |
|
250 | 254 | * user_expressions : {}, |
|
251 | 255 | * allow_stdin : false |
|
252 | 256 | * } |
|
253 | 257 | * |
|
254 | 258 | * When calling this method pass a callbacks structure of the form: |
|
255 | 259 | * |
|
256 | 260 | * callbacks = { |
|
257 | 261 | * 'execute_reply': execute_reply_callback, |
|
258 | 262 | * 'output': output_callback, |
|
259 | 263 | * 'clear_output': clear_output_callback, |
|
260 | 264 | * 'set_next_input': set_next_input_callback |
|
261 | 265 | * } |
|
262 | 266 | * |
|
263 | 267 | * The `execute_reply_callback` will be passed the content and metadata |
|
264 | 268 | * objects of the `execute_reply` message documented |
|
265 | 269 | * [here](http://ipython.org/ipython-doc/dev/development/messaging.html#execute) |
|
266 | 270 | * |
|
267 | 271 | * The `output_callback` will be passed `msg_type` ('stream','display_data','pyout','pyerr') |
|
268 | 272 | * of the output and the content and metadata objects of the PUB/SUB channel that contains the |
|
269 | 273 | * output: |
|
270 | 274 | * |
|
271 | 275 | * http://ipython.org/ipython-doc/dev/development/messaging.html#messages-on-the-pub-sub-socket |
|
272 | 276 | * |
|
273 | 277 | * The `clear_output_callback` will be passed a content object that contains |
|
274 | 278 | * stdout, stderr and other fields that are booleans, as well as the metadata object. |
|
275 | 279 | * |
|
276 | 280 | * The `set_next_input_callback` will be passed the text that should become the next |
|
277 | 281 | * input cell. |
|
278 | 282 | */ |
|
279 | 283 | Kernel.prototype.execute = function (code, callbacks, options) { |
|
280 | 284 | |
|
281 | 285 | var content = { |
|
282 | 286 | code : code, |
|
283 | 287 | silent : true, |
|
284 | 288 | user_variables : [], |
|
285 | 289 | user_expressions : {}, |
|
286 |
allow_stdin : |
|
|
290 | allow_stdin : false | |
|
287 | 291 | }; |
|
292 | if (callbacks.input_request !== undefined) { | |
|
293 | content.allow_stdin = true; | |
|
294 | } | |
|
288 | 295 | $.extend(true, content, options) |
|
289 | 296 | $([IPython.events]).trigger('execution_request.Kernel', {kernel: this, content:content}); |
|
290 | 297 | var msg = this._get_msg("execute_request", content); |
|
291 | 298 | this.shell_channel.send(JSON.stringify(msg)); |
|
292 | 299 | this.set_callbacks_for_msg(msg.header.msg_id, callbacks); |
|
293 | 300 | return msg.header.msg_id; |
|
294 | 301 | }; |
|
295 | 302 | |
|
296 | 303 | /** |
|
297 | 304 | * When calling this method pass a callbacks structure of the form: |
|
298 | 305 | * |
|
299 | 306 | * callbacks = { |
|
300 | 307 | * 'complete_reply': complete_reply_callback |
|
301 | 308 | * } |
|
302 | 309 | * |
|
303 | 310 | * The `complete_reply_callback` will be passed the content object of the |
|
304 | 311 | * `complete_reply` message documented |
|
305 | 312 | * [here](http://ipython.org/ipython-doc/dev/development/messaging.html#complete) |
|
306 | 313 | * |
|
307 | 314 | * @method complete |
|
308 | 315 | * @param line {integer} |
|
309 | 316 | * @param cursor_pos {integer} |
|
310 | 317 | * @param {dict} callbacks |
|
311 | 318 | * @param callbacks.complete_reply {function} `complete_reply_callback` |
|
312 | 319 | * |
|
313 | 320 | */ |
|
314 | 321 | Kernel.prototype.complete = function (line, cursor_pos, callbacks) { |
|
315 | 322 | callbacks = callbacks || {}; |
|
316 | 323 | var content = { |
|
317 | 324 | text : '', |
|
318 | 325 | line : line, |
|
319 | 326 | cursor_pos : cursor_pos |
|
320 | 327 | }; |
|
321 | 328 | var msg = this._get_msg("complete_request", content); |
|
322 | 329 | this.shell_channel.send(JSON.stringify(msg)); |
|
323 | 330 | this.set_callbacks_for_msg(msg.header.msg_id, callbacks); |
|
324 | 331 | return msg.header.msg_id; |
|
325 | 332 | }; |
|
326 | 333 | |
|
327 | 334 | |
|
328 | 335 | Kernel.prototype.interrupt = function () { |
|
329 | 336 | if (this.running) { |
|
330 | 337 | $([IPython.events]).trigger('status_interrupting.Kernel', {kernel: this}); |
|
331 | 338 | $.post(this.kernel_url + "/interrupt"); |
|
332 | 339 | }; |
|
333 | 340 | }; |
|
334 | 341 | |
|
335 | 342 | |
|
336 | 343 | Kernel.prototype.kill = function () { |
|
337 | 344 | if (this.running) { |
|
338 | 345 | this.running = false; |
|
339 | 346 | var settings = { |
|
340 | 347 | cache : false, |
|
341 | 348 | type : "DELETE" |
|
342 | 349 | }; |
|
343 | 350 | $.ajax(this.kernel_url, settings); |
|
344 | 351 | }; |
|
345 | 352 | }; |
|
346 | 353 | |
|
347 |
Kernel.prototype.send_input_reply = function (input |
|
|
348 | ||
|
354 | Kernel.prototype.send_input_reply = function (input) { | |
|
349 | 355 | var content = { |
|
350 | 356 | value : input, |
|
351 | 357 | }; |
|
352 | 358 | $([IPython.events]).trigger('input_reply.Kernel', {kernel: this, content:content}); |
|
353 | 359 | var msg = this._get_msg("input_reply", content); |
|
354 | 360 | this.stdin_channel.send(JSON.stringify(msg)); |
|
355 | 361 | return msg.header.msg_id; |
|
356 | 362 | }; |
|
357 | 363 | |
|
358 | 364 | |
|
359 | 365 | // Reply handlers |
|
360 | 366 | |
|
361 | 367 | Kernel.prototype.get_callbacks_for_msg = function (msg_id) { |
|
362 | 368 | var callbacks = this._msg_callbacks[msg_id]; |
|
363 | 369 | return callbacks; |
|
364 | 370 | }; |
|
365 | 371 | |
|
366 | 372 | |
|
367 | 373 | Kernel.prototype.set_callbacks_for_msg = function (msg_id, callbacks) { |
|
368 | 374 | this._msg_callbacks[msg_id] = callbacks || {}; |
|
369 | 375 | } |
|
370 | 376 | |
|
371 | 377 | |
|
372 | 378 | Kernel.prototype._handle_shell_reply = function (e) { |
|
373 | 379 | var reply = $.parseJSON(e.data); |
|
374 | 380 | $([IPython.events]).trigger('shell_reply.Kernel', {kernel: this, reply:reply}); |
|
375 | 381 | var header = reply.header; |
|
376 | 382 | var content = reply.content; |
|
377 | 383 | var metadata = reply.metadata; |
|
378 | 384 | var msg_type = header.msg_type; |
|
379 | 385 | var callbacks = this.get_callbacks_for_msg(reply.parent_header.msg_id); |
|
380 | 386 | if (callbacks !== undefined) { |
|
381 | 387 | var cb = callbacks[msg_type]; |
|
382 | 388 | if (cb !== undefined) { |
|
383 | 389 | cb(content, metadata); |
|
384 | 390 | } |
|
385 | 391 | }; |
|
386 | 392 | |
|
387 | 393 | if (content.payload !== undefined) { |
|
388 | 394 | var payload = content.payload || []; |
|
389 | 395 | this._handle_payload(callbacks, payload); |
|
390 | 396 | } |
|
391 | 397 | }; |
|
392 | 398 | |
|
393 | 399 | |
|
394 | 400 | Kernel.prototype._handle_payload = function (callbacks, payload) { |
|
395 | 401 | var l = payload.length; |
|
396 | 402 | // Payloads are handled by triggering events because we don't want the Kernel |
|
397 | 403 | // to depend on the Notebook or Pager classes. |
|
398 | 404 | for (var i=0; i<l; i++) { |
|
399 | 405 | if (payload[i].source === 'IPython.kernel.zmq.page.page') { |
|
400 | 406 | var data = {'text':payload[i].text} |
|
401 | 407 | $([IPython.events]).trigger('open_with_text.Pager', data); |
|
402 | 408 | } else if (payload[i].source === 'IPython.kernel.zmq.zmqshell.ZMQInteractiveShell.set_next_input') { |
|
403 | 409 | if (callbacks.set_next_input !== undefined) { |
|
404 | 410 | callbacks.set_next_input(payload[i].text) |
|
405 | 411 | } |
|
406 | 412 | } |
|
407 | 413 | }; |
|
408 | 414 | }; |
|
409 | 415 | |
|
410 | 416 | |
|
411 | 417 | Kernel.prototype._handle_iopub_reply = function (e) { |
|
412 | 418 | var reply = $.parseJSON(e.data); |
|
413 | 419 | var content = reply.content; |
|
414 | 420 | var msg_type = reply.header.msg_type; |
|
415 | 421 | var metadata = reply.metadata; |
|
416 | 422 | var callbacks = this.get_callbacks_for_msg(reply.parent_header.msg_id); |
|
417 | 423 | if (msg_type !== 'status' && callbacks === undefined) { |
|
418 | 424 | // Message not from one of this notebook's cells and there are no |
|
419 | 425 | // callbacks to handle it. |
|
420 | 426 | return; |
|
421 | 427 | } |
|
422 | 428 | var output_types = ['stream','display_data','pyout','pyerr']; |
|
423 | 429 | if (output_types.indexOf(msg_type) >= 0) { |
|
424 | 430 | var cb = callbacks['output']; |
|
425 | 431 | if (cb !== undefined) { |
|
426 | 432 | cb(msg_type, content, metadata); |
|
427 | 433 | } |
|
428 | 434 | } else if (msg_type === 'status') { |
|
429 | 435 | if (content.execution_state === 'busy') { |
|
430 | 436 | $([IPython.events]).trigger('status_busy.Kernel', {kernel: this}); |
|
431 | 437 | } else if (content.execution_state === 'idle') { |
|
432 | 438 | $([IPython.events]).trigger('status_idle.Kernel', {kernel: this}); |
|
433 | 439 | } else if (content.execution_state === 'restarting') { |
|
434 | 440 | $([IPython.events]).trigger('status_restarting.Kernel', {kernel: this}); |
|
435 | 441 | } else if (content.execution_state === 'dead') { |
|
436 | 442 | this.stop_channels(); |
|
437 | 443 | $([IPython.events]).trigger('status_dead.Kernel', {kernel: this}); |
|
438 | 444 | }; |
|
439 | 445 | } else if (msg_type === 'clear_output') { |
|
440 | 446 | var cb = callbacks['clear_output']; |
|
441 | 447 | if (cb !== undefined) { |
|
442 | 448 | cb(content, metadata); |
|
443 | 449 | } |
|
444 | 450 | }; |
|
445 | 451 | }; |
|
446 | 452 | |
|
447 | 453 | |
|
448 | 454 | Kernel.prototype._handle_input_request = function (e) { |
|
449 | 455 | var request = $.parseJSON(e.data); |
|
450 | console.log("input", request); | |
|
451 | 456 | var header = request.header; |
|
452 | 457 | var content = request.content; |
|
453 | 458 | var metadata = request.metadata; |
|
454 | 459 | var msg_type = header.msg_type; |
|
455 | 460 | if (msg_type !== 'input_request') { |
|
456 | 461 | console.log("Invalid input request!", request); |
|
457 | 462 | return; |
|
458 | 463 | } |
|
459 | $([IPython.events]).trigger('input_request.Kernel', {kernel: this, request:request}); | |
|
464 | var callbacks = this.get_callbacks_for_msg(request.parent_header.msg_id); | |
|
465 | if (callbacks !== undefined) { | |
|
466 | var cb = callbacks[msg_type]; | |
|
467 | if (cb !== undefined) { | |
|
468 | cb(content, metadata); | |
|
469 | } | |
|
470 | }; | |
|
460 | 471 | }; |
|
461 | 472 | |
|
462 | 473 | |
|
463 | 474 | IPython.Kernel = Kernel; |
|
464 | 475 | |
|
465 | 476 | return IPython; |
|
466 | 477 | |
|
467 | 478 | }(IPython)); |
|
468 | 479 |
@@ -1,1810 +1,1782 b'' | |||
|
1 | 1 | //---------------------------------------------------------------------------- |
|
2 | 2 | // Copyright (C) 2008-2011 The IPython Development Team |
|
3 | 3 | // |
|
4 | 4 | // Distributed under the terms of the BSD License. The full license is in |
|
5 | 5 | // the file COPYING, distributed as part of this software. |
|
6 | 6 | //---------------------------------------------------------------------------- |
|
7 | 7 | |
|
8 | 8 | //============================================================================ |
|
9 | 9 | // Notebook |
|
10 | 10 | //============================================================================ |
|
11 | 11 | |
|
12 | 12 | var IPython = (function (IPython) { |
|
13 | 13 | |
|
14 | 14 | var utils = IPython.utils; |
|
15 | 15 | var key = IPython.utils.keycodes; |
|
16 | 16 | |
|
17 | 17 | /** |
|
18 | 18 | * A notebook contains and manages cells. |
|
19 | 19 | * |
|
20 | 20 | * @class Notebook |
|
21 | 21 | * @constructor |
|
22 | 22 | * @param {String} selector A jQuery selector for the notebook's DOM element |
|
23 | 23 | * @param {Object} [options] A config object |
|
24 | 24 | */ |
|
25 | 25 | var Notebook = function (selector, options) { |
|
26 | 26 | var options = options || {}; |
|
27 | 27 | this._baseProjectUrl = options.baseProjectUrl; |
|
28 | 28 | this.read_only = options.read_only || IPython.read_only; |
|
29 | 29 | |
|
30 | 30 | this.element = $(selector); |
|
31 | 31 | this.element.scroll(); |
|
32 | 32 | this.element.data("notebook", this); |
|
33 | 33 | this.next_prompt_number = 1; |
|
34 | 34 | this.kernel = null; |
|
35 | 35 | this.clipboard = null; |
|
36 | 36 | this.undelete_backup = null; |
|
37 | 37 | this.undelete_index = null; |
|
38 | 38 | this.undelete_below = false; |
|
39 | 39 | this.paste_enabled = false; |
|
40 | 40 | this.dirty = false; |
|
41 | 41 | this.metadata = {}; |
|
42 | 42 | // single worksheet for now |
|
43 | 43 | this.worksheet_metadata = {}; |
|
44 | 44 | this.control_key_active = false; |
|
45 | 45 | this.notebook_id = null; |
|
46 | 46 | this.notebook_name = null; |
|
47 | 47 | this.notebook_name_blacklist_re = /[\/\\:]/; |
|
48 | 48 | this.nbformat = 3 // Increment this when changing the nbformat |
|
49 | 49 | this.nbformat_minor = 0 // Increment this when changing the nbformat |
|
50 | 50 | this.style(); |
|
51 | 51 | this.create_elements(); |
|
52 | 52 | this.bind_events(); |
|
53 | 53 | }; |
|
54 | 54 | |
|
55 | 55 | /** |
|
56 | 56 | * Tweak the notebook's CSS style. |
|
57 | 57 | * |
|
58 | 58 | * @method style |
|
59 | 59 | */ |
|
60 | 60 | Notebook.prototype.style = function () { |
|
61 | 61 | $('div#notebook').addClass('border-box-sizing'); |
|
62 | 62 | }; |
|
63 | 63 | |
|
64 | 64 | /** |
|
65 | 65 | * Get the root URL of the notebook server. |
|
66 | 66 | * |
|
67 | 67 | * @method baseProjectUrl |
|
68 | 68 | * @return {String} The base project URL |
|
69 | 69 | */ |
|
70 | 70 | Notebook.prototype.baseProjectUrl = function(){ |
|
71 | 71 | return this._baseProjectUrl || $('body').data('baseProjectUrl'); |
|
72 | 72 | }; |
|
73 | 73 | |
|
74 | 74 | /** |
|
75 | 75 | * Create an HTML and CSS representation of the notebook. |
|
76 | 76 | * |
|
77 | 77 | * @method create_elements |
|
78 | 78 | */ |
|
79 | 79 | Notebook.prototype.create_elements = function () { |
|
80 | 80 | // We add this end_space div to the end of the notebook div to: |
|
81 | 81 | // i) provide a margin between the last cell and the end of the notebook |
|
82 | 82 | // ii) to prevent the div from scrolling up when the last cell is being |
|
83 | 83 | // edited, but is too low on the page, which browsers will do automatically. |
|
84 | 84 | var that = this; |
|
85 | 85 | var end_space = $('<div/>').addClass('end_space').height("30%"); |
|
86 | 86 | end_space.dblclick(function (e) { |
|
87 | 87 | if (that.read_only) return; |
|
88 | 88 | var ncells = that.ncells(); |
|
89 | 89 | that.insert_cell_below('code',ncells-1); |
|
90 | 90 | }); |
|
91 | 91 | this.element.append(end_space); |
|
92 | 92 | $('div#notebook').addClass('border-box-sizing'); |
|
93 | 93 | }; |
|
94 | 94 | |
|
95 | 95 | /** |
|
96 | 96 | * Bind JavaScript events: key presses and custom IPython events. |
|
97 | 97 | * |
|
98 | 98 | * @method bind_events |
|
99 | 99 | */ |
|
100 | 100 | Notebook.prototype.bind_events = function () { |
|
101 | 101 | var that = this; |
|
102 | 102 | |
|
103 | 103 | $([IPython.events]).on('set_next_input.Notebook', function (event, data) { |
|
104 | 104 | var index = that.find_cell_index(data.cell); |
|
105 | 105 | var new_cell = that.insert_cell_below('code',index); |
|
106 | 106 | new_cell.set_text(data.text); |
|
107 | 107 | that.dirty = true; |
|
108 | 108 | }); |
|
109 | 109 | |
|
110 | 110 | $([IPython.events]).on('set_dirty.Notebook', function (event, data) { |
|
111 | 111 | that.dirty = data.value; |
|
112 | 112 | }); |
|
113 | 113 | |
|
114 | 114 | $([IPython.events]).on('select.Cell', function (event, data) { |
|
115 | 115 | var index = that.find_cell_index(data.cell); |
|
116 | 116 | that.select(index); |
|
117 | 117 | }); |
|
118 | $([IPython.events]).on('input_request.Kernel', function (event, data) { | |
|
119 | var dialog = $('<div/>').attr('id','input_form').append( | |
|
120 | $('<form/>') | |
|
121 | .attr("action", "javascript:$('#input_form').parent().find('button').click();") | |
|
122 | .append( | |
|
123 | $('<input/>') | |
|
124 | .attr('id', 'input_prompt_dialog') | |
|
125 | .attr('type', 'text') | |
|
126 | .attr('name', 'input') | |
|
127 | )); | |
|
128 | $(document).append(dialog); | |
|
129 | dialog.dialog({ | |
|
130 | resizable: false, | |
|
131 | modal: true, | |
|
132 | title: data.request.content.prompt, | |
|
133 | closeText: '', | |
|
134 | buttons : { | |
|
135 | "Okay": function () { | |
|
136 | IPython.notebook.kernel.send_input_reply( | |
|
137 | $("input#input_prompt_dialog").attr('value'), | |
|
138 | data.request.header | |
|
139 | ); | |
|
140 | $(this).dialog('close'); | |
|
141 | dialog.remove(); | |
|
142 | } | |
|
143 | } | |
|
144 | }); | |
|
145 | }); | |
|
146 | 118 | |
|
147 | 119 | |
|
148 | 120 | $(document).keydown(function (event) { |
|
149 | 121 | // console.log(event); |
|
150 | 122 | if (that.read_only) return true; |
|
151 | 123 | |
|
152 | 124 | // Save (CTRL+S) or (AppleKey+S) |
|
153 | 125 | //metaKey = applekey on mac |
|
154 | 126 | if ((event.ctrlKey || event.metaKey) && event.keyCode==83) { |
|
155 | 127 | that.save_notebook(); |
|
156 | 128 | event.preventDefault(); |
|
157 | 129 | return false; |
|
158 | 130 | } else if (event.which === key.ESC) { |
|
159 | 131 | // Intercept escape at highest level to avoid closing |
|
160 | 132 | // websocket connection with firefox |
|
161 | 133 | event.preventDefault(); |
|
162 | 134 | } else if (event.which === key.SHIFT) { |
|
163 | 135 | // ignore shift keydown |
|
164 | 136 | return true; |
|
165 | 137 | } |
|
166 | 138 | if (event.which === key.UPARROW && !event.shiftKey) { |
|
167 | 139 | var cell = that.get_selected_cell(); |
|
168 | 140 | if (cell && cell.at_top()) { |
|
169 | 141 | event.preventDefault(); |
|
170 | 142 | that.select_prev(); |
|
171 | 143 | }; |
|
172 | 144 | } else if (event.which === key.DOWNARROW && !event.shiftKey) { |
|
173 | 145 | var cell = that.get_selected_cell(); |
|
174 | 146 | if (cell && cell.at_bottom()) { |
|
175 | 147 | event.preventDefault(); |
|
176 | 148 | that.select_next(); |
|
177 | 149 | }; |
|
178 | 150 | } else if (event.which === key.ENTER && event.shiftKey) { |
|
179 | 151 | that.execute_selected_cell(); |
|
180 | 152 | return false; |
|
181 | 153 | } else if (event.which === key.ENTER && event.altKey) { |
|
182 | 154 | // Execute code cell, and insert new in place |
|
183 | 155 | that.execute_selected_cell(); |
|
184 | 156 | // Only insert a new cell, if we ended up in an already populated cell |
|
185 | 157 | if (/\S/.test(that.get_selected_cell().get_text()) == true) { |
|
186 | 158 | that.insert_cell_above('code'); |
|
187 | 159 | } |
|
188 | 160 | return false; |
|
189 | 161 | } else if (event.which === key.ENTER && event.ctrlKey) { |
|
190 | 162 | that.execute_selected_cell({terminal:true}); |
|
191 | 163 | return false; |
|
192 | 164 | } else if (event.which === 77 && event.ctrlKey && that.control_key_active == false) { |
|
193 | 165 | that.control_key_active = true; |
|
194 | 166 | return false; |
|
195 | 167 | } else if (event.which === 88 && that.control_key_active) { |
|
196 | 168 | // Cut selected cell = x |
|
197 | 169 | that.cut_cell(); |
|
198 | 170 | that.control_key_active = false; |
|
199 | 171 | return false; |
|
200 | 172 | } else if (event.which === 67 && that.control_key_active) { |
|
201 | 173 | // Copy selected cell = c |
|
202 | 174 | that.copy_cell(); |
|
203 | 175 | that.control_key_active = false; |
|
204 | 176 | return false; |
|
205 | 177 | } else if (event.which === 86 && that.control_key_active) { |
|
206 | 178 | // Paste below selected cell = v |
|
207 | 179 | that.paste_cell_below(); |
|
208 | 180 | that.control_key_active = false; |
|
209 | 181 | return false; |
|
210 | 182 | } else if (event.which === 68 && that.control_key_active) { |
|
211 | 183 | // Delete selected cell = d |
|
212 | 184 | that.delete_cell(); |
|
213 | 185 | that.control_key_active = false; |
|
214 | 186 | return false; |
|
215 | 187 | } else if (event.which === 65 && that.control_key_active) { |
|
216 | 188 | // Insert code cell above selected = a |
|
217 | 189 | that.insert_cell_above('code'); |
|
218 | 190 | that.control_key_active = false; |
|
219 | 191 | return false; |
|
220 | 192 | } else if (event.which === 66 && that.control_key_active) { |
|
221 | 193 | // Insert code cell below selected = b |
|
222 | 194 | that.insert_cell_below('code'); |
|
223 | 195 | that.control_key_active = false; |
|
224 | 196 | return false; |
|
225 | 197 | } else if (event.which === 89 && that.control_key_active) { |
|
226 | 198 | // To code = y |
|
227 | 199 | that.to_code(); |
|
228 | 200 | that.control_key_active = false; |
|
229 | 201 | return false; |
|
230 | 202 | } else if (event.which === 77 && that.control_key_active) { |
|
231 | 203 | // To markdown = m |
|
232 | 204 | that.to_markdown(); |
|
233 | 205 | that.control_key_active = false; |
|
234 | 206 | return false; |
|
235 | 207 | } else if (event.which === 84 && that.control_key_active) { |
|
236 | 208 | // To Raw = t |
|
237 | 209 | that.to_raw(); |
|
238 | 210 | that.control_key_active = false; |
|
239 | 211 | return false; |
|
240 | 212 | } else if (event.which === 49 && that.control_key_active) { |
|
241 | 213 | // To Heading 1 = 1 |
|
242 | 214 | that.to_heading(undefined, 1); |
|
243 | 215 | that.control_key_active = false; |
|
244 | 216 | return false; |
|
245 | 217 | } else if (event.which === 50 && that.control_key_active) { |
|
246 | 218 | // To Heading 2 = 2 |
|
247 | 219 | that.to_heading(undefined, 2); |
|
248 | 220 | that.control_key_active = false; |
|
249 | 221 | return false; |
|
250 | 222 | } else if (event.which === 51 && that.control_key_active) { |
|
251 | 223 | // To Heading 3 = 3 |
|
252 | 224 | that.to_heading(undefined, 3); |
|
253 | 225 | that.control_key_active = false; |
|
254 | 226 | return false; |
|
255 | 227 | } else if (event.which === 52 && that.control_key_active) { |
|
256 | 228 | // To Heading 4 = 4 |
|
257 | 229 | that.to_heading(undefined, 4); |
|
258 | 230 | that.control_key_active = false; |
|
259 | 231 | return false; |
|
260 | 232 | } else if (event.which === 53 && that.control_key_active) { |
|
261 | 233 | // To Heading 5 = 5 |
|
262 | 234 | that.to_heading(undefined, 5); |
|
263 | 235 | that.control_key_active = false; |
|
264 | 236 | return false; |
|
265 | 237 | } else if (event.which === 54 && that.control_key_active) { |
|
266 | 238 | // To Heading 6 = 6 |
|
267 | 239 | that.to_heading(undefined, 6); |
|
268 | 240 | that.control_key_active = false; |
|
269 | 241 | return false; |
|
270 | 242 | } else if (event.which === 79 && that.control_key_active) { |
|
271 | 243 | // Toggle output = o |
|
272 | 244 | if (event.shiftKey){ |
|
273 | 245 | that.toggle_output_scroll(); |
|
274 | 246 | } else { |
|
275 | 247 | that.toggle_output(); |
|
276 | 248 | } |
|
277 | 249 | that.control_key_active = false; |
|
278 | 250 | return false; |
|
279 | 251 | } else if (event.which === 83 && that.control_key_active) { |
|
280 | 252 | // Save notebook = s |
|
281 | 253 | that.save_notebook(); |
|
282 | 254 | that.control_key_active = false; |
|
283 | 255 | return false; |
|
284 | 256 | } else if (event.which === 74 && that.control_key_active) { |
|
285 | 257 | // Move cell down = j |
|
286 | 258 | that.move_cell_down(); |
|
287 | 259 | that.control_key_active = false; |
|
288 | 260 | return false; |
|
289 | 261 | } else if (event.which === 75 && that.control_key_active) { |
|
290 | 262 | // Move cell up = k |
|
291 | 263 | that.move_cell_up(); |
|
292 | 264 | that.control_key_active = false; |
|
293 | 265 | return false; |
|
294 | 266 | } else if (event.which === 80 && that.control_key_active) { |
|
295 | 267 | // Select previous = p |
|
296 | 268 | that.select_prev(); |
|
297 | 269 | that.control_key_active = false; |
|
298 | 270 | return false; |
|
299 | 271 | } else if (event.which === 78 && that.control_key_active) { |
|
300 | 272 | // Select next = n |
|
301 | 273 | that.select_next(); |
|
302 | 274 | that.control_key_active = false; |
|
303 | 275 | return false; |
|
304 | 276 | } else if (event.which === 76 && that.control_key_active) { |
|
305 | 277 | // Toggle line numbers = l |
|
306 | 278 | that.cell_toggle_line_numbers(); |
|
307 | 279 | that.control_key_active = false; |
|
308 | 280 | return false; |
|
309 | 281 | } else if (event.which === 73 && that.control_key_active) { |
|
310 | 282 | // Interrupt kernel = i |
|
311 | 283 | that.kernel.interrupt(); |
|
312 | 284 | that.control_key_active = false; |
|
313 | 285 | return false; |
|
314 | 286 | } else if (event.which === 190 && that.control_key_active) { |
|
315 | 287 | // Restart kernel = . # matches qt console |
|
316 | 288 | that.restart_kernel(); |
|
317 | 289 | that.control_key_active = false; |
|
318 | 290 | return false; |
|
319 | 291 | } else if (event.which === 72 && that.control_key_active) { |
|
320 | 292 | // Show keyboard shortcuts = h |
|
321 | 293 | IPython.quick_help.show_keyboard_shortcuts(); |
|
322 | 294 | that.control_key_active = false; |
|
323 | 295 | return false; |
|
324 | 296 | } else if (event.which === 90 && that.control_key_active) { |
|
325 | 297 | // Undo last cell delete = z |
|
326 | 298 | that.undelete(); |
|
327 | 299 | that.control_key_active = false; |
|
328 | 300 | return false; |
|
329 | 301 | } else if (that.control_key_active) { |
|
330 | 302 | that.control_key_active = false; |
|
331 | 303 | return true; |
|
332 | 304 | }; |
|
333 | 305 | return true; |
|
334 | 306 | }); |
|
335 | 307 | |
|
336 | 308 | var collapse_time = function(time){ |
|
337 | 309 | var app_height = $('#ipython-main-app').height(); // content height |
|
338 | 310 | var splitter_height = $('div#pager_splitter').outerHeight(true); |
|
339 | 311 | var new_height = app_height - splitter_height; |
|
340 | 312 | that.element.animate({height : new_height + 'px'}, time); |
|
341 | 313 | } |
|
342 | 314 | |
|
343 | 315 | this.element.bind('collapse_pager', function (event,extrap) { |
|
344 | 316 | var time = (extrap != undefined) ? ((extrap.duration != undefined ) ? extrap.duration : 'fast') : 'fast'; |
|
345 | 317 | collapse_time(time); |
|
346 | 318 | }); |
|
347 | 319 | |
|
348 | 320 | var expand_time = function(time) { |
|
349 | 321 | var app_height = $('#ipython-main-app').height(); // content height |
|
350 | 322 | var splitter_height = $('div#pager_splitter').outerHeight(true); |
|
351 | 323 | var pager_height = $('div#pager').outerHeight(true); |
|
352 | 324 | var new_height = app_height - pager_height - splitter_height; |
|
353 | 325 | that.element.animate({height : new_height + 'px'}, time); |
|
354 | 326 | } |
|
355 | 327 | |
|
356 | 328 | this.element.bind('expand_pager', function (event, extrap) { |
|
357 | 329 | var time = (extrap != undefined) ? ((extrap.duration != undefined ) ? extrap.duration : 'fast') : 'fast'; |
|
358 | 330 | expand_time(time); |
|
359 | 331 | }); |
|
360 | 332 | |
|
361 | 333 | $(window).bind('beforeunload', function () { |
|
362 | 334 | // TODO: Make killing the kernel configurable. |
|
363 | 335 | var kill_kernel = false; |
|
364 | 336 | if (kill_kernel) { |
|
365 | 337 | that.kernel.kill(); |
|
366 | 338 | } |
|
367 | 339 | if (that.dirty && ! that.read_only) { |
|
368 | 340 | return "You have unsaved changes that will be lost if you leave this page."; |
|
369 | 341 | }; |
|
370 | 342 | // Null is the *only* return value that will make the browser not |
|
371 | 343 | // pop up the "don't leave" dialog. |
|
372 | 344 | return null; |
|
373 | 345 | }); |
|
374 | 346 | }; |
|
375 | 347 | |
|
376 | 348 | /** |
|
377 | 349 | * Scroll the top of the page to a given cell. |
|
378 | 350 | * |
|
379 | 351 | * @method scroll_to_cell |
|
380 | 352 | * @param {Number} cell_number An index of the cell to view |
|
381 | 353 | * @param {Number} time Animation time in milliseconds |
|
382 | 354 | * @return {Number} Pixel offset from the top of the container |
|
383 | 355 | */ |
|
384 | 356 | Notebook.prototype.scroll_to_cell = function (cell_number, time) { |
|
385 | 357 | var cells = this.get_cells(); |
|
386 | 358 | var time = time || 0; |
|
387 | 359 | cell_number = Math.min(cells.length-1,cell_number); |
|
388 | 360 | cell_number = Math.max(0 ,cell_number); |
|
389 | 361 | var scroll_value = cells[cell_number].element.position().top-cells[0].element.position().top ; |
|
390 | 362 | this.element.animate({scrollTop:scroll_value}, time); |
|
391 | 363 | return scroll_value; |
|
392 | 364 | }; |
|
393 | 365 | |
|
394 | 366 | /** |
|
395 | 367 | * Scroll to the bottom of the page. |
|
396 | 368 | * |
|
397 | 369 | * @method scroll_to_bottom |
|
398 | 370 | */ |
|
399 | 371 | Notebook.prototype.scroll_to_bottom = function () { |
|
400 | 372 | this.element.animate({scrollTop:this.element.get(0).scrollHeight}, 0); |
|
401 | 373 | }; |
|
402 | 374 | |
|
403 | 375 | /** |
|
404 | 376 | * Scroll to the top of the page. |
|
405 | 377 | * |
|
406 | 378 | * @method scroll_to_top |
|
407 | 379 | */ |
|
408 | 380 | Notebook.prototype.scroll_to_top = function () { |
|
409 | 381 | this.element.animate({scrollTop:0}, 0); |
|
410 | 382 | }; |
|
411 | 383 | |
|
412 | 384 | |
|
413 | 385 | // Cell indexing, retrieval, etc. |
|
414 | 386 | |
|
415 | 387 | /** |
|
416 | 388 | * Get all cell elements in the notebook. |
|
417 | 389 | * |
|
418 | 390 | * @method get_cell_elements |
|
419 | 391 | * @return {jQuery} A selector of all cell elements |
|
420 | 392 | */ |
|
421 | 393 | Notebook.prototype.get_cell_elements = function () { |
|
422 | 394 | return this.element.children("div.cell"); |
|
423 | 395 | }; |
|
424 | 396 | |
|
425 | 397 | /** |
|
426 | 398 | * Get a particular cell element. |
|
427 | 399 | * |
|
428 | 400 | * @method get_cell_element |
|
429 | 401 | * @param {Number} index An index of a cell to select |
|
430 | 402 | * @return {jQuery} A selector of the given cell. |
|
431 | 403 | */ |
|
432 | 404 | Notebook.prototype.get_cell_element = function (index) { |
|
433 | 405 | var result = null; |
|
434 | 406 | var e = this.get_cell_elements().eq(index); |
|
435 | 407 | if (e.length !== 0) { |
|
436 | 408 | result = e; |
|
437 | 409 | } |
|
438 | 410 | return result; |
|
439 | 411 | }; |
|
440 | 412 | |
|
441 | 413 | /** |
|
442 | 414 | * Count the cells in this notebook. |
|
443 | 415 | * |
|
444 | 416 | * @method ncells |
|
445 | 417 | * @return {Number} The number of cells in this notebook |
|
446 | 418 | */ |
|
447 | 419 | Notebook.prototype.ncells = function () { |
|
448 | 420 | return this.get_cell_elements().length; |
|
449 | 421 | }; |
|
450 | 422 | |
|
451 | 423 | /** |
|
452 | 424 | * Get all Cell objects in this notebook. |
|
453 | 425 | * |
|
454 | 426 | * @method get_cells |
|
455 | 427 | * @return {Array} This notebook's Cell objects |
|
456 | 428 | */ |
|
457 | 429 | // TODO: we are often calling cells as cells()[i], which we should optimize |
|
458 | 430 | // to cells(i) or a new method. |
|
459 | 431 | Notebook.prototype.get_cells = function () { |
|
460 | 432 | return this.get_cell_elements().toArray().map(function (e) { |
|
461 | 433 | return $(e).data("cell"); |
|
462 | 434 | }); |
|
463 | 435 | }; |
|
464 | 436 | |
|
465 | 437 | /** |
|
466 | 438 | * Get a Cell object from this notebook. |
|
467 | 439 | * |
|
468 | 440 | * @method get_cell |
|
469 | 441 | * @param {Number} index An index of a cell to retrieve |
|
470 | 442 | * @return {Cell} A particular cell |
|
471 | 443 | */ |
|
472 | 444 | Notebook.prototype.get_cell = function (index) { |
|
473 | 445 | var result = null; |
|
474 | 446 | var ce = this.get_cell_element(index); |
|
475 | 447 | if (ce !== null) { |
|
476 | 448 | result = ce.data('cell'); |
|
477 | 449 | } |
|
478 | 450 | return result; |
|
479 | 451 | } |
|
480 | 452 | |
|
481 | 453 | /** |
|
482 | 454 | * Get the cell below a given cell. |
|
483 | 455 | * |
|
484 | 456 | * @method get_next_cell |
|
485 | 457 | * @param {Cell} cell The provided cell |
|
486 | 458 | * @return {Cell} The next cell |
|
487 | 459 | */ |
|
488 | 460 | Notebook.prototype.get_next_cell = function (cell) { |
|
489 | 461 | var result = null; |
|
490 | 462 | var index = this.find_cell_index(cell); |
|
491 | 463 | if (this.is_valid_cell_index(index+1)) { |
|
492 | 464 | result = this.get_cell(index+1); |
|
493 | 465 | } |
|
494 | 466 | return result; |
|
495 | 467 | } |
|
496 | 468 | |
|
497 | 469 | /** |
|
498 | 470 | * Get the cell above a given cell. |
|
499 | 471 | * |
|
500 | 472 | * @method get_prev_cell |
|
501 | 473 | * @param {Cell} cell The provided cell |
|
502 | 474 | * @return {Cell} The previous cell |
|
503 | 475 | */ |
|
504 | 476 | Notebook.prototype.get_prev_cell = function (cell) { |
|
505 | 477 | // TODO: off-by-one |
|
506 | 478 | // nb.get_prev_cell(nb.get_cell(1)) is null |
|
507 | 479 | var result = null; |
|
508 | 480 | var index = this.find_cell_index(cell); |
|
509 | 481 | if (index !== null && index > 1) { |
|
510 | 482 | result = this.get_cell(index-1); |
|
511 | 483 | } |
|
512 | 484 | return result; |
|
513 | 485 | } |
|
514 | 486 | |
|
515 | 487 | /** |
|
516 | 488 | * Get the numeric index of a given cell. |
|
517 | 489 | * |
|
518 | 490 | * @method find_cell_index |
|
519 | 491 | * @param {Cell} cell The provided cell |
|
520 | 492 | * @return {Number} The cell's numeric index |
|
521 | 493 | */ |
|
522 | 494 | Notebook.prototype.find_cell_index = function (cell) { |
|
523 | 495 | var result = null; |
|
524 | 496 | this.get_cell_elements().filter(function (index) { |
|
525 | 497 | if ($(this).data("cell") === cell) { |
|
526 | 498 | result = index; |
|
527 | 499 | }; |
|
528 | 500 | }); |
|
529 | 501 | return result; |
|
530 | 502 | }; |
|
531 | 503 | |
|
532 | 504 | /** |
|
533 | 505 | * Get a given index , or the selected index if none is provided. |
|
534 | 506 | * |
|
535 | 507 | * @method index_or_selected |
|
536 | 508 | * @param {Number} index A cell's index |
|
537 | 509 | * @return {Number} The given index, or selected index if none is provided. |
|
538 | 510 | */ |
|
539 | 511 | Notebook.prototype.index_or_selected = function (index) { |
|
540 | 512 | var i; |
|
541 | 513 | if (index === undefined || index === null) { |
|
542 | 514 | i = this.get_selected_index(); |
|
543 | 515 | if (i === null) { |
|
544 | 516 | i = 0; |
|
545 | 517 | } |
|
546 | 518 | } else { |
|
547 | 519 | i = index; |
|
548 | 520 | } |
|
549 | 521 | return i; |
|
550 | 522 | }; |
|
551 | 523 | |
|
552 | 524 | /** |
|
553 | 525 | * Get the currently selected cell. |
|
554 | 526 | * @method get_selected_cell |
|
555 | 527 | * @return {Cell} The selected cell |
|
556 | 528 | */ |
|
557 | 529 | Notebook.prototype.get_selected_cell = function () { |
|
558 | 530 | var index = this.get_selected_index(); |
|
559 | 531 | return this.get_cell(index); |
|
560 | 532 | }; |
|
561 | 533 | |
|
562 | 534 | /** |
|
563 | 535 | * Check whether a cell index is valid. |
|
564 | 536 | * |
|
565 | 537 | * @method is_valid_cell_index |
|
566 | 538 | * @param {Number} index A cell index |
|
567 | 539 | * @return True if the index is valid, false otherwise |
|
568 | 540 | */ |
|
569 | 541 | Notebook.prototype.is_valid_cell_index = function (index) { |
|
570 | 542 | if (index !== null && index >= 0 && index < this.ncells()) { |
|
571 | 543 | return true; |
|
572 | 544 | } else { |
|
573 | 545 | return false; |
|
574 | 546 | }; |
|
575 | 547 | } |
|
576 | 548 | |
|
577 | 549 | /** |
|
578 | 550 | * Get the index of the currently selected cell. |
|
579 | 551 | |
|
580 | 552 | * @method get_selected_index |
|
581 | 553 | * @return {Number} The selected cell's numeric index |
|
582 | 554 | */ |
|
583 | 555 | Notebook.prototype.get_selected_index = function () { |
|
584 | 556 | var result = null; |
|
585 | 557 | this.get_cell_elements().filter(function (index) { |
|
586 | 558 | if ($(this).data("cell").selected === true) { |
|
587 | 559 | result = index; |
|
588 | 560 | }; |
|
589 | 561 | }); |
|
590 | 562 | return result; |
|
591 | 563 | }; |
|
592 | 564 | |
|
593 | 565 | |
|
594 | 566 | // Cell selection. |
|
595 | 567 | |
|
596 | 568 | /** |
|
597 | 569 | * Programmatically select a cell. |
|
598 | 570 | * |
|
599 | 571 | * @method select |
|
600 | 572 | * @param {Number} index A cell's index |
|
601 | 573 | * @return {Notebook} This notebook |
|
602 | 574 | */ |
|
603 | 575 | Notebook.prototype.select = function (index) { |
|
604 | 576 | if (this.is_valid_cell_index(index)) { |
|
605 | 577 | var sindex = this.get_selected_index() |
|
606 | 578 | if (sindex !== null && index !== sindex) { |
|
607 | 579 | this.get_cell(sindex).unselect(); |
|
608 | 580 | }; |
|
609 | 581 | var cell = this.get_cell(index); |
|
610 | 582 | cell.select(); |
|
611 | 583 | if (cell.cell_type === 'heading') { |
|
612 | 584 | $([IPython.events]).trigger('selected_cell_type_changed.Notebook', |
|
613 | 585 | {'cell_type':cell.cell_type,level:cell.level} |
|
614 | 586 | ); |
|
615 | 587 | } else { |
|
616 | 588 | $([IPython.events]).trigger('selected_cell_type_changed.Notebook', |
|
617 | 589 | {'cell_type':cell.cell_type} |
|
618 | 590 | ); |
|
619 | 591 | }; |
|
620 | 592 | }; |
|
621 | 593 | return this; |
|
622 | 594 | }; |
|
623 | 595 | |
|
624 | 596 | /** |
|
625 | 597 | * Programmatically select the next cell. |
|
626 | 598 | * |
|
627 | 599 | * @method select_next |
|
628 | 600 | * @return {Notebook} This notebook |
|
629 | 601 | */ |
|
630 | 602 | Notebook.prototype.select_next = function () { |
|
631 | 603 | var index = this.get_selected_index(); |
|
632 | 604 | this.select(index+1); |
|
633 | 605 | return this; |
|
634 | 606 | }; |
|
635 | 607 | |
|
636 | 608 | /** |
|
637 | 609 | * Programmatically select the previous cell. |
|
638 | 610 | * |
|
639 | 611 | * @method select_prev |
|
640 | 612 | * @return {Notebook} This notebook |
|
641 | 613 | */ |
|
642 | 614 | Notebook.prototype.select_prev = function () { |
|
643 | 615 | var index = this.get_selected_index(); |
|
644 | 616 | this.select(index-1); |
|
645 | 617 | return this; |
|
646 | 618 | }; |
|
647 | 619 | |
|
648 | 620 | |
|
649 | 621 | // Cell movement |
|
650 | 622 | |
|
651 | 623 | /** |
|
652 | 624 | * Move given (or selected) cell up and select it. |
|
653 | 625 | * |
|
654 | 626 | * @method move_cell_up |
|
655 | 627 | * @param [index] {integer} cell index |
|
656 | 628 | * @return {Notebook} This notebook |
|
657 | 629 | **/ |
|
658 | 630 | Notebook.prototype.move_cell_up = function (index) { |
|
659 | 631 | var i = this.index_or_selected(index); |
|
660 | 632 | if (this.is_valid_cell_index(i) && i > 0) { |
|
661 | 633 | var pivot = this.get_cell_element(i-1); |
|
662 | 634 | var tomove = this.get_cell_element(i); |
|
663 | 635 | if (pivot !== null && tomove !== null) { |
|
664 | 636 | tomove.detach(); |
|
665 | 637 | pivot.before(tomove); |
|
666 | 638 | this.select(i-1); |
|
667 | 639 | }; |
|
668 | 640 | this.dirty = true; |
|
669 | 641 | }; |
|
670 | 642 | return this; |
|
671 | 643 | }; |
|
672 | 644 | |
|
673 | 645 | |
|
674 | 646 | /** |
|
675 | 647 | * Move given (or selected) cell down and select it |
|
676 | 648 | * |
|
677 | 649 | * @method move_cell_down |
|
678 | 650 | * @param [index] {integer} cell index |
|
679 | 651 | * @return {Notebook} This notebook |
|
680 | 652 | **/ |
|
681 | 653 | Notebook.prototype.move_cell_down = function (index) { |
|
682 | 654 | var i = this.index_or_selected(index); |
|
683 | 655 | if ( this.is_valid_cell_index(i) && this.is_valid_cell_index(i+1)) { |
|
684 | 656 | var pivot = this.get_cell_element(i+1); |
|
685 | 657 | var tomove = this.get_cell_element(i); |
|
686 | 658 | if (pivot !== null && tomove !== null) { |
|
687 | 659 | tomove.detach(); |
|
688 | 660 | pivot.after(tomove); |
|
689 | 661 | this.select(i+1); |
|
690 | 662 | }; |
|
691 | 663 | }; |
|
692 | 664 | this.dirty = true; |
|
693 | 665 | return this; |
|
694 | 666 | }; |
|
695 | 667 | |
|
696 | 668 | |
|
697 | 669 | // Insertion, deletion. |
|
698 | 670 | |
|
699 | 671 | /** |
|
700 | 672 | * Delete a cell from the notebook. |
|
701 | 673 | * |
|
702 | 674 | * @method delete_cell |
|
703 | 675 | * @param [index] A cell's numeric index |
|
704 | 676 | * @return {Notebook} This notebook |
|
705 | 677 | */ |
|
706 | 678 | Notebook.prototype.delete_cell = function (index) { |
|
707 | 679 | var i = this.index_or_selected(index); |
|
708 | 680 | var cell = this.get_selected_cell(); |
|
709 | 681 | this.undelete_backup = cell.toJSON(); |
|
710 | 682 | $('#undelete_cell').removeClass('ui-state-disabled'); |
|
711 | 683 | if (this.is_valid_cell_index(i)) { |
|
712 | 684 | var ce = this.get_cell_element(i); |
|
713 | 685 | ce.remove(); |
|
714 | 686 | if (i === (this.ncells())) { |
|
715 | 687 | this.select(i-1); |
|
716 | 688 | this.undelete_index = i - 1; |
|
717 | 689 | this.undelete_below = true; |
|
718 | 690 | } else { |
|
719 | 691 | this.select(i); |
|
720 | 692 | this.undelete_index = i; |
|
721 | 693 | this.undelete_below = false; |
|
722 | 694 | }; |
|
723 | 695 | this.dirty = true; |
|
724 | 696 | }; |
|
725 | 697 | return this; |
|
726 | 698 | }; |
|
727 | 699 | |
|
728 | 700 | /** |
|
729 | 701 | * Insert a cell so that after insertion the cell is at given index. |
|
730 | 702 | * |
|
731 | 703 | * Similar to insert_above, but index parameter is mandatory |
|
732 | 704 | * |
|
733 | 705 | * Index will be brought back into the accissible range [0,n] |
|
734 | 706 | * |
|
735 | 707 | * @method insert_cell_at_index |
|
736 | 708 | * @param type {string} in ['code','html','markdown','heading'] |
|
737 | 709 | * @param [index] {int} a valid index where to inser cell |
|
738 | 710 | * |
|
739 | 711 | * @return cell {cell|null} created cell or null |
|
740 | 712 | **/ |
|
741 | 713 | Notebook.prototype.insert_cell_at_index = function(type, index){ |
|
742 | 714 | |
|
743 | 715 | var ncells = this.ncells(); |
|
744 | 716 | var index = Math.min(index,ncells); |
|
745 | 717 | index = Math.max(index,0); |
|
746 | 718 | var cell = null; |
|
747 | 719 | |
|
748 | 720 | if (ncells === 0 || this.is_valid_cell_index(index) || index === ncells) { |
|
749 | 721 | if (type === 'code') { |
|
750 | 722 | cell = new IPython.CodeCell(this.kernel); |
|
751 | 723 | cell.set_input_prompt(); |
|
752 | 724 | } else if (type === 'markdown') { |
|
753 | 725 | cell = new IPython.MarkdownCell(); |
|
754 | 726 | } else if (type === 'html') { |
|
755 | 727 | cell = new IPython.HTMLCell(); |
|
756 | 728 | } else if (type === 'raw') { |
|
757 | 729 | cell = new IPython.RawCell(); |
|
758 | 730 | } else if (type === 'heading') { |
|
759 | 731 | cell = new IPython.HeadingCell(); |
|
760 | 732 | } |
|
761 | 733 | |
|
762 | 734 | if(this._insert_element_at_index(cell.element,index)){ |
|
763 | 735 | cell.render(); |
|
764 | 736 | this.select(this.find_cell_index(cell)); |
|
765 | 737 | this.dirty = true; |
|
766 | 738 | } |
|
767 | 739 | } |
|
768 | 740 | return cell; |
|
769 | 741 | |
|
770 | 742 | }; |
|
771 | 743 | |
|
772 | 744 | /** |
|
773 | 745 | * Insert an element at given cell index. |
|
774 | 746 | * |
|
775 | 747 | * @method _insert_element_at_index |
|
776 | 748 | * @param element {dom element} a cell element |
|
777 | 749 | * @param [index] {int} a valid index where to inser cell |
|
778 | 750 | * @private |
|
779 | 751 | * |
|
780 | 752 | * return true if everything whent fine. |
|
781 | 753 | **/ |
|
782 | 754 | Notebook.prototype._insert_element_at_index = function(element, index){ |
|
783 | 755 | if (element === undefined){ |
|
784 | 756 | return false; |
|
785 | 757 | } |
|
786 | 758 | |
|
787 | 759 | var ncells = this.ncells(); |
|
788 | 760 | |
|
789 | 761 | if (ncells === 0) { |
|
790 | 762 | // special case append if empty |
|
791 | 763 | this.element.find('div.end_space').before(element); |
|
792 | 764 | } else if ( ncells === index ) { |
|
793 | 765 | // special case append it the end, but not empty |
|
794 | 766 | this.get_cell_element(index-1).after(element); |
|
795 | 767 | } else if (this.is_valid_cell_index(index)) { |
|
796 | 768 | // otherwise always somewhere to append to |
|
797 | 769 | this.get_cell_element(index).before(element); |
|
798 | 770 | } else { |
|
799 | 771 | return false; |
|
800 | 772 | } |
|
801 | 773 | |
|
802 | 774 | if (this.undelete_index !== null && index <= this.undelete_index) { |
|
803 | 775 | this.undelete_index = this.undelete_index + 1; |
|
804 | 776 | this.dirty = true; |
|
805 | 777 | } |
|
806 | 778 | return true; |
|
807 | 779 | }; |
|
808 | 780 | |
|
809 | 781 | /** |
|
810 | 782 | * Insert a cell of given type above given index, or at top |
|
811 | 783 | * of notebook if index smaller than 0. |
|
812 | 784 | * |
|
813 | 785 | * default index value is the one of currently selected cell |
|
814 | 786 | * |
|
815 | 787 | * @method insert_cell_above |
|
816 | 788 | * @param type {string} cell type |
|
817 | 789 | * @param [index] {integer} |
|
818 | 790 | * |
|
819 | 791 | * @return handle to created cell or null |
|
820 | 792 | **/ |
|
821 | 793 | Notebook.prototype.insert_cell_above = function (type, index) { |
|
822 | 794 | index = this.index_or_selected(index); |
|
823 | 795 | return this.insert_cell_at_index(type, index); |
|
824 | 796 | }; |
|
825 | 797 | |
|
826 | 798 | /** |
|
827 | 799 | * Insert a cell of given type below given index, or at bottom |
|
828 | 800 | * of notebook if index greater thatn number of cell |
|
829 | 801 | * |
|
830 | 802 | * default index value is the one of currently selected cell |
|
831 | 803 | * |
|
832 | 804 | * @method insert_cell_below |
|
833 | 805 | * @param type {string} cell type |
|
834 | 806 | * @param [index] {integer} |
|
835 | 807 | * |
|
836 | 808 | * @return handle to created cell or null |
|
837 | 809 | * |
|
838 | 810 | **/ |
|
839 | 811 | Notebook.prototype.insert_cell_below = function (type, index) { |
|
840 | 812 | index = this.index_or_selected(index); |
|
841 | 813 | return this.insert_cell_at_index(type, index+1); |
|
842 | 814 | }; |
|
843 | 815 | |
|
844 | 816 | |
|
845 | 817 | /** |
|
846 | 818 | * Insert cell at end of notebook |
|
847 | 819 | * |
|
848 | 820 | * @method insert_cell_at_bottom |
|
849 | 821 | * @param {String} type cell type |
|
850 | 822 | * |
|
851 | 823 | * @return the added cell; or null |
|
852 | 824 | **/ |
|
853 | 825 | Notebook.prototype.insert_cell_at_bottom = function (type){ |
|
854 | 826 | var len = this.ncells(); |
|
855 | 827 | return this.insert_cell_below(type,len-1); |
|
856 | 828 | }; |
|
857 | 829 | |
|
858 | 830 | /** |
|
859 | 831 | * Turn a cell into a code cell. |
|
860 | 832 | * |
|
861 | 833 | * @method to_code |
|
862 | 834 | * @param {Number} [index] A cell's index |
|
863 | 835 | */ |
|
864 | 836 | Notebook.prototype.to_code = function (index) { |
|
865 | 837 | var i = this.index_or_selected(index); |
|
866 | 838 | if (this.is_valid_cell_index(i)) { |
|
867 | 839 | var source_element = this.get_cell_element(i); |
|
868 | 840 | var source_cell = source_element.data("cell"); |
|
869 | 841 | if (!(source_cell instanceof IPython.CodeCell)) { |
|
870 | 842 | var target_cell = this.insert_cell_below('code',i); |
|
871 | 843 | var text = source_cell.get_text(); |
|
872 | 844 | if (text === source_cell.placeholder) { |
|
873 | 845 | text = ''; |
|
874 | 846 | } |
|
875 | 847 | target_cell.set_text(text); |
|
876 | 848 | // make this value the starting point, so that we can only undo |
|
877 | 849 | // to this state, instead of a blank cell |
|
878 | 850 | target_cell.code_mirror.clearHistory(); |
|
879 | 851 | source_element.remove(); |
|
880 | 852 | this.dirty = true; |
|
881 | 853 | }; |
|
882 | 854 | }; |
|
883 | 855 | }; |
|
884 | 856 | |
|
885 | 857 | /** |
|
886 | 858 | * Turn a cell into a Markdown cell. |
|
887 | 859 | * |
|
888 | 860 | * @method to_markdown |
|
889 | 861 | * @param {Number} [index] A cell's index |
|
890 | 862 | */ |
|
891 | 863 | Notebook.prototype.to_markdown = function (index) { |
|
892 | 864 | var i = this.index_or_selected(index); |
|
893 | 865 | if (this.is_valid_cell_index(i)) { |
|
894 | 866 | var source_element = this.get_cell_element(i); |
|
895 | 867 | var source_cell = source_element.data("cell"); |
|
896 | 868 | if (!(source_cell instanceof IPython.MarkdownCell)) { |
|
897 | 869 | var target_cell = this.insert_cell_below('markdown',i); |
|
898 | 870 | var text = source_cell.get_text(); |
|
899 | 871 | if (text === source_cell.placeholder) { |
|
900 | 872 | text = ''; |
|
901 | 873 | }; |
|
902 | 874 | // The edit must come before the set_text. |
|
903 | 875 | target_cell.edit(); |
|
904 | 876 | target_cell.set_text(text); |
|
905 | 877 | // make this value the starting point, so that we can only undo |
|
906 | 878 | // to this state, instead of a blank cell |
|
907 | 879 | target_cell.code_mirror.clearHistory(); |
|
908 | 880 | source_element.remove(); |
|
909 | 881 | this.dirty = true; |
|
910 | 882 | }; |
|
911 | 883 | }; |
|
912 | 884 | }; |
|
913 | 885 | |
|
914 | 886 | /** |
|
915 | 887 | * Turn a cell into an HTML cell. |
|
916 | 888 | * |
|
917 | 889 | * @method to_html |
|
918 | 890 | * @param {Number} [index] A cell's index |
|
919 | 891 | */ |
|
920 | 892 | Notebook.prototype.to_html = function (index) { |
|
921 | 893 | // TODO: remove? This is never called |
|
922 | 894 | var i = this.index_or_selected(index); |
|
923 | 895 | if (this.is_valid_cell_index(i)) { |
|
924 | 896 | var source_element = this.get_cell_element(i); |
|
925 | 897 | var source_cell = source_element.data("cell"); |
|
926 | 898 | var target_cell = null; |
|
927 | 899 | if (!(source_cell instanceof IPython.HTMLCell)) { |
|
928 | 900 | target_cell = this.insert_cell_below('html',i); |
|
929 | 901 | var text = source_cell.get_text(); |
|
930 | 902 | if (text === source_cell.placeholder) { |
|
931 | 903 | text = ''; |
|
932 | 904 | }; |
|
933 | 905 | // The edit must come before the set_text. |
|
934 | 906 | target_cell.edit(); |
|
935 | 907 | target_cell.set_text(text); |
|
936 | 908 | // make this value the starting point, so that we can only undo |
|
937 | 909 | // to this state, instead of a blank cell |
|
938 | 910 | target_cell.code_mirror.clearHistory(); |
|
939 | 911 | source_element.remove(); |
|
940 | 912 | this.dirty = true; |
|
941 | 913 | }; |
|
942 | 914 | }; |
|
943 | 915 | }; |
|
944 | 916 | |
|
945 | 917 | /** |
|
946 | 918 | * Turn a cell into a raw text cell. |
|
947 | 919 | * |
|
948 | 920 | * @method to_raw |
|
949 | 921 | * @param {Number} [index] A cell's index |
|
950 | 922 | */ |
|
951 | 923 | Notebook.prototype.to_raw = function (index) { |
|
952 | 924 | var i = this.index_or_selected(index); |
|
953 | 925 | if (this.is_valid_cell_index(i)) { |
|
954 | 926 | var source_element = this.get_cell_element(i); |
|
955 | 927 | var source_cell = source_element.data("cell"); |
|
956 | 928 | var target_cell = null; |
|
957 | 929 | if (!(source_cell instanceof IPython.RawCell)) { |
|
958 | 930 | target_cell = this.insert_cell_below('raw',i); |
|
959 | 931 | var text = source_cell.get_text(); |
|
960 | 932 | if (text === source_cell.placeholder) { |
|
961 | 933 | text = ''; |
|
962 | 934 | }; |
|
963 | 935 | // The edit must come before the set_text. |
|
964 | 936 | target_cell.edit(); |
|
965 | 937 | target_cell.set_text(text); |
|
966 | 938 | // make this value the starting point, so that we can only undo |
|
967 | 939 | // to this state, instead of a blank cell |
|
968 | 940 | target_cell.code_mirror.clearHistory(); |
|
969 | 941 | source_element.remove(); |
|
970 | 942 | this.dirty = true; |
|
971 | 943 | }; |
|
972 | 944 | }; |
|
973 | 945 | }; |
|
974 | 946 | |
|
975 | 947 | /** |
|
976 | 948 | * Turn a cell into a heading cell. |
|
977 | 949 | * |
|
978 | 950 | * @method to_heading |
|
979 | 951 | * @param {Number} [index] A cell's index |
|
980 | 952 | * @param {Number} [level] A heading level (e.g., 1 becomes <h1>) |
|
981 | 953 | */ |
|
982 | 954 | Notebook.prototype.to_heading = function (index, level) { |
|
983 | 955 | level = level || 1; |
|
984 | 956 | var i = this.index_or_selected(index); |
|
985 | 957 | if (this.is_valid_cell_index(i)) { |
|
986 | 958 | var source_element = this.get_cell_element(i); |
|
987 | 959 | var source_cell = source_element.data("cell"); |
|
988 | 960 | var target_cell = null; |
|
989 | 961 | if (source_cell instanceof IPython.HeadingCell) { |
|
990 | 962 | source_cell.set_level(level); |
|
991 | 963 | } else { |
|
992 | 964 | target_cell = this.insert_cell_below('heading',i); |
|
993 | 965 | var text = source_cell.get_text(); |
|
994 | 966 | if (text === source_cell.placeholder) { |
|
995 | 967 | text = ''; |
|
996 | 968 | }; |
|
997 | 969 | // The edit must come before the set_text. |
|
998 | 970 | target_cell.set_level(level); |
|
999 | 971 | target_cell.edit(); |
|
1000 | 972 | target_cell.set_text(text); |
|
1001 | 973 | // make this value the starting point, so that we can only undo |
|
1002 | 974 | // to this state, instead of a blank cell |
|
1003 | 975 | target_cell.code_mirror.clearHistory(); |
|
1004 | 976 | source_element.remove(); |
|
1005 | 977 | this.dirty = true; |
|
1006 | 978 | }; |
|
1007 | 979 | $([IPython.events]).trigger('selected_cell_type_changed.Notebook', |
|
1008 | 980 | {'cell_type':'heading',level:level} |
|
1009 | 981 | ); |
|
1010 | 982 | }; |
|
1011 | 983 | }; |
|
1012 | 984 | |
|
1013 | 985 | |
|
1014 | 986 | // Cut/Copy/Paste |
|
1015 | 987 | |
|
1016 | 988 | /** |
|
1017 | 989 | * Enable UI elements for pasting cells. |
|
1018 | 990 | * |
|
1019 | 991 | * @method enable_paste |
|
1020 | 992 | */ |
|
1021 | 993 | Notebook.prototype.enable_paste = function () { |
|
1022 | 994 | var that = this; |
|
1023 | 995 | if (!this.paste_enabled) { |
|
1024 | 996 | $('#paste_cell_replace').removeClass('ui-state-disabled') |
|
1025 | 997 | .on('click', function () {that.paste_cell_replace();}); |
|
1026 | 998 | $('#paste_cell_above').removeClass('ui-state-disabled') |
|
1027 | 999 | .on('click', function () {that.paste_cell_above();}); |
|
1028 | 1000 | $('#paste_cell_below').removeClass('ui-state-disabled') |
|
1029 | 1001 | .on('click', function () {that.paste_cell_below();}); |
|
1030 | 1002 | this.paste_enabled = true; |
|
1031 | 1003 | }; |
|
1032 | 1004 | }; |
|
1033 | 1005 | |
|
1034 | 1006 | /** |
|
1035 | 1007 | * Disable UI elements for pasting cells. |
|
1036 | 1008 | * |
|
1037 | 1009 | * @method disable_paste |
|
1038 | 1010 | */ |
|
1039 | 1011 | Notebook.prototype.disable_paste = function () { |
|
1040 | 1012 | if (this.paste_enabled) { |
|
1041 | 1013 | $('#paste_cell_replace').addClass('ui-state-disabled').off('click'); |
|
1042 | 1014 | $('#paste_cell_above').addClass('ui-state-disabled').off('click'); |
|
1043 | 1015 | $('#paste_cell_below').addClass('ui-state-disabled').off('click'); |
|
1044 | 1016 | this.paste_enabled = false; |
|
1045 | 1017 | }; |
|
1046 | 1018 | }; |
|
1047 | 1019 | |
|
1048 | 1020 | /** |
|
1049 | 1021 | * Cut a cell. |
|
1050 | 1022 | * |
|
1051 | 1023 | * @method cut_cell |
|
1052 | 1024 | */ |
|
1053 | 1025 | Notebook.prototype.cut_cell = function () { |
|
1054 | 1026 | this.copy_cell(); |
|
1055 | 1027 | this.delete_cell(); |
|
1056 | 1028 | } |
|
1057 | 1029 | |
|
1058 | 1030 | /** |
|
1059 | 1031 | * Copy a cell. |
|
1060 | 1032 | * |
|
1061 | 1033 | * @method copy_cell |
|
1062 | 1034 | */ |
|
1063 | 1035 | Notebook.prototype.copy_cell = function () { |
|
1064 | 1036 | var cell = this.get_selected_cell(); |
|
1065 | 1037 | this.clipboard = cell.toJSON(); |
|
1066 | 1038 | this.enable_paste(); |
|
1067 | 1039 | }; |
|
1068 | 1040 | |
|
1069 | 1041 | /** |
|
1070 | 1042 | * Replace the selected cell with a cell in the clipboard. |
|
1071 | 1043 | * |
|
1072 | 1044 | * @method paste_cell_replace |
|
1073 | 1045 | */ |
|
1074 | 1046 | Notebook.prototype.paste_cell_replace = function () { |
|
1075 | 1047 | if (this.clipboard !== null && this.paste_enabled) { |
|
1076 | 1048 | var cell_data = this.clipboard; |
|
1077 | 1049 | var new_cell = this.insert_cell_above(cell_data.cell_type); |
|
1078 | 1050 | new_cell.fromJSON(cell_data); |
|
1079 | 1051 | var old_cell = this.get_next_cell(new_cell); |
|
1080 | 1052 | this.delete_cell(this.find_cell_index(old_cell)); |
|
1081 | 1053 | this.select(this.find_cell_index(new_cell)); |
|
1082 | 1054 | }; |
|
1083 | 1055 | }; |
|
1084 | 1056 | |
|
1085 | 1057 | /** |
|
1086 | 1058 | * Paste a cell from the clipboard above the selected cell. |
|
1087 | 1059 | * |
|
1088 | 1060 | * @method paste_cell_above |
|
1089 | 1061 | */ |
|
1090 | 1062 | Notebook.prototype.paste_cell_above = function () { |
|
1091 | 1063 | if (this.clipboard !== null && this.paste_enabled) { |
|
1092 | 1064 | var cell_data = this.clipboard; |
|
1093 | 1065 | var new_cell = this.insert_cell_above(cell_data.cell_type); |
|
1094 | 1066 | new_cell.fromJSON(cell_data); |
|
1095 | 1067 | }; |
|
1096 | 1068 | }; |
|
1097 | 1069 | |
|
1098 | 1070 | /** |
|
1099 | 1071 | * Paste a cell from the clipboard below the selected cell. |
|
1100 | 1072 | * |
|
1101 | 1073 | * @method paste_cell_below |
|
1102 | 1074 | */ |
|
1103 | 1075 | Notebook.prototype.paste_cell_below = function () { |
|
1104 | 1076 | if (this.clipboard !== null && this.paste_enabled) { |
|
1105 | 1077 | var cell_data = this.clipboard; |
|
1106 | 1078 | var new_cell = this.insert_cell_below(cell_data.cell_type); |
|
1107 | 1079 | new_cell.fromJSON(cell_data); |
|
1108 | 1080 | }; |
|
1109 | 1081 | }; |
|
1110 | 1082 | |
|
1111 | 1083 | // Cell undelete |
|
1112 | 1084 | |
|
1113 | 1085 | /** |
|
1114 | 1086 | * Restore the most recently deleted cell. |
|
1115 | 1087 | * |
|
1116 | 1088 | * @method undelete |
|
1117 | 1089 | */ |
|
1118 | 1090 | Notebook.prototype.undelete = function() { |
|
1119 | 1091 | if (this.undelete_backup !== null && this.undelete_index !== null) { |
|
1120 | 1092 | var current_index = this.get_selected_index(); |
|
1121 | 1093 | if (this.undelete_index < current_index) { |
|
1122 | 1094 | current_index = current_index + 1; |
|
1123 | 1095 | } |
|
1124 | 1096 | if (this.undelete_index >= this.ncells()) { |
|
1125 | 1097 | this.select(this.ncells() - 1); |
|
1126 | 1098 | } |
|
1127 | 1099 | else { |
|
1128 | 1100 | this.select(this.undelete_index); |
|
1129 | 1101 | } |
|
1130 | 1102 | var cell_data = this.undelete_backup; |
|
1131 | 1103 | var new_cell = null; |
|
1132 | 1104 | if (this.undelete_below) { |
|
1133 | 1105 | new_cell = this.insert_cell_below(cell_data.cell_type); |
|
1134 | 1106 | } else { |
|
1135 | 1107 | new_cell = this.insert_cell_above(cell_data.cell_type); |
|
1136 | 1108 | } |
|
1137 | 1109 | new_cell.fromJSON(cell_data); |
|
1138 | 1110 | this.select(current_index); |
|
1139 | 1111 | this.undelete_backup = null; |
|
1140 | 1112 | this.undelete_index = null; |
|
1141 | 1113 | } |
|
1142 | 1114 | $('#undelete_cell').addClass('ui-state-disabled'); |
|
1143 | 1115 | } |
|
1144 | 1116 | |
|
1145 | 1117 | // Split/merge |
|
1146 | 1118 | |
|
1147 | 1119 | /** |
|
1148 | 1120 | * Split the selected cell into two, at the cursor. |
|
1149 | 1121 | * |
|
1150 | 1122 | * @method split_cell |
|
1151 | 1123 | */ |
|
1152 | 1124 | Notebook.prototype.split_cell = function () { |
|
1153 | 1125 | // Todo: implement spliting for other cell types. |
|
1154 | 1126 | var cell = this.get_selected_cell(); |
|
1155 | 1127 | if (cell.is_splittable()) { |
|
1156 | 1128 | var texta = cell.get_pre_cursor(); |
|
1157 | 1129 | var textb = cell.get_post_cursor(); |
|
1158 | 1130 | if (cell instanceof IPython.CodeCell) { |
|
1159 | 1131 | cell.set_text(texta); |
|
1160 | 1132 | var new_cell = this.insert_cell_below('code'); |
|
1161 | 1133 | new_cell.set_text(textb); |
|
1162 | 1134 | } else if (cell instanceof IPython.MarkdownCell) { |
|
1163 | 1135 | cell.set_text(texta); |
|
1164 | 1136 | cell.render(); |
|
1165 | 1137 | var new_cell = this.insert_cell_below('markdown'); |
|
1166 | 1138 | new_cell.edit(); // editor must be visible to call set_text |
|
1167 | 1139 | new_cell.set_text(textb); |
|
1168 | 1140 | new_cell.render(); |
|
1169 | 1141 | } else if (cell instanceof IPython.HTMLCell) { |
|
1170 | 1142 | cell.set_text(texta); |
|
1171 | 1143 | cell.render(); |
|
1172 | 1144 | var new_cell = this.insert_cell_below('html'); |
|
1173 | 1145 | new_cell.edit(); // editor must be visible to call set_text |
|
1174 | 1146 | new_cell.set_text(textb); |
|
1175 | 1147 | new_cell.render(); |
|
1176 | 1148 | }; |
|
1177 | 1149 | }; |
|
1178 | 1150 | }; |
|
1179 | 1151 | |
|
1180 | 1152 | /** |
|
1181 | 1153 | * Combine the selected cell into the cell above it. |
|
1182 | 1154 | * |
|
1183 | 1155 | * @method merge_cell_above |
|
1184 | 1156 | */ |
|
1185 | 1157 | Notebook.prototype.merge_cell_above = function () { |
|
1186 | 1158 | var index = this.get_selected_index(); |
|
1187 | 1159 | var cell = this.get_cell(index); |
|
1188 | 1160 | if (index > 0) { |
|
1189 | 1161 | var upper_cell = this.get_cell(index-1); |
|
1190 | 1162 | var upper_text = upper_cell.get_text(); |
|
1191 | 1163 | var text = cell.get_text(); |
|
1192 | 1164 | if (cell instanceof IPython.CodeCell) { |
|
1193 | 1165 | cell.set_text(upper_text+'\n'+text); |
|
1194 | 1166 | } else if (cell instanceof IPython.MarkdownCell || cell instanceof IPython.HTMLCell) { |
|
1195 | 1167 | cell.edit(); |
|
1196 | 1168 | cell.set_text(upper_text+'\n'+text); |
|
1197 | 1169 | cell.render(); |
|
1198 | 1170 | }; |
|
1199 | 1171 | this.delete_cell(index-1); |
|
1200 | 1172 | this.select(this.find_cell_index(cell)); |
|
1201 | 1173 | }; |
|
1202 | 1174 | }; |
|
1203 | 1175 | |
|
1204 | 1176 | /** |
|
1205 | 1177 | * Combine the selected cell into the cell below it. |
|
1206 | 1178 | * |
|
1207 | 1179 | * @method merge_cell_below |
|
1208 | 1180 | */ |
|
1209 | 1181 | Notebook.prototype.merge_cell_below = function () { |
|
1210 | 1182 | var index = this.get_selected_index(); |
|
1211 | 1183 | var cell = this.get_cell(index); |
|
1212 | 1184 | if (index < this.ncells()-1) { |
|
1213 | 1185 | var lower_cell = this.get_cell(index+1); |
|
1214 | 1186 | var lower_text = lower_cell.get_text(); |
|
1215 | 1187 | var text = cell.get_text(); |
|
1216 | 1188 | if (cell instanceof IPython.CodeCell) { |
|
1217 | 1189 | cell.set_text(text+'\n'+lower_text); |
|
1218 | 1190 | } else if (cell instanceof IPython.MarkdownCell || cell instanceof IPython.HTMLCell) { |
|
1219 | 1191 | cell.edit(); |
|
1220 | 1192 | cell.set_text(text+'\n'+lower_text); |
|
1221 | 1193 | cell.render(); |
|
1222 | 1194 | }; |
|
1223 | 1195 | this.delete_cell(index+1); |
|
1224 | 1196 | this.select(this.find_cell_index(cell)); |
|
1225 | 1197 | }; |
|
1226 | 1198 | }; |
|
1227 | 1199 | |
|
1228 | 1200 | |
|
1229 | 1201 | // Cell collapsing and output clearing |
|
1230 | 1202 | |
|
1231 | 1203 | /** |
|
1232 | 1204 | * Hide a cell's output. |
|
1233 | 1205 | * |
|
1234 | 1206 | * @method collapse |
|
1235 | 1207 | * @param {Number} index A cell's numeric index |
|
1236 | 1208 | */ |
|
1237 | 1209 | Notebook.prototype.collapse = function (index) { |
|
1238 | 1210 | var i = this.index_or_selected(index); |
|
1239 | 1211 | this.get_cell(i).collapse(); |
|
1240 | 1212 | this.dirty = true; |
|
1241 | 1213 | }; |
|
1242 | 1214 | |
|
1243 | 1215 | /** |
|
1244 | 1216 | * Show a cell's output. |
|
1245 | 1217 | * |
|
1246 | 1218 | * @method expand |
|
1247 | 1219 | * @param {Number} index A cell's numeric index |
|
1248 | 1220 | */ |
|
1249 | 1221 | Notebook.prototype.expand = function (index) { |
|
1250 | 1222 | var i = this.index_or_selected(index); |
|
1251 | 1223 | this.get_cell(i).expand(); |
|
1252 | 1224 | this.dirty = true; |
|
1253 | 1225 | }; |
|
1254 | 1226 | |
|
1255 | 1227 | /** Toggle whether a cell's output is collapsed or expanded. |
|
1256 | 1228 | * |
|
1257 | 1229 | * @method toggle_output |
|
1258 | 1230 | * @param {Number} index A cell's numeric index |
|
1259 | 1231 | */ |
|
1260 | 1232 | Notebook.prototype.toggle_output = function (index) { |
|
1261 | 1233 | var i = this.index_or_selected(index); |
|
1262 | 1234 | this.get_cell(i).toggle_output(); |
|
1263 | 1235 | this.dirty = true; |
|
1264 | 1236 | }; |
|
1265 | 1237 | |
|
1266 | 1238 | /** |
|
1267 | 1239 | * Toggle a scrollbar for long cell outputs. |
|
1268 | 1240 | * |
|
1269 | 1241 | * @method toggle_output_scroll |
|
1270 | 1242 | * @param {Number} index A cell's numeric index |
|
1271 | 1243 | */ |
|
1272 | 1244 | Notebook.prototype.toggle_output_scroll = function (index) { |
|
1273 | 1245 | var i = this.index_or_selected(index); |
|
1274 | 1246 | this.get_cell(i).toggle_output_scroll(); |
|
1275 | 1247 | }; |
|
1276 | 1248 | |
|
1277 | 1249 | /** |
|
1278 | 1250 | * Hide each code cell's output area. |
|
1279 | 1251 | * |
|
1280 | 1252 | * @method collapse_all_output |
|
1281 | 1253 | */ |
|
1282 | 1254 | Notebook.prototype.collapse_all_output = function () { |
|
1283 | 1255 | var ncells = this.ncells(); |
|
1284 | 1256 | var cells = this.get_cells(); |
|
1285 | 1257 | for (var i=0; i<ncells; i++) { |
|
1286 | 1258 | if (cells[i] instanceof IPython.CodeCell) { |
|
1287 | 1259 | cells[i].output_area.collapse(); |
|
1288 | 1260 | } |
|
1289 | 1261 | }; |
|
1290 | 1262 | // this should not be set if the `collapse` key is removed from nbformat |
|
1291 | 1263 | this.dirty = true; |
|
1292 | 1264 | }; |
|
1293 | 1265 | |
|
1294 | 1266 | /** |
|
1295 | 1267 | * Expand each code cell's output area, and add a scrollbar for long output. |
|
1296 | 1268 | * |
|
1297 | 1269 | * @method scroll_all_output |
|
1298 | 1270 | */ |
|
1299 | 1271 | Notebook.prototype.scroll_all_output = function () { |
|
1300 | 1272 | var ncells = this.ncells(); |
|
1301 | 1273 | var cells = this.get_cells(); |
|
1302 | 1274 | for (var i=0; i<ncells; i++) { |
|
1303 | 1275 | if (cells[i] instanceof IPython.CodeCell) { |
|
1304 | 1276 | cells[i].output_area.expand(); |
|
1305 | 1277 | cells[i].output_area.scroll_if_long(20); |
|
1306 | 1278 | } |
|
1307 | 1279 | }; |
|
1308 | 1280 | // this should not be set if the `collapse` key is removed from nbformat |
|
1309 | 1281 | this.dirty = true; |
|
1310 | 1282 | }; |
|
1311 | 1283 | |
|
1312 | 1284 | /** |
|
1313 | 1285 | * Expand each code cell's output area, and remove scrollbars. |
|
1314 | 1286 | * |
|
1315 | 1287 | * @method expand_all_output |
|
1316 | 1288 | */ |
|
1317 | 1289 | Notebook.prototype.expand_all_output = function () { |
|
1318 | 1290 | var ncells = this.ncells(); |
|
1319 | 1291 | var cells = this.get_cells(); |
|
1320 | 1292 | for (var i=0; i<ncells; i++) { |
|
1321 | 1293 | if (cells[i] instanceof IPython.CodeCell) { |
|
1322 | 1294 | cells[i].output_area.expand(); |
|
1323 | 1295 | cells[i].output_area.unscroll_area(); |
|
1324 | 1296 | } |
|
1325 | 1297 | }; |
|
1326 | 1298 | // this should not be set if the `collapse` key is removed from nbformat |
|
1327 | 1299 | this.dirty = true; |
|
1328 | 1300 | }; |
|
1329 | 1301 | |
|
1330 | 1302 | /** |
|
1331 | 1303 | * Clear each code cell's output area. |
|
1332 | 1304 | * |
|
1333 | 1305 | * @method clear_all_output |
|
1334 | 1306 | */ |
|
1335 | 1307 | Notebook.prototype.clear_all_output = function () { |
|
1336 | 1308 | var ncells = this.ncells(); |
|
1337 | 1309 | var cells = this.get_cells(); |
|
1338 | 1310 | for (var i=0; i<ncells; i++) { |
|
1339 | 1311 | if (cells[i] instanceof IPython.CodeCell) { |
|
1340 | 1312 | cells[i].clear_output(true,true,true); |
|
1341 | 1313 | // Make all In[] prompts blank, as well |
|
1342 | 1314 | // TODO: make this configurable (via checkbox?) |
|
1343 | 1315 | cells[i].set_input_prompt(); |
|
1344 | 1316 | } |
|
1345 | 1317 | }; |
|
1346 | 1318 | this.dirty = true; |
|
1347 | 1319 | }; |
|
1348 | 1320 | |
|
1349 | 1321 | |
|
1350 | 1322 | // Other cell functions: line numbers, ... |
|
1351 | 1323 | |
|
1352 | 1324 | /** |
|
1353 | 1325 | * Toggle line numbers in the selected cell's input area. |
|
1354 | 1326 | * |
|
1355 | 1327 | * @method cell_toggle_line_numbers |
|
1356 | 1328 | */ |
|
1357 | 1329 | Notebook.prototype.cell_toggle_line_numbers = function() { |
|
1358 | 1330 | this.get_selected_cell().toggle_line_numbers(); |
|
1359 | 1331 | }; |
|
1360 | 1332 | |
|
1361 | 1333 | // Kernel related things |
|
1362 | 1334 | |
|
1363 | 1335 | /** |
|
1364 | 1336 | * Start a new kernel and set it on each code cell. |
|
1365 | 1337 | * |
|
1366 | 1338 | * @method start_kernel |
|
1367 | 1339 | */ |
|
1368 | 1340 | Notebook.prototype.start_kernel = function () { |
|
1369 | 1341 | var base_url = $('body').data('baseKernelUrl') + "kernels"; |
|
1370 | 1342 | this.kernel = new IPython.Kernel(base_url); |
|
1371 | 1343 | this.kernel.start(this.notebook_id); |
|
1372 | 1344 | // Now that the kernel has been created, tell the CodeCells about it. |
|
1373 | 1345 | var ncells = this.ncells(); |
|
1374 | 1346 | for (var i=0; i<ncells; i++) { |
|
1375 | 1347 | var cell = this.get_cell(i); |
|
1376 | 1348 | if (cell instanceof IPython.CodeCell) { |
|
1377 | 1349 | cell.set_kernel(this.kernel) |
|
1378 | 1350 | }; |
|
1379 | 1351 | }; |
|
1380 | 1352 | }; |
|
1381 | 1353 | |
|
1382 | 1354 | /** |
|
1383 | 1355 | * Prompt the user to restart the IPython kernel. |
|
1384 | 1356 | * |
|
1385 | 1357 | * @method restart_kernel |
|
1386 | 1358 | */ |
|
1387 | 1359 | Notebook.prototype.restart_kernel = function () { |
|
1388 | 1360 | var that = this; |
|
1389 | 1361 | var dialog = $('<div/>'); |
|
1390 | 1362 | dialog.html('Do you want to restart the current kernel? You will lose all variables defined in it.'); |
|
1391 | 1363 | $(document).append(dialog); |
|
1392 | 1364 | dialog.dialog({ |
|
1393 | 1365 | resizable: false, |
|
1394 | 1366 | modal: true, |
|
1395 | 1367 | title: "Restart kernel or continue running?", |
|
1396 | 1368 | closeText: '', |
|
1397 | 1369 | buttons : { |
|
1398 | 1370 | "Restart": function () { |
|
1399 | 1371 | that.kernel.restart(); |
|
1400 | 1372 | $(this).dialog('close'); |
|
1401 | 1373 | }, |
|
1402 | 1374 | "Continue running": function () { |
|
1403 | 1375 | $(this).dialog('close'); |
|
1404 | 1376 | } |
|
1405 | 1377 | } |
|
1406 | 1378 | }); |
|
1407 | 1379 | }; |
|
1408 | 1380 | |
|
1409 | 1381 | /** |
|
1410 | 1382 | * Run the selected cell. |
|
1411 | 1383 | * |
|
1412 | 1384 | * Execute or render cell outputs. |
|
1413 | 1385 | * |
|
1414 | 1386 | * @method execute_selected_cell |
|
1415 | 1387 | * @param {Object} options Customize post-execution behavior |
|
1416 | 1388 | */ |
|
1417 | 1389 | Notebook.prototype.execute_selected_cell = function (options) { |
|
1418 | 1390 | // add_new: should a new cell be added if we are at the end of the nb |
|
1419 | 1391 | // terminal: execute in terminal mode, which stays in the current cell |
|
1420 | 1392 | var default_options = {terminal: false, add_new: true}; |
|
1421 | 1393 | $.extend(default_options, options); |
|
1422 | 1394 | var that = this; |
|
1423 | 1395 | var cell = that.get_selected_cell(); |
|
1424 | 1396 | var cell_index = that.find_cell_index(cell); |
|
1425 | 1397 | if (cell instanceof IPython.CodeCell) { |
|
1426 | 1398 | cell.execute(); |
|
1427 | 1399 | } else if (cell instanceof IPython.HTMLCell) { |
|
1428 | 1400 | cell.render(); |
|
1429 | 1401 | } |
|
1430 | 1402 | if (default_options.terminal) { |
|
1431 | 1403 | cell.select_all(); |
|
1432 | 1404 | } else { |
|
1433 | 1405 | if ((cell_index === (that.ncells()-1)) && default_options.add_new) { |
|
1434 | 1406 | that.insert_cell_below('code'); |
|
1435 | 1407 | // If we are adding a new cell at the end, scroll down to show it. |
|
1436 | 1408 | that.scroll_to_bottom(); |
|
1437 | 1409 | } else { |
|
1438 | 1410 | that.select(cell_index+1); |
|
1439 | 1411 | }; |
|
1440 | 1412 | }; |
|
1441 | 1413 | this.dirty = true; |
|
1442 | 1414 | }; |
|
1443 | 1415 | |
|
1444 | 1416 | /** |
|
1445 | 1417 | * Execute all cells below the selected cell. |
|
1446 | 1418 | * |
|
1447 | 1419 | * @method execute_cells_below |
|
1448 | 1420 | */ |
|
1449 | 1421 | Notebook.prototype.execute_cells_below = function () { |
|
1450 | 1422 | this.execute_cell_range(this.get_selected_index(), this.ncells()); |
|
1451 | 1423 | this.scroll_to_bottom(); |
|
1452 | 1424 | }; |
|
1453 | 1425 | |
|
1454 | 1426 | /** |
|
1455 | 1427 | * Execute all cells above the selected cell. |
|
1456 | 1428 | * |
|
1457 | 1429 | * @method execute_cells_above |
|
1458 | 1430 | */ |
|
1459 | 1431 | Notebook.prototype.execute_cells_above = function () { |
|
1460 | 1432 | this.execute_cell_range(0, this.get_selected_index()); |
|
1461 | 1433 | }; |
|
1462 | 1434 | |
|
1463 | 1435 | /** |
|
1464 | 1436 | * Execute all cells. |
|
1465 | 1437 | * |
|
1466 | 1438 | * @method execute_all_cells |
|
1467 | 1439 | */ |
|
1468 | 1440 | Notebook.prototype.execute_all_cells = function () { |
|
1469 | 1441 | this.execute_cell_range(0, this.ncells()); |
|
1470 | 1442 | this.scroll_to_bottom(); |
|
1471 | 1443 | }; |
|
1472 | 1444 | |
|
1473 | 1445 | /** |
|
1474 | 1446 | * Execute a contiguous range of cells. |
|
1475 | 1447 | * |
|
1476 | 1448 | * @method execute_cell_range |
|
1477 | 1449 | * @param {Number} start Index of the first cell to execute (inclusive) |
|
1478 | 1450 | * @param {Number} end Index of the last cell to execute (exclusive) |
|
1479 | 1451 | */ |
|
1480 | 1452 | Notebook.prototype.execute_cell_range = function (start, end) { |
|
1481 | 1453 | for (var i=start; i<end; i++) { |
|
1482 | 1454 | this.select(i); |
|
1483 | 1455 | this.execute_selected_cell({add_new:false}); |
|
1484 | 1456 | }; |
|
1485 | 1457 | }; |
|
1486 | 1458 | |
|
1487 | 1459 | // Persistance and loading |
|
1488 | 1460 | |
|
1489 | 1461 | /** |
|
1490 | 1462 | * Getter method for this notebook's ID. |
|
1491 | 1463 | * |
|
1492 | 1464 | * @method get_notebook_id |
|
1493 | 1465 | * @return {String} This notebook's ID |
|
1494 | 1466 | */ |
|
1495 | 1467 | Notebook.prototype.get_notebook_id = function () { |
|
1496 | 1468 | return this.notebook_id; |
|
1497 | 1469 | }; |
|
1498 | 1470 | |
|
1499 | 1471 | /** |
|
1500 | 1472 | * Getter method for this notebook's name. |
|
1501 | 1473 | * |
|
1502 | 1474 | * @method get_notebook_name |
|
1503 | 1475 | * @return {String} This notebook's name |
|
1504 | 1476 | */ |
|
1505 | 1477 | Notebook.prototype.get_notebook_name = function () { |
|
1506 | 1478 | return this.notebook_name; |
|
1507 | 1479 | }; |
|
1508 | 1480 | |
|
1509 | 1481 | /** |
|
1510 | 1482 | * Setter method for this notebook's name. |
|
1511 | 1483 | * |
|
1512 | 1484 | * @method set_notebook_name |
|
1513 | 1485 | * @param {String} name A new name for this notebook |
|
1514 | 1486 | */ |
|
1515 | 1487 | Notebook.prototype.set_notebook_name = function (name) { |
|
1516 | 1488 | this.notebook_name = name; |
|
1517 | 1489 | }; |
|
1518 | 1490 | |
|
1519 | 1491 | /** |
|
1520 | 1492 | * Check that a notebook's name is valid. |
|
1521 | 1493 | * |
|
1522 | 1494 | * @method test_notebook_name |
|
1523 | 1495 | * @param {String} nbname A name for this notebook |
|
1524 | 1496 | * @return {Boolean} True if the name is valid, false if invalid |
|
1525 | 1497 | */ |
|
1526 | 1498 | Notebook.prototype.test_notebook_name = function (nbname) { |
|
1527 | 1499 | nbname = nbname || ''; |
|
1528 | 1500 | if (this.notebook_name_blacklist_re.test(nbname) == false && nbname.length>0) { |
|
1529 | 1501 | return true; |
|
1530 | 1502 | } else { |
|
1531 | 1503 | return false; |
|
1532 | 1504 | }; |
|
1533 | 1505 | }; |
|
1534 | 1506 | |
|
1535 | 1507 | /** |
|
1536 | 1508 | * Load a notebook from JSON (.ipynb). |
|
1537 | 1509 | * |
|
1538 | 1510 | * This currently handles one worksheet: others are deleted. |
|
1539 | 1511 | * |
|
1540 | 1512 | * @method fromJSON |
|
1541 | 1513 | * @param {Object} data JSON representation of a notebook |
|
1542 | 1514 | */ |
|
1543 | 1515 | Notebook.prototype.fromJSON = function (data) { |
|
1544 | 1516 | var ncells = this.ncells(); |
|
1545 | 1517 | var i; |
|
1546 | 1518 | for (i=0; i<ncells; i++) { |
|
1547 | 1519 | // Always delete cell 0 as they get renumbered as they are deleted. |
|
1548 | 1520 | this.delete_cell(0); |
|
1549 | 1521 | }; |
|
1550 | 1522 | // Save the metadata and name. |
|
1551 | 1523 | this.metadata = data.metadata; |
|
1552 | 1524 | this.notebook_name = data.metadata.name; |
|
1553 | 1525 | // Only handle 1 worksheet for now. |
|
1554 | 1526 | var worksheet = data.worksheets[0]; |
|
1555 | 1527 | if (worksheet !== undefined) { |
|
1556 | 1528 | if (worksheet.metadata) { |
|
1557 | 1529 | this.worksheet_metadata = worksheet.metadata; |
|
1558 | 1530 | } |
|
1559 | 1531 | var new_cells = worksheet.cells; |
|
1560 | 1532 | ncells = new_cells.length; |
|
1561 | 1533 | var cell_data = null; |
|
1562 | 1534 | var new_cell = null; |
|
1563 | 1535 | for (i=0; i<ncells; i++) { |
|
1564 | 1536 | cell_data = new_cells[i]; |
|
1565 | 1537 | // VERSIONHACK: plaintext -> raw |
|
1566 | 1538 | // handle never-released plaintext name for raw cells |
|
1567 | 1539 | if (cell_data.cell_type === 'plaintext'){ |
|
1568 | 1540 | cell_data.cell_type = 'raw'; |
|
1569 | 1541 | } |
|
1570 | 1542 | |
|
1571 | 1543 | new_cell = this.insert_cell_below(cell_data.cell_type); |
|
1572 | 1544 | new_cell.fromJSON(cell_data); |
|
1573 | 1545 | }; |
|
1574 | 1546 | }; |
|
1575 | 1547 | if (data.worksheets.length > 1) { |
|
1576 | 1548 | var dialog = $('<div/>'); |
|
1577 | 1549 | dialog.html("This notebook has " + data.worksheets.length + " worksheets, " + |
|
1578 | 1550 | "but this version of IPython can only handle the first. " + |
|
1579 | 1551 | "If you save this notebook, worksheets after the first will be lost." |
|
1580 | 1552 | ); |
|
1581 | 1553 | this.element.append(dialog); |
|
1582 | 1554 | dialog.dialog({ |
|
1583 | 1555 | resizable: false, |
|
1584 | 1556 | modal: true, |
|
1585 | 1557 | title: "Multiple worksheets", |
|
1586 | 1558 | closeText: "", |
|
1587 | 1559 | close: function(event, ui) {$(this).dialog('destroy').remove();}, |
|
1588 | 1560 | buttons : { |
|
1589 | 1561 | "OK": function () { |
|
1590 | 1562 | $(this).dialog('close'); |
|
1591 | 1563 | } |
|
1592 | 1564 | }, |
|
1593 | 1565 | width: 400 |
|
1594 | 1566 | }); |
|
1595 | 1567 | } |
|
1596 | 1568 | }; |
|
1597 | 1569 | |
|
1598 | 1570 | /** |
|
1599 | 1571 | * Dump this notebook into a JSON-friendly object. |
|
1600 | 1572 | * |
|
1601 | 1573 | * @method toJSON |
|
1602 | 1574 | * @return {Object} A JSON-friendly representation of this notebook. |
|
1603 | 1575 | */ |
|
1604 | 1576 | Notebook.prototype.toJSON = function () { |
|
1605 | 1577 | var cells = this.get_cells(); |
|
1606 | 1578 | var ncells = cells.length; |
|
1607 | 1579 | var cell_array = new Array(ncells); |
|
1608 | 1580 | for (var i=0; i<ncells; i++) { |
|
1609 | 1581 | cell_array[i] = cells[i].toJSON(); |
|
1610 | 1582 | }; |
|
1611 | 1583 | var data = { |
|
1612 | 1584 | // Only handle 1 worksheet for now. |
|
1613 | 1585 | worksheets : [{ |
|
1614 | 1586 | cells: cell_array, |
|
1615 | 1587 | metadata: this.worksheet_metadata |
|
1616 | 1588 | }], |
|
1617 | 1589 | metadata : this.metadata |
|
1618 | 1590 | }; |
|
1619 | 1591 | return data; |
|
1620 | 1592 | }; |
|
1621 | 1593 | |
|
1622 | 1594 | /** |
|
1623 | 1595 | * Save this notebook on the server. |
|
1624 | 1596 | * |
|
1625 | 1597 | * @method save_notebook |
|
1626 | 1598 | */ |
|
1627 | 1599 | Notebook.prototype.save_notebook = function () { |
|
1628 | 1600 | // We may want to move the name/id/nbformat logic inside toJSON? |
|
1629 | 1601 | var data = this.toJSON(); |
|
1630 | 1602 | data.metadata.name = this.notebook_name; |
|
1631 | 1603 | data.nbformat = this.nbformat; |
|
1632 | 1604 | data.nbformat_minor = this.nbformat_minor; |
|
1633 | 1605 | // We do the call with settings so we can set cache to false. |
|
1634 | 1606 | var settings = { |
|
1635 | 1607 | processData : false, |
|
1636 | 1608 | cache : false, |
|
1637 | 1609 | type : "PUT", |
|
1638 | 1610 | data : JSON.stringify(data), |
|
1639 | 1611 | headers : {'Content-Type': 'application/json'}, |
|
1640 | 1612 | success : $.proxy(this.save_notebook_success,this), |
|
1641 | 1613 | error : $.proxy(this.save_notebook_error,this) |
|
1642 | 1614 | }; |
|
1643 | 1615 | $([IPython.events]).trigger('notebook_saving.Notebook'); |
|
1644 | 1616 | var url = this.baseProjectUrl() + 'notebooks/' + this.notebook_id; |
|
1645 | 1617 | $.ajax(url, settings); |
|
1646 | 1618 | }; |
|
1647 | 1619 | |
|
1648 | 1620 | /** |
|
1649 | 1621 | * Success callback for saving a notebook. |
|
1650 | 1622 | * |
|
1651 | 1623 | * @method save_notebook_success |
|
1652 | 1624 | * @param {Object} data JSON representation of a notebook |
|
1653 | 1625 | * @param {String} status Description of response status |
|
1654 | 1626 | * @param {jqXHR} xhr jQuery Ajax object |
|
1655 | 1627 | */ |
|
1656 | 1628 | Notebook.prototype.save_notebook_success = function (data, status, xhr) { |
|
1657 | 1629 | this.dirty = false; |
|
1658 | 1630 | $([IPython.events]).trigger('notebook_saved.Notebook'); |
|
1659 | 1631 | }; |
|
1660 | 1632 | |
|
1661 | 1633 | /** |
|
1662 | 1634 | * Failure callback for saving a notebook. |
|
1663 | 1635 | * |
|
1664 | 1636 | * @method save_notebook_error |
|
1665 | 1637 | * @param {jqXHR} xhr jQuery Ajax object |
|
1666 | 1638 | * @param {String} status Description of response status |
|
1667 | 1639 | * @param {String} error_msg HTTP error message |
|
1668 | 1640 | */ |
|
1669 | 1641 | Notebook.prototype.save_notebook_error = function (xhr, status, error_msg) { |
|
1670 | 1642 | $([IPython.events]).trigger('notebook_save_failed.Notebook'); |
|
1671 | 1643 | }; |
|
1672 | 1644 | |
|
1673 | 1645 | /** |
|
1674 | 1646 | * Request a notebook's data from the server. |
|
1675 | 1647 | * |
|
1676 | 1648 | * @method load_notebook |
|
1677 | 1649 | * @param {String} notebook_id A notebook to load |
|
1678 | 1650 | */ |
|
1679 | 1651 | Notebook.prototype.load_notebook = function (notebook_id) { |
|
1680 | 1652 | var that = this; |
|
1681 | 1653 | this.notebook_id = notebook_id; |
|
1682 | 1654 | // We do the call with settings so we can set cache to false. |
|
1683 | 1655 | var settings = { |
|
1684 | 1656 | processData : false, |
|
1685 | 1657 | cache : false, |
|
1686 | 1658 | type : "GET", |
|
1687 | 1659 | dataType : "json", |
|
1688 | 1660 | success : $.proxy(this.load_notebook_success,this), |
|
1689 | 1661 | error : $.proxy(this.load_notebook_error,this), |
|
1690 | 1662 | }; |
|
1691 | 1663 | $([IPython.events]).trigger('notebook_loading.Notebook'); |
|
1692 | 1664 | var url = this.baseProjectUrl() + 'notebooks/' + this.notebook_id; |
|
1693 | 1665 | $.ajax(url, settings); |
|
1694 | 1666 | }; |
|
1695 | 1667 | |
|
1696 | 1668 | /** |
|
1697 | 1669 | * Success callback for loading a notebook from the server. |
|
1698 | 1670 | * |
|
1699 | 1671 | * Load notebook data from the JSON response. |
|
1700 | 1672 | * |
|
1701 | 1673 | * @method load_notebook_success |
|
1702 | 1674 | * @param {Object} data JSON representation of a notebook |
|
1703 | 1675 | * @param {String} status Description of response status |
|
1704 | 1676 | * @param {jqXHR} xhr jQuery Ajax object |
|
1705 | 1677 | */ |
|
1706 | 1678 | Notebook.prototype.load_notebook_success = function (data, status, xhr) { |
|
1707 | 1679 | this.fromJSON(data); |
|
1708 | 1680 | if (this.ncells() === 0) { |
|
1709 | 1681 | this.insert_cell_below('code'); |
|
1710 | 1682 | }; |
|
1711 | 1683 | this.dirty = false; |
|
1712 | 1684 | this.select(0); |
|
1713 | 1685 | this.scroll_to_top(); |
|
1714 | 1686 | if (data.orig_nbformat !== undefined && data.nbformat !== data.orig_nbformat) { |
|
1715 | 1687 | msg = "This notebook has been converted from an older " + |
|
1716 | 1688 | "notebook format (v"+data.orig_nbformat+") to the current notebook " + |
|
1717 | 1689 | "format (v"+data.nbformat+"). The next time you save this notebook, the " + |
|
1718 | 1690 | "newer notebook format will be used and older verions of IPython " + |
|
1719 | 1691 | "may not be able to read it. To keep the older version, close the " + |
|
1720 | 1692 | "notebook without saving it."; |
|
1721 | 1693 | var dialog = $('<div/>'); |
|
1722 | 1694 | dialog.html(msg); |
|
1723 | 1695 | this.element.append(dialog); |
|
1724 | 1696 | dialog.dialog({ |
|
1725 | 1697 | resizable: false, |
|
1726 | 1698 | modal: true, |
|
1727 | 1699 | title: "Notebook converted", |
|
1728 | 1700 | closeText: "", |
|
1729 | 1701 | close: function(event, ui) {$(this).dialog('destroy').remove();}, |
|
1730 | 1702 | buttons : { |
|
1731 | 1703 | "OK": function () { |
|
1732 | 1704 | $(this).dialog('close'); |
|
1733 | 1705 | } |
|
1734 | 1706 | }, |
|
1735 | 1707 | width: 400 |
|
1736 | 1708 | }); |
|
1737 | 1709 | } else if (data.orig_nbformat_minor !== undefined && data.nbformat_minor !== data.orig_nbformat_minor) { |
|
1738 | 1710 | var that = this; |
|
1739 | 1711 | var orig_vs = 'v' + data.nbformat + '.' + data.orig_nbformat_minor; |
|
1740 | 1712 | var this_vs = 'v' + data.nbformat + '.' + this.nbformat_minor; |
|
1741 | 1713 | var msg = "This notebook is version " + orig_vs + ", but we only fully support up to " + |
|
1742 | 1714 | this_vs + ". You can still work with this notebook, but some features " + |
|
1743 | 1715 | "introduced in later notebook versions may not be available." |
|
1744 | 1716 | |
|
1745 | 1717 | var dialog = $('<div/>'); |
|
1746 | 1718 | dialog.html(msg); |
|
1747 | 1719 | this.element.append(dialog); |
|
1748 | 1720 | dialog.dialog({ |
|
1749 | 1721 | resizable: false, |
|
1750 | 1722 | modal: true, |
|
1751 | 1723 | title: "Newer Notebook", |
|
1752 | 1724 | closeText: "", |
|
1753 | 1725 | close: function(event, ui) {$(this).dialog('destroy').remove();}, |
|
1754 | 1726 | buttons : { |
|
1755 | 1727 | "OK": function () { |
|
1756 | 1728 | $(this).dialog('close'); |
|
1757 | 1729 | } |
|
1758 | 1730 | }, |
|
1759 | 1731 | width: 400 |
|
1760 | 1732 | }); |
|
1761 | 1733 | |
|
1762 | 1734 | } |
|
1763 | 1735 | // Create the kernel after the notebook is completely loaded to prevent |
|
1764 | 1736 | // code execution upon loading, which is a security risk. |
|
1765 | 1737 | if (! this.read_only) { |
|
1766 | 1738 | this.start_kernel(); |
|
1767 | 1739 | } |
|
1768 | 1740 | $([IPython.events]).trigger('notebook_loaded.Notebook'); |
|
1769 | 1741 | }; |
|
1770 | 1742 | |
|
1771 | 1743 | /** |
|
1772 | 1744 | * Failure callback for loading a notebook from the server. |
|
1773 | 1745 | * |
|
1774 | 1746 | * @method load_notebook_error |
|
1775 | 1747 | * @param {jqXHR} xhr jQuery Ajax object |
|
1776 | 1748 | * @param {String} textStatus Description of response status |
|
1777 | 1749 | * @param {String} errorThrow HTTP error message |
|
1778 | 1750 | */ |
|
1779 | 1751 | Notebook.prototype.load_notebook_error = function (xhr, textStatus, errorThrow) { |
|
1780 | 1752 | if (xhr.status === 500) { |
|
1781 | 1753 | var msg = "An error occurred while loading this notebook. Most likely " + |
|
1782 | 1754 | "this notebook is in a newer format than is supported by this " + |
|
1783 | 1755 | "version of IPython. This version can load notebook formats " + |
|
1784 | 1756 | "v"+this.nbformat+" or earlier."; |
|
1785 | 1757 | var dialog = $('<div/>'); |
|
1786 | 1758 | dialog.html(msg); |
|
1787 | 1759 | this.element.append(dialog); |
|
1788 | 1760 | dialog.dialog({ |
|
1789 | 1761 | resizable: false, |
|
1790 | 1762 | modal: true, |
|
1791 | 1763 | title: "Error loading notebook", |
|
1792 | 1764 | closeText: "", |
|
1793 | 1765 | close: function(event, ui) {$(this).dialog('destroy').remove();}, |
|
1794 | 1766 | buttons : { |
|
1795 | 1767 | "OK": function () { |
|
1796 | 1768 | $(this).dialog('close'); |
|
1797 | 1769 | } |
|
1798 | 1770 | }, |
|
1799 | 1771 | width: 400 |
|
1800 | 1772 | }); |
|
1801 | 1773 | } |
|
1802 | 1774 | } |
|
1803 | 1775 | |
|
1804 | 1776 | IPython.Notebook = Notebook; |
|
1805 | 1777 | |
|
1806 | 1778 | |
|
1807 | 1779 | return IPython; |
|
1808 | 1780 | |
|
1809 | 1781 | }(IPython)); |
|
1810 | 1782 |
@@ -1,557 +1,603 b'' | |||
|
1 | 1 | //---------------------------------------------------------------------------- |
|
2 | 2 | // Copyright (C) 2008-2011 The IPython Development Team |
|
3 | 3 | // |
|
4 | 4 | // Distributed under the terms of the BSD License. The full license is in |
|
5 | 5 | // the file COPYING, distributed as part of this software. |
|
6 | 6 | //---------------------------------------------------------------------------- |
|
7 | 7 | |
|
8 | 8 | //============================================================================ |
|
9 | 9 | // OutputArea |
|
10 | 10 | //============================================================================ |
|
11 | 11 | |
|
12 | 12 | var IPython = (function (IPython) { |
|
13 | 13 | "use strict"; |
|
14 | 14 | |
|
15 | 15 | var utils = IPython.utils; |
|
16 | 16 | |
|
17 | 17 | var OutputArea = function (selector, prompt_area) { |
|
18 | 18 | this.selector = selector; |
|
19 | 19 | this.wrapper = $(selector); |
|
20 | 20 | this.outputs = []; |
|
21 | 21 | this.collapsed = false; |
|
22 | 22 | this.scrolled = false; |
|
23 | 23 | this.clear_out_timeout = null; |
|
24 | 24 | if (prompt_area === undefined) { |
|
25 | 25 | this.prompt_area = true; |
|
26 | 26 | } else { |
|
27 | 27 | this.prompt_area = prompt_area; |
|
28 | 28 | } |
|
29 | 29 | this.create_elements(); |
|
30 | 30 | this.style(); |
|
31 | 31 | this.bind_events(); |
|
32 | 32 | }; |
|
33 | 33 | |
|
34 | 34 | OutputArea.prototype.create_elements = function () { |
|
35 | 35 | this.element = $("<div/>"); |
|
36 | 36 | this.collapse_button = $("<div/>"); |
|
37 | 37 | this.prompt_overlay = $("<div/>"); |
|
38 | 38 | this.wrapper.append(this.prompt_overlay); |
|
39 | 39 | this.wrapper.append(this.element); |
|
40 | 40 | this.wrapper.append(this.collapse_button); |
|
41 | 41 | }; |
|
42 | 42 | |
|
43 | 43 | |
|
44 | 44 | OutputArea.prototype.style = function () { |
|
45 | 45 | this.collapse_button.hide(); |
|
46 | 46 | this.prompt_overlay.hide(); |
|
47 | 47 | |
|
48 | 48 | this.wrapper.addClass('output_wrapper'); |
|
49 | 49 | this.element.addClass('output vbox'); |
|
50 | 50 | |
|
51 | 51 | this.collapse_button.button(); |
|
52 | 52 | this.collapse_button.addClass('output_collapsed vbox'); |
|
53 | 53 | this.collapse_button.attr('title', 'click to expand output'); |
|
54 | 54 | this.collapse_button.html('. . .'); |
|
55 | 55 | |
|
56 | 56 | this.prompt_overlay.addClass('out_prompt_overlay prompt'); |
|
57 | 57 | this.prompt_overlay.attr('title', 'click to expand output; double click to hide output'); |
|
58 | 58 | |
|
59 | 59 | this.collapse(); |
|
60 | 60 | }; |
|
61 | 61 | |
|
62 | 62 | |
|
63 | 63 | OutputArea.prototype._should_scroll = function (lines) { |
|
64 | 64 | if (!lines) { |
|
65 | 65 | lines = 100; |
|
66 | 66 | } |
|
67 | 67 | // line-height from http://stackoverflow.com/questions/1185151 |
|
68 | 68 | var fontSize = this.element.css('font-size'); |
|
69 | 69 | var lineHeight = Math.floor(parseInt(fontSize.replace('px','')) * 1.5); |
|
70 | 70 | |
|
71 | 71 | return (this.element.height() > lines * lineHeight); |
|
72 | 72 | }; |
|
73 | 73 | |
|
74 | 74 | |
|
75 | 75 | OutputArea.prototype.bind_events = function () { |
|
76 | 76 | var that = this; |
|
77 | this._submit_raw_input_proxy = $.proxy(this._submit_raw_input, this); | |
|
77 | 78 | this.prompt_overlay.dblclick(function () { that.toggle_output(); }); |
|
78 | 79 | this.prompt_overlay.click(function () { that.toggle_scroll(); }); |
|
79 | 80 | |
|
80 | 81 | this.element.resize(function () { |
|
81 | 82 | // FIXME: Firefox on Linux misbehaves, so automatic scrolling is disabled |
|
82 | 83 | if ( IPython.utils.browser[0] === "Firefox" ) { |
|
83 | 84 | return; |
|
84 | 85 | } |
|
85 | 86 | // maybe scroll output, |
|
86 | 87 | // if it's grown large enough and hasn't already been scrolled. |
|
87 | 88 | if ( !that.scrolled && that._should_scroll()) { |
|
88 | 89 | that.scroll_area(); |
|
89 | 90 | } |
|
90 | 91 | }); |
|
91 | 92 | this.collapse_button.click(function () { |
|
92 | 93 | that.expand(); |
|
93 | 94 | }); |
|
94 | 95 | this.collapse_button.hover(function () { |
|
95 | 96 | $(this).addClass("ui-state-hover"); |
|
96 | 97 | }, function () { |
|
97 | 98 | $(this).removeClass("ui-state-hover"); |
|
98 | 99 | }); |
|
99 | 100 | }; |
|
100 | 101 | |
|
101 | 102 | |
|
102 | 103 | OutputArea.prototype.collapse = function () { |
|
103 | 104 | if (!this.collapsed) { |
|
104 | 105 | this.element.hide(); |
|
105 | 106 | this.prompt_overlay.hide(); |
|
106 | 107 | if (this.element.html()){ |
|
107 | 108 | this.collapse_button.show(); |
|
108 | 109 | } |
|
109 | 110 | this.collapsed = true; |
|
110 | 111 | } |
|
111 | 112 | }; |
|
112 | 113 | |
|
113 | 114 | |
|
114 | 115 | OutputArea.prototype.expand = function () { |
|
115 | 116 | if (this.collapsed) { |
|
116 | 117 | this.collapse_button.hide(); |
|
117 | 118 | this.element.show(); |
|
118 | 119 | this.prompt_overlay.show(); |
|
119 | 120 | this.collapsed = false; |
|
120 | 121 | } |
|
121 | 122 | }; |
|
122 | 123 | |
|
123 | 124 | |
|
124 | 125 | OutputArea.prototype.toggle_output = function () { |
|
125 | 126 | if (this.collapsed) { |
|
126 | 127 | this.expand(); |
|
127 | 128 | } else { |
|
128 | 129 | this.collapse(); |
|
129 | 130 | } |
|
130 | 131 | }; |
|
131 | 132 | |
|
132 | 133 | |
|
133 | 134 | OutputArea.prototype.scroll_area = function () { |
|
134 | 135 | this.element.addClass('output_scroll'); |
|
135 | 136 | this.prompt_overlay.attr('title', 'click to unscroll output; double click to hide'); |
|
136 | 137 | this.scrolled = true; |
|
137 | 138 | }; |
|
138 | 139 | |
|
139 | 140 | |
|
140 | 141 | OutputArea.prototype.unscroll_area = function () { |
|
141 | 142 | this.element.removeClass('output_scroll'); |
|
142 | 143 | this.prompt_overlay.attr('title', 'click to scroll output; double click to hide'); |
|
143 | 144 | this.scrolled = false; |
|
144 | 145 | }; |
|
145 | 146 | |
|
146 | 147 | |
|
147 | 148 | OutputArea.prototype.scroll_if_long = function (lines) { |
|
148 | 149 | if (this._should_scroll(lines)) { |
|
149 | 150 | // only allow scrolling long-enough output |
|
150 | 151 | this.scroll_area(); |
|
151 | 152 | } |
|
152 | 153 | }; |
|
153 | 154 | |
|
154 | 155 | |
|
155 | 156 | OutputArea.prototype.toggle_scroll = function () { |
|
156 | 157 | if (this.scrolled) { |
|
157 | 158 | this.unscroll_area(); |
|
158 | 159 | } else { |
|
159 | 160 | // only allow scrolling long-enough output |
|
160 | 161 | this.scroll_if_long(20); |
|
161 | 162 | } |
|
162 | 163 | }; |
|
163 | 164 | |
|
164 | 165 | |
|
165 | 166 | // typeset with MathJax if MathJax is available |
|
166 | 167 | OutputArea.prototype.typeset = function () { |
|
167 | 168 | if (window.MathJax){ |
|
168 | 169 | MathJax.Hub.Queue(["Typeset",MathJax.Hub]); |
|
169 | 170 | } |
|
170 | 171 | }; |
|
171 | 172 | |
|
172 | 173 | |
|
173 | 174 | OutputArea.prototype.handle_output = function (msg_type, content) { |
|
174 | 175 | var json = {}; |
|
175 | 176 | json.output_type = msg_type; |
|
176 | 177 | if (msg_type === "stream") { |
|
177 | 178 | json.text = content.data; |
|
178 | 179 | json.stream = content.name; |
|
179 | 180 | } else if (msg_type === "display_data") { |
|
180 | 181 | json = this.convert_mime_types(json, content.data); |
|
181 | 182 | } else if (msg_type === "pyout") { |
|
182 | 183 | json.prompt_number = content.execution_count; |
|
183 | 184 | json = this.convert_mime_types(json, content.data); |
|
184 | 185 | } else if (msg_type === "pyerr") { |
|
185 | 186 | json.ename = content.ename; |
|
186 | 187 | json.evalue = content.evalue; |
|
187 | 188 | json.traceback = content.traceback; |
|
188 | 189 | } |
|
189 | 190 | // append with dynamic=true |
|
190 | 191 | this.append_output(json, true); |
|
191 | 192 | }; |
|
192 | 193 | |
|
193 | 194 | |
|
194 | 195 | OutputArea.prototype.convert_mime_types = function (json, data) { |
|
195 | 196 | if (data['text/plain'] !== undefined) { |
|
196 | 197 | json.text = data['text/plain']; |
|
197 | 198 | } |
|
198 | 199 | if (data['text/html'] !== undefined) { |
|
199 | 200 | json.html = data['text/html']; |
|
200 | 201 | } |
|
201 | 202 | if (data['image/svg+xml'] !== undefined) { |
|
202 | 203 | json.svg = data['image/svg+xml']; |
|
203 | 204 | } |
|
204 | 205 | if (data['image/png'] !== undefined) { |
|
205 | 206 | json.png = data['image/png']; |
|
206 | 207 | } |
|
207 | 208 | if (data['image/jpeg'] !== undefined) { |
|
208 | 209 | json.jpeg = data['image/jpeg']; |
|
209 | 210 | } |
|
210 | 211 | if (data['text/latex'] !== undefined) { |
|
211 | 212 | json.latex = data['text/latex']; |
|
212 | 213 | } |
|
213 | 214 | if (data['application/json'] !== undefined) { |
|
214 | 215 | json.json = data['application/json']; |
|
215 | 216 | } |
|
216 | 217 | if (data['application/javascript'] !== undefined) { |
|
217 | 218 | json.javascript = data['application/javascript']; |
|
218 | 219 | } |
|
219 | 220 | return json; |
|
220 | 221 | }; |
|
221 | 222 | |
|
222 | 223 | |
|
223 | 224 | OutputArea.prototype.append_output = function (json, dynamic) { |
|
224 | 225 | // If dynamic is true, javascript output will be eval'd. |
|
225 | 226 | this.expand(); |
|
226 | 227 | this.flush_clear_timeout(); |
|
227 | 228 | if (json.output_type === 'pyout') { |
|
228 | 229 | this.append_pyout(json, dynamic); |
|
229 | 230 | } else if (json.output_type === 'pyerr') { |
|
230 | 231 | this.append_pyerr(json); |
|
231 | 232 | } else if (json.output_type === 'display_data') { |
|
232 | 233 | this.append_display_data(json, dynamic); |
|
233 | 234 | } else if (json.output_type === 'stream') { |
|
234 | 235 | this.append_stream(json); |
|
235 | 236 | } |
|
236 | 237 | this.outputs.push(json); |
|
237 | 238 | var that = this; |
|
238 | 239 | setTimeout(function(){that.element.trigger('resize');}, 100); |
|
239 | 240 | }; |
|
240 | 241 | |
|
241 | 242 | |
|
242 | 243 | OutputArea.prototype.create_output_area = function () { |
|
243 | 244 | var oa = $("<div/>").addClass("output_area"); |
|
244 | 245 | if (this.prompt_area) { |
|
245 | 246 | oa.append($('<div/>').addClass('prompt')); |
|
246 | 247 | } |
|
247 | 248 | return oa; |
|
248 | 249 | }; |
|
249 | 250 | |
|
250 | 251 | |
|
251 | 252 | OutputArea.prototype.append_pyout = function (json, dynamic) { |
|
252 | 253 | var n = json.prompt_number || ' '; |
|
253 | 254 | var toinsert = this.create_output_area(); |
|
254 | 255 | if (this.prompt_area) { |
|
255 | 256 | toinsert.find('div.prompt').addClass('output_prompt').html('Out[' + n + ']:'); |
|
256 | 257 | } |
|
257 | 258 | this.append_mime_type(json, toinsert, dynamic); |
|
258 | 259 | this.element.append(toinsert); |
|
259 | 260 | // If we just output latex, typeset it. |
|
260 | 261 | if ((json.latex !== undefined) || (json.html !== undefined)) { |
|
261 | 262 | this.typeset(); |
|
262 | 263 | } |
|
263 | 264 | }; |
|
264 | 265 | |
|
265 | 266 | |
|
266 | 267 | OutputArea.prototype.append_pyerr = function (json) { |
|
267 | 268 | var tb = json.traceback; |
|
268 | 269 | if (tb !== undefined && tb.length > 0) { |
|
269 | 270 | var s = ''; |
|
270 | 271 | var len = tb.length; |
|
271 | 272 | for (var i=0; i<len; i++) { |
|
272 | 273 | s = s + tb[i] + '\n'; |
|
273 | 274 | } |
|
274 | 275 | s = s + '\n'; |
|
275 | 276 | var toinsert = this.create_output_area(); |
|
276 | 277 | this.append_text(s, toinsert); |
|
277 | 278 | this.element.append(toinsert); |
|
278 | 279 | } |
|
279 | 280 | }; |
|
280 | 281 | |
|
281 | 282 | |
|
282 | 283 | OutputArea.prototype.append_stream = function (json) { |
|
283 | 284 | // temporary fix: if stream undefined (json file written prior to this patch), |
|
284 | 285 | // default to most likely stdout: |
|
285 | 286 | if (json.stream == undefined){ |
|
286 | 287 | json.stream = 'stdout'; |
|
287 | 288 | } |
|
288 | 289 | var text = json.text; |
|
289 | 290 | var subclass = "output_"+json.stream; |
|
290 | 291 | if (this.outputs.length > 0){ |
|
291 | 292 | // have at least one output to consider |
|
292 | 293 | var last = this.outputs[this.outputs.length-1]; |
|
293 | 294 | if (last.output_type == 'stream' && json.stream == last.stream){ |
|
294 | 295 | // latest output was in the same stream, |
|
295 | 296 | // so append directly into its pre tag |
|
296 | 297 | // escape ANSI & HTML specials: |
|
297 | 298 | var pre = this.element.find('div.'+subclass).last().find('pre'); |
|
298 | 299 | var html = utils.fixCarriageReturn( |
|
299 | 300 | pre.html() + utils.fixConsole(text)); |
|
300 | 301 | pre.html(html); |
|
301 | 302 | return; |
|
302 | 303 | } |
|
303 | 304 | } |
|
304 | 305 | |
|
305 | 306 | if (!text.replace("\r", "")) { |
|
306 | 307 | // text is nothing (empty string, \r, etc.) |
|
307 | 308 | // so don't append any elements, which might add undesirable space |
|
308 | 309 | return; |
|
309 | 310 | } |
|
310 | 311 | |
|
311 | 312 | // If we got here, attach a new div |
|
312 | 313 | var toinsert = this.create_output_area(); |
|
313 | 314 | this.append_text(text, toinsert, "output_stream "+subclass); |
|
314 | 315 | this.element.append(toinsert); |
|
315 | 316 | }; |
|
316 | 317 | |
|
317 | 318 | |
|
318 | 319 | OutputArea.prototype.append_display_data = function (json, dynamic) { |
|
319 | 320 | var toinsert = this.create_output_area(); |
|
320 | 321 | this.append_mime_type(json, toinsert, dynamic); |
|
321 | 322 | this.element.append(toinsert); |
|
322 | 323 | // If we just output latex, typeset it. |
|
323 | 324 | if ( (json.latex !== undefined) || (json.html !== undefined) ) { |
|
324 | 325 | this.typeset(); |
|
325 | 326 | } |
|
326 | 327 | }; |
|
327 | 328 | |
|
328 | 329 | OutputArea.display_order = ['javascript','html','latex','svg','png','jpeg','text']; |
|
329 | 330 | |
|
330 | 331 | OutputArea.prototype.append_mime_type = function (json, element, dynamic) { |
|
331 | 332 | for(var type_i in OutputArea.display_order){ |
|
332 | 333 | var type = OutputArea.display_order[type_i]; |
|
333 | 334 | if(json[type] != undefined ){ |
|
334 | 335 | if(type == 'javascript'){ |
|
335 | 336 | if (dynamic) { |
|
336 | 337 | this.append_javascript(json.javascript, element, dynamic); |
|
337 | 338 | } |
|
338 | 339 | } else { |
|
339 | 340 | this['append_'+type](json[type], element); |
|
340 | 341 | } |
|
341 | 342 | return; |
|
342 | 343 | } |
|
343 | 344 | } |
|
344 | 345 | }; |
|
345 | 346 | |
|
346 | 347 | |
|
347 | 348 | OutputArea.prototype.append_html = function (html, element) { |
|
348 | 349 | var toinsert = $("<div/>").addClass("output_subarea output_html rendered_html"); |
|
349 | 350 | toinsert.append(html); |
|
350 | 351 | element.append(toinsert); |
|
351 | 352 | }; |
|
352 | 353 | |
|
353 | 354 | |
|
354 | 355 | OutputArea.prototype.append_javascript = function (js, container) { |
|
355 | 356 | // We just eval the JS code, element appears in the local scope. |
|
356 | 357 | var element = $("<div/>").addClass("output_subarea"); |
|
357 | 358 | container.append(element); |
|
358 | 359 | // Div for js shouldn't be drawn, as it will add empty height to the area. |
|
359 | 360 | container.hide(); |
|
360 | 361 | // If the Javascript appends content to `element` that should be drawn, then |
|
361 | 362 | // it must also call `container.show()`. |
|
362 | 363 | try { |
|
363 | 364 | eval(js); |
|
364 | 365 | } catch(err) { |
|
365 | 366 | console.log('Error in Javascript!'); |
|
366 | 367 | console.log(err); |
|
367 | 368 | container.show(); |
|
368 | 369 | element.append($('<div/>') |
|
369 | 370 | .html("Error in Javascript !<br/>"+ |
|
370 | 371 | err.toString()+ |
|
371 | 372 | '<br/>See your browser Javascript console for more details.') |
|
372 | 373 | .addClass('js-error') |
|
373 | 374 | ); |
|
374 | 375 | } |
|
375 | 376 | }; |
|
376 | 377 | |
|
377 | 378 | |
|
378 | 379 | OutputArea.prototype.append_text = function (data, element, extra_class) { |
|
379 | 380 | var toinsert = $("<div/>").addClass("output_subarea output_text"); |
|
380 | 381 | // escape ANSI & HTML specials in plaintext: |
|
381 | 382 | data = utils.fixConsole(data); |
|
382 | 383 | data = utils.fixCarriageReturn(data); |
|
383 | 384 | data = utils.autoLinkUrls(data); |
|
384 | 385 | if (extra_class){ |
|
385 | 386 | toinsert.addClass(extra_class); |
|
386 | 387 | } |
|
387 | 388 | toinsert.append($("<pre/>").html(data)); |
|
388 | 389 | element.append(toinsert); |
|
389 | 390 | }; |
|
390 | 391 | |
|
391 | 392 | |
|
392 | 393 | OutputArea.prototype.append_svg = function (svg, element) { |
|
393 | 394 | var toinsert = $("<div/>").addClass("output_subarea output_svg"); |
|
394 | 395 | toinsert.append(svg); |
|
395 | 396 | element.append(toinsert); |
|
396 | 397 | }; |
|
397 | 398 | |
|
398 | 399 | |
|
399 | 400 | OutputArea.prototype._dblclick_to_reset_size = function (img) { |
|
400 | 401 | // schedule wrapping image in resizable after a delay, |
|
401 | 402 | // so we don't end up calling resize on a zero-size object |
|
402 | 403 | var that = this; |
|
403 | 404 | setTimeout(function () { |
|
404 | 405 | var h0 = img.height(); |
|
405 | 406 | var w0 = img.width(); |
|
406 | 407 | if (!(h0 && w0)) { |
|
407 | 408 | // zero size, schedule another timeout |
|
408 | 409 | that._dblclick_to_reset_size(img); |
|
409 | 410 | return; |
|
410 | 411 | } |
|
411 | 412 | img.resizable({ |
|
412 | 413 | aspectRatio: true, |
|
413 | 414 | autoHide: true |
|
414 | 415 | }); |
|
415 | 416 | img.dblclick(function () { |
|
416 | 417 | // resize wrapper & image together for some reason: |
|
417 | 418 | img.parent().height(h0); |
|
418 | 419 | img.height(h0); |
|
419 | 420 | img.parent().width(w0); |
|
420 | 421 | img.width(w0); |
|
421 | 422 | }); |
|
422 | 423 | }, 250); |
|
423 | 424 | }; |
|
424 | 425 | |
|
425 | 426 | |
|
426 | 427 | OutputArea.prototype.append_png = function (png, element) { |
|
427 | 428 | var toinsert = $("<div/>").addClass("output_subarea output_png"); |
|
428 | 429 | var img = $("<img/>").attr('src','data:image/png;base64,'+png); |
|
429 | 430 | this._dblclick_to_reset_size(img); |
|
430 | 431 | toinsert.append(img); |
|
431 | 432 | element.append(toinsert); |
|
432 | 433 | }; |
|
433 | 434 | |
|
434 | 435 | |
|
435 | 436 | OutputArea.prototype.append_jpeg = function (jpeg, element) { |
|
436 | 437 | var toinsert = $("<div/>").addClass("output_subarea output_jpeg"); |
|
437 | 438 | var img = $("<img/>").attr('src','data:image/jpeg;base64,'+jpeg); |
|
438 | 439 | this._dblclick_to_reset_size(img); |
|
439 | 440 | toinsert.append(img); |
|
440 | 441 | element.append(toinsert); |
|
441 | 442 | }; |
|
442 | 443 | |
|
443 | 444 | |
|
444 | 445 | OutputArea.prototype.append_latex = function (latex, element) { |
|
445 | 446 | // This method cannot do the typesetting because the latex first has to |
|
446 | 447 | // be on the page. |
|
447 | 448 | var toinsert = $("<div/>").addClass("output_subarea output_latex"); |
|
448 | 449 | toinsert.append(latex); |
|
449 | 450 | element.append(toinsert); |
|
450 | 451 | }; |
|
452 | ||
|
453 | OutputArea.prototype.append_raw_input = function (content) { | |
|
454 | this.expand(); | |
|
455 | this.flush_clear_timeout(); | |
|
456 | var area = this.create_output_area(); | |
|
457 | area.append( | |
|
458 | $("<div/>") | |
|
459 | .addClass("box-flex1 output_subarea raw_input") | |
|
460 | .append( | |
|
461 | $("<form/>") | |
|
462 | .attr("action", "javascript:$([IPython.events]).trigger('submit_raw_input.OutputArea');") | |
|
463 | .append( | |
|
464 | $("<span/>") | |
|
465 | .addClass("input_prompt") | |
|
466 | .text(content.prompt) | |
|
467 | ).append( | |
|
468 | $("<input/>") | |
|
469 | .attr("size", 80) | |
|
470 | .addClass("raw_input") | |
|
471 | ) | |
|
472 | ) | |
|
473 | ) | |
|
474 | // clear events first | |
|
475 | $([IPython.events]).off('submit_raw_input.OutputArea'); | |
|
476 | $([IPython.events]).on('submit_raw_input.OutputArea', this._submit_raw_input_proxy); | |
|
477 | this.element.append(area); | |
|
478 | area.find("input.raw_input").focus(); | |
|
479 | } | |
|
480 | OutputArea.prototype._submit_raw_input = function (evt) { | |
|
481 | var container = this.element.find("div.raw_input"); | |
|
482 | var theprompt = container.find("span.input_prompt"); | |
|
483 | var theinput = container.find("input.raw_input"); | |
|
484 | var value = theinput.attr("value"); | |
|
485 | var content = { | |
|
486 | output_type : 'stream', | |
|
487 | name : 'stdout', | |
|
488 | text : theprompt.text() + value + '\n' | |
|
489 | } | |
|
490 | // remove form container | |
|
491 | container.parent().remove(); | |
|
492 | // replace with plaintext version in stdout | |
|
493 | this.append_output(content, false); | |
|
494 | $([IPython.events]).off('submit_raw_input.OutputArea', this._submit_raw_input_proxy); | |
|
495 | $([IPython.events]).trigger('send_input_reply.Kernel', value); | |
|
496 | } | |
|
451 | 497 | |
|
452 | 498 | |
|
453 | 499 | OutputArea.prototype.handle_clear_output = function (content) { |
|
454 | 500 | this.clear_output(content.stdout, content.stderr, content.other); |
|
455 | 501 | }; |
|
456 | 502 | |
|
457 | 503 | |
|
458 | 504 | OutputArea.prototype.clear_output = function (stdout, stderr, other) { |
|
459 | 505 | var that = this; |
|
460 | 506 | if (this.clear_out_timeout != null){ |
|
461 | 507 | // fire previous pending clear *immediately* |
|
462 | 508 | clearTimeout(this.clear_out_timeout); |
|
463 | 509 | this.clear_out_timeout = null; |
|
464 | 510 | this.clear_output_callback(this._clear_stdout, this._clear_stderr, this._clear_other); |
|
465 | 511 | } |
|
466 | 512 | // store flags for flushing the timeout |
|
467 | 513 | this._clear_stdout = stdout; |
|
468 | 514 | this._clear_stderr = stderr; |
|
469 | 515 | this._clear_other = other; |
|
470 | 516 | this.clear_out_timeout = setTimeout(function() { |
|
471 | 517 | // really clear timeout only after a short delay |
|
472 | 518 | // this reduces flicker in 'clear_output; print' cases |
|
473 | 519 | that.clear_out_timeout = null; |
|
474 | 520 | that._clear_stdout = that._clear_stderr = that._clear_other = null; |
|
475 | 521 | that.clear_output_callback(stdout, stderr, other); |
|
476 | 522 | }, 500 |
|
477 | 523 | ); |
|
478 | 524 | }; |
|
479 | 525 | |
|
480 | 526 | |
|
481 | 527 | OutputArea.prototype.clear_output_callback = function (stdout, stderr, other) { |
|
482 | 528 | var output_div = this.element; |
|
483 | 529 | |
|
484 | 530 | if (stdout && stderr && other){ |
|
485 | 531 | // clear all, no need for logic |
|
486 | 532 | output_div.html(""); |
|
487 | 533 | this.outputs = []; |
|
488 | 534 | this.unscroll_area(); |
|
489 | 535 | return; |
|
490 | 536 | } |
|
491 | 537 | // remove html output |
|
492 | 538 | // each output_subarea that has an identifying class is in an output_area |
|
493 | 539 | // which is the element to be removed. |
|
494 | 540 | if (stdout) { |
|
495 | 541 | output_div.find("div.output_stdout").parent().remove(); |
|
496 | 542 | } |
|
497 | 543 | if (stderr) { |
|
498 | 544 | output_div.find("div.output_stderr").parent().remove(); |
|
499 | 545 | } |
|
500 | 546 | if (other) { |
|
501 | 547 | output_div.find("div.output_subarea").not("div.output_stderr").not("div.output_stdout").parent().remove(); |
|
502 | 548 | } |
|
503 | 549 | this.unscroll_area(); |
|
504 | 550 | |
|
505 | 551 | // remove cleared outputs from JSON list: |
|
506 | 552 | for (var i = this.outputs.length - 1; i >= 0; i--) { |
|
507 | 553 | var out = this.outputs[i]; |
|
508 | 554 | var output_type = out.output_type; |
|
509 | 555 | if (output_type == "display_data" && other) { |
|
510 | 556 | this.outputs.splice(i,1); |
|
511 | 557 | } else if (output_type == "stream") { |
|
512 | 558 | if (stdout && out.stream == "stdout") { |
|
513 | 559 | this.outputs.splice(i,1); |
|
514 | 560 | } else if (stderr && out.stream == "stderr") { |
|
515 | 561 | this.outputs.splice(i,1); |
|
516 | 562 | } |
|
517 | 563 | } |
|
518 | 564 | } |
|
519 | 565 | }; |
|
520 | 566 | |
|
521 | 567 | |
|
522 | 568 | OutputArea.prototype.flush_clear_timeout = function() { |
|
523 | 569 | var output_div = this.element; |
|
524 | 570 | if (this.clear_out_timeout){ |
|
525 | 571 | clearTimeout(this.clear_out_timeout); |
|
526 | 572 | this.clear_out_timeout = null; |
|
527 | 573 | this.clear_output_callback(this._clear_stdout, this._clear_stderr, this._clear_other); |
|
528 | 574 | } |
|
529 | 575 | }; |
|
530 | 576 | |
|
531 | 577 | |
|
532 | 578 | // JSON serialization |
|
533 | 579 | |
|
534 | 580 | OutputArea.prototype.fromJSON = function (outputs) { |
|
535 | 581 | var len = outputs.length; |
|
536 | 582 | for (var i=0; i<len; i++) { |
|
537 | 583 | // append with dynamic=false. |
|
538 | 584 | this.append_output(outputs[i], false); |
|
539 | 585 | } |
|
540 | 586 | }; |
|
541 | 587 | |
|
542 | 588 | |
|
543 | 589 | OutputArea.prototype.toJSON = function () { |
|
544 | 590 | var outputs = []; |
|
545 | 591 | var len = this.outputs.length; |
|
546 | 592 | for (var i=0; i<len; i++) { |
|
547 | 593 | outputs[i] = this.outputs[i]; |
|
548 | 594 | } |
|
549 | 595 | return outputs; |
|
550 | 596 | }; |
|
551 | 597 | |
|
552 | 598 | |
|
553 | 599 | IPython.OutputArea = OutputArea; |
|
554 | 600 | |
|
555 | 601 | return IPython; |
|
556 | 602 | |
|
557 | 603 | }(IPython)); |
@@ -1,479 +1,487 b'' | |||
|
1 | 1 | /** |
|
2 | 2 | * Primary styles |
|
3 | 3 | * |
|
4 | 4 | * Author: IPython Development Team |
|
5 | 5 | */ |
|
6 | 6 | |
|
7 | 7 | @import "variables.less"; |
|
8 | 8 | |
|
9 | 9 | |
|
10 | 10 | body { |
|
11 | 11 | background-color:@notebook_background; |
|
12 | 12 | } |
|
13 | 13 | |
|
14 | 14 | body.notebook_app { |
|
15 | 15 | overflow: hidden; |
|
16 | 16 | } |
|
17 | 17 | |
|
18 | 18 | blockquote { |
|
19 | 19 | border-left: 4px solid #DDD; |
|
20 | 20 | padding: 0 15px; |
|
21 | 21 | color: #777; |
|
22 | 22 | } |
|
23 | 23 | |
|
24 | 24 | span#save_widget { |
|
25 | 25 | padding: 5px; |
|
26 | 26 | margin: 0px 0px 0px 300px; |
|
27 | 27 | display:inline-block; |
|
28 | 28 | } |
|
29 | 29 | |
|
30 | 30 | span#notebook_name { |
|
31 | 31 | height: 1em; |
|
32 | 32 | line-height: 1em; |
|
33 | 33 | padding: 3px; |
|
34 | 34 | border: none; |
|
35 | 35 | font-size: 146.5%; |
|
36 | 36 | } |
|
37 | 37 | |
|
38 | 38 | |
|
39 | 39 | .ui-menubar-item .ui-button .ui-button-text { |
|
40 | 40 | padding: 0.4em 1.0em; |
|
41 | 41 | font-size: 100%; |
|
42 | 42 | } |
|
43 | 43 | |
|
44 | 44 | .ui-menu { |
|
45 | 45 | -moz-box-shadow: 0px 6px 10px -1px #adadad; |
|
46 | 46 | -webkit-box-shadow: 0px 6px 10px -1px #adadad; |
|
47 | 47 | box-shadow: 0px 6px 10px -1px #adadad; |
|
48 | 48 | } |
|
49 | 49 | |
|
50 | 50 | .ui-menu .ui-menu-item a { |
|
51 | 51 | border: 1px solid transparent; |
|
52 | 52 | padding: 2px 1.6em; |
|
53 | 53 | } |
|
54 | 54 | |
|
55 | 55 | .ui-menu .ui-menu-item a.ui-state-focus { |
|
56 | 56 | margin: 0; |
|
57 | 57 | } |
|
58 | 58 | |
|
59 | 59 | .ui-menu hr { |
|
60 | 60 | margin: 0.3em 0; |
|
61 | 61 | } |
|
62 | 62 | |
|
63 | 63 | #menubar_container { |
|
64 | 64 | position: relative; |
|
65 | 65 | } |
|
66 | 66 | |
|
67 | 67 | #notification_area { |
|
68 | 68 | position: absolute; |
|
69 | 69 | right: 0px; |
|
70 | 70 | top: 0px; |
|
71 | 71 | height: 25px; |
|
72 | 72 | padding: 3px 0px; |
|
73 | 73 | padding-right: 3px; |
|
74 | 74 | z-index: 10; |
|
75 | 75 | } |
|
76 | 76 | |
|
77 | 77 | .notification_widget{ |
|
78 | 78 | float : right; |
|
79 | 79 | right: 0px; |
|
80 | 80 | top: 1px; |
|
81 | 81 | height: 25px; |
|
82 | 82 | padding: 3px 6px; |
|
83 | 83 | z-index: 10; |
|
84 | 84 | } |
|
85 | 85 | |
|
86 | 86 | .toolbar { |
|
87 | 87 | padding: 3px 15px; |
|
88 | 88 | border-bottom: @borderwidth @border_color solid; |
|
89 | 89 | |
|
90 | 90 | button { |
|
91 | 91 | margin-top:2px; |
|
92 | 92 | margin-bottom:2px; |
|
93 | 93 | } |
|
94 | 94 | |
|
95 | 95 | |
|
96 | 96 | select, label { |
|
97 | 97 | height : 19px; |
|
98 | 98 | vertical-align:middle; |
|
99 | 99 | margin-right:2px; |
|
100 | 100 | margin-bottom:0; |
|
101 | 101 | display: inline; |
|
102 | 102 | font-size: 92%; |
|
103 | 103 | margin-left:0.3em; |
|
104 | 104 | margin-right:0.3em; |
|
105 | 105 | padding: 0px; |
|
106 | 106 | } |
|
107 | 107 | } |
|
108 | 108 | |
|
109 | 109 | .toolbar select{ |
|
110 | 110 | width:auto; |
|
111 | 111 | } |
|
112 | 112 | |
|
113 | 113 | |
|
114 | 114 | #ipython-main-app { |
|
115 | 115 | width: 100%; |
|
116 | 116 | position: relative; |
|
117 | 117 | font-size: 110%; |
|
118 | 118 | } |
|
119 | 119 | |
|
120 | 120 | span#quick_help_area { |
|
121 | 121 | position: static; |
|
122 | 122 | padding: 5px 0px; |
|
123 | 123 | margin: 0px 0px 0px 0px; |
|
124 | 124 | } |
|
125 | 125 | |
|
126 | 126 | .help_string { |
|
127 | 127 | float: right; |
|
128 | 128 | width: 170px; |
|
129 | 129 | padding: 0px 5px; |
|
130 | 130 | text-align: left; |
|
131 | 131 | font-size: 85%; |
|
132 | 132 | } |
|
133 | 133 | |
|
134 | 134 | .help_string_label { |
|
135 | 135 | float: right; |
|
136 | 136 | font-size: 85%; |
|
137 | 137 | } |
|
138 | 138 | |
|
139 | 139 | div#notebook_panel { |
|
140 | 140 | margin: 0px 0px 0px 0px; |
|
141 | 141 | padding: 0px; |
|
142 | 142 | } |
|
143 | 143 | |
|
144 | 144 | div#notebook { |
|
145 | 145 | overflow-y: scroll; |
|
146 | 146 | overflow-x: auto; |
|
147 | 147 | width: 100%; |
|
148 | 148 | /* This spaces the cell away from the edge of the notebook area */ |
|
149 | 149 | padding: 5px 5px 15px 5px; |
|
150 | 150 | margin: 0px; |
|
151 | 151 | } |
|
152 | 152 | |
|
153 | 153 | div#pager_splitter { |
|
154 | 154 | height: 8px; |
|
155 | 155 | } |
|
156 | 156 | |
|
157 | 157 | #pager_container { |
|
158 | 158 | position : relative; |
|
159 | 159 | } |
|
160 | 160 | |
|
161 | 161 | div#pager { |
|
162 | 162 | padding: 15px; |
|
163 | 163 | overflow: auto; |
|
164 | 164 | display: none; |
|
165 | 165 | } |
|
166 | 166 | |
|
167 | 167 | div.ui-widget-content { |
|
168 | 168 | border: 1px solid @border_color; |
|
169 | 169 | outline: none; |
|
170 | 170 | } |
|
171 | 171 | |
|
172 | 172 | .cell { |
|
173 | 173 | border: 1px solid transparent; |
|
174 | 174 | .vbox(); |
|
175 | 175 | |
|
176 | 176 | &.selected { |
|
177 | 177 | .corner-all; |
|
178 | 178 | border : thin @border_color solid; |
|
179 | 179 | } |
|
180 | 180 | } |
|
181 | 181 | |
|
182 | 182 | div.cell { |
|
183 | 183 | width: 100%; |
|
184 | 184 | padding: 5px 5px 5px 0px; |
|
185 | 185 | /* This acts as a spacer between cells, that is outside the border */ |
|
186 | 186 | margin: 2px 0px 2px 0px; |
|
187 | 187 | outline: none; |
|
188 | 188 | } |
|
189 | 189 | |
|
190 | 190 | div.code_cell { |
|
191 | 191 | } |
|
192 | 192 | |
|
193 | 193 | /* any special styling for code cells that are currently running goes here */ |
|
194 | 194 | div.code_cell.running { |
|
195 | 195 | } |
|
196 | 196 | |
|
197 | 197 | div.prompt { |
|
198 | 198 | /* This needs to be wide enough for 3 digit prompt numbers: In[100]: */ |
|
199 | 199 | width: 11ex; |
|
200 | 200 | /* This 0.4em is tuned to match the padding on the CodeMirror editor. */ |
|
201 | 201 | padding: 0.4em; |
|
202 | 202 | margin: 0px; |
|
203 | 203 | font-family: monospace; |
|
204 | 204 | text-align: right; |
|
205 | 205 | /* This has to match that of the the CodeMirror class line-height below */ |
|
206 | 206 | line-height: 1.231; |
|
207 | 207 | } |
|
208 | 208 | |
|
209 | 209 | div.input { |
|
210 | 210 | page-break-inside: avoid; |
|
211 | 211 | .hbox(); |
|
212 | 212 | } |
|
213 | 213 | |
|
214 | 214 | /* input_area and input_prompt must match in top border and margin for alignment */ |
|
215 | 215 | div.input_area { |
|
216 | 216 | /*color: @fontBaseColor;*/ |
|
217 | 217 | border: 1px solid @light_border_color; |
|
218 | 218 | .corner-all; |
|
219 | 219 | background: @cell_background; |
|
220 | 220 | } |
|
221 | 221 | |
|
222 | 222 | div.input_prompt { |
|
223 | 223 | color: navy; |
|
224 | 224 | border-top: 1px solid transparent; |
|
225 | 225 | } |
|
226 | 226 | |
|
227 | 227 | div.output_wrapper { |
|
228 | 228 | /* This is a spacer between the input and output of each cell */ |
|
229 | 229 | margin-top: 5px; |
|
230 | 230 | margin-left: 5px; |
|
231 | 231 | /* FF needs explicit width to stretch */ |
|
232 | 232 | width: 100%; |
|
233 | 233 | /* this position must be relative to enable descendents to be absolute within it */ |
|
234 | 234 | position: relative; |
|
235 | 235 | } |
|
236 | 236 | |
|
237 | 237 | /* class for the output area when it should be height-limited */ |
|
238 | 238 | div.output_scroll { |
|
239 | 239 | /* ideally, this would be max-height, but FF barfs all over that */ |
|
240 | 240 | height: 24em; |
|
241 | 241 | /* FF needs this *and the wrapper* to specify full width, or it will shrinkwrap */ |
|
242 | 242 | width: 100%; |
|
243 | 243 | |
|
244 | 244 | overflow: auto; |
|
245 | 245 | .corner-all; |
|
246 | 246 | box-shadow: inset 0 2px 8px rgba(0, 0, 0, .8); |
|
247 | 247 | } |
|
248 | 248 | |
|
249 | 249 | /* output div while it is collapsed */ |
|
250 | 250 | div.output_collapsed { |
|
251 | 251 | margin-right: 5px; |
|
252 | 252 | } |
|
253 | 253 | |
|
254 | 254 | div.out_prompt_overlay { |
|
255 | 255 | height: 100%; |
|
256 | 256 | padding: 0px; |
|
257 | 257 | position: absolute; |
|
258 | 258 | .corner-all; |
|
259 | 259 | } |
|
260 | 260 | |
|
261 | 261 | div.out_prompt_overlay:hover { |
|
262 | 262 | /* use inner shadow to get border that is computed the same on WebKit/FF */ |
|
263 | 263 | box-shadow: inset 0 0 1px #000; |
|
264 | 264 | background: rgba(240, 240, 240, 0.5); |
|
265 | 265 | } |
|
266 | 266 | |
|
267 | 267 | div.output_prompt { |
|
268 | 268 | color: darkred; |
|
269 | 269 | /* 5px right shift to account for margin in parent container */ |
|
270 | 270 | margin: 0 5px 0 -5px; |
|
271 | 271 | } |
|
272 | 272 | |
|
273 | 273 | /* This class is the outer container of all output sections. */ |
|
274 | 274 | div.output_area { |
|
275 | 275 | padding: 0px; |
|
276 | 276 | page-break-inside: avoid; |
|
277 | 277 | .hbox(); |
|
278 | 278 | } |
|
279 | 279 | |
|
280 | 280 | |
|
281 | 281 | /* This is needed to protect the pre formating from global settings such |
|
282 | 282 | as that of bootstrap */ |
|
283 | 283 | div.output_area pre { |
|
284 | 284 | font-family: monospace; |
|
285 | 285 | margin: 0; |
|
286 | 286 | padding: 0; |
|
287 | 287 | border: 0; |
|
288 | 288 | font-size: 100%; |
|
289 | 289 | vertical-align: baseline; |
|
290 | 290 | color: black; |
|
291 | 291 | } |
|
292 | 292 | |
|
293 | 293 | /* This class is for the output subarea inside the output_area and after |
|
294 | 294 | the prompt div. */ |
|
295 | 295 | div.output_subarea { |
|
296 | 296 | padding: 0.44em 0.4em 0.4em 1px; |
|
297 | 297 | .box-flex1(); |
|
298 | 298 | } |
|
299 | 299 | |
|
300 | 300 | /* The rest of the output_* classes are for special styling of the different |
|
301 | 301 | output types */ |
|
302 | 302 | |
|
303 | 303 | /* all text output has this class: */ |
|
304 | 304 | div.output_text { |
|
305 | 305 | text-align: left; |
|
306 | 306 | color: @fontBaseColor; |
|
307 | 307 | font-family: monospace; |
|
308 | 308 | /* This has to match that of the the CodeMirror class line-height below */ |
|
309 | 309 | line-height: 1.231; |
|
310 | 310 | } |
|
311 | 311 | |
|
312 | 312 | /* stdout/stderr are 'text' as well as 'stream', but pyout/pyerr are *not* streams */ |
|
313 | 313 | div.output_stream { |
|
314 | 314 | padding-top: 0.0em; |
|
315 | 315 | padding-bottom: 0.0em; |
|
316 | 316 | } |
|
317 | 317 | div.output_stdout { |
|
318 | 318 | } |
|
319 | 319 | div.output_stderr { |
|
320 | 320 | background: #fdd; /* very light red background for stderr */ |
|
321 | 321 | } |
|
322 | 322 | |
|
323 | 323 | div.output_latex { |
|
324 | 324 | text-align: left; |
|
325 | 325 | } |
|
326 | 326 | |
|
327 | 327 | div.output_html { |
|
328 | 328 | } |
|
329 | 329 | |
|
330 | 330 | div.output_png { |
|
331 | 331 | } |
|
332 | 332 | |
|
333 | 333 | div.output_jpeg { |
|
334 | 334 | } |
|
335 | 335 | |
|
336 | 336 | div.text_cell { |
|
337 | 337 | padding: 5px 5px 5px 5px; |
|
338 | 338 | } |
|
339 | 339 | |
|
340 | 340 | div.text_cell_input { |
|
341 | 341 | color: @fontBaseColor; |
|
342 | 342 | border: 1px solid @light_border_color; |
|
343 | 343 | .corner-all; |
|
344 | 344 | background: @cell_background; |
|
345 | 345 | } |
|
346 | 346 | |
|
347 | 347 | div.text_cell_render { |
|
348 | 348 | /*font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;*/ |
|
349 | 349 | outline: none; |
|
350 | 350 | resize: none; |
|
351 | 351 | width: inherit; |
|
352 | 352 | border-style: none; |
|
353 | 353 | padding: 5px; |
|
354 | 354 | color: @fontBaseColor; |
|
355 | 355 | } |
|
356 | 356 | |
|
357 | 357 | /* The following gets added to the <head> if it is detected that the user has a |
|
358 | 358 | * monospace font with inconsistent normal/bold/italic height. See |
|
359 | 359 | * notebookmain.js. Such fonts will have keywords vertically offset with |
|
360 | 360 | * respect to the rest of the text. The user should select a better font. |
|
361 | 361 | * See: https://github.com/ipython/ipython/issues/1503 |
|
362 | 362 | * |
|
363 | 363 | * .CodeMirror span { |
|
364 | 364 | * vertical-align: bottom; |
|
365 | 365 | * } |
|
366 | 366 | */ |
|
367 | 367 | |
|
368 | 368 | .CodeMirror { |
|
369 | 369 | line-height: 1.231; /* Changed from 1em to our global default */ |
|
370 | 370 | } |
|
371 | 371 | |
|
372 | 372 | .CodeMirror-scroll { |
|
373 | 373 | height: auto; /* Changed to auto to autogrow */ |
|
374 | 374 | /* The CodeMirror docs are a bit fuzzy on if overflow-y should be hidden or visible.*/ |
|
375 | 375 | /* We have found that if it is visible, vertical scrollbars appear with font size changes.*/ |
|
376 | 376 | overflow-y: hidden; |
|
377 | 377 | overflow-x: auto; /* Changed from auto to remove scrollbar */ |
|
378 | 378 | } |
|
379 | 379 | |
|
380 | 380 | /* CSS font colors for translated ANSI colors. */ |
|
381 | 381 | |
|
382 | 382 | |
|
383 | 383 | .ansiblack {color: @fontBaseColor;} |
|
384 | 384 | .ansired {color: darkred;} |
|
385 | 385 | .ansigreen {color: darkgreen;} |
|
386 | 386 | .ansiyellow {color: brown;} |
|
387 | 387 | .ansiblue {color: darkblue;} |
|
388 | 388 | .ansipurple {color: darkviolet;} |
|
389 | 389 | .ansicyan {color: steelblue;} |
|
390 | 390 | .ansigrey {color: grey;} |
|
391 | 391 | .ansibold {font-weight: bold;} |
|
392 | 392 | |
|
393 | 393 | .completions { |
|
394 | 394 | position: absolute; |
|
395 | 395 | z-index: 10; |
|
396 | 396 | overflow: hidden; |
|
397 | 397 | border: 1px solid @border_color; |
|
398 | 398 | } |
|
399 | 399 | |
|
400 | 400 | .completions select { |
|
401 | 401 | background: white; |
|
402 | 402 | outline: none; |
|
403 | 403 | border: none; |
|
404 | 404 | padding: 0px; |
|
405 | 405 | margin: 0px; |
|
406 | 406 | overflow: auto; |
|
407 | 407 | font-family: monospace; |
|
408 | 408 | } |
|
409 | 409 | |
|
410 | 410 | option.context { |
|
411 | 411 | background-color: #DEF7FF; |
|
412 | 412 | } |
|
413 | 413 | option.introspection { |
|
414 | 414 | background-color: #EBF4EB; |
|
415 | 415 | } |
|
416 | 416 | |
|
417 | 417 | /*fixed part of the completion*/ |
|
418 | 418 | .completions p b { |
|
419 | 419 | font-weight:bold; |
|
420 | 420 | } |
|
421 | 421 | |
|
422 | 422 | .completions p { |
|
423 | 423 | background: #DDF; |
|
424 | 424 | /*outline: none; |
|
425 | 425 | padding: 0px;*/ |
|
426 | 426 | border-bottom: black solid 1px; |
|
427 | 427 | padding: 1px; |
|
428 | 428 | font-family: monospace; |
|
429 | 429 | } |
|
430 | 430 | |
|
431 | 431 | pre.dialog { |
|
432 | 432 | background-color: @cell_background; |
|
433 | 433 | border: 1px solid #ddd; |
|
434 | 434 | .corner-all; |
|
435 | 435 | padding: 0.4em; |
|
436 | 436 | padding-left: 2em; |
|
437 | 437 | } |
|
438 | 438 | |
|
439 | 439 | p.dialog { |
|
440 | 440 | padding : 0.2em; |
|
441 | 441 | } |
|
442 | 442 | |
|
443 | 443 | .shortcut_key { |
|
444 | 444 | display: inline-block; |
|
445 | 445 | width: 15ex; |
|
446 | 446 | text-align: right; |
|
447 | 447 | font-family: monospace; |
|
448 | 448 | } |
|
449 | 449 | |
|
450 | 450 | .shortcut_descr { |
|
451 | 451 | } |
|
452 | 452 | |
|
453 | 453 | /* Word-wrap output correctly. This is the CSS3 spelling, though Firefox seems |
|
454 | 454 | to not honor it correctly. Webkit browsers (Chrome, rekonq, Safari) do. |
|
455 | 455 | */ |
|
456 | 456 | pre, code, kbd, samp { white-space: pre-wrap; } |
|
457 | 457 | |
|
458 | 458 | #fonttest { |
|
459 | 459 | font-family: monospace; |
|
460 | 460 | } |
|
461 | 461 | |
|
462 | 462 | .js-error { |
|
463 | 463 | color: darkred; |
|
464 | 464 | } |
|
465 | 465 | |
|
466 | 466 | a { |
|
467 | 467 | text-decoration: underline; |
|
468 | 468 | } |
|
469 | 469 | |
|
470 | 470 | p { |
|
471 | 471 | |
|
472 | 472 | margin-bottom:0; |
|
473 | 473 | |
|
474 | 474 | } |
|
475 | 475 | |
|
476 | 476 | a.heading-anchor:link, a.heading-anchor:visited { |
|
477 | 477 | text-decoration: none; |
|
478 | 478 | color: inherit; |
|
479 | ||
|
480 | /* raw_input styles */ | |
|
481 | ||
|
482 | span.input_prompt { | |
|
483 | font-family: monospace; | |
|
484 | } | |
|
485 | input.raw_input { | |
|
486 | width: auto; | |
|
479 | 487 | } |
General Comments 0
You need to be logged in to leave comments.
Login now