spec/dummy/tmp/cache/assets/D11/2E0/sprockets%2F1879a9ee13aa637550fd9d122fdb5407 in api_taster-0.2.0 vs spec/dummy/tmp/cache/assets/D11/2E0/sprockets%2F1879a9ee13aa637550fd9d122fdb5407 in api_taster-0.2.1
- old
+ new
@@ -1,14 +1,16 @@
-o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1340196299.730068:@value"·{I"
+o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1340243247.760919:@value"o
{I"
class:EFI"ProcessedAsset; FI"logical_path; FI"api_taster/app.js; FI"
pathname; FI"M/Users/User/Projects/api_taster/app/assets/javascripts/api_taster/app.js; FI"content_type; FI"application/javascript; FI"
-mtime; FI"2012-06-20T22:44:52+10:00; FI"length; FiµI"digest; F"%f45e973f7eb31cfc93bfd51a8637dff7I"source; FI"µvar ApiTaster = {
+mtime; FI"2012-06-21T11:47:27+10:00; FI"length; Fim
+I"digest; F"%d5d887c25d127970d7c31900f6d38533I"source; FI"m
+var ApiTaster = {
formAction: '',
disableUrlParams: function() {
- $("#url-params input").prop("disabled", true);
+ $("fieldset[ref=url-params] input").prop("disabled", true);
},
enableUrlParams: function() {
- $("#url-params input").prop("disabled", false);
+ $("fieldset[ref=url-params] input").prop("disabled", false);
},
storeFormActionFor: function(form) {
ApiTaster.formAction = form.attr("action")
},
restoreFormActionFor: function(form) {
@@ -32,22 +34,42 @@
var replacedAction = ApiTaster.formAction.replace(regex, paramValue);
form.attr("action", replacedAction);
}
});
+ },
+ enableNavTabsFor: function(contentElement) {
+ var container = this;
+
+ $("ul.nav-tabs a", container).click(function(e) {
+ e.preventDefault();
+
+ $(this).parent().siblings().removeClass("active");
+ $(this).parent().addClass("active");
+
+ $(contentElement, container).hide();
+ $(contentElement + "[ref=" + $(this).attr("id") + "]", container).show();
+ });
+ },
+ displayOnlySelectedParamsFieldset: function() {
+ $("fieldset", this).hide();
+ $("fieldset[ref=" + $("ul.nav-tabs li.active a").attr("id") + "]", this).show();
}
});
jQuery(function($) {
$("a.show-api").click(function(e) {
e.preventDefault();
$("a.show-api").parent().removeClass("active");
$(this).parent().addClass("active");
- $("#show-api-div").load(this.href, function() {
+ $("#show-api-div .div-container").load(this.href, function() {
prettyPrint();
+
+ $("#show-api-div form").enableNavTabsFor("fieldset");
+ $("#show-api-div form").displayOnlySelectedParamsFieldset();
});
});
$("#show-api-div").on("click", "#submit-api", function() {
$(this).parents("form").submit(function() {
@@ -74,19 +96,11 @@
);
prettyPrint();
});
- $("#show-api-response-div ul.nav-tabs a").click(function(e) {
- e.preventDefault();
-
- $(this).parent().siblings().removeClass("active");
- $(this).parent().addClass("active");
-
- $("pre", "#show-api-response-div").hide();
- $("pre[ref=" + $(this).attr("id") + "]", "#show-api-response-div").show();
- });
+ $("#show-api-response-div").enableNavTabsFor("pre");
});
});
-; FI"dependency_digest; F"%f72464ee6da308977a56230cbf4a4d18I"required_paths; F[I"M/Users/User/Projects/api_taster/app/assets/javascripts/api_taster/app.js; FI"dependency_paths; F[{I" path; FI"M/Users/User/Projects/api_taster/app/assets/javascripts/api_taster/app.js; FI"
-mtime; FI"2012-06-20T22:44:52+10:00; FI"digest; F"%f45e973f7eb31cfc93bfd51a8637dff7I"
_version; F"%9f3b95dd7ea3030dc35985c0a8020862
+; FI"dependency_digest; F"%dae1cdacab6b0b11a6a56fdb0f18d33cI"required_paths; F[I"M/Users/User/Projects/api_taster/app/assets/javascripts/api_taster/app.js; FI"dependency_paths; F[{I" path; FI"M/Users/User/Projects/api_taster/app/assets/javascripts/api_taster/app.js; FI"
+mtime; FI"2012-06-21T11:47:27+10:00; FI"digest; F"%d5d887c25d127970d7c31900f6d38533I"
_version; F"%9f3b95dd7ea3030dc35985c0a8020862
\ No newline at end of file