diff --git a/background.js b/background.js index d1e61a2bcea0da1ff558c1a7e3a5cc712f4d2859..b424d12ed4dce7f86793caa780c043f50d4e0482 100644 --- a/background.js +++ b/background.js @@ -4,7 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * @author didierfred@gmail.com - * @version 0.2 + * @version 0.3 */ @@ -49,7 +49,7 @@ else { console.log("Load default config"); var headers = []; - headers.push({action:"add",header_name:"test_header_name",header_value:"test_header_value",comment:"test",apply_on:"req",status:"on"}); + headers.push({action:"add",header_name:"test-header-name",header_value:"test-header-value",comment:"test",apply_on:"req",status:"on"}); config = {format_version:"1.1",target_page:"https://httpbin.org/*",headers:headers}; // save configuration localStorage.setItem("config",JSON.stringify(config)); diff --git a/manifest.json b/manifest.json index 000b24f039e9e5e3ce80787919bad341ec8bf67c..535c03cfaae45f68851028387e2d823b1f647db4 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "description": "Simple Modify headers ", "manifest_version": 2, "name": "simple-modify-headers", - "version": "1.3", + "version": "1.4", "homepage_url": "https://github.com/didierfred/SimpleModifyHeaders", "icons": { "48": "icons/modify-48.png" diff --git a/popup/config.js b/popup/config.js index 35edc4c83902719d3ff676caebfaa35ae24c9f3e..2bf490f4389e588ac14bbfdc82816b9e25774c3c 100644 --- a/popup/config.js +++ b/popup/config.js @@ -5,7 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * @author didierfred@gmail.com - * @version 0.2 + * @version 0.3 */ @@ -44,8 +44,6 @@ html = html + "<td> <a href=\"#\" id=\"up_button" + line_number + "\" class=\"b html = html + "<td> <a href=\"#\" id=\"down_button" + line_number + "\" class=\"btn btn-default btn-sm\"> <span class=\"glyphicon glyphicon-arrow-down\"></span></a></td>"; html = html + "<td> <a href=\"#\" id=\"delete_button" + line_number + "\" class=\"btn btn-primary btn-sm\"> <span class=\"glyphicon glyphicon-trash\"></span> Delete </a></td>"; -console.log("html="+ html); - var newTR = document.createElement("tr"); newTR.id="line" + line_number; newTR.innerHTML = html; @@ -265,24 +263,19 @@ function delete_line(line_number_to_delete) } } var Node_to_delete = document.getElementById("line"+(line_number-1)); - Node_to_delete.parentNode.removeChild(Node_to_delete); + Node_to_delete.parentNode.removeChild(Node_to_delete); line_number--; } /** -* Move up a configuration line on the UI +* Invert two configuration lines on the UI **/ -function move_line_up(line_number_to_move) - { - if (line_number_to_move != 1) invert_line(line_number_to_move-1,line_number) - - } function invert_line(line1, line2) { - // if line does not exist + // if a line does not exist , do nothing if ((line1==0)||(line2==0)||(line1>=line_number)||(line2>=line_number)) return; // Save data for line 1 @@ -300,6 +293,7 @@ function invert_line(line1, line2) document.getElementById("comment"+line1).value = document.getElementById("comment"+line2).value; document.getElementById("select_status"+line1).value = document.getElementById("select_status"+line2).value; document.getElementById("apply_on"+line1).value = document.getElementById("apply_on"+line2).value; + // Copy line 1 to line 2 document.getElementById("select_action"+line2).value = select_action1; document.getElementById("header_name"+line2).value = header_name1; diff --git a/popup/menu.js b/popup/menu.js index 8af4f76a5ea6dcd46e985df3270c0753953b4fd7..91a5ce573d6a95d295629893c85212e703cd315d 100644 --- a/popup/menu.js +++ b/popup/menu.js @@ -5,7 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * @author didierfred@gmail.com - * @version 0.1 + * @version 0.2 */