Ignore:
Timestamp:
2022-02-01T11:54:46+13:00 (2 years ago)
Author:
cstephen
Message:

Migrate to using jQuery3 and jQuery-UI-1.13.2; and integrate cookie consent manager

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/debug_scripts.js

    r27809 r36027  
    131131    {
    132132        $.ajax(document.URL)
    133         .success(function(response)
     133        .done(function(response)
    134134        {
    135135            //Get the body text from the response
     
    156156            addMouseEventsToDebugElements(debugElems);
    157157        })
    158         .error(function()
     158        .fail(function()
    159159        {
    160160            alert("There was an error reloading the page, please reload manually.");
     
    224224       
    225225        _backButton = $("<button>Back button</button>").attr("id", "veBack");
    226         _backButton.click(backForwardFunction);
     226        _backButton.on("click", backForwardFunction);
    227227        _styleFunctions.push(function(){_backButton.button({icons:{primary:"ui-icon-triangle-1-w"}, text:false, disabled:true})});
    228228   
    229229        _forwardButton = $("<button>Forward button</button>").attr("id", "veForwards");
    230         _forwardButton.click(backForwardFunction);
     230        _forwardButton.on("click", backForwardFunction);
    231231        _styleFunctions.push(function(){_forwardButton.button({icons:{primary:"ui-icon-triangle-1-e"}, text:false, disabled:true})});
    232232
    233233        //Changes the template list to what is currently selected
    234234        _currentSelectionButton = $("<button>Current selection button</button>");
    235         _currentSelectionButton.click(function()
     235        _currentSelectionButton.on("click", function()
    236236        {
    237237            _fileSelector.find("option").eq(0).prop("selected", true);
     
    259259        //Used to enable the selector to get the templates of a particular area of the page
    260260        _enableSelectorButton = $("<button>Select an element</button>");
    261         _enableSelectorButton.click(function()
     261        _enableSelectorButton.on("click", function()
    262262        {
    263263            _enableSelectorButton.button("option", "label", "Select new element");
    264             $("a").click(function(e)
     264            $("a").on("click", function(e)
    265265            {
    266266                e.preventDefault();
     
    274274        //Used to minimise/restore the editor
    275275        _closeEditorButton = $("<button>Close editor</button>");
    276         _closeEditorButton.click(function()
     276        _closeEditorButton.on("click", function()
    277277        {
    278278            if(_closeEditorButton.button("option", "label") == "Close editor")
     
    292292        //Used to save any changes that have been made to this template
    293293        _saveButton = $("<button>Save changes</button>");
    294         _saveButton.click(function()
     294        _saveButton.on("click", function()
    295295        {
    296296            if(_editor)
     
    329329
    330330                $.post(url, parameters)
    331                 .success(function()
     331                .done(function()
    332332                {
    333333                    $.ajax(gs.xsltParams.library_name + "?a=s&sa=c")
    334                     .success(function()
     334                    .done(function()
    335335                    {
    336336                        partialPageReload(function(){$.unblockUI();});
    337337                    })
    338                     .error(function()
     338                    .fail(function()
    339339                    {
    340340                        $.unblockUI();
    341341                        alert("Error reloading collection.");
    342342                    })
    343                     .complete(function()
     343                    .always(function()
    344344                    {
    345345                        _saveButton.button("option", "disabled", false);
    346346                    });
    347347                })
    348                 .error(function()
     348                .fail(function()
    349349                {
    350350                    alert("There was an error sending the request to the server, please try again.");
     
    356356        //Used to switch between the XML and Visual editors
    357357        _swapEditorButton = $("<button>Switch to XML editor</button>");
    358         _swapEditorButton.button().click(function()
     358        _swapEditorButton.button().on("click", function()
    359359        {
    360360            if(_vEditor && _textEditor)
     
    402402
    403403        undoButton = $("<button>Undo</button>");
    404         undoButton.click(function()
     404        undoButton.on("click", function()
    405405        {
    406406            if(_isVisualEditor)
     
    497497        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;
    498498        $.ajax(url)
    499         .success(function(response)
     499        .done(function(response)
    500500        {
    501501            var listStartIndex = response.indexOf("<fileListJSON>") + "<fileListJSON>".length;
     
    532532            });
    533533        })
    534         .error(function()
     534        .fail(function()
    535535        {
    536536            console.log("Error retrieving XSLT files");
     
    608608        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;
    609609        $.ajax(getURL)
    610         .success(function(templateResponse)
     610        .done(function(templateResponse)
    611611        {
    612612            var templateListStart = templateResponse.indexOf("<templateList>") + "<templateList>".length;
     
    691691
    692692        $.post(url, params)
    693         .success(function(response)
     693        .done(function(response)
    694694        {
    695695            var template;
     
    754754            }
    755755        })
    756         .error(function()
     756        .fail(function()
    757757        {
    758758            console.log("Error getting the XML template from the file");
     
    809809    var addMouseEventsToDebugElements = function(debugElems)
    810810    {
    811         debugElems.click(function(e)
     811        debugElems.on("click", function(e)
    812812        {
    813813            if(_debugOn)
     
    935935            var enableGBButtonHolder = $("<div>", {"title":"Enable Greenbug", "id":"gbEnableButton", "class":"ui-state-default ui-corner-all"});
    936936            enableGBButtonHolder.append($("<img>", {"src":gs.imageURLs.greenBug}));
    937             enableGBButtonHolder.click(function()
     937            enableGBButtonHolder.on("click", function()
    938938            {
    939939                var url = document.URL;
     
    968968
    969969//The code entry point
    970 $(window).load(function()
     970$(window).on("load", function()
    971971{
    972972    var debugWidget = new DebugWidget();
Note: See TracChangeset for help on using the changeset viewer.