diff options
author | Yukai Huang | 2017-03-07 21:59:18 +0800 |
---|---|---|
committer | Yukai Huang | 2017-03-07 21:59:18 +0800 |
commit | 121d84863a055dbe259cdcfb98583a376bd8e2fa (patch) | |
tree | 3318c55baac9ef2f4afe53e7ee4ebd51bea4c1a4 /public/js/lib | |
parent | 8f1c97f4a476ff6534ff1e809ed748cf92ba9288 (diff) |
Extract UI jquery node
Diffstat (limited to 'public/js/lib')
-rw-r--r-- | public/js/lib/editor/ui-elements.js | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/public/js/lib/editor/ui-elements.js b/public/js/lib/editor/ui-elements.js new file mode 100644 index 00000000..d06e6402 --- /dev/null +++ b/public/js/lib/editor/ui-elements.js @@ -0,0 +1,84 @@ +/* + * Global UI elements references + */ + +export const getUIElements = () => ({ + spinner: $(".ui-spinner"), + content: $(".ui-content"), + toolbar: { + shortStatus: $(".ui-short-status"), + status: $(".ui-status"), + new: $(".ui-new"), + publish: $(".ui-publish"), + extra: { + revision: $(".ui-extra-revision"), + slide: $(".ui-extra-slide") + }, + download: { + markdown: $(".ui-download-markdown"), + html: $(".ui-download-html"), + rawhtml: $(".ui-download-raw-html"), + pdf: $(".ui-download-pdf-beta"), + }, + export: { + dropbox: $(".ui-save-dropbox"), + googleDrive: $(".ui-save-google-drive"), + gist: $(".ui-save-gist"), + snippet: $(".ui-save-snippet") + }, + import: { + dropbox: $(".ui-import-dropbox"), + googleDrive: $(".ui-import-google-drive"), + gist: $(".ui-import-gist"), + snippet: $(".ui-import-snippet"), + clipboard: $(".ui-import-clipboard") + }, + mode: $(".ui-mode"), + edit: $(".ui-edit"), + view: $(".ui-view"), + both: $(".ui-both"), + uploadImage: $(".ui-upload-image") + }, + infobar: { + lastchange: $(".ui-lastchange"), + lastchangeuser: $(".ui-lastchangeuser"), + nolastchangeuser: $(".ui-no-lastchangeuser"), + permission: { + permission: $(".ui-permission"), + label: $(".ui-permission-label"), + freely: $(".ui-permission-freely"), + editable: $(".ui-permission-editable"), + locked: $(".ui-permission-locked"), + private: $(".ui-permission-private"), + limited: $(".ui-permission-limited"), + protected: $(".ui-permission-protected") + }, + delete: $(".ui-delete-note") + }, + toc: { + toc: $('.ui-toc'), + affix: $('.ui-affix-toc'), + label: $('.ui-toc-label'), + dropdown: $('.ui-toc-dropdown') + }, + area: { + edit: $(".ui-edit-area"), + view: $(".ui-view-area"), + codemirror: $(".ui-edit-area .CodeMirror"), + codemirrorScroll: $(".ui-edit-area .CodeMirror .CodeMirror-scroll"), + codemirrorSizer: $(".ui-edit-area .CodeMirror .CodeMirror-sizer"), + codemirrorSizerInner: $(".ui-edit-area .CodeMirror .CodeMirror-sizer > div"), + markdown: $(".ui-view-area .markdown-body"), + resize: { + handle: $('.ui-resizable-handle'), + syncToggle: $('.ui-sync-toggle') + } + }, + modal: { + snippetImportProjects: $("#snippetImportModalProjects"), + snippetImportSnippets: $("#snippetImportModalSnippets"), + revision: $("#revisionModal") + } +}) + +export default getUIElements; |