Permalink
Browse files

Fix ask tweaks ajax submit for checkbox elements

  • Loading branch information...
jcutler committed Feb 14, 2012
1 parent 8e0d9df commit b4710ef36a4c9ebc189f2ec9342aae48aa129f78
View
@@ -1340,6 +1340,8 @@
settings.askDash = getSetting("MissingE_askTweaks_askDash",0);
settings.massDelete = getSetting("MissingE_askTweaks_massDelete",1);
settings.adjustDomain = MissingE.isTumblrURL(sender.tab.url, ["messages"]);
+ settings.photoReplies = getSetting("MissingE_postingTweaks_enabled",1) == 1 ?
+ getSetting("MissingE_postingTweaks_photoReplies",1) : 0;
break;
case "sidebarTweaks":
settings.retries = getSetting("MissingE_sidebarTweaks_retries",MissingE.defaultRetries);
View
@@ -1,6 +1,6 @@
{
"name": "Missing e",
- "version": "2.5.12",
+ "version": "2.5.13",
"description": "Useful features and customizations for Tumblr.",
"icons": { "16": "identity/missinge16.png",
"48": "identity/missinge48.png",
@@ -158,10 +158,17 @@ MissingE.packages.askTweaks = {
var params = {};
var name;
for (i=0; i<inputs.length; i++) {
- var inp = $(inputs[i]);
- name = inp.attr('name');
- if (name) {
- params[name] = inp.val();
+ var theInput = $(inputs[i]);
+ if (theInput.length === 0) { continue; }
+ name = theInput.attr("name");
+ if (!name) { continue; }
+ if (theInput.attr("type") !== "checkbox" ||
+ theInput.checked === true) {
+ params[name] = theInput.val();
+ }
+ else if (MissingE.packages.askTweaks.allowPhotoReplies &&
+ name === "allow_photo_replies") {
+ params[name] = theInput.val();
}
}
for (i=0; i<textareas.length; i++) {
@@ -332,6 +339,8 @@ MissingE.packages.askTweaks = {
run: function() {
var settings = this.settings;
var lang = $('html').attr('lang');
+
+ this.allowPhotoReplies = settings.photoReplies === 1;
/*
$('#posts li.fan_mail .controls_link.to_name').live('click', function() {
@@ -1634,6 +1634,8 @@ function handleMessage(message, myWorker) {
settings.askDash = getSetting("extensions.MissingE.askTweaks.askDash",0);
settings.massDelete = getSetting("extensions.MissingE.askTweaks.massDelete",1);
settings.adjustDomain = MissingE.isTumblrURL(myWorker.tab.url, ["messages"]);
+ settings.photoReplies = getSetting("extensions.MissingE.postingTweaks.enabled",1) == 1 ?
+ getSetting("extensions.MissingE.postingTweaks.photoReplies",1) : 0;
break;
case "sidebarTweaks":
settings.retries = getSetting("extensions.MissingE.sidebarTweaks.retries",MissingE.defaultRetries);
@@ -3,7 +3,7 @@
"license": "GPL 3.0",
"author": "Jeremy Cutler",
"url": "http://missing-e.com",
- "version": "2.5.12",
+ "version": "2.5.13",
"fullName": "Missing e",
"id": "jid0-0PGffAcVvhUBieFYkRVVc5w6lIU",
"description": "Useful features and customizations for Tumblr.",
@@ -13,9 +13,9 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
- <string>2.5.12</string>
+ <string>2.5.13</string>
<key>CFBundleVersion</key>
- <string>25012</string>
+ <string>25013</string>
<key>Chrome</key>
<dict>
<key>Database Quota</key>
@@ -52,7 +52,7 @@
</dict>
<dict>
<key>DefaultValue</key>
- <string>2.5.12</string>
+ <string>2.5.13</string>
<key>Key</key>
<string>MissingE_version</string>
<key>Title</key>
@@ -1485,6 +1485,8 @@
settings.askDash = getSetting("MissingE_askTweaks_askDash",0);
settings.massDelete = getSetting("MissingE_askTweaks_massDelete",1);
settings.adjustDomain = MissingE.isTumblrURL(request.target.url, ["messages"]);
+ settings.photoReplies = getSetting("MissingE_postingTweaks_enabled",1) == 1 ?
+ getSetting("MissingE_postingTweaks_photoReplies",1) : 0;
break;
case "sidebarTweaks":
settings.retries = getSetting("MissingE_sidebarTweaks_retries",MissingE.defaultRetries);
View
@@ -63,9 +63,9 @@
<div id="plus1description">'Missing e' adds functionality and tools for navigating, posting and socializing on the the popular Tumblr micro-blogging platform!</div>
<div id="logo"><div id="title">MISSING</div><img src="images/missinge.png" alt="Missing e" /><div><em><span class="ul">unofficial</span> browser extension for tumblr</em></div></div>
<div style="margin:20px 0;text-align: center"><a title="Nominate Missing e for a social media award in the Shorty Awards!" href="http://shortyawards.com/theMissinge?category=apps"><img src="http://cdn.shortyawards.com/images/badges/shorty_badge_300x36_me.png" border="0" width="300" height="36" alt="Nominate Missing e for a social media award in the Shorty Awards!"></a></div>
-<div version="2.5.12" id="versioncheck">
+<div version="2.5.13" id="versioncheck">
<div id="uptodate"><div>Missing e: Up To Date</div></div>
-<div id="notuptodate"><a href="faq#update">Update to v2.5.12 now</a></div>
+<div id="notuptodate"><a href="faq#update">Update to v2.5.13 now</a></div>
</div>
<div id="downloads">
<!--

0 comments on commit b4710ef

Please sign in to comment.