')).parent().data('animated', false);
74 |
75 | if ($element.data('animated') !== false)
76 | $div.addClass('switch-animate').data('animated', true);
77 |
78 | $div
79 | .append($switchLeft)
80 | .append($label)
81 | .append($switchRight);
82 |
83 | $element.find('>div').addClass(
84 | $element.find('input').is(':checked') ? 'switch-on' : 'switch-off'
85 | );
86 |
87 | if ($element.find('input').is(':disabled'))
88 | $(this).addClass('deactivate');
89 |
90 | var changeStatus = function ($this) {
91 | $this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
92 | };
93 |
94 | $element.on('keydown', function (e) {
95 | if (e.keyCode === 32) {
96 | e.stopImmediatePropagation();
97 | e.preventDefault();
98 | changeStatus($(e.target).find('span:first'));
99 | }
100 | });
101 |
102 | $switchLeft.on('click', function (e) {
103 | changeStatus($(this));
104 | });
105 |
106 | $switchRight.on('click', function (e) {
107 | changeStatus($(this));
108 | });
109 |
110 | $element.find('input').on('change', function (e) {
111 | var $this = $(this)
112 | , $element = $this.parent()
113 | , thisState = $this.is(':checked')
114 | , state = $element.is('.switch-off');
115 |
116 | e.preventDefault();
117 |
118 | $element.css('left', '');
119 |
120 | if (state === thisState) {
121 |
122 | if (thisState)
123 | $element.removeClass('switch-off').addClass('switch-on');
124 | else $element.removeClass('switch-on').addClass('switch-off');
125 |
126 | if ($element.data('animated') !== false)
127 | $element.addClass("switch-animate");
128 |
129 | $element.parent().trigger('switch-change', {'el': $this, 'value': thisState})
130 | }
131 | });
132 |
133 | $element.find('label').on('mousedown touchstart', function (e) {
134 | var $this = $(this);
135 | moving = false;
136 |
137 | e.preventDefault();
138 | e.stopImmediatePropagation();
139 |
140 | $this.closest('div').removeClass('switch-animate');
141 |
142 | if ($this.closest('.has-switch').is('.deactivate'))
143 | $this.unbind('click');
144 | else {
145 | $this.on('mousemove touchmove', function (e) {
146 | var $element = $(this).closest('.switch')
147 | , relativeX = (e.pageX || e.originalEvent.targetTouches[0].pageX) - $element.offset().left
148 | , percent = (relativeX / $element.width()) * 100
149 | , left = 25
150 | , right = 75;
151 |
152 | moving = true;
153 |
154 | if (percent < left)
155 | percent = left;
156 | else if (percent > right)
157 | percent = right;
158 |
159 | $element.find('>div').css('left', (percent - right) + "%")
160 | });
161 |
162 | $this.on('click touchend', function (e) {
163 | var $this = $(this)
164 | , $target = $(e.target)
165 | , $myCheckBox = $target.siblings('input');
166 |
167 | e.stopImmediatePropagation();
168 | e.preventDefault();
169 |
170 | $this.unbind('mouseleave');
171 |
172 | if (moving)
173 | $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25));
174 | else $myCheckBox.prop("checked", !$myCheckBox.is(":checked"));
175 |
176 | moving = false;
177 | $myCheckBox.trigger('change');
178 | });
179 |
180 | $this.on('mouseleave', function (e) {
181 | var $this = $(this)
182 | , $myCheckBox = $this.siblings('input');
183 |
184 | e.preventDefault();
185 | e.stopImmediatePropagation();
186 |
187 | $this.unbind('mouseleave');
188 | $this.trigger('mouseup');
189 |
190 | $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25)).trigger('change');
191 | });
192 |
193 | $this.on('mouseup', function (e) {
194 | e.stopImmediatePropagation();
195 | e.preventDefault();
196 |
197 | $(this).unbind('mousemove');
198 | });
199 | }
200 | });
201 | }
202 | );
203 | },
204 | toggleActivation: function () {
205 | $(this).toggleClass('deactivate');
206 | },
207 | isActive: function () {
208 | return !$(this).hasClass('deactivate');
209 | },
210 | setActive: function (active) {
211 | if (active)
212 | $(this).removeClass('deactivate');
213 | else $(this).addClass('deactivate');
214 | },
215 | toggleState: function (skipOnChange) {
216 | var $input = $(this).find('input:checkbox');
217 | $input.prop('checked', !$input.is(':checked')).trigger('change', skipOnChange);
218 | },
219 | setState: function (value, skipOnChange) {
220 | $(this).find('input:checkbox').prop('checked', value).trigger('change', skipOnChange);
221 | },
222 | status: function () {
223 | return $(this).find('input:checkbox').is(':checked');
224 | },
225 | destroy: function () {
226 | var $div = $(this).find('div')
227 | , $checkbox;
228 |
229 | $div.find(':not(input:checkbox)').remove();
230 |
231 | $checkbox = $div.children();
232 | $checkbox.unwrap().unwrap();
233 |
234 | $checkbox.unbind('change');
235 |
236 | return $checkbox;
237 | }
238 | };
239 |
240 | if (methods[method])
241 | return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
242 | else if (typeof method === 'object' || !method)
243 | return methods.init.apply(this, arguments);
244 | else
245 | $.error('Method ' + method + ' does not exist!');
246 | };
247 | }(jQuery);
248 |
249 | $(function () {
250 | $('.switch')['bootstrapSwitch']();
251 | });
252 |
--------------------------------------------------------------------------------
/sqlfile/cms.sql:
--------------------------------------------------------------------------------
1 | USE `cms`;
2 | -- USE `unaux_24579808_halawatha`;
3 |
4 | -- Dumping structure for table cms.admin
5 | CREATE TABLE IF NOT EXISTS `admin` (
6 | `id` int(11) NOT NULL AUTO_INCREMENT,
7 | `username` varchar(250) NOT NULL,
8 | `password` varchar(250) NOT NULL,
9 | `updationDate` varchar(255) NOT NULL,
10 | PRIMARY KEY (`id`)
11 | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
12 |
13 | -- Dumping data for table cms.admin: ~0 rows (approximately)
14 | /*!40000 ALTER TABLE `admin` DISABLE KEYS */;
15 | INSERT INTO `admin` (`id`, `username`, `password`, `updationDate`) VALUES
16 | (1, 'admin', 'f925916e2754e5e03f75dd58a5733251', '18-10-2016 04:18:16');
17 | /*!40000 ALTER TABLE `admin` ENABLE KEYS */;
18 |
19 | -- Dumping structure for table cms.category
20 | CREATE TABLE IF NOT EXISTS `category` (
21 | `id` int(11) NOT NULL AUTO_INCREMENT,
22 | `categoryName` varchar(255) DEFAULT NULL,
23 | `categoryDescription` longtext,
24 | `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
25 | `updationDate` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
26 | PRIMARY KEY (`id`)
27 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
28 |
29 | -- Dumping data for table cms.category: ~2 rows (approximately)
30 | /*!40000 ALTER TABLE `category` DISABLE KEYS */;
31 | INSERT INTO `category` (`id`, `categoryName`, `categoryDescription`, `creationDate`, `updationDate`) VALUES
32 | (1, 'E-commerce', 'E-commerce', '2017-03-28 12:40:55', '2019-06-24 12:36:04'),
33 | (2, 'general', 'dsdas', '2017-06-11 16:24:06', '0000-00-00 00:00:00');
34 | /*!40000 ALTER TABLE `category` ENABLE KEYS */;
35 |
36 | -- Dumping structure for table cms.complaintremark
37 | CREATE TABLE IF NOT EXISTS `complaintremark` (
38 | `id` int(11) NOT NULL AUTO_INCREMENT,
39 | `complaintNumber` int(11) NOT NULL,
40 | `status` varchar(255) NOT NULL,
41 | `remark` mediumtext NOT NULL,
42 | `remarkDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
43 | PRIMARY KEY (`id`)
44 | ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
45 |
46 | -- Dumping data for table cms.complaintremark: ~8 rows (approximately)
47 | /*!40000 ALTER TABLE `complaintremark` DISABLE KEYS */;
48 | INSERT INTO `complaintremark` (`id`, `complaintNumber`, `status`, `remark`, `remarkDate`) VALUES
49 | (1, 2, 'in process', 'Hi this for demo', '2017-04-01 22:59:19'),
50 | (2, 9, 'in process', 'hiiiiiiiiiiiiiiiiiiii', '2017-04-02 00:07:59'),
51 | (3, 3, 'in process', 'test', '2017-05-02 21:27:43'),
52 | (4, 19, 'closed', 'case solved', '2017-06-11 16:48:33'),
53 | (5, 1, 'closed', 'This sample text for testing', '2018-09-05 22:38:26'),
54 | (6, 5, 'in process', 'test Data', '2019-06-24 12:56:17'),
55 | (7, 23, 'in process', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', '2019-06-24 16:04:47'),
56 | (8, 23, 'closed', 'Issue resolved ', '2019-06-24 16:07:08');
57 | /*!40000 ALTER TABLE `complaintremark` ENABLE KEYS */;
58 |
59 | -- Dumping structure for table cms.state
60 | CREATE TABLE IF NOT EXISTS `state` (
61 | `id` int(11) NOT NULL AUTO_INCREMENT,
62 | `stateName` varchar(255) DEFAULT NULL,
63 | `stateDescription` tinytext,
64 | `postingDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
65 | `updationDate` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
66 | PRIMARY KEY (`id`)
67 | ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
68 |
69 | -- Dumping data for table cms.state: ~4 rows (approximately)
70 | /*!40000 ALTER TABLE `state` DISABLE KEYS */;
71 | INSERT INTO `state` (`id`, `stateName`, `stateDescription`, `postingDate`, `updationDate`) VALUES
72 | (3, 'Uttar Pradesh', '', '2016-10-18 17:05:02', '0000-00-00 00:00:00'),
73 | (4, 'Punjab', 'pbPB', '2016-10-18 17:05:58', '0000-00-00 00:00:00'),
74 | (5, 'Haryana', 'Haryana', '2017-03-28 12:50:36', '0000-00-00 00:00:00'),
75 | (6, 'Delhi', 'Delhi', '2017-06-11 16:24:12', '2019-06-24 12:54:19');
76 | /*!40000 ALTER TABLE `state` ENABLE KEYS */;
77 |
78 | -- Dumping structure for table cms.subcategory
79 | CREATE TABLE IF NOT EXISTS `subcategory` (
80 | `id` int(11) NOT NULL AUTO_INCREMENT,
81 | `categoryid` int(11) DEFAULT NULL,
82 | `subcategory` varchar(255) DEFAULT NULL,
83 | `creationDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
84 | `updationDate` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
85 | PRIMARY KEY (`id`)
86 | ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
87 |
88 | -- Dumping data for table cms.subcategory: ~3 rows (approximately)
89 | /*!40000 ALTER TABLE `subcategory` DISABLE KEYS */;
90 | INSERT INTO `subcategory` (`id`, `categoryid`, `subcategory`, `creationDate`, `updationDate`) VALUES
91 | (1, 1, 'Online Shopping', '2017-03-28 12:41:07', '0000-00-00 00:00:00'),
92 | (2, 1, 'E-wllaet', '2017-03-28 12:41:20', '0000-00-00 00:00:00'),
93 | (3, 2, 'other', '2019-06-24 12:36:44', '2019-06-24 12:51:38');
94 | /*!40000 ALTER TABLE `subcategory` ENABLE KEYS */;
95 |
96 | -- Dumping structure for table cms.tblproducts
97 | CREATE TABLE IF NOT EXISTS `tblproducts` (
98 | `id` int(11) NOT NULL,
99 | `userId` int(11) DEFAULT NULL,
100 | `image` varchar(255) DEFAULT NULL,
101 | `regDate` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
102 | `lastUpdationDate` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
103 | PRIMARY KEY (`id`),
104 | KEY `complaintNumber` (`id`)
105 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
106 |
107 | -- Dumping data for table cms.tblproducts: ~9 rows (approximately)
108 | /*!40000 ALTER TABLE `tblproducts` DISABLE KEYS */;
109 | INSERT INTO `tblproducts` (`id`, `userId`, `image`, `regDate`, `lastUpdationDate`) VALUES
110 | (1, 2147483647, '568011570032237.jpg', '2019-10-02 21:33:57', NULL),
111 | (3434, 2147483647, '8022361569994218.jpg', '2019-10-02 11:00:18', NULL),
112 | (9867, 2147483647, '7541731569994356', '2019-10-02 11:02:36', NULL),
113 | (12345, 2147483647, '870351569993746.png', '2019-10-02 10:52:26', NULL),
114 | (123456, 2147483647, '9179691569994192.png', '2019-10-02 10:59:52', NULL),
115 | (876875, 2147483647, '5361781569994302.F.M Fazrin.png', '2019-10-02 11:01:42', NULL),
116 | (9989876, 2147483647, '2924661569995039.png', '2019-10-02 11:13:59', NULL),
117 | (12343434, 2147483647, '6654411569993911.jpg', '2019-10-02 10:55:11', NULL),
118 | (76767565, 2147483647, '8983061569994699.png', '2019-10-02 11:08:19', NULL),
119 | (876888787, 2147483647, '4138611569997215.png', '2019-10-02 11:50:15', NULL),
120 | (1231122323, 2147483647, '5849621569994906.jpg', '2019-10-02 11:11:46', NULL),
121 | (2147483647, 2147483647, '2112701569994992.jpg', '2019-10-02 11:13:12', NULL);
122 | /*!40000 ALTER TABLE `tblproducts` ENABLE KEYS */;
123 |
124 | -- Dumping structure for table cms.userlog
125 | CREATE TABLE IF NOT EXISTS `userlog` (
126 | `id` int(11) NOT NULL AUTO_INCREMENT,
127 | `uid` int(11) NOT NULL,
128 | `username` varchar(255) NOT NULL,
129 | `userip` binary(16) NOT NULL,
130 | `loginTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
131 | `logout` varchar(255) NOT NULL,
132 | `status` int(11) NOT NULL,
133 | PRIMARY KEY (`id`)
134 | ) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=latin1;
135 |
136 | -- Dumping data for table cms.userlog: ~29 rows (approximately)
137 | /*!40000 ALTER TABLE `userlog` DISABLE KEYS */;
138 | INSERT INTO `userlog` (`id`, `uid`, `username`, `userip`, `loginTime`, `logout`, `status`) VALUES
139 | (1, 1, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2017-03-28 22:34:36', '', 1),
140 | (2, 1, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2017-03-29 20:32:26', '', 1),
141 | (3, 1, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2017-03-30 20:28:00', '', 1),
142 | (4, 0, 'dsad', _binary 0x3A3A3100000000000000000000000000, '2017-03-31 23:09:07', '', 0),
143 | (5, 0, 'dwerwer', _binary 0x3A3A3100000000000000000000000000, '2017-03-31 23:11:22', '', 0),
144 | (6, 0, 'ffert', _binary 0x3A3A3100000000000000000000000000, '2017-03-31 23:11:29', '', 0),
145 | (7, 0, 'ewrwe', _binary 0x3A3A3100000000000000000000000000, '2017-03-31 23:12:12', '', 0),
146 | (8, 0, 'ewrwe', _binary 0x3A3A3100000000000000000000000000, '2017-03-31 23:17:51', '', 0),
147 | (9, 0, 'ewrwe', _binary 0x3A3A3100000000000000000000000000, '2017-03-31 23:17:54', '', 0),
148 | (10, 0, 'fsdfsdff', _binary 0x3A3A3100000000000000000000000000, '2017-03-31 23:18:11', '', 0),
149 | (11, 1, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2017-03-31 23:19:25', '', 1),
150 | (12, 1, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2017-04-02 00:22:35', '02-04-2017 12:24:41 AM', 1),
151 | (13, 1, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2017-04-02 00:28:09', '02-04-2017 12:50:42 AM', 1),
152 | (14, 1, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2017-04-02 01:08:15', '02-04-2017 01:08:19 AM', 1),
153 | (15, 0, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2017-04-03 00:20:20', '', 0),
154 | (16, 1, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2017-04-03 00:20:28', '03-04-2017 12:26:50 AM', 1),
155 | (17, 1, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2017-05-02 23:31:26', '', 1),
156 | (18, 0, 'test@gm.com', _binary 0x3A3A3100000000000000000000000000, '2017-06-11 16:18:50', '', 0),
157 | (19, 5, 'abc@abc.com', _binary 0x3A3A3100000000000000000000000000, '2017-06-11 16:26:30', '11-06-2017 04:39:15 PM', 1),
158 | (20, 6, 'xyz@xyz.com', _binary 0x3A3A3100000000000000000000000000, '2017-06-11 16:43:28', '11-06-2017 04:45:46 PM', 1),
159 | (21, 6, 'xyz@xyz.com', _binary 0x3A3A3100000000000000000000000000, '2017-06-11 16:49:45', '11-06-2017 04:50:02 PM', 1),
160 | (22, 1, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2018-05-24 23:56:07', '', 1),
161 | (23, 0, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2018-09-05 22:35:22', '', 0),
162 | (24, 0, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2018-09-05 22:35:32', '', 0),
163 | (25, 1, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2018-09-05 22:37:12', '', 1),
164 | (26, 1, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2019-06-24 15:57:30', '24-06-2019 04:11:08 PM', 1),
165 | (27, 1, 'anuj.lpu1@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2019-10-02 01:21:53', '02-10-2019 01:24:53 AM', 1),
166 | (28, 2, 'mfmfazrin1986@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2019-10-02 01:31:24', '', 1),
167 | (29, 2, 'mfmfazrin1986@gmail.com', _binary 0x3A3A3100000000000000000000000000, '2019-10-02 01:48:48', '02-10-2019 09:14:49 PM', 1);
168 | /*!40000 ALTER TABLE `userlog` ENABLE KEYS */;
169 |
170 | -- Dumping structure for table cms.users
171 | CREATE TABLE IF NOT EXISTS `users` (
172 | `id` int(11) NOT NULL AUTO_INCREMENT,
173 | `fullName` varchar(255) DEFAULT NULL,
174 | `userEmail` varchar(255) DEFAULT NULL,
175 | `password` varchar(255) DEFAULT NULL,
176 | `contactNo` bigint(11) DEFAULT NULL,
177 | `address` tinytext,
178 | `State` varchar(255) DEFAULT NULL,
179 | `country` varchar(255) DEFAULT NULL,
180 | `pincode` int(6) DEFAULT NULL,
181 | `userImage` varchar(255) DEFAULT NULL,
182 | `regDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
183 | `updationDate` timestamp NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
184 | `status` int(1) DEFAULT NULL,
185 | PRIMARY KEY (`id`)
186 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
187 |
188 | -- Dumping data for table cms.users: ~0 rows (approximately)
189 | /*!40000 ALTER TABLE `users` DISABLE KEYS */;
190 | INSERT INTO `users` (`id`, `fullName`, `userEmail`, `password`, `contactNo`, `address`, `State`, `country`, `pincode`, `userImage`, `regDate`, `updationDate`, `status`) VALUES
191 | (1, 'Anuj Kumar', 'anuj.lpu1@gmail.com', 'f925916e2754e5e03f75dd58a5733251', 9999857860, 'Shakarpur', 'Uttar Pradesh', 'India', 110092, '6e8024ec26c292f258ec30f01e0392dc.png', '2017-03-28 17:14:52', '2019-06-24 16:09:44', 1),
192 | (2, 'Mohamed Farook Mohamed Fazrin', 'mfmfazrin1986@gmail.com', '71e17aba47d4d6364748518455afd09e', 772049123, NULL, NULL, NULL, NULL, 'c9c2bce82b74978a3e87079f2ce6e52b.png', '2019-10-02 01:31:01', '2019-10-02 08:00:51', 1);
193 | /*!40000 ALTER TABLE `users` ENABLE KEYS */;
194 |
195 | /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
196 | /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
197 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
198 |
--------------------------------------------------------------------------------
/assets/js/gritter/js/jquery.gritter.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Gritter for jQuery
3 | * http://www.boedesign.com/
4 | *
5 | * Copyright (c) 2012 Jordan Boesch
6 | * Dual licensed under the MIT and GPL licenses.
7 | *
8 | * Date: February 24, 2012
9 | * Version: 1.7.4
10 | */
11 |
12 | (function($){
13 |
14 | /**
15 | * Set it up as an object under the jQuery namespace
16 | */
17 | $.gritter = {};
18 |
19 | /**
20 | * Set up global options that the user can over-ride
21 | */
22 | $.gritter.options = {
23 | position: '',
24 | class_name: '', // could be set to 'gritter-light' to use white notifications
25 | fade_in_speed: 'medium', // how fast notifications fade in
26 | fade_out_speed: 1000, // how fast the notices fade out
27 | time: 6000 // hang on the screen for...
28 | }
29 |
30 | /**
31 | * Add a gritter notification to the screen
32 | * @see Gritter#add();
33 | */
34 | $.gritter.add = function(params){
35 |
36 | try {
37 | return Gritter.add(params || {});
38 | } catch(e) {
39 |
40 | var err = 'Gritter Error: ' + e;
41 | (typeof(console) != 'undefined' && console.error) ?
42 | console.error(err, params) :
43 | alert(err);
44 |
45 | }
46 |
47 | }
48 |
49 | /**
50 | * Remove a gritter notification from the screen
51 | * @see Gritter#removeSpecific();
52 | */
53 | $.gritter.remove = function(id, params){
54 | Gritter.removeSpecific(id, params || {});
55 | }
56 |
57 | /**
58 | * Remove all notifications
59 | * @see Gritter#stop();
60 | */
61 | $.gritter.removeAll = function(params){
62 | Gritter.stop(params || {});
63 | }
64 |
65 | /**
66 | * Big fat Gritter object
67 | * @constructor (not really since its object literal)
68 | */
69 | var Gritter = {
70 |
71 | // Public - options to over-ride with $.gritter.options in "add"
72 | position: '',
73 | fade_in_speed: '',
74 | fade_out_speed: '',
75 | time: '',
76 |
77 | // Private - no touchy the private parts
78 | _custom_timer: 0,
79 | _item_count: 0,
80 | _is_setup: 0,
81 | _tpl_close: '
',
82 | _tpl_title: '
[[title]]',
83 | _tpl_item: '
',
84 | _tpl_wrap: '
',
85 |
86 | /**
87 | * Add a gritter notification to the screen
88 | * @param {Object} params The object that contains all the options for drawing the notification
89 | * @return {Integer} The specific numeric id to that gritter notification
90 | */
91 | add: function(params){
92 | // Handle straight text
93 | if(typeof(params) == 'string'){
94 | params = {text:params};
95 | }
96 |
97 | // We might have some issues if we don't have a title or text!
98 | if(!params.text){
99 | throw 'You must supply "text" parameter.';
100 | }
101 |
102 | // Check the options and set them once
103 | if(!this._is_setup){
104 | this._runSetup();
105 | }
106 |
107 | // Basics
108 | var title = params.title,
109 | text = params.text,
110 | image = params.image || '',
111 | sticky = params.sticky || false,
112 | item_class = params.class_name || $.gritter.options.class_name,
113 | position = $.gritter.options.position,
114 | time_alive = params.time || '';
115 |
116 | this._verifyWrapper();
117 |
118 | this._item_count++;
119 | var number = this._item_count,
120 | tmp = this._tpl_item;
121 |
122 | // Assign callbacks
123 | $(['before_open', 'after_open', 'before_close', 'after_close']).each(function(i, val){
124 | Gritter['_' + val + '_' + number] = ($.isFunction(params[val])) ? params[val] : function(){}
125 | });
126 |
127 | // Reset
128 | this._custom_timer = 0;
129 |
130 | // A custom fade time set
131 | if(time_alive){
132 | this._custom_timer = time_alive;
133 | }
134 |
135 | var image_str = (image != '') ? '

' : '',
136 | class_name = (image != '') ? 'gritter-with-image' : 'gritter-without-image';
137 |
138 | // String replacements on the template
139 | if(title){
140 | title = this._str_replace('[[title]]',title,this._tpl_title);
141 | }else{
142 | title = '';
143 | }
144 |
145 | tmp = this._str_replace(
146 | ['[[title]]', '[[text]]', '[[close]]', '[[image]]', '[[number]]', '[[class_name]]', '[[item_class]]'],
147 | [title, text, this._tpl_close, image_str, this._item_count, class_name, item_class], tmp
148 | );
149 |
150 | // If it's false, don't show another gritter message
151 | if(this['_before_open_' + number]() === false){
152 | return false;
153 | }
154 |
155 | $('#gritter-notice-wrapper').addClass(position).append(tmp);
156 |
157 | var item = $('#gritter-item-' + this._item_count);
158 |
159 | item.fadeIn(this.fade_in_speed, function(){
160 | Gritter['_after_open_' + number]($(this));
161 | });
162 |
163 | if(!sticky){
164 | this._setFadeTimer(item, number);
165 | }
166 |
167 | // Bind the hover/unhover states
168 | $(item).bind('mouseenter mouseleave', function(event){
169 | if(event.type == 'mouseenter'){
170 | if(!sticky){
171 | Gritter._restoreItemIfFading($(this), number);
172 | }
173 | }
174 | else {
175 | if(!sticky){
176 | Gritter._setFadeTimer($(this), number);
177 | }
178 | }
179 | Gritter._hoverState($(this), event.type);
180 | });
181 |
182 | // Clicking (X) makes the perdy thing close
183 | $(item).find('.gritter-close').click(function(){
184 | Gritter.removeSpecific(number, {}, null, true);
185 | });
186 |
187 | return number;
188 |
189 | },
190 |
191 | /**
192 | * If we don't have any more gritter notifications, get rid of the wrapper using this check
193 | * @private
194 | * @param {Integer} unique_id The ID of the element that was just deleted, use it for a callback
195 | * @param {Object} e The jQuery element that we're going to perform the remove() action on
196 | * @param {Boolean} manual_close Did we close the gritter dialog with the (X) button
197 | */
198 | _countRemoveWrapper: function(unique_id, e, manual_close){
199 |
200 | // Remove it then run the callback function
201 | e.remove();
202 | this['_after_close_' + unique_id](e, manual_close);
203 |
204 | // Check if the wrapper is empty, if it is.. remove the wrapper
205 | if($('.gritter-item-wrapper').length == 0){
206 | $('#gritter-notice-wrapper').remove();
207 | }
208 |
209 | },
210 |
211 | /**
212 | * Fade out an element after it's been on the screen for x amount of time
213 | * @private
214 | * @param {Object} e The jQuery element to get rid of
215 | * @param {Integer} unique_id The id of the element to remove
216 | * @param {Object} params An optional list of params to set fade speeds etc.
217 | * @param {Boolean} unbind_events Unbind the mouseenter/mouseleave events if they click (X)
218 | */
219 | _fade: function(e, unique_id, params, unbind_events){
220 |
221 | var params = params || {},
222 | fade = (typeof(params.fade) != 'undefined') ? params.fade : true,
223 | fade_out_speed = params.speed || this.fade_out_speed,
224 | manual_close = unbind_events;
225 |
226 | this['_before_close_' + unique_id](e, manual_close);
227 |
228 | // If this is true, then we are coming from clicking the (X)
229 | if(unbind_events){
230 | e.unbind('mouseenter mouseleave');
231 | }
232 |
233 | // Fade it out or remove it
234 | if(fade){
235 |
236 | e.animate({
237 | opacity: 0
238 | }, fade_out_speed, function(){
239 | e.animate({ height: 0 }, 300, function(){
240 | Gritter._countRemoveWrapper(unique_id, e, manual_close);
241 | })
242 | })
243 |
244 | }
245 | else {
246 |
247 | this._countRemoveWrapper(unique_id, e);
248 |
249 | }
250 |
251 | },
252 |
253 | /**
254 | * Perform actions based on the type of bind (mouseenter, mouseleave)
255 | * @private
256 | * @param {Object} e The jQuery element
257 | * @param {String} type The type of action we're performing: mouseenter or mouseleave
258 | */
259 | _hoverState: function(e, type){
260 |
261 | // Change the border styles and add the (X) close button when you hover
262 | if(type == 'mouseenter'){
263 |
264 | e.addClass('hover');
265 |
266 | // Show close button
267 | e.find('.gritter-close').show();
268 |
269 | }
270 | // Remove the border styles and hide (X) close button when you mouse out
271 | else {
272 |
273 | e.removeClass('hover');
274 |
275 | // Hide close button
276 | e.find('.gritter-close').hide();
277 |
278 | }
279 |
280 | },
281 |
282 | /**
283 | * Remove a specific notification based on an ID
284 | * @param {Integer} unique_id The ID used to delete a specific notification
285 | * @param {Object} params A set of options passed in to determine how to get rid of it
286 | * @param {Object} e The jQuery element that we're "fading" then removing
287 | * @param {Boolean} unbind_events If we clicked on the (X) we set this to true to unbind mouseenter/mouseleave
288 | */
289 | removeSpecific: function(unique_id, params, e, unbind_events){
290 |
291 | if(!e){
292 | var e = $('#gritter-item-' + unique_id);
293 | }
294 |
295 | // We set the fourth param to let the _fade function know to
296 | // unbind the "mouseleave" event. Once you click (X) there's no going back!
297 | this._fade(e, unique_id, params || {}, unbind_events);
298 |
299 | },
300 |
301 | /**
302 | * If the item is fading out and we hover over it, restore it!
303 | * @private
304 | * @param {Object} e The HTML element to remove
305 | * @param {Integer} unique_id The ID of the element
306 | */
307 | _restoreItemIfFading: function(e, unique_id){
308 |
309 | clearTimeout(this['_int_id_' + unique_id]);
310 | e.stop().css({ opacity: '', height: '' });
311 |
312 | },
313 |
314 | /**
315 | * Setup the global options - only once
316 | * @private
317 | */
318 | _runSetup: function(){
319 |
320 | for(opt in $.gritter.options){
321 | this[opt] = $.gritter.options[opt];
322 | }
323 | this._is_setup = 1;
324 |
325 | },
326 |
327 | /**
328 | * Set the notification to fade out after a certain amount of time
329 | * @private
330 | * @param {Object} item The HTML element we're dealing with
331 | * @param {Integer} unique_id The ID of the element
332 | */
333 | _setFadeTimer: function(e, unique_id){
334 |
335 | var timer_str = (this._custom_timer) ? this._custom_timer : this.time;
336 | this['_int_id_' + unique_id] = setTimeout(function(){
337 | Gritter._fade(e, unique_id);
338 | }, timer_str);
339 |
340 | },
341 |
342 | /**
343 | * Bring everything to a halt
344 | * @param {Object} params A list of callback functions to pass when all notifications are removed
345 | */
346 | stop: function(params){
347 |
348 | // callbacks (if passed)
349 | var before_close = ($.isFunction(params.before_close)) ? params.before_close : function(){};
350 | var after_close = ($.isFunction(params.after_close)) ? params.after_close : function(){};
351 |
352 | var wrap = $('#gritter-notice-wrapper');
353 | before_close(wrap);
354 | wrap.fadeOut(function(){
355 | $(this).remove();
356 | after_close();
357 | });
358 |
359 | },
360 |
361 | /**
362 | * An extremely handy PHP function ported to JS, works well for templating
363 | * @private
364 | * @param {String/Array} search A list of things to search for
365 | * @param {String/Array} replace A list of things to replace the searches with
366 | * @return {String} sa The output
367 | */
368 | _str_replace: function(search, replace, subject, count){
369 |
370 | var i = 0, j = 0, temp = '', repl = '', sl = 0, fl = 0,
371 | f = [].concat(search),
372 | r = [].concat(replace),
373 | s = subject,
374 | ra = r instanceof Array, sa = s instanceof Array;
375 | s = [].concat(s);
376 |
377 | if(count){
378 | this.window[count] = 0;
379 | }
380 |
381 | for(i = 0, sl = s.length; i < sl; i++){
382 |
383 | if(s[i] === ''){
384 | continue;
385 | }
386 |
387 | for (j = 0, fl = f.length; j < fl; j++){
388 |
389 | temp = s[i] + '';
390 | repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0];
391 | s[i] = (temp).split(f[j]).join(repl);
392 |
393 | if(count && s[i] !== temp){
394 | this.window[count] += (temp.length-s[i].length) / f[j].length;
395 | }
396 |
397 | }
398 | }
399 |
400 | return sa ? s : s[0];
401 |
402 | },
403 |
404 | /**
405 | * A check to make sure we have something to wrap our notices with
406 | * @private
407 | */
408 | _verifyWrapper: function(){
409 |
410 | if($('#gritter-notice-wrapper').length == 0){
411 | $('body').append(this._tpl_wrap);
412 | }
413 |
414 | }
415 |
416 | }
417 |
418 | })(jQuery);
419 |
--------------------------------------------------------------------------------
/assets/js/jquery.tagsinput.js:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | jQuery Tags Input Plugin 1.3.3
4 |
5 | Copyright (c) 2011 XOXCO, Inc
6 |
7 | Documentation for this plugin lives here:
8 | http://xoxco.com/clickable/jquery-tags-input
9 |
10 | Licensed under the MIT license:
11 | http://www.opensource.org/licenses/mit-license.php
12 |
13 | ben@xoxco.com
14 |
15 | */
16 |
17 | (function($) {
18 |
19 | var delimiter = new Array();
20 | var tags_callbacks = new Array();
21 | $.fn.doAutosize = function(o){
22 | var minWidth = $(this).data('minwidth'),
23 | maxWidth = $(this).data('maxwidth'),
24 | val = '',
25 | input = $(this),
26 | testSubject = $('#'+$(this).data('tester_id'));
27 |
28 | if (val === (val = input.val())) {return;}
29 |
30 | // Enter new content into testSubject
31 | var escaped = val.replace(/&/g, '&').replace(/\s/g,' ').replace(//g, '>');
32 | testSubject.html(escaped);
33 | // Calculate new width + whether to change
34 | var testerWidth = testSubject.width(),
35 | newWidth = (testerWidth + o.comfortZone) >= minWidth ? testerWidth + o.comfortZone : minWidth,
36 | currentWidth = input.width(),
37 | isValidWidthChange = (newWidth < currentWidth && newWidth >= minWidth)
38 | || (newWidth > minWidth && newWidth < maxWidth);
39 |
40 | // Animate width
41 | if (isValidWidthChange) {
42 | input.width(newWidth);
43 | }
44 |
45 |
46 | };
47 | $.fn.resetAutosize = function(options){
48 | // alert(JSON.stringify(options));
49 | var minWidth = $(this).data('minwidth') || options.minInputWidth || $(this).width(),
50 | maxWidth = $(this).data('maxwidth') || options.maxInputWidth || ($(this).closest('.tagsinput').width() - options.inputPadding),
51 | val = '',
52 | input = $(this),
53 | testSubject = $('
').css({
54 | position: 'absolute',
55 | top: -9999,
56 | left: -9999,
57 | width: 'auto',
58 | fontSize: input.css('fontSize'),
59 | fontFamily: input.css('fontFamily'),
60 | fontWeight: input.css('fontWeight'),
61 | letterSpacing: input.css('letterSpacing'),
62 | whiteSpace: 'nowrap'
63 | }),
64 | testerId = $(this).attr('id')+'_autosize_tester';
65 | if(! $('#'+testerId).length > 0){
66 | testSubject.attr('id', testerId);
67 | testSubject.appendTo('body');
68 | }
69 |
70 | input.data('minwidth', minWidth);
71 | input.data('maxwidth', maxWidth);
72 | input.data('tester_id', testerId);
73 | input.css('width', minWidth);
74 | };
75 |
76 | $.fn.addTag = function(value,options) {
77 | options = jQuery.extend({focus:false,callback:true},options);
78 | this.each(function() {
79 | var id = $(this).attr('id');
80 |
81 | var tagslist = $(this).val().split(delimiter[id]);
82 | if (tagslist[0] == '') {
83 | tagslist = new Array();
84 | }
85 |
86 | value = jQuery.trim(value);
87 |
88 | if (options.unique) {
89 | var skipTag = $(this).tagExist(value);
90 | if(skipTag == true) {
91 | //Marks fake input as not_valid to let styling it
92 | $('#'+id+'_tag').addClass('not_valid');
93 | }
94 | } else {
95 | var skipTag = false;
96 | }
97 |
98 | if (value !='' && skipTag != true) {
99 | $('
').addClass('tag').append(
100 | $('').text(value).append(' '),
101 | $('', {
102 | href : '#',
103 | title : 'Remove tag',
104 | text : ''
105 | }).click(function () {
106 | return $('#' + id).removeTag(escape(value));
107 | })
108 | ).insertBefore('#' + id + '_addTag');
109 |
110 | tagslist.push(value);
111 |
112 | $('#'+id+'_tag').val('');
113 | if (options.focus) {
114 | $('#'+id+'_tag').focus();
115 | } else {
116 | $('#'+id+'_tag').blur();
117 | }
118 |
119 | $.fn.tagsInput.updateTagsField(this,tagslist);
120 |
121 | if (options.callback && tags_callbacks[id] && tags_callbacks[id]['onAddTag']) {
122 | var f = tags_callbacks[id]['onAddTag'];
123 | f.call(this, value);
124 | }
125 | if(tags_callbacks[id] && tags_callbacks[id]['onChange'])
126 | {
127 | var i = tagslist.length;
128 | var f = tags_callbacks[id]['onChange'];
129 | f.call(this, $(this), tagslist[i-1]);
130 | }
131 | }
132 |
133 | });
134 |
135 | return false;
136 | };
137 |
138 | $.fn.removeTag = function(value) {
139 | value = unescape(value);
140 | this.each(function() {
141 | var id = $(this).attr('id');
142 |
143 | var old = $(this).val().split(delimiter[id]);
144 |
145 | $('#'+id+'_tagsinput .tag').remove();
146 | str = '';
147 | for (i=0; i< old.length; i++) {
148 | if (old[i]!=value) {
149 | str = str + delimiter[id] +old[i];
150 | }
151 | }
152 |
153 | $.fn.tagsInput.importTags(this,str);
154 |
155 | if (tags_callbacks[id] && tags_callbacks[id]['onRemoveTag']) {
156 | var f = tags_callbacks[id]['onRemoveTag'];
157 | f.call(this, value);
158 | }
159 | });
160 |
161 | return false;
162 | };
163 |
164 | $.fn.tagExist = function(val) {
165 | var id = $(this).attr('id');
166 | var tagslist = $(this).val().split(delimiter[id]);
167 | return (jQuery.inArray(val, tagslist) >= 0); //true when tag exists, false when not
168 | };
169 |
170 | // clear all existing tags and import new ones from a string
171 | $.fn.importTags = function(str) {
172 | id = $(this).attr('id');
173 | $('#'+id+'_tagsinput .tag').remove();
174 | $.fn.tagsInput.importTags(this,str);
175 | }
176 |
177 | $.fn.tagsInput = function(options) {
178 | var settings = jQuery.extend({
179 | interactive:true,
180 | defaultText:'',
181 | minChars:0,
182 | width:'',
183 | height:'',
184 | autocomplete: {selectFirst: false },
185 | 'hide':true,
186 | 'delimiter':',',
187 | 'unique':true,
188 | removeWithBackspace:true,
189 | placeholderColor:'#666666',
190 | autosize: true,
191 | comfortZone: 20,
192 | inputPadding: 6*2
193 | },options);
194 |
195 | this.each(function() {
196 | if (settings.hide) {
197 | $(this).hide();
198 | }
199 | var id = $(this).attr('id');
200 | if (!id || delimiter[$(this).attr('id')]) {
201 | id = $(this).attr('id', 'tags' + new Date().getTime()).attr('id');
202 | }
203 |
204 | var data = jQuery.extend({
205 | pid:id,
206 | real_input: '#'+id,
207 | holder: '#'+id+'_tagsinput',
208 | input_wrapper: '#'+id+'_addTag',
209 | fake_input: '#'+id+'_tag'
210 | },settings);
211 |
212 | delimiter[id] = data.delimiter;
213 |
214 | if (settings.onAddTag || settings.onRemoveTag || settings.onChange) {
215 | tags_callbacks[id] = new Array();
216 | tags_callbacks[id]['onAddTag'] = settings.onAddTag;
217 | tags_callbacks[id]['onRemoveTag'] = settings.onRemoveTag;
218 | tags_callbacks[id]['onChange'] = settings.onChange;
219 | }
220 |
221 | var containerClass = $('#'+id).attr('class').replace('tagsinput', '');
222 | var markup = '';
229 |
230 | $(markup).insertAfter(this);
231 |
232 | $(data.holder).css('width',settings.width);
233 | $(data.holder).css('min-height',settings.height);
234 | $(data.holder).css('height','100%');
235 |
236 | if ($(data.real_input).val()!='') {
237 | $.fn.tagsInput.importTags($(data.real_input),$(data.real_input).val());
238 | }
239 | if (settings.interactive) {
240 | $(data.fake_input).val($(data.fake_input).attr('data-default'));
241 | $(data.fake_input).css('color',settings.placeholderColor);
242 | $(data.fake_input).resetAutosize(settings);
243 |
244 | $(data.holder).bind('click',data,function(event) {
245 | $(event.data.fake_input).focus();
246 | });
247 |
248 | $(data.fake_input).bind('focus',data,function(event) {
249 | if ($(event.data.fake_input).val()==$(event.data.fake_input).attr('data-default')) {
250 | $(event.data.fake_input).val('');
251 | }
252 | $(event.data.fake_input).css('color','#000000');
253 | });
254 |
255 | if (settings.autocomplete_url != undefined) {
256 | autocomplete_options = {source: settings.autocomplete_url};
257 | for (attrname in settings.autocomplete) {
258 | autocomplete_options[attrname] = settings.autocomplete[attrname];
259 | }
260 |
261 | if (jQuery.Autocompleter !== undefined) {
262 | $(data.fake_input).autocomplete(settings.autocomplete_url, settings.autocomplete);
263 | $(data.fake_input).bind('result',data,function(event,data,formatted) {
264 | if (data) {
265 | $('#'+id).addTag(data[0] + "",{focus:true,unique:(settings.unique)});
266 | }
267 | });
268 | } else if (jQuery.ui.autocomplete !== undefined) {
269 | $(data.fake_input).autocomplete(autocomplete_options);
270 | $(data.fake_input).bind('autocompleteselect',data,function(event,ui) {
271 | $(event.data.real_input).addTag(ui.item.value,{focus:true,unique:(settings.unique)});
272 | return false;
273 | });
274 | }
275 |
276 |
277 | } else {
278 | // if a user tabs out of the field, create a new tag
279 | // this is only available if autocomplete is not used.
280 | $(data.fake_input).bind('blur',data,function(event) {
281 | var d = $(this).attr('data-default');
282 | if ($(event.data.fake_input).val()!='' && $(event.data.fake_input).val()!=d) {
283 | if( (event.data.minChars <= $(event.data.fake_input).val().length) && (!event.data.maxChars || (event.data.maxChars >= $(event.data.fake_input).val().length)) )
284 | $(event.data.real_input).addTag($(event.data.fake_input).val(),{focus:true,unique:(settings.unique)});
285 | } else {
286 | $(event.data.fake_input).val($(event.data.fake_input).attr('data-default'));
287 | $(event.data.fake_input).css('color',settings.placeholderColor);
288 | }
289 | return false;
290 | });
291 |
292 | }
293 | // if user types a comma, create a new tag
294 | $(data.fake_input).bind('keypress',data,function(event) {
295 | if (event.which==event.data.delimiter.charCodeAt(0) || event.which==13 ) {
296 | event.preventDefault();
297 | if( (event.data.minChars <= $(event.data.fake_input).val().length) && (!event.data.maxChars || (event.data.maxChars >= $(event.data.fake_input).val().length)) )
298 | $(event.data.real_input).addTag($(event.data.fake_input).val(),{focus:true,unique:(settings.unique)});
299 | $(event.data.fake_input).resetAutosize(settings);
300 | return false;
301 | } else if (event.data.autosize) {
302 | $(event.data.fake_input).doAutosize(settings);
303 |
304 | }
305 | });
306 | //Delete last tag on backspace
307 | data.removeWithBackspace && $(data.fake_input).bind('keydown', function(event)
308 | {
309 | if(event.keyCode == 8 && $(this).val() == '')
310 | {
311 | event.preventDefault();
312 | var last_tag = $(this).closest('.tagsinput').find('.tag:last').text();
313 | var id = $(this).attr('id').replace(/_tag$/, '');
314 | last_tag = last_tag.replace(/[\s\u00a0]+x$/, '');
315 | $('#' + id).removeTag(escape(last_tag));
316 | $(this).trigger('focus');
317 | }
318 | });
319 | $(data.fake_input).blur();
320 |
321 | //Removes the not_valid class when user changes the value of the fake input
322 | if(data.unique) {
323 | $(data.fake_input).keydown(function(event){
324 | if(event.keyCode == 8 || String.fromCharCode(event.which).match(/\w+|[áéíóúÁÉÍÓÚñÑ,/]+/)) {
325 | $(this).removeClass('not_valid');
326 | }
327 | });
328 | }
329 | } // if settings.interactive
330 | });
331 |
332 | return this;
333 |
334 | };
335 |
336 | $.fn.tagsInput.updateTagsField = function(obj,tagslist) {
337 | var id = $(obj).attr('id');
338 | $(obj).val(tagslist.join(delimiter[id]));
339 | };
340 |
341 | $.fn.tagsInput.importTags = function(obj,val) {
342 | $(obj).val('');
343 | var id = $(obj).attr('id');
344 | var tags = val.split(delimiter[id]);
345 | for (i=0; i, usually */
136 | .fc-widget-content { /* , usually */
137 | border: 1px solid #ddd;
138 | color: #646464;
139 | }
140 |
141 | .fc-state-highlight { /* | today cell */ /* TODO: add .fc-today to | */
142 | background: #fff;
143 | }
144 |
145 | .fc-cell-overlay { /* semi-transparent rectangle while dragging */
146 | background: #9cf;
147 | opacity: .2;
148 | filter: alpha(opacity=20); /* for IE */
149 | }
150 |
151 |
152 |
153 | /* Buttons
154 | ------------------------------------------------------------------------*/
155 |
156 | .fc-button {
157 | position: relative;
158 | overflow: hidden;
159 | display: inline-block;
160 | cursor: pointer;
161 | top: -52px;
162 | }
163 |
164 | .fc-header {
165 | margin-bottom:-20px;
166 | }
167 |
168 | .fc-state-default { /* non-theme */
169 | border-style: solid;
170 | border-width: 1px 0;
171 | }
172 |
173 | .fc-button-inner {
174 | position: relative;
175 | float: left;
176 | overflow: hidden;
177 | padding: 5px;
178 |
179 | }
180 |
181 | .fc-state-default .fc-button-inner { /* non-theme */
182 | border-style: solid;
183 | border-width: 0 1px;
184 | }
185 |
186 | .fc-button-content {
187 | position: relative;
188 | float: left;
189 | height: 1.9em;
190 | line-height: 1.9em;
191 | padding: 0 .6em;
192 | white-space: nowrap;
193 | }
194 |
195 | /* icon (for jquery ui) */
196 |
197 | .fc-button-content .fc-icon-wrap {
198 | position: relative;
199 | float: left;
200 | top: 50%;
201 | }
202 |
203 | .fc-button-content .ui-icon {
204 | position: relative;
205 | float: left;
206 | margin-top: -50%;
207 | *margin-top: 0;
208 | *top: -50%;
209 | }
210 |
211 | /* gloss effect */
212 |
213 | .fc-state-default .fc-button-effect {
214 | position: absolute;
215 | top: 50%;
216 | left: 0;
217 | }
218 |
219 | .fc-state-default .fc-button-effect span {
220 |
221 | }
222 |
223 | /* button states (determines colors) */
224 |
225 | .fc-state-default,
226 | .fc-state-default .fc-button-inner {
227 | border-top-style: none;
228 | border-bottom-style: none;
229 | border-left-style: solid;
230 | border-right-style: solid;
231 | border-color: #ddd;
232 | background: transparent;
233 | color: #646464;
234 | }
235 |
236 | .fc-state-hover,
237 | .fc-state-hover .fc-button-inner {
238 | border-color: #ddd;
239 | background: #fafafa;
240 | }
241 |
242 | .fc-state-down,
243 | .fc-state-down .fc-button-inner {
244 | border-color: #ddd;
245 | background: transparent;
246 | }
247 |
248 | .fc-state-active,
249 | .fc-state-active .fc-button-inner {
250 | background:#FFFFFF;
251 | border-bottom: 1px solid #FFFFFF;
252 | border-color: #DDDDDD #DDDDDD #FFFFFF;
253 | color: #646464;
254 | }
255 | }
256 |
257 | .fc-state-disabled,
258 | .fc-state-disabled .fc-button-inner {
259 | color: #999;
260 | border-color: #ddd;
261 | }
262 |
263 | .fc-state-disabled {
264 | cursor: default;
265 | }
266 |
267 | .fc-state-disabled .fc-button-effect {
268 | display: none;
269 | }
270 |
271 |
272 |
273 | /* Global Event Styles
274 | ------------------------------------------------------------------------*/
275 |
276 | .fc-event {
277 | border-style: solid;
278 | border-width: 0;
279 | font-size: .85em;
280 | cursor: default;
281 | }
282 |
283 | a.fc-event,
284 | .fc-event-draggable {
285 | cursor: pointer;
286 | }
287 |
288 | a.fc-event {
289 | text-decoration: none;
290 | }
291 |
292 | .fc-rtl .fc-event {
293 | text-align: right;
294 | }
295 |
296 | .fc-event-skin {
297 | border-color: #81c4e6; /* default BORDER color */
298 | background-color: #8cccec; /* default BACKGROUND color */
299 | color: #fff; /* default TEXT color */
300 | }
301 |
302 | .fc-event-inner {
303 | position: relative;
304 | width: 100%;
305 | height: 100%;
306 | border-style: solid;
307 | border-width: 0;
308 | overflow: hidden;
309 | }
310 |
311 | .fc-event-time,
312 | .fc-event-title {
313 | padding: 0 1px;
314 | }
315 |
316 | .fc .ui-resizable-handle { /*** TODO: don't use ui-resizable anymore, change class ***/
317 | display: block;
318 | position: absolute;
319 | z-index: 99999;
320 | overflow: hidden; /* hacky spaces (IE6/7) */
321 | font-size: 300%; /* */
322 | line-height: 50%; /* */
323 | }
324 |
325 |
326 |
327 | /* Horizontal Events
328 | ------------------------------------------------------------------------*/
329 |
330 | .fc-event-hori {
331 | border-width: 1px 0;
332 | margin-bottom: 1px;
333 | }
334 |
335 | /* resizable */
336 |
337 | .fc-event-hori .ui-resizable-e {
338 | top: 0 !important; /* importants override pre jquery ui 1.7 styles */
339 | right: -3px !important;
340 | width: 7px !important;
341 | height: 100% !important;
342 | cursor: e-resize;
343 | }
344 |
345 | .fc-event-hori .ui-resizable-w {
346 | top: 0 !important;
347 | left: -3px !important;
348 | width: 7px !important;
349 | height: 100% !important;
350 | cursor: w-resize;
351 | }
352 |
353 | .fc-event-hori .ui-resizable-handle {
354 | _padding-bottom: 14px; /* IE6 had 0 height */
355 | }
356 |
357 |
358 |
359 | /* Fake Rounded Corners (for buttons and events)
360 | ------------------------------------------------------------*/
361 |
362 | .fc-corner-left {
363 | margin-left: 1px;
364 | }
365 |
366 | .fc-corner-left .fc-button-inner,
367 | .fc-corner-left .fc-event-inner {
368 | margin-left: -1px;
369 | }
370 |
371 | .fc-corner-right {
372 | margin-right: 1px;
373 | }
374 |
375 | .fc-corner-right .fc-button-inner,
376 | .fc-corner-right .fc-event-inner {
377 | margin-right: -1px;
378 | }
379 |
380 | .fc-corner-top {
381 | margin-top: 1px;
382 | }
383 |
384 | .fc-corner-top .fc-event-inner {
385 | margin-top: -1px;
386 | }
387 |
388 | .fc-corner-bottom {
389 | margin-bottom: 1px;
390 | }
391 |
392 | .fc-corner-bottom .fc-event-inner {
393 | margin-bottom: -1px;
394 | }
395 |
396 |
397 |
398 | /* Fake Rounded Corners SPECIFICALLY FOR EVENTS
399 | -----------------------------------------------------------------*/
400 |
401 | .fc-corner-left .fc-event-inner {
402 | border-left-width: 1px;
403 | }
404 |
405 | .fc-corner-right .fc-event-inner {
406 | border-right-width: 1px;
407 | }
408 |
409 | .fc-corner-top .fc-event-inner {
410 | border-top-width: 1px;
411 | }
412 |
413 | .fc-corner-bottom .fc-event-inner {
414 | border-bottom-width: 1px;
415 | }
416 |
417 |
418 |
419 | /* Reusable Separate-border Table
420 | ------------------------------------------------------------*/
421 |
422 | table.fc-border-separate {
423 | border-collapse: separate;
424 |
425 | }
426 |
427 | .fc-border-separate th,
428 | .fc-border-separate td {
429 | border-width: 1px 0 0 1px;
430 | }
431 |
432 | .fc-border-separate th.fc-last,
433 | .fc-border-separate td.fc-last {
434 | border-right-width: 1px;
435 | }
436 |
437 | .fc-border-separate tr.fc-last th,
438 | .fc-border-separate tr.fc-last td {
439 | border-bottom-width: 1px;
440 | }
441 |
442 | .fc-border-separate tbody tr.fc-first td,
443 | .fc-border-separate tbody tr.fc-first th {
444 | border-top-width: 0;
445 | }
446 |
447 |
448 |
449 | /* Month View, Basic Week View, Basic Day View
450 | ------------------------------------------------------------------------*/
451 |
452 | .fc-grid th {
453 | text-align: center;
454 | }
455 |
456 | .fc-grid .fc-day-number {
457 | float: right;
458 | padding: 0 2px;
459 | }
460 |
461 | .fc-grid .fc-other-month .fc-day-number {
462 | opacity: 0.3;
463 | filter: alpha(opacity=30); /* for IE */
464 | /* opacity with small font can sometimes look too faded
465 | might want to set the 'color' property instead
466 | making day-numbers bold also fixes the problem */
467 | }
468 |
469 | .fc-grid .fc-day-content {
470 | clear: both;
471 | padding: 2px 2px 1px; /* distance between events and day edges */
472 | }
473 |
474 | /* event styles */
475 |
476 | .fc-grid .fc-event-time {
477 | font-weight: bold;
478 | }
479 |
480 | /* right-to-left */
481 |
482 | .fc-rtl .fc-grid .fc-day-number {
483 | float: left;
484 | }
485 |
486 | .fc-rtl .fc-grid .fc-event-time {
487 | float: right;
488 | }
489 |
490 |
491 |
492 | /* Agenda Week View, Agenda Day View
493 | ------------------------------------------------------------------------*/
494 |
495 | .fc-agenda table {
496 | border-collapse: separate;
497 | }
498 |
499 | .fc-agenda-days th {
500 | text-align: center;
501 | }
502 |
503 | .fc-agenda .fc-agenda-axis {
504 | width: 50px;
505 | padding: 0 4px;
506 | vertical-align: middle;
507 | text-align: right;
508 | white-space: nowrap;
509 | font-weight: normal;
510 | }
511 |
512 | .fc-agenda .fc-day-content {
513 | padding: 2px 2px 1px;
514 | }
515 |
516 | /* make axis border take precedence */
517 |
518 | .fc-agenda-days .fc-agenda-axis {
519 | border-right-width: 1px;
520 | }
521 |
522 | .fc-agenda-days .fc-col0 {
523 | border-left-width: 0;
524 | }
525 |
526 | /* all-day area */
527 |
528 | .fc-agenda-allday th {
529 | border-width: 0 1px;
530 | }
531 |
532 | .fc-agenda-allday .fc-day-content {
533 | min-height: 34px; /* TODO: doesnt work well in quirksmode */
534 | _height: 34px;
535 | }
536 |
537 | /* divider (between all-day and slots) */
538 |
539 | .fc-agenda-divider-inner {
540 | height: 2px;
541 | overflow: hidden;
542 | }
543 |
544 | .fc-widget-header .fc-agenda-divider-inner {
545 | background: #eee;
546 | }
547 |
548 | /* slot rows */
549 |
550 | .fc-agenda-slots th {
551 | border-width: 1px 1px;
552 | }
553 |
554 | .fc-agenda-slots td {
555 | border-width: 1px 0 0;
556 | background: none;
557 | }
558 |
559 | .fc-agenda-slots td div {
560 | height: 20px;
561 | }
562 |
563 | .fc-agenda-slots tr.fc-slot0 th,
564 | .fc-agenda-slots tr.fc-slot0 td {
565 | border-top-width: 0;
566 | }
567 |
568 | .fc-agenda-slots tr.fc-minor th,
569 | .fc-agenda-slots tr.fc-minor td {
570 | border-top-style: dotted;
571 | }
572 |
573 | .fc-agenda-slots tr.fc-minor th.ui-widget-header {
574 | *border-top-style: solid; /* doesn't work with background in IE6/7 */
575 | }
576 |
577 |
578 |
579 | /* Vertical Events
580 | ------------------------------------------------------------------------*/
581 |
582 | .fc-event-vert {
583 | border-width: 0 1px;
584 | }
585 |
586 | .fc-event-vert .fc-event-head,
587 | .fc-event-vert .fc-event-content {
588 | position: relative;
589 | z-index: 2;
590 | width: 100%;
591 | overflow: hidden;
592 | }
593 |
594 | .fc-event-vert .fc-event-time {
595 | white-space: nowrap;
596 | font-size: 10px;
597 | }
598 |
599 | .fc-event-vert .fc-event-bg { /* makes the event lighter w/ a semi-transparent overlay */
600 | position: absolute;
601 | z-index: 1;
602 | top: 0;
603 | left: 0;
604 | width: 100%;
605 | height: 100%;
606 | background: #fff;
607 | opacity: .3;
608 | filter: alpha(opacity=30);
609 | }
610 |
611 | .fc .ui-draggable-dragging .fc-event-bg, /* TODO: something nicer like .fc-opacity */
612 | .fc-select-helper .fc-event-bg {
613 | display: none\9; /* for IE6/7/8. nested opacity filters while dragging don't work */
614 | }
615 |
616 | /* resizable */
617 |
618 | .fc-event-vert .ui-resizable-s {
619 | bottom: 0 !important; /* importants override pre jquery ui 1.7 styles */
620 | width: 100% !important;
621 | height: 8px !important;
622 | overflow: hidden !important;
623 | line-height: 8px !important;
624 | font-size: 11px !important;
625 | font-family: monospace;
626 | text-align: center;
627 | cursor: s-resize;
628 | }
629 |
630 | .fc-agenda .ui-resizable-resizing { /* TODO: better selector */
631 | _overflow: hidden;
632 | }
--------------------------------------------------------------------------------
|