mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Cleanup whitespace + indentation for UI widgets
This commit is contained in:
parent
c85daa95c9
commit
fc0327677a
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack) {
|
||||
cloudStack.uiCustom.dashboard = function() {
|
||||
@ -44,14 +44,14 @@
|
||||
maximizeIfSelected: true,
|
||||
complete: function($newPanel) {
|
||||
$newPanel.detailView($.extend(true, {},
|
||||
cloudStack.sections.dashboard.admin.zoneDetailView,
|
||||
{
|
||||
$browser: $browser,
|
||||
context: $.extend(true, {}, cloudStack.context, {
|
||||
physicalResources: [{ id: item.zoneID }]
|
||||
})
|
||||
}
|
||||
));
|
||||
cloudStack.sections.dashboard.admin.zoneDetailView,
|
||||
{
|
||||
$browser: $browser,
|
||||
context: $.extend(true, {}, cloudStack.context, {
|
||||
physicalResources: [{ id: item.zoneID }]
|
||||
})
|
||||
}
|
||||
));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
$.each(item, function(arrayKey, arrayValue) {
|
||||
if (!arrayValue) arrayValue = '';
|
||||
|
||||
|
||||
var $arrayElem = $li.find('[data-list-item=' + arrayKey + ']');
|
||||
|
||||
$arrayElem.each(function() {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function(cloudStack, $) {
|
||||
cloudStack.uiCustom.enableStaticNAT = function(args) {
|
||||
@ -74,12 +74,12 @@
|
||||
'input[type=radio]:checked, input[type=checkbox]:checked'
|
||||
).size()) {
|
||||
cloudStack.dialog.notice({ message: _l('message.select.instance')});
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
var complete = args.complete;
|
||||
|
||||
|
||||
$dataList.fadeOut(function() {
|
||||
action({
|
||||
context: $.extend(true, {}, context, {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack) {
|
||||
var installWizard = function(args) {
|
||||
@ -217,7 +217,7 @@
|
||||
$('<h2></h2>').html(_l('label.installWizard.title')),
|
||||
$('<h3></h3>').html(_l('label.installWizard.subtitle'))
|
||||
)
|
||||
);
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -232,7 +232,7 @@
|
||||
*/
|
||||
nextButton: function(label, options) {
|
||||
var $button = options && !options.type ?
|
||||
$('<div>').addClass('button goTo').html(label) :
|
||||
$('<div>').addClass('button goTo').html(label) :
|
||||
$('<input>').attr({ type: 'submit' }).addClass('button goTo').val(label);
|
||||
|
||||
return $button;
|
||||
@ -307,12 +307,12 @@
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
return $intro.append($title, $subtitle,
|
||||
$copy,
|
||||
$continue);
|
||||
},
|
||||
|
||||
|
||||
intro: function(args) {
|
||||
var $intro = $('<div></div>').addClass('intro what-is-cloudstack');
|
||||
var $title = $('<div></div>').addClass('title').html(_l('label.what.is.cloudstack'));
|
||||
@ -519,7 +519,7 @@
|
||||
select: function(args) {
|
||||
args.response.success({ data: [
|
||||
{ id: 'XenServer', description: 'XenServer' },
|
||||
{ id: 'KVM', description: 'KVM'}
|
||||
{ id: 'KVM', description: 'KVM'}
|
||||
]});
|
||||
}
|
||||
},
|
||||
@ -666,9 +666,9 @@
|
||||
launchInfo: function(args) {
|
||||
var $intro = $('<div></div>').addClass('intro');
|
||||
var $title = $('<div></div>').addClass('title')
|
||||
.html(_l('label.congratulations'));
|
||||
.html(_l('label.congratulations'));
|
||||
var $subtitle = $('<div></div>').addClass('subtitle')
|
||||
.html(_l('label.installWizard.click.launch'));
|
||||
.html(_l('label.installWizard.click.launch'));
|
||||
var $continue = elems.nextButton(_l('label.launch'));
|
||||
var $prev = elems.prevButton(_l('label.back'));
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack) {
|
||||
/**
|
||||
@ -82,39 +82,39 @@
|
||||
var id = this[fields.id];
|
||||
|
||||
var $select = $('<div>')
|
||||
.addClass('select')
|
||||
.append(
|
||||
$('<input>')
|
||||
.attr({
|
||||
type: (function(type) {
|
||||
return type ? type : 'radio';
|
||||
})(options ? options.type : null),
|
||||
name: name,
|
||||
'wizard-field': options['wizard-field']
|
||||
})
|
||||
.val(id)
|
||||
.click(function() {
|
||||
var $radio = $(this).closest('.select').find('input[type=radio]');
|
||||
.addClass('select')
|
||||
.append(
|
||||
$('<input>')
|
||||
.attr({
|
||||
type: (function(type) {
|
||||
return type ? type : 'radio';
|
||||
})(options ? options.type : null),
|
||||
name: name,
|
||||
'wizard-field': options['wizard-field']
|
||||
})
|
||||
.val(id)
|
||||
.click(function() {
|
||||
var $radio = $(this).closest('.select').find('input[type=radio]');
|
||||
|
||||
if ($radio.is(':checked') && !$(this).is(':checked')) {
|
||||
if (!$radio.closest('.select').index()) {
|
||||
return false;
|
||||
} else {
|
||||
$radio
|
||||
.closest('.select')
|
||||
.siblings().filter(':first')
|
||||
.find('input[type=radio]').click();
|
||||
}
|
||||
}
|
||||
if ($radio.is(':checked') && !$(this).is(':checked')) {
|
||||
if (!$radio.closest('.select').index()) {
|
||||
return false;
|
||||
} else {
|
||||
$radio
|
||||
.closest('.select')
|
||||
.siblings().filter(':first')
|
||||
.find('input[type=radio]').click();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
})
|
||||
)
|
||||
.append(
|
||||
$('<div>').addClass('select-desc')
|
||||
.append($('<div>').addClass('name').html(this[fields.name]))
|
||||
.append($('<div>').addClass('desc').html(this[fields.desc]))
|
||||
);
|
||||
return true;
|
||||
})
|
||||
)
|
||||
.append(
|
||||
$('<div>').addClass('select-desc')
|
||||
.append($('<div>').addClass('name').html(this[fields.name]))
|
||||
.append($('<div>').addClass('desc').html(this[fields.desc]))
|
||||
);
|
||||
|
||||
$selects.append($select);
|
||||
|
||||
@ -195,7 +195,7 @@
|
||||
'select-iso': function($step, formData) {
|
||||
var originalValues = function(formData) {
|
||||
var $inputs = $step.find('.wizard-step-conditional:visible')
|
||||
.find('input[type=radio]');
|
||||
.find('input[type=radio]');
|
||||
var $selected = $inputs.filter(function() {
|
||||
return $(this).val() == formData.templateid;
|
||||
});
|
||||
@ -235,12 +235,12 @@
|
||||
// Create hypervisor select
|
||||
$selects.find('input').bind('click', function() {
|
||||
var $select = $(this).closest('.select');
|
||||
|
||||
//$select.siblings().removeClass('selected').find('.hypervisor').remove(); //SelectISO has 3 tabs now. This line only remove hypervisor div in the same tab, not enough. The following 3 lines will remove hypervisor div in all of 3 tabs.
|
||||
$("#instance-wizard-featured-isos .select-container div.selected").removeClass('selected').find('div.hypervisor').remove();
|
||||
$("#instance-wizard-community-isos .select-container div.selected").removeClass('selected').find('div.hypervisor').remove();
|
||||
$("#instance-wizard-my-isos .select-container div.selected").removeClass('selected').find('div.hypervisor').remove();
|
||||
|
||||
|
||||
//$select.siblings().removeClass('selected').find('.hypervisor').remove(); //SelectISO has 3 tabs now. This line only remove hypervisor div in the same tab, not enough. The following 3 lines will remove hypervisor div in all of 3 tabs.
|
||||
$("#instance-wizard-featured-isos .select-container div.selected").removeClass('selected').find('div.hypervisor').remove();
|
||||
$("#instance-wizard-community-isos .select-container div.selected").removeClass('selected').find('div.hypervisor').remove();
|
||||
$("#instance-wizard-my-isos .select-container div.selected").removeClass('selected').find('div.hypervisor').remove();
|
||||
|
||||
$select.addClass('selected').append(
|
||||
$('<div>').addClass('hypervisor')
|
||||
.append($('<label>').html('Hypervisor:'))
|
||||
@ -269,8 +269,8 @@
|
||||
['featuredtemplates', 'instance-wizard-featured-templates'],
|
||||
['communitytemplates', 'instance-wizard-community-templates'],
|
||||
['mytemplates', 'instance-wizard-my-templates'],
|
||||
|
||||
['featuredisos', 'instance-wizard-featured-isos'],
|
||||
|
||||
['featuredisos', 'instance-wizard-featured-isos'],
|
||||
['communityisos', 'instance-wizard-community-isos'],
|
||||
['myisos', 'instance-wizard-my-isos']
|
||||
//['isos', 'instance-wizard-all-isos']
|
||||
@ -632,15 +632,15 @@
|
||||
cloudStack.dialog.notice({ message: 'message.step.1.continue' });
|
||||
return false;
|
||||
}
|
||||
|
||||
//step 5 - select network
|
||||
if($activeStep.find('.wizard-step-conditional.select-network:visible').size() > 0) {
|
||||
if($activeStep.find('input[type=checkbox]:checked').size() == 0) { //if no checkbox is checked
|
||||
cloudStack.dialog.notice({ message: 'message.step.4.continue' });
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//step 5 - select network
|
||||
if($activeStep.find('.wizard-step-conditional.select-network:visible').size() > 0) {
|
||||
if($activeStep.find('input[type=checkbox]:checked').size() == 0) { //if no checkbox is checked
|
||||
cloudStack.dialog.notice({ message: 'message.step.4.continue' });
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$form.valid()) {
|
||||
if ($form.find('input.error:visible, select.error:visible').size()) {
|
||||
return false;
|
||||
@ -687,7 +687,7 @@
|
||||
var $futureSteps = $step.siblings().filter(function() {
|
||||
return $(this).index() > $step.index();
|
||||
});
|
||||
|
||||
|
||||
// Reset all fields in futher steps
|
||||
$futureSteps.removeClass('loaded');
|
||||
});
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack) {
|
||||
cloudStack.ipRules = function(args) {
|
||||
@ -19,9 +19,9 @@
|
||||
return $('<div>').multiEdit(args);
|
||||
};
|
||||
|
||||
var makeMultiEditPanel = function($item) {
|
||||
if ($item.closest('li').hasClass('disabled'))
|
||||
return false;
|
||||
var makeMultiEditPanel = function($item) {
|
||||
if ($item.closest('li').hasClass('disabled'))
|
||||
return false;
|
||||
|
||||
var targetId = $item.attr('net-target');
|
||||
var targetName = $item.parent().find('.name').find('span').html();
|
||||
@ -103,39 +103,39 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(includingFirewall == true) {
|
||||
$chart.find('li.firewall .view-details').click(function() {
|
||||
//makeMultiEditPanel($(this), { title: _l('label.nat.port.range')});
|
||||
makeMultiEditPanel($(this));
|
||||
});
|
||||
}
|
||||
else {
|
||||
$chart.find('li.firewall').hide();
|
||||
}
|
||||
|
||||
if(includingFirewall == true) {
|
||||
$chart.find('li.firewall .view-details').click(function() {
|
||||
//makeMultiEditPanel($(this), { title: _l('label.nat.port.range')});
|
||||
makeMultiEditPanel($(this));
|
||||
});
|
||||
}
|
||||
else {
|
||||
$chart.find('li.firewall').hide();
|
||||
}
|
||||
|
||||
return $chart;
|
||||
};
|
||||
|
||||
var netChart = function(args) {
|
||||
|
||||
|
||||
var $chart = $('#template').find('.network-chart.normal').clone();
|
||||
var preFilter = args.preFilter ? args.preFilter({
|
||||
items: ['firewall', 'portForwarding', 'loadBalancing'],
|
||||
context: context
|
||||
}) : [];
|
||||
|
||||
// 1. choose between staticNAT chart and non-staticNAT chart 2. filter disabled tabs
|
||||
if (preFilter.length) {
|
||||
if($.inArray('nonStaticNATChart', preFilter) != -1) { //choose static NAT chart
|
||||
if($.inArray('firewall', preFilter) == -1) {
|
||||
return staticNATChart(args, true); //static NAT including Firewall
|
||||
}
|
||||
else {
|
||||
return staticNATChart(args, false); //static NAT excluding Firewall
|
||||
}
|
||||
}
|
||||
else { //choose non-static NAT chart
|
||||
// 1. choose between staticNAT chart and non-staticNAT chart 2. filter disabled tabs
|
||||
if (preFilter.length) {
|
||||
if($.inArray('nonStaticNATChart', preFilter) != -1) { //choose static NAT chart
|
||||
if($.inArray('firewall', preFilter) == -1) {
|
||||
return staticNATChart(args, true); //static NAT including Firewall
|
||||
}
|
||||
else {
|
||||
return staticNATChart(args, false); //static NAT excluding Firewall
|
||||
}
|
||||
}
|
||||
else { //choose non-static NAT chart
|
||||
$(preFilter).each(function() {
|
||||
var id = this;
|
||||
|
||||
@ -143,7 +143,7 @@
|
||||
return $(this).hasClass(id);
|
||||
}).addClass('disabled');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$chart.find('.view-details').click(function() {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack) {
|
||||
/**
|
||||
@ -46,14 +46,14 @@
|
||||
|
||||
if (event.type == 'keydown') {
|
||||
$label.hide();
|
||||
|
||||
|
||||
return true;
|
||||
} else {
|
||||
if (!$target.val()) {
|
||||
$label.show();
|
||||
} else {
|
||||
$label.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -61,7 +61,7 @@
|
||||
|
||||
if (!args.hasLogo) $login.addClass('nologo');
|
||||
|
||||
// Labels cause related input to be focused
|
||||
// Labels cause related input to be focused
|
||||
$login.find('label').click(function() {
|
||||
var $input = $inputs.filter('[name=' + $(this).attr('for') + ']');
|
||||
|
||||
@ -106,7 +106,7 @@
|
||||
if (!$.cookie('lang')) {
|
||||
$.cookie('lang', 'en');
|
||||
}
|
||||
|
||||
|
||||
$languageSelect.val($.cookie('lang'));
|
||||
};
|
||||
})(jQuery, cloudStack);
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function(cloudStack, $) {
|
||||
cloudStack.uiCustom.physicalResources = function(args) {
|
||||
@ -37,7 +37,7 @@
|
||||
|
||||
var resourceChart = function(args) {
|
||||
getData();
|
||||
|
||||
|
||||
return $dashboard
|
||||
.click(function(event) {
|
||||
var $target = $(event.target);
|
||||
@ -63,74 +63,74 @@
|
||||
});
|
||||
|
||||
return function(args) {
|
||||
$dashboard.find('#update_ssl_button').click(function() {
|
||||
cloudStack.dialog.createForm({
|
||||
form: {
|
||||
title: 'label.update.ssl',
|
||||
desc: 'message.update.ssl',
|
||||
fields: {
|
||||
certificate: { label: 'label.certificate', isTextarea: true },
|
||||
privatekey: { label: 'label.privatekey', isTextarea: true },
|
||||
domainsuffix: { label: 'label.domain.suffix' }
|
||||
}
|
||||
},
|
||||
after: function(args) {
|
||||
var $loading = $('<div>').addClass('loading-overlay');
|
||||
$dashboard.find('#update_ssl_button').click(function() {
|
||||
cloudStack.dialog.createForm({
|
||||
form: {
|
||||
title: 'label.update.ssl',
|
||||
desc: 'message.update.ssl',
|
||||
fields: {
|
||||
certificate: { label: 'label.certificate', isTextarea: true },
|
||||
privatekey: { label: 'label.privatekey', isTextarea: true },
|
||||
domainsuffix: { label: 'label.domain.suffix' }
|
||||
}
|
||||
},
|
||||
after: function(args) {
|
||||
var $loading = $('<div>').addClass('loading-overlay');
|
||||
$('.system-dashboard-view:visible').prepend($loading);
|
||||
|
||||
$.ajax({
|
||||
url: createURL('uploadCustomCertificate'),
|
||||
data: {
|
||||
certificate: args.data.certificate,
|
||||
privatekey: args.data.privatekey,
|
||||
domainsuffix: args.data.domainsuffix
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function(json) {
|
||||
var jid = json.uploadcustomcertificateresponse.jobid;
|
||||
var timerKey = "uploadcustomcertificatejob_" + jid;
|
||||
$("body").everyTime(2000, timerKey, function() {
|
||||
$.ajax({
|
||||
url: createURL("queryAsyncJobResult&jobId=" + jid),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
|
||||
var result = json.queryasyncjobresultresponse;
|
||||
if (result.jobstatus == 0) {
|
||||
return; //Job has not completed
|
||||
}
|
||||
else {
|
||||
$("body").stopTime(timerKey);
|
||||
if (result.jobstatus == 1) {
|
||||
cloudStack.dialog.notice({ message: 'Update SSL Certiciate succeeded' });
|
||||
}
|
||||
else if (result.jobstatus == 2) {
|
||||
cloudStack.dialog.notice({ message: 'Failed to update SSL Certificate. ' + _s(result.jobresult.errortext) });
|
||||
}
|
||||
$loading.remove();
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
cloudStack.dialog.notice({ message: 'Failed to update SSL Certificate. ' + parseXMLHttpResponse(XMLHttpResponse) });
|
||||
$loading.remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
cloudStack.dialog.notice({ message: 'Failed to update SSL Certificate. ' + parseXMLHttpResponse(XMLHttpResponse) });
|
||||
$loading.remove();
|
||||
}
|
||||
});
|
||||
},
|
||||
context: {}
|
||||
});
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: createURL('uploadCustomCertificate'),
|
||||
data: {
|
||||
certificate: args.data.certificate,
|
||||
privatekey: args.data.privatekey,
|
||||
domainsuffix: args.data.domainsuffix
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function(json) {
|
||||
var jid = json.uploadcustomcertificateresponse.jobid;
|
||||
var timerKey = "uploadcustomcertificatejob_" + jid;
|
||||
$("body").everyTime(2000, timerKey, function() {
|
||||
$.ajax({
|
||||
url: createURL("queryAsyncJobResult&jobId=" + jid),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
|
||||
var result = json.queryasyncjobresultresponse;
|
||||
if (result.jobstatus == 0) {
|
||||
return; //Job has not completed
|
||||
}
|
||||
else {
|
||||
$("body").stopTime(timerKey);
|
||||
if (result.jobstatus == 1) {
|
||||
cloudStack.dialog.notice({ message: 'Update SSL Certiciate succeeded' });
|
||||
}
|
||||
else if (result.jobstatus == 2) {
|
||||
cloudStack.dialog.notice({ message: 'Failed to update SSL Certificate. ' + _s(result.jobresult.errortext) });
|
||||
}
|
||||
$loading.remove();
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
cloudStack.dialog.notice({ message: 'Failed to update SSL Certificate. ' + parseXMLHttpResponse(XMLHttpResponse) });
|
||||
$loading.remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
cloudStack.dialog.notice({ message: 'Failed to update SSL Certificate. ' + parseXMLHttpResponse(XMLHttpResponse) });
|
||||
$loading.remove();
|
||||
}
|
||||
});
|
||||
},
|
||||
context: {}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
$dashboard.find('#refresh_button').click(function() {
|
||||
$dashboard.find('#refresh_button').click(function() {
|
||||
getData();
|
||||
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function(cloudStack, $) {
|
||||
var pageElems = cloudStack.uiCustom.projectsTabs = {
|
||||
@ -32,7 +32,7 @@
|
||||
var $emailFields = $fields.filter(function() {
|
||||
return $(this).hasClass('email');
|
||||
});
|
||||
|
||||
|
||||
$multi.prepend(
|
||||
$('<div>').addClass('add-by')
|
||||
.append($('<span>').html(_l('label.add.by') + ':'))
|
||||
@ -148,7 +148,7 @@
|
||||
|
||||
resources: function(options) {
|
||||
if (!options) options = {};
|
||||
|
||||
|
||||
var $resources = $('<div>').addClass('resources').data('tab-title', _l('label.resources'));
|
||||
var $form = $('<form>');
|
||||
var $submit = $('<input>').attr({
|
||||
@ -232,7 +232,7 @@
|
||||
}
|
||||
|
||||
if (isAdmin() || isDomainAdmin()) {
|
||||
tabs.resources = pageElems.dashboardTabs.resources;
|
||||
tabs.resources = pageElems.dashboardTabs.resources;
|
||||
}
|
||||
}
|
||||
|
||||
@ -400,7 +400,7 @@
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
if (isAdmin() || isDomainAdmin()) {
|
||||
$ul.append(
|
||||
// Resources tab
|
||||
@ -418,7 +418,7 @@
|
||||
$resouces = $('<div>')
|
||||
.attr({ id: 'new-project-review-tabs-resouces' })
|
||||
.appendTo($tabs)
|
||||
.append(pageElems.dashboardTabs.resources);
|
||||
.append(pageElems.dashboardTabs.resources);
|
||||
}
|
||||
|
||||
$tabs.tabs();
|
||||
@ -608,7 +608,7 @@
|
||||
if ($target.is('li')) {
|
||||
cloudStack.context.projects = [$target.data('json-obj')];
|
||||
showDashboard();
|
||||
|
||||
|
||||
var $switcher = $('.select.project-view');
|
||||
var projectName = _s(cloudStack.context.projects[0].name);
|
||||
|
||||
@ -616,10 +616,10 @@
|
||||
if (projectName.length > 10) {
|
||||
projectName = projectName.substr(0, 10).concat('...');
|
||||
}
|
||||
|
||||
|
||||
// Put project name in header
|
||||
$switcher.html('<span class="icon"> </span>' + projectName);
|
||||
|
||||
|
||||
|
||||
$.merge($selector, $('.overlay')).remove();
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function(cloudStack, $) {
|
||||
cloudStack.uiCustom.recurringSnapshots = function(args) {
|
||||
@ -82,11 +82,11 @@
|
||||
// Update fields
|
||||
$snapshotRow.find('td.time span').html(args.data.time);
|
||||
$snapshotRow.find('td.day-of-week span').html(_l(
|
||||
args.data['day-of-week'] ?
|
||||
args.data['day-of-week'] ?
|
||||
$snapshots.find('select[name=day-of-week] option').filter(function() {
|
||||
return $(this).val() == args.data['day-of-week'];
|
||||
}).html() :
|
||||
args.data['day-of-month']
|
||||
args.data['day-of-month']
|
||||
));
|
||||
$snapshotRow.find('td.timezone span').html(
|
||||
$snapshots.find('select[name=timezone] option').filter(function() {
|
||||
@ -96,7 +96,7 @@
|
||||
$snapshotRow.find('td.keep span').html(args.data.keep);
|
||||
|
||||
$(':ui-dialog').dialog('option', 'position', 'center');
|
||||
|
||||
|
||||
refreshSnapshotTabs();
|
||||
}
|
||||
}
|
||||
@ -172,7 +172,7 @@
|
||||
$snapshots.find('select[name=day-of-week] option').filter(function() {
|
||||
return $(this).val() == snapshot['day-of-week'];
|
||||
}).html() :
|
||||
snapshot['day-of-month']
|
||||
snapshot['day-of-month']
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@ -8,12 +8,12 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack) {
|
||||
cloudStack.uiCustom.securityRules = function(args) {
|
||||
var multiEdit = args;
|
||||
|
||||
|
||||
return function(args) {
|
||||
var context = args.context;
|
||||
var $multi = $('<div>').addClass('security-rules').multiEdit(
|
||||
@ -62,7 +62,7 @@
|
||||
.append($('<label>').html('Account'))
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
return $multi;
|
||||
};
|
||||
};
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack) {
|
||||
/**
|
||||
@ -24,35 +24,21 @@
|
||||
var $browser = args.$browser;
|
||||
var action = args.action;
|
||||
// Launch a list view
|
||||
//var $multiple-click=$viewAll.data('multiple-click',false);
|
||||
$viewAll.click(function() {
|
||||
//var $multiple-click=$viewAll.data('multiple-click',false);
|
||||
$viewAll.click(function() {
|
||||
if ($viewAll.data('multiple-click')) return false;
|
||||
//@pranav-handling the multiple clicks by using a flag variable
|
||||
$viewAll.data('multiple-click', true);
|
||||
$browser.cloudBrowser('addPanel', {
|
||||
title: args.title,
|
||||
maximizeIfSelected: true,
|
||||
complete: function($newPanel) {
|
||||
$viewAll.data('multiple-click', false);
|
||||
action({ $panel: $newPanel });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* $viewAll.click(function() {
|
||||
//@pranav-handling the multiple clicks by using a flag variable
|
||||
$viewAll.data('multiple-click', true);
|
||||
$browser.cloudBrowser('addPanel', {
|
||||
// $('.button view-all').data('multiple_click',true),
|
||||
title: args.title,
|
||||
maximizeIfSelected: true,
|
||||
complete: function($newPanel) {
|
||||
$viewAll.data('multiple-click', false);
|
||||
action({ $panel: $newPanel });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
*/
|
||||
|
||||
$viewAll.append($label);
|
||||
|
||||
return $viewAll;
|
||||
@ -142,7 +128,7 @@
|
||||
viewAll: {
|
||||
action: actions.listView('hosts', context)
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
primaryStorage: {
|
||||
label: 'Primary Storage',
|
||||
@ -246,7 +232,7 @@
|
||||
'providers': {
|
||||
label: _l('label.network.service.providers'),
|
||||
ignoreChart: true,
|
||||
dependsOn: 'guest',
|
||||
dependsOn: 'guest',
|
||||
configure: {
|
||||
action: actions.providerListView(targetContext)
|
||||
}
|
||||
@ -258,18 +244,18 @@
|
||||
});
|
||||
|
||||
// Make traffic type elems
|
||||
$.each(trafficTypes, function(id, trafficType) {
|
||||
if ($.inArray(id, validTrafficTypes) == -1) { //if it is not a valid traffic type
|
||||
if(trafficType.dependsOn != null && trafficType.dependsOn.length > 0) { //if it has dependsOn
|
||||
if($.inArray(trafficType.dependsOn, validTrafficTypes) == -1) { //if its dependsOn is not a valid traffic type, either
|
||||
return true; //skip this item
|
||||
}
|
||||
//else, if its dependsOn is a valid traffic type, continue to Make list item (e.g. providers.dependsOn is 'guest')
|
||||
}
|
||||
else {
|
||||
return true; //if it doesn't have dependsOn, skip this item
|
||||
}
|
||||
}
|
||||
$.each(trafficTypes, function(id, trafficType) {
|
||||
if ($.inArray(id, validTrafficTypes) == -1) { //if it is not a valid traffic type
|
||||
if(trafficType.dependsOn != null && trafficType.dependsOn.length > 0) { //if it has dependsOn
|
||||
if($.inArray(trafficType.dependsOn, validTrafficTypes) == -1) { //if its dependsOn is not a valid traffic type, either
|
||||
return true; //skip this item
|
||||
}
|
||||
//else, if its dependsOn is a valid traffic type, continue to Make list item (e.g. providers.dependsOn is 'guest')
|
||||
}
|
||||
else {
|
||||
return true; //if it doesn't have dependsOn, skip this item
|
||||
}
|
||||
}
|
||||
|
||||
// Make list item
|
||||
var $li = $('<li>').addClass(id);
|
||||
@ -285,8 +271,8 @@
|
||||
$li.appendTo($trafficTypes);
|
||||
|
||||
// Make chart
|
||||
if (trafficType.ignoreChart)
|
||||
return true;
|
||||
if (trafficType.ignoreChart)
|
||||
return true;
|
||||
|
||||
var $targetChartItem = $('<div>').addClass('network-chart-item').addClass(id);
|
||||
$targetChartItem.appendTo($networkChart);
|
||||
@ -388,8 +374,8 @@
|
||||
var $totalValue = $('<span>').addClass('total').html(data.total);
|
||||
var $chart = $('<div>').addClass('chart');
|
||||
var $chartLine = $('<div>').addClass('chart-line')
|
||||
.css({ width: '0%' })
|
||||
.animate({ width: data.percent + '%' });
|
||||
.css({ width: '0%' })
|
||||
.animate({ width: data.percent + '%' });
|
||||
var $percent = $('<div>').addClass('percentage');
|
||||
var $percentValue = $('<soan>').addClass('value').html(data.percent);
|
||||
|
||||
@ -407,7 +393,7 @@
|
||||
$percent.append($percentValue, '%')
|
||||
)
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack) {
|
||||
/**
|
||||
@ -58,11 +58,11 @@
|
||||
var $network = $(network);
|
||||
var $guestForm = $wizard.find('form[guest-network-id=' + $network.index() + ']');
|
||||
var trafficTypeConfiguration = {};
|
||||
|
||||
|
||||
$network.find('.traffic-type-draggable').each(function() {
|
||||
var $trafficType = $(this);
|
||||
var trafficTypeID = $trafficType.attr('traffic-type-id');
|
||||
|
||||
|
||||
|
||||
trafficTypeConfiguration[trafficTypeID] = $trafficType.data('traffic-type-data');
|
||||
});
|
||||
@ -83,7 +83,7 @@
|
||||
|
||||
// Traffic type configuration data
|
||||
trafficTypeConfiguration: trafficTypeConfiguration,
|
||||
|
||||
|
||||
guestConfiguration: $guestForm.size() ?
|
||||
cloudStack.serializeForm($guestForm) : null
|
||||
};
|
||||
@ -185,7 +185,7 @@
|
||||
cloudStack.dialog.notice({
|
||||
message: _l('message.configure.all.traffic.types')
|
||||
});
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -379,11 +379,11 @@
|
||||
*/
|
||||
getOriginalTrafficContainer: function($trafficType) {
|
||||
var $dragContainer = physicalNetwork.getMainContainer($trafficType)
|
||||
.find('.traffic-types-drag-area ul > li')
|
||||
.filter(function() {
|
||||
return $(this).hasClass($trafficType.attr('traffic-type-id'));
|
||||
})
|
||||
.find('ul');
|
||||
.find('.traffic-types-drag-area ul > li')
|
||||
.filter(function() {
|
||||
return $(this).hasClass($trafficType.attr('traffic-type-id'));
|
||||
})
|
||||
.find('ul');
|
||||
|
||||
return $dragContainer;
|
||||
},
|
||||
@ -455,7 +455,7 @@
|
||||
var trafficTypeID = $trafficType.attr('traffic-type-id');
|
||||
|
||||
if (!physicalNetwork.isTrafficTypeClone($trafficType) &&
|
||||
$.inArray(trafficTypeID, physicalNetwork.requiredTrafficTypes($wizard)) == -1) {
|
||||
$.inArray(trafficTypeID, physicalNetwork.requiredTrafficTypes($wizard)) == -1) {
|
||||
$trafficType.appendTo($originalContainer);
|
||||
} else {
|
||||
physicalNetwork.assignTrafficType(
|
||||
@ -494,7 +494,7 @@
|
||||
var $mainContainer = physicalNetwork.getMainContainer($containers);
|
||||
var $allPhysicalNetworks = physicalNetwork.getNetworks($mainContainer);
|
||||
var containerTotal = isAdvancedNetwork($containers.closest('.zone-wizard')) ?
|
||||
2 : 1;
|
||||
2 : 1;
|
||||
|
||||
$allPhysicalNetworks.each(function() {
|
||||
var $ul = $(this).find('.drop-container ul');
|
||||
@ -556,8 +556,8 @@
|
||||
var $container = $wizard.find('.setup-physical-network .content.input-area form');
|
||||
var $physicalNetworkItem = $('<div>').addClass('select-container multi');
|
||||
var $deleteButton = $('<div>').addClass('button remove physical-network')
|
||||
.attr({ title: 'Remove this physical network' })
|
||||
.append('<span>').addClass('icon').html(' ');
|
||||
.attr({ title: 'Remove this physical network' })
|
||||
.append('<span>').addClass('icon').html(' ');
|
||||
var $icon = $('<div>').addClass('physical-network-icon');
|
||||
var $nameField = $('<div>').addClass('field name').append(
|
||||
$('<div>').addClass('name').append(
|
||||
@ -595,9 +595,9 @@
|
||||
var trafficTypeID = ui.draggable.attr('traffic-type-id');
|
||||
var $physicalNetwork = $(this).closest('.select-container.multi');
|
||||
var trafficTypeData = ui.draggable.data('traffic-type-data');
|
||||
|
||||
|
||||
if (trafficTypeID == 'guest' &&
|
||||
ui.draggable.closest('.select-container.multi').size()) {
|
||||
ui.draggable.closest('.select-container.multi').size()) {
|
||||
ui.draggable.remove();
|
||||
}
|
||||
|
||||
@ -813,11 +813,11 @@
|
||||
|
||||
var makeMessage = function(message, isError) {
|
||||
var $li = $('<li>')
|
||||
.addClass(!isError ? 'loading' : 'info')
|
||||
.append(
|
||||
$('<span>').addClass('icon').html(' '),
|
||||
$('<span>').addClass('text').html(message)
|
||||
);
|
||||
.addClass(!isError ? 'loading' : 'info')
|
||||
.append(
|
||||
$('<span>').addClass('icon').html(' '),
|
||||
$('<span>').addClass('text').html(message)
|
||||
);
|
||||
var $launchContainer = $launchStep.find('.launch-container');
|
||||
|
||||
$launchStep.find('ul').append($li);
|
||||
@ -976,16 +976,16 @@
|
||||
|
||||
// Custom UI manipulations for specific steps
|
||||
switch($targetStep.attr('zone-wizard-step-id')) {
|
||||
case 'configureGuestTraffic':
|
||||
if (formState['network-model'] == 'Advanced') {
|
||||
guestTraffic.init($wizard, args);
|
||||
} else {
|
||||
guestTraffic.remove($wizard);
|
||||
}
|
||||
break;
|
||||
case 'configureGuestTraffic':
|
||||
if (formState['network-model'] == 'Advanced') {
|
||||
guestTraffic.init($wizard, args);
|
||||
} else {
|
||||
guestTraffic.remove($wizard);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'setupPhysicalNetwork':
|
||||
physicalNetwork.init($wizard);
|
||||
case 'setupPhysicalNetwork':
|
||||
physicalNetwork.init($wizard);
|
||||
}
|
||||
|
||||
if ($uiCustom.size()) {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack) {
|
||||
$.extend(cloudStack, {
|
||||
@ -91,7 +91,7 @@
|
||||
else if (data.treeView)
|
||||
$panel.treeView(data, { context: args.context });
|
||||
else
|
||||
$panel.listView(data, { context: args.context });
|
||||
$panel.listView(data, { context: args.context });
|
||||
}
|
||||
});
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
var $notificationArea = $('<div>').addClass('button notifications')
|
||||
.append(
|
||||
$('<div>').addClass('total')
|
||||
// Total notifications
|
||||
// Total notifications
|
||||
.append($('<span>').html(0))
|
||||
)
|
||||
.append($('<span>').html(_l('label.notifications')))
|
||||
@ -258,16 +258,16 @@
|
||||
.appendTo($container.find('#header'));
|
||||
$(['label.logout', 'label.help']).each(function() {
|
||||
var $link = $('<a>')
|
||||
.attr({ href: '#' })
|
||||
.html(_l(this.toString()))
|
||||
.appendTo($options);
|
||||
.attr({ href: '#' })
|
||||
.html(_l(this.toString()))
|
||||
.appendTo($options);
|
||||
|
||||
if (this == 'label.help') {
|
||||
$link.click(function() {
|
||||
var helpURL = 'http://docs.cloud.com/CloudStack_Documentation';
|
||||
|
||||
window.open(helpURL, '_blank');
|
||||
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
@ -283,14 +283,14 @@
|
||||
|
||||
// Validation
|
||||
$.extend($.validator.messages, { required: _l('label.required') });
|
||||
|
||||
|
||||
$.validator.addMethod(
|
||||
"disallowSpecialCharacters",
|
||||
function(value, element) {
|
||||
return (value.indexOf("<") == -1 && value.indexOf(">") == -1);
|
||||
},
|
||||
"disallowSpecialCharacters",
|
||||
function(value, element) {
|
||||
return (value.indexOf("<") == -1 && value.indexOf(">") == -1);
|
||||
},
|
||||
jQuery.format("Disallowed characters: <, >")
|
||||
);
|
||||
);
|
||||
|
||||
// Check for pending project invitations
|
||||
if (args.projects) {
|
||||
@ -299,7 +299,7 @@
|
||||
response: {
|
||||
success: function(args) {
|
||||
if (!args.data.length) return;
|
||||
|
||||
|
||||
var projectList = $.map(args.data, function(invitation) {
|
||||
return '<li>' + invitation.project + '</li>';
|
||||
}).join('');
|
||||
@ -316,7 +316,7 @@
|
||||
|
||||
// Hide logo conditionally
|
||||
if (!args.hasLogo) $('#header .controls').addClass('nologo');
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack) {
|
||||
cloudStack.dialog = {
|
||||
@ -37,10 +37,10 @@
|
||||
var $form = $('<form>').appendTo($formContainer)
|
||||
.submit(function() {
|
||||
$(this).closest('.ui-dialog').find('button.ok').click();
|
||||
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
var createLabel = _l(args.form.createLabel);
|
||||
var $submit = $('<input>')
|
||||
.attr({
|
||||
@ -56,41 +56,41 @@
|
||||
$(fields).each(function() {
|
||||
var key = this;
|
||||
var field = args.form.fields[key];
|
||||
|
||||
|
||||
var $formItem = $('<div>')
|
||||
.addClass('form-item')
|
||||
.attr({ rel: key });
|
||||
.addClass('form-item')
|
||||
.attr({ rel: key });
|
||||
|
||||
if (field.hidden || field.isHidden) $formItem.hide();
|
||||
|
||||
$formItem.appendTo($form);
|
||||
|
||||
//Handling Escape KeyPress events
|
||||
/* $('.ui-dialog').keypress(function(event) {
|
||||
if ( event.which == 27 ) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$('.ui-dialog').keydown(function(event) {
|
||||
if(event.keyCode == 27)
|
||||
{
|
||||
alert("you pressed the Escape key");
|
||||
event.preventdefault();
|
||||
}
|
||||
})
|
||||
|
||||
//Handling Escape KeyPress events
|
||||
/* $('.ui-dialog').keypress(function(event) {
|
||||
if ( event.which == 27 ) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
$(':ui-dialog').dialog({
|
||||
closeOnEscape: false
|
||||
}); */
|
||||
|
||||
$(document).ready(function(){
|
||||
$('.ui-dialog').keydown(function(event) {
|
||||
if(event.keyCode == 27)
|
||||
{
|
||||
alert("you pressed the Escape key");
|
||||
event.preventdefault();
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$(':ui-dialog').dialog({
|
||||
closeOnEscape: false
|
||||
}); */
|
||||
// Label field
|
||||
var $name = $('<div>').addClass('name')
|
||||
.appendTo($formItem)
|
||||
.append(
|
||||
$('<label>').html(_l(field.label) + ':')
|
||||
);
|
||||
.appendTo($formItem)
|
||||
.append(
|
||||
$('<label>').html(_l(field.label) + ':')
|
||||
);
|
||||
|
||||
// Add 'required asterisk' if field is required
|
||||
if (field.validation && field.validation.required) {
|
||||
@ -104,7 +104,7 @@
|
||||
|
||||
// Input area
|
||||
var $value = $('<div>').addClass('value')
|
||||
.appendTo($formItem);
|
||||
.appendTo($formItem);
|
||||
var $input, $dependsOn, selectFn, selectArgs;
|
||||
var dependsOn = field.dependsOn;
|
||||
|
||||
@ -170,9 +170,9 @@
|
||||
description = this.description;
|
||||
|
||||
var $option = $('<option>')
|
||||
.appendTo($input)
|
||||
.val(_s(id))
|
||||
.html(_s(description));
|
||||
.appendTo($input)
|
||||
.val(_s(id))
|
||||
.html(_s(description));
|
||||
});
|
||||
|
||||
if (field.defaultValue) {
|
||||
@ -274,14 +274,14 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if(field.isTextarea) {
|
||||
$input = $('<textarea>').attr({
|
||||
name: key
|
||||
}).appendTo($value);
|
||||
} else if(field.isTextarea) {
|
||||
$input = $('<textarea>').attr({
|
||||
name: key
|
||||
}).appendTo($value);
|
||||
|
||||
if (field.defaultValue) {
|
||||
$input.val(field.defaultValue);
|
||||
}
|
||||
if (field.defaultValue) {
|
||||
$input.val(field.defaultValue);
|
||||
}
|
||||
} else {
|
||||
// Text field
|
||||
if (field.range) {
|
||||
@ -311,8 +311,8 @@
|
||||
if (field.defaultValue) {
|
||||
$input.val(field.defaultValue);
|
||||
}
|
||||
}
|
||||
$input.addClass("disallowSpecialCharacters");
|
||||
}
|
||||
$input.addClass("disallowSpecialCharacters");
|
||||
}
|
||||
|
||||
$input.data('validation-rules', field.validation);
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack) {
|
||||
cloudStack.ui.event = {
|
||||
|
||||
@ -8,13 +8,13 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack) {
|
||||
// General utils
|
||||
cloudStack.serializeForm = function($form, options) {
|
||||
if (!options) options = {};
|
||||
|
||||
|
||||
var data = {};
|
||||
|
||||
$($form.serializeArray()).each(function() {
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
$container.find(itemSelector).each(function() {
|
||||
var $elem = $(this);
|
||||
|
||||
|
||||
if (even) {
|
||||
even = false;
|
||||
args.odd($elem);
|
||||
@ -69,26 +69,26 @@
|
||||
|
||||
/**
|
||||
* Sanitize user input (HTML Encoding) -- shortcut _s
|
||||
*
|
||||
*
|
||||
* Strip unwanted characters from user-based input
|
||||
*/
|
||||
cloudStack.sanitize = window._s = function(value) {
|
||||
if(typeof(value) == "number") {
|
||||
//alert("number does not need to be sanitized. Only string needs to be sanitized.");
|
||||
return value;
|
||||
}
|
||||
else if(typeof(value) == "boolean") {
|
||||
//alert("boolean does not need to be sanitized. Only string needs to be sanitized.");
|
||||
return value;
|
||||
}
|
||||
else if(typeof(value) == "object") {
|
||||
//alert("object cant not be sanitized. Only string can be sanitized.");
|
||||
return value;
|
||||
}
|
||||
else if(typeof(value) == null || typeof(value) == "undefined") {
|
||||
return '';
|
||||
}
|
||||
|
||||
if(typeof(value) == "number") {
|
||||
//alert("number does not need to be sanitized. Only string needs to be sanitized.");
|
||||
return value;
|
||||
}
|
||||
else if(typeof(value) == "boolean") {
|
||||
//alert("boolean does not need to be sanitized. Only string needs to be sanitized.");
|
||||
return value;
|
||||
}
|
||||
else if(typeof(value) == "object") {
|
||||
//alert("object cant not be sanitized. Only string can be sanitized.");
|
||||
return value;
|
||||
}
|
||||
else if(typeof(value) == null || typeof(value) == "undefined") {
|
||||
return '';
|
||||
}
|
||||
|
||||
var sanitized = value
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
@ -96,11 +96,11 @@
|
||||
|
||||
return sanitized;
|
||||
};
|
||||
|
||||
/**
|
||||
* Reverse sanitization (HTML Decoding)
|
||||
|
||||
/**
|
||||
* Reverse sanitization (HTML Decoding)
|
||||
*/
|
||||
cloudStack.sanitizeReverse = function(value) {
|
||||
cloudStack.sanitizeReverse = function(value) {
|
||||
var reversedValue = value
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
@ -108,5 +108,5 @@
|
||||
|
||||
return reversedValue;
|
||||
};
|
||||
|
||||
|
||||
})(jQuery, cloudStack);
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack) {
|
||||
cloudStack.ui.widgets.browser = {};
|
||||
@ -128,7 +128,7 @@
|
||||
width: function($container, options) {
|
||||
options = options ? options : {};
|
||||
var width = $container.find('div.panel').size() < 1 || options.maximized == true ?
|
||||
$container.width() : $container.width() - $container.width() / 4;
|
||||
$container.width() : $container.width() - $container.width() / 4;
|
||||
|
||||
return width;
|
||||
},
|
||||
@ -248,10 +248,10 @@
|
||||
duration: 500,
|
||||
complete: function() {
|
||||
$(this).remove();
|
||||
|
||||
|
||||
if (complete) complete($toShow);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
$toShow.show();
|
||||
$panel.animate({
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($) {
|
||||
/**
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack, _l) {
|
||||
var replaceListViewItem = function($detailView, newData) {
|
||||
@ -20,20 +20,20 @@
|
||||
var $newRow;
|
||||
var jsonObj = $row.data('json-obj');
|
||||
|
||||
if($listView.length > 0 ) { //$listView.length is 0 after calling $(window).trigger('cloudStack.fullRefresh')
|
||||
$listView.listView('replaceItem', {
|
||||
$row: $row,
|
||||
data: $.extend(jsonObj, newData),
|
||||
after: function($newRow) {
|
||||
$detailView.data('list-view-row', $newRow);
|
||||
if($listView.length > 0 ) { //$listView.length is 0 after calling $(window).trigger('cloudStack.fullRefresh')
|
||||
$listView.listView('replaceItem', {
|
||||
$row: $row,
|
||||
data: $.extend(jsonObj, newData),
|
||||
after: function($newRow) {
|
||||
$detailView.data('list-view-row', $newRow);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.data-table').dataTable('selectRow', $newRow.index());
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
setTimeout(function() {
|
||||
$('.data-table').dataTable('selectRow', $newRow.index());
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Refresh detail view context
|
||||
$.extend(
|
||||
$detailView.data('view-args').context[
|
||||
@ -157,7 +157,7 @@
|
||||
// Setup notification
|
||||
cloudStack.ui.notifications.add(
|
||||
notification,
|
||||
function(args2) { //name parameter as "args2" instead of "args" to avoid override "args" from success: function(args) {
|
||||
function(args2) { //name parameter as "args2" instead of "args" to avoid override "args" from success: function(args) {
|
||||
if ($detailView.is(':visible')) {
|
||||
$loading.remove();
|
||||
|
||||
@ -188,12 +188,12 @@
|
||||
|
||||
return true;
|
||||
},
|
||||
error: function(args) { //args here is parsed errortext from API response
|
||||
if(args != null & args.length > 0) {
|
||||
cloudStack.dialog.notice({
|
||||
message: args
|
||||
});
|
||||
}
|
||||
error: function(args) { //args here is parsed errortext from API response
|
||||
if(args != null & args.length > 0) {
|
||||
cloudStack.dialog.notice({
|
||||
message: args
|
||||
});
|
||||
}
|
||||
$loading.remove();
|
||||
}
|
||||
}
|
||||
@ -237,7 +237,7 @@
|
||||
} else {
|
||||
performAction({ id: id });
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
cloudStack.dialog.createForm({
|
||||
form: action.createForm,
|
||||
after: function(args) {
|
||||
@ -268,10 +268,10 @@
|
||||
panel: $panel.prev()
|
||||
});
|
||||
}
|
||||
|
||||
if($detailView.data("list-view-row") != null) {
|
||||
$detailView.data("list-view-row").remove();
|
||||
}
|
||||
|
||||
if($detailView.data("list-view-row") != null) {
|
||||
$detailView.data("list-view-row").remove();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -295,7 +295,7 @@
|
||||
// Show buttons
|
||||
$.merge($editButton, $cancelButton)
|
||||
.appendTo(
|
||||
$detailView.find('.ui-tabs-panel .detail-group.actions')
|
||||
$detailView.find('.ui-tabs-panel .detail-group.actions')
|
||||
).fadeIn();
|
||||
|
||||
var convertInputs = function($inputs) {
|
||||
@ -310,7 +310,7 @@
|
||||
));
|
||||
else if ($input.is('input[type=checkbox]')) {
|
||||
var val = $input.is(':checked');
|
||||
|
||||
|
||||
$value.data('detail-view-boolean-value', _s(val));
|
||||
$value.html(_s(val) ? _l('label.yes') : _l('label.no'));
|
||||
}
|
||||
@ -331,11 +331,11 @@
|
||||
var originalValue = $input.data('original-value');
|
||||
|
||||
$value.html(_s(originalValue));
|
||||
});
|
||||
});
|
||||
|
||||
$editButton.fadeOut('fast', function() {
|
||||
$editButton.remove();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var applyEdits = function($inputs, $editButton) {
|
||||
@ -349,7 +349,7 @@
|
||||
if ($input.is('[type=checkbox]')) {
|
||||
data[$input.attr('name')] = $input.is(':checked') ? 'on' : null;
|
||||
} else {
|
||||
data[$input.attr('name')] = $input.val();
|
||||
data[$input.attr('name')] = $input.val();
|
||||
}
|
||||
});
|
||||
|
||||
@ -815,7 +815,7 @@
|
||||
jsonObj: jsonObj,
|
||||
context: args.context,
|
||||
response: {
|
||||
success: function(args) {
|
||||
success: function(args) {
|
||||
if (options.newData) {
|
||||
$.extend(args.data, options.newData);
|
||||
}
|
||||
@ -825,7 +825,7 @@
|
||||
}
|
||||
var tabData = $tabContent.data('detail-view-tab-data');
|
||||
var data = args.data;
|
||||
|
||||
|
||||
var isFirstPanel = $tabContent.index($detailView.find('div.detail-group.ui-tabs-panel')) == 0;
|
||||
var actionFilter = args.actionFilter;
|
||||
|
||||
@ -871,8 +871,8 @@
|
||||
var tabFilter = options.tabFilter;
|
||||
var context = options.context ? options.context : {};
|
||||
|
||||
if(options.newData &&
|
||||
($detailView.data('view-args').section != null && context[$detailView.data('view-args').section] != null && context[$detailView.data('view-args').section].length > 0)) {
|
||||
if(options.newData &&
|
||||
($detailView.data('view-args').section != null && context[$detailView.data('view-args').section] != null && context[$detailView.data('view-args').section].length > 0)) {
|
||||
$.extend(
|
||||
context[$detailView.data('view-args').section][0],
|
||||
options.newData
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
/**
|
||||
* Create dynamic list view based on data callbacks
|
||||
@ -148,7 +148,7 @@
|
||||
if (!args) args = {};
|
||||
|
||||
var actionFilter = args.actionFilter ?
|
||||
args.actionFilter : $instanceRow.data('list-view-action-filter');
|
||||
args.actionFilter : $instanceRow.data('list-view-action-filter');
|
||||
|
||||
if (!isHeader) {
|
||||
if ($instanceRow.is(':visible')) {
|
||||
@ -198,7 +198,7 @@
|
||||
$instanceRow.data('list-view-action-filter')
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (options.error) {
|
||||
options.error(args);
|
||||
@ -210,7 +210,7 @@
|
||||
if (!isHeader) {
|
||||
if (($.isPlainObject(args.action.createForm) && args.action.addRow != 'false') ||
|
||||
(!args.action.createForm && args.action.addRow == 'true')) {
|
||||
$instanceRow.remove();
|
||||
$instanceRow.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@ -341,15 +341,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
remove: function($instanceRow, args) {
|
||||
uiActions.standard($instanceRow, args, {
|
||||
complete: function(args, $newRow) {
|
||||
$newRow.remove();
|
||||
|
||||
remove: function($instanceRow, args) {
|
||||
uiActions.standard($instanceRow, args, {
|
||||
complete: function(args, $newRow) {
|
||||
$newRow.remove();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
edit: function($instanceRow, args) {
|
||||
var $td = $instanceRow.find('td.editable');
|
||||
var $edit = $td.find('div.edit');
|
||||
@ -373,8 +373,8 @@
|
||||
if (!options) options = {};
|
||||
|
||||
var oldVal = $label.html();
|
||||
|
||||
if(val != null )
|
||||
|
||||
if(val != null )
|
||||
$label.html(_s(val));
|
||||
|
||||
var data = {
|
||||
@ -413,16 +413,16 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
if (args.cancel) { //click Cancel button
|
||||
showLabel();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$editInput.is(':visible') || !(typeof(args.action) == 'undefined')) { //click Edit button
|
||||
|
||||
if (!$editInput.is(':visible') || !(typeof(args.action) == 'undefined')) { //click Edit button
|
||||
showEditField();
|
||||
}
|
||||
else if ($editInput.val() != $label.html()) { //click Save button with changed value
|
||||
}
|
||||
else if ($editInput.val() != $label.html()) { //click Save button with changed value
|
||||
$edit.animate({ opacity: 0.5 });
|
||||
|
||||
var originalName = $label.html();
|
||||
@ -445,8 +445,8 @@
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
else { //click Save button with unchanged value
|
||||
}
|
||||
else { //click Save button with unchanged value
|
||||
showLabel();
|
||||
}
|
||||
|
||||
@ -519,7 +519,7 @@
|
||||
$td.addClass('editable');
|
||||
|
||||
// Put <td> label into a span
|
||||
var sanitizedValue = $td.html();
|
||||
var sanitizedValue = $td.html();
|
||||
$('<span></span>').html(sanitizedValue).appendTo($td.html(''));
|
||||
|
||||
var $editArea = $('<div></div>').addClass('edit');
|
||||
@ -557,13 +557,13 @@
|
||||
var $thead = $('<thead>').prependTo($table).append($('<tr>'));
|
||||
var reorder = options.reorder;
|
||||
|
||||
var hiddenFields = [];
|
||||
if(preFilter != null)
|
||||
hiddenFields = preFilter();
|
||||
|
||||
$.each(fields, function(key) {
|
||||
if($.inArray(key, hiddenFields) != -1)
|
||||
return true;
|
||||
var hiddenFields = [];
|
||||
if(preFilter != null)
|
||||
hiddenFields = preFilter();
|
||||
|
||||
$.each(fields, function(key) {
|
||||
if($.inArray(key, hiddenFields) != -1)
|
||||
return true;
|
||||
var field = this;
|
||||
var $th = $('<th>').addClass(key).appendTo($thead.find('tr'));
|
||||
|
||||
@ -598,10 +598,10 @@
|
||||
var $filterSelect = $('<select id="filterBy"></select>').appendTo($filters);
|
||||
|
||||
if (filters)
|
||||
$.each(filters, function(key) {
|
||||
if(this.preFilter != null && this.preFilter() == false) {
|
||||
return true; //skip to next item in each loop
|
||||
}
|
||||
$.each(filters, function(key) {
|
||||
if(this.preFilter != null && this.preFilter() == false) {
|
||||
return true; //skip to next item in each loop
|
||||
}
|
||||
var $option = $('<option>').attr({
|
||||
value: key
|
||||
}).html(_l(this.label));
|
||||
@ -766,14 +766,14 @@
|
||||
}
|
||||
|
||||
var hiddenFields = [];
|
||||
if(preFilter != null)
|
||||
hiddenFields = preFilter();
|
||||
|
||||
if(preFilter != null)
|
||||
hiddenFields = preFilter();
|
||||
|
||||
// Add field data
|
||||
$.each(fields, function(key) {
|
||||
if($.inArray(key, hiddenFields) != -1)
|
||||
return true;
|
||||
var field = this;
|
||||
$.each(fields, function(key) {
|
||||
if($.inArray(key, hiddenFields) != -1)
|
||||
return true;
|
||||
var field = this;
|
||||
var $td = $('<td>')
|
||||
.addClass(key)
|
||||
.data('list-view-item-field', key)
|
||||
@ -791,12 +791,12 @@
|
||||
if (field.converter) {
|
||||
content = _l(field.converter(content, dataItem));
|
||||
}
|
||||
|
||||
if (field.editable) {
|
||||
$td.html(_s(content));
|
||||
createEditField($td).appendTo($td);
|
||||
}
|
||||
else {
|
||||
|
||||
if (field.editable) {
|
||||
$td.html(_s(content));
|
||||
createEditField($td).appendTo($td);
|
||||
}
|
||||
else {
|
||||
$td.html('');
|
||||
$td.append(
|
||||
$('<span></span>').html(_s(content))
|
||||
@ -818,7 +818,7 @@
|
||||
var rowIndex = $tr.closest('tbody').find('tr').size() - ($tr.index());
|
||||
|
||||
context[viewArgs.activeSection] = $tr.data('json-obj');
|
||||
|
||||
|
||||
action.action({
|
||||
context: context,
|
||||
index: rowIndex,
|
||||
@ -978,7 +978,7 @@
|
||||
response: {
|
||||
success: function(args) {
|
||||
setLoadingArgs.loadingCompleted();
|
||||
|
||||
|
||||
addTableRows(preFilter, fields, args.data, $tbody, actions, {
|
||||
actionFilter: args.actionFilter,
|
||||
context: context,
|
||||
@ -991,7 +991,7 @@
|
||||
});
|
||||
},
|
||||
error: function(args) {
|
||||
setLoadingArgs.loadingCompleted();
|
||||
setLoadingArgs.loadingCompleted();
|
||||
addTableRows(preFilter, fields, [], $tbody, actions);
|
||||
$table.find('td:first').html(_l('ERROR'));
|
||||
$table.dataTable(null, { noSelect: uiCustom });
|
||||
@ -1142,11 +1142,11 @@
|
||||
|
||||
if (listViewData.actions && listViewData.actions.add) {
|
||||
var showAdd = listViewData.actions.add.preFilter ?
|
||||
listViewData.actions.add.preFilter({
|
||||
context: listViewData.context ?
|
||||
listViewData.context : cloudStack.context
|
||||
}) : true;
|
||||
|
||||
listViewData.actions.add.preFilter({
|
||||
context: listViewData.context ?
|
||||
listViewData.context : cloudStack.context
|
||||
}) : true;
|
||||
|
||||
if (showAdd) {
|
||||
$toolbar
|
||||
.append(
|
||||
@ -1156,7 +1156,7 @@
|
||||
.append(
|
||||
$('<span>').html(_l(listViewData.actions.add.label))
|
||||
)
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1185,13 +1185,13 @@
|
||||
$('<tbody>').appendTo($table);
|
||||
|
||||
createHeader(listViewData.preFilter,
|
||||
listViewData.fields,
|
||||
listViewData.fields,
|
||||
$table,
|
||||
listViewData.actions,
|
||||
{ reorder: reorder });
|
||||
createFilters($toolbar, listViewData.filters);
|
||||
createSearchBar($toolbar);
|
||||
|
||||
|
||||
loadBody(
|
||||
$table,
|
||||
listViewData.dataProvider,
|
||||
@ -1240,9 +1240,9 @@
|
||||
return true;
|
||||
});
|
||||
|
||||
var search = function() {
|
||||
var search = function() {
|
||||
loadBody(
|
||||
$table,
|
||||
$table,
|
||||
listViewData.dataProvider,
|
||||
listViewData.preFilter,
|
||||
listViewData.fields,
|
||||
@ -1337,9 +1337,9 @@
|
||||
|
||||
// Click on first item will trigger detail view (if present)
|
||||
if (detailViewPresent && !uiCustom && !$target.closest('.empty, .loading').size()) {
|
||||
var $loading = $('<div>').addClass('loading-overlay');
|
||||
var $loading = $('<div>').addClass('loading-overlay');
|
||||
$target.closest('div.data-table').prepend($loading); //overlay the whole listView, so users can't click another row until click-handling for this row is done (e.g. API response is back)
|
||||
|
||||
|
||||
listViewData.detailView.$browser = args.$browser;
|
||||
detailViewArgs = {
|
||||
$panel: $target.closest('div.panel'),
|
||||
@ -1376,13 +1376,13 @@
|
||||
}
|
||||
|
||||
createDetailView(
|
||||
detailViewArgs,
|
||||
function($detailView) { //complete(), callback funcion
|
||||
$detailView.data('list-view', $listView);
|
||||
$loading.remove();
|
||||
},
|
||||
$target.closest('tr')
|
||||
);
|
||||
detailViewArgs,
|
||||
function($detailView) { //complete(), callback funcion
|
||||
$detailView.data('list-view', $listView);
|
||||
$loading.remove();
|
||||
},
|
||||
$target.closest('tr')
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack) {
|
||||
var _medit = cloudStack.ui.widgets.multiEdit = {
|
||||
@ -21,7 +21,7 @@
|
||||
var $tr;
|
||||
var $item = $('<div>').addClass('data-item');
|
||||
var multiRule = data;
|
||||
|
||||
|
||||
$item.append($('<table>').append($('<tbody>')));
|
||||
$tr = $('<tr>').appendTo($item.find('tbody'));
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
var $loading = $('<div>').addClass('loading-overlay');
|
||||
var complete = function(args) {
|
||||
var $tbody = $item.find('.expandable-listing tbody');
|
||||
|
||||
|
||||
$loading.remove();
|
||||
$(data).each(function() {
|
||||
var item = this;
|
||||
@ -51,7 +51,7 @@
|
||||
|
||||
$itemRow.appendTo($tbody);
|
||||
newItemRows.push($itemRow);
|
||||
|
||||
|
||||
cloudStack.evenOdd($tbody, 'tr:visible', {
|
||||
even: function($elem) {
|
||||
$elem.removeClass('odd');
|
||||
@ -67,7 +67,7 @@
|
||||
var error = function() {
|
||||
$(newItemRows).each(function() {
|
||||
var $itemRow = this;
|
||||
|
||||
|
||||
$itemRow.remove();
|
||||
});
|
||||
$loading.remove();
|
||||
@ -83,7 +83,7 @@
|
||||
var notificationError = function(args) {
|
||||
error();
|
||||
};
|
||||
|
||||
|
||||
cloudStack.ui.notifications.add(args.notification,
|
||||
complete, {},
|
||||
notificationError, {});
|
||||
@ -94,7 +94,7 @@
|
||||
};
|
||||
|
||||
if (!itemData) itemData = [{}];
|
||||
|
||||
|
||||
if ($multi.find('th,td').filter(function() {
|
||||
return $(this).attr('rel') == fieldName;
|
||||
}).is(':hidden')) return true;
|
||||
@ -109,7 +109,7 @@
|
||||
$td.append($('<span>').html(start + ' - ' + end));
|
||||
} else {
|
||||
var maxLengths = data['_maxLength'];
|
||||
|
||||
|
||||
if (maxLengths &&
|
||||
maxLengths[fieldName] &&
|
||||
data[fieldName].length >= maxLengths[fieldName]) {
|
||||
@ -128,7 +128,7 @@
|
||||
return $(this).val() == data[fieldName];
|
||||
}).html())));
|
||||
} else if (field.addButton && !options.noSelect) {
|
||||
if (options.multipleAdd) {
|
||||
if (options.multipleAdd) {
|
||||
$addButton.click(function() {
|
||||
_medit.vmList($multi,
|
||||
options.listView,
|
||||
@ -141,8 +141,8 @@
|
||||
});
|
||||
$td.append($addButton);
|
||||
} else {
|
||||
// Show VM data
|
||||
var itemName = data._itemName ? itemData[0][data._itemName] : itemData[0].name;
|
||||
// Show VM data
|
||||
var itemName = data._itemName ? itemData[0][data._itemName] : itemData[0].name;
|
||||
$td.html(options.multipleAdd ?
|
||||
itemData.length + ' VMs' : itemName);
|
||||
$td.click(function() {
|
||||
@ -159,13 +159,13 @@
|
||||
}
|
||||
} else if (field.custom) {
|
||||
var $button = $('<div>').addClass('button add-vm custom-action');
|
||||
|
||||
$td.data('multi-custom-data', data[fieldName]);
|
||||
|
||||
$td.data('multi-custom-data', data[fieldName]);
|
||||
$button.html(data && data[fieldName] && data[fieldName]['_buttonLabel'] ?
|
||||
_l(data[fieldName]['_buttonLabel']) : _l(field.custom.buttonLabel));
|
||||
$button.click(function() {
|
||||
var $button = $(this);
|
||||
|
||||
|
||||
field.custom.action({
|
||||
context: options.context ? options.context : cloudStack.context,
|
||||
data: $td.data('multi-custom-data'),
|
||||
@ -222,7 +222,7 @@
|
||||
.click(function() {
|
||||
var performAction = function(actionOptions) {
|
||||
if (!actionOptions) actionOptions = {};
|
||||
|
||||
|
||||
action.action({
|
||||
context: $.extend(true, {}, options.context, {
|
||||
multiRule: [data]
|
||||
@ -281,7 +281,7 @@
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
var $target = $(this);
|
||||
var $dataItem = $target.closest('.data-item');
|
||||
var $expandable = $dataItem.find('.expandable-listing');
|
||||
@ -339,7 +339,7 @@
|
||||
_medit.multiItem.expandable($item.find('tr').data('multi-edit-data'),
|
||||
options.itemActions,
|
||||
multiRule).appendTo($item);
|
||||
|
||||
|
||||
// Expandable icon/action
|
||||
$item.find('td:first').prepend(
|
||||
$('<div>').addClass('expand').click(function() {
|
||||
@ -352,7 +352,7 @@
|
||||
|
||||
vmList: function($multi, listView, context, isMultipleAdd, label, complete, options) {
|
||||
if (!options) options = {};
|
||||
|
||||
|
||||
// Create a listing of instances, based on limited information
|
||||
// from main instances list view
|
||||
var $listView;
|
||||
@ -552,7 +552,7 @@
|
||||
|
||||
$.each(itemActions, function(itemActionID, itemAction) {
|
||||
if (itemActionID == 'add') return true;
|
||||
|
||||
|
||||
var $itemAction = $('<div>').addClass('action').addClass(itemActionID);
|
||||
|
||||
$itemAction.click(function() {
|
||||
@ -631,7 +631,7 @@
|
||||
odd: function($elem) {
|
||||
$elem.addClass('odd');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
return $expandable.hide();
|
||||
@ -679,7 +679,7 @@
|
||||
|
||||
if (field.select) {
|
||||
var $select = $('<select>');
|
||||
|
||||
|
||||
$select.attr({
|
||||
name: fieldName
|
||||
});
|
||||
@ -705,27 +705,27 @@
|
||||
|
||||
$(field.range).each(function() {
|
||||
var $input = $('<input>')
|
||||
.attr({
|
||||
name: this,
|
||||
type: 'text'
|
||||
})
|
||||
.addClass(!field.isOptional ? 'required' : null)
|
||||
.attr('disabled', field.isDisabled ? 'disabled' : false)
|
||||
.appendTo(
|
||||
$('<div>').addClass('range-item').appendTo($range)
|
||||
);
|
||||
.attr({
|
||||
name: this,
|
||||
type: 'text'
|
||||
})
|
||||
.addClass(!field.isOptional ? 'required' : null)
|
||||
.attr('disabled', field.isDisabled ? 'disabled' : false)
|
||||
.appendTo(
|
||||
$('<div>').addClass('range-item').appendTo($range)
|
||||
);
|
||||
|
||||
if (field.isDisabled) $input.hide();
|
||||
});
|
||||
} else {
|
||||
var $input = $('<input>')
|
||||
.attr({
|
||||
name: fieldName,
|
||||
type: field.isPassword ? 'password' : 'text'
|
||||
})
|
||||
.addClass(!field.isOptional ? 'required' : null)
|
||||
.attr('disabled', field.isDisabled ? 'disabled' : false)
|
||||
.appendTo($td);
|
||||
.attr({
|
||||
name: fieldName,
|
||||
type: field.isPassword ? 'password' : 'text'
|
||||
})
|
||||
.addClass(!field.isOptional ? 'required' : null)
|
||||
.attr('disabled', field.isDisabled ? 'disabled' : false)
|
||||
.appendTo($td);
|
||||
|
||||
if (field.isDisabled) $input.hide();
|
||||
}
|
||||
@ -874,7 +874,7 @@
|
||||
$(args.data).each(function() {
|
||||
var data = this;
|
||||
var itemData = this._itemData;
|
||||
|
||||
|
||||
_medit.addItem(
|
||||
data,
|
||||
fields,
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack, _l) {
|
||||
/**
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($) {
|
||||
/**
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
// Events
|
||||
$overlay.click(function(event) {
|
||||
if (!args || !args.closeAction) return false;
|
||||
if (!args || !args.closeAction) return false;
|
||||
|
||||
args.closeAction();
|
||||
$overlay.fadeOut(function() {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
//
|
||||
// Automatically generated by addcopyright.py at 04/03/2012
|
||||
(function($, cloudStack, _s) {
|
||||
/**
|
||||
@ -37,7 +37,7 @@
|
||||
)
|
||||
.appendTo($treeList);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -98,7 +98,7 @@
|
||||
dataProvider: treeViewArgs.dataProvider
|
||||
}).appendTo($li);
|
||||
$li.addClass('expanded');
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@
|
||||
$li.animate({ opacity: 0.5 });
|
||||
$li.bind('click', function() { return false; });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user