Changeset 36027
- Timestamp:
- 2022-02-01T11:54:46+13:00 (14 months ago)
- Location:
- main/trunk/greenstone3/web/interfaces/default
- Files:
-
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/interfaceConfig.xml
r33284 r36027 47 47 </actionList> 48 48 <optionList> 49 <option name="cssTheme" value="interfaces/default/style/themes/main/jquery-ui-1.8.16.custom.css"/> 49 <!-- Uncomment and update this option if you want to introduce custom CSS to this interface. --> 50 <!-- <option name="cssTheme" value="interfaces/default/style/themes/main/jquery-ui.theme.css"/> --> 51 50 52 <option name="highlightQueryTerms" value="true"/> 51 53 <!-- Set one or other of the following two options (berryBasket and favouriteBasket) to true --> … … 250 252 </languageList> 251 253 </interfaceConfig> 252 -
main/trunk/greenstone3/web/interfaces/default/js/classifier_scripts.js
r33289 r36027 144 144 145 145 $.ajax(url) 146 . success(function(data)146 .done(function(data) 147 147 { 148 148 var newDiv = $("<div>"); … … 171 171 } 172 172 }) 173 . error(function()173 .fail(function() 174 174 { 175 175 sectionToggle.attr("src", gs.imageURLs.expand); 176 176 }) 177 . complete(function()177 .always(function() 178 178 { 179 179 inProgress[sectionID] = false; -
main/trunk/greenstone3/web/interfaces/default/js/debug_scripts.js
r27809 r36027 131 131 { 132 132 $.ajax(document.URL) 133 . success(function(response)133 .done(function(response) 134 134 { 135 135 //Get the body text from the response … … 156 156 addMouseEventsToDebugElements(debugElems); 157 157 }) 158 . error(function()158 .fail(function() 159 159 { 160 160 alert("There was an error reloading the page, please reload manually."); … … 224 224 225 225 _backButton = $("<button>Back button</button>").attr("id", "veBack"); 226 _backButton. click(backForwardFunction);226 _backButton.on("click", backForwardFunction); 227 227 _styleFunctions.push(function(){_backButton.button({icons:{primary:"ui-icon-triangle-1-w"}, text:false, disabled:true})}); 228 228 229 229 _forwardButton = $("<button>Forward button</button>").attr("id", "veForwards"); 230 _forwardButton. click(backForwardFunction);230 _forwardButton.on("click", backForwardFunction); 231 231 _styleFunctions.push(function(){_forwardButton.button({icons:{primary:"ui-icon-triangle-1-e"}, text:false, disabled:true})}); 232 232 233 233 //Changes the template list to what is currently selected 234 234 _currentSelectionButton = $("<button>Current selection button</button>"); 235 _currentSelectionButton. click(function()235 _currentSelectionButton.on("click", function() 236 236 { 237 237 _fileSelector.find("option").eq(0).prop("selected", true); … … 259 259 //Used to enable the selector to get the templates of a particular area of the page 260 260 _enableSelectorButton = $("<button>Select an element</button>"); 261 _enableSelectorButton. click(function()261 _enableSelectorButton.on("click", function() 262 262 { 263 263 _enableSelectorButton.button("option", "label", "Select new element"); 264 $("a"). click(function(e)264 $("a").on("click", function(e) 265 265 { 266 266 e.preventDefault(); … … 274 274 //Used to minimise/restore the editor 275 275 _closeEditorButton = $("<button>Close editor</button>"); 276 _closeEditorButton. click(function()276 _closeEditorButton.on("click", function() 277 277 { 278 278 if(_closeEditorButton.button("option", "label") == "Close editor") … … 292 292 //Used to save any changes that have been made to this template 293 293 _saveButton = $("<button>Save changes</button>"); 294 _saveButton. click(function()294 _saveButton.on("click", function() 295 295 { 296 296 if(_editor) … … 329 329 330 330 $.post(url, parameters) 331 . success(function()331 .done(function() 332 332 { 333 333 $.ajax(gs.xsltParams.library_name + "?a=s&sa=c") 334 . success(function()334 .done(function() 335 335 { 336 336 partialPageReload(function(){$.unblockUI();}); 337 337 }) 338 . error(function()338 .fail(function() 339 339 { 340 340 $.unblockUI(); 341 341 alert("Error reloading collection."); 342 342 }) 343 . complete(function()343 .always(function() 344 344 { 345 345 _saveButton.button("option", "disabled", false); 346 346 }); 347 347 }) 348 . error(function()348 .fail(function() 349 349 { 350 350 alert("There was an error sending the request to the server, please try again."); … … 356 356 //Used to switch between the XML and Visual editors 357 357 _swapEditorButton = $("<button>Switch to XML editor</button>"); 358 _swapEditorButton.button(). click(function()358 _swapEditorButton.button().on("click", function() 359 359 { 360 360 if(_vEditor && _textEditor) … … 402 402 403 403 undoButton = $("<button>Undo</button>"); 404 undoButton. click(function()404 undoButton.on("click", function() 405 405 { 406 406 if(_isVisualEditor) … … 497 497 var url = gs.xsltParams.library_name + "?a=g&rt=r&s=GetXSLTFilesForCollection&s1.interfaceName=" + gs.xsltParams.interface_name + "&s1.siteName=" + gs.xsltParams.site_name + "&s1.collectionName=" + gs.cgiParams.c; 498 498 $.ajax(url) 499 . success(function(response)499 .done(function(response) 500 500 { 501 501 var listStartIndex = response.indexOf("<fileListJSON>") + "<fileListJSON>".length; … … 532 532 }); 533 533 }) 534 . error(function()534 .fail(function() 535 535 { 536 536 console.log("Error retrieving XSLT files"); … … 608 608 var getURL = gs.xsltParams.library_name + "?a=g&rt=r&s=GetTemplateListFromFile&s1.fileName=" + filename + "&s1.locationName=" + location + "&s1.interfaceName=" + gs.xsltParams.interface_name + "&s1.siteName=" + gs.xsltParams.site_name + "&s1.collectionName=" + gs.cgiParams.c; 609 609 $.ajax(getURL) 610 . success(function(templateResponse)610 .done(function(templateResponse) 611 611 { 612 612 var templateListStart = templateResponse.indexOf("<templateList>") + "<templateList>".length; … … 691 691 692 692 $.post(url, params) 693 . success(function(response)693 .done(function(response) 694 694 { 695 695 var template; … … 754 754 } 755 755 }) 756 . error(function()756 .fail(function() 757 757 { 758 758 console.log("Error getting the XML template from the file"); … … 809 809 var addMouseEventsToDebugElements = function(debugElems) 810 810 { 811 debugElems. click(function(e)811 debugElems.on("click", function(e) 812 812 { 813 813 if(_debugOn) … … 935 935 var enableGBButtonHolder = $("<div>", {"title":"Enable Greenbug", "id":"gbEnableButton", "class":"ui-state-default ui-corner-all"}); 936 936 enableGBButtonHolder.append($("<img>", {"src":gs.imageURLs.greenBug})); 937 enableGBButtonHolder. click(function()937 enableGBButtonHolder.on("click", function() 938 938 { 939 939 var url = document.URL; … … 968 968 969 969 //The code entry point 970 $(window). load(function()970 $(window).on("load", function() 971 971 { 972 972 var debugWidget = new DebugWidget(); -
main/trunk/greenstone3/web/interfaces/default/js/document_scripts.js
r35183 r36027 73 73 74 74 $.ajax(url) 75 . success(function(response)75 .done(function(response) 76 76 { 77 77 if(response) … … 93 93 } 94 94 }) 95 . error(function()95 .fail(function() 96 96 { 97 97 callback(null); … … 128 128 129 129 $.ajax(url) 130 . success(function(response)130 .done(function(response) 131 131 { 132 132 if(response) … … 150 150 } 151 151 }) 152 . error(function()152 .fail(function() 153 153 { 154 154 callback(null); … … 462 462 463 463 $.ajax(url) 464 . success(function(response)464 .done(function(response) 465 465 { 466 466 if(response) … … 479 479 } 480 480 }) 481 . error(function()481 .fail(function() 482 482 { 483 483 setTimeout(function(){loadTopLevelPage(callbackFunction, customURL);}, 1000); … … 538 538 else { 539 539 $.ajax(url) 540 . success(retrieveFullTableOfContentsSuccess)541 . error(function() {540 .done(retrieveFullTableOfContentsSuccess) 541 .fail(function() { 542 542 setTimeout(retrieveFullTableOfContents, 1000); 543 543 }); … … 618 618 $("#extractDocButton").attr("disabled", "disabled").html("Extracting document..."); 619 619 $.ajax(url) 620 . success(function(response)620 .done(function(response) 621 621 { 622 622 $("#extractDocButton").html("Building collection..."); 623 623 gs.functions.buildCollections([gs.cgiParams.c], function() 624 624 { 625 $("#extractDocButton"). removeAttr("disabled").html("Extract these pages to document");625 $("#extractDocButton").prop("disabled", false).html("Extract these pages to document"); 626 626 }); 627 627 }) 628 . error(function()629 { 630 $("#extractDocButton"). removeAttr("disabled").html("Extract these pages to document");628 .fail(function() 629 { 630 $("#extractDocButton").prop("disabled", false).html("Extract these pages to document"); 631 631 }); 632 632 } … … 705 705 706 706 $.ajax(url) 707 . success(function(response)707 .done(function(response) 708 708 { 709 709 var tableOfContents = $("#tableOfContents"); … … 714 714 loading.remove(); 715 715 }) 716 . error(function()716 .fail(function() 717 717 { 718 718 setTimeout(function(){retrieveTableOfContentsAndTitles();}, 1000); … … 769 769 { 770 770 currentImage.attr("onclick", ""); 771 currentImage. click(function()771 currentImage.on("click", function() 772 772 { 773 773 var sliderDiv = currentImage.parents("table").first().next(); … … 972 972 973 973 $.ajax(url) 974 . success(function(text)974 .done(function(text) 975 975 { 976 976 var hrefStart = text.indexOf("src=\"") + 5; … … 986 986 987 987 var image = $("<img>"); 988 image. load(function()988 image.on("load", function() 989 989 { 990 990 $(page.link).html(""); … … 993 993 page.imageLoaded = true; 994 994 }); 995 image. error(function()995 image.on("error", function() 996 996 { 997 997 if(!attemptNumber || attemptNumber < 3) … … 1012 1012 var title = text.substring(titleStart, titleEnd); 1013 1013 }) 1014 . error(function()1014 .fail(function() 1015 1015 { 1016 1016 page.failed = true; … … 1307 1307 { 1308 1308 url:url, 1309 success: function(data)1309 done: function(data) 1310 1310 { 1311 1311 var startIndex = data.indexOf(">", data.indexOf(">") + 1) + 1; … … 1422 1422 var setLink = function(currentLink, index) 1423 1423 { 1424 $(currentLink). click(function()1424 $(currentLink).on("click", function() 1425 1425 { 1426 1426 _inTransition = true; … … 1465 1465 } 1466 1466 1467 _nextButton. click(this.nextImage);1468 _prevButton. click(this.prevImage);1469 } 1467 _nextButton.on("click", this.nextImage); 1468 _prevButton.on("click", this.prevImage); 1469 } -
main/trunk/greenstone3/web/interfaces/default/js/documentbasket/featuredimagezoomer.js
r24510 r36027 176 176 var imgcoords=getcoords() 177 177 $statusdiv.css({left:imgcoords.left+w/2-$statusdiv.width()/2, top:imgcoords.top+h/2-$statusdiv.height()/2, visibility:'visible'}) 178 $bigimage. bind('loadevt', function(){ //magnified image ONLOAD event function (to be triggered later)178 $bigimage.on('loadevt', function(){ //magnified image ONLOAD event function (to be triggered later) 179 179 $img.css({opacity:1}) //restore thumb image opacity 180 180 $statusdiv.empty().css({border:'1px solid black', background:'#C0C0C0', padding:'4px', font:'bold 13px Arial', opacity:0.8}).hide().removeClass('preloadevt'); … … 203 203 }).css({cursor: fiz.magnifycursor}); 204 204 if (setting.zoomrange && setting.zoomrange[1]>setting.zoomrange[0]){ //if zoom range enabled 205 $tracker. bind('DOMMouseScroll mousewheel', function(e){205 $tracker.on('DOMMouseScroll mousewheel', function(e){ 206 206 fiz.magnifyimage($tracker, e, setting.zoomrange); 207 207 e.preventDefault(); … … 213 213 } 214 214 else{ 215 $bigimage. bind('load', function(){$bigimage.trigger('loadevt')})215 $bigimage.on('load', function(){$bigimage.trigger('loadevt')}) 216 216 } 217 217 }) -
main/trunk/greenstone3/web/interfaces/default/js/documentedit_scripts.js
r33508 r36027 80 80 "href": "javascript:;" 81 81 }); 82 newLink. click(function () {82 newLink.on("click", function () { 83 83 if (metaTable.css("display") == "none") { 84 84 linkLabel.html(gs.text.de.hide_metadata); … … 203 203 "href": "javascript:;" 204 204 }); 205 newLink. click(function () {205 newLink.on("click", function () { 206 206 //console.log(" Show/Hide Map Editor "); 207 207 var clicked_mapEditor = gsmap_store["map-" + id]; … … 326 326 "class": "ui-state-default ui-corner-all" 327 327 }); 328 saveButton. click(save);328 saveButton.on("click", save); 329 329 saveButton.html(gs.text.de.save); 330 330 editBar.append(saveButton); … … 334 334 "class": "ui-state-default ui-corner-all" 335 335 }); 336 rebuildButton. click(rebuildCurrentCollection);336 rebuildButton.on("click", rebuildCurrentCollection); 337 337 rebuildButton.html(gs.text.de.rebuild); 338 338 editBar.append(rebuildButton); … … 342 342 "class": "ui-state-default ui-corner-all" 343 343 }); 344 saveAndRebuildButton. click(saveAndRebuild);344 saveAndRebuildButton.on("click", saveAndRebuild); 345 345 saveAndRebuildButton.html(gs.text.de.saverebuild); 346 346 editBar.append(saveAndRebuildButton); … … 409 409 function enableSaveButtons(enabled) { 410 410 if (enabled) { 411 $("#saveButton, #rebuildButton, #saveAndRebuildButton"). removeAttr("disabled");411 $("#saveButton, #rebuildButton, #saveAndRebuildButton").prop("disabled", false); 412 412 } else { 413 $("#saveButton, #rebuildButton, #saveAndRebuildButton"). attr("disabled", "disabled");413 $("#saveButton, #rebuildButton, #saveAndRebuildButton").prop("disabled", true); 414 414 } 415 415 } -
main/trunk/greenstone3/web/interfaces/default/js/documentedit_scripts_util.js
r32902 r36027 194 194 if (enabled) { 195 195 $("#saveButton, #quickSaveButton").html(gs.text.de.save_changes); 196 $("#saveButton, #quickSaveButton"). removeAttr("disabled");196 $("#saveButton, #quickSaveButton").prop("disabled", false); 197 197 198 198 } else { 199 199 $("#saveButton, #quickSaveButton").html(gs.text.de.saving + "..."); 200 $("#saveButton, #quickSaveButton"). attr("disabled", "disabled");200 $("#saveButton, #quickSaveButton").prop("disabled", true); 201 201 202 202 } … … 1087 1087 1088 1088 addRowButton.html(gs.text.de.add_new_metadata); 1089 addRowButton. click(function()1089 addRowButton.on("click", function() 1090 1090 { 1091 1091 var name = metaNameField.val(); … … 1106 1106 var addAllButton = $("<button>",{"class": "ui-state-default ui-corner-all", "style": "margin: 5px;"}); 1107 1107 addAllButton.html(gs.text.de.add_all_metadata); 1108 addAllButton. click(function()1108 addAllButton.on("click", function() 1109 1109 { 1110 1110 for(var i=0; i<availableMetadataElements.length; i++) { … … 1165 1165 var newCell = $("<td>"); 1166 1166 var removeLink = $("<a>"+gs.text.de.remove+"</a>", {"href": "javascript:;"}); 1167 removeLink. click(function()1167 removeLink.on("click", function() 1168 1168 { 1169 1169 var undo = new Array(); -
main/trunk/greenstone3/web/interfaces/default/js/format_document.js
r27714 r36027 4 4 $(document).ready(function(){ 5 5 6 $('.sectionHeader'). click(function () {6 $('.sectionHeader').on("click", function () { 7 7 console.log('section Header click *'); 8 8 getXSLT("sectionHeader"); … … 10 10 }); 11 11 12 $('.sectionContainer'). click(function () {12 $('.sectionContainer').on("click", function () { 13 13 console.log('section Container click *'); 14 14 getXSLT("sectionContainer"); -
main/trunk/greenstone3/web/interfaces/default/js/format_jquery_prototypes.js
r27714 r36027 28 28 type: "GET", 29 29 url: "?a=g&s=CoverageMetadataRetrieve&o=xml&rt=r&c=" + host_info.collection_name, 30 success: function(data)30 done: function(data) 31 31 { 32 32 var str = "<select name=\"meta_select\" onChange=\"onSelectChange(this)\">"; -
main/trunk/greenstone3/web/interfaces/default/js/format_util.js
r27714 r36027 400 400 console.log('function bind_tables()'); 401 401 402 $('#sectionHeader'). click(function () {402 $('#sectionHeader').on("click", function () { 403 403 console.log('section Header click *'); 404 404 return true; 405 405 }); 406 406 407 $('#sectionContainer'). click(function () {407 $('#sectionContainer').on("click", function () { 408 408 console.log('section Container click *'); 409 409 return true; … … 524 524 }); 525 525 526 $('.gsf_template'). click(function () {526 $('.gsf_template').on("click", function () { 527 527 console.log('gsf_template class click'); 528 528 return false; … … 563 563 }); 564 564 565 $('.td-div'). click(function () {565 $('.td-div').on("click", function () { 566 566 //console.log('td class click'); 567 567 return true; … … 715 715 { 716 716 console.log('function bind_minmax_remove()'); 717 $('a.minmax'). bind('click', toggleContent);718 $('a.remove'). bind('click', removeContent);717 $('a.minmax').on('click', toggleContent); 718 $('a.remove').on('click', removeContent); 719 719 }; 720 720 -
main/trunk/greenstone3/web/interfaces/default/js/gui_div.js
r27714 r36027 371 371 /* DOCUMENT SPECIFIC FUNCTIONS */ 372 372 373 $('.sectionHeader'). click(function () {373 $('.sectionHeader').on("click", function () { 374 374 console.log('section Header click *'); 375 375 getXSLT("sectionHeader"); … … 377 377 }); 378 378 379 $('.sectionContainer'). click(function () {379 $('.sectionContainer').on("click", function () { 380 380 console.log('section Container click *'); 381 381 getXSLT("sectionContainer"); … … 405 405 type: "GET", 406 406 url: "?a=g&s=CoverageMetadataRetrieve&o=xml&rt=r&c=" + collection, 407 success: function(data)407 done: function(data) 408 408 { 409 409 var str = "<select name=\"meta_select\" onChange=\"onSelectChange(this)\">"; … … 951 951 console.log('function bind_tables()'); 952 952 953 $('#sectionHeader'). click(function () {953 $('#sectionHeader').on("click", function () { 954 954 console.log('section Header click *'); 955 955 return true; 956 956 }); 957 957 958 $('#sectionContainer'). click(function () {958 $('#sectionContainer').on("click", function () { 959 959 console.log('section Container click *'); 960 960 return true; … … 1070 1070 }); 1071 1071 1072 $('.gsf_template'). click(function () {1072 $('.gsf_template').on("click", function () { 1073 1073 console.log('gsf_template class click'); 1074 1074 return false; … … 1107 1107 }); 1108 1108 1109 $('.td-div'). click(function () {1109 $('.td-div').on("click", function () { 1110 1110 //console.log('td class click'); 1111 1111 return true; … … 1255 1255 { 1256 1256 console.log('function bind_minmax_remove()'); 1257 $('a.minmax'). bind('click', toggleContent);1258 $('a.remove'). bind('click', removeContent);1257 $('a.minmax').on('click', toggleContent); 1258 $('a.remove').on('click', removeContent); 1259 1259 }; 1260 1260 -
main/trunk/greenstone3/web/interfaces/default/js/hierarchy.js
r31067 r36027 75 75 } 76 76 else { 77 //wrap elements in hierarchy level 78 var levelMenu = '<ul>'; 79 for(var key in levelItems) 77 //wrap elements in hierarchy level 78 var levelMenu = '<ul>'; 79 for(var key in levelItems) 80 { 81 //Fill menu with items 82 levelMenu += levelItems[key]; 83 } 84 levelMenu += "</ul>"; 85 menuItem.append(levelMenu); 86 menuItem.find("li") 87 .on("mouseenter", function() 80 88 { 81 //Fill menu with items 82 levelMenu += levelItems[key]; 83 } 84 levelMenu += "</ul>"; 85 menuItem.append(levelMenu); 86 menuItem.find("li").hover( 87 function(){openHierarchyMenuLevel(this);} 88 , 89 function(){closeHierarchyMenuLevel(this);} 90 ); 91 92 //menuItem.find('ul'); 93 menuItem.children('ul').slideDown(); 94 } 95 89 openHierarchyMenuLevel(this); 90 }) 91 .on("mouseleave", function() 92 { 93 closeHierarchyMenuLevel(this); 94 }); 95 96 //menuItem.find('ul'); 97 menuItem.children('ul').slideDown(); 98 } 96 99 } else { 97 100 //stop animation … … 144 147 function setHierarchyHoverEvent(father,className) 145 148 { 146 147 $(father).find(className).hover(function() 148 { 149 openHierarchyMenuLevel(this); 150 }, function() { 151 closeHierarchyMenuLevel(this); 152 }); 149 $(father).find(className) 150 .on("mouseenter", function() 151 { 152 openHierarchyMenuLevel(this); 153 }) 154 .on("mouseleave", function() 155 { 156 closeHierarchyMenuLevel(this); 157 }); 153 158 154 159 } … … 183 188 $(row).each(function(){setHierarchyHoverEvent($(this),".metaDataHierarchyMenu ul li")}); 184 189 //Set menu name or SuggestionsMenu on change of textarea set menu name to appropriate menu item if exists 185 $(row).find('.metaTableCellArea'). bind('input propertychange',function()190 $(row).find('.metaTableCellArea').on('input propertychange',function() 186 191 { 187 192 var input = $(this).val(); -
main/trunk/greenstone3/web/interfaces/default/js/javascript-global-functions.js
r33218 r36027 549 549 // since get-meta-array and especially set-meta-array can be large, e.g. for user comments. 550 550 $.ajax({url: url, async: async_setting, type: method, data: data}) 551 . success(function(response) {551 .done(function(response) { 552 552 ajaxResponse = response; 553 553 // console.log("** (" + callingFunction + ") Response received from server: " + ajaxResponse); … … 561 561 } 562 562 }) 563 . error(function(response) {563 .fail(function(response) { 564 564 if(errorResponseFunction != null) { 565 565 errorResponseFunction(response); -
main/trunk/greenstone3/web/interfaces/default/js/jquery.blockUI.js
r28942 r36027 1 1 /*! 2 2 * jQuery blockUI plugin 3 * Version 2. 66.0-2013.10.093 * Version 2.70.0-2014.11.23 4 4 * Requires jQuery v1.7 or later 5 5 * … … 108 108 }; 109 109 110 $.blockUI.version = 2. 66; // 2nd generation blocking at no extra cost!110 $.blockUI.version = 2.70; // 2nd generation blocking at no extra cost! 111 111 112 112 // override these in your code to change the default behavior and style … … 427 427 lyr3.show(); 428 428 if (opts.onBlock) 429 opts.onBlock ();429 opts.onBlock.bind(lyr3)(); 430 430 } 431 431 … … 516 516 data.el.style.display = data.display; 517 517 data.el.style.position = data.position; 518 data.el.style.cursor = 'default'; // #59 518 519 if (data.parent) 519 520 data.parent.appendChild(data.el); … … 551 552 var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove'; 552 553 if (b) 553 $(document). bind(events, opts, handler);554 $(document).on(events, opts, handler); 554 555 else 555 $(document). unbind(events, handler);556 $(document).off(events, handler); 556 557 557 558 // former impl... -
main/trunk/greenstone3/web/interfaces/default/js/jquery.selectboxes.js
r27714 r36027 391 391 { 392 392 var w = which || "selected"; 393 if($(to). size()== 0) return this;393 if($(to).length == 0) return this; 394 394 this.each( 395 395 function() -
main/trunk/greenstone3/web/interfaces/default/js/jquery.themeswitcher.min.js
r30806 r36027 15 15 else 16 16 { 17 e.attr("href", "http://ajax.googleapis.com/ajax/libs/jqueryui/" + a.jqueryuiversion + "/themes/" + f.name + "/jquery-ui.css"); 18 $.ajax({url:gs.xsltParams.library_name + "?a=g&rt=r&configChangeName=cssTheme&configChangeValue=" + "http://ajax.googleapis.com/ajax/libs/jqueryui/" + a.jqueryuiversion + "/themes/" + f.name + "/jquery-ui.css"}); 17 var themeUrl = "https://code.jquery.com/ui/" + a.jqueryuiversion + "/themes/" + f.name + "/theme.css"; 18 19 e.attr("href", themeUrl); 20 $.ajax({url: gs.xsltParams.library_name + "?a=g&rt=r&configChangeName=cssTheme&configChangeValue=" + themeUrl}); 19 21 } 20 22 e.appendTo("head"); … … 59 61 rounded: true, 60 62 imgpath: "", 61 jqueryuiversion: "1. 8.10",63 jqueryuiversion: "1.13.0", 62 64 initialtext: gs.text.pref.switch_theme, 63 65 buttonpretext: "Theme:", -
main/trunk/greenstone3/web/interfaces/default/js/map-scripts.js
r33348 r36027 73 73 { 74 74 var startStopCheckbox = $("<input>", {"type": "checkbox", "checked": _scrollThroughDefault, "id": "scrollCheckbox"}); 75 startStopCheckbox. click(function()75 startStopCheckbox.on("click", function() 76 76 { 77 77 // http://stackoverflow.com/questions/901712/how-to-check-if-a-checkbox-is-checked-in-jquery … … 278 278 279 279 $.ajax({type:"POST", url:url, data:data}) 280 . success(function(responseText)280 .done(function(responseText) 281 281 { 282 282 //console.log("*** responseText (first 250) = " + responseText.substring(0,256)); … … 986 986 var url = gs.xsltParams.library_name + "?a=b&rt=s&s=ClassifierBrowse&c=" + gs.cgiParams.c + "&cl=" + sectionID + "&excerptid=jsonNodes"; 987 987 $.ajax(url) 988 . success(function(responseText)988 .done(function(responseText) 989 989 { 990 990 var startIndex = responseText.indexOf(">"); … … 1025 1025 //console.log("getSub Classifier -> updateMap()"); 1026 1026 }) 1027 . error(function()1027 .fail(function() 1028 1028 { 1029 1029 //console.log("Error getting subclassifiers"); … … 1094 1094 var url = gs.xsltParams.library_name + "?a=q&s=RawQuery&rt=rd&c=" + gs.cgiParams.c + "&s1.rawquery=" + query + "&excerptid=nearbyDocs&ilt=" + inlineTemplate.replace(/ /, "%20"); 1095 1095 $.ajax(url) 1096 . success(function(response)1096 .done(function(response) 1097 1097 { 1098 1098 response = response.replace(/<img src="[^"]*map_marker.png"[^>]*>/g, ""); -
main/trunk/greenstone3/web/interfaces/default/js/ui.nestedSortable.js
r27714 r36027 69 69 var validHandle = false; 70 70 71 $(this.options.handle, currentItem).find("*").a ndSelf().each(function() { if(this == event.target) validHandle = true; });71 $(this.options.handle, currentItem).find("*").addBack().each(function() { if(this == event.target) validHandle = true; }); 72 72 if(!validHandle) return false; 73 73 } -
main/trunk/greenstone3/web/interfaces/default/js/visual-xml-editor.js
r27713 r36027 291 291 292 292 $.ajax(url) 293 . success(function(response)293 .done(function(response) 294 294 { 295 295 startIndex = response.search("<templateList>") + "<templateList>".length; … … 323 323 } 324 324 }) 325 . error(function()325 .fail(function() 326 326 { 327 327 console.log("Error retrieving GSLIB templates"); … … 383 383 var customElemHolder = $("<div>"); 384 384 var customCreateButton = $("<button>Create element</button>"); 385 customCreateButton. click(function()385 customCreateButton.on("click", function() 386 386 { 387 387 var elemName = customInput.val(); … … 648 648 649 649 var _editButton = $("<button>Edit text</button>"); 650 _editButton. click(function()650 _editButton.on("click", function() 651 651 { 652 652 if(_editButton.button("option", "label") == "Edit text") … … 768 768 var link = $("<a href=\"javascript:;\">edit</a>"); 769 769 770 link. click(function()770 link.on("click", function() 771 771 { 772 772 _thisAttr.editMode(); … … 781 781 var cell = $("<td>", {"class":"veDeleteCell"}); 782 782 var link = $("<a href=\"javascript:;\">delete</a>"); 783 link. click(function()783 link.on("click", function() 784 784 { 785 785 _transactions.push({type:"remAttr", elem:_xmlElem, row:_row, rowParent:_row.parent(), name:_name, value:_value}); … … 824 824 editLink.text("done"); 825 825 editLink.off("click"); 826 editLink. click(function()826 editLink.on("click", function() 827 827 { 828 828 _thisAttr.saveEdits(); … … 871 871 editLink.text("edit"); 872 872 editLink.off("click"); 873 editLink. click(function()873 editLink.on("click", function() 874 874 { 875 875 _thisAttr.editMode(); … … 1175 1175 var errorFunction = function() 1176 1176 { 1177 $.ajax(url). success(successFunction).error(errorFunction);1177 $.ajax(url).done(successFunction).fail(errorFunction); 1178 1178 } 1179 1179 1180 $.ajax(url). success(successFunction).error(errorFunction);1180 $.ajax(url).done(successFunction).fail(errorFunction); 1181 1181 } 1182 1182 … … 1248 1248 1249 1249 var addButton = $("<button>Add attribute</button>"); 1250 addButton. click(function()1250 addButton.on("click", function() 1251 1251 { 1252 1252 var newAtt; … … 1330 1330 event.stopPropagation(); 1331 1331 }); 1332 _div. click(function(event)1332 _div.on("click", function(event) 1333 1333 { 1334 1334 event.stopPropagation(); -
main/trunk/greenstone3/web/interfaces/default/transform/depositor/de_page1.xsl
r33755 r36027 27 27 <script type="text/javascript"> 28 28 <xsl:text disable-output-escaping="yes"> 29 $("#addNewMD"). click(function()29 $("#addNewMD").on("click", function() 30 30 { 31 31 var val = $("#newMDName").val(); … … 50 50 <script type="text/javascript"> 51 51 <xsl:text disable-output-escaping="yes"> 52 $("#clearSaved"). click(function()52 $("#clearSaved").on("click", function() 53 53 { 54 54 $.ajax(gs.xsltParams.library_name + "?a=de&sa=clearcache") 55 . success(function()55 .done(function() 56 56 { 57 57 document.location.href = gs.xsltParams.library_name + "?a=de&sa=getwizard&depage=1&c=" + gs.cgiParams.c; … … 64 64 </xsl:template> 65 65 </xsl:stylesheet> 66 -
main/trunk/greenstone3/web/interfaces/default/transform/depositor/de_page4.xsl
r33755 r36027 17 17 <xsl:text disable-output-escaping="yes"> 18 18 { 19 $(window). load(function()19 $(window).on("load", function() 20 20 { 21 21 $("#progressBar").html($("#progressBar").html() + "<br/>Moving file into collection..."); 22 22 var url = gs.xsltParams.library_name + "?a=de&sa=depositFile&ro=1&c=" + gs.cgiParams.c + "&fileToAdd=" + gs.deSavedMetadata["md___ex.Filename"]; 23 $.ajax(url). success(function(response)23 $.ajax(url).done(function(response) 24 24 { 25 25 $("#progressBar").html($("#progressBar").html() + "<br/>Importing collection..."); … … 46 46 $("#progressBar").html($("#progressBar").html() + "<br/>Collection built..."); 47 47 $("#progressBar").html($("#progressBar").html() + "<br/>Reloading Greenstone..."); 48 $.ajax(gs.xsltParams.library_name + "?a=s&sa=c"). success(function()48 $.ajax(gs.xsltParams.library_name + "?a=s&sa=c").done(function() 49 49 { 50 50 $("#progressBar").html($("#progressBar").html() + "<br/>Done!"); 51 51 }) 52 . error(function()52 .fail(function() 53 53 { 54 54 $("#progressBar").html($("#progressBar").html() + "<br/>Reload failed, please restart Greenstone manually."); … … 72 72 </xsl:template> 73 73 </xsl:stylesheet> 74 -
main/trunk/greenstone3/web/interfaces/default/transform/depositor/depositor.xsl
r33755 r36027 58 58 <xsl:text disable-output-escaping="yes"> 59 59 { 60 $(window). load(function()60 $(window).on("load", function() 61 61 { 62 62 var cachedMetadata = []; … … 101 101 } 102 102 103 $(".wizardStepLink a"). click(function()103 $(".wizardStepLink a").on("click", function() 104 104 { 105 105 var requestedPage = $(this).attr("page"); … … 123 123 </xsl:template> 124 124 </xsl:stylesheet> 125 -
main/trunk/greenstone3/web/interfaces/default/transform/expand-gsf.xsl
r34526 r36027 424 424 </xsl:choose> 425 425 </xslt:attribute> 426 <xsl:if test="@alt"> 427 <xslt:attribute name='alt'> 428 <xsl:value-of select="@alt" /> 429 </xslt:attribute> 430 </xsl:if> 426 431 </img> 427 432 </xsl:when> … … 756 761 757 762 </xsl:stylesheet> 758 759 -
main/trunk/greenstone3/web/interfaces/default/transform/javascript-global-setup.xsl
r33720 r36027 9 9 <xsl:template name="setup-gs-variable"> 10 10 <script type="text/javascript"> 11 gs = new Array(); 12 gs.cgiParams = new Array(); 13 gs.xsltParams = new Array(); 14 gs.siteMetadata = new Array(); 15 gs.collectionMetadata = new Array(); 16 gs.documentMetadata = new Array(); 17 gs.imageURLs = new Array(); 18 gs.variables = new Array(); 19 gs.requestInformation = new Array(); 11 <xsl:text disable-output-escaping="yes"> 12 if (typeof gs === "undefined" ) { 13 gs={}; 14 } 15 gs.cgiParams ??= {}; 16 gs.xsltParams ??= {}; 17 gs.siteMetadata ??= {}; 18 gs.collectionMetadata ??= {}; 19 gs.documentMetadata ??= {}; 20 gs.imageURLs ??= {}; 21 gs.variables ??= {}; 22 gs.requestInformation ??= {}; 23 </xsl:text> 20 24 </script> 21 25 <xsl:call-template name="populate-cgi-param-values"/> … … 159 163 160 164 <xsl:template name="include-global-javascript-functions"> 161 <script type="text/javascript" src="interfaces/ default/js/javascript-global-functions.js"><xsl:text> </xsl:text></script>162 <script type="text/javascript" src="interfaces/ default/js/GSMetadata.js"><xsl:text> </xsl:text></script>165 <script type="text/javascript" src="interfaces/{$interface_name}/js/javascript-global-functions.js"><xsl:text> </xsl:text></script> 166 <script type="text/javascript" src="interfaces/{$interface_name}/js/GSMetadata.js"><xsl:text> </xsl:text></script> 163 167 <script type="text/javascript" src="interfaces/{$interface_name}/js/utility_scripts.js"><xsl:text> </xsl:text></script> 164 168 -
main/trunk/greenstone3/web/interfaces/default/transform/layouts/formatmanager.xsl
r35319 r36027 23 23 <!-- Sam2's div code --> 24 24 25 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"><xsl:text> </xsl:text></script> 26 <!--<script type="text/javascript" src="interfaces/default/js/jquery-1.4.2.js"><xsl:text> </xsl:text></script>--> 25 <!-- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"><xsl:text> </xsl:text></script> --> 27 26 <!-- XML parsing doesn't seem to work properly jquery so jquery.xml.js is a fix for this --> 28 27 <script type="text/javascript" src="interfaces/default/js/jquery.xml.js"><xsl:text> </xsl:text></script> 29 < script type="text/javascript" src="interfaces/default/js/jquery-ui-1.8.15/ui/jquery-ui-1.8.15.custom.js"><xsl:text> </xsl:text></script>28 <!-- <script type="text/javascript" src="interfaces/default/js/jquery-ui-1.8.15/ui/jquery-ui-1.8.15.custom.js"><xsl:text> </xsl:text></script> --> 30 29 <script type="text/javascript" src="interfaces/default/js/jquery.selectboxes.js"><xsl:text> </xsl:text></script> 31 30 <script type="text/javascript" src="interfaces/default/js/innerxhtml.js"><xsl:text> </xsl:text></script> … … 82 81 </style> 83 82 84 < link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css"/>83 <!-- <link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css"/> --> 85 84 86 85 <table width="100%" border="1"> -
main/trunk/greenstone3/web/interfaces/default/transform/layouts/header.xsl
r35331 r36027 11 11 <xsl:include href="../shared-templates.xsl"/> 12 12 <xsl:include href="../javascript-global-setup.xsl"/> 13 14 <xsl:param name="cookie_consent"/> 13 15 14 16 <!-- If the c parameter is empty then use the p.c parameter for the collection name--> … … 104 106 </script> 105 107 106 <xsl:choose> 107 <xsl:when test="/page/pageResponse/interfaceOptions/option[@name = 'cssTheme']/@value"> 108 <link rel="stylesheet" href="interfaces/{$interface_name}/style/themes/main/jquery-ui.theme.css" type="text/css"/> 109 <link rel="stylesheet" href="interfaces/{$interface_name}/style/themes/main/jquery-ui.structure.min.css" type="text/css"/> 110 <link rel="stylesheet" href="interfaces/{$interface_name}/style/core.css" type="text/css"/> 108 111 <!-- Get the theme from the interfaceConfig.xml file --> 109 <link rel="stylesheet" href="{/page/pageResponse/interfaceOptions/option[@name = 'cssTheme']/@value}" type="text/css"/> 110 </xsl:when> 111 <xsl:otherwise> 112 <link rel="stylesheet" href="interfaces/{$interface_name}/style/themes/main/jquery-ui-1.8.16.custom.css" type="text/css"/> 113 </xsl:otherwise> 112 <xsl:choose> 113 <xsl:when test="/page/pageResponse/interfaceOptions/option[@name = 'cssTheme']/@value"> 114 <link rel="stylesheet" href="{/page/pageResponse/interfaceOptions/option[@name = 'cssTheme']/@value}" type="text/css"/> 115 </xsl:when> 114 116 </xsl:choose> 115 <link rel="stylesheet" href="interfaces/{$interface_name}/style/core.css" type="text/css"/>116 117 <xsl:call-template name="favicon"/> 117 118 118 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery .min.js"><xsl:text> </xsl:text></script>119 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery-ui-1.1 0.2.custom/js/jquery-ui-1.10.2.custom.min.js"><xsl:text> </xsl:text></script>119 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery-3.6.0.min.js"><xsl:text> </xsl:text></script> 120 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery-ui-1.13.0.custom/jquery-ui.min.js"><xsl:text> </xsl:text></script> 120 121 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery.blockUI.js"><xsl:text> </xsl:text></script> 121 122 <script type="text/javascript" src="interfaces/{$interface_name}/js/ace/ace.js"><xsl:text> </xsl:text></script> 122 123 124 <!-- Cookie Consent Manager --> 125 <xsl:choose> 126 <xsl:when test="$cookie_consent"> 127 <link rel="stylesheet" href="interfaces/{$interface_name}/style/cookieconsent.css" type="text/css"/> 128 <gslib:langfrag name="ccm" /> 129 <script defer="true" type="text/javascript" src="interfaces/{$interface_name}/js/cookieconsent.js"><xsl:text> </xsl:text></script> 130 <script defer="true" type="text/javascript" src="interfaces/{$interface_name}/js/cookieconsent-init.js"><xsl:text> </xsl:text></script> 131 </xsl:when> 132 </xsl:choose> 133 123 134 <script type="text/javascript" src="interfaces/{$interface_name}/js/zoomer.js"><xsl:text> </xsl:text></script> 124 135 … … 155 166 <xsl:call-template name="setup-gs-variable"/> 156 167 <xsl:if test="/page/pageRequest/@action ='p' and /page/pageRequest/@subaction='pref'"> 157 <script type="text/javascript"> 158 <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceStringsAsJavascript($interface_name, /page/@lang, 'pref')"/> 159 </script> 160 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery.themeswitcher.min.js"><xsl:text> </xsl:text></script> 168 <gslib:langfrag name="pref" /> 169 <script type="text/javascript" src="interfaces/{$interface_name}/js/jquery.themeswitcher.min.js"><xsl:text> </xsl:text></script> 161 170 </xsl:if> 162 171 <xsl:call-template name="define-js-macro-variables"/> … … 496 505 <xsl:when test="$isEditingAvailable = '1' and $userHasEditPermission = '1'"><xsl:text disable-output-escaping="yes"> 497 506 .html((gs.userInformation.editEnabled == "true") ? "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'menu.disable_edit_mode')"/><xsl:text disable-output-escaping="yes">" : "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'menu.enable_edit_mode')"/><xsl:text disable-output-escaping="yes">") 498 . click(function()507 .on("click", function() 499 508 { 500 509 var c_url = gs.xsltParams.library_name + "?a=g&rt=ro&s=ChangeUserEditMode&s1.username=" + gs.userInformation.username + "&s1.enabled=" + ((gs.userInformation.editEnabled == "true") ? "false" : "true"); 501 510 $.ajax(c_url) 502 . success(function(response)511 .done(function(response) 503 512 { 504 513 //location.reload(true); // need to set docEdit=0 if we have just disabled editing … … 508 517 </xsl:text></xsl:when><xsl:otherwise><xsl:variable name="reason"><xsl:choose><xsl:when test="$isEditingAvailable != '1'"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.error_unavailable')"/></xsl:when><xsl:when test="$userHasEditPermission != '1'"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.error_wrong_group')"/></xsl:when></xsl:choose><xsl:text> </xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.error_contact_admin', $siteAdmin)"/></xsl:variable><xsl:text disable-output-escaping="yes"> 509 518 .html("</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.error')"/><xsl:text disable-output-escaping='yes'>") 510 . click(function()519 .on("click", function() 511 520 { 512 521 alert("</xsl:text><xsl:value-of select="$reason"/><xsl:text disable-output-escaping='yes'>"); … … 638 647 <script type="text/javascript"> 639 648 <xsl:text disable-output-escaping="yes"> 640 $("#preferencesButton").button({icon s:{primary:"ui-icon-wrench"}});649 $("#preferencesButton").button({icon: "ui-icon-wrench"}); 641 650 $("#preferencesButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"}); 642 $("#helpButton").button({icon s:{primary:"ui-icon-help"}});651 $("#helpButton").button({icon: "ui-icon-help"}); 643 652 $("#helpButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"}); 644 $("#debugButton").button({icon s:{primary:"ui-icon-info"}});653 $("#debugButton").button({icon: "ui-icon-info"}); 645 654 $("#debugButton .ui-button-text").css({"padding-top":"0px", "padding-bottom":"3px"}); 646 655 </xsl:text> 647 656 <xsl:choose> 648 657 <xsl:when test="/page/pageRequest/userInformation/@username"> 649 <xsl:text disable-output-escaping="yes">$("#loginButton").button({icon s:{primary:"ui-icon-unlocked"}});</xsl:text>658 <xsl:text disable-output-escaping="yes">$("#loginButton").button({icon: "ui-icon-unlocked"});</xsl:text> 650 659 </xsl:when> 651 660 <xsl:otherwise> 652 <xsl:text disable-output-escaping="yes">$("#loginButton").button({icon s:{primary:"ui-icon-locked"}});</xsl:text>661 <xsl:text disable-output-escaping="yes">$("#loginButton").button({icon: "ui-icon-locked"});</xsl:text> 653 662 </xsl:otherwise> 654 663 </xsl:choose> … … 820 829 <script src="interfaces/{$interface_name}/js/map-scripts-shapes-util.js" type="text/javascript"><xsl:text> </xsl:text></script> 821 830 <script src="interfaces/{$interface_name}/js/map-scripts.js" type="text/javascript"><xsl:text> </xsl:text></script> 822 <script type="text/javascript">$(window). load(initializeMapScripts);</script>831 <script type="text/javascript">$(window).on("load", initializeMapScripts);</script> 823 832 </xsl:template> 824 833 … … 834 843 <script src="interfaces/{$interface_name}/js/panoramaMarker.js" type="text/javascript"><xsl:text> </xsl:text></script> 835 844 <script src="interfaces/{$interface_name}/js/panoramaViewer.js" type="text/javascript"><xsl:text> </xsl:text></script> 836 <script type="text/javascript">$(window). load(initPanoramaViewer);$(window).load(_animate);</script>845 <script type="text/javascript">$(window).on("load", initPanoramaViewer);$(window).on("load", _animate);</script> 837 846 </xsl:template> 838 847 -
main/trunk/greenstone3/web/interfaces/default/transform/layouts/toc.xsl
r34579 r36027 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <xsl:stylesheet version="1.0" 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 4 xmlns:java="http://xml.apache.org/xslt/java" 5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil" 6 xmlns:gslib="http://www.greenstone.org/skinning" 7 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" 8 extension-element-prefixes="java util" 9 exclude-result-prefixes="java util gsf"> 10 11 <xsl:template name="rightSidebarTOC"> 12 <div id="rightSidebar"> 13 <xsl:choose> 14 <xsl:when test="@docType = 'simple'"> 15 <xsl:for-each select="."> 16 <xsl:call-template name="displayCoverImage"/> 17 </xsl:for-each> 18 <xsl:call-template name="viewOptions"/> 19 <!--<xsl:text> </xsl:text>--> 20 </xsl:when> 21 <xsl:otherwise> 22 <xsl:for-each select="documentNode[1]"> 23 <xsl:call-template name="displayCoverImage"/> 24 </xsl:for-each> 25 <xsl:call-template name="viewOptions"/> 26 <xsl:call-template name="displayTOC"/> 27 </xsl:otherwise> 28 </xsl:choose> 29 </div> 30 </xsl:template> 31 32 <!-- this is called in the context of the top level node with the metadataList. For a simple doc, this is the document node. For a comples document, this is the first documentNode hcild of the document node. --> 33 <xsl:template name="displayCoverImage"> 34 <xsl:variable name="hasCover"><gsf:metadata name="hascover"/></xsl:variable> 35 <xsl:if test="$hasCover = '1' and (not(/page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']) or /page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']/@value='true')"> 36 <!-- the book's cover image --> 37 <div id="coverImage"> 38 <img> 39 <xsl:attribute name="src"><xsl:value-of select="$httpPath"/>/index/assoc/<gsf:metadata name="assocfilepath" pos="1"/>/cover.jpg</xsl:attribute> 40 </img><xsl:text> </xsl:text> 41 </div> 42 </xsl:if> 43 </xsl:template> 44 45 <xsl:template name="displayTOC"> 46 <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']) or /page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true'"> 47 <div class="tableOfContentsContainer ui-state-default"> 48 <table class="tocTable ui-widget-content"> 49 <tr> 50 <td id="unfloatTOCButton" style="display:none;"> 51 <a href="javascript:floatMenu(false);"> 52 <img class="icon" style="padding-top:3px;"> 53 <xsl:attribute name="src"> 54 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'left_arrow_image')"/> 55 </xsl:attribute> 56 </img> 57 </a> 58 </td> 59 <td style="vertical-align:top; text-align:right;"> 60 <a id="sidebarMinimizeButton" href="javascript:minimizeSidebar();" style="float: right; font-size:0.6em;"> 61 <img class="icon" style="padding-top:3px;"> 62 <xsl:attribute name="src"> 63 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/> 64 </xsl:attribute> 65 </img> 66 </a> 67 <a id="sidebarMaximizeButton" href="javascript:maximizeSidebar();" style="float: right; font-size:0.6em; display:none;"> 68 <img class="icon" style="padding-top:3px;"> 69 <xsl:attribute name="src"> 70 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/> 71 </xsl:attribute> 72 </img> 73 </a> 74 </td> 75 </tr> 76 <tr><td id="tdContentsArea"> 77 <div id="contentsArea"> 78 <!-- showing gotoFavourites display-area takes priority over berryBaskets --> 79 <xsl:choose> 80 <xsl:when test="/page/pageResponse/interfaceOptions/option[@name = 'favouriteBasket']/@value = 'true'"> 81 <!-- show the goto favourites if it's turned on --> 82 <xsl:call-template name="gotoFavourites"/> 83 </xsl:when> 84 <xsl:otherwise> 85 <!-- show the berry basket if it's turned on --> 86 <xsl:call-template name="berryBasket"/> 87 </xsl:otherwise> 88 </xsl:choose> 89 90 <!-- add in expand and contract document links --> 91 <xsl:call-template name="expandContractDocumentLinks"/> 92 <!-- dynamically get the contents (if enabled) --> 93 <xsl:choose> 94 <xsl:when test="/page/pageResponse/document/@docType = 'paged' or /page/pageResponse/document/@docType = 'pagedhierarchy'"> 95 <gsf:image type="Thumb"/> 96 <!-- Table of contents will be dynamically retrieved when viewing a paged document --> 97 <script type="text/javascript"> 98 <xsl:text disable-output-escaping="yes"> 99 $(window).load(function() 100 { 101 retrieveTableOfContentsAndTitles(); 102 <!--setUpFilterButtons();--> 103 }); 104 </xsl:text> 105 </script> 106 107 <div id="tableOfContents"><xsl:text> </xsl:text></div> 108 <div id="tocLoadingImage" style="text-align:center;"> 109 <img src="{util:getInterfaceText($interface_name, /page/@lang, 'loading_image')}"/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.loading')"/><xsl:text>...</xsl:text> 110 </div> 111 <label for="filterText"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.filter_pages')"/><xsl:text>: </xsl:text></label><span id="filterOnButtons" style="float: right;">...</span><input id="filterText" type="text" style="width: 100%;"/> 112 <!-- <xsl:if test="/page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true'">--> 113 <xsl:if test="/page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true' and /page/pageRequest/paramList/param[@name='docEdit']/@value = '1' and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))"> 114 <a href="javascript:extractFilteredPagesToOwnDocument();"><button id="extractDocButton"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.extract_pages')"/></button></a> 115 </xsl:if> 116 </xsl:when> 117 <xsl:when test="not(/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageRequest/paramList/param[@name = 'ec']/@value = '1')"> 118 <div id="tableOfContents"> 119 <div id="tocLoadingImage" style="text-align:center;"> 120 <img src="{util:getInterfaceText($interface_name, /page/@lang, 'loading_image')}"/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.loading')"/><xsl:text>...</xsl:text> 121 </div> 122 </div> 123 <script type="text/javascript"> 124 <xsl:text disable-output-escaping="yes"> 125 $(window).load(function() 126 { 127 retrieveFullTableOfContents(); 128 }); 129 </xsl:text> 130 </script> 131 </xsl:when> 132 <xsl:otherwise> 133 134 <div id="tableOfContents"> 135 <!-- if ed=1 or ec=1 then we have the complete section hierarchy in the page xml source, so we don't need an ajax call to get the table of contents, we just generate it from the list of nodes --> 136 <xsl:attribute name="class"> <!-- do we ever need this ?? --> 137 <xsl:choose> 138 <xsl:when test="count(//documentNode) > 1">visible</xsl:when> 139 <xsl:otherwise>hidden</xsl:otherwise> 140 </xsl:choose> 141 </xsl:attribute> 142 <xsl:for-each select="documentNode"> 143 <xsl:call-template name="documentNodeTOC"/> 144 </xsl:for-each> 145 </div> 146 </xsl:otherwise> 147 </xsl:choose> 148 </div> 149 </td></tr> 150 </table> 151 </div> 152 </xsl:if> 153 </xsl:template> 154 155 <!-- This template is used to display the table of contents --> 156 <xsl:template name="documentNodeTOC"> 157 <ul> 158 <table><tr> 159 <!-- The expand/collapse button (not displayed for the top level node) --> 160 <xsl:if test="util:hashToDepthClass(@nodeID) != 'sectionHeaderDepthTitle'"> 161 <td> 162 <xsl:choose> 163 <xsl:when test="documentNode"> 164 <img id="ttoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon"> 165 <xsl:attribute name="src"> 166 <xsl:choose> 167 <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageResponse/document/@selectedNode = @nodeID"> 168 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/> 169 </xsl:when> 170 <xsl:otherwise> 171 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/> 172 </xsl:otherwise> 173 </xsl:choose> 174 </xsl:attribute> 175 </img> 176 </xsl:when> 177 <xsl:otherwise> 178 <xsl:attribute name="class">emptyIcon</xsl:attribute> 179 </xsl:otherwise> 180 </xsl:choose> 181 </td> 182 </xsl:if> 183 184 <!-- The chapter/page icon --> 185 <td> 186 <img> 187 <xsl:if test="not(documentNode)"> 188 <xsl:attribute name="class">leafNode</xsl:attribute> 189 </xsl:if> 190 191 <xsl:attribute name="src"> 192 <xsl:choose> 193 <xsl:when test="not(documentNode)"> 194 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'page_image')"/> 195 </xsl:when> 196 <xsl:otherwise> 197 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'chapter_image')"/> 198 </xsl:otherwise> 199 </xsl:choose> 200 </xsl:attribute> 201 </img> 202 </td> 203 204 <!-- The section name, links to the section in the document --> 205 <td class="tocTextCell"> 206 <a id="toclink{@nodeID}" href="javascript:focusSection('{@nodeID}');"> 207 <xsl:if test="util:hashToSectionId(@nodeID)"> 208 <span class="tocSectionNumber"><xsl:value-of select="util:hashToSectionId(@nodeID)"/><!--<xsl:text> </xsl:text>--></span></xsl:if><span class="tocSectionTitle"><xsl:call-template name="sectionHeading"/></span></a> 209 210 </td> 211 </tr></table> 212 213 <!-- display any child items --> 214 <xsl:if test="documentNode"> 215 <li id="toc{@nodeID}"> 216 <xsl:attribute name="style"> 217 <xsl:choose> 218 <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageResponse/document/@selectedNode = @nodeID"> 219 <xsl:text>display:block;</xsl:text> 220 </xsl:when> 221 <xsl:otherwise> 222 <xsl:text>display:none;</xsl:text> 223 </xsl:otherwise> 224 </xsl:choose> 225 </xsl:attribute> 226 <xsl:for-each select="documentNode"> 227 <xsl:call-template name="documentNodeTOC"/> 228 </xsl:for-each> 229 </li> 230 </xsl:if> 231 232 </ul> 233 </xsl:template> 234 235 <xsl:template name="viewOptions"> 236 <div id="viewAndZoomOptions" class="ui-state-default ui-corner-all"> 237 <ul id="viewOptions"> 238 <!-- Paged-image document options --> 239 <xsl:if test="count(//documentNode/metadataList/metadata[@name = 'Screen']) > 0 or /page/pageResponse/document/@docType = 'paged' or /page/pageResponse/document/@docType = 'pagedhierarchy'"> 240 <!-- view selection option --> 241 <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='viewSelection']) or /page/pageResponse/format[@type='display']/gsf:option[@name='viewSelection']/@value='true'"> 242 <li id="pagedImageOptions"> 243 <select id="viewSelection" onchange="changeView();"> 244 <xsl:choose> 245 <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'image'"> 246 <option><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.default_view')"/></option> 247 <option selected="true"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.image_view')"/></option> 248 <option><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.text_view')"/></option> 249 </xsl:when> 250 <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'"> 251 <option><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.default_view')"/></option> 252 <option><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.image_view')"/></option> 253 <option selected="true"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.text_view')"/></option> 254 </xsl:when> 255 <xsl:otherwise> 256 <option selected="true"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.default_view')"/></option> 257 <option><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.image_view')"/></option> 258 <option><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.text_view')"/></option> 259 </xsl:otherwise> 260 </xsl:choose> 261 </select> 262 </li> 263 </xsl:if> 264 <!-- Slide-show options --> 265 <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='slideShow']) or /page/pageResponse/format[@type='display']/gsf:option[@name='slideShow']/@value='true'"> 266 <li id="slideShowOptions"> 267 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.slideshowTooltip')"/></xsl:attribute> 268 <img onclick="showSlideShow()"> 269 <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'slideshow_image')"/></xsl:attribute> 270 </img> 271 </li> 272 </xsl:if> 273 </xsl:if> 274 <!-- Realistic books link --> 275 <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'"> 276 <li> 277 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.realisticBooksTooltip')"/></xsl:attribute> 278 <img id="rbOptionImage" onclick="bookInit();"> 279 <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'realistic_books_image')"/></xsl:attribute> 280 </img> 281 <input id="rbOption" type="checkbox" onclick="bookInit();" class="optionCheckBox"/> 282 </li> 283 </xsl:if> 284 285 <!-- Highlight on/off button --> 286 <xsl:if test="util:contains(/page/pageRequest/paramList/param[@name = 'p.s']/@value, 'Query') and not(metadataList/metadata[@name='NoText']) and not(/page/pageResponse/format[@type='display']/gsf:option[@name='disableSearchTermHighlighting']/@value='true')"> 287 <li> 288 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.highlightTooltip')"/></xsl:attribute> 289 <img onclick="swapHighlight(true);"> 290 <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'highlight_image')"/></xsl:attribute> 291 </img> 292 <input id="highlightOption" type="checkbox" class="optionCheckBox" onclick="swapHighlight(false);"> 293 <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'hl']/@value = 'off')"> 294 <xsl:attribute name="checked">checked</xsl:attribute> 295 </xsl:if> 296 </input> 297 </li> 298 </xsl:if><xsl:text> </xsl:text> 299 300 <!-- Zoom on/off button --> 301 <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']) or /page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']/@value='false'"> 302 303 <li id="zoomOptions" style="display:none;"> 304 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.zoomTooltip')"/></xsl:attribute> 305 <img id="zoomToggleImage"> 306 <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'zoom_image')"/></xsl:attribute> 307 </img> 308 <input id="zoomToggle" type="checkbox"/> 309 <script type="text/javascript"> 310 <xsl:text disable-output-escaping="yes"> 311 $("#zoomToggle").change(function() 312 { 313 _imageZoomEnabled = $("#zoomToggle").prop("checked"); 314 }); 315 316 $("#zoomToggleImage").click(function() 317 { 318 $("#zoomToggle").prop("checked", !$("#zoomToggle").prop("checked")); 319 _imageZoomEnabled = $("#zoomToggle").prop("checked"); 320 }); 321 </xsl:text> 322 </script> 323 </li> 324 </xsl:if> 325 <!-- Floating TOC on/off button --> 326 <xsl:if test="count(//documentNode) > 0 and (not(/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']) or /page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true')"> 327 <li id="floatingTOCOptions"> 328 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.floatingTooltip')"/></xsl:attribute> 329 <img id="floatTOCToggleImage"> 330 <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'float_toc_image')"/></xsl:attribute> 331 </img> 332 <input id="floatTOCToggle" type="checkbox"/> 333 <script type="text/javascript"> 334 <xsl:text disable-output-escaping="yes"> 335 $("#floatTOCToggle").prop("checked", false); 336 $("#floatTOCToggle").click(function() 337 { 338 floatMenu($("#floatTOCToggle").prop("checked")); 339 }); 340 341 $("#floatTOCToggleImage").click(function() 342 { 343 $("#floatTOCToggle").prop("checked", !$("#floatTOCToggle").prop("checked")) 344 floatMenu($("#floatTOCToggle").prop("checked")); 345 }); 346 </xsl:text> 347 </script> 348 </li> 349 <xsl:if test="/page/pageRequest/paramList/param[@name='ftoc']/@value = '1'"> 350 <script type="text/javascript"> 351 <xsl:text disable-output-escaping="yes"> 352 $(window).load(function() 353 { 354 $("#floatTOCToggle").prop("checked", true); 355 floatMenu(true); 356 }); 357 </xsl:text> 358 </script> 359 </xsl:if> 360 </xsl:if> 361 </ul> 362 <div style="clear:both;"><xsl:text> </xsl:text></div> 363 </div> 364 </xsl:template> 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 4 xmlns:java="http://xml.apache.org/xslt/java" 5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil" 6 xmlns:gslib="http://www.greenstone.org/skinning" 7 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" 8 extension-element-prefixes="java util" 9 exclude-result-prefixes="java util gsf"> 10 11 <xsl:template name="rightSidebarTOC"> 12 <div id="rightSidebar"> 13 <xsl:choose> 14 <xsl:when test="@docType = 'simple'"> 15 <xsl:for-each select="."> 16 <xsl:call-template name="displayCoverImage"/> 17 </xsl:for-each> 18 <xsl:call-template name="viewOptions"/> 19 <!--<xsl:text> </xsl:text>--> 20 </xsl:when> 21 <xsl:otherwise> 22 <xsl:for-each select="documentNode[1]"> 23 <xsl:call-template name="displayCoverImage"/> 24 </xsl:for-each> 25 <xsl:call-template name="viewOptions"/> 26 <xsl:call-template name="displayTOC"/> 27 </xsl:otherwise> 28 </xsl:choose> 29 </div> 30 </xsl:template> 31 32 <!-- this is called in the context of the top level node with the metadataList. For a simple doc, this is the document node. For a comples document, this is the first documentNode hcild of the document node. --> 33 <xsl:template name="displayCoverImage"> 34 <xsl:variable name="hasCover"> 35 <gsf:metadata name="hascover"/> 36 </xsl:variable> 37 <xsl:if test="$hasCover = '1' and (not(/page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']) or /page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']/@value='true')"> 38 <!-- the book's cover image --> 39 <div id="coverImage"> 40 <img> 41 <xsl:attribute name="src"> 42 <xsl:value-of select="$httpPath"/>/index/assoc/<gsf:metadata name="assocfilepath" pos="1"/>/cover.jpg 43 </xsl:attribute> 44 </img> 45 <xsl:text> </xsl:text> 46 </div> 47 </xsl:if> 48 </xsl:template> 49 50 <xsl:template name="displayTOC"> 51 <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']) or /page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true'"> 52 <div class="tableOfContentsContainer ui-state-default"> 53 <table class="tocTable ui-widget-content"> 54 <tr> 55 <td id="unfloatTOCButton" style="display:none;"> 56 <a href="javascript:floatMenu(false);"> 57 <img class="icon" style="padding-top:3px;"> 58 <xsl:attribute name="src"> 59 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'left_arrow_image')"/> 60 </xsl:attribute> 61 </img> 62 </a> 63 </td> 64 <td style="vertical-align:top; text-align:right;"> 65 <a id="sidebarMinimizeButton" href="javascript:minimizeSidebar();" style="float: right; font-size:0.6em;"> 66 <img class="icon" style="padding-top:3px;"> 67 <xsl:attribute name="src"> 68 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/> 69 </xsl:attribute> 70 </img> 71 </a> 72 <a id="sidebarMaximizeButton" href="javascript:maximizeSidebar();" style="float: right; font-size:0.6em; display:none;"> 73 <img class="icon" style="padding-top:3px;"> 74 <xsl:attribute name="src"> 75 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/> 76 </xsl:attribute> 77 </img> 78 </a> 79 </td> 80 </tr> 81 <tr> 82 <td id="tdContentsArea"> 83 <div id="contentsArea"> 84 <!-- showing gotoFavourites display-area takes priority over berryBaskets --> 85 <xsl:choose> 86 <xsl:when test="/page/pageResponse/interfaceOptions/option[@name = 'favouriteBasket']/@value = 'true'"> 87 <!-- show the goto favourites if it's turned on --> 88 <xsl:call-template name="gotoFavourites"/> 89 </xsl:when> 90 <xsl:otherwise> 91 <!-- show the berry basket if it's turned on --> 92 <xsl:call-template name="berryBasket"/> 93 </xsl:otherwise> 94 </xsl:choose> 95 96 <!-- add in expand and contract document links --> 97 <xsl:call-template name="expandContractDocumentLinks"/> 98 <!-- dynamically get the contents (if enabled) --> 99 <xsl:choose> 100 <xsl:when test="/page/pageResponse/document/@docType = 'paged' or /page/pageResponse/document/@docType = 'pagedhierarchy'"> 101 <gsf:image type="Thumb"/> 102 <!-- Table of contents will be dynamically retrieved when viewing a paged document --> 103 <script type="text/javascript"> 104 <xsl:text disable-output-escaping="yes"> 105 $(window).on("load", function() 106 { 107 retrieveTableOfContentsAndTitles(); 108 <!--setUpFilterButtons();--> 109 }); 110 </xsl:text> 111 </script> 112 113 <div id="tableOfContents"> 114 <xsl:text> </xsl:text> 115 </div> 116 117 <div id="tocLoadingImage" style="text-align:center;"> 118 <img src="{util:getInterfaceText($interface_name, /page/@lang, 'loading_image')}"/> 119 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.loading')"/> 120 <xsl:text>...</xsl:text> 121 </div> 122 123 <label for="filterText"> 124 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.filter_pages')"/> 125 <xsl:text>: </xsl:text> 126 </label> 127 <span id="filterOnButtons" style="float: right;">...</span> 128 <input id="filterText" type="text" style="width: 100%;" /> 129 130 <!-- <xsl:if test="/page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true'"> --> 131 <xsl:if test="/page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true' and /page/pageRequest/paramList/param[@name='docEdit']/@value = '1' and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))"> 132 <a href="javascript:extractFilteredPagesToOwnDocument();"> 133 <button id="extractDocButton"> 134 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.extract_pages')"/> 135 </button> 136 </a> 137 </xsl:if> 138 </xsl:when> 139 <xsl:when test="not(/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageRequest/paramList/param[@name = 'ec']/@value = '1')"> 140 <div id="tableOfContents"> 141 <div id="tocLoadingImage" style="text-align:center;"> 142 <img src="{util:getInterfaceText($interface_name, /page/@lang, 'loading_image')}"/> 143 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.loading')"/> 144 <xsl:text>...</xsl:text> 145 </div> 146 </div> 147 <script type="text/javascript"> 148 <xsl:text disable-output-escaping="yes"> 149 $(window).on("load", function() 150 { 151 retrieveFullTableOfContents(); 152 }); 153 </xsl:text> 154 </script> 155 </xsl:when> 156 <xsl:otherwise> 157 158 <div id="tableOfContents"> 159 <!-- if ed=1 or ec=1 then we have the complete section hierarchy in the page xml source, so we don't need an ajax call to get the table of contents, we just generate it from the list of nodes --> 160 <xsl:attribute name="class"> <!-- do we ever need this ?? --> 161 <xsl:choose> 162 <xsl:when test="count(//documentNode) > 1">visible</xsl:when> 163 <xsl:otherwise>hidden</xsl:otherwise> 164 </xsl:choose> 165 </xsl:attribute> 166 167 <xsl:for-each select="documentNode"> 168 <xsl:call-template name="documentNodeTOC"/> 169 </xsl:for-each> 170 </div> 171 </xsl:otherwise> 172 </xsl:choose> 173 </div> 174 </td> 175 </tr> 176 </table> 177 </div> 178 </xsl:if> 179 </xsl:template> 180 181 <!-- This template is used to display the table of contents --> 182 <xsl:template name="documentNodeTOC"> 183 <table> 184 <tr> 185 <!-- The expand/collapse button (not displayed for the top level node) --> 186 <xsl:if test="util:hashToDepthClass(@nodeID) != 'sectionHeaderDepthTitle'"> 187 <td> 188 <xsl:choose> 189 <xsl:when test="documentNode"> 190 <img id="ttoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon"> 191 <xsl:attribute name="src"> 192 <xsl:choose> 193 <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageResponse/document/@selectedNode = @nodeID"> 194 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/> 195 </xsl:when> 196 <xsl:otherwise> 197 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/> 198 </xsl:otherwise> 199 </xsl:choose> 200 </xsl:attribute> 201 </img> 202 </xsl:when> 203 <xsl:otherwise> 204 <xsl:attribute name="class">emptyIcon</xsl:attribute> 205 206 <!-- 207 Prevent the <td> element being self-closed, which would be invalid according to the HTML spec. 208 This is also an identified issue in jQuery > 3.5.0 209 --> 210 <xsl:text> </xsl:text> 211 </xsl:otherwise> 212 </xsl:choose> 213 </td> 214 </xsl:if> 215 216 <!-- The chapter/page icon --> 217 <td> 218 <img> 219 <xsl:if test="not(documentNode)"> 220 <xsl:attribute name="class">leafNode</xsl:attribute> 221 </xsl:if> 222 223 <xsl:attribute name="src"> 224 <xsl:choose> 225 <xsl:when test="not(documentNode)"> 226 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'page_image')"/> 227 </xsl:when> 228 <xsl:otherwise> 229 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'chapter_image')"/> 230 </xsl:otherwise> 231 </xsl:choose> 232 </xsl:attribute> 233 </img> 234 </td> 235 236 <!-- The section name, links to the section in the document --> 237 <td class="tocTextCell"> 238 <a id="toclink{@nodeID}" href="javascript:focusSection('{@nodeID}');"> 239 <xsl:if test="util:hashToSectionId(@nodeID)"> 240 <span class="tocSectionNumber"> 241 <xsl:value-of select="util:hashToSectionId(@nodeID)"/><!--<xsl:text> </xsl:text>--> 242 </span> 243 </xsl:if> 244 <span class="tocSectionTitle"> 245 <xsl:call-template name="sectionHeading"/> 246 </span> 247 </a> 248 </td> 249 </tr> 250 </table> 251 252 <!-- display any child items --> 253 <xsl:if test="documentNode"> 254 <div id="toc{@nodeID}"> 255 <xsl:attribute name="style"> 256 <xsl:choose> 257 <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageResponse/document/@selectedNode = @nodeID"> 258 <xsl:text>display:block;</xsl:text> 259 </xsl:when> 260 <xsl:otherwise> 261 <xsl:text>display:none;</xsl:text> 262 </xsl:otherwise> 263 </xsl:choose> 264 </xsl:attribute> 265 <xsl:for-each select="documentNode"> 266 <xsl:call-template name="documentNodeTOC"/> 267 </xsl:for-each> 268 </div> 269 </xsl:if> 270 </xsl:template> 271 272 <xsl:template name="viewOptions"> 273 <div id="viewAndZoomOptions" class="ui-state-default ui-corner-all"> 274 <ul id="viewOptions"> 275 <!-- Paged-image document options --> 276 <xsl:if test="count(//documentNode/metadataList/metadata[@name = 'Screen']) > 0 or /page/pageResponse/document/@docType = 'paged' or /page/pageResponse/document/@docType = 'pagedhierarchy'"> 277 <!-- view selection option --> 278 <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='viewSelection']) or /page/pageResponse/format[@type='display']/gsf:option[@name='viewSelection']/@value='true'"> 279 <li id="pagedImageOptions"> 280 <select id="viewSelection" onchange="changeView();"> 281 <xsl:choose> 282 <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'image'"> 283 <option> 284 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.default_view')"/> 285 </option> 286 <option selected="true"> 287 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.image_view')"/> 288 </option> 289 <option> 290 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.text_view')"/> 291 </option> 292 </xsl:when> 293 <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'"> 294 <option> 295 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.default_view')"/> 296 </option> 297 <option> 298 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.image_view')"/> 299 </option> 300 <option selected="true"> 301 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.text_view')"/> 302 </option> 303 </xsl:when> 304 <xsl:otherwise> 305 <option selected="true"> 306 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.default_view')"/> 307 </option> 308 <option> 309 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.image_view')"/> 310 </option> 311 <option> 312 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.text_view')"/> 313 </option> 314 </xsl:otherwise> 315 </xsl:choose> 316 </select> 317 </li> 318 </xsl:if> 319 320 <!-- Slide-show options --> 321 <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='slideShow']) or /page/pageResponse/format[@type='display']/gsf:option[@name='slideShow']/@value='true'"> 322 <li id="slideShowOptions"> 323 <xsl:attribute name="title"> 324 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.slideshowTooltip')"/> 325 </xsl:attribute> 326 <img onclick="showSlideShow()"> 327 <xsl:attribute name="src"> 328 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'slideshow_image')"/> 329 </xsl:attribute> 330 </img> 331 </li> 332 </xsl:if> 333 </xsl:if> 334 <!-- Realistic books link --> 335 <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'"> 336 <li> 337 <xsl:attribute name="title"> 338 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.realisticBooksTooltip')"/> 339 </xsl:attribute> 340 <img id="rbOptionImage" onclick="bookInit();"> 341 <xsl:attribute name="src"> 342 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'realistic_books_image')"/> 343 </xsl:attribute> 344 </img> 345 <input id="rbOption" type="checkbox" onclick="bookInit();" class="optionCheckBox"/> 346 </li> 347 </xsl:if> 348 349 <!-- Highlight on/off button --> 350 <xsl:if test="util:contains(/page/pageRequest/paramList/param[@name = 'p.s']/@value, 'Query') and not(metadataList/metadata[@name='NoText']) and not(/page/pageResponse/format[@type='display']/gsf:option[@name='disableSearchTermHighlighting']/@value='true')"> 351 <li> 352 <xsl:attribute name="title"> 353 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.highlightTooltip')"/> 354 </xsl:attribute> 355 <img onclick="swapHighlight(true);"> 356 <xsl:attribute name="src"> 357 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'highlight_image')"/> 358 </xsl:attribute> 359 </img> 360 <input id="highlightOption" type="checkbox" class="optionCheckBox" onclick="swapHighlight(false);"> 361 <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'hl']/@value = 'off')"> 362 <xsl:attribute name="checked">checked</xsl:attribute> 363 </xsl:if> 364 </input> 365 </li> 366 </xsl:if> 367 <xsl:text> </xsl:text> 368 369 <!-- Zoom on/off button --> 370 <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']) or /page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']/@value='false'"> 371 <li id="zoomOptions" style="display:none;"> 372 <xsl:attribute name="title"> 373 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.zoomTooltip')"/> 374 </xsl:attribute> 375 <img id="zoomToggleImage"> 376 <xsl:attribute name="src"> 377 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'zoom_image')"/> 378 </xsl:attribute> 379 </img> 380 <input id="zoomToggle" type="checkbox"/> 381 <script type="text/javascript"> 382 <xsl:text disable-output-escaping="yes"> 383 $("#zoomToggle").change(function() 384 { 385 _imageZoomEnabled = $("#zoomToggle").prop("checked"); 386 }); 387 388 $("#zoomToggleImage").on("click", function() 389 { 390 $("#zoomToggle").prop("checked", !$("#zoomToggle").prop("checked")); 391 _imageZoomEnabled = $("#zoomToggle").prop("checked"); 392 }); 393 </xsl:text> 394 </script> 395 </li> 396 </xsl:if> 397 398 <!-- Floating TOC on/off button --> 399 <xsl:if test="count(//documentNode) > 0 and (not(/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']) or /page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true')"> 400 <li id="floatingTOCOptions"> 401 <xsl:attribute name="title"> 402 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.floatingTooltip')"/> 403 </xsl:attribute> 404 <img id="floatTOCToggleImage"> 405 <xsl:attribute name="src"> 406 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'float_toc_image')"/> 407 </xsl:attribute> 408 </img> 409 <input id="floatTOCToggle" type="checkbox"/> 410 <script type="text/javascript"> 411 <xsl:text disable-output-escaping="yes"> 412 $("#floatTOCToggle").prop("checked", false); 413 $("#floatTOCToggle").on("click", function() 414 { 415 floatMenu($("#floatTOCToggle").prop("checked")); 416 }); 417 418 $("#floatTOCToggleImage").on("click", function() 419 { 420 $("#floatTOCToggle").prop("checked", !$("#floatTOCToggle").prop("checked")) 421 floatMenu($("#floatTOCToggle").prop("checked")); 422 }); 423 </xsl:text> 424 </script> 425 </li> 426 <xsl:if test="/page/pageRequest/paramList/param[@name='ftoc']/@value = '1'"> 427 <script type="text/javascript"> 428 <xsl:text disable-output-escaping="yes"> 429 $(window).on("load", function() 430 { 431 $("#floatTOCToggle").prop("checked", true); 432 floatMenu(true); 433 }); 434 </xsl:text> 435 </script> 436 </xsl:if> 437 </xsl:if> 438 </ul> 439 <div style="clear:both;"> 440 <xsl:text> </xsl:text> 441 </div> 442 </div> 443 </xsl:template> 365 444 </xsl:stylesheet> -
main/trunk/greenstone3/web/interfaces/default/transform/pages/authen.xsl
r35828 r36027 120 120 var </xsl:text><xsl:value-of select="$message-pos"/><xsl:text disable-output-escaping="yes"> = "</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.delete_warning')"/><xsl:text disable-output-escaping="yes">" + </xsl:text><xsl:value-of select="$user-pos"/><xsl:text disable-output-escaping="yes"> + "?"; 121 121 var button = $("#delUser" + </xsl:text><xsl:value-of select="$user-pos"/><xsl:text disable-output-escaping="yes">); 122 button. click(function()122 button.on("click", function() 123 123 { 124 124 if(confirm(</xsl:text><xsl:value-of select="$message-pos"/><xsl:text disable-output-escaping="yes">)) … … 363 363 </tr> 364 364 <xsl:if test="/page/pageResponse/authenticationNode/service/@operation = 'AddUser'"> 365 365 <!-- if you want to add a default group to the groups field with AdddUser, then use this instead, replacing xxx with the default group/s 366 366 <xsl:call-template name="addGroupInputField"><xsl:with-param name="default_value">xxx</xsl:with-param></xsl:call-template>--> 367 367 <xsl:call-template name="addGroupInputField"/> 368 368 <tr> 369 369 <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'authen.comment')"/><xsl:text>: </xsl:text></td> … … 472 472 <script type="text/javascript"> 473 473 <xsl:text disable-output-escaping="yes"> 474 $("#submitButton"). click(function()474 $("#submitButton").on("click", function() 475 475 { 476 476 var passwordOne = $("#passwordOne"); -
main/trunk/greenstone3/web/interfaces/default/transform/pages/classifier.xsl
r35827 r36027 31 31 <xsl:text> </xsl:text> 32 32 </script> 33 <script type="text/javascript">$(window). load(openStoredClassifiers);</script>33 <script type="text/javascript">$(window).on("load", openStoredClassifiers);</script> 34 34 35 35 <!-- -
main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl
r35170 r36027 366 366 <xsl:text disable-output-escaping="yes"> 367 367 368 $(window). load(function()368 $(window).on("load", function() 369 369 { 370 370 if(gs.cgiParams.docEdit == "1") … … 518 518 <script type="text/javascript"> 519 519 <xsl:text disable-output-escaping="yes"> 520 $(window). load(function()520 $(window).on("load", function() 521 521 { 522 522 var sectionID = gs.cgiParams.d; … … 554 554 <script type="text/javascript"> 555 555 <xsl:text disable-output-escaping="yes"> 556 $(window). load(function()556 $(window).on("load", function() 557 557 { 558 558 loadTopLevelPage(function() -
main/trunk/greenstone3/web/interfaces/default/transform/pages/pref.xsl
r33755 r36027 34 34 <input type='hidden' name='c' value="{$collName}"/> 35 35 36 <button type="button" data-cc="c-settings" class="cc-link">Cookie Consent Manager</button> 36 37 <p id="SaveInstructions" style="color:red; text-align:center; display:none;"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.set_prefs_help')"/></p> 37 38 <xsl:call-template name="presentation-prefs"/> … … 106 107 107 108 YAHOO.util.Event.addListener(window, 'load', pageLoad); 108 $(window). bind("beforeunload", unsavedChanges);109 $(window).on("beforeunload", unsavedChanges); 109 110 </xsl:text></script> 110 111 </xsl:template> … … 204 205 </xsl:if> 205 206 </xsl:template> 206 <xsl:template name="book-param"> 207 <!-- tidy (?) --> 208 <xsl:variable name="tidyoption"><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='tidyoption']"/></xsl:variable> 209 <xsl:if test="$tidyoption='tidy'"> 210 <xsl:variable name="book"> 211 <xsl:choose> 212 <xsl:when test="/page/pageRequest/paramList/param[@name='book']"> 213 <xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/> 214 </xsl:when> 215 <xsl:when test="/page/pageRequest/paramList/param[@name='s1.book']"> 216 <xsl:value-of select="/page/pageRequest/paramList/param[@name='s1.book']/@value"/> 217 </xsl:when> 218 <xsl:otherwise>off</xsl:otherwise> 219 </xsl:choose> 220 </xsl:variable> 221 <div class="paramLabel"> 222 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.book')"/> 223 </div> 224 <div class="paramValue"> 225 <select name="s1.book"> 226 <option value="on"><xsl:if test="$book='on'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.on')"/></option> 227 <option value="off"><xsl:if test="$book='off'"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.off')"/></option> 228 </select> 229 </div> 230 <br class="clear"/> 231 </xsl:if> 232 </xsl:template> 233 <xsl:template name="theme-change-param"> 234 <!-- Theme Changer --> 235 <xsl:if test="/page/pageRequest/userInformation and util:contains(/page/pageRequest/userInformation/@groups, 'administrator')"> 236 <div> 237 <div class="paramLabel"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.theme')"/></div> 238 <script type="text/javascript"> 239 <xsl:text disable-output-escaping="yes"> 240 $(document).ready(function(){ 241 $("#switcher").themeswitcher({ 242 imgpath: "interfaces/" + gs.xsltParams.interface_name + "/style/images/", 243 additionalThemes: [ 244 {title:gs.text.pref.theme_default, name:"custom-theme0", icon:"theme_90_greenstone.png", url:"interfaces/" + gs.xsltParams.interface_name + "/style/themes/main/jquery-ui-1.8.16.custom.css"}, 245 {title:gs.text.pref.theme_custom1, name:"custom-theme1", icon:"theme_90_start_menu.png", url:"interfaces/" + gs.xsltParams.interface_name + "/style/themes/alt_theme_1/jquery-ui-1.8.16.custom.css"}, 246 {title: gs.text.pref.theme_custom2, name:"custom-theme2", icon:"theme_90_mint_choco.png", url:"interfaces/" + gs.xsltParams.interface_name + "/style/themes/alt_theme_2/jquery-ui-1.8.16.custom.css"}, 247 248 ] 249 }); 250 }); 251 </xsl:text> 252 </script> 253 <div class="paramValue" id="switcher"><xsl:text> </xsl:text></div> 254 </div> 255 <br class="clear"/> 256 </xsl:if> 257 </xsl:template> 207 208 <xsl:template name="book-param"> 209 <!-- tidy (?) --> 210 <xsl:variable name="tidyoption"> 211 <xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='tidyoption']" /> 212 </xsl:variable> 213 214 <xsl:if test="$tidyoption='tidy'"> 215 <xsl:variable name="book"> 216 <xsl:choose> 217 <xsl:when test="/page/pageRequest/paramList/param[@name='book']"> 218 <xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value" /> 219 </xsl:when> 220 <xsl:when test="/page/pageRequest/paramList/param[@name='s1.book']"> 221 <xsl:value-of select="/page/pageRequest/paramList/param[@name='s1.book']/@value" /> 222 </xsl:when> 223 <xsl:otherwise>off</xsl:otherwise> 224 </xsl:choose> 225 </xsl:variable> 226 <div class="paramLabel"> 227 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.book')" /> 228 </div> 229 <div class="paramValue"> 230 <select name="s1.book"> 231 <option value="on"> 232 <xsl:if test="$book='on'"> 233 <xsl:attribute name="selected"></xsl:attribute> 234 </xsl:if> 235 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.on')" /> 236 </option> 237 <option value="off"> 238 <xsl:if test="$book='off'"> 239 <xsl:attribute name="selected"></xsl:attribute> 240 </xsl:if> 241 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.off')" /> 242 </option> 243 </select> 244 </div> 245 <br class="clear"/> 246 </xsl:if> 247 </xsl:template> 248 249 <xsl:template name="theme-change-param"> 250 <!-- Theme Changer --> 251 <xsl:if test="/page/pageRequest/userInformation and util:contains(/page/pageRequest/userInformation/@groups, 'administrator')"> 252 <div> 253 <div class="paramLabel"> 254 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.theme')" /> 255 </div> 256 257 <script type="text/javascript"> 258 <xsl:text disable-output-escaping="yes"> 259 $(function() { 260 $("#switcher").themeswitcher({ 261 imgpath: "interfaces/" + gs.xsltParams.interface_name + "/style/images/", 262 additionalThemes: [ 263 { 264 title: gs.text.pref.theme_default, 265 name: "custom-theme0", 266 icon: "theme_90_greenstone.png", 267 url: "interfaces/" + gs.xsltParams.interface_name + "/style/themes/main/jquery-ui.theme.css" 268 }, 269 ] 270 }); 271 }); 272 </xsl:text> 273 </script> 274 275 <div class="paramValue" id="switcher"> 276 <xsl:text> </xsl:text> 277 </div> 278 </div> 279 <br class="clear" /> 280 </xsl:if> 281 </xsl:template> 258 282 259 283 </xsl:stylesheet> -
main/trunk/greenstone3/web/interfaces/default/transform/pages/verify.xsl
r34102 r36027 72 72 type: 'POST', 73 73 data: $('#verifyform').serialize(), 74 success: function(){74 done: function(){ 75 75 window.location.href='</xsl:text><xsl:value-of select="$URL"/><xsl:text disable-output-escaping="yes">'; 76 76 }
Note:
See TracChangeset
for help on using the changeset viewer.