From 1ce278672c2b4739ed0d1dd14d18f7c265daed62 Mon Sep 17 00:00:00 2001 From: bergware Date: Wed, 7 Mar 2018 20:53:32 +0100 Subject: [PATCH] Right, file was moved to the wrong foler --- .../javascript/dynamix.vm.manager.js | 229 ------------------ 1 file changed, 229 deletions(-) delete mode 100644 plugins/dynamix.docker.manager/javascript/dynamix.vm.manager.js diff --git a/plugins/dynamix.docker.manager/javascript/dynamix.vm.manager.js b/plugins/dynamix.docker.manager/javascript/dynamix.vm.manager.js deleted file mode 100644 index a1092bb60..000000000 --- a/plugins/dynamix.docker.manager/javascript/dynamix.vm.manager.js +++ /dev/null @@ -1,229 +0,0 @@ -function clearHistory(){ - window.history.pushState('VMs', 'Title', '/VMs'); -} - -function ordinal_suffix_of(i) { - var j = i % 10, - k = i % 100; - if (j == 1 && k != 11) { - return i + "st"; - } - if (j == 2 && k != 12) { - return i + "nd"; - } - if (j == 3 && k != 13) { - return i + "rd"; - } - return i + "th"; -} - -function slideUpRows($tr, onComplete) { - $tr.not('tr,table').finish().fadeOut('fast'); - - $tr.filter('tr').find('td').finish().each(function(){ - $(this) - .data("paddingstate", $(this).css(["paddingTop", "paddingBottom"])) - .animate({ paddingTop: 0, paddingBottom: 0 }, { duration: 'fast' }) - .wrapInner('
') - .children() - .slideUp("fast", function() { - $(this).contents().unwrap(); - $tr.filter('tr').hide(); - if ($.isFunction(onComplete)) { - onComplete(); - } - }); - }); - - $tr.filter('table').finish().each(function(){ - $(this) - .wrap('
') - .parent() - .slideUp("fast", function() { - $(this).contents().unwrap(); - $tr.filter('table').hide(); - if ($.isFunction(onComplete)) { - onComplete(); - } - }); - }); - - return $tr; -} - -function slideDownRows($tr, onComplete) { - $tr.filter(':hidden').not('tr,table').finish().fadeIn('fast'); - - $tr.filter('tr:hidden').find('td').finish().each(function(){ - $(this) - .wrapInner('
') - .animate($(this).data("paddingstate"), { duration: 'fast', start: function() { $tr.filter('tr:hidden').show(); } }) - .children() - .slideDown("fast", function() { - $(this).contents().unwrap(); - if ($.isFunction(onComplete)) { - onComplete(); - } - }); - }); - - $tr.filter('table:hidden').finish().each(function(){ - $(this) - .wrap('
') - .show() - .parent() - .slideDown("fast", function() { - $(this).contents().unwrap(); - if ($.isFunction(onComplete)) { - onComplete(); - } - }); - }); - - return $tr; -} - -function toggleRows(what, val, what2, onComplete) { - if (val == 1) { - slideDownRows($('.'+what), onComplete); - if (arguments.length > 2) { - slideUpRows($('.'+what2), onComplete); - } - } else { - slideUpRows($('.'+what), onComplete); - if (arguments.length > 2) { - slideDownRows($('.'+what2), onComplete); - } - } -} - -function updatePrefixLabels(category) { - $("#vmform table:data(category)").filter(function() { - return $(this).data('category') == category; - }).each(function (index) { - var oldprefix = $(this).data('prefix'); - var newprefix = oldprefix; - - if (index > 0) { - newprefix = ordinal_suffix_of(index+1); - } - - $(this) - .data('prefix', newprefix) - .find('tr').each(function() { - var $td = $(this).children('td').first(); - - var old = $td.text(); - if (oldprefix && old.indexOf(oldprefix) === 0) { - old = old.replace(oldprefix + ' ', ''); - } - - $td.text(newprefix + ' ' + old); - }); - }); -} - -function bindSectionEvents(category) { - var $Filtered = $("#vmform table:data(category)").filter(function(index) { - return $(this).data('category') == category; - }); - - var count = $Filtered.length; - - $Filtered.each(function(index) { - var $table = $(this); - var config = $(this).data(); - var boolAdd = false; - var boolDelete = false; - - if (!config.hasOwnProperty('multiple')) { - return; - } - - // Clean old sections - var $first_td = $(this).find('td').first(); - - // delete section - if (!config.hasOwnProperty('minimum') || parseInt(config.minimum) < (index+1)) { - if ($first_td.children('.sectionbutton.remove').length === 0) { - var $el_remove = $('
').one('click', clickRemoveSection); - $first_td.append($el_remove); - } - boolDelete = true; - } else { - $first_td.children('.sectionbutton.remove').fadeOut('fast', function() { $(this).remove(); }); - } - - // add section (can only add from the last section) - if ((index+1) == count) { - if (!config.hasOwnProperty('maximum') || parseInt(config.maximum) > (index+1)) { - if ($first_td.children('.sectionbutton.add').length === 0) { - var $el_add = $('
').one('click', clickAddSection); - $first_td.append($el_add); - } - boolAdd = true; - } else { - $first_td.children('.sectionbutton.add').fadeOut('fast', function() { $(this).remove(); }); - } - } - - if (boolDelete || boolAdd) { - $table.addClass("multiple"); - if ($first_td.children('.sectiontab').length === 0) { - var $el_tab = $('
'); - $first_td.append($el_tab); - } - } else { - $first_td.children('.sectionbutton, .sectiontab').fadeOut('fast', function() { - $(this).remove(); - $table.removeClass("multiple"); - }); - } - }); -} - -function clickAddSection() { - var $table = $(this).closest('table'); - $(this).remove(); - var newindex = new Date().getTime(); - var config = $table.data(); - - var $template = $($('
').loadTemplate($("#tmpl" + config.category)).html().replace(/{{INDEX}}/g, newindex)); - - $template - .data({ - multiple: true, - category: config.category, - index: newindex, - minimum: config.minimum, - maximum: config.maximum - }) - .find('tr').hide() - .find("input[data-pickroot]").fileTreeAttach(); - - $table.after($template); - - updatePrefixLabels(config.category); - bindSectionEvents(config.category); - - $el_showable = $template.find('tr').not("." + (isVMAdvancedMode() ? 'basic' : 'advanced')); - - slideDownRows($el_showable); - - $table.parent().trigger('spawn_section', [ $template, $template.data() ]); -} - -function clickRemoveSection() { - var $table = $(this).closest('table'); - var $parent = $table.parent(); - var tabledata = $table.data(); - - slideUpRows($table, function() { - $table.detach(); - $parent.trigger('destroy_section', [ $table, tabledata ]); - $table.remove(); - - updatePrefixLabels(tabledata.category); - bindSectionEvents(tabledata.category); - }); -}