Change label for default "Return to Survey" button in upload file modal

More
2 months 2 days ago #199035 by ritapas
Hello,
a customer with Limesurvey 2.6.6LTS asked me to change the default label of many survey buttons in a custom theme. In brief, they want to show the survey as an "application form".
I cannot access to the filesystem so I cannot change the translation files.

XSS filter is on.

I've managed to change the label for the Back, Exit and clear, Captcha text in the template.js
$(document).ready(function(){
    var previousText = "Back";
    $('#moveprevbtn .ui-button-text').text(previousText);
    var clearAllText = "Exit and clear the application";   
    $('#clearall .ui-button-text').text(clearAllText);
    var captchaText = "Please confirm access to the application by answering the security question below and click continue.";
    $('#welcome p .captcha').text(captchaText);
    var loadAllText = "Load unfinished application";
    $('#loadallbtn .ui-button-text').text(loadAllText);
 
    // THIS WON'T WORK //
    var returnToSurvey = "Back to the application"
    $('.dialog-upload .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button-text').text(returnToSurvey);
});
 

However, I cannot find a way to change the "Return to survey" button in the "upload file" modal form, because at "document.ready" it is not still present.

The modal form is as in the attached picture.
File Attachment:



Any hints?
Regards
Rita
Attachments:

Please Log in to join the conversation.

LimeSurvey Partners
More
2 months 2 days ago #199074 by ritapas
P.S.:
if after having opened the upload modal form I type the following code in the JavaScript Console, the button label changes as expected.
var returnToSurvey = "Back to the application";
    $('.dialog-upload .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button-text').text(returnToSurvey);

Please Log in to join the conversation.

More
2 months 1 day ago #199098 by DenisChenu
Old version here, the jqueryui, maybe try api.jqueryui.com/dialog/#event-open ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.
The following user(s) said Thank You: ritapas

Please Log in to join the conversation.

More
2 months 1 day ago - 2 months 1 day ago #199114 by ritapas
Yes Denis,
this works, thank you so much!!!

For the others like me who don't know much about JQuery this is the way I did:


1. The dialog is already initialised with the open callback function;

2. This code has been added outside the document.ready()
$(document).on("dialogopen", ".dialog-upload", function(event, ui) {
      var returnToSurvey = "Back to the application";
      $('.dialog-upload .ui-dialog-buttonpane .ui-dialog-buttonset .ui-button-text').text(returnToSurvey);
});


I hope this can help some other newbies like me.

Thank you again.
Rita
Last edit: 2 months 1 day ago by ritapas.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now