test/dummy/tmp/cache/assets/test/sprockets/eb2867da33f352331b0a86f8f9b9ccdf in i18n_admin_utils-0.0.4 vs test/dummy/tmp/cache/assets/test/sprockets/eb2867da33f352331b0a86f8f9b9ccdf in i18n_admin_utils-1.0.0

- old
+ new

@@ -1,8 +1,8 @@ {I" class:EFI"BundledAsset;FI"logical_path;FI"$i18n_admin_utils/application.js;TI" pathname;FI"_C:/dev/ws/ruby/i18n_admin_utils/app/assets/javascripts/i18n_admin_utils/application.coffee;FI"content_type;FI"application/javascript;FI" -mtime;Fl+)“/SI" length;Fi¶²I" digest;F"%ece542c44c2f544c2633e258896912b5I" source;FI"¶²/*! +mtime;Fl+‚HSI" length;FiÑI" digest;F"%2671099791fbc6f93af04d2d2f26361eI" source;FI"Ñ/*! * jQuery JavaScript Library v1.11.0 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ @@ -10735,12 +10735,14 @@ }); } })( jQuery ); (function() { - var CSRFToken, allowLinkExtensions, anchoredLink, browserCompatibleDocumentParser, browserIsntBuggy, browserSupportsCustomEvents, browserSupportsPushState, browserSupportsTurbolinks, bypassOnLoadPopstate, cacheCurrentPage, cacheSize, changePage, constrainPageCacheTo, createDocument, crossOriginLink, currentState, enableTransitionCache, executeScriptTags, extractLink, extractTitleAndBody, fetch, fetchHistory, fetchReplacement, handleClick, historyStateIsDefined, htmlExtensions, ignoreClick, initializeTurbolinks, installClickHandlerLast, installDocumentReadyPageEventTriggers, installHistoryChangeHandler, installJqueryAjaxSuccessPageUpdateTrigger, loadedAssets, noTurbolink, nonHtmlLink, nonStandardClick, pageCache, pageChangePrevented, pagesCached, popCookie, processResponse, recallScrollPosition, referer, reflectNewUrl, reflectRedirectedUrl, rememberCurrentState, rememberCurrentUrl, rememberReferer, removeHash, removeHashForIE10compatiblity, removeNoscriptTags, requestMethodIsSafe, resetScrollPosition, targetLink, transitionCacheEnabled, transitionCacheFor, triggerEvent, visit, xhr, _ref, + var CSRFToken, Click, ComponentUrl, Link, browserCompatibleDocumentParser, browserIsntBuggy, browserSupportsCustomEvents, browserSupportsPushState, browserSupportsTurbolinks, bypassOnLoadPopstate, cacheCurrentPage, cacheSize, changePage, constrainPageCacheTo, createDocument, currentState, enableTransitionCache, executeScriptTags, extractTitleAndBody, fetch, fetchHistory, fetchReplacement, historyStateIsDefined, initializeTurbolinks, installDocumentReadyPageEventTriggers, installHistoryChangeHandler, installJqueryAjaxSuccessPageUpdateTrigger, loadedAssets, pageCache, pageChangePrevented, pagesCached, popCookie, processResponse, recallScrollPosition, referer, reflectNewUrl, reflectRedirectedUrl, rememberCurrentState, rememberCurrentUrl, rememberReferer, removeNoscriptTags, requestMethodIsSafe, resetScrollPosition, transitionCacheEnabled, transitionCacheFor, triggerEvent, visit, xhr, _ref, __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, + __hasProp = {}.hasOwnProperty, + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, __slice = [].slice; pageCache = {}; cacheSize = 10; @@ -10749,24 +10751,23 @@ currentState = null; loadedAssets = null; - htmlExtensions = ['html']; - referer = null; createDocument = null; xhr = null; fetch = function(url) { var cachedPage; + url = new ComponentUrl(url); rememberReferer(); cacheCurrentPage(); reflectNewUrl(url); - if (transitionCacheEnabled && (cachedPage = transitionCacheFor(url))) { + if (transitionCacheEnabled && (cachedPage = transitionCacheFor(url.absolute))) { fetchHistory(cachedPage); return fetchReplacement(url); } else { return fetchReplacement(url, resetScrollPosition); } @@ -10792,17 +10793,17 @@ onLoadFunction = (function(_this) { return function() {}; })(this); } triggerEvent('page:fetch', { - url: url + url: url.absolute }); if (xhr != null) { xhr.abort(); } xhr = new XMLHttpRequest; - xhr.open('GET', removeHashForIE10compatiblity(url), true); + xhr.open('GET', url.withoutHashForIE10compatibility(), true); xhr.setRequestHeader('Accept', 'text/html, application/xhtml+xml, application/xml'); xhr.setRequestHeader('X-XHR-Referer', referer); xhr.onload = function() { var doc; triggerEvent('page:receive'); @@ -10810,18 +10811,18 @@ changePage.apply(null, extractTitleAndBody(doc)); reflectRedirectedUrl(); onLoadFunction(); return triggerEvent('page:load'); } else { - return document.location.href = url; + return document.location.href = url.absolute; } }; xhr.onloadend = function() { return xhr = null; }; xhr.onerror = function() { - return document.location.href = url; + return document.location.href = url.absolute; }; return xhr.send(); }; fetchHistory = function(cachedPage) { @@ -10832,12 +10833,14 @@ recallScrollPosition(cachedPage); return triggerEvent('page:restore'); }; cacheCurrentPage = function() { - pageCache[currentState.url] = { - url: document.location.href, + var currentStateUrl; + currentStateUrl = new ComponentUrl(currentState.url); + pageCache[currentStateUrl.absolute] = { + url: currentStateUrl.relative, body: document.body, title: document.title, positionY: window.pageYOffset, positionX: window.pageXOffset, cachedAt: new Date().getTime(), @@ -10914,23 +10917,24 @@ node.innerHTML = node.innerHTML.replace(/<noscript[\S\s]*?<\/noscript>/ig, ''); return node; }; reflectNewUrl = function(url) { - if (url !== referer) { + if ((url = new ComponentUrl(url)).absolute !== referer) { return window.history.pushState({ turbolinks: true, - url: url - }, '', url); + url: url.absolute + }, '', url.absolute); } }; reflectRedirectedUrl = function() { var location, preservedHash; if (location = xhr.getResponseHeader('X-XHR-Redirected-To')) { - preservedHash = removeHash(location) === location ? document.location.hash : ''; - return window.history.replaceState(currentState, '', location + preservedHash); + location = new ComponentUrl(location); + preservedHash = location.hasNoHash() ? document.location.hash : ''; + return window.history.replaceState(currentState, '', location.href + preservedHash); } }; rememberReferer = function() { return referer = document.location.href; @@ -10957,24 +10961,10 @@ } else { return window.scrollTo(0, 0); } }; - removeHashForIE10compatiblity = function(url) { - return removeHash(url); - }; - - removeHash = function(url) { - var link; - link = url; - if (url.href == null) { - link = document.createElement('A'); - link.href = url; - } - return link.href.replace(link.hash, ''); - }; - popCookie = function(name) { var value, _ref; value = ((_ref = document.cookie.match(new RegExp(name + "=(\\w+)"))) != null ? _ref[1].toUpperCase() : void 0) || ''; document.cookie = name + '=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/'; return value; @@ -11102,84 +11092,155 @@ return createDocumentUsingWrite; } } }; - installClickHandlerLast = function(event) { - if (!event.defaultPrevented) { - document.removeEventListener('click', handleClick, false); - return document.addEventListener('click', handleClick, false); + ComponentUrl = (function() { + function ComponentUrl(original) { + this.original = original != null ? original : document.location.href; + if (this.original.constructor === ComponentUrl) { + return this.original; + } + this._parse(); } - }; - handleClick = function(event) { - var link; - if (!event.defaultPrevented) { - link = extractLink(event); - if (link.nodeName === 'A' && !ignoreClick(event, link)) { - if (!pageChangePrevented()) { - visit(link.href); - } - return event.preventDefault(); + ComponentUrl.prototype.withoutHash = function() { + return this.href.replace(this.hash, ''); + }; + + ComponentUrl.prototype.withoutHashForIE10compatibility = function() { + return this.withoutHash(); + }; + + ComponentUrl.prototype.hasNoHash = function() { + return this.hash.length === 0; + }; + + ComponentUrl.prototype._parse = function() { + var _ref; + (this.link != null ? this.link : this.link = document.createElement('a')).href = this.original; + _ref = this.link, this.href = _ref.href, this.protocol = _ref.protocol, this.host = _ref.host, this.hostname = _ref.hostname, this.port = _ref.port, this.pathname = _ref.pathname, this.search = _ref.search, this.hash = _ref.hash; + this.origin = [this.protocol, '//', this.hostname].join(''); + if (this.port.length !== 0) { + this.origin += ":" + this.port; } - } - }; + this.relative = [this.pathname, this.search, this.hash].join(''); + return this.absolute = this.href; + }; - extractLink = function(event) { - var link; - link = event.target; - while (!(!link.parentNode || link.nodeName === 'A')) { - link = link.parentNode; - } - return link; - }; + return ComponentUrl; - crossOriginLink = function(link) { - return location.protocol !== link.protocol || location.host !== link.host; - }; + })(); - anchoredLink = function(link) { - return ((link.hash && removeHash(link)) === removeHash(location)) || (link.href === location.href + '#'); - }; + Link = (function(_super) { + __extends(Link, _super); - nonHtmlLink = function(link) { - var url; - url = removeHash(link); - return url.match(/\.[a-z]+(\?.*)?$/g) && !url.match(new RegExp("\\.(?:" + (htmlExtensions.join('|')) + ")?(\\?.*)?$", 'g')); - }; + Link.HTML_EXTENSIONS = ['html']; - noTurbolink = function(link) { - var ignore; - while (!(ignore || link === document)) { - ignore = link.getAttribute('data-no-turbolink') != null; - link = link.parentNode; + Link.allowExtensions = function() { + var extension, extensions, _i, _len; + extensions = 1 <= arguments.length ? __slice.call(arguments, 0) : []; + for (_i = 0, _len = extensions.length; _i < _len; _i++) { + extension = extensions[_i]; + Link.HTML_EXTENSIONS.push(extension); + } + return Link.HTML_EXTENSIONS; + }; + + function Link(link) { + this.link = link; + if (this.link.constructor === Link) { + return this.link; + } + this.original = this.link.href; + Link.__super__.constructor.apply(this, arguments); } - return ignore; - }; - targetLink = function(link) { - return link.target.length !== 0; - }; + Link.prototype.shouldIgnore = function() { + return this._crossOrigin() || this._anchored() || this._nonHtml() || this._optOut() || this._target(); + }; - nonStandardClick = function(event) { - return event.which > 1 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey; - }; + Link.prototype._crossOrigin = function() { + return this.origin !== (new ComponentUrl).origin; + }; - ignoreClick = function(event, link) { - return crossOriginLink(link) || anchoredLink(link) || nonHtmlLink(link) || noTurbolink(link) || targetLink(link) || nonStandardClick(event); - }; + Link.prototype._anchored = function() { + var current; + return ((this.hash && this.withoutHash()) === (current = new ComponentUrl).withoutHash()) || (this.href === current.href + '#'); + }; - allowLinkExtensions = function() { - var extension, extensions, _i, _len; - extensions = 1 <= arguments.length ? __slice.call(arguments, 0) : []; - for (_i = 0, _len = extensions.length; _i < _len; _i++) { - extension = extensions[_i]; - htmlExtensions.push(extension); + Link.prototype._nonHtml = function() { + return this.pathname.match(/\.[a-z]+$/g) && !this.pathname.match(new RegExp("\\.(?:" + (Link.HTML_EXTENSIONS.join('|')) + ")?$", 'g')); + }; + + Link.prototype._optOut = function() { + var ignore, link; + link = this.link; + while (!(ignore || link === document)) { + ignore = link.getAttribute('data-no-turbolink') != null; + link = link.parentNode; + } + return ignore; + }; + + Link.prototype._target = function() { + return this.link.target.length !== 0; + }; + + return Link; + + })(ComponentUrl); + + Click = (function() { + Click.installHandlerLast = function(event) { + if (!event.defaultPrevented) { + document.removeEventListener('click', Click.handle, false); + return document.addEventListener('click', Click.handle, false); + } + }; + + Click.handle = function(event) { + return new Click(event); + }; + + function Click(event) { + this.event = event; + if (this.event.defaultPrevented) { + return; + } + this._extractLink(); + if (this._validForTurbolinks()) { + if (!pageChangePrevented()) { + visit(this.link.href); + } + this.event.preventDefault(); + } } - return htmlExtensions; - }; + Click.prototype._extractLink = function() { + var link; + link = this.event.target; + while (!(!link.parentNode || link.nodeName === 'A')) { + link = link.parentNode; + } + if (link.nodeName === 'A' && link.href.length !== 0) { + return this.link = new Link(link); + } + }; + + Click.prototype._validForTurbolinks = function() { + return (this.link != null) && !(this.link.shouldIgnore() || this._nonStandardClick()); + }; + + Click.prototype._nonStandardClick = function() { + return this.event.which > 1 || this.event.metaKey || this.event.ctrlKey || this.event.shiftKey || this.event.altKey; + }; + + return Click; + + })(); + bypassOnLoadPopstate = function(fn) { return setTimeout(fn, 500); }; installDocumentReadyPageEventTriggers = function() { @@ -11201,11 +11262,11 @@ }; installHistoryChangeHandler = function(event) { var cachedPage, _ref; if ((_ref = event.state) != null ? _ref.turbolinks : void 0) { - if (cachedPage = pageCache[event.state.url]) { + if (cachedPage = pageCache[(new ComponentUrl(event.state.url)).absolute]) { cacheCurrentPage(); return fetchHistory(cachedPage); } else { return visit(event.target.location.href); } @@ -11214,11 +11275,11 @@ initializeTurbolinks = function() { rememberCurrentUrl(); rememberCurrentState(); createDocument = browserCompatibleDocumentParser(); - document.addEventListener('click', installClickHandlerLast, true); + document.addEventListener('click', Click.installHandlerLast, true); return bypassOnLoadPopstate(function() { return window.addEventListener('popstate', installHistoryChangeHandler, false); }); }; @@ -11250,15 +11311,23 @@ this.Turbolinks = { visit: visit, pagesCached: pagesCached, enableTransitionCache: enableTransitionCache, - allowLinkExtensions: allowLinkExtensions, + allowLinkExtensions: Link.allowExtensions, supported: browserSupportsTurbolinks }; }).call(this); +/*! + Autosize v1.18.6 - 2014-03-13 + Automatically adjust textarea height based on user input. + (c) 2014 Jack Moore - http://www.jacklmoore.com/autosize + license: http://www.opensource.org/licenses/mit-license.php +*/ + +(function(e){var t,o={className:"autosizejs",id:"autosizejs",append:"",callback:!1,resizeDelay:10,placeholder:!0},i='<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>',n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],a=e(i).data("autosize",!0)[0];a.style.lineHeight="99px","99px"===e(a).css("lineHeight")&&n.push("lineHeight"),a.style.lineHeight="",e.fn.autosize=function(i){return this.length?(i=e.extend({},o,i||{}),a.parentNode!==document.body&&e(document.body).append(a),this.each(function(){function o(){var t,o=window.getComputedStyle?window.getComputedStyle(u,null):!1;o?(t=u.getBoundingClientRect().width,0===t&&(t=parseInt(o.width,10)),e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,i){t-=parseInt(o[i],10)})):t=Math.max(p.width(),0),a.style.width=t+"px"}function s(){var s={};if(t=u,a.className=i.className,a.id=i.id,d=parseInt(p.css("maxHeight"),10),e.each(n,function(e,t){s[t]=p.css(t)}),e(a).css(s).attr("wrap",p.attr("wrap")),o(),window.chrome){var r=u.style.width;u.style.width="0px",u.offsetWidth,u.style.width=r}}function r(){var e,n;t!==u?s():o(),a.value=!u.value&&i.placeholder?(p.attr("placeholder")||"")+i.append:u.value+i.append,a.style.overflowY=u.style.overflowY,n=parseInt(u.style.height,10),a.scrollTop=0,a.scrollTop=9e4,e=a.scrollTop,d&&e>d?(u.style.overflowY="scroll",e=d):(u.style.overflowY="hidden",c>e&&(e=c)),e+=w,n!==e&&(u.style.height=e+"px",f&&i.callback.call(u,u))}function l(){clearTimeout(h),h=setTimeout(function(){var e=p.width();e!==g&&(g=e,r())},parseInt(i.resizeDelay,10))}var d,c,h,u=this,p=e(u),w=0,f=e.isFunction(i.callback),z={height:u.style.height,overflow:u.style.overflow,overflowY:u.style.overflowY,wordWrap:u.style.wordWrap,resize:u.style.resize},g=p.width();p.data("autosize")||(p.data("autosize",!0),("border-box"===p.css("box-sizing")||"border-box"===p.css("-moz-box-sizing")||"border-box"===p.css("-webkit-box-sizing"))&&(w=p.outerHeight()-p.height()),c=Math.max(parseInt(p.css("minHeight"),10)-w||0,p.height()),p.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word",resize:"none"===p.css("resize")||"vertical"===p.css("resize")?"none":"horizontal"}),"onpropertychange"in u?"oninput"in u?p.on("input.autosize keyup.autosize",r):p.on("propertychange.autosize",function(){"value"===event.propertyName&&r()}):p.on("input.autosize",r),i.resizeDelay!==!1&&e(window).on("resize.autosize",l),p.on("autosize.resize",r),p.on("autosize.resizeIncludeStyle",function(){t=null,r()}),p.on("autosize.destroy",function(){t=null,clearTimeout(h),e(window).off("resize",l),p.off("autosize").off(".autosize").css(z).removeData("autosize")}),r())})):this}})(window.jQuery||window.$); (function() { var get_content, handle_error; $(document).ready(function() { $('span.translation_missing').each(function() { @@ -11270,19 +11339,10 @@ html: true, title: 'Translation missing, Input', content: content }); }); - $('.loadonready').each(function() { - var container, url; - container = $(this); - url = container.data('url'); - return $.get(url).success(function(data) { - container.html(data); - return window.load_script_on(container); - }); - }); return $(document).on('submit', 'form.translation_helper', function(e) { var form; e.preventDefault(); form = $(this); form.find('button').prop('disabled', true); @@ -11307,11 +11367,10 @@ get_content = function(span) { var content, key, url; url = '/translation/edit'; key = span.attr('title').match(/translation missing: (.*)/)[1]; - console.log(key); content = "<form action='" + url + "' method='post' class='translation_helper'>"; content += "<div class='alert alert-danger hidden'></div>"; content += "<input type='hidden' name='key' value='" + key + "'>"; content += "<label>Translate " + key + "</label>"; content += "<input type='text' name='value' class='form-control'>"; @@ -13289,22 +13348,73 @@ (function() { + var hide_translation_element, show_translation_element; + $(document).ready(function() { window.load_script_on($(this)); + $('.loadonready').each(function() { + var container, url; + container = $(this); + url = container.data('url'); + container.html($('#loading_icon').html()); + return $.get(url).success(function(data) { + container.html(data); + return window.load_script_on(container); + }); + }); $(document).on('click', 'form input.nosubmit, form button.nosubmit', function(e) { return e.preventDefault(); }); - return $(document).on('keyup', 'input[data-update], textarea[data-update]', function() { + $(document).on('keyup', 'input[data-update], textarea[data-update]', function() { var form, input; input = $(this); form = input.closest('form'); - console.log(form); return form.find('input[name="' + input.data('update') + '"], textarea[name="' + input.data('update') + '"]').val(input.val()); }); + $(document).on('click', '.toogle-container', function() { + var container; + container = $($(this).data('container')); + if (container.is(':visible')) { + return container.hide(); + } else { + return container.show(); + } + }); + $(document).on('keyup', 'input.translation_search', function() { + var container, elements, input, query, val; + input = $(this); + val = input.val(); + container = input.closest('.translation_container'); + elements = container.find('.translation_list .translation_item'); + if (val.length === 0) { + return show_translation_element(elements); + } else { + query = '[data-locale*="' + val + '"],[data-key*="' + val + '"], [data-filename*="' + val + '"]'; + show_translation_element(elements.filter(query)); + return hide_translation_element(elements.not(query)); + } + }); + return $(document).on('click', '.translation_list .translation_item', function() { + var container, item, list; + item = $(this); + list = item.closest('.translation_list'); + list.find('.translation_item.active').each(function() { + return $(this).removeClass('active'); + }); + item.addClass('active'); + container = item.closest('.translation_container').find(list.data('container')); + container.html($('#loading_icon').html()); + return $.get(list.data('url'), { + translation: item.data('translation') + }).success(function(data) { + container.html(data); + return window.load_script_on(container); + }); + }); }); window.load_script_on = function(container) { container.find("[rel=tooltip]").tooltip({ container: 'body', @@ -13315,10 +13425,32 @@ container: 'body', animation: false, delay: 0, trigger: 'hover' }); - return container.find('[data-toggle="modal"]').modal('hide'); + container.find('[data-toggle="modal"]').modal('hide'); + container.find('textarea.autosize').autosize(); + return window.load_rails_embed_code_editor(); }; + show_translation_element = function(elements) { + return elements.each(function() { + var element; + element = $(this); + if (!element.is(':visible')) { + return element.slideDown(200); + } + }); + }; + + hide_translation_element = function(elements) { + return elements.each(function() { + var element; + element = $(this); + if (element.is(':visible')) { + return element.slideUp(200); + } + }); + }; + }).call(this); -;TI"required_assets_digest;F"%e867565679381bdc1e89d941767d5f0aI" _version;F"%1005ed9f20e25fb0a0599a7017dd0e6b +;TI"required_assets_digest;F"%b410a84a4c6b4ecedf030e1762ee28d6I" _version;F"%2b66aa67c90052d553e0328c249bc9b0 \ No newline at end of file