diff --git a/area.js b/area.js index f7b5e4c..ff12849 100644 --- a/area.js +++ b/area.js @@ -1,4 +1,5 @@ /* jslint esversion: 6 */ +/* exported Tools, ToolNames, FontGenericFamilies, DrawingArea */ /* * Copyright 2019 Abakkk @@ -47,8 +48,7 @@ const SVG_DEBUG_EXTENDS = false; const TEXT_CURSOR_TIME = 600; // ms const GRID_TILES_HORIZONTAL_NUMBER = 30; -const { Shapes, ShapeNames, Transformations, LineCapNames, LineJoinNames, FillRuleNames, - FontWeightNames, FontStyleNames, FontStretchNames, FontVariantNames } = Elements; +const { Shapes, ShapeNames, Transformations, LineCapNames, LineJoinNames, FillRuleNames, FontWeightNames, FontStyleNames } = Elements; const Manipulations = { MOVE: 100, RESIZE: 101, MIRROR: 102 }; const ManipulationNames = { 100: "Move", 101: "Resize", 102: "Mirror" }; var Tools = Object.assign({}, Shapes, Manipulations); diff --git a/elements.js b/elements.js index c2214c7..e2b1acf 100644 --- a/elements.js +++ b/elements.js @@ -1,5 +1,3 @@ -/* jslint esversion: 6 */ - /* * Copyright 2019 Abakkk * @@ -20,6 +18,9 @@ * along with this program. If not, see . */ +/* jslint esversion: 6 */ +/* exported Shapes, ShapeNames, Transformations, LineCapNames, LineJoinNames, FillRuleNames, FontWeightNames, FontStyleNames, getPangoFontFamilies, DrawingElement */ + const Cairo = imports.cairo; const Clutter = imports.gi.Clutter; const Lang = imports.lang; @@ -43,8 +44,8 @@ var FillRuleNames = { 0: 'Nonzero', 1: 'Evenodd' }; var FontWeightNames = Object.assign(reverseEnumeration(Pango.Weight), { 200: "Ultra-light", 350: "Semi-light", 600: "Semi-bold", 800: "Ultra-bold" }); delete FontWeightNames[Pango.Weight.ULTRAHEAVY]; var FontStyleNames = reverseEnumeration(Pango.Style); -var FontStretchNames = reverseEnumeration(Pango.Stretch); -var FontVariantNames = reverseEnumeration(Pango.Variant); +const FontStretchNames = reverseEnumeration(Pango.Stretch); +const FontVariantNames = reverseEnumeration(Pango.Variant); var getPangoFontFamilies = function() { return PangoCairo.font_map_get_default().list_families().map(fontFamily => fontFamily.get_name()).sort((a,b) => a.localeCompare(b)); diff --git a/extension.js b/extension.js index d12d1bd..5f8607a 100644 --- a/extension.js +++ b/extension.js @@ -1,4 +1,5 @@ /* jslint esversion: 6 */ +/* exported manager, init, enable, disable, setCursor */ /* * Copyright 2019 Abakkk @@ -45,7 +46,7 @@ const HIDE_TIMEOUT_LONG = 2500; // ms, default is 1500 ms const DRAWING_ACTION_MODE = Math.pow(2,14); const WRITING_ACTION_MODE = Math.pow(2,15); // use 'login-dialog-message-warning' class in order to get GS theme warning color (default: #f57900) -var WARNING_COLOR_STYLE_CLASS_NAME = 'login-dialog-message-warning'; +const WARNING_COLOR_STYLE_CLASS_NAME = 'login-dialog-message-warning'; var manager; @@ -70,7 +71,7 @@ function disable() { // AreaManager assigns one DrawingArea per monitor (updateAreas()), // distributes keybinding callbacks to the active area // and handles stylesheet and monitor changes. -var AreaManager = new Lang.Class({ +const AreaManager = new Lang.Class({ Name: 'DrawOnYourScreenAreaManager', _init: function() { diff --git a/files.js b/files.js index 0001cc4..8315c20 100644 --- a/files.js +++ b/files.js @@ -1,4 +1,5 @@ /* jslint esversion: 6 */ +/* exported Image, getImages, getJsons, getDateString */ /* * Copyright 2019 Abakkk diff --git a/helper.js b/helper.js index d6704e9..7ed108d 100644 --- a/helper.js +++ b/helper.js @@ -1,4 +1,5 @@ /* jslint esversion: 6 */ +/* exported DrawingHelper */ /* * Copyright 2019 Abakkk diff --git a/menu.js b/menu.js index 666279a..b70ce5c 100644 --- a/menu.js +++ b/menu.js @@ -1,4 +1,5 @@ /* jslint esversion: 6 */ +/* exported DrawingMenu */ /* * Copyright 2019 Abakkk @@ -59,6 +60,8 @@ const FULL_LINE_ICON_PATH = ICON_DIR.get_child('full-line-symbolic.svg').get_pat // 150 labels with font-family style take ~15Mo const FONT_FAMILY_STYLE = true; +// use 'login-dialog-message-warning' class in order to get GS theme warning color (default: #f57900) +const WARNING_COLOR_STYLE_CLASS_NAME = 'login-dialog-message-warning'; const getActor = function(object) { return GS_VERSION < '3.33.0' ? object.actor : object; @@ -308,18 +311,18 @@ var DrawingMenu = new Lang.Class({ target[targetProperty] = Math.max(Math.round(value * 50), 0); label.set_text(target[targetProperty] + " px"); if (target[targetProperty] === 0) - label.add_style_class_name(Extension.WARNING_COLOR_STYLE_CLASS_NAME); + label.add_style_class_name(WARNING_COLOR_STYLE_CLASS_NAME); else - label.remove_style_class_name(Extension.WARNING_COLOR_STYLE_CLASS_NAME); + label.remove_style_class_name(WARNING_COLOR_STYLE_CLASS_NAME); }); } else { slider.connect('notify::value', () => { target[targetProperty] = Math.max(Math.round(slider.value * 50), 0); label.set_text(target[targetProperty] + " px"); if (target[targetProperty] === 0) - label.add_style_class_name(Extension.WARNING_COLOR_STYLE_CLASS_NAME); + label.add_style_class_name(WARNING_COLOR_STYLE_CLASS_NAME); else - label.remove_style_class_name(Extension.WARNING_COLOR_STYLE_CLASS_NAME); + label.remove_style_class_name(WARNING_COLOR_STYLE_CLASS_NAME); }); } diff --git a/prefs.js b/prefs.js index cbf1d1e..a92bb01 100644 --- a/prefs.js +++ b/prefs.js @@ -1,4 +1,5 @@ /* jslint esversion: 6 */ +/* exported GLOBAL_KEYBINDINGS, INTERNAL_KEYBINDINGS, OTHER_SHORTCUTS, init, buildPrefsWidget */ /* * Copyright 2019 Abakkk @@ -100,10 +101,10 @@ var INTERNAL_KEYBINDINGS = { if (GS_VERSION < "3.36") delete INTERNAL_KEYBINDINGS['open-preferences']; -function getKeyLabel(accel) { +const getKeyLabel = function(accel) { let [keyval, mods] = Gtk.accelerator_parse(accel); return Gtk.accelerator_get_label(keyval, mods); -} +}; var OTHER_SHORTCUTS = [ { desc: "Draw", get shortcut() { return _("Left click"); } },