o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1339006099.0375218: @value"{I" class:EFI"ProcessedAsset;FI"logical_path;F"cms/core_library.jsI" pathname;F"‰/Users/josiahivey/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/browsercms-3.5.0.rc3/app/assets/javascripts/cms/core_library.js.erbI"content_type;FI"application/javascript;FI" mtime;FI"2012-05-24T14:00:47-05:00;FI" length;Fi÷I" digest;F"%9770224a1800bf6e2bbd063a021f4e41I" source;FI"÷// // Defines Core BrowserCMS functions used throughout the application. // // jQuery(function ($) { //It would be cool if these were added to the real jQuery //You can call this a few ways: //createElement('p') => "

" //createElement('p','hi') => "

hi

" //createElement('p', {align: 'center'}) => "

" //createElement('p','hi',{align: 'center'}) => "

hi

" $.createElement = function (tag_name, tag_value, tag_attrs) { var name = tag_name if (typeof tag_value == "object") { var value = null var attrs = tag_value } else { var value = tag_value var attrs = tag_attrs } var element = $(document.createElement(tag_name)) if (attrs) { $.each(attrs, function (k, v) { element.attr(k, v) }) } if (value) { element.html(value) } return element } var sanitizationRegexes = [ [/\s/, "_"], [/[&+()]/, "-"], [/[=?!'"{}\[\]#<>%]/, ""] ] $.cms = { sanitizeFileName:function (s) { var split = s.split(/\/|\\/) s = split[split.length - 1] $.each(sanitizationRegexes, function (i, e) { var r = new RegExp(e[0].source, 'g') s = s.replace(r, e[1]) }) return s; }, slug:function (s) { return $.trim(s.toLowerCase().replace(/[^a-zA-Z0-9_\s]+/g, '')).replace(/\ +/g, '-') }, showNotice:function (msg) { $('#message').removeClass('error').addClass('notice').html(msg).parent().show().animate({opacity:1.0}, 3000).fadeOut("normal") }, showError:function (msg) { $('#message').removeClass('notice').addClass('error').html(msg).parent().show().animate({opacity:1.0}, 3000).fadeOut("normal") }, attachEventHandlers:function (context) { $('a.button', context).click(function () { if ($(this).hasClass('disabled')) return false; }); $('a.http_post, a.http_put, a.http_delete', context).click(function () { if ($(this).hasClass('disabled')) return false; if ($(this).hasClass('confirm_with_title') ? confirm(this.title) : true) { // Create the form var f = document.createElement('form') f.style.display = 'none' this.parentNode.appendChild(f) f.method = "POST" f.action = this.href $(f).attr('target', $(this).attr('target')) //Create the _method hidden input var m = document.createElement('input') var http_method = $(this).attr('class').match(/http_([^ ]*)/)[1] $(m).attr('type', 'hidden').attr('name', '_method').attr('value', http_method) f.appendChild(m) //Create the authenticity_token hidden input if ($.cms.authenticity_token && $.cms.authenticity_token != '') { var m = document.createElement('input') $(m).attr('type', 'hidden').attr('name', 'authenticity_token').attr('value', $.cms.authenticity_token) f.appendChild(m) } f.submit() } return false }) } } $.cms.attachEventHandlers(document); $('#message.notice').parent().show().animate({opacity:1.0}, 3000).fadeOut("normal") $('#message.error').parent().show().animate({opacity:1.0}, 3000).fadeOut("normal") }); // Automatically enable date_picker controls $(function () { if ($.datepicker) { $('input.date_picker').datepicker({ changeFirstDay:false, changeMonth:true, changeYear:true, closeText:'', showButtonPanel:true, dateFormat:'yy/mm/dd' }); } }); // UI Enhancement to suggest paths for uploaded files $(function () { var path_input = $('.suggest_file_path'); if (path_input.length) { $('select[data-purpose=section_selector], input[data-purpose=cms_file_field]').change(function () { var section_id = $('select[data-purpose=section_selector]').val(); var section_path = $('.section_id_map[data-id='+ section_id +']').data('path'); var file_path = $.cms.sanitizeFileName($('input[data-purpose=cms_file_field]').val()); path_input.val(section_path + file_path); }); } }); //CookieSet allows us to treat one cookie value as a set of values jQuery(function ($) { var sep = '|' $.cookieSet = { //Treats the cookie as an array add:function (name, value, options) { this.remove(name, value, options) var set = this.get(name) if (set) { set.push(value) } else { var set = [value] } $.cookie(name, set.join(sep), options) return this.get(name) }, get:function (name) { var val = $.cookie(name) if (val) { return val.split(sep) } else { return null } }, remove:function (name, value, options) { var set = this.get(name) if (set) { var arr = [] $.each(set, function () { if (this != value + '') { arr.push(this) } }) $.cookie(name, arr.join(sep), options) return this.get(name) } else { return null } }, //Treats the cookie as an array contains:function (name, value) { var set = this.get(name) if (set) { return $.inArray(value + '', set) > -1 } else { return false } } } }); ;FI"dependency_digest;F"%5f98445155f5203149122ac57f63915aI"required_paths;F["|/Users/josiahivey/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/jquery-rails-2.0.2/vendor/assets/javascripts/jquery.js"‰/Users/josiahivey/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/browsercms-3.5.0.rc3/app/assets/javascripts/cms/core_library.js.erbI"dependency_paths;F[{I" path;F"‰/Users/josiahivey/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/browsercms-3.5.0.rc3/app/assets/javascripts/cms/core_library.js.erbI" mtime;FI"2012-05-24T14:00:47-05:00;FI" digest;F"%52409bef5dfc039cd287989a1c3158aa{I" path;F"|/Users/josiahivey/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/jquery-rails-2.0.2/vendor/assets/javascripts/jquery.jsI" mtime;FI"2012-04-11T16:44:06-05:00;FI" digest;F"%33830d8b45ce2f9b31ccd9bdf5f3fc6eI" _version;F"%9f3b95dd7ea3030dc35985c0a8020862