Procházet zdrojové kódy

Parse vegas.*.css to find available transitions

Jay Salvat před 10 roky
rodič
revize
618e7a1b30
4 změnil soubory, kde provedl 10 přidání a 6 odebrání
  1. 5 3
      dist/vegas.js
  2. 1 1
      dist/vegas.min.js
  3. 0 0
      dist/vegas.min.js.map
  4. 4 2
      src/vegas.js

+ 5 - 3
dist/vegas.js

@@ -1,6 +1,6 @@
 /*!-----------------------------------------------------------------------------
  * Vegas - Fullscreen Backgrounds and Slideshows.
- * v2.0.0-wip - built 2015-01-18
+ * v2.0.0-wip - built 2015-01-20
  * Licensed under the MIT License.
  * http://vegas.jaysalvat.com/
  * ----------------------------------------------------------------------------
@@ -71,13 +71,15 @@
             var sheet = document.styleSheets[i],
                 rules = sheet.rules ? sheet.rules : sheet.cssRules;
 
-            if (/vegas(\.min)?\.css$/.test(sheet.href)) {
+            if (/vegas(\..*?)?(\.min)?\.css$/.test(sheet.href)) {
                 for (var j = 0; j < rules.length; j++) {
                     var rule  = rules[j],
                         match = /vegas\-transition\-(.*)-|\b/gi.exec(rule.selectorText);
                 
                     if (match && match[1]) {
-                        this.transitions.push(match[1]);
+                        if (this.transitions.indexOf(match[1]) === -1) {
+                            this.transitions.push(match[1]);
+                        }
                     }
                 }
             }

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/vegas.min.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/vegas.min.js.map


+ 4 - 2
src/vegas.js

@@ -62,13 +62,15 @@
             var sheet = document.styleSheets[i],
                 rules = sheet.rules ? sheet.rules : sheet.cssRules;
 
-            if (/vegas(\.min)?\.css$/.test(sheet.href)) {
+            if (/vegas(\..*?)?(\.min)?\.css$/.test(sheet.href)) {
                 for (var j = 0; j < rules.length; j++) {
                     var rule  = rules[j],
                         match = /vegas\-transition\-(.*)-|\b/gi.exec(rule.selectorText);
                 
                     if (match && match[1]) {
-                        this.transitions.push(match[1]);
+                        if (this.transitions.indexOf(match[1]) === -1) {
+                            this.transitions.push(match[1]);
+                        }
                     }
                 }
             }

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů