minor, add 'exported' directive for linters
This commit is contained in:
parent
ecab1e2bed
commit
a128664921
4
area.js
4
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);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
/* jslint esversion: 6 */
|
||||
|
||||
/*
|
||||
* Copyright 2019 Abakkk
|
||||
*
|
||||
|
|
@ -20,6 +18,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* 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));
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
1
files.js
1
files.js
|
|
@ -1,4 +1,5 @@
|
|||
/* jslint esversion: 6 */
|
||||
/* exported Image, getImages, getJsons, getDateString */
|
||||
|
||||
/*
|
||||
* Copyright 2019 Abakkk
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* jslint esversion: 6 */
|
||||
/* exported DrawingHelper */
|
||||
|
||||
/*
|
||||
* Copyright 2019 Abakkk
|
||||
|
|
|
|||
11
menu.js
11
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);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
5
prefs.js
5
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"); } },
|
||||
|
|
|
|||
Loading…
Reference in New Issue