Show More
@@ -0,0 +1,157 b'' | |||
|
1 | /* | |
|
2 | ||
|
3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org> | |
|
4 | Adapted from GitHub theme | |
|
5 | ||
|
6 | */ | |
|
7 | ||
|
8 | pre code { | |
|
9 | display: block; | |
|
10 | padding: 0.5em; | |
|
11 | } | |
|
12 | ||
|
13 | .highlight-base, | |
|
14 | pre code, | |
|
15 | pre .subst, | |
|
16 | pre .tag .title, | |
|
17 | pre .lisp .title, | |
|
18 | pre .clojure .built_in, | |
|
19 | pre .nginx .title { | |
|
20 | color: black; | |
|
21 | } | |
|
22 | ||
|
23 | .highlight-string, | |
|
24 | pre .string, | |
|
25 | pre .constant, | |
|
26 | pre .parent, | |
|
27 | pre .tag .value, | |
|
28 | pre .rules .value, | |
|
29 | pre .rules .value .number, | |
|
30 | pre .preprocessor, | |
|
31 | pre .ruby .symbol, | |
|
32 | pre .ruby .symbol .string, | |
|
33 | pre .aggregate, | |
|
34 | pre .template_tag, | |
|
35 | pre .django .variable, | |
|
36 | pre .smalltalk .class, | |
|
37 | pre .addition, | |
|
38 | pre .flow, | |
|
39 | pre .stream, | |
|
40 | pre .bash .variable, | |
|
41 | pre .apache .tag, | |
|
42 | pre .apache .cbracket, | |
|
43 | pre .tex .command, | |
|
44 | pre .tex .special, | |
|
45 | pre .erlang_repl .function_or_atom, | |
|
46 | pre .markdown .header { | |
|
47 | color: #BA2121; | |
|
48 | } | |
|
49 | ||
|
50 | .highlight-comment, | |
|
51 | pre .comment, | |
|
52 | pre .annotation, | |
|
53 | pre .template_comment, | |
|
54 | pre .diff .header, | |
|
55 | pre .chunk, | |
|
56 | pre .markdown .blockquote { | |
|
57 | color: #408080; | |
|
58 | font-style: italic; | |
|
59 | } | |
|
60 | ||
|
61 | .highlight-number, | |
|
62 | pre .number, | |
|
63 | pre .date, | |
|
64 | pre .regexp, | |
|
65 | pre .literal, | |
|
66 | pre .smalltalk .symbol, | |
|
67 | pre .smalltalk .char, | |
|
68 | pre .go .constant, | |
|
69 | pre .change, | |
|
70 | pre .markdown .bullet, | |
|
71 | pre .markdown .link_url { | |
|
72 | color: #080; | |
|
73 | } | |
|
74 | ||
|
75 | pre .label, | |
|
76 | pre .javadoc, | |
|
77 | pre .ruby .string, | |
|
78 | pre .decorator, | |
|
79 | pre .filter .argument, | |
|
80 | pre .localvars, | |
|
81 | pre .array, | |
|
82 | pre .attr_selector, | |
|
83 | pre .important, | |
|
84 | pre .pseudo, | |
|
85 | pre .pi, | |
|
86 | pre .doctype, | |
|
87 | pre .deletion, | |
|
88 | pre .envvar, | |
|
89 | pre .shebang, | |
|
90 | pre .apache .sqbracket, | |
|
91 | pre .nginx .built_in, | |
|
92 | pre .tex .formula, | |
|
93 | pre .erlang_repl .reserved, | |
|
94 | pre .prompt, | |
|
95 | pre .markdown .link_label, | |
|
96 | pre .vhdl .attribute, | |
|
97 | pre .clojure .attribute, | |
|
98 | pre .coffeescript .property { | |
|
99 | color: #88F | |
|
100 | } | |
|
101 | ||
|
102 | .highlight-keyword, | |
|
103 | pre .keyword, | |
|
104 | pre .id, | |
|
105 | pre .phpdoc, | |
|
106 | pre .aggregate, | |
|
107 | pre .css .tag, | |
|
108 | pre .javadoctag, | |
|
109 | pre .phpdoc, | |
|
110 | pre .yardoctag, | |
|
111 | pre .smalltalk .class, | |
|
112 | pre .winutils, | |
|
113 | pre .bash .variable, | |
|
114 | pre .apache .tag, | |
|
115 | pre .go .typename, | |
|
116 | pre .tex .command, | |
|
117 | pre .markdown .strong, | |
|
118 | pre .request, | |
|
119 | pre .status { | |
|
120 | color: #008000; | |
|
121 | font-weight: bold; | |
|
122 | } | |
|
123 | ||
|
124 | .highlight-builtin, | |
|
125 | pre .built_in { | |
|
126 | color: #008000; | |
|
127 | } | |
|
128 | ||
|
129 | pre .markdown .emphasis { | |
|
130 | font-style: italic; | |
|
131 | } | |
|
132 | ||
|
133 | pre .nginx .built_in { | |
|
134 | font-weight: normal; | |
|
135 | } | |
|
136 | ||
|
137 | pre .coffeescript .javascript, | |
|
138 | pre .javascript .xml, | |
|
139 | pre .tex .formula, | |
|
140 | pre .xml .javascript, | |
|
141 | pre .xml .vbscript, | |
|
142 | pre .xml .css, | |
|
143 | pre .xml .cdata { | |
|
144 | opacity: 0.5; | |
|
145 | } | |
|
146 | ||
|
147 | /* apply the same style to codemirror */ | |
|
148 | ||
|
149 | .cm-s-ipython span.cm-variable { .highlight-base()} | |
|
150 | .cm-s-ipython span.cm-keyword { .highlight-keyword() } | |
|
151 | .cm-s-ipython span.cm-number { .highlight-number() } | |
|
152 | .cm-s-ipython span.cm-comment { .highlight-comment() } | |
|
153 | .cm-s-ipython span.cm-string { .highlight-string()} | |
|
154 | .cm-s-ipython span.cm-builtin { .highlight-builtin() } | |
|
155 | .cm-s-ipython span.cm-error { color: #f00; } | |
|
156 | .cm-s-ipython span.cm-operator {color: #AA22FF; font-weight: bold;} | |
|
157 | .cm-s-ipython span.cm-meta {color: #AA22FF;} |
@@ -1,3 +1,3 b'' | |||
|
1 | 1 | [submodule "components"] |
|
2 | 2 | path = IPython/frontend/html/notebook/static/components |
|
3 |
url = |
|
|
3 | url = https://github.com/ipython/ipython-components.git |
@@ -1,334 +1,343 b'' | |||
|
1 | 1 | # encoding: utf-8 |
|
2 | 2 | """ |
|
3 | 3 | An application for IPython. |
|
4 | 4 | |
|
5 | 5 | All top-level applications should use the classes in this module for |
|
6 | 6 | handling configuration and creating componenets. |
|
7 | 7 | |
|
8 | 8 | The job of an :class:`Application` is to create the master configuration |
|
9 | 9 | object and then create the configurable objects, passing the config to them. |
|
10 | 10 | |
|
11 | 11 | Authors: |
|
12 | 12 | |
|
13 | 13 | * Brian Granger |
|
14 | 14 | * Fernando Perez |
|
15 | 15 | * Min RK |
|
16 | 16 | |
|
17 | 17 | """ |
|
18 | 18 | |
|
19 | 19 | #----------------------------------------------------------------------------- |
|
20 | 20 | # Copyright (C) 2008-2011 The IPython Development Team |
|
21 | 21 | # |
|
22 | 22 | # Distributed under the terms of the BSD License. The full license is in |
|
23 | 23 | # the file COPYING, distributed as part of this software. |
|
24 | 24 | #----------------------------------------------------------------------------- |
|
25 | 25 | |
|
26 | 26 | #----------------------------------------------------------------------------- |
|
27 | 27 | # Imports |
|
28 | 28 | #----------------------------------------------------------------------------- |
|
29 | 29 | |
|
30 | 30 | import atexit |
|
31 | 31 | import glob |
|
32 | 32 | import logging |
|
33 | 33 | import os |
|
34 | 34 | import shutil |
|
35 | 35 | import sys |
|
36 | 36 | |
|
37 | 37 | from IPython.config.application import Application, catch_config_error |
|
38 | 38 | from IPython.config.loader import ConfigFileNotFound |
|
39 | 39 | from IPython.core import release, crashhandler |
|
40 | 40 | from IPython.core.profiledir import ProfileDir, ProfileDirError |
|
41 | 41 | from IPython.utils.path import get_ipython_dir, get_ipython_package_dir |
|
42 | 42 | from IPython.utils.traitlets import List, Unicode, Type, Bool, Dict |
|
43 | 43 | |
|
44 | 44 | #----------------------------------------------------------------------------- |
|
45 | 45 | # Classes and functions |
|
46 | 46 | #----------------------------------------------------------------------------- |
|
47 | 47 | |
|
48 | 48 | |
|
49 | 49 | #----------------------------------------------------------------------------- |
|
50 | 50 | # Base Application Class |
|
51 | 51 | #----------------------------------------------------------------------------- |
|
52 | 52 | |
|
53 | 53 | # aliases and flags |
|
54 | 54 | |
|
55 | 55 | base_aliases = { |
|
56 | 56 | 'profile' : 'BaseIPythonApplication.profile', |
|
57 | 57 | 'ipython-dir' : 'BaseIPythonApplication.ipython_dir', |
|
58 | 58 | 'log-level' : 'Application.log_level', |
|
59 | 59 | } |
|
60 | 60 | |
|
61 | 61 | base_flags = dict( |
|
62 | 62 | debug = ({'Application' : {'log_level' : logging.DEBUG}}, |
|
63 | 63 | "set log level to logging.DEBUG (maximize logging output)"), |
|
64 | 64 | quiet = ({'Application' : {'log_level' : logging.CRITICAL}}, |
|
65 | 65 | "set log level to logging.CRITICAL (minimize logging output)"), |
|
66 | 66 | init = ({'BaseIPythonApplication' : { |
|
67 | 67 | 'copy_config_files' : True, |
|
68 | 68 | 'auto_create' : True} |
|
69 | 69 | }, """Initialize profile with default config files. This is equivalent |
|
70 | 70 | to running `ipython profile create <profile>` prior to startup. |
|
71 | 71 | """) |
|
72 | 72 | ) |
|
73 | 73 | |
|
74 | 74 | |
|
75 | 75 | class BaseIPythonApplication(Application): |
|
76 | 76 | |
|
77 | 77 | name = Unicode(u'ipython') |
|
78 | 78 | description = Unicode(u'IPython: an enhanced interactive Python shell.') |
|
79 | 79 | version = Unicode(release.version) |
|
80 | 80 | |
|
81 | 81 | aliases = Dict(base_aliases) |
|
82 | 82 | flags = Dict(base_flags) |
|
83 | 83 | classes = List([ProfileDir]) |
|
84 | 84 | |
|
85 | 85 | # Track whether the config_file has changed, |
|
86 | 86 | # because some logic happens only if we aren't using the default. |
|
87 | 87 | config_file_specified = Bool(False) |
|
88 | 88 | |
|
89 | 89 | config_file_name = Unicode(u'ipython_config.py') |
|
90 | 90 | def _config_file_name_default(self): |
|
91 | 91 | return self.name.replace('-','_') + u'_config.py' |
|
92 | 92 | def _config_file_name_changed(self, name, old, new): |
|
93 | 93 | if new != old: |
|
94 | 94 | self.config_file_specified = True |
|
95 | 95 | |
|
96 | 96 | # The directory that contains IPython's builtin profiles. |
|
97 | 97 | builtin_profile_dir = Unicode( |
|
98 | 98 | os.path.join(get_ipython_package_dir(), u'config', u'profile', u'default') |
|
99 | 99 | ) |
|
100 | 100 | |
|
101 | 101 | config_file_paths = List(Unicode) |
|
102 | 102 | def _config_file_paths_default(self): |
|
103 | 103 | return [os.getcwdu()] |
|
104 | 104 | |
|
105 | 105 | profile = Unicode(u'default', config=True, |
|
106 | 106 | help="""The IPython profile to use.""" |
|
107 | 107 | ) |
|
108 | 108 | |
|
109 | 109 | def _profile_changed(self, name, old, new): |
|
110 | 110 | self.builtin_profile_dir = os.path.join( |
|
111 | 111 | get_ipython_package_dir(), u'config', u'profile', new |
|
112 | 112 | ) |
|
113 | 113 | |
|
114 | 114 | ipython_dir = Unicode(get_ipython_dir(), config=True, |
|
115 | 115 | help=""" |
|
116 | 116 | The name of the IPython directory. This directory is used for logging |
|
117 | 117 | configuration (through profiles), history storage, etc. The default |
|
118 | 118 | is usually $HOME/.ipython. This options can also be specified through |
|
119 | 119 | the environment variable IPYTHONDIR. |
|
120 | 120 | """ |
|
121 | 121 | ) |
|
122 | 122 | |
|
123 | 123 | overwrite = Bool(False, config=True, |
|
124 | 124 | help="""Whether to overwrite existing config files when copying""") |
|
125 | 125 | auto_create = Bool(False, config=True, |
|
126 | 126 | help="""Whether to create profile dir if it doesn't exist""") |
|
127 | 127 | |
|
128 | 128 | config_files = List(Unicode) |
|
129 | 129 | def _config_files_default(self): |
|
130 | 130 | return [u'ipython_config.py'] |
|
131 | 131 | |
|
132 | 132 | copy_config_files = Bool(False, config=True, |
|
133 | 133 | help="""Whether to install the default config files into the profile dir. |
|
134 | 134 | If a new profile is being created, and IPython contains config files for that |
|
135 | 135 | profile, then they will be staged into the new directory. Otherwise, |
|
136 | 136 | default config files will be automatically generated. |
|
137 | 137 | """) |
|
138 | 138 | |
|
139 | 139 | verbose_crash = Bool(False, config=True, |
|
140 | 140 | help="""Create a massive crash report when IPython encounters what may be an |
|
141 | 141 | internal error. The default is to append a short message to the |
|
142 | 142 | usual traceback""") |
|
143 | 143 | |
|
144 | 144 | # The class to use as the crash handler. |
|
145 | 145 | crash_handler_class = Type(crashhandler.CrashHandler) |
|
146 | 146 | |
|
147 | @catch_config_error | |
|
147 | 148 | def __init__(self, **kwargs): |
|
148 | 149 | super(BaseIPythonApplication, self).__init__(**kwargs) |
|
150 | # ensure current working directory exists | |
|
151 | try: | |
|
152 | directory = os.getcwdu() | |
|
153 | except: | |
|
154 | # raise exception | |
|
155 | self.log.error("Current working directory doesn't exist.") | |
|
156 | raise | |
|
157 | ||
|
149 | 158 | # ensure even default IPYTHONDIR exists |
|
150 | 159 | if not os.path.exists(self.ipython_dir): |
|
151 | 160 | self._ipython_dir_changed('ipython_dir', self.ipython_dir, self.ipython_dir) |
|
152 | 161 | |
|
153 | 162 | #------------------------------------------------------------------------- |
|
154 | 163 | # Various stages of Application creation |
|
155 | 164 | #------------------------------------------------------------------------- |
|
156 | 165 | |
|
157 | 166 | def init_crash_handler(self): |
|
158 | 167 | """Create a crash handler, typically setting sys.excepthook to it.""" |
|
159 | 168 | self.crash_handler = self.crash_handler_class(self) |
|
160 | 169 | sys.excepthook = self.excepthook |
|
161 | 170 | def unset_crashhandler(): |
|
162 | 171 | sys.excepthook = sys.__excepthook__ |
|
163 | 172 | atexit.register(unset_crashhandler) |
|
164 | 173 | |
|
165 | 174 | def excepthook(self, etype, evalue, tb): |
|
166 | 175 | """this is sys.excepthook after init_crashhandler |
|
167 | 176 | |
|
168 | 177 | set self.verbose_crash=True to use our full crashhandler, instead of |
|
169 | 178 | a regular traceback with a short message (crash_handler_lite) |
|
170 | 179 | """ |
|
171 | 180 | |
|
172 | 181 | if self.verbose_crash: |
|
173 | 182 | return self.crash_handler(etype, evalue, tb) |
|
174 | 183 | else: |
|
175 | 184 | return crashhandler.crash_handler_lite(etype, evalue, tb) |
|
176 | 185 | |
|
177 | 186 | def _ipython_dir_changed(self, name, old, new): |
|
178 | 187 | if old in sys.path: |
|
179 | 188 | sys.path.remove(old) |
|
180 | 189 | sys.path.append(os.path.abspath(new)) |
|
181 | 190 | if not os.path.isdir(new): |
|
182 | 191 | os.makedirs(new, mode=0o777) |
|
183 | 192 | readme = os.path.join(new, 'README') |
|
184 | 193 | if not os.path.exists(readme): |
|
185 | 194 | path = os.path.join(get_ipython_package_dir(), u'config', u'profile') |
|
186 | 195 | shutil.copy(os.path.join(path, 'README'), readme) |
|
187 | 196 | self.log.debug("IPYTHONDIR set to: %s" % new) |
|
188 | 197 | |
|
189 | 198 | def load_config_file(self, suppress_errors=True): |
|
190 | 199 | """Load the config file. |
|
191 | 200 | |
|
192 | 201 | By default, errors in loading config are handled, and a warning |
|
193 | 202 | printed on screen. For testing, the suppress_errors option is set |
|
194 | 203 | to False, so errors will make tests fail. |
|
195 | 204 | """ |
|
196 | 205 | self.log.debug("Searching path %s for config files", self.config_file_paths) |
|
197 | 206 | base_config = 'ipython_config.py' |
|
198 | 207 | self.log.debug("Attempting to load config file: %s" % |
|
199 | 208 | base_config) |
|
200 | 209 | try: |
|
201 | 210 | Application.load_config_file( |
|
202 | 211 | self, |
|
203 | 212 | base_config, |
|
204 | 213 | path=self.config_file_paths |
|
205 | 214 | ) |
|
206 | 215 | except ConfigFileNotFound: |
|
207 | 216 | # ignore errors loading parent |
|
208 | 217 | self.log.debug("Config file %s not found", base_config) |
|
209 | 218 | pass |
|
210 | 219 | if self.config_file_name == base_config: |
|
211 | 220 | # don't load secondary config |
|
212 | 221 | return |
|
213 | 222 | self.log.debug("Attempting to load config file: %s" % |
|
214 | 223 | self.config_file_name) |
|
215 | 224 | try: |
|
216 | 225 | Application.load_config_file( |
|
217 | 226 | self, |
|
218 | 227 | self.config_file_name, |
|
219 | 228 | path=self.config_file_paths |
|
220 | 229 | ) |
|
221 | 230 | except ConfigFileNotFound: |
|
222 | 231 | # Only warn if the default config file was NOT being used. |
|
223 | 232 | if self.config_file_specified: |
|
224 | 233 | msg = self.log.warn |
|
225 | 234 | else: |
|
226 | 235 | msg = self.log.debug |
|
227 | 236 | msg("Config file not found, skipping: %s", self.config_file_name) |
|
228 | 237 | except: |
|
229 | 238 | # For testing purposes. |
|
230 | 239 | if not suppress_errors: |
|
231 | 240 | raise |
|
232 | 241 | self.log.warn("Error loading config file: %s" % |
|
233 | 242 | self.config_file_name, exc_info=True) |
|
234 | 243 | |
|
235 | 244 | def init_profile_dir(self): |
|
236 | 245 | """initialize the profile dir""" |
|
237 | 246 | try: |
|
238 | 247 | # location explicitly specified: |
|
239 | 248 | location = self.config.ProfileDir.location |
|
240 | 249 | except AttributeError: |
|
241 | 250 | # location not specified, find by profile name |
|
242 | 251 | try: |
|
243 | 252 | p = ProfileDir.find_profile_dir_by_name(self.ipython_dir, self.profile, self.config) |
|
244 | 253 | except ProfileDirError: |
|
245 | 254 | # not found, maybe create it (always create default profile) |
|
246 | 255 | if self.auto_create or self.profile == 'default': |
|
247 | 256 | try: |
|
248 | 257 | p = ProfileDir.create_profile_dir_by_name(self.ipython_dir, self.profile, self.config) |
|
249 | 258 | except ProfileDirError: |
|
250 | 259 | self.log.fatal("Could not create profile: %r"%self.profile) |
|
251 | 260 | self.exit(1) |
|
252 | 261 | else: |
|
253 | 262 | self.log.info("Created profile dir: %r"%p.location) |
|
254 | 263 | else: |
|
255 | 264 | self.log.fatal("Profile %r not found."%self.profile) |
|
256 | 265 | self.exit(1) |
|
257 | 266 | else: |
|
258 | 267 | self.log.info("Using existing profile dir: %r"%p.location) |
|
259 | 268 | else: |
|
260 | 269 | # location is fully specified |
|
261 | 270 | try: |
|
262 | 271 | p = ProfileDir.find_profile_dir(location, self.config) |
|
263 | 272 | except ProfileDirError: |
|
264 | 273 | # not found, maybe create it |
|
265 | 274 | if self.auto_create: |
|
266 | 275 | try: |
|
267 | 276 | p = ProfileDir.create_profile_dir(location, self.config) |
|
268 | 277 | except ProfileDirError: |
|
269 | 278 | self.log.fatal("Could not create profile directory: %r"%location) |
|
270 | 279 | self.exit(1) |
|
271 | 280 | else: |
|
272 | 281 | self.log.info("Creating new profile dir: %r"%location) |
|
273 | 282 | else: |
|
274 | 283 | self.log.fatal("Profile directory %r not found."%location) |
|
275 | 284 | self.exit(1) |
|
276 | 285 | else: |
|
277 | 286 | self.log.info("Using existing profile dir: %r"%location) |
|
278 | 287 | |
|
279 | 288 | self.profile_dir = p |
|
280 | 289 | self.config_file_paths.append(p.location) |
|
281 | 290 | |
|
282 | 291 | def init_config_files(self): |
|
283 | 292 | """[optionally] copy default config files into profile dir.""" |
|
284 | 293 | # copy config files |
|
285 | 294 | path = self.builtin_profile_dir |
|
286 | 295 | if self.copy_config_files: |
|
287 | 296 | src = self.profile |
|
288 | 297 | |
|
289 | 298 | cfg = self.config_file_name |
|
290 | 299 | if path and os.path.exists(os.path.join(path, cfg)): |
|
291 | 300 | self.log.warn("Staging %r from %s into %r [overwrite=%s]"%( |
|
292 | 301 | cfg, src, self.profile_dir.location, self.overwrite) |
|
293 | 302 | ) |
|
294 | 303 | self.profile_dir.copy_config_file(cfg, path=path, overwrite=self.overwrite) |
|
295 | 304 | else: |
|
296 | 305 | self.stage_default_config_file() |
|
297 | 306 | else: |
|
298 | 307 | # Still stage *bundled* config files, but not generated ones |
|
299 | 308 | # This is necessary for `ipython profile=sympy` to load the profile |
|
300 | 309 | # on the first go |
|
301 | 310 | files = glob.glob(os.path.join(path, '*.py')) |
|
302 | 311 | for fullpath in files: |
|
303 | 312 | cfg = os.path.basename(fullpath) |
|
304 | 313 | if self.profile_dir.copy_config_file(cfg, path=path, overwrite=False): |
|
305 | 314 | # file was copied |
|
306 | 315 | self.log.warn("Staging bundled %s from %s into %r"%( |
|
307 | 316 | cfg, self.profile, self.profile_dir.location) |
|
308 | 317 | ) |
|
309 | 318 | |
|
310 | 319 | |
|
311 | 320 | def stage_default_config_file(self): |
|
312 | 321 | """auto generate default config file, and stage it into the profile.""" |
|
313 | 322 | s = self.generate_config_file() |
|
314 | 323 | fname = os.path.join(self.profile_dir.location, self.config_file_name) |
|
315 | 324 | if self.overwrite or not os.path.exists(fname): |
|
316 | 325 | self.log.warn("Generating default config file: %r"%(fname)) |
|
317 | 326 | with open(fname, 'w') as f: |
|
318 | 327 | f.write(s) |
|
319 | 328 | |
|
320 | 329 | @catch_config_error |
|
321 | 330 | def initialize(self, argv=None): |
|
322 | 331 | # don't hook up crash handler before parsing command-line |
|
323 | 332 | self.parse_command_line(argv) |
|
324 | 333 | self.init_crash_handler() |
|
325 | 334 | if self.subapp is not None: |
|
326 | 335 | # stop here if subapp is taking over |
|
327 | 336 | return |
|
328 | 337 | cl_config = self.config |
|
329 | 338 | self.init_profile_dir() |
|
330 | 339 | self.init_config_files() |
|
331 | 340 | self.load_config_file() |
|
332 | 341 | # enforce cl-opts override configfile opts: |
|
333 | 342 | self.update_config(cl_config) |
|
334 | 343 |
@@ -1,1118 +1,1177 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | """Implementation of execution-related magic functions. |
|
3 | 3 | """ |
|
4 | 4 | #----------------------------------------------------------------------------- |
|
5 | 5 | # Copyright (c) 2012 The IPython Development Team. |
|
6 | 6 | # |
|
7 | 7 | # Distributed under the terms of the Modified BSD License. |
|
8 | 8 | # |
|
9 | 9 | # The full license is in the file COPYING.txt, distributed with this software. |
|
10 | 10 | #----------------------------------------------------------------------------- |
|
11 | 11 | |
|
12 | 12 | #----------------------------------------------------------------------------- |
|
13 | 13 | # Imports |
|
14 | 14 | #----------------------------------------------------------------------------- |
|
15 | 15 | |
|
16 | 16 | # Stdlib |
|
17 | 17 | import __builtin__ as builtin_mod |
|
18 | 18 | import ast |
|
19 | 19 | import bdb |
|
20 | 20 | import os |
|
21 | 21 | import sys |
|
22 | 22 | import time |
|
23 | 23 | from StringIO import StringIO |
|
24 | 24 | |
|
25 | 25 | # cProfile was added in Python2.5 |
|
26 | 26 | try: |
|
27 | 27 | import cProfile as profile |
|
28 | 28 | import pstats |
|
29 | 29 | except ImportError: |
|
30 | 30 | # profile isn't bundled by default in Debian for license reasons |
|
31 | 31 | try: |
|
32 | 32 | import profile, pstats |
|
33 | 33 | except ImportError: |
|
34 | 34 | profile = pstats = None |
|
35 | 35 | |
|
36 | 36 | # Our own packages |
|
37 | 37 | from IPython.core import debugger, oinspect |
|
38 | 38 | from IPython.core import magic_arguments |
|
39 | 39 | from IPython.core import page |
|
40 | 40 | from IPython.core.error import UsageError |
|
41 | 41 | from IPython.core.macro import Macro |
|
42 | 42 | from IPython.core.magic import (Magics, magics_class, line_magic, cell_magic, |
|
43 | 43 | line_cell_magic, on_off, needs_local_scope) |
|
44 | 44 | from IPython.testing.skipdoctest import skip_doctest |
|
45 | 45 | from IPython.utils import py3compat |
|
46 | 46 | from IPython.utils.contexts import preserve_keys |
|
47 | 47 | from IPython.utils.io import capture_output |
|
48 | 48 | from IPython.utils.ipstruct import Struct |
|
49 | 49 | from IPython.utils.module_paths import find_mod |
|
50 | 50 | from IPython.utils.path import get_py_filename, unquote_filename, shellglob |
|
51 | 51 | from IPython.utils.timing import clock, clock2 |
|
52 | 52 | from IPython.utils.warn import warn, error |
|
53 | 53 | |
|
54 | 54 | |
|
55 | 55 | #----------------------------------------------------------------------------- |
|
56 | 56 | # Magic implementation classes |
|
57 | 57 | #----------------------------------------------------------------------------- |
|
58 | 58 | |
|
59 | 59 | @magics_class |
|
60 | 60 | class ExecutionMagics(Magics): |
|
61 | 61 | """Magics related to code execution, debugging, profiling, etc. |
|
62 | 62 | |
|
63 | 63 | """ |
|
64 | 64 | |
|
65 | 65 | def __init__(self, shell): |
|
66 | 66 | super(ExecutionMagics, self).__init__(shell) |
|
67 | 67 | if profile is None: |
|
68 | 68 | self.prun = self.profile_missing_notice |
|
69 | 69 | # Default execution function used to actually run user code. |
|
70 | 70 | self.default_runner = None |
|
71 | 71 | |
|
72 | 72 | def profile_missing_notice(self, *args, **kwargs): |
|
73 | 73 | error("""\ |
|
74 | 74 | The profile module could not be found. It has been removed from the standard |
|
75 | 75 | python packages because of its non-free license. To use profiling, install the |
|
76 | 76 | python-profiler package from non-free.""") |
|
77 | 77 | |
|
78 | 78 | @skip_doctest |
|
79 | 79 | @line_cell_magic |
|
80 |
def prun(self, parameter_s='', cell=None |
|
|
81 | opts=None,arg_lst=None,prog_ns=None): | |
|
80 | def prun(self, parameter_s='', cell=None): | |
|
82 | 81 | |
|
83 | 82 | """Run a statement through the python code profiler. |
|
84 | 83 | |
|
85 | 84 | Usage, in line mode: |
|
86 | 85 | %prun [options] statement |
|
87 | 86 | |
|
88 | 87 | Usage, in cell mode: |
|
89 | 88 | %%prun [options] [statement] |
|
90 | 89 | code... |
|
91 | 90 | code... |
|
92 | 91 | |
|
93 | 92 | In cell mode, the additional code lines are appended to the (possibly |
|
94 | 93 | empty) statement in the first line. Cell mode allows you to easily |
|
95 | 94 | profile multiline blocks without having to put them in a separate |
|
96 | 95 | function. |
|
97 | 96 | |
|
98 | 97 | The given statement (which doesn't require quote marks) is run via the |
|
99 | 98 | python profiler in a manner similar to the profile.run() function. |
|
100 | 99 | Namespaces are internally managed to work correctly; profile.run |
|
101 | 100 | cannot be used in IPython because it makes certain assumptions about |
|
102 | 101 | namespaces which do not hold under IPython. |
|
103 | 102 | |
|
104 | 103 | Options: |
|
105 | 104 | |
|
106 | 105 | -l <limit>: you can place restrictions on what or how much of the |
|
107 | 106 | profile gets printed. The limit value can be: |
|
108 | 107 | |
|
109 | 108 | * A string: only information for function names containing this string |
|
110 | 109 | is printed. |
|
111 | 110 | |
|
112 | 111 | * An integer: only these many lines are printed. |
|
113 | 112 | |
|
114 | 113 | * A float (between 0 and 1): this fraction of the report is printed |
|
115 | 114 | (for example, use a limit of 0.4 to see the topmost 40% only). |
|
116 | 115 | |
|
117 | 116 | You can combine several limits with repeated use of the option. For |
|
118 | 117 | example, '-l __init__ -l 5' will print only the topmost 5 lines of |
|
119 | 118 | information about class constructors. |
|
120 | 119 | |
|
121 | 120 | -r: return the pstats.Stats object generated by the profiling. This |
|
122 | 121 | object has all the information about the profile in it, and you can |
|
123 | 122 | later use it for further analysis or in other functions. |
|
124 | 123 | |
|
125 | 124 | -s <key>: sort profile by given key. You can provide more than one key |
|
126 | 125 | by using the option several times: '-s key1 -s key2 -s key3...'. The |
|
127 | 126 | default sorting key is 'time'. |
|
128 | 127 | |
|
129 | 128 | The following is copied verbatim from the profile documentation |
|
130 | 129 | referenced below: |
|
131 | 130 | |
|
132 | 131 | When more than one key is provided, additional keys are used as |
|
133 | 132 | secondary criteria when the there is equality in all keys selected |
|
134 | 133 | before them. |
|
135 | 134 | |
|
136 | 135 | Abbreviations can be used for any key names, as long as the |
|
137 | 136 | abbreviation is unambiguous. The following are the keys currently |
|
138 | 137 | defined: |
|
139 | 138 | |
|
140 | 139 | Valid Arg Meaning |
|
141 | 140 | "calls" call count |
|
142 | 141 | "cumulative" cumulative time |
|
143 | 142 | "file" file name |
|
144 | 143 | "module" file name |
|
145 | 144 | "pcalls" primitive call count |
|
146 | 145 | "line" line number |
|
147 | 146 | "name" function name |
|
148 | 147 | "nfl" name/file/line |
|
149 | 148 | "stdname" standard name |
|
150 | 149 | "time" internal time |
|
151 | 150 | |
|
152 | 151 | Note that all sorts on statistics are in descending order (placing |
|
153 | 152 | most time consuming items first), where as name, file, and line number |
|
154 | 153 | searches are in ascending order (i.e., alphabetical). The subtle |
|
155 | 154 | distinction between "nfl" and "stdname" is that the standard name is a |
|
156 | 155 | sort of the name as printed, which means that the embedded line |
|
157 | 156 | numbers get compared in an odd way. For example, lines 3, 20, and 40 |
|
158 | 157 | would (if the file names were the same) appear in the string order |
|
159 | 158 | "20" "3" and "40". In contrast, "nfl" does a numeric compare of the |
|
160 | 159 | line numbers. In fact, sort_stats("nfl") is the same as |
|
161 | 160 | sort_stats("name", "file", "line"). |
|
162 | 161 | |
|
163 | 162 | -T <filename>: save profile results as shown on screen to a text |
|
164 | 163 | file. The profile is still shown on screen. |
|
165 | 164 | |
|
166 | 165 | -D <filename>: save (via dump_stats) profile statistics to given |
|
167 | 166 | filename. This data is in a format understood by the pstats module, and |
|
168 | 167 | is generated by a call to the dump_stats() method of profile |
|
169 | 168 | objects. The profile is still shown on screen. |
|
170 | 169 | |
|
171 | 170 | -q: suppress output to the pager. Best used with -T and/or -D above. |
|
172 | 171 | |
|
173 | 172 | If you want to run complete programs under the profiler's control, use |
|
174 | 173 | '%run -p [prof_opts] filename.py [args to program]' where prof_opts |
|
175 | 174 | contains profiler specific options as described here. |
|
176 | 175 | |
|
177 | 176 | You can read the complete documentation for the profile module with:: |
|
178 | 177 | |
|
179 | 178 | In [1]: import profile; profile.help() |
|
180 | 179 | """ |
|
180 | opts, arg_str = self.parse_options(parameter_s, 'D:l:rs:T:q', | |
|
181 | list_all=True, posix=False) | |
|
182 | if cell is not None: | |
|
183 | arg_str += '\n' + cell | |
|
184 | return self._run_with_profiler(arg_str, opts, self.shell.user_ns) | |
|
181 | 185 | |
|
182 | opts_def = Struct(D=[''],l=[],s=['time'],T=['']) | |
|
186 | def _run_with_profiler(self, code, opts, namespace): | |
|
187 | """ | |
|
188 | Run `code` with profiler. Used by ``%prun`` and ``%run -p``. | |
|
183 | 189 |
|
|
184 | if user_mode: # regular user call | |
|
185 | opts,arg_str = self.parse_options(parameter_s,'D:l:rs:T:q', | |
|
186 | list_all=True, posix=False) | |
|
187 | namespace = self.shell.user_ns | |
|
188 | if cell is not None: | |
|
189 | arg_str += '\n' + cell | |
|
190 | else: # called to run a program by %run -p | |
|
191 | try: | |
|
192 | filename = get_py_filename(arg_lst[0]) | |
|
193 | except IOError as e: | |
|
194 | try: | |
|
195 | msg = str(e) | |
|
196 | except UnicodeError: | |
|
197 | msg = e.message | |
|
198 | error(msg) | |
|
199 | return | |
|
190 | Parameters | |
|
191 | ---------- | |
|
192 | code : str | |
|
193 | Code to be executed. | |
|
194 | opts : Struct | |
|
195 | Options parsed by `self.parse_options`. | |
|
196 | namespace : dict | |
|
197 | A dictionary for Python namespace (e.g., `self.shell.user_ns`). | |
|
200 | 198 |
|
|
201 | arg_str = 'execfile(filename,prog_ns)' | |
|
202 | namespace = { | |
|
203 | 'execfile': self.shell.safe_execfile, | |
|
204 | 'prog_ns': prog_ns, | |
|
205 | 'filename': filename | |
|
206 | } | |
|
199 | """ | |
|
207 | 200 | |
|
208 | opts.merge(opts_def) | |
|
201 | # Fill default values for unspecified options: | |
|
202 | opts.merge(Struct(D=[''], l=[], s=['time'], T=[''])) | |
|
209 | 203 | |
|
210 | 204 | prof = profile.Profile() |
|
211 | 205 | try: |
|
212 |
prof = prof.runctx( |
|
|
206 | prof = prof.runctx(code, namespace, namespace) | |
|
213 | 207 | sys_exit = '' |
|
214 | 208 | except SystemExit: |
|
215 | 209 | sys_exit = """*** SystemExit exception caught in code being profiled.""" |
|
216 | 210 | |
|
217 | 211 | stats = pstats.Stats(prof).strip_dirs().sort_stats(*opts.s) |
|
218 | 212 | |
|
219 | 213 | lims = opts.l |
|
220 | 214 | if lims: |
|
221 | 215 | lims = [] # rebuild lims with ints/floats/strings |
|
222 | 216 | for lim in opts.l: |
|
223 | 217 | try: |
|
224 | 218 | lims.append(int(lim)) |
|
225 | 219 | except ValueError: |
|
226 | 220 | try: |
|
227 | 221 | lims.append(float(lim)) |
|
228 | 222 | except ValueError: |
|
229 | 223 | lims.append(lim) |
|
230 | 224 | |
|
231 | 225 | # Trap output. |
|
232 | 226 | stdout_trap = StringIO() |
|
233 | 227 | stats_stream = stats.stream |
|
234 | 228 | try: |
|
235 | 229 | stats.stream = stdout_trap |
|
236 | 230 | stats.print_stats(*lims) |
|
237 | 231 | finally: |
|
238 | 232 | stats.stream = stats_stream |
|
239 | 233 | |
|
240 | 234 | output = stdout_trap.getvalue() |
|
241 | 235 | output = output.rstrip() |
|
242 | 236 | |
|
243 | 237 | if 'q' not in opts: |
|
244 | 238 | page.page(output) |
|
245 | 239 | print sys_exit, |
|
246 | 240 | |
|
247 | 241 | dump_file = opts.D[0] |
|
248 | 242 | text_file = opts.T[0] |
|
249 | 243 | if dump_file: |
|
250 | 244 | dump_file = unquote_filename(dump_file) |
|
251 | 245 | prof.dump_stats(dump_file) |
|
252 | 246 | print '\n*** Profile stats marshalled to file',\ |
|
253 | 247 | repr(dump_file)+'.',sys_exit |
|
254 | 248 | if text_file: |
|
255 | 249 | text_file = unquote_filename(text_file) |
|
256 | 250 | pfile = open(text_file,'w') |
|
257 | 251 | pfile.write(output) |
|
258 | 252 | pfile.close() |
|
259 | 253 | print '\n*** Profile printout saved to text file',\ |
|
260 | 254 | repr(text_file)+'.',sys_exit |
|
261 | 255 | |
|
262 | 256 | if 'r' in opts: |
|
263 | 257 | return stats |
|
264 | 258 | else: |
|
265 | 259 | return None |
|
266 | 260 | |
|
267 | 261 | @line_magic |
|
268 | 262 | def pdb(self, parameter_s=''): |
|
269 | 263 | """Control the automatic calling of the pdb interactive debugger. |
|
270 | 264 | |
|
271 | 265 | Call as '%pdb on', '%pdb 1', '%pdb off' or '%pdb 0'. If called without |
|
272 | 266 | argument it works as a toggle. |
|
273 | 267 | |
|
274 | 268 | When an exception is triggered, IPython can optionally call the |
|
275 | 269 | interactive pdb debugger after the traceback printout. %pdb toggles |
|
276 | 270 | this feature on and off. |
|
277 | 271 | |
|
278 | 272 | The initial state of this feature is set in your configuration |
|
279 | 273 | file (the option is ``InteractiveShell.pdb``). |
|
280 | 274 | |
|
281 | 275 | If you want to just activate the debugger AFTER an exception has fired, |
|
282 | 276 | without having to type '%pdb on' and rerunning your code, you can use |
|
283 | 277 | the %debug magic.""" |
|
284 | 278 | |
|
285 | 279 | par = parameter_s.strip().lower() |
|
286 | 280 | |
|
287 | 281 | if par: |
|
288 | 282 | try: |
|
289 | 283 | new_pdb = {'off':0,'0':0,'on':1,'1':1}[par] |
|
290 | 284 | except KeyError: |
|
291 | 285 | print ('Incorrect argument. Use on/1, off/0, ' |
|
292 | 286 | 'or nothing for a toggle.') |
|
293 | 287 | return |
|
294 | 288 | else: |
|
295 | 289 | # toggle |
|
296 | 290 | new_pdb = not self.shell.call_pdb |
|
297 | 291 | |
|
298 | 292 | # set on the shell |
|
299 | 293 | self.shell.call_pdb = new_pdb |
|
300 | 294 | print 'Automatic pdb calling has been turned',on_off(new_pdb) |
|
301 | 295 | |
|
302 | 296 | @line_magic |
|
303 | 297 | def debug(self, parameter_s=''): |
|
304 | 298 | """Activate the interactive debugger in post-mortem mode. |
|
305 | 299 | |
|
306 | 300 | If an exception has just occurred, this lets you inspect its stack |
|
307 | 301 | frames interactively. Note that this will always work only on the last |
|
308 | 302 | traceback that occurred, so you must call this quickly after an |
|
309 | 303 | exception that you wish to inspect has fired, because if another one |
|
310 | 304 | occurs, it clobbers the previous one. |
|
311 | 305 | |
|
312 | 306 | If you want IPython to automatically do this on every exception, see |
|
313 | 307 | the %pdb magic for more details. |
|
314 | 308 | """ |
|
315 | 309 | self.shell.debugger(force=True) |
|
316 | 310 | |
|
317 | 311 | @line_magic |
|
318 | 312 | def tb(self, s): |
|
319 | 313 | """Print the last traceback with the currently active exception mode. |
|
320 | 314 | |
|
321 | 315 | See %xmode for changing exception reporting modes.""" |
|
322 | 316 | self.shell.showtraceback() |
|
323 | 317 | |
|
324 | 318 | @skip_doctest |
|
325 | 319 | @line_magic |
|
326 | 320 | def run(self, parameter_s='', runner=None, |
|
327 | 321 | file_finder=get_py_filename): |
|
328 | 322 | """Run the named file inside IPython as a program. |
|
329 | 323 | |
|
330 |
Usage: |
|
|
331 | %run [-n -i -t [-N<N>] -d [-b<N>] -p [profile options] -G] file [args] | |
|
324 | Usage: | |
|
325 | %run [-n -i -e -G] | |
|
326 | [( -t [-N<N>] | -d [-b<N>] | -p [profile options] )] | |
|
327 | ( -m mod | file ) [args] | |
|
332 | 328 | |
|
333 | 329 | Parameters after the filename are passed as command-line arguments to |
|
334 | 330 | the program (put in sys.argv). Then, control returns to IPython's |
|
335 | 331 | prompt. |
|
336 | 332 | |
|
337 | 333 | This is similar to running at a system prompt:\\ |
|
338 | 334 | $ python file args\\ |
|
339 | 335 | but with the advantage of giving you IPython's tracebacks, and of |
|
340 | 336 | loading all variables into your interactive namespace for further use |
|
341 | 337 | (unless -p is used, see below). |
|
342 | 338 | |
|
343 | 339 | The file is executed in a namespace initially consisting only of |
|
344 | 340 | __name__=='__main__' and sys.argv constructed as indicated. It thus |
|
345 | 341 | sees its environment as if it were being run as a stand-alone program |
|
346 | 342 | (except for sharing global objects such as previously imported |
|
347 | 343 | modules). But after execution, the IPython interactive namespace gets |
|
348 | 344 | updated with all variables defined in the program (except for __name__ |
|
349 | 345 | and sys.argv). This allows for very convenient loading of code for |
|
350 | 346 | interactive work, while giving each program a 'clean sheet' to run in. |
|
351 | 347 | |
|
352 | 348 | Arguments are expanded using shell-like glob match. Patterns |
|
353 | 349 | '*', '?', '[seq]' and '[!seq]' can be used. Additionally, |
|
354 | 350 | tilde '~' will be expanded into user's home directory. Unlike |
|
355 | 351 | real shells, quotation does not suppress expansions. Use |
|
356 | 352 | *two* back slashes (e.g., '\\\\*') to suppress expansions. |
|
357 | 353 | To completely disable these expansions, you can use -G flag. |
|
358 | 354 | |
|
359 | 355 | Options: |
|
360 | 356 | |
|
361 | 357 | -n: __name__ is NOT set to '__main__', but to the running file's name |
|
362 | 358 | without extension (as python does under import). This allows running |
|
363 | 359 | scripts and reloading the definitions in them without calling code |
|
364 | 360 | protected by an ' if __name__ == "__main__" ' clause. |
|
365 | 361 | |
|
366 | 362 | -i: run the file in IPython's namespace instead of an empty one. This |
|
367 | 363 | is useful if you are experimenting with code written in a text editor |
|
368 | 364 | which depends on variables defined interactively. |
|
369 | 365 | |
|
370 | 366 | -e: ignore sys.exit() calls or SystemExit exceptions in the script |
|
371 | 367 | being run. This is particularly useful if IPython is being used to |
|
372 | 368 | run unittests, which always exit with a sys.exit() call. In such |
|
373 | 369 | cases you are interested in the output of the test results, not in |
|
374 | 370 | seeing a traceback of the unittest module. |
|
375 | 371 | |
|
376 | 372 | -t: print timing information at the end of the run. IPython will give |
|
377 | 373 | you an estimated CPU time consumption for your script, which under |
|
378 | 374 | Unix uses the resource module to avoid the wraparound problems of |
|
379 | 375 | time.clock(). Under Unix, an estimate of time spent on system tasks |
|
380 | 376 | is also given (for Windows platforms this is reported as 0.0). |
|
381 | 377 | |
|
382 | 378 | If -t is given, an additional -N<N> option can be given, where <N> |
|
383 | 379 | must be an integer indicating how many times you want the script to |
|
384 | 380 | run. The final timing report will include total and per run results. |
|
385 | 381 | |
|
386 | 382 | For example (testing the script uniq_stable.py):: |
|
387 | 383 | |
|
388 | 384 | In [1]: run -t uniq_stable |
|
389 | 385 | |
|
390 | 386 | IPython CPU timings (estimated):\\ |
|
391 | 387 | User : 0.19597 s.\\ |
|
392 | 388 | System: 0.0 s.\\ |
|
393 | 389 | |
|
394 | 390 | In [2]: run -t -N5 uniq_stable |
|
395 | 391 | |
|
396 | 392 | IPython CPU timings (estimated):\\ |
|
397 | 393 | Total runs performed: 5\\ |
|
398 | 394 | Times : Total Per run\\ |
|
399 | 395 | User : 0.910862 s, 0.1821724 s.\\ |
|
400 | 396 | System: 0.0 s, 0.0 s. |
|
401 | 397 | |
|
402 | 398 | -d: run your program under the control of pdb, the Python debugger. |
|
403 | 399 | This allows you to execute your program step by step, watch variables, |
|
404 | 400 | etc. Internally, what IPython does is similar to calling: |
|
405 | 401 | |
|
406 | 402 | pdb.run('execfile("YOURFILENAME")') |
|
407 | 403 | |
|
408 | 404 | with a breakpoint set on line 1 of your file. You can change the line |
|
409 | 405 | number for this automatic breakpoint to be <N> by using the -bN option |
|
410 | 406 | (where N must be an integer). For example:: |
|
411 | 407 | |
|
412 | 408 | %run -d -b40 myscript |
|
413 | 409 | |
|
414 | 410 | will set the first breakpoint at line 40 in myscript.py. Note that |
|
415 | 411 | the first breakpoint must be set on a line which actually does |
|
416 | 412 | something (not a comment or docstring) for it to stop execution. |
|
417 | 413 | |
|
418 | 414 | Or you can specify a breakpoint in a different file:: |
|
419 | 415 | |
|
420 | 416 | %run -d -b myotherfile.py:20 myscript |
|
421 | 417 | |
|
422 | 418 | When the pdb debugger starts, you will see a (Pdb) prompt. You must |
|
423 | 419 | first enter 'c' (without quotes) to start execution up to the first |
|
424 | 420 | breakpoint. |
|
425 | 421 | |
|
426 | 422 | Entering 'help' gives information about the use of the debugger. You |
|
427 | 423 | can easily see pdb's full documentation with "import pdb;pdb.help()" |
|
428 | 424 | at a prompt. |
|
429 | 425 | |
|
430 | 426 | -p: run program under the control of the Python profiler module (which |
|
431 | 427 | prints a detailed report of execution times, function calls, etc). |
|
432 | 428 | |
|
433 | 429 | You can pass other options after -p which affect the behavior of the |
|
434 | 430 | profiler itself. See the docs for %prun for details. |
|
435 | 431 | |
|
436 | 432 | In this mode, the program's variables do NOT propagate back to the |
|
437 | 433 | IPython interactive namespace (because they remain in the namespace |
|
438 | 434 | where the profiler executes them). |
|
439 | 435 | |
|
440 | 436 | Internally this triggers a call to %prun, see its documentation for |
|
441 | 437 | details on the options available specifically for profiling. |
|
442 | 438 | |
|
443 | 439 | There is one special usage for which the text above doesn't apply: |
|
444 | 440 | if the filename ends with .ipy, the file is run as ipython script, |
|
445 | 441 | just as if the commands were written on IPython prompt. |
|
446 | 442 | |
|
447 | 443 | -m: specify module name to load instead of script path. Similar to |
|
448 | 444 | the -m option for the python interpreter. Use this option last if you |
|
449 | 445 | want to combine with other %run options. Unlike the python interpreter |
|
450 | 446 | only source modules are allowed no .pyc or .pyo files. |
|
451 | 447 | For example:: |
|
452 | 448 | |
|
453 | 449 | %run -m example |
|
454 | 450 | |
|
455 | 451 | will run the example module. |
|
456 | 452 | |
|
457 | 453 | -G: disable shell-like glob expansion of arguments. |
|
458 | 454 | |
|
459 | 455 | """ |
|
460 | 456 | |
|
461 | 457 | # get arguments and set sys.argv for program to be run. |
|
462 | 458 | opts, arg_lst = self.parse_options(parameter_s, |
|
463 | 459 | 'nidtN:b:pD:l:rs:T:em:G', |
|
464 | 460 | mode='list', list_all=1) |
|
465 | 461 | if "m" in opts: |
|
466 | 462 | modulename = opts["m"][0] |
|
467 | 463 | modpath = find_mod(modulename) |
|
468 | 464 | if modpath is None: |
|
469 | 465 | warn('%r is not a valid modulename on sys.path'%modulename) |
|
470 | 466 | return |
|
471 | 467 | arg_lst = [modpath] + arg_lst |
|
472 | 468 | try: |
|
473 | 469 | filename = file_finder(arg_lst[0]) |
|
474 | 470 | except IndexError: |
|
475 | 471 | warn('you must provide at least a filename.') |
|
476 | 472 | print '\n%run:\n', oinspect.getdoc(self.run) |
|
477 | 473 | return |
|
478 | 474 | except IOError as e: |
|
479 | 475 | try: |
|
480 | 476 | msg = str(e) |
|
481 | 477 | except UnicodeError: |
|
482 | 478 | msg = e.message |
|
483 | 479 | error(msg) |
|
484 | 480 | return |
|
485 | 481 | |
|
486 | 482 | if filename.lower().endswith('.ipy'): |
|
487 | 483 | with preserve_keys(self.shell.user_ns, '__file__'): |
|
488 | 484 | self.shell.user_ns['__file__'] = filename |
|
489 | 485 | self.shell.safe_execfile_ipy(filename) |
|
490 | 486 | return |
|
491 | 487 | |
|
492 | 488 | # Control the response to exit() calls made by the script being run |
|
493 | 489 | exit_ignore = 'e' in opts |
|
494 | 490 | |
|
495 | 491 | # Make sure that the running script gets a proper sys.argv as if it |
|
496 | 492 | # were run from a system shell. |
|
497 | 493 | save_argv = sys.argv # save it for later restoring |
|
498 | 494 | |
|
499 | 495 | if 'G' in opts: |
|
500 | 496 | args = arg_lst[1:] |
|
501 | 497 | else: |
|
502 | 498 | # tilde and glob expansion |
|
503 | 499 | args = shellglob(map(os.path.expanduser, arg_lst[1:])) |
|
504 | 500 | |
|
505 | 501 | sys.argv = [filename] + args # put in the proper filename |
|
506 | 502 | # protect sys.argv from potential unicode strings on Python 2: |
|
507 | 503 | if not py3compat.PY3: |
|
508 | 504 | sys.argv = [ py3compat.cast_bytes(a) for a in sys.argv ] |
|
509 | 505 | |
|
510 | 506 | if 'i' in opts: |
|
511 | 507 | # Run in user's interactive namespace |
|
512 | 508 | prog_ns = self.shell.user_ns |
|
513 | 509 | __name__save = self.shell.user_ns['__name__'] |
|
514 | 510 | prog_ns['__name__'] = '__main__' |
|
515 | 511 | main_mod = self.shell.new_main_mod(prog_ns) |
|
516 | 512 | else: |
|
517 | 513 | # Run in a fresh, empty namespace |
|
518 | 514 | if 'n' in opts: |
|
519 | 515 | name = os.path.splitext(os.path.basename(filename))[0] |
|
520 | 516 | else: |
|
521 | 517 | name = '__main__' |
|
522 | 518 | |
|
523 | 519 | main_mod = self.shell.new_main_mod() |
|
524 | 520 | prog_ns = main_mod.__dict__ |
|
525 | 521 | prog_ns['__name__'] = name |
|
526 | 522 | |
|
527 | 523 | # Since '%run foo' emulates 'python foo.py' at the cmd line, we must |
|
528 | 524 | # set the __file__ global in the script's namespace |
|
529 | 525 | prog_ns['__file__'] = filename |
|
530 | 526 | |
|
531 | 527 | # pickle fix. See interactiveshell for an explanation. But we need to |
|
532 | 528 | # make sure that, if we overwrite __main__, we replace it at the end |
|
533 | 529 | main_mod_name = prog_ns['__name__'] |
|
534 | 530 | |
|
535 | 531 | if main_mod_name == '__main__': |
|
536 | 532 | restore_main = sys.modules['__main__'] |
|
537 | 533 | else: |
|
538 | 534 | restore_main = False |
|
539 | 535 | |
|
540 | 536 | # This needs to be undone at the end to prevent holding references to |
|
541 | 537 | # every single object ever created. |
|
542 | 538 | sys.modules[main_mod_name] = main_mod |
|
543 | 539 | |
|
540 | if 'p' in opts or 'd' in opts: | |
|
541 | if 'm' in opts: | |
|
542 | code = 'run_module(modulename, prog_ns)' | |
|
543 | code_ns = { | |
|
544 | 'run_module': self.shell.safe_run_module, | |
|
545 | 'prog_ns': prog_ns, | |
|
546 | 'modulename': modulename, | |
|
547 | } | |
|
548 | else: | |
|
549 | code = 'execfile(filename, prog_ns)' | |
|
550 | code_ns = { | |
|
551 | 'execfile': self.shell.safe_execfile, | |
|
552 | 'prog_ns': prog_ns, | |
|
553 | 'filename': get_py_filename(filename), | |
|
554 | } | |
|
555 | ||
|
544 | 556 | try: |
|
545 | 557 | stats = None |
|
546 | 558 | with self.shell.readline_no_record: |
|
547 | 559 | if 'p' in opts: |
|
548 |
stats = self. |
|
|
560 | stats = self._run_with_profiler(code, opts, code_ns) | |
|
549 | 561 | else: |
|
550 | 562 | if 'd' in opts: |
|
551 |
|
|
|
552 | # reset Breakpoint state, which is moronically kept | |
|
553 | # in a class | |
|
554 | bdb.Breakpoint.next = 1 | |
|
555 | bdb.Breakpoint.bplist = {} | |
|
556 | bdb.Breakpoint.bpbynumber = [None] | |
|
557 | # Set an initial breakpoint to stop execution | |
|
558 | maxtries = 10 | |
|
559 | bp_file, bp_line = parse_breakpoint(opts.get('b', ['1'])[0], filename) | |
|
560 | checkline = deb.checkline(bp_file, bp_line) | |
|
561 | if not checkline: | |
|
562 | for bp in range(bp_line + 1, bp_line + maxtries + 1): | |
|
563 | if deb.checkline(bp_file, bp): | |
|
564 | break | |
|
565 | else: | |
|
566 | msg = ("\nI failed to find a valid line to set " | |
|
567 | "a breakpoint\n" | |
|
568 | "after trying up to line: %s.\n" | |
|
569 | "Please set a valid breakpoint manually " | |
|
570 | "with the -b option." % bp) | |
|
571 | error(msg) | |
|
572 | return | |
|
573 | # if we find a good linenumber, set the breakpoint | |
|
574 | deb.do_break('%s:%s' % (bp_file, bp_line)) | |
|
575 | ||
|
576 | # Mimic Pdb._runscript(...) | |
|
577 | deb._wait_for_mainpyfile = True | |
|
578 | deb.mainpyfile = deb.canonic(filename) | |
|
579 | ||
|
580 | # Start file run | |
|
581 | print "NOTE: Enter 'c' at the", | |
|
582 | print "%s prompt to start your script." % deb.prompt | |
|
583 | ns = {'execfile': py3compat.execfile, 'prog_ns': prog_ns} | |
|
584 | try: | |
|
585 | #save filename so it can be used by methods on the deb object | |
|
586 | deb._exec_filename = filename | |
|
587 | deb.run('execfile("%s", prog_ns)' % filename, ns) | |
|
588 | ||
|
589 | except: | |
|
590 | etype, value, tb = sys.exc_info() | |
|
591 | # Skip three frames in the traceback: the %run one, | |
|
592 | # one inside bdb.py, and the command-line typed by the | |
|
593 | # user (run by exec in pdb itself). | |
|
594 | self.shell.InteractiveTB(etype, value, tb, tb_offset=3) | |
|
563 | self._run_with_debugger( | |
|
564 | code, code_ns, opts.get('b', ['1'])[0], filename) | |
|
595 | 565 | else: |
|
596 |
if |
|
|
597 |
|
|
|
598 | if runner is None: | |
|
599 |
|
|
|
566 | if 'm' in opts: | |
|
567 | def run(): | |
|
568 | self.shell.safe_run_module(modulename, prog_ns) | |
|
569 | else: | |
|
570 | if runner is None: | |
|
571 | runner = self.default_runner | |
|
572 | if runner is None: | |
|
573 | runner = self.shell.safe_execfile | |
|
574 | ||
|
575 | def run(): | |
|
576 | runner(filename, prog_ns, prog_ns, | |
|
577 | exit_ignore=exit_ignore) | |
|
578 | ||
|
600 | 579 | if 't' in opts: |
|
601 | 580 | # timed execution |
|
602 | 581 | try: |
|
603 | 582 | nruns = int(opts['N'][0]) |
|
604 | 583 | if nruns < 1: |
|
605 | 584 | error('Number of runs must be >=1') |
|
606 | 585 | return |
|
607 | 586 | except (KeyError): |
|
608 | 587 | nruns = 1 |
|
609 |
|
|
|
610 | if nruns == 1: | |
|
611 | t0 = clock2() | |
|
612 | runner(filename, prog_ns, prog_ns, | |
|
613 | exit_ignore=exit_ignore) | |
|
614 | t1 = clock2() | |
|
615 | t_usr = t1[0] - t0[0] | |
|
616 | t_sys = t1[1] - t0[1] | |
|
617 | print "\nIPython CPU timings (estimated):" | |
|
618 | print " User : %10.2f s." % t_usr | |
|
619 | print " System : %10.2f s." % t_sys | |
|
620 | else: | |
|
621 | runs = range(nruns) | |
|
622 | t0 = clock2() | |
|
623 | for nr in runs: | |
|
624 | runner(filename, prog_ns, prog_ns, | |
|
625 | exit_ignore=exit_ignore) | |
|
626 | t1 = clock2() | |
|
627 | t_usr = t1[0] - t0[0] | |
|
628 | t_sys = t1[1] - t0[1] | |
|
629 | print "\nIPython CPU timings (estimated):" | |
|
630 | print "Total runs performed:", nruns | |
|
631 | print " Times : %10s %10s" % ('Total', 'Per run') | |
|
632 | print " User : %10.2f s, %10.2f s." % (t_usr, t_usr / nruns) | |
|
633 | print " System : %10.2f s, %10.2f s." % (t_sys, t_sys / nruns) | |
|
634 | twall1 = time.time() | |
|
635 | print "Wall time: %10.2f s." % (twall1 - twall0) | |
|
636 | ||
|
588 | self._run_with_timing(run, nruns) | |
|
637 | 589 | else: |
|
638 | 590 | # regular execution |
|
639 | runner(filename, prog_ns, prog_ns, exit_ignore=exit_ignore) | |
|
591 | run() | |
|
640 | 592 | |
|
641 | 593 | if 'i' in opts: |
|
642 | 594 | self.shell.user_ns['__name__'] = __name__save |
|
643 | 595 | else: |
|
644 | 596 | # The shell MUST hold a reference to prog_ns so after %run |
|
645 | 597 | # exits, the python deletion mechanism doesn't zero it out |
|
646 | 598 | # (leaving dangling references). |
|
647 | 599 | self.shell.cache_main_mod(prog_ns, filename) |
|
648 | 600 | # update IPython interactive namespace |
|
649 | 601 | |
|
650 | 602 | # Some forms of read errors on the file may mean the |
|
651 | 603 | # __name__ key was never set; using pop we don't have to |
|
652 | 604 | # worry about a possible KeyError. |
|
653 | 605 | prog_ns.pop('__name__', None) |
|
654 | 606 | |
|
655 | 607 | with preserve_keys(self.shell.user_ns, '__file__'): |
|
656 | 608 | self.shell.user_ns.update(prog_ns) |
|
657 | 609 | finally: |
|
658 | 610 | # It's a bit of a mystery why, but __builtins__ can change from |
|
659 | 611 | # being a module to becoming a dict missing some key data after |
|
660 | 612 | # %run. As best I can see, this is NOT something IPython is doing |
|
661 | 613 | # at all, and similar problems have been reported before: |
|
662 | 614 | # http://coding.derkeiler.com/Archive/Python/comp.lang.python/2004-10/0188.html |
|
663 | 615 | # Since this seems to be done by the interpreter itself, the best |
|
664 | 616 | # we can do is to at least restore __builtins__ for the user on |
|
665 | 617 | # exit. |
|
666 | 618 | self.shell.user_ns['__builtins__'] = builtin_mod |
|
667 | 619 | |
|
668 | 620 | # Ensure key global structures are restored |
|
669 | 621 | sys.argv = save_argv |
|
670 | 622 | if restore_main: |
|
671 | 623 | sys.modules['__main__'] = restore_main |
|
672 | 624 | else: |
|
673 | 625 | # Remove from sys.modules the reference to main_mod we'd |
|
674 | 626 | # added. Otherwise it will trap references to objects |
|
675 | 627 | # contained therein. |
|
676 | 628 | del sys.modules[main_mod_name] |
|
677 | 629 | |
|
678 | 630 | return stats |
|
679 | ||
|
631 | ||
|
632 | def _run_with_debugger(self, code, code_ns, break_point, filename): | |
|
633 | """ | |
|
634 | Run `code` in debugger with a break point. | |
|
635 | ||
|
636 | Parameters | |
|
637 | ---------- | |
|
638 | code : str | |
|
639 | Code to execute. | |
|
640 | code_ns : dict | |
|
641 | A namespace in which `code` is executed. | |
|
642 | break_point : str | |
|
643 | Line number in the file specified by `filename` argument | |
|
644 | or a string in the format ``file:line``. In the latter | |
|
645 | case, `filename` is ignored. | |
|
646 | See also :func:`.parse_breakpoint`. | |
|
647 | filename : str | |
|
648 | Path to the file in which break point is specified. | |
|
649 | ||
|
650 | Raises | |
|
651 | ------ | |
|
652 | UsageError | |
|
653 | If no meaningful break point is given by `break_point` and | |
|
654 | `filename`. | |
|
655 | ||
|
656 | """ | |
|
657 | deb = debugger.Pdb(self.shell.colors) | |
|
658 | # reset Breakpoint state, which is moronically kept | |
|
659 | # in a class | |
|
660 | bdb.Breakpoint.next = 1 | |
|
661 | bdb.Breakpoint.bplist = {} | |
|
662 | bdb.Breakpoint.bpbynumber = [None] | |
|
663 | # Set an initial breakpoint to stop execution | |
|
664 | maxtries = 10 | |
|
665 | bp_file, bp_line = parse_breakpoint(break_point, filename) | |
|
666 | checkline = deb.checkline(bp_file, bp_line) | |
|
667 | if not checkline: | |
|
668 | for bp in range(bp_line + 1, bp_line + maxtries + 1): | |
|
669 | if deb.checkline(bp_file, bp): | |
|
670 | break | |
|
671 | else: | |
|
672 | msg = ("\nI failed to find a valid line to set " | |
|
673 | "a breakpoint\n" | |
|
674 | "after trying up to line: %s.\n" | |
|
675 | "Please set a valid breakpoint manually " | |
|
676 | "with the -b option." % bp) | |
|
677 | raise UsageError(msg) | |
|
678 | # if we find a good linenumber, set the breakpoint | |
|
679 | deb.do_break('%s:%s' % (bp_file, bp_line)) | |
|
680 | ||
|
681 | # Mimic Pdb._runscript(...) | |
|
682 | deb._wait_for_mainpyfile = True | |
|
683 | deb.mainpyfile = deb.canonic(filename) | |
|
684 | ||
|
685 | # Start file run | |
|
686 | print "NOTE: Enter 'c' at the", | |
|
687 | print "%s prompt to start your script." % deb.prompt | |
|
688 | try: | |
|
689 | #save filename so it can be used by methods on the deb object | |
|
690 | deb._exec_filename = filename | |
|
691 | deb.run(code, code_ns) | |
|
692 | ||
|
693 | except: | |
|
694 | etype, value, tb = sys.exc_info() | |
|
695 | # Skip three frames in the traceback: the %run one, | |
|
696 | # one inside bdb.py, and the command-line typed by the | |
|
697 | # user (run by exec in pdb itself). | |
|
698 | self.shell.InteractiveTB(etype, value, tb, tb_offset=3) | |
|
699 | ||
|
700 | @staticmethod | |
|
701 | def _run_with_timing(run, nruns): | |
|
702 | """ | |
|
703 | Run function `run` and print timing information. | |
|
704 | ||
|
705 | Parameters | |
|
706 | ---------- | |
|
707 | run : callable | |
|
708 | Any callable object which takes no argument. | |
|
709 | nruns : int | |
|
710 | Number of times to execute `run`. | |
|
711 | ||
|
712 | """ | |
|
713 | twall0 = time.time() | |
|
714 | if nruns == 1: | |
|
715 | t0 = clock2() | |
|
716 | run() | |
|
717 | t1 = clock2() | |
|
718 | t_usr = t1[0] - t0[0] | |
|
719 | t_sys = t1[1] - t0[1] | |
|
720 | print "\nIPython CPU timings (estimated):" | |
|
721 | print " User : %10.2f s." % t_usr | |
|
722 | print " System : %10.2f s." % t_sys | |
|
723 | else: | |
|
724 | runs = range(nruns) | |
|
725 | t0 = clock2() | |
|
726 | for nr in runs: | |
|
727 | run() | |
|
728 | t1 = clock2() | |
|
729 | t_usr = t1[0] - t0[0] | |
|
730 | t_sys = t1[1] - t0[1] | |
|
731 | print "\nIPython CPU timings (estimated):" | |
|
732 | print "Total runs performed:", nruns | |
|
733 | print " Times : %10s %10s" % ('Total', 'Per run') | |
|
734 | print " User : %10.2f s, %10.2f s." % (t_usr, t_usr / nruns) | |
|
735 | print " System : %10.2f s, %10.2f s." % (t_sys, t_sys / nruns) | |
|
736 | twall1 = time.time() | |
|
737 | print "Wall time: %10.2f s." % (twall1 - twall0) | |
|
738 | ||
|
680 | 739 | @skip_doctest |
|
681 | 740 | @line_cell_magic |
|
682 | 741 | def timeit(self, line='', cell=None): |
|
683 | 742 | """Time execution of a Python statement or expression |
|
684 | 743 | |
|
685 | 744 | Usage, in line mode: |
|
686 | 745 | %timeit [-n<N> -r<R> [-t|-c]] statement |
|
687 | 746 | or in cell mode: |
|
688 | 747 | %%timeit [-n<N> -r<R> [-t|-c]] setup_code |
|
689 | 748 | code |
|
690 | 749 | code... |
|
691 | 750 | |
|
692 | 751 | Time execution of a Python statement or expression using the timeit |
|
693 | 752 | module. This function can be used both as a line and cell magic: |
|
694 | 753 | |
|
695 | 754 | - In line mode you can time a single-line statement (though multiple |
|
696 | 755 | ones can be chained with using semicolons). |
|
697 | 756 | |
|
698 | 757 | - In cell mode, the statement in the first line is used as setup code |
|
699 | 758 | (executed but not timed) and the body of the cell is timed. The cell |
|
700 | 759 | body has access to any variables created in the setup code. |
|
701 | 760 | |
|
702 | 761 | Options: |
|
703 | 762 | -n<N>: execute the given statement <N> times in a loop. If this value |
|
704 | 763 | is not given, a fitting value is chosen. |
|
705 | 764 | |
|
706 | 765 | -r<R>: repeat the loop iteration <R> times and take the best result. |
|
707 | 766 | Default: 3 |
|
708 | 767 | |
|
709 | 768 | -t: use time.time to measure the time, which is the default on Unix. |
|
710 | 769 | This function measures wall time. |
|
711 | 770 | |
|
712 | 771 | -c: use time.clock to measure the time, which is the default on |
|
713 | 772 | Windows and measures wall time. On Unix, resource.getrusage is used |
|
714 | 773 | instead and returns the CPU user time. |
|
715 | 774 | |
|
716 | 775 | -p<P>: use a precision of <P> digits to display the timing result. |
|
717 | 776 | Default: 3 |
|
718 | 777 | |
|
719 | 778 | |
|
720 | 779 | Examples |
|
721 | 780 | -------- |
|
722 | 781 | :: |
|
723 | 782 | |
|
724 | 783 | In [1]: %timeit pass |
|
725 | 784 | 10000000 loops, best of 3: 53.3 ns per loop |
|
726 | 785 | |
|
727 | 786 | In [2]: u = None |
|
728 | 787 | |
|
729 | 788 | In [3]: %timeit u is None |
|
730 | 789 | 10000000 loops, best of 3: 184 ns per loop |
|
731 | 790 | |
|
732 | 791 | In [4]: %timeit -r 4 u == None |
|
733 | 792 | 1000000 loops, best of 4: 242 ns per loop |
|
734 | 793 | |
|
735 | 794 | In [5]: import time |
|
736 | 795 | |
|
737 | 796 | In [6]: %timeit -n1 time.sleep(2) |
|
738 | 797 | 1 loops, best of 3: 2 s per loop |
|
739 | 798 | |
|
740 | 799 | |
|
741 | 800 | The times reported by %timeit will be slightly higher than those |
|
742 | 801 | reported by the timeit.py script when variables are accessed. This is |
|
743 | 802 | due to the fact that %timeit executes the statement in the namespace |
|
744 | 803 | of the shell, compared with timeit.py, which uses a single setup |
|
745 | 804 | statement to import function or create variables. Generally, the bias |
|
746 | 805 | does not matter as long as results from timeit.py are not mixed with |
|
747 | 806 | those from %timeit.""" |
|
748 | 807 | |
|
749 | 808 | import timeit |
|
750 | 809 | |
|
751 | 810 | opts, stmt = self.parse_options(line,'n:r:tcp:', |
|
752 | 811 | posix=False, strict=False) |
|
753 | 812 | if stmt == "" and cell is None: |
|
754 | 813 | return |
|
755 | 814 | |
|
756 | 815 | timefunc = timeit.default_timer |
|
757 | 816 | number = int(getattr(opts, "n", 0)) |
|
758 | 817 | repeat = int(getattr(opts, "r", timeit.default_repeat)) |
|
759 | 818 | precision = int(getattr(opts, "p", 3)) |
|
760 | 819 | if hasattr(opts, "t"): |
|
761 | 820 | timefunc = time.time |
|
762 | 821 | if hasattr(opts, "c"): |
|
763 | 822 | timefunc = clock |
|
764 | 823 | |
|
765 | 824 | timer = timeit.Timer(timer=timefunc) |
|
766 | 825 | # this code has tight coupling to the inner workings of timeit.Timer, |
|
767 | 826 | # but is there a better way to achieve that the code stmt has access |
|
768 | 827 | # to the shell namespace? |
|
769 | 828 | transform = self.shell.input_splitter.transform_cell |
|
770 | 829 | |
|
771 | 830 | if cell is None: |
|
772 | 831 | # called as line magic |
|
773 | 832 | ast_setup = ast.parse("pass") |
|
774 | 833 | ast_stmt = ast.parse(transform(stmt)) |
|
775 | 834 | else: |
|
776 | 835 | ast_setup = ast.parse(transform(stmt)) |
|
777 | 836 | ast_stmt = ast.parse(transform(cell)) |
|
778 | 837 | |
|
779 | 838 | ast_setup = self.shell.transform_ast(ast_setup) |
|
780 | 839 | ast_stmt = self.shell.transform_ast(ast_stmt) |
|
781 | 840 | |
|
782 | 841 | # This codestring is taken from timeit.template - we fill it in as an |
|
783 | 842 | # AST, so that we can apply our AST transformations to the user code |
|
784 | 843 | # without affecting the timing code. |
|
785 | 844 | timeit_ast_template = ast.parse('def inner(_it, _timer):\n' |
|
786 | 845 | ' setup\n' |
|
787 | 846 | ' _t0 = _timer()\n' |
|
788 | 847 | ' for _i in _it:\n' |
|
789 | 848 | ' stmt\n' |
|
790 | 849 | ' _t1 = _timer()\n' |
|
791 | 850 | ' return _t1 - _t0\n') |
|
792 | 851 | |
|
793 | 852 | class TimeitTemplateFiller(ast.NodeTransformer): |
|
794 | 853 | "This is quite tightly tied to the template definition above." |
|
795 | 854 | def visit_FunctionDef(self, node): |
|
796 | 855 | "Fill in the setup statement" |
|
797 | 856 | self.generic_visit(node) |
|
798 | 857 | if node.name == "inner": |
|
799 | 858 | node.body[:1] = ast_setup.body |
|
800 | 859 | |
|
801 | 860 | return node |
|
802 | 861 | |
|
803 | 862 | def visit_For(self, node): |
|
804 | 863 | "Fill in the statement to be timed" |
|
805 | 864 | if getattr(getattr(node.body[0], 'value', None), 'id', None) == 'stmt': |
|
806 | 865 | node.body = ast_stmt.body |
|
807 | 866 | return node |
|
808 | 867 | |
|
809 | 868 | timeit_ast = TimeitTemplateFiller().visit(timeit_ast_template) |
|
810 | 869 | timeit_ast = ast.fix_missing_locations(timeit_ast) |
|
811 | 870 | |
|
812 | 871 | # Track compilation time so it can be reported if too long |
|
813 | 872 | # Minimum time above which compilation time will be reported |
|
814 | 873 | tc_min = 0.1 |
|
815 | 874 | |
|
816 | 875 | t0 = clock() |
|
817 | 876 | code = compile(timeit_ast, "<magic-timeit>", "exec") |
|
818 | 877 | tc = clock()-t0 |
|
819 | 878 | |
|
820 | 879 | ns = {} |
|
821 | 880 | exec code in self.shell.user_ns, ns |
|
822 | 881 | timer.inner = ns["inner"] |
|
823 | 882 | |
|
824 | 883 | if number == 0: |
|
825 | 884 | # determine number so that 0.2 <= total time < 2.0 |
|
826 | 885 | number = 1 |
|
827 | 886 | for i in range(1, 10): |
|
828 | 887 | if timer.timeit(number) >= 0.2: |
|
829 | 888 | break |
|
830 | 889 | number *= 10 |
|
831 | 890 | |
|
832 | 891 | best = min(timer.repeat(repeat, number)) / number |
|
833 | 892 | |
|
834 | 893 | print u"%d loops, best of %d: %s per loop" % (number, repeat, |
|
835 | 894 | _format_time(best, precision)) |
|
836 | 895 | if tc > tc_min: |
|
837 | 896 | print "Compiler time: %.2f s" % tc |
|
838 | 897 | |
|
839 | 898 | @skip_doctest |
|
840 | 899 | @needs_local_scope |
|
841 | 900 | @line_cell_magic |
|
842 | 901 | def time(self,line='', cell=None, local_ns=None): |
|
843 | 902 | """Time execution of a Python statement or expression. |
|
844 | 903 | |
|
845 | 904 | The CPU and wall clock times are printed, and the value of the |
|
846 | 905 | expression (if any) is returned. Note that under Win32, system time |
|
847 | 906 | is always reported as 0, since it can not be measured. |
|
848 | 907 | |
|
849 | 908 | This function can be used both as a line and cell magic: |
|
850 | 909 | |
|
851 | 910 | - In line mode you can time a single-line statement (though multiple |
|
852 | 911 | ones can be chained with using semicolons). |
|
853 | 912 | |
|
854 | 913 | - In cell mode, you can time the cell body (a directly |
|
855 | 914 | following statement raises an error). |
|
856 | 915 | |
|
857 | 916 | This function provides very basic timing functionality. Use the timeit |
|
858 | 917 | magic for more controll over the measurement. |
|
859 | 918 | |
|
860 | 919 | Examples |
|
861 | 920 | -------- |
|
862 | 921 | :: |
|
863 | 922 | |
|
864 | 923 | In [1]: %time 2**128 |
|
865 | 924 | CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s |
|
866 | 925 | Wall time: 0.00 |
|
867 | 926 | Out[1]: 340282366920938463463374607431768211456L |
|
868 | 927 | |
|
869 | 928 | In [2]: n = 1000000 |
|
870 | 929 | |
|
871 | 930 | In [3]: %time sum(range(n)) |
|
872 | 931 | CPU times: user 1.20 s, sys: 0.05 s, total: 1.25 s |
|
873 | 932 | Wall time: 1.37 |
|
874 | 933 | Out[3]: 499999500000L |
|
875 | 934 | |
|
876 | 935 | In [4]: %time print 'hello world' |
|
877 | 936 | hello world |
|
878 | 937 | CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s |
|
879 | 938 | Wall time: 0.00 |
|
880 | 939 | |
|
881 | 940 | Note that the time needed by Python to compile the given expression |
|
882 | 941 | will be reported if it is more than 0.1s. In this example, the |
|
883 | 942 | actual exponentiation is done by Python at compilation time, so while |
|
884 | 943 | the expression can take a noticeable amount of time to compute, that |
|
885 | 944 | time is purely due to the compilation: |
|
886 | 945 | |
|
887 | 946 | In [5]: %time 3**9999; |
|
888 | 947 | CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s |
|
889 | 948 | Wall time: 0.00 s |
|
890 | 949 | |
|
891 | 950 | In [6]: %time 3**999999; |
|
892 | 951 | CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s |
|
893 | 952 | Wall time: 0.00 s |
|
894 | 953 | Compiler : 0.78 s |
|
895 | 954 | """ |
|
896 | 955 | |
|
897 | 956 | # fail immediately if the given expression can't be compiled |
|
898 | 957 | |
|
899 | 958 | if line and cell: |
|
900 | 959 | raise UsageError("Can't use statement directly after '%%time'!") |
|
901 | 960 | |
|
902 | 961 | if cell: |
|
903 | 962 | expr = self.shell.prefilter(cell,False) |
|
904 | 963 | else: |
|
905 | 964 | expr = self.shell.prefilter(line,False) |
|
906 | 965 | |
|
907 | 966 | # Minimum time above which parse time will be reported |
|
908 | 967 | tp_min = 0.1 |
|
909 | 968 | |
|
910 | 969 | t0 = clock() |
|
911 | 970 | expr_ast = ast.parse(expr) |
|
912 | 971 | tp = clock()-t0 |
|
913 | 972 | |
|
914 | 973 | # Apply AST transformations |
|
915 | 974 | expr_ast = self.shell.transform_ast(expr_ast) |
|
916 | 975 | |
|
917 | 976 | # Minimum time above which compilation time will be reported |
|
918 | 977 | tc_min = 0.1 |
|
919 | 978 | |
|
920 | 979 | if len(expr_ast.body)==1 and isinstance(expr_ast.body[0], ast.Expr): |
|
921 | 980 | mode = 'eval' |
|
922 | 981 | source = '<timed eval>' |
|
923 | 982 | expr_ast = ast.Expression(expr_ast.body[0].value) |
|
924 | 983 | else: |
|
925 | 984 | mode = 'exec' |
|
926 | 985 | source = '<timed exec>' |
|
927 | 986 | t0 = clock() |
|
928 | 987 | code = compile(expr_ast, source, mode) |
|
929 | 988 | tc = clock()-t0 |
|
930 | 989 | |
|
931 | 990 | # skew measurement as little as possible |
|
932 | 991 | glob = self.shell.user_ns |
|
933 | 992 | wtime = time.time |
|
934 | 993 | # time execution |
|
935 | 994 | wall_st = wtime() |
|
936 | 995 | if mode=='eval': |
|
937 | 996 | st = clock2() |
|
938 | 997 | out = eval(code, glob, local_ns) |
|
939 | 998 | end = clock2() |
|
940 | 999 | else: |
|
941 | 1000 | st = clock2() |
|
942 | 1001 | exec code in glob, local_ns |
|
943 | 1002 | end = clock2() |
|
944 | 1003 | out = None |
|
945 | 1004 | wall_end = wtime() |
|
946 | 1005 | # Compute actual times and report |
|
947 | 1006 | wall_time = wall_end-wall_st |
|
948 | 1007 | cpu_user = end[0]-st[0] |
|
949 | 1008 | cpu_sys = end[1]-st[1] |
|
950 | 1009 | cpu_tot = cpu_user+cpu_sys |
|
951 | 1010 | # On windows cpu_sys is always zero, so no new information to the next print |
|
952 | 1011 | if sys.platform != 'win32': |
|
953 | 1012 | print "CPU times: user %s, sys: %s, total: %s" % \ |
|
954 | 1013 | (_format_time(cpu_user),_format_time(cpu_sys),_format_time(cpu_tot)) |
|
955 | 1014 | print "Wall time: %s" % _format_time(wall_time) |
|
956 | 1015 | if tc > tc_min: |
|
957 | 1016 | print "Compiler : %s" % _format_time(tc) |
|
958 | 1017 | if tp > tp_min: |
|
959 | 1018 | print "Parser : %s" % _format_time(tp) |
|
960 | 1019 | return out |
|
961 | 1020 | |
|
962 | 1021 | @skip_doctest |
|
963 | 1022 | @line_magic |
|
964 | 1023 | def macro(self, parameter_s=''): |
|
965 | 1024 | """Define a macro for future re-execution. It accepts ranges of history, |
|
966 | 1025 | filenames or string objects. |
|
967 | 1026 | |
|
968 | 1027 | Usage:\\ |
|
969 | 1028 | %macro [options] name n1-n2 n3-n4 ... n5 .. n6 ... |
|
970 | 1029 | |
|
971 | 1030 | Options: |
|
972 | 1031 | |
|
973 | 1032 | -r: use 'raw' input. By default, the 'processed' history is used, |
|
974 | 1033 | so that magics are loaded in their transformed version to valid |
|
975 | 1034 | Python. If this option is given, the raw input as typed as the |
|
976 | 1035 | command line is used instead. |
|
977 | 1036 | |
|
978 | 1037 | This will define a global variable called `name` which is a string |
|
979 | 1038 | made of joining the slices and lines you specify (n1,n2,... numbers |
|
980 | 1039 | above) from your input history into a single string. This variable |
|
981 | 1040 | acts like an automatic function which re-executes those lines as if |
|
982 | 1041 | you had typed them. You just type 'name' at the prompt and the code |
|
983 | 1042 | executes. |
|
984 | 1043 | |
|
985 | 1044 | The syntax for indicating input ranges is described in %history. |
|
986 | 1045 | |
|
987 | 1046 | Note: as a 'hidden' feature, you can also use traditional python slice |
|
988 | 1047 | notation, where N:M means numbers N through M-1. |
|
989 | 1048 | |
|
990 | 1049 | For example, if your history contains (%hist prints it):: |
|
991 | 1050 | |
|
992 | 1051 | 44: x=1 |
|
993 | 1052 | 45: y=3 |
|
994 | 1053 | 46: z=x+y |
|
995 | 1054 | 47: print x |
|
996 | 1055 | 48: a=5 |
|
997 | 1056 | 49: print 'x',x,'y',y |
|
998 | 1057 | |
|
999 | 1058 | you can create a macro with lines 44 through 47 (included) and line 49 |
|
1000 | 1059 | called my_macro with:: |
|
1001 | 1060 | |
|
1002 | 1061 | In [55]: %macro my_macro 44-47 49 |
|
1003 | 1062 | |
|
1004 | 1063 | Now, typing `my_macro` (without quotes) will re-execute all this code |
|
1005 | 1064 | in one pass. |
|
1006 | 1065 | |
|
1007 | 1066 | You don't need to give the line-numbers in order, and any given line |
|
1008 | 1067 | number can appear multiple times. You can assemble macros with any |
|
1009 | 1068 | lines from your input history in any order. |
|
1010 | 1069 | |
|
1011 | 1070 | The macro is a simple object which holds its value in an attribute, |
|
1012 | 1071 | but IPython's display system checks for macros and executes them as |
|
1013 | 1072 | code instead of printing them when you type their name. |
|
1014 | 1073 | |
|
1015 | 1074 | You can view a macro's contents by explicitly printing it with:: |
|
1016 | 1075 | |
|
1017 | 1076 | print macro_name |
|
1018 | 1077 | |
|
1019 | 1078 | """ |
|
1020 | 1079 | opts,args = self.parse_options(parameter_s,'r',mode='list') |
|
1021 | 1080 | if not args: # List existing macros |
|
1022 | 1081 | return sorted(k for k,v in self.shell.user_ns.iteritems() if\ |
|
1023 | 1082 | isinstance(v, Macro)) |
|
1024 | 1083 | if len(args) == 1: |
|
1025 | 1084 | raise UsageError( |
|
1026 | 1085 | "%macro insufficient args; usage '%macro name n1-n2 n3-4...") |
|
1027 | 1086 | name, codefrom = args[0], " ".join(args[1:]) |
|
1028 | 1087 | |
|
1029 | 1088 | #print 'rng',ranges # dbg |
|
1030 | 1089 | try: |
|
1031 | 1090 | lines = self.shell.find_user_code(codefrom, 'r' in opts) |
|
1032 | 1091 | except (ValueError, TypeError) as e: |
|
1033 | 1092 | print e.args[0] |
|
1034 | 1093 | return |
|
1035 | 1094 | macro = Macro(lines) |
|
1036 | 1095 | self.shell.define_macro(name, macro) |
|
1037 | 1096 | print 'Macro `%s` created. To execute, type its name (without quotes).' % name |
|
1038 | 1097 | print '=== Macro contents: ===' |
|
1039 | 1098 | print macro, |
|
1040 | 1099 | |
|
1041 | 1100 | @magic_arguments.magic_arguments() |
|
1042 | 1101 | @magic_arguments.argument('output', type=str, default='', nargs='?', |
|
1043 | 1102 | help="""The name of the variable in which to store output. |
|
1044 | 1103 | This is a utils.io.CapturedIO object with stdout/err attributes |
|
1045 | 1104 | for the text of the captured output. |
|
1046 | 1105 | |
|
1047 | 1106 | CapturedOutput also has a show() method for displaying the output, |
|
1048 | 1107 | and __call__ as well, so you can use that to quickly display the |
|
1049 | 1108 | output. |
|
1050 | 1109 | |
|
1051 | 1110 | If unspecified, captured output is discarded. |
|
1052 | 1111 | """ |
|
1053 | 1112 | ) |
|
1054 | 1113 | @magic_arguments.argument('--no-stderr', action="store_true", |
|
1055 | 1114 | help="""Don't capture stderr.""" |
|
1056 | 1115 | ) |
|
1057 | 1116 | @magic_arguments.argument('--no-stdout', action="store_true", |
|
1058 | 1117 | help="""Don't capture stdout.""" |
|
1059 | 1118 | ) |
|
1060 | 1119 | @cell_magic |
|
1061 | 1120 | def capture(self, line, cell): |
|
1062 | 1121 | """run the cell, capturing stdout/err""" |
|
1063 | 1122 | args = magic_arguments.parse_argstring(self.capture, line) |
|
1064 | 1123 | out = not args.no_stdout |
|
1065 | 1124 | err = not args.no_stderr |
|
1066 | 1125 | with capture_output(out, err) as io: |
|
1067 | 1126 | self.shell.run_cell(cell) |
|
1068 | 1127 | if args.output: |
|
1069 | 1128 | self.shell.user_ns[args.output] = io |
|
1070 | 1129 | |
|
1071 | 1130 | def parse_breakpoint(text, current_file): |
|
1072 | 1131 | '''Returns (file, line) for file:line and (current_file, line) for line''' |
|
1073 | 1132 | colon = text.find(':') |
|
1074 | 1133 | if colon == -1: |
|
1075 | 1134 | return current_file, int(text) |
|
1076 | 1135 | else: |
|
1077 | 1136 | return text[:colon], int(text[colon+1:]) |
|
1078 | 1137 | |
|
1079 | 1138 | def _format_time(timespan, precision=3): |
|
1080 | 1139 | """Formats the timespan in a human readable form""" |
|
1081 | 1140 | import math |
|
1082 | 1141 | |
|
1083 | 1142 | if timespan >= 60.0: |
|
1084 | 1143 | # we have more than a minute, format that in a human readable form |
|
1085 | 1144 | # Idea from http://snipplr.com/view/5713/ |
|
1086 | 1145 | parts = [("d", 60*60*24),("h", 60*60),("min", 60), ("s", 1)] |
|
1087 | 1146 | time = [] |
|
1088 | 1147 | leftover = timespan |
|
1089 | 1148 | for suffix, length in parts: |
|
1090 | 1149 | value = int(leftover / length) |
|
1091 | 1150 | if value > 0: |
|
1092 | 1151 | leftover = leftover % length |
|
1093 | 1152 | time.append(u'%s%s' % (str(value), suffix)) |
|
1094 | 1153 | if leftover < 1: |
|
1095 | 1154 | break |
|
1096 | 1155 | return " ".join(time) |
|
1097 | 1156 | |
|
1098 | 1157 | |
|
1099 | 1158 | # Unfortunately the unicode 'micro' symbol can cause problems in |
|
1100 | 1159 | # certain terminals. |
|
1101 | 1160 | # See bug: https://bugs.launchpad.net/ipython/+bug/348466 |
|
1102 | 1161 | # Try to prevent crashes by being more secure than it needs to |
|
1103 | 1162 | # E.g. eclipse is able to print a µ, but has no sys.stdout.encoding set. |
|
1104 | 1163 | units = [u"s", u"ms",u'us',"ns"] # the save value |
|
1105 | 1164 | if hasattr(sys.stdout, 'encoding') and sys.stdout.encoding: |
|
1106 | 1165 | try: |
|
1107 | 1166 | u'\xb5'.encode(sys.stdout.encoding) |
|
1108 | 1167 | units = [u"s", u"ms",u'\xb5s',"ns"] |
|
1109 | 1168 | except: |
|
1110 | 1169 | pass |
|
1111 | 1170 | scaling = [1, 1e3, 1e6, 1e9] |
|
1112 | 1171 | |
|
1113 | 1172 | if timespan > 0.0: |
|
1114 | 1173 | order = min(-int(math.floor(math.log10(timespan)) // 3), 3) |
|
1115 | 1174 | else: |
|
1116 | 1175 | order = 3 |
|
1117 | 1176 | ret = u"%.*g %s" % (precision, timespan * scaling[order], units[order]) |
|
1118 | 1177 | return ret |
@@ -1,339 +1,416 b'' | |||
|
1 | 1 | # encoding: utf-8 |
|
2 | 2 | """Tests for code execution (%run and related), which is particularly tricky. |
|
3 | 3 | |
|
4 | 4 | Because of how %run manages namespaces, and the fact that we are trying here to |
|
5 | 5 | verify subtle object deletion and reference counting issues, the %run tests |
|
6 | 6 | will be kept in this separate file. This makes it easier to aggregate in one |
|
7 | 7 | place the tricks needed to handle it; most other magics are much easier to test |
|
8 | 8 | and we do so in a common test_magic file. |
|
9 | 9 | """ |
|
10 | 10 | from __future__ import absolute_import |
|
11 | 11 | |
|
12 | 12 | #----------------------------------------------------------------------------- |
|
13 | 13 | # Imports |
|
14 | 14 | #----------------------------------------------------------------------------- |
|
15 | 15 | |
|
16 | import functools | |
|
16 | 17 | import os |
|
18 | import random | |
|
17 | 19 | import sys |
|
18 | 20 | import tempfile |
|
21 | import textwrap | |
|
22 | import unittest | |
|
19 | 23 | |
|
20 | 24 | import nose.tools as nt |
|
21 | 25 | from nose import SkipTest |
|
22 | 26 | |
|
23 | 27 | from IPython.testing import decorators as dec |
|
24 | 28 | from IPython.testing import tools as tt |
|
25 | 29 | from IPython.utils import py3compat |
|
30 | from IPython.utils.tempdir import TemporaryDirectory | |
|
31 | from IPython.core import debugger | |
|
26 | 32 | |
|
27 | 33 | #----------------------------------------------------------------------------- |
|
28 | 34 | # Test functions begin |
|
29 | 35 | #----------------------------------------------------------------------------- |
|
30 | 36 | |
|
31 | 37 | def doctest_refbug(): |
|
32 | 38 | """Very nasty problem with references held by multiple runs of a script. |
|
33 | 39 | See: https://github.com/ipython/ipython/issues/141 |
|
34 | 40 | |
|
35 | 41 | In [1]: _ip.clear_main_mod_cache() |
|
36 | 42 | # random |
|
37 | 43 | |
|
38 | 44 | In [2]: %run refbug |
|
39 | 45 | |
|
40 | 46 | In [3]: call_f() |
|
41 | 47 | lowercased: hello |
|
42 | 48 | |
|
43 | 49 | In [4]: %run refbug |
|
44 | 50 | |
|
45 | 51 | In [5]: call_f() |
|
46 | 52 | lowercased: hello |
|
47 | 53 | lowercased: hello |
|
48 | 54 | """ |
|
49 | 55 | |
|
50 | 56 | |
|
51 | 57 | def doctest_run_builtins(): |
|
52 | 58 | r"""Check that %run doesn't damage __builtins__. |
|
53 | 59 | |
|
54 | 60 | In [1]: import tempfile |
|
55 | 61 | |
|
56 | 62 | In [2]: bid1 = id(__builtins__) |
|
57 | 63 | |
|
58 | 64 | In [3]: fname = tempfile.mkstemp('.py')[1] |
|
59 | 65 | |
|
60 | 66 | In [3]: f = open(fname,'w') |
|
61 | 67 | |
|
62 | 68 | In [4]: dummy= f.write('pass\n') |
|
63 | 69 | |
|
64 | 70 | In [5]: f.flush() |
|
65 | 71 | |
|
66 | 72 | In [6]: t1 = type(__builtins__) |
|
67 | 73 | |
|
68 | 74 | In [7]: %run $fname |
|
69 | 75 | |
|
70 | 76 | In [7]: f.close() |
|
71 | 77 | |
|
72 | 78 | In [8]: bid2 = id(__builtins__) |
|
73 | 79 | |
|
74 | 80 | In [9]: t2 = type(__builtins__) |
|
75 | 81 | |
|
76 | 82 | In [10]: t1 == t2 |
|
77 | 83 | Out[10]: True |
|
78 | 84 | |
|
79 | 85 | In [10]: bid1 == bid2 |
|
80 | 86 | Out[10]: True |
|
81 | 87 | |
|
82 | 88 | In [12]: try: |
|
83 | 89 | ....: os.unlink(fname) |
|
84 | 90 | ....: except: |
|
85 | 91 | ....: pass |
|
86 | 92 | ....: |
|
87 | 93 | """ |
|
88 | 94 | |
|
89 | 95 | |
|
90 | 96 | def doctest_run_option_parser(): |
|
91 | 97 | r"""Test option parser in %run. |
|
92 | 98 | |
|
93 | 99 | In [1]: %run print_argv.py |
|
94 | 100 | [] |
|
95 | 101 | |
|
96 | 102 | In [2]: %run print_argv.py print*.py |
|
97 | 103 | ['print_argv.py'] |
|
98 | 104 | |
|
99 | 105 | In [3]: %run -G print_argv.py print*.py |
|
100 | 106 | ['print*.py'] |
|
101 | 107 | |
|
102 | 108 | """ |
|
103 | 109 | |
|
104 | 110 | |
|
105 | 111 | @dec.skip_win32 |
|
106 | 112 | def doctest_run_option_parser_for_posix(): |
|
107 | 113 | r"""Test option parser in %run (Linux/OSX specific). |
|
108 | 114 | |
|
109 | 115 | You need double quote to escape glob in POSIX systems: |
|
110 | 116 | |
|
111 | 117 | In [1]: %run print_argv.py print\\*.py |
|
112 | 118 | ['print*.py'] |
|
113 | 119 | |
|
114 | 120 | You can't use quote to escape glob in POSIX systems: |
|
115 | 121 | |
|
116 | 122 | In [2]: %run print_argv.py 'print*.py' |
|
117 | 123 | ['print_argv.py'] |
|
118 | 124 | |
|
119 | 125 | """ |
|
120 | 126 | |
|
121 | 127 | |
|
122 | 128 | @dec.skip_if_not_win32 |
|
123 | 129 | def doctest_run_option_parser_for_windows(): |
|
124 | 130 | r"""Test option parser in %run (Windows specific). |
|
125 | 131 | |
|
126 | 132 | In Windows, you can't escape ``*` `by backslash: |
|
127 | 133 | |
|
128 | 134 | In [1]: %run print_argv.py print\\*.py |
|
129 | 135 | ['print\\*.py'] |
|
130 | 136 | |
|
131 | 137 | You can use quote to escape glob: |
|
132 | 138 | |
|
133 | 139 | In [2]: %run print_argv.py 'print*.py' |
|
134 | 140 | ['print*.py'] |
|
135 | 141 | |
|
136 | 142 | """ |
|
137 | 143 | |
|
138 | 144 | |
|
139 | 145 | @py3compat.doctest_refactor_print |
|
140 | 146 | def doctest_reset_del(): |
|
141 | 147 | """Test that resetting doesn't cause errors in __del__ methods. |
|
142 | 148 | |
|
143 | 149 | In [2]: class A(object): |
|
144 | 150 | ...: def __del__(self): |
|
145 | 151 | ...: print str("Hi") |
|
146 | 152 | ...: |
|
147 | 153 | |
|
148 | 154 | In [3]: a = A() |
|
149 | 155 | |
|
150 | 156 | In [4]: get_ipython().reset() |
|
151 | 157 | Hi |
|
152 | 158 | |
|
153 | 159 | In [5]: 1+1 |
|
154 | 160 | Out[5]: 2 |
|
155 | 161 | """ |
|
156 | 162 | |
|
157 | 163 | # For some tests, it will be handy to organize them in a class with a common |
|
158 | 164 | # setup that makes a temp file |
|
159 | 165 | |
|
160 | 166 | class TestMagicRunPass(tt.TempFileMixin): |
|
161 | 167 | |
|
162 | 168 | def setup(self): |
|
163 | 169 | """Make a valid python temp file.""" |
|
164 | 170 | self.mktmp('pass\n') |
|
165 | 171 | |
|
166 | 172 | def run_tmpfile(self): |
|
167 | 173 | _ip = get_ipython() |
|
168 | 174 | # This fails on Windows if self.tmpfile.name has spaces or "~" in it. |
|
169 | 175 | # See below and ticket https://bugs.launchpad.net/bugs/366353 |
|
170 | 176 | _ip.magic('run %s' % self.fname) |
|
171 | 177 | |
|
172 | 178 | def run_tmpfile_p(self): |
|
173 | 179 | _ip = get_ipython() |
|
174 | 180 | # This fails on Windows if self.tmpfile.name has spaces or "~" in it. |
|
175 | 181 | # See below and ticket https://bugs.launchpad.net/bugs/366353 |
|
176 | 182 | _ip.magic('run -p %s' % self.fname) |
|
177 | 183 | |
|
178 | 184 | def test_builtins_id(self): |
|
179 | 185 | """Check that %run doesn't damage __builtins__ """ |
|
180 | 186 | _ip = get_ipython() |
|
181 | 187 | # Test that the id of __builtins__ is not modified by %run |
|
182 | 188 | bid1 = id(_ip.user_ns['__builtins__']) |
|
183 | 189 | self.run_tmpfile() |
|
184 | 190 | bid2 = id(_ip.user_ns['__builtins__']) |
|
185 | 191 | nt.assert_equal(bid1, bid2) |
|
186 | 192 | |
|
187 | 193 | def test_builtins_type(self): |
|
188 | 194 | """Check that the type of __builtins__ doesn't change with %run. |
|
189 | 195 | |
|
190 | 196 | However, the above could pass if __builtins__ was already modified to |
|
191 | 197 | be a dict (it should be a module) by a previous use of %run. So we |
|
192 | 198 | also check explicitly that it really is a module: |
|
193 | 199 | """ |
|
194 | 200 | _ip = get_ipython() |
|
195 | 201 | self.run_tmpfile() |
|
196 | 202 | nt.assert_equal(type(_ip.user_ns['__builtins__']),type(sys)) |
|
197 | 203 | |
|
198 | 204 | def test_prompts(self): |
|
199 | 205 | """Test that prompts correctly generate after %run""" |
|
200 | 206 | self.run_tmpfile() |
|
201 | 207 | _ip = get_ipython() |
|
202 | 208 | p2 = _ip.prompt_manager.render('in2').strip() |
|
203 | 209 | nt.assert_equal(p2[:3], '...') |
|
204 | 210 | |
|
205 | 211 | def test_run_profile( self ): |
|
206 | 212 | """Test that the option -p, which invokes the profiler, do not |
|
207 | 213 | crash by invoking execfile""" |
|
208 | 214 | _ip = get_ipython() |
|
209 | 215 | self.run_tmpfile_p() |
|
210 | 216 | |
|
211 | 217 | |
|
212 | 218 | class TestMagicRunSimple(tt.TempFileMixin): |
|
213 | 219 | |
|
214 | 220 | def test_simpledef(self): |
|
215 | 221 | """Test that simple class definitions work.""" |
|
216 | 222 | src = ("class foo: pass\n" |
|
217 | 223 | "def f(): return foo()") |
|
218 | 224 | self.mktmp(src) |
|
219 | 225 | _ip.magic('run %s' % self.fname) |
|
220 | 226 | _ip.run_cell('t = isinstance(f(), foo)') |
|
221 | 227 | nt.assert_true(_ip.user_ns['t']) |
|
222 | 228 | |
|
223 | 229 | def test_obj_del(self): |
|
224 | 230 | """Test that object's __del__ methods are called on exit.""" |
|
225 | 231 | if sys.platform == 'win32': |
|
226 | 232 | try: |
|
227 | 233 | import win32api |
|
228 | 234 | except ImportError: |
|
229 | 235 | raise SkipTest("Test requires pywin32") |
|
230 | 236 | src = ("class A(object):\n" |
|
231 | 237 | " def __del__(self):\n" |
|
232 | 238 | " print 'object A deleted'\n" |
|
233 | 239 | "a = A()\n") |
|
234 | 240 | self.mktmp(py3compat.doctest_refactor_print(src)) |
|
235 | 241 | if dec.module_not_available('sqlite3'): |
|
236 | 242 | err = 'WARNING: IPython History requires SQLite, your history will not be saved\n' |
|
237 | 243 | else: |
|
238 | 244 | err = None |
|
239 | 245 | tt.ipexec_validate(self.fname, 'object A deleted', err) |
|
240 | 246 | |
|
241 | 247 | @dec.skip_known_failure |
|
242 | 248 | def test_aggressive_namespace_cleanup(self): |
|
243 | 249 | """Test that namespace cleanup is not too aggressive GH-238 |
|
244 | 250 | |
|
245 | 251 | Returning from another run magic deletes the namespace""" |
|
246 | 252 | # see ticket https://github.com/ipython/ipython/issues/238 |
|
247 | 253 | class secondtmp(tt.TempFileMixin): pass |
|
248 | 254 | empty = secondtmp() |
|
249 | 255 | empty.mktmp('') |
|
250 | 256 | src = ("ip = get_ipython()\n" |
|
251 | 257 | "for i in range(5):\n" |
|
252 | 258 | " try:\n" |
|
253 | 259 | " ip.magic('run %s')\n" |
|
254 | 260 | " except NameError as e:\n" |
|
255 | 261 | " print i;break\n" % empty.fname) |
|
256 | 262 | self.mktmp(py3compat.doctest_refactor_print(src)) |
|
257 | 263 | _ip.magic('run %s' % self.fname) |
|
258 | 264 | _ip.run_cell('ip == get_ipython()') |
|
259 | 265 | nt.assert_equal(_ip.user_ns['i'], 5) |
|
260 | 266 | |
|
261 | 267 | @dec.skip_win32 |
|
262 | 268 | def test_tclass(self): |
|
263 | 269 | mydir = os.path.dirname(__file__) |
|
264 | 270 | tc = os.path.join(mydir, 'tclass') |
|
265 | 271 | src = ("%%run '%s' C-first\n" |
|
266 | 272 | "%%run '%s' C-second\n" |
|
267 | 273 | "%%run '%s' C-third\n") % (tc, tc, tc) |
|
268 | 274 | self.mktmp(src, '.ipy') |
|
269 | 275 | out = """\ |
|
270 | 276 | ARGV 1-: ['C-first'] |
|
271 | 277 | ARGV 1-: ['C-second'] |
|
272 | 278 | tclass.py: deleting object: C-first |
|
273 | 279 | ARGV 1-: ['C-third'] |
|
274 | 280 | tclass.py: deleting object: C-second |
|
275 | 281 | tclass.py: deleting object: C-third |
|
276 | 282 | """ |
|
277 | 283 | if dec.module_not_available('sqlite3'): |
|
278 | 284 | err = 'WARNING: IPython History requires SQLite, your history will not be saved\n' |
|
279 | 285 | else: |
|
280 | 286 | err = None |
|
281 | 287 | tt.ipexec_validate(self.fname, out, err) |
|
282 | 288 | |
|
283 | 289 | def test_run_i_after_reset(self): |
|
284 | 290 | """Check that %run -i still works after %reset (gh-693)""" |
|
285 | 291 | src = "yy = zz\n" |
|
286 | 292 | self.mktmp(src) |
|
287 | 293 | _ip.run_cell("zz = 23") |
|
288 | 294 | _ip.magic('run -i %s' % self.fname) |
|
289 | 295 | nt.assert_equal(_ip.user_ns['yy'], 23) |
|
290 | 296 | _ip.magic('reset -f') |
|
291 | 297 | _ip.run_cell("zz = 23") |
|
292 | 298 | _ip.magic('run -i %s' % self.fname) |
|
293 | 299 | nt.assert_equal(_ip.user_ns['yy'], 23) |
|
294 | 300 | |
|
295 | 301 | def test_unicode(self): |
|
296 | 302 | """Check that files in odd encodings are accepted.""" |
|
297 | 303 | mydir = os.path.dirname(__file__) |
|
298 | 304 | na = os.path.join(mydir, 'nonascii.py') |
|
299 | 305 | _ip.magic('run "%s"' % na) |
|
300 | 306 | nt.assert_equal(_ip.user_ns['u'], u'Ўт№Ф') |
|
301 | 307 | |
|
302 | 308 | def test_run_py_file_attribute(self): |
|
303 | 309 | """Test handling of `__file__` attribute in `%run <file>.py`.""" |
|
304 | 310 | src = "t = __file__\n" |
|
305 | 311 | self.mktmp(src) |
|
306 | 312 | _missing = object() |
|
307 | 313 | file1 = _ip.user_ns.get('__file__', _missing) |
|
308 | 314 | _ip.magic('run %s' % self.fname) |
|
309 | 315 | file2 = _ip.user_ns.get('__file__', _missing) |
|
310 | 316 | |
|
311 | 317 | # Check that __file__ was equal to the filename in the script's |
|
312 | 318 | # namespace. |
|
313 | 319 | nt.assert_equal(_ip.user_ns['t'], self.fname) |
|
314 | 320 | |
|
315 | 321 | # Check that __file__ was not leaked back into user_ns. |
|
316 | 322 | nt.assert_equal(file1, file2) |
|
317 | 323 | |
|
318 | 324 | def test_run_ipy_file_attribute(self): |
|
319 | 325 | """Test handling of `__file__` attribute in `%run <file.ipy>`.""" |
|
320 | 326 | src = "t = __file__\n" |
|
321 | 327 | self.mktmp(src, ext='.ipy') |
|
322 | 328 | _missing = object() |
|
323 | 329 | file1 = _ip.user_ns.get('__file__', _missing) |
|
324 | 330 | _ip.magic('run %s' % self.fname) |
|
325 | 331 | file2 = _ip.user_ns.get('__file__', _missing) |
|
326 | 332 | |
|
327 | 333 | # Check that __file__ was equal to the filename in the script's |
|
328 | 334 | # namespace. |
|
329 | 335 | nt.assert_equal(_ip.user_ns['t'], self.fname) |
|
330 | 336 | |
|
331 | 337 | # Check that __file__ was not leaked back into user_ns. |
|
332 | 338 | nt.assert_equal(file1, file2) |
|
333 | 339 | |
|
334 | 340 | def test_run_formatting(self): |
|
335 | 341 | """ Test that %run -t -N<N> does not raise a TypeError for N > 1.""" |
|
336 | 342 | src = "pass" |
|
337 | 343 | self.mktmp(src) |
|
338 | 344 | _ip.magic('run -t -N 1 %s' % self.fname) |
|
339 | 345 | _ip.magic('run -t -N 10 %s' % self.fname) |
|
346 | ||
|
347 | ||
|
348 | class TestMagicRunWithPackage(unittest.TestCase): | |
|
349 | ||
|
350 | def writefile(self, name, content): | |
|
351 | path = os.path.join(self.tempdir.name, name) | |
|
352 | d = os.path.dirname(path) | |
|
353 | if not os.path.isdir(d): | |
|
354 | os.makedirs(d) | |
|
355 | with open(path, 'w') as f: | |
|
356 | f.write(textwrap.dedent(content)) | |
|
357 | ||
|
358 | def setUp(self): | |
|
359 | self.package = package = 'tmp{0}'.format(repr(random.random())[2:]) | |
|
360 | """Temporary valid python package name.""" | |
|
361 | ||
|
362 | self.value = int(random.random() * 10000) | |
|
363 | ||
|
364 | self.tempdir = TemporaryDirectory() | |
|
365 | self.__orig_cwd = os.getcwdu() | |
|
366 | sys.path.insert(0, self.tempdir.name) | |
|
367 | ||
|
368 | self.writefile(os.path.join(package, '__init__.py'), '') | |
|
369 | self.writefile(os.path.join(package, 'sub.py'), """ | |
|
370 | x = {0!r} | |
|
371 | """.format(self.value)) | |
|
372 | self.writefile(os.path.join(package, 'relative.py'), """ | |
|
373 | from .sub import x | |
|
374 | """) | |
|
375 | self.writefile(os.path.join(package, 'absolute.py'), """ | |
|
376 | from {0}.sub import x | |
|
377 | """.format(package)) | |
|
378 | ||
|
379 | def tearDown(self): | |
|
380 | os.chdir(self.__orig_cwd) | |
|
381 | sys.path[:] = [p for p in sys.path if p != self.tempdir.name] | |
|
382 | self.tempdir.cleanup() | |
|
383 | ||
|
384 | def check_run_submodule(self, submodule, opts=''): | |
|
385 | _ip.magic('run {2} -m {0}.{1}'.format(self.package, submodule, opts)) | |
|
386 | self.assertEqual(_ip.user_ns['x'], self.value, | |
|
387 | 'Variable `x` is not loaded from module `{0}`.' | |
|
388 | .format(submodule)) | |
|
389 | ||
|
390 | def test_run_submodule_with_absolute_import(self): | |
|
391 | self.check_run_submodule('absolute') | |
|
392 | ||
|
393 | def test_run_submodule_with_relative_import(self): | |
|
394 | """Run submodule that has a relative import statement (#2727).""" | |
|
395 | self.check_run_submodule('relative') | |
|
396 | ||
|
397 | def test_prun_submodule_with_absolute_import(self): | |
|
398 | self.check_run_submodule('absolute', '-p') | |
|
399 | ||
|
400 | def test_prun_submodule_with_relative_import(self): | |
|
401 | self.check_run_submodule('relative', '-p') | |
|
402 | ||
|
403 | def with_fake_debugger(func): | |
|
404 | @functools.wraps(func) | |
|
405 | def wrapper(*args, **kwds): | |
|
406 | with tt.monkeypatch(debugger.Pdb, 'run', staticmethod(eval)): | |
|
407 | return func(*args, **kwds) | |
|
408 | return wrapper | |
|
409 | ||
|
410 | @with_fake_debugger | |
|
411 | def test_debug_run_submodule_with_absolute_import(self): | |
|
412 | self.check_run_submodule('absolute', '-d') | |
|
413 | ||
|
414 | @with_fake_debugger | |
|
415 | def test_debug_run_submodule_with_relative_import(self): | |
|
416 | self.check_run_submodule('relative', '-d') |
@@ -1,1 +1,1 b'' | |||
|
1 | Subproject commit f7467391a9f9d4868f0bbf0d088fd572625862a4 | |
|
1 | Subproject commit 945dfca396a1a7ca66d36ee758c7d8dca2b11287 |
@@ -1,981 +1,1001 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,a:focus{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,a.muted:focus{color:#808080;} |
|
113 | 113 | .text-warning{color:#c09853;} |
|
114 | 114 | a.text-warning:hover,a.text-warning:focus{color:#a47e3c;} |
|
115 | 115 | .text-error{color:#b94a48;} |
|
116 | 116 | a.text-error:hover,a.text-error:focus{color:#953b39;} |
|
117 | 117 | .text-info{color:#3a87ad;} |
|
118 | 118 | a.text-info:hover,a.text-info:focus{color:#2d6987;} |
|
119 | 119 | .text-success{color:#468847;} |
|
120 | 120 | a.text-success:hover,a.text-success:focus{color:#356635;} |
|
121 | 121 | .text-left{text-align:left;} |
|
122 | 122 | .text-right{text-align:right;} |
|
123 | 123 | .text-center{text-align:center;} |
|
124 | 124 | 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;} |
|
125 | 125 | h1,h2,h3{line-height:40px;} |
|
126 | 126 | h1{font-size:35.75px;} |
|
127 | 127 | h2{font-size:29.25px;} |
|
128 | 128 | h3{font-size:22.75px;} |
|
129 | 129 | h4{font-size:16.25px;} |
|
130 | 130 | h5{font-size:13px;} |
|
131 | 131 | h6{font-size:11.049999999999999px;} |
|
132 | 132 | h1 small{font-size:22.75px;} |
|
133 | 133 | h2 small{font-size:16.25px;} |
|
134 | 134 | h3 small{font-size:13px;} |
|
135 | 135 | h4 small{font-size:13px;} |
|
136 | 136 | .page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eeeeee;} |
|
137 | 137 | ul,ol{padding:0;margin:0 0 10px 25px;} |
|
138 | 138 | ul ul,ul ol,ol ol,ol ul{margin-bottom:0;} |
|
139 | 139 | li{line-height:20px;} |
|
140 | 140 | ul.unstyled,ol.unstyled{margin-left:0;list-style:none;} |
|
141 | 141 | ul.inline,ol.inline{margin-left:0;list-style:none;}ul.inline>li,ol.inline>li{display:inline-block;*display:inline;*zoom:1;padding-left:5px;padding-right:5px;} |
|
142 | 142 | dl{margin-bottom:20px;} |
|
143 | 143 | dt,dd{line-height:20px;} |
|
144 | 144 | dt{font-weight:bold;} |
|
145 | 145 | dd{margin-left:10px;} |
|
146 | 146 | .dl-horizontal{*zoom:1;}.dl-horizontal:before,.dl-horizontal:after{display:table;content:"";line-height:0;} |
|
147 | 147 | .dl-horizontal:after{clear:both;} |
|
148 | 148 | .dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} |
|
149 | 149 | .dl-horizontal dd{margin-left:180px;} |
|
150 | 150 | hr{margin:20px 0;border:0;border-top:1px solid #eeeeee;border-bottom:1px solid #ffffff;} |
|
151 | 151 | abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999999;} |
|
152 | 152 | abbr.initialism{font-size:90%;text-transform:uppercase;} |
|
153 | 153 | blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eeeeee;}blockquote p{margin-bottom:0;font-size:16.25px;font-weight:300;line-height:1.25;} |
|
154 | 154 | blockquote small{display:block;line-height:20px;color:#999999;}blockquote small:before{content:'\2014 \00A0';} |
|
155 | 155 | 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;} |
|
156 | 156 | blockquote.pull-right small:before{content:'';} |
|
157 | 157 | blockquote.pull-right small:after{content:'\00A0 \2014';} |
|
158 | 158 | q:before,q:after,blockquote:before,blockquote:after{content:"";} |
|
159 | 159 | address{display:block;margin-bottom:20px;font-style:normal;line-height:20px;} |
|
160 | 160 | form{margin:0 0 20px;} |
|
161 | 161 | fieldset{padding:0;margin:0;border:0;} |
|
162 | 162 | 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;} |
|
163 | 163 | label,input,button,select,textarea{font-size:13px;font-weight:normal;line-height:20px;} |
|
164 | 164 | input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;} |
|
165 | 165 | label{display:block;margin-bottom:5px;} |
|
166 | 166 | 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;} |
|
167 | 167 | input,textarea,.uneditable-input{width:206px;} |
|
168 | 168 | textarea{height:auto;} |
|
169 | 169 | 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);} |
|
170 | 170 | input[type="radio"],input[type="checkbox"]{margin:4px 0 0;*margin-top:0;margin-top:1px \9;line-height:normal;} |
|
171 | 171 | input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto;} |
|
172 | 172 | select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px;} |
|
173 | 173 | select{width:220px;border:1px solid #cccccc;background-color:#ffffff;} |
|
174 | 174 | select[multiple],select[size]{height:auto;} |
|
175 | 175 | 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;} |
|
176 | 176 | .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;} |
|
177 | 177 | .uneditable-input{overflow:hidden;white-space:nowrap;} |
|
178 | 178 | .uneditable-textarea{width:auto;height:auto;} |
|
179 | 179 | input:-moz-placeholder,textarea:-moz-placeholder{color:#999999;} |
|
180 | 180 | input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999999;} |
|
181 | 181 | input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999999;} |
|
182 | 182 | .radio,.checkbox{min-height:20px;padding-left:20px;} |
|
183 | 183 | .radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-20px;} |
|
184 | 184 | .controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px;} |
|
185 | 185 | .radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle;} |
|
186 | 186 | .radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px;} |
|
187 | 187 | .input-mini{width:60px;} |
|
188 | 188 | .input-small{width:90px;} |
|
189 | 189 | .input-medium{width:150px;} |
|
190 | 190 | .input-large{width:210px;} |
|
191 | 191 | .input-xlarge{width:270px;} |
|
192 | 192 | .input-xxlarge{width:530px;} |
|
193 | 193 | 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;} |
|
194 | 194 | .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;} |
|
195 | 195 | input,textarea,.uneditable-input{margin-left:0;} |
|
196 | 196 | .controls-row [class*="span"]+[class*="span"]{margin-left:20px;} |
|
197 | 197 | input.span12,textarea.span12,.uneditable-input.span12{width:926px;} |
|
198 | 198 | input.span11,textarea.span11,.uneditable-input.span11{width:846px;} |
|
199 | 199 | input.span10,textarea.span10,.uneditable-input.span10{width:766px;} |
|
200 | 200 | input.span9,textarea.span9,.uneditable-input.span9{width:686px;} |
|
201 | 201 | input.span8,textarea.span8,.uneditable-input.span8{width:606px;} |
|
202 | 202 | input.span7,textarea.span7,.uneditable-input.span7{width:526px;} |
|
203 | 203 | input.span6,textarea.span6,.uneditable-input.span6{width:446px;} |
|
204 | 204 | input.span5,textarea.span5,.uneditable-input.span5{width:366px;} |
|
205 | 205 | input.span4,textarea.span4,.uneditable-input.span4{width:286px;} |
|
206 | 206 | input.span3,textarea.span3,.uneditable-input.span3{width:206px;} |
|
207 | 207 | input.span2,textarea.span2,.uneditable-input.span2{width:126px;} |
|
208 | 208 | input.span1,textarea.span1,.uneditable-input.span1{width:46px;} |
|
209 | 209 | .controls-row{*zoom:1;}.controls-row:before,.controls-row:after{display:table;content:"";line-height:0;} |
|
210 | 210 | .controls-row:after{clear:both;} |
|
211 | 211 | .controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left;} |
|
212 | 212 | .controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px;} |
|
213 | 213 | input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eeeeee;} |
|
214 | 214 | input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent;} |
|
215 | 215 | .control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853;} |
|
216 | 216 | .control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853;} |
|
217 | 217 | .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;} |
|
218 | 218 | .control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853;} |
|
219 | 219 | .control-group.error .control-label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48;} |
|
220 | 220 | .control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48;} |
|
221 | 221 | .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;} |
|
222 | 222 | .control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48;} |
|
223 | 223 | .control-group.success .control-label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847;} |
|
224 | 224 | .control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847;} |
|
225 | 225 | .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;} |
|
226 | 226 | .control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847;} |
|
227 | 227 | .control-group.info .control-label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad;} |
|
228 | 228 | .control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad;} |
|
229 | 229 | .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;} |
|
230 | 230 | .control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad;} |
|
231 | 231 | 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;} |
|
232 | 232 | .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;} |
|
233 | 233 | .form-actions:after{clear:both;} |
|
234 | 234 | .help-block,.help-inline{color:#262626;} |
|
235 | 235 | .help-block{display:block;margin-bottom:10px;} |
|
236 | 236 | .help-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding-left:5px;} |
|
237 | 237 | .input-append,.input-prepend{display:inline-block;margin-bottom:10px;vertical-align:middle;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,.input-append .popover,.input-prepend .popover{font-size:13px;} |
|
238 | 238 | .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;} |
|
239 | 239 | .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;} |
|
240 | 240 | .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;} |
|
241 | 241 | .input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546;} |
|
242 | 242 | .input-prepend .add-on,.input-prepend .btn{margin-right:-1px;} |
|
243 | 243 | .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;} |
|
244 | 244 | .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;} |
|
245 | 245 | .input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px;} |
|
246 | 246 | .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;} |
|
247 | 247 | .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;} |
|
248 | 248 | .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;} |
|
249 | 249 | .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;} |
|
250 | 250 | .input-prepend.input-append .btn-group:first-child{margin-left:0;} |
|
251 | 251 | 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;} |
|
252 | 252 | .form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} |
|
253 | 253 | .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;} |
|
254 | 254 | .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;} |
|
255 | 255 | .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;} |
|
256 | 256 | .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;} |
|
257 | 257 | .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;} |
|
258 | 258 | .form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none;} |
|
259 | 259 | .form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block;} |
|
260 | 260 | .form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0;} |
|
261 | 261 | .form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle;} |
|
262 | 262 | .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;} |
|
263 | 263 | .control-group{margin-bottom:10px;} |
|
264 | 264 | legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate;} |
|
265 | 265 | .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;} |
|
266 | 266 | .form-horizontal .control-group:after{clear:both;} |
|
267 | 267 | .form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right;} |
|
268 | 268 | .form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0;}.form-horizontal .controls:first-child{*padding-left:180px;} |
|
269 | 269 | .form-horizontal .help-block{margin-bottom:0;} |
|
270 | 270 | .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;} |
|
271 | 271 | .form-horizontal .form-actions{padding-left:180px;} |
|
272 | 272 | table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0;} |
|
273 | 273 | .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;} |
|
274 | 274 | .table th{font-weight:bold;} |
|
275 | 275 | .table thead th{vertical-align:bottom;} |
|
276 | 276 | .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;} |
|
277 | 277 | .table tbody+tbody{border-top:2px solid #dddddd;} |
|
278 | 278 | .table .table{background-color:#ffffff;} |
|
279 | 279 | .table-condensed th,.table-condensed td{padding:4px 5px;} |
|
280 | 280 | .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;} |
|
281 | 281 | .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;} |
|
282 | 282 | .table-bordered thead:first-child tr:first-child>th:first-child,.table-bordered tbody:first-child tr:first-child>td:first-child,.table-bordered tbody:first-child tr:first-child>th:first-child{-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;} |
|
283 | 283 | .table-bordered thead:first-child tr:first-child>th:last-child,.table-bordered tbody:first-child tr:first-child>td:last-child,.table-bordered tbody:first-child tr:first-child>th:last-child{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;} |
|
284 | 284 | .table-bordered thead:last-child tr:last-child>th:first-child,.table-bordered tbody:last-child tr:last-child>td:first-child,.table-bordered tbody:last-child tr:last-child>th:first-child,.table-bordered tfoot:last-child tr:last-child>td:first-child,.table-bordered tfoot:last-child tr:last-child>th:first-child{-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;} |
|
285 | 285 | .table-bordered thead:last-child tr:last-child>th:last-child,.table-bordered tbody:last-child tr:last-child>td:last-child,.table-bordered tbody:last-child tr:last-child>th:last-child,.table-bordered tfoot:last-child tr:last-child>td:last-child,.table-bordered tfoot:last-child tr:last-child>th:last-child{-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;} |
|
286 | 286 | .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;} |
|
287 | 287 | .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;} |
|
288 | 288 | .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;} |
|
289 | 289 | .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;} |
|
290 | 290 | .table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f9f9f9;} |
|
291 | 291 | .table-hover tbody tr:hover>td,.table-hover tbody tr:hover>th{background-color:#f5f5f5;} |
|
292 | 292 | 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;} |
|
293 | 293 | .table td.span1,.table th.span1{float:none;width:44px;margin-left:0;} |
|
294 | 294 | .table td.span2,.table th.span2{float:none;width:124px;margin-left:0;} |
|
295 | 295 | .table td.span3,.table th.span3{float:none;width:204px;margin-left:0;} |
|
296 | 296 | .table td.span4,.table th.span4{float:none;width:284px;margin-left:0;} |
|
297 | 297 | .table td.span5,.table th.span5{float:none;width:364px;margin-left:0;} |
|
298 | 298 | .table td.span6,.table th.span6{float:none;width:444px;margin-left:0;} |
|
299 | 299 | .table td.span7,.table th.span7{float:none;width:524px;margin-left:0;} |
|
300 | 300 | .table td.span8,.table th.span8{float:none;width:604px;margin-left:0;} |
|
301 | 301 | .table td.span9,.table th.span9{float:none;width:684px;margin-left:0;} |
|
302 | 302 | .table td.span10,.table th.span10{float:none;width:764px;margin-left:0;} |
|
303 | 303 | .table td.span11,.table th.span11{float:none;width:844px;margin-left:0;} |
|
304 | 304 | .table td.span12,.table th.span12{float:none;width:924px;margin-left:0;} |
|
305 | 305 | .table tbody tr.success>td{background-color:#dff0d8;} |
|
306 | 306 | .table tbody tr.error>td{background-color:#f2dede;} |
|
307 | 307 | .table tbody tr.warning>td{background-color:#fcf8e3;} |
|
308 | 308 | .table tbody tr.info>td{background-color:#d9edf7;} |
|
309 | 309 | .table-hover tbody tr.success:hover>td{background-color:#d0e9c6;} |
|
310 | 310 | .table-hover tbody tr.error:hover>td{background-color:#ebcccc;} |
|
311 | 311 | .table-hover tbody tr.warning:hover>td{background-color:#faf2cc;} |
|
312 | 312 | .table-hover tbody tr.info:hover>td{background-color:#c4e3f3;} |
|
313 | 313 | [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;} |
|
314 | 314 | .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:focus>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>li>a:focus>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:focus>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"],.dropdown-submenu:focus>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png");} |
|
315 | 315 | .icon-glass{background-position:0 0;} |
|
316 | 316 | .icon-music{background-position:-24px 0;} |
|
317 | 317 | .icon-search{background-position:-48px 0;} |
|
318 | 318 | .icon-envelope{background-position:-72px 0;} |
|
319 | 319 | .icon-heart{background-position:-96px 0;} |
|
320 | 320 | .icon-star{background-position:-120px 0;} |
|
321 | 321 | .icon-star-empty{background-position:-144px 0;} |
|
322 | 322 | .icon-user{background-position:-168px 0;} |
|
323 | 323 | .icon-film{background-position:-192px 0;} |
|
324 | 324 | .icon-th-large{background-position:-216px 0;} |
|
325 | 325 | .icon-th{background-position:-240px 0;} |
|
326 | 326 | .icon-th-list{background-position:-264px 0;} |
|
327 | 327 | .icon-ok{background-position:-288px 0;} |
|
328 | 328 | .icon-remove{background-position:-312px 0;} |
|
329 | 329 | .icon-zoom-in{background-position:-336px 0;} |
|
330 | 330 | .icon-zoom-out{background-position:-360px 0;} |
|
331 | 331 | .icon-off{background-position:-384px 0;} |
|
332 | 332 | .icon-signal{background-position:-408px 0;} |
|
333 | 333 | .icon-cog{background-position:-432px 0;} |
|
334 | 334 | .icon-trash{background-position:-456px 0;} |
|
335 | 335 | .icon-home{background-position:0 -24px;} |
|
336 | 336 | .icon-file{background-position:-24px -24px;} |
|
337 | 337 | .icon-time{background-position:-48px -24px;} |
|
338 | 338 | .icon-road{background-position:-72px -24px;} |
|
339 | 339 | .icon-download-alt{background-position:-96px -24px;} |
|
340 | 340 | .icon-download{background-position:-120px -24px;} |
|
341 | 341 | .icon-upload{background-position:-144px -24px;} |
|
342 | 342 | .icon-inbox{background-position:-168px -24px;} |
|
343 | 343 | .icon-play-circle{background-position:-192px -24px;} |
|
344 | 344 | .icon-repeat{background-position:-216px -24px;} |
|
345 | 345 | .icon-refresh{background-position:-240px -24px;} |
|
346 | 346 | .icon-list-alt{background-position:-264px -24px;} |
|
347 | 347 | .icon-lock{background-position:-287px -24px;} |
|
348 | 348 | .icon-flag{background-position:-312px -24px;} |
|
349 | 349 | .icon-headphones{background-position:-336px -24px;} |
|
350 | 350 | .icon-volume-off{background-position:-360px -24px;} |
|
351 | 351 | .icon-volume-down{background-position:-384px -24px;} |
|
352 | 352 | .icon-volume-up{background-position:-408px -24px;} |
|
353 | 353 | .icon-qrcode{background-position:-432px -24px;} |
|
354 | 354 | .icon-barcode{background-position:-456px -24px;} |
|
355 | 355 | .icon-tag{background-position:0 -48px;} |
|
356 | 356 | .icon-tags{background-position:-25px -48px;} |
|
357 | 357 | .icon-book{background-position:-48px -48px;} |
|
358 | 358 | .icon-bookmark{background-position:-72px -48px;} |
|
359 | 359 | .icon-print{background-position:-96px -48px;} |
|
360 | 360 | .icon-camera{background-position:-120px -48px;} |
|
361 | 361 | .icon-font{background-position:-144px -48px;} |
|
362 | 362 | .icon-bold{background-position:-167px -48px;} |
|
363 | 363 | .icon-italic{background-position:-192px -48px;} |
|
364 | 364 | .icon-text-height{background-position:-216px -48px;} |
|
365 | 365 | .icon-text-width{background-position:-240px -48px;} |
|
366 | 366 | .icon-align-left{background-position:-264px -48px;} |
|
367 | 367 | .icon-align-center{background-position:-288px -48px;} |
|
368 | 368 | .icon-align-right{background-position:-312px -48px;} |
|
369 | 369 | .icon-align-justify{background-position:-336px -48px;} |
|
370 | 370 | .icon-list{background-position:-360px -48px;} |
|
371 | 371 | .icon-indent-left{background-position:-384px -48px;} |
|
372 | 372 | .icon-indent-right{background-position:-408px -48px;} |
|
373 | 373 | .icon-facetime-video{background-position:-432px -48px;} |
|
374 | 374 | .icon-picture{background-position:-456px -48px;} |
|
375 | 375 | .icon-pencil{background-position:0 -72px;} |
|
376 | 376 | .icon-map-marker{background-position:-24px -72px;} |
|
377 | 377 | .icon-adjust{background-position:-48px -72px;} |
|
378 | 378 | .icon-tint{background-position:-72px -72px;} |
|
379 | 379 | .icon-edit{background-position:-96px -72px;} |
|
380 | 380 | .icon-share{background-position:-120px -72px;} |
|
381 | 381 | .icon-check{background-position:-144px -72px;} |
|
382 | 382 | .icon-move{background-position:-168px -72px;} |
|
383 | 383 | .icon-step-backward{background-position:-192px -72px;} |
|
384 | 384 | .icon-fast-backward{background-position:-216px -72px;} |
|
385 | 385 | .icon-backward{background-position:-240px -72px;} |
|
386 | 386 | .icon-play{background-position:-264px -72px;} |
|
387 | 387 | .icon-pause{background-position:-288px -72px;} |
|
388 | 388 | .icon-stop{background-position:-312px -72px;} |
|
389 | 389 | .icon-forward{background-position:-336px -72px;} |
|
390 | 390 | .icon-fast-forward{background-position:-360px -72px;} |
|
391 | 391 | .icon-step-forward{background-position:-384px -72px;} |
|
392 | 392 | .icon-eject{background-position:-408px -72px;} |
|
393 | 393 | .icon-chevron-left{background-position:-432px -72px;} |
|
394 | 394 | .icon-chevron-right{background-position:-456px -72px;} |
|
395 | 395 | .icon-plus-sign{background-position:0 -96px;} |
|
396 | 396 | .icon-minus-sign{background-position:-24px -96px;} |
|
397 | 397 | .icon-remove-sign{background-position:-48px -96px;} |
|
398 | 398 | .icon-ok-sign{background-position:-72px -96px;} |
|
399 | 399 | .icon-question-sign{background-position:-96px -96px;} |
|
400 | 400 | .icon-info-sign{background-position:-120px -96px;} |
|
401 | 401 | .icon-screenshot{background-position:-144px -96px;} |
|
402 | 402 | .icon-remove-circle{background-position:-168px -96px;} |
|
403 | 403 | .icon-ok-circle{background-position:-192px -96px;} |
|
404 | 404 | .icon-ban-circle{background-position:-216px -96px;} |
|
405 | 405 | .icon-arrow-left{background-position:-240px -96px;} |
|
406 | 406 | .icon-arrow-right{background-position:-264px -96px;} |
|
407 | 407 | .icon-arrow-up{background-position:-289px -96px;} |
|
408 | 408 | .icon-arrow-down{background-position:-312px -96px;} |
|
409 | 409 | .icon-share-alt{background-position:-336px -96px;} |
|
410 | 410 | .icon-resize-full{background-position:-360px -96px;} |
|
411 | 411 | .icon-resize-small{background-position:-384px -96px;} |
|
412 | 412 | .icon-plus{background-position:-408px -96px;} |
|
413 | 413 | .icon-minus{background-position:-433px -96px;} |
|
414 | 414 | .icon-asterisk{background-position:-456px -96px;} |
|
415 | 415 | .icon-exclamation-sign{background-position:0 -120px;} |
|
416 | 416 | .icon-gift{background-position:-24px -120px;} |
|
417 | 417 | .icon-leaf{background-position:-48px -120px;} |
|
418 | 418 | .icon-fire{background-position:-72px -120px;} |
|
419 | 419 | .icon-eye-open{background-position:-96px -120px;} |
|
420 | 420 | .icon-eye-close{background-position:-120px -120px;} |
|
421 | 421 | .icon-warning-sign{background-position:-144px -120px;} |
|
422 | 422 | .icon-plane{background-position:-168px -120px;} |
|
423 | 423 | .icon-calendar{background-position:-192px -120px;} |
|
424 | 424 | .icon-random{background-position:-216px -120px;width:16px;} |
|
425 | 425 | .icon-comment{background-position:-240px -120px;} |
|
426 | 426 | .icon-magnet{background-position:-264px -120px;} |
|
427 | 427 | .icon-chevron-up{background-position:-288px -120px;} |
|
428 | 428 | .icon-chevron-down{background-position:-313px -119px;} |
|
429 | 429 | .icon-retweet{background-position:-336px -120px;} |
|
430 | 430 | .icon-shopping-cart{background-position:-360px -120px;} |
|
431 | 431 | .icon-folder-close{background-position:-384px -120px;width:16px;} |
|
432 | 432 | .icon-folder-open{background-position:-408px -120px;width:16px;} |
|
433 | 433 | .icon-resize-vertical{background-position:-432px -119px;} |
|
434 | 434 | .icon-resize-horizontal{background-position:-456px -118px;} |
|
435 | 435 | .icon-hdd{background-position:0 -144px;} |
|
436 | 436 | .icon-bullhorn{background-position:-24px -144px;} |
|
437 | 437 | .icon-bell{background-position:-48px -144px;} |
|
438 | 438 | .icon-certificate{background-position:-72px -144px;} |
|
439 | 439 | .icon-thumbs-up{background-position:-96px -144px;} |
|
440 | 440 | .icon-thumbs-down{background-position:-120px -144px;} |
|
441 | 441 | .icon-hand-right{background-position:-144px -144px;} |
|
442 | 442 | .icon-hand-left{background-position:-168px -144px;} |
|
443 | 443 | .icon-hand-up{background-position:-192px -144px;} |
|
444 | 444 | .icon-hand-down{background-position:-216px -144px;} |
|
445 | 445 | .icon-circle-arrow-right{background-position:-240px -144px;} |
|
446 | 446 | .icon-circle-arrow-left{background-position:-264px -144px;} |
|
447 | 447 | .icon-circle-arrow-up{background-position:-288px -144px;} |
|
448 | 448 | .icon-circle-arrow-down{background-position:-312px -144px;} |
|
449 | 449 | .icon-globe{background-position:-336px -144px;} |
|
450 | 450 | .icon-wrench{background-position:-360px -144px;} |
|
451 | 451 | .icon-tasks{background-position:-384px -144px;} |
|
452 | 452 | .icon-filter{background-position:-408px -144px;} |
|
453 | 453 | .icon-briefcase{background-position:-432px -144px;} |
|
454 | 454 | .icon-fullscreen{background-position:-456px -144px;} |
|
455 | 455 | .dropup,.dropdown{position:relative;} |
|
456 | 456 | .dropdown-toggle{*margin-bottom:-3px;} |
|
457 | 457 | .dropdown-toggle:active,.open .dropdown-toggle{outline:0;} |
|
458 | 458 | .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:"";} |
|
459 | 459 | .dropdown .caret{margin-top:8px;margin-left:2px;} |
|
460 | 460 | .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;} |
|
461 | 461 | .dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;} |
|
462 | 462 | .dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333333;white-space:nowrap;} |
|
463 | 463 | .dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus,.dropdown-submenu:hover>a,.dropdown-submenu:focus>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);} |
|
464 | 464 | .dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{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);} |
|
465 | 465 | .dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999999;} |
|
466 | 466 | .dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:default;} |
|
467 | 467 | .open{*z-index:1000;}.open>.dropdown-menu{display:block;} |
|
468 | 468 | .pull-right>.dropdown-menu{right:0;left:auto;} |
|
469 | 469 | .dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000000;content:"";} |
|
470 | 470 | .dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px;} |
|
471 | 471 | .dropdown-submenu{position:relative;} |
|
472 | 472 | .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;} |
|
473 | 473 | .dropdown-submenu:hover>.dropdown-menu{display:block;} |
|
474 | 474 | .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;} |
|
475 | 475 | .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;} |
|
476 | 476 | .dropdown-submenu:hover>a:after{border-left-color:#ffffff;} |
|
477 | 477 | .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;} |
|
478 | 478 | .dropdown .dropdown-menu .nav-header{padding-left:20px;padding-right:20px;} |
|
479 | 479 | .typeahead{z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} |
|
480 | 480 | .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);} |
|
481 | 481 | .well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} |
|
482 | 482 | .well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} |
|
483 | 483 | .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;} |
|
484 | 484 | .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;} |
|
485 | 485 | .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,.close:focus{color:#000000;text-decoration:none;cursor:pointer;opacity:0.4;filter:alpha(opacity=40);} |
|
486 | 486 | button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none;} |
|
487 | 487 | .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:focus,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333333;background-color:#e6e6e6;*background-color:#d9d9d9;} |
|
488 | 488 | .btn:active,.btn.active{background-color:#cccccc \9;} |
|
489 | 489 | .btn:first-child{*margin-left:0;} |
|
490 | 490 | .btn:hover,.btn:focus{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;} |
|
491 | 491 | .btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} |
|
492 | 492 | .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);} |
|
493 | 493 | .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;} |
|
494 | 494 | .btn-large{padding:11px 19px;font-size:16.25px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} |
|
495 | 495 | .btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px;} |
|
496 | 496 | .btn-small{padding:2px 10px;font-size:11.049999999999999px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} |
|
497 | 497 | .btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0;} |
|
498 | 498 | .btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px;} |
|
499 | 499 | .btn-mini{padding:0 6px;font-size:9.75px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} |
|
500 | 500 | .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;} |
|
501 | 501 | .btn-block+.btn-block{margin-top:5px;} |
|
502 | 502 | input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%;} |
|
503 | 503 | .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);} |
|
504 | 504 | .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:focus,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#ffffff;background-color:#0044cc;*background-color:#003bb3;} |
|
505 | 505 | .btn-primary:active,.btn-primary.active{background-color:#003399 \9;} |
|
506 | 506 | .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:focus,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#ffffff;background-color:#f89406;*background-color:#df8505;} |
|
507 | 507 | .btn-warning:active,.btn-warning.active{background-color:#c67605 \9;} |
|
508 | 508 | .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:focus,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#ffffff;background-color:#bd362f;*background-color:#a9302a;} |
|
509 | 509 | .btn-danger:active,.btn-danger.active{background-color:#942a25 \9;} |
|
510 | 510 | .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:focus,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#ffffff;background-color:#51a351;*background-color:#499249;} |
|
511 | 511 | .btn-success:active,.btn-success.active{background-color:#408140 \9;} |
|
512 | 512 | .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:focus,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#ffffff;background-color:#2f96b4;*background-color:#2a85a0;} |
|
513 | 513 | .btn-info:active,.btn-info.active{background-color:#24748c \9;} |
|
514 | 514 | .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:focus,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#ffffff;background-color:#222222;*background-color:#151515;} |
|
515 | 515 | .btn-inverse:active,.btn-inverse.active{background-color:#080808 \9;} |
|
516 | 516 | 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;} |
|
517 | 517 | button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px;} |
|
518 | 518 | button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px;} |
|
519 | 519 | button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px;} |
|
520 | 520 | .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;} |
|
521 | 521 | .btn-link{border-color:transparent;cursor:pointer;color:#0088cc;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} |
|
522 | 522 | .btn-link:hover,.btn-link:focus{color:#005580;text-decoration:underline;background-color:transparent;} |
|
523 | 523 | .btn-link[disabled]:hover,.btn-link[disabled]:focus{color:#333333;text-decoration:none;} |
|
524 | 524 | .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;} |
|
525 | 525 | .btn-group+.btn-group{margin-left:5px;} |
|
526 | 526 | .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;} |
|
527 | 527 | .btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} |
|
528 | 528 | .btn-group>.btn+.btn{margin-left:-1px;} |
|
529 | 529 | .btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:13px;} |
|
530 | 530 | .btn-group>.btn-mini{font-size:9.75px;} |
|
531 | 531 | .btn-group>.btn-small{font-size:11.049999999999999px;} |
|
532 | 532 | .btn-group>.btn-large{font-size:16.25px;} |
|
533 | 533 | .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;} |
|
534 | 534 | .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;} |
|
535 | 535 | .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;} |
|
536 | 536 | .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;} |
|
537 | 537 | .btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2;} |
|
538 | 538 | .btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0;} |
|
539 | 539 | .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;} |
|
540 | 540 | .btn-group>.btn-mini+.dropdown-toggle{padding-left:5px;padding-right:5px;*padding-top:2px;*padding-bottom:2px;} |
|
541 | 541 | .btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px;} |
|
542 | 542 | .btn-group>.btn-large+.dropdown-toggle{padding-left:12px;padding-right:12px;*padding-top:7px;*padding-bottom:7px;} |
|
543 | 543 | .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);} |
|
544 | 544 | .btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6;} |
|
545 | 545 | .btn-group.open .btn-primary.dropdown-toggle{background-color:#0044cc;} |
|
546 | 546 | .btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406;} |
|
547 | 547 | .btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f;} |
|
548 | 548 | .btn-group.open .btn-success.dropdown-toggle{background-color:#51a351;} |
|
549 | 549 | .btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4;} |
|
550 | 550 | .btn-group.open .btn-inverse.dropdown-toggle{background-color:#222222;} |
|
551 | 551 | .btn .caret{margin-top:8px;margin-left:0;} |
|
552 | 552 | .btn-large .caret{margin-top:6px;} |
|
553 | 553 | .btn-large .caret{border-left-width:5px;border-right-width:5px;border-top-width:5px;} |
|
554 | 554 | .btn-mini .caret,.btn-small .caret{margin-top:8px;} |
|
555 | 555 | .dropup .btn-large .caret{border-bottom-width:5px;} |
|
556 | 556 | .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;} |
|
557 | 557 | .btn-group-vertical{display:inline-block;*display:inline;*zoom:1;} |
|
558 | 558 | .btn-group-vertical>.btn{display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} |
|
559 | 559 | .btn-group-vertical>.btn+.btn{margin-left:0;margin-top:-1px;} |
|
560 | 560 | .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;} |
|
561 | 561 | .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;} |
|
562 | 562 | .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;} |
|
563 | 563 | .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;} |
|
564 | 564 | .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;} |
|
565 | 565 | .alert,.alert h4{color:#c09853;} |
|
566 | 566 | .alert h4{margin:0;} |
|
567 | 567 | .alert .close{position:relative;top:-2px;right:-21px;line-height:20px;} |
|
568 | 568 | .alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#468847;} |
|
569 | 569 | .alert-success h4{color:#468847;} |
|
570 | 570 | .alert-danger,.alert-error{background-color:#f2dede;border-color:#eed3d7;color:#b94a48;} |
|
571 | 571 | .alert-danger h4,.alert-error h4{color:#b94a48;} |
|
572 | 572 | .alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#3a87ad;} |
|
573 | 573 | .alert-info h4{color:#3a87ad;} |
|
574 | 574 | .alert-block{padding-top:14px;padding-bottom:14px;} |
|
575 | 575 | .alert-block>p,.alert-block>ul{margin-bottom:0;} |
|
576 | 576 | .alert-block p+p{margin-top:5px;} |
|
577 | 577 | .nav{margin-left:0;margin-bottom:20px;list-style:none;} |
|
578 | 578 | .nav>li>a{display:block;} |
|
579 | 579 | .nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eeeeee;} |
|
580 | 580 | .nav>li>a>img{max-width:none;} |
|
581 | 581 | .nav>.pull-right{float:right;} |
|
582 | 582 | .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;} |
|
583 | 583 | .nav li+.nav-header{margin-top:9px;} |
|
584 | 584 | .nav-list{padding-left:15px;padding-right:15px;margin-bottom:0;} |
|
585 | 585 | .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);} |
|
586 | 586 | .nav-list>li>a{padding:3px 15px;} |
|
587 | 587 | .nav-list>.active>a,.nav-list>.active>a:hover,.nav-list>.active>a:focus{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.2);background-color:#0088cc;} |
|
588 | 588 | .nav-list [class^="icon-"],.nav-list [class*=" icon-"]{margin-right:2px;} |
|
589 | 589 | .nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;} |
|
590 | 590 | .nav-tabs,.nav-pills{*zoom:1;}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;content:"";line-height:0;} |
|
591 | 591 | .nav-tabs:after,.nav-pills:after{clear:both;} |
|
592 | 592 | .nav-tabs>li,.nav-pills>li{float:left;} |
|
593 | 593 | .nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px;} |
|
594 | 594 | .nav-tabs{border-bottom:1px solid #ddd;} |
|
595 | 595 | .nav-tabs>li{margin-bottom:-1px;} |
|
596 | 596 | .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,.nav-tabs>li>a:focus{border-color:#eeeeee #eeeeee #dddddd;} |
|
597 | 597 | .nav-tabs>.active>a,.nav-tabs>.active>a:hover,.nav-tabs>.active>a:focus{color:#555555;background-color:#ffffff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default;} |
|
598 | 598 | .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;} |
|
599 | 599 | .nav-pills>.active>a,.nav-pills>.active>a:hover,.nav-pills>.active>a:focus{color:#ffffff;background-color:#0088cc;} |
|
600 | 600 | .nav-stacked>li{float:none;} |
|
601 | 601 | .nav-stacked>li>a{margin-right:0;} |
|
602 | 602 | .nav-tabs.nav-stacked{border-bottom:0;} |
|
603 | 603 | .nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} |
|
604 | 604 | .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;} |
|
605 | 605 | .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;} |
|
606 | 606 | .nav-tabs.nav-stacked>li>a:hover,.nav-tabs.nav-stacked>li>a:focus{border-color:#ddd;z-index:2;} |
|
607 | 607 | .nav-pills.nav-stacked>li>a{margin-bottom:3px;} |
|
608 | 608 | .nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px;} |
|
609 | 609 | .nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;} |
|
610 | 610 | .nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} |
|
611 | 611 | .nav .dropdown-toggle .caret{border-top-color:#0088cc;border-bottom-color:#0088cc;margin-top:6px;} |
|
612 | 612 | .nav .dropdown-toggle:hover .caret,.nav .dropdown-toggle:focus .caret{border-top-color:#005580;border-bottom-color:#005580;} |
|
613 | 613 | .nav-tabs .dropdown-toggle .caret{margin-top:8px;} |
|
614 | 614 | .nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff;} |
|
615 | 615 | .nav-tabs .active .dropdown-toggle .caret{border-top-color:#555555;border-bottom-color:#555555;} |
|
616 | 616 | .nav>.dropdown.active>a:hover,.nav>.dropdown.active>a:focus{cursor:pointer;} |
|
617 | 617 | .nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover,.nav>li.dropdown.open.active>a:focus{color:#ffffff;background-color:#999999;border-color:#999999;} |
|
618 | 618 | .nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret,.nav li.dropdown.open a:focus .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;opacity:1;filter:alpha(opacity=100);} |
|
619 | 619 | .tabs-stacked .open>a:hover,.tabs-stacked .open>a:focus{border-color:#999999;} |
|
620 | 620 | .tabbable{*zoom:1;}.tabbable:before,.tabbable:after{display:table;content:"";line-height:0;} |
|
621 | 621 | .tabbable:after{clear:both;} |
|
622 | 622 | .tab-content{overflow:auto;} |
|
623 | 623 | .tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0;} |
|
624 | 624 | .tab-content>.tab-pane,.pill-content>.pill-pane{display:none;} |
|
625 | 625 | .tab-content>.active,.pill-content>.active{display:block;} |
|
626 | 626 | .tabs-below>.nav-tabs{border-top:1px solid #ddd;} |
|
627 | 627 | .tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0;} |
|
628 | 628 | .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,.tabs-below>.nav-tabs>li>a:focus{border-bottom-color:transparent;border-top-color:#ddd;} |
|
629 | 629 | .tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover,.tabs-below>.nav-tabs>.active>a:focus{border-color:transparent #ddd #ddd #ddd;} |
|
630 | 630 | .tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none;} |
|
631 | 631 | .tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px;} |
|
632 | 632 | .tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd;} |
|
633 | 633 | .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;} |
|
634 | 634 | .tabs-left>.nav-tabs>li>a:hover,.tabs-left>.nav-tabs>li>a:focus{border-color:#eeeeee #dddddd #eeeeee #eeeeee;} |
|
635 | 635 | .tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover,.tabs-left>.nav-tabs .active>a:focus{border-color:#ddd transparent #ddd #ddd;*border-right-color:#ffffff;} |
|
636 | 636 | .tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd;} |
|
637 | 637 | .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;} |
|
638 | 638 | .tabs-right>.nav-tabs>li>a:hover,.tabs-right>.nav-tabs>li>a:focus{border-color:#eeeeee #eeeeee #eeeeee #dddddd;} |
|
639 | 639 | .tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover,.tabs-right>.nav-tabs .active>a:focus{border-color:#ddd #ddd #ddd transparent;*border-left-color:#ffffff;} |
|
640 | 640 | .nav>.disabled>a{color:#999999;} |
|
641 | 641 | .nav>.disabled>a:hover,.nav>.disabled>a:focus{text-decoration:none;background-color:transparent;cursor:default;} |
|
642 | 642 | .navbar{overflow:visible;margin-bottom:20px;*position:relative;*z-index:2;} |
|
643 | 643 | .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;} |
|
644 | 644 | .navbar-inner:after{clear:both;} |
|
645 | 645 | .navbar .container{width:auto;} |
|
646 | 646 | .nav-collapse.collapse{height:auto;overflow:visible;} |
|
647 | 647 | .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,.navbar .brand:focus{text-decoration:none;} |
|
648 | 648 | .navbar-text{margin-bottom:0;line-height:40px;color:#777777;} |
|
649 | 649 | .navbar-link{color:#777777;}.navbar-link:hover,.navbar-link:focus{color:#333333;} |
|
650 | 650 | .navbar .divider-vertical{height:40px;margin:0 9px;border-left:1px solid #f2f2f2;border-right:1px solid #ffffff;} |
|
651 | 651 | .navbar .btn,.navbar .btn-group{margin-top:5px;} |
|
652 | 652 | .navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn,.navbar .input-prepend .btn-group,.navbar .input-append .btn-group{margin-top:0;} |
|
653 | 653 | .navbar-form{margin-bottom:0;*zoom:1;}.navbar-form:before,.navbar-form:after{display:table;content:"";line-height:0;} |
|
654 | 654 | .navbar-form:after{clear:both;} |
|
655 | 655 | .navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px;} |
|
656 | 656 | .navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0;} |
|
657 | 657 | .navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px;} |
|
658 | 658 | .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;} |
|
659 | 659 | .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;} |
|
660 | 660 | .navbar-static-top{position:static;margin-bottom:0;}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} |
|
661 | 661 | .navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0;} |
|
662 | 662 | .navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px;} |
|
663 | 663 | .navbar-fixed-bottom .navbar-inner{border-width:1px 0 0;} |
|
664 | 664 | .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;} |
|
665 | 665 | .navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;} |
|
666 | 666 | .navbar-fixed-top{top:0;} |
|
667 | 667 | .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);} |
|
668 | 668 | .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);} |
|
669 | 669 | .navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0;} |
|
670 | 670 | .navbar .nav.pull-right{float:right;margin-right:0;} |
|
671 | 671 | .navbar .nav>li{float:left;} |
|
672 | 672 | .navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777777;text-decoration:none;text-shadow:0 1px 0 #ffffff;} |
|
673 | 673 | .navbar .nav .dropdown-toggle .caret{margin-top:8px;} |
|
674 | 674 | .navbar .nav>li>a:focus,.navbar .nav>li>a:hover{background-color:transparent;color:#333333;text-decoration:none;} |
|
675 | 675 | .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);} |
|
676 | 676 | .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:focus,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#ffffff;background-color:#e5e5e5;*background-color:#d9d9d9;} |
|
677 | 677 | .navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#cccccc \9;} |
|
678 | 678 | .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);} |
|
679 | 679 | .btn-navbar .icon-bar+.icon-bar{margin-top:3px;} |
|
680 | 680 | .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;} |
|
681 | 681 | .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;} |
|
682 | 682 | .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;} |
|
683 | 683 | .navbar-fixed-bottom .nav>li>.dropdown-menu:after{border-top:6px solid #ffffff;border-bottom:0;bottom:-6px;top:auto;} |
|
684 | 684 | .navbar .nav li.dropdown>a:hover .caret,.navbar .nav li.dropdown>a:focus .caret{border-top-color:#333333;border-bottom-color:#333333;} |
|
685 | 685 | .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;} |
|
686 | 686 | .navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777777;border-bottom-color:#777777;} |
|
687 | 687 | .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;} |
|
688 | 688 | .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;} |
|
689 | 689 | .navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{left:auto;right:13px;} |
|
690 | 690 | .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;} |
|
691 | 691 | .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;} |
|
692 | 692 | .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,.navbar-inverse .brand:focus,.navbar-inverse .nav>li>a:focus{color:#ffffff;} |
|
693 | 693 | .navbar-inverse .brand{color:#999999;} |
|
694 | 694 | .navbar-inverse .navbar-text{color:#999999;} |
|
695 | 695 | .navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{background-color:transparent;color:#ffffff;} |
|
696 | 696 | .navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#ffffff;background-color:#111111;} |
|
697 | 697 | .navbar-inverse .navbar-link{color:#999999;}.navbar-inverse .navbar-link:hover,.navbar-inverse .navbar-link:focus{color:#ffffff;} |
|
698 | 698 | .navbar-inverse .divider-vertical{border-left-color:#111111;border-right-color:#222222;} |
|
699 | 699 | .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;} |
|
700 | 700 | .navbar-inverse .nav li.dropdown>a:hover .caret,.navbar-inverse .nav li.dropdown>a:focus .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;} |
|
701 | 701 | .navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999999;border-bottom-color:#999999;} |
|
702 | 702 | .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;} |
|
703 | 703 | .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;} |
|
704 | 704 | .navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#cccccc;} |
|
705 | 705 | .navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#cccccc;} |
|
706 | 706 | .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;} |
|
707 | 707 | .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:focus,.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;} |
|
708 | 708 | .navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000000 \9;} |
|
709 | 709 | .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;} |
|
710 | 710 | .breadcrumb>.active{color:#999999;} |
|
711 | 711 | .pagination{margin:20px 0;} |
|
712 | 712 | .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);} |
|
713 | 713 | .pagination ul>li{display:inline;} |
|
714 | 714 | .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;} |
|
715 | 715 | .pagination ul>li>a:hover,.pagination ul>li>a:focus,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5;} |
|
716 | 716 | .pagination ul>.active>a,.pagination ul>.active>span{color:#999999;cursor:default;} |
|
717 | 717 | .pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover,.pagination ul>.disabled>a:focus{color:#999999;background-color:transparent;cursor:default;} |
|
718 | 718 | .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;} |
|
719 | 719 | .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;} |
|
720 | 720 | .pagination-centered{text-align:center;} |
|
721 | 721 | .pagination-right{text-align:right;} |
|
722 | 722 | .pagination-large ul>li>a,.pagination-large ul>li>span{padding:11px 19px;font-size:16.25px;} |
|
723 | 723 | .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;} |
|
724 | 724 | .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;} |
|
725 | 725 | .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;} |
|
726 | 726 | .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;} |
|
727 | 727 | .pagination-small ul>li>a,.pagination-small ul>li>span{padding:2px 10px;font-size:11.049999999999999px;} |
|
728 | 728 | .pagination-mini ul>li>a,.pagination-mini ul>li>span{padding:0 6px;font-size:9.75px;} |
|
729 | 729 | .pager{margin:20px 0;list-style:none;text-align:center;*zoom:1;}.pager:before,.pager:after{display:table;content:"";line-height:0;} |
|
730 | 730 | .pager:after{clear:both;} |
|
731 | 731 | .pager li{display:inline;} |
|
732 | 732 | .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;} |
|
733 | 733 | .pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#f5f5f5;} |
|
734 | 734 | .pager .next>a,.pager .next>span{float:right;} |
|
735 | 735 | .pager .previous>a,.pager .previous>span{float:left;} |
|
736 | 736 | .pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999999;background-color:#fff;cursor:default;} |
|
737 | 737 | .modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000;}.modal-backdrop.fade{opacity:0;} |
|
738 | 738 | .modal-backdrop,.modal-backdrop.fade.in{opacity:0.8;filter:alpha(opacity=80);} |
|
739 | 739 | .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%;} |
|
740 | 740 | .modal.fade.in{top:10%;} |
|
741 | 741 | .modal-header{padding:9px 15px;border-bottom:1px solid #eee;}.modal-header .close{margin-top:2px;} |
|
742 | 742 | .modal-header h3{margin:0;line-height:30px;} |
|
743 | 743 | .modal-body{position:relative;overflow-y:auto;max-height:400px;padding:15px;} |
|
744 | 744 | .modal-form{margin-bottom:0;} |
|
745 | 745 | .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;} |
|
746 | 746 | .modal-footer:after{clear:both;} |
|
747 | 747 | .modal-footer .btn+.btn{margin-left:5px;margin-bottom:0;} |
|
748 | 748 | .modal-footer .btn-group .btn+.btn{margin-left:-1px;} |
|
749 | 749 | .modal-footer .btn-block+.btn-block{margin-left:0;} |
|
750 | 750 | .tooltip{position:absolute;z-index:1030;display:block;visibility:visible;font-size:11px;line-height:1.4;opacity:0;filter:alpha(opacity=0);}.tooltip.in{opacity:0.8;filter:alpha(opacity=80);} |
|
751 | 751 | .tooltip.top{margin-top:-3px;padding:5px 0;} |
|
752 | 752 | .tooltip.right{margin-left:3px;padding:0 5px;} |
|
753 | 753 | .tooltip.bottom{margin-top:3px;padding:5px 0;} |
|
754 | 754 | .tooltip.left{margin-left:-3px;padding:0 5px;} |
|
755 | 755 | .tooltip-inner{max-width:200px;padding:8px;color:#ffffff;text-align:center;text-decoration:none;background-color:#000000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} |
|
756 | 756 | .tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid;} |
|
757 | 757 | .tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000000;} |
|
758 | 758 | .tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000000;} |
|
759 | 759 | .tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000000;} |
|
760 | 760 | .tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000000;} |
|
761 | 761 | .popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;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;} |
|
762 | 762 | .popover.right{margin-left:10px;} |
|
763 | 763 | .popover.bottom{margin-top:10px;} |
|
764 | 764 | .popover.left{margin-left:-10px;} |
|
765 | 765 | .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;}.popover-title:empty{display:none;} |
|
766 | 766 | .popover-content{padding:9px 14px;} |
|
767 | 767 | .popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid;} |
|
768 | 768 | .popover .arrow{border-width:11px;} |
|
769 | 769 | .popover .arrow:after{border-width:10px;content:"";} |
|
770 | 770 | .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;} |
|
771 | 771 | .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;} |
|
772 | 772 | .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;} |
|
773 | 773 | .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;} |
|
774 | 774 | .thumbnails{margin-left:-20px;list-style:none;*zoom:1;}.thumbnails:before,.thumbnails:after{display:table;content:"";line-height:0;} |
|
775 | 775 | .thumbnails:after{clear:both;} |
|
776 | 776 | .row-fluid .thumbnails{margin-left:0;} |
|
777 | 777 | .thumbnails>li{float:left;margin-bottom:20px;margin-left:20px;} |
|
778 | 778 | .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;} |
|
779 | 779 | a.thumbnail:hover,a.thumbnail:focus{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);} |
|
780 | 780 | .thumbnail>img{display:block;max-width:100%;margin-left:auto;margin-right:auto;} |
|
781 | 781 | .thumbnail .caption{padding:9px;color:#555555;} |
|
782 | 782 | .media,.media-body{overflow:hidden;*overflow:visible;zoom:1;} |
|
783 | 783 | .media,.media .media{margin-top:15px;} |
|
784 | 784 | .media:first-child{margin-top:0;} |
|
785 | 785 | .media-object{display:block;} |
|
786 | 786 | .media-heading{margin:0 0 5px;} |
|
787 | 787 | .media>.pull-left{margin-right:10px;} |
|
788 | 788 | .media>.pull-right{margin-left:10px;} |
|
789 | 789 | .media-list{margin-left:0;list-style:none;} |
|
790 | 790 | .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;} |
|
791 | 791 | .label{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} |
|
792 | 792 | .badge{padding-left:9px;padding-right:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;} |
|
793 | 793 | .label:empty,.badge:empty{display:none;} |
|
794 | 794 | a.label:hover,a.label:focus,a.badge:hover,a.badge:focus{color:#ffffff;text-decoration:none;cursor:pointer;} |
|
795 | 795 | .label-important,.badge-important{background-color:#b94a48;} |
|
796 | 796 | .label-important[href],.badge-important[href]{background-color:#953b39;} |
|
797 | 797 | .label-warning,.badge-warning{background-color:#f89406;} |
|
798 | 798 | .label-warning[href],.badge-warning[href]{background-color:#c67605;} |
|
799 | 799 | .label-success,.badge-success{background-color:#468847;} |
|
800 | 800 | .label-success[href],.badge-success[href]{background-color:#356635;} |
|
801 | 801 | .label-info,.badge-info{background-color:#3a87ad;} |
|
802 | 802 | .label-info[href],.badge-info[href]{background-color:#2d6987;} |
|
803 | 803 | .label-inverse,.badge-inverse{background-color:#333333;} |
|
804 | 804 | .label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a;} |
|
805 | 805 | .btn .label,.btn .badge{position:relative;top:-1px;} |
|
806 | 806 | .btn-mini .label,.btn-mini .badge{top:0;} |
|
807 | 807 | @-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;} |
|
808 | 808 | .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;} |
|
809 | 809 | .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);} |
|
810 | 810 | .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;} |
|
811 | 811 | .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;} |
|
812 | 812 | .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);} |
|
813 | 813 | .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);} |
|
814 | 814 | .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);} |
|
815 | 815 | .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);} |
|
816 | 816 | .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);} |
|
817 | 817 | .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);} |
|
818 | 818 | .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);} |
|
819 | 819 | .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);} |
|
820 | 820 | .accordion{margin-bottom:20px;} |
|
821 | 821 | .accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} |
|
822 | 822 | .accordion-heading{border-bottom:0;} |
|
823 | 823 | .accordion-heading .accordion-toggle{display:block;padding:8px 15px;} |
|
824 | 824 | .accordion-toggle{cursor:pointer;} |
|
825 | 825 | .accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5;} |
|
826 | 826 | .carousel{position:relative;margin-bottom:20px;line-height:1;} |
|
827 | 827 | .carousel-inner{overflow:hidden;width:100%;position:relative;} |
|
828 | 828 | .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;}.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;line-height:1;} |
|
829 | 829 | .carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block;} |
|
830 | 830 | .carousel-inner>.active{left:0;} |
|
831 | 831 | .carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%;} |
|
832 | 832 | .carousel-inner>.next{left:100%;} |
|
833 | 833 | .carousel-inner>.prev{left:-100%;} |
|
834 | 834 | .carousel-inner>.next.left,.carousel-inner>.prev.right{left:0;} |
|
835 | 835 | .carousel-inner>.active.left{left:-100%;} |
|
836 | 836 | .carousel-inner>.active.right{left:100%;} |
|
837 | 837 | .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;} |
|
838 | 838 | .carousel-control:hover,.carousel-control:focus{color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90);} |
|
839 | 839 | .carousel-indicators{position:absolute;top:15px;right:15px;z-index:5;margin:0;list-style:none;}.carousel-indicators li{display:block;float:left;width:10px;height:10px;margin-left:5px;text-indent:-999px;background-color:#ccc;background-color:rgba(255, 255, 255, 0.25);border-radius:5px;} |
|
840 | 840 | .carousel-indicators .active{background-color:#fff;} |
|
841 | 841 | .carousel-caption{position:absolute;left:0;right:0;bottom:0;padding:15px;background:#333333;background:rgba(0, 0, 0, 0.75);} |
|
842 | 842 | .carousel-caption h4,.carousel-caption p{color:#ffffff;line-height:20px;} |
|
843 | 843 | .carousel-caption h4{margin:0 0 5px;} |
|
844 | 844 | .carousel-caption p{margin-bottom:0;} |
|
845 | 845 | .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;} |
|
846 | 846 | .hero-unit li{line-height:30px;} |
|
847 | 847 | .pull-right{float:right;} |
|
848 | 848 | .pull-left{float:left;} |
|
849 | 849 | .hide{display:none;} |
|
850 | 850 | .show{display:block;} |
|
851 | 851 | .invisible{visibility:hidden;} |
|
852 | 852 | .affix{position:fixed;} |
|
853 | 853 | .corner-all{border-radius:4px;} |
|
854 | 854 | .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;} |
|
855 | 855 | .hbox>*{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;} |
|
856 | 856 | .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%;} |
|
857 | 857 | .vbox>*{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;} |
|
858 | 858 | .reverse{-webkit-box-direction:reverse;-moz-box-direction:reverse;box-direction:reverse;} |
|
859 | 859 | .box-flex0{-webkit-box-flex:0;-moz-box-flex:0;box-flex:0;} |
|
860 | 860 | .box-flex1{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;} |
|
861 | 861 | .box-flex{-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;} |
|
862 | 862 | .box-flex2{-webkit-box-flex:2;-moz-box-flex:2;box-flex:2;} |
|
863 | 863 | .box-group1{-webkit-box-flex-group:1;-moz-box-flex-group:1;box-flex-group:1;} |
|
864 | 864 | .box-group2{-webkit-box-flex-group:2;-moz-box-flex-group:2;box-flex-group:2;} |
|
865 | 865 | .start{-webkit-box-pack:start;-moz-box-pack:start;box-pack:start;} |
|
866 | 866 | .end{-webkit-box-pack:end;-moz-box-pack:end;box-pack:end;} |
|
867 | 867 | .center{-webkit-box-pack:center;-moz-box-pack:center;box-pack:center;} |
|
868 | 868 | .corner-all{border-radius:4px;} |
|
869 | pre code{display:block;padding:0.5em;} | |
|
870 | .highlight-base,pre code,pre .subst,pre .tag .title,pre .lisp .title,pre .clojure .built_in,pre .nginx .title{color:black;} | |
|
871 | .highlight-string,pre .string,pre .constant,pre .parent,pre .tag .value,pre .rules .value,pre .rules .value .number,pre .preprocessor,pre .ruby .symbol,pre .ruby .symbol .string,pre .aggregate,pre .template_tag,pre .django .variable,pre .smalltalk .class,pre .addition,pre .flow,pre .stream,pre .bash .variable,pre .apache .tag,pre .apache .cbracket,pre .tex .command,pre .tex .special,pre .erlang_repl .function_or_atom,pre .markdown .header{color:#BA2121;} | |
|
872 | .highlight-comment,pre .comment,pre .annotation,pre .template_comment,pre .diff .header,pre .chunk,pre .markdown .blockquote{color:#408080;font-style:italic;} | |
|
873 | .highlight-number,pre .number,pre .date,pre .regexp,pre .literal,pre .smalltalk .symbol,pre .smalltalk .char,pre .go .constant,pre .change,pre .markdown .bullet,pre .markdown .link_url{color:#080;} | |
|
874 | pre .label,pre .javadoc,pre .ruby .string,pre .decorator,pre .filter .argument,pre .localvars,pre .array,pre .attr_selector,pre .important,pre .pseudo,pre .pi,pre .doctype,pre .deletion,pre .envvar,pre .shebang,pre .apache .sqbracket,pre .nginx .built_in,pre .tex .formula,pre .erlang_repl .reserved,pre .prompt,pre .markdown .link_label,pre .vhdl .attribute,pre .clojure .attribute,pre .coffeescript .property{color:#8888ff;} | |
|
875 | .highlight-keyword,pre .keyword,pre .id,pre .phpdoc,pre .aggregate,pre .css .tag,pre .javadoctag,pre .phpdoc,pre .yardoctag,pre .smalltalk .class,pre .winutils,pre .bash .variable,pre .apache .tag,pre .go .typename,pre .tex .command,pre .markdown .strong,pre .request,pre .status{color:#008000;font-weight:bold;} | |
|
876 | .highlight-builtin,pre .built_in{color:#008000;} | |
|
877 | pre .markdown .emphasis{font-style:italic;} | |
|
878 | pre .nginx .built_in{font-weight:normal;} | |
|
879 | pre .coffeescript .javascript,pre .javascript .xml,pre .tex .formula,pre .xml .javascript,pre .xml .vbscript,pre .xml .css,pre .xml .cdata{opacity:0.5;} | |
|
880 | .cm-s-ipython span.cm-variable{color:black;} | |
|
881 | .cm-s-ipython span.cm-keyword{color:#008000;font-weight:bold;} | |
|
882 | .cm-s-ipython span.cm-number{color:#080;} | |
|
883 | .cm-s-ipython span.cm-comment{color:#408080;font-style:italic;} | |
|
884 | .cm-s-ipython span.cm-string{color:#BA2121;} | |
|
885 | .cm-s-ipython span.cm-builtin{color:#008000;} | |
|
886 | .cm-s-ipython span.cm-error{color:#f00;} | |
|
887 | .cm-s-ipython span.cm-operator{color:#AA22FF;font-weight:bold;} | |
|
888 | .cm-s-ipython span.cm-meta{color:#AA22FF;} | |
|
869 | 889 | body{background-color:#ffffff;} |
|
870 | 890 | body.notebook_app{overflow:hidden;} |
|
871 | 891 | blockquote{border-left:4px solid #DDD;padding:0 15px;color:#777;} |
|
872 | 892 | span#save_widget{padding:5px;margin:0px 0px 0px 300px;display:inline-block;} |
|
873 | 893 | span#checkpoint_status span#autosave_status{font-size:small;} |
|
874 | 894 | span#notebook_name{height:1em;line-height:1em;padding:3px;border:none;font-size:146.5%;} |
|
875 | 895 | .ui-menubar-item .ui-button .ui-button-text{padding:0.4em 1.0em;font-size:100%;} |
|
876 | 896 | .ui-menu{-webkit-box-shadow:0px 6px 10px -1px #adadad;-moz-box-shadow:0px 6px 10px -1px #adadad;box-shadow:0px 6px 10px -1px #adadad;} |
|
877 | 897 | .ui-menu .ui-menu-item a{border:1px solid transparent;padding:2px 1.6em;} |
|
878 | 898 | .ui-menu .ui-menu-item a.ui-state-focus{margin:0;} |
|
879 | 899 | .ui-menu hr{margin:0.3em 0;} |
|
880 | 900 | #menubar_container{position:relative;} |
|
881 | 901 | #notification_area{position:absolute;right:0px;top:0px;height:25px;padding:3px 0px;padding-right:3px;z-index:10;} |
|
882 | 902 | .notification_widget{float:right;right:0px;top:1px;height:25px;padding:3px 6px;z-index:10;} |
|
883 | 903 | .toolbar{padding:3px 15px;border-bottom:1px #ababab solid;}.toolbar button{margin-top:2px;margin-bottom:2px;} |
|
884 | 904 | .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;} |
|
885 | 905 | .toolbar select{width:auto;} |
|
886 | 906 | #ipython-main-app{width:100%;position:relative;font-size:110%;} |
|
887 | 907 | span#quick_help_area{position:static;padding:5px 0px;margin:0px 0px 0px 0px;} |
|
888 | 908 | .help_string{float:right;width:170px;padding:0px 5px;text-align:left;font-size:85%;} |
|
889 | 909 | .help_string_label{float:right;font-size:85%;} |
|
890 | 910 | div#notebook_panel{margin:0px 0px 0px 0px;padding:0px;} |
|
891 | 911 | div#notebook{overflow-y:scroll;overflow-x:auto;width:100%;padding:5px 5px 15px 5px;margin:0px;} |
|
892 | 912 | div#pager_splitter{height:8px;} |
|
893 | 913 | #pager_container{position:relative;} |
|
894 | 914 | div#pager{padding:15px;overflow:auto;display:none;} |
|
895 | 915 | div.ui-widget-content{border:1px solid #ababab;outline:none;} |
|
896 | 916 | .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;} |
|
897 | 917 | div.cell{width:100%;padding:5px 5px 5px 0px;margin:2px 0px 2px 0px;outline:none;} |
|
898 | 918 | div.prompt{width:11ex;padding:0.4em;margin:0px;font-family:monospace;text-align:right;line-height:1.231;} |
|
899 | 919 | 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;} |
|
900 | 920 | div.input_area{border:1px solid #cfcfcf;border-radius:4px;background:#f7f7f7;} |
|
901 | 921 | div.input_prompt{color:navy;border-top:1px solid transparent;} |
|
902 | 922 | div.output_wrapper{margin-top:5px;margin-left:5px;width:100%;position:relative;} |
|
903 | 923 | div.output_scroll{height:24em;width:100%;overflow:auto;border-radius:4px;-webkit-box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);-moz-box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);} |
|
904 | 924 | div.output_collapsed{margin-right:5px;} |
|
905 | 925 | div.out_prompt_overlay{height:100%;padding:0px;position:absolute;border-radius:4px;} |
|
906 | 926 | div.out_prompt_overlay:hover{-webkit-box-shadow:inset 0 0 1px #000000;-moz-box-shadow:inset 0 0 1px #000000;box-shadow:inset 0 0 1px #000000;background:rgba(240, 240, 240, 0.5);} |
|
907 | 927 | div.output_prompt{color:darkred;margin:0 5px 0 -5px;} |
|
908 | 928 | 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;} |
|
909 | 929 | div.output_area pre{font-family:monospace;margin:0;padding:0;border:0;font-size:100%;vertical-align:baseline;color:black;} |
|
910 | 930 | div.output_subarea{padding:0.44em 0.4em 0.4em 1px;-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;} |
|
911 | 931 | div.output_text{text-align:left;color:#000000;font-family:monospace;line-height:1.231;} |
|
912 | 932 | div.output_stream{padding-top:0.0em;padding-bottom:0.0em;} |
|
913 | 933 | div.output_stderr{background:#fdd;} |
|
914 | 934 | div.output_latex{text-align:left;} |
|
915 | 935 | div.text_cell{padding:5px 5px 5px 5px;} |
|
916 | 936 | div.text_cell_input{color:#000000;border:1px solid #cfcfcf;border-radius:4px;background:#f7f7f7;} |
|
917 | 937 | div.text_cell_render{outline:none;resize:none;width:inherit;border-style:none;padding:5px;color:#000000;} |
|
918 | 938 | .CodeMirror{line-height:1.231;height:auto;background:none;} |
|
919 | 939 | .CodeMirror-scroll{overflow-y:hidden;overflow-x:auto;} |
|
920 | 940 | .CodeMirror-lines{padding:0.4em;} |
|
921 | 941 | .CodeMirror pre{padding:0;} |
|
922 | 942 | .ansiblack{color:#000000;} |
|
923 | 943 | .ansired{color:darkred;} |
|
924 | 944 | .ansigreen{color:darkgreen;} |
|
925 | 945 | .ansiyellow{color:brown;} |
|
926 | 946 | .ansiblue{color:darkblue;} |
|
927 | 947 | .ansipurple{color:darkviolet;} |
|
928 | 948 | .ansicyan{color:steelblue;} |
|
929 | 949 | .ansigrey{color:grey;} |
|
930 | 950 | .ansibold{font-weight:bold;} |
|
931 | 951 | .completions{position:absolute;z-index:10;overflow:hidden;border:1px solid #ababab;border-radius:4px;-webkit-box-shadow:0px 6px 10px -1px #adadad;-moz-box-shadow:0px 6px 10px -1px #adadad;box-shadow:0px 6px 10px -1px #adadad;} |
|
932 | 952 | .completions select{background:white;outline:none;border:none;padding:0px;margin:0px;overflow:auto;font-family:monospace;font-size:110%;color:#000000;} |
|
933 | 953 | .completions select option.context{color:#0064cd;} |
|
934 | 954 | pre.dialog{background-color:#f7f7f7;border:1px solid #ddd;border-radius:4px;padding:0.4em;padding-left:2em;} |
|
935 | 955 | p.dialog{padding:0.2em;} |
|
936 | 956 | .shortcut_key{display:inline-block;width:15ex;text-align:right;font-family:monospace;} |
|
937 | 957 | pre,code,kbd,samp{white-space:pre-wrap;} |
|
938 | 958 | #fonttest{font-family:monospace;} |
|
939 | 959 | .js-error{color:darkred;} |
|
940 | 960 | a{text-decoration:underline;} |
|
941 | 961 | p{margin-bottom:0;} |
|
942 | 962 | a.heading-anchor:link,a.heading-anchor:visited{text-decoration:none;color:inherit;} |
|
943 | 963 | div.raw_input{padding-top:0px;padding-bottom:0px;height:1em;line-height:1em;font-family:monospace;} |
|
944 | 964 | span.input_prompt{font-family:inherit;} |
|
945 | 965 | input.raw_input{font-family:inherit;font-size:inherit;color:inherit;width:auto;margin:-2px 0px 0px 1px;padding-left:1px;padding-top:2px;height:1em;} |
|
946 | 966 | p.p-space{margin-bottom:10px;} |
|
947 | 967 | .rendered_html{color:black;}.rendered_html em{font-style:italic;} |
|
948 | 968 | .rendered_html strong{font-weight:bold;} |
|
949 | 969 | .rendered_html u{text-decoration:underline;} |
|
950 | 970 | .rendered_html :link{text-decoration:underline;} |
|
951 | 971 | .rendered_html :visited{text-decoration:underline;} |
|
952 | 972 | .rendered_html h1{font-size:197%;margin:.65em 0;font-weight:bold;} |
|
953 | 973 | .rendered_html h2{font-size:153.9%;margin:.75em 0;font-weight:bold;} |
|
954 | 974 | .rendered_html h3{font-size:123.1%;margin:.85em 0;font-weight:bold;} |
|
955 | 975 | .rendered_html h4{font-size:100%;margin:0.95em 0;font-weight:bold;} |
|
956 | 976 | .rendered_html h5{font-size:85%;margin:1.5em 0;font-weight:bold;} |
|
957 | 977 | .rendered_html h6{font-size:77%;margin:1.65em 0;font-weight:bold;} |
|
958 | 978 | .rendered_html ul{list-style:disc;margin:1em 2em;} |
|
959 | 979 | .rendered_html ul ul{list-style:square;margin:0em 2em;} |
|
960 | 980 | .rendered_html ul ul ul{list-style:circle;margin:0em 2em;} |
|
961 | 981 | .rendered_html ol{list-style:decimal;margin:1em 2em;} |
|
962 | 982 | .rendered_html ol ol{list-style:upper-alpha;margin:0em 2em;} |
|
963 | 983 | .rendered_html ol ol ol{list-style:lower-alpha;margin:0em 2em;} |
|
964 | 984 | .rendered_html ol ol ol ol{list-style:lower-roman;margin:0em 2em;} |
|
965 | 985 | .rendered_html ol ol ol ol ol{list-style:decimal;margin:0em 2em;} |
|
966 | 986 | .rendered_html hr{color:black;background-color:black;} |
|
967 | 987 | .rendered_html pre{margin:1em 2em;} |
|
968 | 988 | .rendered_html blockquote{margin:1em 2em;} |
|
969 | 989 | .rendered_html table,.rendered_html tr,.rendered_html th,.rendered_html td{border:1px solid black;border-collapse:collapse;margin:1em 2em;} |
|
970 | 990 | .rendered_html td,.rendered_html th{text-align:left;vertical-align:middle;padding:4px;} |
|
971 | 991 | .rendered_html th{font-weight:bold;} |
|
972 | 992 | .rendered_html p{text-align:justify;} |
|
973 | 993 | .rendered_html p+p{margin-top:1em;} |
|
974 | 994 | .corner-all{border-radius:4px;} |
|
975 | 995 | @-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;} |
|
976 | 996 | .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;} |
|
977 | 997 | .tooltipbuttons{position:absolute;padding-right:15px;top:0px;right:0px;} |
|
978 | 998 | .tooltiptext{padding-right:30px;} |
|
979 | 999 | .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;z-index:2;}.ipython_tooltip a{float:right;} |
|
980 | 1000 | .pretooltiparrow{left:0px;margin:0px;top:-16px;width:40px;height:16px;overflow:hidden;position:absolute;} |
|
981 | 1001 | .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,99 +1,115 b'' | |||
|
1 | 1 | //---------------------------------------------------------------------------- |
|
2 | 2 | // Copyright (C) 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 | // On document ready |
|
10 | 10 | //============================================================================ |
|
11 | 11 | |
|
12 | 12 | |
|
13 | 13 | $(document).ready(function () { |
|
14 | 14 | |
|
15 | 15 | // monkey patch CM to be able to syntax highlight cell magics |
|
16 | 16 | // bug reported upstream, |
|
17 | 17 | // see https://github.com/marijnh/CodeMirror2/issues/670 |
|
18 | 18 | if(CodeMirror.getMode(1,'text/plain').indent == undefined ){ |
|
19 | 19 | console.log('patching CM for undefined indent'); |
|
20 | 20 | CodeMirror.modes.null = function() { return {token: function(stream) {stream.skipToEnd();},indent : function(){return 0}}} |
|
21 | 21 | } |
|
22 | 22 | |
|
23 | 23 | CodeMirror.patchedGetMode = function(config, mode){ |
|
24 | 24 | var cmmode = CodeMirror.getMode(config, mode); |
|
25 | 25 | if(cmmode.indent == null) |
|
26 | 26 | { |
|
27 | 27 | console.log('patch mode "' , mode, '" on the fly'); |
|
28 | 28 | cmmode.indent = function(){return 0}; |
|
29 | 29 | } |
|
30 | 30 | return cmmode; |
|
31 | 31 | } |
|
32 | 32 | // end monkey patching CodeMirror |
|
33 | 33 | |
|
34 | 34 | IPython.mathjaxutils.init(); |
|
35 | 35 | |
|
36 | 36 | IPython.read_only = $('body').data('readOnly') === 'True'; |
|
37 | 37 | $('#ipython-main-app').addClass('border-box-sizing'); |
|
38 | 38 | $('div#notebook_panel').addClass('border-box-sizing'); |
|
39 | 39 | // The header's bottom border is provided by the menu bar so we remove it. |
|
40 | 40 | $('div#header').css('border-bottom-style','none'); |
|
41 | 41 | |
|
42 | 42 | var baseProjectUrl = $('body').data('baseProjectUrl') |
|
43 | 43 | |
|
44 | 44 | IPython.page = new IPython.Page(); |
|
45 | IPython.markdown_converter = new Markdown.Converter(); | |
|
46 | 45 | IPython.layout_manager = new IPython.LayoutManager(); |
|
47 | 46 | IPython.pager = new IPython.Pager('div#pager', 'div#pager_splitter'); |
|
48 | 47 | IPython.quick_help = new IPython.QuickHelp('span#quick_help_area'); |
|
49 | 48 | IPython.login_widget = new IPython.LoginWidget('span#login_widget',{baseProjectUrl:baseProjectUrl}); |
|
50 | 49 | IPython.notebook = new IPython.Notebook('div#notebook',{baseProjectUrl:baseProjectUrl, read_only:IPython.read_only}); |
|
51 | 50 | IPython.save_widget = new IPython.SaveWidget('span#save_widget'); |
|
52 | 51 | IPython.menubar = new IPython.MenuBar('#menubar',{baseProjectUrl:baseProjectUrl}) |
|
53 | 52 | IPython.toolbar = new IPython.MainToolBar('#maintoolbar') |
|
54 | 53 | IPython.tooltip = new IPython.Tooltip() |
|
55 | 54 | IPython.notification_area = new IPython.NotificationArea('#notification_area') |
|
56 | 55 | IPython.notification_area.init_notification_widgets(); |
|
57 | 56 | |
|
58 | 57 | IPython.layout_manager.do_resize(); |
|
59 | 58 | |
|
60 | 59 | $('body').append('<div id="fonttest"><pre><span id="test1">x</span>'+ |
|
61 | 60 | '<span id="test2" style="font-weight: bold;">x</span>'+ |
|
62 | 61 | '<span id="test3" style="font-style: italic;">x</span></pre></div>') |
|
63 | 62 | var nh = $('#test1').innerHeight(); |
|
64 | 63 | var bh = $('#test2').innerHeight(); |
|
65 | 64 | var ih = $('#test3').innerHeight(); |
|
66 | 65 | if(nh != bh || nh != ih) { |
|
67 | 66 | $('head').append('<style>.CodeMirror span { vertical-align: bottom; }</style>'); |
|
68 | 67 | } |
|
69 | 68 | $('#fonttest').remove(); |
|
70 | 69 | |
|
71 | 70 | if(IPython.read_only){ |
|
72 | 71 | // hide various elements from read-only view |
|
73 | 72 | $('div#pager').remove(); |
|
74 | 73 | $('div#pager_splitter').remove(); |
|
75 | 74 | |
|
76 | 75 | // set the notebook name field as not modifiable |
|
77 | 76 | $('#notebook_name').attr('disabled','disabled') |
|
78 | 77 | } |
|
79 | 78 | |
|
80 | 79 | IPython.page.show(); |
|
81 | 80 | |
|
82 | 81 | IPython.layout_manager.do_resize(); |
|
83 | 82 | var first_load = function () { |
|
84 | 83 | IPython.layout_manager.do_resize(); |
|
85 | 84 | var hash = document.location.hash; |
|
86 | 85 | if (hash) { |
|
87 | 86 | document.location.hash = ''; |
|
88 | 87 | document.location.hash = hash; |
|
89 | 88 | } |
|
90 | 89 | IPython.notebook.set_autosave_interval(IPython.notebook.minimum_autosave_interval); |
|
91 | 90 | // only do this once |
|
92 | 91 | $([IPython.events]).off('notebook_loaded.Notebook', first_load); |
|
93 | 92 | }; |
|
94 | 93 | |
|
95 | 94 | $([IPython.events]).on('notebook_loaded.Notebook', first_load); |
|
96 | 95 | IPython.notebook.load_notebook($('body').data('notebookId')); |
|
96 | ||
|
97 | if (marked) { | |
|
98 | marked.setOptions({ | |
|
99 | gfm : true, | |
|
100 | tables: true, | |
|
101 | langPrefix: "language-", | |
|
102 | highlight: function(code, lang) { | |
|
103 | var highlighted; | |
|
104 | try { | |
|
105 | highlighted = hljs.highlight(lang, code, false); | |
|
106 | } catch(err) { | |
|
107 | highlighted = hljs.highlightAuto(code); | |
|
108 | } | |
|
109 | return highlighted.value; | |
|
110 | } | |
|
111 | }) | |
|
112 | } | |
|
97 | 113 | |
|
98 | 114 | }); |
|
99 | 115 |
@@ -1,161 +1,162 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 | // SaveWidget |
|
10 | 10 | //============================================================================ |
|
11 | 11 | |
|
12 | 12 | var IPython = (function (IPython) { |
|
13 | 13 | |
|
14 | 14 | var utils = IPython.utils; |
|
15 | 15 | |
|
16 | 16 | var SaveWidget = function (selector) { |
|
17 | 17 | this.selector = selector; |
|
18 | 18 | if (this.selector !== undefined) { |
|
19 | 19 | this.element = $(selector); |
|
20 | 20 | this.style(); |
|
21 | 21 | this.bind_events(); |
|
22 | 22 | } |
|
23 | 23 | }; |
|
24 | 24 | |
|
25 | 25 | |
|
26 | 26 | SaveWidget.prototype.style = function () { |
|
27 | 27 | this.element.find('span#save_widget').addClass('ui-widget'); |
|
28 | 28 | this.element.find('span#notebook_name').addClass('ui-widget'); |
|
29 | 29 | this.element.find('span#autosave_status').addClass('ui-widget') |
|
30 | 30 | .css({border: 'none'}); |
|
31 | 31 | this.element.find('span#checkpoint_status').addClass('ui-widget') |
|
32 | 32 | .css({border: 'none', 'margin-left': '20px'}); |
|
33 | 33 | }; |
|
34 | 34 | |
|
35 | 35 | |
|
36 | 36 | SaveWidget.prototype.bind_events = function () { |
|
37 | 37 | var that = this; |
|
38 | 38 | this.element.find('span#notebook_name').click(function () { |
|
39 | 39 | that.rename_notebook(); |
|
40 | 40 | }); |
|
41 | 41 | this.element.find('span#notebook_name').hover(function () { |
|
42 | 42 | $(this).addClass("ui-state-hover"); |
|
43 | 43 | }, function () { |
|
44 | 44 | $(this).removeClass("ui-state-hover"); |
|
45 | 45 | }); |
|
46 | 46 | $([IPython.events]).on('notebook_loaded.Notebook', function () { |
|
47 | 47 | that.set_last_saved(); |
|
48 | 48 | that.update_notebook_name(); |
|
49 | 49 | that.update_document_title(); |
|
50 | 50 | }); |
|
51 | 51 | $([IPython.events]).on('notebook_saved.Notebook', function () { |
|
52 | 52 | that.set_last_saved(); |
|
53 | 53 | that.update_notebook_name(); |
|
54 | 54 | that.update_document_title(); |
|
55 | 55 | }); |
|
56 | 56 | $([IPython.events]).on('notebook_save_failed.Notebook', function () { |
|
57 | 57 | that.set_save_status('Last Save Failed!'); |
|
58 | 58 | }); |
|
59 | 59 | $([IPython.events]).on('checkpoints_listed.Notebook', function (event, data) { |
|
60 | 60 | that.set_last_checkpoint(data[0]); |
|
61 | 61 | }); |
|
62 | 62 | |
|
63 | 63 | $([IPython.events]).on('checkpoint_created.Notebook', function (event, data) { |
|
64 | 64 | that.set_last_checkpoint(data); |
|
65 | 65 | }); |
|
66 | 66 | }; |
|
67 | 67 | |
|
68 | 68 | |
|
69 | 69 | SaveWidget.prototype.rename_notebook = function () { |
|
70 | 70 | var that = this; |
|
71 | 71 | var dialog = $('<div/>'); |
|
72 | 72 | dialog.append( |
|
73 | 73 | $('<p/>').html('Enter a new notebook name:') |
|
74 | 74 | .css({'margin-bottom': '10px'}) |
|
75 | 75 | ); |
|
76 | 76 | dialog.append( |
|
77 | 77 | $('<input/>').attr('type','text').attr('size','25') |
|
78 | 78 | .addClass('ui-widget ui-widget-content') |
|
79 | 79 | .attr('value',IPython.notebook.get_notebook_name()) |
|
80 | 80 | ); |
|
81 | 81 | // $(document).append(dialog); |
|
82 | 82 | dialog.dialog({ |
|
83 | 83 | resizable: false, |
|
84 | 84 | modal: true, |
|
85 | 85 | title: "Rename Notebook", |
|
86 | 86 | closeText: "", |
|
87 | 87 | close: function(event, ui) {$(this).dialog('destroy').remove();}, |
|
88 | 88 | buttons : { |
|
89 | 89 | "OK": function () { |
|
90 | 90 | var new_name = $(this).find('input').attr('value'); |
|
91 | 91 | if (!IPython.notebook.test_notebook_name(new_name)) { |
|
92 | 92 | $(this).find('h3').html( |
|
93 | 93 | "Invalid notebook name. Notebook names must "+ |
|
94 | 94 | "have 1 or more characters and can contain any characters " + |
|
95 | 95 | "except :/\\. Please enter a new notebook name:" |
|
96 | 96 | ); |
|
97 | 97 | } else { |
|
98 | 98 | IPython.notebook.set_notebook_name(new_name); |
|
99 | 99 | IPython.notebook.save_notebook(); |
|
100 | 100 | $(this).dialog('close'); |
|
101 | 101 | } |
|
102 | 102 | }, |
|
103 | 103 | "Cancel": function () { |
|
104 | 104 | $(this).dialog('close'); |
|
105 | 105 | } |
|
106 | 106 | }, |
|
107 | 107 | open : function (event, ui) { |
|
108 | 108 | var that = $(this); |
|
109 | 109 | // Upon ENTER, click the OK button. |
|
110 | 110 | that.find('input[type="text"]').keydown(function (event, ui) { |
|
111 | 111 | if (event.which === utils.keycodes.ENTER) { |
|
112 | 112 | that.parent().find('button').first().click(); |
|
113 | 113 | } |
|
114 | 114 | }); |
|
115 | 115 | } |
|
116 | 116 | }); |
|
117 | 117 | } |
|
118 | 118 | |
|
119 | 119 | |
|
120 | 120 | SaveWidget.prototype.update_notebook_name = function () { |
|
121 | 121 | var nbname = IPython.notebook.get_notebook_name(); |
|
122 | 122 | this.element.find('span#notebook_name').html(nbname); |
|
123 | 123 | }; |
|
124 | 124 | |
|
125 | 125 | |
|
126 | 126 | SaveWidget.prototype.update_document_title = function () { |
|
127 | 127 | var nbname = IPython.notebook.get_notebook_name(); |
|
128 | 128 | document.title = nbname; |
|
129 | 129 | }; |
|
130 | 130 | |
|
131 | 131 | |
|
132 | 132 | SaveWidget.prototype.set_save_status = function (msg) { |
|
133 | 133 | this.element.find('span#autosave_status').html(msg); |
|
134 | 134 | } |
|
135 | 135 | |
|
136 | 136 | SaveWidget.prototype.set_checkpoint_status = function (msg) { |
|
137 | 137 | this.element.find('span#checkpoint_status').html(msg); |
|
138 | 138 | } |
|
139 | 139 | |
|
140 | 140 | SaveWidget.prototype.set_last_checkpoint = function (checkpoint) { |
|
141 | 141 | if (!checkpoint) { |
|
142 | 142 | this.set_checkpoint_status(""); |
|
143 | return; | |
|
143 | 144 | } |
|
144 | 145 | var d = new Date(checkpoint.last_modified); |
|
145 | 146 | this.set_checkpoint_status( |
|
146 | 147 | "Last Checkpoint: " + d.format('mmm dd HH:MM') |
|
147 | 148 | ); |
|
148 | 149 | } |
|
149 | 150 | |
|
150 | 151 | SaveWidget.prototype.set_last_saved = function () { |
|
151 | 152 | var d = new Date(); |
|
152 | 153 | this.set_save_status('(autosaved: '+d.format('mmm dd HH:MM') + ')'); |
|
153 | 154 | }; |
|
154 | 155 | |
|
155 | 156 | |
|
156 | 157 | IPython.SaveWidget = SaveWidget; |
|
157 | 158 | |
|
158 | 159 | return IPython; |
|
159 | 160 | |
|
160 | 161 | }(IPython)); |
|
161 | 162 |
@@ -1,558 +1,546 b'' | |||
|
1 | 1 | //---------------------------------------------------------------------------- |
|
2 | 2 | // Copyright (C) 2008-2012 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 | // TextCell |
|
10 | 10 | //============================================================================ |
|
11 | 11 | |
|
12 | 12 | |
|
13 | 13 | |
|
14 | 14 | /** |
|
15 | 15 | A module that allow to create different type of Text Cell |
|
16 | 16 | @module IPython |
|
17 | 17 | @namespace IPython |
|
18 | 18 | */ |
|
19 | 19 | var IPython = (function (IPython) { |
|
20 | 20 | |
|
21 | 21 | // TextCell base class |
|
22 | 22 | var key = IPython.utils.keycodes; |
|
23 | 23 | |
|
24 | 24 | /** |
|
25 | 25 | * Construct a new TextCell, codemirror mode is by default 'htmlmixed', and cell type is 'text' |
|
26 | 26 | * cell start as not redered. |
|
27 | 27 | * |
|
28 | 28 | * @class TextCell |
|
29 | 29 | * @constructor TextCell |
|
30 | 30 | * @extend Ipython.Cell |
|
31 | 31 | * @param {object|undefined} [options] |
|
32 | 32 | * @param [options.cm_config] {object} config to pass to CodeMirror, will extend/overwrite default config |
|
33 | 33 | * @param [options.placeholder] {string} default string to use when souce in empty for rendering (only use in some TextCell subclass) |
|
34 | 34 | */ |
|
35 | 35 | var TextCell = function (options) { |
|
36 | 36 | // in all TextCell/Cell subclasses |
|
37 | 37 | // do not assign most of members here, just pass it down |
|
38 | 38 | // in the options dict potentially overwriting what you wish. |
|
39 | 39 | // they will be assigned in the base class. |
|
40 | 40 | |
|
41 | 41 | // we cannot put this as a class key as it has handle to "this". |
|
42 | 42 | var cm_overwrite_options = { |
|
43 | 43 | onKeyEvent: $.proxy(this.handle_codemirror_keyevent,this) |
|
44 | 44 | }; |
|
45 | 45 | |
|
46 | 46 | options = this.mergeopt(TextCell,options,{cm_config:cm_overwrite_options}); |
|
47 | 47 | |
|
48 | 48 | IPython.Cell.apply(this, [options]); |
|
49 | 49 | |
|
50 | 50 | |
|
51 | 51 | this.rendered = false; |
|
52 | 52 | this.cell_type = this.cell_type || 'text'; |
|
53 | 53 | }; |
|
54 | 54 | |
|
55 | 55 | TextCell.prototype = new IPython.Cell(); |
|
56 | 56 | |
|
57 | 57 | TextCell.options_default = { |
|
58 | 58 | cm_config : { |
|
59 | 59 | extraKeys: {"Tab": "indentMore","Shift-Tab" : "indentLess"}, |
|
60 | 60 | mode: 'htmlmixed', |
|
61 | 61 | lineWrapping : true, |
|
62 | 62 | } |
|
63 | 63 | }; |
|
64 | 64 | |
|
65 | 65 | |
|
66 | 66 | |
|
67 | 67 | /** |
|
68 | 68 | * Create the DOM element of the TextCell |
|
69 | 69 | * @method create_element |
|
70 | 70 | * @private |
|
71 | 71 | */ |
|
72 | 72 | TextCell.prototype.create_element = function () { |
|
73 | 73 | IPython.Cell.prototype.create_element.apply(this, arguments); |
|
74 | 74 | var cell = $("<div>").addClass('cell text_cell border-box-sizing'); |
|
75 | 75 | cell.attr('tabindex','2'); |
|
76 | 76 | |
|
77 | 77 | this.celltoolbar = new IPython.CellToolbar(this); |
|
78 | 78 | cell.append(this.celltoolbar.element); |
|
79 | 79 | |
|
80 | 80 | var input_area = $('<div/>').addClass('text_cell_input border-box-sizing'); |
|
81 | 81 | this.code_mirror = CodeMirror(input_area.get(0), this.cm_config); |
|
82 | 82 | |
|
83 | 83 | // The tabindex=-1 makes this div focusable. |
|
84 | 84 | var render_area = $('<div/>').addClass('text_cell_render border-box-sizing'). |
|
85 | 85 | addClass('rendered_html').attr('tabindex','-1'); |
|
86 | 86 | cell.append(input_area).append(render_area); |
|
87 | 87 | this.element = cell; |
|
88 | 88 | }; |
|
89 | 89 | |
|
90 | 90 | |
|
91 | 91 | /** |
|
92 | 92 | * Bind the DOM evet to cell actions |
|
93 | 93 | * Need to be called after TextCell.create_element |
|
94 | 94 | * @private |
|
95 | 95 | * @method bind_event |
|
96 | 96 | */ |
|
97 | 97 | TextCell.prototype.bind_events = function () { |
|
98 | 98 | IPython.Cell.prototype.bind_events.apply(this); |
|
99 | 99 | var that = this; |
|
100 | 100 | this.element.keydown(function (event) { |
|
101 | 101 | if (event.which === 13 && !event.shiftKey) { |
|
102 | 102 | if (that.rendered) { |
|
103 | 103 | that.edit(); |
|
104 | 104 | return false; |
|
105 | 105 | }; |
|
106 | 106 | }; |
|
107 | 107 | }); |
|
108 | 108 | this.element.dblclick(function () { |
|
109 | 109 | that.edit(); |
|
110 | 110 | }); |
|
111 | 111 | }; |
|
112 | 112 | |
|
113 | 113 | /** |
|
114 | 114 | * This method gets called in CodeMirror's onKeyDown/onKeyPress |
|
115 | 115 | * handlers and is used to provide custom key handling. |
|
116 | 116 | * |
|
117 | 117 | * Subclass should override this method to have custom handeling |
|
118 | 118 | * |
|
119 | 119 | * @method handle_codemirror_keyevent |
|
120 | 120 | * @param {CodeMirror} editor - The codemirror instance bound to the cell |
|
121 | 121 | * @param {event} event - |
|
122 | 122 | * @return {Boolean} `true` if CodeMirror should ignore the event, `false` Otherwise |
|
123 | 123 | */ |
|
124 | 124 | TextCell.prototype.handle_codemirror_keyevent = function (editor, event) { |
|
125 | 125 | |
|
126 | 126 | if (event.keyCode === 13 && (event.shiftKey || event.ctrlKey)) { |
|
127 | 127 | // Always ignore shift-enter in CodeMirror as we handle it. |
|
128 | 128 | return true; |
|
129 | 129 | } |
|
130 | 130 | return false; |
|
131 | 131 | }; |
|
132 | 132 | |
|
133 | 133 | /** |
|
134 | 134 | * Select the current cell and trigger 'focus' |
|
135 | 135 | * @method select |
|
136 | 136 | */ |
|
137 | 137 | TextCell.prototype.select = function () { |
|
138 | 138 | IPython.Cell.prototype.select.apply(this); |
|
139 | 139 | var output = this.element.find("div.text_cell_render"); |
|
140 | 140 | output.trigger('focus'); |
|
141 | 141 | }; |
|
142 | 142 | |
|
143 | 143 | /** |
|
144 | 144 | * unselect the current cell and `render` it |
|
145 | 145 | * @method unselect |
|
146 | 146 | */ |
|
147 | 147 | TextCell.prototype.unselect = function() { |
|
148 | 148 | // render on selection of another cell |
|
149 | 149 | this.render(); |
|
150 | 150 | IPython.Cell.prototype.unselect.apply(this); |
|
151 | 151 | }; |
|
152 | 152 | |
|
153 | 153 | /** |
|
154 | 154 | * |
|
155 | 155 | * put the current cell in edition mode |
|
156 | 156 | * @method edit |
|
157 | 157 | */ |
|
158 | 158 | TextCell.prototype.edit = function () { |
|
159 | 159 | if ( this.read_only ) return; |
|
160 | 160 | if (this.rendered === true) { |
|
161 | 161 | var text_cell = this.element; |
|
162 | 162 | var output = text_cell.find("div.text_cell_render"); |
|
163 | 163 | output.hide(); |
|
164 | 164 | text_cell.find('div.text_cell_input').show(); |
|
165 | 165 | this.code_mirror.refresh(); |
|
166 | 166 | this.code_mirror.focus(); |
|
167 | 167 | // We used to need an additional refresh() after the focus, but |
|
168 | 168 | // it appears that this has been fixed in CM. This bug would show |
|
169 | 169 | // up on FF when a newly loaded markdown cell was edited. |
|
170 | 170 | this.rendered = false; |
|
171 | 171 | if (this.get_text() === this.placeholder) { |
|
172 | 172 | this.set_text(''); |
|
173 | 173 | this.refresh(); |
|
174 | 174 | } |
|
175 | 175 | } |
|
176 | 176 | }; |
|
177 | 177 | |
|
178 | 178 | |
|
179 | 179 | /** |
|
180 | 180 | * Empty, Subclasses must define render. |
|
181 | 181 | * @method render |
|
182 | 182 | */ |
|
183 | 183 | TextCell.prototype.render = function () {}; |
|
184 | 184 | |
|
185 | 185 | |
|
186 | 186 | /** |
|
187 | 187 | * setter: {{#crossLink "TextCell/set_text"}}{{/crossLink}} |
|
188 | 188 | * @method get_text |
|
189 | 189 | * @retrun {string} CodeMirror current text value |
|
190 | 190 | */ |
|
191 | 191 | TextCell.prototype.get_text = function() { |
|
192 | 192 | return this.code_mirror.getValue(); |
|
193 | 193 | }; |
|
194 | 194 | |
|
195 | 195 | /** |
|
196 | 196 | * @param {string} text - Codemiror text value |
|
197 | 197 | * @see TextCell#get_text |
|
198 | 198 | * @method set_text |
|
199 | 199 | * */ |
|
200 | 200 | TextCell.prototype.set_text = function(text) { |
|
201 | 201 | this.code_mirror.setValue(text); |
|
202 | 202 | this.code_mirror.refresh(); |
|
203 | 203 | }; |
|
204 | 204 | |
|
205 | 205 | /** |
|
206 | 206 | * setter :{{#crossLink "TextCell/set_rendered"}}{{/crossLink}} |
|
207 | 207 | * @method get_rendered |
|
208 | 208 | * @return {html} html of rendered element |
|
209 | 209 | * */ |
|
210 | 210 | TextCell.prototype.get_rendered = function() { |
|
211 | 211 | return this.element.find('div.text_cell_render').html(); |
|
212 | 212 | }; |
|
213 | 213 | |
|
214 | 214 | /** |
|
215 | 215 | * @method set_rendered |
|
216 | 216 | */ |
|
217 | 217 | TextCell.prototype.set_rendered = function(text) { |
|
218 | 218 | this.element.find('div.text_cell_render').html(text); |
|
219 | 219 | }; |
|
220 | 220 | |
|
221 | 221 | /** |
|
222 | 222 | * not deprecated, but implementation wrong |
|
223 | 223 | * @method at_top |
|
224 | 224 | * @deprecated |
|
225 | 225 | * @return {Boolean} true is cell rendered, false otherwise |
|
226 | 226 | * I doubt this is what it is supposed to do |
|
227 | 227 | * this implementation is completly false |
|
228 | 228 | */ |
|
229 | 229 | TextCell.prototype.at_top = function () { |
|
230 | 230 | if (this.rendered) { |
|
231 | 231 | return true; |
|
232 | 232 | } else { |
|
233 | 233 | return false; |
|
234 | 234 | } |
|
235 | 235 | }; |
|
236 | 236 | |
|
237 | 237 | |
|
238 | 238 | /** |
|
239 | 239 | * not deprecated, but implementation wrong |
|
240 | 240 | * @method at_bottom |
|
241 | 241 | * @deprecated |
|
242 | 242 | * @return {Boolean} true is cell rendered, false otherwise |
|
243 | 243 | * I doubt this is what it is supposed to do |
|
244 | 244 | * this implementation is completly false |
|
245 | 245 | * */ |
|
246 | 246 | TextCell.prototype.at_bottom = function () { |
|
247 | 247 | if (this.rendered) { |
|
248 | 248 | return true; |
|
249 | 249 | } else { |
|
250 | 250 | return false; |
|
251 | 251 | } |
|
252 | 252 | }; |
|
253 | 253 | |
|
254 | 254 | /** |
|
255 | 255 | * Create Text cell from JSON |
|
256 | 256 | * @param {json} data - JSON serialized text-cell |
|
257 | 257 | * @method fromJSON |
|
258 | 258 | */ |
|
259 | 259 | TextCell.prototype.fromJSON = function (data) { |
|
260 | 260 | IPython.Cell.prototype.fromJSON.apply(this, arguments); |
|
261 | 261 | if (data.cell_type === this.cell_type) { |
|
262 | 262 | if (data.source !== undefined) { |
|
263 | 263 | this.set_text(data.source); |
|
264 | 264 | // make this value the starting point, so that we can only undo |
|
265 | 265 | // to this state, instead of a blank cell |
|
266 | 266 | this.code_mirror.clearHistory(); |
|
267 | 267 | this.set_rendered(data.rendered || ''); |
|
268 | 268 | this.rendered = false; |
|
269 | 269 | this.render(); |
|
270 | 270 | } |
|
271 | 271 | } |
|
272 | 272 | }; |
|
273 | 273 | |
|
274 | 274 | /** Generate JSON from cell |
|
275 | 275 | * @return {object} cell data serialised to json |
|
276 | 276 | */ |
|
277 | 277 | TextCell.prototype.toJSON = function () { |
|
278 | 278 | var data = IPython.Cell.prototype.toJSON.apply(this); |
|
279 | 279 | data.cell_type = this.cell_type; |
|
280 | 280 | data.source = this.get_text(); |
|
281 | 281 | return data; |
|
282 | 282 | }; |
|
283 | 283 | |
|
284 | 284 | |
|
285 | 285 | /** |
|
286 | 286 | * @class MarkdownCell |
|
287 | 287 | * @constructor MarkdownCell |
|
288 | 288 | * @extends Ipython.HtmlCell |
|
289 | 289 | */ |
|
290 | 290 | var MarkdownCell = function (options) { |
|
291 | 291 | var options = options || {}; |
|
292 | 292 | |
|
293 | 293 | options = this.mergeopt(MarkdownCell,options); |
|
294 | 294 | TextCell.apply(this, [options]); |
|
295 | 295 | |
|
296 | 296 | this.cell_type = 'markdown'; |
|
297 | 297 | }; |
|
298 | 298 | |
|
299 | 299 | MarkdownCell.options_default = { |
|
300 | 300 | cm_config: { |
|
301 |
mode: 'm |
|
|
301 | mode: 'gfm' | |
|
302 | 302 | }, |
|
303 | 303 | placeholder: "Type *Markdown* and LaTeX: $\\alpha^2$" |
|
304 | 304 | } |
|
305 | 305 | |
|
306 | 306 | |
|
307 | 307 | |
|
308 | 308 | |
|
309 | 309 | MarkdownCell.prototype = new TextCell(); |
|
310 | 310 | |
|
311 | 311 | /** |
|
312 | 312 | * @method render |
|
313 | 313 | */ |
|
314 | 314 | MarkdownCell.prototype.render = function () { |
|
315 | 315 | if (this.rendered === false) { |
|
316 | 316 | var text = this.get_text(); |
|
317 | 317 | if (text === "") { text = this.placeholder; } |
|
318 | text = IPython.mathjaxutils.remove_math(text) | |
|
319 |
var html = |
|
|
320 | html = IPython.mathjaxutils.replace_math(html) | |
|
318 | text = IPython.mathjaxutils.remove_math(text); | |
|
319 | var html = marked.parser(marked.lexer(text)); | |
|
320 | html = IPython.mathjaxutils.replace_math(html); | |
|
321 | 321 | try { |
|
322 | 322 | this.set_rendered(html); |
|
323 | 323 | } catch (e) { |
|
324 | 324 | console.log("Error running Javascript in Markdown:"); |
|
325 | 325 | console.log(e); |
|
326 | 326 | this.set_rendered($("<div/>").addClass("js-error").html( |
|
327 | 327 | "Error rendering Markdown!<br/>" + e.toString()) |
|
328 | 328 | ); |
|
329 | 329 | } |
|
330 | 330 | this.element.find('div.text_cell_input').hide(); |
|
331 | 331 | this.element.find("div.text_cell_render").show(); |
|
332 | var code_snippets = this.element.find("pre > code"); | |
|
333 | code_snippets.replaceWith(function () { | |
|
334 | var code = $(this).html(); | |
|
335 | /* Substitute br for newlines and for spaces | |
|
336 | before highlighting, since prettify doesn't | |
|
337 | preserve those on all browsers */ | |
|
338 | code = code.replace(/(\r\n|\n|\r)/gm, "<br/>"); | |
|
339 | code = code.replace(/ /gm, ' '); | |
|
340 | code = prettyPrintOne(code); | |
|
341 | ||
|
342 | return '<code class="prettyprint">' + code + '</code>'; | |
|
343 | }); | |
|
344 | 332 | this.typeset() |
|
345 | 333 | this.rendered = true; |
|
346 | 334 | } |
|
347 | 335 | }; |
|
348 | 336 | |
|
349 | 337 | |
|
350 | 338 | // RawCell |
|
351 | 339 | |
|
352 | 340 | /** |
|
353 | 341 | * @class RawCell |
|
354 | 342 | * @constructor RawCell |
|
355 | 343 | * @extends Ipython.TextCell |
|
356 | 344 | */ |
|
357 | 345 | var RawCell = function (options) { |
|
358 | 346 | |
|
359 | 347 | options = this.mergeopt(RawCell,options) |
|
360 | 348 | TextCell.apply(this, [options]); |
|
361 | 349 | |
|
362 | 350 | this.cell_type = 'raw'; |
|
363 | 351 | |
|
364 | 352 | var that = this |
|
365 | 353 | this.element.focusout( |
|
366 | 354 | function() { that.auto_highlight(); } |
|
367 | 355 | ); |
|
368 | 356 | }; |
|
369 | 357 | |
|
370 | 358 | RawCell.options_default = { |
|
371 | 359 | placeholder : "Type plain text and LaTeX: $\\alpha^2$" |
|
372 | 360 | }; |
|
373 | 361 | |
|
374 | 362 | |
|
375 | 363 | |
|
376 | 364 | RawCell.prototype = new TextCell(); |
|
377 | 365 | |
|
378 | 366 | /** |
|
379 | 367 | * Trigger autodetection of highlight scheme for current cell |
|
380 | 368 | * @method auto_highlight |
|
381 | 369 | */ |
|
382 | 370 | RawCell.prototype.auto_highlight = function () { |
|
383 | 371 | this._auto_highlight(IPython.config.raw_cell_highlight); |
|
384 | 372 | }; |
|
385 | 373 | |
|
386 | 374 | /** @method render **/ |
|
387 | 375 | RawCell.prototype.render = function () { |
|
388 | 376 | this.rendered = true; |
|
389 | 377 | this.edit(); |
|
390 | 378 | }; |
|
391 | 379 | |
|
392 | 380 | |
|
393 | 381 | /** @method handle_codemirror_keyevent **/ |
|
394 | 382 | RawCell.prototype.handle_codemirror_keyevent = function (editor, event) { |
|
395 | 383 | |
|
396 | 384 | var that = this; |
|
397 | 385 | if (event.which === key.UPARROW && event.type === 'keydown') { |
|
398 | 386 | // If we are not at the top, let CM handle the up arrow and |
|
399 | 387 | // prevent the global keydown handler from handling it. |
|
400 | 388 | if (!that.at_top()) { |
|
401 | 389 | event.stop(); |
|
402 | 390 | return false; |
|
403 | 391 | } else { |
|
404 | 392 | return true; |
|
405 | 393 | }; |
|
406 | 394 | } else if (event.which === key.DOWNARROW && event.type === 'keydown') { |
|
407 | 395 | // If we are not at the bottom, let CM handle the down arrow and |
|
408 | 396 | // prevent the global keydown handler from handling it. |
|
409 | 397 | if (!that.at_bottom()) { |
|
410 | 398 | event.stop(); |
|
411 | 399 | return false; |
|
412 | 400 | } else { |
|
413 | 401 | return true; |
|
414 | 402 | }; |
|
415 | 403 | }; |
|
416 | 404 | return false; |
|
417 | 405 | }; |
|
418 | 406 | |
|
419 | 407 | /** @method select **/ |
|
420 | 408 | RawCell.prototype.select = function () { |
|
421 | 409 | IPython.Cell.prototype.select.apply(this); |
|
422 | 410 | this.code_mirror.refresh(); |
|
423 | 411 | this.code_mirror.focus(); |
|
424 | 412 | }; |
|
425 | 413 | |
|
426 | 414 | /** @method at_top **/ |
|
427 | 415 | RawCell.prototype.at_top = function () { |
|
428 | 416 | var cursor = this.code_mirror.getCursor(); |
|
429 | 417 | if (cursor.line === 0 && cursor.ch === 0) { |
|
430 | 418 | return true; |
|
431 | 419 | } else { |
|
432 | 420 | return false; |
|
433 | 421 | } |
|
434 | 422 | }; |
|
435 | 423 | |
|
436 | 424 | |
|
437 | 425 | /** @method at_bottom **/ |
|
438 | 426 | RawCell.prototype.at_bottom = function () { |
|
439 | 427 | var cursor = this.code_mirror.getCursor(); |
|
440 | 428 | if (cursor.line === (this.code_mirror.lineCount()-1) && cursor.ch === this.code_mirror.getLine(cursor.line).length) { |
|
441 | 429 | return true; |
|
442 | 430 | } else { |
|
443 | 431 | return false; |
|
444 | 432 | } |
|
445 | 433 | }; |
|
446 | 434 | |
|
447 | 435 | |
|
448 | 436 | /** |
|
449 | 437 | * @class HeadingCell |
|
450 | 438 | * @extends Ipython.TextCell |
|
451 | 439 | */ |
|
452 | 440 | |
|
453 | 441 | /** |
|
454 | 442 | * @constructor HeadingCell |
|
455 | 443 | * @extends Ipython.TextCell |
|
456 | 444 | */ |
|
457 | 445 | var HeadingCell = function (options) { |
|
458 | 446 | |
|
459 | 447 | options = this.mergeopt(HeadingCell,options) |
|
460 | 448 | TextCell.apply(this, [options]); |
|
461 | 449 | |
|
462 | 450 | /** |
|
463 | 451 | * heading level of the cell, use getter and setter to access |
|
464 | 452 | * @property level |
|
465 | 453 | */ |
|
466 | 454 | this.level = 1; |
|
467 | 455 | this.cell_type = 'heading'; |
|
468 | 456 | }; |
|
469 | 457 | |
|
470 | 458 | HeadingCell.options_default = { |
|
471 | 459 | placeholder: "Type Heading Here" |
|
472 | 460 | }; |
|
473 | 461 | |
|
474 | 462 | HeadingCell.prototype = new TextCell(); |
|
475 | 463 | |
|
476 | 464 | /** @method fromJSON */ |
|
477 | 465 | HeadingCell.prototype.fromJSON = function (data) { |
|
478 | 466 | if (data.level != undefined){ |
|
479 | 467 | this.level = data.level; |
|
480 | 468 | } |
|
481 | 469 | TextCell.prototype.fromJSON.apply(this, arguments); |
|
482 | 470 | }; |
|
483 | 471 | |
|
484 | 472 | |
|
485 | 473 | /** @method toJSON */ |
|
486 | 474 | HeadingCell.prototype.toJSON = function () { |
|
487 | 475 | var data = TextCell.prototype.toJSON.apply(this); |
|
488 | 476 | data.level = this.get_level(); |
|
489 | 477 | return data; |
|
490 | 478 | }; |
|
491 | 479 | |
|
492 | 480 | |
|
493 | 481 | /** |
|
494 | 482 | * Change heading level of cell, and re-render |
|
495 | 483 | * @method set_level |
|
496 | 484 | */ |
|
497 | 485 | HeadingCell.prototype.set_level = function (level) { |
|
498 | 486 | this.level = level; |
|
499 | 487 | if (this.rendered) { |
|
500 | 488 | this.rendered = false; |
|
501 | 489 | this.render(); |
|
502 | 490 | }; |
|
503 | 491 | }; |
|
504 | 492 | |
|
505 | 493 | /** The depth of header cell, based on html (h1 to h6) |
|
506 | 494 | * @method get_level |
|
507 | 495 | * @return {integer} level - for 1 to 6 |
|
508 | 496 | */ |
|
509 | 497 | HeadingCell.prototype.get_level = function () { |
|
510 | 498 | return this.level; |
|
511 | 499 | }; |
|
512 | 500 | |
|
513 | 501 | |
|
514 | 502 | HeadingCell.prototype.set_rendered = function (text) { |
|
515 | 503 | var r = this.element.find("div.text_cell_render"); |
|
516 | 504 | r.empty(); |
|
517 | 505 | var link = text.replace(/ /g, '_'); |
|
518 | 506 | r.append( |
|
519 | 507 | $('<h'+this.level+'/>') |
|
520 | 508 | .append( |
|
521 | 509 | $('<a/>') |
|
522 | 510 | .addClass('heading-anchor') |
|
523 | 511 | .attr('href', '#' + link) |
|
524 | 512 | .attr('id', link) |
|
525 | 513 | .html(text) |
|
526 | 514 | ) |
|
527 | 515 | ); |
|
528 | 516 | }; |
|
529 | 517 | |
|
530 | 518 | |
|
531 | 519 | HeadingCell.prototype.get_rendered = function () { |
|
532 | 520 | var r = this.element.find("div.text_cell_render"); |
|
533 | 521 | return r.children().first().html(); |
|
534 | 522 | }; |
|
535 | 523 | |
|
536 | 524 | |
|
537 | 525 | HeadingCell.prototype.render = function () { |
|
538 | 526 | if (this.rendered === false) { |
|
539 | 527 | var text = this.get_text(); |
|
540 | 528 | if (text === "") { text = this.placeholder; } |
|
541 | 529 | this.set_rendered(text); |
|
542 | 530 | this.typeset(); |
|
543 | 531 | this.element.find('div.text_cell_input').hide(); |
|
544 | 532 | this.element.find("div.text_cell_render").show(); |
|
545 | 533 | this.rendered = true; |
|
546 | 534 | }; |
|
547 | 535 | }; |
|
548 | 536 | |
|
549 | 537 | IPython.TextCell = TextCell; |
|
550 | 538 | IPython.MarkdownCell = MarkdownCell; |
|
551 | 539 | IPython.RawCell = RawCell; |
|
552 | 540 | IPython.HeadingCell = HeadingCell; |
|
553 | 541 | |
|
554 | 542 | |
|
555 | 543 | return IPython; |
|
556 | 544 | |
|
557 | 545 | }(IPython)); |
|
558 | 546 |
@@ -1,513 +1,513 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 | @import "highlight.less"; | |
|
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#checkpoint_status span#autosave_status { |
|
31 | 31 | font-size: small; |
|
32 | 32 | } |
|
33 | 33 | |
|
34 | 34 | /*span#save_widget > span#autosave_status { |
|
35 | 35 | font-size: x-small; |
|
36 | 36 | } |
|
37 | 37 | */ |
|
38 | 38 | span#notebook_name { |
|
39 | 39 | height: 1em; |
|
40 | 40 | line-height: 1em; |
|
41 | 41 | padding: 3px; |
|
42 | 42 | border: none; |
|
43 | 43 | font-size: 146.5%; |
|
44 | 44 | } |
|
45 | 45 | |
|
46 | 46 | |
|
47 | 47 | .ui-menubar-item .ui-button .ui-button-text { |
|
48 | 48 | padding: 0.4em 1.0em; |
|
49 | 49 | font-size: 100%; |
|
50 | 50 | } |
|
51 | 51 | |
|
52 | 52 | .ui-menu { |
|
53 | 53 | .box-shadow(0px 6px 10px -1px #adadad); |
|
54 | 54 | } |
|
55 | 55 | |
|
56 | 56 | .ui-menu .ui-menu-item a { |
|
57 | 57 | border: 1px solid transparent; |
|
58 | 58 | padding: 2px 1.6em; |
|
59 | 59 | } |
|
60 | 60 | |
|
61 | 61 | .ui-menu .ui-menu-item a.ui-state-focus { |
|
62 | 62 | margin: 0; |
|
63 | 63 | } |
|
64 | 64 | |
|
65 | 65 | .ui-menu hr { |
|
66 | 66 | margin: 0.3em 0; |
|
67 | 67 | } |
|
68 | 68 | |
|
69 | 69 | #menubar_container { |
|
70 | 70 | position: relative; |
|
71 | 71 | } |
|
72 | 72 | |
|
73 | 73 | #notification_area { |
|
74 | 74 | position: absolute; |
|
75 | 75 | right: 0px; |
|
76 | 76 | top: 0px; |
|
77 | 77 | height: 25px; |
|
78 | 78 | padding: 3px 0px; |
|
79 | 79 | padding-right: 3px; |
|
80 | 80 | z-index: 10; |
|
81 | 81 | } |
|
82 | 82 | |
|
83 | 83 | .notification_widget{ |
|
84 | 84 | float : right; |
|
85 | 85 | right: 0px; |
|
86 | 86 | top: 1px; |
|
87 | 87 | height: 25px; |
|
88 | 88 | padding: 3px 6px; |
|
89 | 89 | z-index: 10; |
|
90 | 90 | } |
|
91 | 91 | |
|
92 | 92 | .toolbar { |
|
93 | 93 | padding: 3px 15px; |
|
94 | 94 | border-bottom: @borderwidth @border_color solid; |
|
95 | 95 | |
|
96 | 96 | button { |
|
97 | 97 | margin-top:2px; |
|
98 | 98 | margin-bottom:2px; |
|
99 | 99 | } |
|
100 | 100 | |
|
101 | 101 | |
|
102 | 102 | select, label { |
|
103 | 103 | height : 19px; |
|
104 | 104 | vertical-align:middle; |
|
105 | 105 | margin-right:2px; |
|
106 | 106 | margin-bottom:0; |
|
107 | 107 | display: inline; |
|
108 | 108 | font-size: 92%; |
|
109 | 109 | margin-left:0.3em; |
|
110 | 110 | margin-right:0.3em; |
|
111 | 111 | padding: 0px; |
|
112 | 112 | } |
|
113 | 113 | } |
|
114 | 114 | |
|
115 | 115 | .toolbar select{ |
|
116 | 116 | width:auto; |
|
117 | 117 | } |
|
118 | 118 | |
|
119 | 119 | |
|
120 | 120 | #ipython-main-app { |
|
121 | 121 | width: 100%; |
|
122 | 122 | position: relative; |
|
123 | 123 | font-size: 110%; |
|
124 | 124 | } |
|
125 | 125 | |
|
126 | 126 | span#quick_help_area { |
|
127 | 127 | position: static; |
|
128 | 128 | padding: 5px 0px; |
|
129 | 129 | margin: 0px 0px 0px 0px; |
|
130 | 130 | } |
|
131 | 131 | |
|
132 | 132 | .help_string { |
|
133 | 133 | float: right; |
|
134 | 134 | width: 170px; |
|
135 | 135 | padding: 0px 5px; |
|
136 | 136 | text-align: left; |
|
137 | 137 | font-size: 85%; |
|
138 | 138 | } |
|
139 | 139 | |
|
140 | 140 | .help_string_label { |
|
141 | 141 | float: right; |
|
142 | 142 | font-size: 85%; |
|
143 | 143 | } |
|
144 | 144 | |
|
145 | 145 | div#notebook_panel { |
|
146 | 146 | margin: 0px 0px 0px 0px; |
|
147 | 147 | padding: 0px; |
|
148 | 148 | } |
|
149 | 149 | |
|
150 | 150 | div#notebook { |
|
151 | 151 | overflow-y: scroll; |
|
152 | 152 | overflow-x: auto; |
|
153 | 153 | width: 100%; |
|
154 | 154 | /* This spaces the cell away from the edge of the notebook area */ |
|
155 | 155 | padding: 5px 5px 15px 5px; |
|
156 | 156 | margin: 0px; |
|
157 | 157 | } |
|
158 | 158 | |
|
159 | 159 | div#pager_splitter { |
|
160 | 160 | height: 8px; |
|
161 | 161 | } |
|
162 | 162 | |
|
163 | 163 | #pager_container { |
|
164 | 164 | position : relative; |
|
165 | 165 | } |
|
166 | 166 | |
|
167 | 167 | div#pager { |
|
168 | 168 | padding: 15px; |
|
169 | 169 | overflow: auto; |
|
170 | 170 | display: none; |
|
171 | 171 | } |
|
172 | 172 | |
|
173 | 173 | div.ui-widget-content { |
|
174 | 174 | border: 1px solid @border_color; |
|
175 | 175 | outline: none; |
|
176 | 176 | } |
|
177 | 177 | |
|
178 | 178 | .cell { |
|
179 | 179 | border: 1px solid transparent; |
|
180 | 180 | .vbox(); |
|
181 | 181 | |
|
182 | 182 | &.selected { |
|
183 | 183 | .corner-all; |
|
184 | 184 | border : thin @border_color solid; |
|
185 | 185 | } |
|
186 | 186 | } |
|
187 | 187 | |
|
188 | 188 | div.cell { |
|
189 | 189 | width: 100%; |
|
190 | 190 | padding: 5px 5px 5px 0px; |
|
191 | 191 | /* This acts as a spacer between cells, that is outside the border */ |
|
192 | 192 | margin: 2px 0px 2px 0px; |
|
193 | 193 | outline: none; |
|
194 | 194 | } |
|
195 | 195 | |
|
196 | 196 | div.code_cell { |
|
197 | 197 | } |
|
198 | 198 | |
|
199 | 199 | /* any special styling for code cells that are currently running goes here */ |
|
200 | 200 | div.code_cell.running { |
|
201 | 201 | } |
|
202 | 202 | |
|
203 | 203 | div.prompt { |
|
204 | 204 | /* This needs to be wide enough for 3 digit prompt numbers: In[100]: */ |
|
205 | 205 | width: 11ex; |
|
206 | 206 | /* This 0.4em is tuned to match the padding on the CodeMirror editor. */ |
|
207 | 207 | padding: 0.4em; |
|
208 | 208 | margin: 0px; |
|
209 | 209 | font-family: monospace; |
|
210 | 210 | text-align: right; |
|
211 | 211 | /* This has to match that of the the CodeMirror class line-height below */ |
|
212 | 212 | line-height: 1.231; |
|
213 | 213 | } |
|
214 | 214 | |
|
215 | 215 | div.input { |
|
216 | 216 | page-break-inside: avoid; |
|
217 | 217 | .hbox(); |
|
218 | 218 | } |
|
219 | 219 | |
|
220 | 220 | /* input_area and input_prompt must match in top border and margin for alignment */ |
|
221 | 221 | div.input_area { |
|
222 | 222 | /*color: @fontBaseColor;*/ |
|
223 | 223 | border: 1px solid @light_border_color; |
|
224 | 224 | .corner-all; |
|
225 | 225 | background: @cell_background; |
|
226 | 226 | } |
|
227 | 227 | |
|
228 | 228 | div.input_prompt { |
|
229 | 229 | color: navy; |
|
230 | 230 | border-top: 1px solid transparent; |
|
231 | 231 | } |
|
232 | 232 | |
|
233 | 233 | div.output_wrapper { |
|
234 | 234 | /* This is a spacer between the input and output of each cell */ |
|
235 | 235 | margin-top: 5px; |
|
236 | 236 | margin-left: 5px; |
|
237 | 237 | /* FF needs explicit width to stretch */ |
|
238 | 238 | width: 100%; |
|
239 | 239 | /* this position must be relative to enable descendents to be absolute within it */ |
|
240 | 240 | position: relative; |
|
241 | 241 | } |
|
242 | 242 | |
|
243 | 243 | /* class for the output area when it should be height-limited */ |
|
244 | 244 | div.output_scroll { |
|
245 | 245 | /* ideally, this would be max-height, but FF barfs all over that */ |
|
246 | 246 | height: 24em; |
|
247 | 247 | /* FF needs this *and the wrapper* to specify full width, or it will shrinkwrap */ |
|
248 | 248 | width: 100%; |
|
249 | 249 | |
|
250 | 250 | overflow: auto; |
|
251 | 251 | .corner-all; |
|
252 | 252 | .box-shadow(inset 0 2px 8px rgba(0, 0, 0, .8)); |
|
253 | 253 | } |
|
254 | 254 | |
|
255 | 255 | /* output div while it is collapsed */ |
|
256 | 256 | div.output_collapsed { |
|
257 | 257 | margin-right: 5px; |
|
258 | 258 | } |
|
259 | 259 | |
|
260 | 260 | div.out_prompt_overlay { |
|
261 | 261 | height: 100%; |
|
262 | 262 | padding: 0px; |
|
263 | 263 | position: absolute; |
|
264 | 264 | .corner-all; |
|
265 | 265 | } |
|
266 | 266 | |
|
267 | 267 | div.out_prompt_overlay:hover { |
|
268 | 268 | /* use inner shadow to get border that is computed the same on WebKit/FF */ |
|
269 | 269 | .box-shadow(inset 0 0 1px #000); |
|
270 | 270 | background: rgba(240, 240, 240, 0.5); |
|
271 | 271 | } |
|
272 | 272 | |
|
273 | 273 | div.output_prompt { |
|
274 | 274 | color: darkred; |
|
275 | 275 | /* 5px right shift to account for margin in parent container */ |
|
276 | 276 | margin: 0 5px 0 -5px; |
|
277 | 277 | } |
|
278 | 278 | |
|
279 | 279 | /* This class is the outer container of all output sections. */ |
|
280 | 280 | div.output_area { |
|
281 | 281 | padding: 0px; |
|
282 | 282 | page-break-inside: avoid; |
|
283 | 283 | .hbox(); |
|
284 | 284 | } |
|
285 | 285 | |
|
286 | 286 | |
|
287 | 287 | /* This is needed to protect the pre formating from global settings such |
|
288 | 288 | as that of bootstrap */ |
|
289 | 289 | div.output_area pre { |
|
290 | 290 | font-family: monospace; |
|
291 | 291 | margin: 0; |
|
292 | 292 | padding: 0; |
|
293 | 293 | border: 0; |
|
294 | 294 | font-size: 100%; |
|
295 | 295 | vertical-align: baseline; |
|
296 | 296 | color: black; |
|
297 | 297 | } |
|
298 | 298 | |
|
299 | 299 | /* This class is for the output subarea inside the output_area and after |
|
300 | 300 | the prompt div. */ |
|
301 | 301 | div.output_subarea { |
|
302 | 302 | padding: 0.44em 0.4em 0.4em 1px; |
|
303 | 303 | .box-flex1(); |
|
304 | 304 | } |
|
305 | 305 | |
|
306 | 306 | /* The rest of the output_* classes are for special styling of the different |
|
307 | 307 | output types */ |
|
308 | 308 | |
|
309 | 309 | /* all text output has this class: */ |
|
310 | 310 | div.output_text { |
|
311 | 311 | text-align: left; |
|
312 | 312 | color: @fontBaseColor; |
|
313 | 313 | font-family: monospace; |
|
314 | 314 | /* This has to match that of the the CodeMirror class line-height below */ |
|
315 | 315 | line-height: 1.231; |
|
316 | 316 | } |
|
317 | 317 | |
|
318 | 318 | /* stdout/stderr are 'text' as well as 'stream', but pyout/pyerr are *not* streams */ |
|
319 | 319 | div.output_stream { |
|
320 | 320 | padding-top: 0.0em; |
|
321 | 321 | padding-bottom: 0.0em; |
|
322 | 322 | } |
|
323 | 323 | div.output_stdout { |
|
324 | 324 | } |
|
325 | 325 | div.output_stderr { |
|
326 | 326 | background: #fdd; /* very light red background for stderr */ |
|
327 | 327 | } |
|
328 | 328 | |
|
329 | 329 | div.output_latex { |
|
330 | 330 | text-align: left; |
|
331 | 331 | } |
|
332 | 332 | |
|
333 | 333 | div.output_html { |
|
334 | 334 | } |
|
335 | 335 | |
|
336 | 336 | div.output_png { |
|
337 | 337 | } |
|
338 | 338 | |
|
339 | 339 | div.output_jpeg { |
|
340 | 340 | } |
|
341 | 341 | |
|
342 | 342 | div.text_cell { |
|
343 | 343 | padding: 5px 5px 5px 5px; |
|
344 | 344 | } |
|
345 | 345 | |
|
346 | 346 | div.text_cell_input { |
|
347 | 347 | color: @fontBaseColor; |
|
348 | 348 | border: 1px solid @light_border_color; |
|
349 | 349 | .corner-all; |
|
350 | 350 | background: @cell_background; |
|
351 | 351 | } |
|
352 | 352 | |
|
353 | 353 | div.text_cell_render { |
|
354 | 354 | /*font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;*/ |
|
355 | 355 | outline: none; |
|
356 | 356 | resize: none; |
|
357 | 357 | width: inherit; |
|
358 | 358 | border-style: none; |
|
359 | 359 | padding: 5px; |
|
360 | 360 | color: @fontBaseColor; |
|
361 | 361 | } |
|
362 | 362 | |
|
363 | 363 | /* The following gets added to the <head> if it is detected that the user has a |
|
364 | 364 | * monospace font with inconsistent normal/bold/italic height. See |
|
365 | 365 | * notebookmain.js. Such fonts will have keywords vertically offset with |
|
366 | 366 | * respect to the rest of the text. The user should select a better font. |
|
367 | 367 | * See: https://github.com/ipython/ipython/issues/1503 |
|
368 | 368 | * |
|
369 | 369 | * .CodeMirror span { |
|
370 | 370 | * vertical-align: bottom; |
|
371 | 371 | * } |
|
372 | 372 | */ |
|
373 | 373 | |
|
374 | 374 | .CodeMirror { |
|
375 | 375 | line-height: 1.231; /* Changed from 1em to our global default */ |
|
376 | 376 | height: auto; /* Changed to auto to autogrow */ |
|
377 | 377 | background: none; /* Changed from white to allow our bg to show through */ |
|
378 | 378 | } |
|
379 | 379 | |
|
380 | 380 | .CodeMirror-scroll { |
|
381 | 381 | /* The CodeMirror docs are a bit fuzzy on if overflow-y should be hidden or visible.*/ |
|
382 | 382 | /* We have found that if it is visible, vertical scrollbars appear with font size changes.*/ |
|
383 | 383 | overflow-y: hidden; |
|
384 | 384 | overflow-x: auto; /* Changed from auto to remove scrollbar */ |
|
385 | 385 | } |
|
386 | 386 | |
|
387 | 387 | .CodeMirror-lines { |
|
388 | 388 | /* In CM2, this used to be 0.4em, but in CM3 it went to 4px. We need the em value because */ |
|
389 | 389 | /* we have set a different line-height and want this to scale with that. */ |
|
390 | 390 | padding: 0.4em; |
|
391 | 391 | } |
|
392 | 392 | |
|
393 | 393 | .CodeMirror pre { |
|
394 | 394 | /* In CM3 this went to 4px from 0 in CM2. We need the 0 value because of how we size */ |
|
395 | 395 | /* .CodeMirror-lines */ |
|
396 | 396 | padding: 0; |
|
397 | 397 | } |
|
398 | 398 | |
|
399 | 399 | /* CSS font colors for translated ANSI colors. */ |
|
400 | 400 | |
|
401 | 401 | |
|
402 | 402 | .ansiblack {color: @fontBaseColor;} |
|
403 | 403 | .ansired {color: darkred;} |
|
404 | 404 | .ansigreen {color: darkgreen;} |
|
405 | 405 | .ansiyellow {color: brown;} |
|
406 | 406 | .ansiblue {color: darkblue;} |
|
407 | 407 | .ansipurple {color: darkviolet;} |
|
408 | 408 | .ansicyan {color: steelblue;} |
|
409 | 409 | .ansigrey {color: grey;} |
|
410 | 410 | .ansibold {font-weight: bold;} |
|
411 | 411 | |
|
412 | 412 | .completions { |
|
413 | 413 | position: absolute; |
|
414 | 414 | z-index: 10; |
|
415 | 415 | overflow: hidden; |
|
416 | 416 | border: 1px solid @border_color; |
|
417 | 417 | .corner-all; |
|
418 | 418 | .box-shadow(0px 6px 10px -1px #adadad); |
|
419 | 419 | } |
|
420 | 420 | |
|
421 | 421 | .completions select { |
|
422 | 422 | background: white; |
|
423 | 423 | outline: none; |
|
424 | 424 | border: none; |
|
425 | 425 | padding: 0px; |
|
426 | 426 | margin: 0px; |
|
427 | 427 | overflow: auto; |
|
428 | 428 | font-family: monospace; |
|
429 | 429 | font-size: 110%; |
|
430 | 430 | color: @fontBaseColor; |
|
431 | 431 | } |
|
432 | 432 | |
|
433 | 433 | .completions select option.context { |
|
434 | 434 | color: @blueDark; |
|
435 | 435 | } |
|
436 | 436 | |
|
437 | 437 | pre.dialog { |
|
438 | 438 | background-color: @cell_background; |
|
439 | 439 | border: 1px solid #ddd; |
|
440 | 440 | .corner-all; |
|
441 | 441 | padding: 0.4em; |
|
442 | 442 | padding-left: 2em; |
|
443 | 443 | } |
|
444 | 444 | |
|
445 | 445 | p.dialog { |
|
446 | 446 | padding : 0.2em; |
|
447 | 447 | } |
|
448 | 448 | |
|
449 | 449 | .shortcut_key { |
|
450 | 450 | display: inline-block; |
|
451 | 451 | width: 15ex; |
|
452 | 452 | text-align: right; |
|
453 | 453 | font-family: monospace; |
|
454 | 454 | } |
|
455 | 455 | |
|
456 | 456 | .shortcut_descr { |
|
457 | 457 | } |
|
458 | 458 | |
|
459 | 459 | /* Word-wrap output correctly. This is the CSS3 spelling, though Firefox seems |
|
460 | 460 | to not honor it correctly. Webkit browsers (Chrome, rekonq, Safari) do. |
|
461 | 461 | */ |
|
462 | 462 | pre, code, kbd, samp { white-space: pre-wrap; } |
|
463 | 463 | |
|
464 | 464 | #fonttest { |
|
465 | 465 | font-family: monospace; |
|
466 | 466 | } |
|
467 | 467 | |
|
468 | 468 | .js-error { |
|
469 | 469 | color: darkred; |
|
470 | 470 | } |
|
471 | 471 | |
|
472 | 472 | a { |
|
473 | 473 | text-decoration: underline; |
|
474 | 474 | } |
|
475 | 475 | |
|
476 | 476 | p { |
|
477 | 477 | |
|
478 | 478 | margin-bottom:0; |
|
479 | 479 | |
|
480 | 480 | } |
|
481 | 481 | |
|
482 | 482 | a.heading-anchor:link, a.heading-anchor:visited { |
|
483 | 483 | text-decoration: none; |
|
484 | 484 | color: inherit; |
|
485 | 485 | } |
|
486 | 486 | |
|
487 | 487 | /* raw_input styles */ |
|
488 | 488 | |
|
489 | 489 | div.raw_input { |
|
490 | 490 | padding-top: 0px; |
|
491 | 491 | padding-bottom: 0px; |
|
492 | 492 | height: 1em; |
|
493 | 493 | line-height: 1em; |
|
494 | 494 | font-family: monospace; |
|
495 | 495 | } |
|
496 | 496 | span.input_prompt { |
|
497 | 497 | font-family: inherit; |
|
498 | 498 | } |
|
499 | 499 | input.raw_input { |
|
500 | 500 | font-family: inherit; |
|
501 | 501 | font-size: inherit; |
|
502 | 502 | color: inherit; |
|
503 | 503 | width: auto; |
|
504 | 504 | margin: -2px 0px 0px 1px; |
|
505 | 505 | padding-left: 1px; |
|
506 | 506 | padding-top: 2px; |
|
507 | 507 | height: 1em; |
|
508 | 508 | } |
|
509 | 509 | |
|
510 | 510 | p.p-space { |
|
511 | 511 | margin-bottom: 10px; |
|
512 | 512 | } |
|
513 | 513 |
@@ -1,243 +1,242 b'' | |||
|
1 | 1 | {% extends "page.html" %} |
|
2 | 2 | |
|
3 | 3 | {% block stylesheet %} |
|
4 | 4 | |
|
5 | 5 | {% if mathjax_url %} |
|
6 | 6 | <script type="text/javascript" src="{{mathjax_url}}?config=TeX-AMS_HTML-full&delayStartupUntil=configured" charset="utf-8"></script> |
|
7 | 7 | {% endif %} |
|
8 | 8 | <script type="text/javascript"> |
|
9 | 9 | // MathJax disabled, set as null to distingish from *missing* MathJax, |
|
10 | 10 | // where it will be undefined, and should prompt a dialog later. |
|
11 | 11 | window.mathjax_url = "{{mathjax_url}}"; |
|
12 | 12 | </script> |
|
13 | 13 | |
|
14 | 14 | <link rel="stylesheet" href="{{ static_url("components/codemirror/lib/codemirror.css") }}"> |
|
15 | <link rel="stylesheet" href="{{ static_url("css/codemirror-ipython.css") }}"> | |
|
16 | ||
|
17 | <link rel="stylesheet" href="{{ static_url("prettify/prettify.css") }}"/> | |
|
18 | 15 | |
|
19 | 16 | <link rel="stylesheet" href="{{ static_url("css/celltoolbar.css") }}" type="text/css" /> |
|
20 | 17 | |
|
21 | 18 | {{super()}} |
|
22 | 19 | |
|
23 | 20 | {% endblock %} |
|
24 | 21 | |
|
25 | 22 | {% block params %} |
|
26 | 23 | |
|
27 | 24 | data-project={{project}} |
|
28 | 25 | data-base-project-url={{base_project_url}} |
|
29 | 26 | data-base-kernel-url={{base_kernel_url}} |
|
30 | 27 | data-read-only={{read_only and not logged_in}} |
|
31 | 28 | data-notebook-id={{notebook_id}} |
|
32 | 29 | class="notebook_app" |
|
33 | 30 | |
|
34 | 31 | {% endblock %} |
|
35 | 32 | |
|
36 | 33 | |
|
37 | 34 | {% block header %} |
|
38 | 35 | |
|
39 | 36 | <span id="save_widget"> |
|
40 | 37 | <span id="notebook_name"></span> |
|
41 | 38 | <span id="checkpoint_status"></span> |
|
42 | 39 | <span id="autosave_status"></span> |
|
43 | 40 | </span> |
|
44 | 41 | |
|
45 | 42 | {% endblock %} |
|
46 | 43 | |
|
47 | 44 | |
|
48 | 45 | {% block site %} |
|
49 | 46 | |
|
50 | 47 | <div id="menubar_container"> |
|
51 | 48 | <div id="menubar"> |
|
52 | 49 | <ul id="menus"> |
|
53 | 50 | <li><a href="#">File</a> |
|
54 | 51 | <ul> |
|
55 | 52 | <li id="new_notebook"><a href="#">New</a></li> |
|
56 | 53 | <li id="open_notebook"><a href="#">Open...</a></li> |
|
57 | 54 | <hr/> |
|
58 | 55 | <li id="copy_notebook"><a href="#">Make a Copy...</a></li> |
|
59 | 56 | <li id="rename_notebook"><a href="#">Rename...</a></li> |
|
60 | 57 | <li id="save_checkpoint"><a href="#">Save and Checkpoint</a></li> |
|
61 | 58 | <hr/> |
|
62 | 59 | <li id="restore_checkpoint"><a href="#">Revert to Checkpoint</a> |
|
63 | 60 | <ul> |
|
64 | 61 | <li><a href="#"></a></li> |
|
65 | 62 | <li><a href="#"></a></li> |
|
66 | 63 | <li><a href="#"></a></li> |
|
67 | 64 | <li><a href="#"></a></li> |
|
68 | 65 | <li><a href="#"></a></li> |
|
69 | 66 | </ul> |
|
70 | 67 | </li> |
|
71 | 68 | <hr/> |
|
72 | 69 | <li><a href="#">Download as</a> |
|
73 | 70 | <ul> |
|
74 | 71 | <li id="download_ipynb"><a href="#">IPython (.ipynb)</a></li> |
|
75 | 72 | <li id="download_py"><a href="#">Python (.py)</a></li> |
|
76 | 73 | </ul> |
|
77 | 74 | </li> |
|
78 | 75 | <!--<hr/> |
|
79 | 76 | <li id="print_notebook"><a href="/{{notebook_id}}/print" target="_blank">Print View</a></li>--> |
|
80 | 77 | <hr/> |
|
81 | 78 | <li id="kill_and_exit"><a href="#" >Close and halt</a></li> |
|
82 | 79 | </ul> |
|
83 | 80 | </li> |
|
84 | 81 | <li><a href="#">Edit</a> |
|
85 | 82 | <ul> |
|
86 | 83 | <li id="cut_cell"><a href="#">Cut Cell</a></li> |
|
87 | 84 | <li id="copy_cell"><a href="#">Copy Cell</a></li> |
|
88 | 85 | <li id="paste_cell_above" class="ui-state-disabled"><a href="#">Paste Cell Above</a></li> |
|
89 | 86 | <li id="paste_cell_below" class="ui-state-disabled"><a href="#">Paste Cell Below</a></li> |
|
90 | 87 | <li id="paste_cell_replace" class="ui-state-disabled"><a href="#">Paste Cell & Replace</a></li> |
|
91 | 88 | <li id="delete_cell"><a href="#">Delete Cell</a></li> |
|
92 | 89 | <li id="undelete_cell" class="ui-state-disabled"><a href="#">Undo Delete Cell</a></li> |
|
93 | 90 | <hr/> |
|
94 | 91 | <li id="split_cell"><a href="#">Split Cell</a></li> |
|
95 | 92 | <li id="merge_cell_above"><a href="#">Merge Cell Above</a></li> |
|
96 | 93 | <li id="merge_cell_below"><a href="#">Merge Cell Below</a></li> |
|
97 | 94 | <hr/> |
|
98 | 95 | <li id="move_cell_up"><a href="#">Move Cell Up</a></li> |
|
99 | 96 | <li id="move_cell_down"><a href="#">Move Cell Down</a></li> |
|
100 | 97 | <hr/> |
|
101 | 98 | <li id="select_previous"><a href="#">Select Previous Cell</a></li> |
|
102 | 99 | <li id="select_next"><a href="#">Select Next Cell</a></li> |
|
103 | 100 | </ul> |
|
104 | 101 | </li> |
|
105 | 102 | <li><a href="#">View</a> |
|
106 | 103 | <ul> |
|
107 | 104 | <li id="toggle_header"><a href="#">Toggle Header</a></li> |
|
108 | 105 | <li id="toggle_toolbar"><a href="#">Toggle Toolbar</a></li> |
|
109 | 106 | </ul> |
|
110 | 107 | </li> |
|
111 | 108 | <li><a href="#">Insert</a> |
|
112 | 109 | <ul> |
|
113 | 110 | <li id="insert_cell_above"><a href="#">Insert Cell Above</a></li> |
|
114 | 111 | <li id="insert_cell_below"><a href="#">Insert Cell Below</a></li> |
|
115 | 112 | </ul> |
|
116 | 113 | </li> |
|
117 | 114 | <li><a href="#">Cell</a> |
|
118 | 115 | <ul> |
|
119 | 116 | <li id="run_cell"><a href="#">Run</a></li> |
|
120 | 117 | <li id="run_cell_in_place"><a href="#">Run in Place</a></li> |
|
121 | 118 | <li id="run_all_cells"><a href="#">Run All</a></li> |
|
122 | 119 | <li id="run_all_cells_above"><a href="#">Run All Above</a></li> |
|
123 | 120 | <li id="run_all_cells_below"><a href="#">Run All Below</a></li> |
|
124 | 121 | <hr/> |
|
125 | 122 | <li id="to_code"><a href="#">Code</a></li> |
|
126 | 123 | <li id="to_markdown"><a href="#">Markdown </a></li> |
|
127 | 124 | <li id="to_raw"><a href="#">Raw Text</a></li> |
|
128 | 125 | <li id="to_heading1"><a href="#">Heading 1</a></li> |
|
129 | 126 | <li id="to_heading2"><a href="#">Heading 2</a></li> |
|
130 | 127 | <li id="to_heading3"><a href="#">Heading 3</a></li> |
|
131 | 128 | <li id="to_heading4"><a href="#">Heading 4</a></li> |
|
132 | 129 | <li id="to_heading5"><a href="#">Heading 5</a></li> |
|
133 | 130 | <li id="to_heading6"><a href="#">Heading 6</a></li> |
|
134 | 131 | <hr/> |
|
135 | 132 | <li id="toggle_output"><a href="#">Toggle Current Output</a></li> |
|
136 | 133 | <li id="all_outputs"><a href="#">All Output</a> |
|
137 | 134 | <ul> |
|
138 | 135 | <li id="expand_all_output"><a href="#">Expand</a></li> |
|
139 | 136 | <li id="scroll_all_output"><a href="#">Scroll Long</a></li> |
|
140 | 137 | <li id="collapse_all_output"><a href="#">Collapse</a></li> |
|
141 | 138 | <li id="clear_all_output"><a href="#">Clear</a></li> |
|
142 | 139 | </ul> |
|
143 | 140 | </li> |
|
144 | 141 | </ul> |
|
145 | 142 | </li> |
|
146 | 143 | <li><a href="#">Kernel</a> |
|
147 | 144 | <ul> |
|
148 | 145 | <li id="int_kernel"><a href="#">Interrupt</a></li> |
|
149 | 146 | <li id="restart_kernel"><a href="#">Restart</a></li> |
|
150 | 147 | </ul> |
|
151 | 148 | </li> |
|
152 | 149 | <li><a href="#">Help</a> |
|
153 | 150 | <ul> |
|
154 | 151 | <li><a href="http://ipython.org/documentation.html" target="_blank">IPython Help</a></li> |
|
155 | 152 | <li><a href="http://ipython.org/ipython-doc/stable/interactive/htmlnotebook.html" target="_blank">Notebook Help</a></li> |
|
156 | 153 | <li id="keyboard_shortcuts"><a href="#">Keyboard Shortcuts</a></li> |
|
157 | 154 | <hr/> |
|
158 | 155 | <li><a href="http://docs.python.org" target="_blank">Python</a></li> |
|
159 | 156 | <li><a href="http://docs.scipy.org/doc/numpy/reference/" target="_blank">NumPy</a></li> |
|
160 | 157 | <li><a href="http://docs.scipy.org/doc/scipy/reference/" target="_blank">SciPy</a></li> |
|
161 | 158 | <li><a href="http://docs.sympy.org/dev/index.html" target="_blank">SymPy</a></li> |
|
162 | 159 | <li><a href="http://matplotlib.sourceforge.net/" target="_blank">Matplotlib</a></li> |
|
163 | 160 | </ul> |
|
164 | 161 | </li> |
|
165 | 162 | </ul> |
|
166 | 163 | |
|
167 | 164 | </div> |
|
168 | 165 | <div id="notification_area"> |
|
169 | 166 | </div> |
|
170 | 167 | </div> |
|
171 | 168 | |
|
172 | 169 | |
|
173 | 170 | <div id="maintoolbar"></div> |
|
174 | 171 | |
|
175 | 172 | <div id="ipython-main-app"> |
|
176 | 173 | |
|
177 | 174 | <div id="notebook_panel"> |
|
178 | 175 | <div id="notebook"></div> |
|
179 | 176 | <div id="pager_splitter"></div> |
|
180 | 177 | <div id="pager_container"> |
|
181 | 178 | <div id='pager_button_area'> |
|
182 | 179 | </div> |
|
183 | 180 | <div id="pager"></div> |
|
184 | 181 | </div> |
|
185 | 182 | </div> |
|
186 | 183 | |
|
187 | 184 | </div> |
|
188 | 185 | <div id='tooltip' class='ipython_tooltip' style='display:none'></div> |
|
189 | 186 | |
|
190 | 187 | |
|
191 | 188 | {% endblock %} |
|
192 | 189 | |
|
193 | 190 | |
|
194 | 191 | {% block script %} |
|
195 | 192 | |
|
196 | 193 | {{super()}} |
|
197 | 194 | |
|
198 | 195 | <script src="{{ static_url("components/codemirror/lib/codemirror.js") }}" charset="utf-8"></script> |
|
199 | 196 | <script src="{{ static_url("components/codemirror/addon/mode/loadmode.js") }}" charset="utf-8"></script> |
|
200 | 197 | <script src="{{ static_url("components/codemirror/addon/mode/multiplex.js") }}" charset="utf-8"></script> |
|
198 | <script src="{{ static_url("components/codemirror/addon/mode/overlay.js") }}" charset="utf-8"></script> | |
|
201 | 199 | <script src="{{ static_url("js/codemirror-ipython.js") }}" charset="utf-8"></script> |
|
202 | 200 | <script src="{{ static_url("components/codemirror/mode/htmlmixed/htmlmixed.js") }}" charset="utf-8"></script> |
|
203 | 201 | <script src="{{ static_url("components/codemirror/mode/xml/xml.js") }}" charset="utf-8"></script> |
|
204 | 202 | <script src="{{ static_url("components/codemirror/mode/javascript/javascript.js") }}" charset="utf-8"></script> |
|
205 | 203 | <script src="{{ static_url("components/codemirror/mode/css/css.js") }}" charset="utf-8"></script> |
|
206 | 204 | <script src="{{ static_url("components/codemirror/mode/rst/rst.js") }}" charset="utf-8"></script> |
|
207 | 205 | <script src="{{ static_url("components/codemirror/mode/markdown/markdown.js") }}" charset="utf-8"></script> |
|
206 | <script src="{{ static_url("components/codemirror/mode/gfm/gfm.js") }}" charset="utf-8"></script> | |
|
208 | 207 | |
|
209 |
<script src="{{ static_url("p |
|
|
208 | <script src="{{ static_url("components/marked/lib/marked.js") }}" charset="utf-8"></script> | |
|
209 | <script src="{{ static_url("components/highlight.js/build/highlight.pack.js") }}" charset="utf-8"></script> | |
|
210 | 210 | |
|
211 | <script src="{{ static_url("prettify/prettify.js") }}" charset="utf-8"></script> | |
|
212 | 211 | <script src="{{ static_url("dateformat/date.format.js") }}" charset="utf-8"></script> |
|
213 | 212 | |
|
214 | 213 | <script src="{{ static_url("js/events.js") }}" type="text/javascript" charset="utf-8"></script> |
|
215 | 214 | <script src="{{ static_url("js/utils.js") }}" type="text/javascript" charset="utf-8"></script> |
|
216 | 215 | <script src="{{ static_url("js/layoutmanager.js") }}" type="text/javascript" charset="utf-8"></script> |
|
217 | 216 | <script src="{{ static_url("js/mathjaxutils.js") }}" type="text/javascript" charset="utf-8"></script> |
|
218 | 217 | <script src="{{ static_url("js/outputarea.js") }}" type="text/javascript" charset="utf-8"></script> |
|
219 | 218 | <script src="{{ static_url("js/cell.js") }}" type="text/javascript" charset="utf-8"></script> |
|
220 | 219 | <script src="{{ static_url("js/celltoolbar.js") }}" type="text/javascript" charset="utf-8"></script> |
|
221 | 220 | <script src="{{ static_url("js/codecell.js") }}" type="text/javascript" charset="utf-8"></script> |
|
222 | 221 | <script src="{{ static_url("js/completer.js") }}" type="text/javascript" charset="utf-8"></script> |
|
223 | 222 | <script src="{{ static_url("js/textcell.js") }}" type="text/javascript" charset="utf-8"></script> |
|
224 | 223 | <script src="{{ static_url("js/kernel.js") }}" type="text/javascript" charset="utf-8"></script> |
|
225 | 224 | <script src="{{ static_url("js/savewidget.js") }}" type="text/javascript" charset="utf-8"></script> |
|
226 | 225 | <script src="{{ static_url("js/quickhelp.js") }}" type="text/javascript" charset="utf-8"></script> |
|
227 | 226 | <script src="{{ static_url("js/pager.js") }}" type="text/javascript" charset="utf-8"></script> |
|
228 | 227 | <script src="{{ static_url("js/menubar.js") }}" type="text/javascript" charset="utf-8"></script> |
|
229 | 228 | <script src="{{ static_url("js/toolbar.js") }}" type="text/javascript" charset="utf-8"></script> |
|
230 | 229 | <script src="{{ static_url("js/maintoolbar.js") }}" type="text/javascript" charset="utf-8"></script> |
|
231 | 230 | <script src="{{ static_url("js/notebook.js") }}" type="text/javascript" charset="utf-8"></script> |
|
232 | 231 | <script src="{{ static_url("js/notificationwidget.js") }}" type="text/javascript" charset="utf-8"></script> |
|
233 | 232 | <script src="{{ static_url("js/notificationarea.js") }}" type="text/javascript" charset="utf-8"></script> |
|
234 | 233 | <script src="{{ static_url("js/tooltip.js") }}" type="text/javascript" charset="utf-8"></script> |
|
235 | 234 | <script src="{{ static_url("js/config.js") }}" type="text/javascript" charset="utf-8"></script> |
|
236 | 235 | <script src="{{ static_url("js/notebookmain.js") }}" type="text/javascript" charset="utf-8"></script> |
|
237 | 236 | |
|
238 | 237 | <script src="{{ static_url("js/contexthint.js") }}" charset="utf-8"></script> |
|
239 | 238 | |
|
240 | 239 | <script src="{{ static_url("js/celltoolbarpresets/default.js") }}" type="text/javascript" charset="utf-8"></script> |
|
241 | 240 | <script src="{{ static_url("js/celltoolbarpresets/slideshow.js") }}" type="text/javascript" charset="utf-8"></script> |
|
242 | 241 | |
|
243 | 242 | {% endblock %} |
@@ -1,172 +1,190 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | """ |
|
3 | 3 | A multi-heart Heartbeat system using PUB and ROUTER sockets. pings are sent out on the PUB, |
|
4 | 4 | and hearts are tracked based on their DEALER identities. |
|
5 | 5 | |
|
6 | 6 | Authors: |
|
7 | 7 | |
|
8 | 8 | * Min RK |
|
9 | 9 | """ |
|
10 | 10 | #----------------------------------------------------------------------------- |
|
11 | 11 | # Copyright (C) 2010-2011 The IPython Development Team |
|
12 | 12 | # |
|
13 | 13 | # Distributed under the terms of the BSD License. The full license is in |
|
14 | 14 | # the file COPYING, distributed as part of this software. |
|
15 | 15 | #----------------------------------------------------------------------------- |
|
16 | 16 | |
|
17 | 17 | from __future__ import print_function |
|
18 | 18 | import time |
|
19 | 19 | import uuid |
|
20 | 20 | |
|
21 | 21 | import zmq |
|
22 | 22 | from zmq.devices import ThreadDevice, ThreadMonitoredQueue |
|
23 | 23 | from zmq.eventloop import ioloop, zmqstream |
|
24 | 24 | |
|
25 | 25 | from IPython.config.configurable import LoggingConfigurable |
|
26 | 26 | from IPython.utils.py3compat import str_to_bytes |
|
27 | from IPython.utils.traitlets import Set, Instance, CFloat, Integer | |
|
27 | from IPython.utils.traitlets import Set, Instance, CFloat, Integer, Dict | |
|
28 | 28 | |
|
29 | 29 | from IPython.parallel.util import log_errors |
|
30 | 30 | |
|
31 | 31 | class Heart(object): |
|
32 | 32 | """A basic heart object for responding to a HeartMonitor. |
|
33 | 33 | This is a simple wrapper with defaults for the most common |
|
34 | 34 | Device model for responding to heartbeats. |
|
35 | 35 | |
|
36 | 36 | It simply builds a threadsafe zmq.FORWARDER Device, defaulting to using |
|
37 | 37 | SUB/DEALER for in/out. |
|
38 | 38 | |
|
39 | 39 | You can specify the DEALER's IDENTITY via the optional heart_id argument.""" |
|
40 | 40 | device=None |
|
41 | 41 | id=None |
|
42 | 42 | def __init__(self, in_addr, out_addr, mon_addr=None, in_type=zmq.SUB, out_type=zmq.DEALER, mon_type=zmq.PUB, heart_id=None): |
|
43 | 43 | if mon_addr is None: |
|
44 | 44 | self.device = ThreadDevice(zmq.FORWARDER, in_type, out_type) |
|
45 | 45 | else: |
|
46 | 46 | self.device = ThreadMonitoredQueue(in_type, out_type, mon_type, in_prefix=b"", out_prefix=b"") |
|
47 | 47 | # do not allow the device to share global Context.instance, |
|
48 | 48 | # which is the default behavior in pyzmq > 2.1.10 |
|
49 | 49 | self.device.context_factory = zmq.Context |
|
50 | 50 | |
|
51 | 51 | self.device.daemon=True |
|
52 | 52 | self.device.connect_in(in_addr) |
|
53 | 53 | self.device.connect_out(out_addr) |
|
54 | 54 | if mon_addr is not None: |
|
55 | 55 | self.device.connect_mon(mon_addr) |
|
56 | 56 | if in_type == zmq.SUB: |
|
57 | 57 | self.device.setsockopt_in(zmq.SUBSCRIBE, b"") |
|
58 | 58 | if heart_id is None: |
|
59 | 59 | heart_id = uuid.uuid4().bytes |
|
60 | 60 | self.device.setsockopt_out(zmq.IDENTITY, heart_id) |
|
61 | 61 | self.id = heart_id |
|
62 | 62 | |
|
63 | 63 | def start(self): |
|
64 | 64 | return self.device.start() |
|
65 | 65 | |
|
66 | 66 | |
|
67 | 67 | class HeartMonitor(LoggingConfigurable): |
|
68 | 68 | """A basic HeartMonitor class |
|
69 | 69 | pingstream: a PUB stream |
|
70 | 70 | pongstream: an ROUTER stream |
|
71 | 71 | period: the period of the heartbeat in milliseconds""" |
|
72 | 72 | |
|
73 | 73 | period = Integer(3000, config=True, |
|
74 | 74 | help='The frequency at which the Hub pings the engines for heartbeats ' |
|
75 | 75 | '(in ms)', |
|
76 | 76 | ) |
|
77 | max_heartmonitor_misses = Integer(10, config=True, | |
|
78 | help='Allowed consecutive missed pings from controller Hub to engine before unregistering.', | |
|
79 | ) | |
|
77 | 80 | |
|
78 | 81 | pingstream=Instance('zmq.eventloop.zmqstream.ZMQStream') |
|
79 | 82 | pongstream=Instance('zmq.eventloop.zmqstream.ZMQStream') |
|
80 | 83 | loop = Instance('zmq.eventloop.ioloop.IOLoop') |
|
81 | 84 | def _loop_default(self): |
|
82 | 85 | return ioloop.IOLoop.instance() |
|
83 | 86 | |
|
84 | 87 | # not settable: |
|
85 | 88 | hearts=Set() |
|
86 | 89 | responses=Set() |
|
87 |
on_probation= |
|
|
90 | on_probation=Dict() | |
|
88 | 91 | last_ping=CFloat(0) |
|
89 | 92 | _new_handlers = Set() |
|
90 | 93 | _failure_handlers = Set() |
|
91 | 94 | lifetime = CFloat(0) |
|
92 | 95 | tic = CFloat(0) |
|
93 | 96 | |
|
94 | 97 | def __init__(self, **kwargs): |
|
95 | 98 | super(HeartMonitor, self).__init__(**kwargs) |
|
96 | 99 | |
|
97 | 100 | self.pongstream.on_recv(self.handle_pong) |
|
98 | 101 | |
|
99 | 102 | def start(self): |
|
100 | 103 | self.tic = time.time() |
|
101 | 104 | self.caller = ioloop.PeriodicCallback(self.beat, self.period, self.loop) |
|
102 | 105 | self.caller.start() |
|
103 | 106 | |
|
104 | 107 | def add_new_heart_handler(self, handler): |
|
105 | 108 | """add a new handler for new hearts""" |
|
106 | 109 | self.log.debug("heartbeat::new_heart_handler: %s", handler) |
|
107 | 110 | self._new_handlers.add(handler) |
|
108 | 111 | |
|
109 | 112 | def add_heart_failure_handler(self, handler): |
|
110 | 113 | """add a new handler for heart failure""" |
|
111 | 114 | self.log.debug("heartbeat::new heart failure handler: %s", handler) |
|
112 | 115 | self._failure_handlers.add(handler) |
|
113 | 116 | |
|
114 | 117 | def beat(self): |
|
115 | 118 | self.pongstream.flush() |
|
116 | 119 | self.last_ping = self.lifetime |
|
117 | 120 | |
|
118 | 121 | toc = time.time() |
|
119 | 122 | self.lifetime += toc-self.tic |
|
120 | 123 | self.tic = toc |
|
121 | 124 | self.log.debug("heartbeat::sending %s", self.lifetime) |
|
122 | 125 | goodhearts = self.hearts.intersection(self.responses) |
|
123 | 126 | missed_beats = self.hearts.difference(goodhearts) |
|
124 | heartfailures = self.on_probation.intersection(missed_beats) | |
|
125 | 127 | newhearts = self.responses.difference(goodhearts) |
|
126 | 128 | map(self.handle_new_heart, newhearts) |
|
129 | heartfailures, on_probation = self._check_missed(missed_beats, self.on_probation, | |
|
130 | self.hearts) | |
|
127 | 131 | map(self.handle_heart_failure, heartfailures) |
|
128 |
self.on_probation = |
|
|
132 | self.on_probation = on_probation | |
|
129 | 133 | self.responses = set() |
|
130 | 134 | #print self.on_probation, self.hearts |
|
131 | 135 | # self.log.debug("heartbeat::beat %.3f, %i beating hearts", self.lifetime, len(self.hearts)) |
|
132 | 136 | self.pingstream.send(str_to_bytes(str(self.lifetime))) |
|
133 | 137 | # flush stream to force immediate socket send |
|
134 | 138 | self.pingstream.flush() |
|
135 | 139 | |
|
140 | def _check_missed(self, missed_beats, on_probation, hearts): | |
|
141 | """Update heartbeats on probation, identifying any that have too many misses. | |
|
142 | """ | |
|
143 | failures = [] | |
|
144 | new_probation = {} | |
|
145 | for cur_heart in (b for b in missed_beats if b in hearts): | |
|
146 | miss_count = on_probation.get(cur_heart, 0) + 1 | |
|
147 | self.log.info("heartbeat::missed %s : %s" % (cur_heart, miss_count)) | |
|
148 | if miss_count > self.max_heartmonitor_misses: | |
|
149 | failures.append(cur_heart) | |
|
150 | else: | |
|
151 | new_probation[cur_heart] = miss_count | |
|
152 | return failures, new_probation | |
|
153 | ||
|
136 | 154 | def handle_new_heart(self, heart): |
|
137 | 155 | if self._new_handlers: |
|
138 | 156 | for handler in self._new_handlers: |
|
139 | 157 | handler(heart) |
|
140 | 158 | else: |
|
141 | 159 | self.log.info("heartbeat::yay, got new heart %s!", heart) |
|
142 | 160 | self.hearts.add(heart) |
|
143 | 161 | |
|
144 | 162 | def handle_heart_failure(self, heart): |
|
145 | 163 | if self._failure_handlers: |
|
146 | 164 | for handler in self._failure_handlers: |
|
147 | 165 | try: |
|
148 | 166 | handler(heart) |
|
149 | 167 | except Exception as e: |
|
150 | 168 | self.log.error("heartbeat::Bad Handler! %s", handler, exc_info=True) |
|
151 | 169 | pass |
|
152 | 170 | else: |
|
153 | 171 | self.log.info("heartbeat::Heart %s failed :(", heart) |
|
154 | 172 | self.hearts.remove(heart) |
|
155 | 173 | |
|
156 | 174 | |
|
157 | 175 | @log_errors |
|
158 | 176 | def handle_pong(self, msg): |
|
159 | 177 | "a heart just beat" |
|
160 | 178 | current = str_to_bytes(str(self.lifetime)) |
|
161 | 179 | last = str_to_bytes(str(self.last_ping)) |
|
162 | 180 | if msg[1] == current: |
|
163 | 181 | delta = time.time()-self.tic |
|
164 | 182 | # self.log.debug("heartbeat::heart %r took %.2f ms to respond"%(msg[0], 1000*delta)) |
|
165 | 183 | self.responses.add(msg[0]) |
|
166 | 184 | elif msg[1] == last: |
|
167 | 185 | delta = time.time()-self.tic + (self.lifetime-self.last_ping) |
|
168 | 186 | self.log.warn("heartbeat::heart %r missed a beat, and took %.2f ms to respond", msg[0], 1000*delta) |
|
169 | 187 | self.responses.add(msg[0]) |
|
170 | 188 | else: |
|
171 | 189 | self.log.warn("heartbeat::got bad heartbeat (possibly old?): %s (current=%.3f)", msg[1], self.lifetime) |
|
172 | 190 |
@@ -1,18 +1,16 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | # encoding: utf-8 |
|
3 | 3 | |
|
4 | 4 | #----------------------------------------------------------------------------- |
|
5 | 5 | # Copyright (C) 2008-2009 The IPython Development Team |
|
6 | 6 | # |
|
7 | 7 | # Distributed under the terms of the BSD License. The full license is in |
|
8 | 8 | # the file COPYING, distributed as part of this software. |
|
9 | 9 | #----------------------------------------------------------------------------- |
|
10 | 10 | |
|
11 | 11 | #----------------------------------------------------------------------------- |
|
12 | 12 | # Imports |
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | ||
|
15 | ||
|
16 | 14 | from IPython.parallel.apps.ipclusterapp import launch_new_instance |
|
17 | 15 | |
|
18 | 16 | launch_new_instance() |
@@ -1,18 +1,16 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | # encoding: utf-8 |
|
3 | 3 | |
|
4 | 4 | #----------------------------------------------------------------------------- |
|
5 | 5 | # Copyright (C) 2008-2009 The IPython Development Team |
|
6 | 6 | # |
|
7 | 7 | # Distributed under the terms of the BSD License. The full license is in |
|
8 | 8 | # the file COPYING, distributed as part of this software. |
|
9 | 9 | #----------------------------------------------------------------------------- |
|
10 | 10 | |
|
11 | 11 | #----------------------------------------------------------------------------- |
|
12 | 12 | # Imports |
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | ||
|
15 | ||
|
16 | 14 | from IPython.parallel.apps.ipcontrollerapp import launch_new_instance |
|
17 | 15 | |
|
18 | 16 | launch_new_instance() |
@@ -1,20 +1,16 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | # encoding: utf-8 |
|
3 | 3 | |
|
4 | 4 | #----------------------------------------------------------------------------- |
|
5 | 5 | # Copyright (C) 2008-2009 The IPython Development Team |
|
6 | 6 | # |
|
7 | 7 | # Distributed under the terms of the BSD License. The full license is in |
|
8 | 8 | # the file COPYING, distributed as part of this software. |
|
9 | 9 | #----------------------------------------------------------------------------- |
|
10 | 10 | |
|
11 | 11 | #----------------------------------------------------------------------------- |
|
12 | 12 | # Imports |
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | ||
|
15 | ||
|
16 | 14 | from IPython.parallel.apps.ipengineapp import launch_new_instance |
|
17 | 15 | |
|
18 | 16 | launch_new_instance() |
|
19 | ||
|
20 |
@@ -1,20 +1,16 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | # encoding: utf-8 |
|
3 | 3 | |
|
4 | 4 | #----------------------------------------------------------------------------- |
|
5 | 5 | # Copyright (C) 2008-2009 The IPython Development Team |
|
6 | 6 | # |
|
7 | 7 | # Distributed under the terms of the BSD License. The full license is in |
|
8 | 8 | # the file COPYING, distributed as part of this software. |
|
9 | 9 | #----------------------------------------------------------------------------- |
|
10 | 10 | |
|
11 | 11 | #----------------------------------------------------------------------------- |
|
12 | 12 | # Imports |
|
13 | 13 | #----------------------------------------------------------------------------- |
|
14 | ||
|
15 | ||
|
16 | 14 | from IPython.parallel.apps.iploggerapp import launch_new_instance |
|
17 | 15 | |
|
18 | 16 | launch_new_instance() |
|
19 | ||
|
20 |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed | |
This diff has been collapsed as it changes many lines, (1319 lines changed) Show them Hide them |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now