Updated Branches: refs/heads/ui-regions 5a08ef64b -> e3439bc8d
Add select region icon to top bar Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/e3439bc8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/e3439bc8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/e3439bc8 Branch: refs/heads/ui-regions Commit: e3439bc8d08b7ea03175440ce8ca11326e301e1e Parents: cc49cb5 Author: Brian Federle <[email protected]> Authored: Tue Feb 26 14:02:05 2013 -0800 Committer: Brian Federle <[email protected]> Committed: Tue Feb 26 14:02:05 2013 -0800 ---------------------------------------------------------------------- ui/css/cloudstack3.css | 42 ++++++++++++++++++++++++++++++++++++++++++ ui/images/sprites.png | Bin 185046 -> 187945 bytes ui/scripts/regions.js | 20 ++++++++++++++++++++ ui/scripts/ui/core.js | 8 ++++++++ 4 files changed, 70 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e3439bc8/ui/css/cloudstack3.css ---------------------------------------------------------------------- diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 25b38cd..f8a7884 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -11071,6 +11071,48 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it height: 100%; } +/*Regions*/ +.region-switcher { + background: url(../images/bg-gradients.png) 0px -1px; + border: 1px solid #5E5E5E; + /*+border-radius:4px;*/ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; + border-top: 1px solid #717171; + border-bottom: 1px solid #FFFFFF; + width: 32px; + height: 28px; + float: left; + margin: 4px 13px 0 0; + cursor: pointer; + /*+box-shadow:inset 0px 1px 1px #000000;*/ + -moz-box-shadow: inset 0px 1px 1px #000000; + -webkit-box-shadow: inset 0px 1px 1px #000000; + -o-box-shadow: inset 0px 1px 1px #000000; + box-shadow: inset 0px 1px 1px #000000; +} + +.region-switcher .icon { + display: block; + width: 100%; + height: 100%; + background: url(../images/sprites.png) -15px -1313px; +} + +.region-switcher:hover { + /*+box-shadow:inset 0px 1px 5px #000000;*/ + -moz-box-shadow: inset 0px 1px 5px #000000; + -webkit-box-shadow: inset 0px 1px 5px #000000; + -o-box-shadow: inset 0px 1px 5px #000000; + box-shadow: inset 0px 1px 5px #000000; +} + +.region-switcher:hover .icon { + background-position: -70px -1311px; +} + /*Action icons*/ .action.edit .icon { background-position: 1px -1px; http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e3439bc8/ui/images/sprites.png ---------------------------------------------------------------------- diff --git a/ui/images/sprites.png b/ui/images/sprites.png index 61ec3ab..0dd997e 100644 Binary files a/ui/images/sprites.png and b/ui/images/sprites.png differ http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e3439bc8/ui/scripts/regions.js ---------------------------------------------------------------------- diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js index f5a3dcf..46f73da 100644 --- a/ui/scripts/regions.js +++ b/ui/scripts/regions.js @@ -68,6 +68,26 @@ }, detailView: { name: 'Region details', + actions: { + remove: { + label: 'label.remove.region', + messages: { + notification: function() { return 'label.remove.region'; }, + confirm: function() { return 'message.remove.region'; } + }, + action: function(args) { + var region = args.context.regions[0]; + + $.ajax({ + url: createURL('removeRegion'), + data: { id: region.id }, + success: function(json) { + args.response.success(); + } + }); + } + } + }, tabs: { details: { title: 'label.details', http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e3439bc8/ui/scripts/ui/core.js ---------------------------------------------------------------------- diff --git a/ui/scripts/ui/core.js b/ui/scripts/ui/core.js index b2be379..68dafda 100644 --- a/ui/scripts/ui/core.js +++ b/ui/scripts/ui/core.js @@ -127,6 +127,13 @@ .append($('<span>').html(_l('label.notifications'))) .notifications(); + // Region switcher + var $regionSwitcher = $('<div>').addClass('region-switcher') + .attr('title', 'Select region') + .append( + $('<span>').addClass('icon').html(' ') + ); + // Project switcher var $viewSwitcher = $('<div>').addClass('button view-switcher') .append( @@ -220,6 +227,7 @@ $('<div>').addClass('controls') .append($notificationArea) .append($viewSwitcher) + .append($regionSwitcher) .append($projectSelect) .append($userInfo) ];
