expressionui 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA1:
3
- metadata.gz: bed5a42f185efac12fee84fbc37deb07b7038e11
4
- data.tar.gz: 9c4eb5104097eec9931c7cb3ae7b3006b2c6b0f8
5
- SHA512:
6
- metadata.gz: 90c498a4f7a3c98898076f5bbc0b631a110c24332a6c3bef57d34e3330cafbf8ce7aef39d7f9affdeb5035918eca3d6eecbbe9648bf586a08a60b39d82d64854
7
- data.tar.gz: 4363e46e1c141b64b1c19afd6806ba62a3169eb261860743be4ad6a7dd2b75e434ffd099cd010ede6333322aef8b6ef171782f69e2ed11298d9fc694c4745b72
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 11256f25a87790c8f49299cd5537a0a67daf84fa
4
+ data.tar.gz: c2969ebf5e901ff2ab397ea5accad090df9ca228
5
+ SHA512:
6
+ metadata.gz: 7399362f647a7245116a8228318e640ca091536bd46d906264c985688cfa175e9ce62b4c56fa881502098cdcf2229279bc0747c1ece81db25d8bfc89e87e849c
7
+ data.tar.gz: dfd3ea146ddd2502bcdf9011cb5a1535a25428d5b41e1a5a083e13b113cc6453b768534b4bc867260e40719e8031366d4c38ce206fca3f9e763aa149daa0548d
@@ -1,6 +1,4 @@
1
- Copyright (c) 2013 Jason Cypret
2
-
3
- MIT License
1
+ Copyright 2013 Jason Cypret
4
2
 
5
3
  Permission is hereby granted, free of charge, to any person obtaining
6
4
  a copy of this software and associated documentation files (the
@@ -19,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
17
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
18
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
19
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,3 +1,3 @@
1
1
  module Expressionui
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/expressionui.rb CHANGED
@@ -1,5 +1,8 @@
1
1
  require "expressionui/version"
2
2
 
3
3
  module Expressionui
4
- # Your code goes here...
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
5
8
  end
@@ -0,0 +1,175 @@
1
+ /* expressionUI modal v2.0
2
+ * https://github.com/jasoncypret/expressionUI
3
+ *
4
+ * Copyright (c) 2013 Jason Cypret (http://jasoncypret.com/)
5
+ * Licensed under the MIT License
6
+ */
7
+
8
+ (function ($) {
9
+ var methods = {
10
+ defaults: {
11
+ title: 'Alert',
12
+ id: 'dialog',
13
+ closeID: 'closeDialog',
14
+ overlay: true,
15
+ overlayMrk: '<div class="pageOverlay"></div>',
16
+ appendTo: 'body',
17
+ threshold: 15,
18
+ ajax: '',
19
+ ajaxTarget: '',
20
+ notify: false,
21
+ width: 'auto',
22
+ height: 'auto',
23
+ header: true,
24
+ headerContent: '',
25
+ footer: true,
26
+ removeContent: false,
27
+ buttons: [
28
+ { buttonText: 'Ok', callback: function () {
29
+ return;
30
+ }, defaultButton: true }
31
+ ],
32
+ beforeOpen: $.noop,
33
+ afterOpen: $.noop,
34
+ beforeClose: $.noop,
35
+ afterClose: $.noop
36
+ },
37
+ init: function (options) {
38
+ options = $.extend({}, methods.defaults, options);
39
+ $(this).dialog('_open', options);
40
+ },
41
+ _open: function (options) {
42
+ options.beforeOpen();
43
+ var overlay = '',
44
+ isMobile = '',
45
+ buildModal,
46
+ buttons = ''
47
+ $.each(options.buttons, function (i, btn) {
48
+ var defaultBtn = '';
49
+ if (typeof btn.defaultButton != 'undefined')
50
+ defaultBtn = ' defaultButton';
51
+ var className = '';
52
+ if (typeof btn.className != 'undefined')
53
+ className = btn.className;
54
+ buttons += '<a href="javascript:;" id="dialogBtn' + i + '" class="' + className + defaultBtn + '"><span>' + btn.buttonText + '</span></a>';
55
+ });
56
+ if (options.width != "auto") {
57
+ options.width = options.width + 'px'
58
+ }
59
+ if (options.overlay) {
60
+ overlay = options.overlayMrk;
61
+ }
62
+ buildModal = '<div id="' + options.id + '" class="dialog_container ' + isMobile + ' ' + options.height + '">' + overlay + '<div style="width:' + options.width + ';" class="dialog">';
63
+ if (options.header) {
64
+ buildModal += '<h1><span class="container">' + options.title + '<a href="javascript:;" id="' + options.closeID + '" class="closeDialog ' + options.closeClass + '">x</a></span></h1>';
65
+ } else {
66
+ buttons += '<a href="javascript:;" class="closeDialog"><span>Cancel</span></a>';
67
+ }
68
+ buildModal += '<div class="dialogBody"><div class="container"><div class="d_content"></div></div></div>';
69
+ if (options.footer) {
70
+ buildModal += '<div class="dialogFooter"><span class="container">' + buttons + '</span></div>';
71
+ }
72
+ buildModal += '</div></div>';
73
+ $(options.appendTo).append(buildModal);
74
+ if (options.headerContent && options.header) {
75
+ $(options.headerContent).appendTo('#' + options.id + ' h1 .container').css('display', 'block');
76
+ }
77
+ $(this).appendTo('#' + options.id + ' .d_content').css('display', 'block');
78
+ if (options.ajax) {
79
+ $(this).dialog('ajax', options);
80
+ }
81
+ $('#' + options.id + ' .dialog').dialog('position', options);
82
+ $('#' + options.id).dialog('_setupEvents', options);
83
+ $(options.appendTo).addClass("dialog_open");
84
+ options.afterOpen.call();
85
+ },
86
+ ajax: function (options) {
87
+ var _this = $(this)
88
+ if (options.ajaxTarget) options.ajax = options.ajax + ' ' + options.ajaxTarget
89
+ if (options.notify) {
90
+ _this.parents('.dialogBody').notify({ style: "none", position: "middle", loading: "circles", sticky: true, content: "hidden" });
91
+ }
92
+ _this.load(options.ajax, function (response, status, xhr) {
93
+ _this.parents('.dialogBody').find('.notify').notify("close")
94
+ if (status == "error") {
95
+ var msg = "Sorry but there was an error: ";
96
+ alert(msg + xhr.status + " " + xhr.statusText);
97
+ }
98
+ });
99
+ },
100
+ close: function (options) {
101
+ options = $.extend({}, methods.defaults, options);
102
+ if ($('.dialog')[1]) {
103
+ var amount = $('.dialog').length - 1
104
+ $.each($('.dialog'), function (i, v) {
105
+ if (i === amount) {
106
+ $(v).parents('.dialog_container').fadeOut('fast');
107
+ }
108
+ });
109
+ } else {
110
+ $(options.appendTo).removeClass('dialog_open').addClass('dialog_close');
111
+ }
112
+ options.beforeClose();
113
+ var modal_content = $(this).find('.d_content').children(),
114
+ parent = $(this).parents('.dialog_container'),
115
+ body = $(this).find('.dialogBody'),
116
+ b_width = body.outerWidth(),
117
+ b_height = body.outerHeight();
118
+ body.css({width: b_width, height: b_height});
119
+ if (!options.removeContent) {
120
+ modal_content.appendTo(options.appendTo).css('display', 'none');
121
+ if (options.headerContent && options.header) {
122
+ $(options.headerContent).appendTo(options.appendTo).css('display', 'none');
123
+ }
124
+ } else {
125
+ modal_content.remove();
126
+ }
127
+ setTimeout(function () {
128
+ if (!$('.dialog')[1]) {
129
+ $(options.appendTo).removeClass("dialog_close");
130
+ }
131
+ parent.remove();
132
+ $(window).unbind("resize.modal");
133
+ }, 1000);
134
+ options.afterClose();
135
+ },
136
+ _setupEvents: function (options) {
137
+ var _this = $(this)
138
+ $(window).bind("resize.modal", function () {
139
+ _this.find('.dialog').dialog('position', options)
140
+ });
141
+ $(this).find('.dialogFooter a:not(.closeDialog)').each(function (i) {
142
+ $(this).click(options.buttons[i].context ? function () {
143
+ options.buttons[i].callback.apply(options.buttons[i].context)
144
+ } : options.buttons[i].callback);
145
+ });
146
+ $(this).find('.closeDialog').click(function () {
147
+ (typeof options.closeCallback === 'undefined') ? $('#' + options.id + ' .dialog').dialog('close', options) : options.closeCallback();
148
+ });
149
+ },
150
+ position: function (options) {
151
+ var dialog = $(this);
152
+ var dialogHeight = dialog.outerHeight();
153
+ var dialogPadding = dialogHeight - dialog.height();
154
+ var win = $(window).height();
155
+ var threshold = options.threshold;
156
+ if (options.height == 'auto') {
157
+ if ( dialogHeight > (win - (threshold * 2)) ) {
158
+ dialog.css('height', (win - ((threshold * 2) - dialogPadding)) );
159
+ }
160
+ dialog.css({ 'margin-top': -(dialog.outerHeight() / 2), 'margin-left': -(dialog.outerWidth() / 2) });
161
+ } else {
162
+ dialog.css({ 'top': threshold, 'bottom': threshold, 'margin-left': -(dialog.outerWidth() / 2) });
163
+ }
164
+ }
165
+ };
166
+ $.fn.dialog = function (method) {
167
+ if (methods[method]) {
168
+ return methods[ method ].apply(this, Array.prototype.slice.call(arguments, 1));
169
+ } else if (typeof method === 'object' || !method) {
170
+ return methods.init.apply(this, arguments);
171
+ } else {
172
+ $.error('Method ' + method + ' does not exist on jQuery.Modal');
173
+ }
174
+ }
175
+ })(jQuery);
@@ -0,0 +1,199 @@
1
+ /* expressionUI notify v2.0
2
+ * https://github.com/jasoncypret/expressionUI
3
+ *
4
+ * Copyright (c) 2013 Jason Cypret (http://jasoncypret.com/)
5
+ * Licensed under the MIT License
6
+ */
7
+
8
+ (function() {
9
+ (function($) {
10
+ var methods, t;
11
+ t = void 0;
12
+ methods = {
13
+ defaults: {
14
+ n_class: "",
15
+ message: null,
16
+ sticky: false,
17
+ width: "full",
18
+ style: "success",
19
+ append_type: "prepend",
20
+ allow_multiple: false,
21
+ invert: false,
22
+ icon: true,
23
+ loading: null,
24
+ position: "top",
25
+ duration: "7000",
26
+ content: "visible",
27
+ text_align: "bottom",
28
+ beforeOpen: $.noop,
29
+ afterOpen: $.noop,
30
+ beforeClose: $.noop,
31
+ afterClose: $.noop
32
+ },
33
+ init: function(options) {
34
+ options = $.extend({}, methods.defaults, options);
35
+ if (!options.allow_multiple) {
36
+ var selector = '';
37
+ switch (options.append_type) {
38
+ case 'prepend': case 'append':
39
+ selector = $(this).find('.notify');
40
+ break
41
+ case 'after':
42
+ selector = $(this).next('.notify');
43
+ break
44
+ case 'before':
45
+ selector = $(this).prev('.notify');
46
+ break
47
+ }
48
+ if (selector.length > 0) {
49
+ $(selector).notify("close", options, false);
50
+ }
51
+ return $(this).notify("_add_markup", options);
52
+ } else {
53
+ return $(this).notify("_add_markup", options);
54
+ }
55
+ },
56
+ _add_markup: function(options) {
57
+ var markup, iconType;
58
+
59
+ // Check ICON TRUE
60
+ if (options.style === "error") { iconType = 'x'; }
61
+ if (options.style === "success") { iconType = '/'; }
62
+ if (options.style === "tip") { iconType = '!'; }
63
+ if (options.style === "info") { iconType = 'i'; }
64
+ if (!options.message) { options.message = ''; }
65
+
66
+ markup = '<div style="display:none;" class="notify' + options.n_class + ' text_align_' + options.text_align + ' style_' + options.style + ' position_' + options.position + ' width_' + options.width + ' invert_' + options.invert + ' loading_' + options.loading + ' icon_' + options.icon +'">';
67
+ markup += '<div class="notify_wrap">';
68
+ if (options.icon) { markup += '<div class="icon">' + iconType + '</div>' }
69
+
70
+
71
+ switch(options.loading) {
72
+ case "dots":
73
+ markup += '<div class="indicator">';
74
+ markup += '<div class="dot1"></div>';
75
+ markup += '<div class="dot2"></div>';
76
+ markup += '<div class="dot3"></div>';
77
+ markup += '<div class="dot4"></div>';
78
+ markup += '<div class="dot5"></div>';
79
+ markup += '<div class="dot6"></div>';
80
+ markup += '<div class="dot7"></div>';
81
+ markup += '<div class="dot8"></div>';
82
+ markup += '</div>'
83
+ markup += '<div class="msg">' + options.message + '</div>';
84
+ break
85
+
86
+ case "spinner":
87
+ markup += '<div class="indicator"></div>';
88
+ markup += '<div class="msg">' + options.message + '</div>';
89
+ break
90
+
91
+ case "bars":
92
+ markup += '<div class="indicator"><div class="progress"></div></div>';
93
+ markup += '<div class="msg">' + options.message + '</div>';
94
+ break
95
+
96
+ case "circles":
97
+ markup += '<div class="indicator">';
98
+ markup += '<div class="circle1"></div>';
99
+ markup += '<div class="circle2"></div>'
100
+ markup += '<div class="circle3"></div>';
101
+ markup += '</div>';
102
+ markup += '<div class="msg">' + options.message + '</div>';
103
+ break
104
+
105
+ default:
106
+ (options.style == "loading") ? markup += '<div class="progress"></div><div class="msg">' + options.message + '</div>' : markup += '<div class="msg">' + options.message + '</div>' ;
107
+ markup += '<a class="notify_close" href="javascript:;"><span>x</span></a>';
108
+ markup += '</div>';
109
+ }
110
+
111
+ markup += '</div>';
112
+
113
+ return $(this).notify("_open", options, markup);
114
+ },
115
+
116
+ _open: function(options, markup) {
117
+ var selector
118
+ options.beforeOpen();
119
+ $(this).addClass('notify_container content_' + options.content)[options.append_type](markup);
120
+ switch (options.append_type) {
121
+ case 'prepend': case 'append':
122
+ selector = $(this).find('.notify[style*="display"]');
123
+ break
124
+ case 'after':
125
+ selector = $(this).next('.notify[style*="display"]');
126
+ break
127
+ case 'before':
128
+ selector = $(this).prev('.notify[style*="display"]');
129
+ break
130
+ }
131
+ $(selector).slideDown("fast");
132
+ options.afterOpen();
133
+ return $(this).notify("_setupEvents", options, selector);
134
+ },
135
+ close: function(options, animate) {
136
+ var selector
137
+ animate = typeof animate !== 'undefined' ? animate : true;
138
+ options = $.extend({}, methods.defaults, options);
139
+ options.beforeClose();
140
+ switch (options.append_type) {
141
+ case 'prepend': case 'append': case 'before':
142
+ selector = $(this).parents('.notify_container');
143
+ break
144
+ case 'after':
145
+ selector = $(this).prev('.notify_container');
146
+ break
147
+ }
148
+ if (!$(this).hasClass("loading_null")) {
149
+ animate = false;
150
+ }
151
+ if (animate) {
152
+ $(this).slideUp("fast", function() {
153
+ $(selector).removeClass('content_hidden content_overlay content_visible notify_container');
154
+ return $(this).remove();
155
+ });
156
+ } else {
157
+ $(selector).removeClass('content_hidden content_overlay content_visible notify_container');
158
+ return $(this).remove();
159
+ }
160
+ return options.afterClose();
161
+ },
162
+ close_all: function(options) {
163
+ options = $.extend({}, methods.defaults, options);
164
+ options.beforeClose();
165
+ $(".notify").slideUp("fast", function() {
166
+ $(this).closest('[class^=content_]').removeClass('content_hidden content_overlay content_visible');
167
+ return $(this).remove();
168
+ });
169
+ return options.afterClose();
170
+ },
171
+ loading: function(options) {
172
+ options = $.extend({}, methods.defaults, options);
173
+ },
174
+ _setupEvents: function(options, selector) {
175
+ if (!options.sticky) {
176
+ t = setTimeout(function() {
177
+ $(selector).notify("close", options);
178
+ return clearTimeout(t);
179
+ }, options.duration);
180
+ }
181
+ return $(selector).click(function() {
182
+ clearTimeout(t);
183
+ return $(selector).notify("close", options);
184
+ });
185
+ }
186
+ };
187
+ return $.fn.notify = function(method) {
188
+ if (methods[method]) {
189
+ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
190
+ } else if (typeof method === "object" || !method) {
191
+ return methods.init.apply(this, arguments);
192
+ } else {
193
+ return $.error("Method " + method + " does not exist on jQuery.Notify");
194
+ }
195
+ };
196
+ })(jQuery);
197
+
198
+ }).call(this);
199
+
@@ -0,0 +1,62 @@
1
+ /* expressionUI popover v2.0
2
+ * https://github.com/jasoncypret/expressionUI
3
+ *
4
+ * Copyright (c) 2013 Jason Cypret (http://jasoncypret.com/)
5
+ * Licensed under the MIT License
6
+ */
7
+
8
+ (function ($) {
9
+ $.fn.popover = function (options) {
10
+ var defaults = {
11
+ content: $('.popover'),
12
+ padding: 0,
13
+ aOffset: 55
14
+ };
15
+ options = $.extend({}, defaults, options);
16
+ var left = $(this).offset().left,
17
+ top = $(this).offset().top,
18
+ winTopMax = $(window).height() / 2,
19
+ winLeftMax = $(window).width() / 2,
20
+ pos = '',
21
+ num = 0,
22
+ tooltipHeight,
23
+ tooltipWidth;
24
+ (top >= 1 && top - $(window).scrollTop() <= winTopMax) ? pos = 'top' : pos = 'bottom';
25
+ (left >= 1 && left - $(window).scrollLeft() <= winLeftMax) ? pos += 'left' : pos += 'right';
26
+ options.content.addClass('popover_container ' + pos).css({visibility: 'hidden', display: 'block', zIndex: '9999'});
27
+ tooltipHeight = options.content.outerHeight();
28
+ tooltipWidth = options.content.outerWidth();
29
+ switch (pos) {
30
+ case "topleft":
31
+ top += ( $(this).outerHeight() * Math.PHI ) + options.padding;
32
+ left -= options.aOffset / (Math.PHI * Math.PHI);
33
+ break;
34
+ case "topright":
35
+ top += ( $(this).outerHeight() * Math.PHI ) + options.padding;
36
+ left -= tooltipWidth - options.aOffset;
37
+ break;
38
+ case "bottomleft":
39
+ top -= tooltipHeight + ($(this).outerHeight() / 2);
40
+ left -= options.aOffset / (Math.PHI * Math.PHI);
41
+ break;
42
+ case "bottomright":
43
+ top -= tooltipHeight + ($(this).outerHeight() / 2);
44
+ left -= tooltipWidth - options.aOffset;
45
+ break;
46
+ }
47
+ options.content.css({ 'left': left + 'px', 'top': top + 'px', 'display': 'none', 'visibility': 'visible' }).show();
48
+ $(this).addClass('popover_active')
49
+ var removePopup = function (e) {
50
+ num++;
51
+ if (num > 1) {
52
+ $(options.content).removeClass('popover_container topleft bottomleft topright bottomright').hide();
53
+ $(document).unbind('click.popover content.scroll');
54
+ $('.popover_active').removeClass('popover_active')
55
+ }
56
+ };
57
+ $(document).bind('click.popover content.scroll', removePopup);
58
+ }
59
+ })(jQuery);
60
+
61
+ //TODO: Move to a global place
62
+ Math.PHI = 1.61803398875;
@@ -0,0 +1,55 @@
1
+ a:visited
2
+ //color: $link
3
+
4
+ .btn
5
+ +btn(#fff)
6
+ &.highlight
7
+ +btn($highlight)
8
+ &.accent
9
+ +btn($accent)
10
+
11
+ .amp
12
+ +amp
13
+
14
+ .markdown_style
15
+ //+markdown_style
16
+
17
+ .offscreen
18
+ +offscreen
19
+
20
+ a.nav_action
21
+ +nav_action
22
+
23
+ a.btn_filter
24
+ +btn_filter
25
+
26
+ .icon
27
+ +icon_font
28
+
29
+ .icon_left:before
30
+ +icon_inline
31
+ padding-right: $pad/1.5
32
+
33
+ .icon_right:after
34
+ +icon_inline
35
+ padding-left: $pad/1.5
36
+
37
+ .invisible
38
+ visibility: hidden
39
+ position: relative
40
+ +group
41
+
42
+ .left
43
+ float: left
44
+
45
+ .middle
46
+ display: block
47
+
48
+ .right
49
+ float: right
50
+
51
+ .group
52
+ +group
53
+
54
+ .inline
55
+ +inline_block