rmr-util 1.1.128 → 1.1.129

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/index.html CHANGED
@@ -105,7 +105,7 @@
105
105
  <button class="">Submit</button>
106
106
  </form>
107
107
 
108
- <img data-rmr-srcset="https://im.vsco.co/aws-us-west-2/5d508d/2222331/5e478e7de6e0db2b1ea8fbbd/vsco5e478e87283a5.jpg?w=1184&dpr=2" class="rmr-loader">
108
+ <img data-rmr-srcset="https://im.vsco.co/aws-us-west-2/5d508d/2222331/5e478e7de6e0db2b1ea8fbbd/vsco5e478e87283a5.jpg?w=1184&dpr=2">
109
109
 
110
110
  <form class="xhr" action="xhr/form.php" method="post">
111
111
  <input type="checkbox" name="check" value="rmr">
package/index.js CHANGED
@@ -438,7 +438,7 @@
438
438
 
439
439
  animateScroll();
440
440
  },
441
-
441
+
442
442
  /**
443
443
  *
444
444
  *
@@ -681,66 +681,66 @@
681
681
  return n;
682
682
  },
683
683
 
684
- /**
685
- * Make loader
686
- *
687
- * @return {String} SVG element
688
- */
689
- loader = function() {
690
-
691
- /*
692
- const svg = makeElement('svg', {
693
- version: '1.1',
694
- class: 'rmr-loader',
695
- xmlns: 'http://www.w3.org/2000/svg',
696
- 'xmlns:xlink': 'http://www.w3.org/1999/xlink',
697
- x: '0px',
698
- y: '0px',
699
- width: '40px',
700
- height: '40px',
701
- viewBox: '0 0 40 40',
702
- 'enable-background': 'new 0 0 40 40',
703
- 'xml:space': 'preserve'
704
- });
705
-
706
- svg.innerHTML =
707
- '<path opacity="0.2" fill="#000" d="M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946 s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634 c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z"></path>' +
708
- '<path fill="#000" d="M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0 C22.32,8.481,24.301,9.057,26.013,10.047z">' +
709
- '<animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 20 20" to="360 20 20" dur="0.8s" repeatCount="indefinite"></animateTransform>' +
710
- '</path>';
711
- */
712
-
713
- return '<svg version="1.1" class="rmr-loader" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="40px" height="40px" viewBox="0 0 40 40" enable-background="new 0 0 40 40" xml:space="preserve">' +
714
- '<path opacity="0.2" fill="#000" d="M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946 s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634 c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z"></path>' +
715
- '<path fill="#000" d="M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0 C22.32,8.481,24.301,9.057,26.013,10.047z">' +
716
- '<animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 20 20" to="360 20 20" dur="0.8s" repeatCount="indefinite"></animateTransform>' +
717
- '</path>' +
718
- '</svg>';
719
-
720
- // return svg;
721
- },
722
-
723
-
724
- /**
725
- * Bind variables to placeholders in a string
726
- *
727
- * @param {String} subject
728
- * @param {Object} lookup table containing key/value pairs
729
- * @return {String} string
730
- */
731
- bindString = function(subject, lookup) {
732
-
733
- let str = subject;
734
-
735
- for (const key in lookup) {
736
- if (! objectHas(lookup, key)) {
737
- continue;
738
- }
739
- str = str.replace(key, lookup[key])
740
- }
741
-
742
- return str;
743
- },
684
+ // *
685
+ // * Make loader
686
+ // *
687
+ // * @return {String} SVG element
688
+ // */
689
+ // loader = function() {
690
+ //
691
+ //
692
+ // const svg = makeElement('svg', {
693
+ // version: '1.1',
694
+ // class: 'rmr-loader',
695
+ // xmlns: 'http://www.w3.org/2000/svg',
696
+ // 'xmlns:xlink': 'http://www.w3.org/1999/xlink',
697
+ // x: '0px',
698
+ // y: '0px',
699
+ // width: '40px',
700
+ // height: '40px',
701
+ // viewBox: '0 0 40 40',
702
+ // 'enable-background': 'new 0 0 40 40',
703
+ // 'xml:space': 'preserve'
704
+ // });
705
+ //
706
+ // svg.innerHTML =
707
+ // '<path opacity="0.2" fill="#000" d="M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946 s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634 c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z"></path>' +
708
+ // '<path fill="#000" d="M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0 C22.32,8.481,24.301,9.057,26.013,10.047z">' +
709
+ // '<animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 20 20" to="360 20 20" dur="0.8s" repeatCount="indefinite"></animateTransform>' +
710
+ // '</path>';
711
+ // */
712
+ //
713
+ // return '<svg version="1.1" class="rmr-loader" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="40px" height="40px" viewBox="0 0 40 40" enable-background="new 0 0 40 40" xml:space="preserve">' +
714
+ // '<path opacity="0.2" fill="#000" d="M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,14.946,14.946 s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634 c0-6.425,5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,26.541,26.626,31.749,20.201,31.749z"></path>' +
715
+ // '<path fill="#000" d="M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0 C22.32,8.481,24.301,9.057,26.013,10.047z">' +
716
+ // '<animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 20 20" to="360 20 20" dur="0.8s" repeatCount="indefinite"></animateTransform>' +
717
+ // '</path>' +
718
+ // '</svg>';
719
+ //
720
+ // // return svg;
721
+ // },
722
+
723
+
724
+ // *
725
+ // * Bind variables to placeholders in a string
726
+ // *
727
+ // * @param {String} subject
728
+ // * @param {Object} lookup table containing key/value pairs
729
+ // * @return {String} string
730
+ // */
731
+ // bindString = function(subject, lookup) {
732
+ //
733
+ // let str = subject;
734
+ //
735
+ // for (const key in lookup) {
736
+ // if (! objectHas(lookup, key)) {
737
+ // continue;
738
+ // }
739
+ // str = str.replace(key, lookup[key])
740
+ // }
741
+ //
742
+ // return str;
743
+ // },
744
744
 
745
745
  /**
746
746
  * Localize a string
@@ -1013,7 +1013,7 @@
1013
1013
  }
1014
1014
 
1015
1015
  while ( (parent = parent.parentNode) !== null) {
1016
- if (parent === ancestor) {
1016
+ if (parent === ancestor) {
1017
1017
  return parent;
1018
1018
  }
1019
1019
  }
@@ -1106,7 +1106,7 @@
1106
1106
  }
1107
1107
 
1108
1108
  return true;
1109
-
1109
+
1110
1110
  },
1111
1111
 
1112
1112
  /**
@@ -1226,14 +1226,14 @@
1226
1226
 
1227
1227
  // for notifications
1228
1228
  const subs = {
1229
-
1229
+
1230
1230
  };
1231
1231
 
1232
1232
  /**
1233
-
1234
-
1235
- @param w {Int} -
1236
- @return {String} -
1233
+
1234
+
1235
+ @param w {Int} -
1236
+ @return {String} -
1237
1237
  */
1238
1238
  const breakpointUp = (w) => {
1239
1239
  const arg = parseInt(w ? w : window.innerWidth, 10);
@@ -1248,8 +1248,8 @@
1248
1248
 
1249
1249
  /**
1250
1250
 
1251
- @param w {Int} -
1252
- @return {String} -
1251
+ @param w {Int} -
1252
+ @return {String} -
1253
1253
  */
1254
1254
  const breakpointDown = (w) => {
1255
1255
  const
@@ -1265,7 +1265,7 @@
1265
1265
  };
1266
1266
 
1267
1267
  /**
1268
-
1268
+
1269
1269
  @return {Object} - { names : widths }
1270
1270
  */
1271
1271
  const breakpointGet = (name) => {
@@ -1280,7 +1280,7 @@
1280
1280
 
1281
1281
 
1282
1282
  /**
1283
-
1283
+
1284
1284
  @return {Object} - { names : widths }
1285
1285
  */
1286
1286
  const breakpointAll = () => {
@@ -1369,7 +1369,7 @@
1369
1369
  if (a.host !== location.host && obj.exclude.indexOf(a.host) < 0) {
1370
1370
  a.classList.add('rmr-external');
1371
1371
  a.setAttribute('target', '_blank');
1372
- }
1372
+ }
1373
1373
  }
1374
1374
  },
1375
1375
  loader: function(options) {
@@ -1526,7 +1526,7 @@
1526
1526
  Breakpoint: {
1527
1527
 
1528
1528
  /**
1529
-
1529
+
1530
1530
  */
1531
1531
  up: breakpointUp,
1532
1532
  down: breakpointDown,
@@ -1539,7 +1539,7 @@
1539
1539
  isURL: isURL,
1540
1540
  guid: guid,
1541
1541
  localize: localize,
1542
- bind: bindString,
1542
+ // bind: bindString,
1543
1543
  formatSeconds: (seconds) => {
1544
1544
 
1545
1545
  seconds = parseInt(seconds);
@@ -1572,7 +1572,7 @@
1572
1572
  },
1573
1573
  Notify: {
1574
1574
  post: notifyPost,
1575
- subscribe: notifySubscribe
1575
+ subscribe: notifySubscribe
1576
1576
  },
1577
1577
  Object: {
1578
1578
  keys: objectKeys,
@@ -1597,7 +1597,7 @@
1597
1597
  ancestor: ancestor,
1598
1598
  matches: selectorMatches,
1599
1599
  remove: removeNode,
1600
- loader: loader,
1600
+ // loader: loader,
1601
1601
  get: getElement,
1602
1602
  getAll: getElements,
1603
1603
  prune: pruneElement,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rmr-util",
3
- "version": "1.1.128",
3
+ "version": "1.1.129",
4
4
  "description": "JS & CSS for your browser",
5
5
  "url": "https://davidfmiller.github.io/rmr-util/",
6
6
  "license": "ISC",
@@ -5,7 +5,8 @@
5
5
  */
6
6
 
7
7
 
8
- body.rmr-js img[data-rmr-src] {
8
+ body.rmr-js img[data-rmr-src],
9
+ body.rmr-js img[data-rmr-srcset] {
9
10
  opacity: 0;
10
11
  transition: opacity 0.5s;
11
12
  &.rmr-loaded {
package/webpack.config.js CHANGED
@@ -1,38 +1,22 @@
1
+ /* globals require, __dirname, module, webpack */
1
2
 
2
3
  const
3
- path = require('path'),
4
- webpack = require('webpack'),
5
- terser = require('terser-webpack-plugin');
4
+ path = require('path');
5
+ webpack = require('webpack');
6
6
 
7
7
  const config = {
8
8
  entry: './build.js',
9
+ // mode: 'development',
10
+ mode: 'production',
9
11
  output: {
10
- path: path.resolve(__dirname, 'docs/build/'),
12
+ path: path.resolve(__dirname, 'docs/build'),
11
13
  filename: 'rmr-util.bundle.js'
12
14
  },
13
- mode: 'production',
14
- // mode: 'development',
15
- watch: true,
16
- plugins : [
17
- new terser({
18
- extractComments: false,
19
- test: /\.js(\?.*)?$/i
20
- })
15
+ plugins: [
21
16
  ],
17
+ watch: true,
22
18
  module: {
23
19
  rules: [
24
- {
25
- test: /\.js$/,
26
- // include: path.resolve(__dirname, 'src'),
27
- use: [{
28
- loader: 'babel-loader',
29
- options: {
30
- presets: [
31
- ['es2015']
32
- ]
33
- }
34
- }]
35
- }
36
20
  ]
37
21
  }
38
22
  };