Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
pgogy committed Jul 16, 2012
1 parent 1fe4d46 commit 23ad7c3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 24 deletions.
8 changes: 7 additions & 1 deletion languages/en-GB/website_code/scripts/template_management.js
Expand Up @@ -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";
Expand All @@ -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";
Expand All @@ -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";

Expand All @@ -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?";


47 changes: 24 additions & 23 deletions website_code/scripts/template_management.js
Expand Up @@ -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);

}

Expand Down Expand Up @@ -423,7 +423,9 @@ function example_window(example_id){
}

}else{
alert("Sorry an example does not exist for this template");

alert(NO_EXAMPLE);

}

}
Expand Down Expand Up @@ -459,7 +461,7 @@ function preview_window(admin){

}else{

alert("Please select a project to preview.");
alert(PROJECT_SELECT);

}

Expand Down Expand Up @@ -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);

}

Expand All @@ -614,8 +616,7 @@ function properties_window(admin){
NewWindow.window_reference = self;

NewWindow.focus();



}

x++;
Expand Down Expand Up @@ -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 + '"');

}

Expand Down Expand Up @@ -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);

}

Expand All @@ -880,7 +881,7 @@ function duplicate_stateChanged(){
response = xmlHttp.responseText.trim();

if(response!=""){
alert('Error while duplicating : "' + response + '"');
alert(DUPLICATE_ERROR + ' "' + response + '"');

}

Expand Down Expand Up @@ -920,7 +921,7 @@ function publish_this(){

}else{

alert("Only 1 template can be published at any time");
alert(PUBLISH_LIMIT);

}

Expand All @@ -938,7 +939,7 @@ function publish_stateChanged(){

if (xmlHttp.readyState==4){

alert("Your file has been published");
alert(PUBLISH_SUCCESS);

}

Expand All @@ -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){

Expand All @@ -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);

}

Expand All @@ -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){

Expand All @@ -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{

Expand Down Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 23ad7c3

Please sign in to comment.