BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

default.js 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. $.noty.themes.defaultTheme = {
  2. name : 'defaultTheme',
  3. helpers : {
  4. borderFix: function () {
  5. if (this.options.dismissQueue) {
  6. var selector = this.options.layout.container.selector + ' ' + this.options.layout.parent.selector;
  7. switch (this.options.layout.name) {
  8. case 'top':
  9. $(selector).css({borderRadius: '0px 0px 0px 0px'});
  10. $(selector).last().css({borderRadius: '0px 0px 5px 5px'});
  11. break;
  12. case 'topCenter':
  13. case 'topLeft':
  14. case 'topRight':
  15. case 'bottomCenter':
  16. case 'bottomLeft':
  17. case 'bottomRight':
  18. case 'center':
  19. case 'centerLeft':
  20. case 'centerRight':
  21. case 'inline':
  22. $(selector).css({borderRadius: '0px 0px 0px 0px'});
  23. $(selector).first().css({'border-top-left-radius': '5px', 'border-top-right-radius': '5px'});
  24. $(selector).last().css({'border-bottom-left-radius': '5px', 'border-bottom-right-radius': '5px'});
  25. break;
  26. case 'bottom':
  27. $(selector).css({borderRadius: '0px 0px 0px 0px'});
  28. $(selector).first().css({borderRadius: '5px 5px 0px 0px'});
  29. break;
  30. default:
  31. break;
  32. }
  33. }
  34. }
  35. },
  36. modal : {
  37. css: {
  38. position : 'fixed',
  39. width : '100%',
  40. height : '100%',
  41. backgroundColor: '#000',
  42. zIndex : 10000,
  43. opacity : 0.6,
  44. display : 'none',
  45. left : 0,
  46. top : 0
  47. }
  48. },
  49. style : function () {
  50. this.$bar.css({
  51. overflow : 'hidden',
  52. background: "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAoCAQAAAClM0ndAAAAhklEQVR4AdXO0QrCMBBE0bttkk38/w8WRERpdyjzVOc+HxhIHqJGMQcFFkpYRQotLLSw0IJ5aBdovruMYDA/kT8plF9ZKLFQcgF18hDj1SbQOMlCA4kao0iiXmah7qBWPdxpohsgVZyj7e5I9KcID+EhiDI5gxBYKLBQYKHAQoGFAoEks/YEGHYKB7hFxf0AAAAASUVORK5CYII=') repeat-x scroll left top #fff",
  53. position : 'relative'
  54. });
  55. this.$progressBar.css({
  56. position : 'absolute',
  57. left : 0,
  58. bottom : 0,
  59. height : 4,
  60. width : '100%',
  61. backgroundColor: '#000000',
  62. opacity : 0.2,
  63. '-ms-filter' : 'progid:DXImageTransform.Microsoft.Alpha(Opacity=20)',
  64. filter : 'alpha(opacity=20)'
  65. });
  66. this.$message.css({
  67. textAlign: 'center',
  68. padding : '8px 10px 9px',
  69. width : 'auto',
  70. position : 'relative'
  71. });
  72. this.$closeButton.css({
  73. position : 'absolute',
  74. top : 4, right: 4,
  75. width : 10, height: 10,
  76. background: "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAQAAAAnOwc2AAAAxUlEQVR4AR3MPUoDURSA0e++uSkkOxC3IAOWNtaCIDaChfgXBMEZbQRByxCwk+BasgQRZLSYoLgDQbARxry8nyumPcVRKDfd0Aa8AsgDv1zp6pYd5jWOwhvebRTbzNNEw5BSsIpsj/kurQBnmk7sIFcCF5yyZPDRG6trQhujXYosaFoc+2f1MJ89uc76IND6F9BvlXUdpb6xwD2+4q3me3bysiHvtLYrUJto7PD/ve7LNHxSg/woN2kSz4txasBdhyiz3ugPGetTjm3XRokAAAAASUVORK5CYII=)",
  77. display : 'none',
  78. cursor : 'pointer'
  79. });
  80. this.$buttons.css({
  81. padding : 5,
  82. textAlign : 'right',
  83. borderTop : '1px solid #ccc',
  84. backgroundColor: '#fff'
  85. });
  86. this.$buttons.find('button').css({
  87. marginLeft: 5
  88. });
  89. this.$buttons.find('button:first').css({
  90. marginLeft: 0
  91. });
  92. this.$bar.on({
  93. mouseenter: function () {
  94. $(this).find('.noty_close').stop().fadeTo('normal', 1);
  95. },
  96. mouseleave: function () {
  97. $(this).find('.noty_close').stop().fadeTo('normal', 0);
  98. }
  99. });
  100. switch (this.options.layout.name) {
  101. case 'top':
  102. this.$bar.css({
  103. borderRadius: '0px 0px 5px 5px',
  104. borderBottom: '2px solid #eee',
  105. borderLeft : '2px solid #eee',
  106. borderRight : '2px solid #eee',
  107. boxShadow : "0 2px 4px rgba(0, 0, 0, 0.1)"
  108. });
  109. break;
  110. case 'topCenter':
  111. case 'center':
  112. case 'bottomCenter':
  113. case 'inline':
  114. this.$bar.css({
  115. borderRadius: '5px',
  116. border : '1px solid #eee',
  117. boxShadow : "0 2px 4px rgba(0, 0, 0, 0.1)"
  118. });
  119. this.$message.css({textAlign: 'center'});
  120. break;
  121. case 'topLeft':
  122. case 'topRight':
  123. case 'bottomLeft':
  124. case 'bottomRight':
  125. case 'centerLeft':
  126. case 'centerRight':
  127. this.$bar.css({
  128. borderRadius: '5px',
  129. border : '1px solid #eee',
  130. boxShadow : "0 2px 4px rgba(0, 0, 0, 0.1)"
  131. });
  132. this.$message.css({textAlign: 'left'});
  133. break;
  134. case 'bottom':
  135. this.$bar.css({
  136. borderRadius: '5px 5px 0px 0px',
  137. borderTop : '2px solid #eee',
  138. borderLeft : '2px solid #eee',
  139. borderRight : '2px solid #eee',
  140. boxShadow : "0 -2px 4px rgba(0, 0, 0, 0.1)"
  141. });
  142. break;
  143. default:
  144. this.$bar.css({
  145. border : '2px solid #eee',
  146. boxShadow: "0 2px 4px rgba(0, 0, 0, 0.1)"
  147. });
  148. break;
  149. }
  150. switch (this.options.type) {
  151. case 'alert':
  152. case 'notification':
  153. this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'});
  154. break;
  155. case 'warning':
  156. this.$bar.css({backgroundColor: '#FFEAA8', borderColor: '#FFC237', color: '#826200'});
  157. this.$buttons.css({borderTop: '1px solid #FFC237'});
  158. break;
  159. case 'error':
  160. this.$bar.css({backgroundColor: 'red', borderColor: 'darkred', color: '#FFF'});
  161. this.$message.css({fontWeight: 'bold'});
  162. this.$buttons.css({borderTop: '1px solid darkred'});
  163. break;
  164. case 'information':
  165. this.$bar.css({backgroundColor: '#57B7E2', borderColor: '#0B90C4', color: '#FFF'});
  166. this.$buttons.css({borderTop: '1px solid #0B90C4'});
  167. break;
  168. case 'success':
  169. this.$bar.css({backgroundColor: 'lightgreen', borderColor: '#50C24E', color: 'darkgreen'});
  170. this.$buttons.css({borderTop: '1px solid #50C24E'});
  171. break;
  172. default:
  173. this.$bar.css({backgroundColor: '#FFF', borderColor: '#CCC', color: '#444'});
  174. break;
  175. }
  176. },
  177. callback: {
  178. onShow : function () {
  179. $.noty.themes.defaultTheme.helpers.borderFix.apply(this);
  180. },
  181. onClose: function () {
  182. $.noty.themes.defaultTheme.helpers.borderFix.apply(this);
  183. }
  184. }
  185. };