From 1fd84b148d71dd9d1e5110ac1640abea8f838cde Mon Sep 17 00:00:00 2001 From: phamt Date: Wed, 28 Sep 2011 21:38:12 +0000 Subject: [PATCH] Set theme for all elements on UI. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10669 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/css/style.css | 8 +++-- xCAT-UI/js/configure/configure.js | 9 ++++- xCAT-UI/js/configure/update.js | 2 +- xCAT-UI/js/custom/blade.js | 2 +- xCAT-UI/js/custom/hmc.js | 2 +- xCAT-UI/js/custom/ipmi.js | 3 +- xCAT-UI/js/custom/zvm.js | 3 +- xCAT-UI/js/custom/zvmUtils.js | 2 +- xCAT-UI/js/monitor/monitor.js | 4 +-- xCAT-UI/js/nodes/nodes.js | 42 ++-------------------- xCAT-UI/js/nodes/physical.js | 40 ++------------------- xCAT-UI/js/provision/images.js | 7 ++++ xCAT-UI/js/provision/provision.js | 10 +++--- xCAT-UI/js/ui.js | 58 +++++++++++++++++++++++++++++++ 14 files changed, 99 insertions(+), 93 deletions(-) diff --git a/xCAT-UI/css/style.css b/xCAT-UI/css/style.css index 4e3e98814..b3a56eed6 100644 --- a/xCAT-UI/css/style.css +++ b/xCAT-UI/css/style.css @@ -246,7 +246,7 @@ span.ui-icon-info { } .tab th { - font: 12px verdana, arial, helvetica, sans-serif; + font: bold 12px verdana, arial, helvetica, sans-serif; padding: 10px; border-width: 1px; border-style: solid; @@ -263,6 +263,10 @@ span.ui-icon-info { vertical-align: middle; } +.tab table a { + color: blue; +} + .tab span a,.tab li a { text-decoration: none; cursor: pointer; @@ -448,7 +452,7 @@ legend { .datatable a { text-decoration: none; - color: #000FF; + color: blue; cursor: pointer; } diff --git a/xCAT-UI/js/configure/configure.js b/xCAT-UI/js/configure/configure.js index e3a05ecda..cfd04c1df 100644 --- a/xCAT-UI/js/configure/configure.js +++ b/xCAT-UI/js/configure/configure.js @@ -126,7 +126,7 @@ function loadTableNames(data) { for ( var i = 0; i < tables.length; i++) { // Create a link for each table var args = tables[i].split(':'); - var link = $('' + args[0] + ''); + var link = $('' + args[0] + ''); // Open table on click link.bind('click', function(e) { @@ -438,6 +438,13 @@ function loadTable(data) { actionsMenu.css('display', 'inline-block'); actionBar.append(actionsMenu); + // Set correct theme for action menu + actionsMenu.find('li').hover(function() { + setMenu2Theme($(this)); + }, function() { + setMenu2Normal($(this)); + }); + // Create a division to hold actions menu var menuDiv = $(''); $('#' + id + 'Datatable_wrapper').prepend(menuDiv); diff --git a/xCAT-UI/js/configure/update.js b/xCAT-UI/js/configure/update.js index 894fc6f51..2f1eb7849 100644 --- a/xCAT-UI/js/configure/update.js +++ b/xCAT-UI/js/configure/update.js @@ -126,7 +126,7 @@ function showRpmInfo(data) { $('#rpm fieldset').children().remove(); $('#rpm fieldset').append("xCAT RPMs"); show = ""; - show += ""; + show += ""; show += ""; show += ""; show += ""; diff --git a/xCAT-UI/js/custom/blade.js b/xCAT-UI/js/custom/blade.js index aa037c0fb..851d3c06f 100644 --- a/xCAT-UI/js/custom/blade.js +++ b/xCAT-UI/js/custom/blade.js @@ -279,7 +279,7 @@ bladePlugin.prototype.addNode = function() { nodeTypeSelectDia.dialog( { modal : true, width : 400, - title : 'Select Node Type', + title : 'Add node', open : function(event, ui) { $(".ui-dialog-titlebar-close").hide(); }, diff --git a/xCAT-UI/js/custom/hmc.js b/xCAT-UI/js/custom/hmc.js index 1d242167d..0fac865a3 100644 --- a/xCAT-UI/js/custom/hmc.js +++ b/xCAT-UI/js/custom/hmc.js @@ -170,7 +170,7 @@ hmcPlugin.prototype.addNode = function() { diaDiv.dialog({ modal : true, width : 400, - title : 'Add System p Node', + title : 'Add node', close : function(){$('#addpnodeDiv').remove();} }); diff --git a/xCAT-UI/js/custom/ipmi.js b/xCAT-UI/js/custom/ipmi.js index 2bdd85c54..2c4ada7b8 100644 --- a/xCAT-UI/js/custom/ipmi.js +++ b/xCAT-UI/js/custom/ipmi.js @@ -171,7 +171,7 @@ ipmiPlugin.prototype.loadResources = function() { * @return Nothing */ ipmiPlugin.prototype.addNode = function() { - var diag = $('
'); + var diag = $('
'); var info = createInfoBar('Add a node range'); diag.append(info); @@ -199,6 +199,7 @@ ipmiPlugin.prototype.addNode = function() { bmcFieldSet.append(bmcInputs); diag.dialog({ + title: 'Add node', modal: true, width: 400, close: function(){$(this).remove();}, diff --git a/xCAT-UI/js/custom/zvm.js b/xCAT-UI/js/custom/zvm.js index eaeed186f..f612f9b24 100644 --- a/xCAT-UI/js/custom/zvm.js +++ b/xCAT-UI/js/custom/zvm.js @@ -343,7 +343,7 @@ zvmPlugin.prototype.loadInventory = function(data) { * Show user entry */ var toggleLinkId = node + 'ToggleLink'; - var toggleLink = $('Show directory entry'); + var toggleLink = $('Show directory entry'); toggleLink.one('click', function(event) { // Toggle inventory division $('#' + invDivId).toggle(); @@ -928,6 +928,7 @@ zvmPlugin.prototype.addNode = function() { // Open form as a dialog addNodeForm.dialog({ + title: 'Add node', modal: true, width: 400, buttons: { diff --git a/xCAT-UI/js/custom/zvmUtils.js b/xCAT-UI/js/custom/zvmUtils.js index 616b63e0a..61b88f649 100644 --- a/xCAT-UI/js/custom/zvmUtils.js +++ b/xCAT-UI/js/custom/zvmUtils.js @@ -2276,7 +2276,7 @@ function createZProvisionNew(inst) { var diskDiv = $('
'); var diskLabel = $(''); var diskTable = $('
Package NameVersion
'); - var diskHeader = $(' Type Address Size Mode Pool Password '); + var diskHeader = $(' Type Address Size Mode Pool Password '); // Adjust header width diskHeader.find('th').css( { 'width' : '80px' diff --git a/xCAT-UI/js/monitor/monitor.js b/xCAT-UI/js/monitor/monitor.js index fd43f0e59..01d89240b 100644 --- a/xCAT-UI/js/monitor/monitor.js +++ b/xCAT-UI/js/monitor/monitor.js @@ -118,9 +118,9 @@ function loadMonitorPage() { // Turn on or off monitoring tool when clicked statusButton.find('input["' + name + '"]:radio').change(toggleMonitor); } - + var monTable = $('
'); - monTable.append($('ToolStatusDescription')); + monTable.append($('ToolStatusDescription')); var monTableBody = $(''); monTable.append(monTableBody); diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js index b6d7e58f1..bfab4ad8e 100644 --- a/xCAT-UI/js/nodes/nodes.js +++ b/xCAT-UI/js/nodes/nodes.js @@ -409,7 +409,7 @@ function mkAddNodeLink() { addNodeForm.dialog({ modal: true, width: 400, - title:'Add Node', + title:'Add node', close: function(){$(this).remove();}, buttons: { 'Ok': function(){ @@ -817,45 +817,9 @@ function loadNodes(data) { // Set correct theme for action menu actionsMenu.find('li').hover(function() { - // On hover - var background = '', color = ''; - var theme = $.cookie('xcat_theme'); - if (theme) { - switch (theme) { - case 'cupertino': - background = '#3BAAE3'; - color = 'white'; - break; - case 'dark_hive': - background = '#0972A5'; - break; - case 'redmond': - background = '#F5F8F9'; - color = '#E17009'; - break; - case 'start': - background = '#6EAC2C'; - break; - case 'sunny': - background = 'white'; - color = '#0074C7'; - break; - case 'ui_dark': - background = '#F58400'; - break; - default: - background = '#6EAC2C'; - } - } else { - background = '#6EAC2C'; - } - - $(this).css('background', background); - $(this).find('a:eq(0)').css('color', color); + setMenu2Theme($(this)); }, function() { - // Change back to normal - $(this).css('background', ''); - $(this).find('a:eq(0)').css('color', ''); + setMenu2Normal($(this)); }); // Insert action bar and nodes datatable diff --git a/xCAT-UI/js/nodes/physical.js b/xCAT-UI/js/nodes/physical.js index f6438eb35..54e14b2ab 100644 --- a/xCAT-UI/js/nodes/physical.js +++ b/xCAT-UI/js/nodes/physical.js @@ -544,45 +544,9 @@ function createActionMenu(){ // Set correct theme for action menu actionsMenu.find('li').hover(function() { - // On hover - var background = '', color = ''; - var theme = $.cookie('xcat_theme'); - if (theme) { - switch (theme) { - case 'cupertino': - background = '#3BAAE3'; - color = 'white'; - break; - case 'dark_hive': - background = '#0972A5'; - break; - case 'redmond': - background = '#F5F8F9'; - color = '#E17009'; - break; - case 'start': - background = '#6EAC2C'; - break; - case 'sunny': - background = 'white'; - color = '#0074C7'; - break; - case 'ui_dark': - background = '#F58400'; - break; - default: - background = '#6EAC2C'; - } - } else { - background = '#6EAC2C'; - } - - $(this).css('background', background); - $(this).find('a:eq(0)').css('color', color); + setMenu2Theme($(this)); }, function() { - // Change back to normal - $(this).css('background', ''); - $(this).find('a:eq(0)').css('color', ''); + setMenu2Normal($(this)); }); return actionBar; diff --git a/xCAT-UI/js/provision/images.js b/xCAT-UI/js/provision/images.js index 3ccd908e9..974ace848 100644 --- a/xCAT-UI/js/provision/images.js +++ b/xCAT-UI/js/provision/images.js @@ -188,6 +188,13 @@ function loadImages(data) { actionsMenu.css('display', 'inline-block'); actionBar.append(actionsMenu); + // Set correct theme for action menu + actionsMenu.find('li').hover(function() { + setMenu2Theme($(this)); + }, function() { + setMenu2Normal($(this)); + }); + // Create a division to hold actions menu var menuDiv = $(''); $('#' + imgTableId + '_wrapper').prepend(menuDiv); diff --git a/xCAT-UI/js/provision/provision.js b/xCAT-UI/js/provision/provision.js index acf2884b2..c888fc9c7 100644 --- a/xCAT-UI/js/provision/provision.js +++ b/xCAT-UI/js/provision/provision.js @@ -109,24 +109,24 @@ function loadProvisionPage() { else{ var tabtitle = ''; - // Create an instance of the plugin + // Create an instance of the plugin var plugin; switch (hw) { case "blade": plugin = new bladePlugin(); - tabtitle = 'Blade'; + tabtitle = 'BladeCenter'; break; case "hmc": plugin = new hmcPlugin(); - tabtitle = 'System P'; + tabtitle = 'System p'; break; case "ipmi": plugin = new ipmiPlugin(); - tabtitle = 'System X'; + tabtitle = 'iDataPlex'; break; case "zvm": plugin = new zvmPlugin(); - tabtitle = 'zVM'; + tabtitle = 'System z'; break; } diff --git a/xCAT-UI/js/ui.js b/xCAT-UI/js/ui.js index 3e857ed43..5f693dedf 100644 --- a/xCAT-UI/js/ui.js +++ b/xCAT-UI/js/ui.js @@ -813,4 +813,62 @@ function openSettings() { } } }); +} + +/** + * Set menu theme + * + * @param menu + * Menu object + * @return Nothing + */ +function setMenu2Theme(menu) { + // On hover + var background = '', color = ''; + var theme = $.cookie('xcat_theme'); + if (theme) { + switch (theme) { + case 'cupertino': + background = '#3BAAE3'; + color = 'white'; + break; + case 'dark_hive': + background = '#0972A5'; + break; + case 'redmond': + background = '#F5F8F9'; + color = '#E17009'; + break; + case 'start': + background = '#6EAC2C'; + break; + case 'sunny': + background = 'white'; + color = '#0074C7'; + break; + case 'ui_dark': + background = '#F58400'; + break; + default: + background = '#6EAC2C'; + } + } else { + background = '#6EAC2C'; + } + + menu.css('background', background); + menu.find('a:eq(0)').css('color', color); +} + +/** + * Set menu back to normal before applying theme + * + * @param menu + * Menu object + * @return Nothing + */ +function setMenu2Normal(menu) { + // Change back to normal + menu.css('background', ''); + menu.find('a:eq(0)').css('color', ''); } \ No newline at end of file