Feature #780

Plugins: Make it possible to modify a setting object programatically

Added by andreus sebes almost 9 years ago. Updated about 7 years ago.

Status:FixedStart date:11/16/2011
Priority:NormalDue date:
Assignee:Andreas Smas% Done:

100%

Category:Plugins
Target version:4.4

Description

When i try to change a setting in real time it changes and when i'm inside showtime it works (but is not changed in the settings), but when i quit showtime the setting is back to default...

service.set=1;

Associated revisions

Revision 507ffeef
Added by Andreas Smas about 7 years ago

js: Allow setting objects to be modified programatically

Fixes #780

Change included in version 4.3.342

History

#1 Updated by Andreas Smas almost 9 years ago

  • Status changed from New to Need feedback

I'm not even sure what you are trying to do here.

What is the service object?

#2 Updated by andreus sebes almost 9 years ago

This a plugin setting i tried to change inside the plugin

settings.createBool("set", "Accepted?", false, function(v) { service.set= v; });

then if the user acceptd it i want to change it permanently (even if you quit showtime)

@if (service.set!='1') {
if (showtime.message("text?", true, true)) service.set= 1;
else {
page.error("Error.");
return;
}
}@

#3 Updated by Andreas Smas almost 9 years ago

  • Tracker changed from Bug to Feature
  • Subject changed from Plugins: Save a setting in real time to Plugins: Make it possible to modify a setting object programatically
  • Status changed from Need feedback to Accepted
  • Target version changed from 3.4 to 34

Your code is wrong.

service.set is in no way related to the setting object.

the anonymous function that is passed to the createBool() function modifies service.set but there
is nothing that makes it work the opposite way.

I think I understand what you're trying to do but unfortunately there is no way to programatically modify settings from javascript.

It could be useful though, so i'm changing this into a feature request.

#4 Updated by andreus sebes almost 9 years ago

Ok .Thanks andreas

#5 Updated by Andreas Smas about 7 years ago

  • Target version changed from 34 to 4.4

#6 Updated by Andreas Smas about 7 years ago

  • Status changed from Accepted to Fixed
  • % Done changed from 0 to 100

Applied in changeset git|commit:507ffeef2ea4c08ec8af7d03c7feec4e864933a6.

Also available in: Atom PDF