Commit 90b2b09f by Dányi Bence

webui: cloud.js autoformat

parent 951af651
...@@ -84,16 +84,17 @@ $(function() { ...@@ -84,16 +84,17 @@ $(function() {
$('#new-folder').click(function() { $('#new-folder').click(function() {
$('#new-folder-form input')[0].focus(); $('#new-folder-form input')[0].focus();
}); });
$('#new-group').click(function(){ $('#new-group').click(function() {
var content=$('#new-group-wizard').html(); var content = $('#new-group-wizard').html();
$('#new-group-wizard').parent()[0].removeChild($('#new-group-wizard')[0]); $('#new-group-wizard').parent()[0].removeChild($('#new-group-wizard')[0]);
$('#modal').show(); $('#modal').show();
$('#modal-container').html(content); $('#modal-container').html(content);
function updateSummary(){
function updateSummary() {
$('#new-group-summary-name').html($('#new-group-name').val()); $('#new-group-summary-name').html($('#new-group-name').val());
$('#new-group-summary-count').html(function(text){ $('#new-group-summary-count').html(function(text) {
var m=text.match(/\s*[a-z][0-9a-z]{5}\s*(\r|\n|$)+/gi); var m = text.match(/\s*[a-z][0-9a-z]{5}\s*(\r|\n|$)+/gi);
return m?m.length:0; return m ? m.length : 0;
}($('#new-group-members').val())); }($('#new-group-members').val()));
$('#new-group-summary-semester').html($('#new-group-semester')[0].options[$('#new-group-semester')[0].selectedIndex].innerHTML) $('#new-group-summary-semester').html($('#new-group-semester')[0].options[$('#new-group-semester')[0].selectedIndex].innerHTML)
} }
...@@ -110,6 +111,7 @@ $(function() { ...@@ -110,6 +111,7 @@ $(function() {
/** /**
* Manage VM State (STOP) * Manage VM State (STOP)
*/ */
function stop_vm(id, name) { function stop_vm(id, name) {
confirm_message = interpolate(gettext("Are you sure stopping %s?"), [name]) confirm_message = interpolate(gettext("Are you sure stopping %s?"), [name])
if (vm_confirm_popup(confirm_message, gettext("Stop"))) { if (vm_confirm_popup(confirm_message, gettext("Stop"))) {
...@@ -119,6 +121,7 @@ $(function() { ...@@ -119,6 +121,7 @@ $(function() {
/** /**
* Manage VM State (DELETE) * Manage VM State (DELETE)
*/ */
function delete_vm(id, name) { function delete_vm(id, name) {
confirm_message = interpolate(gettext("Are you sure deleting %s?"), [name]) confirm_message = interpolate(gettext("Are you sure deleting %s?"), [name])
if (vm_confirm_popup(confirm_message, gettext("Delete"))) { if (vm_confirm_popup(confirm_message, gettext("Delete"))) {
...@@ -128,6 +131,7 @@ $(function() { ...@@ -128,6 +131,7 @@ $(function() {
/** /**
* Manage VM State (RESET) * Manage VM State (RESET)
*/ */
function restart_vm(id, name) { function restart_vm(id, name) {
confirm_message = interpolate(gettext("Are you sure restarting %s?"), [name]) confirm_message = interpolate(gettext("Are you sure restarting %s?"), [name])
if (vm_confirm_popup(confirm_message, gettext("Restart"))) { if (vm_confirm_popup(confirm_message, gettext("Restart"))) {
...@@ -137,22 +141,23 @@ $(function() { ...@@ -137,22 +141,23 @@ $(function() {
/** /**
* Manage VM State (RESUME) * Manage VM State (RESUME)
*/ */
function resume_vm(id, name) { function resume_vm(id, name) {
manage_vm(id, "resume") manage_vm(id, "resume")
} }
/** /**
* Manage VM State generic * Manage VM State generic
*/ */
function manage_vm(id, state) { function manage_vm(id, state) {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
data: '', data: '',
url: '/vm/'+state+'/'+id+'/', url: '/vm/' + state + '/' + id + '/',
success: function(data) { success: function(data) {}
}
}) })
} }
$('#new-member').click(function(){ $('#new-member').click(function() {
$('#new-member-form').toggle(); $('#new-member-form').toggle();
}) })
...@@ -416,8 +421,8 @@ $(function() { ...@@ -416,8 +421,8 @@ $(function() {
* Downloads the specified file (or folder zipped) * Downloads the specified file (or folder zipped)
*/ */
self.download = function(item) { self.download = function(item) {
if(window.navigator.userAgent.indexOf('cloud-gui')>-1){ if(window.navigator.userAgent.indexOf('cloud-gui') > -1) {
window.location.href = 'cloudfile:'+self.currentPath() + item.originalName; window.location.href = 'cloudfile:' + self.currentPath() + item.originalName;
return; return;
} }
$.ajax({ $.ajax({
...@@ -478,7 +483,7 @@ $(function() { ...@@ -478,7 +483,7 @@ $(function() {
//$(e.target).parent().parent().parent().unbind('click'); //$(e.target).parent().parent().parent().unbind('click');
$(e.target).parent().parent().parent().find('.name').html('<input type="text" value="' + item.originalName + '" />\ $(e.target).parent().parent().parent().find('.name').html('<input type="text" value="' + item.originalName + '" />\
<input type="submit" value="Átnevezés" />'); <input type="submit" value="Átnevezés" />');
$(e.target).parent().parent().parent().find('.name input').click(function(f){ $(e.target).parent().parent().parent().find('.name input').click(function(f) {
f.stopPropagation(); f.stopPropagation();
}) })
$(e.target).parent().parent().parent().find('.name input[type=submit]').click(function(e) { $(e.target).parent().parent().parent().find('.name input[type=submit]').click(function(e) {
...@@ -490,7 +495,7 @@ $(function() { ...@@ -490,7 +495,7 @@ $(function() {
url: '/ajax/store/rename', url: '/ajax/store/rename',
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
loadFolder(self.currentPath(),true); loadFolder(self.currentPath(), true);
} }
}) })
return false; return false;
...@@ -525,7 +530,7 @@ $(function() { ...@@ -525,7 +530,7 @@ $(function() {
url: '/ajax/store/newFolder', url: '/ajax/store/newFolder',
dataType: 'json', dataType: 'json',
success: function(data) { success: function(data) {
loadFolder(self.currentPath(),true); loadFolder(self.currentPath(), true);
} }
}) })
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment