From edf9042ed5032989dfb257f1c9c95d6dfd4962b7 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 15 May 2015 17:12:19 -0700 Subject: [PATCH] add hifi link to table, make table icons anchors --- domain-server/resources/web/css/style.css | 5 +++ domain-server/resources/web/js/settings.js | 50 ++++++++++++++-------- 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/domain-server/resources/web/css/style.css b/domain-server/resources/web/css/style.css index 607288f2c1..51275da509 100644 --- a/domain-server/resources/web/css/style.css +++ b/domain-server/resources/web/css/style.css @@ -78,6 +78,11 @@ td.reorder-buttons .glyphicon { display: inherit; } +td a.glyphicon { + color: black; + text-decoration: none; +} + tr.new-row { color: #3c763d; background-color: #dff0d8; diff --git a/domain-server/resources/web/js/settings.js b/domain-server/resources/web/js/settings.js index 300744dd4d..cd26d0e43e 100644 --- a/domain-server/resources/web/js/settings.js +++ b/domain-server/resources/web/js/settings.js @@ -173,6 +173,8 @@ $(document).ready(function(){ // set focus to the first input in the new row $(this).closest('table').find('tr.inputs input:first').focus() } + + e.preventDefault(); } }); @@ -208,7 +210,7 @@ $(document).ready(function(){ chooseFromHighFidelityDomains($(this)) }); - $('#' + Settings.FORM_ID).on('click', '#' + Settings.GET_TEMPORARY_NAME_ID, function(){ + $('#' + Settings.FORM_ID).on('click', '#' + Settings.GET_TEMPORARY_NAME_BTN_ID, function(){ $(this).blur(); createTemporaryDomain(); }); @@ -496,6 +498,11 @@ function setupPlacesTable() { { "name": "path", "label": "Path" + }, + { + "name": "edit", + "label": "", + "class": "buttons" } ] } @@ -519,13 +526,16 @@ function setupPlacesTable() { } function placeTableRow(name, path, isTemporary) { - if (!isTemporary) { - var name_link = "" + name + ""; + var name_link = "" + name + ""; + + if (isTemporary) { + var editColumn = ""; } else { - var name_link = name; + var editColumn = ""; } - return "" + name_link + "" + path + ""; + return "" + name_link + "" + path + "" + editColumn + ""; } function placeTableRowForPlaceObject(place) { @@ -637,10 +647,11 @@ function chooseFromHighFidelityDomains(clickedButton) { function createTemporaryDomain() { swal({ title: 'Create temporary place name', - text: 'This will create a temporary place name and domain ID so other users can easily connect to your domain.', + text: "This will create a temporary place name and domain ID (valid for 30 days) so other users can easily connect to your domain.", showCancelButton: true, confirmButtonText: 'Create', - closeOnConfirm: false + closeOnConfirm: false, + html: true }, function(isConfirm){ if (isConfirm) { showSpinnerAlert('Creating temporary place name'); @@ -757,15 +768,15 @@ function makeTable(setting, keypath, setting_value, isLocked) { } _.each(setting.columns, function(col) { - html += "" + col.label + "" // Data + html += "" + col.label + "" // Data }) if (!isLocked && !setting.read_only) { if (setting.can_order) { html += ""; + ">"; } - html += "" + html += "" } // populate rows in the table from existing values @@ -804,11 +815,11 @@ function makeTable(setting, keypath, setting_value, isLocked) { if (!isLocked && !setting.read_only) { if (setting.can_order) { html += "" + "'>" + + "" } html += "" + "'>" } html += "" @@ -850,7 +861,7 @@ function makeTableInputs(setting) { html += "" } html += "" + "'>" html += "" return html @@ -956,13 +967,14 @@ function addTableRow(add_glyphicon) { $(element).html(1) } } else if ($(element).hasClass(Settings.REORDER_BUTTONS_CLASS)) { - $(element).html("") + $(element).html("") } else if ($(element).hasClass(Settings.ADD_DEL_BUTTONS_CLASS)) { // Change buttons - var span = $(element).children("span") - span.removeClass(Settings.ADD_ROW_SPAN_CLASSES) - span.addClass(Settings.DEL_ROW_SPAN_CLASSES) + var anchor = $(element).children("a") + anchor.removeClass(Settings.ADD_ROW_SPAN_CLASSES) + anchor.addClass(Settings.DEL_ROW_SPAN_CLASSES) } else if ($(element).hasClass("key")) { var input = $(element).children("input") $(element).html(input.val())