Skip to content

Commit

Permalink
Specific titles for option dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
failys committed Aug 10, 2016
1 parent d87cc2e commit 49e1312
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 4 deletions.
10 changes: 10 additions & 0 deletions cairis/web/dist/js/cairis/SVGhandler.js
Expand Up @@ -52,6 +52,7 @@ $( document ).ajaxComplete(function() {
url: serverIP + "/api/assets/name/"+ data.theName,
success: function() {
fillOptionMenu("fastTemplates/AssetOptions.html", "#optionsContent", dataArr,false,true,function(){
$("#optionsHeaderGear").text("Asset properties");
$.each(data.theEnvironmentProperties, function (idx, env) {
if (window.assetEnvironment == env.theEnvironmentName) {
var propValues = [];
Expand Down Expand Up @@ -104,6 +105,7 @@ $( document ).ajaxComplete(function() {
fillOptionMenu("fastTemplates/PersonaOptions.html", "#optionsContent", data,false,true,function(){
$.session.set("Persona", JSON.stringify(data));
$('#personasForm').loadJSON(data,null);
$("#optionsHeaderGear").text("Persona properties");
forceOpenOptions();
$.each(data.theEnvironmentProperties, function (idx, env) {
if (window.assetEnvironment == env.theEnvironmentName) {
Expand Down Expand Up @@ -152,6 +154,7 @@ $( document ).ajaxComplete(function() {
fillOptionMenu("fastTemplates/VulnerabilityOptions.html", "#optionsContent", data,false,true,function(){
$.session.set("Vulnerability", JSON.stringify(data));
$('#vulnerabilitiesForm').loadJSON(data,null);
$("#optionsHeaderGear").text("Vulnerability properties");
forceOpenOptions();
$.each(data.theEnvironmentProperties, function (idx, env) {
if (window.assetEnvironment == env.theEnvironmentName) {
Expand Down Expand Up @@ -205,6 +208,7 @@ $( document ).ajaxComplete(function() {
fillOptionMenu("fastTemplates/RoleOptions.html", "#optionsContent", data,false,true,function(){
$.session.set("Role", JSON.stringify(data));
$('#rolesForm').loadJSON(data,null);
$("#optionsHeaderGear").text("Role properties");
forceOpenOptions();
});
},
Expand Down Expand Up @@ -247,6 +251,7 @@ $( document ).ajaxComplete(function() {
fillOptionMenu("fastTemplates/ThreatOptions.html", "#optionsContent", data,false,true,function(){
$.session.set("Threat", JSON.stringify(data));
$('#threatsForm').loadJSON(data,null);
$("#optionsHeaderGear").text("Threat properties");
forceOpenOptions();
$.each(data.theEnvironmentProperties, function (idx, env) {
if (window.assetEnvironment == env.theEnvironmentName) {
Expand Down Expand Up @@ -311,6 +316,7 @@ $( document ).ajaxComplete(function() {
fillOptionMenu("fastTemplates/RequirementOptions.html", "#optionsContent", data,false,true,function(){
$.session.set("Requirement", JSON.stringify(data));
$('#requirementsForm').loadJSON(data,null);
$("#optionsHeaderGear").text("Requirement properties");
forceOpenOptions();
$('#originator').val(data.attrs.originator);
$('#rationale').val(data.attrs.rationale);
Expand Down Expand Up @@ -357,6 +363,7 @@ $( document ).ajaxComplete(function() {
fillOptionMenu("fastTemplates/GoalOptions.html", "#optionsContent", data,false,true,function(){
$.session.set("Goal", JSON.stringify(data));
$('#goalsForm').loadJSON(data,null);
$("#optionsHeaderGear").text("Goal properties");
forceOpenOptions();
$.each(data.theEnvironmentProperties, function (idx, env) {
if (window.assetEnvironment == env.theEnvironmentName) {
Expand Down Expand Up @@ -408,6 +415,7 @@ $( document ).ajaxComplete(function() {
fillOptionMenu("fastTemplates/AttackerOptions.html", "#optionsContent", data,false,true,function(){
$.session.set("Attacker", JSON.stringify(data));
$('#attackersForm').loadJSON(data,null);
$("#optionsHeaderGear").text("Attacker properties");
forceOpenOptions();
$.each(data.theEnvironmentProperties, function (idx, env) {
if (window.assetEnvironment == env.theEnvironmentName) {
Expand Down Expand Up @@ -467,6 +475,7 @@ $( document ).ajaxComplete(function() {
fillOptionMenu("fastTemplates/RiskOptions.html", "#optionsContent", data,false,true,function(){
$.session.set("Risk", JSON.stringify(data));
$('#risksForm').loadJSON(data,null);
$("#optionsHeaderGear").text("Risk properties");
forceOpenOptions();

var riskName = $("#theName").val();
Expand Down Expand Up @@ -551,6 +560,7 @@ $( document ).ajaxComplete(function() {
fillOptionMenu("fastTemplates/TaskOptions.html", "#optionsContent", data,false,true,function(){
$.session.set("Task", JSON.stringify(data));
$('#tasksForm').loadJSON(data,null);
$("#optionsHeaderGear").text("Task properties");
forceOpenOptions();
$.each(data.theEnvironmentProperties, function (idx, env) {
if (window.assetEnvironment == env.theEnvironmentName) {
Expand Down
2 changes: 2 additions & 0 deletions cairis/web/dist/js/cairis/assets.js
Expand Up @@ -40,6 +40,7 @@ $(document).on('click', "button.editAssetsButton",function(){
fillOptionMenu("fastTemplates/editAssetsOptions.html","#optionsContent",null,true,true, function(){
$.session.set("Asset", JSON.stringify(newdata));
$('#editAssetsOptionsform').loadJSON(newdata,null);
$("#optionsHeaderGear").text("Asset properties");
forceOpenOptions();
$.ajax({
type: "GET",
Expand Down Expand Up @@ -211,6 +212,7 @@ optionsContent.on('click', '.addEnvironmentPlus',function(){
$(this).dialog("close");
//Created a function, for readability
//$( "#comboboxDialogSelect").find("option:selected" ).text()
$("#optionsHeaderGear").text("Asset properties");
forceOpenOptions();
var chosenText = $( "#comboboxDialogSelect").find("option:selected" ).text();
$("#theEnvironmentDictionary").find("tbody").append("<tr><td class='deleteAssetEnv'><i class='fa fa-minus'></i></td><td class='clickable-environments'>" + chosenText +"</td></tr>");
Expand Down
2 changes: 2 additions & 0 deletions cairis/web/dist/js/cairis/attackers.js
Expand Up @@ -87,6 +87,7 @@ $(document).on('click', ".editAttackerButton", function () {
success: function (data) {
// console.log(JSON.stringify(rawData));
fillOptionMenu("fastTemplates/editAttackerOptions.html", "#optionsContent", null, true, true, function () {
$("#optionsHeaderGear").text("Attacker properties");
forceOpenOptions();
$("#addAttackerPropertyDiv").hide();
$.session.set("Attacker", JSON.stringify(data));
Expand Down Expand Up @@ -340,6 +341,7 @@ $(document).on("click", "#addNewAttacker", function () {
$("#editAttackerOptionsForm").addClass("new");
$("#Properties").hide();
$.session.set("Attacker", JSON.stringify(jQuery.extend(true, {},attackerDefault )));
$("#optionsHeaderGear").text("Attacker properties");
forceOpenOptions();
});
});
Expand Down
4 changes: 3 additions & 1 deletion cairis/web/dist/js/cairis/goals.js
Expand Up @@ -15,7 +15,7 @@
specific language governing permissions and limitations
under the License.
Authors: Raf Vandelaer */
Authors: Raf Vandelaer, Shamal Faily */

$("#EditGoals").click(function(){
createEditGoalsTable()
Expand Down Expand Up @@ -315,6 +315,7 @@ optionsContent.on('change', ".goalAutoUpdater" ,function() {
$(document).on('click', '#addNewGoal', function () {
fillGoalOptionMenu(null, function () {
$("#editGoalOptionsForm").addClass('new');
$("#optionsHeaderGear").text("Goal properties");
forceOpenOptions();
$("#goalsProperties").hide();
});
Expand Down Expand Up @@ -478,6 +479,7 @@ function fillGoalOptionMenu(data,callback){
$.each(data.theEnvironmentProperties, function (index, prop) {
appendGoalEnvironment(prop.theEnvironmentName);
});
$("#optionsHeaderGear").text("Goal properties");
forceOpenOptions();
$("#theGoalEnvironments").find(".goalEnvProperties:first").trigger('click');

Expand Down
2 changes: 2 additions & 0 deletions cairis/web/dist/js/cairis/personas.js
Expand Up @@ -85,6 +85,7 @@ $(document).on('click', ".editPersonaButton", function () {
success: function (data) {
// console.log(JSON.stringify(rawData));
fillOptionMenu("fastTemplates/editPersonasOptions.html", "#optionsContent", null, true, true, function () {
$("#optionsHeaderGear").text("Persona properties");
forceOpenOptions();
$.session.set("Persona", JSON.stringify(data));
$('#editPersonasOptionsForm').loadJSON(data, null);
Expand Down Expand Up @@ -271,6 +272,7 @@ $(document).on("click", "#addNewPersona", function () {
$("#editPersonasOptionsForm").addClass("new");
$("#Properties").hide();
$.session.set("Persona", JSON.stringify(jQuery.extend(true, {},personaDefault )));
$("#optionsHeaderGear").text("Persona properties");
forceOpenOptions();

getPersonaTypes(function createTypes(types) {
Expand Down
5 changes: 2 additions & 3 deletions cairis/web/dist/js/cairis/responses.js
Expand Up @@ -15,7 +15,7 @@
specific language governing permissions and limitations
under the License.
Authors: Raf Vandelaer */
Authors: Raf Vandelaer, Shamal Faily */

$("#responsesTable").click(function () {
createResponsesTable();
Expand All @@ -34,9 +34,8 @@ $(document).on('click', ".editResponseButton", function () {
success: function (data) {
// console.log(JSON.stringify(rawData));
fillOptionMenu("fastTemplates/editResponseOptions.html", "#optionsContent", null, true, true, function () {

$("#optionsHeaderGear").text("Response properties");
var tags = data.theTags;

$("#theResponseName").val(data.theName);
$.session.set("response", JSON.stringify(data));
var text = "";
Expand Down
1 change: 1 addition & 0 deletions cairis/web/dist/js/cairis/risks.js
Expand Up @@ -119,6 +119,7 @@ $(document).on('click', '.editRiskButton', function () {
success: function (mainData) {
// console.log(JSON.stringify(rawData));
fillOptionMenu("fastTemplates/editRiskOptions.html", "#optionsContent", null, true, true, function () {
$("#optionsHeaderGear").text("Risk properties");
forceOpenOptions();
var threatSelect = $("#theThreatNames");
var vulnSelect = $("#theVulnerabilityNames");
Expand Down
2 changes: 2 additions & 0 deletions cairis/web/dist/js/cairis/threats.js
Expand Up @@ -92,6 +92,7 @@ $(document).on('click', ".editThreatsButton", function () {
success: function (data) {
// console.log(JSON.stringify(rawData));
fillOptionMenu("fastTemplates/editThreatOptions.html", "#optionsContent", null, true, true, function () {
$("#optionsHeaderGear").text("Threat properties");
forceOpenOptions();
$("#addPropertyDiv").hide();
getThreatTypes(function createTypes(types) {
Expand Down Expand Up @@ -144,6 +145,7 @@ $(document).on("click", "#addNewThreat", function () {
});

$.session.set("theThreat", JSON.stringify(jQuery.extend(true, {},threatDefault )));
$("#optionsHeaderGear").text("Threat properties");
forceOpenOptions();
//$("reqTable").find("tbody").append('<tr><td><button class="editThreatsButton" value="">Edit</button> <button class="deleteThreatsButton" value="Replay attack">Delete</button></td><td name="theName"></td><td name="theType"></td></tr>')
});
Expand Down

0 comments on commit 49e1312

Please sign in to comment.