瀏覽代碼

Parse vegas.*.css to find available transitions

Jay Salvat 10 年之前
父節點
當前提交
618e7a1b30
共有 4 個文件被更改,包括 10 次插入6 次删除
  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]);
+                        }
                     }
                 }
             }

File diff suppressed because it is too large
+ 1 - 1
dist/vegas.min.js


File diff suppressed because it is too large
+ 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]);
+                        }
                     }
                 }
             }

Some files were not shown because too many files changed in this diff