...
@@ -2053,7 +2053,7 @@ $('#myCarousel').on('slide.bs.carousel', function () {
The affix plugin toggles between three classes, each representing a particular state: .affix
, .affix-top
, and .affix-bottom
. You must provide the styles for these classes yourself (independent of this plugin) to handle the actual positions.
Here's how the affix plugin works:
- - To start, the plugin adds
.affix-top
to indicate the element is in it's top-most position. At this point no CSS positioning is required.
+ - To start, the plugin adds
.affix-top
to indicate the element is in its top-most position. At this point no CSS positioning is required.
- Scrolling past the element you want affixed should trigger the actual affixing. This is where
.affix
replaces .affix-top
and sets position: fixed;
(provided by Bootstrap's code CSS).
- If a bottom offset is defined, scrolling past that should replace
.affix
with .affix-bottom
. Since offsets are optional, setting one requires you to set the appropriate CSS. In this case, add position: absolute;
when necessary. The plugin uses the data attribute or JavaScript option to determine where to position the element from there.
diff --git a/less/forms.less b/less/forms.less
index 530257499f..aefa5a462c 100644
--- a/less/forms.less
+++ b/less/forms.less
@@ -265,7 +265,7 @@ input[type="checkbox"],
// Feedback icon (requires .glyphicon classes)
.form-control-feedback {
position: absolute;
- top: (@line-height-computed + 5); // Height of the `label` and it's margin
+ top: (@line-height-computed + 5); // Height of the `label` and its margin
right: 0;
display: block;
width: @input-height-base;
diff --git a/less/navbar.less b/less/navbar.less
index d96f85e306..621772fbbf 100644
--- a/less/navbar.less
+++ b/less/navbar.less
@@ -212,7 +212,7 @@
// Navbar nav links
//
-// Builds on top of the `.nav` components with it's own modifier class to make
+// Builds on top of the `.nav` components with its own modifier class to make
// the nav the full height of the horizontal nav (above 768px).
.navbar-nav {
diff --git a/less/navs.less b/less/navs.less
index e4ac144595..9e729b39fe 100644
--- a/less/navs.less
+++ b/less/navs.less
@@ -91,7 +91,7 @@
}
}
- // Active state, and it's :hover to override normal :hover
+ // Active state, and its :hover to override normal :hover
&.active > a {
&,
&:hover,
diff --git a/less/panels.less b/less/panels.less
index 1b72cebd16..ef87868672 100644
--- a/less/panels.less
+++ b/less/panels.less
@@ -95,15 +95,17 @@
border: 0;
margin-bottom: 0;
}
- > .table-striped > tbody > tr:last-child,
- > .table-responsive > .table-striped > tbody > tr:last-child {
- td:first-child,
- th:first-child {
- border-bottom-left-radius: (@panel-border-radius - 1);
- }
- td:last-child,
- th:last-child {
- border-bottom-left-radius: (@panel-border-radius - 1);
+ > .table-striped,
+ > .table-responsive > .table-striped {
+ > tbody > tr:last-child {
+ td:first-child,
+ th:first-child {
+ border-bottom-left-radius: (@panel-border-radius - 1);
+ }
+ td:last-child,
+ th:last-child {
+ border-bottom-left-radius: (@panel-border-radius - 1);
+ }
}
}
}
@@ -120,7 +122,7 @@
}
}
-// Within heading, strip any `h*` tag of it's default margins for spacing.
+// Within heading, strip any `h*` tag of its default margins for spacing.
.panel-title {
margin-top: 0;
margin-bottom: 0;
diff --git a/less/type.less b/less/type.less
index 9d032b2681..5373975d2f 100644
--- a/less/type.less
+++ b/less/type.less
@@ -126,7 +126,7 @@ cite { font-style: normal; }
// For now we'll leave these alongside the text classes until v4 when we can
// safely shift things around (per SemVer rules).
.bg-primary {
- // Given the contrast here, this is the only class to have it's color inverted
+ // Given the contrast here, this is the only class to have its color inverted
// automatically.
color: #fff;
background-color: @brand-primary;
diff --git a/test-infra/node_modules_cache.py b/test-infra/node_modules_cache.py
index 9d9272fcc1..6acddb38a7 100755
--- a/test-infra/node_modules_cache.py
+++ b/test-infra/node_modules_cache.py
@@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals, print_function, divisi
from sys import argv
from os import environ, stat, remove as _delete_file
-from os.path import isfile
+from os.path import isfile, dirname, basename, abspath
from hashlib import sha256
from subprocess import check_call as run
@@ -12,7 +12,6 @@ from boto.s3.key import Key
from boto.exception import S3ResponseError
-NODE_MODULES_TARBALL = 'node_modules.tar.gz'
NEED_TO_UPLOAD_MARKER = '.need-to-upload'
BYTES_PER_MB = 1024 * 1024
try:
@@ -25,7 +24,9 @@ def _sha256_of_file(filename):
hasher = sha256()
with open(filename, 'rb') as input_file:
hasher.update(input_file.read())
- return hasher.hexdigest()
+ file_hash = hasher.hexdigest()
+ print('sha256({}) = {}'.format(filename, file_hash))
+ return file_hash
def _delete_file_quietly(filename):
@@ -35,52 +36,71 @@ def _delete_file_quietly(filename):
pass
-def _tarball_size():
- kib = stat(NODE_MODULES_TARBALL).st_size // BYTES_PER_MB
+def _tarball_size(directory):
+ kib = stat(_tarball_filename_for(directory)).st_size // BYTES_PER_MB
return "{} MiB".format(kib)
+def _tarball_filename_for(directory):
+ return abspath('./{}.tar.gz'.format(basename(directory)))
+
+
+def _create_tarball(directory):
+ print("Creating tarball of {}...".format(directory))
+ run(['tar', '-czf', _tarball_filename_for(directory), '-C', dirname(directory), basename(directory)])
+
+
+def _extract_tarball(directory):
+ print("Extracting tarball of {}...".format(directory))
+ run(['tar', '-xzf', _tarball_filename_for(directory), '-C', dirname(directory)])
+
+
+def download(directory):
+ _delete_file_quietly(NEED_TO_UPLOAD_MARKER)
+ try:
+ print("Downloading {} tarball from S3...".format(basename(directory)))
+ key.get_contents_to_filename(_tarball_filename_for(directory))
+ except S3ResponseError as err:
+ open(NEED_TO_UPLOAD_MARKER, 'a').close()
+ print(err)
+ raise SystemExit("Cached {} download failed!".format(basename(directory)))
+ print("Downloaded {}.".format(_tarball_size(directory)))
+ _extract_tarball(directory)
+ print("{} successfully installed from cache.".format(directory))
+
+
+def upload(directory):
+ _create_tarball(directory)
+ print("Uploading {} tarball to S3... ({})".format(basename(directory), _tarball_size(directory)))
+ key.set_contents_from_filename(_tarball_filename_for(directory))
+ print("{} cache successfully updated.".format(directory))
+ _delete_file_quietly(NEED_TO_UPLOAD_MARKER)
+
+
if __name__ == '__main__':
# Uses environment variables:
# AWS_ACCESS_KEY_ID - AWS Access Key ID
# AWS_SECRET_ACCESS_KEY - AWS Secret Access Key
argv.pop(0)
- if len(argv) != 1:
- raise SystemExit("USAGE: node_modules_cache.py
")
- mode = argv.pop()
+ if len(argv) != 3:
+ raise SystemExit("USAGE: node_modules_cache.py ")
+ mode, dependencies_file, directory = argv
conn = S3Connection()
bucket = conn.lookup(BUCKET_NAME)
if bucket is None:
raise SystemExit("Could not access bucket!")
- package_json_hash = _sha256_of_file('package.json')
- print('sha256(package.json) = ' + package_json_hash)
+ dependencies_file_hash = _sha256_of_file(dependencies_file)
- key = Key(bucket, package_json_hash)
+ key = Key(bucket, dependencies_file_hash)
key.storage_class = 'REDUCED_REDUNDANCY'
if mode == 'download':
- _delete_file_quietly(NEED_TO_UPLOAD_MARKER)
- try:
- print("Downloading tarball from S3...")
- key.get_contents_to_filename(NODE_MODULES_TARBALL)
- except S3ResponseError as err:
- open(NEED_TO_UPLOAD_MARKER, 'a').close()
- print(err)
- raise SystemExit("Cached node_modules download failed!")
- print("Downloaded {}.".format(_tarball_size()))
- print("Extracting tarball...")
- run(['tar', 'xzf', NODE_MODULES_TARBALL])
- print("node_modules successfully installed from cache.")
+ download(directory)
elif mode == 'upload':
- if isfile(NEED_TO_UPLOAD_MARKER):
- print("Creating tarball...")
- run(['tar', 'czf', NODE_MODULES_TARBALL, 'node_modules'])
- print("Uploading tarball to S3... ({})".format(_tarball_size()))
- key.set_contents_from_filename(NODE_MODULES_TARBALL)
- print("node_modules cache successfully updated.")
- _delete_file_quietly(NEED_TO_UPLOAD_MARKER)
+ if isfile(NEED_TO_UPLOAD_MARKER): # FIXME
+ upload(directory)
else:
print("No need to upload anything.")
else: