spec/dummy/tmp/cache/assets/test/sprockets/170327cc3c46701aa0fad89ac033f86f in storytime-1.0.1 vs spec/dummy/tmp/cache/assets/test/sprockets/170327cc3c46701aa0fad89ac033f86f in storytime-1.0.2
- old
+ new
@@ -1,8 +1,8 @@
{I"
class:ETI"BundledAsset; FI"logical_path; TI"storytime/application.js; TI"
pathname; TI"Z/Users/ben/flyover/projects/storytime/app/assets/javascripts/storytime/application.js; FI"content_type; TI"application/javascript; TI"
-mtime; Tl++#FTI"length; TiC§I"digest; TI"%468cfe0401bd9ceb8de896731a2e4ea8; FI"source; TI"C§// This is a manifest file that'll be compiled into application.js, which will include all the files
+mtime; Tl+daZTI"length; TiÿºI"digest; TI"%c8a8d63f050d243d4f2b8b9b8ec97922; FI"source; TI"ÿº// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
@@ -12894,11 +12894,11 @@
}
}(jQuery);
/*!
- * jQuery UI Core 1.11.0
+ * jQuery UI Core 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
@@ -12920,11 +12920,11 @@
// $.ui might exist from components with no dependencies, e.g., $.ui.position
$.ui = $.ui || {};
$.extend( $.ui, {
- version: "1.11.0",
+ version: "1.11.2",
keyCode: {
BACKSPACE: 8,
COMMA: 188,
DELETE: 46,
@@ -12944,19 +12944,20 @@
}
});
// plugins
$.fn.extend({
- scrollParent: function() {
+ scrollParent: function( includeHidden ) {
var position = this.css( "position" ),
excludeStaticParent = position === "absolute",
+ overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
scrollParent = this.parents().filter( function() {
var parent = $( this );
if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
return false;
}
- return (/(auto|scroll)/).test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
+ return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
}).eq( 0 );
return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
},
@@ -12989,11 +12990,11 @@
map = element.parentNode;
mapName = map.name;
if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
return false;
}
- img = $( "img[usemap=#" + mapName + "]" )[0];
+ img = $( "img[usemap='#" + mapName + "']" )[ 0 ];
return !!img && visible( img );
}
return ( /input|select|textarea|button|object/.test( nodeName ) ?
!element.disabled :
"a" === nodeName ?
@@ -13200,11 +13201,11 @@
}));
/*!
- * jQuery UI Datepicker 1.11.0
+ * jQuery UI Datepicker 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
@@ -13225,11 +13226,11 @@
// Browser globals
factory( jQuery );
}
}(function( $ ) {
-$.extend($.ui, { datepicker: { version: "1.11.0" } });
+$.extend($.ui, { datepicker: { version: "1.11.2" } });
var datepicker_instActive;
function datepicker_getZindex( elem ) {
var position, value;
@@ -14001,17 +14002,21 @@
_updateDatepicker: function(inst) {
this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
datepicker_instActive = inst; // for delegate hover events
inst.dpDiv.empty().append(this._generateHTML(inst));
this._attachHandlers(inst);
- inst.dpDiv.find("." + this._dayOverClass + " a");
var origyearshtml,
numMonths = this._getNumberOfMonths(inst),
cols = numMonths[1],
- width = 17;
+ width = 17,
+ activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
+ if ( activeCell.length > 0 ) {
+ datepicker_handleMouseover.apply( activeCell.get( 0 ) );
+ }
+
inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
if (cols > 1) {
inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
}
inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
@@ -14340,11 +14345,12 @@
// Extract a number from the string value
getNumber = function(match) {
var isDoubled = lookAhead(match),
size = (match === "@" ? 14 : (match === "!" ? 20 :
(match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
- digits = new RegExp("^\\d{1," + size + "}"),
+ minSize = (match === "y" ? size : 1),
+ digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
num = value.substring(iValue).match(digits);
if (!num) {
throw "Missing number at position " + iValue;
}
iValue += num[0].length;
@@ -15201,24 +15207,26 @@
}
if (this.className.indexOf("ui-datepicker-next") !== -1) {
$(this).removeClass("ui-datepicker-next-hover");
}
})
- .delegate(selector, "mouseover", function(){
- if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline ? dpDiv.parent()[0] : datepicker_instActive.input[0])) {
- $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
- $(this).addClass("ui-state-hover");
- if (this.className.indexOf("ui-datepicker-prev") !== -1) {
- $(this).addClass("ui-datepicker-prev-hover");
- }
- if (this.className.indexOf("ui-datepicker-next") !== -1) {
- $(this).addClass("ui-datepicker-next-hover");
- }
- }
- });
+ .delegate( selector, "mouseover", datepicker_handleMouseover );
}
+function datepicker_handleMouseover() {
+ if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) {
+ $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
+ $(this).addClass("ui-state-hover");
+ if (this.className.indexOf("ui-datepicker-prev") !== -1) {
+ $(this).addClass("ui-datepicker-prev-hover");
+ }
+ if (this.className.indexOf("ui-datepicker-next") !== -1) {
+ $(this).addClass("ui-datepicker-next-hover");
+ }
+ }
+}
+
/* jQuery extend now ignores nulls! */
function datepicker_extendRemove(target, props) {
$.extend(target, props);
for (var name in props) {
if (props[name] == null) {
@@ -15268,17 +15276,17 @@
};
$.datepicker = new Datepicker(); // singleton instance
$.datepicker.initialized = false;
$.datepicker.uuid = new Date().getTime();
-$.datepicker.version = "1.11.0";
+$.datepicker.version = "1.11.2";
return $.datepicker;
}));
/*!
- * jQuery UI Position 1.11.0
+ * jQuery UI Position 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
@@ -15399,12 +15407,15 @@
isWindow: isWindow,
isDocument: isDocument,
offset: withinElement.offset() || { left: 0, top: 0 },
scrollLeft: withinElement.scrollLeft(),
scrollTop: withinElement.scrollTop(),
- width: isWindow ? withinElement.width() : withinElement.outerWidth(),
- height: isWindow ? withinElement.height() : withinElement.outerHeight()
+
+ // support: jQuery 1.6.x
+ // jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
+ width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
+ height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
};
}
};
$.fn.position = function( options ) {
@@ -15789,11 +15800,11 @@
return $.ui.position;
}));
/*!
- * jQuery UI Widget 1.11.0
+ * jQuery UI Widget 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
@@ -15816,15 +15827,22 @@
var widget_uuid = 0,
widget_slice = Array.prototype.slice;
$.cleanData = (function( orig ) {
return function( elems ) {
- for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ var events, elem, i;
+ for ( i = 0; (elem = elems[i]) != null; i++ ) {
try {
- $( elem ).triggerHandler( "remove" );
+
+ // Only trigger remove when necessary to save time
+ events = $._data( elem, "events" );
+ if ( events && events.remove ) {
+ $( elem ).triggerHandler( "remove" );
+ }
+
// http://bugs.jquery.com/ticket/8235
- } catch( e ) {}
+ } catch ( e ) {}
}
orig( elems );
};
})( $.cleanData );
@@ -16038,14 +16056,10 @@
_createWidget: function( options, element ) {
element = $( element || this.defaultElement || this )[ 0 ];
this.element = $( element );
this.uuid = widget_uuid++;
this.eventNamespace = "." + this.widgetName + this.uuid;
- this.options = $.widget.extend( {},
- this.options,
- this._getCreateOptions(),
- options );
this.bindings = $();
this.hoverable = $();
this.focusable = $();
@@ -16064,10 +16078,15 @@
// element is window or document
element.document || element );
this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
}
+ this.options = $.widget.extend( {},
+ this.options,
+ this._getCreateOptions(),
+ options );
+
this._create();
this._trigger( "create", null, this._getCreateEventData() );
this._init();
},
_getCreateOptions: $.noop,
@@ -16226,12 +16245,18 @@
}
});
},
_off: function( element, eventName ) {
- eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
+ eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
+ this.eventNamespace;
element.unbind( eventName ).undelegate( eventName );
+
+ // Clear the stack to avoid memory leaks (#10056)
+ this.bindings = $( this.bindings.not( element ).get() );
+ this.focusable = $( this.focusable.not( element ).get() );
+ this.hoverable = $( this.hoverable.not( element ).get() );
},
_delay: function( handler, delay ) {
function handlerProxy() {
return ( typeof handler === "string" ? instance[ handler ] : handler )
@@ -34267,13 +34292,13 @@
var addUnloadHandler;
function Editor() {}
Editor.prototype.init = function() {
- var excerpt_character_limit, form, self, title_character_limit;
+ var excerpt_character_limit, form, mediaInstance, self, title_character_limit;
self = this;
- this.initMedia();
+ mediaInstance = this.initMedia();
this.initWysiwyg();
title_character_limit = $("#title_character_limit").data("limit");
$("#title_character_limit").html(title_character_limit - $("#post_title").val().length);
$("#post_title").keypress(function(e) {
if ((e.which === 32 || e.which > 0x20) && ($("#post_title").val().length > title_character_limit - 1)) {
@@ -34295,62 +34320,91 @@
form = $(".edit_post").last();
$("#preview_post").click(function() {
self.autosavePostForm();
});
if ($("#main").data("preview")) {
- $("#preview_post").trigger("click");
window.open($("#preview_post").attr("href"));
}
} else {
form = $(".new_post").last();
- $("#preview_new_post").click(function() {
+ $("#preview_post").click(function() {
+ form.data("unsaved-changes", false);
$("<input name='preview' type='hidden' value='true'>").insertAfter($(".new_post").children().first());
$(".new_post").submit();
});
}
+ $(".chosen-select").chosen({
+ no_results_text: "No results were found... Press 'Enter' to create a new tag named ",
+ placeholder_text_multiple: "Select or enter one or more Tags",
+ search_contains: true
+ });
$(".datepicker").datepicker({
dateFormat: "MM d, yy"
});
$(".timepicker").timepicker({
showPeriod: true
});
+ $(document).on('shown.bs.modal', function() {
+ mediaInstance.initUpload();
+ });
+ $("#post_tag_ids").next("div").find(".search-field").children("input").on('keyup', function(e) {
+ var searched_tag, selected_tags;
+ if (e.which === 13 && $("#post_tag_ids").next("div").find(".search-field").children("input").val().length > 0) {
+ searched_tag = $("#post_tag_ids").next("div").find(".search-field").children("input").val();
+ $("#post_tag_ids").append('<option value="nv__' + searched_tag + '">' + searched_tag + '</option>');
+ selected_tags = $("#post_tag_ids").val() || [];
+ selected_tags.push("nv__" + searched_tag);
+ $("#post_tag_ids").val(selected_tags);
+ $("#post_tag_ids").trigger('chosen:updated');
+ }
+ });
+ $(".publish").on('click', function() {
+ $("#post_published").val(1);
+ form.data("unsaved-changes", false);
+ });
addUnloadHandler(form);
};
Editor.prototype.initMedia = function() {
var mediaInstance;
mediaInstance = new Storytime.Dashboard.Media();
mediaInstance.initPagination();
mediaInstance.initInsert();
mediaInstance.initFeaturedImageSelector();
- return $(document).on('shown.bs.modal', function() {
+ mediaInstance.initSecondaryImageSelector();
+ $(document).on('shown.bs.modal', function() {
mediaInstance.initUpload();
});
+ return mediaInstance;
};
Editor.prototype.initWysiwyg = function() {
+ var self;
+ self = this;
$(".summernote").summernote({
codemirror: {
htmlMode: true,
lineNumbers: true,
lineWrapping: true,
mode: 'text/html',
theme: 'monokai'
},
- height: 300,
+ height: 200,
minHeight: null,
maxHeight: null,
toolbar: [['style', ['style']], ['font', ['bold', 'italic', 'underline', 'superscript', 'subscript', 'strikethrough', 'clear']], ['color', ['color']], ['para', ['ul', 'ol', 'paragraph']], ['table', ['table']], ['insert', ['link', 'picture', 'video', 'hr']], ['view', ['fullscreen', 'codeview']], ['editing', ['undo', 'redo']], ['help', ['help']]],
onblur: function() {
$(".summernote").data("range", document.getSelection().getRangeAt(0));
},
onfocus: function() {
if ($(".edit_post").length) {
- self.updateLater(1000);
+ self.updateLater(10000);
}
},
onkeyup: function() {
+ var form;
+ form = $(".edit_post").length ? $(".edit_post").last() : $(".new_post").last();
form.data("unsaved-changes", true);
},
onImageUpload: function(files, editor, $editable) {
$("#media_file").fileupload('send', {
files: files
@@ -34358,57 +34412,67 @@
editor.insertImage($editable, result.file_url);
});
}
});
$(".note-image-dialog").on('shown.bs.modal', function() {
- $(".note-image-dialog").find(".row-fluid").append("<div id='gallery_copy'> <h5>Gallery</h5> <div id='media_gallery'>" + $("#media_gallery").html() + "</div> </div>");
+ if ($("#media_gallery").length > 0) {
+ $(".note-image-dialog").find(".row-fluid").append("<div id='gallery_copy'> <h5>Gallery</h5> <div id='media_gallery'>" + $("#media_gallery").html() + "</div> </div>");
+ }
});
return $(".note-image-dialog").on('hide.bs.modal', function() {
$("#gallery_copy").remove();
});
};
Editor.prototype.autosavePostForm = function() {
- var data, post_id, self;
+ var dashboard_namespace, data, form, post_id, self;
self = this;
post_id = $("#main").data("post-id");
+ dashboard_namespace = $("#main").data("dashboard-namespace");
data = [];
data.push({
name: "post[draft_content]",
value: $(".summernote").code()
});
+ form = $(".edit_post").length ? $(".edit_post").last() : $(".new_post").last();
+ form.data("unsaved-changes", false);
return $.ajax({
type: "POST",
- url: "/dashboard/posts/" + post_id + "/autosaves",
+ url: "" + dashboard_namespace + "/posts/" + post_id + "/autosaves",
data: data
});
};
Editor.prototype.updateLater = function(timer) {
- var self, timeoutId;
+ var form, self, timeoutId;
self = this;
if (timer == null) {
timer = 120000;
}
+ form = $(".edit_post").length ? $(".edit_post").last() : $(".new_post").last();
timeoutId = window.setTimeout((function() {
- return self.autosavePostForm().done(function() {
- var time_now;
- self.updateLater(10000);
- time_now = new Date().toLocaleTimeString();
- return $("#draft_last_saved_at").html("Draft saved at " + time_now);
- }).fail(function() {
- return console.log("Something went wrong while trying to autosave...");
- });
+ if (form.data("unsaved-changes") === true) {
+ self.autosavePostForm().done(function() {
+ var time_now;
+ self.updateLater(timer);
+ time_now = new Date().toLocaleTimeString();
+ $("#draft_last_saved_at").html("Draft saved at " + time_now);
+ }).fail(function() {
+ console.log("Something went wrong while trying to autosave...");
+ });
+ } else {
+ self.updateLater(timer);
+ }
}), timer);
};
addUnloadHandler = function(form) {
form.find("input, textarea").on("keyup", function() {
- return form.data("unsaved-changes", true);
+ form.data("unsaved-changes", true);
});
$(".save").click(function() {
- return form.data("unsaved-changes", false);
+ form.data("unsaved-changes", false);
});
return $(window).on("beforeunload", function() {
if (form.data("unsaved-changes")) {
return "You haven't saved your changes.";
}
@@ -34439,11 +34503,11 @@
var _ref;
if (!this.uploadInitialized) {
$('#media_file').fileupload({
dataType: 'json',
done: function(e, data) {
- $("#media_gallery").prepend(data.result.html);
+ $(".media_container").prepend(data.result.html);
},
progressall: function(e, data) {
var progress;
progress = parseInt(data.loaded / data.total * 100, 10);
$('#progress .progress-bar').css('width', progress + '%');
@@ -34458,42 +34522,88 @@
Media.prototype.initInsert = function() {
var self;
self = this;
$(document).on("click", ".insert-image-button", function(e) {
- var image_tag, node;
+ var featured_media, image_tag, node, secondary_media;
e.preventDefault();
if (self.selectingFeatured) {
- $("#featured_media_id").val($(this).data("media-id"));
+ featured_media = $("#featured_media_id");
+ featured_media.val($(this).data("media-id"));
if ($("#featured_media_image").length > 0) {
$("#featured_media_image").attr("src", $(this).data("thumb-url"));
} else {
$("#featured_media_container").html("<img id='featured_media_image' src='" + ($(this).data("thumb-url")) + "' />");
}
+ featured_media.parent().parent().find(".select_featured_image").hide();
+ featured_media.parent().parent().find(".remove_featured_image").show();
$("#insertMediaModal").modal("hide");
+ } else if (self.selectingSecondary) {
+ secondary_media = $("#secondary_media_id");
+ secondary_media.val($(this).data("media-id"));
+ if ($("#secondary_media_image").length > 0) {
+ $("#secondary_media_image").attr("src", $(this).data("thumb-url"));
+ } else {
+ $("#secondary_media_container").html("<img id='secondary_media_image' src='" + ($(this).data("thumb-url")) + "' />");
+ }
+ secondary_media.parent().parent().find(".select_featured_image").hide();
+ secondary_media.parent().parent().find(".remove_featured_image").show();
+ $("#insertMediaModal").modal("hide");
+ } else if (self.selectingSecondary) {
+ $("#secondary_media_id").val($(this).data("media-id"));
+ if ($("#secondary_media_image").length > 0) {
+ $("#secondary_media_image").attr("src", $(this).data("thumb-url"));
+ } else {
+ $("#secondary_media_container").html("<img id='secondary_media_image' src='" + ($(this).data("thumb-url")) + "' />");
+ }
+ $("#insertMediaModal").modal("hide");
} else {
image_tag = "<img src='" + ($(this).data("image-url")) + "' />";
node = $(".summernote").data("range").createContextualFragment(image_tag);
$(".summernote").data("range").insertNode(node);
$(".note-image-dialog").modal("hide");
}
});
+ $(document).on("click", "button.remove_featured_image", function(e) {
+ e.preventDefault();
+ $(this).parent().find("input").val("");
+ $(this).parent().find(".image_container").html("");
+ $(this).parent().find(".select_featured_image").show();
+ $(this).parent().find(".remove_featured_image").hide();
+ });
};
Media.prototype.initFeaturedImageSelector = function() {
var self;
self = this;
$(document).on("click", "#featured_media_button", function(e) {
e.preventDefault();
self.selectingFeatured = true;
+ self.selectingSecondary = false;
$("#insertMediaModal").modal("show");
});
$(document).on('hidden.bs.modal', function() {
self.selectingFeatured = false;
+ self.selectingSecondary = false;
});
};
+ Media.prototype.initSecondaryImageSelector = function() {
+ var self;
+ self = this;
+ $(document).on("click", "#secondary_media_button", function(e) {
+ e.preventDefault();
+ self.selectingFeatured = false;
+ self.selectingSecondary = true;
+ $("#insertMediaModal").modal("show");
+ });
+ $(document).on('hidden.bs.modal', function() {
+ self.selectingFeatured = false;
+ self.selectingSecondary = false;
+ });
+ };
+
return Media;
})();
}).call(this);
@@ -34594,6 +34704,6 @@
}
}
}
;
-; TI"required_assets_digest; TI"%7668d325103351052f9084faa8de76cf; FI"
_version; TI"%64b22cf9f770209c1e0beb31754a8cbc; F
+; TI"required_assets_digest; TI"%05f4459d9fc9529f573a3398abd50829; FI"
_version; TI"%37d9e9317b7fde5d2addbefd4177a12b; F
\ No newline at end of file