social_stream 0.28.0 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/base/app/helpers/toolbar_helper.rb +6 -8
- data/base/lib/social_stream/base/version.rb +1 -1
- data/base/social_stream-base.gemspec +1 -1
- data/base/vendor/assets/javascripts/jquery.watermark.js +196 -161
- data/events/app/assets/stylesheets/events.css.scss +1 -0
- data/events/lib/social_stream/events/version.rb +1 -1
- data/events/social_stream-events.gemspec +1 -1
- data/lib/social_stream/version.rb +1 -1
- data/social_stream.gemspec +2 -2
- metadata +6 -6
data/.gitignore
CHANGED
@@ -48,11 +48,13 @@ module ToolbarHelper
|
|
48
48
|
result + item[:html]
|
49
49
|
}
|
50
50
|
|
51
|
+
toolbar_init = "SocialStream.Toolbar.init({ option: '#{ options[:option] }' });".html_safe
|
52
|
+
|
51
53
|
case request.format
|
52
54
|
when Mime::JS
|
53
|
-
response =
|
54
|
-
$('#toolbarContent').html("#{ escape_javascript(content) }")
|
55
|
-
|
55
|
+
response =
|
56
|
+
"$('#toolbarContent').html(\"#{ escape_javascript(content) }\");\n" +
|
57
|
+
toolbar_init
|
56
58
|
EOJ
|
57
59
|
|
58
60
|
response.html_safe
|
@@ -61,11 +63,7 @@ module ToolbarHelper
|
|
61
63
|
content
|
62
64
|
end
|
63
65
|
|
64
|
-
content_for
|
65
|
-
<<-EOJ
|
66
|
-
SocialStream.Toolbar.init({ option: '#{ options[:option] }' });
|
67
|
-
EOJ
|
68
|
-
end
|
66
|
+
content_for :javascript, toolbar_init
|
69
67
|
end
|
70
68
|
end
|
71
69
|
|
@@ -46,7 +46,7 @@ Gem::Specification.new do |s|
|
|
46
46
|
# Tagging
|
47
47
|
s.add_runtime_dependency('acts-as-taggable-on','~> 2.2.2')
|
48
48
|
# HTML Forms
|
49
|
-
s.add_runtime_dependency('formtastic','
|
49
|
+
s.add_runtime_dependency('formtastic','>= 1.2.3')
|
50
50
|
# Background jobs
|
51
51
|
s.add_runtime_dependency('resque','~> 1.20.0')
|
52
52
|
# Modernizr.js javascript library
|
@@ -1,12 +1,12 @@
|
|
1
1
|
/*
|
2
2
|
Watermark plugin for jQuery
|
3
|
-
Version: 3.1.
|
3
|
+
Version: 3.1.4
|
4
4
|
http://jquery-watermark.googlecode.com/
|
5
5
|
|
6
|
-
Copyright (c) 2009-
|
6
|
+
Copyright (c) 2009-2012 Todd Northrop
|
7
7
|
http://www.speednet.biz/
|
8
8
|
|
9
|
-
|
9
|
+
August 13, 2012
|
10
10
|
|
11
11
|
Requires: jQuery 1.2.3+
|
12
12
|
|
@@ -14,7 +14,7 @@
|
|
14
14
|
See mit-license.txt and gpl2-license.txt in the project root for details.
|
15
15
|
------------------------------------------------------*/
|
16
16
|
|
17
|
-
(function ($, window, undefined) {
|
17
|
+
( function ( $, window, undefined ) {
|
18
18
|
|
19
19
|
var
|
20
20
|
// String constants for data names
|
@@ -28,12 +28,15 @@ var
|
|
28
28
|
|
29
29
|
// Copy of native jQuery regex use to strip return characters from element value
|
30
30
|
rreturn = /\r/g,
|
31
|
+
|
32
|
+
// Used to determine if type attribute of input element is a non-text type (invalid)
|
33
|
+
rInvalidType = /^(button|checkbox|hidden|image|radio|range|reset|submit)$/i,
|
31
34
|
|
32
35
|
// Includes only elements with watermark defined
|
33
36
|
selWatermarkDefined = "input:data(" + dataFlag + "),textarea:data(" + dataFlag + ")",
|
34
37
|
|
35
38
|
// Includes only elements capable of having watermark
|
36
|
-
selWatermarkAble = "
|
39
|
+
selWatermarkAble = ":watermarkable",
|
37
40
|
|
38
41
|
// triggerFns:
|
39
42
|
// Array of function names to look for in the global namespace.
|
@@ -54,14 +57,14 @@ var
|
|
54
57
|
pageDirty = false,
|
55
58
|
|
56
59
|
// Detects if the browser can handle native placeholders
|
57
|
-
hasNativePlaceholder = ("placeholder" in document.createElement("input"));
|
60
|
+
hasNativePlaceholder = ( "placeholder" in document.createElement( "input" ) );
|
58
61
|
|
59
62
|
// Best practice: this plugin adds only one method to the jQuery object.
|
60
63
|
// Also ensures that the watermark code is only added once.
|
61
64
|
$.watermark = $.watermark || {
|
62
65
|
|
63
66
|
// Current version number of the plugin
|
64
|
-
version: "3.1.
|
67
|
+
version: "3.1.4",
|
65
68
|
|
66
69
|
runOnce: true,
|
67
70
|
|
@@ -90,131 +93,131 @@ $.watermark = $.watermark || {
|
|
90
93
|
|
91
94
|
// Hide one or more watermarks by specifying any selector type
|
92
95
|
// i.e., DOM element, string selector, jQuery matched set, etc.
|
93
|
-
hide: function (selector) {
|
94
|
-
$(selector).filter(selWatermarkDefined).each(
|
96
|
+
hide: function ( selector ) {
|
97
|
+
$( selector ).filter( selWatermarkDefined ).each(
|
95
98
|
function () {
|
96
|
-
$.watermark._hide($(this));
|
99
|
+
$.watermark._hide( $( this ) );
|
97
100
|
}
|
98
101
|
);
|
99
102
|
},
|
100
103
|
|
101
104
|
// Internal use only.
|
102
|
-
_hide: function ($input, focus) {
|
103
|
-
var elem = $input[0],
|
104
|
-
inputVal = (elem.value || "").replace(rreturn, ""),
|
105
|
-
inputWm = $input.data(dataText) || "",
|
106
|
-
maxLen = $input.data(dataMaxLen) || 0,
|
107
|
-
className = $input.data(dataClass);
|
105
|
+
_hide: function ( $input, focus ) {
|
106
|
+
var elem = $input[ 0 ],
|
107
|
+
inputVal = ( elem.value || "" ).replace( rreturn, "" ),
|
108
|
+
inputWm = $input.data( dataText ) || "",
|
109
|
+
maxLen = $input.data( dataMaxLen ) || 0,
|
110
|
+
className = $input.data( dataClass );
|
108
111
|
|
109
|
-
if ((inputWm.length) && (inputVal == inputWm)) {
|
112
|
+
if ( ( inputWm.length ) && ( inputVal == inputWm ) ) {
|
110
113
|
elem.value = "";
|
111
114
|
|
112
115
|
// Password type?
|
113
|
-
if ($input.data(dataPassword)) {
|
116
|
+
if ( $input.data( dataPassword ) ) {
|
114
117
|
|
115
|
-
if (($input.attr("type") || "") === "text") {
|
116
|
-
var $pwd = $input.data(dataPassword) || [],
|
118
|
+
if ( ( $input.attr( "type" ) || "" ) === "text" ) {
|
119
|
+
var $pwd = $input.data( dataPassword ) || [],
|
117
120
|
$wrap = $input.parent() || [];
|
118
121
|
|
119
|
-
if (($pwd.length) && ($wrap.length)) {
|
120
|
-
$wrap[0].removeChild($input[0]); // Can't use jQuery methods, because they destroy data
|
121
|
-
$wrap[0].appendChild($pwd[0]);
|
122
|
+
if ( ( $pwd.length ) && ( $wrap.length ) ) {
|
123
|
+
$wrap[ 0 ].removeChild( $input[ 0 ] ); // Can't use jQuery methods, because they destroy data
|
124
|
+
$wrap[ 0 ].appendChild( $pwd[ 0 ] );
|
122
125
|
$input = $pwd;
|
123
126
|
}
|
124
127
|
}
|
125
128
|
}
|
126
129
|
|
127
|
-
if (maxLen) {
|
128
|
-
$input.attr("maxLength", maxLen);
|
129
|
-
$input.removeData(dataMaxLen);
|
130
|
+
if ( maxLen ) {
|
131
|
+
$input.attr( "maxLength", maxLen );
|
132
|
+
$input.removeData( dataMaxLen );
|
130
133
|
}
|
131
134
|
|
132
|
-
if (focus) {
|
133
|
-
$input.attr("autocomplete", "off"); // Avoid NS_ERROR_XPC_JS_THREW_STRING error in Firefox
|
135
|
+
if ( focus ) {
|
136
|
+
$input.attr( "autocomplete", "off" ); // Avoid NS_ERROR_XPC_JS_THREW_STRING error in Firefox
|
134
137
|
|
135
138
|
window.setTimeout(
|
136
139
|
function () {
|
137
140
|
$input.select(); // Fix missing cursor in IE
|
138
141
|
}
|
139
|
-
, 1);
|
142
|
+
, 1 );
|
140
143
|
}
|
141
144
|
}
|
142
145
|
|
143
|
-
className && $input.removeClass(className);
|
146
|
+
className && $input.removeClass( className );
|
144
147
|
},
|
145
148
|
|
146
149
|
// Display one or more watermarks by specifying any selector type
|
147
150
|
// i.e., DOM element, string selector, jQuery matched set, etc.
|
148
151
|
// If conditions are not right for displaying a watermark, ensures that watermark is not shown.
|
149
|
-
show: function (selector) {
|
150
|
-
$(selector).filter(selWatermarkDefined).each(
|
152
|
+
show: function ( selector ) {
|
153
|
+
$( selector ).filter( selWatermarkDefined ).each(
|
151
154
|
function () {
|
152
|
-
$.watermark._show($(this));
|
155
|
+
$.watermark._show( $( this ) );
|
153
156
|
}
|
154
157
|
);
|
155
158
|
},
|
156
159
|
|
157
160
|
// Internal use only.
|
158
|
-
_show: function ($input) {
|
159
|
-
var elem = $input[0],
|
160
|
-
val = (elem.value || "").replace(rreturn, ""),
|
161
|
-
text = $input.data(dataText) || "",
|
162
|
-
type = $input.attr("type") || "",
|
163
|
-
className = $input.data(dataClass);
|
161
|
+
_show: function ( $input ) {
|
162
|
+
var elem = $input[ 0 ],
|
163
|
+
val = ( elem.value || "" ).replace( rreturn, "" ),
|
164
|
+
text = $input.data( dataText ) || "",
|
165
|
+
type = $input.attr( "type" ) || "",
|
166
|
+
className = $input.data( dataClass );
|
164
167
|
|
165
|
-
if (((val.length == 0) || (val == text)) && (!$input.data(dataFocus))) {
|
168
|
+
if ( ( ( val.length == 0 ) || ( val == text ) ) && ( !$input.data( dataFocus ) ) ) {
|
166
169
|
pageDirty = true;
|
167
170
|
|
168
171
|
// Password type?
|
169
|
-
if ($input.data(dataPassword)) {
|
172
|
+
if ( $input.data( dataPassword ) ) {
|
170
173
|
|
171
|
-
if (type === "password") {
|
172
|
-
var $pwd = $input.data(dataPassword) || [],
|
174
|
+
if ( type === "password" ) {
|
175
|
+
var $pwd = $input.data( dataPassword ) || [],
|
173
176
|
$wrap = $input.parent() || [];
|
174
177
|
|
175
|
-
if (($pwd.length) && ($wrap.length)) {
|
176
|
-
$wrap[0].removeChild($input[0]); // Can't use jQuery methods, because they destroy data
|
177
|
-
$wrap[0].appendChild($pwd[0]);
|
178
|
+
if ( ( $pwd.length ) && ( $wrap.length ) ) {
|
179
|
+
$wrap[ 0 ].removeChild( $input[ 0 ] ); // Can't use jQuery methods, because they destroy data
|
180
|
+
$wrap[ 0 ].appendChild( $pwd[ 0 ] );
|
178
181
|
$input = $pwd;
|
179
|
-
$input.attr("maxLength", text.length);
|
180
|
-
elem = $input[0];
|
182
|
+
$input.attr( "maxLength", text.length );
|
183
|
+
elem = $input[ 0 ];
|
181
184
|
}
|
182
185
|
}
|
183
186
|
}
|
184
187
|
|
185
188
|
// Ensure maxLength big enough to hold watermark (input of type="text" or type="search" only)
|
186
|
-
if ((type === "text") || (type === "search")) {
|
187
|
-
var maxLen = $input.attr("maxLength") || 0;
|
189
|
+
if ( ( type === "text" ) || ( type === "search" ) ) {
|
190
|
+
var maxLen = $input.attr( "maxLength" ) || 0;
|
188
191
|
|
189
|
-
if ((maxLen > 0) && (text.length > maxLen)) {
|
190
|
-
$input.data(dataMaxLen, maxLen);
|
191
|
-
$input.attr("maxLength", text.length);
|
192
|
+
if ( ( maxLen > 0 ) && ( text.length > maxLen ) ) {
|
193
|
+
$input.data( dataMaxLen, maxLen );
|
194
|
+
$input.attr( "maxLength", text.length );
|
192
195
|
}
|
193
196
|
}
|
194
197
|
|
195
|
-
className && $input.addClass(className);
|
198
|
+
className && $input.addClass( className );
|
196
199
|
elem.value = text;
|
197
200
|
}
|
198
201
|
else {
|
199
|
-
$.watermark._hide($input);
|
202
|
+
$.watermark._hide( $input );
|
200
203
|
}
|
201
204
|
},
|
202
205
|
|
203
206
|
// Hides all watermarks on the current page.
|
204
207
|
hideAll: function () {
|
205
|
-
if (pageDirty) {
|
206
|
-
$.watermark.hide(selWatermarkAble);
|
208
|
+
if ( pageDirty ) {
|
209
|
+
$.watermark.hide( selWatermarkAble );
|
207
210
|
pageDirty = false;
|
208
211
|
}
|
209
212
|
},
|
210
213
|
|
211
214
|
// Displays all watermarks on the current page.
|
212
215
|
showAll: function () {
|
213
|
-
$.watermark.show(selWatermarkAble);
|
216
|
+
$.watermark.show( selWatermarkAble );
|
214
217
|
}
|
215
218
|
};
|
216
219
|
|
217
|
-
$.fn.watermark = $.fn.watermark || function (text, options) {
|
220
|
+
$.fn.watermark = $.fn.watermark || function ( text, options ) {
|
218
221
|
/// <summary>
|
219
222
|
/// Set watermark text and class name on all input elements of type="text/password/search" and
|
220
223
|
/// textareas within the matched set. If className is not specified in options, the default is
|
@@ -268,54 +271,54 @@ $.fn.watermark = $.fn.watermark || function (text, options) {
|
|
268
271
|
/// overall it is not recommended.
|
269
272
|
/// </remarks>
|
270
273
|
|
271
|
-
if (!this.length) {
|
274
|
+
if ( !this.length ) {
|
272
275
|
return this;
|
273
276
|
}
|
274
277
|
|
275
278
|
var hasClass = false,
|
276
|
-
hasText = (typeof(text) === "string");
|
279
|
+
hasText = ( typeof( text ) === "string" );
|
277
280
|
|
278
|
-
if (hasText) {
|
279
|
-
text = text.replace(rreturn, "");
|
281
|
+
if ( hasText ) {
|
282
|
+
text = text.replace( rreturn, "" );
|
280
283
|
}
|
281
284
|
|
282
|
-
if (typeof(options) === "object") {
|
283
|
-
hasClass = (typeof(options.className) === "string");
|
284
|
-
options = $.extend({}, $.watermark.options, options);
|
285
|
+
if ( typeof( options ) === "object" ) {
|
286
|
+
hasClass = ( typeof( options.className ) === "string" );
|
287
|
+
options = $.extend( {}, $.watermark.options, options );
|
285
288
|
}
|
286
|
-
else if (typeof(options) === "string") {
|
289
|
+
else if ( typeof( options ) === "string" ) {
|
287
290
|
hasClass = true;
|
288
|
-
options = $.extend({}, $.watermark.options, {className: options});
|
291
|
+
options = $.extend( {}, $.watermark.options, { className: options } );
|
289
292
|
}
|
290
293
|
else {
|
291
294
|
options = $.watermark.options;
|
292
295
|
}
|
293
296
|
|
294
|
-
if (typeof(options.useNative) !== "function") {
|
297
|
+
if ( typeof( options.useNative ) !== "function" ) {
|
295
298
|
options.useNative = options.useNative? function () { return true; } : function () { return false; };
|
296
299
|
}
|
297
300
|
|
298
301
|
return this.each(
|
299
302
|
function () {
|
300
|
-
var $input = $(this);
|
303
|
+
var $input = $( this );
|
301
304
|
|
302
|
-
if (!$input.is(selWatermarkAble)) {
|
305
|
+
if ( !$input.is( selWatermarkAble ) ) {
|
303
306
|
return;
|
304
307
|
}
|
305
308
|
|
306
309
|
// Watermark already initialized?
|
307
|
-
if ($input.data(dataFlag)) {
|
310
|
+
if ( $input.data( dataFlag ) ) {
|
308
311
|
|
309
312
|
// If re-defining text or class, first remove existing watermark, then make changes
|
310
|
-
if (hasText || hasClass) {
|
311
|
-
$.watermark._hide($input);
|
313
|
+
if ( hasText || hasClass ) {
|
314
|
+
$.watermark._hide( $input );
|
312
315
|
|
313
|
-
if (hasText) {
|
314
|
-
$input.data(dataText, text);
|
316
|
+
if ( hasText ) {
|
317
|
+
$input.data( dataText, text );
|
315
318
|
}
|
316
319
|
|
317
|
-
if (hasClass) {
|
318
|
-
$input.data(dataClass, options.className);
|
320
|
+
if ( hasClass ) {
|
321
|
+
$input.data( dataClass, options.className );
|
319
322
|
}
|
320
323
|
}
|
321
324
|
}
|
@@ -323,14 +326,14 @@ $.fn.watermark = $.fn.watermark || function (text, options) {
|
|
323
326
|
|
324
327
|
// Detect and use native browser support, if enabled in options
|
325
328
|
if (
|
326
|
-
(hasNativePlaceholder)
|
327
|
-
&& (options.useNative.call(this, $input))
|
328
|
-
&& (($input.attr("tagName") || "") !== "TEXTAREA")
|
329
|
+
( hasNativePlaceholder )
|
330
|
+
&& ( options.useNative.call( this, $input ) )
|
331
|
+
&& ( ( $input.attr( "tagName" ) || "" ) !== "TEXTAREA" )
|
329
332
|
) {
|
330
333
|
// className is not set because current placeholder standard doesn't
|
331
334
|
// have a separate class name property for placeholders (watermarks).
|
332
|
-
if (hasText) {
|
333
|
-
$input.attr("placeholder", text);
|
335
|
+
if ( hasText ) {
|
336
|
+
$input.attr( "placeholder", text );
|
334
337
|
}
|
335
338
|
|
336
339
|
// Only set data flag for non-native watermarks
|
@@ -338,78 +341,79 @@ $.fn.watermark = $.fn.watermark || function (text, options) {
|
|
338
341
|
return;
|
339
342
|
}
|
340
343
|
|
341
|
-
$input.data(dataText, hasText? text : "");
|
342
|
-
$input.data(dataClass, options.className);
|
343
|
-
$input.data(dataFlag, 1); // Flag indicates watermark was initialized
|
344
|
+
$input.data( dataText, hasText? text : "" );
|
345
|
+
$input.data( dataClass, options.className );
|
346
|
+
$input.data( dataFlag, 1 ); // Flag indicates watermark was initialized
|
344
347
|
|
345
348
|
// Special processing for password type
|
346
|
-
if (($input.attr("type") || "") === "password") {
|
347
|
-
var $wrap = $input.wrap("<span>").parent(),
|
348
|
-
$wm = $($wrap.html().replace(/type=["']?password["']?/i, 'type="text"'));
|
349
|
+
if ( ( $input.attr( "type" ) || "" ) === "password" ) {
|
350
|
+
var $wrap = $input.wrap( "<span>" ).parent(),
|
351
|
+
$wm = $( $wrap.html().replace( /type=["']?password["']?/i, 'type="text"' ) );
|
349
352
|
|
350
|
-
$wm.data(dataText, $input.data(dataText));
|
351
|
-
$wm.data(dataClass, $input.data(dataClass));
|
352
|
-
$wm.data(dataFlag, 1);
|
353
|
-
$wm.attr("maxLength", text.length);
|
353
|
+
$wm.data( dataText, $input.data( dataText ) );
|
354
|
+
$wm.data( dataClass, $input.data( dataClass ) );
|
355
|
+
$wm.data( dataFlag, 1 );
|
356
|
+
$wm.attr( "maxLength", text.length );
|
354
357
|
|
355
358
|
$wm.focus(
|
356
359
|
function () {
|
357
|
-
$.watermark._hide($wm, true);
|
360
|
+
$.watermark._hide( $wm, true );
|
358
361
|
}
|
359
|
-
).bind("dragenter",
|
362
|
+
).bind( "dragenter",
|
360
363
|
function () {
|
361
|
-
$.watermark._hide($wm);
|
364
|
+
$.watermark._hide( $wm );
|
362
365
|
}
|
363
|
-
).bind("dragend",
|
366
|
+
).bind( "dragend",
|
364
367
|
function () {
|
365
|
-
window.setTimeout(function () { $wm.blur(); }, 1);
|
368
|
+
window.setTimeout( function () { $wm.blur(); }, 1 );
|
366
369
|
}
|
367
370
|
);
|
371
|
+
|
368
372
|
$input.blur(
|
369
373
|
function () {
|
370
|
-
$.watermark._show($input);
|
374
|
+
$.watermark._show( $input );
|
371
375
|
}
|
372
|
-
).bind("dragleave",
|
376
|
+
).bind( "dragleave",
|
373
377
|
function () {
|
374
|
-
$.watermark._show($input);
|
378
|
+
$.watermark._show( $input );
|
375
379
|
}
|
376
380
|
);
|
377
381
|
|
378
|
-
$wm.data(dataPassword, $input);
|
379
|
-
$input.data(dataPassword, $wm);
|
382
|
+
$wm.data( dataPassword, $input );
|
383
|
+
$input.data( dataPassword, $wm );
|
380
384
|
}
|
381
385
|
else {
|
382
386
|
|
383
387
|
$input.focus(
|
384
388
|
function () {
|
385
|
-
$input.data(dataFocus, 1);
|
386
|
-
$.watermark._hide($input, true);
|
389
|
+
$input.data( dataFocus, 1 );
|
390
|
+
$.watermark._hide( $input, true );
|
387
391
|
}
|
388
392
|
).blur(
|
389
393
|
function () {
|
390
|
-
$input.data(dataFocus, 0);
|
391
|
-
$.watermark._show($input);
|
394
|
+
$input.data( dataFocus, 0 );
|
395
|
+
$.watermark._show( $input );
|
392
396
|
}
|
393
|
-
).bind("dragenter",
|
397
|
+
).bind( "dragenter",
|
394
398
|
function () {
|
395
|
-
$.watermark._hide($input);
|
399
|
+
$.watermark._hide( $input );
|
396
400
|
}
|
397
|
-
).bind("dragleave",
|
401
|
+
).bind( "dragleave",
|
398
402
|
function () {
|
399
|
-
$.watermark._show($input);
|
403
|
+
$.watermark._show( $input );
|
400
404
|
}
|
401
|
-
).bind("dragend",
|
405
|
+
).bind( "dragend",
|
402
406
|
function () {
|
403
|
-
window.setTimeout(function () { $.watermark._show($input); }, 1);
|
407
|
+
window.setTimeout( function () { $.watermark._show($input); }, 1 );
|
404
408
|
}
|
405
|
-
).bind("drop",
|
409
|
+
).bind( "drop",
|
406
410
|
// Firefox makes this lovely function necessary because the dropped text
|
407
411
|
// is merged with the watermark before the drop event is called.
|
408
|
-
function (evt) {
|
409
|
-
var elem = $input[0],
|
410
|
-
dropText = evt.originalEvent.dataTransfer.getData("Text");
|
412
|
+
function ( evt ) {
|
413
|
+
var elem = $input[ 0 ],
|
414
|
+
dropText = evt.originalEvent.dataTransfer.getData( "Text" );
|
411
415
|
|
412
|
-
if ((elem.value || "").replace(rreturn, "").replace(dropText, "") === $input.data(dataText)) {
|
416
|
+
if ( ( elem.value || "" ).replace( rreturn, "" ).replace( dropText, "" ) === $input.data( dataText ) ) {
|
413
417
|
elem.value = dropText;
|
414
418
|
}
|
415
419
|
|
@@ -422,35 +426,35 @@ $.fn.watermark = $.fn.watermark || function (text, options) {
|
|
422
426
|
// we need to replace the form's submit function with our own
|
423
427
|
// function. Otherwise watermarks won't be cleared when the form
|
424
428
|
// is submitted programmatically.
|
425
|
-
if (this.form) {
|
429
|
+
if ( this.form ) {
|
426
430
|
var form = this.form,
|
427
|
-
$form = $(form);
|
431
|
+
$form = $( form );
|
428
432
|
|
429
|
-
if (!$form.data(dataFormSubmit)) {
|
430
|
-
$form.submit($.watermark.hideAll);
|
433
|
+
if ( !$form.data( dataFormSubmit ) ) {
|
434
|
+
$form.submit( $.watermark.hideAll );
|
431
435
|
|
432
436
|
// form.submit exists for all browsers except Google Chrome
|
433
437
|
// (see "else" below for explanation)
|
434
|
-
if (form.submit) {
|
435
|
-
$form.data(dataFormSubmit, form.submit);
|
438
|
+
if ( form.submit ) {
|
439
|
+
$form.data( dataFormSubmit, form.submit );
|
436
440
|
|
437
|
-
form.submit = (function (f, $f) {
|
441
|
+
form.submit = ( function ( f, $f ) {
|
438
442
|
return function () {
|
439
|
-
var nativeSubmit = $f.data(dataFormSubmit);
|
443
|
+
var nativeSubmit = $f.data( dataFormSubmit );
|
440
444
|
|
441
445
|
$.watermark.hideAll();
|
442
446
|
|
443
|
-
if (nativeSubmit.apply) {
|
444
|
-
nativeSubmit.apply(f, Array.prototype.slice.call(arguments));
|
447
|
+
if ( nativeSubmit.apply ) {
|
448
|
+
nativeSubmit.apply( f, Array.prototype.slice.call( arguments ) );
|
445
449
|
}
|
446
450
|
else {
|
447
451
|
nativeSubmit();
|
448
452
|
}
|
449
453
|
};
|
450
|
-
})(form, $form);
|
454
|
+
})( form, $form );
|
451
455
|
}
|
452
456
|
else {
|
453
|
-
$form.data(dataFormSubmit, 1);
|
457
|
+
$form.data( dataFormSubmit, 1 );
|
454
458
|
|
455
459
|
// This strangeness is due to the fact that Google Chrome's
|
456
460
|
// form.submit function is not visible to JavaScript (identifies
|
@@ -459,29 +463,29 @@ $.fn.watermark = $.fn.watermark || function (text, options) {
|
|
459
463
|
// useful. Within my own form.submit function I delete the form's
|
460
464
|
// submit function, and then call the non-existent function --
|
461
465
|
// which, in the world of Google Chrome, still exists.
|
462
|
-
form.submit = (function (f) {
|
466
|
+
form.submit = ( function ( f ) {
|
463
467
|
return function () {
|
464
468
|
$.watermark.hideAll();
|
465
469
|
delete f.submit;
|
466
470
|
f.submit();
|
467
471
|
};
|
468
|
-
})(form);
|
472
|
+
})( form );
|
469
473
|
}
|
470
474
|
}
|
471
475
|
}
|
472
476
|
}
|
473
477
|
|
474
|
-
$.watermark._show($input);
|
478
|
+
$.watermark._show( $input );
|
475
479
|
}
|
476
480
|
);
|
477
481
|
};
|
478
482
|
|
479
483
|
// The code included within the following if structure is guaranteed to only run once,
|
480
484
|
// even if the watermark script file is included multiple times in the page.
|
481
|
-
if ($.watermark.runOnce) {
|
485
|
+
if ( $.watermark.runOnce ) {
|
482
486
|
$.watermark.runOnce = false;
|
483
487
|
|
484
|
-
$.extend($.expr[":"], {
|
488
|
+
$.extend( $.expr[ ":" ], {
|
485
489
|
|
486
490
|
// Extends jQuery with a custom selector - ":data(...)"
|
487
491
|
// :data(<name>) Includes elements that have a specific name defined in the jQuery data
|
@@ -489,8 +493,38 @@ if ($.watermark.runOnce) {
|
|
489
493
|
// A more sophisticated version of the :data() custom selector originally part of this plugin
|
490
494
|
// was removed for compatibility with jQuery UI. The original code can be found in the SVN
|
491
495
|
// source listing in the file, "jquery.data.js".
|
492
|
-
data:
|
493
|
-
|
496
|
+
data: $.expr.createPseudo ?
|
497
|
+
$.expr.createPseudo( function( dataName ) {
|
498
|
+
return function( elem ) {
|
499
|
+
return !!$.data( elem, dataName );
|
500
|
+
};
|
501
|
+
}) :
|
502
|
+
// support: jQuery <1.8
|
503
|
+
function( elem, i, match ) {
|
504
|
+
return !!$.data( elem, match[ 3 ] );
|
505
|
+
},
|
506
|
+
|
507
|
+
// Extends jQuery with a custom selector - ":watermarkable"
|
508
|
+
// Includes elements that can be watermarked, including textareas and most input elements
|
509
|
+
// that accept text input. It uses a "negative" test (i.e., testing for input types that DON'T
|
510
|
+
// work) because the HTML spec states that you can basically use any type, and if it doesn't
|
511
|
+
// recognize the type it will default to type=text. So if we only looked for certain type attributes
|
512
|
+
// we would fail to recognize non-standard types, which are still valid and watermarkable.
|
513
|
+
watermarkable: function ( elem ) {
|
514
|
+
var type,
|
515
|
+
name = elem.nodeName;
|
516
|
+
|
517
|
+
if ( name === "TEXTAREA" ) {
|
518
|
+
return true;
|
519
|
+
}
|
520
|
+
|
521
|
+
if ( name !== "INPUT" ) {
|
522
|
+
return false;
|
523
|
+
}
|
524
|
+
|
525
|
+
type = elem.getAttribute( "type" );
|
526
|
+
|
527
|
+
return ( ( !type ) || ( !rInvalidType.test( type ) ) );
|
494
528
|
}
|
495
529
|
});
|
496
530
|
|
@@ -498,66 +532,67 @@ if ($.watermark.runOnce) {
|
|
498
532
|
// watermarked input elements. When .val() is being used to set values, this
|
499
533
|
// function ensures watermarks are properly set/removed after the values are set.
|
500
534
|
// Uses self-executing function to override the default jQuery function.
|
501
|
-
(function (valOld) {
|
535
|
+
( function ( valOld ) {
|
502
536
|
|
503
537
|
$.fn.val = function () {
|
538
|
+
var args = Array.prototype.slice.call( arguments );
|
504
539
|
|
505
540
|
// Best practice: return immediately if empty matched set
|
506
541
|
if ( !this.length ) {
|
507
|
-
return
|
542
|
+
return args.length? this : undefined;
|
508
543
|
}
|
509
544
|
|
510
545
|
// If no args, then we're getting the value of the first element;
|
511
|
-
//
|
512
|
-
if ( !
|
546
|
+
// else we're setting values for all elements in matched set
|
547
|
+
if ( !args.length ) {
|
513
548
|
|
514
549
|
// If element is watermarked, get the underlying value;
|
515
|
-
//
|
516
|
-
if ( this.data(dataFlag) ) {
|
517
|
-
var v = (this[0].value || "").replace(rreturn, "");
|
518
|
-
return (v === (this.data(dataText) || ""))? "" : v;
|
550
|
+
// else use native jQuery .val()
|
551
|
+
if ( this.data( dataFlag ) ) {
|
552
|
+
var v = ( this[ 0 ].value || "" ).replace( rreturn, "" );
|
553
|
+
return ( v === ( this.data( dataText ) || "" ) )? "" : v;
|
519
554
|
}
|
520
555
|
else {
|
521
|
-
return valOld.apply( this
|
556
|
+
return valOld.apply( this );
|
522
557
|
}
|
523
558
|
}
|
524
559
|
else {
|
525
|
-
valOld.apply( this,
|
526
|
-
$.watermark.show(this);
|
560
|
+
valOld.apply( this, args );
|
561
|
+
$.watermark.show( this );
|
527
562
|
return this;
|
528
563
|
}
|
529
564
|
};
|
530
565
|
|
531
|
-
})($.fn.val);
|
566
|
+
})( $.fn.val );
|
532
567
|
|
533
568
|
// Hijack any functions found in the triggerFns list
|
534
|
-
if (triggerFns.length) {
|
569
|
+
if ( triggerFns.length ) {
|
535
570
|
|
536
571
|
// Wait until DOM is ready before searching
|
537
|
-
$(function () {
|
572
|
+
$( function () {
|
538
573
|
var i, name, fn;
|
539
574
|
|
540
|
-
for (i=triggerFns.length-1; i>=0; i--) {
|
541
|
-
name = triggerFns[i];
|
542
|
-
fn = window[name];
|
575
|
+
for ( i = triggerFns.length - 1; i >= 0; i-- ) {
|
576
|
+
name = triggerFns[ i ];
|
577
|
+
fn = window[ name ];
|
543
578
|
|
544
|
-
if (typeof(fn) === "function") {
|
545
|
-
window[name] = (function (origFn) {
|
579
|
+
if ( typeof( fn ) === "function" ) {
|
580
|
+
window[ name ] = ( function ( origFn ) {
|
546
581
|
return function () {
|
547
582
|
$.watermark.hideAll();
|
548
|
-
return origFn.apply(null, Array.prototype.slice.call(arguments));
|
583
|
+
return origFn.apply( null, Array.prototype.slice.call( arguments ) );
|
549
584
|
};
|
550
|
-
})(fn);
|
585
|
+
})( fn );
|
551
586
|
}
|
552
587
|
}
|
553
588
|
});
|
554
589
|
}
|
555
590
|
|
556
|
-
$(window).bind("beforeunload", function () {
|
557
|
-
if ($.watermark.options.hideBeforeUnload) {
|
591
|
+
$( window ).bind( "beforeunload", function () {
|
592
|
+
if ( $.watermark.options.hideBeforeUnload ) {
|
558
593
|
$.watermark.hideAll();
|
559
594
|
}
|
560
595
|
});
|
561
596
|
}
|
562
597
|
|
563
|
-
})(jQuery, window);
|
598
|
+
})( jQuery, window );
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
13
|
|
14
14
|
# Gem dependencies
|
15
|
-
s.add_runtime_dependency('social_stream-base', '~> 0.22.
|
15
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.22.1')
|
16
16
|
s.add_runtime_dependency('rails-scheduler', '~> 0.0.8')
|
17
17
|
|
18
18
|
# Development Gem dependencies
|
data/social_stream.gemspec
CHANGED
@@ -11,9 +11,9 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.files = `git ls-files`.split("\n")
|
12
12
|
|
13
13
|
# Gem dependencies
|
14
|
-
s.add_runtime_dependency('social_stream-base', '~> 0.22.
|
14
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.22.1')
|
15
15
|
s.add_runtime_dependency('social_stream-documents', '~> 0.16.0')
|
16
|
-
s.add_runtime_dependency('social_stream-events', '~> 0.14.
|
16
|
+
s.add_runtime_dependency('social_stream-events', '~> 0.14.1')
|
17
17
|
s.add_runtime_dependency('social_stream-linkser', '~> 0.13.0')
|
18
18
|
s.add_runtime_dependency('social_stream-presence', '~> 0.15.0')
|
19
19
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.28.
|
4
|
+
version: 0.28.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-06
|
13
|
+
date: 2012-09-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: social_stream-base
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.22.
|
22
|
+
version: 0.22.1
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,7 +27,7 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - ~>
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: 0.22.
|
30
|
+
version: 0.22.1
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: social_stream-documents
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
@@ -51,7 +51,7 @@ dependencies:
|
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.14.
|
54
|
+
version: 0.14.1
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - ~>
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0.14.
|
62
|
+
version: 0.14.1
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: social_stream-linkser
|
65
65
|
requirement: !ruby/object:Gem::Requirement
|