diff --git a/src/sunstone/public/js/plugins/files-tab.js b/src/sunstone/public/js/plugins/files-tab.js index ca4758b617..9807a2c693 100644 --- a/src/sunstone/public/js/plugins/files-tab.js +++ b/src/sunstone/public/js/plugins/files-tab.js @@ -319,16 +319,6 @@ var file_actions = { error: onError, notify: true }, - "File.clone_dialog" : { - type: "custom", - call: popUpFileCloneDialog - }, - "File.clone" : { - type: "single", - call: OpenNebula.Image.clone, - error: onError, - notify: true - }, "File.help" : { type: "custom", call: function() { @@ -386,11 +376,6 @@ var file_buttons = { layout: "more_select", text: tr("Disable") }, - "File.clone_dialog" : { - type: "action", - layout: "main", - text: tr("Clone") - }, "File.delete" : { type: "confirm", layout: "del", @@ -546,14 +531,6 @@ function updateFileInfo(request,img){ '+pretty_time(img_info.REGTIME)+'\ \ \ - \ - '+tr("Persistent")+'\ - '+(parseInt(img_info.PERSISTENT) ? tr("yes") : tr("no"))+'\ -
\ - \ -
\ - \ - \ \ '+tr("Filesystem type")+'\ '+(typeof img_info.FSTYPE === "string" ? img_info.FSTYPE : "--")+'\ @@ -633,26 +610,6 @@ function updateFileInfo(request,img){ Sunstone.runAction("File.showinfo", img_info.ID); }); - // Listener for edit link for persistency change - $("#div_edit_persistency").live("click", function() { - var value_str = $(".value_td_persistency").text(); - $(".value_td_persistency").html( - ''); - $('option[value="'+value_str+'"]').replaceWith(''); - }); - - $("#persistency_select").live("change", function() { - var new_value=$("option:selected", this).text(); - - if (new_value=="yes") - Sunstone.runAction("File.persistent",[img_info.ID]); - else - Sunstone.runAction("File.nonpersistent",[img_info.ID]); - - }); Sunstone.updateInfoPanelTab("file_info_panel","file_info_tab",info_tab); Sunstone.popUpInfoPanel("file_info_panel"); @@ -946,98 +903,6 @@ function is_persistent_file(id){ return $(data).is(':checked'); }; -function setupFileCloneDialog(){ - //Append to DOM - dialogs_context.append('
'); - var dialog = $('#file_clone_dialog',dialogs_context); - - //Put HTML in place - - var html = '
\ -

\ - '+tr("Clone File")+'\ -

\ -
\ -
\ -
\ -
\ -
'+tr("Several file are selected, please choose prefix to name the new copies")+':
\ -
\ -
\ -
\ -
\ - \ - \ -
\ -
\ - \ -
\ -
\ -
\ -
\ - \ - \ -
\ -×\ -
\ -'; - - dialog.html(html); - - //Convert into jQuery - //dialog.dialog({ - // autoOpen:false, - // width:375, - // modal:true, - // resizable:false - //}); - dialog.addClass("reveal-modal"); - - //$('button',dialog).button(); - - $('form',dialog).submit(function(){ - var name = $('input', this).val(); - var sel_elems = fileElements(); - if (!name || !sel_elems.length) - notifyError('A name or prefix is needed!'); - if (sel_elems.length > 1){ - for (var i=0; i< sel_elems.length; i++) - //If we are cloning several files we - //use the name as prefix - Sunstone.runAction('Image.clone', - sel_elems[i], - name+getFileName(sel_elems[i])); - } else { - Sunstone.runAction('Image.clone',sel_elems[0],name) - }; - dialog.trigger("reveal:close") - setTimeout(function(){ - Sunstone.runAction('Image.refresh'); - }, 1500); - return false; - }); -} - -function popUpFileCloneDialog(){ - var dialog = $('#file_clone_dialog'); - var sel_elems = fileElements(); - //show different text depending on how many elements are selected - if (sel_elems.length > 1){ - $('.clone_one',dialog).hide(); - $('.clone_several',dialog).show(); - $('input',dialog).val('Copy of '); - } - else { - $('.clone_one',dialog).show(); - $('.clone_several',dialog).hide(); - $('input',dialog).val('Copy of '+getFileName(sel_elems[0])); - }; - - $(dialog).reveal(); -} - //The DOM is ready at this point $(document).ready(function(){ @@ -1066,7 +931,6 @@ $(document).ready(function(){ setupCreateFileDialog(); setupTips($create_file_dialog); - setupFileCloneDialog(); setFileAutorefresh(); initCheckAllBoxes(dataTable_files);