test/dummy/tmp/cache/assets/CDF/CE0/sprockets%2F5b28ba105943c3d7648e1c3a64497d6a in i18n_viz-0.3.0 vs test/dummy/tmp/cache/assets/CDF/CE0/sprockets%2F5b28ba105943c3d7648e1c3a64497d6a in i18n_viz-0.3.1
- old
+ new
@@ -1,8 +1,8 @@
-o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1336549141.5283899�$:@value"{*{I"
+o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1336981034.7149305�l:@value"Y*{I"
class:EFI"BundledAsset;FI"logical_path;FI"application.js;TI"
pathname;FI"4$root/app/assets/javascripts/application.js.erb;FI"content_type;FI"application/javascript;FI"
-mtime;FI"2012-05-09T09:38:33+02:00;FI"length;Fi�(I"digest;F"%2ff4b53e7640d580d0eab06526942a86I"source;FI"�(/*!
+mtime;FI"2012-05-14T09:35:30+02:00;FI"length;Fi�(I"digest;F"%81cc317d9dc74b48954be1f7a4a9ef8dI"source;FI"�(/*!
* jQuery JavaScript Library v1.7.2
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
@@ -9804,63 +9804,67 @@
};
}).call(this);
(function() {
+ window.I18nViz.extractI18nKeysFromText = function(text) {
+ var keys;
+ keys = text.match(window.I18nViz.global_regex);
+ if (keys) {
+ keys.forEach(function(value, index) {
+ return keys[index] = value.replace(/--/g, "");
+ });
+ return keys;
+ } else {
+ return null;
+ }
+ };
+
$.fn.enrichWithI18nData = function() {
- var i18n_keys;
- i18n_keys = I18nViz.extractI18nKeysFromText($(this).text());
+ var $i18n_element, i18n_keys;
+ $i18n_element = $(this);
+ i18n_keys = window.I18nViz.extractI18nKeysFromText($i18n_element.text());
if (i18n_keys !== null) {
- $(this).addClass("i18n-viz").data("i18n-keys", i18n_keys);
+ $i18n_element.addClass("i18n-viz").data("i18n-keys", i18n_keys);
}
- return $(this);
+ return $i18n_element;
};
$.fn.clearI18nText = function() {
$(this).textNodes().each(function() {
return $(this).replaceWith($(this).text().replace(I18nViz.global_regex, ""));
});
return $(this);
};
- I18nViz.extractI18nKeysFromText = function(text) {
- var keys;
- keys = text.match(I18nViz.global_regex);
- if (keys) {
- keys.forEach(function(value, index) {
- return keys[index] = value.replace(/--/g, "");
- });
- return keys;
- } else {
- return null;
- }
- };
-
$.extend($.expr[':'], {
'i18n-textnode': function(el) {
- return I18nViz.regex.test($(el).textNodes().text());
+ return window.I18nViz.regex.test($(el).textNodes().text());
},
'i18n-value-placeholder': function(el) {
- return I18nViz.regex.test($(el).val()) || I18nViz.regex.test($(el).attr('placeholder'));
+ return window.I18nViz.regex.test($(el).val()) || I18nViz.regex.test($(el).attr('placeholder'));
}
});
}).call(this);
(function() {
$(document).ready(function() {
$("body").append('<div id="i18n_viz_tooltip">...</div>').click(function() {
return $("#i18n_viz_tooltip").hide();
});
- $.fn.initGUI = function(keys) {
- $(this).mouseenter(function() {
+ $.fn.initGUI = function() {
+ var $i18n_element, keys;
+ $i18n_element = $(this);
+ keys = $i18n_element.data("i18n-keys");
+ $i18n_element.mouseenter(function() {
var $tooltip, left, top;
$tooltip = $("#i18n_viz_tooltip");
- top = $(this).offset().top - $tooltip.outerHeight();
- left = $(this).offset().left;
+ top = $i18n_element.offset().top - $tooltip.outerHeight();
+ left = $i18n_element.offset().left;
if (top < 0) {
- top = $(this).offset().top + $(this).height() + 10;
+ top = $i18n_element.offset().top + $i18n_element.height() + 10;
}
$tooltip.html('');
keys.forEach(function(value) {
if (window.I18nViz.external_tool_url.length > 0) {
return $tooltip.append('<a href="' + window.I18nViz.external_tool_url + value + '" target="_blank">' + value + '</a>');
@@ -9871,25 +9875,21 @@
return $tooltip.css({
top: top,
left: left
}).show();
});
- return $(this);
+ return $i18n_element;
};
$(":i18n-textnode").each(function() {
- var $i18n_textnode, i18n_keys;
- $i18n_textnode = $(this);
- i18n_keys = window.I18nViz.extractI18nKeysFromText($i18n_textnode.text());
- return $i18n_textnode.enrichWithI18nData(i18n_keys).initGUI(i18n_keys).clearI18nText();
+ return $(this).enrichWithI18nData().clearI18nText().initGUI();
});
return $("input:i18n-value-placeholder").each(function() {
- var $i18n_input_element, cleared_input_value, cleared_placeholder_value, i18n_keys, input_value, placeholder_value;
+ var $i18n_input_element, cleared_input_value, cleared_placeholder_value, input_value, placeholder_value;
$i18n_input_element = $(this);
input_value = $i18n_input_element.val();
placeholder_value = $i18n_input_element.attr('placeholder');
- i18n_keys = extractI18nKeysFromText(input_value + placeholder_value);
- $i18n_input_element.enrichWithI18nData(i18n_keys);
+ $i18n_input_element.enrichWithI18nData();
cleared_input_value = input_value.replace(window.I18nViz.global_regex, "");
$(this).val(cleared_input_value);
if (placeholder_value) {
cleared_placeholder_value = placeholder_value.replace(window.I18nViz.global_regex, "");
return $(this).attr('placeholder', cleared_placeholder_value);
@@ -9916,6 +9916,6 @@
//
;
-;FI"required_assets_digest;F"%98b5d70f949d03ae2c4d7f67afc18928I"
_version;F"%45a9b34d2c65935f21d8f90f1e1b2836
+;FI"required_assets_digest;F"%173e6570c925b30c8afada986c94c1e0I"
_version;F"%45a9b34d2c65935f21d8f90f1e1b2836
\ No newline at end of file