diff --git a/languages/en-GB/website_code/scripts/template_management.js b/languages/en-GB/website_code/scripts/template_management.js index 07aec5ccfd..e1275d96a8 100644 --- a/languages/en-GB/website_code/scripts/template_management.js +++ b/languages/en-GB/website_code/scripts/template_management.js @@ -18,6 +18,8 @@ var RECYCLE_PROPERTIES = "You cannot set the properties on a file in the recycle bin, please remove this file before continuing"; + var DELETE_ERROR = "Error while trying to delete template"; + var RECYCLE_DUPLICATE = "Please remove content from the recycle bin before duplicating it."; var DUPLICATE_PROMPT = "Please select a project to duplicate"; @@ -26,6 +28,8 @@ var DUPLICATE_LIMIT = "Only 1 template can be duplicated at any time."; + var DUPLICATE_ERROR = "Error while duplicating : "; + var PUBLISH_LIMIT = "Only 1 template can be published at any time"; var PUBLISH_SUCCESS = "Your file has been published"; @@ -34,7 +38,7 @@ var DELETE_MULTIPLE_PROMPT = "Are you sure you with to delete these items?"; - var DELETE_PROMPT = "Are you sure you with to delete?"; + var DELETE_PROMPT = "Are you sure you wish to delete?"; var DELETE_PERMENANT_PROMPT = "Are you sure you want to permenantly delete file"; @@ -47,5 +51,7 @@ var ERROR_DELETE = 'Error while trying to delete template'; var ERROR_DUPLICATE = 'Error while duplicating '; + + var RECYCLE_EMPTY = "Are you sure you want to empty the recycle bin?"; diff --git a/website_code/scripts/template_management.js b/website_code/scripts/template_management.js index f0ba9b469b..d1c33b398b 100644 --- a/website_code/scripts/template_management.js +++ b/website_code/scripts/template_management.js @@ -231,13 +231,13 @@ function edit_window(admin){ }else{ - alert("You cannot edit files in the recycle bin. Please remove the file from the recycle bin before editing."); + alert(RECYCLE_EDIT); } }else{ - alert("You cannot edit a folder. To change a folder's properties please click 'Properties'"); + alert(FOLDER_EDIT); } @@ -423,7 +423,9 @@ function example_window(example_id){ } }else{ - alert("Sorry an example does not exist for this template"); + + alert(NO_EXAMPLE); + } } @@ -459,7 +461,7 @@ function preview_window(admin){ }else{ - alert("Please select a project to preview."); + alert(PROJECT_SELECT); } @@ -603,7 +605,7 @@ function properties_window(admin){ }else{ - alert("You cannot set the properties on a file in the recycle bin, please remove this file before continuing"); + alert(RECYCLE_PROPERTIES); } @@ -614,8 +616,7 @@ function properties_window(admin){ NewWindow.window_reference = self; NewWindow.focus(); - - + } x++; @@ -795,7 +796,7 @@ function delete_stateChanged(){ response = xmlHttp.responseText.trim(); if(response.indexOf("Sorry")==0){ - alert('Error while trying to delete template "' + response + '"'); + alert(DELETE_ERROR + ' "' + response + '"'); } @@ -844,23 +845,23 @@ function duplicate_template(){ }else{ - alert("Please remove content from the recycle bin before duplicating it."); + alert(RECYCLE_DUPLICATE); } }else{ - alert("Please select a project to duplicate"); + alert(DUPLICATE_PROMPT); } }else if(drag_manager.selected_items.length==0){ - alert("Please select a template you would like to duplicate"); + alert(DUPLICATE_PROMPT_OTHER); }else{ - alert("Only 1 template can be duplicated at any time."); + alert(DUPLICATE_LIMIT); } @@ -880,7 +881,7 @@ function duplicate_stateChanged(){ response = xmlHttp.responseText.trim(); if(response!=""){ - alert('Error while duplicating : "' + response + '"'); + alert(DUPLICATE_ERROR + ' "' + response + '"'); } @@ -920,7 +921,7 @@ function publish_this(){ }else{ - alert("Only 1 template can be published at any time"); + alert(PUBLISH_LIMIT); } @@ -938,7 +939,7 @@ function publish_stateChanged(){ if (xmlHttp.readyState==4){ - alert("Your file has been published"); + alert(PUBLISH_SUCCESS); } @@ -960,7 +961,7 @@ function remove_this(){ if(document.getElementById("recyclebin").mainhighlight){ - var response = confirm("Are you sure you want to empty the recycle bin?"); + var response = confirm(RECYCLE_EMPTY); if(response){ @@ -984,22 +985,22 @@ function remove_this(){ } if(document.getElementById("folder_workspace").mainhighlight){ - alert("You cannot delete the Workspace folder"); + alert(WORKSPACE_DELETE); } }else{ if(drag_manager.selected_items.length!=1){ - var response = confirm("Are you sure you with to delete these item?"); + var response = confirm(DELETE_PROMPT); }else{ data_string = drag_manager.selected_items[0].innerHTML; name_string = data_string.split(">"); - - var response = confirm(name_string[1] + "\n\nAre you sure you with to delete?"); + + var response = confirm(name_string[2].split("<").shift() + "\n\n" + DELETE_PROMPT); } @@ -1013,7 +1014,7 @@ function remove_this(){ if(drag_manager.selected_items[x].parentNode.id=="folderchild_recyclebin"){ - var answer = confirm("Are you sure you want to permenantly delete file - " + drag_manager.selected_items[x].innerHTML.substr(drag_manager.selected_items[x].innerHTML.indexOf(">")+1,drag_manager.selected_items[x].innerHTML.length)); + var answer = confirm(DELETE_PERMENANT_PROMPT + " - " + drag_manager.selected_items[x].innerHTML.substr(drag_manager.selected_items[x].innerHTML.indexOf(">")+1,drag_manager.selected_items[x].innerHTML.length)); if(answer){ @@ -1034,7 +1035,7 @@ function remove_this(){ if(folder_children!=0){ - alert("Sorry you cannot delete a folder that has projects in it. Please empty the folder first"); + alert(DELETE_FOLDER_NOT_EMPTY); }else{ @@ -1216,7 +1217,7 @@ function create_tutorial(tutorial){ if(is_ok_name(document.getElementById(tutorial).childNodes[1].filename.value)){ xmlHttp.send('tutorialid=' + tutorial + '&tutorialname=' + document.getElementById(tutorial).childNodes[1].filename.value); }else{ - alert("Sorry that is not a valid name. Please use only letters and numbers."); + alert(NAME_FAIL); } } }