Skip to content

Commit

Permalink
Merge pull request #220 from warriorframework/WAR-1329
Browse files Browse the repository at this point in the history
WAR-1329 password protection on UI
  • Loading branch information
keenan35i committed Sep 28, 2017
2 parents e6a58bf + 455a215 commit f488101
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions katana/native/wdf_edit/static/wdf_edit/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ var wdf = {
});
},

search_for_password: function(){
$inputs = katana.$activeTab.find("#content, #subcontent");
$inputs.each(function(ind, row) {
$row = $(row);
$row_key = $row.find("[name$='-key']");
$row_value = $row.find("[name$='-value']");
if (typeof $row_key.attr("value") !== "undefined" && $row_key.attr("value").toLowerCase() == "password" ) {
$row_value.prop("type", "password");
}
});
},

hide_template: function(){
/*
Hide the templates
Expand Down Expand Up @@ -95,13 +107,20 @@ var wdf = {
},

validateKey: function(){
$(this).prop("value", $(this).val());
$(this).css("background", "#f9f9f9");
if ($(this).prop("value").indexOf(" ") != -1) {
$ele = $(this);
$ele.prop("value", $ele.val());
$ele.css("background", "#f9f9f9");
if ($ele.prop("value").indexOf(" ") != -1) {
alert("Data key cannot contain whitespace");
$(this).focus()
$ele.focus()
// katana.quickAnimation($(this), "wdf-highlight", 1000);
$(this).css("background", "#ecff91");
$ele.css("background", "#ecff91");
}

if ($ele.val().toLowerCase() == "password") {
$ele.next().prop("type", "password");
} else {
$ele.next().removeAttr("type");
}
},

Expand Down Expand Up @@ -424,6 +443,7 @@ var wdf = {
katana.$activeTab.find("#main_info").replaceWith(data);
wdf.hide_template();
wdf.search_and_hide();
wdf.search_for_password();
// console.log("loaded");
}
});
Expand Down

0 comments on commit f488101

Please sign in to comment.