From 123962d4320bfe827e90aa031aa9964946cbc238 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Fri, 3 Jan 2020 01:12:39 -0500 Subject: General clean-ups for the new workarounds extension * data/extensions/gnuzilla-ext-workarounds@gnu.org/jquery-3.4.1.min.js: Remove, since it's a duplicate and not needed. * data/extensions/gnuzilla-ext-workarounds@gnu.org/manifest.json: Re-indent, remove "jquery-3.4.1.min.js" from content_scripts js files: as far as I see, it's not used in any of the workaround files, and is only used in html/domestic.html; but html/ already has a copy of it. So there's no point in keeping a second copy around and injecting it to the matched urls along with the other workaround scripts. * data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.html: Update the extension name here to match the manifest. * data/extensions/gnuzilla-ext-workarounds@gnu.org/README~, data/extensions/gnuzilla-ext-workarounds@gnu.org/background.js~, data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.html~, data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.js~, data/extensions/gnuzilla-ext-workarounds@gnu.org/html/usps_postage.js~, data/extensions/gnuzilla-ext-workarounds@gnu.org/jquery-3.4.1.min.js, data/extensions/gnuzilla-ext-workarounds@gnu.org/manifest.json~, data/extensions/gnuzilla-ext-workarounds@gnu.org/workaround/googledocs_main.js~, data/extensions/gnuzilla-ext-workarounds@gnu.org/workaround/goteo_main.js~, data/extensions/gnuzilla-ext-workarounds@gnu.org/workaround/mcdonalds_wifi.js~, data/extensions/gnuzilla-ext-workarounds@gnu.org/workaround/paygov_main.js~, data/extensions/gnuzilla-ext-workarounds@gnu.org/workaround/rsf_main.js~, data/extensions/gnuzilla-ext-workarounds@gnu.org/workaround/sumofus_main.js~: Remove auto-created backup files. --- .../html/domestic.html | 4 +- .../html/domestic.html~ | 807 --------------------- .../html/domestic.js~ | 375 ---------- .../html/usps_postage.js~ | 376 ---------- 4 files changed, 2 insertions(+), 1560 deletions(-) delete mode 100644 data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.html~ delete mode 100644 data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.js~ delete mode 100644 data/extensions/gnuzilla-ext-workarounds@gnu.org/html/usps_postage.js~ (limited to 'data/extensions/gnuzilla-ext-workarounds@gnu.org/html') diff --git a/data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.html b/data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.html index f8dec41..547f0fb 100644 --- a/data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.html +++ b/data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.html @@ -42,8 +42,8 @@

What is this?

The postage calculator on the USPS website is impossible to use without running non-free Javascript. This is a work-around.

-

Packaged as part of the "Non-free JS Work-around scripts" add-on.

- +

Packaged as part of the "Workarounds for nonfree JS" add-on.

+

Domestic rates

To get a user ID, sign up here and it will be emailed to you.

diff --git a/data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.html~ b/data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.html~ deleted file mode 100644 index 358a5e8..0000000 --- a/data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.html~ +++ /dev/null @@ -1,807 +0,0 @@ - - - - - - - - - - - - - - - - - - -

Postage Calculator :D

-

This is a utility for calculating United States Postal Service domestic postage rates.

-

What is this?

-

The postage calculator on the USPS website is impossible to use without running non-free Javascript. This is a work-around.

- -

Packaged as part of the "Non-free JS Work-around scripts" add-on.

- -

Domestic rates

- -

To get a user ID, sign up here and it will be emailed to you.

- - User ID:
- Service: -
- first class mail type: -
- - - ZipOrigination:
- ZipDestination:
- Pounds:
- - - - - Container: -
- Note: "Cubic Soft Pack" and "Cubic Parcels" are only valid containers for "Priority Mail Cubic" -
- Width:
- Length:
- Height:
- Girth:
- Value:
- Amount to collect:
- Special services:
-
- (hold control to select multiple special services if neccessary.)
- Content Type: -
- Content description: -
- Is machinable: -
- Is ground only: -
-
-
- Calculate postage -
- -

International rates

-
- User ID:
- Pounds:
- Value of contents:
- Machinable: -
- - Destination is a post office box:
- - Contains a gift:
- Origin Zip:
- - Width:
- Length:
- Height:
- Girth:
- - Destination country: -
- Mail type: -
- Commercial: -
- Commercial Plus: -
- Size: -
- Container: -
- -
-
- Calculate postage -
- - - -
-
- -

-
-
-
-
-
- diff --git a/data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.js~ b/data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.js~ deleted file mode 100644 index 693a831..0000000 --- a/data/extensions/gnuzilla-ext-workarounds@gnu.org/html/domestic.js~ +++ /dev/null @@ -1,375 +0,0 @@ - -/* - Copyright (C) 2019 Nathan Nichols - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - - -console.log("main.js"); - - -function is_in(a, arr){ - for(var i = 0; i < arr.length; i++){ - if(a == arr[i]){ - return true; - } - } - - return false; - -} -function disable(name){ - off = document.getElementsByName(name); - for(var i = 0; i < off.length; i++){ - off[i].style = "display:none;" - } -} -function enable(name){ - on = document.getElementsByName(name); - for(var i = 0; i < on.length; i++){ - on[i].style = "" - } -} - - - -function tag(name){ - return "<"+name+">"; -} -function etag(name){ - return ""; - -} -function surround(name,content){ - return tag(name) + content + etag(name); -} -function visible(name){ - if(document.getElementsByName(name)[0].style.display == "none"){ - return false; - }else{ - return true; - } -} - -function gen_package(data){ - var res = ''; - res = res + surround("Service", data["Service"]); - - if(visible("FirstClassMailType")){ - res=res+surround("FirstClassMailType", data["FirstClassMailType"]); - } - res = res + surround("ZipOrigination", data["ZipOrigination"]); - res = res + surround("ZipDestination", data["ZipDestination"]); - res = res + surround("Pounds", data["Pounds"]); - res = res + surround("Ounces", "0"); - - res = res + surround("Container", data["Container"]); - res = res + surround("Machinable", data["Machinable"]); - - res = res + etag("Package"); - - return res; -} - -function build_xml_domestic(data){ - var res = ''; - res = res + "2"; - res = res + gen_package(data); - res = res + etag("RateV4Request"); - return res; -} - -function check_domestic(req){ - console.log("Form changed."); - - serv = req["Service"]; - // "Machinable" required for: - mach=["FIRST CLASS","LETTER","FLAT","RETAIL GROUND","ALL","ONLINE"]; - if(is_in(serv, mach) == true){ - enable("Machinable"); - }else{ - disable("Machinable") - } - - if(serv == "Retail Ground"){ - enable("GroundOnly"); - }else{ - disable("GroundOnly"); - } - - fcmt=["FIRST CLASS","FIRST CLASS COMMERCIAL","FIRST CLASS HFP COMMERCIAL"]; - if(is_in(serv, fcmt)){ - enable("FirstClassMailType"); - }else{ - disable("FirstClassMailType"); - } - - if(resp["ContentType"] == "LIVES"){ - enable("ContentDescription"); - }else{ - disable("ContentDescription"); - } -}; -function check_intl(req){ - console.log("Form changed."); - -}; - - -function byname(name){ - return document.getElementsByName(name)[0].value; -} - -// Return an array of the selected opion values -function select_values(name) { - var opts = document.getElementsByName(name)[0].options - var res = []; - for(var i = 0; i < opts.length; i++){ - if(opts[i].selected){ - res.push(opts[i].value); - } - } - return res; -} - -// reads the form and returns a dictionary -function read_domestic(){ - resp = {}; - resp["USERID"] = byname("USERID"); - resp["Service"] = byname("Service"); - resp["FirstClassMailType"] = byname("FirstClassMailType"); - resp["Machinable"] = byname("Machinable"); - resp["ZipOrigination"] = byname("ZipOrigination"); - resp["ZipDestination"] = byname("ZipDestination"); - resp["Pounds"] = byname("Pounds"); - resp["Container"] = byname("Container"); - //resp["Size"] = byname("Size"); - resp["Width"] = byname("Width"); - resp["Length"] = byname("Length"); - resp["Height"] = byname("Height"); - resp["Girth"] = byname("Girth"); - resp["Value"] = byname("Value"); - resp["AmountToCollect"] = byname("AmountToCollect"); - resp["SpecialServices"] = select_values("SpecialService"); - resp["ContentType"] = byname("ContentType"); - - if(resp["ContentType"] == "DEFAULT"){ - resp["ContentType"] = ""; - } - return resp; -} - - -// reads the form and returns a dictionary -function read_intl(){ - resp = {}; - resp["USERID"] = byname("USERID2"); - resp["Machinable"] = byname("Machinable2"); - resp["MailType"] = byname("MailType"); - //resp["POBoxFlag"] = byname("POBoxFlag"); - //resp["GiftFlag"] = byname("GiftFlag"); - resp["ValueOfContents"] = byname("ValueOfContents"); - resp["Country"] = byname("Country"); - resp["Pounds"] = byname("Pounds2"); - resp["GiftFlag"] = byname("GiftFlag"); - resp["POBoxFlag"] = byname("POBoxFlag"); - resp["OriginZip"] = byname("OriginZip"); - resp["Width"] = byname("Width2"); - resp["Length"] = byname("Length2"); - resp["Height"] = byname("Height2"); - resp["Girth"] = byname("Girth2"); - resp["Container"] = byname("Container2"); - resp["CommercialFlag"] = byname("CommercialFlag"); - resp["CommercialPlusFlag"] = byname("CommercialPlusFlag"); - resp["Size"] = byname("Size2"); - - - return resp; -} - -function decode_html(input){ - var e = document.createElement('div'); - e.innerHTML = input; - return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue; -} - - -function make_row(name, avail, price){ - res = ""; - res = res+""+name+""; - res = res+""+avail+""; - res = res+""+price+""; - res = res+"\n"; - return res; - -} - -function parse_response(resp){ - console.log(resp.documentElement.outerHTML); - xml_doc = $.parseXML(resp.documentElement.outerHTML); - $xml = $(xml_doc); - errs = $xml.find("Error"); - console.log(errs); - - var res = ""; - - if(errs.length > 0){ - for(var i = 0; i < errs.length; i++){ - res = res+i.toString()+": "+$(errs[i]).find("Description")[0].innerHTML; - res = res +"
"; - } - $("#errors").html(res) - $("#mainrate").html(""); - $("#results").html(""); - - return ""; - } - - $pack = $($xml.find("Package")[0]); - - // Get Parse the main result - mailserv = decode_html($pack.find("MailService")[0].innerHTML); - rate = $pack.find("Rate")[0].innerHTML; - - var res = ""; - res = "Mail Service:"+mailserv+"
"; - res = res+"Rate:"+rate+"
\n" - - // Generate a table of the services available - servs = $pack.find("SpecialService"); - table = make_row(" Service name ", "Available", "Price"); - for(var i = 0; i < servs.length; i++){ - serv = $(servs[i]); - name = decode_html(serv.find("ServiceName")[0].innerHTML); - avail = serv.find("Available")[0].innerHTML; - price = serv.find("Price")[0].innerHTML; - table = table + make_row(name,avail,price); - } - - table = ""+table+""; - $("#mainrate").html(res); - $("#results").html(table); - return table; -} - - -function make_api_call(url){ - $.ajax({ - url: url, - cache: false, - type: 'post', - }).done(function(d){ - console.log("Success"); - var res = parse_response(d); - //$("#results").html(res); - }).always(function(){ - - }).fail(function(d){ - console.log("Failed"); - console.log(d); - }); -} - -function gen_package_intl(data){ - var res = ""; - res = res + ''; - res = res + surround("Pounds",data["Pounds"]) - res = res + surround("Ounces","0"); - res = res + surround("Machinable",data["Machinable"]); - res = res + surround("MailType",data["MailType"]); - /* - res = res + "" - res = res + surround("POBoxFlag",data["POBoxFlag"]); - res = res + surround("GiftFlag",data["GiftFlag"]); - res = res + "" - */ - res = res + surround("ValueOfContents", data["ValueOfContents"]); - res = res + surround("Country",data["Country"]); - //res = res + surround("Size",data["Size"]); - //res = res + surround("Container",data["Container"]); - //res = res + surround("Width",data["Width"]); - //res = res + surround("Length",data["Length"]); - //res = res + surround("Height",data["Height"]); - //res = res + surround("Girth",data["Girth"]); - res = res + surround("OriginZip",data["OriginZip"]); - - res = res + ''; - - return res; -} - - -function build_xml_intl(data){ - res = ""; - res = res + ''; - res = res + gen_package_intl(data); - - res = res + ""; - console.log(res); - return res; -}; - - - -window.addEventListener('load', (event) => { - - $("#button_domestic").bind("click",function(){ - console.log("Making request"); - r = read_domestic(); - check_domestic(r); - url = "http://production.shippingapis.com/ShippingAPI.dll?API=RateV4&XML="; - url = url + build_xml_domestic(r); - console.log(url); - make_api_call(url); - }); - - console.log("Window loaded.") - disable("Machinable"); - disable("FirstClassMailType"); - disable("ContentDescription"); - disable("GroundOnly"); - - document.getElementById("button_intl").style = "display:none;"; - document.forms[1].style = "display:none;"; - - document.forms[0].addEventListener("change", function(){ - r = read_domestic(); - check_domestic(r); - url = "http://production.shippingapis.com/ShippingAPI.dll?API=RateV4&XML="; - url = url + build_xml_domestic(r); - console.log(url); - }); - - $("#button_intl").bind("click",function(){ - console.log("Making request"); - r = read_intl(); - check_intl(r); - url = "http://production.shippingapis.com/ShippingAPI.dll?API=IntlRateV2&XML="; - url = url + build_xml_intl(r); - console.log(url); - make_api_call(url); - }); - - document.forms[1].addEventListener("change", function(){ - r = read_intl(); - url = "http://production.shippingapis.com/ShippingAPI.dll?API=IntlRateV2&XML="; - url = url + build_xml_intl(r); - console.log(url); - }); - -}); - - - diff --git a/data/extensions/gnuzilla-ext-workarounds@gnu.org/html/usps_postage.js~ b/data/extensions/gnuzilla-ext-workarounds@gnu.org/html/usps_postage.js~ deleted file mode 100644 index bf42d49..0000000 --- a/data/extensions/gnuzilla-ext-workarounds@gnu.org/html/usps_postage.js~ +++ /dev/null @@ -1,376 +0,0 @@ -/* - - Copyright (C) 2017-2019 Nathan Nichols - Copyright (C) 2019 Free Software Foundation - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -*/ - -console.log("usps_postage.js"); - - -function is_in(a, arr){ - for(var i = 0; i < arr.length; i++){ - if(a == arr[i]){ - return true; - } - } - - return false; - -} -function disable(name){ - off = document.getElementsByName(name); - for(var i = 0; i < off.length; i++){ - off[i].style = "display:none;" - } -} -function enable(name){ - on = document.getElementsByName(name); - for(var i = 0; i < on.length; i++){ - on[i].style = "" - } -} - - - -function tag(name){ - return "<"+name+">"; -} -function etag(name){ - return ""; - -} -function surround(name,content){ - return tag(name) + content + etag(name); -} -function visible(name){ - if(document.getElementsByName(name)[0].style.display == "none"){ - return false; - }else{ - return true; - } -} - -function gen_package(data){ - var res = ''; - res = res + surround("Service", data["Service"]); - - if(visible("FirstClassMailType")){ - res=res+surround("FirstClassMailType", data["FirstClassMailType"]); - } - res = res + surround("ZipOrigination", data["ZipOrigination"]); - res = res + surround("ZipDestination", data["ZipDestination"]); - res = res + surround("Pounds", data["Pounds"]); - res = res + surround("Ounces", "0"); - - res = res + surround("Container", data["Container"]); - res = res + surround("Machinable", data["Machinable"]); - - res = res + etag("Package"); - - return res; -} - -function build_xml_domestic(data){ - var res = ''; - res = res + "2"; - res = res + gen_package(data); - res = res + etag("RateV4Request"); - return res; -} - -function check_domestic(req){ - console.log("Form changed."); - - serv = req["Service"]; - // "Machinable" required for: - mach=["FIRST CLASS","LETTER","FLAT","RETAIL GROUND","ALL","ONLINE"]; - if(is_in(serv, mach) == true){ - enable("Machinable"); - }else{ - disable("Machinable") - } - - if(serv == "Retail Ground"){ - enable("GroundOnly"); - }else{ - disable("GroundOnly"); - } - - fcmt=["FIRST CLASS","FIRST CLASS COMMERCIAL","FIRST CLASS HFP COMMERCIAL"]; - if(is_in(serv, fcmt)){ - enable("FirstClassMailType"); - }else{ - disable("FirstClassMailType"); - } - - if(resp["ContentType"] == "LIVES"){ - enable("ContentDescription"); - }else{ - disable("ContentDescription"); - } -}; -function check_intl(req){ - console.log("Form changed."); - -}; - - -function byname(name){ - return document.getElementsByName(name)[0].value; -} - -// Return an array of the selected opion values -function select_values(name) { - var opts = document.getElementsByName(name)[0].options - var res = []; - for(var i = 0; i < opts.length; i++){ - if(opts[i].selected){ - res.push(opts[i].value); - } - } - return res; -} - -// reads the form and returns a dictionary -function read_domestic(){ - resp = {}; - resp["USERID"] = byname("USERID"); - resp["Service"] = byname("Service"); - resp["FirstClassMailType"] = byname("FirstClassMailType"); - resp["Machinable"] = byname("Machinable"); - resp["ZipOrigination"] = byname("ZipOrigination"); - resp["ZipDestination"] = byname("ZipDestination"); - resp["Pounds"] = byname("Pounds"); - resp["Container"] = byname("Container"); - //resp["Size"] = byname("Size"); - resp["Width"] = byname("Width"); - resp["Length"] = byname("Length"); - resp["Height"] = byname("Height"); - resp["Girth"] = byname("Girth"); - resp["Value"] = byname("Value"); - resp["AmountToCollect"] = byname("AmountToCollect"); - resp["SpecialServices"] = select_values("SpecialService"); - resp["ContentType"] = byname("ContentType"); - - if(resp["ContentType"] == "DEFAULT"){ - resp["ContentType"] = ""; - } - return resp; -} - - -// reads the form and returns a dictionary -function read_intl(){ - resp = {}; - resp["USERID"] = byname("USERID2"); - resp["Machinable"] = byname("Machinable2"); - resp["MailType"] = byname("MailType"); - //resp["POBoxFlag"] = byname("POBoxFlag"); - //resp["GiftFlag"] = byname("GiftFlag"); - resp["ValueOfContents"] = byname("ValueOfContents"); - resp["Country"] = byname("Country"); - resp["Pounds"] = byname("Pounds2"); - resp["GiftFlag"] = byname("GiftFlag"); - resp["POBoxFlag"] = byname("POBoxFlag"); - resp["OriginZip"] = byname("OriginZip"); - resp["Width"] = byname("Width2"); - resp["Length"] = byname("Length2"); - resp["Height"] = byname("Height2"); - resp["Girth"] = byname("Girth2"); - resp["Container"] = byname("Container2"); - resp["CommercialFlag"] = byname("CommercialFlag"); - resp["CommercialPlusFlag"] = byname("CommercialPlusFlag"); - resp["Size"] = byname("Size2"); - - - return resp; -} - -function decode_html(input){ - var e = document.createElement('div'); - e.innerHTML = input; - return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue; -} - - -function make_row(name, avail, price){ - res = ""; - res = res+""+name+""; - res = res+""+avail+""; - res = res+""+price+""; - res = res+"\n"; - return res; - -} - -function parse_response(resp){ - console.log(resp.documentElement.outerHTML); - xml_doc = $.parseXML(resp.documentElement.outerHTML); - $xml = $(xml_doc); - errs = $xml.find("Error"); - console.log(errs); - - var res = ""; - - if(errs.length > 0){ - for(var i = 0; i < errs.length; i++){ - res = res+i.toString()+": "+$(errs[i]).find("Description")[0].innerHTML; - res = res +"
"; - } - $("#errors").html(res) - $("#mainrate").html(""); - $("#results").html(""); - - return ""; - } - - $pack = $($xml.find("Package")[0]); - - // Get Parse the main result - mailserv = decode_html($pack.find("MailService")[0].innerHTML); - rate = $pack.find("Rate")[0].innerHTML; - - var res = ""; - res = "Mail Service:"+mailserv+"
"; - res = res+"Rate:"+rate+"
\n" - - // Generate a table of the services available - servs = $pack.find("SpecialService"); - table = make_row(" Service name ", "Available", "Price"); - for(var i = 0; i < servs.length; i++){ - serv = $(servs[i]); - name = decode_html(serv.find("ServiceName")[0].innerHTML); - avail = serv.find("Available")[0].innerHTML; - price = serv.find("Price")[0].innerHTML; - table = table + make_row(name,avail,price); - } - - table = ""+table+""; - $("#mainrate").html(res); - $("#results").html(table); - return table; -} - - -function make_api_call(url){ - $.ajax({ - url: url, - cache: false, - type: 'post', - }).done(function(d){ - console.log("Success"); - var res = parse_response(d); - //$("#results").html(res); - }).always(function(){ - - }).fail(function(d){ - console.log("Failed"); - console.log(d); - }); -} - -function gen_package_intl(data){ - var res = ""; - res = res + ''; - res = res + surround("Pounds",data["Pounds"]) - res = res + surround("Ounces","0"); - res = res + surround("Machinable",data["Machinable"]); - res = res + surround("MailType",data["MailType"]); - /* - res = res + "" - res = res + surround("POBoxFlag",data["POBoxFlag"]); - res = res + surround("GiftFlag",data["GiftFlag"]); - res = res + "" - */ - res = res + surround("ValueOfContents", data["ValueOfContents"]); - res = res + surround("Country",data["Country"]); - //res = res + surround("Size",data["Size"]); - //res = res + surround("Container",data["Container"]); - //res = res + surround("Width",data["Width"]); - //res = res + surround("Length",data["Length"]); - //res = res + surround("Height",data["Height"]); - //res = res + surround("Girth",data["Girth"]); - res = res + surround("OriginZip",data["OriginZip"]); - - res = res + ''; - - return res; -} - - -function build_xml_intl(data){ - res = ""; - res = res + ''; - res = res + gen_package_intl(data); - - res = res + ""; - console.log(res); - return res; -}; - - - -window.addEventListener('load', (event) => { - - $("#button_domestic").bind("click",function(){ - console.log("Making request"); - r = read_domestic(); - check_domestic(r); - url = "http://production.shippingapis.com/ShippingAPI.dll?API=RateV4&XML="; - url = url + build_xml_domestic(r); - console.log(url); - make_api_call(url); - }); - - console.log("Window loaded.") - disable("Machinable"); - disable("FirstClassMailType"); - disable("ContentDescription"); - disable("GroundOnly"); - - document.getElementById("button_intl").style = "display:none;"; - document.forms[1].style = "display:none;"; - - document.forms[0].addEventListener("change", function(){ - r = read_domestic(); - check_domestic(r); - url = "http://production.shippingapis.com/ShippingAPI.dll?API=RateV4&XML="; - url = url + build_xml_domestic(r); - console.log(url); - }); - - $("#button_intl").bind("click",function(){ - console.log("Making request"); - r = read_intl(); - check_intl(r); - url = "http://production.shippingapis.com/ShippingAPI.dll?API=IntlRateV2&XML="; - url = url + build_xml_intl(r); - console.log(url); - make_api_call(url); - }); - - document.forms[1].addEventListener("change", function(){ - r = read_intl(); - url = "http://production.shippingapis.com/ShippingAPI.dll?API=IntlRateV2&XML="; - url = url + build_xml_intl(r); - console.log(url); - }); - -}); - - - -- cgit v1.2.3