|
1 | 1 | ;(function(root, factory) { |
2 | 2 | if (typeof define === 'function' && define.amd) { |
3 | | - define(['Notify'], factory); |
| 3 | + define(['notify.js/dist/notify.js'], factory); |
4 | 4 | } else if (typeof exports === 'object') { |
5 | | - module.exports = factory(require('Notify')); |
| 5 | + module.exports = factory(require('notify.js/dist/notify.js')); |
6 | 6 | } else { |
7 | 7 | root.wtGenius = factory(root.Notify); |
8 | 8 | } |
9 | 9 | }(this, function(Notify) { |
10 | 10 | var wtGenius = angular.module('wt.genius', []); |
| 11 | +/** |
| 12 | + * $wtRetina |
| 13 | + * |
| 14 | + * Version: 1.0.0 - 2015-10-19 |
| 15 | + * Anthor: zhenshuai |
| 16 | + */ |
| 17 | +angular.module('wt.genius') |
| 18 | + .provider('$wtRetina', [function () { |
| 19 | + var defaults = { |
| 20 | + onchange: function () { |
| 21 | + //console.log('dpi 切换事件'); |
| 22 | + } |
| 23 | + }; |
| 24 | + var configOptions = {}; |
| 25 | + this.config = function (value) { |
| 26 | + configOptions = value; |
| 27 | + }; |
| 28 | + this.$get = [ |
| 29 | + function () { |
| 30 | + var mediaQuery = "(min--moz-device-pixel-ratio: 1.5),\ |
| 31 | + (-o-min-device-pixel-ratio: 3/2),\ |
| 32 | + (-webkit-min-device-pixel-ratio: 1.5),\ |
| 33 | + (min-device-pixel-ratio: 1.5),\ |
| 34 | + (min-resolution: 144dpi),\ |
| 35 | + (min-resolution: 1.5dppx)"; |
| 36 | + |
| 37 | + var matchObj = window.matchMedia(mediaQuery); |
| 38 | + return { |
| 39 | + isRetina: matchObj.matches, |
| 40 | + media : matchObj.media |
| 41 | + }; |
| 42 | + } |
| 43 | + ]; |
| 44 | + }]); |
11 | 45 | /** |
12 | 46 | * $wtNotify |
13 | 47 | * |
@@ -91,39 +125,5 @@ angular.module('wt.genius') |
91 | 125 | return result; |
92 | 126 | }]; |
93 | 127 | }]); |
94 | | -/** |
95 | | - * $wtRetina |
96 | | - * |
97 | | - * Version: 1.0.0 - 2015-10-19 |
98 | | - * Anthor: zhenshuai |
99 | | - */ |
100 | | -angular.module('wt.genius') |
101 | | - .provider('$wtRetina', [function () { |
102 | | - var defaults = { |
103 | | - onchange: function () { |
104 | | - //console.log('dpi 切换事件'); |
105 | | - } |
106 | | - }; |
107 | | - var configOptions = {}; |
108 | | - this.config = function (value) { |
109 | | - configOptions = value; |
110 | | - }; |
111 | | - this.$get = [ |
112 | | - function () { |
113 | | - var mediaQuery = "(min--moz-device-pixel-ratio: 1.5),\ |
114 | | - (-o-min-device-pixel-ratio: 3/2),\ |
115 | | - (-webkit-min-device-pixel-ratio: 1.5),\ |
116 | | - (min-device-pixel-ratio: 1.5),\ |
117 | | - (min-resolution: 144dpi),\ |
118 | | - (min-resolution: 1.5dppx)"; |
119 | | - |
120 | | - var matchObj = window.matchMedia(mediaQuery); |
121 | | - return { |
122 | | - isRetina: matchObj.matches, |
123 | | - media : matchObj.media |
124 | | - }; |
125 | | - } |
126 | | - ]; |
127 | | - }]); |
128 | 128 | return wtGenius; |
129 | 129 | })); |
0 commit comments