mixins/preferences ================== PreferencesMixin -------------------- .. js:mixin:: PreferencesMixin(category, group[, prefs]) Mixin that provides preference functionality. :param String category: Preferences category. :param String group: Preferences group. :param Object prefs: The config for the preferences to create. See :js:class:`PrefGroup`s *data* parameter for details. .. js:attribute:: prefs :type: PreferencesProxy All prefrences related function are collected here. .. js:function:: applyPreferences(key, value) This function will be bound to the *changed* event of the prefrences object. This is also triggered for non-auto applied shortcus. :param String key: The key of the setting changed. May be undefined if multiple settings changed at once - e.g. after loading the from the DB. :param value: The new value of the setting changed. Only available if the *key* was set. .. js:attribute:: prefs.vue :type: PrefsGroup (Vue) The preferences group. .. js:function:: prefs.get(key) Retrieves the value of a preference item given by key. :param String key: The key of the preferences item. :return: The current value of the preferences item. .. js:function:: prefs.set(key[, value[, global]]) Retrieves the value of a preference item given by key. :param String key: The key of the preferences item. :param value: The new value for the preferences item. :param Bool global: The value will be set globally, ignoring eventual binding. .. js:function:: prefs.watch(key, callback) Watches a specific prefrences items value for changes. .. note:: This uses the *$watch* method of *vuejs* internally. :param String key: The key of the preferences item to watch. If *null* will watch all preferences of the entire group. :callback oldValue: The old value of the preference before it was changed. :callback newValue: The new value of the preference after it was changed. .. js:attribute:: prefs.autoShortcuts read-only :type: Object(shortcutDefinition => callback) All shortcuts do be automatically applied (by :js:mixin:`ShortcutsMixin`).