Scribusoid

Author Topic: Incorrect assignment of JavaScript events  (Read 1798 times)

simonbaev

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
  • Scribus User
Incorrect assignment of JavaScript events
« on: August 25, 2015, 10:44:00 pm »
Hello,

I am working on Scribus 1.5.0. (Build ID: C-C-T-F-C1.14.2-64bit) on Ubuntu 15.04.

When I setup JavaScript action in, say, text input field there is a list of events that I can select to bind my JS code to. And this binding seems to work wrong...

To see it, try to add a new input text field and assign some JS code to MouseUp event. Click OK and close the dialog. Then reopen the dialog and check "MouseUp" event... it is empty. The JS code appears in MouseDown event...

Whatever is saved in MouseDown shows up in MouseUp. After opening and closing the dialog I couldn't see any consistency in how MouseUp and MouseDown events affect each other, but for sure they do. Other events, i.e. MouseEnter, MouseExit, OnFocus, OnBlur work OK.

I looked at *.sla file and noticed the mapping:
  • MouseUp -> "ANACTION" property of PAGEOBJECT element associated with this field (it can be identified by searching for the 'name' that was used on element properties dialog)
  • MouseDown -> "ANDACT" property
  • MouseEnter -> "ANEACT"
  • MouseExit -> "ANXACT"
  • OnFocus -> "ANFOACT"
  • OnBlur -> "ANBLACT"

When I manually set values of mentioned properties in *.sla file, the dialog in Scribus shows them correctly. But any attempt to change them in Scribus, results in wrong assignment (MouseUp and MouseDown particularly).

Nermander

  • Hero Member
  • *****
  • Posts: 1321
  • Karma: 17
Re: Incorrect assignment of JavaScript events
« Reply #1 on: August 26, 2015, 08:33:50 am »
To me it sounds like a verified bug, most likely a mixup the writing of the objects.

http://bugs.scribus.net would be the right place to post it.

Kunda

  • Administrator
  • Full Member
  • *****
  • Posts: 218
  • Karma: 2
  • Scribus User
Re: Incorrect assignment of JavaScript events
« Reply #2 on: August 27, 2015, 05:59:30 am »
Hey OP,
Nermander is correct, you should post this as a bug, so others could test it.
Here's a tip: You could compile Scribus 1.5.1svn in a separate directory and test those type of issues on it. Lots of things are getting fixed in 1.5.1 that don't work correctly on 1.5.0
Just be warned that it is unstable and bleeding edge. I use it just the same though.
If you want to compile it there are some great scripts from jluc https://github.com/JLuc/makscribus