- Timestamp:
- 2022-02-01T11:54:46+13:00 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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();
Note:
See TracChangeset
for help on using the changeset viewer.