Changeset 25296 for main/trunk/greenstone3/web/interfaces
- Timestamp:
- 2012-03-27T13:07:06+13:00 (12 years ago)
- Location:
- main/trunk/greenstone3/web/interfaces/oran/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/oran/js/documentmaker_scripts.js
r25142 r25296 37 37 if(docLinks.length == 0) 38 38 { 39 document.getElementById("gs_content").innerHTML = "No documents in the Document Basket";39 document.getElementById("gs_content").innerHTML = gs.text.dse.no_docs; 40 40 return; 41 41 } … … 241 241 242 242 //Add a title to the top-level item 243 var title = createSectionTitle( "UNTITLED DOCUMENT");243 var title = createSectionTitle(gs.text.dse.untitled); 244 244 topLevelLI.appendChild(title); 245 245 topLevelLI.sectionTitle = title; … … 293 293 //Create the delete section link 294 294 var deleteSectionLink = document.createElement("A"); 295 deleteSectionLink.innerHTML = "delete section";295 deleteSectionLink.innerHTML = gs.text.dse.delete_section; 296 296 deleteSectionLink.setAttribute("href", "javascript:;"); 297 297 deleteSectionLink.setAttribute("class", "menuLink"); … … 509 509 //"Edit" link 510 510 var toggleLink = document.createElement("A"); 511 toggleLink.innerHTML = "edit";511 toggleLink.innerHTML = gs.text.dse.edit; 512 512 toggleLink.setAttribute("class", "menuLink"); 513 513 toggleLink.setAttribute("href", "javascript:;"); … … 520 520 521 521 var newSectionLink = document.createElement("A"); 522 newSectionLink.innerHTML = "add sub-section";522 newSectionLink.innerHTML = gs.text.dse.add_sub_section.replace(/ /g, " "); 523 523 newSectionLink.setAttribute("class", "menuLink"); 524 524 newSectionLink.setAttribute("href", "javascript:;"); … … 542 542 //"Duplicate" link 543 543 var duplicateLink = document.createElement("A"); 544 duplicateLink.innerHTML = "duplicate";544 duplicateLink.innerHTML = gs.text.dse.duplicate; 545 545 duplicateLink.setAttribute("class", "menuLink"); 546 546 duplicateLink.setAttribute("href", "javascript:;"); -
main/trunk/greenstone3/web/interfaces/oran/js/documentmaker_scripts_util.js
r25143 r25296 178 178 function save() 179 179 { 180 //This works in most cases but will not work when taking a doc from one collection to another, will need to be fixed at some point 180 181 var collection; 181 182 if(gs.cgiParams.c && gs.cgiParams.c != "") … … 204 205 var value = valueCell.innerHTML; 205 206 206 gs.functions.removeArchivesMetadata(collection /*bad*/, "localsite" /*bad*/, docID, name, null, value, function(){console.log("REMOVED ARCHIVES");});207 addCollectionToBuild(collection); /*bad*/207 gs.functions.removeArchivesMetadata(collection, gs.xsltParams.site_name, docID, name, null, value, function(){console.log("REMOVED ARCHIVES");}); 208 addCollectionToBuild(collection); 208 209 209 210 removeFromParent(currentRow); … … 232 233 if(changedElem.originalValue) 233 234 { 234 gs.functions.setArchivesMetadata(collection, "localsite" /*bad*/, docID, name, null, changedElem.innerHTML, changedElem.originalValue, "override", function(){console.log("SAVED ARCHIVES");});235 gs.functions.setArchivesMetadata(collection, gs.xsltParams.site_name, docID, name, null, changedElem.innerHTML, changedElem.originalValue, "override", function(){console.log("SAVED ARCHIVES");}); 235 236 } 236 237 else 237 238 { 238 gs.functions.setArchivesMetadata(collection, "localsite" /*bad*/, docID, name, null, changedElem.innerHTML, null, "accumulate", function(){console.log("SAVED ARCHIVES");});239 gs.functions.setArchivesMetadata(collection, gs.xsltParams.site_name, docID, name, null, changedElem.innerHTML, null, "accumulate", function(){console.log("SAVED ARCHIVES");}); 239 240 } 240 241 changedElem.originalValue = changedElem.innerHTML; … … 282 283 if(!xml || checkForErrors(xml)) 283 284 { 284 alert( "There was an error saving, aborting");285 alert(gs.text.dse.error_saving); 285 286 286 287 var saveButton = document.getElementById("saveButton"); 287 saveButton.innerHTML = "Save changes";288 saveButton.innerHTML = gs.text.dse.save_changes; 288 289 saveButton.disabled = false; 289 290 … … 300 301 { 301 302 var saveButton = document.getElementById("saveButton"); 302 saveButton.innerHTML = "Saving...";303 saveButton.innerHTML = gs.text.dse.saving + "..."; 303 304 saveButton.disabled = true; 304 305 305 statusID = _statusBar.addStatus( "Modifying archive files...");306 statusID = _statusBar.addStatus(gs.text.dse.modifying_archives + "..."); 306 307 ajax.send("a=g&rt=r&s=DocumentExecuteTransaction&s1.transactions=" + request); 307 308 } … … 313 314 if(!collections || collections.length == 0) 314 315 { 315 console.log( "List of collections to build is empty");316 saveButton.innerHTML = "Save changes";316 console.log(gs.text.dse.empty_collection_list); 317 saveButton.innerHTML = gs.text.save_changes; 317 318 saveButton.disabled = false; 318 319 return; … … 334 335 if(!xml || checkForErrors(xml)) 335 336 { 336 alert( "Could not build collection -> " + collections[counter] + ", aborting");337 alert(gs.text.dse.could_not_build_p1 + " " + collections[counter] + gs.text.dse.could_not_build_p2); 337 338 338 339 _statusBar.removeStatus(statusID); 339 saveButton.innerHTML = "Save changes";340 saveButton.innerHTML = gs.text.dse.save_changes; 340 341 saveButton.disabled = false; 341 342 … … 359 360 if(!xml || checkForErrors(xml)) 360 361 { 361 alert( "Could not activate collection -> " + collections[counter] + ", aborting");362 alert(gs.text.dse.could_not_activate_p1 + " " + collections[counter] + gs.text.dse.could_not_activate_p2); 362 363 363 364 _statusBar.removeStatus(statusID); 364 saveButton.innerHTML = "Save changes";365 saveButton.innerHTML = gs.text.dse.save_changes; 365 366 saveButton.disabled = false; 366 367 … … 387 388 388 389 _statusBar.removeStatus(statusID); 389 saveButton.innerHTML = "Save changes";390 saveButton.innerHTML = gs.text.dse.save_changes; 390 391 saveButton.disabled = false; 391 392 }); … … 393 394 } 394 395 } 395 _statusBar.changeStatus(statusID, "Activating collection" + collections[counter] + "...");396 _statusBar.changeStatus(statusID, gs.text.dse.activating + " " + collections[counter] + "..."); 396 397 localAjax.send(); 397 398 }); 398 399 } 399 400 } 400 statusID = _statusBar.addStatus( "Building collection" + collections[counter] + "...");401 statusID = _statusBar.addStatus(gs.text.dse.activating + " " + collections[counter] + "..."); 401 402 ajax.send(); 402 403 } … … 421 422 if(!xml || checkForErrors(xml)) 422 423 { 423 alert( "Could not check status of " + serverFunction + ", there was an error in the XML, aborting");424 alert(gs.text.dse.could_not_check_status_p1 + " " + serverFunction + gs.text.dse.could_not_check_status_p2a); 424 425 425 426 _statusBar.removeStatus(statusID); 426 saveButton.innerHTML = "Save changes";427 saveButton.innerHTML = gs.text.dse.save_changes; 427 428 saveButton.disabled = false; 428 429 … … 439 440 else if (code == HALTED || code == ERROR) 440 441 { 441 alert( "Could not check status of " + serverFunction + ", there was an error on the server, aborting");442 alert(gs.text.dse.could_not_check_status_p1 + " " + serverFunction + gs.text.dse.could_not_check_status_p2b); 442 443 443 444 _statusBar.removeStatus(statusID); 444 saveButton.innerHTML = "Save changes";445 saveButton.innerHTML = gs.text.dse.save_changes; 445 446 saveButton.disabled = false; 446 447 } … … 485 486 if(errorElems && errorElems.length > 0) 486 487 { 487 var errorString = "There was an error saving your changes: ";488 var errorString = gs.text.dse.error_saving_changes + ": "; 488 489 for(var i = 0; i < errorElems.length; i++) 489 490 { … … 507 508 if(xmlDoc.parseError.errorCode!=0) 508 509 { 509 txt = "Error Code: " + xmlDoc.parseError.errorCode + "\n";510 txt = txt + "Error Reason: " + xmlDoc.parseError.reason;511 txt = txt + "Error Line: " + xmlDoc.parseError.line;510 txt = dse.error_code + ": " + xmlDoc.parseError.errorCode + "\n"; 511 txt = txt + dse.error_reason + ": " + xmlDoc.parseError.reason; 512 txt = txt + dse.error_line + ": " + xmlDoc.parseError.line; 512 513 console.log(txt); 513 514 return null; … … 524 525 if (xmlDoc.getElementsByTagName("parsererror").length > 0) 525 526 { 526 console.log( "There was an error parsing the XML");527 console.log(gs.text.dse.xml_error); 527 528 return null; 528 529 } … … 532 533 else 533 534 { 534 console.log( 'Your browser cannot handle XML validation');535 console.log(gs.text.dse.browse_cannot_validate_xml); 535 536 } 536 537 return null; … … 641 642 642 643 var addRowButton = document.createElement("BUTTON"); 643 addRowButton.innerHTML = "Add new metadata";644 addRowButton.innerHTML = gs.text.dse.add_new_metadata; 644 645 addRowButton.onclick = function() 645 646 { … … 647 648 if(!name || name == "") 648 649 { 649 console.log( "No value given for new metadata name");650 console.log(gs.text.dse.no_value_given); 650 651 return; 651 652 } … … 738 739 //The "Save changes" button 739 740 var saveButton = document.createElement("BUTTON"); 740 saveButton.innerHTML = "Save changes";741 saveButton.innerHTML = gs.text.dse.save_changes; 741 742 saveButton.setAttribute("onclick", "save();"); 742 743 saveButton.setAttribute("id", "saveButton"); … … 751 752 //The "Create new document" button 752 753 var newDocButton = document.createElement("BUTTON"); 753 newDocButton.innerHTML = "Create new document";754 newDocButton.innerHTML = gs.text.dse.create_new_document; 754 755 newDocButton.setAttribute("onclick", "createNewDocumentArea();"); 755 756 newDocCell.appendChild(newDocButton); … … 784 785 currentNode = currentNode.nextSibling; 785 786 } 786 return " {UNTITLED}";787 return ""; 787 788 } 788 789 … … 871 872 { 872 873 textDiv.style.display = "none"; 873 section.menu.editTextLink.innerHTML = "edit";874 section.menu.editTextLink.innerHTML = gs.text.dse.edit; 874 875 } 875 876 else 876 877 { 877 878 textDiv.style.display = "block"; 878 section.menu.editTextLink.innerHTML = "hide";879 section.menu.editTextLink.innerHTML = gs.text.dse.hide; 879 880 } 880 881 } … … 912 913 else 913 914 { 914 textSpan.appendChild(document.createTextNode(" [ UNTITLED SECTION] "));915 textSpan.appendChild(document.createTextNode(" [" + gs.text.dse.untitled_section + "] ")); 915 916 } 916 917 return textSpan; … … 937 938 var newSecLI = document.createElement("LI"); 938 939 var newSpan = document.createElement("SPAN"); 939 newSpan.innerHTML = "Insert new section";940 newSpan.innerHTML = gs.text.dse.insert_new_section + " "; 940 941 941 942 newSecLI.sectionTitle = newSpan;
Note:
See TracChangeset
for help on using the changeset viewer.