mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2025-12-08 19:05:54 +00:00
initializing repo.
This commit is contained in:
parent
8875f45e38
commit
cf3a39bbcc
13
.gitignore
vendored
Normal file
13
.gitignore
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
*.iml
|
||||||
|
.gradle
|
||||||
|
/local.properties
|
||||||
|
.DS_Store
|
||||||
|
/build
|
||||||
|
/captures
|
||||||
|
.externalNativeBuild
|
||||||
|
/gradle.properties
|
||||||
|
/.idea/
|
||||||
|
/app/google-services.json
|
||||||
|
/app/db/
|
||||||
|
/app/build/
|
||||||
|
/app/src/main/res/values/secrets.xml
|
||||||
2
app/.gitignore
vendored
Normal file
2
app/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/build
|
||||||
|
/google-services.json
|
||||||
118
app/build.gradle
Normal file
118
app/build.gradle
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
apply plugin: 'com.android.application'
|
||||||
|
apply plugin: 'me.tatarka.retrolambda'
|
||||||
|
apply plugin: "com.neenbedankt.android-apt"
|
||||||
|
apply plugin: 'com.jakewharton.hugo'
|
||||||
|
apply plugin: 'com.siimkinks.sqlitemagic'
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
signing {
|
||||||
|
keyAlias ANDROID_KEY_ALIAS
|
||||||
|
keyPassword ANDROID_STORE_PASSWORD
|
||||||
|
storeFile file('StyleMe')
|
||||||
|
storePassword ANDROID_STORE_PASSWORD
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 25
|
||||||
|
buildToolsVersion "25.0.2"
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "com.fastaccess.github"
|
||||||
|
minSdkVersion 21
|
||||||
|
targetSdkVersion 25
|
||||||
|
versionCode 100
|
||||||
|
versionName "1.0.0"
|
||||||
|
signingConfig signingConfigs.signing
|
||||||
|
buildConfigField "String", "GITHUB_CLIENT_ID", "\"${GITHUB_CLIENT_ID}\""
|
||||||
|
buildConfigField "String", "GITHUB_SECRET", "\"${GITHUB_SECRET}\""
|
||||||
|
buildConfigField "String", "REDIRECT_URL", "\"${REDIRECT_URL}\""
|
||||||
|
buildConfigField "String", "REST_URL", '"https://api.github.com/"'
|
||||||
|
}
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
shrinkResources true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
res.srcDirs = [
|
||||||
|
"src/main/res/",
|
||||||
|
"src/main/res/layouts/main_layouts",
|
||||||
|
"src/main/res/layouts/row_layouts",
|
||||||
|
"src/main/res/layouts/other_layouts",
|
||||||
|
"src/main/res"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lintOptions {
|
||||||
|
abortOnError false
|
||||||
|
htmlReport true
|
||||||
|
xmlReport true
|
||||||
|
disable 'InvalidPackage'
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
all*.exclude module: 'annotations'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
retrolambda {
|
||||||
|
oldJdk System.getenv("JAVA7_HOME")
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
maven { url "https://clojars.org/repo/" }
|
||||||
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||||
|
maven { url "http://dl.bintray.com/amulyakhare/maven" }
|
||||||
|
maven { url "https://jitpack.io" }
|
||||||
|
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
|
||||||
|
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
ext {
|
||||||
|
supportVerion = "25.1.1"
|
||||||
|
firebase = "10.0.1"
|
||||||
|
thirtyinchVersion = '0.8.0-rc3'
|
||||||
|
retrofit = '2.1.0'
|
||||||
|
}
|
||||||
|
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
compile "com.android.support:appcompat-v7:${supportVerion}"
|
||||||
|
compile "com.android.support:design:${supportVerion}"
|
||||||
|
compile "com.android.support:cardview-v7:${supportVerion}"
|
||||||
|
compile "com.android.support:recyclerview-v7:${supportVerion}"
|
||||||
|
compile "com.android.support:preference-v14:${supportVerion}"
|
||||||
|
compile "com.android.support:customtabs:${supportVerion}"
|
||||||
|
compile "com.google.firebase:firebase-messaging:${firebase}"
|
||||||
|
compile "com.google.firebase:firebase-analytics:${firebase}"
|
||||||
|
compile "net.grandcentrix.thirtyinch:thirtyinch:${thirtyinchVersion}"
|
||||||
|
compile "net.grandcentrix.thirtyinch:thirtyinch-rx:${thirtyinchVersion}"
|
||||||
|
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
|
||||||
|
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
|
||||||
|
compile 'de.hdodenhof:circleimageview:2.1.0'
|
||||||
|
compile 'com.jakewharton:butterknife:8.4.0'
|
||||||
|
compile 'org.greenrobot:eventbus:3.0.0'
|
||||||
|
compile 'frankiesardo:icepick:3.1.0'
|
||||||
|
compile 'it.sephiroth.android.library.bottomnavigation:bottom-navigation:1.0.7'
|
||||||
|
compile 'pub.devrel:easypermissions:0.2.1'
|
||||||
|
compile 'io.reactivex:rxandroid:1.2.1'
|
||||||
|
compile 'io.reactivex:rxjava:1.2.2'
|
||||||
|
compile "com.squareup.retrofit2:retrofit:${retrofit}"
|
||||||
|
compile "com.squareup.retrofit2:converter-gson:${retrofit}"
|
||||||
|
compile "com.squareup.retrofit2:adapter-rxjava:${retrofit}"
|
||||||
|
compile 'com.squareup.okhttp3:logging-interceptor:3.3.1'
|
||||||
|
compile 'com.annimon:stream:1.1.4'
|
||||||
|
compile 'com.commonsware.cwac:anddown:0.3.0'
|
||||||
|
provided "org.projectlombok:lombok:1.12.6"
|
||||||
|
apt "org.projectlombok:lombok:1.12.6"
|
||||||
|
apt 'frankiesardo:icepick-processor:3.1.0'
|
||||||
|
apt 'com.jakewharton:butterknife-compiler:8.4.0'
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: "com.google.gms.google-services"
|
||||||
25
app/proguard-rules.pro
vendored
Normal file
25
app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# By default, the flags in this file are appended to flags specified
|
||||||
|
# in /Users/Kosh/Library/Android/sdk/tools/proguard/proguard-android.txt
|
||||||
|
# You can edit the include getPath and order by changing the proguardFiles
|
||||||
|
# directive in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# Add any project specific keep options here:
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Uncomment this to preserve the line number information for
|
||||||
|
# debugging stack traces.
|
||||||
|
#-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
|
# If you keep the line number information, uncomment this to
|
||||||
|
# hide the original source file name.
|
||||||
|
#-renamesourcefileattribute SourceFile
|
||||||
115
app/src/main/AndroidManifest.xml
Normal file
115
app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest package="com.fastaccess"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:name=".App"
|
||||||
|
android:allowBackup="false"
|
||||||
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
|
android:supportsRtl="true"
|
||||||
|
android:theme="@style/AppTheme">
|
||||||
|
<activity
|
||||||
|
android:name="com.fastaccess.ui.modules.main.MainView">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.modules.login.LoginView"
|
||||||
|
android:configChanges="keyboard|orientation|screenSize"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:launchMode="singleTop">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW"/>
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
<category android:name="android.intent.category.BROWSABLE"/>
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:host="fast-for-github.firebaseapp.com"
|
||||||
|
android:scheme="https"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.modules.user.UserPagerView"
|
||||||
|
android:label="@string/user"/>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.modules.repos.RepoPagerView"
|
||||||
|
android:label="@string/repo"/>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.modules.repos.issues.issue.details.IssuePagerView"
|
||||||
|
android:label="@string/issue"/>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.modules.repos.pull_requests.pull_request.details.PullRequestPagerView"
|
||||||
|
android:label="@string/pull_request"/>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.modules.repos.code.commit.details.CommitPagerView"
|
||||||
|
android:label="@string/commit"/>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.modules.code.CodeViewerView"
|
||||||
|
android:configChanges="keyboard|orientation|screenSize"
|
||||||
|
android:label="@string/viewer"/>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.modules.editor.EditorView"
|
||||||
|
android:configChanges="keyboard|orientation|screenSize"
|
||||||
|
android:label="@string/write"/>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.modules.gists.create.CreateGistView"
|
||||||
|
android:configChanges="keyboard|orientation|screenSize"
|
||||||
|
android:label="@string/create_gist"/>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.modules.gists.gist.GistView"
|
||||||
|
android:label="@string/gist"/>
|
||||||
|
|
||||||
|
<activity android:name=".ui.modules.search.SearchView"/>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.modules.parser.LinksParserActivity"
|
||||||
|
android:configChanges="keyboard|orientation|screenSize"
|
||||||
|
android:excludeFromRecents="true"
|
||||||
|
android:theme="@android:style/Theme.NoDisplay">
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW"/>
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:host="github.com"
|
||||||
|
android:scheme="http"/>
|
||||||
|
<data
|
||||||
|
android:host="github.com"
|
||||||
|
android:scheme="https"/>
|
||||||
|
|
||||||
|
<data
|
||||||
|
android:host="gist.github.com"
|
||||||
|
android:scheme="http"/>
|
||||||
|
<data
|
||||||
|
android:host="gist.github.com"
|
||||||
|
android:scheme="https"/>
|
||||||
|
|
||||||
|
<data android:pathPattern=".*"/>
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
<category android:name="android.intent.category.BROWSABLE"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
BIN
app/src/main/assets/fonts/app_font.ttf
Executable file
BIN
app/src/main/assets/fonts/app_font.ttf
Executable file
Binary file not shown.
18
app/src/main/assets/highlight/js/lang-Splus.js
Normal file
18
app/src/main/assets/highlight/js/lang-Splus.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2012 Jeffrey B. Arnold
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/],
|
||||||
|
["pun",/^(?:<<?-|->>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-aea.js
Normal file
18
app/src/main/assets/highlight/js/lang-aea.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2009 Onno Hommes.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,
|
||||||
|
null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-agc.js
Normal file
18
app/src/main/assets/highlight/js/lang-agc.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2009 Onno Hommes.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,
|
||||||
|
null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-apollo.js
Normal file
18
app/src/main/assets/highlight/js/lang-apollo.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2009 Onno Hommes.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,
|
||||||
|
null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-basic.js
Normal file
18
app/src/main/assets/highlight/js/lang-basic.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2013 Peter Kofler
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:"(?:[^\\"\r\n]|\\.)*(?:"|$))/,null,'"'],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^REM[^\r\n]*/,null],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,null],["pln",/^[A-Z][A-Z0-9]?(?:\$|%)?/i,null],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?/i,
|
||||||
|
null,"0123456789"],["pun",/^.[^\s\w\.$%"]*/,null]]),["basic","cbm"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-cbm.js
Normal file
18
app/src/main/assets/highlight/js/lang-cbm.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2013 Peter Kofler
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:"(?:[^\\"\r\n]|\\.)*(?:"|$))/,null,'"'],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^REM[^\r\n]*/,null],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,null],["pln",/^[A-Z][A-Z0-9]?(?:\$|%)?/i,null],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?/i,
|
||||||
|
null,"0123456789"],["pun",/^.[^\s\w\.$%"]*/,null]]),["basic","cbm"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-cl.js
Normal file
18
app/src/main/assets/highlight/js/lang-cl.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2008 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,
|
||||||
|
null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" "));
|
||||||
17
app/src/main/assets/highlight/js/lang-clj.js
Normal file
17
app/src/main/assets/highlight/js/lang-clj.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
Copyright (C) 2011 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[\(\{\[]+/,null,"([{"],["clo",/^[\)\}\]]+/,null,")]}"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,
|
||||||
|
null],["typ",/^:[0-9a-zA-Z\-]+/]]),["clj"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-css.js
Normal file
18
app/src/main/assets/highlight/js/lang-css.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2009 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[["str",/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],["str",/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']+)\)/i],["kwd",/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],
|
||||||
|
["com",/^(?:\x3c!--|--\x3e)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#(?:[0-9a-f]{3}){1,2}\b/i],["pln",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],["pun",/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^\)\"\']+/]]),["css-str"]);
|
||||||
19
app/src/main/assets/highlight/js/lang-dart.js
Normal file
19
app/src/main/assets/highlight/js/lang-dart.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2013 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!(?:.*)/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/(?:.*)/],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|async|await|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|sync|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i],
|
||||||
|
["typ",/^\b(?:bool|double|Dynamic|int|num|Object|String|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?[\']{3}[\s|\S]*?[^\\][\']{3}/],["str",/^r?[\"]{3}[\s|\S]*?[^\\][\"]{3}/],["str",/^r?\'(\'|(?:[^\n\r\f])*?[^\\]\')/],["str",/^r?\"(\"|(?:[^\n\r\f])*?[^\\]\")/],["typ",/^[A-Z]\w*/],["pln",/^[a-z_$][a-z0-9_]*/i],["pun",/^[~!%^&*+=|?:<>/-]/],["lit",/^\b0x[0-9a-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit",
|
||||||
|
/^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(){}\[\],.;]/]]),["dart"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-el.js
Normal file
18
app/src/main/assets/highlight/js/lang-el.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2008 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,
|
||||||
|
null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" "));
|
||||||
18
app/src/main/assets/highlight/js/lang-erl.js
Normal file
18
app/src/main/assets/highlight/js/lang-erl.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2013 Andrew Allen
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^\?[^ \t\n({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/],
|
||||||
|
["kwd",/^-[a-z_]+/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;]/]]),["erlang","erl"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-erlang.js
Normal file
18
app/src/main/assets/highlight/js/lang-erlang.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2013 Andrew Allen
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^\?[^ \t\n({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/],
|
||||||
|
["kwd",/^-[a-z_]+/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;]/]]),["erlang","erl"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-fs.js
Normal file
18
app/src/main/assets/highlight/js/lang-fs.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2008 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])(?:\'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/],
|
||||||
|
["lit",/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^(?:[a-z_][\w']*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],["pun",/^[^\t\n\r \xA0\"\'\w]+/]]),["fs","ml"]);
|
||||||
17
app/src/main/assets/highlight/js/lang-go.js
Normal file
17
app/src/main/assets/highlight/js/lang-go.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2010 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])+(?:\'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\/\*[\s\S]*?\*\/)/],["pln",/^(?:[^\/\"\'`]|\/(?![\/\*]))+/i]]),["go"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-hs.js
Normal file
18
app/src/main/assets/highlight/js/lang-hs.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2009 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])\'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:(?:--+(?:[^\r\n\x0C]*)?)|(?:\{-(?:[^-]|-+[^-\}])*-\}))/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^a-zA-Z0-9\']|$)/,
|
||||||
|
null],["pln",/^(?:[A-Z][\w\']*\.)*[a-zA-Z][\w\']*/],["pun",/^[^\t\n\x0B\x0C\r a-zA-Z0-9\'\"]+/]]),["hs"]);
|
||||||
19
app/src/main/assets/highlight/js/lang-lasso.js
Normal file
19
app/src/main/assets/highlight/js/lang-lasso.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2013 Eric Knibbe
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//],
|
||||||
|
["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i],
|
||||||
|
["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]);
|
||||||
19
app/src/main/assets/highlight/js/lang-lassoscript.js
Normal file
19
app/src/main/assets/highlight/js/lang-lassoscript.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2013 Eric Knibbe
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//],
|
||||||
|
["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i],
|
||||||
|
["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]);
|
||||||
17
app/src/main/assets/highlight/js/lang-latex.js
Normal file
17
app/src/main/assets/highlight/js/lang-latex.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2011 Martin S.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["kwd",/^\\[a-zA-Z@]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[{}()\[\]=]+/]]),["latex","tex"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-lgt.js
Normal file
18
app/src/main/assets/highlight/js/lang-lgt.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2014 Paulo Moura
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^(?:0'.|0b[0-1]+|0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\r\n]*/,null,"%"],["com",/^\/\*[\s\S]*?\*\//],["kwd",/^\s*:-\s(c(a(lls|tegory)|oinductive)|p(ublic|r(ot(ocol|ected)|ivate))|e(l(if|se)|n(coding|sure_loaded)|xport)|i(f|n(clude|itialization|fo))|alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|od(e|ule)|ultifile)|reexport|s(et_(logtalk|prolog)_flag|ynchronized)|o(bject|p)|use(s|_module))/],
|
||||||
|
["kwd",/^\s*:-\s(e(lse|nd(if|_(category|object|protocol)))|built_in|dynamic|synchronized|threaded)/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;{}:^<>=\\/+*?#!-]/]]),["logtalk","lgt"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-lisp.js
Normal file
18
app/src/main/assets/highlight/js/lang-lisp.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2008 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,
|
||||||
|
null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" "));
|
||||||
17
app/src/main/assets/highlight/js/lang-ll.js
Normal file
17
app/src/main/assets/highlight/js/lang-ll.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2013 Nikhil Dabas
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^!?\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["com",/^;[^\r\n]*/,null,";"]],[["pln",/^[%@!](?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\d+)/],["kwd",/^[A-Za-z_][0-9A-Za-z_]*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[xX][a-fA-F0-9]+)/],["pun",/^[()\[\]{},=*<>:]|\.\.\.$/]]),["llvm","ll"]);
|
||||||
17
app/src/main/assets/highlight/js/lang-llvm.js
Normal file
17
app/src/main/assets/highlight/js/lang-llvm.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2013 Nikhil Dabas
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^!?\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["com",/^;[^\r\n]*/,null,";"]],[["pln",/^[%@!](?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\d+)/],["kwd",/^[A-Za-z_][0-9A-Za-z_]*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[xX][a-fA-F0-9]+)/],["pun",/^[()\[\]{},=*<>:]|\.\.\.$/]]),["llvm","ll"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-logtalk.js
Normal file
18
app/src/main/assets/highlight/js/lang-logtalk.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2014 Paulo Moura
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^(?:0'.|0b[0-1]+|0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\r\n]*/,null,"%"],["com",/^\/\*[\s\S]*?\*\//],["kwd",/^\s*:-\s(c(a(lls|tegory)|oinductive)|p(ublic|r(ot(ocol|ected)|ivate))|e(l(if|se)|n(coding|sure_loaded)|xport)|i(f|n(clude|itialization|fo))|alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|od(e|ule)|ultifile)|reexport|s(et_(logtalk|prolog)_flag|ynchronized)|o(bject|p)|use(s|_module))/],
|
||||||
|
["kwd",/^\s*:-\s(e(lse|nd(if|_(category|object|protocol)))|built_in|dynamic|synchronized|threaded)/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;{}:^<>=\\/+*?#!-]/]]),["logtalk","lgt"]);
|
||||||
19
app/src/main/assets/highlight/js/lang-ls.js
Normal file
19
app/src/main/assets/highlight/js/lang-ls.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2013 Eric Knibbe
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//],
|
||||||
|
["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i],
|
||||||
|
["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-lsp.js
Normal file
18
app/src/main/assets/highlight/js/lang-lsp.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2008 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,
|
||||||
|
null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" "));
|
||||||
18
app/src/main/assets/highlight/js/lang-lua.js
Normal file
18
app/src/main/assets/highlight/js/lang-lua.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2008 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\s\S]*?(?:\]\1\]|$)|[^\r\n]*)/],["str",/^\[(=*)\[[\s\S]*?(?:\]\1\]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],
|
||||||
|
["pln",/^[a-z_]\w*/i],["pun",/^[^\w\t\n\r \xA0][^\w\t\n\r \xA0\"\'\-\+=]*/]]),["lua"]);
|
||||||
29
app/src/main/assets/highlight/js/lang-matlab.js
Normal file
29
app/src/main/assets/highlight/js/lang-matlab.js
Normal file
File diff suppressed because one or more lines are too long
18
app/src/main/assets/highlight/js/lang-ml.js
Normal file
18
app/src/main/assets/highlight/js/lang-ml.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2008 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])(?:\'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/],
|
||||||
|
["lit",/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^(?:[a-z_][\w']*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],["pun",/^[^\t\n\r \xA0\"\'\w]+/]]),["fs","ml"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-mumps.js
Normal file
18
app/src/main/assets/highlight/js/lang-mumps.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2011 Kitware Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"]|\\.)*")/,null,'"']],[["com",/^;[^\r\n]*/,null,";"],["dec",/^(?:\$(?:D|DEVICE|EC|ECODE|ES|ESTACK|ET|ETRAP|H|HOROLOG|I|IO|J|JOB|K|KEY|P|PRINCIPAL|Q|QUIT|ST|STACK|S|STORAGE|SY|SYSTEM|T|TEST|TL|TLEVEL|TR|TRESTART|X|Y|Z[A-Z]*|A|ASCII|C|CHAR|D|DATA|E|EXTRACT|F|FIND|FN|FNUMBER|G|GET|J|JUSTIFY|L|LENGTH|NA|NAME|O|ORDER|P|PIECE|QL|QLENGTH|QS|QSUBSCRIPT|Q|QUERY|R|RANDOM|RE|REVERSE|S|SELECT|ST|STACK|T|TEXT|TR|TRANSLATE|NaN))\b/i,
|
||||||
|
null],["kwd",/^(?:[^\$]B|BREAK|C|CLOSE|D|DO|E|ELSE|F|FOR|G|GOTO|H|HALT|H|HANG|I|IF|J|JOB|K|KILL|L|LOCK|M|MERGE|N|NEW|O|OPEN|Q|QUIT|R|READ|S|SET|TC|TCOMMIT|TRE|TRESTART|TRO|TROLLBACK|TS|TSTART|U|USE|V|VIEW|W|WRITE|X|XECUTE)\b/i,null],["lit",/^[+-]?(?:(?:\.\d+|\d+(?:\.\d*)?)(?:E[+\-]?\d+)?)/i],["pln",/^[a-z][a-zA-Z0-9]*/i],["pun",/^[^\w\t\n\r\xA0\"\$;%\^]|_/]]),["mumps"]);
|
||||||
19
app/src/main/assets/highlight/js/lang-n.js
Normal file
19
app/src/main/assets/highlight/js/lang-n.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2011 Zimin A.V.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*\'|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null],["str",/^<#(?:[^#>])*(?:#>|$)/,null],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null],["com",/^\/\/[^\r\n]*/,
|
||||||
|
null],["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/,
|
||||||
|
null],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,null],["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^@[A-Z]+[a-z][A-Za-z_$@0-9]*/,null],["pln",/^'?[A-Za-z_$][a-z_$@0-9]*/i,null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\"\`\/\#]*/,null]]),["n","nemerle"]);
|
||||||
19
app/src/main/assets/highlight/js/lang-nemerle.js
Normal file
19
app/src/main/assets/highlight/js/lang-nemerle.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2011 Zimin A.V.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*\'|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null],["str",/^<#(?:[^#>])*(?:#>|$)/,null],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null],["com",/^\/\/[^\r\n]*/,
|
||||||
|
null],["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/,
|
||||||
|
null],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,null],["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^@[A-Z]+[a-z][A-Za-z_$@0-9]*/,null],["pln",/^'?[A-Za-z_$][a-z_$@0-9]*/i,null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\"\`\/\#]*/,null]]),["n","nemerle"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-pascal.js
Normal file
18
app/src/main/assets/highlight/js/lang-pascal.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2013 Peter Kofler
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$))/,null,"'"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^\(\*[\s\S]*?(?:\*\)|$)|^\{[\s\S]*?(?:\}|$)/,null],["kwd",/^(?:ABSOLUTE|AND|ARRAY|ASM|ASSEMBLER|BEGIN|CASE|CONST|CONSTRUCTOR|DESTRUCTOR|DIV|DO|DOWNTO|ELSE|END|EXTERNAL|FOR|FORWARD|FUNCTION|GOTO|IF|IMPLEMENTATION|IN|INLINE|INTERFACE|INTERRUPT|LABEL|MOD|NOT|OBJECT|OF|OR|PACKED|PROCEDURE|PROGRAM|RECORD|REPEAT|SET|SHL|SHR|THEN|TO|TYPE|UNIT|UNTIL|USES|VAR|VIRTUAL|WHILE|WITH|XOR)\b/i,
|
||||||
|
null],["lit",/^(?:true|false|self|nil)/i,null],["pln",/^[a-z][a-z0-9]*/i,null],["lit",/^(?:\$[a-f0-9]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?)/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\/]*/,null]]),["pascal"]);
|
||||||
17
app/src/main/assets/highlight/js/lang-proto.js
Normal file
17
app/src/main/assets/highlight/js/lang-proto.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2006 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-r.js
Normal file
18
app/src/main/assets/highlight/js/lang-r.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2012 Jeffrey B. Arnold
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/],
|
||||||
|
["pun",/^(?:<<?-|->>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]);
|
||||||
17
app/src/main/assets/highlight/js/lang-rd.js
Normal file
17
app/src/main/assets/highlight/js/lang-rd.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2012 Jeffrey Arnold
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[a-zA-Z@]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[{}()\[\]]+/]]),["Rd","rd"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-rkt.js
Normal file
18
app/src/main/assets/highlight/js/lang-rkt.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2008 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,
|
||||||
|
null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" "));
|
||||||
20
app/src/main/assets/highlight/js/lang-rust.js
Normal file
20
app/src/main/assets/highlight/js/lang-rust.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2015 Chris Morgan
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([],[["pln",/^[\t\n\r \xA0]+/],["com",/^\/\/.*/],["com",/^\/\*[\s\S]*?(?:\*\/|$)/],["str",/^b"(?:[^\\]|\\(?:.|x[\da-fA-F]{2}))*?"/],["str",/^"(?:[^\\]|\\(?:.|x[\da-fA-F]{2}|u\{\[\da-fA-F]{1,6}\}))*?"/],["str",/^b?r(#*)\"[\s\S]*?\"\1/],["str",/^b'([^\\]|\\(.|x[\da-fA-F]{2}))'/],["str",/^'([^\\]|\\(.|x[\da-fA-F]{2}|u\{[\da-fA-F]{1,6}\}))'/],["tag",/^'\w+?\b/],["kwd",/^(?:match|if|else|as|break|box|continue|extern|fn|for|in|if|impl|let|loop|pub|return|super|unsafe|where|while|use|mod|trait|struct|enum|type|move|mut|ref|static|const|crate)\b/],
|
||||||
|
["kwd",/^(?:alignof|become|do|offsetof|priv|pure|sizeof|typeof|unsized|yield|abstract|virtual|final|override|macro)\b/],["typ",/^(?:[iu](8|16|32|64|size)|char|bool|f32|f64|str|Self)\b/],["typ",/^(?:Copy|Send|Sized|Sync|Drop|Fn|FnMut|FnOnce|Box|ToOwned|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator|Option|Some|None|Result|Ok|Err|SliceConcatExt|String|ToString|Vec)\b/],["lit",/^(self|true|false|null)\b/],
|
||||||
|
["lit",/^\d[0-9_]*(?:[iu](?:size|8|16|32|64))?/],["lit",/^0x[a-fA-F0-9_]+(?:[iu](?:size|8|16|32|64))?/],["lit",/^0o[0-7_]+(?:[iu](?:size|8|16|32|64))?/],["lit",/^0b[01_]+(?:[iu](?:size|8|16|32|64))?/],["lit",/^\d[0-9_]*\.(?![^\s\d.])/],["lit",/^\d[0-9_]*(?:\.\d[0-9_]*)(?:[eE][+-]?[0-9_]+)?(?:f32|f64)?/],["lit",/^\d[0-9_]*(?:\.\d[0-9_]*)?(?:[eE][+-]?[0-9_]+)(?:f32|f64)?/],["lit",/^\d[0-9_]*(?:\.\d[0-9_]*)?(?:[eE][+-]?[0-9_]+)?(?:f32|f64)/],
|
||||||
|
["atn",/^[a-z_]\w*!/i],["pln",/^[a-z_]\w*/i],["atv",/^#!?\[[\s\S]*?\]/],["pun",/^[+\-/*=^&|!<>%[\](){}?:.,;]/],["pln",/./]]),["rust"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-s.js
Normal file
18
app/src/main/assets/highlight/js/lang-s.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2012 Jeffrey B. Arnold
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/],
|
||||||
|
["pun",/^(?:<<?-|->>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-scala.js
Normal file
18
app/src/main/assets/highlight/js/lang-scala.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2010 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:(?:""(?:""?(?!")|[^\\"]|\\.)*"{0,3})|(?:[^"\r\n\\]|\\.)*"?))/,null,'"'],["lit",/^`(?:[^\r\n\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&()*+,\-:;<=>?@\[\\\]^{|}~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\r\n\\']|\\(?:'|[^\r\n']+))'/],["lit",/^'[a-zA-Z_$][\w$]*(?!['$\w])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/],
|
||||||
|
["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:(?:0(?:[0-7]+|X[0-9A-F]+))L?|(?:(?:0|[1-9][0-9]*)(?:(?:\.[0-9]+)?(?:E[+\-]?[0-9]+)?F?|L?))|\\.[0-9]+(?:E[+\-]?[0-9]+)?F?)/i],["typ",/^[$_]*[A-Z][_$A-Z0-9]*[a-z][\w$]*/],["pln",/^[$a-zA-Z_][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-scm.js
Normal file
18
app/src/main/assets/highlight/js/lang-scm.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2008 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,
|
||||||
|
null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" "));
|
||||||
18
app/src/main/assets/highlight/js/lang-sql.js
Normal file
18
app/src/main/assets/highlight/js/lang-sql.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2008 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/],["kwd",/^(?:ADD|ALL|ALTER|AND|ANY|APPLY|AS|ASC|AUTHORIZATION|BACKUP|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|COMPUTE|CONNECT|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|ELSE|END|ERRLVL|ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FOLLOWING|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LINENO|LOAD|MATCH|MATCHED|MERGE|NATURAL|NATIONAL|NOCHECK|NONCLUSTERED|NOCYCLE|NOT|NULL|NULLIF|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUTER|OVER|PARTITION|PERCENT|PIVOT|PLAN|PRECEDING|PRECISION|PRIMARY|PRINT|PROC|PROCEDURE|PUBLIC|RAISERROR|READ|READTEXT|RECONFIGURE|REFERENCES|REPLICATION|RESTORE|RESTRICT|RETURN|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|ROWGUIDCOL|ROWS?|RULE|SAVE|SCHEMA|SELECT|SESSION_USER|SET|SETUSER|SHUTDOWN|SOME|START|STATISTICS|SYSTEM_USER|TABLE|TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|UNBOUNDED|UNION|UNIQUE|UNPIVOT|UPDATE|UPDATETEXT|USE|USER|USING|VALUES|VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WITHIN|WRITETEXT|XML)(?=[^\w-]|$)/i,
|
||||||
|
null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^[a-z_][\w-]*/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0+\-\"\']*/]]),["sql"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-ss.js
Normal file
18
app/src/main/assets/highlight/js/lang-ss.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2008 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,
|
||||||
|
null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" "));
|
||||||
16
app/src/main/assets/highlight/js/lang-swift.js
Normal file
16
app/src/main/assets/highlight/js/lang-swift.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2015 Google Inc.
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \n\r\t\v\f\0]+/,null," \n\r\t\v\f\x00"],["str",/^"(?:[^"\\]|(?:\\.)|(?:\\\((?:[^"\\)]|\\.)*\)))*"/,null,'"']],[["lit",/^(?:(?:0x[\da-fA-F][\da-fA-F_]*\.[\da-fA-F][\da-fA-F_]*[pP]?)|(?:\d[\d_]*\.\d[\d_]*[eE]?))[+-]?\d[\d_]*/,null],["lit",/^-?(?:(?:0(?:(?:b[01][01_]*)|(?:o[0-7][0-7_]*)|(?:x[\da-fA-F][\da-fA-F_]*)))|(?:\d[\d_]*))/,null],["lit",/^(?:true|false|nil)\b/,null],["kwd",/^\b(?:__COLUMN__|__FILE__|__FUNCTION__|__LINE__|#available|#else|#elseif|#endif|#if|#line|arch|arm|arm64|associativity|as|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|dynamicType|else|enum|fallthrough|final|for|func|get|import|indirect|infix|init|inout|internal|i386|if|in|iOS|iOSApplicationExtension|is|lazy|left|let|mutating|none|nonmutating|operator|optional|OSX|OSXApplicationExtension|override|postfix|precedence|prefix|private|protocol|Protocol|public|required|rethrows|return|right|safe|self|set|static|struct|subscript|super|switch|throw|try|Type|typealias|unowned|unsafe|var|weak|watchOS|while|willSet|x86_64)\b/,
|
||||||
|
null],["com",/^\/\/.*?[\n\r]/,null],["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null],["pun",/^<<=|<=|<<|>>=|>=|>>|===|==|\.\.\.|&&=|\.\.<|!==|!=|&=|~=|~|\(|\)|\[|\]|{|}|@|#|;|\.|,|:|\|\|=|\?\?|\|\||&&|&\*|&\+|&-|&=|\+=|-=|\/=|\*=|\^=|%=|\|=|->|`|==|\+\+|--|\/|\+|!|\*|%|<|>|&|\||\^|\?|=|-|_/,null],["typ",/^\b(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null]]),["swift"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-tcl.js
Normal file
18
app/src/main/assets/highlight/js/lang-tcl.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2012 Pyrios
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\{+/,null,"{"],["clo",/^\}+/,null,"}"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:after|append|apply|array|break|case|catch|continue|error|eval|exec|exit|expr|for|foreach|if|incr|info|proc|return|set|switch|trace|uplevel|upvar|while)\b/,null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],
|
||||||
|
["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["tcl"]);
|
||||||
17
app/src/main/assets/highlight/js/lang-tex.js
Normal file
17
app/src/main/assets/highlight/js/lang-tex.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2011 Martin S.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["kwd",/^\\[a-zA-Z@]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[{}()\[\]=]+/]]),["latex","tex"]);
|
||||||
19
app/src/main/assets/highlight/js/lang-vb.js
Normal file
19
app/src/main/assets/highlight/js/lang-vb.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2009 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})(?:[\"\u201C\u201D]c|$)|[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})*(?:[\"\u201C\u201D]|$))/i,null,'"\u201c\u201d'],["com",/^[\'\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\r\n_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:AddHandler|AddressOf|Alias|And|AndAlso|Ansi|As|Assembly|Auto|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|Class|CLng|CObj|Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|New|Next|Not|NotInheritable|NotOverridable|Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Preserve|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TypeOf|Unicode|Until|Variant|Wend|When|While|With|WithEvents|WriteOnly|Xor|EndIf|GoSub|Let|Variant|Wend)\b/i,
|
||||||
|
null],["com",/^REM\b[^\r\n\u2028\u2029]*/i],["lit",/^(?:True\b|False\b|Nothing\b|\d+(?:E[+\-]?\d+[FRD]?|[FRDSIL])?|(?:&H[0-9A-F]+|&O[0-7]+)[SIL]?|\d*\.\d+(?:E[+\-]?\d+)?[FRD]?|#\s+(?:\d+[\-\/]\d+[\-\/]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)?|\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[%&@!#]+\])?|\[(?:[a-z]|_\w)\w*\])/i],["pun",/^[^\w\t\n\r \"\'\[\]\xA0\u2018\u2019\u201C\u201D\u2028\u2029]+/],["pun",/^(?:\[|\])/]]),["vb",
|
||||||
|
"vbs"]);
|
||||||
19
app/src/main/assets/highlight/js/lang-vbs.js
Normal file
19
app/src/main/assets/highlight/js/lang-vbs.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2009 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})(?:[\"\u201C\u201D]c|$)|[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})*(?:[\"\u201C\u201D]|$))/i,null,'"\u201c\u201d'],["com",/^[\'\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\r\n_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:AddHandler|AddressOf|Alias|And|AndAlso|Ansi|As|Assembly|Auto|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|Class|CLng|CObj|Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|New|Next|Not|NotInheritable|NotOverridable|Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Preserve|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TypeOf|Unicode|Until|Variant|Wend|When|While|With|WithEvents|WriteOnly|Xor|EndIf|GoSub|Let|Variant|Wend)\b/i,
|
||||||
|
null],["com",/^REM\b[^\r\n\u2028\u2029]*/i],["lit",/^(?:True\b|False\b|Nothing\b|\d+(?:E[+\-]?\d+[FRD]?|[FRDSIL])?|(?:&H[0-9A-F]+|&O[0-7]+)[SIL]?|\d*\.\d+(?:E[+\-]?\d+)?[FRD]?|#\s+(?:\d+[\-\/]\d+[\-\/]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)?|\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[%&@!#]+\])?|\[(?:[a-z]|_\w)\w*\])/i],["pun",/^[^\w\t\n\r \"\'\[\]\xA0\u2018\u2019\u201C\u201D\u2028\u2029]+/],["pun",/^(?:\[|\])/]]),["vb",
|
||||||
|
"vbs"]);
|
||||||
19
app/src/main/assets/highlight/js/lang-vhd.js
Normal file
19
app/src/main/assets/highlight/js/lang-vhd.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2010 benoit@ryder.fr
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[BOX]?"(?:[^\"]|"")*"|'.')/i],["com",/^--[^\r\n]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i,
|
||||||
|
null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^\'(?:ACTIVE|ASCENDING|BASE|DELAYED|DRIVING|DRIVING_VALUE|EVENT|HIGH|IMAGE|INSTANCE_NAME|LAST_ACTIVE|LAST_EVENT|LAST_VALUE|LEFT|LEFTOF|LENGTH|LOW|PATH_NAME|POS|PRED|QUIET|RANGE|REVERSE_RANGE|RIGHT|RIGHTOF|SIMPLE_NAME|STABLE|SUCC|TRANSACTION|VAL|VALUE)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w\\.]+#(?:[+\-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:E[+\-]?\d+(?:_\d+)*)?)/i],
|
||||||
|
["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0\-\"\']*/]]),["vhdl","vhd"]);
|
||||||
19
app/src/main/assets/highlight/js/lang-vhdl.js
Normal file
19
app/src/main/assets/highlight/js/lang-vhdl.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2010 benoit@ryder.fr
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[BOX]?"(?:[^\"]|"")*"|'.')/i],["com",/^--[^\r\n]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i,
|
||||||
|
null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^\'(?:ACTIVE|ASCENDING|BASE|DELAYED|DRIVING|DRIVING_VALUE|EVENT|HIGH|IMAGE|INSTANCE_NAME|LAST_ACTIVE|LAST_EVENT|LAST_VALUE|LEFT|LEFTOF|LENGTH|LOW|PATH_NAME|POS|PRED|QUIET|RANGE|REVERSE_RANGE|RIGHT|RIGHTOF|SIMPLE_NAME|STABLE|SUCC|TRANSACTION|VAL|VALUE)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w\\.]+#(?:[+\-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:E[+\-]?\d+(?:_\d+)*)?)/i],
|
||||||
|
["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0\-\"\']*/]]),["vhdl","vhd"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-wiki.js
Normal file
18
app/src/main/assets/highlight/js/lang-wiki.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2009 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t \xA0a-gi-z0-9]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[=*~\^\[\]]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^(?:[A-Z][a-z][a-z0-9]+[A-Z][a-z][a-zA-Z0-9]+)\b/],["lang-",/^\{\{\{([\s\S]+?)\}\}\}/],["lang-",/^`([^\r\n`]+)`/],["str",/^https?:\/\/[^\/?#\s]*(?:\/[^?#\s]*)?(?:\?[^#\s]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\s\S])[^#=*~^A-Zh\{`\[\r\n]*/]]),["wiki"]);
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]);
|
||||||
19
app/src/main/assets/highlight/js/lang-xq.js
Normal file
19
app/src/main/assets/highlight/js/lang-xq.js
Normal file
File diff suppressed because one or more lines are too long
19
app/src/main/assets/highlight/js/lang-xquery.js
Normal file
19
app/src/main/assets/highlight/js/lang-xquery.js
Normal file
File diff suppressed because one or more lines are too long
18
app/src/main/assets/highlight/js/lang-yaml.js
Normal file
18
app/src/main/assets/highlight/js/lang-yaml.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2015 ribrdb @ code.google.com
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:|>?]+/,null,":|>?"],["dec",/^%(?:YAML|TAG)[^#\r\n]+/,null,"%"],["typ",/^[&]\S+/,null,"&"],["typ",/^!\S*/,null,"!"],["str",/^"(?:[^\\"]|\\.)*(?:"|$)/,null,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,null,"'"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^\s+/,null," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\r\n]|$)/],["pun",/^-/],["kwd",/^[\w-]+:[ \r\n]/],["pln",
|
||||||
|
/^\w+/]]),["yaml","yml"]);
|
||||||
18
app/src/main/assets/highlight/js/lang-yml.js
Normal file
18
app/src/main/assets/highlight/js/lang-yml.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (C) 2015 ribrdb @ code.google.com
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:|>?]+/,null,":|>?"],["dec",/^%(?:YAML|TAG)[^#\r\n]+/,null,"%"],["typ",/^[&]\S+/,null,"&"],["typ",/^!\S*/,null,"!"],["str",/^"(?:[^\\"]|\\.)*(?:"|$)/,null,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,null,"'"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^\s+/,null," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\r\n]|$)/],["pun",/^-/],["kwd",/^[\w-]+:[ \r\n]/],["pln",
|
||||||
|
/^\w+/]]),["yaml","yml"]);
|
||||||
46
app/src/main/assets/highlight/js/prettify.js
Normal file
46
app/src/main/assets/highlight/js/prettify.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
!function(){/*
|
||||||
|
|
||||||
|
Copyright (C) 2006 Google Inc.
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
window.PR_SHOULD_USE_CONTINUATION=!0;
|
||||||
|
(function(){function T(a){function d(e){var b=e.charCodeAt(0);if(92!==b)return b;var a=e.charAt(1);return(b=w[a])?b:"0"<=a&&"7">=a?parseInt(e.substring(1),8):"u"===a||"x"===a?parseInt(e.substring(2),16):e.charCodeAt(1)}function f(e){if(32>e)return(16>e?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return"\\"===e||"-"===e||"]"===e||"^"===e?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[0-9A-Fa-f]{4}|\\x[0-9A-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\s\S]|-|[^-\\]/g);e=
|
||||||
|
[];var a="^"===b[0],c=["["];a&&c.push("^");for(var a=a?1:0,g=b.length;a<g;++a){var h=b[a];if(/\\[bdsw]/i.test(h))c.push(h);else{var h=d(h),k;a+2<g&&"-"===b[a+1]?(k=d(b[a+2]),a+=2):k=h;e.push([h,k]);65>k||122<h||(65>k||90<h||e.push([Math.max(65,h)|32,Math.min(k,90)|32]),97>k||122<h||e.push([Math.max(97,h)&-33,Math.min(k,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];g=[];for(a=0;a<e.length;++a)h=e[a],h[0]<=g[1]+1?g[1]=Math.max(g[1],h[1]):b.push(g=h);for(a=0;a<b.length;++a)h=b[a],
|
||||||
|
c.push(f(h[0])),h[1]>h[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(f(h[1])));c.push("]");return c.join("")}function v(e){for(var a=e.source.match(/(?:\[(?:[^\x5C\x5D]|\\[\s\S])*\]|\\u[A-Fa-f0-9]{4}|\\x[A-Fa-f0-9]{2}|\\[0-9]+|\\[^ux0-9]|\(\?[:!=]|[\(\)\^]|[^\x5B\x5C\(\)\^]+)/g),c=a.length,d=[],g=0,h=0;g<c;++g){var k=a[g];"("===k?++h:"\\"===k.charAt(0)&&(k=+k.substring(1))&&(k<=h?d[k]=-1:a[g]=f(k))}for(g=1;g<d.length;++g)-1===d[g]&&(d[g]=++A);for(h=g=0;g<c;++g)k=a[g],"("===k?(++h,d[h]||(a[g]="(?:")):"\\"===
|
||||||
|
k.charAt(0)&&(k=+k.substring(1))&&k<=h&&(a[g]="\\"+d[k]);for(g=0;g<c;++g)"^"===a[g]&&"^"!==a[g+1]&&(a[g]="");if(e.ignoreCase&&n)for(g=0;g<c;++g)k=a[g],e=k.charAt(0),2<=k.length&&"["===e?a[g]=b(k):"\\"!==e&&(a[g]=k.replace(/[a-zA-Z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var A=0,n=!1,l=!1,m=0,c=a.length;m<c;++m){var p=a[m];if(p.ignoreCase)l=!0;else if(/[a-z]/i.test(p.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){n=!0;
|
||||||
|
l=!1;break}}for(var w={b:8,t:9,n:10,v:11,f:12,r:13},r=[],m=0,c=a.length;m<c;++m){p=a[m];if(p.global||p.multiline)throw Error(""+p);r.push("(?:"+v(p)+")")}return new RegExp(r.join("|"),l?"gi":"g")}function U(a,d){function f(a){var c=a.nodeType;if(1==c){if(!b.test(a.className)){for(c=a.firstChild;c;c=c.nextSibling)f(c);c=a.nodeName.toLowerCase();if("br"===c||"li"===c)v[l]="\n",n[l<<1]=A++,n[l++<<1|1]=a}}else if(3==c||4==c)c=a.nodeValue,c.length&&(c=d?c.replace(/\r\n?/g,"\n"):c.replace(/[ \t\r\n]+/g,
|
||||||
|
" "),v[l]=c,n[l<<1]=A,A+=c.length,n[l++<<1|1]=a)}var b=/(?:^|\s)nocode(?:\s|$)/,v=[],A=0,n=[],l=0;f(a);return{a:v.join("").replace(/\n$/,""),c:n}}function J(a,d,f,b,v){f&&(a={h:a,l:1,j:null,m:null,a:f,c:null,i:d,g:null},b(a),v.push.apply(v,a.g))}function V(a){for(var d=void 0,f=a.firstChild;f;f=f.nextSibling)var b=f.nodeType,d=1===b?d?a:f:3===b?W.test(f.nodeValue)?a:d:d;return d===a?void 0:d}function G(a,d){function f(a){for(var l=a.i,m=a.h,c=[l,"pln"],p=0,w=a.a.match(v)||[],r={},e=0,t=w.length;e<
|
||||||
|
t;++e){var z=w[e],q=r[z],g=void 0,h;if("string"===typeof q)h=!1;else{var k=b[z.charAt(0)];if(k)g=z.match(k[1]),q=k[0];else{for(h=0;h<A;++h)if(k=d[h],g=z.match(k[1])){q=k[0];break}g||(q="pln")}!(h=5<=q.length&&"lang-"===q.substring(0,5))||g&&"string"===typeof g[1]||(h=!1,q="src");h||(r[z]=q)}k=p;p+=z.length;if(h){h=g[1];var B=z.indexOf(h),D=B+h.length;g[2]&&(D=z.length-g[2].length,B=D-h.length);q=q.substring(5);J(m,l+k,z.substring(0,B),f,c);J(m,l+k+B,h,K(q,h),c);J(m,l+k+D,z.substring(D),f,c)}else c.push(l+
|
||||||
|
k,q)}a.g=c}var b={},v;(function(){for(var f=a.concat(d),l=[],m={},c=0,p=f.length;c<p;++c){var w=f[c],r=w[3];if(r)for(var e=r.length;0<=--e;)b[r.charAt(e)]=w;w=w[1];r=""+w;m.hasOwnProperty(r)||(l.push(w),m[r]=null)}l.push(/[\0-\uffff]/);v=T(l)})();var A=d.length;return f}function y(a){var d=[],f=[];a.tripleQuotedStrings?d.push(["str",/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
|
||||||
|
null,"'\""]):a.multiLineStrings?d.push(["str",/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):d.push(["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]);a.verbatimStrings&&f.push(["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var b=a.hashComments;b&&(a.cStyleComments?(1<b?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,
|
||||||
|
null,"#"]),f.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):d.push(["com",/^#[^\r\n]*/,null,"#"]));a.cStyleComments&&(f.push(["com",/^\/\/[^\r\n]*/,null]),f.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));if(b=a.regexLiterals){var v=(b=1<b?"":"\n\r")?".":"[\\S\\s]";f.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+
|
||||||
|
("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+v+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+v+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&f.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&f.push(["kwd",new RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),null]);d.push(["pln",/^\s+/,null," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");f.push(["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],["pln",/^[a-z_$][a-z_$@0-9]*/i,
|
||||||
|
null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pln",/^\\[\s\S]?/,null],["pun",new RegExp(b),null]);return G(d,f)}function L(a,d,f){function b(a){var c=a.nodeType;if(1==c&&!A.test(a.className))if("br"===a.nodeName)v(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((3==c||4==c)&&f){var d=a.nodeValue,q=d.match(n);q&&(c=d.substring(0,q.index),a.nodeValue=c,(d=d.substring(q.index+q[0].length))&&
|
||||||
|
a.parentNode.insertBefore(l.createTextNode(d),a.nextSibling),v(a),c||a.parentNode.removeChild(a))}}function v(a){function b(a,c){var d=c?a.cloneNode(!1):a,k=a.parentNode;if(k){var k=b(k,1),e=a.nextSibling;k.appendChild(d);for(var f=e;f;f=e)e=f.nextSibling,k.appendChild(f)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;a=b(a.nextSibling,0);for(var d;(d=a.parentNode)&&1===d.nodeType;)a=d;c.push(a)}for(var A=/(?:^|\s)nocode(?:\s|$)/,n=/\r\n?|\n/,l=a.ownerDocument,m=l.createElement("li");a.firstChild;)m.appendChild(a.firstChild);
|
||||||
|
for(var c=[m],p=0;p<c.length;++p)b(c[p]);d===(d|0)&&c[0].setAttribute("value",d);var w=l.createElement("ol");w.className="linenums";d=Math.max(0,d-1|0)||0;for(var p=0,r=c.length;p<r;++p)m=c[p],m.className="L"+(p+d)%10,m.firstChild||m.appendChild(l.createTextNode("\u00a0")),w.appendChild(m);a.appendChild(w)}function t(a,d){for(var f=d.length;0<=--f;){var b=d[f];I.hasOwnProperty(b)?E.console&&console.warn("cannot override language handler %s",b):I[b]=a}}function K(a,d){a&&I.hasOwnProperty(a)||(a=/^\s*</.test(d)?
|
||||||
|
"default-markup":"default-code");return I[a]}function M(a){var d=a.j;try{var f=U(a.h,a.l),b=f.a;a.a=b;a.c=f.c;a.i=0;K(d,b)(a);var v=/\bMSIE\s(\d+)/.exec(navigator.userAgent),v=v&&8>=+v[1],d=/\n/g,A=a.a,n=A.length,f=0,l=a.c,m=l.length,b=0,c=a.g,p=c.length,w=0;c[p]=n;var r,e;for(e=r=0;e<p;)c[e]!==c[e+2]?(c[r++]=c[e++],c[r++]=c[e++]):e+=2;p=r;for(e=r=0;e<p;){for(var t=c[e],z=c[e+1],q=e+2;q+2<=p&&c[q+1]===z;)q+=2;c[r++]=t;c[r++]=z;e=q}c.length=r;var g=a.h;a="";g&&(a=g.style.display,g.style.display="none");
|
||||||
|
try{for(;b<m;){var h=l[b+2]||n,k=c[w+2]||n,q=Math.min(h,k),B=l[b+1],D;if(1!==B.nodeType&&(D=A.substring(f,q))){v&&(D=D.replace(d,"\r"));B.nodeValue=D;var N=B.ownerDocument,u=N.createElement("span");u.className=c[w+1];var y=B.parentNode;y.replaceChild(u,B);u.appendChild(B);f<h&&(l[b+1]=B=N.createTextNode(A.substring(q,h)),y.insertBefore(B,u.nextSibling))}f=q;f>=h&&(b+=2);f>=k&&(w+=2)}}finally{g&&(g.style.display=a)}}catch(x){E.console&&console.log(x&&x.stack||x)}}var E=window,C=["break,continue,do,else,for,if,return,while"],
|
||||||
|
F=[[C,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],H=[F,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],
|
||||||
|
O=[F,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],P=[F,"abstract,as,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],F=[F,"debugger,eval,export,function,get,instanceof,null,set,undefined,var,with,Infinity,NaN"],
|
||||||
|
Q=[C,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],R=[C,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],C=[C,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,
|
||||||
|
W=/\S/,X=y({keywords:[H,P,O,F,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",Q,R,C],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),I={};t(X,["default-code"]);t(G([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",
|
||||||
|
/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),"default-markup htm html mxml xhtml xml xsl".split(" "));t(G([["pln",/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],
|
||||||
|
["pun",/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);t(G([],[["atv",/^[\s\S]+/]]),["uq.val"]);t(y({keywords:H,hashComments:!0,cStyleComments:!0,types:S}),"c cc cpp cxx cyc m".split(" "));t(y({keywords:"null,true,false"}),["json"]);t(y({keywords:P,hashComments:!0,cStyleComments:!0,
|
||||||
|
verbatimStrings:!0,types:S}),["cs"]);t(y({keywords:O,cStyleComments:!0}),["java"]);t(y({keywords:C,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);t(y({keywords:Q,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);t(y({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),
|
||||||
|
["perl","pl","pm"]);t(y({keywords:R,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);t(y({keywords:F,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);t(y({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);t(G([],[["str",/^[\s\S]+/]]),["regex"]);
|
||||||
|
var Y=E.PR={createSimpleLexer:G,registerLangHandler:t,sourceDecorator:y,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:E.prettyPrintOne=function(a,d,f){f=f||!1;d=d||null;var b=document.createElement("div");b.innerHTML="<pre>"+a+"</pre>";b=b.firstChild;f&&L(b,f,!0);M({j:d,m:f,h:b,l:1,a:null,i:null,c:null,
|
||||||
|
g:null});return b.innerHTML},prettyPrint:E.prettyPrint=function(a,d){function f(){for(var b=E.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;p<t.length&&c.now()<b;p++){for(var d=t[p],l=g,m=d;m=m.previousSibling;){var n=m.nodeType,u=(7===n||8===n)&&m.nodeValue;if(u?!/^\??prettify\b/.test(u):3!==n||/\S/.test(m.nodeValue))break;if(u){l={};u.replace(/\b(\w+)=([\w:.%+-]+)/g,function(a,b,c){l[b]=c});break}}m=d.className;if((l!==g||r.test(m))&&!e.test(m)){n=!1;for(u=d.parentNode;u;u=u.parentNode)if(q.test(u.tagName)&&
|
||||||
|
u.className&&r.test(u.className)){n=!0;break}if(!n){d.className+=" prettyprinted";n=l.lang;if(!n){var n=m.match(w),C;!n&&(C=V(d))&&z.test(C.tagName)&&(n=C.className.match(w));n&&(n=n[1])}if(y.test(d.tagName))u=1;else var u=d.currentStyle,x=v.defaultView,u=(u=u?u.whiteSpace:x&&x.getComputedStyle?x.getComputedStyle(d,null).getPropertyValue("white-space"):0)&&"pre"===u.substring(0,3);x=l.linenums;(x="true"===x||+x)||(x=(x=m.match(/\blinenums\b(?::(\d+))?/))?x[1]&&x[1].length?+x[1]:!0:!1);x&&L(d,x,u);
|
||||||
|
M({j:n,h:d,m:x,l:u,a:null,i:null,c:null,g:null})}}}p<t.length?E.setTimeout(f,250):"function"===typeof a&&a()}for(var b=d||document.body,v=b.ownerDocument||document,b=[b.getElementsByTagName("pre"),b.getElementsByTagName("code"),b.getElementsByTagName("xmp")],t=[],n=0;n<b.length;++n)for(var l=0,m=b[n].length;l<m;++l)t.push(b[n][l]);var b=null,c=Date;c.now||(c={now:function(){return+new Date}});var p=0,w=/\blang(?:uage)?-([\w.]+)(?!\S)/,r=/\bprettyprint\b/,e=/\bprettyprinted\b/,y=/pre|xmp/i,z=/^code$/i,
|
||||||
|
q=/^(?:pre|code|xmp)$/i,g={};f()}},H=E.define;"function"===typeof H&&H.amd&&H("google-code-prettify",[],function(){return Y})})();}()
|
||||||
117
app/src/main/assets/highlight/styles/prettify.css
Normal file
117
app/src/main/assets/highlight/styles/prettify.css
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
.prettyprint {
|
||||||
|
background: #fff;
|
||||||
|
font-family: Menlo, "Bitstream Vera Sans Mono", "DejaVu Sans Mono", Monaco, Consolas, monospace;
|
||||||
|
border: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pln {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol.linenums {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
color: #727272;
|
||||||
|
}
|
||||||
|
|
||||||
|
li.L0,
|
||||||
|
li.L1,
|
||||||
|
li.L2,
|
||||||
|
li.L3,
|
||||||
|
li.L4,
|
||||||
|
li.L5,
|
||||||
|
li.L6,
|
||||||
|
li.L7,
|
||||||
|
li.L8,
|
||||||
|
li.L9 {
|
||||||
|
padding-left: 0px !important;
|
||||||
|
background-color: #fff;
|
||||||
|
list-style-type: decimal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen {
|
||||||
|
|
||||||
|
/* string content */
|
||||||
|
|
||||||
|
.str {
|
||||||
|
color: #183691;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* keyword */
|
||||||
|
|
||||||
|
.kwd {
|
||||||
|
color: #a71d5d;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* comment */
|
||||||
|
|
||||||
|
.com {
|
||||||
|
color: #969896;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* type name */
|
||||||
|
|
||||||
|
.typ {
|
||||||
|
color: #0086b3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* literal value */
|
||||||
|
|
||||||
|
.lit {
|
||||||
|
color: #0086b3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* punctuation */
|
||||||
|
|
||||||
|
.pun {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* lisp open bracket */
|
||||||
|
|
||||||
|
.opn {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* lisp close bracket */
|
||||||
|
|
||||||
|
.clo {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* markup tag name */
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
color: #000080;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* markup attribute name */
|
||||||
|
|
||||||
|
.atn {
|
||||||
|
color: #795da3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* markup attribute value */
|
||||||
|
|
||||||
|
.atv {
|
||||||
|
color: #183691;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* declaration */
|
||||||
|
|
||||||
|
.dec {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* variable name */
|
||||||
|
|
||||||
|
.var {
|
||||||
|
color: #008080;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* function name */
|
||||||
|
|
||||||
|
.fun {
|
||||||
|
color: #900;
|
||||||
|
}
|
||||||
|
}
|
||||||
557
app/src/main/assets/md/github.css
Executable file
557
app/src/main/assets/md/github.css
Executable file
@ -0,0 +1,557 @@
|
|||||||
|
.markdown-body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||||
|
font-size: 16px;
|
||||||
|
padding: 15px;
|
||||||
|
line-height: 1.5;
|
||||||
|
word-wrap: break-word
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body::before {
|
||||||
|
display: table;
|
||||||
|
content: ""
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body::after {
|
||||||
|
display: table;
|
||||||
|
clear: both;
|
||||||
|
content: ""
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body>:first-child {
|
||||||
|
margin-top: 0!important
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body>:last-child {
|
||||||
|
margin-bottom: 0!important
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body a:not([href]) {
|
||||||
|
color: inherit;
|
||||||
|
text-decoration: none
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .absent {
|
||||||
|
color: #c00
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .anchor {
|
||||||
|
float: left;
|
||||||
|
padding-right: 4px;
|
||||||
|
margin-left: -20px;
|
||||||
|
line-height: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .anchor:focus {
|
||||||
|
outline: none
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body p, .markdown-body blockquote, .markdown-body ul, .markdown-body ol, .markdown-body dl, .markdown-body table, .markdown-body pre {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 16px
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body hr {
|
||||||
|
height: .25em;
|
||||||
|
padding: 0;
|
||||||
|
margin: 24px 0;
|
||||||
|
background-color: #e7e7e7;
|
||||||
|
border: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body blockquote {
|
||||||
|
padding: 0 1em;
|
||||||
|
color: #777;
|
||||||
|
border-left: .25em solid #ddd
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body blockquote>:first-child {
|
||||||
|
margin-top: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body blockquote>:last-child {
|
||||||
|
margin-bottom: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body kbd {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 3px 5px;
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 10px;
|
||||||
|
color: #555;
|
||||||
|
vertical-align: middle;
|
||||||
|
background-color: #fcfcfc;
|
||||||
|
border: solid 1px #ccc;
|
||||||
|
border-bottom-color: #bbb;
|
||||||
|
border-radius: 3px;
|
||||||
|
box-shadow: inset 0 -1px 0 #bbb
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .loweralpha {
|
||||||
|
list-style-type: lower-alpha
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 {
|
||||||
|
margin-top: 24px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
line-height: 1.25
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body h1 .octicon-link, .markdown-body h2 .octicon-link, .markdown-body h3 .octicon-link, .markdown-body h4 .octicon-link, .markdown-body h5 .octicon-link, .markdown-body h6 .octicon-link {
|
||||||
|
color: #000;
|
||||||
|
vertical-align: middle;
|
||||||
|
visibility: hidden
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body h1:hover .anchor, .markdown-body h2:hover .anchor, .markdown-body h3:hover .anchor, .markdown-body h4:hover .anchor, .markdown-body h5:hover .anchor, .markdown-body h6:hover .anchor {
|
||||||
|
text-decoration: none
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body h1:hover .anchor .octicon-link, .markdown-body h2:hover .anchor .octicon-link, .markdown-body h3:hover .anchor .octicon-link, .markdown-body h4:hover .anchor .octicon-link, .markdown-body h5:hover .anchor .octicon-link, .markdown-body h6:hover .anchor .octicon-link {
|
||||||
|
visibility: visible
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body h1 tt, .markdown-body h1 code, .markdown-body h2 tt, .markdown-body h2 code, .markdown-body h3 tt, .markdown-body h3 code, .markdown-body h4 tt, .markdown-body h4 code, .markdown-body h5 tt, .markdown-body h5 code, .markdown-body h6 tt, .markdown-body h6 code {
|
||||||
|
font-size: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body h1 {
|
||||||
|
padding-bottom: .3em;
|
||||||
|
font-size: 2em;
|
||||||
|
border-bottom: 1px solid #eee
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body h2 {
|
||||||
|
padding-bottom: .3em;
|
||||||
|
font-size: 1.5em;
|
||||||
|
border-bottom: 1px solid #eee
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body h3 {
|
||||||
|
font-size: 1.25em
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body h4 {
|
||||||
|
font-size: 1em
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body h5 {
|
||||||
|
font-size: .875em
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body h6 {
|
||||||
|
font-size: .85em;
|
||||||
|
color: #777
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body ul, .markdown-body ol {
|
||||||
|
padding-left: 2em
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body ul.no-list, .markdown-body ol.no-list {
|
||||||
|
padding: 0;
|
||||||
|
list-style-type: none
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body ul ul, .markdown-body ul ol, .markdown-body ol ol, .markdown-body ol ul {
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body li>p {
|
||||||
|
margin-top: 16px
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body li+li {
|
||||||
|
margin-top: .25em
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body dl {
|
||||||
|
padding: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body dl dt {
|
||||||
|
padding: 0;
|
||||||
|
margin-top: 16px;
|
||||||
|
font-size: 1em;
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 700
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body dl dd {
|
||||||
|
padding: 0 16px;
|
||||||
|
margin-bottom: 16px
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body table {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
overflow: auto
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body table th {
|
||||||
|
font-weight: 700
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body table th, .markdown-body table td {
|
||||||
|
padding: 6px 13px;
|
||||||
|
border: 1px solid #ddd
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body table tr {
|
||||||
|
background-color: #fff;
|
||||||
|
border-top: 1px solid #ccc
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body table tr:nth-child(2n) {
|
||||||
|
background-color: #f8f8f8
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body img {
|
||||||
|
max-width: 100%;
|
||||||
|
box-sizing: content-box;
|
||||||
|
background-color: #fff
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body img[align=right] {
|
||||||
|
padding-left: 20px
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body img[align=left] {
|
||||||
|
padding-right: 20px
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .emoji {
|
||||||
|
max-width: none;
|
||||||
|
vertical-align: text-top;
|
||||||
|
background-color: transparent
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body span.frame {
|
||||||
|
display: block;
|
||||||
|
overflow: hidden
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body span.frame>span {
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
width: auto;
|
||||||
|
padding: 7px;
|
||||||
|
margin: 13px 0 0;
|
||||||
|
overflow: hidden;
|
||||||
|
border: 1px solid #ddd
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body span.frame span img {
|
||||||
|
display: block;
|
||||||
|
float: left
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body span.frame span span {
|
||||||
|
display: block;
|
||||||
|
padding: 5px 0 0;
|
||||||
|
clear: both;
|
||||||
|
color: #333
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body span.align-center {
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
clear: both
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body span.align-center>span {
|
||||||
|
display: block;
|
||||||
|
margin: 13px auto 0;
|
||||||
|
overflow: hidden;
|
||||||
|
text-align: center
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body span.align-center span img {
|
||||||
|
margin: 0 auto;
|
||||||
|
text-align: center
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body span.align-right {
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
clear: both
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body span.align-right>span {
|
||||||
|
display: block;
|
||||||
|
margin: 13px 0 0;
|
||||||
|
overflow: hidden;
|
||||||
|
text-align: right
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body span.align-right span img {
|
||||||
|
margin: 0;
|
||||||
|
text-align: right
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body span.float-left {
|
||||||
|
display: block;
|
||||||
|
float: left;
|
||||||
|
margin-right: 13px;
|
||||||
|
overflow: hidden
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body span.float-left span {
|
||||||
|
margin: 13px 0 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body span.float-right {
|
||||||
|
display: block;
|
||||||
|
float: right;
|
||||||
|
margin-left: 13px;
|
||||||
|
overflow: hidden
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body span.float-right>span {
|
||||||
|
display: block;
|
||||||
|
margin: 13px auto 0;
|
||||||
|
overflow: hidden;
|
||||||
|
text-align: right
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body code, .markdown-body tt {
|
||||||
|
padding: 0;
|
||||||
|
padding-top: .2em;
|
||||||
|
padding-bottom: .2em;
|
||||||
|
margin: 0;
|
||||||
|
font-size: 85%;
|
||||||
|
background-color: rgba(0, 0, 0, 0.04);
|
||||||
|
border-radius: 3px
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body code::before, .markdown-body code::after, .markdown-body tt::before, .markdown-body tt::after {
|
||||||
|
letter-spacing: -.2em;
|
||||||
|
content: "\00a0"
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body code br, .markdown-body tt br {
|
||||||
|
display: none
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body del code {
|
||||||
|
text-decoration: inherit
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body pre {
|
||||||
|
word-wrap: normal
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body pre>code {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
font-size: 100%;
|
||||||
|
word-break: normal;
|
||||||
|
white-space: pre;
|
||||||
|
background: transparent;
|
||||||
|
border: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .highlight {
|
||||||
|
margin-bottom: 16px
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .highlight pre {
|
||||||
|
margin-bottom: 0;
|
||||||
|
word-break: normal
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .highlight pre, .markdown-body pre {
|
||||||
|
padding: 16px;
|
||||||
|
overflow: auto;
|
||||||
|
font-size: 85%;
|
||||||
|
line-height: 1.45;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
border-radius: 3px
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body pre code, .markdown-body pre tt {
|
||||||
|
display: inline;
|
||||||
|
max-width: auto;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
overflow: visible;
|
||||||
|
line-height: inherit;
|
||||||
|
word-wrap: normal;
|
||||||
|
background-color: transparent;
|
||||||
|
border: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body pre code::before, .markdown-body pre code::after, .markdown-body pre tt::before, .markdown-body pre tt::after {
|
||||||
|
content: normal
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .csv-data td, .markdown-body .csv-data th {
|
||||||
|
padding: 5px;
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1;
|
||||||
|
text-align: left;
|
||||||
|
white-space: nowrap
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .csv-data .blob-num {
|
||||||
|
padding: 10px 8px 9px;
|
||||||
|
text-align: right;
|
||||||
|
background: #fff;
|
||||||
|
border: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .csv-data tr {
|
||||||
|
border-top: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .csv-data th {
|
||||||
|
font-weight: 700;
|
||||||
|
background: #f8f8f8;
|
||||||
|
border-top: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body {
|
||||||
|
font-size: 15px
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body blockquote {
|
||||||
|
margin-right: 0;
|
||||||
|
margin-left: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body code {
|
||||||
|
white-space: normal
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body.email-format {
|
||||||
|
line-height: 1.5em!important
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body.email-format div {
|
||||||
|
white-space: pre-wrap
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .email-hidden-reply {
|
||||||
|
display: none;
|
||||||
|
white-space: pre-wrap
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .email-hidden-reply.expanded {
|
||||||
|
display: block
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-body .email-quoted-reply, .markdown-body .email-signature-reply {
|
||||||
|
padding: 0 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
color: #767676;
|
||||||
|
border-left: 4px solid #ddd
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-c {
|
||||||
|
color: #969896
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-c1, .pl-s .pl-v {
|
||||||
|
color: #0086b3
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-e, .pl-en {
|
||||||
|
color: #795da3
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-smi, .pl-s .pl-s1 {
|
||||||
|
color: #333
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-ent {
|
||||||
|
color: #63a35c
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-k {
|
||||||
|
color: #a71d5d
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-s, .pl-pds, .pl-s .pl-pse .pl-s1, .pl-sr, .pl-sr .pl-cce, .pl-sr .pl-sre, .pl-sr .pl-sra {
|
||||||
|
color: #183691
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-v {
|
||||||
|
color: #ed6a43
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-id {
|
||||||
|
color: #b52a1d
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-ii {
|
||||||
|
color: #f8f8f8;
|
||||||
|
background-color: #b52a1d
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-sr .pl-cce {
|
||||||
|
font-weight: 700;
|
||||||
|
color: #63a35c
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-ml {
|
||||||
|
color: #693a17
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-mh, .pl-mh .pl-en, .pl-ms {
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1d3e81
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-mq {
|
||||||
|
color: teal
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-mi {
|
||||||
|
font-style: italic;
|
||||||
|
color: #333
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-mb {
|
||||||
|
font-weight: 700;
|
||||||
|
color: #333
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-md {
|
||||||
|
color: #bd2c00;
|
||||||
|
background-color: #ffecec
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-mi1 {
|
||||||
|
color: #55a532;
|
||||||
|
background-color: #eaffea
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-mdr {
|
||||||
|
font-weight: 700;
|
||||||
|
color: #795da3
|
||||||
|
}
|
||||||
|
|
||||||
|
.pl-mo {
|
||||||
|
color: #1d3e81
|
||||||
|
}
|
||||||
|
|
||||||
|
kbd {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 3px 5px;
|
||||||
|
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
||||||
|
line-height: 10px;
|
||||||
|
color: #555;
|
||||||
|
vertical-align: middle;
|
||||||
|
background-color: #fcfcfc;
|
||||||
|
border: solid 1px #ccc;
|
||||||
|
border-bottom-color: #bbb;
|
||||||
|
border-radius: 3px;
|
||||||
|
box-shadow: inset 0 -1px 0 #bbb
|
||||||
|
}
|
||||||
|
|
||||||
|
.badmono {
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-weight: 700
|
||||||
|
}
|
||||||
26
app/src/main/assets/md/intercept-touch.js
Normal file
26
app/src/main/assets/md/intercept-touch.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
document.addEventListener("DOMContentLoaded", function(event) {
|
||||||
|
document.querySelectorAll('img').forEach(function(img){
|
||||||
|
img.onerror = function(){this.style.display='none';};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
window.onload = function() {
|
||||||
|
addTouchEvents(document.getElementsByTagName("pre"));
|
||||||
|
addTouchEvents(document.getElementsByTagName("table"));
|
||||||
|
addEventListener(document.getElementsByClassName("highlight"));
|
||||||
|
};
|
||||||
|
|
||||||
|
function addTouchEvents(elements) {
|
||||||
|
for (var i = 0; i < elements.length; i++) {
|
||||||
|
elements[i].addEventListener("touchstart", touchStart, false);
|
||||||
|
elements[i].addEventListener("touchend", touchEnd, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function touchStart(event) {
|
||||||
|
Android.startIntercept();
|
||||||
|
}
|
||||||
|
|
||||||
|
function touchEnd(event) {
|
||||||
|
Android.stopIntercept();
|
||||||
|
}
|
||||||
41
app/src/main/java/com/fastaccess/App.java
Normal file
41
app/src/main/java/com/fastaccess/App.java
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
package com.fastaccess;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.commonsware.cwac.anddown.AndDown;
|
||||||
|
import com.fastaccess.helper.TypeFaceHelper;
|
||||||
|
import com.fastaccess.provider.uil.UILProvider;
|
||||||
|
import com.siimkinks.sqlitemagic.SqliteMagic;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 03 Feb 2017, 12:07 AM
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class App extends Application {
|
||||||
|
private static App instance;
|
||||||
|
|
||||||
|
private AndDown andDown;
|
||||||
|
|
||||||
|
@Override public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
instance = this;
|
||||||
|
SqliteMagic.setLoggingEnabled(BuildConfig.DEBUG);
|
||||||
|
SqliteMagic.init(this);
|
||||||
|
UILProvider.initUIL(this);
|
||||||
|
TypeFaceHelper.generateTypeface(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull public static App getInstance() {
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@NonNull public AndDown getAndDown() {
|
||||||
|
if (andDown == null) {
|
||||||
|
andDown = new AndDown();
|
||||||
|
}
|
||||||
|
return andDown;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 09 Nov 2016, 11:28 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor
|
||||||
|
public class AccessTokenModel {
|
||||||
|
private String accessToken;
|
||||||
|
private String tokenType;
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 20 Nov 2016, 10:40 AM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor
|
||||||
|
public class CommentRequestModel implements Parcelable {
|
||||||
|
private String body;
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {dest.writeString(this.body);}
|
||||||
|
|
||||||
|
@SuppressWarnings("WeakerAccess") protected CommentRequestModel(Parcel in) {this.body = in.readString();}
|
||||||
|
|
||||||
|
public static final Creator<CommentRequestModel> CREATOR = new Creator<CommentRequestModel>() {
|
||||||
|
@Override public CommentRequestModel createFromParcel(Parcel source) {return new CommentRequestModel(source);}
|
||||||
|
|
||||||
|
@Override public CommentRequestModel[] newArray(int size) {return new CommentRequestModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
219
app/src/main/java/com/fastaccess/data/dao/CommentsModel.java
Normal file
219
app/src/main/java/com/fastaccess/data/dao/CommentsModel.java
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.siimkinks.sqlitemagic.CommentsModelTable;
|
||||||
|
import com.siimkinks.sqlitemagic.Delete;
|
||||||
|
import com.siimkinks.sqlitemagic.Select;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Column;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Id;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import rx.Completable;
|
||||||
|
import rx.Observable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 20 Nov 2016, 10:34 AM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class CommentsModel implements Parcelable {
|
||||||
|
|
||||||
|
@Id(autoIncrement = false) @Column long id;
|
||||||
|
@Column(handleRecursively = false, onDeleteCascade = true) UserModel user;
|
||||||
|
@Column String url;
|
||||||
|
@Column String body;
|
||||||
|
@Column String bodyHtml;
|
||||||
|
@Column String htmlUrl;
|
||||||
|
@Column Date createdAt;
|
||||||
|
@Column Date updatedAt;
|
||||||
|
@Column int position;
|
||||||
|
@Column int line;
|
||||||
|
@Column String path;
|
||||||
|
@Column String commitId;
|
||||||
|
@Column String repoId;
|
||||||
|
@Column String login;
|
||||||
|
@Column String gistId;
|
||||||
|
@Column String issueId;
|
||||||
|
@Column String pullRequestId;
|
||||||
|
|
||||||
|
public Completable save() {
|
||||||
|
return persist().observe().toCompletable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Completable saveForGist(@NonNull List<CommentsModel> models, @NonNull String gistId) {
|
||||||
|
return Delete.from(CommentsModelTable.COMMENTS_MODEL)
|
||||||
|
.where(CommentsModelTable.COMMENTS_MODEL.GIST_ID.is(gistId))
|
||||||
|
.observe()
|
||||||
|
.toCompletable()
|
||||||
|
.andThen(Observable.from(models)
|
||||||
|
.map(model -> {
|
||||||
|
model.setGistId(gistId);
|
||||||
|
return model.save();
|
||||||
|
}))
|
||||||
|
.toCompletable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Completable saveForCommits(@NonNull List<CommentsModel> models, @NonNull String repoId, @NonNull String login, @NonNull String
|
||||||
|
commitId) {
|
||||||
|
return Delete.from(CommentsModelTable.COMMENTS_MODEL)
|
||||||
|
.where(CommentsModelTable.COMMENTS_MODEL.COMMIT_ID.is(commitId)
|
||||||
|
.and(CommentsModelTable.COMMENTS_MODEL.REPO_ID.is(repoId))
|
||||||
|
.and(CommentsModelTable.COMMENTS_MODEL.LOGIN.is(login)))
|
||||||
|
.observe()
|
||||||
|
.toCompletable()
|
||||||
|
.andThen(Observable.from(models)
|
||||||
|
.map(model -> {
|
||||||
|
model.setLogin(login);
|
||||||
|
model.setRepoId(repoId);
|
||||||
|
model.setCommitId(commitId);
|
||||||
|
return model.save();
|
||||||
|
}))
|
||||||
|
.toCompletable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Completable saveForIssues(@NonNull List<CommentsModel> models, @NonNull String repoId, @NonNull String login, @NonNull String
|
||||||
|
issueId) {
|
||||||
|
return Delete.from(CommentsModelTable.COMMENTS_MODEL)
|
||||||
|
.where(CommentsModelTable.COMMENTS_MODEL.ISSUE_ID.is(issueId)
|
||||||
|
.and(CommentsModelTable.COMMENTS_MODEL.REPO_ID.is(repoId))
|
||||||
|
.and(CommentsModelTable.COMMENTS_MODEL.LOGIN.is(login)))
|
||||||
|
.observe()
|
||||||
|
.toCompletable()
|
||||||
|
.andThen(Observable.from(models)
|
||||||
|
.map(model -> {
|
||||||
|
model.setLogin(login);
|
||||||
|
model.setRepoId(repoId);
|
||||||
|
model.setIssueId(issueId);
|
||||||
|
return model.save();
|
||||||
|
}))
|
||||||
|
.toCompletable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Completable saveForPullRequest(@NonNull List<CommentsModel> models, @NonNull String repoId, @NonNull String login, @NonNull String
|
||||||
|
pullRequestId) {
|
||||||
|
return Delete.from(CommentsModelTable.COMMENTS_MODEL)
|
||||||
|
.where(CommentsModelTable.COMMENTS_MODEL.PULL_REQUEST_ID.is(pullRequestId)
|
||||||
|
.and(CommentsModelTable.COMMENTS_MODEL.REPO_ID.is(repoId))
|
||||||
|
.and(CommentsModelTable.COMMENTS_MODEL.LOGIN.is(login)))
|
||||||
|
.observe()
|
||||||
|
.toCompletable()
|
||||||
|
.andThen(Observable.from(models)
|
||||||
|
.map(model -> {
|
||||||
|
model.setLogin(login);
|
||||||
|
model.setRepoId(repoId);
|
||||||
|
model.setPullRequestId(pullRequestId);
|
||||||
|
return model.save();
|
||||||
|
}))
|
||||||
|
.toCompletable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Observable<List<CommentsModel>> getGistComments(@NonNull String gistId) {
|
||||||
|
return Select.from(CommentsModelTable.COMMENTS_MODEL)
|
||||||
|
.where(CommentsModelTable.COMMENTS_MODEL.GIST_ID.is(gistId))
|
||||||
|
.orderBy(CommentsModelTable.COMMENTS_MODEL.UPDATED_AT.desc())
|
||||||
|
.observe()
|
||||||
|
.runQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Observable<List<CommentsModel>> getCommitComments(@NonNull String repoId, @NonNull String login, @NonNull String commitId) {
|
||||||
|
return Select.from(CommentsModelTable.COMMENTS_MODEL)
|
||||||
|
.where(CommentsModelTable.COMMENTS_MODEL.COMMIT_ID.is(commitId)
|
||||||
|
.and(CommentsModelTable.COMMENTS_MODEL.REPO_ID.is(repoId))
|
||||||
|
.and(CommentsModelTable.COMMENTS_MODEL.LOGIN.is(login)))
|
||||||
|
.orderBy(CommentsModelTable.COMMENTS_MODEL.UPDATED_AT.desc())
|
||||||
|
.observe()
|
||||||
|
.runQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Observable<List<CommentsModel>> getIssueComments(@NonNull String repoId, @NonNull String login, @NonNull String issueId) {
|
||||||
|
return Select.from(CommentsModelTable.COMMENTS_MODEL)
|
||||||
|
.where(CommentsModelTable.COMMENTS_MODEL.ISSUE_ID.is(issueId)
|
||||||
|
.and(CommentsModelTable.COMMENTS_MODEL.REPO_ID.is(repoId))
|
||||||
|
.and(CommentsModelTable.COMMENTS_MODEL.LOGIN.is(login)))
|
||||||
|
.orderBy(CommentsModelTable.COMMENTS_MODEL.UPDATED_AT.desc())
|
||||||
|
.observe()
|
||||||
|
.runQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Observable<List<CommentsModel>> getPullRequestComments(@NonNull String repoId, @NonNull String login, @NonNull String
|
||||||
|
pullRequestId) {
|
||||||
|
return Select.from(CommentsModelTable.COMMENTS_MODEL)
|
||||||
|
.where(CommentsModelTable.COMMENTS_MODEL.PULL_REQUEST_ID.is(pullRequestId)
|
||||||
|
.and(CommentsModelTable.COMMENTS_MODEL.REPO_ID.is(repoId))
|
||||||
|
.and(CommentsModelTable.COMMENTS_MODEL.LOGIN.is(login)))
|
||||||
|
.orderBy(CommentsModelTable.COMMENTS_MODEL.UPDATED_AT.desc())
|
||||||
|
.observe()
|
||||||
|
.runQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
|
||||||
|
CommentsModel that = (CommentsModel) o;
|
||||||
|
|
||||||
|
return id == that.id;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public int hashCode() {
|
||||||
|
return (int) (id ^ (id >>> 32));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeLong(this.id);
|
||||||
|
dest.writeParcelable(this.user, flags);
|
||||||
|
dest.writeString(this.url);
|
||||||
|
dest.writeString(this.body);
|
||||||
|
dest.writeString(this.bodyHtml);
|
||||||
|
dest.writeString(this.htmlUrl);
|
||||||
|
dest.writeLong(this.createdAt != null ? this.createdAt.getTime() : -1);
|
||||||
|
dest.writeLong(this.updatedAt != null ? this.updatedAt.getTime() : -1);
|
||||||
|
dest.writeInt(this.position);
|
||||||
|
dest.writeInt(this.line);
|
||||||
|
dest.writeString(this.path);
|
||||||
|
dest.writeString(this.commitId);
|
||||||
|
dest.writeString(this.repoId);
|
||||||
|
dest.writeString(this.gistId);
|
||||||
|
dest.writeString(this.issueId);
|
||||||
|
dest.writeString(this.pullRequestId);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected CommentsModel(Parcel in) {
|
||||||
|
this.id = in.readLong();
|
||||||
|
this.user = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
this.url = in.readString();
|
||||||
|
this.body = in.readString();
|
||||||
|
this.bodyHtml = in.readString();
|
||||||
|
this.htmlUrl = in.readString();
|
||||||
|
long tmpCreatedAt = in.readLong();
|
||||||
|
this.createdAt = tmpCreatedAt == -1 ? null : new Date(tmpCreatedAt);
|
||||||
|
long tmpUpdatedAt = in.readLong();
|
||||||
|
this.updatedAt = tmpUpdatedAt == -1 ? null : new Date(tmpUpdatedAt);
|
||||||
|
this.position = in.readInt();
|
||||||
|
this.line = in.readInt();
|
||||||
|
this.path = in.readString();
|
||||||
|
this.commitId = in.readString();
|
||||||
|
this.repoId = in.readString();
|
||||||
|
this.gistId = in.readString();
|
||||||
|
this.issueId = in.readString();
|
||||||
|
this.pullRequestId = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<CommentsModel> CREATOR = new Creator<CommentsModel>() {
|
||||||
|
@Override public CommentsModel createFromParcel(Parcel source) {return new CommentsModel(source);}
|
||||||
|
|
||||||
|
@Override public CommentsModel[] newArray(int size) {return new CommentsModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 12 Feb 2017, 12:06 AM
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CommitFileListModel extends ArrayList<CommitFileModel> {}
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 01 Jan 2017, 9:00 PM
|
||||||
|
*/
|
||||||
|
@Getter @Setter @NoArgsConstructor
|
||||||
|
public class CommitFileModel implements Parcelable {
|
||||||
|
|
||||||
|
private String sha;
|
||||||
|
private String filename;
|
||||||
|
private String status;
|
||||||
|
private int additions;
|
||||||
|
private int deletions;
|
||||||
|
private int changes;
|
||||||
|
private String blobUrl;
|
||||||
|
private String rawUrl;
|
||||||
|
private String contentsUrl;
|
||||||
|
private String patch;
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(this.sha);
|
||||||
|
dest.writeString(this.filename);
|
||||||
|
dest.writeString(this.status);
|
||||||
|
dest.writeInt(this.additions);
|
||||||
|
dest.writeInt(this.deletions);
|
||||||
|
dest.writeInt(this.changes);
|
||||||
|
dest.writeString(this.blobUrl);
|
||||||
|
dest.writeString(this.rawUrl);
|
||||||
|
dest.writeString(this.contentsUrl);
|
||||||
|
dest.writeString(this.patch);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("WeakerAccess") protected CommitFileModel(Parcel in) {
|
||||||
|
this.sha = in.readString();
|
||||||
|
this.filename = in.readString();
|
||||||
|
this.status = in.readString();
|
||||||
|
this.additions = in.readInt();
|
||||||
|
this.deletions = in.readInt();
|
||||||
|
this.changes = in.readInt();
|
||||||
|
this.blobUrl = in.readString();
|
||||||
|
this.rawUrl = in.readString();
|
||||||
|
this.contentsUrl = in.readString();
|
||||||
|
this.patch = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<CommitFileModel> CREATOR = new Creator<CommitFileModel>() {
|
||||||
|
@Override public CommitFileModel createFromParcel(Parcel source) {return new CommitFileModel(source);}
|
||||||
|
|
||||||
|
@Override public CommitFileModel[] newArray(int size) {return new CommitFileModel[size];}
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override public String toString() {
|
||||||
|
return "CommitFileModel{" +
|
||||||
|
"sha='" + sha + '\'' +
|
||||||
|
", filename='" + filename + '\'' +
|
||||||
|
", status='" + status + '\'' +
|
||||||
|
", additions=" + additions +
|
||||||
|
", deletions=" + deletions +
|
||||||
|
", changes=" + changes +
|
||||||
|
", blobUrl='" + blobUrl + '\'' +
|
||||||
|
", rawUrl='" + rawUrl + '\'' +
|
||||||
|
", contentsUrl='" + contentsUrl + '\'' +
|
||||||
|
", patch='" + patch + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 12 Feb 2017, 12:10 AM
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CommitListModel extends ArrayList<CommitModel> {}
|
||||||
158
app/src/main/java/com/fastaccess/data/dao/CommitModel.java
Normal file
158
app/src/main/java/com/fastaccess/data/dao/CommitModel.java
Normal file
@ -0,0 +1,158 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.siimkinks.sqlitemagic.CommitModelTable;
|
||||||
|
import com.siimkinks.sqlitemagic.Delete;
|
||||||
|
import com.siimkinks.sqlitemagic.Select;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Column;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import rx.Completable;
|
||||||
|
import rx.Observable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 08 Dec 2016, 8:55 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class CommitModel implements Parcelable {
|
||||||
|
@Column String url;
|
||||||
|
@Column String ref;
|
||||||
|
@Column RepoModel repo;
|
||||||
|
@Column String sha;
|
||||||
|
@Column @SerializedName("distincted") boolean distincted;
|
||||||
|
@Column @SerializedName("commit") GitCommitModel gitCommit;
|
||||||
|
@Column UserModel author;
|
||||||
|
@Column UserModel committer;
|
||||||
|
@Column UserModel user;
|
||||||
|
@Column CommitListModel parents;
|
||||||
|
@Column GithubState stats;
|
||||||
|
@Column CommitFileListModel files;
|
||||||
|
@Column String htmlUrl;
|
||||||
|
@Column String login;
|
||||||
|
@Column String repoId;
|
||||||
|
@Column long pullRequestNumber;
|
||||||
|
|
||||||
|
|
||||||
|
public Completable save() {
|
||||||
|
return this.persist().observe()
|
||||||
|
.toCompletable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Completable save(@NonNull List<CommitModel> models, @NonNull String repoId, @NonNull String login) {
|
||||||
|
return Delete.from(CommitModelTable.COMMIT_MODEL)
|
||||||
|
.where(CommitModelTable.COMMIT_MODEL.REPO_ID.is(repoId))
|
||||||
|
.observe()
|
||||||
|
.toCompletable()
|
||||||
|
.andThen(Observable.from(models)
|
||||||
|
.map(commitModel -> {
|
||||||
|
commitModel.setRepoId(repoId);
|
||||||
|
commitModel.setLogin(login);
|
||||||
|
return commitModel.save();
|
||||||
|
}))
|
||||||
|
.toCompletable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Completable save(@NonNull List<CommitModel> models, @NonNull String repoId, @NonNull String login, long number) {
|
||||||
|
return Delete.from(CommitModelTable.COMMIT_MODEL)
|
||||||
|
.where(CommitModelTable.COMMIT_MODEL.REPO_ID.is(repoId))
|
||||||
|
.observe()
|
||||||
|
.toCompletable()
|
||||||
|
.andThen(Observable.from(models)
|
||||||
|
.map(commitModel -> {
|
||||||
|
commitModel.setRepoId(repoId);
|
||||||
|
commitModel.setLogin(login);
|
||||||
|
commitModel.setPullRequestNumber(number);
|
||||||
|
return commitModel.save();
|
||||||
|
}))
|
||||||
|
.toCompletable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Observable<List<CommitModel>> getCommits(@NonNull String repoId, @NonNull String login) {
|
||||||
|
return Select.from(CommitModelTable.COMMIT_MODEL)
|
||||||
|
.where(CommitModelTable.COMMIT_MODEL.REPO_ID.is(repoId)
|
||||||
|
.and(CommitModelTable.COMMIT_MODEL.LOGIN.is(login))
|
||||||
|
.and(CommitModelTable.COMMIT_MODEL.PULL_REQUEST_NUMBER.is(0L)))
|
||||||
|
.queryDeep()
|
||||||
|
.observe()
|
||||||
|
.runQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Observable<List<CommitModel>> getCommits(@NonNull String repoId, @NonNull String login, long pullRequestNumber) {
|
||||||
|
return Select.from(CommitModelTable.COMMIT_MODEL)
|
||||||
|
.where(CommitModelTable.COMMIT_MODEL.REPO_ID.is(repoId)
|
||||||
|
.and(CommitModelTable.COMMIT_MODEL.LOGIN.is(login))
|
||||||
|
.and(CommitModelTable.COMMIT_MODEL.PULL_REQUEST_NUMBER.is(pullRequestNumber)))
|
||||||
|
.queryDeep()
|
||||||
|
.observe()
|
||||||
|
.runQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Observable<CommitModel> getCommit(@NonNull String sha, @NonNull String repoId, @NonNull String login) {
|
||||||
|
return Select.from(CommitModelTable.COMMIT_MODEL)
|
||||||
|
.where(CommitModelTable.COMMIT_MODEL.REPO_ID.is(repoId)
|
||||||
|
.and(CommitModelTable.COMMIT_MODEL.LOGIN.is(login))
|
||||||
|
.and(CommitModelTable.COMMIT_MODEL.SHA.is(sha)))
|
||||||
|
.queryDeep()
|
||||||
|
.takeFirst()
|
||||||
|
.observe()
|
||||||
|
.runQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(this.url);
|
||||||
|
dest.writeString(this.ref);
|
||||||
|
dest.writeParcelable(this.repo, flags);
|
||||||
|
dest.writeString(this.sha);
|
||||||
|
dest.writeByte(this.distincted ? (byte) 1 : (byte) 0);
|
||||||
|
dest.writeParcelable(this.gitCommit, flags);
|
||||||
|
dest.writeParcelable(this.author, flags);
|
||||||
|
dest.writeParcelable(this.committer, flags);
|
||||||
|
dest.writeParcelable(this.user, flags);
|
||||||
|
dest.writeList(this.parents);
|
||||||
|
dest.writeParcelable(this.stats, flags);
|
||||||
|
dest.writeList(this.files);
|
||||||
|
dest.writeString(this.htmlUrl);
|
||||||
|
dest.writeString(this.login);
|
||||||
|
dest.writeString(this.repoId);
|
||||||
|
dest.writeLong(this.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected CommitModel(Parcel in) {
|
||||||
|
this.url = in.readString();
|
||||||
|
this.ref = in.readString();
|
||||||
|
this.repo = in.readParcelable(RepoModel.class.getClassLoader());
|
||||||
|
this.sha = in.readString();
|
||||||
|
this.distincted = in.readByte() != 0;
|
||||||
|
this.gitCommit = in.readParcelable(GitCommitModel.class.getClassLoader());
|
||||||
|
this.author = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
this.committer = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
this.user = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
in.readList(this.parents, this.parents.getClass().getClassLoader());
|
||||||
|
this.stats = in.readParcelable(GithubState.class.getClassLoader());
|
||||||
|
in.readList(this.files, this.files.getClass().getClassLoader());
|
||||||
|
this.htmlUrl = in.readString();
|
||||||
|
this.login = in.readString();
|
||||||
|
this.repoId = in.readString();
|
||||||
|
this.id = in.readLong();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<CommitModel> CREATOR = new Creator<CommitModel>() {
|
||||||
|
@Override public CommitModel createFromParcel(Parcel source) {return new CommitModel(source);}
|
||||||
|
|
||||||
|
@Override public CommitModel[] newArray(int size) {return new CommitModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 18 Feb 2017, 11:15 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Setter @Getter @NoArgsConstructor
|
||||||
|
public class CreateGistModel implements Parcelable {
|
||||||
|
private HashMap<String, FilesListModel> files;
|
||||||
|
private String description;
|
||||||
|
@SerializedName("public") private boolean publicGist;
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeSerializable(this.files);
|
||||||
|
dest.writeString(this.description);
|
||||||
|
dest.writeByte(this.publicGist ? (byte) 1 : (byte) 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings({"WeakerAccess", "unchecked"}) protected CreateGistModel(Parcel in) {
|
||||||
|
this.files = (HashMap<String, FilesListModel>) in.readSerializable();
|
||||||
|
this.description = in.readString();
|
||||||
|
this.publicGist = in.readByte() != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Parcelable.Creator<CreateGistModel> CREATOR = new Parcelable.Creator<CreateGistModel>() {
|
||||||
|
@Override public CreateGistModel createFromParcel(Parcel source) {return new CreateGistModel(source);}
|
||||||
|
|
||||||
|
@Override public CreateGistModel[] newArray(int size) {return new CreateGistModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
83
app/src/main/java/com/fastaccess/data/dao/EventsModel.java
Normal file
83
app/src/main/java/com/fastaccess/data/dao/EventsModel.java
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.fastaccess.data.dao.types.EventsType;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.siimkinks.sqlitemagic.Delete;
|
||||||
|
import com.siimkinks.sqlitemagic.EventsModelTable;
|
||||||
|
import com.siimkinks.sqlitemagic.Select;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Column;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Id;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import rx.Completable;
|
||||||
|
import rx.Observable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 08 Feb 2017, 10:02 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class EventsModel implements Parcelable {
|
||||||
|
@Id(autoIncrement = false) @Column long id;
|
||||||
|
@Column EventsType type;
|
||||||
|
@Column UserModel actor;
|
||||||
|
@Column RepoModel repo;
|
||||||
|
@Column PayloadModel payload;
|
||||||
|
@Column Date createdAt;
|
||||||
|
@SerializedName("public") @Column boolean publicEvent;
|
||||||
|
|
||||||
|
public static Completable save(@NonNull List<EventsModel> events) {
|
||||||
|
return Delete.from(EventsModelTable.EVENTS_MODEL)
|
||||||
|
.observe()
|
||||||
|
.toCompletable()
|
||||||
|
.andThen(persist(events).observe());
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull public static Observable<List<EventsModel>> getEvents() {
|
||||||
|
return Select.from(EventsModelTable.EVENTS_MODEL)
|
||||||
|
.orderBy(EventsModelTable.EVENTS_MODEL.CREATED_AT.desc())
|
||||||
|
.queryDeep()
|
||||||
|
.observe()
|
||||||
|
.runQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeLong(this.id);
|
||||||
|
dest.writeInt(this.type == null ? -1 : this.type.ordinal());
|
||||||
|
dest.writeParcelable(this.actor, flags);
|
||||||
|
dest.writeParcelable(this.repo, flags);
|
||||||
|
dest.writeParcelable(this.payload, flags);
|
||||||
|
dest.writeLong(this.createdAt != null ? this.createdAt.getTime() : -1);
|
||||||
|
dest.writeByte(this.publicEvent ? (byte) 1 : (byte) 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected EventsModel(Parcel in) {
|
||||||
|
this.id = in.readLong();
|
||||||
|
int tmpType = in.readInt();
|
||||||
|
this.type = tmpType == -1 ? null : EventsType.values()[tmpType];
|
||||||
|
this.actor = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
this.repo = in.readParcelable(RepoModel.class.getClassLoader());
|
||||||
|
this.payload = in.readParcelable(PayloadModel.class.getClassLoader());
|
||||||
|
long tmpCreatedAt = in.readLong();
|
||||||
|
this.createdAt = tmpCreatedAt == -1 ? null : new Date(tmpCreatedAt);
|
||||||
|
this.publicEvent = in.readByte() != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<EventsModel> CREATOR = new Creator<EventsModel>() {
|
||||||
|
@Override public EventsModel createFromParcel(Parcel source) {return new EventsModel(source);}
|
||||||
|
|
||||||
|
@Override public EventsModel[] newArray(int size) {return new EventsModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
71
app/src/main/java/com/fastaccess/data/dao/FileModel.java
Normal file
71
app/src/main/java/com/fastaccess/data/dao/FileModel.java
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.siimkinks.sqlitemagic.FileModelTable;
|
||||||
|
import com.siimkinks.sqlitemagic.Select;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Column;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import rx.Completable;
|
||||||
|
import rx.Observable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 06 Dec 2016, 10:42 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class FileModel implements Parcelable {
|
||||||
|
|
||||||
|
@Column boolean isMarkdown;
|
||||||
|
@Column String content;
|
||||||
|
@Column String fullUrl;
|
||||||
|
@Column boolean isRepo;
|
||||||
|
|
||||||
|
public Completable save() {
|
||||||
|
return this.persist()
|
||||||
|
.observe()
|
||||||
|
.toCompletable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Completable save(@NonNull FileModel model) {
|
||||||
|
return model.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Observable<FileModel> get(@NonNull String url) {
|
||||||
|
return Select.from(FileModelTable.FILE_MODEL)
|
||||||
|
.where(FileModelTable.FILE_MODEL.FULL_URL.is(url))
|
||||||
|
.takeFirst()
|
||||||
|
.observe()
|
||||||
|
.runQueryOnceOrDefault(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeByte(this.isMarkdown ? (byte) 1 : (byte) 0);
|
||||||
|
dest.writeString(this.content);
|
||||||
|
dest.writeString(this.fullUrl);
|
||||||
|
dest.writeByte(this.isRepo ? (byte) 1 : (byte) 0);
|
||||||
|
dest.writeLong(this.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected FileModel(Parcel in) {
|
||||||
|
this.isMarkdown = in.readByte() != 0;
|
||||||
|
this.content = in.readString();
|
||||||
|
this.fullUrl = in.readString();
|
||||||
|
this.isRepo = in.readByte() != 0;
|
||||||
|
this.id = in.readLong();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<FileModel> CREATOR = new Creator<FileModel>() {
|
||||||
|
@Override public FileModel createFromParcel(Parcel source) {return new FileModel(source);}
|
||||||
|
|
||||||
|
@Override public FileModel[] newArray(int size) {return new FileModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 12 Nov 2016, 11:09 AM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class FilesListModel implements Parcelable, Serializable {
|
||||||
|
|
||||||
|
String filename;
|
||||||
|
String type;
|
||||||
|
String language;
|
||||||
|
String rawUrl;
|
||||||
|
long size;
|
||||||
|
String content;
|
||||||
|
boolean needFetching;
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(this.filename);
|
||||||
|
dest.writeString(this.type);
|
||||||
|
dest.writeString(this.language);
|
||||||
|
dest.writeString(this.rawUrl);
|
||||||
|
dest.writeLong(this.size);
|
||||||
|
dest.writeString(this.content);
|
||||||
|
dest.writeByte(this.needFetching ? (byte) 1 : (byte) 0);
|
||||||
|
dest.writeLong(this.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected FilesListModel(Parcel in) {
|
||||||
|
this.filename = in.readString();
|
||||||
|
this.type = in.readString();
|
||||||
|
this.language = in.readString();
|
||||||
|
this.rawUrl = in.readString();
|
||||||
|
this.size = in.readLong();
|
||||||
|
this.content = in.readString();
|
||||||
|
this.needFetching = in.readByte() != 0;
|
||||||
|
this.id = in.readLong();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<FilesListModel> CREATOR = new Creator<FilesListModel>() {
|
||||||
|
@Override public FilesListModel createFromParcel(Parcel source) {return new FilesListModel(source);}
|
||||||
|
|
||||||
|
@Override public FilesListModel[] newArray(int size) {return new FilesListModel[size];}
|
||||||
|
};
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,140 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
|
||||||
|
import com.annimon.stream.Collectors;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.fastaccess.R;
|
||||||
|
import com.fastaccess.data.dao.types.IssueState;
|
||||||
|
import com.fastaccess.ui.modules.gists.gist.comments.GistCommentsView;
|
||||||
|
import com.fastaccess.ui.modules.gists.gist.files.GistFilesListView;
|
||||||
|
import com.fastaccess.ui.modules.profile.followers.ProfileFollowersView;
|
||||||
|
import com.fastaccess.ui.modules.profile.following.ProfileFollowingView;
|
||||||
|
import com.fastaccess.ui.modules.profile.gists.ProfileGistsView;
|
||||||
|
import com.fastaccess.ui.modules.profile.overview.ProfileOverviewView;
|
||||||
|
import com.fastaccess.ui.modules.profile.repos.ProfileReposView;
|
||||||
|
import com.fastaccess.ui.modules.profile.starred.ProfileStarredView;
|
||||||
|
import com.fastaccess.ui.modules.repos.code.commit.RepoCommitsView;
|
||||||
|
import com.fastaccess.ui.modules.repos.code.commit.details.comments.CommitCommentsView;
|
||||||
|
import com.fastaccess.ui.modules.repos.code.commit.details.files.CommitFilesView;
|
||||||
|
import com.fastaccess.ui.modules.repos.code.contributors.RepoContributorsView;
|
||||||
|
import com.fastaccess.ui.modules.repos.code.files.paths.RepoFilePathView;
|
||||||
|
import com.fastaccess.ui.modules.repos.code.prettifier.ViewerView;
|
||||||
|
import com.fastaccess.ui.modules.repos.code.releases.RepoReleasesView;
|
||||||
|
import com.fastaccess.ui.modules.repos.issues.issue.RepoIssuesView;
|
||||||
|
import com.fastaccess.ui.modules.repos.issues.issue.details.comments.IssueCommentsView;
|
||||||
|
import com.fastaccess.ui.modules.repos.issues.issue.details.events.IssueDetailsView;
|
||||||
|
import com.fastaccess.ui.modules.repos.pull_requests.pull_request.RepoPullRequestView;
|
||||||
|
import com.fastaccess.ui.modules.repos.pull_requests.pull_request.details.commits.PullRequestCommitsView;
|
||||||
|
import com.fastaccess.ui.modules.repos.pull_requests.pull_request.details.events.PullRequestDetailsView;
|
||||||
|
import com.fastaccess.ui.modules.search.code.SearchCodeView;
|
||||||
|
import com.fastaccess.ui.modules.search.issues.SearchIssuesView;
|
||||||
|
import com.fastaccess.ui.modules.search.repos.SearchReposView;
|
||||||
|
import com.fastaccess.ui.modules.search.users.SearchUsersView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 03 Dec 2016, 9:26 AM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
|
public class FragmentPagerAdapterModel {
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
private Fragment fragment;
|
||||||
|
|
||||||
|
private FragmentPagerAdapterModel(String title, Fragment fragment) {
|
||||||
|
this.title = title;
|
||||||
|
this.fragment = fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull public static List<FragmentPagerAdapterModel> buildForProfile(@NonNull Context context, @NonNull String login) {
|
||||||
|
return Stream.of(new FragmentPagerAdapterModel(context.getString(R.string.overview), ProfileOverviewView.newInstance(login)),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.repos), ProfileReposView.newInstance(login)),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.starred), ProfileStarredView.newInstance(login)),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.gists), ProfileGistsView.newInstance(login)),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.followers), ProfileFollowersView.newInstance(login)),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.following), ProfileFollowingView.newInstance(login)))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<FragmentPagerAdapterModel> buildForRepoCode(@NonNull Context context, @NonNull String repoId,
|
||||||
|
@NonNull String login, @NonNull String url) {
|
||||||
|
return Stream.of(new FragmentPagerAdapterModel(context.getString(R.string.readme), ViewerView.newInstance(url, true)),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.files), RepoFilePathView.newInstance(login, repoId, null)),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.commits), RepoCommitsView.newInstance(repoId, login)),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.releases), RepoReleasesView.newInstance(repoId, login)),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.contributors), RepoContributorsView.newInstance(repoId, login)))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull public static List<FragmentPagerAdapterModel> buildForSearch(@NonNull Context context) {
|
||||||
|
return Stream.of(new FragmentPagerAdapterModel(context.getString(R.string.repos), SearchReposView.newInstance()),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.users), SearchUsersView.newInstance()),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.issues), SearchIssuesView.newInstance()),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.code), SearchCodeView.newInstance()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull public static List<FragmentPagerAdapterModel> buildForIssues(@NonNull Context context, @NonNull IssueModel issueModel) {
|
||||||
|
String login = issueModel.getLogin();
|
||||||
|
String repoId = issueModel.getRepoId();
|
||||||
|
int number = issueModel.getNumber();
|
||||||
|
return Stream.of(new FragmentPagerAdapterModel(context.getString(R.string.details), IssueDetailsView.newInstance(issueModel)),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.comments), IssueCommentsView.newInstance(login, repoId, number)))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@NonNull public static List<FragmentPagerAdapterModel> buildForPullRequest(@NonNull Context context, @NonNull PullRequestModel pullRequest) {
|
||||||
|
String login = pullRequest.getLogin();
|
||||||
|
String repoId = pullRequest.getRepoId();
|
||||||
|
int number = pullRequest.getNumber();
|
||||||
|
return Stream.of(new FragmentPagerAdapterModel(context.getString(R.string.details), PullRequestDetailsView.newInstance(pullRequest)),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.commits), PullRequestCommitsView.newInstance(repoId, login, number)),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.comments), IssueCommentsView.newInstance(login, repoId, number)))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@NonNull public static List<FragmentPagerAdapterModel> buildForRepoIssue(@NonNull Context context, @NonNull String login,
|
||||||
|
@NonNull String repoId) {
|
||||||
|
return Stream.of(new FragmentPagerAdapterModel(context.getString(R.string.opened),
|
||||||
|
RepoIssuesView.newInstance(repoId, login, IssueState.open)),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.closed),
|
||||||
|
RepoIssuesView.newInstance(repoId, login, IssueState.closed)))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull public static List<FragmentPagerAdapterModel> buildForRepoPullRequest(@NonNull Context context, @NonNull String login,
|
||||||
|
@NonNull String repoId) {
|
||||||
|
return Stream.of(new FragmentPagerAdapterModel(context.getString(R.string.opened),
|
||||||
|
RepoPullRequestView.newInstance(repoId, login, IssueState.open)),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.closed),
|
||||||
|
RepoPullRequestView.newInstance(repoId, login, IssueState.closed)))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull public static List<FragmentPagerAdapterModel> buildForCommit(@NonNull Context context, @NonNull CommitModel commitModel) {
|
||||||
|
String login = commitModel.getLogin();
|
||||||
|
String repoId = commitModel.getRepoId();
|
||||||
|
String sha = commitModel.getSha();
|
||||||
|
return Stream.of(new FragmentPagerAdapterModel(context.getString(R.string.commits), CommitFilesView.newInstance(commitModel.getFiles()))
|
||||||
|
, new FragmentPagerAdapterModel(context.getString(R.string.comments), CommitCommentsView.newInstance(login, repoId, sha)))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull public static List<FragmentPagerAdapterModel> buildForGist(@NonNull Context context, @NonNull GistsModel gistsModel) {
|
||||||
|
|
||||||
|
return Stream.of(new FragmentPagerAdapterModel(context.getString(R.string.files), GistFilesListView.newInstance(gistsModel.getFiles())),
|
||||||
|
new FragmentPagerAdapterModel(context.getString(R.string.comments), GistCommentsView.newInstance(gistsModel.getGistId())))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 18 Feb 2017, 2:10 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor class GistHubErrorsModel {
|
||||||
|
private String resource;
|
||||||
|
private String field;
|
||||||
|
private String code;
|
||||||
|
}
|
||||||
207
app/src/main/java/com/fastaccess/data/dao/GistsModel.java
Normal file
207
app/src/main/java/com/fastaccess/data/dao/GistsModel.java
Normal file
@ -0,0 +1,207 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.annimon.stream.LongStream;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.fastaccess.helper.InputHelper;
|
||||||
|
import com.fastaccess.ui.widgets.SpannableBuilder;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.siimkinks.sqlitemagic.Delete;
|
||||||
|
import com.siimkinks.sqlitemagic.GistsModelTable;
|
||||||
|
import com.siimkinks.sqlitemagic.Select;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Column;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Id;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import rx.Completable;
|
||||||
|
import rx.Observable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 09 Feb 2017, 2:45 AM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class GistsModel implements Parcelable {
|
||||||
|
|
||||||
|
@SerializedName("nooope") @Id @Column long id;
|
||||||
|
@Column String url;
|
||||||
|
@Column String forksUrl;
|
||||||
|
@Column String commitsUrl;
|
||||||
|
@SerializedName("id") @Column String gistId;
|
||||||
|
@Column String gitPullUrl;
|
||||||
|
@Column String gitPushUrl;
|
||||||
|
@Column String htmlUrl;
|
||||||
|
@Column boolean publicX;
|
||||||
|
@Column Date createdAt;
|
||||||
|
@Column Date updatedAt;
|
||||||
|
@Column String description;
|
||||||
|
@Column int comments;
|
||||||
|
@Column String commentsUrl;
|
||||||
|
@Column boolean truncated;
|
||||||
|
@Column String ownerName;
|
||||||
|
@Column(onDeleteCascade = true, handleRecursively = false) GithubFileModel files;
|
||||||
|
@Column(onDeleteCascade = true, handleRecursively = false) UserModel user;
|
||||||
|
@Column(onDeleteCascade = true, handleRecursively = false) UserModel owner;
|
||||||
|
|
||||||
|
public static Completable save(@NonNull List<GistsModel> gists) {
|
||||||
|
return Delete.from(GistsModelTable.GISTS_MODEL)
|
||||||
|
.where(GistsModelTable.GISTS_MODEL.OWNER_NAME.isNull())
|
||||||
|
.observe()
|
||||||
|
.toCompletable()
|
||||||
|
.andThen(persist(gists).observe());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Completable save(@NonNull List<GistsModel> gists, @NonNull String ownerName) {
|
||||||
|
return Delete.from(GistsModelTable.GISTS_MODEL)
|
||||||
|
.where(GistsModelTable.GISTS_MODEL.OWNER_NAME.is(ownerName))
|
||||||
|
.observe()
|
||||||
|
.toCompletable()
|
||||||
|
.andThen(Observable.from(gists)
|
||||||
|
.map(gistsModel -> {
|
||||||
|
gistsModel.setOwnerName(ownerName);
|
||||||
|
return gistsModel.persist().observe();
|
||||||
|
}))
|
||||||
|
.toCompletable();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull public static Observable<List<GistsModel>> getMyGists(@NonNull String ownerName) {
|
||||||
|
return Select.from(GistsModelTable.GISTS_MODEL)
|
||||||
|
.where(GistsModelTable.GISTS_MODEL.OWNER_NAME.is(ownerName))
|
||||||
|
.queryDeep()
|
||||||
|
.observe()
|
||||||
|
.runQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull public static Observable<List<GistsModel>> getGists() {
|
||||||
|
return Select.from(GistsModelTable.GISTS_MODEL)
|
||||||
|
.where(GistsModelTable.GISTS_MODEL.OWNER_NAME.isNull())
|
||||||
|
.queryDeep()
|
||||||
|
.observe()
|
||||||
|
.runQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable public static Observable<GistsModel> getGist(@NonNull String gistId) {
|
||||||
|
return Select.from(GistsModelTable.GISTS_MODEL)
|
||||||
|
.where(GistsModelTable.GISTS_MODEL.GIST_ID.is(gistId))
|
||||||
|
.queryDeep()
|
||||||
|
.takeFirst()
|
||||||
|
.observe()
|
||||||
|
.runQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
GistsModel that = (GistsModel) o;
|
||||||
|
return url != null ? url.equals(that.url) : that.url == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public int hashCode() {
|
||||||
|
return url != null ? url.hashCode() : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull public List<FilesListModel> getFilesAsList() {
|
||||||
|
List<FilesListModel> models = new ArrayList<>();
|
||||||
|
if (files != null) {
|
||||||
|
models.addAll(files.values());
|
||||||
|
}
|
||||||
|
return models;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull public SpannableBuilder getDisplayTitle(boolean isFromProfile) {
|
||||||
|
SpannableBuilder spannableBuilder = SpannableBuilder.builder();
|
||||||
|
if (!isFromProfile) {
|
||||||
|
if (getOwner() != null) {
|
||||||
|
spannableBuilder.bold(getOwner().getLogin());
|
||||||
|
} else if (getUser() != null) {
|
||||||
|
spannableBuilder.bold(getUser().getLogin());
|
||||||
|
} else {
|
||||||
|
spannableBuilder.bold("Anonymous");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!InputHelper.isEmpty(getDescription())) {
|
||||||
|
if (!InputHelper.isEmpty(spannableBuilder.toString())) {
|
||||||
|
spannableBuilder.append("/");
|
||||||
|
}
|
||||||
|
spannableBuilder.append(getDescription());
|
||||||
|
}
|
||||||
|
if (InputHelper.isEmpty(spannableBuilder.toString())) {
|
||||||
|
if (isFromProfile) spannableBuilder.bold("N/A");
|
||||||
|
}
|
||||||
|
return spannableBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getSize() {
|
||||||
|
List<FilesListModel> models = getFilesAsList();
|
||||||
|
if (!models.isEmpty()) {
|
||||||
|
return Stream.of(models).flatMapToLong(filesListModel -> LongStream.of(filesListModel.getSize())).sum();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeLong(this.id);
|
||||||
|
dest.writeString(this.url);
|
||||||
|
dest.writeString(this.forksUrl);
|
||||||
|
dest.writeString(this.commitsUrl);
|
||||||
|
dest.writeString(this.gistId);
|
||||||
|
dest.writeString(this.gitPullUrl);
|
||||||
|
dest.writeString(this.gitPushUrl);
|
||||||
|
dest.writeString(this.htmlUrl);
|
||||||
|
dest.writeByte(this.publicX ? (byte) 1 : (byte) 0);
|
||||||
|
dest.writeLong(this.createdAt != null ? this.createdAt.getTime() : -1);
|
||||||
|
dest.writeLong(this.updatedAt != null ? this.updatedAt.getTime() : -1);
|
||||||
|
dest.writeString(this.description);
|
||||||
|
dest.writeInt(this.comments);
|
||||||
|
dest.writeString(this.commentsUrl);
|
||||||
|
dest.writeByte(this.truncated ? (byte) 1 : (byte) 0);
|
||||||
|
dest.writeString(this.ownerName);
|
||||||
|
dest.writeSerializable(this.files);
|
||||||
|
dest.writeParcelable(this.user, flags);
|
||||||
|
dest.writeParcelable(this.owner, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected GistsModel(Parcel in) {
|
||||||
|
this.id = in.readLong();
|
||||||
|
this.url = in.readString();
|
||||||
|
this.forksUrl = in.readString();
|
||||||
|
this.commitsUrl = in.readString();
|
||||||
|
this.gistId = in.readString();
|
||||||
|
this.gitPullUrl = in.readString();
|
||||||
|
this.gitPushUrl = in.readString();
|
||||||
|
this.htmlUrl = in.readString();
|
||||||
|
this.publicX = in.readByte() != 0;
|
||||||
|
long tmpCreatedAt = in.readLong();
|
||||||
|
this.createdAt = tmpCreatedAt == -1 ? null : new Date(tmpCreatedAt);
|
||||||
|
long tmpUpdatedAt = in.readLong();
|
||||||
|
this.updatedAt = tmpUpdatedAt == -1 ? null : new Date(tmpUpdatedAt);
|
||||||
|
this.description = in.readString();
|
||||||
|
this.comments = in.readInt();
|
||||||
|
this.commentsUrl = in.readString();
|
||||||
|
this.truncated = in.readByte() != 0;
|
||||||
|
this.ownerName = in.readString();
|
||||||
|
this.files = (GithubFileModel) in.readSerializable();
|
||||||
|
this.user = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
this.owner = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<GistsModel> CREATOR = new Creator<GistsModel>() {
|
||||||
|
@Override public GistsModel createFromParcel(Parcel source) {return new GistsModel(source);}
|
||||||
|
|
||||||
|
@Override public GistsModel[] newArray(int size) {return new GistsModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 12 Feb 2017, 12:14 AM
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class GitCommitListModel extends ArrayList<GitCommitModel> {}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Column;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 08 Dec 2016, 8:59 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class GitCommitModel implements Parcelable {
|
||||||
|
@Column String sha;
|
||||||
|
@Column String url;
|
||||||
|
@Column String message;
|
||||||
|
@Column UserModel author;
|
||||||
|
@Column UserModel committer;
|
||||||
|
@Column UserModel tree;
|
||||||
|
@Column @SerializedName("distinct") boolean distincted;
|
||||||
|
@Column GitCommitListModel parents;
|
||||||
|
@Column int commentCount;
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(this.sha);
|
||||||
|
dest.writeString(this.url);
|
||||||
|
dest.writeString(this.message);
|
||||||
|
dest.writeParcelable(this.author, flags);
|
||||||
|
dest.writeParcelable(this.committer, flags);
|
||||||
|
dest.writeParcelable(this.tree, flags);
|
||||||
|
dest.writeByte(this.distincted ? (byte) 1 : (byte) 0);
|
||||||
|
dest.writeList(this.parents);
|
||||||
|
dest.writeInt(this.commentCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected GitCommitModel(Parcel in) {
|
||||||
|
this.sha = in.readString();
|
||||||
|
this.url = in.readString();
|
||||||
|
this.message = in.readString();
|
||||||
|
this.author = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
this.committer = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
this.tree = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
this.distincted = in.readByte() != 0;
|
||||||
|
in.readList(parents, parents.getClass().getClassLoader());
|
||||||
|
in.readList(this.parents, GitCommitModel.class.getClassLoader());
|
||||||
|
this.commentCount = in.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<GitCommitModel> CREATOR = new Creator<GitCommitModel>() {
|
||||||
|
@Override public GitCommitModel createFromParcel(Parcel source) {return new GitCommitModel(source);}
|
||||||
|
|
||||||
|
@Override public GitCommitModel[] newArray(int size) {return new GitCommitModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 18 Feb 2017, 2:09 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor
|
||||||
|
public class GitHubErrorResponse {
|
||||||
|
private String message;
|
||||||
|
private String documentation_url;
|
||||||
|
private List<GistHubErrorsModel> errors;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 10 Feb 2017, 9:46 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public class GithubFileModel extends HashMap<String, FilesListModel> implements Serializable {}
|
||||||
42
app/src/main/java/com/fastaccess/data/dao/GithubState.java
Normal file
42
app/src/main/java/com/fastaccess/data/dao/GithubState.java
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Column;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 08 Dec 2016, 8:57 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class GithubState implements Parcelable {
|
||||||
|
@Column int additions;
|
||||||
|
@Column int deletions;
|
||||||
|
@Column int total;
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeInt(this.additions);
|
||||||
|
dest.writeInt(this.deletions);
|
||||||
|
dest.writeInt(this.total);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected GithubState(Parcel in) {
|
||||||
|
this.additions = in.readInt();
|
||||||
|
this.deletions = in.readInt();
|
||||||
|
this.total = in.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<GithubState> CREATOR = new Creator<GithubState>() {
|
||||||
|
@Override public GithubState createFromParcel(Parcel source) {return new GithubState(source);}
|
||||||
|
|
||||||
|
@Override public GithubState[] newArray(int size) {return new GithubState[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 10 Dec 2016, 3:34 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
|
public class IssueEventAdapterModel implements Parcelable {
|
||||||
|
|
||||||
|
public static final int HEADER = 1;
|
||||||
|
public static final int ROW = 2;
|
||||||
|
private int type;
|
||||||
|
|
||||||
|
private IssueEventModel issueEvent;
|
||||||
|
private IssueModel issueModel;
|
||||||
|
|
||||||
|
private IssueEventAdapterModel(int type, IssueEventModel model) {
|
||||||
|
this.type = type;
|
||||||
|
this.issueEvent = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IssueEventAdapterModel(int type, IssueModel issueModel) {
|
||||||
|
this.type = type;
|
||||||
|
this.issueModel = issueModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ArrayList<IssueEventAdapterModel> addEvents(@Nullable List<IssueEventModel> modelList) {
|
||||||
|
ArrayList<IssueEventAdapterModel> models = new ArrayList<>();
|
||||||
|
if (modelList == null || modelList.isEmpty()) return models;
|
||||||
|
Stream.of(modelList).forEach(issueEventModel -> models.add(new IssueEventAdapterModel(ROW, issueEventModel)));
|
||||||
|
return models;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeInt(this.type);
|
||||||
|
dest.writeParcelable(this.issueEvent, flags);
|
||||||
|
dest.writeParcelable(this.issueModel, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IssueEventAdapterModel() {}
|
||||||
|
|
||||||
|
@SuppressWarnings("WeakerAccess") protected IssueEventAdapterModel(Parcel in) {
|
||||||
|
this.type = in.readInt();
|
||||||
|
this.issueEvent = in.readParcelable(IssueEventModel.class.getClassLoader());
|
||||||
|
this.issueModel = in.readParcelable(IssueModel.class.getClassLoader());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<IssueEventAdapterModel> CREATOR = new Creator<IssueEventAdapterModel>() {
|
||||||
|
@Override public IssueEventAdapterModel createFromParcel(Parcel source) {return new IssueEventAdapterModel(source);}
|
||||||
|
|
||||||
|
@Override public IssueEventAdapterModel[] newArray(int size) {return new IssueEventAdapterModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.fastaccess.data.dao.types.IssueEventType;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Column;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Id;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 10 Dec 2016, 3:34 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class IssueEventModel implements Parcelable {
|
||||||
|
|
||||||
|
@Column @Id(autoIncrement = false) long id;
|
||||||
|
@Column String url;
|
||||||
|
@Column UserModel actor;
|
||||||
|
@Column UserModel assigner;
|
||||||
|
@Column UserModel assignee;
|
||||||
|
@Column IssueEventType event;
|
||||||
|
@Column MilestoneModel milestone;
|
||||||
|
@Column RenameModel rename;
|
||||||
|
@Column IssueModel source;
|
||||||
|
@Column LabelModel label;
|
||||||
|
@Column String commitId;
|
||||||
|
@Column String commitUrl;
|
||||||
|
@Column Date createdAt;
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeLong(this.id);
|
||||||
|
dest.writeString(this.url);
|
||||||
|
dest.writeParcelable(this.actor, flags);
|
||||||
|
dest.writeParcelable(this.assigner, flags);
|
||||||
|
dest.writeParcelable(this.assignee, flags);
|
||||||
|
dest.writeInt(this.event == null ? -1 : this.event.ordinal());
|
||||||
|
dest.writeParcelable(this.milestone, flags);
|
||||||
|
dest.writeParcelable(this.rename, flags);
|
||||||
|
dest.writeParcelable(this.source, flags);
|
||||||
|
dest.writeParcelable(this.label, flags);
|
||||||
|
dest.writeString(this.commitId);
|
||||||
|
dest.writeString(this.commitUrl);
|
||||||
|
dest.writeLong(this.createdAt != null ? this.createdAt.getTime() : -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected IssueEventModel(Parcel in) {
|
||||||
|
this.id = in.readLong();
|
||||||
|
this.url = in.readString();
|
||||||
|
this.actor = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
this.assigner = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
this.assignee = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
int tmpEvent = in.readInt();
|
||||||
|
this.event = tmpEvent == -1 ? null : IssueEventType.values()[tmpEvent];
|
||||||
|
this.milestone = in.readParcelable(MilestoneModel.class.getClassLoader());
|
||||||
|
this.rename = in.readParcelable(RenameModel.class.getClassLoader());
|
||||||
|
this.source = in.readParcelable(IssueModel.class.getClassLoader());
|
||||||
|
this.label = in.readParcelable(LabelModel.class.getClassLoader());
|
||||||
|
this.commitId = in.readString();
|
||||||
|
this.commitUrl = in.readString();
|
||||||
|
long tmpCreatedAt = in.readLong();
|
||||||
|
this.createdAt = tmpCreatedAt == -1 ? null : new Date(tmpCreatedAt);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<IssueEventModel> CREATOR = new Creator<IssueEventModel>() {
|
||||||
|
@Override public IssueEventModel createFromParcel(Parcel source) {return new IssueEventModel(source);}
|
||||||
|
|
||||||
|
@Override public IssueEventModel[] newArray(int size) {return new IssueEventModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
170
app/src/main/java/com/fastaccess/data/dao/IssueModel.java
Normal file
170
app/src/main/java/com/fastaccess/data/dao/IssueModel.java
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.fastaccess.data.dao.types.IssueState;
|
||||||
|
import com.siimkinks.sqlitemagic.Delete;
|
||||||
|
import com.siimkinks.sqlitemagic.IssueModelTable;
|
||||||
|
import com.siimkinks.sqlitemagic.Select;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Column;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Id;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
import rx.Completable;
|
||||||
|
import rx.Observable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 08 Dec 2016, 9:02 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class IssueModel implements Parcelable {
|
||||||
|
@Column String url;
|
||||||
|
@Column String body;
|
||||||
|
@Column String title;
|
||||||
|
@Column @Id(autoIncrement = false) long id;
|
||||||
|
@Column int comments;
|
||||||
|
@Column int number;
|
||||||
|
@Column boolean locked;
|
||||||
|
@Column IssueState state;
|
||||||
|
@Column UserModel user;
|
||||||
|
@Column UserModel assignee;
|
||||||
|
@Column UsersListModel assignees;
|
||||||
|
@Column LabelListModel labels;
|
||||||
|
@Column MilestoneModel milestone;
|
||||||
|
@Column(handleRecursively = false) RepoModel repository;
|
||||||
|
@Column String repoUrl;
|
||||||
|
@Column String bodyHtml;
|
||||||
|
@Column String htmlUrl;
|
||||||
|
@Column(handleRecursively = false) PullRequestModel pullRequest;
|
||||||
|
@Column Date closedAt;
|
||||||
|
@Column Date createdAt;
|
||||||
|
@Column Date updatedAt;
|
||||||
|
@Column UserModel closedBy;
|
||||||
|
@Column String repoId;
|
||||||
|
@Column String login;
|
||||||
|
|
||||||
|
public Completable save() {
|
||||||
|
return persist().observe().toCompletable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Completable save(@NonNull List<IssueModel> models, @NonNull String repoId, @NonNull String login) {
|
||||||
|
return Delete.from(IssueModelTable.ISSUE_MODEL)
|
||||||
|
.where(IssueModelTable.ISSUE_MODEL.REPO_ID.is(repoId))
|
||||||
|
.observe()
|
||||||
|
.toCompletable()
|
||||||
|
.andThen(Observable.from(models)
|
||||||
|
.map(issueModel -> {
|
||||||
|
issueModel.setRepoId(repoId);
|
||||||
|
issueModel.setLogin(login);
|
||||||
|
return issueModel.save();
|
||||||
|
}))
|
||||||
|
.toCompletable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Observable<List<IssueModel>> getIssues(@NonNull String repoId, @NonNull String login, @NonNull IssueState issueState) {
|
||||||
|
return Select.from(IssueModelTable.ISSUE_MODEL)
|
||||||
|
.where(IssueModelTable.ISSUE_MODEL.REPO_ID.is(repoId)
|
||||||
|
.and(IssueModelTable.ISSUE_MODEL.LOGIN.is(login))
|
||||||
|
.and(IssueModelTable.ISSUE_MODEL.STATE.is(issueState)))
|
||||||
|
.orderBy(IssueModelTable.ISSUE_MODEL.UPDATED_AT.desc())
|
||||||
|
.queryDeep()
|
||||||
|
.observe()
|
||||||
|
.runQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Observable<IssueModel> getIssue(long id) {
|
||||||
|
return Select.from(IssueModelTable.ISSUE_MODEL)
|
||||||
|
.where(IssueModelTable.ISSUE_MODEL.ID.is(id))
|
||||||
|
.queryDeep()
|
||||||
|
.takeFirst()
|
||||||
|
.observe()
|
||||||
|
.runQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Observable<IssueModel> getIssueByNumber(int number) {
|
||||||
|
return Select.from(IssueModelTable.ISSUE_MODEL)
|
||||||
|
.where(IssueModelTable.ISSUE_MODEL.NUMBER.is(number))
|
||||||
|
.queryDeep()
|
||||||
|
.takeFirst()
|
||||||
|
.observe()
|
||||||
|
.runQuery();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(this.url);
|
||||||
|
dest.writeString(this.body);
|
||||||
|
dest.writeString(this.title);
|
||||||
|
dest.writeLong(this.id);
|
||||||
|
dest.writeInt(this.comments);
|
||||||
|
dest.writeInt(this.number);
|
||||||
|
dest.writeByte(this.locked ? (byte) 1 : (byte) 0);
|
||||||
|
dest.writeInt(this.state == null ? -1 : this.state.ordinal());
|
||||||
|
dest.writeParcelable(this.user, flags);
|
||||||
|
dest.writeParcelable(this.assignee, flags);
|
||||||
|
dest.writeList(this.assignees);
|
||||||
|
dest.writeList(this.labels);
|
||||||
|
dest.writeParcelable(this.milestone, flags);
|
||||||
|
dest.writeParcelable(this.repository, flags);
|
||||||
|
dest.writeString(this.repoUrl);
|
||||||
|
dest.writeString(this.bodyHtml);
|
||||||
|
dest.writeString(this.htmlUrl);
|
||||||
|
dest.writeParcelable(this.pullRequest, flags);
|
||||||
|
dest.writeLong(this.closedAt != null ? this.closedAt.getTime() : -1);
|
||||||
|
dest.writeLong(this.createdAt != null ? this.createdAt.getTime() : -1);
|
||||||
|
dest.writeLong(this.updatedAt != null ? this.updatedAt.getTime() : -1);
|
||||||
|
dest.writeParcelable(this.closedBy, flags);
|
||||||
|
dest.writeString(this.repoId);
|
||||||
|
dest.writeString(this.login);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected IssueModel(Parcel in) {
|
||||||
|
this.url = in.readString();
|
||||||
|
this.body = in.readString();
|
||||||
|
this.title = in.readString();
|
||||||
|
this.id = in.readLong();
|
||||||
|
this.comments = in.readInt();
|
||||||
|
this.number = in.readInt();
|
||||||
|
this.locked = in.readByte() != 0;
|
||||||
|
int tmpState = in.readInt();
|
||||||
|
this.state = tmpState == -1 ? null : IssueState.values()[tmpState];
|
||||||
|
this.user = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
this.assignee = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
this.assignees = new UsersListModel();
|
||||||
|
in.readList(this.assignees, this.assignee.getClass().getClassLoader());
|
||||||
|
this.labels = new LabelListModel();
|
||||||
|
in.readList(this.labels, this.labels.getClass().getClassLoader());
|
||||||
|
this.milestone = in.readParcelable(MilestoneModel.class.getClassLoader());
|
||||||
|
this.repository = in.readParcelable(RepoModel.class.getClassLoader());
|
||||||
|
this.repoUrl = in.readString();
|
||||||
|
this.bodyHtml = in.readString();
|
||||||
|
this.htmlUrl = in.readString();
|
||||||
|
this.pullRequest = in.readParcelable(PullRequestModel.class.getClassLoader());
|
||||||
|
long tmpClosedAt = in.readLong();
|
||||||
|
this.closedAt = tmpClosedAt == -1 ? null : new Date(tmpClosedAt);
|
||||||
|
long tmpCreatedAt = in.readLong();
|
||||||
|
this.createdAt = tmpCreatedAt == -1 ? null : new Date(tmpCreatedAt);
|
||||||
|
long tmpUpdatedAt = in.readLong();
|
||||||
|
this.updatedAt = tmpUpdatedAt == -1 ? null : new Date(tmpUpdatedAt);
|
||||||
|
this.closedBy = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
this.repoId = in.readString();
|
||||||
|
this.login = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<IssueModel> CREATOR = new Creator<IssueModel>() {
|
||||||
|
@Override public IssueModel createFromParcel(Parcel source) {return new IssueModel(source);}
|
||||||
|
|
||||||
|
@Override public IssueModel[] newArray(int size) {return new IssueModel[size];}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.annimon.stream.Collectors;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.fastaccess.data.dao.types.IssueState;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 10 Dec 2016, 8:53 AM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor
|
||||||
|
public class IssueRequestModel implements Parcelable {
|
||||||
|
|
||||||
|
|
||||||
|
private IssueState state;
|
||||||
|
private String title;
|
||||||
|
private String body;
|
||||||
|
private int milestone;
|
||||||
|
private String assignee;
|
||||||
|
private List<String> labels;
|
||||||
|
|
||||||
|
|
||||||
|
public static IssueRequestModel clone(@NonNull IssueModel issue) {
|
||||||
|
IssueRequestModel model = new IssueRequestModel();
|
||||||
|
if (issue.getLabels() != null) {
|
||||||
|
model.setLabels(Stream.of(issue.getLabels()).filter(value -> value.getName() != null)
|
||||||
|
.map(LabelModel::getName).collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
model.setAssignee(issue.getAssignee() != null ? issue.getAssignee().getLogin() : null);
|
||||||
|
model.setBody(issue.getBody());
|
||||||
|
model.setMilestone(issue.getMilestone() != null ? issue.getMilestone().getNumber() : 0);
|
||||||
|
model.setState(issue.getState() == IssueState.closed ? IssueState.open : IssueState.closed);
|
||||||
|
model.setTitle(issue.getTitle());
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeInt(this.state == null ? -1 : this.state.ordinal());
|
||||||
|
dest.writeString(this.title);
|
||||||
|
dest.writeString(this.body);
|
||||||
|
dest.writeInt(this.milestone);
|
||||||
|
dest.writeString(this.assignee);
|
||||||
|
dest.writeStringList(this.labels);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("WeakerAccess") protected IssueRequestModel(Parcel in) {
|
||||||
|
int tmpState = in.readInt();
|
||||||
|
this.state = tmpState == -1 ? null : IssueState.values()[tmpState];
|
||||||
|
this.title = in.readString();
|
||||||
|
this.body = in.readString();
|
||||||
|
this.milestone = in.readInt();
|
||||||
|
this.assignee = in.readString();
|
||||||
|
this.labels = in.createStringArrayList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<IssueRequestModel> CREATOR = new Creator<IssueRequestModel>() {
|
||||||
|
@Override public IssueRequestModel createFromParcel(Parcel source) {return new IssueRequestModel(source);}
|
||||||
|
|
||||||
|
@Override public IssueRequestModel[] newArray(int size) {return new IssueRequestModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 12 Feb 2017, 1:32 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class LabelListModel extends ArrayList<LabelModel> {}
|
||||||
42
app/src/main/java/com/fastaccess/data/dao/LabelModel.java
Normal file
42
app/src/main/java/com/fastaccess/data/dao/LabelModel.java
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Column;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 08 Dec 2016, 9:05 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class LabelModel implements Parcelable {
|
||||||
|
@Column String url;
|
||||||
|
@Column String name;
|
||||||
|
@Column String color;
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(this.url);
|
||||||
|
dest.writeString(this.name);
|
||||||
|
dest.writeString(this.color);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected LabelModel(Parcel in) {
|
||||||
|
this.url = in.readString();
|
||||||
|
this.name = in.readString();
|
||||||
|
this.color = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<LabelModel> CREATOR = new Creator<LabelModel>() {
|
||||||
|
@Override public LabelModel createFromParcel(Parcel source) {return new LabelModel(source);}
|
||||||
|
|
||||||
|
@Override public LabelModel[] newArray(int size) {return new LabelModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
52
app/src/main/java/com/fastaccess/data/dao/LicenseModel.java
Normal file
52
app/src/main/java/com/fastaccess/data/dao/LicenseModel.java
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Column;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Id;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 01 Jan 2017, 1:15 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class LicenseModel implements Parcelable {
|
||||||
|
@Id @Column long id;
|
||||||
|
@Column String key;
|
||||||
|
@Column String name;
|
||||||
|
@Column String spdxId;
|
||||||
|
@Column String url;
|
||||||
|
@Column boolean featured;
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeLong(this.id);
|
||||||
|
dest.writeString(this.key);
|
||||||
|
dest.writeString(this.name);
|
||||||
|
dest.writeString(this.spdxId);
|
||||||
|
dest.writeString(this.url);
|
||||||
|
dest.writeByte(this.featured ? (byte) 1 : (byte) 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected LicenseModel(Parcel in) {
|
||||||
|
this.id = in.readLong();
|
||||||
|
this.key = in.readString();
|
||||||
|
this.name = in.readString();
|
||||||
|
this.spdxId = in.readString();
|
||||||
|
this.url = in.readString();
|
||||||
|
this.featured = in.readByte() != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<LicenseModel> CREATOR = new Creator<LicenseModel>() {
|
||||||
|
@Override public LicenseModel createFromParcel(Parcel source) {return new LicenseModel(source);}
|
||||||
|
|
||||||
|
@Override public LicenseModel[] newArray(int size) {return new LicenseModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
163
app/src/main/java/com/fastaccess/data/dao/LoginModel.java
Normal file
163
app/src/main/java/com/fastaccess/data/dao/LoginModel.java
Normal file
@ -0,0 +1,163 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.siimkinks.sqlitemagic.LoginModelTable;
|
||||||
|
import com.siimkinks.sqlitemagic.Select;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Column;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Id;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Unique;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 08 Feb 2017, 8:51 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class LoginModel implements Parcelable {
|
||||||
|
|
||||||
|
@Id(autoIncrement = false) @Column long id;
|
||||||
|
@Column @Unique String login;
|
||||||
|
@Column String avatarUrl;
|
||||||
|
@Column String gravatarId;
|
||||||
|
@Column String url;
|
||||||
|
@Column String htmlUrl;
|
||||||
|
@Column String followersUrl;
|
||||||
|
@Column String followingUrl;
|
||||||
|
@Column String gistsUrl;
|
||||||
|
@Column String starredUrl;
|
||||||
|
@Column String subscriptionsUrl;
|
||||||
|
@Column String organizationsUrl;
|
||||||
|
@Column String reposUrl;
|
||||||
|
@Column String eventsUrl;
|
||||||
|
@Column String receivedEventsUrl;
|
||||||
|
@Column String type;
|
||||||
|
@Column boolean siteAdmin;
|
||||||
|
@Column String name;
|
||||||
|
@Column String company;
|
||||||
|
@Column String blog;
|
||||||
|
@Column String location;
|
||||||
|
@Column String email;
|
||||||
|
@Column boolean hireable;
|
||||||
|
@Column String bio;
|
||||||
|
@Column long publicRepos;
|
||||||
|
@Column long publicGists;
|
||||||
|
@Column long followers;
|
||||||
|
@Column long following;
|
||||||
|
@Column Date createdAt;
|
||||||
|
@Column Date updatedAt;
|
||||||
|
@Column String token;
|
||||||
|
@Column int contributions;
|
||||||
|
|
||||||
|
public void save() {
|
||||||
|
this.persist().execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LoginModel getUser() {
|
||||||
|
return Select.from(LoginModelTable.LOGIN_MODEL)
|
||||||
|
.where(LoginModelTable.LOGIN_MODEL.LOGIN.isNotNull()
|
||||||
|
.and(LoginModelTable.LOGIN_MODEL.TOKEN.isNotNull()))
|
||||||
|
.takeFirst()
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LoginModel getUser(String login) {
|
||||||
|
return Select.from(LoginModelTable.LOGIN_MODEL)
|
||||||
|
.where(LoginModelTable.LOGIN_MODEL.LOGIN.is(login)
|
||||||
|
.and(LoginModelTable.LOGIN_MODEL.TOKEN.isNotNull()))
|
||||||
|
.takeFirst()
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeLong(this.id);
|
||||||
|
dest.writeString(this.login);
|
||||||
|
dest.writeString(this.avatarUrl);
|
||||||
|
dest.writeString(this.gravatarId);
|
||||||
|
dest.writeString(this.url);
|
||||||
|
dest.writeString(this.htmlUrl);
|
||||||
|
dest.writeString(this.followersUrl);
|
||||||
|
dest.writeString(this.followingUrl);
|
||||||
|
dest.writeString(this.gistsUrl);
|
||||||
|
dest.writeString(this.starredUrl);
|
||||||
|
dest.writeString(this.subscriptionsUrl);
|
||||||
|
dest.writeString(this.organizationsUrl);
|
||||||
|
dest.writeString(this.reposUrl);
|
||||||
|
dest.writeString(this.eventsUrl);
|
||||||
|
dest.writeString(this.receivedEventsUrl);
|
||||||
|
dest.writeString(this.type);
|
||||||
|
dest.writeByte(this.siteAdmin ? (byte) 1 : (byte) 0);
|
||||||
|
dest.writeString(this.name);
|
||||||
|
dest.writeString(this.company);
|
||||||
|
dest.writeString(this.blog);
|
||||||
|
dest.writeString(this.location);
|
||||||
|
dest.writeString(this.email);
|
||||||
|
dest.writeByte(this.hireable ? (byte) 1 : (byte) 0);
|
||||||
|
dest.writeString(this.bio);
|
||||||
|
dest.writeLong(this.publicRepos);
|
||||||
|
dest.writeLong(this.publicGists);
|
||||||
|
dest.writeLong(this.followers);
|
||||||
|
dest.writeLong(this.following);
|
||||||
|
dest.writeLong(this.createdAt != null ? this.createdAt.getTime() : -1);
|
||||||
|
dest.writeLong(this.updatedAt != null ? this.updatedAt.getTime() : -1);
|
||||||
|
dest.writeString(this.token);
|
||||||
|
dest.writeInt(this.contributions);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected LoginModel(Parcel in) {
|
||||||
|
this.id = in.readLong();
|
||||||
|
this.login = in.readString();
|
||||||
|
this.avatarUrl = in.readString();
|
||||||
|
this.gravatarId = in.readString();
|
||||||
|
this.url = in.readString();
|
||||||
|
this.htmlUrl = in.readString();
|
||||||
|
this.followersUrl = in.readString();
|
||||||
|
this.followingUrl = in.readString();
|
||||||
|
this.gistsUrl = in.readString();
|
||||||
|
this.starredUrl = in.readString();
|
||||||
|
this.subscriptionsUrl = in.readString();
|
||||||
|
this.organizationsUrl = in.readString();
|
||||||
|
this.reposUrl = in.readString();
|
||||||
|
this.eventsUrl = in.readString();
|
||||||
|
this.receivedEventsUrl = in.readString();
|
||||||
|
this.type = in.readString();
|
||||||
|
this.siteAdmin = in.readByte() != 0;
|
||||||
|
this.name = in.readString();
|
||||||
|
this.company = in.readString();
|
||||||
|
this.blog = in.readString();
|
||||||
|
this.location = in.readString();
|
||||||
|
this.email = in.readString();
|
||||||
|
this.hireable = in.readByte() != 0;
|
||||||
|
this.bio = in.readString();
|
||||||
|
this.publicRepos = in.readLong();
|
||||||
|
this.publicGists = in.readLong();
|
||||||
|
this.followers = in.readLong();
|
||||||
|
this.following = in.readLong();
|
||||||
|
long tmpCreatedAt = in.readLong();
|
||||||
|
this.createdAt = tmpCreatedAt == -1 ? null : new Date(tmpCreatedAt);
|
||||||
|
long tmpUpdatedAt = in.readLong();
|
||||||
|
this.updatedAt = tmpUpdatedAt == -1 ? null : new Date(tmpUpdatedAt);
|
||||||
|
this.token = in.readString();
|
||||||
|
this.contributions = in.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<LoginModel> CREATOR = new Creator<LoginModel>() {
|
||||||
|
@Override public LoginModel createFromParcel(Parcel source) {return new LoginModel(source);}
|
||||||
|
|
||||||
|
@Override public LoginModel[] newArray(int size) {return new LoginModel[size];}
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override public String toString() {
|
||||||
|
return login;
|
||||||
|
}
|
||||||
|
}
|
||||||
39
app/src/main/java/com/fastaccess/data/dao/MarkdownModel.java
Normal file
39
app/src/main/java/com/fastaccess/data/dao/MarkdownModel.java
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 18 Feb 2017, 7:20 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor
|
||||||
|
public class MarkdownModel implements Parcelable {
|
||||||
|
private String text;
|
||||||
|
private String mode = "gfm";
|
||||||
|
private String context = "markdown";
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(this.text);
|
||||||
|
dest.writeString(this.mode);
|
||||||
|
dest.writeString(this.context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("WeakerAccess") protected MarkdownModel(Parcel in) {
|
||||||
|
this.text = in.readString();
|
||||||
|
this.mode = in.readString();
|
||||||
|
this.context = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Parcelable.Creator<MarkdownModel> CREATOR = new Parcelable.Creator<MarkdownModel>() {
|
||||||
|
@Override public MarkdownModel createFromParcel(Parcel source) {return new MarkdownModel(source);}
|
||||||
|
|
||||||
|
@Override public MarkdownModel[] newArray(int size) {return new MarkdownModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 16 Dec 2016, 11:42 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor
|
||||||
|
public class MergeRequestModel implements Parcelable {
|
||||||
|
|
||||||
|
private String commitMessage;
|
||||||
|
private String sha;
|
||||||
|
private String base;
|
||||||
|
private String head;
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(this.commitMessage);
|
||||||
|
dest.writeString(this.sha);
|
||||||
|
dest.writeString(this.base);
|
||||||
|
dest.writeString(this.head);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("WeakerAccess") protected MergeRequestModel(Parcel in) {
|
||||||
|
this.commitMessage = in.readString();
|
||||||
|
this.sha = in.readString();
|
||||||
|
this.base = in.readString();
|
||||||
|
this.head = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<MergeRequestModel> CREATOR = new Creator<MergeRequestModel>() {
|
||||||
|
@Override public MergeRequestModel createFromParcel(Parcel source) {return new MergeRequestModel(source);}
|
||||||
|
|
||||||
|
@Override public MergeRequestModel[] newArray(int size) {return new MergeRequestModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,43 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 16 Dec 2016, 11:40 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor
|
||||||
|
public class MergeResponseModel implements Parcelable {
|
||||||
|
|
||||||
|
private String sha;
|
||||||
|
private boolean merged;
|
||||||
|
private String message;
|
||||||
|
private String documentationUrl;
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(this.sha);
|
||||||
|
dest.writeByte(this.merged ? (byte) 1 : (byte) 0);
|
||||||
|
dest.writeString(this.message);
|
||||||
|
dest.writeString(this.documentationUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("WeakerAccess") protected MergeResponseModel(Parcel in) {
|
||||||
|
this.sha = in.readString();
|
||||||
|
this.merged = in.readByte() != 0;
|
||||||
|
this.message = in.readString();
|
||||||
|
this.documentationUrl = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<MergeResponseModel> CREATOR = new Creator<MergeResponseModel>() {
|
||||||
|
@Override public MergeResponseModel createFromParcel(Parcel source) {return new MergeResponseModel(source);}
|
||||||
|
|
||||||
|
@Override public MergeResponseModel[] newArray(int size) {return new MergeResponseModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Column;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Id;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 08 Dec 2016, 8:47 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class MilestoneModel implements Parcelable {
|
||||||
|
|
||||||
|
@Column String url;
|
||||||
|
@Column String title;
|
||||||
|
@Column String state;
|
||||||
|
@Column String description;
|
||||||
|
@Column @Id(autoIncrement = false) long id;
|
||||||
|
@Column int number;
|
||||||
|
@Column UserModel creator;
|
||||||
|
@Column String htmlUr;
|
||||||
|
@Column int openIssues;
|
||||||
|
@Column int closedIssues;
|
||||||
|
@Column Date createdAt;
|
||||||
|
@Column Date updatedAt;
|
||||||
|
@Column Date closedAt;
|
||||||
|
@Column Date dueOn;
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(this.url);
|
||||||
|
dest.writeString(this.title);
|
||||||
|
dest.writeString(this.state);
|
||||||
|
dest.writeString(this.description);
|
||||||
|
dest.writeLong(this.id);
|
||||||
|
dest.writeInt(this.number);
|
||||||
|
dest.writeParcelable(this.creator, flags);
|
||||||
|
dest.writeString(this.htmlUr);
|
||||||
|
dest.writeInt(this.openIssues);
|
||||||
|
dest.writeInt(this.closedIssues);
|
||||||
|
dest.writeLong(this.createdAt != null ? this.createdAt.getTime() : -1);
|
||||||
|
dest.writeLong(this.updatedAt != null ? this.updatedAt.getTime() : -1);
|
||||||
|
dest.writeLong(this.closedAt != null ? this.closedAt.getTime() : -1);
|
||||||
|
dest.writeLong(this.dueOn != null ? this.dueOn.getTime() : -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected MilestoneModel(Parcel in) {
|
||||||
|
this.url = in.readString();
|
||||||
|
this.title = in.readString();
|
||||||
|
this.state = in.readString();
|
||||||
|
this.description = in.readString();
|
||||||
|
this.id = in.readLong();
|
||||||
|
this.number = in.readInt();
|
||||||
|
this.creator = in.readParcelable(UserModel.class.getClassLoader());
|
||||||
|
this.htmlUr = in.readString();
|
||||||
|
this.openIssues = in.readInt();
|
||||||
|
this.closedIssues = in.readInt();
|
||||||
|
long tmpCreatedAt = in.readLong();
|
||||||
|
this.createdAt = tmpCreatedAt == -1 ? null : new Date(tmpCreatedAt);
|
||||||
|
long tmpUpdatedAt = in.readLong();
|
||||||
|
this.updatedAt = tmpUpdatedAt == -1 ? null : new Date(tmpUpdatedAt);
|
||||||
|
long tmpClosedAt = in.readLong();
|
||||||
|
this.closedAt = tmpClosedAt == -1 ? null : new Date(tmpClosedAt);
|
||||||
|
long tmpDueOn = in.readLong();
|
||||||
|
this.dueOn = tmpDueOn == -1 ? null : new Date(tmpDueOn);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<MilestoneModel> CREATOR = new Creator<MilestoneModel>() {
|
||||||
|
@Override public MilestoneModel createFromParcel(Parcel source) {return new MilestoneModel(source);}
|
||||||
|
|
||||||
|
@Override public MilestoneModel[] newArray(int size) {return new MilestoneModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
41
app/src/main/java/com/fastaccess/data/dao/NameParser.java
Normal file
41
app/src/main/java/com/fastaccess/data/dao/NameParser.java
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.fastaccess.helper.InputHelper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 11 Feb 2017, 11:03 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter @Setter
|
||||||
|
public class NameParser {
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
public NameParser(@Nullable String url) {
|
||||||
|
if (!InputHelper.isEmpty(url)) {
|
||||||
|
Uri uri = Uri.parse(url);
|
||||||
|
List<String> segments = uri.getPathSegments();
|
||||||
|
if (segments == null || segments.size() < 2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.name = segments.get(1);
|
||||||
|
this.username = segments.get(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public String toString() {
|
||||||
|
return "NameParser{" +
|
||||||
|
"name='" + name + '\'' +
|
||||||
|
", username='" + username + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
55
app/src/main/java/com/fastaccess/data/dao/Pageable.java
Normal file
55
app/src/main/java/com/fastaccess/data/dao/Pageable.java
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 15 Nov 2016, 7:04 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor
|
||||||
|
public class Pageable<M extends Parcelable> implements Parcelable {
|
||||||
|
|
||||||
|
private int first;
|
||||||
|
private int next;
|
||||||
|
private int prev;
|
||||||
|
private int last;
|
||||||
|
private int totalCount;
|
||||||
|
private boolean incompleteResults;
|
||||||
|
private List<M> items;
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeInt(this.first);
|
||||||
|
dest.writeInt(this.next);
|
||||||
|
dest.writeInt(this.prev);
|
||||||
|
dest.writeInt(this.last);
|
||||||
|
dest.writeInt(this.totalCount);
|
||||||
|
dest.writeByte(this.incompleteResults ? (byte) 1 : (byte) 0);
|
||||||
|
dest.writeTypedList(this.items);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("WeakerAccess") protected Pageable(Parcel in) {
|
||||||
|
this.first = in.readInt();
|
||||||
|
this.next = in.readInt();
|
||||||
|
this.prev = in.readInt();
|
||||||
|
this.last = in.readInt();
|
||||||
|
this.totalCount = in.readInt();
|
||||||
|
this.incompleteResults = in.readByte() != 0;
|
||||||
|
in.readList(this.items, this.items.getClass().getClassLoader());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<Pageable> CREATOR = new Creator<Pageable>() {
|
||||||
|
@Override public Pageable createFromParcel(Parcel source) {return new Pageable(source);}
|
||||||
|
|
||||||
|
@Override public Pageable[] newArray(int size) {return new Pageable[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
46
app/src/main/java/com/fastaccess/data/dao/PayloadModel.java
Normal file
46
app/src/main/java/com/fastaccess/data/dao/PayloadModel.java
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
package com.fastaccess.data.dao;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Column;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Id;
|
||||||
|
import com.siimkinks.sqlitemagic.annotation.Table;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Kosh on 08 Feb 2017, 10:03 PM
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@Getter @Setter @NoArgsConstructor @Table(persistAll = true)
|
||||||
|
public class PayloadModel implements Parcelable {
|
||||||
|
|
||||||
|
@Id @Column long id;
|
||||||
|
@Column String action;
|
||||||
|
@Column(onDeleteCascade = true, handleRecursively = false) RepoModel forkee;
|
||||||
|
|
||||||
|
@Override public int describeContents() { return 0; }
|
||||||
|
|
||||||
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeLong(this.id);
|
||||||
|
dest.writeString(this.action);
|
||||||
|
dest.writeParcelable(this.forkee, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected PayloadModel(Parcel in) {
|
||||||
|
this.id = in.readLong();
|
||||||
|
this.action = in.readString();
|
||||||
|
this.forkee = in.readParcelable(RepoModel.class.getClassLoader());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<PayloadModel> CREATOR = new Creator<PayloadModel>() {
|
||||||
|
@Override public PayloadModel createFromParcel(Parcel source) {return new PayloadModel(source);}
|
||||||
|
|
||||||
|
@Override public PayloadModel[] newArray(int size) {return new PayloadModel[size];}
|
||||||
|
};
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user