;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\207" [require s makey js2-refactor] 2) #@27 Keymap for widgetjs-mode. (defvar widgetjs-mode-map (make-sparse-keymap) (#$ . 174)) (byte-code "\300\301\302\303\304\305%\210\300\306\307\303\304\305%\210\300\310\311\312\304\305%\210\300\313\314\315\304\305%\207" [custom-declare-face widgetjs-html-face nil "Face used to highlight `html' tags, typically used in\n rendering methods." :group widgetjs widgetjs-html-tag-face ((t :foreground "#61afef" :background "#38394c" :weight bold :box t)) widgetjs-that-face ((t :inherit font-lock-keyword-face)) "Face used to highlight `that' used as the receiver." widgetjs-prop-face ((t :inherit font-lock-keyword-face)) "Face used to highlight `spec' and `my'."] 6) (defconst widgetjs-font-lock-keywords '(("\\<\\(html\\)\\>\\(\\.\\)\\(\\w+\\)" (1 'widgetjs-html-face) (2 'widgetjs-html-face) (3 'widgetjs-html-tag-face prepend)) ("\\" quote widgetjs-that-face) ("\\\\|\\" quote widgetjs-prop-face))) #@95 Non-nil if Widgetjs mode is enabled. Use the command `widgetjs-mode' to change this variable. (defvar widgetjs-mode nil (#$ . 1097)) (make-variable-buffer-local 'widgetjs-mode) #@593 Minor mode for handling AMD modules within a JavaScript file. This is a minor mode. If called interactively, toggle the `Widgetjs mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `widgetjs-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. (defalias 'widgetjs-mode #[(&optional arg) "\306  \307=\203\n?\202 \247\203 \310W\203\311\202\312\313\303!\2032\314\302 \"\n\2032\302 B\n\203>\315\311\f\"\210\202C\316\311\f\"\210\317\320\n\203M\321\202N\322\"\210\323\324!\203s\306 \203b\306 \232\203s\325\326\327\n\203n\330\202o\331 #\210))\332 \210\n\207" [#1=#:last-message arg widgetjs-mode local-minor-modes widgetjs-font-lock-keywords local current-message toggle 1 nil t boundp delq font-lock-add-keywords font-lock-remove-keywords run-hooks widgetjs-mode-hook widgetjs-mode-on-hook widgetjs-mode-off-hook called-interactively-p any " in current buffer" message "Widgetjs mode %sabled%s" "en" "dis" force-mode-line-update] 4 (#$ . 1281) (list (if current-prefix-arg (prefix-numeric-value current-prefix-arg) 'toggle))]) (defvar widgetjs-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\313\310\211%\207" [widgetjs-mode-map widgetjs-mode-hook variable-documentation put "Hook run after entering or leaving `widgetjs-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode widgetjs-mode " Wjs"] 6) (defalias 'widgetjs-convert-function #[(property-name) "\212\304 \210\305 \306\305 !\307!\310\n \"\311 \n#\210\312 \"-\207" [function-node function-name scope property-name widgetjs-goto-function-node js2-node-at-point js2-function-name js2-node-get-enclosing-scope js2-get-defining-scope widgetjs-replace-occurrences widgetjs-convert-definition] 4]) (defalias 'widgetjs-convert-definition #[(property-name function-name) "`\303\304!\210`|\210) \305\nQc\210\306\307!\210\310u\210\311c\210\306\312!\210\310u\210\313 \210\314\315!?\205.\315c\207" [end property-name function-name search-backward-regexp "function[ ]+" "." search-forward "(" -1 " = function" "{" forward-sexp looking-at ";"] 3]) (defalias 'widgetjs-replace-occurrences #[(function-name property-name scope) "\212\305\306 \307\"\210\305\211\205 @\310\n\f\"\210 A\211\204\305,\207" [nodes scope node --dolist-tail-- property-name nil js2-visit-ast #[(node end-p) "\204-\306 !\n>\204-\307 !\203- \306 !\f>\204\"\310\311\312 D\"\210 \313H\230\203- B\314\207" [end-p node cl-struct-js2-function-node-tags function-name cl-struct-js2-name-node-tags nodes type-of js2r--local-name-node-p signal wrong-type-argument js2-name-node 6 t] 5] widgetjs-replace-occurrence] 4]) (defalias 'widgetjs-replace-occurrence #[(node property-name) "\302!b\210 \303Pc\207" [node property-name js2-node-abs-pos "."] 2]) (defalias 'widgetjs-goto-function-node #[nil "\300 \210\301\302!\210\301\303!\210\304u\210\305\306!\205\304u\207" [back-to-indentation search-forward "function " "(" -1 looking-back " "] 2]) (defalias 'widgetjs-convert-function-to-my #[nil "\300\301!\207" [widgetjs-convert-function "my"] 2 nil nil]) (defalias 'widgetjs-convert-function-to-that #[nil "\300\301!\207" [widgetjs-convert-function "that"] 2 nil nil]) (defalias 'widgetjs-make-string-translatable #[nil "\305 \306!\306!\307!\n>\204\310\311\312D\"\210\313H\\\262\307!\f>\204-\314\315!\210\212 b\210\316c\210\317 \\b\210\320c,\207" [node beg cl-struct-js2-node-tags end cl-struct-js2-string-node-tags js2-node-at-point js2-node-abs-pos type-of signal wrong-type-argument js2-node 3 error "Not on a string node" "_(" 2 ")"] 6 nil nil]) (defalias 'widgetjs-expand-html #[nil "\212\301 \210`\302\210\303`\"*\207" [beg back-to-indentation nil widgetjs-expand-html-region] 3 nil nil]) (defalias 'widgetjs-expand-html-region #[(beg end) " {\303\n!\304Pc\210 |\210\305`\")\207" [beg end expansion-string widgetjs-parse-html ";" indent-region] 3 nil nil]) (defalias 'widgetjs-parse-html #[(string) "\302!\211@<\203\303 !\202\304 !)\207" [string html-list read widgetjs-parse-nodes widgetjs-parse-node] 3]) (defalias 'widgetjs-parse-nodes #[(nodes) "\304 \305\211\203 @\306\307\n!\310R A\211\204\n*)\207" [result nodes node --dolist-tail-- "" nil " " widgetjs-parse-node ";\n"] 5]) #@39 NODE can be either a string or a list (defalias 'widgetjs-parse-node #[(node) ";\203\n\301\301Q\207\302!\207" [node "'" widgetjs-parse-list-node] 3 (#$ . 6020)]) #@85 Parsing rules: - The car of NODE is the tag - The cdr of NODE contains its children (defalias 'widgetjs-parse-list-node #[(node) "\305@!\306@!A\307 \310Q\n\203\f\nP \2031\n\203&\f\311P\f\312P\211\313 !\312Q\f\314P\211,\207" [node tag attributes children result widgetjs-parse-tag widgetjs-parse-attributes "html." "(" ", " "\n" widgetjs-parse-children ")"] 4 (#$ . 6192)]) (defalias 'widgetjs-parse-tag #[(symbol) "\302!\303\304\305 #\303\306\305 #\211)\207" [symbol result symbol-name replace-regexp-in-string "\\..*" "" "\\@.*"] 5]) #@74 CHILDREN should be a list of HTML nodes (lists themselves), or a string. (defalias 'widgetjs-parse-children #[(children) "\304 <\2030 \305\211\203, @\306\n!P\307 !@\n=\204%\310P A\211\204*\2026\306 !P)\207" [result children node --dolist-tail-- "" nil widgetjs-parse-node last ",\n"] 4 (#$ . 6753)]) (defalias 'widgetjs-parse-attributes #[(symbol) "\305!\306 !\307 !\310\n\204 \2038\311\n\203\"\f\312\n\313R \2034\n\203.\f\314P\f\315 \313R\f\316P\f,\207" [symbol name class id result symbol-name widgetjs-parse-class widgetjs-parse-id nil "{" "klass: '" "'" "," " id: '" "}"] 4]) (defalias 'widgetjs-parse-id #[(name) "\302 \303\216\304\305 \"\205\306\307 \"*\207" [save-match-data-internal name match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] string-match "@\\([a-zA-Z0-9-_]+\\)" match-string 1] 3]) (defalias 'widgetjs-parse-class #[(name) "\302 \303\216\304\305 \"\205\306\307\310\311\312\313 \"\314\"\315#!*\207" [save-match-data-internal name match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] string-match "\\(\\.[a-zA-Z0-9-_]+\\)+" s-trim mapconcat identity split-string match-string 0 "\\." " "] 7]) (defalias 'widgetjs-initialize-makey-group #[nil "\300\301!\210\302 \207" [makey-initialize-key-groups ((widgetjs (description "Widgetjs") (actions ("Convert function" ("m" "Convert function to my" widgetjs-convert-function-to-my) ("t" "Convert function to that" widgetjs-convert-function-to-that)) ("HTML expansion" ("h" "Render HTML expansion" widgetjs-expand-html)) ("Translation" ("l" "Translatable string" widgetjs-make-string-translatable))))) makey-key-mode-popup-widgetjs] 2 nil nil]) (byte-code "\301\302\303#\210\304\305!\207" [widgetjs-mode-map define-key "" widgetjs-initialize-makey-group provide widgetjs] 4)