Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:
  • Page:
  • 1
  • 2

TOPIC: How bypass php zip import to add resources ?

How bypass php zip import to add resources ? 3 years 8 months ago #90002

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1805
  • Thank you received: 445
  • Karma: 111
Yes it's works... I've seen the end of your tunnel !
(Faut jamais abandonner pour un bout de code... ;) )
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => bit.ly/20NW9V8 (already included in /docs/demosurveys)
The administrator has disabled public write access.

How bypass php zip import to add resources ? 3 years 8 months ago #90011

  • hug
  • hug's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 16
  • Thank you received: 1
  • Karma: 0
???? Are you telling me that I'm trying to make working something that does work already ????

I wonder if i am not becoming mad...

... But in a certain way, it makes sense to me : I tested a survey which were non active and the css depend on which template is used, but I made a copy of the original one to change it for timepicker and don't understand why this css is not used for testing. Below is a print screen of what i got from testing.

Now, I'm feeling quite ridiculous...

Thank you very much and sorry for disturbing

The administrator has disabled public write access.

How bypass php zip import to add resources ? 3 years 8 months ago #90012

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1805
  • Thank you received: 445
  • Karma: 111
Check your inbox &/or LS results...
I've submitted your working nicely survey... :)
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => bit.ly/20NW9V8 (already included in /docs/demosurveys)
The administrator has disabled public write access.

How bypass php zip import to add resources ? 3 years 8 months ago #90015

  • hug
  • hug's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 16
  • Thank you received: 1
  • Karma: 0
Yes, I'll see what I can do... But removing the read only attribute does not seems to work very well (like for the test survey is still the same).

Anyway this thing is driving me mad !!!

Here is the TRUE survey... and just the first time question work !

cdlvg.free.fr/index.php?sid=33913&lang=fr
The administrator has disabled public write access.

How bypass php zip import to add resources ? 3 years 8 months ago #90017

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1805
  • Thank you received: 445
  • Karma: 111
It's normal that only the first question is working...

It's due to the syntax*:
$(".numeric:eq(0) input.text").timepicker({

You should in this case use the old one with SGA code (at least for 2nd time question)
$('#answer33913X4X34').timepicker({


*Cf. TPartner's note
(assuming you are applying it to the first short text on the page)
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => bit.ly/20NW9V8 (already included in /docs/demosurveys)
Last Edit: 3 years 8 months ago by Ben_V.
The administrator has disabled public write access.

How bypass php zip import to add resources ? 3 years 8 months ago #90019

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6230
  • Thank you received: 1382
  • Karma: 539
Yes, and you should be able to put but selectors in the same call:
$('#answer33913X5X38, #answer33913X5X44').timepicker({
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: Ben_V

How bypass php zip import to add resources ? 3 years 8 months ago #90026

  • hug
  • hug's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 16
  • Thank you received: 1
  • Karma: 0
Everthing is working !!!!!!!!!! :woohoo:

Yeeeha ! Thank you very very much for your precious help and sorry for my bad understanding of javascript :dry:

At least you made someone happy !
The administrator has disabled public write access.
The following user(s) said Thank You: Ben_V

How bypass php zip import to add resources ? 3 years 8 months ago #90068

  • hug
  • hug's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 16
  • Thank you received: 1
  • Karma: 0
Assuming I'm totally stupid with javascript. I tried to remove readonly attribute remplacing this
$(".text-short:eq(0) input.text").attr('readonly', 'readonly');

by this
$(".text-short:eq(0) input.text").removeattr('readonly');

On the first question and it has worked, but the following questions failed... So I tried the same as you suggest in your previous replies

For the second question :
$('#answer33913X4X34').removeattr('readonly');

That did not work... What do I have to do, please ?
The administrator has disabled public write access.

How bypass php zip import to add resources ? 3 years 8 months ago #90069

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6230
  • Thank you received: 1382
  • Karma: 539
This will remove the attribute from all text inputs on the page:
$(".text-short input.text").removeAttr('readonly');

(note: removeAttr should have a capital A)
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: hug

How bypass php zip import to add resources ? 3 years 8 months ago #90072

  • hug
  • hug's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 16
  • Thank you received: 1
  • Karma: 0
Ok. I won't forget the case sensitive information in the future and i understand that when i remove the :eq0 it applies to the whole survey. Thanks.

What I don't understand is :
1. Why if i use my own code without capital A, timepicker behavior changes but nothing change if i totally remove the original line
2. If i use your code that does not change timepicker behavior
3. Why I can directly edit time in all timepicker question except in the first one

What I understand is that i don't understand JS
The administrator has disabled public write access.

How bypass php zip import to add resources ? 3 years 8 months ago #90078

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6230
  • Thank you received: 1382
  • Karma: 539
when i remove the :eq0 it applies to the whole survey.
Not the whole survey, only all text inputs on the current page.

Can you activate another sample survey?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

How bypass php zip import to add resources ? 3 years 8 months ago #90087

  • hug
  • hug's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 16
  • Thank you received: 1
  • Karma: 0
You will find the activated survey here : cdlvg.free.fr/index.php?sid=33913&lang=fr

You just have to choose anyone of the answer in the radio list and time questions will appear.
The administrator has disabled public write access.

How bypass php zip import to add resources ? 3 years 8 months ago #90088

  • Ben_V
  • Ben_V's Avatar
  • Offline
  • Platinum Lime
  • Posts: 1805
  • Thank you received: 445
  • Karma: 111
Hi,
It doesn't works if you just remove (or wrap as comment) this kind of code ?:
$('#answer33913X4X34').attr('readonly', 'readonly');
Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
All LS releases => bit.ly/1VMuTDu | 2.06lts => bit.ly/1Qv44A1
Demo surveys => bit.ly/20NW9V8 (already included in /docs/demosurveys)
The administrator has disabled public write access.
The following user(s) said Thank You: hug

How bypass php zip import to add resources ? 3 years 8 months ago #90092

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6230
  • Thank you received: 1382
  • Karma: 539
Yes, in the first question (ID 38), you have this which removes the attribute from all text inputs:
$(".text-short input.text").removeAttr('readonly');

But then in the second question (ID 44), you have this which overrides that and applies the attribute to the first question again:
$(".text-short:eq(0) input.text").attr('readonly', 'readonly');

The JavaScript will be fired sequentially as the page is rendered so any commands or functions will override previous ones.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: hug

How bypass php zip import to add resources ? 3 years 8 months ago #90152

  • hug
  • hug's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 16
  • Thank you received: 1
  • Karma: 0
Ok ! It works perfectly now :D

I understand my mistake : i thought I could have set this parameter question by question.

One more time, but the last one for this question type, thank you very much you too for your help :)
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.484 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form