Repository: pockethub/PocketHub Branch: master Commit: 8228cb8f7197 Files: 732 Total size: 2.5 MB Directory structure: gitextract_6u3neemq/ ├── .gitattributes ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── LICENSE ├── README.md ├── app/ │ ├── build.gradle │ ├── quality.gradle │ └── src/ │ ├── androidTest/ │ │ ├── AndroidManifest.xml │ │ └── java/ │ │ └── com/ │ │ └── github/ │ │ └── pockethub/ │ │ └── android/ │ │ └── tests/ │ │ ├── NewsEventTextTest.java │ │ ├── ViewVisibiltyIdlingResource.kt │ │ ├── commit/ │ │ │ ├── CommitUriMatcherTest.java │ │ │ ├── CommitUtilsTest.java │ │ │ ├── CreateCommentActivityTest.java │ │ │ ├── DiffStylerTest.java │ │ │ └── FullCommitTest.java │ │ ├── gist/ │ │ │ ├── CreateCommentActivityTest.java │ │ │ ├── CreateGistActivityTest.java │ │ │ ├── GistFilesViewActivityTest.java │ │ │ ├── GistStoreTest.java │ │ │ └── GistUriMatcherTest.java │ │ ├── issue/ │ │ │ ├── CreateCommentActivityTest.java │ │ │ ├── EditIssueActivityTest.java │ │ │ ├── EditIssuesFilterActivityTest.java │ │ │ ├── IssueFilterTest.java │ │ │ ├── IssueStoreTest.java │ │ │ └── IssueUriMatcherTest.java │ │ ├── ref/ │ │ │ └── RefUtilsTest.java │ │ ├── repo/ │ │ │ ├── RecentRepositoriesTest.java │ │ │ ├── RepositoryEventMatcherTest.java │ │ │ ├── RepositoryUriMatcherTest.java │ │ │ └── SearchActivityTest.java │ │ ├── user/ │ │ │ ├── UserComparatorTest.java │ │ │ └── UserUriMatcherTest.java │ │ └── util/ │ │ └── HtmlUtilsTest.java │ ├── debug/ │ │ └── res/ │ │ └── values/ │ │ └── strings.xml │ ├── main/ │ │ ├── AndroidManifest.xml │ │ ├── assets/ │ │ │ ├── code_mirror/ │ │ │ │ ├── LICENSE │ │ │ │ ├── VERSION │ │ │ │ ├── addon/ │ │ │ │ │ ├── comment/ │ │ │ │ │ │ ├── comment.js │ │ │ │ │ │ └── continuecomment.js │ │ │ │ │ ├── dialog/ │ │ │ │ │ │ ├── dialog.css │ │ │ │ │ │ └── dialog.js │ │ │ │ │ ├── display/ │ │ │ │ │ │ ├── autorefresh.js │ │ │ │ │ │ ├── fullscreen.css │ │ │ │ │ │ ├── fullscreen.js │ │ │ │ │ │ ├── panel.js │ │ │ │ │ │ ├── placeholder.js │ │ │ │ │ │ └── rulers.js │ │ │ │ │ ├── edit/ │ │ │ │ │ │ ├── closebrackets.js │ │ │ │ │ │ ├── closetag.js │ │ │ │ │ │ ├── continuelist.js │ │ │ │ │ │ ├── matchbrackets.js │ │ │ │ │ │ ├── matchtags.js │ │ │ │ │ │ └── trailingspace.js │ │ │ │ │ ├── fold/ │ │ │ │ │ │ ├── brace-fold.js │ │ │ │ │ │ ├── comment-fold.js │ │ │ │ │ │ ├── foldcode.js │ │ │ │ │ │ ├── foldgutter.css │ │ │ │ │ │ ├── foldgutter.js │ │ │ │ │ │ ├── indent-fold.js │ │ │ │ │ │ ├── markdown-fold.js │ │ │ │ │ │ └── xml-fold.js │ │ │ │ │ ├── hint/ │ │ │ │ │ │ ├── anyword-hint.js │ │ │ │ │ │ ├── css-hint.js │ │ │ │ │ │ ├── html-hint.js │ │ │ │ │ │ ├── javascript-hint.js │ │ │ │ │ │ ├── show-hint.css │ │ │ │ │ │ ├── show-hint.js │ │ │ │ │ │ ├── sql-hint.js │ │ │ │ │ │ └── xml-hint.js │ │ │ │ │ ├── lint/ │ │ │ │ │ │ ├── coffeescript-lint.js │ │ │ │ │ │ ├── css-lint.js │ │ │ │ │ │ ├── html-lint.js │ │ │ │ │ │ ├── javascript-lint.js │ │ │ │ │ │ ├── json-lint.js │ │ │ │ │ │ ├── lint.css │ │ │ │ │ │ ├── lint.js │ │ │ │ │ │ └── yaml-lint.js │ │ │ │ │ ├── merge/ │ │ │ │ │ │ ├── merge.css │ │ │ │ │ │ └── merge.js │ │ │ │ │ ├── mode/ │ │ │ │ │ │ ├── loadmode.js │ │ │ │ │ │ ├── multiplex.js │ │ │ │ │ │ ├── multiplex_test.js │ │ │ │ │ │ ├── overlay.js │ │ │ │ │ │ └── simple.js │ │ │ │ │ ├── runmode/ │ │ │ │ │ │ ├── colorize.js │ │ │ │ │ │ ├── runmode-standalone.js │ │ │ │ │ │ ├── runmode.js │ │ │ │ │ │ └── runmode.node.js │ │ │ │ │ ├── scroll/ │ │ │ │ │ │ ├── annotatescrollbar.js │ │ │ │ │ │ ├── scrollpastend.js │ │ │ │ │ │ ├── simplescrollbars.css │ │ │ │ │ │ └── simplescrollbars.js │ │ │ │ │ ├── search/ │ │ │ │ │ │ ├── jump-to-line.js │ │ │ │ │ │ ├── match-highlighter.js │ │ │ │ │ │ ├── matchesonscrollbar.css │ │ │ │ │ │ ├── matchesonscrollbar.js │ │ │ │ │ │ ├── search.js │ │ │ │ │ │ └── searchcursor.js │ │ │ │ │ ├── selection/ │ │ │ │ │ │ ├── active-line.js │ │ │ │ │ │ ├── mark-selection.js │ │ │ │ │ │ └── selection-pointer.js │ │ │ │ │ ├── tern/ │ │ │ │ │ │ ├── tern.css │ │ │ │ │ │ ├── tern.js │ │ │ │ │ │ └── worker.js │ │ │ │ │ └── wrap/ │ │ │ │ │ └── hardwrap.js │ │ │ │ ├── lib/ │ │ │ │ │ ├── codemirror.css │ │ │ │ │ └── codemirror.js │ │ │ │ ├── mode/ │ │ │ │ │ ├── apl/ │ │ │ │ │ │ └── apl.js │ │ │ │ │ ├── asciiarmor/ │ │ │ │ │ │ └── asciiarmor.js │ │ │ │ │ ├── asn.1/ │ │ │ │ │ │ └── asn.1.js │ │ │ │ │ ├── asterisk/ │ │ │ │ │ │ └── asterisk.js │ │ │ │ │ ├── brainfuck/ │ │ │ │ │ │ └── brainfuck.js │ │ │ │ │ ├── clike/ │ │ │ │ │ │ └── clike.js │ │ │ │ │ ├── clojure/ │ │ │ │ │ │ └── clojure.js │ │ │ │ │ ├── cmake/ │ │ │ │ │ │ └── cmake.js │ │ │ │ │ ├── cobol/ │ │ │ │ │ │ └── cobol.js │ │ │ │ │ ├── coffeescript/ │ │ │ │ │ │ └── coffeescript.js │ │ │ │ │ ├── commonlisp/ │ │ │ │ │ │ └── commonlisp.js │ │ │ │ │ ├── crystal/ │ │ │ │ │ │ └── crystal.js │ │ │ │ │ ├── css/ │ │ │ │ │ │ └── css.js │ │ │ │ │ ├── cypher/ │ │ │ │ │ │ └── cypher.js │ │ │ │ │ ├── d/ │ │ │ │ │ │ └── d.js │ │ │ │ │ ├── dart/ │ │ │ │ │ │ └── dart.js │ │ │ │ │ ├── diff/ │ │ │ │ │ │ └── diff.js │ │ │ │ │ ├── django/ │ │ │ │ │ │ └── django.js │ │ │ │ │ ├── dockerfile/ │ │ │ │ │ │ └── dockerfile.js │ │ │ │ │ ├── dtd/ │ │ │ │ │ │ └── dtd.js │ │ │ │ │ ├── dylan/ │ │ │ │ │ │ └── dylan.js │ │ │ │ │ ├── ebnf/ │ │ │ │ │ │ └── ebnf.js │ │ │ │ │ ├── ecl/ │ │ │ │ │ │ └── ecl.js │ │ │ │ │ ├── eiffel/ │ │ │ │ │ │ └── eiffel.js │ │ │ │ │ ├── elm/ │ │ │ │ │ │ └── elm.js │ │ │ │ │ ├── erlang/ │ │ │ │ │ │ └── erlang.js │ │ │ │ │ ├── factor/ │ │ │ │ │ │ └── factor.js │ │ │ │ │ ├── fcl/ │ │ │ │ │ │ └── fcl.js │ │ │ │ │ ├── forth/ │ │ │ │ │ │ └── forth.js │ │ │ │ │ ├── fortran/ │ │ │ │ │ │ └── fortran.js │ │ │ │ │ ├── gas/ │ │ │ │ │ │ └── gas.js │ │ │ │ │ ├── gfm/ │ │ │ │ │ │ └── gfm.js │ │ │ │ │ ├── gherkin/ │ │ │ │ │ │ └── gherkin.js │ │ │ │ │ ├── go/ │ │ │ │ │ │ └── go.js │ │ │ │ │ ├── groovy/ │ │ │ │ │ │ └── groovy.js │ │ │ │ │ ├── haml/ │ │ │ │ │ │ └── haml.js │ │ │ │ │ ├── handlebars/ │ │ │ │ │ │ └── handlebars.js │ │ │ │ │ ├── haskell/ │ │ │ │ │ │ └── haskell.js │ │ │ │ │ ├── haskell-literate/ │ │ │ │ │ │ └── haskell-literate.js │ │ │ │ │ ├── haxe/ │ │ │ │ │ │ └── haxe.js │ │ │ │ │ ├── htmlembedded/ │ │ │ │ │ │ └── htmlembedded.js │ │ │ │ │ ├── htmlmixed/ │ │ │ │ │ │ └── htmlmixed.js │ │ │ │ │ ├── http/ │ │ │ │ │ │ └── http.js │ │ │ │ │ ├── idl/ │ │ │ │ │ │ └── idl.js │ │ │ │ │ ├── javascript/ │ │ │ │ │ │ └── javascript.js │ │ │ │ │ ├── jinja2/ │ │ │ │ │ │ └── jinja2.js │ │ │ │ │ ├── jsx/ │ │ │ │ │ │ └── jsx.js │ │ │ │ │ ├── julia/ │ │ │ │ │ │ └── julia.js │ │ │ │ │ ├── livescript/ │ │ │ │ │ │ └── livescript.js │ │ │ │ │ ├── lua/ │ │ │ │ │ │ └── lua.js │ │ │ │ │ ├── markdown/ │ │ │ │ │ │ └── markdown.js │ │ │ │ │ ├── mathematica/ │ │ │ │ │ │ └── mathematica.js │ │ │ │ │ ├── mbox/ │ │ │ │ │ │ └── mbox.js │ │ │ │ │ ├── meta.js │ │ │ │ │ ├── mirc/ │ │ │ │ │ │ └── mirc.js │ │ │ │ │ ├── mllike/ │ │ │ │ │ │ └── mllike.js │ │ │ │ │ ├── modelica/ │ │ │ │ │ │ └── modelica.js │ │ │ │ │ ├── mscgen/ │ │ │ │ │ │ └── mscgen.js │ │ │ │ │ ├── mumps/ │ │ │ │ │ │ └── mumps.js │ │ │ │ │ ├── nginx/ │ │ │ │ │ │ └── nginx.js │ │ │ │ │ ├── nsis/ │ │ │ │ │ │ └── nsis.js │ │ │ │ │ ├── ntriples/ │ │ │ │ │ │ └── ntriples.js │ │ │ │ │ ├── octave/ │ │ │ │ │ │ └── octave.js │ │ │ │ │ ├── oz/ │ │ │ │ │ │ └── oz.js │ │ │ │ │ ├── pascal/ │ │ │ │ │ │ └── pascal.js │ │ │ │ │ ├── pegjs/ │ │ │ │ │ │ └── pegjs.js │ │ │ │ │ ├── perl/ │ │ │ │ │ │ └── perl.js │ │ │ │ │ ├── php/ │ │ │ │ │ │ └── php.js │ │ │ │ │ ├── pig/ │ │ │ │ │ │ └── pig.js │ │ │ │ │ ├── powershell/ │ │ │ │ │ │ └── powershell.js │ │ │ │ │ ├── properties/ │ │ │ │ │ │ └── properties.js │ │ │ │ │ ├── protobuf/ │ │ │ │ │ │ └── protobuf.js │ │ │ │ │ ├── pug/ │ │ │ │ │ │ └── pug.js │ │ │ │ │ ├── puppet/ │ │ │ │ │ │ └── puppet.js │ │ │ │ │ ├── python/ │ │ │ │ │ │ └── python.js │ │ │ │ │ ├── q/ │ │ │ │ │ │ └── q.js │ │ │ │ │ ├── r/ │ │ │ │ │ │ └── r.js │ │ │ │ │ ├── rpm/ │ │ │ │ │ │ └── rpm.js │ │ │ │ │ ├── rst/ │ │ │ │ │ │ └── rst.js │ │ │ │ │ ├── ruby/ │ │ │ │ │ │ └── ruby.js │ │ │ │ │ ├── rust/ │ │ │ │ │ │ └── rust.js │ │ │ │ │ ├── sas/ │ │ │ │ │ │ └── sas.js │ │ │ │ │ ├── sass/ │ │ │ │ │ │ └── sass.js │ │ │ │ │ ├── scheme/ │ │ │ │ │ │ └── scheme.js │ │ │ │ │ ├── shell/ │ │ │ │ │ │ └── shell.js │ │ │ │ │ ├── sieve/ │ │ │ │ │ │ └── sieve.js │ │ │ │ │ ├── slim/ │ │ │ │ │ │ └── slim.js │ │ │ │ │ ├── smalltalk/ │ │ │ │ │ │ └── smalltalk.js │ │ │ │ │ ├── smarty/ │ │ │ │ │ │ └── smarty.js │ │ │ │ │ ├── solr/ │ │ │ │ │ │ └── solr.js │ │ │ │ │ ├── soy/ │ │ │ │ │ │ └── soy.js │ │ │ │ │ ├── sparql/ │ │ │ │ │ │ └── sparql.js │ │ │ │ │ ├── spreadsheet/ │ │ │ │ │ │ └── spreadsheet.js │ │ │ │ │ ├── sql/ │ │ │ │ │ │ └── sql.js │ │ │ │ │ ├── stex/ │ │ │ │ │ │ └── stex.js │ │ │ │ │ ├── stylus/ │ │ │ │ │ │ └── stylus.js │ │ │ │ │ ├── swift/ │ │ │ │ │ │ └── swift.js │ │ │ │ │ ├── tcl/ │ │ │ │ │ │ └── tcl.js │ │ │ │ │ ├── textile/ │ │ │ │ │ │ └── textile.js │ │ │ │ │ ├── tiddlywiki/ │ │ │ │ │ │ ├── tiddlywiki.css │ │ │ │ │ │ └── tiddlywiki.js │ │ │ │ │ ├── tiki/ │ │ │ │ │ │ ├── tiki.css │ │ │ │ │ │ └── tiki.js │ │ │ │ │ ├── toml/ │ │ │ │ │ │ └── toml.js │ │ │ │ │ ├── tornado/ │ │ │ │ │ │ └── tornado.js │ │ │ │ │ ├── troff/ │ │ │ │ │ │ └── troff.js │ │ │ │ │ ├── ttcn/ │ │ │ │ │ │ └── ttcn.js │ │ │ │ │ ├── ttcn-cfg/ │ │ │ │ │ │ └── ttcn-cfg.js │ │ │ │ │ ├── turtle/ │ │ │ │ │ │ └── turtle.js │ │ │ │ │ ├── twig/ │ │ │ │ │ │ └── twig.js │ │ │ │ │ ├── vb/ │ │ │ │ │ │ └── vb.js │ │ │ │ │ ├── vbscript/ │ │ │ │ │ │ └── vbscript.js │ │ │ │ │ ├── velocity/ │ │ │ │ │ │ └── velocity.js │ │ │ │ │ ├── verilog/ │ │ │ │ │ │ └── verilog.js │ │ │ │ │ ├── vhdl/ │ │ │ │ │ │ └── vhdl.js │ │ │ │ │ ├── vue/ │ │ │ │ │ │ └── vue.js │ │ │ │ │ ├── webidl/ │ │ │ │ │ │ └── webidl.js │ │ │ │ │ ├── xml/ │ │ │ │ │ │ └── xml.js │ │ │ │ │ ├── xquery/ │ │ │ │ │ │ └── xquery.js │ │ │ │ │ ├── yacas/ │ │ │ │ │ │ └── yacas.js │ │ │ │ │ ├── yaml/ │ │ │ │ │ │ └── yaml.js │ │ │ │ │ ├── yaml-frontmatter/ │ │ │ │ │ │ └── yaml-frontmatter.js │ │ │ │ │ └── z80/ │ │ │ │ │ └── z80.js │ │ │ │ └── theme/ │ │ │ │ ├── 3024-day.css │ │ │ │ ├── 3024-night.css │ │ │ │ ├── abcdef.css │ │ │ │ ├── ambiance-mobile.css │ │ │ │ ├── ambiance.css │ │ │ │ ├── base16-dark.css │ │ │ │ ├── base16-light.css │ │ │ │ ├── bespin.css │ │ │ │ ├── blackboard.css │ │ │ │ ├── cobalt.css │ │ │ │ ├── colorforth.css │ │ │ │ ├── dracula.css │ │ │ │ ├── eclipse.css │ │ │ │ ├── elegant.css │ │ │ │ ├── erlang-dark.css │ │ │ │ ├── hopscotch.css │ │ │ │ ├── icecoder.css │ │ │ │ ├── isotope.css │ │ │ │ ├── lesser-dark.css │ │ │ │ ├── liquibyte.css │ │ │ │ ├── material.css │ │ │ │ ├── mbo.css │ │ │ │ ├── mdn-like.css │ │ │ │ ├── midnight.css │ │ │ │ ├── monokai.css │ │ │ │ ├── neat.css │ │ │ │ ├── neo.css │ │ │ │ ├── night.css │ │ │ │ ├── panda-syntax.css │ │ │ │ ├── paraiso-dark.css │ │ │ │ ├── paraiso-light.css │ │ │ │ ├── pastel-on-dark.css │ │ │ │ ├── railscasts.css │ │ │ │ ├── rubyblue.css │ │ │ │ ├── seti.css │ │ │ │ ├── solarized.css │ │ │ │ ├── the-matrix.css │ │ │ │ ├── tomorrow-night-bright.css │ │ │ │ ├── tomorrow-night-eighties.css │ │ │ │ ├── ttcn.css │ │ │ │ ├── twilight.css │ │ │ │ ├── vibrant-ink.css │ │ │ │ ├── xq-dark.css │ │ │ │ ├── xq-light.css │ │ │ │ ├── yeti.css │ │ │ │ └── zenburn.css │ │ │ ├── github.css │ │ │ ├── intercept.js │ │ │ ├── polyfills.js │ │ │ ├── source-editor.css │ │ │ ├── source-editor.html │ │ │ └── source-editor.js │ │ ├── java/ │ │ │ └── com/ │ │ │ └── github/ │ │ │ └── pockethub/ │ │ │ └── android/ │ │ │ ├── ApplicationComponent.java │ │ │ ├── ApplicationModule.kt │ │ │ ├── GitHubModule.java │ │ │ ├── Intents.java │ │ │ ├── PocketHub.java │ │ │ ├── PocketHubModule.java │ │ │ ├── RequestCodes.java │ │ │ ├── RequestReader.java │ │ │ ├── RequestWriter.java │ │ │ ├── ResultCodes.java │ │ │ ├── accounts/ │ │ │ │ ├── AccountAuthenticator.java │ │ │ │ ├── AccountAuthenticatorService.java │ │ │ │ ├── AccountUtils.java │ │ │ │ ├── AccountsHelper.java │ │ │ │ ├── LoginActivity.java │ │ │ │ └── LoginWebViewActivity.java │ │ │ ├── core/ │ │ │ │ ├── GitHubRequest.kt │ │ │ │ ├── ItemStore.java │ │ │ │ ├── OnLoadListener.java │ │ │ │ ├── code/ │ │ │ │ │ ├── FullTree.java │ │ │ │ │ └── RefreshTreeTask.java │ │ │ │ ├── commit/ │ │ │ │ │ ├── CommitMatch.kt │ │ │ │ │ ├── CommitStore.java │ │ │ │ │ ├── CommitUriMatcher.java │ │ │ │ │ ├── CommitUtils.kt │ │ │ │ │ ├── FullCommit.java │ │ │ │ │ ├── FullCommitFile.java │ │ │ │ │ └── RefreshCommitTask.java │ │ │ │ ├── gist/ │ │ │ │ │ ├── FullGist.kt │ │ │ │ │ ├── GistEventMatcher.java │ │ │ │ │ ├── GistStore.java │ │ │ │ │ ├── GistUriMatcher.java │ │ │ │ │ └── RefreshGistTask.java │ │ │ │ ├── issue/ │ │ │ │ │ ├── FullIssue.kt │ │ │ │ │ ├── IssueEventMatcher.java │ │ │ │ │ ├── IssueFilter.java │ │ │ │ │ ├── IssueStore.java │ │ │ │ │ ├── IssueUriMatcher.java │ │ │ │ │ ├── IssueUtils.java │ │ │ │ │ └── RefreshIssueTask.java │ │ │ │ ├── ref/ │ │ │ │ │ └── RefUtils.java │ │ │ │ ├── repo/ │ │ │ │ │ ├── RepositoryEventMatcher.java │ │ │ │ │ ├── RepositoryUriMatcher.java │ │ │ │ │ └── RepositoryUtils.kt │ │ │ │ └── user/ │ │ │ │ ├── UserComparator.java │ │ │ │ ├── UserEventMatcher.java │ │ │ │ └── UserUriMatcher.java │ │ │ ├── dagger/ │ │ │ │ ├── ActivityBuilder.java │ │ │ │ ├── ActivityScope.java │ │ │ │ ├── CommitCompareViewFragmentProvider.java │ │ │ │ ├── CommitViewFragmentProvider.java │ │ │ │ ├── CreateCommentFragmentProvider.java │ │ │ │ ├── DialogFragmentBuilder.java │ │ │ │ ├── FiltersViewFragmentProvider.java │ │ │ │ ├── GistFilesViewFragmentProvider.java │ │ │ │ ├── GistsPagerFragmentProvider.java │ │ │ │ ├── GistsViewFragmentProvider.java │ │ │ │ ├── HomePagerFragmentProvider.java │ │ │ │ ├── IssueBrowseFragmentProvider.java │ │ │ │ ├── IssueDashboardPagerFragmentProvider.java │ │ │ │ ├── IssueSearchFragmentProvider.java │ │ │ │ ├── IssuesViewFragmentProvider.java │ │ │ │ ├── MainFragmentProvider.java │ │ │ │ ├── NotificationFragmentProvider.java │ │ │ │ ├── RepositoryContributorsFragmentProvider.java │ │ │ │ ├── RepositoryViewFragmentProvider.java │ │ │ │ ├── SearchActivityFragmentProvider.java │ │ │ │ ├── ServiceBuilder.java │ │ │ │ └── UserViewFragmentProvider.java │ │ │ ├── markwon/ │ │ │ │ ├── AlignHandler.java │ │ │ │ ├── AsyncDrawableSchedulerPlugin.java │ │ │ │ ├── FontResolver.java │ │ │ │ ├── GifAwareGlideStore.java │ │ │ │ ├── MarkwonUtils.java │ │ │ │ ├── SpanLinkPlugin.java │ │ │ │ ├── SvgDecoder.java │ │ │ │ ├── SvgDrawableTranscoder.java │ │ │ │ └── SvgModule.java │ │ │ ├── persistence/ │ │ │ │ ├── AccountDataManager.java │ │ │ │ ├── DatabaseCache.kt │ │ │ │ ├── OrganizationRepositories.kt │ │ │ │ ├── OrganizationRepositoriesFactory.java │ │ │ │ ├── Organizations.kt │ │ │ │ └── PersistableResource.java │ │ │ ├── rx/ │ │ │ │ ├── AutoDisposeUtils.java │ │ │ │ └── RxProgress.java │ │ │ ├── sync/ │ │ │ │ ├── ContentProviderAdapter.java │ │ │ │ ├── SyncAdapter.java │ │ │ │ ├── SyncAdapterService.java │ │ │ │ └── SyncCampaign.java │ │ │ ├── ui/ │ │ │ │ ├── ConfirmDialogFragment.java │ │ │ │ ├── DialogResultListener.java │ │ │ │ ├── FragmentProvider.java │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── NewsFragment.kt │ │ │ │ ├── SingleChoiceDialogFragment.java │ │ │ │ ├── TextWatcherAdapter.java │ │ │ │ ├── ViewPager.java │ │ │ │ ├── WebView.java │ │ │ │ ├── base/ │ │ │ │ │ ├── AccountAuthenticatorAppCompatActivity.java │ │ │ │ │ ├── BaseActivity.kt │ │ │ │ │ ├── BaseFragment.kt │ │ │ │ │ ├── DialogFragmentHelper.java │ │ │ │ │ ├── FragmentPagerAdapter.java │ │ │ │ │ └── FragmentStatePagerAdapter.java │ │ │ │ ├── code/ │ │ │ │ │ └── RepositoryCodeFragment.kt │ │ │ │ ├── comment/ │ │ │ │ │ ├── CommentPreviewPagerAdapter.java │ │ │ │ │ ├── CreateCommentActivity.kt │ │ │ │ │ ├── DeleteCommentListener.java │ │ │ │ │ ├── EditCommentListener.java │ │ │ │ │ ├── RawCommentFragment.kt │ │ │ │ │ └── RenderedCommentFragment.kt │ │ │ │ ├── commit/ │ │ │ │ │ ├── CommitCompareListFragment.kt │ │ │ │ │ ├── CommitCompareViewActivity.java │ │ │ │ │ ├── CommitDiffListFragment.kt │ │ │ │ │ ├── CommitFileComparator.java │ │ │ │ │ ├── CommitFileViewActivity.kt │ │ │ │ │ ├── CommitListFragment.kt │ │ │ │ │ ├── CommitPagerAdapter.java │ │ │ │ │ ├── CommitViewActivity.kt │ │ │ │ │ ├── CreateCommentActivity.java │ │ │ │ │ └── DiffStyler.java │ │ │ │ ├── gist/ │ │ │ │ │ ├── CreateCommentActivity.java │ │ │ │ │ ├── CreateGistActivity.kt │ │ │ │ │ ├── EditCommentActivity.java │ │ │ │ │ ├── GistFileFragment.kt │ │ │ │ │ ├── GistFilesPagerAdapter.java │ │ │ │ │ ├── GistFilesViewActivity.kt │ │ │ │ │ ├── GistFragment.kt │ │ │ │ │ ├── GistQueriesPagerAdapter.java │ │ │ │ │ ├── GistsFragment.kt │ │ │ │ │ ├── GistsPagerAdapter.java │ │ │ │ │ ├── GistsPagerFragment.kt │ │ │ │ │ ├── GistsViewActivity.kt │ │ │ │ │ ├── MyGistsFragment.java │ │ │ │ │ ├── PublicGistsFragment.java │ │ │ │ │ └── StarredGistsFragment.java │ │ │ │ ├── helpers/ │ │ │ │ │ ├── ItemListHandler.kt │ │ │ │ │ ├── ListFetcher.kt │ │ │ │ │ ├── PagedListFetcher.kt │ │ │ │ │ ├── PagedScrollListener.kt │ │ │ │ │ ├── PagerHandler.kt │ │ │ │ │ └── ResourceLoadingIndicator.kt │ │ │ │ ├── issue/ │ │ │ │ │ ├── AssigneeDialog.java │ │ │ │ │ ├── AssigneeDialogFragment.java │ │ │ │ │ ├── CreateCommentActivity.java │ │ │ │ │ ├── DashboardIssueFragment.kt │ │ │ │ │ ├── EditAssigneeTask.java │ │ │ │ │ ├── EditCommentActivity.java │ │ │ │ │ ├── EditIssueActivity.kt │ │ │ │ │ ├── EditIssuesFilterActivity.kt │ │ │ │ │ ├── EditLabelsTask.java │ │ │ │ │ ├── EditMilestoneTask.java │ │ │ │ │ ├── EditStateTask.java │ │ │ │ │ ├── FilterListFragment.kt │ │ │ │ │ ├── FiltersViewActivity.java │ │ │ │ │ ├── IssueBrowseActivity.java │ │ │ │ │ ├── IssueDashboardPagerAdapter.java │ │ │ │ │ ├── IssueDashboardPagerFragment.kt │ │ │ │ │ ├── IssueFragment.kt │ │ │ │ │ ├── IssueSearchActivity.java │ │ │ │ │ ├── IssueSearchSuggestionsProvider.java │ │ │ │ │ ├── IssuesFragment.kt │ │ │ │ │ ├── IssuesPagerAdapter.java │ │ │ │ │ ├── IssuesViewActivity.kt │ │ │ │ │ ├── LabelDrawableSpan.kt │ │ │ │ │ ├── LabelsDialog.java │ │ │ │ │ ├── LabelsDialogFragment.java │ │ │ │ │ ├── MilestoneDialog.java │ │ │ │ │ ├── MilestoneDialogFragment.kt │ │ │ │ │ └── SearchIssueListFragment.kt │ │ │ │ ├── item/ │ │ │ │ │ ├── ContributorItem.kt │ │ │ │ │ ├── GitHubCommentItem.kt │ │ │ │ │ ├── LoadingItem.kt │ │ │ │ │ ├── TextItem.kt │ │ │ │ │ ├── UserItem.kt │ │ │ │ │ ├── code/ │ │ │ │ │ │ ├── BlobItem.kt │ │ │ │ │ │ ├── FolderItem.kt │ │ │ │ │ │ └── PathHeaderItem.kt │ │ │ │ │ ├── commit/ │ │ │ │ │ │ ├── CommitCommentItem.kt │ │ │ │ │ │ ├── CommitFileHeaderItem.kt │ │ │ │ │ │ ├── CommitFileLineItem.kt │ │ │ │ │ │ ├── CommitHeaderItem.kt │ │ │ │ │ │ ├── CommitItem.kt │ │ │ │ │ │ └── CommitParentItem.kt │ │ │ │ │ ├── dialog/ │ │ │ │ │ │ ├── AssigneeDialogItem.kt │ │ │ │ │ │ ├── LabelDialogItem.kt │ │ │ │ │ │ ├── MilestoneDialogItem.kt │ │ │ │ │ │ └── RefDialogItem.kt │ │ │ │ │ ├── gist/ │ │ │ │ │ │ ├── GistFileItem.kt │ │ │ │ │ │ ├── GistHeaderItem.kt │ │ │ │ │ │ └── GistItem.kt │ │ │ │ │ ├── issue/ │ │ │ │ │ │ ├── IssueDashboardItem.kt │ │ │ │ │ │ ├── IssueEventItem.kt │ │ │ │ │ │ ├── IssueFilterHeaderItem.kt │ │ │ │ │ │ ├── IssueFilterItem.kt │ │ │ │ │ │ ├── IssueHeaderItem.kt │ │ │ │ │ │ └── IssueItem.kt │ │ │ │ │ ├── news/ │ │ │ │ │ │ ├── CommitCommentEventItem.kt │ │ │ │ │ │ ├── CreateEventItem.kt │ │ │ │ │ │ ├── DeleteEventItem.kt │ │ │ │ │ │ ├── FollowEventItem.kt │ │ │ │ │ │ ├── ForkEventItem.kt │ │ │ │ │ │ ├── GistEventItem.kt │ │ │ │ │ │ ├── GollumEventItem.kt │ │ │ │ │ │ ├── IssueCommentEventItem.kt │ │ │ │ │ │ ├── IssuesEventItem.kt │ │ │ │ │ │ ├── MemberEventItem.kt │ │ │ │ │ │ ├── NewsItem.kt │ │ │ │ │ │ ├── PublicEventItem.kt │ │ │ │ │ │ ├── PullRequestEventItem.kt │ │ │ │ │ │ ├── PullRequestReviewCommentEventItem.kt │ │ │ │ │ │ ├── PushEventItem.kt │ │ │ │ │ │ ├── ReleaseEventItem.kt │ │ │ │ │ │ ├── TeamAddEventItem.kt │ │ │ │ │ │ └── WatchEventItem.kt │ │ │ │ │ ├── notification/ │ │ │ │ │ │ ├── NotificationHeaderItem.kt │ │ │ │ │ │ └── NotificationItem.kt │ │ │ │ │ └── repository/ │ │ │ │ │ ├── RepositoryHeaderItem.kt │ │ │ │ │ └── RepositoryItem.kt │ │ │ │ ├── notification/ │ │ │ │ │ ├── NotificationActivity.kt │ │ │ │ │ ├── NotificationListFragment.kt │ │ │ │ │ ├── NotificationPagerAdapter.java │ │ │ │ │ └── NotificationReadListener.java │ │ │ │ ├── ref/ │ │ │ │ │ ├── BranchFileViewActivity.kt │ │ │ │ │ ├── RefDialog.java │ │ │ │ │ └── RefDialogFragment.java │ │ │ │ ├── repo/ │ │ │ │ │ ├── RecentRepositories.java │ │ │ │ │ ├── RepositoryContributorsActivity.java │ │ │ │ │ ├── RepositoryContributorsFragment.kt │ │ │ │ │ ├── RepositoryListFragment.kt │ │ │ │ │ ├── RepositoryNewsFragment.java │ │ │ │ │ ├── RepositoryPagerAdapter.java │ │ │ │ │ ├── RepositoryReadmeFragment.kt │ │ │ │ │ ├── RepositoryViewActivity.kt │ │ │ │ │ └── UserRepositoryListFragment.kt │ │ │ │ ├── search/ │ │ │ │ │ ├── RepositorySearchSuggestionsProvider.java │ │ │ │ │ ├── SearchActivity.kt │ │ │ │ │ ├── SearchPagerAdapter.java │ │ │ │ │ ├── SearchRepositoryListFragment.kt │ │ │ │ │ └── SearchUserListFragment.kt │ │ │ │ ├── user/ │ │ │ │ │ ├── FollowersFragment.kt │ │ │ │ │ ├── FollowingFragment.kt │ │ │ │ │ ├── HomePagerAdapter.kt │ │ │ │ │ ├── HomePagerFragment.kt │ │ │ │ │ ├── MembersFragment.kt │ │ │ │ │ ├── MyFollowersFragment.java │ │ │ │ │ ├── MyFollowingFragment.java │ │ │ │ │ ├── OrganizationNewsFragment.java │ │ │ │ │ ├── OrganizationSelectionListener.java │ │ │ │ │ ├── OrganizationSelectionProvider.java │ │ │ │ │ ├── PagedUserFragment.kt │ │ │ │ │ ├── UriLauncherActivity.java │ │ │ │ │ ├── UserCreatedNewsFragment.java │ │ │ │ │ ├── UserFollowersFragment.java │ │ │ │ │ ├── UserFollowingFragment.java │ │ │ │ │ ├── UserNewsFragment.java │ │ │ │ │ ├── UserPagerAdapter.java │ │ │ │ │ ├── UserReceivedNewsFragment.java │ │ │ │ │ └── UserViewActivity.kt │ │ │ │ └── view/ │ │ │ │ ├── LinkTextView.kt │ │ │ │ └── OcticonTextView.java │ │ │ └── util/ │ │ │ ├── AvatarLoader.kt │ │ │ ├── ConvertUtils.java │ │ │ ├── GravatarUtils.java │ │ │ ├── HtmlUtils.java │ │ │ ├── HttpImageGetter.java │ │ │ ├── ImageBinPoster.kt │ │ │ ├── ImageUtils.java │ │ │ ├── InfoUtils.java │ │ │ ├── MarkdownLoader.java │ │ │ ├── MarkdownUtils.java │ │ │ ├── PermissionsUtils.java │ │ │ ├── PreferenceUtils.java │ │ │ ├── RxPageUtil.java │ │ │ ├── ServiceUtils.java │ │ │ ├── ShareUtils.java │ │ │ ├── SourceEditor.java │ │ │ ├── TimeUtils.java │ │ │ ├── ToastUtils.java │ │ │ └── android/ │ │ │ └── text/ │ │ │ └── SpannableStringBuilder.kt │ │ ├── res/ │ │ │ ├── color/ │ │ │ │ └── color_navigation_view_icon.xml │ │ │ ├── drawable/ │ │ │ │ ├── actionbar_spinner.xml │ │ │ │ ├── diff_add_background.xml │ │ │ │ ├── diff_marker_background.xml │ │ │ │ ├── diff_remove_background.xml │ │ │ │ ├── edit_text_background.xml │ │ │ │ ├── edit_text_cursor.xml │ │ │ │ ├── footer_selector.xml │ │ │ │ ├── ic_add_a_photo.xml │ │ │ │ ├── ic_notifications_black.xml │ │ │ │ ├── ic_search_white_24dp.xml │ │ │ │ ├── inset_background.xml │ │ │ │ ├── label_background.xml │ │ │ │ ├── list_divider_5dp.xml │ │ │ │ ├── list_item_background.xml │ │ │ │ ├── milestone_background.xml │ │ │ │ ├── milestone_closed_background.xml │ │ │ │ ├── section_background.xml │ │ │ │ ├── section_selected_background.xml │ │ │ │ └── section_selector.xml │ │ │ ├── layout/ │ │ │ │ ├── activity_commit_file_view.xml │ │ │ │ ├── activity_gist_create.xml │ │ │ │ ├── activity_issue_edit.xml │ │ │ │ ├── activity_issue_search.xml │ │ │ │ ├── activity_issues_filter_edit.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_pager.xml │ │ │ │ ├── activity_pager_with_title.xml │ │ │ │ ├── activity_repo_contributors.xml │ │ │ │ ├── activity_repo_issue_list.xml │ │ │ │ ├── adapter_fenced_code_block.xml │ │ │ │ ├── blob_item.xml │ │ │ │ ├── collaborator_item.xml │ │ │ │ ├── comment.xml │ │ │ │ ├── comment_event.xml │ │ │ │ ├── comment_event_item.xml │ │ │ │ ├── comment_item.xml │ │ │ │ ├── commit_comment_item.xml │ │ │ │ ├── commit_compare.xml │ │ │ │ ├── commit_compare_file_details_header.xml │ │ │ │ ├── commit_details_header.xml │ │ │ │ ├── commit_diff_file_header.xml │ │ │ │ ├── commit_diff_line.xml │ │ │ │ ├── commit_file_details_header.xml │ │ │ │ ├── commit_header.xml │ │ │ │ ├── commit_item.xml │ │ │ │ ├── commit_parent_item.xml │ │ │ │ ├── contributor_item.xml │ │ │ │ ├── dashboard_issue_item.xml │ │ │ │ ├── diff_comment_item.xml │ │ │ │ ├── diff_line_dialog.xml │ │ │ │ ├── drawer_header.xml │ │ │ │ ├── folder_item.xml │ │ │ │ ├── fragment_comment_create.xml │ │ │ │ ├── fragment_comment_list.xml │ │ │ │ ├── fragment_comment_preview.xml │ │ │ │ ├── fragment_commit_diff_list.xml │ │ │ │ ├── fragment_commit_list.xml │ │ │ │ ├── fragment_gist_file_view.xml │ │ │ │ ├── fragment_item_list.xml │ │ │ │ ├── fragment_repo_code.xml │ │ │ │ ├── gist_file_item.xml │ │ │ │ ├── gist_header.xml │ │ │ │ ├── gist_item.xml │ │ │ │ ├── issue_details.xml │ │ │ │ ├── issue_header.xml │ │ │ │ ├── issue_number.xml │ │ │ │ ├── issues_filter_details.xml │ │ │ │ ├── issues_filter_header.xml │ │ │ │ ├── issues_filter_item.xml │ │ │ │ ├── issues_filter_list.xml │ │ │ │ ├── label_item.xml │ │ │ │ ├── loading_item.xml │ │ │ │ ├── login.xml │ │ │ │ ├── markwon_adapter.xml │ │ │ │ ├── markwon_adapter_test.xml │ │ │ │ ├── markwon_table_block.xml │ │ │ │ ├── markwon_table_cell.xml │ │ │ │ ├── milestone.xml │ │ │ │ ├── milestone_item.xml │ │ │ │ ├── news_item.xml │ │ │ │ ├── notification_item.xml │ │ │ │ ├── notification_item_header.xml │ │ │ │ ├── pager_with_tabs.xml │ │ │ │ ├── path_item.xml │ │ │ │ ├── ref_footer.xml │ │ │ │ ├── ref_item.xml │ │ │ │ ├── repo_details.xml │ │ │ │ ├── repo_dialog.xml │ │ │ │ ├── repo_header_item.xml │ │ │ │ ├── repo_issue_item.xml │ │ │ │ ├── tabbed_progress_pager.xml │ │ │ │ ├── user_item.xml │ │ │ │ └── user_repo_item.xml │ │ │ ├── menu/ │ │ │ │ ├── activity_comment.xml │ │ │ │ ├── activity_create_gist.xml │ │ │ │ ├── activity_file_view.xml │ │ │ │ ├── activity_issue_edit.xml │ │ │ │ ├── activity_issue_filter.xml │ │ │ │ ├── activity_login.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_repository.xml │ │ │ │ ├── activity_search.xml │ │ │ │ ├── activity_user_follow.xml │ │ │ │ ├── fragment_code_view.xml │ │ │ │ ├── fragment_commit_view.xml │ │ │ │ ├── fragment_gist_view.xml │ │ │ │ ├── fragment_gists.xml │ │ │ │ ├── fragment_issue_view.xml │ │ │ │ ├── fragment_issues.xml │ │ │ │ ├── fragment_refresh.xml │ │ │ │ └── navigation.xml │ │ │ ├── values/ │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── styles.xml │ │ │ │ ├── theme.xml │ │ │ │ └── typeface.xml │ │ │ ├── values-bg/ │ │ │ │ └── strings.xml │ │ │ ├── values-cs/ │ │ │ │ └── strings.xml │ │ │ ├── values-de/ │ │ │ │ └── strings.xml │ │ │ ├── values-el/ │ │ │ │ └── strings.xml │ │ │ ├── values-es/ │ │ │ │ └── strings.xml │ │ │ ├── values-fr/ │ │ │ │ └── strings.xml │ │ │ ├── values-hu/ │ │ │ │ └── strings.xml │ │ │ ├── values-is/ │ │ │ │ └── strings.xml │ │ │ ├── values-it/ │ │ │ │ └── strings.xml │ │ │ ├── values-iw/ │ │ │ │ └── strings.xml │ │ │ ├── values-ja/ │ │ │ │ └── strings.xml │ │ │ ├── values-ko/ │ │ │ │ └── strings.xml │ │ │ ├── values-no/ │ │ │ │ └── strings.xml │ │ │ ├── values-pl/ │ │ │ │ └── strings.xml │ │ │ ├── values-pt/ │ │ │ │ └── strings.xml │ │ │ ├── values-ro/ │ │ │ │ └── strings.xml │ │ │ ├── values-ru/ │ │ │ │ └── strings.xml │ │ │ ├── values-sk/ │ │ │ │ └── strings.xml │ │ │ ├── values-sv/ │ │ │ │ └── strings.xml │ │ │ ├── values-tr/ │ │ │ │ └── strings.xml │ │ │ ├── values-uk/ │ │ │ │ └── strings.xml │ │ │ ├── values-v21/ │ │ │ │ └── dimens.xml │ │ │ ├── values-v23/ │ │ │ │ └── styles.xml │ │ │ ├── values-zh-rCN/ │ │ │ │ └── strings.xml │ │ │ ├── values-zh-rTW/ │ │ │ │ └── strings.xml │ │ │ └── xml/ │ │ │ ├── authenticator.xml │ │ │ ├── searchable_issues.xml │ │ │ ├── searchable_repos_users.xml │ │ │ └── sync_adapter.xml │ │ └── sqldelight/ │ │ └── com.github.pockethub.android/ │ │ ├── 10.sqm │ │ ├── 11.sqm │ │ ├── 12.sqm │ │ ├── 9.sqm │ │ ├── issue_filter.sq │ │ ├── organizations.sq │ │ └── repositories.sq │ └── test/ │ └── java/ │ └── com/ │ └── github/ │ └── pockethub/ │ └── android/ │ ├── AccountManagerShadow.java │ ├── ui/ │ │ └── MainActivityTest.java │ └── util/ │ └── ConvertUtilsTest.java ├── build.gradle ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat ├── proguard.cfg ├── script/ │ └── style/ │ └── checkstyle.xml └── settings.gradle ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitattributes ================================================ # Set default behaviour, in case users don't have core.autocrlf set. * text=auto ================================================ FILE: .gitignore ================================================ */target target tmp *~ bin */test-output temp-testng-customsuite.xml **pom.xml.releaseBackup release.properties gen */seed.txt notes logs gen-external-apklibs .idea *.iml .DS_Store *.swp out .gradle /local.properties /build ###OSX### .DS_Store .AppleDouble .LSOverride # Icon must ends with two \r. Icon # Thumbnails ._* # Files that might appear on external disk .Spotlight-V100 .Trashes ###Linux### *~ # KDE directory preferences .directory ###Android### # Built application files *.apk *.ap_ # Files for ART and Dalvik VM *.dex # Java class files *.class # Generated files bin/ gen/ # Gradle files .gradle/ .gradletasknamecache build/ # Local configuration file (sdk path, etc) local.properties # Proguard folder generated by Eclipse proguard/ # Lint lint-report.html lint-report_files/ lint_result.txt # Mobile Tools for Java (J2ME) .mtj.tmp/ # Package Files # *.war *.ear # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* ###IntelliJ### *.iml *.ipr *.iws .idea/ ###Eclipse### *.pydevproject .metadata tmp/ *.tmp *.bak *.swp *~.nib .settings/ .loadpath # External tool builders .externalToolBuilders/ # Locally stored "Eclipse launch configurations" *.launch # CDT-specific .cproject # PDT-specific .buildpath # sbteclipse plugin .target # TeXlipse plugin .texlipse #GitHub application codes (local and personal) github.properties ================================================ FILE: .travis.yml ================================================ language: android android: components: - tools - tools #Running this twice get's the latest build tools (https://github.com/codepath/android_guides/wiki/Setting-up-Travis-CI) - platform-tools - android-28 - build-tools-28.0.3 - extra licenses: - 'android-sdk-license-.+' jdk: oraclejdk8 notifications: email: false sudo: required #The build runs out of memory and is killed if we use the container system before_install: - yes | sdkmanager "platforms;android-28" script: - ./gradlew clean build - ./gradlew test ================================================ FILE: CONTRIBUTING.md ================================================ Contributing ============ ## Reporting issues * IMPORTANT: Any issues reported regarding the old Play Store version of the original GitHub app will be closed without investigation. Please only report issues regarding the current repo version (i.e. you must confirm this issue exists in the latest master). This is a different app now, and many old issues with the original app (such as 2FA) were resolved in master but not released. * Make sure there's not already an issue (open or closed) regarding your issue. * Include detailed information and steps to reproduce. Any issues opened with no description will be ignored. * Include a screenshot(s) of the issue. Brownie points for a screen recording of the issue. ## ALL pull requests Please include a descriptive title and description. If you changed anything with the UI, please include screenshots of how it looks. Use descriptive messages for your commits, and be sure to explain the *why* for commits where appropriate. Please **don't** squash all your commits into one before opening the PR. Commits are easier to review when they're split up and in the order they happened. Of course, do squash smaller commits together as needed to ensure a clean history. If you open a pull request, you are responsible for engaging with us in the review and discussion afterward. If you don't respond to comments after opening, we will probably just close it. ## Translations Always welcome, but please be prepared to have someone else that speaks if available to review it. Chances are that we cannot review it ourselves, for obvious reasons. ## Bugfixes for existing issues Always welcome. Please reference the issue number you're addressing in the PR, and let us know in the issue tracker if you're working on it. ## New features, UI changes, and infrastructure changes Please make sure you discuss these with us in the issue tracker before opening a pull request. It's good to get a conversation going first to make sure that everyone is on the same page, and this way you don't accidentally invest a lot of time into something we don't want to merge. That said, we're always open to these, so please don't hesitate to start the discussion! ================================================ FILE: ISSUE_TEMPLATE.md ================================================ ## If the issues at hand is a BUG, please follow this template. Otherwise feel free to ignore it. ## Description A concise description of what the problem is. ### Versions and device What version of the app does this happen on?\ Was the version downloaded from the Play Store?\ What version of Android does it happen on?\ What model of phone does it happen on? ## Steps to Reproduce 1. Step by step instructions on how to reproduce this bug. 2. The more detailed your list of instructions, the easier it is for the developer to track down the problem! ### Actual behaviour Describe what happens when you perform the steps above. ### Expected behaviour Describe what you expected to happen when performing the steps above. ## Logs Please include any relevant log output that might assist in tracking down the problem. ================================================ FILE: LICENSE ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: README.md ================================================ # PocketHub [![Build Status](https://travis-ci.org/pockethub/PocketHub.svg?branch=master)](https://travis-ci.org/pockethub/PocketHub) Get it on Google Play This repository contains the source code for the PocketHub Android app. This is the *same* repository as the now-defunct official GitHub Android app. ## What's going on here? > What happened to the old app? GitHub didn't want to maintain the app anymore, so it's been released to the community and maintained as a public project. We are actively working towards a re-release to the Play Store, and this app will be the spiritual successor to the original GitHub app. > What's PocketHub? A name we decided that sounded good. We're a team of a few people helping organizing and prepare this. > What about the other forks out there? They'll remain forks. Obviously we'd prefer them to focus on improving this project, but otherwise we're not coordinating anything with them. > What's the immediate plan? We're shooting for an initial re-release just to get the app out there. There have been a significant number of changes since the app was last updated, with many functional and design changes that we need to make sure are good to go. > What's the less-immediate plan? After the initial release, we'll start working on giving this app a proper refresh. Much of the UI has already been touched up with elements of Material Design, but we have a long ways to go. Android has changed a lot since this was actively developed, and it's time we take advantage of those changes. > How can I help? Please see the [issues](https://github.com/pockethub/PocketHub/issues) section to report any bugs or feature requests and to see the list of known issues. We can't promise fast response times since we all have full time jobs of our own, but we will do our best to respond in a timely fashion. If you'd like to contribute, please fork this repository and contribute back using [pull requests](https://github.com/pockethub/PocketHub/pulls). Any contributions, large or small, major features, bug fixes, additional language translations, unit/integration tests are welcomed and appreciated but will be thoroughly reviewed and discussed. **Please read [CONTRIBUTING.md](https://github.com/pockethub/PocketHub/blob/master/CONTRIBUTING.md) first!** ## Setup Environment 1. Create a GitHub application (https://github.com/settings/applications/new) 2. Set the following gradle properties via one of the ways described [here](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties): - `pockethub_github_client`=your_application_client_id - `pockethub_github_secret`=your_application_client_secret - `pockethub_github_callback`=your_callback_url ### Callback URL - The callback URL needs to be in the format `your_schema://whatever_you_want` - Use a custom schema like `myawesomeschema` (not `http` or `https`) - The schema must be lowercase ([Reference](https://developer.android.com/guide/topics/manifest/data-element.html)) ## Legacy Notes If you had a current installation of the Github App installed and then enabled 2FA (2 Factor Authentication), then you must delete the Personal Access Token (PAT) from your configuration (via the web interface). A thanks to @landstander668 for posting this workaround. ## License * [Apache Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) ================================================ FILE: app/build.gradle ================================================ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' apply plugin: 'com.github.ben-manes.versions' // ./gradlew dependencyUpdates -Drevision=release apply plugin: 'com.squareup.sqldelight' //apply from: 'quality.gradle' repositories { flatDir { dirs 'libs' } } // Manifest version information! def versionMajor = 0 def versionMinor = 5 def versionPatch = 1 def versionBuild = 0 // bump for dogfood builds, public betas, etc. def isTravis = "true".equals(System.getenv("TRAVIS")) def preDexEnabled = "true".equals(System.getProperty("pre-dex", "true")) def clientIdIsNotSet = true; def clientSecretIsNotSet = true; def addConfigValues = { name, isDebug, suffix = "" -> def value = (isDebug ? "com.github.debug" : "com.github") + suffix android.defaultConfig.buildConfigField "String", name, "\"${value}\"" android.defaultConfig.resValue "string", name.toLowerCase(), value } sqldelight { Database { packageName = "com.github.pockethub.android" } } android { compileSdkVersion 28 defaultConfig { applicationId 'com.github.pockethub.android' minSdkVersion 19 targetSdkVersion 28 multiDexEnabled true testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testOptions.unitTests.includeAndroidResources = true versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild versionName "${versionMajor}.${versionMinor}.${versionPatch}" vectorDrawables.useSupportLibrary = true addConfigValues("ACCOUNT_TYPE", false) addConfigValues("PROVIDER_AUTHORITY_SYNC", false, ".sync") addConfigValues("PROVIDER_AUTHORITY_SEARCH_SUGGEST_ISSUES", false, ".search.suggest.recent.issues") addConfigValues("PROVIDER_AUTHORITY_SEARCH_SUGGEST_REPOS", false, ".search.suggest.recent.repos") if (project.hasProperty('pockethub_github_client')) { resValue "string", "github_client", pockethub_github_client clientIdIsNotSet = false } else { resValue "string", "github_client", "dummy_client" } if (project.hasProperty('pockethub_github_secret')) { resValue "string", "github_secret", pockethub_github_secret clientSecretIsNotSet = false } else { resValue "string", "github_secret", "dummy_secret" } if (clientIdIsNotSet || clientSecretIsNotSet) { logger.warn("You won't be able to login, because the oauth client or secret isn't set") logger.warn("Read the README.md: https://github.com/pockethub/PocketHub#setup-environment") } if (project.hasProperty('pockethub_bugsnag_api_key')) { resValue "string", "bugsnag_api_key", pockethub_bugsnag_api_key } else { resValue "string", "bugsnag_api_key", "bugsnag-api-key" } String oauth = "" if (project.hasProperty('pockethub_github_callback')) { oauth = pockethub_github_callback } else { oauth = "http://dummy.example.com" } resValue "string", "github_oauth", oauth resValue "string", "github_oauth_scheme", oauth.split("://")[0] } buildTypes { debug { addConfigValues("ACCOUNT_TYPE", true) addConfigValues("PROVIDER_AUTHORITY_SYNC", true, ".sync") addConfigValues("PROVIDER_AUTHORITY_SEARCH_SUGGEST_ISSUES", true, ".search.suggest.recent.issues") addConfigValues("PROVIDER_AUTHORITY_SEARCH_SUGGEST_REPOS", true, ".search.suggest.recent.repos") applicationIdSuffix ".debug" } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8.toString() } testOptions { animationsDisabled = true unitTests { includeAndroidResources = true } } configurations { implementation.exclude group: 'org.jetbrains', module: 'annotations' } packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/LICENSE' exclude 'META-INF/NOTICE' } lintOptions { warning 'MissingTranslation' abortOnError true check 'NewApi', 'InlinedApi' fatal 'NewApi', 'InlinedApi' checkReleaseBuilds true textReport isTravis textOutput 'stdout' htmlReport !isTravis xmlReport !isTravis } dexOptions { // Skip pre-dexing when running on Travis CI or when disabled via -Dpre-dex=false. preDexLibraries = preDexEnabled && !isTravis } } androidExtensions { experimental = true } kapt { correctErrorTypes = true } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.core:core-ktx:1.2.0' implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0' implementation 'com.google.android.material:material:1.1.0' final def markwon_version = '4.3.0' implementation "io.noties.markwon:core:$markwon_version" implementation "io.noties.markwon:ext-strikethrough:$markwon_version" implementation "io.noties.markwon:ext-tasklist:$markwon_version" implementation "io.noties.markwon:html:$markwon_version" implementation "io.noties.markwon:image:$markwon_version" implementation "io.noties.markwon:image-glide:$markwon_version" implementation "io.noties.markwon:linkify:$markwon_version" implementation "io.noties.markwon:recycler-table:$markwon_version" implementation "io.noties.markwon:syntax-highlight:$markwon_version" implementation "com.caverock:androidsvg:1.4" implementation "pl.droidsonroids.gif:android-gif-drawable:1.2.19" implementation 'com.github.bumptech.glide:glide:4.11.0' implementation "com.github.bumptech.glide:okhttp3-integration:4.11.0" kapt 'com.github.bumptech.glide:compiler:4.11.0' kapt 'io.noties:prism4j-bundler:2.0.0' implementation 'com.squareup.okhttp3:okhttp:3.10.0' implementation "com.squareup.sqldelight:android-driver:1.2.2" implementation 'io.reactivex.rxjava2:rxandroid:2.0.2' implementation 'io.reactivex.rxjava2:rxjava:2.1.10' implementation 'com.uber.autodispose:autodispose:0.6.1' implementation 'com.uber.autodispose:autodispose-android-archcomponents:0.6.1' implementation 'com.bugsnag:bugsnag-android:4.3.1' implementation 'com.google.dagger:dagger:2.27' implementation 'com.google.dagger:dagger-android:2.27' implementation 'com.google.dagger:dagger-android-support:2.27' kapt 'com.google.dagger:dagger-compiler:2.27' kapt 'com.google.dagger:dagger-android-processor:2.27' compileOnly 'com.episode6.hackit.auto.factory:auto-factory-annotations:1.0-beta5' kapt 'com.google.auto.factory:auto-factory:1.0-beta7' implementation 'com.github.meisolsson:githubsdk:0.7.0' implementation "com.squareup.moshi:moshi:1.9.2" implementation 'com.afollestad.material-dialogs:core:0.9.6.0' implementation 'com.xwray:groupie:2.3.0' implementation 'com.xwray:groupie-kotlin-android-extensions:2.3.0' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.1.0' androidTestImplementation 'com.android.support:support-annotations:28.0.0' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test:rules:1.0.2' //Libs for testing testImplementation 'junit:junit:4.12' testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" testImplementation "androidx.test:core:1.2.0" testImplementation "org.mockito:mockito-core:2.18.3" testImplementation "org.robolectric:robolectric:4.2.1" } ================================================ FILE: app/quality.gradle ================================================ apply plugin: 'checkstyle' check.dependsOn 'checkstyle' checkstyle { toolVersion = '7.5.1' } task checkstyle(type: Checkstyle) { configFile file("${project.rootDir}/script/style/checkstyle.xml") source 'src' include '**/*.java' exclude '**/gen/**' classpath = files() reports { html { enabled true destination "$project.buildDir/reports/checkstyle/checkstyle.html" } } } ================================================ FILE: app/src/androidTest/AndroidManifest.xml ================================================ ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/NewsEventTextTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; import androidx.test.annotation.UiThreadTest; import androidx.test.filters.SmallTest; import androidx.test.runner.AndroidJUnit4; import com.github.pockethub.android.R; import com.github.pockethub.android.ui.item.news.NewsItem; import com.github.pockethub.android.util.AvatarLoader; import com.meisolsson.githubsdk.model.*; import com.meisolsson.githubsdk.model.payload.*; import com.xwray.groupie.ViewHolder; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import java.util.Collections; import java.util.Date; import static androidx.test.InstrumentationRegistry.getInstrumentation; import static junit.framework.Assert.assertNotNull; import static org.junit.Assert.assertEquals; /** * Tests of the news text rendering */ @RunWith(AndroidJUnit4.class) @SmallTest public class NewsEventTextTest { private TextView text; private User actor; private GitHubEvent.RepoIdentifier repo; private AvatarLoader avatarLoader; private LayoutInflater layoutInflater; @Before public void setUp() { actor = User.builder().login("user").build(); repo = GitHubEvent.RepoIdentifier.builder() .repoWithUserName("user/repo") .build(); Context context = getInstrumentation().getTargetContext(); avatarLoader = new AvatarLoader(context); layoutInflater = LayoutInflater.from(context); } private GitHubEvent createEvent(GitHubEventType type, GitHubPayload payload) { return GitHubEvent.builder() .id("test") .createdAt(new Date()) .type(type) .payload(payload) .actor(actor) .repo(repo) .build(); } private void verify(String expected) { CharSequence actual = text.getText(); assertNotNull(actual); assertEquals(expected, actual.toString()); } private void updateView(GitHubEvent event) { NewsItem item = NewsItem.createNewsItem(avatarLoader, event); View itemView = layoutInflater.inflate(item.getLayout(), null); ViewHolder viewHolder = item.createViewHolder(itemView); item.bind((com.xwray.groupie.kotlinandroidextensions.ViewHolder) viewHolder, 0); text = viewHolder.itemView.findViewById(R.id.tv_event); assertNotNull(text); } /** * Verify text of commit comment event */ @Test @UiThreadTest public void testCommitCommentEvent() { GitHubEvent event = createEvent(GitHubEventType.CommitCommentEvent, CommitCommentPayload.builder().build()); updateView(event); verify("user commented on user/repo"); } /** * Verify text of create event */ @Test @UiThreadTest public void testCreateRepositoryEvent() { CreatePayload payload = CreatePayload.builder() .refType(ReferenceType.Repository) .build(); GitHubEvent event = createEvent(GitHubEventType.CreateEvent, payload); updateView(event); verify("user created repository repo"); } /** * Verify text of create event */ @Test @UiThreadTest public void testCreateBranchEvent() { CreatePayload payload = CreatePayload.builder() .refType(ReferenceType.Branch) .ref("b1") .build(); GitHubEvent event = createEvent(GitHubEventType.CreateEvent, payload); updateView(event); verify("user created branch b1 at user/repo"); } /** * Verify text of delete event */ @Test @UiThreadTest public void testDelete() { DeletePayload payload = DeletePayload.builder() .refType(ReferenceType.Branch) .ref("b1") .build(); GitHubEvent event = createEvent(GitHubEventType.DeleteEvent, payload); updateView(event); verify("user deleted branch b1 at user/repo"); } /** * Verify text of follow event */ @Test @UiThreadTest public void testFollow() { User target = User.builder() .login("user2") .build(); FollowPayload payload = FollowPayload.builder() .target(target) .build(); GitHubEvent event = createEvent(GitHubEventType.FollowEvent, payload); updateView(event); verify("user started following user2"); } /** * Verify text of Gist event */ @Test @UiThreadTest public void testGist() { Gist gist = Gist.builder() .id("1") .build(); GistPayload payload = GistPayload.builder() .action(GistPayload.Action.Created) .gist(gist) .build(); GitHubEvent event = createEvent(GitHubEventType.GistEvent, payload); updateView(event); verify("user created Gist 1"); } /** * Verify text of wiki event */ @Test @UiThreadTest public void testWiki() { GitHubEvent event = createEvent(GitHubEventType.GollumEvent, null); updateView(event); verify("user updated the wiki in user/repo"); } /** * Verify text of issue comment event */ @Test @UiThreadTest public void testIssueComment() { Issue issue = Issue.builder() .number(5) .build(); IssueCommentPayload payload = IssueCommentPayload.builder() .issue(issue) .build(); GitHubEvent event = createEvent(GitHubEventType.IssueCommentEvent, payload); updateView(event); verify("user commented on issue 5 on user/repo"); } /** * Verify text of issue event */ @Test @UiThreadTest public void testIssue() { Issue issue = Issue.builder() .number(8) .build(); IssuesPayload payload = IssuesPayload.builder() .action(IssuesPayload.Action.Closed) .issue(issue) .build(); GitHubEvent event = createEvent(GitHubEventType.IssuesEvent, payload); updateView(event); verify("user closed issue 8 on user/repo"); } /** * Verify text of member event */ @Test @UiThreadTest public void testAddMember() { User user = User.builder() .login("person") .build(); MemberPayload payload = MemberPayload.builder() .member(user) .build(); GitHubEvent event = createEvent(GitHubEventType.MemberEvent, payload); updateView(event); verify("user added person as a collaborator to user/repo"); } /** * Verify text of open sourced event */ @Test @UiThreadTest public void testOpenSourced() { GitHubEvent event = createEvent(GitHubEventType.PublicEvent, null); updateView(event); verify("user open sourced repository user/repo"); } /** * Verify text of watch event */ @Test @UiThreadTest public void testWatch() { GitHubEvent event = createEvent(GitHubEventType.WatchEvent, null); updateView(event); verify("user starred user/repo"); } /** * Verify text of pull request event */ @Test @UiThreadTest public void testPullRequest() { PullRequestPayload payload = PullRequestPayload.builder() .number(30) .action(PullRequestPayload.Action.Closed) .build(); GitHubEvent event = createEvent(GitHubEventType.PullRequestEvent, payload); updateView(event); verify("user closed pull request 30 on user/repo"); } /** * Verify text of push event */ @Test @UiThreadTest public void testPush() { PushPayload payload = PushPayload.builder() .ref("refs/heads/master") .commits(Collections.emptyList()) .build(); GitHubEvent event = createEvent(GitHubEventType.PushEvent, payload); updateView(event); verify("user pushed to master at user/repo"); } /** * Verify text of push event */ @Test @UiThreadTest public void testTeamAdd() { Team team = Team.builder() .name("t1") .build(); Repository repo = Repository.builder() .name("r2") .build(); TeamAddPayload payload = TeamAddPayload.builder() .repository(repo) .team(team) .build(); GitHubEvent event = createEvent(GitHubEventType.TeamAddEvent, payload); updateView(event); verify("user added r2 to team t1"); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/ViewVisibiltyIdlingResource.kt ================================================ package com.github.pockethub.android.tests import android.app.Activity import android.os.Handler import android.view.View import androidx.annotation.IdRes import androidx.test.espresso.IdlingResource import androidx.test.espresso.IdlingResource.ResourceCallback import java.lang.ref.WeakReference /** * [IdlingResource] which monitors a [View] for a given visibility state. The resource is considered idle when the * View has the desired state. * * @author vaughandroid@gmail.com * @param view the View to monitor * @param visibility One of [View.VISIBLE], [View.INVISIBLE], or [View.GONE]. */ class ViewVisibilityIdlingResource(view: View, private val mVisibility: Int) : IdlingResource { /** Hold weak reference to the View, so we don't leak memory even if the resource isn't unregistered. */ private val mView: WeakReference = WeakReference(view) private val mName: String private var mResourceCallback: ResourceCallback? = null /** * @param activity which owns the View * @param viewId ID of the View to monitor * @param visibility One of [View.VISIBLE], [View.INVISIBLE], or [View.GONE]. */ constructor(activity: Activity, @IdRes viewId: Int, visibility: Int) : this(activity.findViewById(viewId), visibility) init { mName = "View Visibility for view " + view.id + "(@" + System.identityHashCode(mView) + ")" } override fun getName(): String { return mName } override fun isIdleNow(): Boolean { val view = mView.get() val isIdle = view == null || view.visibility == mVisibility if (isIdle) { if (mResourceCallback != null) { mResourceCallback!!.onTransitionToIdle() } } else { /* Force a re-check of the idle state in a little while. * If isIdleNow() returns false, Espresso only polls it every few seconds which can slow down our tests. * Ideally we would watch for the visibility state changing, but AFAIK we can't detect when a View's * visibility changes to GONE. */ Handler().postDelayed({ isIdleNow }, IDLE_POLL_DELAY_MILLIS.toLong()) } return isIdle } override fun registerIdleTransitionCallback(resourceCallback: ResourceCallback) { mResourceCallback = resourceCallback } companion object { private val IDLE_POLL_DELAY_MILLIS = 100 } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/commit/CommitUriMatcherTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.commit; import android.net.Uri; import androidx.test.filters.SmallTest; import androidx.test.runner.AndroidJUnit4; import com.github.pockethub.android.core.commit.CommitMatch; import com.github.pockethub.android.core.commit.CommitUriMatcher; import org.junit.Test; import org.junit.runner.RunWith; import static junit.framework.Assert.assertNotNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; /** * Tests of {@link CommitUriMatcher} */ @RunWith(AndroidJUnit4.class) @SmallTest public class CommitUriMatcherTest { /** * Verity empty uri */ @Test public void testEmptyUri() { assertNull(CommitUriMatcher.getCommit(Uri.parse(""))); } /** * Verify non-hex commit SHA-1 in uri */ public void testNonHexId() { assertNull(CommitUriMatcher.getCommit(Uri .parse("https://github.com/defunkt/resque/commit/abck"))); } /** * Verify http uri */ @Test public void testHttpUri() { CommitMatch commit = CommitUriMatcher.getCommit(Uri .parse("https://github.com/defunkt/resque/commit/abcd")); assertNotNull(commit); assertEquals("abcd", commit.getCommit()); assertNotNull(commit.getRepository()); assertEquals("resque", commit.getRepository().name()); assertNotNull(commit.getRepository().owner()); assertEquals("defunkt", commit.getRepository().owner().login()); } /** * Verify https uri */ @Test public void testHttpsUri() { CommitMatch commit = CommitUriMatcher.getCommit(Uri .parse("https://github.com/defunkt/resque/commit/1234")); assertNotNull(commit); assertEquals("1234", commit.getCommit()); assertNotNull(commit.getRepository()); assertEquals("resque", commit.getRepository().name()); assertNotNull(commit.getRepository().owner()); assertEquals("defunkt", commit.getRepository().owner().login()); } /** * Verify uri with comment fragment */ @Test public void testCommentUri() { CommitMatch commit = CommitUriMatcher .getCommit(Uri .parse("https://github.com/defunkt/resque/commit/a1b2#commitcomment-1605701")); assertNotNull(commit); assertEquals("a1b2", commit.getCommit()); assertNotNull(commit.getRepository()); assertEquals("resque", commit.getRepository().name()); assertNotNull(commit.getRepository().owner()); assertEquals("defunkt", commit.getRepository().owner().login()); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/commit/CommitUtilsTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.commit; import androidx.test.filters.SmallTest; import com.github.pockethub.android.core.commit.CommitUtils; import com.meisolsson.githubsdk.model.Commit; import com.meisolsson.githubsdk.model.GitHubFile; import com.meisolsson.githubsdk.model.git.GitCommit; import com.meisolsson.githubsdk.model.git.GitUser; import org.junit.Test; import java.util.Date; import static junit.framework.Assert.assertFalse; import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; /** * Test of {@link CommitUtils} */ @SmallTest public class CommitUtilsTest { /** * Test commit SHA-1 abbreviation */ @Test public void testAbbreviate() { assertNull(CommitUtils.abbreviate((GitCommit) null)); assertNull(CommitUtils.abbreviate((Commit) null)); assertNull(CommitUtils.abbreviate((String) null)); assertEquals("", CommitUtils.abbreviate("")); assertEquals("a", CommitUtils.abbreviate("a")); assertEquals("abcdefghij", CommitUtils.abbreviate("abcdefghijk")); GitCommit gitCommit = GitCommit.builder() .sha("abc") .build(); assertEquals("abc", CommitUtils.abbreviate(gitCommit)); Commit commit = Commit.builder() .sha("abcd") .build(); assertEquals("abcd", CommitUtils.abbreviate(commit)); } /** * Test commit name parsing from path */ @Test public void testGetName() { assertNull(CommitUtils.getName((String) null)); assertNull(CommitUtils.getName((GitHubFile) null)); assertEquals("", CommitUtils.getName("")); assertEquals("/", CommitUtils.getName("/")); assertEquals("b", CommitUtils.getName("a/b")); GitHubFile file = GitHubFile.builder().filename("a/b/c").build(); assertEquals("c", CommitUtils.getName(file)); } /** * Test commit SHA-1 evaluation */ @Test public void testIsValidCommit() { assertFalse(CommitUtils.isValidCommit("")); assertTrue(CommitUtils.isValidCommit("a")); assertTrue(CommitUtils.isValidCommit("bbbbb")); assertFalse(CommitUtils.isValidCommit("am")); assertFalse(CommitUtils.isValidCommit("xyz")); } /** * Test parsing author from commit */ @Test public void testGetAuthor() { Commit commit = Commit.builder().build(); assertNull(CommitUtils.getAuthor(commit)); GitCommit rawCommit = GitCommit.builder().build(); commit = commit.toBuilder() .commit(rawCommit) .build(); assertNull(CommitUtils.getAuthor(commit)); GitUser user = GitUser.builder().build(); rawCommit = rawCommit.toBuilder() .author(user) .build(); commit = commit.toBuilder() .commit(rawCommit) .build(); assertNull(CommitUtils.getAuthor(commit)); user = user.toBuilder().name("u1").build(); rawCommit = rawCommit.toBuilder() .author(user) .build(); commit = commit.toBuilder() .commit(rawCommit) .build(); assertEquals("u1", CommitUtils.getAuthor(commit)); } /** * Test parsing committer from commit */ @Test public void testGetCommitter() { Commit commit = Commit.builder().build(); assertNull(CommitUtils.getCommitter(commit)); GitCommit rawCommit = GitCommit.builder().build(); commit = commit.toBuilder() .commit(rawCommit) .build(); assertNull(CommitUtils.getCommitter(commit)); GitUser user = GitUser.builder().build(); rawCommit = rawCommit.toBuilder() .committer(user) .build(); commit = commit.toBuilder() .commit(rawCommit) .build(); assertNull(CommitUtils.getCommitter(commit)); user = user.toBuilder().name("u1").build(); rawCommit = rawCommit.toBuilder() .committer(user) .build(); commit = commit.toBuilder() .commit(rawCommit) .build(); assertEquals("u1", CommitUtils.getCommitter(commit)); user = user.toBuilder().name("u2").build(); rawCommit = rawCommit.toBuilder() .committer(user) .build(); commit = commit.toBuilder() .commit(rawCommit) .build(); assertEquals("u2", CommitUtils.getCommitter(commit)); } /** * Test parsing author date from commit */ @Test public void testGetAuthorDate() { Commit commit = Commit.builder().build(); assertNull(CommitUtils.getAuthorDate(commit)); GitCommit rawCommit = GitCommit.builder().build(); commit = commit.toBuilder() .commit(rawCommit) .build(); assertNull(CommitUtils.getAuthorDate(commit)); GitUser user = GitUser.builder().build(); rawCommit = rawCommit.toBuilder() .author(user) .build(); commit = commit.toBuilder() .commit(rawCommit) .build(); assertNull(CommitUtils.getAuthorDate(commit)); user = user.toBuilder() .date(new Date(12000)) .build(); rawCommit = rawCommit.toBuilder() .author(user) .build(); commit = commit.toBuilder() .commit(rawCommit) .build(); assertEquals(new Date(12000), CommitUtils.getAuthorDate(commit)); } /** * Test parsing committer date from commit */ @Test public void testGetCommitterDate() { Commit commit = Commit.builder().build(); assertNull(CommitUtils.getCommitterDate(commit)); GitCommit rawCommit = GitCommit.builder().build(); commit = commit.toBuilder() .commit(rawCommit) .build(); assertNull(CommitUtils.getCommitterDate(commit)); GitUser user = GitUser.builder().build(); rawCommit = rawCommit.toBuilder() .committer(user) .build(); commit = commit.toBuilder() .commit(rawCommit) .build(); assertNull(CommitUtils.getCommitterDate(commit)); user = user.toBuilder() .date(new Date(12000)) .build(); rawCommit = rawCommit.toBuilder() .committer(user) .build(); commit = commit.toBuilder() .commit(rawCommit) .build(); assertEquals(new Date(12000), CommitUtils.getCommitterDate(commit)); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/commit/CreateCommentActivityTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.commit; import androidx.test.espresso.ViewInteraction; import androidx.test.espresso.action.ViewActions; import androidx.test.espresso.assertion.ViewAssertions; import androidx.test.rule.ActivityTestRule; import com.github.pockethub.android.R; import com.github.pockethub.android.ui.commit.CreateCommentActivity; import com.meisolsson.githubsdk.model.Repository; import com.meisolsson.githubsdk.model.User; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import static androidx.test.espresso.Espresso.closeSoftKeyboard; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.hamcrest.CoreMatchers.not; /** * Tests of {@link CreateCommentActivity} */ public class CreateCommentActivityTest { @Rule public ActivityTestRule activityTestRule = new ActivityTestRule<>(CreateCommentActivity.class, false, false); @Before public void setUp() { User user = User.builder() .login("owner") .build(); Repository repo = Repository.builder() .name("name") .owner(user) .build(); activityTestRule.launchActivity(CreateCommentActivity.createIntent(repo, "abcdef")); } /** * Verify empty comment can't be created */ @Test public void testEmptyCommentIsProhibited() { ViewInteraction createMenu = onView(withId(R.id.m_apply)); ViewInteraction comment = onView(withId(R.id.et_comment)); createMenu.check(ViewAssertions.matches(not(isEnabled()))); closeSoftKeyboard(); comment.perform(ViewActions.typeText("a")); createMenu.check(ViewAssertions.matches(isEnabled())); comment.perform(ViewActions.replaceText("")); createMenu.check(ViewAssertions.matches(not(isEnabled()))); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/commit/DiffStylerTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.commit; import androidx.test.filters.SmallTest; import com.github.pockethub.android.ui.commit.DiffStyler; import com.meisolsson.githubsdk.model.GitHubFile; import org.junit.Test; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.util.Collections; import java.util.List; import static androidx.test.InstrumentationRegistry.getTargetContext; import static junit.framework.Assert.assertNotNull; import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertEquals; /** * Tests of {@link DiffStyler} */ @SmallTest public class DiffStylerTest { private void compareStyled(String patch) throws IOException { assertNotNull(patch); String fileName = "file.txt"; DiffStyler styler = new DiffStyler(getTargetContext().getResources()); GitHubFile file = GitHubFile.builder() .filename(fileName) .patch(patch) .build(); styler.setFiles(Collections.singletonList(file)); List styled = styler.get(fileName); assertNotNull(styled); BufferedReader reader = new BufferedReader(new StringReader(patch)); String line = reader.readLine(); int processed = 0; while (line != null) { assertEquals(line, styled.get(processed).toString()); line = reader.readLine(); processed++; } assertEquals(processed, styled.size()); } /** * Test styler with empty files */ @Test public void testEmptyFiles() { DiffStyler styler = new DiffStyler(getTargetContext().getResources()); styler.setFiles(null); assertTrue(styler.get("navigation_drawer_header_background").isEmpty()); styler.setFiles(Collections.emptyList()); assertTrue(styler.get("navigation_drawer_header_background").isEmpty()); } /** * Test styler with empty patch */ @Test public void testEmptyPatch() { DiffStyler styler = new DiffStyler(getTargetContext().getResources()); GitHubFile file = GitHubFile.builder() .filename("file.txt") .build(); styler.setFiles(Collections.singletonList(file)); assertTrue(styler.get("file.txt").isEmpty()); file = file.toBuilder().filename("").build(); styler.setFiles(Collections.singletonList(file)); assertTrue(styler.get("file.txt").isEmpty()); } /** * Test styler for file with only single newline * * @throws IOException */ @Test public void testOnlyNewline() throws IOException { compareStyled("\n"); } /** * Test styler for file with an empty patch line with other valid lines * * @throws IOException */ @Test public void testEmptyPatchLineWithOtherValidLines() throws IOException { compareStyled("@@ 0,1 0,1 @@\n\n-navigation_drawer_header_background\n"); } /** * Test styler for file with trailing empty line * * @throws IOException */ @Test public void testTrailingEmptyLine() throws IOException { compareStyled("@@ 0,1 0,1 @@\n-navigation_drawer_header_background\n\n"); } /** * Test styler for file with only newlines * * @throws IOException */ @Test public void testOnlyNewlines() throws IOException { compareStyled("\n\n\n"); } /** * Test styler for patch with no trailing newline after the second line * * @throws IOException */ @Test public void testNoTrailingNewlineAfterSecondLine() throws IOException { compareStyled("@@ 1,2 1,2 @@\n+navigation_drawer_header_background"); } /** * Test styler for patch with no trailing newline * * @throws IOException */ @Test public void testNoTrailingNewline() throws IOException { compareStyled("@@ 1,2 1,2 @@"); } /** * Test styler for file with valid patch * * @throws IOException */ @Test public void testFormattedPatch() throws IOException { compareStyled("@@ 1,2 1,2 @@\n+navigation_drawer_header_background\n"); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/commit/FullCommitTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.commit; import androidx.test.filters.SmallTest; import com.github.pockethub.android.core.commit.FullCommit; import com.meisolsson.githubsdk.model.Commit; import com.meisolsson.githubsdk.model.GitHubFile; import com.meisolsson.githubsdk.model.git.GitComment; import org.junit.Test; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import static junit.framework.Assert.assertFalse; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; /** * Tests of {@link FullCommit} */ @SmallTest public class FullCommitTest { /** * Test commit with one file and one line comment */ @Test public void testSingleLineCommentSingleFile() { GitHubFile file = GitHubFile.builder() .filename("a.txt") .build(); GitComment comment = GitComment.builder() .path(file.filename()) .position(10) .build(); Commit commit = Commit.builder() .files(Collections.singletonList(file)) .build(); FullCommit full = new FullCommit(commit, new ArrayList<>( Collections.singletonList(comment))); assertTrue(full.isEmpty()); assertEquals(1, full.getFiles().size()); assertEquals(comment, full.getFiles().get(0).get(10).get(0)); } /** * Test commit with one file and one commit comment */ @Test public void testSingleCommentSingleFile() { GitHubFile file = GitHubFile.builder() .filename("a.txt") .build(); GitComment comment = GitComment.builder().build(); Commit commit = Commit.builder() .files(Collections.singletonList(file)) .build(); FullCommit full = new FullCommit(commit, Collections.singletonList(comment)); assertFalse(full.isEmpty()); assertEquals(comment, full.get(0)); assertEquals(1, full.getFiles().size()); } /** * Test commit with no files and one commit comment */ @Test public void testSingleCommentNoFiles() { GitComment comment = GitComment.builder().build(); Commit commit = Commit.builder().build(); FullCommit full = new FullCommit(commit, Collections.singletonList(comment)); assertFalse(full.isEmpty()); assertEquals(comment, full.get(0)); assertTrue(full.getFiles().isEmpty()); } /** * Test commit with no comments and one file */ @Test public void testNoCommentsSingleFile() { GitHubFile file = GitHubFile.builder() .filename("a.txt") .build(); Commit commit = Commit.builder() .files(Collections.singletonList(file)) .build(); FullCommit full = new FullCommit(commit); assertTrue(full.isEmpty()); assertEquals(1, full.getFiles().size()); } /** * Test commit with line and global comments */ @Test public void testBothTypesOfComments() { GitHubFile file = GitHubFile.builder() .filename("a.txt") .build(); GitComment comment1 = GitComment.builder() .path(file.filename()) .position(10) .build(); GitComment comment2 = GitComment.builder().build(); Commit commit = Commit.builder() .files(Collections.singletonList(file)) .build(); FullCommit full = new FullCommit(commit, new ArrayList<>(Arrays.asList(comment1, comment2))); assertEquals(1, full.size()); assertEquals(comment2, full.get(0)); assertEquals(1, full.getFiles().size()); assertEquals(comment1, full.getFiles().get(0).get(10).get(0)); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/gist/CreateCommentActivityTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.gist; import androidx.test.espresso.ViewInteraction; import androidx.test.espresso.action.ViewActions; import androidx.test.espresso.assertion.ViewAssertions; import androidx.test.rule.ActivityTestRule; import com.github.pockethub.android.R; import com.github.pockethub.android.ui.gist.CreateCommentActivity; import com.meisolsson.githubsdk.model.Gist; import com.meisolsson.githubsdk.model.User; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import static androidx.test.espresso.Espresso.closeSoftKeyboard; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.hamcrest.CoreMatchers.not; /** * Tests of {@link CreateCommentActivity} */ public class CreateCommentActivityTest { @Rule public ActivityTestRule activityTestRule = new ActivityTestRule<>(CreateCommentActivity.class, false, false); @Before public void setUp() { User user = User.builder() .login("abc") .build(); Gist gist = Gist.builder() .owner(user) .id("123") .build(); activityTestRule.launchActivity(CreateCommentActivity.createIntent(gist)); } /** * Verify empty comment can't be created * * @throws Throwable */ @Test public void testEmptyCommentIsProhibited() { ViewInteraction createMenu = onView(withId(R.id.m_apply)); ViewInteraction comment = onView(withId(R.id.et_comment)); createMenu.check(ViewAssertions.matches(not(isEnabled()))); closeSoftKeyboard(); comment.perform(ViewActions.typeText("a")); createMenu.check(ViewAssertions.matches(isEnabled())); comment.perform(ViewActions.replaceText("")); createMenu.check(ViewAssertions.matches(not(isEnabled()))); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/gist/CreateGistActivityTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.gist; import android.content.Intent; import androidx.test.espresso.ViewInteraction; import androidx.test.espresso.action.ViewActions; import androidx.test.espresso.assertion.ViewAssertions; import androidx.test.rule.ActivityTestRule; import com.github.pockethub.android.R; import com.github.pockethub.android.R.id; import com.github.pockethub.android.ui.gist.CreateGistActivity; import org.junit.Rule; import org.junit.Test; import static android.content.Intent.EXTRA_TEXT; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.matcher.ViewMatchers.*; import static org.hamcrest.CoreMatchers.not; /** * Tests of {@link CreateGistActivity} */ public class CreateGistActivityTest { @Rule public ActivityTestRule activityTestRule = new ActivityTestRule<>(CreateGistActivity.class, false, false); /** * Create Gist with initial text */ @Test public void testCreateWithInitialText() { activityTestRule.launchActivity(new Intent().putExtra(EXTRA_TEXT, "gist content")); onView(withId(id.create_gist)) .check(ViewAssertions.matches(isEnabled())); onView(withId(id.et_gist_content)) .check(ViewAssertions.matches(withText("gist content"))); } /** * Create Gist with no initial text * * @throws Throwable */ @Test public void testCreateWithNoInitialText() throws Throwable { activityTestRule.launchActivity(new Intent()); ViewInteraction createMenu = onView(withId(R.id.create_gist)); ViewInteraction content = onView(withId(R.id.et_gist_content)); createMenu.check(ViewAssertions.matches(not(isEnabled()))); content.perform(ViewActions.typeText("gist content")); createMenu.check(ViewAssertions.matches(isEnabled())); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/gist/GistFilesViewActivityTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.gist; import android.content.Context; import androidx.collection.ArrayMap; import androidx.test.rule.ActivityTestRule; import androidx.viewpager.widget.ViewPager; import com.github.pockethub.android.PocketHub; import com.github.pockethub.android.R.id; import com.github.pockethub.android.core.gist.GistStore; import com.github.pockethub.android.ui.gist.GistFilesViewActivity; import com.meisolsson.githubsdk.model.Gist; import com.meisolsson.githubsdk.model.GistFile; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import java.util.Map; import static androidx.test.InstrumentationRegistry.getInstrumentation; import static org.junit.Assert.assertEquals; /** * Tests of {@link GistFilesViewActivity} */ public class GistFilesViewActivityTest { protected GistStore store; private Gist gist; @Rule public ActivityTestRule activityTestRule = new ActivityTestRule<>(GistFilesViewActivity.class, false, false); @Before public void setUp() { Context context = getInstrumentation().getTargetContext(); PocketHub pocketHub = (PocketHub) context.getApplicationContext(); store = pocketHub.applicationComponent().gistStore(); Map files = new ArrayMap<>(); GistFile a = GistFile.builder() .content("aa") .filename("a") .build(); GistFile b = GistFile.builder() .content("bb") .filename("b") .build(); files.put("a", a); files.put("b", b); gist = Gist.builder() .id("abcd") .files(files) .build(); store.addGist(gist); activityTestRule.launchActivity(GistFilesViewActivity.Companion.createIntent(gist, 0)); } /** * Verify changing pages between gist files * * @throws Throwable */ @Test public void testChangingPages() throws Throwable { final ViewPager pager = activityTestRule.getActivity().findViewById(id.vp_pages); assertEquals(0, pager.getCurrentItem()); activityTestRule.runOnUiThread(() -> pager.setCurrentItem(1, true)); assertEquals(1, pager.getCurrentItem()); activityTestRule.runOnUiThread(() -> pager.setCurrentItem(0, true)); assertEquals(0, pager.getCurrentItem()); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/gist/GistStoreTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.gist; import androidx.test.filters.SmallTest; import com.github.pockethub.android.core.gist.GistStore; import com.meisolsson.githubsdk.model.Gist; import org.junit.Test; import static junit.framework.Assert.assertNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; /** * Unit tests of {@link GistStore} */ @SmallTest public class GistStoreTest { /** * Verify issue is updated when re-added */ @Test public void testReuseIssue() { GistStore store = new GistStore(); assertNull(store.getGist("abcd")); Gist gist = Gist.builder() .id("abcd") .description("description") .build(); // The gist is added and the store will return the given gist assertEquals(gist, store.addGist(gist)); assertEquals(gist, store.getGist("abcd")); Gist gist2 = Gist.builder() .id("abcd") .description("description2") .build(); // The gist has now been updated and should not return the same gist assertNotEquals(gist, store.addGist(gist2)); assertNotEquals(gist.description(), gist2.description()); assertNotEquals(gist, store.getGist("abcd")); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/gist/GistUriMatcherTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.gist; import android.net.Uri; import androidx.test.filters.SmallTest; import com.github.pockethub.android.core.gist.GistUriMatcher; import com.meisolsson.githubsdk.model.Gist; import org.junit.Test; import static junit.framework.Assert.assertNotNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; /** * Unit tests of {@link GistUriMatcher} */ @SmallTest public class GistUriMatcherTest { /** * Verify empty uri */ @Test public void testEmptyUri() { assertNull(GistUriMatcher.getGist(Uri.parse(""))); } /** * Verify invalid Gist ids in URIs */ @Test public void testNonGistId() { assertNull(GistUriMatcher.getGist(Uri .parse("https://gist.github.com/TEST"))); assertNull(GistUriMatcher.getGist(Uri .parse("https://gist.github.com/abc%20"))); assertNull(GistUriMatcher.getGist(Uri .parse("https://gist.github.com/abcdefg"))); } /** * Verify public Gist id */ @Test public void testPublicGist() { Gist gist = GistUriMatcher.getGist(Uri .parse("https://gist.github.com/1234")); assertNotNull(gist); assertEquals("1234", gist.id()); } /** * Verify public Gist id */ @Test public void testPrivateGist() { Gist gist = GistUriMatcher.getGist(Uri .parse("https://gist.github.com/abcd1234abcd1234abcd")); assertNotNull(gist); assertEquals("abcd1234abcd1234abcd", gist.id()); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/issue/CreateCommentActivityTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.issue; import androidx.test.espresso.ViewInteraction; import androidx.test.espresso.action.ViewActions; import androidx.test.espresso.assertion.ViewAssertions; import androidx.test.rule.ActivityTestRule; import com.github.pockethub.android.R; import com.github.pockethub.android.ui.issue.CreateCommentActivity; import com.github.pockethub.android.util.InfoUtils; import com.meisolsson.githubsdk.model.User; import org.junit.Before; import org.junit.Test; import static androidx.test.espresso.Espresso.closeSoftKeyboard; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.hamcrest.CoreMatchers.not; /** * Tests of {@link CreateCommentActivity} */ public class CreateCommentActivityTest { public ActivityTestRule activityTestRule = new ActivityTestRule<>(CreateCommentActivity.class); @Before public void setUp() { User user = User.builder() .login("u") .build(); activityTestRule.launchActivity( CreateCommentActivity.createIntent( InfoUtils.createRepoFromData("o", "u"), 1, user ) ); } /** * Verify empty comment can't be created * * @throws Throwable */ @Test public void testEmptyCommentIsProhibited() { ViewInteraction createMenu = onView(withId(R.id.m_apply)); ViewInteraction comment = onView(withId(R.id.et_comment)); createMenu.check(ViewAssertions.matches(not(isEnabled()))); closeSoftKeyboard(); comment.perform(ViewActions.typeText("a")); createMenu.check(ViewAssertions.matches(isEnabled())); comment.perform(ViewActions.replaceText("")); createMenu.check(ViewAssertions.matches(not(isEnabled()))); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/issue/EditIssueActivityTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.issue; import android.view.View; import androidx.test.espresso.IdlingRegistry; import androidx.test.espresso.ViewInteraction; import androidx.test.espresso.action.ViewActions; import androidx.test.espresso.assertion.ViewAssertions; import androidx.test.rule.ActivityTestRule; import com.github.pockethub.android.R; import com.github.pockethub.android.tests.ViewVisibilityIdlingResource; import com.github.pockethub.android.ui.issue.EditIssueActivity; import com.github.pockethub.android.util.InfoUtils; import com.meisolsson.githubsdk.model.Repository; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import static androidx.test.espresso.Espresso.closeSoftKeyboard; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.matcher.ViewMatchers.isEnabled; import static androidx.test.espresso.matcher.ViewMatchers.withId; import static org.hamcrest.CoreMatchers.not; /** * Tests of {@link EditIssueActivity} */ public class EditIssueActivityTest { @Rule public ActivityTestRule activityTestRule = new ActivityTestRule<>(EditIssueActivity.class, true, false); @Before public void setUp() { Repository repo = InfoUtils.createRepoFromData("owner", "repo"); activityTestRule.launchActivity(EditIssueActivity.Companion.createIntent(repo)); } /** * Verify save menu is properly enabled/disable depending on the issue have * a non-empty title * * @throws Throwable */ @Test public void testSaveMenuEnabled() { ViewInteraction createMenu = onView(withId(R.id.m_apply)); ViewInteraction comment = onView(withId(R.id.et_issue_title)); ViewVisibilityIdlingResource idlingResource = new ViewVisibilityIdlingResource( activityTestRule.getActivity(), R.id.sv_issue_content, View.VISIBLE ); IdlingRegistry.getInstance().register(idlingResource); createMenu.check(ViewAssertions.matches(not(isEnabled()))); closeSoftKeyboard(); comment.perform(ViewActions.typeText("a")); createMenu.check(ViewAssertions.matches(isEnabled())); comment.perform(ViewActions.replaceText("")); createMenu.check(ViewAssertions.matches(not(isEnabled()))); IdlingRegistry.getInstance().unregister(idlingResource); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/issue/EditIssuesFilterActivityTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.issue; import androidx.test.rule.ActivityTestRule; import com.github.pockethub.android.core.issue.IssueFilter; import com.github.pockethub.android.ui.issue.EditIssuesFilterActivity; import com.github.pockethub.android.util.InfoUtils; import com.meisolsson.githubsdk.model.Repository; import org.junit.Before; import org.junit.Rule; import java.util.UUID; /** * Tests of {@link EditIssuesFilterActivity} */ public class EditIssuesFilterActivityTest { @Rule public ActivityTestRule activityTestRule = new ActivityTestRule<>(EditIssuesFilterActivity.class); @Before public void setUp() { Repository repo = InfoUtils.createRepoFromData("owner", "name"); IssueFilter filter = new IssueFilter(repo, UUID.randomUUID().toString()); activityTestRule.launchActivity(EditIssuesFilterActivity.Companion.createIntent(filter)); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/issue/IssueFilterTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.issue; import androidx.test.filters.SmallTest; import com.github.pockethub.android.core.issue.IssueFilter; import com.meisolsson.githubsdk.model.Milestone; import com.meisolsson.githubsdk.model.Repository; import com.meisolsson.githubsdk.model.User; import org.junit.Test; import java.util.UUID; import static junit.framework.Assert.assertFalse; import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertEquals; /** * Unit tests of {@link IssueFilter} */ @SmallTest public class IssueFilterTest { /** * Verify {@link IssueFilter#equals(Object)} */ @Test public void testEqualFilter() { Repository repo = Repository.builder() .id(1L) .build(); IssueFilter filter1 = new IssueFilter(repo, UUID.randomUUID().toString()); assertFalse(filter1.equals(null)); assertFalse(filter1.equals("")); assertTrue(filter1.equals(filter1)); IssueFilter filter2 = new IssueFilter(repo, UUID.randomUUID().toString()); assertEquals(filter1, filter2); assertEquals(filter1.hashCode(), filter2.hashCode()); User user = User.builder() .id(2L) .build(); filter1.setAssignee(user); assertFalse(filter1.equals(filter2)); filter2.setAssignee(user); assertEquals(filter1, filter2); assertEquals(filter1.hashCode(), filter2.hashCode()); filter1.setOpen(false); assertFalse(filter1.equals(filter2)); filter2.setOpen(false); assertEquals(filter1, filter2); assertEquals(filter1.hashCode(), filter2.hashCode()); Milestone milestone = Milestone.builder() .number(3) .build(); filter1.setMilestone(milestone); assertFalse(filter1.equals(filter2)); filter2.setMilestone(milestone); assertEquals(filter1, filter2); assertEquals(filter1.hashCode(), filter2.hashCode()); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/issue/IssueStoreTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.issue; import androidx.test.filters.SmallTest; import com.github.pockethub.android.core.issue.IssueStore; import com.github.pockethub.android.util.InfoUtils; import com.meisolsson.githubsdk.model.Issue; import com.meisolsson.githubsdk.model.Repository; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNull; /** * Unit tests of {@link IssueStore} */ @SmallTest public class IssueStoreTest { /** * Verify issue is updated when re-added */ @Test public void testReuseIssue() { IssueStore store = new IssueStore(); Repository repo = InfoUtils.createRepoFromData("owner", "name"); assertNull(store.getIssue(repo, 1)); Issue issue = Issue.builder() .repository(repo) .number(1) .body("body") .build(); assertEquals(issue, store.addIssue(issue)); assertEquals(issue, store.getIssue(repo, 1)); Issue issue2 = Issue.builder() .repository(repo) .number(1) .body("body2") .build(); assertNotEquals(issue, store.addIssue(issue2)); assertNotEquals(issue2.body(), issue.body()); assertNotEquals(issue, store.getIssue(repo, 1)); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/issue/IssueUriMatcherTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.issue; import android.net.Uri; import androidx.test.filters.SmallTest; import com.github.pockethub.android.core.issue.IssueUriMatcher; import com.meisolsson.githubsdk.model.Issue; import org.junit.Test; import static junit.framework.Assert.assertNotNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; /** * Unit tests of {@link IssueUriMatcher} */ @SmallTest public class IssueUriMatcherTest { /** * Verify empty uri */ @Test public void testEmptyUri() { assertNull(IssueUriMatcher.getIssue(Uri.parse(""))); } /** * Verify non-numeric issue number in uri */ @Test public void testNonNumericIssueNumber() { assertNull(IssueUriMatcher.getIssue(Uri .parse("https://github.com/defunkt/resque/issues/fourty"))); } /** * Verify http uri */ @Test public void testHttpUri() { Issue issue = IssueUriMatcher.getIssue(Uri .parse("https://github.com/defunkt/resque/issues/3")); assertNotNull(issue); assertEquals(3, issue.number().intValue()); assertNotNull(issue.repository()); assertEquals("resque", issue.repository().name()); assertNotNull(issue.repository().owner()); assertEquals("defunkt", issue.repository().owner().login()); } /** * Verify pull uri */ @Test public void testPullUri() { Issue issue = IssueUriMatcher.getIssue(Uri .parse("https://github.com/defunkt/resque/pull/3")); assertNotNull(issue); assertEquals(3, issue.number().intValue()); assertNotNull(issue.repository()); assertEquals("resque", issue.repository().name()); assertNotNull(issue.repository().owner()); assertEquals("defunkt", issue.repository().owner().login()); } /** * Verify https uri */ @Test public void testHttpsUri() { Issue issue = IssueUriMatcher.getIssue(Uri .parse("http://github.com/defunkt/resque/issues/15")); assertNotNull(issue); assertEquals(15, issue.number().intValue()); assertNotNull(issue.repository()); assertEquals("resque", issue.repository().name()); assertNotNull(issue.repository().owner()); assertEquals("defunkt", issue.repository().owner().login()); } /** * Verify uri with comment fragment */ @Test public void testCommentUri() { Issue issue = IssueUriMatcher .getIssue(Uri .parse("https://github.com/defunkt/resque/issues/300#issuecomment-123456")); assertNotNull(issue); assertEquals(300, issue.number().intValue()); assertNotNull(issue.repository()); assertEquals("resque", issue.repository().name()); assertNotNull(issue.repository().owner()); assertEquals("defunkt", issue.repository().owner().login()); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/ref/RefUtilsTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.ref; import androidx.test.filters.SmallTest; import com.github.pockethub.android.core.ref.RefUtils; import com.meisolsson.githubsdk.model.git.GitReference; import org.junit.Test; import static junit.framework.Assert.assertFalse; import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; /** * Tests of {@link RefUtils} */ @SmallTest public class RefUtilsTest { /** * Verify {@link RefUtils#isBranch(GitReference)} */ @Test public void testIsBranch() { assertFalse(RefUtils.isBranch(null)); assertFalse(RefUtils.isBranch(GitReference.builder().build())); assertFalse(RefUtils.isBranch(createGitReference(""))); assertFalse(RefUtils.isBranch(createGitReference("navigation_drawer_header_background"))); assertFalse(RefUtils.isBranch(createGitReference("refs/tags/v1"))); assertFalse(RefUtils.isBranch(createGitReference("refs/b1"))); assertTrue(RefUtils.isBranch(createGitReference("refs/heads/b2"))); } /** * Verify {@link RefUtils#isTag(GitReference)} */ @Test public void testIsTag() { assertFalse(RefUtils.isTag((GitReference) null)); assertFalse(RefUtils.isTag(GitReference.builder().build())); assertFalse(RefUtils.isTag(createGitReference(""))); assertFalse(RefUtils.isTag(createGitReference("navigation_drawer_header_background"))); assertFalse(RefUtils.isTag(createGitReference("refs/b1"))); assertFalse(RefUtils.isTag(createGitReference("refs/heads/b2"))); assertTrue(RefUtils.isTag(createGitReference("refs/tags/v1"))); } /** * Verify {@link RefUtils#isValid(GitReference)} */ @Test public void testIsValid() { assertFalse(RefUtils.isValid(null)); assertFalse(RefUtils.isValid(GitReference.builder().build())); assertFalse(RefUtils.isValid(createGitReference(""))); assertFalse(RefUtils.isValid(createGitReference("refs/pull/6/merge"))); assertFalse(RefUtils.isValid(createGitReference("refs/pull/6/head"))); assertTrue(RefUtils.isValid(createGitReference("refs/pull"))); assertTrue(RefUtils.isValid(createGitReference("refs/heads/b1"))); assertTrue(RefUtils.isValid(createGitReference("refs/tags/v1"))); } /** * Verify {@link RefUtils#getName(GitReference)} */ @Test public void testGetName() { assertNull(RefUtils.getName((GitReference) null)); assertNull(RefUtils.getName(GitReference.builder().build())); assertEquals("", RefUtils.getName(createGitReference(""))); assertEquals("unchanged", RefUtils.getName(createGitReference("unchanged"))); assertEquals("branch", RefUtils.getName(createGitReference("refs/heads/branch"))); assertEquals("tag", RefUtils.getName(createGitReference("refs/tags/tag"))); assertEquals("notes", RefUtils.getName(createGitReference("refs/notes"))); } /** * Verify {@link RefUtils#getPath(GitReference)} */ @Test public void testGetPath() { assertNull(RefUtils.getPath(null)); assertNull(RefUtils.getPath(GitReference.builder().build())); assertEquals("", RefUtils.getPath(createGitReference(""))); assertEquals("unchanged", RefUtils.getPath(createGitReference("unchanged"))); assertEquals("heads/branch", RefUtils.getPath(createGitReference("refs/heads/branch"))); assertEquals("tags/tag", RefUtils.getPath(createGitReference("refs/tags/tag"))); assertEquals("notes", RefUtils.getPath(createGitReference("refs/notes"))); } private GitReference createGitReference(String ref){ return GitReference.builder() .ref(ref) .build(); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/repo/RecentRepositoriesTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.repo; import androidx.test.filters.SmallTest; import com.github.pockethub.android.ui.repo.RecentRepositories; import com.meisolsson.githubsdk.model.User; import org.junit.Test; import static androidx.test.InstrumentationRegistry.getTargetContext; import static com.github.pockethub.android.ui.repo.RecentRepositories.MAX_SIZE; import static junit.framework.Assert.assertFalse; import static junit.framework.TestCase.assertTrue; /** * Unit tests of {@link RecentRepositories} */ @SmallTest public class RecentRepositoriesTest { /** * Verify bad input */ @Test public void testBadInput() { User org = User.builder() .id(20L) .build(); RecentRepositories recent = new RecentRepositories(getTargetContext(), org); assertFalse(recent.contains(null)); assertFalse(recent.contains(-1)); } /** * Verify eviction */ @Test public void testMaxReached() { User org = User.builder() .id(20L) .build(); RecentRepositories recent = new RecentRepositories(getTargetContext(), org); for (int i = 0; i < MAX_SIZE; i++) { recent.add(i); assertTrue(recent.contains(i)); } recent.add(MAX_SIZE + 1); assertTrue(recent.contains(MAX_SIZE + 1)); assertFalse(recent.contains(0)); for (int i = 1; i < MAX_SIZE; i++) { assertTrue(recent.contains(i)); } } /** * Verify input/output to disk of {@link RecentRepositories} state */ @Test public void testIO() { User org = User.builder() .id(20L) .build(); RecentRepositories recent1 = new RecentRepositories(getTargetContext(), org); long id = 1234; recent1.add(id); assertTrue(recent1.contains(id)); recent1.save(); RecentRepositories recent2 = new RecentRepositories(getTargetContext(), org); assertTrue(recent2.contains(id)); } /** * Verify repositories are scoped to organization */ @Test public void testScopedStorage() { User org1 = User.builder() .id(20L) .build(); RecentRepositories recent1 = new RecentRepositories(getTargetContext(), org1); long id1 = 1234; recent1.add(id1); assertTrue(recent1.contains(id1)); User org2 = User.builder() .id(40L) .build(); RecentRepositories recent2 = new RecentRepositories(getTargetContext(), org2); assertFalse(recent2.contains(id1)); long id2 = 2345; recent2.add(id2); assertTrue(recent2.contains(id2)); recent2.save(); recent1 = new RecentRepositories(getTargetContext(), org1); assertFalse(recent1.contains(id2)); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/repo/RepositoryEventMatcherTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.repo; import androidx.test.filters.SmallTest; import com.github.pockethub.android.core.repo.RepositoryEventMatcher; import com.meisolsson.githubsdk.model.GitHubEvent; import com.meisolsson.githubsdk.model.GitHubEventType; import com.meisolsson.githubsdk.model.Repository; import com.meisolsson.githubsdk.model.User; import com.meisolsson.githubsdk.model.payload.ForkPayload; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; /** * Unit tests of {@link RepositoryEventMatcher} */ @SmallTest public class RepositoryEventMatcherTest { /** * Test fork event that has an incomplete forkee in the payload */ @Test public void testIncompleteRepositoryFork() { RepositoryEventMatcher matcher = new RepositoryEventMatcher(); ForkPayload payload = ForkPayload.builder().build(); GitHubEvent event = GitHubEvent.builder() .type(GitHubEventType.ForkEvent) .payload(payload) .build(); assertNull(matcher.getRepository(event)); Repository repository = Repository.builder().build(); payload = payload.toBuilder().forkee(repository).build(); event = event.toBuilder().payload(payload).build(); assertNull(matcher.getRepository(event)); repository = repository.toBuilder().name("repo").build(); payload = payload.toBuilder().forkee(repository).build(); event = event.toBuilder().payload(payload).build(); assertNull(matcher.getRepository(event)); User user = User.builder().build(); repository = repository.toBuilder().owner(user).build(); payload = payload.toBuilder().forkee(repository).build(); event = event.toBuilder().payload(payload).build(); assertNull(matcher.getRepository(event)); user = user.toBuilder().login("owner").build(); repository = repository.toBuilder().owner(user).build(); payload = payload.toBuilder().forkee(repository).build(); event = event.toBuilder().payload(payload).build(); assertEquals(repository, matcher.getRepository(event)); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/repo/RepositoryUriMatcherTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.repo; import android.net.Uri; import com.github.pockethub.android.core.repo.RepositoryUriMatcher; import com.meisolsson.githubsdk.model.Repository; import org.junit.Test; import static junit.framework.Assert.assertNotNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; /** * Unit tests of {@link RepositoryUriMatcher} */ public class RepositoryUriMatcherTest { /** * Verity empty uri */ @Test public void testEmptyUri() { assertNull(RepositoryUriMatcher.getRepository(Uri.parse(""))); } /** * Verify URI with no owner */ @Test public void testUriWithNoOnwer() { assertNull(RepositoryUriMatcher.getRepository(Uri .parse("http://github.com"))); assertNull(RepositoryUriMatcher.getRepository(Uri .parse("http://github.com/"))); assertNull(RepositoryUriMatcher.getRepository(Uri .parse("http://github.com//"))); } /** * Verify URI with owner but no name */ @Test public void testUriWithNoName() { assertNull(RepositoryUriMatcher.getRepository(Uri .parse("http://github.com/defunkt"))); assertNull(RepositoryUriMatcher.getRepository(Uri .parse("http://github.com/defunkt/"))); } /** * Verify URI with owner but no name */ @Test public void testHttpUriWithOwnerAndName() { Repository repo = RepositoryUriMatcher.getRepository(Uri .parse("http://github.com/defunkt/resque")); assertNotNull(repo); assertEquals("resque", repo.name()); assertNotNull(repo.owner()); assertEquals("defunkt", repo.owner().login()); } /** * Verify URI with owner but no name */ @Test public void testHttpsUriWithOwnerAndName() { Repository repo = RepositoryUriMatcher.getRepository(Uri .parse("https://github.com/mojombo/jekyll")); assertNotNull(repo); assertEquals("jekyll", repo.name()); assertNotNull(repo.owner()); assertEquals("mojombo", repo.owner().login()); } /** * Verify URI with white-listed owner */ @Test public void testInvalidOwner() { assertNull(RepositoryUriMatcher.getRepository(Uri .parse("http://github.com/blog/page1"))); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/repo/SearchActivityTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.repo; import android.content.Intent; import androidx.test.rule.ActivityTestRule; import com.github.pockethub.android.ui.search.SearchActivity; import org.junit.Before; import org.junit.Rule; import static android.app.SearchManager.QUERY; import static android.content.Intent.ACTION_SEARCH; /** * Tests of {@link SearchActivity} */ public class SearchActivityTest { @Rule public ActivityTestRule activityTestRule = new ActivityTestRule<>(SearchActivity.class); @Before public void setUp() { Intent intent = new Intent(ACTION_SEARCH) .putExtra(QUERY, "navigation_drawer_header_background"); activityTestRule.launchActivity(intent); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/user/UserComparatorTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.user; import android.accounts.Account; import androidx.test.filters.SmallTest; import com.github.pockethub.android.core.user.UserComparator; import com.meisolsson.githubsdk.model.User; import org.junit.Test; import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertEquals; /** * Unit tests of {@link UserComparator} */ @SmallTest public class UserComparatorTest { /** * Test sorting of users that match login */ @Test public void testLoginMatch() { Account account = new Account("m", "t"); UserComparator comparator = new UserComparator(account); assertTrue(comparator.compare(createUser("m"), createUser("a")) < 0); assertTrue(comparator.compare(createUser("a"), createUser("m")) > 0); assertTrue(comparator.compare(createUser("m"), createUser("z")) < 0); assertTrue(comparator.compare(createUser("z"), createUser("m")) > 0); assertEquals( 0, comparator.compare(createUser("m"), createUser("m"))); } /** * Test sorting of users that don't match login */ @Test public void testNoLoginMatch() { Account account = new Account("m", "t"); UserComparator comparator = new UserComparator(account); assertTrue(comparator.compare(createUser("a"), createUser("c")) < 0); assertTrue(comparator.compare(createUser("db"), createUser("da")) > 0); } private User createUser(String login){ return User.builder() .login(login) .build(); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/user/UserUriMatcherTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.user; import android.net.Uri; import com.github.pockethub.android.core.user.UserUriMatcher; import com.meisolsson.githubsdk.model.User; import org.junit.Test; import static junit.framework.Assert.assertNotNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; /** * Unit tests of {@link UserUriMatcher} */ public class UserUriMatcherTest { /** * Verify empty URI */ @Test public void testEmptyUri() { assertNull(UserUriMatcher.getUser(Uri.parse(""))); } /** * Verify no name */ @Test public void testUriWithNoName() { assertNull(UserUriMatcher.getUser(Uri.parse("http://github.com"))); assertNull(UserUriMatcher.getUser(Uri.parse("https://github.com"))); assertNull(UserUriMatcher.getUser(Uri.parse("http://github.com/"))); assertNull(UserUriMatcher.getUser(Uri.parse("http://github.com//"))); } /** * Verify URI with name */ @Test public void testHttpUriWithName() { User user = UserUriMatcher.getUser(Uri .parse("http://github.com/defunkt")); assertNotNull(user); assertEquals("defunkt", user.login()); } /** * Verify URI with name */ @Test public void testHttpsUriWithName() { User user = UserUriMatcher.getUser(Uri .parse("https://github.com/mojombo")); assertNotNull(user); assertEquals("mojombo", user.login()); } /** * Verify URI with name */ @Test public void testUriWithTrailingSlash() { User user = UserUriMatcher.getUser(Uri .parse("http://github.com/defunkt/")); assertNotNull(user); assertEquals("defunkt", user.login()); } /** * Verify URI with name */ @Test public void testUriWithTrailingSlashes() { User user = UserUriMatcher.getUser(Uri .parse("http://github.com/defunkt//")); assertNotNull(user); assertEquals("defunkt", user.login()); } } ================================================ FILE: app/src/androidTest/java/com/github/pockethub/android/tests/util/HtmlUtilsTest.java ================================================ /* * Copyright (c) 2015 PocketHub * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.pockethub.android.tests.util; import com.github.pockethub.android.util.HtmlUtils; import org.junit.Test; import static junit.framework.Assert.assertNotNull; import static org.junit.Assert.assertEquals; /** * Unit tests of HTML conversions done when rendering markdown */ public class HtmlUtilsTest { private String format(String html) { CharSequence formatted = HtmlUtils.format(html); assertNotNull(formatted); return formatted.toString().replace("", "") .replace("", ""); } /** * Single email toggle span is removed */ @Test public void testToggleRemoved() { String html = "before after"; assertEquals("before after", format(html)); } /** * Multiple email toggle spans are removed */ @Test public void testTogglesRemoved() { String html = "before after"; assertEquals("before after", format(html)); } /** * Email div is transformed into block quote */ @Test public void testEmailQuoted() { String html = "before
quoted
after"; assertEquals("before
quoted
after", format(html)); } /** * Email fragment div is removed and newlines are replaced with br tags */ @Test public void testEmailFragment() { String html = "before
in\nside
after"; assertEquals("before in
side after", format(html)); } /** * Email fragment div is removed and newlines are replaced with br tags */ @Test public void testEmailFragments() { String html = "before
in\nside
after
out\nside
"; assertEquals("before in
side after out
side", format(html)); } /** * Email fragment div is removed and newlines are replaced with br tags */ @Test public void testTrailingEmailFragment() { String html = "before
in\nside
"; assertEquals("before in
side", format(html)); } /** * Leading break is removed */ @Test public void testLeadingBreak() { String html = "
content"; assertEquals("content", format(html)); } /** * Trailing break is removed */ @Test public void testTrailingBreak() { String html = "content
"; assertEquals("content", format(html)); } /** * Leading & trailing breaks are removed */ @Test public void testWrappedBreaks() { String html = "
content
"; assertEquals("content", format(html)); } /** * Leading & trailing breaks are removed */ @Test public void testWrappedParagraphs() { String html = "

content

"; assertEquals("content", format(html)); } /** * Paragraph replaced with break */ @Test public void testParagraphReplacedWithBreak() { String html = "line1

line2

"; assertEquals("line1
line2", format(html)); } /** * em tags replaced with i tags */ @Test public void testEmReplacedWithI() { String html = "abc"; assertEquals(html, format(html)); } /** * strong tags replaced with b tags */ @Test public void testStrongReplacedWithB() { String html = "a"; assertEquals(html, format(html)); } /** * Leading whitespace is removed */ @Test public void testLeadingWhitespace() { String html = " content"; assertEquals("content", format(html)); } /** * Trailing whitespace is removed */ @Test public void testTrailingWhitespace() { String html = "content "; assertEquals("content", format(html)); } /** * Leading & trailing whitespace is removed */ @Test public void testWrappedWhitetspace() { String html = " content "; assertEquals("content", format(html)); } /** * Pre untouched */ @Test public void testPreWithNoWhitespace() { String html = "a
b
c"; assertEquals("a
b
c", format(html)); } /** * Pre space escaped */ @Test public void testPreWithSpaces() { String html = "a
 b
c"; assertEquals("a
 b
c", format(html)); } /** * Pre tab escaped */ @Test public void testPreWithTabs() { String html = "a
\tb
c"; assertEquals("a
    b
c", format(html)); } /** * Pre newline escaped */ @Test public void testPreWithNewline() { String html = "a
\nb
c"; assertEquals("a

b
c", format(html)); } /** * Pre space, tab, and newline escaped */ @Test public void testPreWithAllWhitepsace() { String html = "a
\nb\tc 
d"; assertEquals("a

b    c 
d", format(html)); } /** * Multiple pre elements escaped */ @Test public void testMultiplePresEscaped() { String html = "a
 c 
d
\te\t
"; assertEquals( "a
 c 
d
    e    
", format(html)); } /** * Single code element inside a pre element */ @Test public void testFormatPreCodeOnly() { String html = "
a\nb\nc\n
"; assertEquals("
a
b
c
", format(html)); } } ================================================ FILE: app/src/debug/res/values/strings.xml ================================================ PocketHub Debug ================================================ FILE: app/src/main/AndroidManifest.xml ================================================ ================================================ FILE: app/src/main/assets/code_mirror/LICENSE ================================================ The MIT License (MIT) Copyright (c) 2016 Marijn Haverbeke and others Copyright (c) 2016 Michael Zhou Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: app/src/main/assets/code_mirror/VERSION ================================================ 5.19.0-minified ================================================ FILE: app/src/main/assets/code_mirror/addon/comment/comment.js ================================================ 'use strict';(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})(function(h){function w(a){a=a.search(q);return-1==a?0:a}function D(a,d,b){return/\bstring\b/.test(a.getTokenTypeAt(k(d.line,0)))&&!/^[\'\"`]/.test(b)}var A={},q=/[^\s\u00a0]/,k=h.Pos;h.commands.toggleComment=function(a){a.toggleComment()};h.defineExtension("toggleComment",function(a){a||(a=A);for(var d= Infinity,b=this.listSelections(),c=null,e=b.length-1;0<=e;e--){var f=b[e].from(),g=b[e].to();f.line>=d||(g.line>=d&&(g=k(d,0)),d=f.line,null==c?this.uncomment(f,g,a)?c="un":(this.lineComment(f,g,a),c="line"):"un"==c?this.uncomment(f,g,a):this.lineComment(f,g,a))}});h.defineExtension("lineComment",function(a,d,b){b||(b=A);var c=this,e=c.getModeAt(a),f=c.getLine(a.line);if(null!=f&&!D(c,a,f)){var g=b.lineComment||e.lineComment;if(g){var m=Math.min(0!=d.ch||d.line==a.line?d.line+1:d.line,c.lastLine()+ 1),h=null==b.padding?" ":b.padding,l=b.commentBlankLines||a.line==d.line;c.operation(function(){if(b.indent){for(var d=null,f=a.line;fe.length)d=e}for(f=a.line;fm||c.operation(function(){if(0!=b.fullLines){var l=q.test(c.getLine(m)); c.replaceRange(h+g,k(m));c.replaceRange(f+h,k(a.line,0));var x=b.blockCommentLead||e.blockCommentLead;if(null!=x)for(var p=a.line+1;p<=m;++p)(p!=m||l)&&c.replaceRange(x+h,k(p,0))}else c.replaceRange(g,d),c.replaceRange(f,a)})}});h.defineExtension("uncomment",function(a,d,b){b||(b=A);var c=this,e=c.getModeAt(a),f=Math.min(0!=d.ch||d.line==a.line?d.line:d.line-1,c.lastLine()),g=Math.min(a.line,f),h=b.lineComment||e.lineComment,w=[],l=null==b.padding?" ":b.padding,x;a:if(h){for(var p=g;p<=f;++p){var B= c.getLine(p),n=B.indexOf(h);-1d||(b.slice(e,e+l.length)==l&&(e+=l.length),x=!0,c.replaceRange("",k(a,d),k(a,e)))}});if(x)return!0}var t=b.blockCommentStart||e.blockCommentStart,u=b.blockCommentEnd||e.blockCommentEnd;if(!t||!u)return!1;var C=b.blockCommentLead||e.blockCommentLead,y= c.getLine(g),z=y.indexOf(t);if(-1==z)return!1;var v=f==g?y:c.getLine(f),r=v.indexOf(u,f==g?z+t.length:0);-1==r&&g!=f&&(v=c.getLine(--f),r=v.indexOf(u));if(-1==r||!/comment/.test(c.getTokenTypeAt(k(g,z+1)))||!/comment/.test(c.getTokenTypeAt(k(f,r+1))))return!1;e=y.lastIndexOf(t,a.ch);b=-1==e?-1:y.slice(0,a.ch).indexOf(u,e+t.length);if(-1!=e&&-1!=b&&b+u.length!=a.ch)return!1;b=v.indexOf(u,d.ch);a=v.slice(d.ch).lastIndexOf(t,b-d.ch);e=-1==b||-1==a?-1:d.ch+a;if(-1!=b&&-1!=e&&e!=d.ch)return!1;c.operation(function(){c.replaceRange("", k(f,r-(l&&v.slice(r-l.length,r)==l?l.length:0)),k(f,r+u.length));var a=z+t.length;l&&y.slice(a,a+l.length)==l&&(a+=l.length);c.replaceRange("",k(g,z),k(g,a));if(C)for(a=g+1;a<=f;++a){var b=c.getLine(a),d=b.indexOf(C);if(-1!=d&&!q.test(b.slice(0,d))){var e=d+C.length;l&&b.slice(e,e+l.length)==l&&(e+=l.length);c.replaceRange("",k(a,d),k(a,e))}}});return!0})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/comment/continuecomment.js ================================================ 'use strict';(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){function q(b){if(b.getOption("disableInput"))return e.Pass;for(var d=b.listSelections(),a,l=[],m=0;m=k))if(0==g.string.indexOf(a.blockCommentStart)){if(c=n.slice(0,g.start),!/^\s*$/.test(c))for(c="",k=0;kg.start&&/^\s*$/.test(n.slice(0,h))&&(c=n.slice(0,h));null!=c&&(c+=a.blockCommentContinue)}null==c&&a.lineComment&&r(b)&& (f=b.getLine(f.line),h=f.indexOf(a.lineComment),-1=d&&e()},200)});c.on(n,"focus",function(){++d})}});c.defineExtension("openNotification",function(a,g){function b(){f||(f=!0,clearTimeout(h),e.parentNode.removeChild(e))}m(this,b);var e=l(this,a,g&&g.bottom),f= !1,h;a=g&&"undefined"!==typeof g.duration?g.duration:5E3;c.on(e,"click",function(a){c.e_preventDefault(a);b()});a&&(h=setTimeout(b,a));return b})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/display/autorefresh.js ================================================ 'use strict';(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){function f(b,a){function d(){b.display.wrapper.offsetHeight?(e(b,a),b.display.lastWrapHeight!=b.display.wrapper.clientHeight&&b.refresh()):a.timeout=setTimeout(d,a.delay)}a.timeout=setTimeout(d,a.delay);a.hurry=function(){clearTimeout(a.timeout);a.timeout=setTimeout(d,50)};c.on(window,"mouseup", a.hurry);c.on(window,"keyup",a.hurry)}function e(b,a){clearTimeout(a.timeout);c.off(window,"mouseup",a.hurry);c.off(window,"keyup",a.hurry)}c.defineOption("autoRefresh",!1,function(b,a){b.state.autoRefresh&&(e(b,b.state.autoRefresh),b.state.autoRefresh=null);a&&0==b.display.wrapper.offsetHeight&&f(b,b.state.autoRefresh={delay:a.delay||250})})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/display/fullscreen.css ================================================ .CodeMirror-fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;height:auto;z-index:9} ================================================ FILE: app/src/main/assets/code_mirror/addon/display/fullscreen.js ================================================ 'use strict';(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){c.defineOption("fullScreen",!1,function(d,a,b){b==c.Init&&(b=!1);!b!=!a&&(a?(a=d.getWrapperElement(),d.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:a.style.width,height:a.style.height},a.style.width="",a.style.height="auto",a.className+=" CodeMirror-fullscreen", document.documentElement.style.overflow="hidden"):(a=d.getWrapperElement(),a.className=a.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="",b=d.state.fullScreenRestore,a.style.width=b.width,a.style.height=b.height,window.scrollTo(b.scrollLeft,b.scrollTop)),d.refresh())})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/display/panel.js ================================================ 'use strict';(function(g){"object"==typeof exports&&"object"==typeof module?g(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],g):g(CodeMirror)})(function(g){function f(a,b,c,d){this.cm=a;this.node=b;this.options=c;this.height=d;this.cleared=!1}function h(a){var b=a.getWrapperElement(),c=window.getComputedStyle?window.getComputedStyle(b):b.currentStyle,d=parseInt(c.height),e=a.state.panels={setHeight:b.style.height,heightLeft:d,panels:0,wrapper:document.createElement("div")}; b.parentNode.insertBefore(e.wrapper,b);c=a.hasFocus();e.wrapper.appendChild(b);c&&a.focus();a._setSize=a.setSize;null!=d&&(a.setSize=function(b,c){if(null==c)return this._setSize(b,c);e.setHeight=c;if("number"!=typeof c){var f=/^(\d+\.?\d*)px$/.exec(c);f?c=Number(f[1]):(e.wrapper.style.height=c,c=e.wrapper.offsetHeight,e.wrapper.style.height="")}a._setSize(b,e.heightLeft+=c-d);d=c})}g.defineExtension("addPanel",function(a,b){b=b||{};this.state.panels||h(this);var c=this.state.panels,d=c.wrapper,e= this.getWrapperElement();b.after instanceof f&&!b.after.cleared?d.insertBefore(a,b.before.node.nextSibling):b.before instanceof f&&!b.before.cleared?d.insertBefore(a,b.before.node):b.replace instanceof f&&!b.replace.cleared?(d.insertBefore(a,b.replace.node),b.replace.clear()):"bottom"==b.position?d.appendChild(a):"before-bottom"==b.position?d.insertBefore(a,e.nextSibling):"after-top"==b.position?d.insertBefore(a,e):d.insertBefore(a,d.firstChild);d=b&&b.height||a.offsetHeight;this._setSize(null,c.heightLeft-= d);c.panels++;return new f(this,a,b,d)});f.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var a=this.cm.state.panels;this.cm._setSize(null,a.heightLeft+=this.height);a.wrapper.removeChild(this.node);if(0==--a.panels){var a=this.cm,b=a.state.panels;a.state.panels=null;var c=a.getWrapperElement();b.wrapper.parentNode.replaceChild(c,b.wrapper);c.style.height=b.setHeight;a.setSize=a._setSize;a.setSize()}}};f.prototype.changed=function(a){a=null==a?this.node.offsetHeight:a;this.cm._setSize(null, this.cm.state.panels.height+=a-this.height);this.height=a}}); ================================================ FILE: app/src/main/assets/code_mirror/addon/display/placeholder.js ================================================ 'use strict';(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)})(function(d){function f(a){a.state.placeholder&&(a.state.placeholder.parentNode.removeChild(a.state.placeholder),a.state.placeholder=null)}function h(a){f(a);var c=a.state.placeholder=document.createElement("pre");c.style.cssText="height: 0; overflow: visible";c.className="CodeMirror-placeholder";var b= a.getOption("placeholder");"string"==typeof b&&(b=document.createTextNode(b));c.appendChild(b);a.display.lineSpace.insertBefore(c,a.display.lineSpace.firstChild)}function g(a){k(a)&&h(a)}function e(a){var c=a.getWrapperElement(),b=k(a);c.className=c.className.replace(" CodeMirror-empty","")+(b?" CodeMirror-empty":"");b?h(a):f(a)}function k(a){return 1===a.lineCount()&&""===a.getLine(0)}d.defineOption("placeholder","",function(a,c,b){b=b&&b!=d.Init;c&&!b?(a.on("blur",g),a.on("change",e),a.on("swapDoc", e),e(a)):!c&&b&&(a.off("blur",g),a.off("change",e),a.off("swapDoc",e),f(a),b=a.getWrapperElement(),b.className=b.className.replace(" CodeMirror-empty",""));c&&!a.hasFocus()&&g(a)})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/display/rulers.js ================================================ 'use strict';(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){function e(a){a.state.rulerDiv.textContent="";var h=a.getOption("rulers"),e=a.defaultCharWidth(),k=a.charCoords(c.Pos(a.firstLine(),0),"div").left;a.state.rulerDiv.style.minHeight=a.display.scroller.offsetHeight+30+"px";for(var f=0;f=g.ch||b.getRange(k(g.line,g.ch-3),k(g.line,g.ch-2))!=a))h="addFour";else if(v)if(!f.isWordChar(t)&&B(b,g,a))h="both";else return f.Pass;else if(m&&(b.getLine(g.line).length== g.ch||C(t,e)||/\s/.test(t)))h="both";else return f.Pass;else h=0<=c.indexOf(a)&&b.getRange(g,k(g.line,g.ch+3))==a+a+a?"skipThree":"skip";if(!l)l=h;else if(l!=h)return f.Pass}var n=d%2?e.charAt(d-1):a,q=d%2?a:e.charAt(d+1);b.operation(function(){if("skip"==l)b.execCommand("goCharRight");else if("skipThree"==l)for(var a=0;3>a;a++)b.execCommand("goCharRight");else if("surround"==l){for(var c=b.getSelections(),a=0;a=a.ch+1)return/\bstring2?\b/.test(e);c.start=c.pos}}var w={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},k=f.Pos;f.defineOption("autoCloseBrackets",!1,function(b,a,c){c&&c!=f.Init&&(b.removeKeyMap(p),b.state.closeBrackets=null);a&&(b.state.closeBrackets=a,b.addKeyMap(p))}); for(var q=w.pairs+"`",p={Backspace:function(b){var a=u(b);if(!a||b.getOption("disableInput"))return f.Pass;for(var c=r(a,"pairs"),a=b.listSelections(),e=0;ef.ch&&(g=g.slice(0,g.length-c.end+f.ch));var n=g.toLowerCase();if(!g||"string"==c.type&&(c.end!=f.ch||!/[\"\']/.test(c.string.charAt(c.string.length-1))||1==c.string.length)||"tag"==c.type&&"closeTag"==m.type||c.string.indexOf("/")==c.string.length-1||k&&-1"+(c?"\n\n":"")+"",newPos:c?e.Pos(f.line+1,0):e.Pos(f.line,f.ch+1)}}for(d=h.length-1;0<=d;d--)f=a[d],b.replaceRange(f.text,h[d].head,h[d].anchor,"+insert"),c=b.listSelections().slice(0),c[d]={head:f.newPos,anchor:f.newPos},b.setSelections(c),f.indent&&(b.indentLine(f.newPos.line,null,!0),b.indentLine(f.newPos.line+1,null,!0))}function n(b,h){for(var a=b.listSelections(),d=[],f=h?"/":""!=b.getLine(k.line).charAt(m.end)&&(g+=">");d[c]=g}b.replaceSelections(d);a=b.listSelections(); for(c=0;c'"]=function(a){return r(a)};b.addKeyMap(a)}});var t="area base br col command embed hr img input keygen link meta param source track wbr".split(" "),u="applet blockquote body button div dl fieldset form frameset h1 h2 h3 h4 h5 h6 head html iframe layer legend object ol p select table ul".split(" "); e.commands.closeTag=function(b){return n(b)}}); ================================================ FILE: app/src/main/assets/code_mirror/addon/edit/continuelist.js ================================================ 'use strict';(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)})(function(d){var l=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,m=/^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,n=/[*+-]\s/;d.commands.newlineAndIndentContinueMarkdownList=function(b){if(b.getOption("disableInput"))return d.Pass;for(var f=b.listSelections(),g=[],e=0;e")?a[2]:parseInt(a[3],10)+1+a[4],g[e]="\n"+c+a+h)}b.replaceSelections(g)}}); ================================================ FILE: app/src/main/assets/code_mirror/addon/edit/matchbrackets.js ================================================ 'use strict';(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){function r(a,c,b,e){var d=a.getLineHandle(c.line),l=c.ch-1,d=0<=l&&q[d.text.charAt(l)]||q[d.text.charAt(++l)];if(!d)return null;var h=">"==d.charAt(1)?1:-1;if(b&&0l))for(k==c.line&&(f=c.ch-(0>b?1:0));f!=w;f+=b){var p=n.charAt(f);if(d.test(p)&&(void 0===e||a.getTokenTypeAt(m(k,f+1))==e))if(">"== q[p].charAt(1)==0document.documentMode),m=e.Pos,q={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},f=null;e.defineOption("matchBrackets", !1,function(a,c,b){b&&b!=e.Init&&(a.off("cursorActivity",v),f&&(f(),f=null));c&&(a.state.matchBrackets="object"==typeof c?c:{},a.on("cursorActivity",v))});e.defineExtension("matchBrackets",function(){u(this,!0)});e.defineExtension("findMatchingBracket",function(a,c,b){return r(this,a,c,b)});e.defineExtension("scanForBracket",function(a,c,b,e){return t(this,a,c,b,e)})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/edit/matchtags.js ================================================ 'use strict';(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../fold/xml-fold"],d):d(CodeMirror)})(function(d){function f(a){a.state.tagHit&&a.state.tagHit.clear();a.state.tagOther&&a.state.tagOther.clear();a.state.tagHit=a.state.tagOther=null}function e(a){a.state.failedTagMatch=!1;a.operation(function(){f(a);if(!a.somethingSelected()){var b=a.getCursor(), c=a.getViewport();c.from=Math.min(c.from,b.line);c.to=Math.max(b.line+1,c.to);if(b=d.findMatchingTag(a,b,c))a.state.matchBothTags&&(c="open"==b.at?b.open:b.close)&&(a.state.tagHit=a.markText(c.from,c.to,{className:"CodeMirror-matchingtag"})),(b="close"==b.at?b.open:b.close)?a.state.tagOther=a.markText(b.from,b.to,{className:"CodeMirror-matchingtag"}):a.state.failedTagMatch=!0}})}function g(a){a.state.failedTagMatch&&e(a)}d.defineOption("matchTags",!1,function(a,b,c){c&&c!=d.Init&&(a.off("cursorActivity", e),a.off("viewportChange",g),f(a));b&&(a.state.matchBothTags="object"==typeof b&&b.bothTags,a.on("cursorActivity",e),a.on("viewportChange",g),e(a))});d.commands.toMatchingTag=function(a){var b=d.findMatchingTag(a,a.getCursor());b&&(b="close"==b.at?b.open:b.close)&&a.extendSelection(b.to,b.from)}}); ================================================ FILE: app/src/main/assets/code_mirror/addon/edit/trailingspace.js ================================================ 'use strict';(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){a.defineOption("showTrailingSpace",!1,function(d,e,b){b==a.Init&&(b=!1);b&&!e?d.removeOverlay("trailingspace"):!b&&e&&d.addOverlay({token:function(a){for(var b=a.string.length,c=b;c&&/\s/.test(a.string.charAt(c-1));--c);if(c>a.pos)return a.pos=c,null;a.pos=b;return"trailingspace"},name:"trailingspace"})})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/fold/brace-fold.js ================================================ 'use strict';(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)})(function(d){d.registerHelper("fold","brace",function(e,a){function b(h){for(var c=a.ch,b=0;;)if(c=0>=c?-1:f.lastIndexOf(h,c-1),-1==c){if(1==b)break;b=1;c=f.length}else{if(1==b&&cq&&(q=n.length);0>c&&(c=n.length);c=Math.min(q,c);if(c==n.length)break;if(e.getTokenTypeAt(d.Pos(m,c+1))==k)if(c==q)++u;else if(!--u){p=m;r=c;break a}++c}if(null!=p&&(g!=p||r!=l))return{from:d.Pos(g,l),to:d.Pos(p,r)}}});d.registerHelper("fold","import",function(e,a){function b(h){if(he.lastLine())return null; var a=e.getTokenAt(d.Pos(h,1));/\S/.test(a.string)||(a=e.getTokenAt(d.Pos(h,a.end+1)));if("keyword"!=a.type||"import"!=a.string)return null;var b=h;for(h=Math.min(e.lastLine(),h+10);b<=h;++b){var f=e.getLine(b).indexOf(";");if(-1!=f)return{startCh:a.end,end:d.Pos(b,f)}}}a=a.line;var g=b(a),f;if(!g||b(a-1)||(f=b(a-2))&&f.end.line==a-1)return null;for(f=g.end;;){var k=b(f.line+1);if(null==k)break;f=k.end}return{from:e.clipPos(d.Pos(a,g.startCh+1)),to:f}});d.registerHelper("fold","include",function(e, a){function b(a){if(ae.lastLine())return null;var b=e.getTokenAt(d.Pos(a,1));/\S/.test(b.string)||(b=e.getTokenAt(d.Pos(a,b.end+1)));if("meta"==b.type&&"#include"==b.string.slice(0,8))return b.start+8}a=a.line;var g=b(a);if(null==g||null!=b(a-1))return null;for(var f=a;null!=b(f+1);)++f;return{from:d.Pos(a,g+1),to:e.clipPos(d.Pos(f))}})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/fold/comment-fold.js ================================================ 'use strict';(function(b){"object"==typeof exports&&"object"==typeof module?b(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],b):b(CodeMirror)})(function(b){b.registerGlobalHelper("fold","comment",function(b){return b.blockCommentStart&&b.blockCommentEnd},function(g,d){var e=g.getModeAt(d),m=e.blockCommentStart,e=e.blockCommentEnd;if(m&&e){for(var f=d.line,h=g.getLine(f),a=d.ch,k=0;;)if(a=0>=a?-1:h.lastIndexOf(m,a-1),-1==a){if(1==k)return;k=1; a=h.length}else{if(1==k&&ap&&(p=l.length);0>c&&(c=l.length);c=Math.min(p,c);if(c==l.length)break;if(c==p)++h;else if(!--h){n=a;q=c;break a}++c}if(null!=n&&(f!=n||q!=d))return{from:b.Pos(f,d),to:b.Pos(n,q)}}})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/fold/foldcode.js ================================================ 'use strict';(function(b){"object"==typeof exports&&"object"==typeof module?b(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],b):b(CodeMirror)})(function(b){function k(a,c,d,g){function f(d){var b=k(a,c);if(!b||b.to.line-b.from.linea.firstLine();)c=b.Pos(c.line-1,0),e=f(!1);if(e&&!e.cleared&&"unfold"!==g){var m=p(a,d);b.on(m,"mousedown",function(a){n.clear();b.e_preventDefault(a)});var n=a.markText(e.from,e.to,{replacedWith:m,clearOnEnter:h(a,d,"clearOnEnter"),__isFold:!0});n.on("clear",function(c,d){b.signal(a,"unfold",a,c,d)});b.signal(a,"fold",a,e.from,e.to)}}function p(a,c){a=h(a,c,"widget");"string"==typeof a&&(c=document.createTextNode(a), a=document.createElement("span"),a.appendChild(c),a.className="CodeMirror-foldmarker");return a}function h(a,c,b){return c&&void 0!==c[b]?c[b]:(a=a.options.foldOptions)&&void 0!==a[b]?a[b]:l[b]}b.newFoldFunction=function(a,c){return function(b,g){k(b,g,{rangeFinder:a,widget:c})}};b.defineExtension("foldCode",function(a,b,d){k(this,a,b,d)});b.defineExtension("isFolded",function(a){a=this.findMarksAt(a);for(var b=0;b=f&&(a=g(l.indicatorOpen))}b.setGutterMarker(c,l.gutter,a);++e})}function k(b){var c=b.getViewport(),a=b.state.foldGutter;a&&(b.operation(function(){e(b,c.from,c.to)}),a.from=c.from,a.to=c.to)}function q(b,c,a){var h=b.state.foldGutter; h&&(h=h.options,a==h.gutter&&((a=d(b,c))?a.clear():b.foldCode(m(c,0),h.rangeFinder)))}function n(b){var c=b.state.foldGutter;if(c){var a=c.options;c.from=c.to=0;clearTimeout(c.changeUpdate);c.changeUpdate=setTimeout(function(){k(b)},a.foldOnChangeTimeSpan||600)}}function r(b){var a=b.state.foldGutter;if(a){var d=a.options;clearTimeout(a.changeUpdate);a.changeUpdate=setTimeout(function(){var c=b.getViewport();a.from==a.to||20a.to&&(e(b,a.to,c.to),a.to=c.to)})},d.updateViewportTimeSpan||400)}}function p(a,c){var b=a.state.foldGutter;b&&(c=c.line,c>=b.from&&ck)c=d;else if(/\S/.test(h))break}if(c)return{from:a.Pos(e.line, f.length),to:a.Pos(c,b.getLine(c).length)}}})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/fold/markdown-fold.js ================================================ 'use strict';(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){a.registerHelper("fold","markdown",function(c,d){function g(b){return(b=c.getTokenTypeAt(a.Pos(b,0)))&&/\bheader\b/.test(b)}function h(b,a,c){return(a=a&&a.match(/^#+/))&&g(b)?a[0].length:(a=c&&c.match(/^[=\-]+\s*$/))&&g(b+1)?"="==c[0]?1:2:100}var k=c.getLine(d.line),e=c.getLine(d.line+1), l=h(d.line,k,e);if(100!==l){for(var m=c.lastLine(),b=d.line,f=c.getLine(b+2);b= a.max))return a.ch=0,a.text=a.cm.getLine(++a.line),!0}function u(a){if(!(a.line<=a.min))return a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0}function q(a){for(;;){var b=a.text.indexOf(">",a.ch);if(-1==b)if(t(a))continue;else break;if(m(a,b+1)){var d=a.text.lastIndexOf("/",b),d=-1e&&(!b||b==c[2]))return{tag:c[2],from:h(f,k),to:h(a.line,a.ch)}}else d.push(c[2])}} function w(a,b){for(var d=[];;){var c;a:for(c=a;;){var g=c.ch?c.text.lastIndexOf(">",c.ch-1):-1;if(-1==g)if(u(c))continue;else{c=void 0;break a}if(m(c,g+1)){var f=c.text.lastIndexOf("/",g),f=-1e&&(!b||b==f[2]))return{tag:f[2],from:h(a.line,a.ch), to:h(c,g)}}}}}var h=e.Pos,n=/<(\/?)([A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD-:.0-9\u00B7\u0300-\u036F\u203F-\u2040]*)/g;e.registerHelper("fold","xml",function(a,b){for(a=new l(a,b.line,0);;){var d=v(a),c;if(!d||a.line!=b.line||!(c=q(a)))break; if(!d[1]&&"selfClose"!=c)return b=h(a.line,a.ch),(a=p(a,d[2]))&&{from:b,to:a.from}}});e.findMatchingTag=function(a,b,d){var c=new l(a,b.line,b.ch,d);if(-1!=c.text.indexOf(">")||-1!=c.text.indexOf("<")){var e=q(c),f=e&&h(c.line,c.ch),k=e&&r(c);if(e&&k&&!(0<(c.line-b.line||c.ch-b.ch))){b={from:h(c.line,c.ch),to:f,tag:k[2]};if("selfClose"==e)return{open:b,close:null,at:"open"};if(k[1])return{open:w(c,k[2]),close:b,at:"close"};c=new l(a,f.line,f.ch,d);return{open:b,close:p(c,k[2]),at:"open"}}}};e.findEnclosingTag= function(a,b,d){for(var c=new l(a,b.line,b.ch,d);;){var e=w(c);if(!e)break;var f=new l(a,b.line,b.ch,d);if(f=p(f,e.tag))return{open:e,close:f}}};e.scanForClosingTag=function(a,b,d,c){a=new l(a,b.line,b.ch,c?{from:0,to:c}:null);return p(a,d)}}); ================================================ FILE: app/src/main/assets/code_mirror/addon/hint/anyword-hint.js ================================================ 'use strict';(function(b){"object"==typeof exports&&"object"==typeof module?b(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],b):b(CodeMirror)})(function(b){var p=/[\w$]+/;b.registerHelper("hint","anyword",function(g,a){for(var l=a&&a.word||p,q=a&&a.range||500,c=g.getCursor(),d=g.getLine(c.line),m=c.ch,e=m;e&&l.test(d.charAt(e-1));)--e;d=e!=m&&d.slice(e,m);a=a&&a.list||[];for(var n={},l=new RegExp(l.source,"g"),h=-1;1>=h;h+=2)for(var k=c.line, r=Math.min(Math.max(k+h*q,g.firstLine()),g.lastLine())+h;k!=r;k+=h)for(var t=g.getLine(k),f;f=l.exec(t);)k==c.line&&f[0]===d||d&&0!=f[0].lastIndexOf(d,0)||Object.prototype.hasOwnProperty.call(n,f[0])||(n[f[0]]=!0,a.push(f[0]));return{list:a,from:b.Pos(c.line,e),to:b.Pos(c.line,m)}})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/hint/css-hint.js ================================================ 'use strict';(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror"),require("../../mode/css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/css/css"],a):a(CodeMirror)})(function(a){var m={link:1,visited:1,active:1,hover:1,focus:1,"first-letter":1,"first-line":1,"first-child":1,before:1,after:1,lang:1};a.registerHelper("hint","css",function(d){function f(b){for(var a in b)h&&0!=a.lastIndexOf(h,0)||k.push(a)}var e=d.getCursor(), c=d.getTokenAt(e),b=a.innerMode(d.getMode(),c.state);if("css"==b.mode.name){if("keyword"==c.type&&0=="!important".indexOf(c.string))return{list:["!important"],from:a.Pos(e.line,c.start),to:a.Pos(e.line,c.end)};d=c.start;var l=e.ch,h=c.string.slice(0,l-d);/[^\w$_-]/.test(h)&&(h="",d=l=e.ch);var g=a.resolveMode("text/css"),k=[],b=b.state.state;if("pseudo"==b||"variable-3"==c.type)f(m);else if("block"==b||"maybeprop"==b)f(g.propertyKeywords);else if("prop"==b||"parens"==b||"at"==b||"params"==b)f(g.valueKeywords), f(g.colorKeywords);else if("media"==b||"media_parens"==b)f(g.mediaTypes),f(g.mediaFeatures);if(k.length)return{list:k,from:a.Pos(e.line,d),to:a.Pos(e.line,l)}}})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/hint/html-hint.js ================================================ 'use strict';(function(b){"object"==typeof exports&&"object"==typeof module?b(require("../../lib/codemirror"),require("./xml-hint")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./xml-hint"],b):b(CodeMirror)})(function(b){function n(a){for(var b in g)g.hasOwnProperty(b)&&(a.attrs[b]=g[b])}var d="ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "), c=["_blank","_self","_top","_parent"],h=["ascii","utf-8","utf-16","latin1","latin1"],k=["get","post","put","delete"],l=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],e="all;screen;print;embossed;braille;handheld;print;projection;screen;tty;tv;speech;3d-glasses;resolution [>][<][=] [X];device-aspect-ratio: X/Y;orientation:portrait;orientation:landscape;device-height: [X];device-width: [X]".split(";"),a={attrs:{}},f={a:{attrs:{href:null,ping:null,type:null,media:e,target:c, hreflang:d}},abbr:a,acronym:a,address:a,applet:a,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:e,hreflang:d,type:null,shape:["default","rect","circle","poly"]}},article:a,aside:a,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:a,base:{attrs:{href:null,target:c}},basefont:a,bdi:a,bdo:a,big:a,blockquote:{attrs:{cite:null}},body:a,br:a, button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:l,formmethod:k,formnovalidate:["","novalidate"],formtarget:c,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:a,center:a,cite:a,code:a,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}}, data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:a,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:a,dir:a,div:a,dl:a,dt:a,em:a,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:a,figure:a,font:a,footer:a,form:{attrs:{action:null,name:null,"accept-charset":h,autocomplete:["on","off"], enctype:l,method:k,novalidate:["","novalidate"],target:c}},frame:a,frameset:a,h1:a,h2:a,h3:a,h4:a,h5:a,h6:a,head:{attrs:{},children:"title base link style meta script noscript command".split(" ")},header:a,hgroup:a,hr:a,html:{attrs:{manifest:null},children:["head","body"]},i:a,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null, width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:l,formmethod:k,formnovalidate:["","novalidate"],formtarget:c,multiple:["", "multiple"],readonly:["","readonly"],required:["","required"],type:"hidden text search tel url email password datetime date month week time datetime-local number range color checkbox radio file submit image reset button".split(" ")}},ins:{attrs:{cite:null,datetime:null}},kbd:a,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{"for":null,form:null}},legend:a,li:{attrs:{value:null}},link:{attrs:{href:null,type:null, hreflang:d,media:e,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:a,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:h,name:"viewport application-name author description generator keywords".split(" "),"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:a,noframes:a,noscript:a,object:{attrs:{data:null,type:null, name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{"for":null,form:null,name:null}},p:a,param:{attrs:{name:null,value:null}},pre:a,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:a,rt:a,ruby:a,s:a,samp:a,script:{attrs:{type:["text/javascript"], src:null,async:["","async"],defer:["","defer"],charset:h}},section:a,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:a,source:{attrs:{src:null,type:null,media:null}},span:a,strike:a,strong:a,style:{attrs:{type:["text/css"],media:e,scoped:null}},sub:a,summary:a,sup:a,table:a,tbody:a,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null, cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:a,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:a,time:{attrs:{datetime:null}},title:a,tr:a,track:{attrs:{src:null,label:null,"default":null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:d}},tt:a,u:a,ul:a,"var":a,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous", "use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:a},g={accesskey:"abcdefghijklmnopqrstuvwxyz0123456789".split(""),"class":null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null, lang:["en","es"],spellcheck:["true","false"],style:null,tabindex:"123456789".split(""),title:null,translate:["yes","no"],onclick:null,rel:"stylesheet alternate author bookmark help license next nofollow noreferrer prefetch prev search tag".split(" ")};n(a);for(var m in f)f.hasOwnProperty(m)&&f[m]!=a&&n(f[m]);b.htmlSchema=f;b.registerHelper("hint","html",function(a,c){var d={schemaInfo:f};if(c)for(var e in c)d[e]=c[e];return b.hint.xml(a,d)})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/hint/javascript-hint.js ================================================ 'use strict';(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})(function(h){function m(a,b){for(var k=0,e=a.length;kc.ch&&(d.end=c.ch,d.string=d.string.slice(0,c.ch-d.start)):d={start:c.ch, end:c.ch,string:"",state:d.state,type:"."==d.string?"property":null};for(var f=d;"property"==f.type;){f=k(a,n(c.line,f.start));if("."!=f.string)return;f=k(a,n(c.line,f.start));if(!p)var p=[];p.push(f)}return{list:r(d,p,b,e),from:n(c.line,d.start),to:n(c.line,d.end)}}}function t(a,b){a=a.getTokenAt(b);b.ch==a.start+1&&"."==a.string.charAt(0)?(a.end=a.start,a.string=".",a.type="property"):/^\.[\w$_]*$/.test(a.string)&&(a.type="property",a.start++,a.string=a.string.replace(/\./,""));return a}function r(a, b,k,e){function c(a){var b;if(b=0==a.lastIndexOf(h,0)){a:if(Array.prototype.indexOf)b=-1!=f.indexOf(a);else{for(b=f.length;b--;)if(f[b]===a){b=!0;break a}b=!1}b=!b}b&&f.push(a)}function d(a){"string"==typeof a?m(u,c):a instanceof Array?m(v,c):a instanceof Function&&m(w,c);if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(;a;a=Object.getPrototypeOf(a))Object.getOwnPropertyNames(a).forEach(c);else for(var b in a)c(b)}var f=[],h=a.string,l=e&&e.globalScope||window;if(b&&b.length){a=b.pop();var g; a.type&&0===a.type.indexOf("variable")?(e&&e.additionalContext&&(g=e.additionalContext[a.string]),e&&!1===e.useGlobalScope||(g=g||l[a.string])):"string"==a.type?g="":"atom"==a.type?g=1:"function"==a.type&&(null==l.jQuery||"$"!=a.string&&"jQuery"!=a.string||"function"!=typeof l.jQuery?null!=l._&&"_"==a.string&&"function"==typeof l._&&(g=l._()):g=l.jQuery());for(;null!=g&&b.length;)g=g[b.pop().string];null!=g&&d(g)}else{for(b=a.state.localVars;b;b=b.next)c(b.name);for(b=a.state.globalVars;b;b=b.next)c(b.name); e&&!1===e.useGlobalScope||d(l);m(k,c)}return f}var n=h.Pos;h.registerHelper("hint","javascript",function(a,b){return q(a,x,function(a,b){return a.getTokenAt(b)},b)});h.registerHelper("hint","coffeescript",function(a,b){return q(a,y,t,b)});var u="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),v="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "), w=["prototype","apply","call","bind"],x="break case catch continue debugger default delete do else false finally for function if in instanceof new null return switch throw true try typeof var void while with".split(" "),y="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ")}); ================================================ FILE: app/src/main/assets/code_mirror/addon/hint/show-hint.css ================================================ .CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);border-radius:3px;border:1px solid silver;background:#fff;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff} ================================================ FILE: app/src/main/assets/code_mirror/addon/hint/show-hint.js ================================================ 'use strict';(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],f):f(CodeMirror)})(function(f){function n(a,b){this.cm=a;this.options=b;this.widget=null;this.tick=this.debounce=0;this.startPos=this.cm.getCursor("start");this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var c=this;a.on("cursorActivity",this.activityFunc=function(){c.cursorActivity()})} function y(a,b){function c(a,d){var c;c="string"!=typeof d?function(a){return d(a,b)}:e.hasOwnProperty(d)?e[d]:d;f[a]=c}var e={Up:function(){b.moveFocus(-1)},Down:function(){b.moveFocus(1)},PageUp:function(){b.moveFocus(-b.menuSize()+1,!0)},PageDown:function(){b.moveFocus(b.menuSize()-1,!0)},Home:function(){b.setFocus(0)},End:function(){b.setFocus(b.length-1)},Enter:b.pick,Tab:b.pick,Esc:b.close},d=a.options.customKeys,f=d?{}:e;if(d)for(var g in d)d.hasOwnProperty(g)&&c(g,d[g]);if(a=a.options.extraKeys)for(g in a)a.hasOwnProperty(g)&& c(g,a[g]);return f}function w(a,b){for(;b&&b!=a;){if("LI"===b.nodeName.toUpperCase()&&b.parentNode==a)return b;b=b.parentNode}}function q(a,b){this.completion=a;this.data=b;this.picked=!1;var c=this,e=a.cm,d=this.hints=document.createElement("ul");d.className="CodeMirror-hints";this.selectedHint=b.selectedHint||0;for(var m=b.list,g=0;gd.clientHeight+1,q=e.getScrollInfo();0k&&(d.style.height=k-5+"px",d.style.top=(v=g.bottom-h.top)+"px",k=e.getCursor(),b.from.ch!=k.ch&&(g=e.cursorCoords(k),d.style.left=(u=g.left)+"px",h=d.getBoundingClientRect())));k=h.right-l;0l&&(d.style.width=l-5+"px",k-=h.right-h.left-l),d.style.left=(u=g.left-k)+"px");if(p)for(g=d.firstChild;g;g= g.nextSibling)g.style.paddingRight=e.display.nativeBarWidth+"px";e.addKeyMap(this.keyMap=y(a,{moveFocus:function(a,b){c.changeActive(c.selectedHint+a,b)},setFocus:function(a){c.changeActive(a)},menuSize:function(){return c.screenAmount()},length:m.length,close:function(){a.close()},pick:function(){c.pick()},data:b}));if(a.options.closeOnUnfocus){var t;e.on("blur",this.onBlur=function(){t=setTimeout(function(){a.close()},100)});e.on("focus",this.onFocus=function(){clearTimeout(t)})}e.on("scroll",this.onScroll= function(){var b=e.getScrollInfo(),c=e.getWrapperElement().getBoundingClientRect(),g=v+q.top-b.top,f=g-(window.pageYOffset||(document.documentElement||document.body).scrollTop);n||(f+=d.offsetHeight);if(f<=c.top||f>=c.bottom)return a.close();d.style.top=g+"px";d.style.left=u+q.left-b.left+"px"});f.on(d,"dblclick",function(a){(a=w(d,a.target||a.srcElement))&&null!=a.hintId&&(c.changeActive(a.hintId),c.pick())});f.on(d,"click",function(b){(b=w(d,b.target||b.srcElement))&&null!=b.hintId&&(c.changeActive(b.hintId), a.options.completeOnSingleClick&&c.pick())});f.on(d,"mousedown",function(){setTimeout(function(){e.focus()},20)});f.signal(b,"select",m[0],d.firstChild);return!0}function z(a,b){if(!a.somethingSelected())return b;a=[];for(var c=0;c=this.data.list.length?a=b?this.data.list.length-1:0:0>a&&(a=b?0:this.data.list.length-1);this.selectedHint!=a&&(b=this.hints.childNodes[this.selectedHint],b.className=b.className.replace(" CodeMirror-hint-active",""),b=this.hints.childNodes[this.selectedHint= a],b.className+=" CodeMirror-hint-active",b.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=b.offsetTop+b.offsetHeight-this.hints.clientHeight+3),f.signal(this.data,"select",this.data.list[this.selectedHint],b))},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}};f.registerHelper("hint","auto",{resolve:function(a,b){var c=a.getHelpers(b, "hint"),e;return c.length?(a=function(a,b,e){function d(c){if(c==f.length)return b(null);t(f[c],a,e,function(a){a&&0,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};f.defineOption("hintOptions",null)}); ================================================ FILE: app/src/main/assets/code_mirror/addon/hint/sql-hint.js ================================================ 'use strict';(function(g){"object"==typeof exports&&"object"==typeof module?g(require("../../lib/codemirror"),require("../../mode/sql/sql")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../mode/sql/sql"],g):g(CodeMirror)})(function(g){function r(a){return"[object Array]"==Object.prototype.toString.call(a)}function D(a){a=a.doc.modeOption;"sql"===a&&(a="text/x-sql");return g.resolveMode(a).keywords}function q(a){return"string"==typeof a?a:a.text}function v(a,b){r(b)&&(b= {columns:b});b.text||(b.text=a);return b}function E(a){var b={};if(r(a))for(var c=a.length-1;0<=c;c--){var d=a[c];b[q(d).toUpperCase()]=v(q(d),d)}else if(a)for(c in a)b[c.toUpperCase()]=v(c,a[c]);return b}function w(a){var b={},c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function x(a,b){var c=a.length;b=q(b).substr(0,c);return a.toUpperCase()===b.toUpperCase()}function p(a,b,c,d){if(r(c))for(var e=0;e=B(h,a[b])){k=d;l=a[b];break}d=a[b]}c=c.getRange(k,l,!1);for(b=0;bc.ch&&(e.end=c.ch,e.string=e.string.slice(0,c.ch-e.start));e.string.match(/^[.`\w@]\w*$/)?(k=e.string, f=e.start,g=e.end):(f=g=c.ch,k="");"."==k.charAt(0)||"`"==k.charAt(0)?f=G(c,e,d,a):(p(d,k,n,function(a){return a}),p(d,k,h,function(a){return a}),b||p(d,k,C,function(a){return a.toUpperCase()}));return{list:d,from:m(c.line,f),to:m(c.line,g)}})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/hint/xml-hint.js ================================================ 'use strict';(function(p){"object"==typeof exports&&"object"==typeof module?p(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],p):p(CodeMirror)})(function(p){var r=p.Pos;p.registerHelper("hint","xml",function(b,d){var c=d&&d.schemaInfo,l=d&&d.quoteChar||'"';if(c){d=b.getCursor();var a=b.getTokenAt(d);a.end>d.ch&&(a.end=d.ch,a.string=a.string.slice(0,d.ch-a.start));var k=p.innerMode(b.getMode(),a.state);if("xml"==k.mode.name){var q=[],m=!1,g,t= /\btag\b/.test(a.type)&&!/>$/.test(a.string),w=t&&/^\w/.test(a.string),u;if(w){var e=b.getLine(d.line).slice(Math.max(0,a.start-2),a.start);(e=/<\/$/.test(e)?"close":/<$/.test(e)?"open":null)&&(u=a.start-("close"==e?2:1))}else t&&"<"==a.string?e="open":t&&"")}else{f=(k=c[k.state.tagName])&&k.attrs;c=c["!attrs"];if(!f&&!c)return;if(!f)f=c;else if(c){var e={},n;for(n in c)c.hasOwnProperty(n)&&(e[n]=c[n]);for(n in f)f.hasOwnProperty(n)&&(e[n]=f[n]);f=e}if("string"==a.type||"="==a.string){e=b.getRange(r(d.line,Math.max(0,d.ch-60)),r(d.line,"string"==a.type?a.start:a.end));c=e.match(/([^\s\u00a0=<>\"\']+)=$/); if(!c||!f.hasOwnProperty(c[1])||!(h=f[c[1]]))return;"function"==typeof h&&(h=h.call(this,b));"string"==a.type&&(g=a.string,m=0,/['"]/.test(a.string.charAt(0))&&(l=a.string.charAt(0),g=a.string.slice(1),m++),b=a.string.length,/['"]/.test(a.string.charAt(b-1))&&(l=a.string.charAt(b-1),g=a.string.substr(m,b-2)),m=!0);for(b=0;ba&&--k});a.character=k}}var f=a.character-1,l=f+1;a.evidence&&(h=a.evidence.substring(f).search(/.\b/),-1k)return!1;var g=d.getScrollInfo();if("align"==a.mv.options.connect)l=g.top;else{var h=.5*g.clientHeight,l=g.top+h;c=d.lineAtHeight(l,"local");for(var m=a.chunks,n=b==DIFF_INSERT,u,t,p,r=0;rc?(t=v.editFrom,p=v.origFrom):q>c&&(t=v.editTo,p=v.origTo));q<=c?(u=v.editTo,f=v.origTo):O<=c&&(u=v.editFrom,f=v.origFrom)}c={before:u, after:t};f={before:f,after:p};d=P(d,b==DIFF_INSERT?c:f);b=P(e,b==DIFF_INSERT?f:c);var l=b.top-h+(l-d.top)/(d.bot-d.top)*(b.bot-b.top),y;l>g.top&&1>(y=g.top/h)?l=l*y+g.top*(1-y):(b=g.height-g.clientHeight-g.top)b&&1>(y=b/h)&&(l=l*y+(d.height-d.clientHeight-b)*(1-y)))}e.scrollTo(g.left,l);e.state.scrollSetAt=k;e.state.scrollSetBy=a;return!0}function P(a,b){var c=b.after;null==c&&(c=a.lastLine()+1);return{top:a.heightAtLine(b.before||0,"local"),bot:a.heightAtLine(c, "local")}}function Q(a,b,c){(a.lockScroll=b)&&0!=c&&I(a,DIFF_INSERT)&&x(a);a.lockButton.innerHTML=b?"\u21db\u21da":"\u21db  \u21da"}function G(a,b,c){for(var f=0;fc.to&&(J(a,b,f,c.marked,c.to,e.to,d),c.to=e.to))})}function J(a,b,c,f,d,e,k){function g(b,c){for(var g=Math.max(d,b),h=Math.min(e,c),l=g;lr&&(t&&g(u,r),u=p)):r==c&&(r=D(h,p,!0),h=0<(l.line-h.line||l.ch-h.ch)?l:h,p=0>(m.line-r.line||m.ch-r.ch)?m:r,h.line==p.line&&h.ch==p.ch||f.push(a.markText(h,p,{className:n})),h=r)}u<=h.line&&g(u,h.line+1)}function x(a){if(a.showDifferences){if(a.svg){C(a.svg);var b=a.gap.offsetWidth; T(a.svg,"width",b,"height",a.gap.offsetHeight)}a.copyButtons&&C(a.copyButtons);for(var c=a.edit.getViewport(),f=a.orig.getViewport(),d=a.mv.wrap.getBoundingClientRect().top,e=d-a.edit.getScrollerElement().getBoundingClientRect().top+a.edit.getScrollInfo().top,d=d-a.orig.getScrollerElement().getBoundingClientRect().top+a.orig.getScrollInfo().top,k=0;k=c.from&&g.origFrom<=f.to&&g.origTo>=f.from){var h=a,l=d,m=e,n=b,u="left"==h.type, t=h.orig.heightAtLine(g.origFrom,"local")-l;if(h.svg){var p=t,r=h.edit.heightAtLine(g.editFrom,"local")-m;if(u)var v=p,p=r,r=v;var l=h.orig.heightAtLine(g.origTo,"local")-l,q=h.edit.heightAtLine(g.editTo,"local")-m;u&&(v=l,l=q,q=v);u=" C "+n/2+" "+r+" "+n/2+" "+p+" "+(n+2)+" "+p;p=" C "+n/2+" "+l+" "+n/2+" "+q+" -1 "+q;T(h.svg.appendChild(document.createElementNS("http://www.w3.org/2000/svg","path")),"d","M -1 "+r+u+" L "+(n+2)+" "+l+p+" z","class",h.classes.connect)}h.copyButtons&&(n=h.copyButtons.appendChild(w("div", "left"==h.type?"\u21dd":"\u21dc","CodeMirror-merge-copy")),r=h.mv.options.allowEditingOriginals,n.title=r?"Push to left":"Revert chunk",n.chunk=g,n.style.top=t+"px",r&&(m=h.orig.heightAtLine(g.editFrom,"local")-m,t=h.copyButtons.appendChild(w("div","right"==h.type?"\u21dd":"\u21dc","CodeMirror-merge-copy-reverse")),t.title="Push to right",t.chunk={editFrom:g.origFrom,editTo:g.origTo,origFrom:g.editFrom,origTo:g.editTo},t.style.top=m+"px","right"==h.type?t.style.left="2px":t.style.right="2px"))}}}} function E(a,b){for(var c=0,f=0,d=0;da&&e.editFrom<=a)return null;if(e.editFrom>a)break;c=e.editTo;f=e.origTo}return f+(a-c)}function ca(a,b){for(var c=[],f=0;fd.editTo)break}-1a.lastLine()&&(b--,f=!1);var d=document.createElement("div");d.className="CodeMirror-merge-spacer";d.style.height=c+"px";d.style.minWidth="1px";return a.addLineWidget(b,d,{height:c,above:f})}function U(a,b,c,f){if(!a.diffOutOfDate){a=f.editTo>b.lastLine()?q(f.editFrom-1):q(f.editFrom,0);var d=f.origTo>c.lastLine()?q(f.origFrom- 1):q(f.origFrom,0);b.replaceRange(c.getRange(d,q(f.origTo,0)),a,q(f.editTo,0))}}function V(a){var b=a.lockButton=w("div",null,"CodeMirror-merge-scrolllock");b.title="Toggle locked scrolling";var c=w("div",[b],"CodeMirror-merge-scrolllock-wrap");n.on(b,"click",function(){Q(a,!a.lockScroll)});b=[c];!1!==a.mv.options.revertButtons&&(a.copyButtons=w("div",null,"CodeMirror-merge-copybuttons-"+a.type),n.on(a.copyButtons,"click",function(b){b=b.target||b.srcElement;b.chunk&&("CodeMirror-merge-copy-reverse"== b.className?U(a,a.orig,a.edit,b.chunk):U(a,a.edit,a.orig,b.chunk))}),b.unshift(a.copyButtons));"align"!=a.mv.options.connect&&((c=document.createElementNS&&document.createElementNS("http://www.w3.org/2000/svg","svg"))&&!c.createSVGRect&&(c=null),(a.svg=c)&&b.push(c));return a.gap=w("div",b,"CodeMirror-merge-gap")}function W(a){return"string"==typeof a?a:a.getValue()}function L(a,b){a=X.diff_main(a,b);X.diff_cleanupSemantic(a);for(b=0;bh&&(k&&b.push({origFrom:f,origTo:l,editFrom:c,editTo:h}),c=g,f=m)}else D(h==DIFF_INSERT?d:e,g[1])}(c<=d.line||f<=e.line)&&b.push({origFrom:f,origTo:e.line+1,editFrom:c,editTo:d.line+1});return b}function S(a,b){if(b==a.length-1)return!0;var c=a[b+1][1]; if(1==c.length||10!=c.charCodeAt(0))return!1;if(b==a.length-2)return!0;c=a[b+2][1];return 1b)a:{for(var k=k.chunks,h=k.length-1;0<=h;h--){var l=k[h],l=(g?l.origTo:l.editTo)-1;if(ld){g=l;break a}g=void 0}null!=g&&(null==c||(0>b?g>c:ga){var k=[{line:g,cm:d}];m.left&&k.push({line:E(g,m.left.chunks),cm:m.left.orig});m.right&&k.push({line:E(g,m.right.chunks),cm:m.right.orig});k=ga(h,k);if(m.options.onCollapse)m.options.onCollapse(m,g,h,k)}}});"align"==b.connect&&(this.aligners=[],H(this.left|| this.right,!0));var p=function(){h&&x(h);l&&x(l)};n.on(window,"resize",p);var r=setInterval(function(){for(var a=t.parentNode;a&&a!=document.body;a=a.parentNode);a||(clearInterval(r),n.off(window,"resize",p))},5E3)};F.prototype={constuctor:F,editor:function(){return this.edit},rightOriginal:function(){return this.right&&this.right.orig},leftOriginal:function(){return this.left&&this.left.orig},setShowDifferences:function(a){this.right&&this.right.setShowDifferences(a);this.left&&this.left.setShowDifferences(a)}, rightChunks:function(){if(this.right)return z(this.right),this.right.chunks},leftChunks:function(){if(this.left)return z(this.left),this.left.chunks}};var X=new diff_match_patch;n.commands.goNextDiff=function(a){return Z(a,1)};n.commands.goPrevDiff=function(a){return Z(a,-1)}}); ================================================ FILE: app/src/main/assets/code_mirror/addon/mode/loadmode.js ================================================ 'use strict';(function(b){"object"==typeof exports&&"object"==typeof module?b(require("../../lib/codemirror"),"cjs"):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],function(f){b(f,"amd")}):b(CodeMirror,"plain")})(function(b,f){function l(a,b){var c=b;return function(){0==--c&&a()}}function h(a,c){var e=b.modes[a].dependencies;if(!e)return c();a=[];for(var d=0;db?0:d.indent[b]}}k.defineSimpleMode=function(e,c){k.defineMode(e,function(d){return k.simpleMode(d,c)})};k.simpleMode=function(e,c){r(c, "start");var d={},a=c.meta||{},b=!1,g;for(g in c)if(g!=a&&c.hasOwnProperty(g))for(var h=d[g]=[],f=c[g],l=0;l=this.string.length},sol:function(){return 0==this.pos},peek:function(){return this.string.charAt(this.pos)||null},next:function(){if(this.posb},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){a=this.string.indexOf(a,this.pos);if(-1document.documentMode);if(f.appendChild){var m=d&&d.tabSize||a.defaults.tabSize,l=f,g=0;l.innerHTML="";f=function(a,d){if("\n"==a)l.appendChild(document.createTextNode(n? "\r":a)),g=0;else{for(var b="",e=0;;){var c=a.indexOf("\t",e);if(-1==c){b+=a.slice(e);g+=a.length-e;break}else{g+=c-e;b+=a.slice(e,c);e=m-g%m;g+=e;for(var f=0;fg||g>=b)return e+(b-c);e+=g-c;e+=d-e%d;c=g+1}};function StringStream(a,b){this.pos=this.start=0;this.string=a;this.tabSize=b||8;this.lineStart=this.lastColumnPos=this.lastColumnValue=0} StringStream.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.posb},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos; return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){a=this.string.indexOf(a,this.pos);if(-1r?c.charCoords(a,"local")[b?"top":"bottom"]:c.heightAtLine(l, "local")+(b?0:l.height)}!1!==a&&this.computeScale();var c=this.cm;a=this.hScale;var d=document.createDocumentFragment(),b=this.annotations,e=c.getOption("lineWrapping"),r=e&&1.5*c.defaultTextHeight(),m=null,l=null;if(c.display.barWidth)for(var g=0,n;gk+.9)break;h=b[++g];k=f(h.to,!1)*a}if(k!=p){var k=Math.max(k-p,3),q=d.appendChild(document.createElement("div"));q.style.cssText="position: absolute; right: 0px; width: "+ Math.max(c.display.barWidth-1,2)+"px; top: "+(p+this.buttonHeight)+"px; height: "+k+"px";q.className=this.options.className;h.id&&q.setAttribute("annotation-id",h.id)}}this.div.textContent="";this.div.appendChild(d)};e.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler);this.cm.off("markerAdded",this.resizeHandler);this.cm.off("markerCleared",this.resizeHandler);this.changeHandler&&this.cm.off("change",this.changeHandler);this.div.parentNode.removeChild(this.div)}}); ================================================ FILE: app/src/main/assets/code_mirror/addon/scroll/scrollpastend.js ================================================ 'use strict';(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){function e(a,b){c.changeEnd(b).line==a.lastLine()&&d(a)}function d(a){var b="";if(1b.right?1:0:a.clientYb.bottom?1:0)*d.screen)});c.on(this.node,"mousewheel",e);c.on(this.node,"DOMMouseScroll",e)}function f(a,b,c){this.addClass=a;this.horiz=new g(a,"horizontal",c);b(this.horiz.node);this.vert=new g(a,"vertical",c);b(this.vert.node);this.width=null}g.prototype.setPos=function(a,b){0>a&&(a=0);a>this.total-this.screen&&(a=this.total-this.screen);if(!b&&a==this.pos)return!1;this.pos=a;this.inner.style["horizontal"== this.orientation?"left":"top"]=this.size/this.total*a+"px";return!0};g.prototype.moveTo=function(a){this.setPos(a)&&this.scroll(a,this.orientation)};g.prototype.update=function(a,b,c){var e=this.screen!=b||this.total!=a||this.size!=c;e&&(this.screen=b,this.total=a,this.size=c);a=this.size/this.total*this.screen;10>a&&(this.size-=10-a,a=10);this.inner.style["horizontal"==this.orientation?"width":"height"]=a+"px";this.setPos(this.pos,e)};f.prototype.update=function(a){if(null==this.width){var b=window.getComputedStyle? window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;b&&(this.width=parseInt(b.height))}var b=this.width||0,c=a.scrollWidth>a.clientWidth+1,e=a.scrollHeight>a.clientHeight+1;this.vert.node.style.display=e?"block":"none";this.horiz.node.style.display=c?"block":"none";e&&(this.vert.update(a.scrollHeight,a.clientHeight,a.viewHeight-(c?b:0)),this.vert.node.style.bottom=c?b+"px":"0");c&&(this.horiz.update(a.scrollWidth,a.clientWidth,a.viewWidth-(e?b:0)-a.barLeft),this.horiz.node.style.right= e?b+"px":"0",this.horiz.node.style.left=a.barLeft+"px");return{right:e?b:0,bottom:c?b:0}};f.prototype.setScrollTop=function(a){this.vert.setPos(a)};f.prototype.setScrollLeft=function(a){this.horiz.setPos(a)};f.prototype.clear=function(){var a=this.horiz.node.parentNode;a.removeChild(this.horiz.node);a.removeChild(this.vert.node)};c.scrollbarModel.simple=function(a,b){return new f("CodeMirror-simplescroll",a,b)};c.scrollbarModel.overlay=function(a,b){return new f("CodeMirror-overlayscroll",a,b)}}); ================================================ FILE: app/src/main/assets/code_mirror/addon/search/jump-to-line.js ================================================ 'use strict';(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)})(function(e){function g(a,d,b,c,e){a.openDialog?a.openDialog(d,e,{value:c,selectValueOnOpen:!0}):e(prompt(b,c))}function f(a,d){var b=Number(d);return/^[-+]/.test(d)?a.getCursor().line+b:b-1}e.commands.jumpToLine=function(a){var d=a.getCursor();g(a,'Jump to line: (Use line:column or scroll% syntax)', "Jump to line:",d.line+1+":"+d.ch,function(b){if(b){var c;(c=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(b))?a.setCursor(f(a,c[1]),Number(c[2])):(c=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(b))?(b=Math.round(a.lineCount()*Number(c[1])/100),/^[-+]/.test(c[1])&&(b=d.line+b+1),a.setCursor(b-1,d.ch)):(c=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(b))&&a.setCursor(f(a,c[1]),d.ch)}})};e.keyMap["default"]["Alt-G"]="jumpToLine"}); ================================================ FILE: app/src/main/assets/code_mirror/addon/search/match-highlighter.js ================================================ 'use strict';(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror"),require("./matchesonscrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./matchesonscrollbar"],f):f(CodeMirror)})(function(f){function q(a){this.options={};for(var b in g)this.options[b]=(a&&a.hasOwnProperty(b)?a:g)[b];this.matchesonscroll=this.overlay=this.timeout=null;this.active=!1}function h(a){var b=a.state.matchHighlighter;(b.active||a.hasFocus())&&k(a, b)}function l(a){var b=a.state.matchHighlighter;b.active||(b.active=!0,k(a,b))}function k(a,b){clearTimeout(b.timeout);b.timeout=setTimeout(function(){m(a)},b.options.delay)}function n(a,b,d,c){var e=a.state.matchHighlighter;a.addOverlay(e.overlay=r(b,d,c));e.options.annotateScrollbar&&a.showMatchesOnScrollbar&&(e.matchesonscroll=a.showMatchesOnScrollbar(d?new RegExp("\\b"+b+"\\b"):b,!1,{className:"CodeMirror-selection-highlight-scrollbar"}))}function p(a){var b=a.state.matchHighlighter;b.overlay&& (a.removeOverlay(b.overlay),b.overlay=null,b.matchesonscroll&&(b.matchesonscroll.clear(),b.matchesonscroll=null))}function m(a){a.operation(function(){var b=a.state.matchHighlighter;p(a);if(!a.somethingSelected()&&b.options.showToken){for(var d=!0===b.options.showToken?/[\w$]/:b.options.showToken,c=a.getCursor(),e=a.getLine(c.line),f=c=c.ch;c&&d.test(e.charAt(c-1));)--c;for(;f=b.options.minChars&&n(a,d,!1,b.options.style))}})}function r(a,b,d){return{token:function(c){var e;if(e=c.match(a))(e= !b)||(e=(!c.start||!b.test(c.string.charAt(c.start-1)))&&(c.pos==c.string.length||!b.test(c.string.charAt(c.pos))));if(e)return d;c.next();c.skipTo(a.charAt(0))||c.skipToEnd()}}}var g={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};f.defineOption("highlightSelectionMatches",!1,function(a,b,d){d&&d!=f.Init&&(p(a),clearTimeout(a.state.matchHighlighter.timeout),a.state.matchHighlighter=null,a.off("cursorActivity",h),a.off("focus",l));if(b){b=a.state.matchHighlighter= new q(b);if(a.hasFocus())b.active=!0,m(a);else a.on("focus",l);a.on("cursorActivity",h)}})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/search/matchesonscrollbar.css ================================================ .CodeMirror-search-match{background:gold;border-top:1px solid orange;border-bottom:1px solid orange;-moz-box-sizing:border-box;box-sizing:border-box;opacity:.5} ================================================ FILE: app/src/main/assets/code_mirror/addon/search/matchesonscrollbar.js ================================================ 'use strict';(function(d){"object"==typeof exports&&"object"==typeof module?d(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],d):d(CodeMirror)})(function(d){function g(a,c,b,e){this.cm=a;this.options=e;var f={listenForChanges:!1},d;for(d in e)f[d]=e[d];f.className||(f.className="CodeMirror-search-match");this.annotation=a.annotateScrollbar(f); this.query=c;this.caseFold=b;this.gap={from:a.firstLine(),to:a.lastLine()+1};this.matches=[];this.update=null;this.findMatches();this.annotation.update(this.matches);var g=this;a.on("change",this.changeHandler=function(a,b){g.onChange(b)})}function h(a,c,b){return a<=c?a:Math.max(c,a+b)}d.defineExtension("showMatchesOnScrollbar",function(a,c,b){"string"==typeof b&&(b={className:b});b||(b={});return new g(this,a,c,b)});g.prototype.findMatches=function(){if(this.gap){for(var a=0;a=this.gap.to)break;c.to.line>=this.gap.from&&this.matches.splice(a--,1)}for(var b=this.cm.getSearchCursor(this.query,d.Pos(this.gap.from,0),this.caseFold),e=this.options&&this.options.maxMatches||1E3;b.findNext();){c={from:b.from(),to:b.to()};if(c.from.line>=this.gap.to)break;this.matches.splice(a++,0,c);if(this.matches.length>e)break}this.gap=null}};g.prototype.onChange=function(a){var c=a.from.line,b=d.changeEnd(a).line,e=b-a.to.line;this.gap?(this.gap.from=Math.min(h(this.gap.from, c,e),a.from.line),this.gap.to=Math.max(h(this.gap.to,c,e),a.from.line)):this.gap={from:a.from.line,to:b+1};if(e)for(a=0;ac.line&&document.querySelector&& (d=a.display.wrapper.querySelector(".CodeMirror-dialog"))&&d.getBoundingClientRect().bottom-4>a.cursorCoords(c,"window").top&&((t=d).style.opacity=.4)}))};y(a,'Search: (Use /re/ syntax for regexp search)',g,h,function(c,d){var f=b.keyName(c),e=b.keyMap[a.getOption("keyMap")][f];e||(e=a.getOption("extraKeys")[f]);if("findNext"==e||"findPrev"==e||"findPersistentNext"== e||"findPersistentPrev"==e)b.e_stop(c),p(a,k(a),d),a.execCommand(e);else if("find"==e||"findPersistent"==e)b.e_stop(c),h(d,c)});f&&g&&(p(a,d,g),q(a,c))}else r(a,'Search: (Use /re/ syntax for regexp search)',"Search for:",g,function(b){b&&!d.query&&a.operation(function(){p(a,d,b);d.posFrom=d.posTo=a.getCursor();q(a,c)})})}function q(a,c,e){a.operation(function(){var f= k(a),d=l(a,f.query,c?f.posFrom:f.posTo);if(!d.find(c)&&(d=l(a,f.query,c?b.Pos(a.lastLine()):b.Pos(a.firstLine(),0)),!d.find(c)))return;a.setSelection(d.from(),d.to());a.scrollIntoView({from:d.from(),to:d.to()},20);f.posFrom=d.from();f.posTo=d.to();e&&e(d.from(),d.to())})}function n(a){a.operation(function(){var b=k(a);if(b.lastQuery=b.query)b.query=b.queryText=null,a.removeOverlay(b.overlay),b.annotate&&(b.annotate.clear(),b.annotate=null)})}function w(a,b,e){a.operation(function(){for(var c=l(a, b);c.findNext();)if("string"!=typeof b){var d=a.getRange(c.from(),c.to()).match(b);c.replace(e.replace(/\$(\d)/g,function(a,b){return d[b]}))}else c.replace(e)})}function x(a,b){if(!a.getOption("readOnly")){var c=a.getSelection()||k(a).lastQuery,e=b?"Replace all:":"Replace:";r(a,e+' (Use /re/ syntax for regexp search)',e,c,function(c){c&&(c=v(c),r(a,'With: ', "Replace with:","",function(e){e=u(e);if(b)w(a,c,e);else{n(a);var d=l(a,c,a.getCursor("from")),f=function(){var b=d.from(),h;if(!(h=d.findNext())&&(d=l(a,c),!(h=d.findNext())||b&&d.from().line==b.line&&d.from().ch==b.ch))return;a.setSelection(d.from(),d.to());a.scrollIntoView({from:d.from(),to:d.to()});z(a,"Replace? ","Replace?",[function(){g(h)},f,function(){w(a,c,e)}])},g=function(a){d.replace("string"==typeof c? e:e.replace(/\$(\d)/g,function(b,c){return a[c]}));f()};f()}}))})}}b.commands.find=function(a){n(a);m(a)};b.commands.findPersistent=function(a){n(a);m(a,!1,!0)};b.commands.findPersistentNext=function(a){m(a,!1,!0,!0)};b.commands.findPersistentPrev=function(a){m(a,!0,!0,!0)};b.commands.findNext=m;b.commands.findPrev=function(a){m(a,!0)};b.commands.clearSearch=n;b.commands.replace=x;b.commands.replaceAll=function(a){x(a,!0)}}); ================================================ FILE: app/src/main/assets/code_mirror/addon/search/searchcursor.js ================================================ 'use strict';var $jscomp={scope:{},findInternal:function(a,e,k){a instanceof String&&(a=String(a));for(var g=a.length,b=0;bb.lastLine())&&(c=b.getLine(f.line),h=c.length-p[0].length,e(c.slice(h))==n[0])){a=g(f.line,h);f=f.line+1;for(c=1;ch)--d;else return d}}var g=a.Pos;e.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(a){function b(a){a=g(a,0);h.pos={from:a,to:a};return h.atOccurrence=!1}for(var h=this,e=this.doc.clipPos(a?this.pos.from:this.pos.to);;){if(this.pos=this.matches(a,e))return this.atOccurrence=!0,this.pos.match||!0;if(a){if(!e.line)return b(0);e=g(e.line-1,this.doc.getLine(e.line- 1).length)}else{var k=this.doc.lineCount();if(e.line==k-1)return b(k);e=g(e.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(b,d){this.atOccurrence&&(b=a.splitLines(b),this.doc.replaceRange(b,this.pos.from,this.pos.to,d),this.pos.to=g(this.pos.from.line+b.length-1,b[b.length-1].length+(1==b.length?this.pos.from.ch:0)))}};a.defineExtension("getSearchCursor",function(a,d,h){return new e(this.doc,a,d,h)}); a.defineDocExtension("getSearchCursor",function(a,d,h){return new e(this,a,d,h)});a.defineExtension("selectMatches",function(b,d){var e=[];for(b=this.getSearchCursor(b,this.getCursor("from"),d);b.findNext()&&!(0=f.line,h=p?f:q(g,0),d=b.markText(d,h, {className:e});null==c?n.push(d):n.splice(c++,0,d);if(p)break}}function g(b){b=b.state.markedSelection;for(var a=0;a=l(f,d.from))return h(a);for(;0l(b,d.from)&&(d.to.line-b.linel(f,k.to);)c.pop().clear(),k=c[c.length-1].find();0=a.mouseX&&c.top<=a.mouseY&&c.bottom>=a.mouseY&&(d=!0)}a=d?a.value:"";b.display.lineDiv.style.cursor!=a&&(b.display.lineDiv.style.cursor=a)}b.state.selectionPointer.willUpdate=!1},50))}c.defineOption("selectionPointer",!1,function(b,a){var d=b.state.selectionPointer;d&&(c.off(b.getWrapperElement(),"mousemove",d.mousemove),c.off(b.getWrapperElement(), "mouseout",d.mouseout),c.off(window,"scroll",d.windowScroll),b.off("cursorActivity",e),b.off("scroll",e),b.state.selectionPointer=null,b.display.lineDiv.style.cursor="");a&&(d=b.state.selectionPointer={value:"string"==typeof a?a:"default",mousemove:function(a){var c=b.state.selectionPointer;(null==a.buttons?a.which:a.buttons)?c.mouseX=c.mouseY=null:(c.mouseX=a.clientX,c.mouseY=a.clientY);f(b)},mouseout:function(a){b.getWrapperElement().contains(a.relatedTarget)||(a=b.state.selectionPointer,a.mouseX= a.mouseY=null,f(b))},windowScroll:function(){e(b)},rects:null,mouseX:null,mouseY:null,willUpdate:!1},c.on(b.getWrapperElement(),"mousemove",d.mousemove),c.on(b.getWrapperElement(),"mouseout",d.mouseout),c.on(window,"scroll",d.windowScroll),b.on("cursorActivity",e),b.on("scroll",e))})}); ================================================ FILE: app/src/main/assets/code_mirror/addon/tern/tern.css ================================================ .CodeMirror-Tern-completion{padding-left:22px;position:relative;line-height:1.5}.CodeMirror-Tern-completion:before{position:absolute;left:2px;bottom:2px;border-radius:50%;font-size:12px;font-weight:700;height:15px;width:15px;line-height:16px;text-align:center;color:#fff;-moz-box-sizing:border-box;box-sizing:border-box}.CodeMirror-Tern-completion-unknown:before{content:"?";background:#4bb}.CodeMirror-Tern-completion-object:before{content:"O";background:#77c}.CodeMirror-Tern-completion-fn:before{content:"F";background:#7c7}.CodeMirror-Tern-completion-array:before{content:"A";background:#c66}.CodeMirror-Tern-completion-number:before{content:"1";background:#999}.CodeMirror-Tern-completion-string:before{content:"S";background:#999}.CodeMirror-Tern-completion-bool:before{content:"B";background:#999}.CodeMirror-Tern-completion-guess{color:#999}.CodeMirror-Tern-tooltip{border:1px solid silver;border-radius:3px;color:#444;padding:2px 5px;font-size:90%;font-family:monospace;background-color:#fff;white-space:pre-wrap;max-width:40em;position:absolute;z-index:10;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);transition:opacity 1s;-moz-transition:opacity 1s;-webkit-transition:opacity 1s;-o-transition:opacity 1s;-ms-transition:opacity 1s}.CodeMirror-Tern-hint-doc{max-width:25em;margin-top:-3px}.CodeMirror-Tern-fname{color:#000}.CodeMirror-Tern-farg{color:#70a}.CodeMirror-Tern-farg-current{text-decoration:underline}.CodeMirror-Tern-type{color:#07c}.CodeMirror-Tern-fhint-guess{opacity:.7} ================================================ FILE: app/src/main/assets/code_mirror/addon/tern/tern.js ================================================ 'use strict';(function(h){"object"==typeof exports&&"object"==typeof module?h(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],h):h(CodeMirror)})(function(h){function B(a,c,b){var d=a.docs[c];d?b(x(a,d)):a.options.getFile?a.options.getFile(c,b):b(null)}function u(a,c,b){for(var d in a.docs){var e=a.docs[d];if(e.doc==c)return e}if(!b)for(b=0;;++b)if(d="[doc"+(b||"")+"]",!a.docs[d]){b=d;break}return a.addDoc(b,c)}function C(a,c){if("string"==typeof c)return a.docs[c]; c instanceof h&&(c=c.getDoc());if(c instanceof h.Doc)return u(a,c)}function L(a,c,b){var d=u(a,c),e=a.cachedArgHints;e&&e.doc==c&&0<=y(e.start,b.to)&&(a.cachedArgHints=null);e=d.changed;null==e&&(d.changed=e={from:b.from.line,to:b.from.line});var f=b.from.line+(b.text.length-1);b.from.line=e.to&&(e.to=f+1);e.from>b.from.line&&(e.from=b.from.line);c.lineCount()>D&&100=v;--g){for(var l=c.getLine(g),r=d=0;;){r=l.indexOf("\t",r);if(-1==r)break;d+=f-(r+d)%f-1;r+=1}d=b.column-d;if("("==l.charAt(d)){n=!0;break}}if(n){var m=q(g,d);if((b=a.cachedArgHints)&&b.doc==c.getDoc()&&0==y(m,b.start))return H(a,c,e);a.request(c,{type:"type",preferFunction:!0,end:m},function(b,d){!b&&d.type&&/^fn\(/.test(d.type)&& (a.cachedArgHints={start:m,type:P(d.type),name:d.exprName||d.name||"fn",guess:d.guess,doc:c.getDoc()},H(a,c,e))})}}}}function H(a,c,b){z(a);for(var d=a.cachedArgHints,e=d.type,d=p("span",d.guess?k+"fhint-guess":null,p("span",k+"fname",d.name),"("),f=0;f\u00a0":")"));e.rettype&&d.appendChild(p("span",k+"type",e.rettype));c=c.cursorCoords(null,"page");a.activeArgHints=A(c.right+1,c.bottom,d)}function P(a){function c(c){for(var b=0,e=d;;){var f=a.charAt(d);if(c.test(f)&&!b)return a.slice(e,d);/[{\[\(]/.test(f)?++b:/[}\]\)]/.test(f)&&--b;++d}}var b=[],d=3;if(")"!=a.charAt(d))for(;;){var e=a.slice(d).match(/^([^, \(\[\{]+): /);e&&(d+=e[0].length,e=e[1]);b.push({name:e,type:c(/[\),]/)}); if(")"==a.charAt(d))break;d+=2}e=a.slice(d).match(/^\) -> (.*)$/);return{args:b,rettype:e&&e[1]}}function Q(a,c){function b(b){b={type:"definition",variable:b||null};var d=u(a,c.getDoc());a.server.request(I(a,d,b),function(b,e){if(b)return t(a,c,b);if(!e.file&&e.url)window.open(e.url);else{if(e.file){b=a.docs[e.file];var f,g;if(g=b){var l;var h=b.doc;f=e.context.slice(0,e.contextOffset).split("\n");var m=e.start.line-(f.length-1);g=q(m,(1==f.length?e.start.ch:h.getLine(m).length)-f[0].length);for(var k= h.getLine(m).slice(g.ch),m=m+1;m=y(g,n.end)&&(f=d.length-1))}c.setSelections(d,f)})}function T(a,c){for(var b=Object.create(null),d=0;dD&&!1!==f&&100>c.changed.to-c.changed.from&&c.changed.from<=d.line&&c.changed.to>b.end.line?(e.push(W(c,d,b.end)),b.file="#0",f=e[0].offsetLines,null!=b.start&&(b.start=q(b.start.line- -f,b.start.ch)),b.end=q(b.end.line-f,b.end.ch)):(e.push({type:"full",name:c.name,text:x(a,c)}),b.file=c.name,c.changed=null):b.file=c.name;for(var g in a.docs)f=a.docs[g],f.changed&&f!= c&&(e.push({type:"full",name:f.name,text:x(a,f)}),f.changed=null);return{query:b,files:e}}function W(a,c,b){for(var d=a.doc,e=null,f=null,g=c.line-1,k=Math.max(0,g-50);g>=k;--g){var n=d.getLine(g);0>n.search(/\bfunction\b/)||(n=h.countColumn(n,null,4),null!=e&&e<=n||(e=n,f=g))}null==f&&(f=k);g=Math.min(d.lastLine(),b.line+20);if(null==e||e==h.countColumn(d.getLine(c.line),null,4))c=g;else for(c=b.line+1;c",b):b(prompt(c,""))}function G(a,c,b){function d(){a.state.ternTooltip=null;f.parentNode&&(a.off("cursorActivity",d),a.off("blur",d),a.off("scroll",d),X(f))}a.state.ternTooltip&&w(a.state.ternTooltip); var e=a.cursorCoords(),f=a.state.ternTooltip=A(e.right+1,e.bottom,c),g=!1,k=!1;h.on(f,"mousemove",function(){g=!0});h.on(f,"mouseout",function(a){h.contains(f,a.relatedTarget||a.toElement)||(k?d():g=!1)});setTimeout(function(){k=!0;g||d()},b.options.hintDelay?b.options.hintDelay:1700);a.on("cursorActivity",d);a.on("blur",d);a.on("scroll",d)}function A(a,c,b){b=p("div",k+"tooltip",b);b.style.left=a+"px";b.style.top=c+"px";document.body.appendChild(b);return b}function w(a){var c=a&&a.parentNode;c&& c.removeChild(a)}function X(a){a.style.opacity="0";setTimeout(function(){w(a)},1100)}function t(a,c,b){a.options.showError?a.options.showError(c,b):G(c,String(b),a)}function z(a){a.activeArgHints&&(w(a.activeArgHints),a.activeArgHints=null)}function x(a,c){var b=c.doc.getValue();a.options.fileFilter&&(b=a.options.fileFilter(b,c.name,c.doc));return b}function Y(a){function c(a,c){c&&(a.id=++d,e[d]=c);b.postMessage(a)}var b=a.worker=new Worker(a.options.workerScript);b.postMessage({type:"init",defs:a.options.defs, plugins:a.options.plugins,scripts:a.options.workerDeps});var d=0,e={};b.onmessage=function(b){var d=b.data;"getFile"==d.type?B(a,d.name,function(a,b){c({type:"getFile",err:String(a),text:b,id:d.id})}):"debug"==d.type?window.console.log(d.message):d.id&&e[d.id]&&(e[d.id](d.err,d.body),delete e[d.id])};b.onerror=function(a){for(var b in e)e[b](a);e={}};this.addFile=function(a,b){c({type:"add",name:a,text:b})};this.delFile=function(a){c({type:"del",name:a})};this.request=function(a,b){c({type:"req", body:a},b)}}h.TernServer=function(a){var c=this;this.options=a||{};a=this.options.plugins||(this.options.plugins={});a.doc_comment||(a.doc_comment=!0);this.docs=Object.create(null);this.server=this.options.useWorker?new Y(this):new tern.Server({getFile:function(a,d){return B(c,a,d)},async:!0,defs:this.options.defs||[],plugins:a});this.trackChange=function(a,d){L(c,a,d)};this.activeArgHints=this.cachedArgHints=null;this.jumpStack=[];this.getHint=function(a,d){return M(c,a,d)};this.getHint.async=!0}; h.TernServer.prototype={addDoc:function(a,c){var b={doc:c,name:a,changed:null};this.server.addFile(a,x(this,b));h.on(c,"change",this.trackChange);return this.docs[a]=b},delDoc:function(a){if(a=C(this,a))h.off(a.doc,"change",this.trackChange),delete this.docs[a.name],this.server.delFile(a.name)},hideDoc:function(a){z(this);(a=C(this,a))&&a.changed&&E(this,a)},complete:function(a){a.showHint({hint:this.getHint})},showType:function(a,c,b){F(this,a,c,"type",b)},showDocs:function(a,c,b){F(this,a,c,"documentation", b)},updateArgHints:function(a){O(this,a)},jumpToDef:function(a){Q(this,a)},jumpBack:function(a){var c=this.jumpStack.pop(),b=c&&this.docs[c.file];b&&J(this,u(this,a.getDoc()),b,c.start,c.end)},rename:function(a){S(this,a)},selectName:function(a){U(this,a)},request:function(a,c,b,d){var e=this,f=u(this,a.getDoc()),g=I(this,f,c,d);if(a=g.query&&this.options.queryOptions&&this.options.queryOptions[g.query.type])for(var h in a)g.query[h]=a[h];this.server.request(g,function(a,d){!a&&e.options.responseFilter&& (d=e.options.responseFilter(f,c,g,a,d));b(a,d)})},destroy:function(){z(this);this.worker&&(this.worker.terminate(),this.worker=null)}};var q=h.Pos,k="CodeMirror-Tern-",D=250,V=0,y=h.cmpPos}); ================================================ FILE: app/src/main/assets/code_mirror/addon/tern/worker.js ================================================ 'use strict';var server;this.onmessage=function(b){var a=b.data;switch(a.type){case "init":return startServer(a.defs,a.plugins,a.scripts);case "add":return server.addFile(a.name,a.text);case "del":return server.delFile(a.name);case "req":return server.request(a.body,function(b,d){postMessage({id:a.id,body:d,err:b&&String(b)})});case "getFile":return b=pending[a.id],delete pending[a.id],b(a.err,a.text);default:throw Error("Unknown message type: "+a.type);}};var nextId=0,pending={}; function getFile(b,a){postMessage({type:"getFile",name:b,id:++nextId});pending[nextId]=a}function startServer(b,a,c){c&&importScripts.apply(null,c);server=new tern.Server({getFile:getFile,async:!0,defs:b,plugins:a})}this.console={log:function(b){postMessage({type:"debug",message:b})}}; ================================================ FILE: app/src/main/assets/code_mirror/addon/wrap/hardwrap.js ================================================ 'use strict';(function(k){"object"==typeof exports&&"object"==typeof module?k(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],k):k(CodeMirror)})(function(k){function p(c,a,b){for(var e=b.paragraphStart||c.getHelper(a,"paragraphStart"),d=a.line,f=c.firstLine();d>f;--d){var g=c.getLine(d);if(e&&e.test(g))break;if(!/\S/.test(g)){++d;break}}b=b.paragraphEnd||c.getHelper(a,"paragraphEnd");a=a.line+1;for(e=c.lastLine();a<=e;++a){g=c.getLine(a);if(b&& b.test(g)){++a;break}if(!/\S/.test(g))break}return{from:d,to:a}}function v(c,a,b,e){for(var d=a;dd&&b==t&&v(h,d,f,e);u&&u.from==n&&u.to==n+p?(h=b+l,++q):g.push({text:[p?" ":""],from:m(q,n),to:m(q+1,t.length)})}for(;h.length>d;)l=v(h,d,f,e),g.push({text:["",b],from:m(q,l.from),to:m(q,l.to)}),h=b+h.slice(l.to),++q}g.length&&c.operation(function(){for(var b=0;b=d||(d=a.line,n(c,a,b,{}))})}; k.defineExtension("wrapRange",function(c,a,b){return n(this,c,a,b||{})});k.defineExtension("wrapParagraphsInRange",function(c,a,b){b=b||{};var e=this,d=[];for(c=c.line;c<=a.line;)c=p(e,m(c,0),b),d.push(c),c=c.to;var f=!1;d.length&&e.operation(function(){for(var a=d.length-1;0<=a;--a)f=f||n(e,m(d[a].from,0),m(d[a].to-1),b)});return f})}); ================================================ FILE: app/src/main/assets/code_mirror/lib/codemirror.css ================================================ .CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:none;font-variant-ligatures:none}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0} ================================================ FILE: app/src/main/assets/code_mirror/lib/codemirror.js ================================================ 'use strict';var $jscomp={scope:{},findInternal:function(l,aa,I){l instanceof String&&(l=String(l));for(var S=l.length,ba=0;baA&&setTimeout(function(){e.display.input.reset(!0)},20);Bf(this);Hd||(Cf(),Hd=!0);Ra(this);this.curOp.forceUpdate=!0;Id(this,c);b.autofocus&&!ib||e.hasFocus()?setTimeout(Ec(Fc, this),20):jb(this);for(var f in Sa)if(Sa.hasOwnProperty(f))Sa[f](this,b[f],Jd);Kd(this);b.finishInit&&b.finishInit(this);for(c=0;cA&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0);M||va&&ib||(this.scroller.draggable=!0);a&&(a.appendChild?a.appendChild(this.wrapper):a(this.wrapper));this.reportedViewFrom=this.reportedViewTo=this.viewFrom=this.viewTo=b.first;this.view=[];this.externalMeasured=this.renderedView=null;this.lastWrapHeight=this.lastWrapWidth=this.viewOffset=0;this.updateLineNumbers=null;this.nativeBarWidth=this.barHeight=this.barWidth=0;this.scrollbarsClipped=!1;this.lineNumWidth=this.lineNumInnerWidth= this.lineNumChars=null;this.alignWidgets=!1;this.maxLine=this.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH=null;this.maxLineLength=0;this.maxLineChanged=!1;this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null;this.shift=!1;this.activeTouch=this.selForContextMenu=null;c.init(this)}function I(a){a.doc.mode=l.getMode(a.options,a.doc.modeOption);S(a)}function S(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null)});a.doc.frontier=a.doc.first;kb(a, 100);a.state.modeGen++;a.curOp&&P(a)}function ba(a){var b=Ca(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/lb(a.display)-3);return function(e){if(Da(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;gb.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function Dc(a){var b=N(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters= a.gutters.concat(["CodeMirror-linenumbers"]):-1A&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function Mc(){}function Gd(a){a.display.scrollbars&& (a.display.scrollbars.clear(),a.display.scrollbars.addClass&&pb(a.display.wrapper,a.display.scrollbars.addClass));a.display.scrollbars=new l.scrollbarModel[a.options.scrollbarStyle](function(b){a.display.wrapper.insertBefore(b,a.display.scrollbarFiller);y(b,"mousedown",function(){a.state.focused&&setTimeout(function(){a.display.input.focus()},0)});b.setAttribute("cm-not-content","true")},function(b,c){"horizontal"==c?Ua(a,b):qb(a,b)},a);a.display.scrollbars.addClass&&rb(a.display.wrapper,a.display.scrollbars.addClass)} function Va(a,b){b||(b=ob(a));var c=a.display.barWidth,d=a.display.barHeight;Md(a,b);for(b=0;4>b&&c!=a.display.barWidth||d!=a.display.barHeight;b++)c!=a.display.barWidth&&a.options.lineWrapping&&Qb(a),Md(a,ob(a)),c=a.display.barWidth,d=a.display.barHeight}function Md(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px";c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px";c.heightForcer.style.borderBottom=d.bottom+"px solid transparent";d.right&&d.bottom? (c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="";d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+"px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function Nc(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop,d=Math.floor(d-a.lineSpace.offsetTop), e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,d=Fa(b,d),e=Fa(b,e);if(c&&c.ensure){var f=c.ensure.from.line;c=c.ensure.to.line;f=e&&(d=Fa(b,la(w(b,c))-a.wrapper.clientHeight),e=c)}return{from:d,to:Math.max(e,d+1)}}function Hc(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=Oc(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==Nd(a))return!1;Kd(a)&&(xa(a),b.dims=Qc(a));var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin, d.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFromf-c.viewFrom&&(f=Math.max(d.first,c.viewFrom));c.viewTo>g&&20>c.viewTo-g&&(g=Math.min(e,c.viewTo));ya&&(f=Sc(a.doc,f),g=Od(a.doc,g));d=f!=c.viewFrom||g!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight||c.lastWrapWidth!=b.wrapperWidth;e=a.display;0==e.view.length||f>=e.viewTo||g<=e.viewFrom?(e.view=Sb(a,f,g),e.viewFrom=f):(e.viewFrom>f?e.view=Sb(a,f,e.viewFrom).concat(e.view):e.viewFromg&&(e.view=e.view.slice(0,Ha(a,g))));e.viewTo=g;c.viewOffset=la(w(a.doc,c.viewFrom));a.display.mover.style.top=c.viewOffset+"px";g=Nd(a);if(!d&&0==g&&!b.force&&c.renderedView==c.view&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;f=ma();4=a.display.viewFrom&&b.visible.to<=a.display.viewTo)break;if(!Rc(a,b))break;Qb(a);d=ob(a); sb(a);Va(a,d);Uc(a,d)}b.signal(a,"update",a);if(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo}function Vc(a,b){b=new Rb(a,b);if(Rc(a,b)){Qb(a);Pd(a,b);var c=ob(a);sb(a);Va(a,c);Uc(a,c);b.finish()}}function Uc(a,b){a.display.sizer.style.minHeight=b.docHeight+"px";a.display.heightForcer.style.top=b.docHeight+ "px";a.display.gutters.style.height=b.docHeight+a.display.barHeight+ka(a)+"px"}function Qb(a){a=a.display;for(var b=a.lineDiv.offsetTop,c=0;cA){var f=d.node.offsetTop+d.node.offsetHeight;e=f-b;b=f}else e=d.node.getBoundingClientRect(),e=e.bottom-e.top;f=d.line.height-e;2>e&&(e=Ca(a));if(.001f)if(ja(d.line,e),Qd(d.line),d.rest)for(e=0;eA&&(a.node.style.zIndex=2));return a.node}function Sd(a,b){var c=a.display.externalMeasured;return c&&c.line==b.line?(a.display.externalMeasured=null,b.measure=c.measure,c.built):Vd(a,b)}function Wc(a){var b=a.bgClass?a.bgClass+" "+(a.line.bgClass||""):a.line.bgClass; b&&(b+=" CodeMirror-linebackground");if(a.background)b?a.background.className=b:(a.background.parentNode.removeChild(a.background),a.background=null);else if(b){var c=tb(a);a.background=c.insertBefore(r("div",null,b),c.firstChild)}a.line.wrapClass?tb(a).className=a.line.wrapClass:a.node!=a.text&&(a.node.className="");a.text.className=(a.textClass?a.textClass+" "+(a.line.textClass||""):a.line.textClass)||""}function Td(a,b,c,d){b.gutter&&(b.node.removeChild(b.gutter),b.gutter=null);b.gutterBackground&& (b.node.removeChild(b.gutterBackground),b.gutterBackground=null);if(b.line.gutterClass){var e=tb(b);b.gutterBackground=r("div",null,"CodeMirror-gutter-background "+b.line.gutterClass,"left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+"px; width: "+d.gutterTotalWidth+"px");e.insertBefore(b.gutterBackground,b.text)}var f=b.line.gutterMarkers;if(a.options.lineNumbers||f){var e=tb(b),g=b.gutter=r("div",null,"CodeMirror-gutter-wrapper","left: "+(a.options.fixedGutter?d.fixedPos:-d.gutterTotalWidth)+ "px");a.display.input.setUneditable(g);e.insertBefore(g,b.text);b.line.gutterClass&&(g.className+=" "+b.line.gutterClass);!a.options.lineNumbers||f&&f["CodeMirror-linenumbers"]||(b.lineNumber=g.appendChild(r("div",Pc(a.options,c),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+d.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+a.display.lineNumInnerWidth+"px")));if(f)for(b=0;bt(a,b)?b:a}function Ub(a,b){return 0>t(a,b)?a:b}function Xd(a){a.state.focused||(a.display.input.focus(),Fc(a))}function Vb(a,b,c,d,e){var f=a.doc;a.display.shift=!1;d||(d=f.sel);var g=a.state.pasteIncoming||"paste"==e,h=f.splitLines(b),k=null;if(g&&1e?k.map:m[e],g=0;ge?a.line:a.rest[e]);e=f[g]+d;if(0>d||h!=b)e=f[g+(d?1:0)];return q(c,e)}}}var e=a.text.firstChild,f=!1;if(!b||!ad(e, b))return Ya(q(F(a.line),0),!0);if(b==e&&(f=!0,b=e.childNodes[c],c=0,!b))return c=a.rest?C(a.rest):a.line,Ya(q(F(c),c.text.length),f);var g=3==b.nodeType?b:null,h=b;g||1!=b.childNodes.length||3!=b.firstChild.nodeType||(g=b.firstChild,c&&(c=g.nodeValue.length));for(;h.parentNode!=e;)h=h.parentNode;var k=a.measure,m=k.maps;if(b=d(g,h,c))return Ya(b,f);e=h.nextSibling;for(g=g?g.nodeValue.length-c:0;e;e=e.nextSibling){if(b=d(e,e.firstChild,0))return Ya(q(b.line,b.ch-g),f);g+=e.textContent.length}h=h.previousSibling; for(g=c;h;h=h.previousSibling){if(b=d(h,h.firstChild,-1))return Ya(q(b.line,b.ch+g),f);g+=h.textContent.length}}function Gf(a,b,c,d,e){function f(a){return function(b){return b.id==a}}function g(b){if(1==b.nodeType){var c=b.getAttribute("cm-text");if(null!=c)""==c&&(c=b.textContent.replace(/\u200b/g,"")),h+=c;else{var c=b.getAttribute("cm-marker"),p;if(c)b=a.findMarks(q(d,0),q(e+1,0),f(+c)),b.length&&(p=b[0].find())&&(h+=Ia(a.doc,p.from,p.to).join(m));else if("false"!=b.getAttribute("contenteditable")){for(p= 0;pc)return q(c,w(a,c).text.length);a=w(a,b.line).text.length;c=b.ch;b=null==c||c>a?q(b.line,a):0>c?q(b.line,0):b;return b}function wb(a,b){return b>=a.first&&bt(c,a),b!=0>t(d,a)?(a=c,c=d):b!=0>t(c,d)&&(c=d)),new G(a,c)):new G(d||c,c)}function Zb(a,b,c,d){E(a,new ra([xb(a,a.sel.primary(),b,c)],0),d)}function ge(a,b,c){for(var d=[],e=0;et(b.primary().head, a.sel.primary().head)?-1:1);je(a,ke(a,b,d,!0));c&&!1===c.scroll||!a.cm||Xa(a.cm)}function je(a,b){b.equals(a.sel)||(a.sel=b,a.cm&&(a.cm.curOp.updateInput=a.cm.curOp.selectionChanged=!0,le(a.cm)),V(a,"cursorActivity",a))}function me(a){je(a,ke(a,a.sel,null,!1),oa)}function ke(a,b,c,d){for(var e,f=0;f=b.ch:h.to>b.ch))){if(e&&(L(k,"beforeCursorEnter"),k.explicitlyCleared))if(f.markedSpans){--g;continue}else break;if(k.atomic){if(c){var g=k.find(0>d?1:-1),m;if(0>d?k.inclusiveRight:k.inclusiveLeft)g=ne(a,g,-d,g&&g.line== b.line?f:null);if(g&&g.line==b.line&&(m=t(g,c))&&(0>d?0>m:0d?-1:1);if(0>d?k.inclusiveLeft:k.inclusiveRight)c=ne(a,c,d,c.line==b.line?f:null);return c?Za(a,c,b,d,e):null}}}return b}function cd(a,b,c,d,e){d=d||1;b=Za(a,b,c,d,e)||!e&&Za(a,b,c,d,!0)||Za(a,b,c,-d,e)||!e&&Za(a,b,c,-d,!0);return b?b:(a.cantEdit=!0,q(a.first,0))}function ne(a,b,c,d){return 0>c&&0==b.ch?b.line>a.first?z(a,q(b.line-1)):null:0=a.display.viewTo||h.to().lineb&&(b=0);b=Math.round(b);d=Math.round(d);h.appendChild(r("div",null,"CodeMirror-selected","position: absolute; left: "+a+"px; top: "+b+"px; width: "+(null==c?p-a:c)+"px; height: "+(d-b)+"px"))}function e(b,c,e){var f=w(g,b),h=f.text.length,k,n;Jf(fa(f),c||0,null==e?h:e,function(g,u,l){var K=bc(a,q(b,g),"div",f,"left"),v,r;g==u?(v=K,l=r=K.left):(v=bc(a,q(b,u-1),"div",f,"right"),"rtl"==l&&(l=K,K=v,v=l),l=K.left,r=v.right);null==c&&0==g&&(l=m);3n.bottom||v.bottom==n.bottom&&v.right>n.right)n=v;la.options.cursorBlinkRate&& (b.cursorDiv.style.visibility="hidden")}}function kb(a,b){a.doc.mode.startState&&a.doc.frontier=a.display.viewTo)){var c=+new Date+a.options.workTime,d=za(b.mode,yb(a,b.frontier)),e=[];b.iter(b.frontier,Math.min(b.first+b.size,a.display.viewTo+500),function(f){if(b.frontier>=a.display.viewFrom){var g=f.styles,h=f.text.length>a.options.maxHighlightLength,k=re(a,f, h?za(b.mode,d):d,!0);f.styles=k.styles;var m=f.styleClasses;(k=k.classes)?f.styleClasses=k:m&&(f.styleClasses=null);m=!g||g.length!=f.styles.length||m!=k&&(!m||!k||m.bgClass!=k.bgClass||m.textClass!=k.textClass);for(k=0;!m&&kc)return kb(a,a.options.workDelay),!0});e.length&&X(a, function(){for(var b=0;bg;--b){if(b<=f.first)return f.first;var h=w(f,b-1);if(h.stateAfter&&(!c||b<=f.frontier))return b;h=ha(h.text,null,a.options.tabSize);if(null==e||d>h)e=b-1,d=h}return e}function yb(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=Lf(a,b,c),g=f>d.first&&w(d,f-1).stateAfter,g=g?za(d.mode,g):Mf(d.mode);d.iter(f,b,function(c){ed(a,c.text,g);c.stateAfter= f==b-1||0==f%5||f>=e.viewFrom&&fc)return{map:a.measure.maps[d],cache:a.measure.caches[d],before:!0}}function $c(a,b){if(b>=a.display.viewFrom&&b=a.lineN&&b l;l++){for(;h&&zb(b.line.text.charAt(g.coverStart+h));)--h;for(;g.coverStart+kA&&0==h&&k==g.coverEnd-g.coverStart)n=d.parentNode.getBoundingClientRect();else{n=$a(d,h,k).getClientRects();k=te;if("left"==p)for(m=0;mA&&((l=!window.screen||null==screen.logicalXDPI||screen.logicalXDPI== screen.deviceXDPI)||(null!=fd?l=fd:(p=Y(a.display.measure,r("span","x")),l=p.getBoundingClientRect(),p=$a(p,0,1).getBoundingClientRect(),l=fd=1A)||h||n&&(n.left||n.right)||(n=(n=d.parentNode.getClientRects()[0])? {left:n.left,right:n.left+lb(a.display),top:n.top,bottom:n.bottom}:te);d=n.top-b.rect.top;h=n.bottom-b.rect.top;p=(d+h)/2;g=b.view.measure.heights;for(l=0;lb)f=m-k,e=f-1,b>=m&&(g="right");if(null!=e){d=a[h+2];k==m&&c==(d.insertLeft?"left":"right")&&(g=c);if("left"==c&&0==e)for(;h&&a[h-2]==a[h-3]&&a[h-1].insertLeft;)d=a[(h-=3)+2],g="left";if("right"==c&&e==m-k)for(;hc.from?g(a-1):g(a,d)}d=d||w(a.doc,b.line);e||(e=cc(a,d));var k=fa(d);b=b.ch;if(!k)return g(b);var m=Xb(k,b),m=h(b,m);null!=Bb&&(m.other=h(b,Bb));return m}function xe(a, b){var c=0;b=z(a.doc,b);a.options.lineWrapping||(c=lb(a.display)*b.ch);b=w(a.doc,b.line);a=la(b)+a.display.lineSpace.offsetTop;return{left:c,right:c,top:a,bottom:a+b.height}}function ec(a,b,c,d){a=q(a,b);a.xRel=d;c&&(a.outside=!0);return a}function jd(a,b,c){var d=a.doc;c+=a.display.viewOffset;if(0>c)return ec(d.first,0,!0,-1);var e=Fa(d,c),f=d.first+d.size-1;if(e>f)return ec(d.first+d.size-1,w(d,f).text.length,!0,1);0>b&&(b=0);for(d=w(d,e);;)if(e=Nf(a,d,e,b,c),f=(d=Ea(d,!1))&&d.find(0,!0),d&&(e.ch> f.from.ch||e.ch==f.from.ch&&0d.bottom)return d.left-k;if(gr)return ec(c,n,w,1);for(;;){if(e?n==u||n==kd(b,u,1):1>=n-u){p=d=e.top&&Math.abs(d-e.right)u?-1:1d){n=x;r=t;if(w=h)r+=1E3;p=y}else u=x,l=t,v=h,p-=y}}function Ca(a){if(null!=a.cachedTextHeight)return a.cachedTextHeight;if(null==Ja){Ja=r("pre");for(var b=0;49>b;++b)Ja.appendChild(document.createTextNode("x")),Ja.appendChild(r("br")); Ja.appendChild(document.createTextNode("x"))}Y(a.measure,Ja);b=Ja.offsetHeight/50;3=d.viewTo)||d.maxLineChanged&&c.options.lineWrapping;e.update=e.mustUpdate&&new Rb(c,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}for(b=0;bm;m++){var p=!1,u=sa(c,h),n=g&&g!=h?sa(c,g):u,n=hc(c,Math.min(u.left,n.left),Math.min(u.top,n.top)-k,Math.max(u.left,n.left),Math.max(u.bottom,n.bottom)+k),l=c.doc.scrollTop,q=c.doc.scrollLeft;null!=n.scrollTop&&(qb(c,n.scrollTop),1g.top+m.top?h=!0:g.bottom+m.top>(window.innerHeight||document.documentElement.clientHeight)&&(h=!1),null==h||Pf||(g=r("div","\u200b",null,"position: absolute; top: "+(g.top-k.viewOffset-c.display.lineSpace.offsetTop)+"px; height: "+(g.bottom-g.top+ka(c)+k.barHeight)+"px; left: "+g.left+"px; width: 2px;"),c.display.lineSpace.appendChild(g),g.scrollIntoView(h), c.display.lineSpace.removeChild(g))))}h=e.maybeHiddenMarkers;g=e.maybeUnhiddenMarkers;if(h)for(k=0;kb)&&(e.updateLineNumbers=b);a.curOp.viewChanged=!0;if(b>=e.viewTo)ya&&Sc(a.doc,b)e.viewFrom?xa(a):(e.viewFrom+=d,e.viewTo+=d);else if(b<=e.viewFrom&&c>=e.viewTo)xa(a); else if(b<=e.viewFrom){var f=ic(a,c,c+d,1);f?(e.view=e.view.slice(f.index),e.viewFrom=f.lineN,e.viewTo+=d):xa(a)}else if(c>=e.viewTo)(f=ic(a,b,b,-1))?(e.view=e.view.slice(0,f.index),e.viewTo=f.lineN):xa(a);else{var f=ic(a,b,b,-1),g=ic(a,c,c+d,1);f&&g?(e.view=e.view.slice(0,f.index).concat(Sb(a,f.lineN,g.lineN)).concat(e.view.slice(g.index)),e.viewTo+=d):xa(a)}if(a=e.externalMeasured)c=e.lineN&&b=d.viewTo||(a=d.view[Ha(a,b)],null!=a.node&&(a=a.changes||(a.changes=[]),-1==N(a,c)&&a.push(c)))}function xa(a){a.display.viewFrom=a.display.viewTo=a.doc.first;a.display.view=[];a.display.viewOffset=0}function Ha(a,b){if(b>=a.display.viewTo)return null;b-=a.display.viewFrom;if(0>b)return null;a=a.display.view;for(var c=0;cb)return c}function ic(a,b,c,d){var e=Ha(a, b),f=a.display.view;if(!ya||c==a.doc.first+a.doc.size)return{index:e,lineN:c};for(var g=0,h=a.display.viewFrom;gd?0:f.length-1))return null;c+=d*f[e-(0>d?1:0)].size;e+=d}return{index:e,lineN:c}}function Nd(a){a=a.display.view;for(var b=0,c=0;cA?y(d.scroller,"dblclick",H(a,function(b){if(!D(a,b)){var c=Ka(a,b);!c||ld(a,b,"gutterClick",!0)||ua(a.display,b)||(R(b),b=a.findWordAt(c),Zb(a.doc,b.anchor,b.head))}})):y(d.scroller,"dblclick",function(b){D(a,b)||R(b)});md||y(d.scroller,"contextmenu",function(b){ye(a,b)});var e,f={end:0};y(d.scroller,"touchstart", function(b){var c;if(c=!D(a,b))1!=b.touches.length?c=!1:(c=b.touches[0],c=1>=c.radiusX&&1>=c.radiusY),c=!c;c&&(clearTimeout(e),c=+new Date,d.activeTouch={start:c,moved:!1,prev:300>=c-f.end?f:null},1==b.touches.length&&(d.activeTouch.left=b.touches[0].pageX,d.activeTouch.top=b.touches[0].pageY))});y(d.scroller,"touchmove",function(){d.activeTouch&&(d.activeTouch.moved=!0)});y(d.scroller,"touchend",function(e){var f=d.activeTouch;if(f&&!ua(d,e)&&null!=f.left&&!f.moved&&300>new Date-f.start){var g=a.coordsChar(d.activeTouch, "page"),f=!f.prev||c(f,f.prev)?new G(g,g):!f.prev.prev||c(f,f.prev.prev)?a.findWordAt(g):new G(q(g.line,0),z(a.doc,q(g.line+1,0)));a.setSelection(f.anchor,f.head);a.focus();R(e)}b()});y(d.scroller,"touchcancel",b);y(d.scroller,"scroll",function(){d.scroller.clientHeight&&(qb(a,d.scroller.scrollTop),Ua(a,d.scroller.scrollLeft,!0),L(a,"scroll",a))});y(d.scroller,"mousewheel",function(b){ze(a,b)});y(d.scroller,"DOMMouseScroll",function(b){ze(a,b)});y(d.wrapper,"scroll",function(){d.wrapper.scrollTop= d.wrapper.scrollLeft=0});d.dragFunctions={enter:function(b){D(a,b)||jc(b)},over:function(b){if(!D(a,b)){var c=Ka(a,b);if(c){var d=document.createDocumentFragment();pe(a,c,d);a.display.dragCursor||(a.display.dragCursor=r("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),a.display.lineSpace.insertBefore(a.display.dragCursor,a.display.cursorDiv));Y(a.display.dragCursor,d)}jc(b)}},start:function(b){if(B&&(!a.state.draggingText||100>+new Date-Ae))jc(b);else if(!D(a,b)&&!ua(a.display,b)&&(b.dataTransfer.setData("Text", a.getSelection()),b.dataTransfer.effectAllowed="copyMove",b.dataTransfer.setDragImage&&!Be)){var c=r("img",null,null,"position: fixed; left: 0; top: 0;");c.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";ia&&(c.width=c.height=1,a.display.wrapper.appendChild(c),c._top=c.offsetTop);b.dataTransfer.setDragImage(c,0,0);ia&&c.parentNode.removeChild(c)}},drop:H(a,Rf),leave:function(b){D(a,b)||Ce(a)}};var g=d.input.getField();y(g,"keyup",function(b){De.call(a,b)});y(g,"keydown", H(a,Ee));y(g,"keypress",H(a,Fe));y(g,"focus",function(b){Fc(a,b)});y(g,"blur",function(b){jb(a,b)})}function Sf(a){var b=a.display;if(b.lastWrapHeight!=b.wrapper.clientHeight||b.lastWrapWidth!=b.wrapper.clientWidth)b.cachedCharWidth=b.cachedTextHeight=b.cachedPaddingH=null,b.scrollbarsClipped=!1,a.setSize()}function ua(a,b){for(b=b.target||b.srcElement;b!=a.wrapper;b=b.parentNode)if(!b||1==b.nodeType&&"true"==b.getAttribute("cm-ignore-events")||b.parentNode==a.sizer&&b!=a.mover)return!0}function Ka(a, b,c,d){var e=a.display;if(!c&&"true"==(b.target||b.srcElement).getAttribute("cm-not-content"))return null;var f,g;c=e.lineSpace.getBoundingClientRect();try{f=b.clientX-c.left,g=b.clientY-c.top}catch(k){return null}b=jd(a,f,g);var h;d&&1==b.xRel&&(h=w(a.doc,b.line).text).length==b.ch&&(d=ha(h,h.length,a.options.tabSize)-h.length,b=q(b.line,Math.max(0,Math.round((f-qe(a.display).left)/lb(a.display))-d)));return b}function Qf(a){var b=this.display;if(!(D(this,a)||b.activeTouch&&b.input.supportsTouch()))if(b.shift= a.shiftKey,ua(b,a))M||(b.scroller.draggable=!1,setTimeout(function(){b.scroller.draggable=!0},100));else if(!ld(this,a,"gutterClick",!0)){var c=Ka(this,a);window.focus();switch(Ge(a)){case 1:this.state.selectingText?this.state.selectingText(a):c?Tf(this,a,c):(a.target||a.srcElement)==b.scroller&&R(a);break;case 2:M&&(this.state.lastMiddleDown=+new Date);c&&Zb(this.doc,c);setTimeout(function(){b.input.focus()},20);R(a);break;case 3:md?ye(this,a):Uf(this)}}}function Tf(a,b,c){B?setTimeout(Ec(Xd,a), 0):a.curOp.focus=ma();var d=+new Date,e;kc&&kc.time>d-400&&0==t(kc.pos,c)?e="triple":lc&&lc.time>d-400&&0==t(lc.pos,c)?(e="double",kc={time:d,pos:c}):(e="single",lc={time:d,pos:c});var d=a.doc.sel,f=ea?b.metaKey:b.ctrlKey,g;a.options.dragDrop&&Vf&&!a.isReadOnly()&&"single"==e&&-1<(g=d.contains(c))&&(0>t((g=d.ranges[g]).from(),c)||0c.xRel)?Wf(a,b,c,f):Xf(a,b,c,e,f)}function Wf(a,b,c,d){var e=a.display,f=+new Date,g=H(a,function(h){M&&(e.scroller.draggable=!1);a.state.draggingText= !1;qa(document,"mouseup",g);qa(e.scroller,"drop",g);10>Math.abs(b.clientX-h.clientX)+Math.abs(b.clientY-h.clientY)&&(R(h),!d&&+new Date-200K&&e.push(new G(q(h,K),q(h,He(v,g,f))))}e.length||e.push(new G(c,c));E(m,ga(n.ranges.slice(0,u).concat(e),u),{origin:"*mouse",scroll:!1});a.scrollIntoView(b)}else e=p,f=e.anchor,k=b,"single"!=d&&(b="double"==d?a.findWordAt(b):new G(q(b.line, 0),z(m,q(b.line+1,0))),0=h.to||e.linex.bottom?20:0;p&&setTimeout(H(a,function(){B==c&&(k.scroller.scrollTop+=p,g(b))}),50)}}function h(b){a.state.selectingText= !1;B=Infinity;R(b);k.input.focus();qa(document,"mousemove",C);qa(document,"mouseup",F);m.history.lastSelOrigin=null}var k=a.display,m=a.doc;R(b);var p,u,n=m.sel,l=n.ranges;e&&!b.shiftKey?(u=m.sel.contains(c),p=-1=Math.floor(a.display.gutters.getBoundingClientRect().right))return!1;d&&R(b);d=a.display;var g=d.lineDiv.getBoundingClientRect();if(f>g.bottom||!ca(a,c))return od(b);f-=g.top-d.viewOffset;for(g=0;g=e)return e=Fa(a.doc,f),L(a,c,a,e,a.options.gutters[g],b),od(b)}}function Rf(a){var b=this;Ce(b);if(!D(b,a)&&!ua(b.display,a)){R(a);B&&(Ae=+new Date); var c=Ka(b,a,!0),d=a.dataTransfer.files;if(c&&!b.isReadOnly())if(d&&d.length&&window.FileReader&&window.File){var e=d.length,f=Array(e),g=0;a=function(a,d){if(!b.options.allowDropFileTypes||-1!=N(b.options.allowDropFileTypes,a.type)){var h=new FileReader;h.onload=H(b,function(){var a=h.result;/[\x00-\x08\x0e-\x1f]{2}/.test(a)&&(a="");f[d]=a;++g==e&&(c=z(b.doc,c),a={from:c,to:c,text:b.doc.splitLines(f.join(b.doc.lineSeparator())),origin:"paste"},Wa(b.doc,a),he(b.doc,na(c,La(a))))});h.readAsText(a)}}; for(var h=0;hMath.abs(a.doc.scrollTop-b)||(a.doc.scrollTop=b,va||Vc(a,{top:b}),a.display.scroller.scrollTop!=b&&(a.display.scroller.scrollTop=b),a.display.scrollbars.setScrollTop(b),va&&Vc(a),kb(a,100))}function Ua(a,b,c){(c?b==a.doc.scrollLeft:2>Math.abs(a.doc.scrollLeft-b))||(b=Math.min(b,a.display.scroller.scrollWidth-a.display.scroller.clientWidth),a.doc.scrollLeft=b,Hc(a),a.display.scroller.scrollLeft!=b&&(a.display.scroller.scrollLeft=b),a.display.scrollbars.setScrollLeft(b))} function ze(a,b){var c=Ie(b),d=c.x,c=c.y,e=a.display,f=e.scroller,g=f.scrollWidth>f.clientWidth,h=f.scrollHeight>f.clientHeight;if(d&&g||c&&h){if(c&&ea&&M){var g=b.target,k=e.view;a:for(;g!=f;g=g.parentNode)for(var m=0;mb?h=Math.max(0,h+b-50):g=Math.min(a.doc.height,g+b+50),Vc(a,{top:h,bottom:g})),20>mc&&(null==e.wheelStartX?(e.wheelStartX=f.scrollLeft, e.wheelStartY=f.scrollTop,e.wheelDX=d,e.wheelDY=c,setTimeout(function(){if(null!=e.wheelStartX){var a=f.scrollLeft-e.wheelStartX,b=f.scrollTop-e.wheelStartY,a=b&&e.wheelDY&&b/e.wheelDY||a&&e.wheelDX&&a/e.wheelDX;e.wheelStartX=e.wheelStartY=null;a&&(Z=(Z*mc+a)/(mc+1),++mc)}},200)):(e.wheelDX+=d,e.wheelDY+=c))):(c&&h&&qb(a,Math.max(0,Math.min(f.scrollTop+c*Z,f.scrollHeight-f.clientHeight))),Ua(a,Math.max(0,Math.min(f.scrollLeft+d*Z,f.scrollWidth-f.clientWidth))),(!c||c&&h)&&R(b),e.wheelStartX=null)}} function nc(a,b,c){if("string"==typeof b&&(b=oc[b],!b))return!1;a.display.input.ensurePolled();var d=a.display.shift,e=!1;try{a.isReadOnly()&&(a.state.suppressEdits=!0),c&&(a.display.shift=!1),e=b(a)!=Je}finally{a.display.shift=d,a.state.suppressEdits=!1}return e}function Zf(a,b,c){for(var d=0;dA&&27==a.keyCode&&(a.returnValue=!1);var b=a.keyCode;this.display.shift=16==b||a.shiftKey;var c=Ke(this,a);ia&&(pd=c?b:null,!c&&88==b&&!Le&&(ea?a.metaKey:a.ctrlKey)&&this.replaceSelection("",null,"cut"));18!=b||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||dg(this)}}function dg(a){function b(a){18!=a.keyCode&&a.altKey|| (pb(c,"CodeMirror-crosshair"),qa(document,"keyup",b),qa(document,"mouseover",b))}var c=a.display.lineDiv;rb(c,"CodeMirror-crosshair");y(document,"keyup",b);y(document,"mouseover",b)}function De(a){16==a.keyCode&&(this.doc.sel.shift=!1);D(this,a)}function Fe(a){if(!(ua(this.display,a)||D(this,a)||a.ctrlKey&&!a.altKey||ea&&a.metaKey)){var b=a.keyCode,c=a.charCode;if(ia&&b==pd)pd=null,R(a);else if(!ia||a.which&&!(10>a.which)||!Ke(this,a))if(b=String.fromCharCode(null==c?b:c),!cg(this,a,b))this.display.input.onKeyPress(a)}} function Uf(a){a.state.delayingBlurEvent=!0;setTimeout(function(){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1,jb(a))},100)}function Fc(a,b){a.state.delayingBlurEvent&&(a.state.delayingBlurEvent=!1);"nocursor"!=a.options.readOnly&&(a.state.focused||(L(a,"focus",a,b),a.state.focused=!0,rb(a.display.wrapper,"CodeMirror-focused"),a.curOp||a.display.selForContextMenu==a.doc.sel||(a.display.input.reset(),M&&setTimeout(function(){a.display.input.reset(!0)},20)),a.display.input.receivedFocus()), dd(a))}function jb(a,b){a.state.delayingBlurEvent||(a.state.focused&&(L(a,"blur",a,b),a.state.focused=!1,pb(a.display.wrapper,"CodeMirror-focused")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.display.shift=!1)},150))}function ye(a,b){var c;(c=ua(a.display,b))||(c=ca(a,"gutterContextMenu")?ld(a,b,"gutterContextMenu",!1):!1);if(!c&&!D(a,b,"contextmenu"))a.display.input.onContextMenu(b)}function Me(a,b){if(0>t(a,b.from))return a;if(0>=t(a,b.to))return La(b);var c=a.line+ b.text.length-(b.to.line-b.from.line)-1,d=a.ch;a.line==b.to.line&&(d+=La(b).ch-b.to.ch);return q(c,d)}function qd(a,b){for(var c=[],d=0;da.lastLine())){if(b.from.linee&&(b={from:b.from,to:q(e,w(a,e).text.length),text:[b.text[0]],origin:b.origin});b.removed=Ia(a,b.from,b.to);c||(c=qd(a,b));a.cm?fg(a.cm,b,d):td(a,b,d);$b(a,c,oa)}}function fg(a,b,c){var d=a.doc,e=a.display,f=b.from,g=b.to,h=!1,k=f.line;a.options.lineWrapping|| (k=F(pa(w(d,f.line))),d.iter(k,g.line+1,function(a){if(a==e.maxLine)return h=!0}));-1e.maxLineLength&&(e.maxLine=a,e.maxLineLength=b,e.maxLineChanged=!0,h=!1)}),h&&(a.curOp.updateMaxLine=!0));d.frontier=Math.min(d.frontier,f.line);kb(a,400);c=b.text.length-(g.line-f.line)-1;b.full?P(a):f.line!=g.line||1!=b.text.length||Ve(a.doc,b)?P(a,f.line,g.line+1,c):ta(a,f.line, "text");c=ca(a,"changes");if((d=ca(a,"change"))||c)b={from:f,to:g,text:b.text,removed:b.removed,origin:b.origin},d&&V(a,"change",a,b),c&&(a.curOp.changeObjs||(a.curOp.changeObjs=[])).push(b);a.display.selForContextMenu=null}function bb(a,b,c,d,e){d||(d=c);if(0>t(d,c)){var f=d;d=c;c=f}"string"==typeof b&&(b=a.splitLines(b));Wa(a,{from:c,to:d,text:b,origin:e})}function hc(a,b,c,d,e){var f=a.display,g=Ca(a.display);0>c&&(c=0);var h=a.curOp&&null!=a.curOp.scrollTop?a.curOp.scrollTop:f.scroller.scrollTop, k=Tc(a),m={};e-c>k&&(e=c+k);var p=a.doc.height+Kc(f),u=cp-g;ch+k&&(c=Math.min(c,(g?p:e)-k),c!=h&&(m.scrollTop=c));h=a.curOp&&null!=a.curOp.scrollLeft?a.curOp.scrollLeft:f.scroller.scrollLeft;a=Ga(a)-(a.options.fixedGutter?f.gutters.offsetWidth:0);(f=d-b>a)&&(d=b+a);10>b?m.scrollLeft=0:ba+h-3&&(m.scrollLeft=d+(f?0:10)-a);return m}function rc(a,b,c){null==b&&null==c||sc(a);null!=b&&(a.curOp.scrollLeft=(null==a.curOp.scrollLeft?a.doc.scrollLeft: a.curOp.scrollLeft)+b);null!=c&&(a.curOp.scrollTop=(null==a.curOp.scrollTop?a.doc.scrollTop:a.curOp.scrollTop)+c)}function Xa(a){sc(a);var b=a.getCursor(),c=b,d=b;a.options.lineWrapping||(c=b.ch?q(b.line,b.ch-1):b,d=q(b.line,b.ch+1));a.curOp.scrollToPos={from:c,to:d,margin:a.options.cursorScrollMargin,isCursor:!0}}function sc(a){var b=a.curOp.scrollToPos;if(b){a.curOp.scrollToPos=null;var c=xe(a,b.from),d=xe(a,b.to),b=hc(a,Math.min(c.left,d.left),Math.min(c.top,d.top)-b.margin,Math.max(c.right,d.right), Math.max(c.bottom,d.bottom)+b.margin);a.scrollTo(b.scrollLeft,b.scrollTop)}}function ub(a,b,c,d){var e=a.doc,f;null==c&&(c="add");"smart"==c&&(e.mode.indent?f=yb(a,b):c="prev");var g=a.options.tabSize,h=w(e,b),k=ha(h.text,null,g);h.stateAfter&&(h.stateAfter=null);var m=h.text.match(/^\s*/)[0],p;if(!d&&!/\S/.test(h.text))p=0,c="not";else if("smart"==c&&(p=e.mode.indent(f,h.text.slice(m.length),h.text),p==Je||150e.first?ha(w(e,b-1).text,null,g):0:"add"==c?p= k+a.options.indentUnit:"subtract"==c?p=k-a.options.indentUnit:"number"==typeof c&&(p=k+c);p=Math.max(0,p);c="";d=0;if(a.options.indentWithTabs)for(a=Math.floor(p/g);a;--a)d+=g,c+="\t";d=t(f.from,C(d).to);){var g=d.pop();if(0>t(g.from,f.from)){f.from=g.from;break}}d.push(f)}X(a,function(){for(var b=d.length-1;0<=b;b--)bb(a.doc,"",d[b].from,d[b].to,"+delete");Xa(a)})}function vd(a,b,c,d,e){function f(b){var d=(e?kd:We)(m,h,c,!0);if(null==d){if(b=!b)b=g+c,b=a.first+a.size?b=!1:(g=b,b=m=w(a,b));if(b)h= e?(0>c?gc:fc)(m):0>c?m.text.length:0;else return!1}else h=d;return!0}var g=b.line,h=b.ch,k=c,m=w(a,g);if("char"==d)f();else if("column"==d)f(!0);else if("word"==d||"group"==d){var p=null;d="group"==d;for(var u=a.cm&&a.cm.getHelper(b,"wordChars"),n=!0;!(0>c)||f(!n);n=!1){var l=m.text.charAt(h)||"\n",l=uc(l,u)?"w":d&&"\n"==l?"n":!d||/\s/.test(l)?null:"p";!d||n||l||(l="s");if(p&&p!=l){0>c&&(c=1,f());break}l&&(p=l);if(0c?0>=g:g>=e.height){b.hitSide=!0;break}g+=5*c}return b}function x(a,b,c,d){l.defaults[a]=b;c&&(Sa[a]=d?function(a,b,d){d!=Jd&&c(a,b,d)}:c)}function gg(a){var b=a.split(/-(?!$)/);a=b[b.length-1];for(var c,d,e,f,g=0;g=a:k.to>a);(h||(h=[])).push(new wc(m,k.from,p?null:k.to))}}var c=h,l;if(d)for(h=0;h=e:g.to>e)||g.from==e&&"bookmark"==k.type&&(!f||g.marker.insertLeft))m=null==g.from||(k.inclusiveLeft?g.from<=e:g.fromt(g.to,e.from)||0k||!c.inclusiveLeft&&!k)&&h.push({from:g.from,to:e.from});(0cf(c,d.marker))&&(c=d.marker);return c}function Ye(a,b,c,d,e){a=w(a,b);if(a=ya&&a.markedSpans)for(b=0;b=k||0>=h&&0<=k)&&(0>=h&&(f.marker.inclusiveRight&&e.inclusiveLeft?0<=t(g.to,c):0=t(g.from,d):0>t(g.from,d))))return!0}}}function pa(a){for(var b;b=Ea(a,!0);)a=b.find(-1,!0).line;return a}function Sc(a,b){a=w(a,b);var c=pa(a);return a==c?b:F(c)}function Od(a,b){if(b>a.lastLine())return b; var c=w(a,b);if(!Da(a,c))return b;for(;a=Ea(c,!1);)c=a.find(1,!0).line;return F(c)+1}function Da(a,b){var c=ya&&b.markedSpans;if(c)for(var d,e=0;ee;e++){d&&(d[0]=l.innerMode(a,c).mode);var f=a.token(b,c);if(b.pos>b.start)return f}throw Error("Mode "+a.name+" failed to advance stream.");}function ff(a,b,c,d){function e(a){return{start:p.start, end:p.pos,string:p.current(),type:h||null,state:a?za(f.mode,m):m}}var f=a.doc,g=f.mode,h;b=z(f,b);var k=w(f,b.line),m=yb(a,b.line,c),p=new zc(k.text,a.options.tabSize),l;for(d&&(l=[]);(d||p.posa.options.maxHighlightLength? (h=!1,g&&ed(a,b,d,p.pos),p.pos=b.length,l=null):l=df(yd(c,p,d,n),f);if(n){var q=n[0].name;q&&(l="m-"+(l?q+" "+l:q))}if(!h||m!=l){for(;ka&&e.splice(h, 1,a,e[h+1],d);h+=2;k=Math.min(a,d)}if(b)if(g.opaque)e.splice(c,h-c,a,"cm-overlay "+b),h=c+2;else for(;ca.options.maxHighlightLength?za(a.doc.mode,d):d);b.stateAfter=d;b.styles=e.styles;e.classes?b.styleClasses=e.classes:b.styleClasses&&(b.styleClasses=null);c===a.doc.frontier&&a.doc.frontier++}return b.styles} function ed(a,b,c,d){var e=a.doc.mode;a=new zc(b,a.options.tabSize);a.start=a.pos=d||0;for(""==b&&ef(e,c);!a.eol();)yd(e,a,c),a.start=a.pos}function jf(a,b){if(!a||/^\s*$/.test(a))return null;b=b.addModeClass?lg:mg;return b[a]||(b[a]=a.replace(/\S+/g,"cm-$&"))}function Vd(a,b){var c=r("span",null,null,M?"padding-right: .1px":null),c={pre:r("pre",[c],"CodeMirror-line"),content:c,col:0,pos:0,cm:a,trailingSpace:!1,splitSpaces:(B||M)&&a.getOption("lineWrapping")};b.measure={};for(var d=0;d<=(b.rest?b.rest.length: 0);d++){var e=d?b.rest[d-1]:b.line,f;c.pos=0;c.addToken=ng;var g;g=a.display.measure;if(null!=zd)g=zd;else{var h=Y(g,document.createTextNode("A\u062eA")),k=$a(h,0,1).getBoundingClientRect(),h=$a(h,1,2).getBoundingClientRect();wa(g);g=k&&k.left!=k.right?zd=3>h.right-k.right:!1}g&&(f=fa(e))&&(c.addToken=og(c.addToken,f));c.map=[];k=b!=a.display.externalMeasured&&F(e);a:{g=c;var k=hf(a,e,k),h=e.markedSpans,m=e.text,p=0;if(h)for(var l=m.length,n=0,q=1,v="",w=void 0,x=void 0,t=0,y=void 0,z=void 0,C=void 0, G=void 0,A=void 0;;){if(t==n){for(var y=z=C=G=x="",A=null,t=Infinity,H=[],I,D=0;Dn||E.collapsed&&J.to==n&&J.from==n)?(null!=J.to&&J.to!=n&&t>J.to&&(t=J.to,z=""),E.className&&(y+=" "+E.className),E.css&&(x=(x?x+";":"")+E.css),E.startStyle&&J.from==n&&(C+=" "+E.startStyle),E.endStyle&&J.to==t&&(I||(I=[])).push(E.endStyle,J.to),E.title&&!G&&(G=E.title),E.collapsed&&(!A||0>cf(A.marker, E))&&(A=J)):J.from>n&&t>J.from&&(t=J.from)}if(I)for(D=0;D=l)break;for(H=Math.min(l,t);;){if(v){D=n+v.length;A||(J=D>H?v.slice(0,H-n):v,g.addToken(g,J,w?w+y:y,C,n+J.length==t?z:"",G,x));if(D>=H){v=v.slice(H-n);n=H;break}n=D;C=""}v=m.slice(p,p=k[q++]);w=jf(k[q++],g.cm.options)}}else for(var q= 1;qA?h.appendChild(r("span",[v])):h.appendChild(v);a.map.push(a.pos,a.pos+q,v);a.col+=q;a.pos+=q}if(!n)break;l+=q+1;"\t"==n[0]?(v=a.cm.options.tabSize,n=v-a.col%v,v=h.appendChild(r("span",ud(n),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),a.col+=n):("\r"==n[0]||"\n"==n[0]?(v=h.appendChild(r("span", "\r"==n[0]?"\u240d":"\u2424","cm-invalidchar")),v.setAttribute("cm-text",n[0])):(v=a.cm.options.specialCharPlaceholder(n[0]),v.setAttribute("cm-text",n[0]),B&&9>A?h.appendChild(r("span",[v])):h.appendChild(v)),a.col+=1);a.map.push(a.pos,a.pos+1,v);a.pos++}}else a.col+=b.length,h=document.createTextNode(k),a.map.push(a.pos,a.pos+b.length,h),B&&9>A&&(p=!0),a.pos+=b.length;a.trailingSpace=32==k.charCodeAt(b.length-1);if(c||d||e||p||g)return b=c||"",d&&(b+=d),e&&(b+=e),d=r("span",[h],b,g),f&&(d.title= f),a.content.appendChild(d);a.content.appendChild(h)}}function og(a,b){return function(c,d,e,f,g,h,k){e=e?e+" cm-force-border":"cm-force-border";for(var m=c.pos,p=m+d.length;;){for(var l=0;lm&&n.from<=m)break}if(n.to>=p)return a(c,d,e,f,g,h,k);a(c,d.slice(0,n.to-m),e,f,null,h,k);f=null;d=d.slice(n.to-m);m=n.to}}}function kf(a,b,c,d){var e=!d&&c.widgetNode;e&&a.map.push(a.pos,a.pos+b,e);!d&&a.cm.display.input.needsContentAttribute&&(e||(e=a.content.appendChild(document.createElement("span"))), e.setAttribute("cm-marker",c.id));e&&(a.cm.display.input.setUneditable(e),a.content.appendChild(e));a.pos+=b;a.trailingSpace=!1}function Ve(a,b){return 0==b.from.ch&&0==b.to.ch&&""==C(b.text)&&(!a.cm||a.cm.options.wholeLineUpdateBefore)}function td(a,b,c,d){function e(a,c,e){a.text=c;a.stateAfter&&(a.stateAfter=null);a.styles&&(a.styles=null);null!=a.order&&(a.order=null);af(a);bf(a,e);c=d?d(a):1;c!=a.height&&ja(a,c);V(a,"change",a,b)}function f(a,b){for(var e=[];ab||b>=a.size)throw Error("There is no line "+(b+a.first)+" in the document.");for(;!a.lines;)for(var c= 0;;++c){var d=a.children[c],e=d.chunkSize();if(bf-a.cm.options.historyEventDelay||"*"==b.origin.charAt(0)))e.lastOp==d?(ie(e.done),g=C(e.done)):e.done.length&&!C(e.done).ranges?g=C(e.done):1e.undoDepth;)e.done.shift(),e.done[0].ranges||e.done.shift();e.done.push(c);e.generation=++e.maxGeneration;e.lastModTime=e.lastSelTime=f;e.lastOp=e.lastSelOp=d;e.lastOrigin=e.lastSelOrigin=b.origin;k||L(a,"historyAdded")}function ac(a,b){var c=C(b);c&&c.ranges&&c.equals(a)||b.push(a)}function lf(a,b,c,d){var e=b["spans_"+a.id],f=0;a.iter(Math.max(a.first,c),Math.min(a.first+ a.size,d),function(c){c.markedSpans&&((e||(e=b["spans_"+a.id]={}))[f]=c.markedSpans);++f})}function jg(a){if(!a)return null;for(var b=0,c;b=b.offsetWidth&&2A))}a=Cd?r("span","\u200b"):r("span","\u00a0",null,"display: inline-block; width: 1px; margin-right: -1px");a.setAttribute("cm-text","");return a}function Jf(a,b,c,d){if(!a)return d(b,c,"ltr");for(var e=!1,f=0;fb||b==c&&g.to==b)d(Math.max(g.from,b),Math.min(g.to,c),1==g.level?"rtl": "ltr"),e=!0}e||d(b,c,"ltr")}function hd(a){return a.level%2?a.to:a.from}function id(a){return a.level%2?a.from:a.to}function fc(a){return(a=fa(a))?hd(a[0]):0}function gc(a){var b=fa(a);return b?id(C(b)):a.text.length}function tf(a,b){var c=w(a.doc,b);a=pa(c);a!=c&&(b=F(a));a=(c=fa(a))?c[0].level%2?gc(a):fc(a):0;return q(b,a)}function uf(a,b){var c=tf(a,b.line);a=w(a.doc,c.line);var d=fa(a);return d&&0!=d[0].level?c:(a=Math.max(0,a.text.search(/\S/)),q(c.line,b.line==c.line&&b.ch<=a&&b.ch?0:a))}function Xb(a, b){Bb=null;for(var c=0,d;cb)return c;if(e.from==b||e.to==b)if(null==d)d=c;else{b=e.level;var f=a[d].level;a=a[0].level;a=b==a?!0:f==a?!1:bg.from&&bb||b>a.text.length?null:b}var W=navigator.userAgent,vf=navigator.platform,va=/gecko\/\d/i.test(W),wf=/MSIE \d/.test(W),xf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(W),B=wf||xf,A=B&&(wf?document.documentMode||6:xf[1]),M=/WebKit\//.test(W),ug=M&&/Qt\/\d+\.\d+/.test(W), vg=/Chrome\//.test(W),ia=/Opera\//.test(W),Be=/Apple Computer/.test(navigator.vendor),wg=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(W),Pf=/PhantomJS/.test(W),vb=/AppleWebKit/.test(W)&&/Mobile\/\w+/.test(W),ib=vb||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(W),ea=vb||/Mac/.test(vf),Yf=/\bCrOS\b/.test(W),xg=/win/i.test(vf),Oa=ia&&W.match(/Version\/(\d*\.\d*)/);Oa&&(Oa=Number(Oa[1]));Oa&&15<=Oa&&(ia=!1,M=!0);var yf=ea&&(ug||ia&&(null==Oa||12.11>Oa)),md=va||B&&9<=A,Pe=!1,ya=!1;Lc.prototype= da({update:function(a){var b=a.scrollWidth>a.clientWidth+1,c=a.scrollHeight>a.clientHeight+1,d=a.nativeBarWidth;c?(this.vert.style.display="block",this.vert.style.bottom=b?d+"px":"0",this.vert.firstChild.style.height=Math.max(0,a.scrollHeight-a.clientHeight+(a.viewHeight-(b?d:0)))+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0");b?(this.horiz.style.display="block",this.horiz.style.right=c?d+"px":"0",this.horiz.style.left=a.barLeft+"px",this.horiz.firstChild.style.width=a.scrollWidth- a.clientWidth+(a.viewWidth-a.barLeft-(c?d:0))+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0");!this.checkedZeroWidth&&0A&&f.scrollbars.setScrollTop(f.scroller.scrollTop=k);if(null!=g.selectionStart){(!B||B&&9>A)&&b();var a=0,c=function(){f.selForContextMenu==e.doc.sel&&0==g.selectionStart&&0a++?f.detectingSelectAll=setTimeout(c, 500):f.input.reset()};f.detectingSelectAll=setTimeout(c,200)}}var d=this,e=d.cm,f=e.display,g=d.textarea,h=Ka(e,a),k=f.scroller.scrollTop;if(h&&!ia){e.options.resetSelectionOnContextMenu&&-1==e.doc.sel.contains(h)&&H(e,E)(e.doc,na(h),oa);var m=g.style.cssText,p=d.wrapper.style.cssText;d.wrapper.style.cssText="position: absolute";h=d.wrapper.getBoundingClientRect();g.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(a.clientY-h.top-5)+"px; left: "+(a.clientX-h.left-5)+"px; z-index: 1000; background: "+ (B?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(M)var l=window.scrollY;f.input.focus();M&&window.scrollTo(null,l);f.input.reset();e.somethingSelected()||(g.value=d.prevInput=" ");d.contextMenuPending=!0;f.selForContextMenu=e.doc.sel;clearTimeout(f.detectingSelectAll);B&&9<=A&&b();if(md){jc(a);var n=function(){qa(window,"mouseup",n);setTimeout(c,20)};y(window,"mouseup",n)}else setTimeout(c, 50)}},readOnlyChanged:function(a){a||this.reset()},setUneditable:Jb,needsContentAttribute:!1},Yc.prototype);Zc.prototype=da({init:function(a){function b(a){if(!D(d,a)){if(d.somethingSelected())T={lineWise:!1,text:d.getSelections()},"cut"==a.type&&d.replaceSelection("",null,"cut");else if(d.options.lineWiseCopyCut){var b=$d(d);T={lineWise:!0,text:b.text};"cut"==a.type&&d.operation(function(){d.setSelections(b.ranges,0,oa);d.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData(); var f=T.text.join("\n");a.clipboardData.setData("Text",f);if(a.clipboardData.getData("Text")==f){a.preventDefault();return}}var k=be();a=k.firstChild;d.display.lineSpace.insertBefore(k,d.display.lineSpace.firstChild);a.value=T.text.join("\n");var m=document.activeElement;gb(a);setTimeout(function(){d.display.lineSpace.removeChild(k);m.focus();m==e&&c.showPrimarySelection()},50)}}var c=this,d=c.cm,e=c.div=a.lineDiv;ae(e,d.options.spellcheck);y(e,"paste",function(a){D(d,a)||Zd(a,d)||11>=A&&setTimeout(H(d, function(){c.pollContent()||P(d)}),20)});y(e,"compositionstart",function(a){a=a.data;c.composing={sel:d.doc.sel,data:a,startData:a};if(a){var b=d.doc.sel.primary(),e=d.getLine(b.head.line).indexOf(a,Math.max(0,b.head.ch-a.length));-1b.viewTo- 1)return!1;var e;d.line==b.viewFrom||0==(e=Ha(a,d.line))?(d=F(b.view[0].line),e=b.view[0].node):(d=F(b.view[e].line),e=b.view[e-1].node.nextSibling);var f=Ha(a,c.line);f==b.view.length-1?(c=b.viewTo-1,b=b.lineDiv.lastChild):(c=F(b.view[f+1].line)-1,b=b.view[f+1].node.previousSibling);b=a.doc.splitLines(Gf(a,e,b,d,c));for(e=Ia(a.doc,q(d,0),q(c,w(a.doc,c).text.length));1=t(a,d.to()))return c}return-1}};G.prototype={from:function(){return Ub(this.anchor,this.head)},to:function(){return Tb(this.anchor,this.head)},empty:function(){return this.head.line== this.anchor.line&&this.head.ch==this.anchor.ch}};var te={left:0,right:0,top:0,bottom:0},Ja,ab=null,Of=0,lc,kc,Ae=0,mc=0,Z=null;B?Z=-.53:va?Z=15:vg?Z=-.7:Be&&(Z=-1/3);var Ie=function(a){var b=a.wheelDeltaX,c=a.wheelDeltaY;null==b&&a.detail&&a.axis==a.HORIZONTAL_AXIS&&(b=a.detail);null==c&&a.detail&&a.axis==a.VERTICAL_AXIS?c=a.detail:null==c&&(c=a.wheelDelta);return{x:b,y:c}};l.wheelEventPixels=function(a){a=Ie(a);a.x*=Z;a.y*=Z;return a};var ag=new Ba,pd=null,La=l.changeEnd=function(a){return a.text? q(a.from.line+a.text.length-1,C(a.text).length+(1==a.text.length?a.from.ch:0)):a.to};l.prototype={constructor:l,focus:function(){window.focus();this.display.input.focus()},setOption:function(a,b){var c=this.options,d=c[a];if(c[a]!=b||"mode"==a)c[a]=b,Sa.hasOwnProperty(a)&&H(this,Sa[a])(this,b,d)},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](vc(a))},removeKeyMap:function(a){for(var b=this.state.keyMaps, c=0;cc&&(ub(this,e.head.line,a,!0),c=e.head.line,d==this.doc.sel.primIndex&&Xa(this));else{for(var f=e.from(),e=e.to(),g=Math.max(c,f.line),c=Math.min(this.lastLine(),e.line- (e.ch?0:1))+1,e=g;e>1;if((e?b[2*e-1]:0)>=a)d=e;else if(b[2*e+1]c?b:0==c?null:b.slice(0,c-1)},getModeAt:function(a){var b=this.doc.mode;return b.innerMode?l.innerMode(b,this.getTokenAt(a).state).mode:b},getHelper:function(a,b){return this.getHelpers(a,b)[0]},getHelpers:function(a,b){var c=[];if(!hb.hasOwnProperty(b))return c;var d=hb[b];a=this.getModeAt(a);if("string"==typeof a[b])d[a[b]]&&c.push(d[a[b]]);else if(a[b])for(var e=0;ed&&(a=d,c=!0);a=w(this.doc,a)}return gd(this,a,{top:0,left:0},b||"page").top+(c?this.doc.height-la(a):0)},defaultTextHeight:function(){return Ca(this.display)},defaultCharWidth:function(){return lb(this.display)},setGutterMarker:O(function(a, b,c){return tc(this.doc,a,"gutter",function(a){var d=a.gutterMarkers||(a.gutterMarkers={});d[b]=c;!c&&rf(d)&&(a.gutterMarkers=null);return!0})}),clearGutter:O(function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,ta(b,d,"gutter"),rf(c.gutterMarkers)&&(c.gutterMarkers=null));++d})}),lineInfo:function(a){if("number"==typeof a){if(!wb(this.doc,a))return null;var b=a;a=w(this.doc,a);if(!a)return null}else if(b=F(a),null==b)return null; return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=sa(this,z(this.doc,a));var g=a.bottom,h=a.left;b.style.position="absolute";b.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(b);f.sizer.appendChild(b);if("over"==d)g=a.top;else if("above"==d||"near"== d){var k=Math.max(f.wrapper.clientHeight,this.doc.height),m=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);("above"==d||a.bottom+b.offsetHeight>k)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=k&&(g=a.bottom);h+b.offsetWidth>m&&(h=m-b.offsetWidth)}b.style.top=g+"px";b.style.left=b.style.right="";"right"==e?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):("left"==e?h=0:"middle"==e&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px");c&&(a=hc(this, h,g,h+b.offsetWidth,g+b.offsetHeight),null!=a.scrollTop&&qb(this,a.scrollTop),null!=a.scrollLeft&&Ua(this,a.scrollLeft))},triggerOnKeyDown:O(Ee),triggerOnKeyPress:O(Fe),triggerOnKeyUp:De,execCommand:function(a){if(oc.hasOwnProperty(a))return oc[a].call(null,this)},triggerElectric:O(function(a){Yd(this,a)}),findPosH:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);var f=0;for(a=z(this.doc,a);fa?d.from():d.to()},Lb)}),deleteH:O(function(a,b){var c=this.doc;this.doc.sel.somethingSelected()?c.replaceSelection("",null,"+delete"):cb(this,function(d){var e=vd(c,d.head,a,b,!1);return 0>a?{from:e,to:d.head}:{from:d.head,to:e}})}),findPosV:function(a,b,c,d){var e=1;0>b&&(e=-1,b=-b);var f=0;for(a=z(this.doc,a);fa?g.from():g.to();var h=sa(c,g.head,"div");null!=g.goalColumn&&(h.left=g.goalColumn);e.push(h.left);var m=Xe(c,h,a,b);"page"==b&&g==d.sel.primary()&&rc(c,null,bc(c,m,"div").top-h.top);return m},Lb);if(e.length)for(var g=0;ga.xRel||d==b.length)&&c?--c:++d;for(var f=b.charAt(c),f=uc(f,e)?function(a){return uc(a,e)}:/\s/.test(f)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!uc(a)};0a.doc.first){var g=w(a.doc,e.line-1).text;g&&a.replaceRange(f.charAt(0)+a.doc.lineSeparator()+g.charAt(g.length-1),q(e.line-1,g.length-1),q(e.line,1),"+transpose")}c.push(new G(e, e))}a.setSelections(c)})},newlineAndIndent:function(a){X(a,function(){for(var b=a.listSelections().length,c=0;c=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.posb},eatSpace:function(){for(var a=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){a=this.string.indexOf(a,this.pos);if(-1a.display.maxLineLength&&(a.display.maxLine=f,a.display.maxLineLength=g,a.display.maxLineChanged=!0);null!=c&&a&&this.collapsed&&P(a,c,d+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&me(a.doc));a&&V(a,"markerCleared",a,this);b&&Ta(a);this.parent&&this.parent.clear()}};Na.prototype.find=function(a,b){null==a&&"bookmark"==this.type&&(a=1);for(var c,d,e=0;ethis.size-b&&(1=this.children.length)){var a=this;do{var b=a.children.splice(a.children.length- 5,5),b=new Hb(b);if(a.parent){a.size-=b.size;a.height-=b.height;var c=N(a.parent.children,a);a.parent.children.splice(c+1,0,b)}else c=new Hb(a.children),c.parent=a,a.children=[c,b],a=c;b.parent=a.parent}while(10t(h.head,h.anchor),f[e]=new G(h?k:g,h?g:k)):f[e]=new G(g,g)}f=new ra(f,this.sel.primIndex)}b=f;for(f=d.length-1;0<=f;f--)Wa(this,d[f]);b?he(this,b):this.cm&&Xa(this.cm)}),undo:Q(function(){qc(this,"undo")}), redo:Q(function(){qc(this,"redo")}),undoSelection:Q(function(){qc(this,"undo",!0)}),redoSelection:Q(function(){qc(this,"redo",!0)}),setExtending:function(a){this.extend=a},getExtending:function(){return this.extend},historySize:function(){for(var a=this.history,b=0,c=0,d=0;d=a.ch)&&b.push(e.marker.parent||e.marker)}return b},findMarks:function(a,b,c){a=z(this,a);b=z(this,b);var d=[],e=a.line;this.iter(a.line,b.line+1,function(f){if(f=f.markedSpans)for(var g=0;g=h.to||null==h.from&&e!=a.line||null!=h.from&&e==b.line&&h.from>=b.ch||c&&!c(h.marker)|| d.push(h.marker.parent||h.marker)}++e});return d},getAllMarks:function(){var a=[];this.iter(function(b){if(b=b.markedSpans)for(var c=0;ca)return b=a,!0;a-=e;++c});return z(this,q(c,b))},indexFromPos:function(a){a=z(this,a);var b=a.ch;if(a.linea.ch)return 0;var c=this.lineSeparator().length;this.iter(this.first, a.line,function(a){b+=a.text.length+c});return b},copy:function(a){var b=new U(Bd(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);b.scrollTop=this.scrollTop;b.scrollLeft=this.scrollLeft;b.sel=this.sel;b.extend=!1;a&&(b.history.undoDepth=this.history.undoDepth,b.setHistory(this.getHistory()));return b},linkedDoc:function(a){a||(a={});var b=this.first,c=this.first+this.size;null!=a.from&&a.from>b&&(b=a.from);null!=a.to&&a.toN(Bg,Ob)&&(l.prototype[Ob]=function(a){return function(){return a.apply(this.doc,arguments)}}(U.prototype[Ob]));fb(U);var R=l.e_preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},Cg=l.e_stopPropagation=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},jc=l.e_stop=function(a){R(a);Cg(a)},y=l.on=function(a,b,c){a.addEventListener?a.addEventListener(b, c,!1):a.attachEvent?a.attachEvent("on"+b,c):(a=a._handlers||(a._handlers={}),(a[b]||(a[b]=[])).push(c))},of=[],qa=l.off=function(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,!1);else if(a.detachEvent)a.detachEvent("on"+b,c);else for(a=Bc(a,b,!1),b=0;bf||f>=b)return e+(b-d);e+=f-d;e+=c-e%c;d=f+1}},He=l.findColumn=function(a,b,c){for(var d=0,e=0;;){var f=a.indexOf("\t",d);-1==f&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);e+=f-d;e+=c-e%c;d=f+ 1;if(e>=b)return d}},Cc=[""],gb=function(a){a.select()};vb?gb=function(a){a.selectionStart=0;a.selectionEnd=a.value.length}:B&&(gb=function(a){try{a.select()}catch(b){}});var Dg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,qf=l.isWordChar=function(a){return/\w/.test(a)||"\u0080"A&&(ma=function(){try{return document.activeElement}catch(a){return document.body}}); var pb=l.rmClass=function(a,b){var c=a.className;if(b=Kb(b).exec(c)){var d=c.slice(b.index+b[0].length);a.className=c.slice(0,b.index)+(d?b[1]+d:"")}},rb=l.addClass=function(a,b){var c=a.className;Kb(b).test(c)||(a.className+=(c?" ":"")+b)},Hd=!1,Vf=function(){if(B&&9>A)return!1;var a=r("div");return"draggable"in a||"dragDrop"in a}(),Cd,zd,Ag=l.splitLines=3!="\n\nb".split(/\n/).length?function(a){for(var b=0,c=[],d=a.length;b<=d;){var e=a.indexOf("\n",b);-1==e&&(e=a.length);var f=a.slice(b,"\r"== a.charAt(e-1)?e-1:e),g=f.indexOf("\r");-1!=g?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)},yg=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return b&&b.parentElement()==a?0!=b.compareEndPoints("StartToEnd",b):!1},Le=function(){var a=r("div");if("oncopy"in a)return!0;a.setAttribute("oncopy","return;");return"function"==typeof a.oncopy}(), fd=null,Pa=l.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right", 63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};(function(){for(var a=0;10>a;a++)Pa[a+48]=Pa[a+96]=String(a);for(a=65;90>=a;a++)Pa[a]=String.fromCharCode(a);for(a=1;12>=a;a++)Pa[a+111]=Pa[a+63235]="F"+a})();var Bb,qg=function(){function a(a){return 247>=a?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(a): 1424<=a&&1524>=a?"R":1536<=a&&1773>=a?"rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm".charAt(a-1536):1774<=a&&2220>=a?"r":8192<=a&&8203>=a?"w":8204==a?"b":"L"}function b(a,b,c){this.level=a;this.from=b;this.to=c}var c=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,e=/[LRr]/,f=/[Lb1n]/,g=/[1n]/;return function(h){if(!c.test(h))return!1; for(var k=h.length,m=[],l=0,q;l":[null,"greaterThan"],"\u2265":[null,"greaterThanOrEqual"],"\u2260":[null,"notEqual"],"\u2261":["depth", "match"],"\u2262":[null,"notMatch"],"\u2208":["enlist","membership"],"\u2377":[null,"find"],"\u222a":["unique","union"],"\u2229":[null,"intersection"],"\u223c":["not","without"],"\u2228":[null,"or"],"\u2227":[null,"and"],"\u2371":[null,"nor"],"\u2372":[null,"nand"],"\u2374":["shapeOf","reshape"],",":["ravel","catenate"],"\u236a":[null,"firstAxisCatenate"],"\u233d":["reverse","rotate"],"\u2296":["axis1Reverse","axis1Rotate"],"\u2349":["transpose",null],"\u2191":["first","take"],"\u2193":[null,"drop"], "\u2282":["enclose","partitionWithAxis"],"\u2283":["diclose","pick"],"\u2337":[null,"index"],"\u234b":["gradeUp",null],"\u2352":["gradeDown",null],"\u22a4":["encode",null],"\u22a5":["decode",null],"\u2355":["format","formatByExample"],"\u234e":["execute",null],"\u22a3":["stop","left"],"\u22a2":["pass","right"]},f=/[\.\/\u233f\u2340\u00a8\u2363]/,g=/\u236c/,h=/[\+\u2212\u00d7\u00f7\u2308\u230a\u2223\u2373\?\u22c6\u235f\u25cb!\u2339<\u2264=>\u2265\u2260\u2261\u2262\u2208\u2377\u222a\u2229\u223c\u2228\u2227\u2371\u2372\u2374,\u236a\u233d\u2296\u2349\u2191\u2193\u2282\u2283\u2337\u234b\u2352\u22a4\u22a5\u2355\u234e\u22a3\u22a2]/, k=/\u2190/,l=/[\u235d#].*$/,m=function(b){var c;c=!1;return function(a){c=a;return a===b?"\\"===c:!0}};return{startState:function(){return{prev:!1,func:!1,op:!1,string:!1,escape:!1}},token:function(b,c){var a;if(b.eatSpace())return null;a=b.next();if('"'===a||"'"===a)return b.eatWhile(m(a)),b.next(),c.prev=!0,"string";if(/[\[{\(]/.test(a))return c.prev=!1,null;if(/[\]}\)]/.test(a))return c.prev=!0,null;if(g.test(a))return c.prev=!1,"niladic";if(/[\u00af\d]/.test(a))return c.func?(c.func=!1,c.prev= !1):c.prev=!0,b.eatWhile(/[\w\.]/),"number";if(f.test(a))return"operator apl-"+d[a];if(k.test(a))return"apl-arrow";if(h.test(a))return b="apl-",null!=e[a]&&(b=c.prev?b+e[a][1]:b+e[a][0]),c.func=!0,c.prev=!1,"function "+b;if(l.test(a))return b.skipToEnd(),"comment";if("\u2218"===a&&"."===b.peek())return b.next(),"function jot-dot";b.eatWhile(/[\w\$_]/);c.prev=!0;return"keyword"}}});d.defineMIME("text/apl","apl")}); ================================================ FILE: app/src/main/assets/code_mirror/mode/asciiarmor/asciiarmor.js ================================================ 'use strict';(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){function d(a){var b=a.match(/^\s*\S/);a.skipToEnd();return b?"error":null}c.defineMode("asciiarmor",function(){return{token:function(a,b){var c;if("top"==b.state)return a.sol()&&(c=a.match(/^-----BEGIN (.*)?-----\s*$/))?(b.state="headers",b.type=c[1],"tag"):d(a);if("headers"==b.state){if(a.sol()&& a.match(/^\w+:/))return b.state="header","atom";if(a=d(a))b.state="body";return a}if("header"==b.state)return a.skipToEnd(),b.state="headers","string";if("body"==b.state){if(a.sol()&&(c=a.match(/^-----END (.*)?-----\s*$/))){if(c[1]!=b.type)return"error";b.state="end";return"tag"}if(a.eatWhile(/[A-Za-z0-9+\/=]/))return null;a.next();return"error"}if("end"==b.state)return d(a)},blankLine:function(a){"headers"==a.state&&(a.state="body")},startState:function(){return{state:"top",type:null}}}});c.defineMIME("application/pgp", "asciiarmor");c.defineMIME("application/pgp-keys","asciiarmor");c.defineMIME("application/pgp-signature","asciiarmor")}); ================================================ FILE: app/src/main/assets/code_mirror/mode/asn.1/asn.1.js ================================================ 'use strict';(function(f){"object"==typeof exports&&"object"==typeof module?f(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],f):f(CodeMirror)})(function(f){function e(e){var b={};e=e.split(" ");for(var f=0;f?$/.test(d))return b.extenExten=!0,b.extenStart=!1,"strong";b.extenStart=!1;a.skipToEnd();return"error"}if(b.extenExten)return b.extenExten=!1,b.extenPriority=!0,a.eatWhile(/[^,]/),b.extenInclude&&(a.skipToEnd(),b.extenPriority=!1,b.extenInclude=!1),b.extenSame&& (b.extenPriority=!1,b.extenSame=!1,b.extenApplication=!0),"tag";if(b.extenPriority){b.extenPriority=!1;b.extenApplication=!0;a.next();if(b.extenSame)return null;a.eatWhile(/[^,]/);return"number"}if(b.extenApplication){a.eatWhile(/,/);d=a.current();if(","===d)return null;a.eatWhile(/\w/);d=a.current().toLowerCase();b.extenApplication=!1;if(-1!==g.indexOf(d))return"def strong"}else return c(a,b);return null}}});c.defineMIME("text/x-asterisk","asterisk")}); ================================================ FILE: app/src/main/assets/code_mirror/mode/brainfuck/brainfuck.js ================================================ 'use strict';(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){var d="><+-.,[]".split("");a.defineMode("brainfuck",function(){return{startState:function(){return{commentLine:!1,left:0,right:0,commentLoop:!1}},token:function(a,c){if(a.eatSpace())return null;a.sol()&&(c.commentLine=!1);var b=a.next().toString();if(-1!==d.indexOf(b)){if(!0===c.commentLine)return a.eol()&& (c.commentLine=!1),"comment";if("]"===b||"["===b)return"["===b?c.left++:c.right++,"bracket";if("+"===b||"-"===b)return"keyword";if("<"===b||">"===b)return"atom";if("."===b||","===b)return"def"}else return c.commentLine=!0,a.eol()&&(c.commentLine=!1),"comment";a.eol()&&(c.commentLine=!1)}}});a.defineMIME("text/x-brainfuck","brainfuck")}); ================================================ FILE: app/src/main/assets/code_mirror/mode/clike/clike.js ================================================ 'use strict';(function(q){"object"==typeof exports&&"object"==typeof module?q(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],q):q(CodeMirror)})(function(q){function D(a,b,e,c,g,m){this.indented=a;this.column=b;this.type=e;this.info=c;this.align=g;this.prev=m}function z(a,b,c,r){var e=a.indented;a.context&&"statement"!=a.context.type&&"statement"!=c&&(e=a.context.indented);return a.context=new D(e,b,c,r,null,a.context)}function x(a){var b=a.context.type; if(")"==b||"]"==b||"}"==b)a.indented=a.context.indented;return a.context=a.context.prev}function H(a,b,c){if("variable"==b.prevToken||"variable-3"==b.prevToken||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(a.string.slice(0,c))||b.typeAtEndOfLine&&a.column()==a.indentation())return!0}function I(a){for(;;){if(!a||"top"==a.type)return!0;if("}"==a.type&&"namespace"!=a.prev.info)return!1;a=a.prev}}function c(a){var b={};a=a.split(" ");for(var c=0;c!?|\/]/,P=b.endStatement||/^[;:,]$/,l,G;return{startState:function(a){return{tokenize:null,context:new D((a||0)-h,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(a,f){var d=f.context;a.sol()&&(null==d.align&&(d.align=!1),f.indented=a.indentation(),f.startOfLine=!0);if(a.eatSpace())return m(a,f),null;l=G=null;var e= (f.tokenize||c)(a,f);if("comment"==e||"meta"==e)return e;null==d.align&&(d.align=!0);if(P.test(l))for(;"statement"==f.context.type;)x(f);else if("{"==l)z(f,a.column(),"}");else if("["==l)z(f,a.column(),"]");else if("("==l)z(f,a.column(),")");else if("}"==l){for(;"statement"==d.type;)d=x(f);for("}"==d.type&&(d=x(f));"statement"==d.type;)d=x(f)}else l==d.type?x(f):O&&(("}"==d.type||"top"==d.type)&&";"!=l||"statement"==d.type&&"newstatement"==l)&&z(f,a.column(),"statement",a.current());"variable"==e&& ("def"==f.prevToken||b.typeFirstDefinitions&&H(a,f,a.start)&&I(f.context)&&a.match(/^\s*\(/,!1))&&(e="def");w.token&&(d=w.token(a,f,e),void 0!==d&&(e=d));"def"==e&&!1===b.styleDefs&&(e="variable");f.startOfLine=!1;f.prevToken=G?"def":e||l;m(a,f);return e},indent:function(a,e){if(a.tokenize!=c&&null!=a.tokenize||a.typeAtEndOfLine)return q.Pass;var d=a.context,f=e&&e.charAt(0);"statement"==d.type&&"}"==f&&(d=d.prev);if(b.dontIndentStatements)for(;"statement"==d.type&&b.dontIndentStatements.test(d.info);)d= d.prev;if(w.indent&&(a=w.indent(a,d,e),"number"==typeof a))return a;a=f==d.type;var g=d.prev&&"switch"==d.prev.info;if(b.allmanIndentation&&/[{(]/.test(f)){for(;"top"!=d.type&&"}"!=d.type;)d=d.prev;return d.indented}return"statement"==d.type?d.indented+("{"==f?0:n):!d.align||u&&")"==d.type?")"!=d.type||a?d.indented+(a?0:h)+(a||!g||/^(?:case|default)\b/.test(e)?0:h):d.indented+n:d.column+(a?0:1)},electricInput:!1!==b.indentSwitch?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*", blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});k(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:c("auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile"),types:c("int long char short double float unsigned signed void size_t ptrdiff_t bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:c("case do else for if switch while struct"), defKeywords:c("struct"),typeFirstDefinitions:!0,atoms:c("null true false"),hooks:{"#":n,"*":A},modeProps:{fold:["brace","include"]}});k(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:c("auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"), types:c("int long char short double float unsigned signed void size_t ptrdiff_t bool wchar_t"),blockKeywords:c("catch class do else finally for if struct switch try while"),defKeywords:c("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:c("true false null"),dontIndentStatements:/^template$/,hooks:{"#":n,"*":A,u:u,U:u,L:u,R:u,0:h,1:h,2:h,3:h,4:h,5:h,6:h,7:h,8:h,9:h,token:function(a,b,c){if(b="variable"==c&&"("==a.peek()&&(";"==b.prevToken||null==b.prevToken||"}"==b.prevToken))a=a.current(), b=(a=/(\w+)::(\w+)$/.exec(a))&&a[1]==a[2];if(b)return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}});k("text/x-java",{name:"clike",keywords:c("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while"),types:c("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"), blockKeywords:c("catch class do else finally for if switch try while"),defKeywords:c("class interface package enum"),typeFirstDefinitions:!0,atoms:c("true false null"),endStatement:/^[;:]$/,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(a){a.eatWhile(/[\w\$_]/);return"meta"}},modeProps:{fold:["brace","import"]}});k("text/x-csharp",{name:"clike",keywords:c("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"), types:c("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:c("catch class do else finally for foreach if struct switch try while"),defKeywords:c("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:c("true false null"),hooks:{"@":function(a,b){if(a.eat('"'))return b.tokenize= y,y(a,b);a.eatWhile(/[\w\$_]/);return"meta"}}});k("text/x-scala",{name:"clike",keywords:c("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble :: #:: "),types:c("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"), multiLineStrings:!0,blockKeywords:c("catch class do else finally for forSome if match switch try while"),defKeywords:c("class def object package trait type val var"),atoms:c("true false null"),indentStatements:!1,indentSwitch:!1,hooks:{"@":function(a){a.eatWhile(/[\w\$_]/);return"meta"},'"':function(a,b){if(!a.match('""'))return!1;b.tokenize=E;return b.tokenize(a,b)},"'":function(a){a.eatWhile(/[\w\$_\xa1-\uffff]/);return"atom"},"=":function(a,b){var c=b.context;return"}"==c.type&&c.align&&a.eat(">")? (b.context=new D(c.indented,c.column,c.type,c.info,null,c.prev),"operator"):!1}},modeProps:{closeBrackets:{triples:'"'}}});k("text/x-kotlin",{name:"clike",keywords:c("package as typealias class interface this super val var fun for is in This throw return break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix"), types:c("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,blockKeywords:c("catch class do else finally for if where try while enum"),defKeywords:c("class val var object package interface fun"), atoms:c("true false null this"),hooks:{'"':function(a,b){b.tokenize=F(a.match('""'));return b.tokenize(a,b)}},modeProps:{closeBrackets:{triples:'"'}}});k(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:c("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:c("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:c("for while do if else struct"), builtin:c("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"), atoms:c("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"), indentSwitch:!1,hooks:{"#":n},modeProps:{fold:["brace","include"]}});k("text/x-nesc",{name:"clike",keywords:c("auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatileas atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:c("int long char short double float unsigned signed void size_t ptrdiff_t"), blockKeywords:c("case do else for if switch while struct"),atoms:c("null true false"),hooks:{"#":n},modeProps:{fold:["brace","include"]}});k("text/x-objectivec",{name:"clike",keywords:c("auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatileinline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"), types:c("int long char short double float unsigned signed void size_t ptrdiff_t"),atoms:c("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(a){a.eatWhile(/[\w\$]/);return"keyword"},"#":n,indent:function(a,b,c){if("statement"==b.type&&/^@\w/.test(c))return b.indented}},modeProps:{fold:"brace"}});k("text/x-squirrel",{name:"clike",keywords:c("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"), types:c("int long char short double float unsigned signed void size_t ptrdiff_t"),blockKeywords:c("case catch class else for foreach if switch try while"),defKeywords:c("function local class"),typeFirstDefinitions:!0,atoms:c("true false null"),hooks:{"#":n},modeProps:{fold:["brace","include"]}});var v=null;k("text/x-ceylon",{name:"clike",keywords:c("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"), types:function(a){a=a.charAt(0);return a===a.toUpperCase()&&a!==a.toLowerCase()},blockKeywords:c("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:c("class dynamic function interface module object package value"),builtin:c("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/, isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:c("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(a){a.eatWhile(/[\w\$_]/);return"meta"},'"':function(a,b){b.tokenize=C(a.match('""')?"triple":"single");return b.tokenize(a,b)},"`":function(a,b){if(!v||!a.match("`"))return!1;b.tokenize= v;v=null;return b.tokenize(a,b)},"'":function(a){a.eatWhile(/[\w\$_\xa1-\uffff]/);return"atom"},token:function(a,b,c){if(("variable"==c||"variable-3"==c)&&"."==b.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}); ================================================ FILE: app/src/main/assets/code_mirror/mode/clojure/clojure.js ================================================ 'use strict';(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){e.defineMode("clojure",function(e){function f(a){var c={};a=a.split(" ");for(var b=0;b ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"), m=f("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cat cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement completing concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare dedupe default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while eduction empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth random-sample range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transduce transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? volatile! volatile? vreset! vswap! when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"), t=f("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),g=/\d/,u=/[\d:]/,v=/[0-9a-f]/i,n=/[+-]/,w=/e/i,x=/[^\s\(\[\;\)\]]/,p=/[\w*+!\-\._?:<>\/\xa1-\uffff]/,y=/^(?:def|with)[^\/]+$|\/(?:def|with)/; return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(a,c){null==c.indentStack&&a.sol()&&(c.indentation=a.indentation());if("string"!=c.mode&&a.eatSpace())return null;switch(c.mode){case "string":for(var b,d=!1;null!=(b=a.next());){if('"'==b&&!d){c.mode=!1;break}d=!d&&"\\"==b}a="string";break;default:if(b=a.next(),'"'==b)a=c.mode="string";else if("\\"==b)(c=a.next())&&c.match(/[a-z]/)&&a.match(/[a-z]+/,!0)||"u"===c&&a.match(/[0-9a-z]{4}/i,!0),a="string-2";else if("'"!= b||u.test(a.peek()))if(";"==b)a.skipToEnd(),a="comment";else if(d=b,"0"===d&&a.eat(/x/i)?(a.eatWhile(v),d=!0):("+"!=d&&"-"!=d||!g.test(a.peek())||(a.eat(n),d=a.next()),g.test(d)?(a.eat(d),a.eatWhile(g),"."==a.peek()?(a.eat("."),a.eatWhile(g)):"/"==a.peek()&&(a.eat("/"),a.eatWhile(g)),a.eat(w)&&(a.eat(n),a.eatWhile(g)),d=!0):d=!1),d)a="number";else if("("==b||"["==b||"{"==b){var d="",e=a.column(),f;if("("==b)for(;null!=(f=a.eat(x));)d+=f;0 >= "),e=/\d/,m=/[\d:]/,n=/[0-9a-f]/i,k=/[+-]/,p=/e/i,l=/[\w*+\-]/;return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(a,b){null==b.indentStack&&a.sol()&&(b.indentation=6);if(a.eatSpace())return null;switch(b.mode){case "string":for(var d;null!=(d=a.next());)if('"'==d||"'"==d){b.mode=!1;break}a="string";break;default:var c=a.next();d=a.column();if(0<=d&&5>=d)a="def";else if(72<=d&&79>=d)a.skipToEnd(),a="header";else if("*"==c&&6==d)a.skipToEnd(), a="comment";else if('"'==c||"'"==c)a=b.mode="string";else if("'"!=c||m.test(a.peek()))if("."==c)a="link";else if(b=c,"0"===b&&a.eat(/x/i)?(a.eatWhile(n),b=!0):("+"!=b&&"-"!=b||!e.test(a.peek())||(a.eat(k),b=a.next()),e.test(b)?(a.eat(b),a.eatWhile(e),"."==a.peek()&&(a.eat("."),a.eatWhile(e)),a.eat(p)&&(a.eat(k),a.eatWhile(e)),b=!0):b=!1),b)a="number";else{if(a.current().match(l))for(;71>d&&void 0!==a.eat(l);)d++;a=g&&g.propertyIsEnumerable(a.current().toUpperCase())?"keyword":h&&h.propertyIsEnumerable(a.current().toUpperCase())? "builtin":f&&f.propertyIsEnumerable(a.current().toUpperCase())?"atom":null}else a="atom"}return a},indent:function(a){return null==a.indentStack?a.indentation:a.indentStack.indent}}});c.defineMIME("text/x-cobol","cobol")}); ================================================ FILE: app/src/main/assets/code_mirror/mode/coffeescript/coffeescript.js ================================================ 'use strict';(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){e.defineMode("coffeescript",function(e,t){function k(a){return new RegExp("^(("+a.join(")|(")+"))\\b")}function h(a,b){if(a.sol()){null===b.scope.align&&(b.scope.align=!1);var c=b.scope.offset;if(a.eatSpace())return a=a.indentation(),a>c&&"coffee"==b.scope.type?"indent":a|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,z=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/, q=/^[_A-Za-z$][_A-Za-z$0-9]*/,B=/^@[_A-Za-z$][_A-Za-z$0-9]*/,y=k("and or not is isnt in instanceof typeof".split(" ")),l="for while loop if unless else switch try catch finally class".split(" "),C=k(l.concat("break by continue debugger delete do in of new return then this @ throw when until extends".split(" "))),l=k(l),v=/^('{3}|\"{3}|['\"])/,w=/^(\/{3}|\/)/,A=k("Infinity NaN undefined null true false on off yes no".split(" "));return{startState:function(a){return{tokenize:h,scope:{offset:a||0,type:"coffee", prev:null,align:!1},prop:!1,dedent:0}},token:function(a,b){var c=null===b.scope.align&&b.scope;c&&a.sol()&&(c.align=!1);var d;d=b.tokenize(a,b);var f=a.current();"return"===f&&(b.dedent=!0);(("->"===f||"=>"===f)&&a.eol()||"indent"===d)&&n(a,b);var e="[({".indexOf(f);-1!==e&&n(a,b,"])}".slice(e,e+1));l.exec(f)&&n(a,b);"then"==f&&m(a,b);if("dedent"===d&&m(a,b))d="error";else{e="])}".indexOf(f);if(-1!==e){for(;"coffee"==b.scope.type&&b.scope.prev;)b.scope=b.scope.prev;b.scope.type==f&&(b.scope=b.scope.prev)}b.dedent&& a.eol()&&("coffee"==b.scope.type&&b.scope.prev&&(b.scope=b.scope.prev),b.dedent=!1)}d&&"comment"!=d&&(c&&(c.align=!0),b.prop="punctuation"==d&&"."==a.current());return d},indent:function(a,b){if(a.tokenize!=h)return 0;a=a.scope;var c=b&&-1<"])}".indexOf(b.charAt(0));if(c)for(;"coffee"==a.type&&a.prev;)a=a.prev;b=c&&a.type===b.charAt(0);return a.align?a.alignOffset-(b?1:0):(b?a.prev:a).offset},lineComment:"#",fold:"indent"}});e.defineMIME("text/x-coffeescript","coffeescript");e.defineMIME("text/coffeescript", "coffeescript")}); ================================================ FILE: app/src/main/assets/code_mirror/mode/commonlisp/commonlisp.js ================================================ 'use strict';(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){e.defineMode("commonlisp",function(e){function g(a){for(var b;b=a.next();)if("\\"==b)a.next();else if(!k.test(b)){a.backUp(1);break}return a.current()}function f(a,b){if(a.eatSpace())return d="ws",null;if(a.match(l))return"number";var c=a.next();"\\"==c&&(c=a.next());if('"'==c)return(b.tokenize= m)(a,b);if("("==c)return d="open","bracket";if(")"==c||"]"==c)return d="close","bracket";if(";"==c)return a.skipToEnd(),d="ws","comment";if(/['`,@]/.test(c))return null;if("|"==c){if(a.skipTo("|"))return a.next(),"symbol";a.skipToEnd();return"error"}if("#"==c)return c=a.next(),"["==c?(d="open","bracket"):/[+\-=\.']/.test(c)||/\d/.test(c)&&a.match(/^\d*#/)?null:"|"==c?(b.tokenize=n)(a,b):":"==c?(g(a),"meta"):"error";a=g(a);if("."==a)return null;d="symbol";return"nil"==a||"t"==a||":"==a.charAt(0)?"atom": "open"==b.lastType&&(p.test(a)||h.test(a))?"keyword":"&"==a.charAt(0)?"variable-2":"variable"}function m(a,b){for(var c=!1,d;d=a.next();){if('"'==d&&!c){b.tokenize=f;break}c=!c&&"\\"==d}return"string"}function n(a,b){for(var c,e;c=a.next();){if("#"==c&&"|"==e){b.tokenize=f;break}e=c}d="ws";return"comment"}var p=/^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/, h=/^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/,l=/^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/,k=/[^\s'`,@()\[\]";]/,d;return{startState:function(){return{ctx:{prev:null,start:0,indentTo:0},lastType:null,tokenize:f}},token:function(a,b){a.sol()&&"number"!=typeof b.ctx.indentTo&&(b.ctx.indentTo=b.ctx.start+1);d=null;var c=b.tokenize(a,b);"ws"!=d&&(null==b.ctx.indentTo?"symbol"==d&&h.test(a.current())?b.ctx.indentTo= b.ctx.start+e.indentUnit:b.ctx.indentTo="next":"next"==b.ctx.indentTo&&(b.ctx.indentTo=a.column()),b.lastType=d);"open"==d?b.ctx={prev:b.ctx,start:a.column(),indentTo:null}:"close"==d&&(b.ctx=b.ctx.prev||b.ctx);return c},indent:function(a,b){b=a.ctx.indentTo;return"number"==typeof b?b:a.ctx.start+1},closeBrackets:{pairs:'()[]{}""'},lineComment:";;",blockCommentStart:"#|",blockCommentEnd:"|#"}});e.defineMIME("text/x-common-lisp","commonlisp")}); ================================================ FILE: app/src/main/assets/code_mirror/mode/crystal/crystal.js ================================================ 'use strict';(function(g){"object"==typeof exports&&"object"==typeof module?g(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],g):g(CodeMirror)})(function(g){g.defineMode("crystal",function(g){function m(a,b){return new RegExp((b?"":"^")+"(?:"+a.join("|")+")"+(b?"$":"\\b"))}function h(a,b,c){c.tokenize.push(a);return a(b,c)}function r(a,b){if(a.eatSpace())return null;if("\\"!=b.lastToken&&a.match("{%",!1))return h(n("%","%"),a,b);if("\\"!=b.lastToken&& a.match("{{",!1))return h(n("{","}"),a,b);if("#"==a.peek())return a.skipToEnd(),"comment";var c;if(a.match(k))return a.eat(/[?!]/),c=a.current(),a.eat(":")?"atom":"."==b.lastToken?"property":D.test(c)?("abstract"!=b.lastToken&&E.test(c)?"fun"==c&&0<=b.blocks.indexOf("lib")||(b.blocks.push(c),b.currentIndent+=1):x.test(c)&&(b.blocks.pop(),--b.currentIndent),y.hasOwnProperty(c)&&b.tokenize.push(y[c]),"keyword"):F.test(c)?"atom":"variable";if(a.eat("@")){if("["==a.peek())return h(q("[","]","meta"),a, b);a.eat("@");a.match(k)||a.match(p);return"variable-2"}if(a.eat("$"))return a.eat(/[0-9]+|\?/)||a.match(k)||a.match(p),"variable-3";if(a.match(p))return"tag";if(a.eat(":")){if(a.eat('"'))return h(t('"',"atom",!1),a,b);if(a.match(k)||a.match(p)||a.match(u)||a.match(v)||a.match(z))return"atom";a.eat(":");return"operator"}if(a.eat('"'))return h(t('"',"string",!0),a,b);if("%"==a.peek()){c="string";var e=!0,d;if(a.match("%r"))c="string-2",d=a.next();else if(a.match("%w"))e=!1,d=a.next();else if(d=a.match(/^%([^\w\s=])/))d= d[1];else return a.match(/^%[a-zA-Z0-9_\u009F-\uFFFF]*/)?"meta":"operator";w.hasOwnProperty(d)&&(d=w[d]);return h(t(d,c,e),a,b)}if(a.eat("'"))return a.match(/^(?:[^']|\\(?:[befnrtv0'"]|[0-7]{3}|u(?:[0-9a-fA-F]{4}|\{[0-9a-fA-F]{1,6}\})))/),a.eat("'"),"atom";if(a.eat("0"))return a.eat("x")?a.match(/^[0-9a-fA-F]+/):a.eat("o")?a.match(/^[0-7]+/):a.eat("b")&&a.match(/^[01]+/),"number";if(a.eat(/\d/))return a.match(/^\d*(?:\.\d+)?(?:[eE][+-]?\d+)?/),"number";if(a.match(u))return a.eat("="),"operator";if(a.match(v)|| a.match(G))return"operator";if(c=a.match(/[({[]/,!1))return c=c[0],h(q(c,w[c],null),a,b);if(a.eat("\\"))return a.next(),"meta";a.next();return null}function q(a,b,c,e){return function(d,f){if(!e&&d.match(a))return f.tokenize[f.tokenize.length-1]=q(a,b,c,!0),f.currentIndent+=1,c;var g=r(d,f);d.current()===b&&(f.tokenize.pop(),--f.currentIndent,g=c);return g}}function n(a,b,c){return function(e,d){return!c&&e.match("{"+a)?(d.currentIndent+=1,d.tokenize[d.tokenize.length-1]=n(a,b,!0),"meta"):e.match(b+ "}")?(--d.currentIndent,d.tokenize.pop(),"meta"):r(e,d)}}function A(a,b){if(a.eatSpace())return null;a.match(k)?a.eat(/[!?]/):a.match(u)||a.match(v)||a.match(z);b.tokenize.pop();return"def"}function l(a,b){if(a.eatSpace())return null;a.match(p);b.tokenize.pop();return"def"}function t(a,b,c){return function(e,d){for(var f=!1;e.peek();)if(f)e.next(),f=!1;else{if(e.match("{%",!1)){d.tokenize.push(n("%","%"));break}if(e.match("{{",!1)){d.tokenize.push(n("{","}"));break}if(c&&e.match("#{",!1)){d.tokenize.push(q("#{", "}","meta"));break}f=e.next();if(f==a){d.tokenize.pop();break}f="\\"==f}return b}}var u=/^(?:[-+/%|&^]|\*\*?|[<>]{2})/,v=/^(?:[=!]~|===|<=>|[<>=!]=?|[|&]{2}|~)/,z=/^(?:\[\][?=]?)/,G=/^(?:\.(?:\.{2})?|->|[?:])/,k=/^[a-z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/,p=/^[A-Z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/,D=m("abstract alias as asm begin break case class def do else elsif end ensure enum extend for fun if ifdef include instance_sizeof lib macro module next of out pointerof private protected rescue return require sizeof struct super then type typeof union unless until when while with yield __DIR__ __FILE__ __LINE__".split(" ")), F=m(["true","false","nil","self"]),E=m("def fun macro class module struct lib enum union if unless case while until begin then do for ifdef".split(" ")),B=["end","else","elsif","rescue","ensure"],x=m(B),C=["\\)","\\}","\\]"],H=new RegExp("^(?:"+C.join("|")+")$"),y={def:A,fun:A,macro:function(a,b){if(a.eatSpace())return null;var c;if(c=a.match(k)){if("def"==c)return"keyword";a.eat(/[?!]/)}b.tokenize.pop();return"def"},"class":l,module:l,struct:l,lib:l,"enum":l,union:l},w={"[":"]","{":"}","(":")","<":">"}; return{startState:function(){return{tokenize:[r],currentIndent:0,lastToken:null,blocks:[]}},token:function(a,b){var c=b.tokenize[b.tokenize.length-1](a,b);a=a.current();c&&"comment"!=c&&(b.lastToken=a);return c},indent:function(a,b){b=b.replace(/^\s*(?:\{%)?\s*|\s*(?:%\})?\s*$/g,"");return x.test(b)||H.test(b)?g.indentUnit*(a.currentIndent-1):g.indentUnit*a.currentIndent},fold:"indent",electricInput:m(C.concat(B),!0),lineComment:"#"}});g.defineMIME("text/x-crystal","crystal")}); ================================================ FILE: app/src/main/assets/code_mirror/mode/css/css.js ================================================ 'use strict';(function(k){"object"==typeof exports&&"object"==typeof module?k(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],k):k(CodeMirror)})(function(k){function l(d){for(var e={},f=0;f*\/]/.test(b)?f(null,"select-op"):"."==b&&a.match(/^-?[_a-z][_a-z0-9-]*/i)?f("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(b)?f(null,b):"u"==b&&a.match(/rl(-prefix)?\(/)||"d"==b&&a.match("omain(")||"r"==b&&a.match("egexp(")?(a.backUp(1),c.tokenize=y,f("property","word")):/[\w\\\-]/.test(b)?(a.eatWhile(/[\w\\\-]/),f("property","word")):f(null,null)}function m(a){return function(c, b){for(var d=!1,e;null!=(e=c.next());){if(e==a&&!d){")"==a&&c.backUp(1);break}d=!d&&"\\"==e}if(e==a||!d&&")"!=a)b.tokenize=null;return f("string","string")}}function y(a,c){a.next();a.match(/\s*[\"\')]/,!1)?c.tokenize=null:c.tokenize=m(")");return f(null,"(")}function r(a,c,b){this.type=a;this.indent=c;this.prev=b}function h(a,c,b,d){a.context=new r(b,c.indentation()+(!1===d?0:v),a.context);return b}function n(a){a.context.prev&&(a.context=a.context.prev);return a.context.type}function q(a,c,b,d){for(d= d||1;0