mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-24 18:14:03 +02:00
v2 wip
This commit is contained in:
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
config.js
|
.env
|
||||||
repositories/
|
repositories/
|
||||||
|
repo/
|
||||||
# Created by https://www.gitignore.io/api/node
|
# Created by https://www.gitignore.io/api/node
|
||||||
# Edit at https://www.gitignore.io/?templates=node
|
# Edit at https://www.gitignore.io/?templates=node
|
||||||
|
|
||||||
|
|||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
FROM node:15-slim
|
||||||
|
|
||||||
|
ENV PORT 5000
|
||||||
|
EXPOSE $PORT
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN npm install -g nodemon
|
||||||
|
|
||||||
|
COPY package*.json .
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
RUN npm install forever
|
||||||
|
COPY public .
|
||||||
|
COPY index.js .
|
||||||
|
COPY utils .
|
||||||
|
|
||||||
|
CMD [ "node", "index.js" ]
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
const config = {
|
||||||
|
CLIENT_ID: null,
|
||||||
|
CLIENT_SECRET: null,
|
||||||
|
GITHUB_TOKEN: null,
|
||||||
|
MAX_FILE_SIZE: 10 * 1024 * 1024, // in b
|
||||||
|
MAX_REPO_SIZE: 8 * 1024, // in kb
|
||||||
|
AUTH_CALLBACK: "http://localhost:5000/github/auth",
|
||||||
|
};
|
||||||
|
for (let conf in process.env) {
|
||||||
|
if (config[conf] !== undefined) {
|
||||||
|
config[conf] = process.env[conf];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module.exports = config;
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
anonymous_github:
|
||||||
|
build: .
|
||||||
|
restart: always
|
||||||
|
command: nodemon index.js
|
||||||
|
image: tdurieux/anonymous_github:v2
|
||||||
|
container_name: anonymous_github
|
||||||
|
env_file:
|
||||||
|
- ./.env
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
# - ./repositories:/app/repositories
|
||||||
|
ports:
|
||||||
|
- 5000:5000
|
||||||
|
links:
|
||||||
|
- mongodb
|
||||||
|
- redis
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: "redis:alpine"
|
||||||
|
|
||||||
|
mongodb:
|
||||||
|
image: mongo:latest
|
||||||
|
restart: on-failure
|
||||||
|
ports:
|
||||||
|
- "27017:27017"
|
||||||
|
environment:
|
||||||
|
MONGO_INITDB_ROOT_USERNAME: root
|
||||||
|
MONGO_INITDB_ROOT_PASSWORD: rootpassword
|
||||||
|
volumes:
|
||||||
|
- mongodb_data_container:/data/db
|
||||||
|
command: --quiet
|
||||||
|
healthcheck:
|
||||||
|
test:
|
||||||
|
- CMD
|
||||||
|
- mongo
|
||||||
|
- --eval
|
||||||
|
- "db.adminCommand('ping')"
|
||||||
|
interval: 10s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mongodb_data_container:
|
||||||
@@ -0,0 +1,153 @@
|
|||||||
|
const fs = require("fs").promises;
|
||||||
|
const ofs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
const gh = require("parse-github-url");
|
||||||
|
const { Octokit } = require("@octokit/rest");
|
||||||
|
|
||||||
|
const config = require("./config");
|
||||||
|
const db = require("./utils/database");
|
||||||
|
const repoUtils = require("./utils/repository");
|
||||||
|
const fileUtils = require("./utils/file");
|
||||||
|
const githubUtils = require("./utils/github");
|
||||||
|
|
||||||
|
// const ROOT = "./repositories";
|
||||||
|
const ROOT = "./repo";
|
||||||
|
(async () => {
|
||||||
|
await db.connect();
|
||||||
|
const repositories = await fs.readdir(ROOT);
|
||||||
|
let index = 0;
|
||||||
|
for (let repo of repositories) {
|
||||||
|
// for (let repo of ["14bfc5c6-b794-487e-a58a-c54103a93c7b"]) {
|
||||||
|
console.log("Import ", index++, "/", repositories.length, " ", repo);
|
||||||
|
try {
|
||||||
|
const conf = await repoUtils.getConfig(repo);
|
||||||
|
if (conf) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// const repoPath = path.join("./repositories", repo);
|
||||||
|
const repoPath = path.join(ROOT, repo);
|
||||||
|
const configPath = path.join(repoPath, "config.json");
|
||||||
|
if (!ofs.existsSync(configPath)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const repoConfig = JSON.parse(await fs.readFile(configPath));
|
||||||
|
const r = gh(repoConfig.repository);
|
||||||
|
if (r == null) {
|
||||||
|
console.log(`${repoConfig.repository} is not a valid github url.`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const fullName = `${r.owner}/${r.name}`;
|
||||||
|
|
||||||
|
// const octokit = new Octokit({ auth: config.GITHUB_TOKEN });
|
||||||
|
// try {
|
||||||
|
// await octokit.apps.checkToken({
|
||||||
|
// client_id: config.CLIENT_ID,
|
||||||
|
// access_token: repoConfig.token,
|
||||||
|
// });
|
||||||
|
// } catch (error) {
|
||||||
|
// delete repoConfig.token;
|
||||||
|
// continue
|
||||||
|
// }
|
||||||
|
let token = repoConfig.token;
|
||||||
|
|
||||||
|
if (!token) {
|
||||||
|
token = config.GITHUB_TOKEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
const branches = await repoUtils.getRepoBranches({
|
||||||
|
fullName,
|
||||||
|
token,
|
||||||
|
});
|
||||||
|
const details = await repoUtils.getRepoDetails({
|
||||||
|
fullName,
|
||||||
|
token,
|
||||||
|
});
|
||||||
|
let branch = details.default_branch;
|
||||||
|
if (r.branch && branches[r.branch]) {
|
||||||
|
branch = r.branch;
|
||||||
|
}
|
||||||
|
if (!branches[branch]) {
|
||||||
|
console.log(branch, details.default_branch, branches);
|
||||||
|
}
|
||||||
|
let commit = branches[branch].commit.sha;
|
||||||
|
const anonymizeDate = new Date();
|
||||||
|
|
||||||
|
let mode = "stream";
|
||||||
|
// if (details.size < 1024) {
|
||||||
|
// mode = "download";
|
||||||
|
// }
|
||||||
|
|
||||||
|
let expirationDate = null;
|
||||||
|
if (repoConfig.expiration_date) {
|
||||||
|
expirationDate = new Date(repoConfig.expiration_date["$date"]);
|
||||||
|
}
|
||||||
|
const expirationMode = repoConfig.expiration
|
||||||
|
? repoConfig.expiration
|
||||||
|
: "never";
|
||||||
|
|
||||||
|
const repoConfiguration = {
|
||||||
|
repoId: repo,
|
||||||
|
fullName,
|
||||||
|
// owner: "tdurieux",
|
||||||
|
owner: r.owner,
|
||||||
|
terms: repoConfig.terms,
|
||||||
|
repository: repoConfig.repository,
|
||||||
|
token: repoConfig.token,
|
||||||
|
branch,
|
||||||
|
commit,
|
||||||
|
anonymizeDate,
|
||||||
|
options: {
|
||||||
|
image: false,
|
||||||
|
mode,
|
||||||
|
expirationMode,
|
||||||
|
expirationDate,
|
||||||
|
update: true,
|
||||||
|
page: details.has_pages,
|
||||||
|
pdf: false,
|
||||||
|
notebook: true,
|
||||||
|
loc: false,
|
||||||
|
link: true,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
await db.get("anonymized_repositories").updateOne(
|
||||||
|
{
|
||||||
|
repoId: repo,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$set: repoConfiguration,
|
||||||
|
},
|
||||||
|
{ upsert: true }
|
||||||
|
);
|
||||||
|
if (ofs.existsSync(repoUtils.getOriginalPath(repo))) {
|
||||||
|
await fs.rm(repoUtils.getOriginalPath(repo), {
|
||||||
|
recursive: true,
|
||||||
|
force: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (ofs.existsSync(repoUtils.getAnonymizedPath(repo))) {
|
||||||
|
await fs.rm(repoUtils.getAnonymizedPath(repo), {
|
||||||
|
recursive: true,
|
||||||
|
force: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// await githubUtils.downloadRepoAndAnonymize(repoConfiguration);
|
||||||
|
// await fileUtils.getFileList({ repoConfig: repoConfiguration });
|
||||||
|
await repoUtils.updateStatus(repoConfiguration, "ready");
|
||||||
|
console.log(
|
||||||
|
expirationDate,
|
||||||
|
expirationDate != null && expirationDate < new Date(),
|
||||||
|
expirationDate < new Date()
|
||||||
|
);
|
||||||
|
if (
|
||||||
|
expirationMode != "never" &&
|
||||||
|
expirationDate != null &&
|
||||||
|
expirationDate < new Date()
|
||||||
|
) {
|
||||||
|
await repoUtils.updateStatus(repoConfiguration, "expired");
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await db.close();
|
||||||
|
})();
|
||||||
@@ -1,289 +1,95 @@
|
|||||||
const ofs = require("fs");
|
|
||||||
const fs = require("fs").promises;
|
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const downloadGit = require("download-git-repo");
|
|
||||||
const { Octokit } = require("@octokit/rest");
|
|
||||||
const loc = require("@umijs/linguist");
|
|
||||||
const gh = require("parse-github-url");
|
|
||||||
|
|
||||||
const passport = require("passport");
|
|
||||||
const session = require("express-session");
|
|
||||||
const FileStore = require("session-file-store")(session);
|
|
||||||
const GitHubStrategy = require("passport-github2").Strategy;
|
|
||||||
|
|
||||||
|
const redis = require("redis");
|
||||||
|
const RateLimit = require("express-rate-limit");
|
||||||
|
const RedisStore = require("rate-limit-redis");
|
||||||
const express = require("express");
|
const express = require("express");
|
||||||
const compression = require("compression");
|
const compression = require("compression");
|
||||||
const bodyParser = require("body-parser");
|
const bodyParser = require("body-parser");
|
||||||
|
|
||||||
const config = require("./config");
|
const rediscli = redis.createClient({
|
||||||
|
host: "redis",
|
||||||
|
ttl: 260,
|
||||||
|
});
|
||||||
|
|
||||||
|
const connection = require("./routes/connection");
|
||||||
|
|
||||||
|
const db = require("./utils/database");
|
||||||
|
const fileUtils = require("./utils/file");
|
||||||
|
|
||||||
|
const PORT = process.env.PORT || 5000;
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
app.use(bodyParser.json());
|
app.use(bodyParser.json());
|
||||||
app.use(compression());
|
app.use(compression());
|
||||||
|
|
||||||
passport.serializeUser(function (user, done) {
|
|
||||||
done(null, user);
|
|
||||||
});
|
|
||||||
|
|
||||||
passport.deserializeUser(function (obj, done) {
|
|
||||||
done(null, obj);
|
|
||||||
});
|
|
||||||
|
|
||||||
passport.use(
|
|
||||||
new GitHubStrategy(
|
|
||||||
{
|
|
||||||
clientID: config.clientId,
|
|
||||||
clientSecret: config.clientSecret,
|
|
||||||
callbackURL: config.authCallback,
|
|
||||||
},
|
|
||||||
(accessToken, refreshToken, profile, done) => {
|
|
||||||
// asynchronous verification, for effect...
|
|
||||||
console.log({ accessToken, refreshToken, profile });
|
|
||||||
done(null, { accessToken, refreshToken, profile });
|
|
||||||
|
|
||||||
// an example of how you might save a user
|
|
||||||
// new User({ username: profile.username }).fetch().then(user => {
|
|
||||||
// if (!user) {
|
|
||||||
// user = User.forge({ username: profile.username })
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// user.save({ profile: profile, access_token: accessToken }).then(() => {
|
|
||||||
// return done(null, user)
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
app.use(
|
app.use(
|
||||||
session({
|
new RateLimit({
|
||||||
secret: "keyboard cat",
|
store: new RedisStore({
|
||||||
resave: true,
|
client: rediscli,
|
||||||
saveUninitialized: true,
|
|
||||||
store: new FileStore({
|
|
||||||
path: "./session-store",
|
|
||||||
}),
|
}),
|
||||||
|
windowMs: 15 * 60 * 1000, // 15 minutes
|
||||||
|
max: 200, // limit each IP to 100 requests per windowMs
|
||||||
|
// delayMs: 0, // disable delaying - full speed until the max limit is reached
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
app.use(passport.initialize());
|
app.set("trust proxy", 1);
|
||||||
app.use(passport.session());
|
|
||||||
|
|
||||||
app.get(
|
// handle session and connection
|
||||||
"/github/login",
|
app.use(connection.session);
|
||||||
passport.authenticate("github", { scope: ["repo"] }), /// Note the scope here
|
app.use(connection.passport.initialize());
|
||||||
function (req, res) {
|
app.use(connection.passport.session());
|
||||||
console.log("/github/login");
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
app.get(
|
app.use("/github", connection.router);
|
||||||
"/github/auth",
|
|
||||||
passport.authenticate("github", { failureRedirect: "/" }),
|
|
||||||
function (req, res) {
|
|
||||||
console.log("here");
|
|
||||||
res.redirect("/");
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
function ensureAuthenticated(req, res, next) {
|
// app routes
|
||||||
if (req.isAuthenticated()) {
|
app.use("/api/user", require("./routes/user"));
|
||||||
return next();
|
app.use("/api/repo", require("./routes/file"));
|
||||||
}
|
app.use("/api/repo", require("./routes/repositoy"));
|
||||||
res.redirect("/github/login");
|
|
||||||
}
|
|
||||||
|
|
||||||
app.get("/api/user", async (req, res) => {
|
// wesite view
|
||||||
if (req.user) {
|
app.use("/w/", require("./routes/webview"));
|
||||||
res.json({ username: req.user.profile.username });
|
|
||||||
} else {
|
|
||||||
res.status(403).json({ error: "not_connected" });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get("/api/repos", ensureAuthenticated, async (req, res) => {
|
|
||||||
const octokit = new Octokit({ auth: req.user.accessToken });
|
|
||||||
const repos = await octokit.repos.listForAuthenticatedUser({
|
|
||||||
visibility: "all",
|
|
||||||
sort: "pushed",
|
|
||||||
per_page: 100,
|
|
||||||
});
|
|
||||||
res.json(repos);
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get("/([r|repository])/:id/commit/:sha", (req, res) => {
|
|
||||||
res.status(500).send("To implement!");
|
|
||||||
});
|
|
||||||
|
|
||||||
function downloadRepoAndAnonymize(repoConfig) {
|
|
||||||
const cachePath = path.resolve(
|
|
||||||
__dirname,
|
|
||||||
"repositories",
|
|
||||||
repoConfig.id,
|
|
||||||
"cache"
|
|
||||||
);
|
|
||||||
|
|
||||||
return new Promise(async (resolve, reject) => {
|
|
||||||
fs.access(cachePath, ofs.constants.F_OK).then(
|
|
||||||
() => {},
|
|
||||||
(_) => {
|
|
||||||
try {
|
|
||||||
const opt = {
|
|
||||||
filter: (file) => {
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
map: (file) => {
|
|
||||||
if (file.path.indexOf(".md") > -1) {
|
|
||||||
let content = file.data.toString();
|
|
||||||
for (let term of repoConfig.terms) {
|
|
||||||
content = content.replace(new RegExp(term, "gi"), "XXX");
|
|
||||||
}
|
|
||||||
file.data = content;
|
|
||||||
|
|
||||||
let path = file.path;
|
|
||||||
for (let term of repoConfig.terms) {
|
|
||||||
path = path.replace(new RegExp(term, "gi"), "XXX");
|
|
||||||
}
|
|
||||||
file.path = path;
|
|
||||||
}
|
|
||||||
return file;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
const gurl = gh(repoConfig.repository);
|
|
||||||
if (repoConfig.token) {
|
|
||||||
opt.headers = {
|
|
||||||
"Authorization": `token ${repoConfig.token}`,
|
|
||||||
"user-agent":
|
|
||||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
|
|
||||||
"accept": "application/vnd.github.3.raw",
|
|
||||||
};
|
|
||||||
opt.clone = false;
|
|
||||||
}
|
|
||||||
const url = `direct:https://api.github.com/repos/${gurl.repo}/tarball`;
|
|
||||||
downloadGit(url, cachePath, opt, (err) => {
|
|
||||||
console.log(err);
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async function walk(dir, root) {
|
|
||||||
if (root == null) {
|
|
||||||
root = dir;
|
|
||||||
}
|
|
||||||
let files = await fs.readdir(dir);
|
|
||||||
const output = {};
|
|
||||||
for (let file of files) {
|
|
||||||
let filePath = path.join(dir, file);
|
|
||||||
const stats = await fs.stat(filePath);
|
|
||||||
if (stats.isDirectory()) {
|
|
||||||
output[file] = await walk(filePath, root);
|
|
||||||
} else if (stats.isFile()) {
|
|
||||||
output[file] = stats.size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return output;
|
|
||||||
}
|
|
||||||
|
|
||||||
app.get("/api/files/:id/", (req, res) => {
|
|
||||||
const repo_id = req.params.id;
|
|
||||||
if (!repo_id) {
|
|
||||||
return res.status(404).json({ error: "invalid_repo_id" });
|
|
||||||
}
|
|
||||||
const repoPath = path.resolve(__dirname, "repositories", repo_id);
|
|
||||||
fs.access(repoPath, ofs.constants.F_OK).then(
|
|
||||||
(_) => {
|
|
||||||
fs.readFile(path.resolve(repoPath, "config.json")).then(
|
|
||||||
async (data) => {
|
|
||||||
data = JSON.parse(data);
|
|
||||||
const repoCache = path.join(repoPath, "cache");
|
|
||||||
if (!ofs.existsSync(repoCache)) {
|
|
||||||
await downloadRepoAndAnonymize(data, repo_id);
|
|
||||||
}
|
|
||||||
fs.access(repoCache, ofs.constants.F_OK).then(
|
|
||||||
async (_) => {
|
|
||||||
res.json(await walk(repoCache));
|
|
||||||
},
|
|
||||||
(_) => res.status(404).json({ error: "repo_not_found" })
|
|
||||||
);
|
|
||||||
},
|
|
||||||
(_) => res.status(404).json({ error: "config_error" })
|
|
||||||
);
|
|
||||||
},
|
|
||||||
(_) => res.status(404).json({ error: "repo_not_found" })
|
|
||||||
);
|
|
||||||
});
|
|
||||||
app.get("/api/repository/:id/:path*", (req, res) => {
|
|
||||||
const repo_id = req.params.id;
|
|
||||||
console.log(repo_id);
|
|
||||||
if (!repo_id) {
|
|
||||||
return res.status(404).json({ error: "invalid_repo_id" });
|
|
||||||
}
|
|
||||||
const repoPath = path.resolve(__dirname, "repositories", repo_id);
|
|
||||||
const repoConfig = path.join(repoPath, "config.json");
|
|
||||||
const repoCache = path.join(repoPath, "cache");
|
|
||||||
fs.access(repoConfig, ofs.constants.F_OK).then(
|
|
||||||
(_) => {
|
|
||||||
fs.readFile(repoConfig).then(
|
|
||||||
async (data) => {
|
|
||||||
data = JSON.parse(data);
|
|
||||||
if (!ofs.existsSync(repoCache)) {
|
|
||||||
await downloadRepoAndAnonymize(data, repo_id);
|
|
||||||
}
|
|
||||||
let requestPath = req.params.path;
|
|
||||||
if (req.params[0]) {
|
|
||||||
requestPath += req.params[0];
|
|
||||||
}
|
|
||||||
if (requestPath == null) {
|
|
||||||
requestPath = "README.md";
|
|
||||||
}
|
|
||||||
|
|
||||||
const ppath = path.join(repoCache, requestPath);
|
|
||||||
fs.access(ppath, ofs.constants.F_OK).then(
|
|
||||||
(ok) => res.sendFile(ppath, { dotfiles: "allow" }),
|
|
||||||
(ko) =>
|
|
||||||
res
|
|
||||||
.status(404)
|
|
||||||
.json({ error: "file_not_found", path: requestPath })
|
|
||||||
);
|
|
||||||
},
|
|
||||||
(_) => res.status(404).json({ error: "config_error" })
|
|
||||||
);
|
|
||||||
},
|
|
||||||
(_) => res.status(404).json({ error: "repo_not_found" })
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get("/api/stat/:id/", (req, res) => {
|
|
||||||
const repo_id = req.params.id;
|
|
||||||
const repoPath = path.resolve(__dirname, "repositories", repo_id);
|
|
||||||
const repoCache = path.join(repoPath, "cache");
|
|
||||||
if (ofs.existsSync(repoCache)) {
|
|
||||||
res.json(loc(repoCache).languages);
|
|
||||||
} else {
|
|
||||||
res.status(404).json({ error: "repo_not_found" });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
app.post("/", (req, res) => {
|
|
||||||
res.status(500).send("To implement!");
|
|
||||||
});
|
|
||||||
|
|
||||||
app.use(express.static(__dirname + "/public"));
|
app.use(express.static(__dirname + "/public"));
|
||||||
|
|
||||||
function homeAppResponse(req, res) {
|
async function homeAppResponse(_, res) {
|
||||||
res.sendFile(path.resolve(__dirname, "public", "index.html"));
|
res.sendFile(path.resolve(__dirname, "public", "index.html"));
|
||||||
}
|
}
|
||||||
function exploreAppResponse(req, res) {
|
function exploreAppResponse(req, res) {
|
||||||
|
if (req.headers["accept"].indexOf("text/html") == -1) {
|
||||||
|
// if it is not an html request, it assumes that the browser try to load a different type of resource
|
||||||
|
return res.redirect(`/api/repo/${req.params.repoId}/file/${req.params[0]}`);
|
||||||
|
}
|
||||||
res.sendFile(path.resolve(__dirname, "public", "explore.html"));
|
res.sendFile(path.resolve(__dirname, "public", "explore.html"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.get("/api/supportedTypes", async (req, res) => {
|
||||||
|
res.json(
|
||||||
|
require("textextensions")
|
||||||
|
.default.concat(fileUtils.additionalExtensions)
|
||||||
|
.sort()
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get("/api/stat", async (req, res) => {
|
||||||
|
const nbRepositories = await db
|
||||||
|
.get("anonymized_repositories")
|
||||||
|
.estimatedDocumentCount();
|
||||||
|
|
||||||
|
const nbUsers = (await db.get("anonymized_repositories").distinct("owner"))
|
||||||
|
.length; //await db.get("users").estimatedDocumentCount();
|
||||||
|
res.json({ nbRepositories, nbUsers });
|
||||||
|
});
|
||||||
|
|
||||||
app
|
app
|
||||||
.get("/", homeAppResponse)
|
.get("/", homeAppResponse)
|
||||||
.get("/myrepo", homeAppResponse)
|
.get("/404", homeAppResponse)
|
||||||
.get("/r/*", exploreAppResponse)
|
.get("/anonymize", homeAppResponse)
|
||||||
.get("/repository/*", exploreAppResponse);
|
.get("/r/:repoId/?*", exploreAppResponse)
|
||||||
|
.get("/repository/:repoId/?*", exploreAppResponse)
|
||||||
|
.get("*", homeAppResponse);
|
||||||
|
|
||||||
app.listen(5000, () => {});
|
db.connect().then((_) => {
|
||||||
|
app.listen(PORT, () => {
|
||||||
|
console.log("Database connected and Server started on port: " + PORT);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
Generated
+13498
-3007
File diff suppressed because it is too large
Load Diff
+17
-8
@@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "anonymous_github",
|
"name": "anonymous_github",
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"description": "Anonymise github repositories for double blind reviews",
|
"description": "Anonymise Github repositories for double blind reviews",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "mocha --reporter spec",
|
||||||
"start": "node index.js",
|
"start": "node index.js",
|
||||||
"dev": "nodemon index.js"
|
"dev": "nodemon index.js"
|
||||||
},
|
},
|
||||||
@@ -19,26 +19,35 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/tdurieux/anonymous_github#readme",
|
"homepage": "https://github.com/tdurieux/anonymous_github#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@octokit/rest": "^17.9.2",
|
"@octokit/rest": "^18.3.5",
|
||||||
"@umijs/linguist": "^1.0.1",
|
"@umijs/linguist": "^1.0.1",
|
||||||
|
"array-equal": "^1.0.0",
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
"download-git-repo": "^3.0.2",
|
"connect-redis": "^5.1.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
|
"express-rate-limit": "^5.2.6",
|
||||||
"express-session": "^1.17.1",
|
"express-session": "^1.17.1",
|
||||||
"jszip": "^3.4.0",
|
"extract-zip": "^2.0.1",
|
||||||
|
"istextorbinary": "^5.12.0",
|
||||||
|
"mongodb": "^3.6.4",
|
||||||
"parse-github-url": "^1.0.2",
|
"parse-github-url": "^1.0.2",
|
||||||
"passport": "^0.4.1",
|
"passport": "^0.4.1",
|
||||||
"passport-github2": "^0.1.12",
|
"passport-github2": "^0.1.12",
|
||||||
"path": "^0.12.7",
|
"rate-limit-redis": "^2.1.0",
|
||||||
"request": "^2.88.2",
|
"redis": "^3.0.2",
|
||||||
"session-file-store": "^1.4.0"
|
"textextensions": "^5.12.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"chai": "^4.3.3",
|
||||||
|
"mocha": "^8.3.0",
|
||||||
"nodemon": "^2.0.4"
|
"nodemon": "^2.0.4"
|
||||||
},
|
},
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"public/*",
|
"public/*",
|
||||||
|
"test/*",
|
||||||
|
"repo/*",
|
||||||
|
"repositories/*",
|
||||||
"session-store/*"
|
"session-store/*"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+7
File diff suppressed because one or more lines are too long
Vendored
+2
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,85 @@
|
|||||||
|
.nb-notebook {
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nb-stdout, .nb-stderr {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
margin: 1em 0;
|
||||||
|
padding: 0.1em 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nb-stderr {
|
||||||
|
background-color: #FAA;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nb-cell + .nb-cell {
|
||||||
|
margin-top: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nb-output table {
|
||||||
|
border: 1px solid #000;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nb-output th {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nb-output th, .nb-output td {
|
||||||
|
border: 1px solid #000;
|
||||||
|
padding: 0.25em;
|
||||||
|
text-align: left;
|
||||||
|
vertical-align: middle;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nb-notebook blockquote {
|
||||||
|
border-left: 5px solid #CCC;
|
||||||
|
margin-left: 0;
|
||||||
|
padding-left: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nb-cell {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nb-raw-cell {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
background-color: #f5f2f0;
|
||||||
|
font-family: Consolas, Monaco, 'Andale Mono', monospace;
|
||||||
|
padding: 1em;
|
||||||
|
margin: .5em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nb-output {
|
||||||
|
min-height: 1em;
|
||||||
|
width: 100%;
|
||||||
|
overflow-x: scroll;
|
||||||
|
border-right: 1px dotted #CCC;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nb-output img {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nb-output:before, .nb-input:before {
|
||||||
|
position: absolute;
|
||||||
|
font-family: monospace;
|
||||||
|
color: #999;
|
||||||
|
left: -7.5em;
|
||||||
|
width: 7em;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nb-input:before {
|
||||||
|
content: "In [" attr(data-prompt-number) "]:";
|
||||||
|
}
|
||||||
|
.nb-output:before {
|
||||||
|
content: "Out [" attr(data-prompt-number) "]:";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix pandas dataframe formatting
|
||||||
|
div[style="max-height:1000px;max-width:1500px;overflow:auto;"] {
|
||||||
|
max-height: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,142 @@
|
|||||||
|
/* PrismJS 1.21.0
|
||||||
|
https://prismjs.com/download.html#themes=prism&languages=markup+clike+javascript+julia+python+r */
|
||||||
|
/**
|
||||||
|
* prism.js default theme for JavaScript, CSS and HTML
|
||||||
|
* Based on dabblet (http://dabblet.com)
|
||||||
|
* @author Lea Verou
|
||||||
|
*/
|
||||||
|
|
||||||
|
code[class*="language-"],
|
||||||
|
pre[class*="language-"] {
|
||||||
|
color: black;
|
||||||
|
background: none;
|
||||||
|
text-shadow: 0 1px white;
|
||||||
|
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||||
|
font-size: 1em;
|
||||||
|
text-align: left;
|
||||||
|
white-space: pre;
|
||||||
|
word-spacing: normal;
|
||||||
|
word-break: normal;
|
||||||
|
word-wrap: normal;
|
||||||
|
line-height: 1.5;
|
||||||
|
|
||||||
|
-moz-tab-size: 4;
|
||||||
|
-o-tab-size: 4;
|
||||||
|
tab-size: 4;
|
||||||
|
|
||||||
|
-webkit-hyphens: none;
|
||||||
|
-moz-hyphens: none;
|
||||||
|
-ms-hyphens: none;
|
||||||
|
hyphens: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
|
||||||
|
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
|
||||||
|
text-shadow: none;
|
||||||
|
background: #b3d4fc;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
|
||||||
|
code[class*="language-"]::selection, code[class*="language-"] ::selection {
|
||||||
|
text-shadow: none;
|
||||||
|
background: #b3d4fc;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
code[class*="language-"],
|
||||||
|
pre[class*="language-"] {
|
||||||
|
text-shadow: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Code blocks */
|
||||||
|
pre[class*="language-"] {
|
||||||
|
padding: 1em;
|
||||||
|
margin: .5em 0;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
:not(pre) > code[class*="language-"],
|
||||||
|
pre[class*="language-"] {
|
||||||
|
background: #f5f2f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Inline code */
|
||||||
|
:not(pre) > code[class*="language-"] {
|
||||||
|
padding: .1em;
|
||||||
|
border-radius: .3em;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.comment,
|
||||||
|
.token.prolog,
|
||||||
|
.token.doctype,
|
||||||
|
.token.cdata {
|
||||||
|
color: slategray;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.punctuation {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.namespace {
|
||||||
|
opacity: .7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.property,
|
||||||
|
.token.tag,
|
||||||
|
.token.boolean,
|
||||||
|
.token.number,
|
||||||
|
.token.constant,
|
||||||
|
.token.symbol,
|
||||||
|
.token.deleted {
|
||||||
|
color: #905;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.selector,
|
||||||
|
.token.attr-name,
|
||||||
|
.token.string,
|
||||||
|
.token.char,
|
||||||
|
.token.builtin,
|
||||||
|
.token.inserted {
|
||||||
|
color: #690;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.operator,
|
||||||
|
.token.entity,
|
||||||
|
.token.url,
|
||||||
|
.language-css .token.string,
|
||||||
|
.style .token.string {
|
||||||
|
color: #9a6e3a;
|
||||||
|
/* This background color was intended by the author of this theme. */
|
||||||
|
background: hsla(0, 0%, 100%, .5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.atrule,
|
||||||
|
.token.attr-value,
|
||||||
|
.token.keyword {
|
||||||
|
color: #07a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.function,
|
||||||
|
.token.class-name {
|
||||||
|
color: #DD4A68;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.regex,
|
||||||
|
.token.important,
|
||||||
|
.token.variable {
|
||||||
|
color: #e90;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.important,
|
||||||
|
.token.bold {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.token.italic {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.token.entity {
|
||||||
|
cursor: help;
|
||||||
|
}
|
||||||
+150
-62
@@ -14,7 +14,11 @@
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.btn:focus,
|
||||||
|
.btn:active {
|
||||||
|
outline: none !important;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
textarea,
|
textarea,
|
||||||
select,
|
select,
|
||||||
input,
|
input,
|
||||||
@@ -29,10 +33,8 @@ body {
|
|||||||
}
|
}
|
||||||
header {
|
header {
|
||||||
position: relative;
|
position: relative;
|
||||||
min-height: 100%;
|
|
||||||
}
|
}
|
||||||
.view {
|
.view {
|
||||||
width: 100%;
|
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +55,11 @@ header {
|
|||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
}
|
}
|
||||||
.navbar:not(.top-nav-collapse) {
|
.navbar:not(.top-nav-collapse) {
|
||||||
background: transparent !important;
|
/* background: transparent !important; */
|
||||||
|
}
|
||||||
|
.navbar-brand {
|
||||||
|
width: 280px;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 991px) {
|
@media (max-width: 991px) {
|
||||||
@@ -82,26 +88,26 @@ header {
|
|||||||
a:hover {
|
a:hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
.btn,
|
||||||
.white_border,
|
.white_border,
|
||||||
.black_border {
|
.black_border {
|
||||||
border: 1px solid white;
|
border: 1px solid white;
|
||||||
padding: 7px;
|
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: white;
|
color: white;
|
||||||
min-width: 115px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
.card-header .btn {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.btn,
|
||||||
|
.btn:hover,
|
||||||
a.white_border,
|
a.white_border,
|
||||||
a.white_border:hover,
|
a.white_border:hover,
|
||||||
a.black_border,
|
a.black_border,
|
||||||
a.black_border:hover {
|
a.black_border:hover {
|
||||||
padding: 10px;
|
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
.white_border:focus,
|
.btn::placeholder,
|
||||||
.black_border:focus {
|
|
||||||
background: #333333;
|
|
||||||
border: 1px solid #333333;
|
|
||||||
}
|
|
||||||
.white_border::placeholder,
|
.white_border::placeholder,
|
||||||
.black_border::placeholder {
|
.black_border::placeholder {
|
||||||
/* Chrome, Firefox, Opera, Safari 10.1+ */
|
/* Chrome, Firefox, Opera, Safari 10.1+ */
|
||||||
@@ -109,13 +115,23 @@ a.black_border:hover {
|
|||||||
opacity: 1; /* Firefox */
|
opacity: 1; /* Firefox */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.profile-photo {
|
||||||
|
border-radius: 50%;
|
||||||
|
height: 30px;
|
||||||
|
position: relative;
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
.btn,
|
||||||
.black_border {
|
.black_border {
|
||||||
border: 1px solid #333333;
|
border: 1px solid #333333;
|
||||||
}
|
}
|
||||||
|
.btn,
|
||||||
|
.btn:hover,
|
||||||
a.black_border,
|
a.black_border,
|
||||||
a.black_border:hover {
|
a.black_border:hover {
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
|
.btn::placeholder,
|
||||||
.black_border::placeholder {
|
.black_border::placeholder {
|
||||||
/* Chrome, Firefox, Opera, Safari 10.1+ */
|
/* Chrome, Firefox, Opera, Safari 10.1+ */
|
||||||
color: #666666;
|
color: #666666;
|
||||||
@@ -136,62 +152,44 @@ a.black_border:hover {
|
|||||||
margin: auto;
|
margin: auto;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
.leftCol {
|
||||||
.hljs {
|
position: relative;
|
||||||
background: #f8f8f8 !important;
|
|
||||||
}
|
|
||||||
pre {
|
|
||||||
margin: 0;
|
|
||||||
background: #f8f8f8;
|
|
||||||
-moz-tab-size: 4;
|
|
||||||
tab-size: 4;
|
|
||||||
}
|
|
||||||
/* for block of numbers */
|
|
||||||
.hljs-ln-numbers {
|
|
||||||
-webkit-touch-callout: none;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-khtml-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
|
|
||||||
text-align: right;
|
|
||||||
color: #d1d1d1;
|
|
||||||
vertical-align: top;
|
|
||||||
padding-right: 5px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* for block of code */
|
|
||||||
.hljs-ln-code {
|
|
||||||
padding-left: 5px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.files {
|
|
||||||
position: sticky;
|
|
||||||
top: 0;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: scroll;
|
width: 310px;
|
||||||
z-index: 9;
|
z-index: 9;
|
||||||
background: #ecedef;
|
background: #ecedef;
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
.files {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
overflow: scroll;
|
||||||
|
height: calc(100% - 168px);
|
||||||
|
}
|
||||||
|
.stats {
|
||||||
|
height: 120px;
|
||||||
|
overflow: scroll;
|
||||||
|
border-top: 1px solid #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.files a {
|
.files a {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 4px 4px 4px 30px;
|
padding: 0px 3px 0px 25px;
|
||||||
color: #6e6e6f;
|
color: #555555;
|
||||||
}
|
}
|
||||||
|
|
||||||
.files .file,
|
.files .file,
|
||||||
.files .folder {
|
.files .folder {
|
||||||
position: relative;
|
position: relative;
|
||||||
color: #6e6e6f;
|
color: #555555;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.files .file.active a,
|
.files .file.active a,
|
||||||
.files .file a:hover {
|
.files .file a:hover {
|
||||||
background: #c7cbd2;
|
background: #ecedef;
|
||||||
color: #77777a;
|
color: #555555;
|
||||||
}
|
}
|
||||||
.files ul {
|
.files ul {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
@@ -201,10 +199,10 @@ pre {
|
|||||||
.files li ul {
|
.files li ul {
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
}
|
}
|
||||||
.files .folder tree {
|
.files .folder > ul {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.files .folder.open > tree {
|
.files .folder.open > ul {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.files .file::before {
|
.files .file::before {
|
||||||
@@ -213,13 +211,16 @@ pre {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
width: 7px;
|
width: 7px;
|
||||||
padding: 4px;
|
padding: 1px;
|
||||||
padding-left: 8px;
|
padding-left: 1px;
|
||||||
color: #3ba3f8;
|
color: #858b90;
|
||||||
|
}
|
||||||
|
.ace_editor {
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.files .folder::before {
|
.files .folder::before {
|
||||||
content: "\f07b";
|
content: "\f07b";
|
||||||
|
color: #3ba3f8;
|
||||||
}
|
}
|
||||||
.files .folder.open::before {
|
.files .folder.open::before {
|
||||||
content: "\f07c";
|
content: "\f07c";
|
||||||
@@ -227,7 +228,7 @@ pre {
|
|||||||
|
|
||||||
.paths {
|
.paths {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
padding: 8px 4px;
|
padding: 8px 6px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
@@ -239,7 +240,12 @@ pre {
|
|||||||
.paths a {
|
.paths a {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
}
|
}
|
||||||
|
.paths .breadcrumb-item {
|
||||||
|
padding-left: 3px;
|
||||||
|
}
|
||||||
|
.paths .breadcrumb-item::before {
|
||||||
|
padding-right: 3px;
|
||||||
|
}
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
.main {
|
.main {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -269,20 +275,43 @@ pre {
|
|||||||
.repo .options {
|
.repo .options {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
.main > .container-fluid,
|
.main > .container-fluid {
|
||||||
.main > .container-fluid > .row,
|
|
||||||
.body {
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
.row.top {
|
||||||
|
padding-left: 0;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #4a507b;
|
||||||
|
}
|
||||||
|
.row.center {
|
||||||
|
position: relative;
|
||||||
|
height: calc(100% - 56px);
|
||||||
|
}
|
||||||
|
.body {
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
overflow: scroll;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
padding-top: 42px;
|
padding-top: 42px;
|
||||||
background: #f8f8f8;
|
background: #f8f8f8;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
.file-content {
|
.file-content {
|
||||||
padding: 4px 7px;
|
padding: 4px 7px;
|
||||||
|
text-align: left;
|
||||||
|
background: #ffffff;
|
||||||
|
min-height: 100%;
|
||||||
|
}
|
||||||
|
.image-content {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
text-align: center;
|
||||||
|
padding: 4px;
|
||||||
}
|
}
|
||||||
.file-error {
|
.file-error {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -290,3 +319,62 @@ pre {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
padding-top: 100px;
|
padding-top: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.preview {
|
||||||
|
height: 100%;
|
||||||
|
overflow: scroll;
|
||||||
|
}
|
||||||
|
pdfviewer {
|
||||||
|
display: block;
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
pdfpageviewer {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
notebook {
|
||||||
|
display: block;
|
||||||
|
text-align: left;
|
||||||
|
padding: 15px;
|
||||||
|
padding-left: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.floatingchat-container-wrap {
|
||||||
|
left: inherit !important;
|
||||||
|
bottom: inherit !important;
|
||||||
|
top: 3px !important;
|
||||||
|
height: 47px !important;
|
||||||
|
right: 3px !important;
|
||||||
|
}
|
||||||
|
.floating-chat-kofi-popup-iframe {
|
||||||
|
left: inherit !important;
|
||||||
|
bottom: inherit !important;
|
||||||
|
top: 55px !important;
|
||||||
|
right: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#navbar {
|
||||||
|
padding-right: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.accordion-section .panel-default .panel-title a:after {
|
||||||
|
font-family: "FontAwesome";
|
||||||
|
font-style: normal;
|
||||||
|
font-size: 3rem;
|
||||||
|
content: "\f106";
|
||||||
|
color: #1f7de2;
|
||||||
|
float: right;
|
||||||
|
margin-top: -12px;
|
||||||
|
}
|
||||||
|
.accordion-section .panel-default .panel-title a.collapsed:after {
|
||||||
|
content: "\f107";
|
||||||
|
}
|
||||||
|
.accordion-section .panel-default .panel-body {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table.repositories td {
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
+59
-47
@@ -11,74 +11,86 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- CSS -->
|
<!-- CSS -->
|
||||||
<link
|
<link rel="stylesheet" href="/css/bootstrap.min.css" />
|
||||||
rel="stylesheet"
|
|
||||||
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
|
|
||||||
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
|
|
||||||
crossorigin="anonymous"
|
|
||||||
/>
|
|
||||||
<link rel="stylesheet" href="/css/font-awesome.min.css" />
|
<link rel="stylesheet" href="/css/font-awesome.min.css" />
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/style.css" />
|
<link rel="stylesheet" href="/css/style.css" />
|
||||||
|
<link rel="stylesheet" href="/css/notebook.css" />
|
||||||
|
<link rel="stylesheet" href="/css/prism.css" />
|
||||||
|
<link rel="stylesheet" href="/css/katex.min.css" />
|
||||||
|
|
||||||
<!-- JS -->
|
<!-- JS -->
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular.min.js"></script>
|
<script src="/script/external/angular.min.js"></script>
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular-animate.min.js"></script>
|
<script src="/script/external/angular-sanitize.min.js"></script>
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular-touch.min.js"></script>
|
<script src="/script/external/angular-route.min.js"></script>
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular-route.js"></script>
|
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular-sanitize.js"></script>
|
|
||||||
|
|
||||||
<script
|
<script src="/script/external/jquery-3.4.1.min.js"></script>
|
||||||
src="https://code.jquery.com/jquery-3.4.1.min.js"
|
<script src="/script/external/popper.min.js"></script>
|
||||||
crossorigin="anonymous"
|
<script src="/script/external/bootstrap.min.js"></script>
|
||||||
></script>
|
|
||||||
|
|
||||||
<script
|
<link rel="stylesheet" href="/css/github-markdown.min.css" />
|
||||||
src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
|
|
||||||
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
|
|
||||||
crossorigin="anonymous"
|
|
||||||
></script>
|
|
||||||
<script
|
|
||||||
src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
|
|
||||||
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
|
|
||||||
crossorigin="anonymous"
|
|
||||||
></script>
|
|
||||||
|
|
||||||
<link
|
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/2.8.0/github-markdown.min.css"
|
|
||||||
rel="stylesheet"
|
|
||||||
type="text/css"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<link
|
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css"
|
|
||||||
rel="stylesheet"
|
|
||||||
type="text/css"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<script src="/script/exploreApp.js"></script>
|
<script src="/script/exploreApp.js"></script>
|
||||||
|
<script src="/script/ng-pdfviewer.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body keypress-events>
|
<body keypress-events>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<ng-include
|
||||||
<tree class="files col-3 shadow p-0" file="files" parent=""></tree>
|
src="'/partials/header.htm'"
|
||||||
<div class="col-9 p-0 body">
|
style="display:block;min-height: 50px;"
|
||||||
|
></ng-include>
|
||||||
|
<div class="row center">
|
||||||
|
<div class="leftCol shadow p-2 h-100 overflow-auto" ng-show="files">
|
||||||
|
<button
|
||||||
|
class="btn btn-primary btn-lg btn-block"
|
||||||
|
ng-if="options.download"
|
||||||
|
>
|
||||||
|
Download
|
||||||
|
</button>
|
||||||
|
<tree class="files" file="files" parent=""></tree>
|
||||||
|
<div class="stats" ng-if="options.mode == 'download'">
|
||||||
|
<h5>Code Statistics (LOC)</h5>
|
||||||
|
<div ng-repeat="(lang, stat) in stats" ng-if="stat.code>0">
|
||||||
|
<span ng-bind="lang"></span> <span ng-bind="stat.code"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col p-0 body">
|
||||||
<nav aria-label="breadcrumb">
|
<nav aria-label="breadcrumb">
|
||||||
<ol class="breadcrumb shadow paths">
|
<ol class="breadcrumb shadow paths">
|
||||||
<li class="breadcrumb-item" ng-repeat="p in paths">{{p}}</li>
|
<li class="breadcrumb-item" ng-repeat="p in paths" ng-bind="p">
|
||||||
|
Loading...
|
||||||
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="content" ng-view></div>
|
<div class="content" ng-view></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="bottom"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script src="https://storage.ko-fi.com/cdn/scripts/overlay-widget.js"></script>
|
||||||
|
<script>
|
||||||
|
kofiWidgetOverlay.draw("tdurieux", {
|
||||||
|
type: "floating-chat",
|
||||||
|
"floating-chat.donateButton.text": "Support me",
|
||||||
|
"floating-chat.donateButton.background-color": "#323842",
|
||||||
|
"floating-chat.donateButton.text-color": "#fff",
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script src="/script/external/marked.min.js"></script>
|
||||||
|
<script src="/script/external/pdf.compat.js"></script>
|
||||||
|
<script src="/script/external/pdf.js"></script>
|
||||||
|
<script src="/script/external/ansi_up.min.js"></script>
|
||||||
|
<script src="/script/external/katex-auto-render.min.js"></script>
|
||||||
|
<script src="/script/external/katex.min.js"></script>
|
||||||
|
<script src="/script/external/prism.min.js"></script>
|
||||||
|
<script src="/script/external/purify.min.js"></script>
|
||||||
|
<script src="/script/external/notebook.min.js"></script>
|
||||||
|
|
||||||
|
<script src="/script/external/ace/ace.js"></script>
|
||||||
|
<script src="/script/external/ui-ace.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
<script
|
|
||||||
src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"
|
|
||||||
crossorigin="anonymous"
|
|
||||||
></script>
|
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.8.0/highlightjs-line-numbers.min.js"></script>
|
|
||||||
<script src="//cdnjs.cloudflare.com/ajax/libs/marked/1.1.0/marked.min.js"></script>
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+24
-32
@@ -3,48 +3,40 @@
|
|||||||
<html lang="en" ng-app="anonymous-github" ng-controller="mainController">
|
<html lang="en" ng-app="anonymous-github" ng-controller="mainController">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>{{title || "anonymous Github"}}</title>
|
<title>{{title || "Anonymous Github"}}</title>
|
||||||
<base href="/" />
|
<base href="/" />
|
||||||
|
|
||||||
<!-- CSS -->
|
<!-- CSS -->
|
||||||
<link
|
<link rel="stylesheet" href="/css/bootstrap.min.css" />
|
||||||
rel="stylesheet"
|
<link rel="stylesheet" href="/css/prism.css" />
|
||||||
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
|
<link rel="stylesheet" href="/css/font-awesome.min.css" />
|
||||||
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
|
<link rel="stylesheet" href="/css/github-markdown.min.css" />
|
||||||
crossorigin="anonymous"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/style.css" />
|
<link rel="stylesheet" href="/css/style.css" />
|
||||||
|
|
||||||
<!-- JS -->
|
<!-- JS -->
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular.min.js"></script>
|
<script src="/script/external/angular.min.js"></script>
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular-animate.min.js"></script>
|
<script src="/script/external/angular-route.min.js"></script>
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular-touch.min.js"></script>
|
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular-route.js"></script>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="/css/font-awesome.min.css" />
|
<script src="/script/external/jquery-3.4.1.min.js"></script>
|
||||||
|
<script src="/script/external/popper.min.js"></script>
|
||||||
|
<script src="/script/external/bootstrap.min.js"></script>
|
||||||
|
|
||||||
<script
|
<script src="/script/external/prism.min.js"></script>
|
||||||
src="https://code.jquery.com/jquery-3.4.1.min.js"
|
<script src="/script/external/marked.min.js"></script>
|
||||||
crossorigin="anonymous"
|
|
||||||
></script>
|
|
||||||
|
|
||||||
<script
|
|
||||||
src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
|
|
||||||
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
|
|
||||||
crossorigin="anonymous"
|
|
||||||
></script>
|
|
||||||
<script
|
|
||||||
src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
|
|
||||||
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
|
|
||||||
crossorigin="anonymous"
|
|
||||||
></script>
|
|
||||||
|
|
||||||
<script src="/script/homeApp.js"></script>
|
<script src="/script/homeApp.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body keypress-events ng-view></body>
|
<body keypress-events>
|
||||||
<script
|
<ng-view></ng-view>
|
||||||
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"
|
<script src="https://storage.ko-fi.com/cdn/scripts/overlay-widget.js"></script>
|
||||||
crossorigin="anonymous"
|
<script>
|
||||||
></script>
|
kofiWidgetOverlay.draw("tdurieux", {
|
||||||
|
type: "floating-chat",
|
||||||
|
"floating-chat.donateButton.text": "Support me",
|
||||||
|
"floating-chat.donateButton.background-color": "#323842",
|
||||||
|
"floating-chat.donateButton.text-color": "#fff",
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1 +1,6 @@
|
|||||||
<h1>404</h1>
|
<div class="container-fluid main">
|
||||||
|
<ng-include src="'partials/header.htm'"></ng-include>
|
||||||
|
<div class="row center">
|
||||||
|
<div class="container text-center"><h1 class="display-1">404</h1></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,488 @@
|
|||||||
|
<div class="container-fluid main">
|
||||||
|
<ng-include src="'partials/header.htm'"></ng-include>
|
||||||
|
<div class="row center">
|
||||||
|
<div
|
||||||
|
class="col-9 p-2 preview markdown-body"
|
||||||
|
ng-bind-html="html_readme"
|
||||||
|
ng-if="html_readme"
|
||||||
|
></div>
|
||||||
|
<div class="col shadow overflow-auto h-100 d-flex align-content-end">
|
||||||
|
<div
|
||||||
|
class="p-0 py-2 m-auto"
|
||||||
|
ng-class="{'card': !repoUrl, 'w-50': !repoUrl,'container': repoUrl}"
|
||||||
|
>
|
||||||
|
<form
|
||||||
|
class="form needs-validation"
|
||||||
|
ng-class="{'card-body': !repoUrl}"
|
||||||
|
name="anonymize"
|
||||||
|
novalidate
|
||||||
|
>
|
||||||
|
<h5 class="card-title">Annoymize a reposiotry</h5>
|
||||||
|
<h6 class="card-subtitle mb-2 text-muted">
|
||||||
|
Fill the information to annoymize! It will only take 5min.
|
||||||
|
</h6>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="repoUrl">Type the url of your repository</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="form-control"
|
||||||
|
name="repoUrl"
|
||||||
|
id="repoUrl"
|
||||||
|
ng-class="{'is-invalid': anonymize.repoUrl.$invalid}"
|
||||||
|
ng-model="repoUrl"
|
||||||
|
ng-model-options="{ debounce: {default: 1000, blur: 0, click: 0}, updateOn: 'default blur click' }"
|
||||||
|
ng-change="repoSelected()"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
class="invalid-feedback"
|
||||||
|
ng-show="anonymize.repoUrl.$error.github"
|
||||||
|
>
|
||||||
|
Please provide a valid Github url, e.g.,
|
||||||
|
https://github.com/owner/repo.
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="invalid-feedback"
|
||||||
|
ng-show="anonymize.repoUrl.$error.missing"
|
||||||
|
>
|
||||||
|
{{repoUrl}} does not exist or is not accessible
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="invalid-feedback"
|
||||||
|
ng-show="anonymize.repoUrl.$error.used"
|
||||||
|
>
|
||||||
|
{{repoUrl}} is already anonymized
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" ng-hide="repoUrl">
|
||||||
|
<label for="repositories">Or select one of your repository</label>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<select
|
||||||
|
class="form-control"
|
||||||
|
id="repositories"
|
||||||
|
name="repositories"
|
||||||
|
ng-model="repoUrl"
|
||||||
|
ng-change="repoSelected()"
|
||||||
|
>
|
||||||
|
<option selected value="">None</option>
|
||||||
|
<option
|
||||||
|
ng-repeat="repo in repositories|orderBy:'full_name'"
|
||||||
|
value="https://github.com/{{ repo.full_name }}"
|
||||||
|
ng-bind="repo.full_name"
|
||||||
|
></option>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-append">
|
||||||
|
<button
|
||||||
|
class="btn btn-outline-secondary"
|
||||||
|
ng-click="getRepositories(true)"
|
||||||
|
title="Refresh!"
|
||||||
|
data-toggle="tooltip"
|
||||||
|
data-placement="bottom"
|
||||||
|
>
|
||||||
|
<i class="fa fa-undo"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ng-show="repoUrl">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="branch">Branch</label>
|
||||||
|
<div class="input-group mb-3">
|
||||||
|
<select
|
||||||
|
class="form-control"
|
||||||
|
id="branch"
|
||||||
|
name="branch"
|
||||||
|
ng-model="branch"
|
||||||
|
>
|
||||||
|
<option
|
||||||
|
ng-repeat="b in branches"
|
||||||
|
ng-bind="b.name"
|
||||||
|
value="{{b.name}}"
|
||||||
|
></option>
|
||||||
|
</select>
|
||||||
|
<div class="input-group-append">
|
||||||
|
<button
|
||||||
|
class="btn btn-outline-secondary"
|
||||||
|
ng-click="getBranches(true)"
|
||||||
|
title="Refresh!"
|
||||||
|
data-toggle="tooltip"
|
||||||
|
data-placement="bottom"
|
||||||
|
>
|
||||||
|
<i class="fa fa-undo"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<small class="form-text text-muted"
|
||||||
|
>The branch to anonymize</small
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="commit">Commit</label>
|
||||||
|
<input
|
||||||
|
class="form-control"
|
||||||
|
id="commit"
|
||||||
|
name="commit"
|
||||||
|
ng-model="commit"
|
||||||
|
/>
|
||||||
|
<small class="form-text text-muted"
|
||||||
|
>The commit to anonymize</small
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="repoId">Anonymize repository id</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="form-control"
|
||||||
|
name="repoId"
|
||||||
|
id="repoId"
|
||||||
|
ng-class="{'is-invalid': anonymize.repoId.$invalid}"
|
||||||
|
ng-model="repoId"
|
||||||
|
ng-model-options="{ debounce: {default: 1000, blur: 0, click: 0}, updateOn: 'default blur click' }"
|
||||||
|
/>
|
||||||
|
<small id="idHelp" class="form-text text-muted"
|
||||||
|
>Id used in the url:
|
||||||
|
https://anonymous.4open.science/r/{{repoId}}</small
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="invalid-feedback"
|
||||||
|
ng-show="anonymize.repoId.$error.format"
|
||||||
|
>
|
||||||
|
Repository id can only contain letters and numbers
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="invalid-feedback"
|
||||||
|
ng-show="anonymize.repoId.$error.used"
|
||||||
|
>
|
||||||
|
{{repoId}} is already used
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="terms">Terms to anonymize</label>
|
||||||
|
<textarea
|
||||||
|
class="form-control"
|
||||||
|
id="terms"
|
||||||
|
name="terms"
|
||||||
|
rows="3"
|
||||||
|
ng-model="terms"
|
||||||
|
ng-model-options="{ debounce: 250 }"
|
||||||
|
></textarea>
|
||||||
|
<small id="termsHelp" class="form-text text-muted"
|
||||||
|
>One term per line. Each term will be replaced by XXX</small
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="invalid-feedback"
|
||||||
|
ng-show="anonymize.terms.$error.format"
|
||||||
|
>
|
||||||
|
Terms are in an invalid format
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="accordion mb-3" id="options">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header" id="headingOne">
|
||||||
|
<h2 class="mb-0">
|
||||||
|
<button
|
||||||
|
class="btn btn-block text-left"
|
||||||
|
type="button"
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-target="#collapseOne"
|
||||||
|
aria-expanded="true"
|
||||||
|
aria-controls="collapseOne"
|
||||||
|
>
|
||||||
|
Rendering options
|
||||||
|
</button>
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
id="collapseOne"
|
||||||
|
class="collapse show"
|
||||||
|
aria-labelledby="headingOne"
|
||||||
|
data-parent="#options"
|
||||||
|
>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="form-check">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
id="link"
|
||||||
|
name="link"
|
||||||
|
ng-model="options.link"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="link"
|
||||||
|
>Keep links</label
|
||||||
|
>
|
||||||
|
<small id="termsHelp" class="form-text text-muted"
|
||||||
|
>Keep or remove all the links.</small
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
id="image"
|
||||||
|
name="image"
|
||||||
|
ng-model="options.image"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="image"
|
||||||
|
>Display images</label
|
||||||
|
>
|
||||||
|
<small id="termsHelp" class="form-text text-muted"
|
||||||
|
>Images are not anonymized</small
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
id="pdf"
|
||||||
|
name="pdf"
|
||||||
|
ng-model="options.pdf"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="pdf"
|
||||||
|
>Display PDFs</label
|
||||||
|
>
|
||||||
|
<small id="termsHelp" class="form-text text-muted"
|
||||||
|
>PDF are not anonymized</small
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
id="notebook"
|
||||||
|
name="notebook"
|
||||||
|
ng-model="options.notebook"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="notebook"
|
||||||
|
>Display Notebooks</label
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header" id="headingTwo">
|
||||||
|
<h2 class="mb-0">
|
||||||
|
<button
|
||||||
|
class="btn btn-block text-left collapsed"
|
||||||
|
type="button"
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-target="#collapseTwo"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="collapseTwo"
|
||||||
|
>
|
||||||
|
Features
|
||||||
|
</button>
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
id="collapseTwo"
|
||||||
|
class="collapse"
|
||||||
|
aria-labelledby="headingTwo"
|
||||||
|
data-parent="#options"
|
||||||
|
>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="form-check">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
id="page"
|
||||||
|
name="page"
|
||||||
|
ng-model="options.page"
|
||||||
|
ng-disabled="!details.has_pages"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="page"
|
||||||
|
>Github page</label
|
||||||
|
>
|
||||||
|
<small id="termsHelp" class="form-text text-muted"
|
||||||
|
>Enable anonymized Github pages. It will be available
|
||||||
|
at https://anonymous.4open.science/w/{{repoId}}</small
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
id="loc"
|
||||||
|
name="loc"
|
||||||
|
ng-model="options.loc"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="page"
|
||||||
|
>Line of code</label
|
||||||
|
>
|
||||||
|
<small id="termsHelp" class="form-text text-muted"
|
||||||
|
>Display the number of line of code in the
|
||||||
|
reposiotry</small
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header" id="headingThree">
|
||||||
|
<h2 class="mb-0">
|
||||||
|
<button
|
||||||
|
class="btn btn-block text-left collapsed"
|
||||||
|
type="button"
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-target="#collapseThree"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="collapseThree"
|
||||||
|
>
|
||||||
|
Expiration
|
||||||
|
</button>
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
id="collapseThree"
|
||||||
|
class="collapse"
|
||||||
|
aria-labelledby="headingThree"
|
||||||
|
data-parent="#options"
|
||||||
|
>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="expiration">Expiration options</label>
|
||||||
|
<select
|
||||||
|
class="form-control"
|
||||||
|
id="expiration"
|
||||||
|
name="expiration"
|
||||||
|
ng-model="options.expirationMode"
|
||||||
|
>
|
||||||
|
<option value="never" selected>Never expire</option>
|
||||||
|
<option value="redirect">Redirect to GitHub</option>
|
||||||
|
<option value="remove"
|
||||||
|
>Remove anonymized repository</option
|
||||||
|
>
|
||||||
|
</select>
|
||||||
|
<small class="form-text text-muted"
|
||||||
|
>Define the expiration strategy for the
|
||||||
|
repository.</small
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="form-group"
|
||||||
|
id="expiration-date-form"
|
||||||
|
ng-hide="options.expirationMode=='never'"
|
||||||
|
>
|
||||||
|
<label for="expirationDate">Expiration date</label>
|
||||||
|
<input
|
||||||
|
class="form-control .form-control-lg"
|
||||||
|
type="date"
|
||||||
|
name="expirationDate"
|
||||||
|
id="expirationDate"
|
||||||
|
ng-model="options.expirationDate"
|
||||||
|
/>
|
||||||
|
<small
|
||||||
|
class="form-text text-muted"
|
||||||
|
ng-show="options.expirationMode=='remove'"
|
||||||
|
>The date when the anonymized repository will be
|
||||||
|
removed.</small
|
||||||
|
>
|
||||||
|
<small
|
||||||
|
class="form-text text-muted"
|
||||||
|
ng-show="options.expirationMode=='redirect'"
|
||||||
|
>The date when the anonymized repository will be
|
||||||
|
redirected.</small
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header" id="headingFour">
|
||||||
|
<h2 class="mb-0">
|
||||||
|
<button
|
||||||
|
class="btn btn-block text-left collapsed"
|
||||||
|
type="button"
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-target="#headingFour"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="headingFour"
|
||||||
|
>
|
||||||
|
Advance options
|
||||||
|
</button>
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
id="headingFour"
|
||||||
|
class="collapse"
|
||||||
|
aria-labelledby="headingThree"
|
||||||
|
data-parent="#options"
|
||||||
|
>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="form-check">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
id="update"
|
||||||
|
name="update"
|
||||||
|
ng-model="options.update"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="update"
|
||||||
|
>Auto update</label
|
||||||
|
>
|
||||||
|
<small id="termsHelp" class="form-text text-muted"
|
||||||
|
>Automatically update the anonymized repository with
|
||||||
|
the latest commit of the repository. The repository is
|
||||||
|
updated once per hour maximum.</small
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="mode">Proxy mode</label>
|
||||||
|
<select
|
||||||
|
class="form-control"
|
||||||
|
id="mode"
|
||||||
|
name="mode"
|
||||||
|
ng-model="options.mode"
|
||||||
|
>
|
||||||
|
<option value="stream" selected>Stream</option>
|
||||||
|
<option value="download">Download</option>
|
||||||
|
</select>
|
||||||
|
<small class="form-text text-muted"
|
||||||
|
>How the repository will be anonymized. Stream mode will
|
||||||
|
request the content on the flight. This is the only
|
||||||
|
option for repositories bigger than 10mb. Download will
|
||||||
|
download the repository the repository on the
|
||||||
|
anonymous.4open.science server, it is faster and offer
|
||||||
|
more features.</small
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
id="submit"
|
||||||
|
type="submit"
|
||||||
|
class="btn btn-primary"
|
||||||
|
ng-click="anonymizeRepo($event)"
|
||||||
|
ng-show="repoUrl"
|
||||||
|
ng-if="!isUpdate"
|
||||||
|
>
|
||||||
|
Annoymize
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
id="submit"
|
||||||
|
type="submit"
|
||||||
|
class="btn btn-primary"
|
||||||
|
ng-click="updateRepo($event)"
|
||||||
|
ng-show="repoUrl"
|
||||||
|
ng-if="isUpdate"
|
||||||
|
>
|
||||||
|
Update
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<div class="container-fluid main">
|
||||||
|
<ng-include src="'partials/header.htm'"></ng-include>
|
||||||
|
<div class="row center">
|
||||||
|
<div class="col shadow overflow-auto h-100 d-flex ">
|
||||||
|
<div class="card w-50 m-auto">
|
||||||
|
<form
|
||||||
|
class="form needs-validation card-body"
|
||||||
|
name="claimForm"
|
||||||
|
novalidate
|
||||||
|
>
|
||||||
|
<h5 class="card-title">Claim an annoymized reposiotry</h5>
|
||||||
|
<h6 class="card-subtitle mb-2 text-muted">
|
||||||
|
Claim the ownership of an exisiting annoymized reposiotry.
|
||||||
|
</h6>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="col form-group">
|
||||||
|
<label for="repoUrl">Type the url of your repository</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="form-control"
|
||||||
|
name="repoUrl"
|
||||||
|
id="repoUrl"
|
||||||
|
required
|
||||||
|
ng-class="{'is-invalid': claimForm.repoUrl.$invalid}"
|
||||||
|
ng-model="repoUrl"
|
||||||
|
/>
|
||||||
|
<div class="invalid-feedback"
|
||||||
|
ng-show="claimForm.repoUrl.$error.not_found">The repository is not found.</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="repoId">Anonymize repository id</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
class="form-control"
|
||||||
|
name="repoId"
|
||||||
|
id="repoId"
|
||||||
|
required
|
||||||
|
ng-model="repoId"
|
||||||
|
ng-class="{'is-invalid': claimForm.repoId.$invalid}"
|
||||||
|
/>
|
||||||
|
<small id="idHelp" class="form-text text-muted"
|
||||||
|
>The id is in the repository
|
||||||
|
https://anonymous.4open.science/r/{id}</small
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
id="submit"
|
||||||
|
type="submit"
|
||||||
|
class="btn btn-primary"
|
||||||
|
ng-click="claim()"
|
||||||
|
>
|
||||||
|
Claim
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
<div class="container-fluid main">
|
||||||
|
<ng-include src="'partials/header.htm'"></ng-include>
|
||||||
|
<div class="row center">
|
||||||
|
<div class="leftCol shadow p-1 h-100 overflow-auto">
|
||||||
|
<h3>Filters</h3>
|
||||||
|
<h5>Status</h5>
|
||||||
|
<div class="form-check">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
ng-model="filters.status.ready"
|
||||||
|
id="ready"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="ready"> Ready </label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
ng-model="filters.status.expired"
|
||||||
|
id="expired"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="expired"> Expired </label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
ng-model="filters.status.removed"
|
||||||
|
id="removed"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="removed"> Removed </label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col h-100 overflow-auto">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col p-2">
|
||||||
|
<form>
|
||||||
|
<div class="form-row">
|
||||||
|
<div class="col">
|
||||||
|
<input
|
||||||
|
type="search"
|
||||||
|
class="form-control"
|
||||||
|
id="search"
|
||||||
|
placeholder="Search repository..."
|
||||||
|
ng-model="search"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<label class="input-group-text" for="Order">Order</label>
|
||||||
|
</div>
|
||||||
|
<select class="custom-select" ng-model="orderBy">
|
||||||
|
<option value="repoId">Repository ID</option>
|
||||||
|
<option value="fullName">Repository</option>
|
||||||
|
<option value="-anonymizeDate">Anonymize Date</option>
|
||||||
|
<option value="-status">Status</option>
|
||||||
|
<option value="-lastView">Last View</option>
|
||||||
|
<option value="-pageView">Page View</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col text-right">
|
||||||
|
<a
|
||||||
|
class="btn btn-secondary"
|
||||||
|
href="/claim"
|
||||||
|
title="Claim the ownership of an existing anonymized repository."
|
||||||
|
data-toggle="tooltip"
|
||||||
|
data-placement="bottom"
|
||||||
|
>
|
||||||
|
Claim repository
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-primary" href="/anonymize">
|
||||||
|
Annoymize repository
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col p-2">
|
||||||
|
<table class="table repositories">
|
||||||
|
<thead class="thead-light">
|
||||||
|
<tr>
|
||||||
|
<th scope="col">#</th>
|
||||||
|
<th scope="col">Repository ID</th>
|
||||||
|
<th scope="col">Anonymized repository</th>
|
||||||
|
<th scope="col">Branch</th>
|
||||||
|
<!-- <th scope="col">Commit</th> -->
|
||||||
|
<th scope="col" class="text-center"># Terms</th>
|
||||||
|
<th scope="col" class="text-center">Status</th>
|
||||||
|
<th scope="col" class="text-center">Anonymize date</th>
|
||||||
|
<th scope="col" class="text-center"># Views</th>
|
||||||
|
<th scope="col" class="text-center">Last view</th>
|
||||||
|
<th scope="col" class="text-right">Actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr
|
||||||
|
ng-repeat="repo in repositories| filter:repoFiler| orderBy:orderBy"
|
||||||
|
>
|
||||||
|
<th scope="row">{{$index + 1}}</th>
|
||||||
|
<td>
|
||||||
|
<a href="/r/{{repo.repoId}}" target="__self"
|
||||||
|
>{{repo.repoId}}</a
|
||||||
|
>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="https://github.com/{{repo.fullName}}"
|
||||||
|
>{{repo.fullName}}</a
|
||||||
|
>
|
||||||
|
</td>
|
||||||
|
<td>{{repo.branch}}</td>
|
||||||
|
<!-- <td>{{repo.commit.substring(0, 6)}}</td> -->
|
||||||
|
<td class="text-center">{{repo.terms.length}}</td>
|
||||||
|
<td class="text-center">{{repo.status}}</td>
|
||||||
|
<td class="text-center">{{repo.anonymizeDate | date}}</td>
|
||||||
|
<td class="text-center">{{repo.pageView}}</td>
|
||||||
|
<td class="text-center">{{repo.lastView | date}}</td>
|
||||||
|
<td class="text-right">
|
||||||
|
<div class="dropdown">
|
||||||
|
<button
|
||||||
|
class="btn btn-secondary dropdown-toggle"
|
||||||
|
type="button"
|
||||||
|
id="dropdownMenuButton"
|
||||||
|
data-toggle="dropdown"
|
||||||
|
aria-haspopup="true"
|
||||||
|
aria-expanded="false"
|
||||||
|
>
|
||||||
|
Actions
|
||||||
|
</button>
|
||||||
|
<div
|
||||||
|
class="dropdown-menu"
|
||||||
|
aria-labelledby="dropdownMenuButton"
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
class="dropdown-item"
|
||||||
|
href="/anonymize/{{repo.repoId}}"
|
||||||
|
target="_self"
|
||||||
|
>Edit</a
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
class="dropdown-item"
|
||||||
|
href="#"
|
||||||
|
ng-show="repo.status == 'ready'"
|
||||||
|
ng-click="updateRepository(repo)"
|
||||||
|
>Force update</a
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
class="dropdown-item"
|
||||||
|
href="#"
|
||||||
|
ng-show="repo.status == 'removed'"
|
||||||
|
ng-click="updateRepository(repo)"
|
||||||
|
>Enable</a
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
class="dropdown-item"
|
||||||
|
href="#"
|
||||||
|
ng-show="repo.status != 'removed'"
|
||||||
|
ng-click="removeRepository(repo)"
|
||||||
|
>Remove</a
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
class="dropdown-item"
|
||||||
|
href="/r/{{repo.repoId}}"
|
||||||
|
target="_self"
|
||||||
|
>View</a
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
class="dropdown-item"
|
||||||
|
href="/w/{{repo.repoId}}"
|
||||||
|
target="_self"
|
||||||
|
ng-if="repo.options.page"
|
||||||
|
>View GitHub Page</a
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -1,4 +1,10 @@
|
|||||||
<pre ng-if="type == 'text'" ng-bind="content" class="file-content"></pre>
|
<div ng-if="type == 'text'" ng-model="content" ui-ace="aceOption"></div>
|
||||||
<div ng-if="type == 'html'" ng-bind-html="content" class="file-content"></div>
|
<div ng-if="type == 'html'" ng-bind-html="content" class="file-content markdown-body"></div>
|
||||||
<pre ng-if="type == 'code'"><code class="hljs" ng-bind="content"></code></pre>
|
<div ng-if="type == 'code'" ui-ace="aceOption" ng-model="content"></div>
|
||||||
|
<img ng-if="type == 'image'" class="image-content" ng-src="{{url}}"></img>
|
||||||
|
<div class="h-100 overflow-auto" ng-if="type == 'pdf'">
|
||||||
|
<pdfviewer class="h-100 overflow-auto" src="{{url}}" id="viewer"></pdfviewer>
|
||||||
|
</div>
|
||||||
|
<div ng-if="type == 'IPython'"><notebook file="url"></notebook></div>
|
||||||
|
<div ng-if="type == 'error'" class="file-error" ng-bind="content"></div>
|
||||||
<div ng-if="content == null" class="file-error">Empty file!</div>
|
<div ng-if="content == null" class="file-error">Empty file!</div>
|
||||||
@@ -0,0 +1,187 @@
|
|||||||
|
<div class="container-fluid main">
|
||||||
|
<ng-include src="'partials/header.htm'"></ng-include>
|
||||||
|
<div class="row center">
|
||||||
|
<div class="container px-md-3 px-sm-0">
|
||||||
|
<section
|
||||||
|
class="accordion-section clearfix mt-3"
|
||||||
|
aria-label="Question Accordions"
|
||||||
|
>
|
||||||
|
<div class="container">
|
||||||
|
<h2>Frequently Asked Questions</h2>
|
||||||
|
<div
|
||||||
|
class="panel-group"
|
||||||
|
id="accordion"
|
||||||
|
role="tablist"
|
||||||
|
aria-multiselectable="true"
|
||||||
|
>
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading p-3 mb-3" role="tab" id="heading0">
|
||||||
|
<h3 class="panel-title">
|
||||||
|
<a
|
||||||
|
class="collapsed"
|
||||||
|
role="button"
|
||||||
|
title=""
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-parent="#accordion"
|
||||||
|
href="#collapse0"
|
||||||
|
aria-expanded="true"
|
||||||
|
aria-controls="collapse0"
|
||||||
|
>
|
||||||
|
Can I download the repository?
|
||||||
|
</a>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
id="collapse0"
|
||||||
|
class="panel-collapse collapse"
|
||||||
|
role="tabpanel"
|
||||||
|
aria-labelledby="heading0"
|
||||||
|
>
|
||||||
|
<div class="panel-body px-3 mb-4">
|
||||||
|
<p>
|
||||||
|
It is currently not possible to download an anonymized
|
||||||
|
repository. It is technically possible to implement but
|
||||||
|
would require much more processing and storage. I am
|
||||||
|
currently not able to provide this option due to the
|
||||||
|
increase cost.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading p-3 mb-3" role="tab" id="heading1">
|
||||||
|
<h3 class="panel-title">
|
||||||
|
<a
|
||||||
|
class="collapsed"
|
||||||
|
role="button"
|
||||||
|
title=""
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-parent="#accordion"
|
||||||
|
href="#collapse1"
|
||||||
|
aria-expanded="true"
|
||||||
|
aria-controls="collapse1"
|
||||||
|
>
|
||||||
|
Which file formats are supported?
|
||||||
|
</a>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
id="collapse1"
|
||||||
|
class="panel-collapse collapse"
|
||||||
|
role="tabpanel"
|
||||||
|
aria-labelledby="heading1"
|
||||||
|
>
|
||||||
|
<div class="panel-body px-3 mb-4">
|
||||||
|
<p>
|
||||||
|
Anonymous Github is able to display pure textual files, such as text or source code. It can also render images, PDFs, and notbooks.
|
||||||
|
However, only textual based files are anonymized. Anonymous Github considers the following file format as textual:
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<ul>
|
||||||
|
<li ng-repeat="format in supportedFileTypes" ng-bind="format"></li>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading p-3 mb-3" role="tab" id="heading2">
|
||||||
|
<h3 class="panel-title">
|
||||||
|
<a
|
||||||
|
class="collapsed"
|
||||||
|
role="button"
|
||||||
|
title=""
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-parent="#accordion"
|
||||||
|
href="#collapse2"
|
||||||
|
aria-expanded="true"
|
||||||
|
aria-controls="collapse2"
|
||||||
|
>
|
||||||
|
How much is cost?
|
||||||
|
</a>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
id="collapse2"
|
||||||
|
class="panel-collapse collapse"
|
||||||
|
role="tabpanel"
|
||||||
|
aria-labelledby="heading2"
|
||||||
|
>
|
||||||
|
<div class="panel-body px-3 mb-4">
|
||||||
|
<p>
|
||||||
|
Anonymous Github is free to use, however the server costs me hundreds of dollars per year, a small donation to cover to cost is largely appricated.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading p-3 mb-3" role="tab" id="heading3">
|
||||||
|
<h3 class="panel-title">
|
||||||
|
<a
|
||||||
|
class="collapsed"
|
||||||
|
role="button"
|
||||||
|
title=""
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-parent="#accordion"
|
||||||
|
href="#collapse3"
|
||||||
|
aria-expanded="true"
|
||||||
|
aria-controls="collapse3"
|
||||||
|
>
|
||||||
|
Data privacy?
|
||||||
|
</a>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
id="collapse3"
|
||||||
|
class="panel-collapse collapse"
|
||||||
|
role="tabpanel"
|
||||||
|
aria-labelledby="heading3"
|
||||||
|
>
|
||||||
|
<div class="panel-body px-3 mb-4">
|
||||||
|
<p>
|
||||||
|
The data stored on Anonymous Github are never used or shared in any cases.
|
||||||
|
When a repository is removed or expired only the configuration of the repository is conserved to be able to restore easily the reposiotry and to ensure that no future repository will use the same repository id.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading p-3 mb-3" role="tab" id="heading4">
|
||||||
|
<h3 class="panel-title">
|
||||||
|
<a
|
||||||
|
class="collapsed"
|
||||||
|
role="button"
|
||||||
|
title=""
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-parent="#accordion"
|
||||||
|
href="#collapse4"
|
||||||
|
aria-expanded="true"
|
||||||
|
aria-controls="collapse4"
|
||||||
|
>
|
||||||
|
Privacy of the viewer?
|
||||||
|
</a>
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
id="collapse4"
|
||||||
|
class="panel-collapse collapse"
|
||||||
|
role="tabpanel"
|
||||||
|
aria-labelledby="heading4"
|
||||||
|
>
|
||||||
|
<div class="panel-body px-3 mb-4">
|
||||||
|
<p>
|
||||||
|
No information is collected on the viewer of the repositories.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
<div class="row top navbar navbar-expand-lg navbar-dark">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class=""><a class="navbar-brand" href="">Anonymous GitHub</a></div>
|
||||||
|
<div class="col">
|
||||||
|
<button
|
||||||
|
class="navbar-toggler"
|
||||||
|
type="button"
|
||||||
|
data-toggle="collapse"
|
||||||
|
data-target="#navbar"
|
||||||
|
aria-controls="navbar"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-label="Toggle navigation"
|
||||||
|
>
|
||||||
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
</button>
|
||||||
|
<div class="collapse navbar-collapse" id="navbar">
|
||||||
|
<ul class="navbar-nav mr-auto smooth-scroll">
|
||||||
|
<li class="nav-item" ng-if="!user">
|
||||||
|
<a class="nav-link" ng-class="{'active': path == '/'}" href="/">
|
||||||
|
Home
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item" ng-if="user">
|
||||||
|
<a
|
||||||
|
class="nav-link"
|
||||||
|
ng-class="{'active': path == '/dashboard'}"
|
||||||
|
href="/dashboard"
|
||||||
|
>
|
||||||
|
Home
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item" ng-if="user">
|
||||||
|
<a
|
||||||
|
class="nav-link"
|
||||||
|
ng-class="{'active':path == '/anonymize'}"
|
||||||
|
href="/anonymize"
|
||||||
|
>Annoymize</a
|
||||||
|
>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" ng-class="{'active':path == '/faq'}" href="/faq"
|
||||||
|
>FAQ</a
|
||||||
|
>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a
|
||||||
|
class="nav-link"
|
||||||
|
target="_blank"
|
||||||
|
href="https://github.com/tdurieux/anonymous_github/issues/new"
|
||||||
|
data-offset="30"
|
||||||
|
>Report an issue
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item" ng-if="!user">
|
||||||
|
<a
|
||||||
|
class="nav-link"
|
||||||
|
target="_self"
|
||||||
|
href="/github/login"
|
||||||
|
data-offset="30"
|
||||||
|
>Login
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a
|
||||||
|
class="nav-link nav-icon"
|
||||||
|
target="_blank"
|
||||||
|
href="https://github.com/tdurieux/anonymous_github/"
|
||||||
|
data-offset="30"
|
||||||
|
><i class="fa fa-github" aria-hidden="true"></i
|
||||||
|
></a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item dropdown" ng-if="user">
|
||||||
|
<a
|
||||||
|
class="nav-link dropdown-toggle"
|
||||||
|
href="#"
|
||||||
|
id="navbarDropdownMenuLink"
|
||||||
|
role="button"
|
||||||
|
data-toggle="dropdown"
|
||||||
|
aria-haspopup="true"
|
||||||
|
aria-expanded="false"
|
||||||
|
>
|
||||||
|
<!-- <img
|
||||||
|
height="30"
|
||||||
|
class="d-inline-block align-middle"
|
||||||
|
src="{{user.photo}}"
|
||||||
|
ng-if="user.photo"
|
||||||
|
data-offset="30"
|
||||||
|
/> -->
|
||||||
|
{{user.username}}
|
||||||
|
<!-- <span ng-bind="user.username"></span> -->
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
|
||||||
|
<!-- <a class="dropdown-item" href="/profile">My Profile</a> -->
|
||||||
|
<a class="dropdown-item" href="/dashboard">Projects</a>
|
||||||
|
<div class="dropdown-divider"></div>
|
||||||
|
<a class="dropdown-item" href="/api/user/logout" target="__self"
|
||||||
|
>Logout</a
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="navbar-nav"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
+104
-313
@@ -1,53 +1,8 @@
|
|||||||
<!-- Main navigation -->
|
<div class="container-fluid">
|
||||||
<header class="d-flex">
|
<ng-include src="'partials/header.htm'"></ng-include>
|
||||||
<!-- Navbar -->
|
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark fixed-top scrolling-navbar">
|
|
||||||
<div class="container">
|
|
||||||
<a class="navbar-brand" href="#">Anonymous GitHub</a>
|
|
||||||
<button
|
|
||||||
class="navbar-toggler"
|
|
||||||
type="button"
|
|
||||||
data-toggle="collapse"
|
|
||||||
data-target="#navbarTogglerDemo02"
|
|
||||||
aria-controls="navbarTogglerDemo02"
|
|
||||||
aria-expanded="false"
|
|
||||||
aria-label="Toggle navigation"
|
|
||||||
>
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
|
||||||
</button>
|
|
||||||
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
|
|
||||||
<ul class="navbar-nav mr-auto smooth-scroll">
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="#home"
|
|
||||||
>Home
|
|
||||||
<span class="sr-only">(current)</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="#usage" data-offset="90">Usage</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="#features" data-offset="90">Features</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link" href="#about" data-offset="90">About</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a
|
|
||||||
class="nav-link nav-icon"
|
|
||||||
href="https://github.com/tdurieux/anonymous_github/"
|
|
||||||
data-offset="30"
|
|
||||||
><i class="fa fa-github" aria-hidden="true"></i
|
|
||||||
></a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-link">{{user.username}}</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
<div
|
<div
|
||||||
id="home"
|
id="home"
|
||||||
class="view rgba-gradient d-flex align-self-stretch justify-content-center align-items-center"
|
class="row view rgba-gradient d-flex align-self-stretch justify-content-center align-items-center"
|
||||||
>
|
>
|
||||||
<!-- Content -->
|
<!-- Content -->
|
||||||
<div class="container px-md-3 px-sm-0">
|
<div class="container px-md-3 px-sm-0">
|
||||||
@@ -63,290 +18,126 @@
|
|||||||
<h4 class="subtext-header mt-2 mb-4">
|
<h4 class="subtext-header mt-2 mb-4">
|
||||||
Double-blind your repository in 5 min!
|
Double-blind your repository in 5 min!
|
||||||
</h4>
|
</h4>
|
||||||
<input
|
|
||||||
id="url_input"
|
|
||||||
type="text"
|
|
||||||
placeholder="Repository URL..."
|
|
||||||
name="githubRepository"
|
|
||||||
class="white_border"
|
|
||||||
value=""
|
|
||||||
/>
|
|
||||||
or
|
|
||||||
<span ng-if="!user">
|
<span ng-if="!user">
|
||||||
<a href="github/login" class="white_border">Login to GitHub</a>
|
<a href="/github/login" target="_self" class="p-2 white_border"
|
||||||
|
>Login with GitHub to anonymize</a
|
||||||
|
>
|
||||||
</span>
|
</span>
|
||||||
<span ng-if="user">
|
|
||||||
<a href="/myrepo" class="white_border">List my repositories</a>
|
|
||||||
</span>
|
|
||||||
or
|
|
||||||
<button id="edit-button" class="white_border">
|
|
||||||
Edit your existing repository
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
<!--Grid column-->
|
<!--Grid column-->
|
||||||
</div>
|
</div>
|
||||||
<div class="row add_form">
|
|
||||||
<div class="col-md-12 mb-4 white-text fadeIn">
|
|
||||||
<div class="alert alert-danger" role="alert">
|
|
||||||
The repository has to be public,
|
|
||||||
<a href="github/login">login to GitHub</a> for private
|
|
||||||
repositories!
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-md-12 mb-4 white-text fadeIn">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="ignoredTerms"
|
|
||||||
>The text to remove from the repository will be replaced by
|
|
||||||
XXX.</label
|
|
||||||
>
|
|
||||||
<small id="ignoredTermsHelp" class="form-text text-muted"
|
|
||||||
>One term per line (case insensitive).</small
|
|
||||||
>
|
|
||||||
<textarea
|
|
||||||
class="form-control .form-control-lg"
|
|
||||||
name="terms"
|
|
||||||
id="ignoredTerms"
|
|
||||||
rows="5"
|
|
||||||
></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="expiration">Expiration options</label>
|
|
||||||
<select class="form-control" id="expiration" name="expiration">
|
|
||||||
<option value="never">Never</option>
|
|
||||||
<option value="redirect"
|
|
||||||
>Redirect to the GitHub repository</option
|
|
||||||
>
|
|
||||||
<option value="remove">Remove anonymized repository</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="form-group"
|
|
||||||
id="expiration-date-form"
|
|
||||||
style="display: none;"
|
|
||||||
>
|
|
||||||
<label for="date">Expiration date.</label>
|
|
||||||
<small class="form-text text-muted"
|
|
||||||
>When the anonymous repository.</small
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
class="form-control .form-control-lg"
|
|
||||||
type="date"
|
|
||||||
name="expiration_date"
|
|
||||||
id="date"
|
|
||||||
value=""
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<button id="submit" type="submit" class="white_border">
|
|
||||||
Submit</button
|
|
||||||
>`
|
|
||||||
|
|
||||||
<button id="delete" class="white_border" style="color: red;">
|
|
||||||
Delete</button
|
|
||||||
>`
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<form class="row edit_form" style="display: none;">
|
|
||||||
<h2>Edit Anonymized Repository</h2>
|
|
||||||
<div class="col-md-12 mb-4 white-text fadeIn">
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Repository ID</label>
|
|
||||||
<input
|
|
||||||
class="form-control .form-control-lg"
|
|
||||||
type="text"
|
|
||||||
name="id"
|
|
||||||
id="id"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label>Repository URL</label>
|
|
||||||
<input
|
|
||||||
class="form-control .form-control-lg"
|
|
||||||
type="url"
|
|
||||||
name="githubRepository"
|
|
||||||
id="url"
|
|
||||||
value=""
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<button type="submit" class="white_border">Submit</button>
|
|
||||||
<button id="edit_cancel" type="submit" class="white_border">
|
|
||||||
Cancel</button
|
|
||||||
>`
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
<!--Grid row-->
|
<!--Grid row-->
|
||||||
</div>
|
</div>
|
||||||
<!-- Content -->
|
<!-- Content -->
|
||||||
</div>
|
</div>
|
||||||
</header>
|
<main>
|
||||||
<main>
|
<div class="container">
|
||||||
<div class="container">
|
<!--Grid row-->
|
||||||
<!--Grid row-->
|
<div class="row py-5">
|
||||||
<div class="row py-5">
|
<div class="col-md-12">
|
||||||
<div class="col-md-12">
|
<h2 id="usage">Usage</h2>
|
||||||
<h2 id="usage">Usage</h2>
|
<div class="card-text mb-auto">
|
||||||
<div class="card-text mb-auto">
|
<ol>
|
||||||
<ol>
|
<li>
|
||||||
<li>
|
<a href="/github/login">Login</a> with Github access your
|
||||||
Fill the Github repo URL
|
dashboard and anonymize your repositories.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>Complete the list of terms that will be anonymized.</li>
|
||||||
Complete the list of terms that will be anonymized.
|
<li>Anonymize and share your link in your double-blind paper.</li>
|
||||||
<span class="text-muted"
|
</ol>
|
||||||
>The anonymization of the content is done by replacing all
|
Example of an annoymized repository:
|
||||||
occurrences of words in a list by "XXX".The word list typically
|
<a
|
||||||
contains the institution name, author names, logins,
|
href="https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/"
|
||||||
etc...</span
|
>https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/</a
|
||||||
>
|
>.
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
Define if you want an expiration date for your anonymized
|
|
||||||
repository. You can keep it for ever, remove the repository after
|
|
||||||
a specific date or redirect the user to the GitHub repository.
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
As result, a unique url is created with the content of your
|
|
||||||
repository, for example,
|
|
||||||
<a
|
|
||||||
href="http://anonymous.4open.science/repository/840c8c57-3c32-451e-bf12-0e20be300389/"
|
|
||||||
>http://anonymous.4open.science/repository/840c8c57-3c32-451e-bf12-0e20be300389/</a
|
|
||||||
>.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--Grid column-->
|
|
||||||
<div class="col-md-12">
|
|
||||||
<h2 id="features">Features</h2>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
|
||||||
<div
|
|
||||||
class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative"
|
|
||||||
>
|
|
||||||
<div class="col p-4 d-flex flex-column position-static">
|
|
||||||
<h3 class="mb-0">Anonymized</h3>
|
|
||||||
<p class="card-text mb-auto">
|
|
||||||
Anonymous GitHub Anonymizes the content of the repository but also
|
|
||||||
hide the issues, pull-requests, history. This way you are sure
|
|
||||||
that your repository stays anonymized.
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!--Grid column-->
|
||||||
<div class="col-md-6">
|
<div class="col-md-12"><h2 id="features">Features</h2></div>
|
||||||
<div
|
<div class="col-md-6">
|
||||||
class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative"
|
<div
|
||||||
>
|
class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative"
|
||||||
<div class="col p-4 d-flex flex-column position-static">
|
>
|
||||||
<h3 class="mb-0">Always up-to-date</h3>
|
<div class="col p-4 d-flex flex-column position-static">
|
||||||
<p class="card-text mb-auto">
|
<h3 class="mb-0">Easy</h3>
|
||||||
Anonymous GitHub follows to track of the changes on your
|
<p class="card-text mb-auto">
|
||||||
repository and updates the anonymous version automatically.
|
In three clicks, you anonymize your repository. It makes it an
|
||||||
</p>
|
easy and quick step to do before the submission of paper.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col-md-6">
|
||||||
<div class="col-md-6">
|
<div
|
||||||
<div
|
class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative"
|
||||||
class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative"
|
>
|
||||||
>
|
<div class="col p-4 d-flex flex-column position-static">
|
||||||
<div class="col p-4 d-flex flex-column position-static">
|
<h3 class="mb-0">Always up-to-date</h3>
|
||||||
<h3 class="mb-0">Fast</h3>
|
<p class="card-text mb-auto">
|
||||||
<p class="card-text mb-auto">
|
Anonymous GitHub tracks the changes on your repository and
|
||||||
With Anonymous GitHub, it requires only 5min to anonymize your
|
updates the anonymous version automatically.
|
||||||
repository. No more time lost to create a anonymized version of
|
</p>
|
||||||
your repository.
|
</div>
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col-md-6">
|
||||||
<div class="col-md-6">
|
<div
|
||||||
<div
|
class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative"
|
||||||
class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative"
|
>
|
||||||
>
|
<div class="col p-4 d-flex flex-column position-static">
|
||||||
<div class="col p-4 d-flex flex-column position-static">
|
<h3 class="mb-0">Support many file formats</h3>
|
||||||
<h3 class="mb-0">Open-source</h3>
|
<p class="card-text mb-auto">
|
||||||
<p class="card-text mb-auto">
|
Anonymous GitHub renders mainly file, from source code to
|
||||||
Anonymous GitHub is open-source, you can easily deploy it for your
|
images, notebook or PDF.
|
||||||
conference and simplify the life of your authors.
|
</p>
|
||||||
</p>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col-md-6">
|
||||||
<div class="col-md-12">
|
<div
|
||||||
<h2 id="about">Metrics</h2>
|
class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative"
|
||||||
</div>
|
>
|
||||||
<div class="col-md-12">
|
<div class="col p-4 d-flex flex-column position-static">
|
||||||
<div
|
<h3 class="mb-0">Open-source</h3>
|
||||||
class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative"
|
<p class="card-text mb-auto">
|
||||||
>
|
Anonymous GitHub is open-source
|
||||||
<div class="col p-4 d-flex flex-column position-static">
|
<a
|
||||||
<h3 class="mb-auto text-center">2609 Anonymized Repositories</h3>
|
class="nav-icon"
|
||||||
<p class="card-text mb-auto">
|
target="_blank"
|
||||||
<strong></strong>
|
href="https://github.com/tdurieux/anonymous_github/"
|
||||||
</p>
|
data-offset="30"
|
||||||
|
><i class="fa fa-github" aria-hidden="true"></i></a
|
||||||
|
>, you can easily deploy it for your conference and simplify the
|
||||||
|
life of your authors.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-12"><h2 id="about">Metrics</h2></div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div
|
||||||
|
class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative"
|
||||||
|
>
|
||||||
|
<div class="col p-4 d-flex flex-column position-static">
|
||||||
|
<h3 class="mb-auto text-center">
|
||||||
|
{{stat.nbRepositories}} Anonymized Repositories
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div
|
||||||
|
class="row no-gutters border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative"
|
||||||
|
>
|
||||||
|
<div class="col p-4 d-flex flex-column position-static">
|
||||||
|
<h3 class="mb-auto text-center">{{stat.nbUsers}} Users</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--Grid column-->
|
||||||
</div>
|
</div>
|
||||||
<!--Grid column-->
|
<!--Grid row-->
|
||||||
</div>
|
</div>
|
||||||
<!--Grid row-->
|
</main>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
|
||||||
<script>
|
|
||||||
if ($("#url_input")[0].value != "") {
|
|
||||||
$(".view").addClass("active");
|
|
||||||
}
|
|
||||||
$("#url_input").on("focus", (e) => {
|
|
||||||
$(".view").addClass("active");
|
|
||||||
});
|
|
||||||
if ($("#expiration")[0].value == "never") {
|
|
||||||
$("#expiration-date-form").hide();
|
|
||||||
} else {
|
|
||||||
$("#expiration-date-form").show();
|
|
||||||
}
|
|
||||||
$("#expiration").change((e) => {
|
|
||||||
value = e.currentTarget.value;
|
|
||||||
if (value == "never") {
|
|
||||||
$("#expiration-date-form").hide();
|
|
||||||
} else {
|
|
||||||
$("#expiration-date-form").show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if ($(document).scrollTop() < 35) {
|
|
||||||
$(".navbar").removeClass("top-nav-collapse");
|
|
||||||
} else {
|
|
||||||
$(".navbar").addClass("top-nav-collapse");
|
|
||||||
}
|
|
||||||
$(document).scroll((e) => {
|
|
||||||
if ($(document).scrollTop() < 35) {
|
|
||||||
$(".navbar").removeClass("top-nav-collapse");
|
|
||||||
} else {
|
|
||||||
$(".navbar").addClass("top-nav-collapse");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("#edit_cancel").on("click", (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
$(".edit_form").hide();
|
|
||||||
$(".main-options").show();
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
$("#delete").on("click", (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
if (confirm("Are you sure you want to delete the repository?")) {
|
|
||||||
$("#expiration")[0].value = "remove";
|
|
||||||
var date = new Date();
|
|
||||||
date.setDate(date.getDate() - 1);
|
|
||||||
$("#date")[0].value = date.toISOString().split("T")[0];
|
|
||||||
$("#submit").click();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
$("#edit-button").on("click", (e) => {
|
|
||||||
e.preventDefault();
|
|
||||||
$(".view").removeClass("active");
|
|
||||||
$(".edit_form").show();
|
|
||||||
$(".main-options").hide();
|
|
||||||
$("#id").focus();
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<div class="container d-flex h-100">
|
||||||
|
<h1 class="display-1 m-auto" ng-if="!error">Loading...</h1>
|
||||||
|
<h1 class="display-1 m-auto" ng-if="error" ng-bind="error"></h1>
|
||||||
|
</div>
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<div class="container" style="margin-top: 70px;">
|
|
||||||
<div class="list-group">
|
|
||||||
<div
|
|
||||||
class="list-group-item list-group-item-action"
|
|
||||||
ng-repeat="repo in repos"
|
|
||||||
>
|
|
||||||
<div class="d-flex mb-12 justify-content-between">
|
|
||||||
<h5 class="mb-1">{{ repo.full_name }}</h5>
|
|
||||||
<small>
|
|
||||||
{{ repo.private? "Private": "Public" }}
|
|
||||||
</small>
|
|
||||||
</div>
|
|
||||||
<p class="mb-1" ng-if="repo.description">{{ repo.description }}</p>
|
|
||||||
<div class="mb-1">
|
|
||||||
<a
|
|
||||||
class="btn btn-primary anonymize-btn"
|
|
||||||
href="/?githubRepository=https://github.com/{{ repo.full_name }}&id={{ repo.uuid }}"
|
|
||||||
>Anonymize</a
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
+351
-82
@@ -1,22 +1,26 @@
|
|||||||
angular
|
angular
|
||||||
.module("anonymous-github", ["ngRoute", "ngSanitize"])
|
.module("anonymous-github", [
|
||||||
.config(function ($routeProvider, $locationProvider) {
|
"ngRoute",
|
||||||
|
"ngSanitize",
|
||||||
|
"ui.ace",
|
||||||
|
"ngPDFViewer",
|
||||||
|
])
|
||||||
|
.config(function($routeProvider, $locationProvider) {
|
||||||
$routeProvider
|
$routeProvider
|
||||||
.when("/:path*", {
|
.when("/:path*", {
|
||||||
templateUrl: "/partials/explore.htm",
|
templateUrl: "/partials/explore.htm",
|
||||||
controller: "exploreController",
|
controller: "exploreController",
|
||||||
title: "Explore",
|
title: "Explore",
|
||||||
})
|
})
|
||||||
.when("/404", {
|
.otherwise({
|
||||||
templateUrl: "/partials/404.htm",
|
templateUrl: "/partials/loading.htm",
|
||||||
title: "Not Found!",
|
title: "Anonymous Github",
|
||||||
});
|
});
|
||||||
//.otherwise("/error");
|
|
||||||
$locationProvider.html5Mode(true);
|
$locationProvider.html5Mode(true);
|
||||||
})
|
})
|
||||||
.factory("RecursionHelper", [
|
.factory("RecursionHelper", [
|
||||||
"$compile",
|
"$compile",
|
||||||
function ($compile) {
|
function($compile) {
|
||||||
return {
|
return {
|
||||||
/**
|
/**
|
||||||
* Manually compiles the element, fixing the recursion loop.
|
* Manually compiles the element, fixing the recursion loop.
|
||||||
@@ -24,7 +28,7 @@ angular
|
|||||||
* @param [link] A post-link function, or an object with function(s) registered via pre and post properties.
|
* @param [link] A post-link function, or an object with function(s) registered via pre and post properties.
|
||||||
* @returns An object containing the linking functions.
|
* @returns An object containing the linking functions.
|
||||||
*/
|
*/
|
||||||
compile: function (element, link) {
|
compile: function(element, link) {
|
||||||
// Normalize the link parameter
|
// Normalize the link parameter
|
||||||
if (angular.isFunction(link)) {
|
if (angular.isFunction(link)) {
|
||||||
link = { post: link };
|
link = { post: link };
|
||||||
@@ -38,13 +42,13 @@ angular
|
|||||||
/**
|
/**
|
||||||
* Compiles and re-adds the contents
|
* Compiles and re-adds the contents
|
||||||
*/
|
*/
|
||||||
post: function (scope, element) {
|
post: function(scope, element) {
|
||||||
// Compile the contents
|
// Compile the contents
|
||||||
if (!compiledContents) {
|
if (!compiledContents) {
|
||||||
compiledContents = $compile(contents);
|
compiledContents = $compile(contents);
|
||||||
}
|
}
|
||||||
// Re-add the compiled contents to the element
|
// Re-add the compiled contents to the element
|
||||||
compiledContents(scope, function (clone) {
|
compiledContents(scope, function(clone) {
|
||||||
element.append(clone);
|
element.append(clone);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -60,45 +64,164 @@ angular
|
|||||||
])
|
])
|
||||||
.directive("tree", [
|
.directive("tree", [
|
||||||
"RecursionHelper",
|
"RecursionHelper",
|
||||||
function (RecursionHelper) {
|
function(RecursionHelper) {
|
||||||
return {
|
return {
|
||||||
restrict: "E",
|
restrict: "E",
|
||||||
scope: { file: "=", parent: "@" },
|
scope: { file: "=", parent: "@" },
|
||||||
template:
|
// template:
|
||||||
"<ul>" +
|
// "<ul>" +
|
||||||
'<li class="file" ng-repeat="(name, child) in file" ng-class="{folder: isDir(child), active: isActive(name), open: opens[name]}">' +
|
// '<li class="file" ng-repeat="f in afiles" ng-class="{folder: isDir(f.child), active: isActive(f.name), open: opens[f.name]}">' +
|
||||||
"<a href='/r/{{repoId}}/{{parent}}/{{name}}' ng-if='!isDir(child)'>{{name}}</a>" +
|
// "<a href='/r/{{repoId}}/{{parent}}/{{f.name}}' ng-if='!isDir(f.child)'>{{f.name}}</a>" +
|
||||||
"<a ng-click='openFolder(name)' ng-if='isDir(child)'>{{name}}</a>" +
|
// "<a ng-click='openFolder(f.name)' ng-if='isDir(f.child)'>{{f.name}}</a>" +
|
||||||
'<tree file="child" parent="{{parent}}/{{name}}" ng-if="isDir(child)""></tree>' +
|
// '<tree file="f.child" parent="{{parent}}/{{f.name}}" ng-if="isDir(f.child)""></tree>' +
|
||||||
"</li>" +
|
// "</li>" +
|
||||||
"</ul>",
|
// "</ul>",
|
||||||
compile: function (element) {
|
compile: function(element) {
|
||||||
// Use the compile function from the RecursionHelper,
|
|
||||||
// And return the linking function(s) which it returns
|
|
||||||
return RecursionHelper.compile(element);
|
return RecursionHelper.compile(element);
|
||||||
},
|
},
|
||||||
controller: function ($scope, $location) {
|
controller: function($element, $scope, $location, $compile) {
|
||||||
$scope.repoId = document.location.pathname.split("/")[2];
|
$scope.repoId = document.location.pathname.split("/")[2];
|
||||||
|
|
||||||
$scope.opens = {};
|
$scope.opens = {};
|
||||||
$scope.isActive = function (name) {
|
const toArray = function(obj) {
|
||||||
return $location.path() == $scope.parent + "/" + name;
|
const output = [];
|
||||||
|
for (let name in obj) {
|
||||||
|
if (obj[name].size != null) {
|
||||||
|
// it is a file
|
||||||
|
output.push({ name, size: obj[name].size, sha: obj[name].sha });
|
||||||
|
} else {
|
||||||
|
output.push({
|
||||||
|
name,
|
||||||
|
sha: obj[name].sha,
|
||||||
|
child: obj[name],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return output;
|
||||||
};
|
};
|
||||||
$scope.openFolder = function (folder) {
|
|
||||||
|
const sortFiles = (f1, f2) => {
|
||||||
|
const f1d = isDir(f1.child);
|
||||||
|
const f2d = isDir(f2.child);
|
||||||
|
if (f1d && f2d) {
|
||||||
|
return f1.name - f2.name;
|
||||||
|
}
|
||||||
|
if (f1d) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if (f2d) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return f1.name - f2.name;
|
||||||
|
};
|
||||||
|
|
||||||
|
function generate(current, parentPath) {
|
||||||
|
const afiles = toArray(current).sort(sortFiles);
|
||||||
|
let output = "<ul>";
|
||||||
|
for (let f of afiles) {
|
||||||
|
let dir = isDir(f.child);
|
||||||
|
let name = f.name;
|
||||||
|
let size = f.size;
|
||||||
|
if (dir) {
|
||||||
|
let test = name;
|
||||||
|
current = toArray(f.child);
|
||||||
|
while (current.length == 1) {
|
||||||
|
test += "/" + current[0].name;
|
||||||
|
size = current[0].size;
|
||||||
|
current = toArray(current[0].child);
|
||||||
|
}
|
||||||
|
name = test;
|
||||||
|
if (current.length == 0) {
|
||||||
|
dir = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const path = `${parentPath}/${name}`;
|
||||||
|
output += `<li class="file ${
|
||||||
|
dir ? "folder" : ""
|
||||||
|
}" ng-class="{active: isActive('${path}'), open: opens['${path}']}" title="Size: ${size}">`;
|
||||||
|
if (dir) {
|
||||||
|
output += `<a ng-click="openFolder('${path}', $event)">${name}</a>`;
|
||||||
|
} else {
|
||||||
|
output += `<a href='/r/${$scope.repoId}/${path}'>${name}</a>`;
|
||||||
|
}
|
||||||
|
// output += generate(f.child, parentPath + "/" + f.name);
|
||||||
|
output + "</li>";
|
||||||
|
}
|
||||||
|
return output + "</ul>";
|
||||||
|
}
|
||||||
|
function display() {
|
||||||
|
const output = generate($scope.file, "");
|
||||||
|
$compile(output)($scope, (clone) => {
|
||||||
|
$element.append(clone);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.$watch("file", (newValue) => {
|
||||||
|
if (newValue == null) return;
|
||||||
|
if (Array.isArray(newValue)) return;
|
||||||
|
if (Object.keys(newValue).length == 0) {
|
||||||
|
return $element.html("Empty repository");
|
||||||
|
}
|
||||||
|
display();
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.isActive = function(name) {
|
||||||
|
return $location.path() == name;
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.openFolder = function(folder, event) {
|
||||||
$scope.opens[folder] = !$scope.opens[folder];
|
$scope.opens[folder] = !$scope.opens[folder];
|
||||||
|
if (event.srcElement.nextSibling == null) {
|
||||||
|
const folders = folder.substring(1).split("/");
|
||||||
|
let current = $scope.file;
|
||||||
|
for (let folder of folders) {
|
||||||
|
current = current[folder];
|
||||||
|
}
|
||||||
|
$compile(generate(current, folder))($scope, (clone) => {
|
||||||
|
angular.element(event.srcElement.parentNode).append(clone);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
$scope.isDir = function (child) {
|
const isFile = function(child) {
|
||||||
return !Number.isInteger(child);
|
return child == null || child.size != null;
|
||||||
|
};
|
||||||
|
const isDir = function(child) {
|
||||||
|
return !isFile(child);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
.filter("filterObj", function () {
|
.directive("notebook", [
|
||||||
return function (input, search) {
|
function() {
|
||||||
|
return {
|
||||||
|
restrict: "E",
|
||||||
|
scope: { file: "=" },
|
||||||
|
controller: function($element, $scope, $http) {
|
||||||
|
function render() {
|
||||||
|
if (!$scope.file) return;
|
||||||
|
$http.get($scope.file).then((res) => {
|
||||||
|
var notebook = nb.parse(res.data);
|
||||||
|
var rendered = notebook.render();
|
||||||
|
// console.log(angular.element(rendered))
|
||||||
|
$element.append(rendered);
|
||||||
|
Prism.highlightAll();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$scope.$watch("file", (v) => {
|
||||||
|
render();
|
||||||
|
});
|
||||||
|
render();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
])
|
||||||
|
.filter("filterObj", function() {
|
||||||
|
return function(input, search) {
|
||||||
if (!input) return input;
|
if (!input) return input;
|
||||||
if (!search) return input;
|
if (!search) return input;
|
||||||
var result = {};
|
var result = {};
|
||||||
angular.forEach(input, function (value, key) {
|
angular.forEach(input, function(value, key) {
|
||||||
if (search(value)) {
|
if (search(value)) {
|
||||||
result[key] = value;
|
result[key] = value;
|
||||||
}
|
}
|
||||||
@@ -106,20 +229,36 @@ angular
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.controller("mainController", function ($scope, $http, $location) {
|
.controller("mainController", function($scope, $http, $location) {
|
||||||
$scope.files = [];
|
$scope.error = null;
|
||||||
|
$scope.files = null;
|
||||||
$scope.repoId = document.location.pathname.split("/")[2];
|
$scope.repoId = document.location.pathname.split("/")[2];
|
||||||
$scope.paths = $location.path().split("/");
|
$scope.paths = $location
|
||||||
|
.path()
|
||||||
|
.substring(1)
|
||||||
|
.split("/");
|
||||||
|
|
||||||
$scope.$on("$routeChangeSuccess", function (event, current) {
|
$scope.$on("$routeChangeSuccess", function(event, current) {
|
||||||
console.log(event, current);
|
$scope.paths = $location
|
||||||
$scope.paths = $location.path().split("/");
|
.path()
|
||||||
|
.substring(1)
|
||||||
|
.split("/");
|
||||||
});
|
});
|
||||||
|
|
||||||
function getFiles() {
|
function getFiles(callback) {
|
||||||
$http.get(`/api/files/${$scope.repoId}`).then(
|
$http.get(`/api/repo/${$scope.repoId}/files/`).then(
|
||||||
(res) => {
|
(res) => {
|
||||||
$scope.files = res.data;
|
$scope.files = res.data;
|
||||||
|
if ($scope.paths.length == 0 || $scope.paths[0] == "") {
|
||||||
|
for (let file in $scope.files) {
|
||||||
|
if (file.toLowerCase().indexOf("readme") > -1) {
|
||||||
|
$location.url(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (callback) {
|
||||||
|
return callback();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
@@ -127,56 +266,186 @@ angular
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
getFiles();
|
|
||||||
|
|
||||||
$http.get(`/api/stat/${$scope.repoId}`).then(
|
function getStats() {
|
||||||
(res) => {
|
$http.get(`/api/repo/${$scope.repoId}/stats/`).then(
|
||||||
console.log(res.data);
|
|
||||||
},
|
|
||||||
(err) => {
|
|
||||||
console.log(err);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.controller("exploreController", function ($scope, $http, $routeParams) {
|
|
||||||
console.log("here");
|
|
||||||
$scope.content = "";
|
|
||||||
$scope.type = "code";
|
|
||||||
|
|
||||||
const textFiles = ["LICENSE", ".txt"];
|
|
||||||
|
|
||||||
function getContent(path) {
|
|
||||||
$http.get(`/api/repository/${$scope.repoId}/${path}`).then(
|
|
||||||
(res) => {
|
(res) => {
|
||||||
$scope.content = res.data;
|
$scope.stats = res.data;
|
||||||
if ($scope.content == "") {
|
|
||||||
$scope.content = null;
|
|
||||||
}
|
|
||||||
$scope.type = "code";
|
|
||||||
|
|
||||||
for (let t of textFiles) {
|
|
||||||
if (path.toLowerCase().indexOf(t.toLowerCase()) > -1) {
|
|
||||||
$scope.type = "text";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($scope.type == "code" && path.toLowerCase().indexOf(".md") > -1) {
|
|
||||||
$scope.content = marked(res.data);
|
|
||||||
$scope.type = "html";
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
document.querySelectorAll("pre code").forEach((block) => {
|
|
||||||
hljs.highlightBlock(block);
|
|
||||||
hljs.lineNumbersBlock(block);
|
|
||||||
});
|
|
||||||
}, 50);
|
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
$scope.content = err.data;
|
|
||||||
// $location.url("/" + err.status);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
function getUser() {
|
||||||
|
$http.get("/api/user").then(
|
||||||
|
(res) => {
|
||||||
|
if (res) $scope.user = res.data;
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
$scope.user = null;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
getUser();
|
||||||
|
async function getOptions(callback) {
|
||||||
|
$http.get(`/api/repo/${$scope.repoId}/options`).then(
|
||||||
|
(res) => {
|
||||||
|
$scope.options = res.data;
|
||||||
|
if ($scope.options.url) {
|
||||||
|
// the repository is expired with redirect option
|
||||||
|
window.location = $scope.options.url;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (callback) {
|
||||||
|
callback(res.data);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
if (err.data.error == "repository_expired") {
|
||||||
|
$scope.error = "The repository is not available!";
|
||||||
|
} else if (err.data.error == "repo_not_found") {
|
||||||
|
$scope.error = "The repository is not found!";
|
||||||
|
} else {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
getOptions((options) => {
|
||||||
|
getFiles(() => {
|
||||||
|
if (options.mode == "download") {
|
||||||
|
getStats();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.controller("exploreController", function(
|
||||||
|
$scope,
|
||||||
|
$http,
|
||||||
|
$routeParams,
|
||||||
|
PDFViewerService
|
||||||
|
) {
|
||||||
|
const extensionModes = {
|
||||||
|
yml: "yaml",
|
||||||
|
txt: "text",
|
||||||
|
py: "python",
|
||||||
|
js: "javascript",
|
||||||
|
};
|
||||||
|
const textFiles = ["license", "txt"];
|
||||||
|
const imageFiles = ["png", "jpg", "jpeg", "gif"];
|
||||||
|
|
||||||
|
$scope.content = "";
|
||||||
|
$scope.path = $routeParams.path;
|
||||||
|
$scope.url = `/api/repo/${$scope.repoId}/file/${$scope.path}`;
|
||||||
|
|
||||||
|
let extension = $routeParams.path.toLowerCase();
|
||||||
|
const extensionIndex = extension.lastIndexOf(".");
|
||||||
|
if (extensionIndex > -1) {
|
||||||
|
extension = extension.substring(extensionIndex + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.type = getType(extension);
|
||||||
|
|
||||||
|
function getMode(extension) {
|
||||||
|
if (extensionModes[extension]) {
|
||||||
|
return extensionModes[extension];
|
||||||
|
}
|
||||||
|
return extension;
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.aceOption = {
|
||||||
|
readOnly: true,
|
||||||
|
useWrapMode: true,
|
||||||
|
showGutter: true,
|
||||||
|
theme: "chrome",
|
||||||
|
useSoftTab: true,
|
||||||
|
showPrintMargin: true,
|
||||||
|
tabSize: 2,
|
||||||
|
highlightSelectedWord: true,
|
||||||
|
fontSize: 15,
|
||||||
|
keyBinding: "vscode",
|
||||||
|
fullLineSelection: true,
|
||||||
|
highlightActiveLine: true,
|
||||||
|
showInvisibles: false,
|
||||||
|
showIndentGuides: true,
|
||||||
|
showPrintMargin: false,
|
||||||
|
highlightSelectedWord: true,
|
||||||
|
enableBehaviours: true,
|
||||||
|
fadeFoldWidgets: false,
|
||||||
|
mode: getMode(extension),
|
||||||
|
|
||||||
|
onLoad: function(_editor) {
|
||||||
|
_editor.setFontSize($scope.aceOption.fontSize);
|
||||||
|
_editor.setReadOnly($scope.aceOption.readOnly);
|
||||||
|
_editor.setKeyboardHandler($scope.aceOption.keyBinding);
|
||||||
|
_editor.setSelectionStyle(
|
||||||
|
$scope.aceOption.fullLineSelection ? "line" : "text"
|
||||||
|
);
|
||||||
|
_editor.setOption("displayIndentGuides", true);
|
||||||
|
_editor.setHighlightActiveLine($scope.aceOption.highlightActiveLine);
|
||||||
|
_editor.setShowInvisibles($scope.aceOption.showInvisibles);
|
||||||
|
_editor.setDisplayIndentGuides($scope.aceOption.showIndentGuides);
|
||||||
|
|
||||||
|
_editor.renderer.setShowPrintMargin($scope.aceOption.showPrintMargin);
|
||||||
|
_editor.setHighlightSelectedWord(
|
||||||
|
$scope.aceOption.highlightSelectedWord
|
||||||
|
);
|
||||||
|
_editor.session.setUseSoftTabs($scope.aceOption.useSoftTab);
|
||||||
|
_editor.session.setTabSize($scope.aceOption.tabSize);
|
||||||
|
_editor.setBehavioursEnabled($scope.aceOption.enableBehaviours);
|
||||||
|
_editor.setFadeFoldWidgets($scope.aceOption.fadeFoldWidgets);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
function getType(extension) {
|
||||||
|
if (extension == "pdf") {
|
||||||
|
$scope.instance = PDFViewerService.Instance("viewer");
|
||||||
|
return "pdf";
|
||||||
|
}
|
||||||
|
if (extension == "md") {
|
||||||
|
return "md";
|
||||||
|
}
|
||||||
|
if (extension == "ipynb") {
|
||||||
|
return "IPython";
|
||||||
|
}
|
||||||
|
if (textFiles.indexOf(extension) > -1) {
|
||||||
|
return "text";
|
||||||
|
}
|
||||||
|
if (imageFiles.indexOf(extension) > -1) {
|
||||||
|
return "image";
|
||||||
|
}
|
||||||
|
return "code";
|
||||||
|
}
|
||||||
|
|
||||||
|
function getContent(path) {
|
||||||
|
$http
|
||||||
|
.get(`/api/repo/${$scope.repoId}/file/${path}`, {
|
||||||
|
transformResponse: (data) => {
|
||||||
|
return data;
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then(
|
||||||
|
(res) => {
|
||||||
|
$scope.content = res.data;
|
||||||
|
if ($scope.content == "") {
|
||||||
|
$scope.content = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($scope.type == "md") {
|
||||||
|
$scope.content = marked(res.data);
|
||||||
|
$scope.type = "html";
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
Prism.highlightAll();
|
||||||
|
}, 50);
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
$scope.type = "error";
|
||||||
|
console.log(err);
|
||||||
|
$scope.content = err.data;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
getContent($routeParams.path ? $routeParams.path : "");
|
getContent($routeParams.path ? $routeParams.path : "");
|
||||||
});
|
});
|
||||||
|
|||||||
Vendored
+17
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";function i(e,t){return e.type.lastIndexOf(t+".xml")>-1}var r=e("../token_iterator").TokenIterator;t.singletonTags=["area","base","br","col","command","embed","hr","html","img","input","keygen","link","meta","param","source","track","wbr"],t.blockTags=["article","aside","blockquote","body","div","dl","fieldset","footer","form","head","header","html","nav","ol","p","script","section","style","table","tbody","tfoot","thead","ul"],t.beautify=function(e){var n=new r(e,0,0),s=n.getCurrentToken(),o=e.getTabString(),u=t.singletonTags,a=t.blockTags,f,l=!1,c=!1,h=!1,p="",d="",v="",m=0,g=0,y=0,b=0,w=0,E=0,S=0,x,T=0,N=0,C=[],k=!1,L,A=!1,O=!1,M=!1,_=!1,D={0:0},P=[],H=function(){f&&f.value&&f.type!=="string.regexp"&&(f.value=f.value.replace(/^\s*/,""))},B=function(){p=p.replace(/ +$/,"")},j=function(){p=p.trimRight(),l=!1};while(s!==null){T=n.getCurrentTokenRow(),C=n.$rowTokens,f=n.stepForward();if(typeof s!="undefined"){d=s.value,w=0,M=v==="style"||e.$modeId==="ace/mode/css",i(s,"tag-open")?(O=!0,f&&(_=a.indexOf(f.value)!==-1),d==="</"&&(_&&!l&&N<1&&N++,M&&(N=1),w=1,_=!1)):i(s,"tag-close")?O=!1:i(s,"comment.start")?_=!0:i(s,"comment.end")&&(_=!1),!O&&!N&&s.type==="paren.rparen"&&s.value.substr(0,1)==="}"&&N++,T!==x&&(N=T,x&&(N-=x));if(N){j();for(;N>0;N--)p+="\n";l=!0,!i(s,"comment")&&!s.type.match(/^(comment|string)$/)&&(d=d.trimLeft())}if(d){s.type==="keyword"&&d.match(/^(if|else|elseif|for|foreach|while|switch)$/)?(P[m]=d,H(),h=!0,d.match(/^(else|elseif)$/)&&p.match(/\}[\s]*$/)&&(j(),c=!0)):s.type==="paren.lparen"?(H(),d.substr(-1)==="{"&&(h=!0,A=!1,O||(N=1)),d.substr(0,1)==="{"&&(c=!0,p.substr(-1)!=="["&&p.trimRight().substr(-1)==="["?(j(),c=!1):p.trimRight().substr(-1)===")"?j():B())):s.type==="paren.rparen"?(w=1,d.substr(0,1)==="}"&&(P[m-1]==="case"&&w++,p.trimRight().substr(-1)==="{"?j():(c=!0,M&&(N+=2))),d.substr(0,1)==="]"&&p.substr(-1)!=="}"&&p.trimRight().substr(-1)==="}"&&(c=!1,b++,j()),d.substr(0,1)===")"&&p.substr(-1)!=="("&&p.trimRight().substr(-1)==="("&&(c=!1,b++,j()),B()):s.type!=="keyword.operator"&&s.type!=="keyword"||!d.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)?s.type==="punctuation.operator"&&d===";"?(j(),H(),h=!0,M&&N++):s.type==="punctuation.operator"&&d.match(/^(:|,)$/)?(j(),H(),d.match(/^(,)$/)&&S>0&&E===0?N++:(h=!0,l=!1)):s.type==="support.php_tag"&&d==="?>"&&!l?(j(),c=!0):i(s,"attribute-name")&&p.substr(-1).match(/^\s$/)?c=!0:i(s,"attribute-equals")?(B(),H()):i(s,"tag-close")&&(B(),d==="/>"&&(c=!0)):(j(),H(),c=!0,h=!0);if(l&&(!s.type.match(/^(comment)$/)||!!d.substr(0,1).match(/^[/#]$/))&&(!s.type.match(/^(string)$/)||!!d.substr(0,1).match(/^['"]$/))){b=y;if(m>g){b++;for(L=m;L>g;L--)D[L]=b}else m<g&&(b=D[m]);g=m,y=b,w&&(b-=w),A&&!E&&(b++,A=!1);for(L=0;L<b;L++)p+=o}s.type==="keyword"&&d.match(/^(case|default)$/)&&(P[m]=d,m++),s.type==="keyword"&&d.match(/^(break)$/)&&P[m-1]&&P[m-1].match(/^(case|default)$/)&&m--,s.type==="paren.lparen"&&(E+=(d.match(/\(/g)||[]).length,S+=(d.match(/\{/g)||[]).length,m+=d.length),s.type==="keyword"&&d.match(/^(if|else|elseif|for|while)$/)?(A=!0,E=0):!E&&d.trim()&&s.type!=="comment"&&(A=!1);if(s.type==="paren.rparen"){E-=(d.match(/\)/g)||[]).length,S-=(d.match(/\}/g)||[]).length;for(L=0;L<d.length;L++)m--,d.substr(L,1)==="}"&&P[m]==="case"&&m--}s.type=="text"&&(d=d.replace(/\s+$/," ")),c&&!l&&(B(),p.substr(-1)!=="\n"&&(p+=" ")),p+=d,h&&(p+=" "),l=!1,c=!1,h=!1;if(i(s,"tag-close")&&(_||a.indexOf(v)!==-1)||i(s,"doctype")&&d===">")_&&f&&f.value==="</"?N=-1:N=1;i(s,"tag-open")&&d==="</"?m--:i(s,"tag-open")&&d==="<"&&u.indexOf(f.value)===-1?m++:i(s,"tag-name")?v=d:i(s,"tag-close")&&d==="/>"&&u.indexOf(v)===-1&&m--,x=T}}s=f}p=p.trim(),e.doc.setValue(p)},t.commands=[{name:"beautify",description:"Format selection (Beautify)",exec:function(e){t.beautify(e.session)},bindKey:"Ctrl-Shift-B"}]}); (function() {
|
||||||
|
ace.require(["ace/ext/beautify"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/ext/code_lens",["require","exports","module","ace/line_widgets","ace/lib/event","ace/lib/lang","ace/lib/dom","ace/editor","ace/config"],function(e,t,n){"use strict";function u(e){var t=e.$textLayer,n=t.$lenses;n&&n.forEach(function(e){e.remove()}),t.$lenses=null}function a(e,t){var n=e&t.CHANGE_LINES||e&t.CHANGE_FULL||e&t.CHANGE_SCROLL||e&t.CHANGE_TEXT;if(!n)return;var r=t.session,i=t.session.lineWidgets,s=t.$textLayer,a=s.$lenses;if(!i){a&&u(t);return}var f=t.$textLayer.$lines.cells,l=t.layerConfig,c=t.$padding;a||(a=s.$lenses=[]);var h=0;for(var p=0;p<f.length;p++){var d=f[p].row,v=i[d],m=v&&v.lenses;if(!m||!m.length)continue;var g=a[h];g||(g=a[h]=o.buildDom(["div",{"class":"ace_codeLens"}],t.container)),g.style.height=l.lineHeight+"px",h++;for(var y=0;y<m.length;y++){var b=g.childNodes[2*y];b||(y!=0&&g.appendChild(o.createTextNode("\u00a0|\u00a0")),b=o.buildDom(["a"],g)),b.textContent=m[y].title,b.lensCommand=m[y]}while(g.childNodes.length>2*y-1)g.lastChild.remove();var w=t.$cursorLayer.getPixelPosition({row:d,column:0},!0).top-l.lineHeight*v.rowsAbove-l.offset;g.style.top=w+"px";var E=t.gutterWidth,S=r.getLine(d).search(/\S|$/);S==-1&&(S=0),E+=S*l.characterWidth,E-=t.scrollLeft,g.style.paddingLeft=c+E+"px"}while(h<a.length)a.pop().remove()}function f(e){if(!e.lineWidgets)return;var t=e.widgetManager;e.lineWidgets.forEach(function(e){e&&e.lenses&&t.removeLineWidget(e)})}function l(e){e.codeLensProviders=[],e.renderer.on("afterRender",a),e.$codeLensClickHandler||(e.$codeLensClickHandler=function(t){var n=t.target.lensCommand;n&&e.execCommand(n.id,n.arguments)},i.addListener(e.container,"click",e.$codeLensClickHandler,e)),e.$updateLenses=function(){function o(){var r=n.selection.cursor,i=n.documentToScreenRow(r);t.setLenses(n,s);var o=n.$undoManager&&n.$undoManager.$lastDelta;if(o&&o.action=="remove"&&o.lines.length>1)return;var u=n.documentToScreenRow(r),a=e.renderer.layerConfig.lineHeight,f=n.getScrollTop()+(u-i)*a;n.setScrollTop(f)}var n=e.session;if(!n)return;n.widgetManager||(n.widgetManager=new r(n),n.widgetManager.attach(e));var i=e.codeLensProviders.length,s=[];e.codeLensProviders.forEach(function(e){e.provideCodeLenses(n,function(e,t){if(e)return;t.forEach(function(e){s.push(e)}),i--,i==0&&o()})})};var n=s.delayedCall(e.$updateLenses);e.$updateLensesOnInput=function(){n.delay(250)},e.on("input",e.$updateLensesOnInput)}function c(e){e.off("input",e.$updateLensesOnInput),e.renderer.off("afterRender",a),e.$codeLensClickHandler&&e.container.removeEventListener("click",e.$codeLensClickHandler)}var r=e("../line_widgets").LineWidgets,i=e("../lib/event"),s=e("../lib/lang"),o=e("../lib/dom");t.setLenses=function(e,t){var n=Number.MAX_VALUE;f(e),t&&t.forEach(function(t){var r=t.start.row,i=t.start.column,s=e.lineWidgets&&e.lineWidgets[r];if(!s||!s.lenses)s=e.widgetManager.$registerLineWidget({rowCount:1,rowsAbove:1,row:r,column:i,lenses:[]});s.lenses.push(t.command),r<n&&(n=r)}),e._emit("changeFold",{data:{start:{row:n}}})},t.registerCodeLensProvider=function(e,t){e.setOption("enableCodeLens",!0),e.codeLensProviders.push(t),e.$updateLensesOnInput()},t.clear=function(e){t.setLenses(e,null)};var h=e("../editor").Editor;e("../config").defineOptions(h.prototype,"editor",{enableCodeLens:{set:function(e){e?l(this):c(this)}}}),o.importCssString(".ace_codeLens { position: absolute; color: #aaa; font-size: 88%; background: inherit; width: 100%; display: flex; align-items: flex-end; pointer-events: none;}.ace_codeLens > a { cursor: pointer; pointer-events: auto;}.ace_codeLens > a:hover { color: #0000ff; text-decoration: underline;}.ace_dark > .ace_codeLens > a:hover { color: #4e94ce;}","")}); (function() {
|
||||||
|
ace.require(["ace/ext/code_lens"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/ext/elastic_tabstops_lite",["require","exports","module","ace/editor","ace/config"],function(e,t,n){"use strict";var r=function(e){this.$editor=e;var t=this,n=[],r=!1;this.onAfterExec=function(){r=!1,t.processRows(n),n=[]},this.onExec=function(){r=!0},this.onChange=function(e){r&&(n.indexOf(e.start.row)==-1&&n.push(e.start.row),e.end.row!=e.start.row&&n.push(e.end.row))}};(function(){this.processRows=function(e){this.$inChange=!0;var t=[];for(var n=0,r=e.length;n<r;n++){var i=e[n];if(t.indexOf(i)>-1)continue;var s=this.$findCellWidthsForBlock(i),o=this.$setBlockCellWidthsToMax(s.cellWidths),u=s.firstRow;for(var a=0,f=o.length;a<f;a++){var l=o[a];t.push(u),this.$adjustRow(u,l),u++}}this.$inChange=!1},this.$findCellWidthsForBlock=function(e){var t=[],n,r=e;while(r>=0){n=this.$cellWidthsForRow(r);if(n.length==0)break;t.unshift(n),r--}var i=r+1;r=e;var s=this.$editor.session.getLength();while(r<s-1){r++,n=this.$cellWidthsForRow(r);if(n.length==0)break;t.push(n)}return{cellWidths:t,firstRow:i}},this.$cellWidthsForRow=function(e){var t=this.$selectionColumnsForRow(e),n=[-1].concat(this.$tabsForRow(e)),r=n.map(function(e){return 0}).slice(1),i=this.$editor.session.getLine(e);for(var s=0,o=n.length-1;s<o;s++){var u=n[s]+1,a=n[s+1],f=this.$rightmostSelectionInCell(t,a),l=i.substring(u,a);r[s]=Math.max(l.replace(/\s+$/g,"").length,f-u)}return r},this.$selectionColumnsForRow=function(e){var t=[],n=this.$editor.getCursorPosition();return this.$editor.session.getSelection().isEmpty()&&e==n.row&&t.push(n.column),t},this.$setBlockCellWidthsToMax=function(e){var t=!0,n,r,i,s=this.$izip_longest(e);for(var o=0,u=s.length;o<u;o++){var a=s[o];if(!a.push){console.error(a);continue}a.push(NaN);for(var f=0,l=a.length;f<l;f++){var c=a[f];t&&(n=f,i=0,t=!1);if(isNaN(c)){r=f;for(var h=n;h<r;h++)e[h][o]=i;t=!0}i=Math.max(i,c)}}return e},this.$rightmostSelectionInCell=function(e,t){var n=0;if(e.length){var r=[];for(var i=0,s=e.length;i<s;i++)e[i]<=t?r.push(i):r.push(0);n=Math.max.apply(Math,r)}return n},this.$tabsForRow=function(e){var t=[],n=this.$editor.session.getLine(e),r=/\t/g,i;while((i=r.exec(n))!=null)t.push(i.index);return t},this.$adjustRow=function(e,t){var n=this.$tabsForRow(e);if(n.length==0)return;var r=0,i=-1,s=this.$izip(t,n);for(var o=0,u=s.length;o<u;o++){var a=s[o][0],f=s[o][1];i+=1+a,f+=r;var l=i-f;if(l==0)continue;var c=this.$editor.session.getLine(e).substr(0,f),h=c.replace(/\s*$/g,""),p=c.length-h.length;l>0&&(this.$editor.session.getDocument().insertInLine({row:e,column:f+1},Array(l+1).join(" ")+" "),this.$editor.session.getDocument().removeInLine(e,f,f+1),r+=l),l<0&&p>=-l&&(this.$editor.session.getDocument().removeInLine(e,f+l,f),r+=l)}},this.$izip_longest=function(e){if(!e[0])return[];var t=e[0].length,n=e.length;for(var r=1;r<n;r++){var i=e[r].length;i>t&&(t=i)}var s=[];for(var o=0;o<t;o++){var u=[];for(var r=0;r<n;r++)e[r][o]===""?u.push(NaN):u.push(e[r][o]);s.push(u)}return s},this.$izip=function(e,t){var n=e.length>=t.length?t.length:e.length,r=[];for(var i=0;i<n;i++){var s=[e[i],t[i]];r.push(s)}return r}}).call(r.prototype),t.ElasticTabstopsLite=r;var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{useElasticTabstops:{set:function(e){e?(this.elasticTabstops||(this.elasticTabstops=new r(this)),this.commands.on("afterExec",this.elasticTabstops.onAfterExec),this.commands.on("exec",this.elasticTabstops.onExec),this.on("change",this.elasticTabstops.onChange)):this.elasticTabstops&&(this.commands.removeListener("afterExec",this.elasticTabstops.onAfterExec),this.commands.removeListener("exec",this.elasticTabstops.onExec),this.removeListener("change",this.elasticTabstops.onChange))}}})}); (function() {
|
||||||
|
ace.require(["ace/ext/elastic_tabstops_lite"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
|
|||||||
|
; (function() {
|
||||||
|
ace.require(["ace/ext/error_marker"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,t,n){"use strict";var r=e("../../lib/dom"),i="#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 100000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {vertical-align: middle;}.ace_optionsMenuEntry button[ace_selected_button=true] {background: #e7e7e7;box-shadow: 1px 0px 2px 0px #adadad inset;border-color: #adadad;}.ace_optionsMenuEntry button {background: white;border: 1px solid lightgray;margin: 0px;}.ace_optionsMenuEntry button:hover{background: #f0f0f0;}";r.importCssString(i),n.exports.overlayPage=function(t,n,r){function o(e){e.keyCode===27&&u()}function u(){if(!i)return;document.removeEventListener("keydown",o),i.parentNode.removeChild(i),t&&t.focus(),i=null,r&&r()}function a(e){s=e,e&&(i.style.pointerEvents="none",n.style.pointerEvents="auto")}var i=document.createElement("div"),s=!1;return i.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; "+(t?"background-color: rgba(0, 0, 0, 0.3);":""),i.addEventListener("click",function(e){s||u()}),document.addEventListener("keydown",o),n.addEventListener("click",function(e){e.stopPropagation()}),i.appendChild(n),document.body.appendChild(i),t&&t.blur(),{close:u,setIgnoreFocusOut:a}}}),ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(e,t,n){"use strict";var r=e("../../lib/keys");n.exports.getEditorKeybordShortcuts=function(e){var t=r.KEY_MODS,n=[],i={};return e.keyBinding.$handlers.forEach(function(e){var t=e.commandKeyBinding;for(var r in t){var s=r.replace(/(^|-)\w/g,function(e){return e.toUpperCase()}),o=t[r];Array.isArray(o)||(o=[o]),o.forEach(function(e){typeof e!="string"&&(e=e.name),i[e]?i[e].key+="|"+s:(i[e]={key:s,command:e},n.push(i[e]))})}}),n}}),ace.define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"],function(e,t,n){"use strict";function i(t){if(!document.getElementById("kbshortcutmenu")){var n=e("./menu_tools/overlay_page").overlayPage,r=e("./menu_tools/get_editor_keyboard_shortcuts").getEditorKeybordShortcuts,i=r(t),s=document.createElement("div"),o=i.reduce(function(e,t){return e+'<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'+t.command+"</span> : "+'<span class="ace_optionsMenuKey">'+t.key+"</span></div>"},"");s.id="kbshortcutmenu",s.innerHTML="<h1>Keyboard Shortcuts</h1>"+o+"</div>",n(t,s)}}var r=e("../editor").Editor;n.exports.init=function(e){r.prototype.showKeyboardShortcuts=function(){i(this)},e.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e,t){e.showKeyboardShortcuts()}}])}}); (function() {
|
||||||
|
ace.require(["ace/ext/keybinding_menu"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"],function(e,t,n){function i(e){var n=e.editor,r=e.getAccelKey();if(r){var n=e.editor,i=e.getDocumentPosition(),s=n.session,o=s.getTokenAt(i.row,i.column);t.previousLinkingHover&&t.previousLinkingHover!=o&&n._emit("linkHoverOut"),n._emit("linkHover",{position:i,token:o}),t.previousLinkingHover=o}else t.previousLinkingHover&&(n._emit("linkHoverOut"),t.previousLinkingHover=!1)}function s(e){var t=e.getAccelKey(),n=e.getButton();if(n==0&&t){var r=e.editor,i=e.getDocumentPosition(),s=r.session,o=s.getTokenAt(i.row,i.column);r._emit("linkClick",{position:i,token:o})}}var r=e("../editor").Editor;e("../config").defineOptions(r.prototype,"editor",{enableLinking:{set:function(e){e?(this.on("click",s),this.on("mousemove",i)):(this.off("click",s),this.off("mousemove",i))},value:!1}}),t.previousLinkingHover=!1}); (function() {
|
||||||
|
ace.require(["ace/ext/linking"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/ext/modelist",["require","exports","module"],function(e,t,n){"use strict";function i(e){var t=a.text,n=e.split(/[\/\\]/).pop();for(var i=0;i<r.length;i++)if(r[i].supportsFile(n)){t=r[i];break}return t}var r=[],s=function(e,t,n){this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n;var r;/\^/.test(n)?r=n.replace(/\|(\^)?/g,function(e,t){return"$|"+(t?"^":"^.*\\.")})+"$":r="^.*\\.("+n+")$",this.extRe=new RegExp(r,"gi")};s.prototype.supportsFile=function(e){return e.match(this.extRe)};var o={ABAP:["abap"],ABC:["abc"],ActionScript:["as"],ADA:["ada|adb"],Alda:["alda"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],Apex:["apex|cls|trigger|tgr"],AQL:["aql"],AsciiDoc:["asciidoc|adoc"],ASL:["dsl|asl"],Assembly_x86:["asm|a"],AutoHotKey:["ahk"],BatchFile:["bat|cmd"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],C9Search:["c9search_results"],Cirru:["cirru|cr"],Clojure:["clj|cljs"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm"],Crystal:["cr"],CSharp:["cs"],Csound_Document:["csd"],Csound_Orchestra:["orc"],Csound_Score:["sco"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dockerfile:["^Dockerfile"],Dot:["dot"],Drools:["drl"],Edifact:["edi"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Forth:["frt|fs|ldr|fth|4th"],Fortran:["f|f90"],FSharp:["fsi|fs|ml|mli|fsx|fsscript"],FSL:["fsl"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],GraphQLSchema:["gql"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],Haskell_Cabal:["cabal"],haXe:["hx"],Hjson:["hjson"],HTML:["html|htm|xhtml|vue|we|wpy"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Jack:["jack"],Jade:["jade|pug"],Java:["java"],JavaScript:["js|jsm|jsx"],JSON:["json"],JSON5:["json5"],JSONiq:["jq"],JSP:["jsp"],JSSM:["jssm|jssm_state"],JSX:["jsx"],Julia:["jl"],Kotlin:["kt|kts"],LaTeX:["tex|latex|ltx|bib"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],Mask:["mask"],MATLAB:["matlab"],Maze:["mz"],MediaWiki:["wiki|mediawiki"],MEL:["mel"],MIXAL:["mixal"],MUSHCode:["mc|mush"],MySQL:["mysql"],Nginx:["nginx|conf"],Nim:["nim"],Nix:["nix"],NSIS:["nsi|nsh"],Nunjucks:["nunjucks|nunjs|nj|njk"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],Perl6:["p6|pl6|pm6"],pgSQL:["pgsql"],PHP:["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],PHP_Laravel_blade:["blade.php"],Pig:["pig"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prisma:["prisma"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],Puppet:["epp|pp"],Python:["py"],QML:["qml"],R:["r"],Razor:["cshtml|asp"],RDoc:["Rd"],Red:["red|reds"],RHTML:["Rhtml"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala|sbt"],Scheme:["scm|sm|rkt|oak|scheme"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Slim:["slim|skim"],Smarty:["smarty|tpl"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Terraform:["tf","tfvars","terragrunt"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],TSX:["tsx"],Twig:["latte|twig|swig"],Typescript:["ts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Visualforce:["vfp|component|page"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Zeek:["zeek|bro"],Django:["html"]},u={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",Csound_Document:"Csound Document",Csound_Orchestra:"Csound",Csound_Score:"Csound Score",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker",PHP_Laravel_blade:"PHP (Blade Template)",Perl6:"Perl 6",AutoHotKey:"AutoHotkey / AutoIt"},a={};for(var f in o){var l=o[f],c=(u[f]||f).replace(/_/g," "),h=f.toLowerCase(),p=new s(h,c,l[0]);a[h]=p,r.push(p)}n.exports={getModeForPath:i,modes:r,modesByName:a}}); (function() {
|
||||||
|
ace.require(["ace/ext/modelist"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
File diff suppressed because one or more lines are too long
+8
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/ext/rtl",["require","exports","module","ace/editor","ace/config"],function(e,t,n){"use strict";function s(e,t){var n=t.getSelection().lead;t.session.$bidiHandler.isRtlLine(n.row)&&n.column===0&&(t.session.$bidiHandler.isMoveLeftOperation&&n.row>0?t.getSelection().moveCursorTo(n.row-1,t.session.getLine(n.row-1).length):t.getSelection().isEmpty()?n.column+=1:n.setPosition(n.row,n.column+1))}function o(e){e.editor.session.$bidiHandler.isMoveLeftOperation=/gotoleft|selectleft|backspace|removewordleft/.test(e.command.name)}function u(e,t){var n=t.session;n.$bidiHandler.currentRow=null;if(n.$bidiHandler.isRtlLine(e.start.row)&&e.action==="insert"&&e.lines.length>1)for(var r=e.start.row;r<e.end.row;r++)n.getLine(r+1).charAt(0)!==n.$bidiHandler.RLE&&(n.doc.$lines[r+1]=n.$bidiHandler.RLE+n.getLine(r+1))}function a(e,t){var n=t.session,r=n.$bidiHandler,i=t.$textLayer.$lines.cells,s=t.layerConfig.width-t.layerConfig.padding+"px";i.forEach(function(e){var t=e.element.style;r&&r.isRtlLine(e.row)?(t.direction="rtl",t.textAlign="right",t.width=s):(t.direction="",t.textAlign="",t.width="")})}function f(e){function n(e){var t=e.element.style;t.direction=t.textAlign=t.width=""}var t=e.$textLayer.$lines;t.cells.forEach(n),t.cellCache.forEach(n)}var r=[{name:"leftToRight",bindKey:{win:"Ctrl-Alt-Shift-L",mac:"Command-Alt-Shift-L"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!1)},readOnly:!0},{name:"rightToLeft",bindKey:{win:"Ctrl-Alt-Shift-R",mac:"Command-Alt-Shift-R"},exec:function(e){e.session.$bidiHandler.setRtlDirection(e,!0)},readOnly:!0}],i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{rtlText:{set:function(e){e?(this.on("change",u),this.on("changeSelection",s),this.renderer.on("afterRender",a),this.commands.on("exec",o),this.commands.addCommands(r)):(this.off("change",u),this.off("changeSelection",s),this.renderer.off("afterRender",a),this.commands.off("exec",o),this.commands.removeCommands(r),f(this.renderer)),this.renderer.updateFull()}},rtl:{set:function(e){this.session.$bidiHandler.$isRtl=e,e?(this.setOption("rtlText",!1),this.renderer.on("afterRender",a),this.session.$bidiHandler.seenBidi=!0):(this.renderer.off("afterRender",a),f(this.renderer)),this.renderer.updateFull()}}})}); (function() {
|
||||||
|
ace.require(["ace/ext/rtl"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/ext/spellcheck",["require","exports","module","ace/lib/event","ace/editor","ace/config"],function(e,t,n){"use strict";var r=e("../lib/event");t.contextMenuHandler=function(e){var t=e.target,n=t.textInput.getElement();if(!t.selection.isEmpty())return;var i=t.getCursorPosition(),s=t.session.getWordRange(i.row,i.column),o=t.session.getTextRange(s);t.session.tokenRe.lastIndex=0;if(!t.session.tokenRe.test(o))return;var u="\x01\x01",a=o+" "+u;n.value=a,n.setSelectionRange(o.length,o.length+1),n.setSelectionRange(0,0),n.setSelectionRange(0,o.length);var f=!1;r.addListener(n,"keydown",function l(){r.removeListener(n,"keydown",l),f=!0}),t.textInput.setInputHandler(function(e){if(e==a)return"";if(e.lastIndexOf(a,0)===0)return e.slice(a.length);if(e.substr(n.selectionEnd)==a)return e.slice(0,-a.length);if(e.slice(-2)==u){var r=e.slice(0,-2);if(r.slice(-1)==" ")return f?r.substring(0,n.selectionEnd):(r=r.slice(0,-1),t.session.replace(s,r),"")}return e})};var i=e("../editor").Editor;e("../config").defineOptions(i.prototype,"editor",{spellcheck:{set:function(e){var n=this.textInput.getElement();n.spellcheck=!!e,e?this.on("nativecontextmenu",t.contextMenuHandler):this.removeListener("nativecontextmenu",t.contextMenuHandler)},value:!0}})}); (function() {
|
||||||
|
ace.require(["ace/ext/spellcheck"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/lang"),s=e("./lib/event_emitter").EventEmitter,o=e("./editor").Editor,u=e("./virtual_renderer").VirtualRenderer,a=e("./edit_session").EditSession,f=function(e,t,n){this.BELOW=1,this.BESIDE=0,this.$container=e,this.$theme=t,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(n||1),this.$cEditor=this.$editors[0],this.on("focus",function(e){this.$cEditor=e}.bind(this))};(function(){r.implement(this,s),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new o(new u(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e==this.$splits)return;if(e>this.$splits){while(this.$splits<this.$editors.length&&this.$splits<e)t=this.$editors[this.$splits],this.$container.appendChild(t.container),t.setFontSize(this.$fontSize),this.$splits++;while(this.$splits<e)this.$createEditor(),this.$splits++}else while(this.$splits>e)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach(function(t){t.setTheme(e)})},this.setKeyboardHandler=function(e){this.$editors.forEach(function(t){t.setKeyboardHandler(e)})},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach(function(t){t.setFontSize(e)})},this.$cloneSession=function(e){var t=new a(e.getDocument(),e.getMode()),n=e.getUndoManager();return t.setUndoManager(n),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;t==null?n=this.$cEditor:n=this.$editors[t];var r=this.$editors.some(function(t){return t.session===e});return r&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){if(this.$orientation==e)return;this.$orientation=e,this.resize()},this.resize=function(){var e=this.$container.clientWidth,t=this.$container.clientHeight,n;if(this.$orientation==this.BESIDE){var r=e/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=r+"px",n.container.style.top="0px",n.container.style.left=i*r+"px",n.container.style.height=t+"px",n.resize()}else{var s=t/this.$splits;for(var i=0;i<this.$splits;i++)n=this.$editors[i],n.container.style.width=e+"px",n.container.style.top=i*s+"px",n.container.style.left="0px",n.container.style.height=s+"px",n.resize()}}}).call(f.prototype),t.Split=f}),ace.define("ace/ext/split",["require","exports","module","ace/split"],function(e,t,n){"use strict";n.exports=e("../split")}); (function() {
|
||||||
|
ace.require(["ace/ext/split"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";function f(e){this.type=e,this.style={},this.textContent=""}var r=e("../edit_session").EditSession,i=e("../layer/text").Text,s=".ace_static_highlight {font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;font-size: 12px;white-space: pre-wrap}.ace_static_highlight .ace_gutter {width: 2em;text-align: right;padding: 0 3px 0 0;margin-right: 3px;contain: none;}.ace_static_highlight.ace_show_gutter .ace_line {padding-left: 2.6em;}.ace_static_highlight .ace_line { position: relative; }.ace_static_highlight .ace_gutter-cell {-moz-user-select: -moz-none;-khtml-user-select: none;-webkit-user-select: none;user-select: none;top: 0;bottom: 0;left: 0;position: absolute;}.ace_static_highlight .ace_gutter-cell:before {content: counter(ace_line, decimal);counter-increment: ace_line;}.ace_static_highlight {counter-reset: ace_line;}",o=e("../config"),u=e("../lib/dom"),a=e("../lib/lang").escapeHTML;f.prototype.cloneNode=function(){return this},f.prototype.appendChild=function(e){this.textContent+=e.toString()},f.prototype.toString=function(){var e=[];if(this.type!="fragment"){e.push("<",this.type),this.className&&e.push(" class='",this.className,"'");var t=[];for(var n in this.style)t.push(n,":",this.style[n]);t.length&&e.push(" style='",t.join(""),"'"),e.push(">")}return this.textContent&&e.push(this.textContent),this.type!="fragment"&&e.push("</",this.type,">"),e.join("")};var l={createTextNode:function(e,t){return a(e)},createElement:function(e){return new f(e)},createFragment:function(){return new f("fragment")}},c=function(){this.config={},this.dom=l};c.prototype=i.prototype;var h=function(e,t,n){var r=e.className.match(/lang-(\w+)/),i=t.mode||r&&"ace/mode/"+r[1];if(!i)return!1;var s=t.theme||"ace/theme/textmate",o="",a=[];if(e.firstElementChild){var f=0;for(var l=0;l<e.childNodes.length;l++){var c=e.childNodes[l];c.nodeType==3?(f+=c.data.length,o+=c.data):a.push(f,c)}}else o=e.textContent,t.trim&&(o=o.trim());h.render(o,i,s,t.firstLineNumber,!t.showGutter,function(t){u.importCssString(t.css,"ace_highlight"),e.innerHTML=t.html;var r=e.firstChild.firstChild;for(var i=0;i<a.length;i+=2){var s=t.session.doc.indexToPosition(a[i]),o=a[i+1],f=r.children[s.row];f&&f.appendChild(o)}n&&n()})};h.render=function(e,t,n,i,s,u){function c(){var r=h.renderSync(e,t,n,i,s);return u?u(r):r}var a=1,f=r.prototype.$modes;typeof n=="string"&&(a++,o.loadModule(["theme",n],function(e){n=e,--a||c()}));var l;return t&&typeof t=="object"&&!t.getTokenizer&&(l=t,t=l.path),typeof t=="string"&&(a++,o.loadModule(["mode",t],function(e){if(!f[t]||l)f[t]=new e.Mode(l);t=f[t],--a||c()})),--a||c()},h.renderSync=function(e,t,n,i,o){i=parseInt(i||1,10);var u=new r("");u.setUseWorker(!1),u.setMode(t);var a=new c;a.setSession(u),Object.keys(a.$tabStrings).forEach(function(e){if(typeof a.$tabStrings[e]=="string"){var t=l.createFragment();t.textContent=a.$tabStrings[e],a.$tabStrings[e]=t}}),u.setValue(e);var f=u.getLength(),h=l.createElement("div");h.className=n.cssClass;var p=l.createElement("div");p.className="ace_static_highlight"+(o?"":" ace_show_gutter"),p.style["counter-reset"]="ace_line "+(i-1);for(var d=0;d<f;d++){var v=l.createElement("div");v.className="ace_line";if(!o){var m=l.createElement("span");m.className="ace_gutter ace_gutter-cell",m.textContent="",v.appendChild(m)}a.$renderLine(v,d,!1),v.textContent+="\n",p.appendChild(v)}return h.appendChild(p),{css:s+n.cssText,html:h.toString(),session:u}},n.exports=h,n.exports.highlight=h}); (function() {
|
||||||
|
ace.require(["ace/ext/static_highlight"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/dom"),i=e("../lib/lang"),s=function(e,t){this.element=r.createElement("div"),this.element.className="ace_status-indicator",this.element.style.cssText="display: inline-block;",t.appendChild(this.element);var n=i.delayedCall(function(){this.updateStatus(e)}.bind(this)).schedule.bind(null,100);e.on("changeStatus",n),e.on("changeSelection",n),e.on("keyboardActivity",n)};(function(){this.updateStatus=function(e){function n(e,n){e&&t.push(e,n||"|")}var t=[];n(e.keyBinding.getStatusText(e)),e.commands.recording&&n("REC");var r=e.selection,i=r.lead;if(!r.isEmpty()){var s=e.getSelectionRange();n("("+(s.end.row-s.start.row)+":"+(s.end.column-s.start.column)+")"," ")}n(i.row+":"+i.column," "),r.rangeCount&&n("["+r.rangeCount+"]"," "),t.pop(),this.element.textContent=t.join("")}}).call(s.prototype),t.StatusBar=s}); (function() {
|
||||||
|
ace.require(["ace/ext/statusbar"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/ext/themelist",["require","exports","module"],function(e,t,n){"use strict";var r=[["Chrome"],["Clouds"],["Crimson Editor"],["Dawn"],["Dreamweaver"],["Eclipse"],["GitHub"],["IPlastic"],["Solarized Light"],["TextMate"],["Tomorrow"],["Xcode"],["Kuroir"],["KatzenMilch"],["SQL Server","sqlserver","light"],["Ambiance","ambiance","dark"],["Chaos","chaos","dark"],["Clouds Midnight","clouds_midnight","dark"],["Dracula","","dark"],["Cobalt","cobalt","dark"],["Gruvbox","gruvbox","dark"],["Green on Black","gob","dark"],["idle Fingers","idle_fingers","dark"],["krTheme","kr_theme","dark"],["Merbivore","merbivore","dark"],["Merbivore Soft","merbivore_soft","dark"],["Mono Industrial","mono_industrial","dark"],["Monokai","monokai","dark"],["Nord Dark","nord_dark","dark"],["Pastel on dark","pastel_on_dark","dark"],["Solarized Dark","solarized_dark","dark"],["Terminal","terminal","dark"],["Tomorrow Night","tomorrow_night","dark"],["Tomorrow Night Blue","tomorrow_night_blue","dark"],["Tomorrow Night Bright","tomorrow_night_bright","dark"],["Tomorrow Night 80s","tomorrow_night_eighties","dark"],["Twilight","twilight","dark"],["Vibrant Ink","vibrant_ink","dark"]];t.themesByName={},t.themes=r.map(function(e){var n=e[1]||e[0].replace(/ /g,"_").toLowerCase(),r={caption:e[0],theme:"ace/theme/"+n,isDark:e[2]=="dark",name:n};return t.themesByName[n]=r,r})}); (function() {
|
||||||
|
ace.require(["ace/ext/themelist"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/ext/whitespace",["require","exports","module","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../lib/lang");t.$detectIndentation=function(e,t){function c(e){var t=0;for(var r=e;r<n.length;r+=e)t+=n[r]||0;return t}var n=[],r=[],i=0,s=0,o=Math.min(e.length,1e3);for(var u=0;u<o;u++){var a=e[u];if(!/^\s*[^*+\-\s]/.test(a))continue;if(a[0]==" ")i++,s=-Number.MAX_VALUE;else{var f=a.match(/^ */)[0].length;if(f&&a[f]!=" "){var l=f-s;l>0&&!(s%l)&&!(f%l)&&(r[l]=(r[l]||0)+1),n[f]=(n[f]||0)+1}s=f}while(u<o&&a[a.length-1]=="\\")a=e[u++]}var h=r.reduce(function(e,t){return e+t},0),p={score:0,length:0},d=0;for(var u=1;u<12;u++){var v=c(u);u==1?(d=v,v=n[1]?.9:.8,n.length||(v=0)):v/=d,r[u]&&(v+=r[u]/h),v>p.score&&(p={score:v,length:u})}if(p.score&&p.score>1.4)var m=p.length;if(i>d+1){if(m==1||d<i/4||p.score<1.8)m=undefined;return{ch:" ",length:m}}if(d>i+1)return{ch:" ",length:m}},t.detectIndentation=function(e){var n=e.getLines(0,1e3),r=t.$detectIndentation(n)||{};return r.ch&&e.setUseSoftTabs(r.ch==" "),r.length&&e.setTabSize(r.length),r},t.trimTrailingSpace=function(e,t){var n=e.getDocument(),r=n.getAllLines(),i=t&&t.trimEmpty?-1:0,s=[],o=-1;t&&t.keepCursorPosition&&(e.selection.rangeCount?e.selection.rangeList.ranges.forEach(function(e,t,n){var r=n[t+1];if(r&&r.cursor.row==e.cursor.row)return;s.push(e.cursor)}):s.push(e.selection.getCursor()),o=0);var u=s[o]&&s[o].row;for(var a=0,f=r.length;a<f;a++){var l=r[a],c=l.search(/\s+$/);a==u&&(c<s[o].column&&c>i&&(c=s[o].column),o++,u=s[o]?s[o].row:-1),c>i&&n.removeInLine(a,c,l.length)}},t.convertIndentation=function(e,t,n){var i=e.getTabString()[0],s=e.getTabSize();n||(n=s),t||(t=i);var o=t==" "?t:r.stringRepeat(t,n),u=e.doc,a=u.getAllLines(),f={},l={};for(var c=0,h=a.length;c<h;c++){var p=a[c],d=p.match(/^\s*/)[0];if(d){var v=e.$getStringScreenWidth(d)[0],m=Math.floor(v/s),g=v%s,y=f[m]||(f[m]=r.stringRepeat(o,m));y+=l[g]||(l[g]=r.stringRepeat(" ",g)),y!=d&&(u.removeInLine(c,0,d.length),u.insertInLine({row:c,column:0},y))}}e.setTabSize(n),e.setUseSoftTabs(t==" ")},t.$parseStringArg=function(e){var t={};/t/.test(e)?t.ch=" ":/s/.test(e)&&(t.ch=" ");var n=e.match(/\d+/);return n&&(t.length=parseInt(n[0],10)),t},t.$parseArg=function(e){return e?typeof e=="string"?t.$parseStringArg(e):typeof e.text=="string"?t.$parseStringArg(e.text):e:{}},t.commands=[{name:"detectIndentation",description:"Detect indentation from content",exec:function(e){t.detectIndentation(e.session)}},{name:"trimTrailingSpace",description:"Trim trailing whitespace",exec:function(e,n){t.trimTrailingSpace(e.session,n)}},{name:"convertIndentation",description:"Convert indentation to ...",exec:function(e,n){var r=t.$parseArg(n);t.convertIndentation(e.session,r.ch,r.length)}},{name:"setIndentation",description:"Set indentation",exec:function(e,n){var r=t.$parseArg(n);r.length&&e.session.setTabSize(r.length),r.ch&&e.session.setUseSoftTabs(r.ch==" ")}}]}); (function() {
|
||||||
|
ace.require(["ace/ext/whitespace"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/mode/abc_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:["zupfnoter.information.comment.line.percentage","information.keyword","in formation.keyword.embedded"],regex:"(%%%%)(hn\\.[a-z]*)(.*)",comment:"Instruction Comment"},{token:["information.comment.line.percentage","information.keyword.embedded"],regex:"(%%)(.*)",comment:"Instruction Comment"},{token:"comment.line.percentage",regex:"%.*",comment:"Comments"},{token:"barline.keyword.operator",regex:"[\\[:]*[|:][|\\]:]*(?:\\[?[0-9]+)?|\\[[0-9]+",comment:"Bar lines"},{token:["information.keyword.embedded","information.argument.string.unquoted"],regex:"(\\[[A-Za-z]:)([^\\]]*\\])",comment:"embedded Header lines"},{token:["information.keyword","information.argument.string.unquoted"],regex:"^([A-Za-z]:)([^%\\\\]*)",comment:"Header lines"},{token:["text","entity.name.function","string.unquoted","text"],regex:"(\\[)([A-Z]:)(.*?)(\\])",comment:"Inline fields"},{token:["accent.constant.language","pitch.constant.numeric","duration.constant.numeric"],regex:"([\\^=_]*)([A-Ga-gz][,']*)([0-9]*/*[><0-9]*)",comment:"Notes"},{token:"zupfnoter.jumptarget.string.quoted",regex:'[\\"!]\\^\\:.*?[\\"!]',comment:"Zupfnoter jumptarget"},{token:"zupfnoter.goto.string.quoted",regex:'[\\"!]\\^\\@.*?[\\"!]',comment:"Zupfnoter goto"},{token:"zupfnoter.annotation.string.quoted",regex:'[\\"!]\\^\\!.*?[\\"!]',comment:"Zupfnoter annoation"},{token:"zupfnoter.annotationref.string.quoted",regex:'[\\"!]\\^\\#.*?[\\"!]',comment:"Zupfnoter annotation reference"},{token:"chordname.string.quoted",regex:'[\\"!]\\^.*?[\\"!]',comment:"abc chord"},{token:"string.quoted",regex:'[\\"!].*?[\\"!]',comment:"abc annotation"}]},this.normalizeRules()};s.metaData={fileTypes:["abc"],name:"ABC",scopeName:"text.abcnotation"},r.inherits(s,i),t.ABCHighlightRules=s}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++n<s){t=e.getLine(n);var f=u.exec(t);if(!f)continue;f[1]?a--:a++;if(!a)break}var l=n;if(l>o)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/abc",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/abc_highlight_rules","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./abc_highlight_rules").ABCHighlightRules,o=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="%",this.$id="ace/mode/abc",this.snippetFileId="ace/snippets/abc"}.call(u.prototype),t.Mode=u}); (function() {
|
||||||
|
ace.require(["ace/mode/abc"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/mode/ada_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="abort|else|new|return|abs|elsif|not|reverse|abstract|end|null|accept|entry|select|access|exception|of|separate|aliased|exit|or|some|all|others|subtype|and|for|out|synchronized|array|function|overriding|at|tagged|generic|package|task|begin|goto|pragma|terminate|body|private|then|if|procedure|type|case|in|protected|constant|interface|until||is|raise|use|declare|range|delay|limited|record|when|delta|loop|rem|while|digits|renames|with|do|mod|requeue|xor",t="true|false|null",n="count|min|max|avg|sum|rank|now|coalesce|main",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]}};r.inherits(s,i),t.AdaHighlightRules=s}),ace.define("ace/mode/ada",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ada_highlight_rules","ace/range"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./ada_highlight_rules").AdaHighlightRules,o=e("../range").Range,u=function(){this.HighlightRules=s,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="--",this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var o=t.match(/^.*(begin|loop|then|is|do)\s*$/);o&&(r+=n)}return r},this.checkOutdent=function(e,t,n){var r=t+n;return r.match(/^\s*(begin|end)$/)?!0:!1},this.autoOutdent=function(e,t,n){var r=t.getLine(n),i=t.getLine(n-1),s=this.$getIndent(i).length,u=this.$getIndent(r).length;if(u<=s)return;t.outdentRows(new o(n,0,n+2,0))},this.$id="ace/mode/ada"}.call(u.prototype),t.Mode=u}); (function() {
|
||||||
|
ace.require(["ace/mode/ada"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/mode/aql_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="for|search|outbound|inbound|any|graph|prune|options|shortest_path|to|in|return|filter|sort|limit|let|collect|remove|update|replace|insers|upsert|with",t="true|false",n="append|contains_array|count|count_distinct|count_unique|first|flatten|intersection|last|length|minus|nth|outersection|pop|position|push|remove_nth|remove_value|remove_values|reverse|shift|slice|sorted|sorted_unique|union|union_distinct|unique|unshift|date_now|date_iso8601|date_timestamp|is_datestring|date_dayofweek|date_year|date_month|date_day|date_hour|date_minute|date_second|date_millisecond|date_dayofyear|date_isoweek|date_leapyear|date_quarter|date_days_in_month|date_trunc|date_format|date_add|date_subtract|date_diff|date_compare|attributes|count|has|is_same_collection|keep|length|matches|merge|merge_recursive|parse_identifier|translate|unset|unset_recursive|values|zip|fulltext|distance|geo_contains|geo_distance|geo_equals|geo_intersects|is_in_polygon|not_null|first_list|first_document|check_document|collection_count|collections|count|current_user|document|length|hash|apply|assert|/ warn|call|fail|noopt|passthru|sleep|v8|version|abs|acos|asin|atan|atan2|average|avg|ceil|cos|degrees|exp|exp2|floor|log|log2|log10|max|median|min|percentile|pi|pow|radians|rand|range|round|sin|sqrt|stddev_population|stddev_sample|stddev|sum|tan|variance_population|variance_sample|variance|char_length|concat|concat_separator|contains|count|encode_uri_component|find_first|find_last|json_parse|json_stringify|left|length|levenshtein_distance|like|lower|ltrim|md5|random_token|regex_matches|regex_split|regex_test|regex_replace|reverse|right|rtrim|sha1|sha512|split|soundex|substitute|substring|tokens|to_base64|to_hex|trim|upper|uuid|to_bool|to_number|to_string|to_array|to_list|is_null|is_bool|is_number|is_string|is_array|is_list|is_object|is_document|is_datestring|is_key|typename|",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"//.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]},this.normalizeRules()};r.inherits(s,i),t.AqlHighlightRules=s}),ace.define("ace/mode/aql",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/aql_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./aql_highlight_rules").AqlHighlightRules,o=function(){this.HighlightRules=s,this.$behaviour=this.$defaultBehaviour};r.inherits(o,i),function(){this.lineCommentStart="//",this.$id="ace/mode/aql"}.call(o.prototype),t.Mode=o}); (function() {
|
||||||
|
ace.require(["ace/mode/aql"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
File diff suppressed because one or more lines are too long
+8
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/mode/batchfile_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"keyword.command.dosbatch",regex:"\\b(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b",caseInsensitive:!0},{token:"keyword.control.statement.dosbatch",regex:"\\b(?:goto|call|exit)\\b",caseInsensitive:!0},{token:"keyword.control.conditional.if.dosbatch",regex:"\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b",caseInsensitive:!0},{token:"keyword.control.conditional.dosbatch",regex:"\\b(?:if|else)\\b",caseInsensitive:!0},{token:"keyword.control.repeat.dosbatch",regex:"\\bfor\\b",caseInsensitive:!0},{token:"keyword.operator.dosbatch",regex:"\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b"},{token:["doc.comment","comment"],regex:"(?:^|\\b)(rem)($|\\s.*$)",caseInsensitive:!0},{token:"comment.line.colons.dosbatch",regex:"::.*$"},{include:"variable"},{token:"punctuation.definition.string.begin.shell",regex:'"',push:[{token:"punctuation.definition.string.end.shell",regex:'"',next:"pop"},{include:"variable"},{defaultToken:"string.quoted.double.dosbatch"}]},{token:"keyword.operator.pipe.dosbatch",regex:"[|]"},{token:"keyword.operator.redirect.shell",regex:"&>|\\d*>&\\d*|\\d*(?:>>|>|<)|\\d*<&|\\d*<>"}],variable:[{token:"constant.numeric",regex:"%%\\w+|%[*\\d]|%\\w+%"},{token:"constant.numeric",regex:"%~\\d+"},{token:["markup.list","constant.other","markup.list"],regex:"(%)(\\w+)(%?)"}]},this.normalizeRules()};s.metaData={name:"Batch File",scopeName:"source.dosbatch",fileTypes:["bat"]},r.inherits(s,i),t.BatchFileHighlightRules=s}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++n<s){t=e.getLine(n);var f=u.exec(t);if(!f)continue;f[1]?a--:a++;if(!a)break}var l=n;if(l>o)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/batchfile",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/batchfile_highlight_rules","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./batchfile_highlight_rules").BatchFileHighlightRules,o=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="::",this.blockComment="",this.$id="ace/mode/batchfile"}.call(u.prototype),t.Mode=u}); (function() {
|
||||||
|
ace.require(["ace/mode/batchfile"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/mode/c9search_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";function o(e,t){try{return new RegExp(e,t)}catch(n){}}var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,u=function(){this.$rules={start:[{tokenNames:["c9searchresults.constant.numeric","c9searchresults.text","c9searchresults.text","c9searchresults.keyword"],regex:/(^\s+[0-9]+)(:)(\d*\s?)([^\r\n]+)/,onMatch:function(e,t,n){var r=this.splitRegex.exec(e),i=this.tokenNames,s=[{type:i[0],value:r[1]},{type:i[1],value:r[2]}];r[3]&&(r[3]==" "?s[1]={type:i[1],value:r[2]+" "}:s.push({type:i[1],value:r[3]}));var o=n[1],u=r[4],a,f=0;if(o&&o.exec){o.lastIndex=0;while(a=o.exec(u)){var l=u.substring(f,a.index);f=o.lastIndex,l&&s.push({type:i[2],value:l});if(a[0])s.push({type:i[3],value:a[0]});else if(!l)break}}return f<u.length&&s.push({type:i[2],value:u.substr(f)}),s}},{regex:"^Searching for [^\\r\\n]*$",onMatch:function(e,t,n){var r=e.split("\x01");if(r.length<3)return"text";var s,u,a=0,f=[{value:r[a++]+"'",type:"text"},{value:u=r[a++],type:"text"},{value:"'"+r[a++],type:"text"}];r[2]!==" in"&&f.push({value:"'"+r[a++]+"'",type:"text"},{value:r[a++],type:"text"}),f.push({value:" "+r[a++]+" ",type:"text"}),r[a+1]?(s=r[a+1],f.push({value:"("+r[a+1]+")",type:"text"}),a+=1):a-=1;while(a++<r.length)r[a]&&f.push({value:r[a],type:"text"});u&&(/regex/.test(s)||(u=i.escapeRegExp(u)),/whole/.test(s)&&(u="\\b"+u+"\\b"));var l=u&&o("("+u+")",/ sensitive/.test(s)?"g":"ig");return l&&(n[0]=t,n[1]=l),f}},{regex:"^(?=Found \\d+ matches)",token:"text",next:"numbers"},{token:"string",regex:"^\\S:?[^:]+",next:"numbers"}],numbers:[{regex:"\\d+",token:"constant.numeric"},{regex:"$",token:"text",next:"start"}]},this.normalizeRules()};r.inherits(u,s),t.C9SearchHighlightRules=u}),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){"use strict";var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),ace.define("ace/mode/folding/c9search",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(){};r.inherits(o,s),function(){this.foldingStartMarker=/^(\S.*:|Searching for.*)$/,this.foldingStopMarker=/^(\s+|Found.*)$/,this.getFoldWidgetRange=function(e,t,n){var r=e.doc.getAllLines(n),s=r[n],o=/^(Found.*|Searching for.*)$/,u=/^(\S.*:|\s*)$/,a=o.test(s)?o:u,f=n,l=n;if(this.foldingStartMarker.test(s)){for(var c=n+1,h=e.getLength();c<h;c++)if(a.test(r[c]))break;l=c}else if(this.foldingStopMarker.test(s)){for(var c=n-1;c>=0;c--){s=r[c];if(a.test(s))break}f=c}if(f!=l){var p=s.length;return a===o&&(p=s.search(/\(Found[^)]+\)$|$/)),new i(f,p,l,0)}}}.call(o.prototype)}),ace.define("ace/mode/c9search",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c9search_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/c9search"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./c9search_highlight_rules").C9SearchHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,u=e("./folding/c9search").FoldMode,a=function(){this.HighlightRules=s,this.$outdent=new o,this.foldingRules=new u};r.inherits(a,i),function(){this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t);return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.$id="ace/mode/c9search"}.call(a.prototype),t.Mode=a}); (function() {
|
||||||
|
ace.require(["ace/mode/c9search"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/mode/cirru_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"constant.numeric",regex:/[\d\.]+/},{token:"comment.line.double-dash",regex:/--/,next:"comment"},{token:"storage.modifier",regex:/\(/},{token:"storage.modifier",regex:/,/,next:"line"},{token:"support.function",regex:/[^\(\)"\s{}\[\]]+/,next:"line"},{token:"string.quoted.double",regex:/"/,next:"string"},{token:"storage.modifier",regex:/\)/}],comment:[{token:"comment.line.double-dash",regex:/ +[^\n]+/,next:"start"}],string:[{token:"string.quoted.double",regex:/"/,next:"line"},{token:"constant.character.escape",regex:/\\/,next:"escape"},{token:"string.quoted.double",regex:/[^\\"]+/}],escape:[{token:"constant.character.escape",regex:/./,next:"string"}],line:[{token:"constant.numeric",regex:/[\d\.]+/},{token:"markup.raw",regex:/^\s*/,next:"start"},{token:"storage.modifier",regex:/\$/,next:"start"},{token:"variable.parameter",regex:/[^\(\)"\s{}\[\]]+/},{token:"storage.modifier",regex:/\(/,next:"start"},{token:"storage.modifier",regex:/\)/},{token:"markup.raw",regex:/^ */,next:"start"},{token:"string.quoted.double",regex:/"/,next:"string"}]}};r.inherits(s,i),t.CirruHighlightRules=s}),ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=this.indentationBlock(e,n);if(r)return r;var i=/\S/,o=e.getLine(n),u=o.search(i);if(u==-1||o[u]!="#")return;var a=o.length,f=e.getLength(),l=n,c=n;while(++n<f){o=e.getLine(n);var h=o.search(i);if(h==-1)continue;if(o[h]!="#")break;c=n}if(c>l){var p=e.getLine(c).length;return new s(l,a,c,p)}},this.getFoldWidget=function(e,t,n){var r=e.getLine(n),i=r.search(/\S/),s=e.getLine(n+1),o=e.getLine(n-1),u=o.search(/\S/),a=s.search(/\S/);if(i==-1)return e.foldWidgets[n-1]=u!=-1&&u<a?"start":"","";if(u==-1){if(i==a&&r[i]=="#"&&s[i]=="#")return e.foldWidgets[n-1]="",e.foldWidgets[n+1]="","start"}else if(u==i&&r[i]=="#"&&o[i]=="#"&&e.getLine(n-2).search(/\S/)==-1)return e.foldWidgets[n-1]="start",e.foldWidgets[n+1]="","";return u!=-1&&u<i?e.foldWidgets[n-1]="start":e.foldWidgets[n-1]="",i<a?"start":""}}.call(o.prototype)}),ace.define("ace/mode/cirru",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cirru_highlight_rules","ace/mode/folding/coffee"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./cirru_highlight_rules").CirruHighlightRules,o=e("./folding/coffee").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="--",this.$id="ace/mode/cirru"}.call(u.prototype),t.Mode=u}); (function() {
|
||||||
|
ace.require(["ace/mode/cirru"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/mode/cobol_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="ACCEPT|MERGE|SUM|ADD||MESSAGE|TABLE|ADVANCING|MODE|TAPE|AFTER|MULTIPLY|TEST|ALL|NEGATIVE|TEXT|ALPHABET|NEXT|THAN|ALSO|NO|THEN|ALTERNATE|NOT|THROUGH|AND|NUMBER|THRU|ANY|OCCURS|TIME|ARE|OF|TO|AREA|OFF|TOP||ASCENDING|OMITTED|TRUE|ASSIGN|ON|TYPE|AT|OPEN|UNIT|AUTHOR|OR|UNTIL|BEFORE|OTHER|UP|BLANK|OUTPUT|USE|BLOCK|PAGE|USING|BOTTOM|PERFORM|VALUE|BY|PIC|VALUES|CALL|PICTURE|WHEN|CANCEL|PLUS|WITH|CD|POINTER|WRITE|CHARACTER|POSITION||ZERO|CLOSE|POSITIVE|ZEROS|COLUMN|PROCEDURE|ZEROES|COMMA|PROGRAM|COMMON|PROGRAM-ID|COMMUNICATION|QUOTE|COMP|RANDOM|COMPUTE|READ|CONTAINS|RECEIVE|CONFIGURATION|RECORD|CONTINUE|REDEFINES|CONTROL|REFERENCE|COPY|REMAINDER|COUNT|REPLACE|DATA|REPORT|DATE|RESERVE|DAY|RESET|DELETE|RETURN|DESTINATION|REWIND|DISABLE|REWRITE|DISPLAY|RIGHT|DIVIDE|RUN|DOWN|SAME|ELSE|SEARCH|ENABLE|SECTION|END|SELECT|ENVIRONMENT|SENTENCE|EQUAL|SET|ERROR|SIGN|EXIT|SEQUENTIAL|EXTERNAL|SIZE|FLASE|SORT|FILE|SOURCE|LENGTH|SPACE|LESS|STANDARD|LIMIT|START|LINE|STOP|LOCK|STRING|LOW-VALUE|SUBTRACT",t="true|false|null",n="count|min|max|avg|sum|rank|now|coalesce|main",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"\\*.*$"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:r,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]}};r.inherits(s,i),t.CobolHighlightRules=s}),ace.define("ace/mode/cobol",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/cobol_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./cobol_highlight_rules").CobolHighlightRules,o=function(){this.HighlightRules=s,this.$behaviour=this.$defaultBehaviour};r.inherits(o,i),function(){this.lineCommentStart="*",this.$id="ace/mode/cobol"}.call(o.prototype),t.Mode=o}); (function() {
|
||||||
|
ace.require(["ace/mode/cobol"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8
File diff suppressed because one or more lines are too long
+8
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/mode/csp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e=this.createKeywordMapper({"constant.language":"child-src|connect-src|default-src|font-src|frame-src|img-src|manifest-src|media-src|object-src|script-src|style-src|worker-src|base-uri|plugin-types|sandbox|disown-opener|form-action|frame-ancestors|report-uri|report-to|upgrade-insecure-requests|block-all-mixed-content|require-sri-for|reflected-xss|referrer|policy-uri",variable:"'none'|'self'|'unsafe-inline'|'unsafe-eval'|'strict-dynamic'|'unsafe-hashed-attributes'"},"identifier",!0);this.$rules={start:[{token:"string.link",regex:/https?:[^;\s]*/},{token:"operator.punctuation",regex:/;/},{token:e,regex:/[^\s;]+/}]}};r.inherits(s,i),t.CspHighlightRules=s}),ace.define("ace/mode/csp",["require","exports","module","ace/mode/text","ace/mode/csp_highlight_rules","ace/lib/oop"],function(e,t,n){"use strict";var r=e("./text").Mode,i=e("./csp_highlight_rules").CspHighlightRules,s=e("../lib/oop"),o=function(){this.HighlightRules=i};s.inherits(o,r),function(){this.$id="ace/mode/csp"}.call(o.prototype),t.Mode=o}); (function() {
|
||||||
|
ace.require(["ace/mode/csp"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
File diff suppressed because one or more lines are too long
+8
File diff suppressed because one or more lines are too long
Vendored
+8
File diff suppressed because one or more lines are too long
+8
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/mode/diff_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{regex:"^(?:\\*{15}|={67}|-{3}|\\+{3})$",token:"punctuation.definition.separator.diff",name:"keyword"},{regex:"^(@@)(\\s*.+?\\s*)(@@)(.*)$",token:["constant","constant.numeric","constant","comment.doc.tag"]},{regex:"^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$",token:["constant.numeric","punctuation.definition.range.diff","constant.function","constant.numeric","punctuation.definition.range.diff","invalid"],name:"meta."},{regex:"^(\\-{3}|\\+{3}|\\*{3})( .+)$",token:["constant.numeric","meta.tag"]},{regex:"^([!+>])(.*?)(\\s*)$",token:["support.constant","text","invalid"]},{regex:"^([<\\-])(.*?)(\\s*)$",token:["support.function","string","invalid"]},{regex:"^(diff)(\\s+--\\w+)?(.+?)( .+)?$",token:["variable","variable","keyword","variable"]},{regex:"^Index.+$",token:"variable"},{regex:"^\\s+$",token:"text"},{regex:"\\s*$",token:"invalid"},{defaultToken:"invisible",caseInsensitive:!0}]}};r.inherits(s,i),t.DiffHighlightRules=s}),ace.define("ace/mode/folding/diff",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(e,t){this.regExpList=e,this.flag=t,this.foldingStartMarker=RegExp("^("+e.join("|")+")",this.flag)};r.inherits(o,i),function(){this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i={row:n,column:r.length},o=this.regExpList;for(var u=1;u<=o.length;u++){var a=RegExp("^("+o.slice(0,u).join("|")+")",this.flag);if(a.test(r))break}for(var f=e.getLength();++n<f;){r=e.getLine(n);if(a.test(r))break}if(n==i.row+1)return;return new s(i.row,i.column,n-1,r.length)}}.call(o.prototype)}),ace.define("ace/mode/diff",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/diff_highlight_rules","ace/mode/folding/diff"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./diff_highlight_rules").DiffHighlightRules,o=e("./folding/diff").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o(["diff","@@|\\*{5}"],"i")};r.inherits(u,i),function(){this.$id="ace/mode/diff",this.snippetFileId="ace/snippets/diff"}.call(u.prototype),t.Mode=u}); (function() {
|
||||||
|
ace.require(["ace/mode/diff"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+8
File diff suppressed because one or more lines are too long
+8
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},s.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:!0}]}};r.inherits(s,i),s.getTagRule=function(e){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"}},s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),ace.define("ace/mode/edifact_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=function(){var e="UNH",t="ADR|AGR|AJT|ALC|ALI|APP|APR|ARD|ARR|ASI|ATT|AUT|BAS|BGM|BII|BUS|CAV|CCD|CCI|CDI|CDS|CDV|CED|CIN|CLA|CLI|CMP|CNI|CNT|COD|COM|COT|CPI|CPS|CPT|CST|CTA|CUX|DAM|DFN|DGS|DII|DIM|DLI|DLM|DMS|DOC|DRD|DSG|DSI|DTM|EDT|EFI|ELM|ELU|ELV|EMP|EQA|EQD|EQN|ERC|ERP|EVE|FCA|FII|FNS|FNT|FOR|FSQ|FTX|GDS|GEI|GID|GIN|GIR|GOR|GPO|GRU|HAN|HYN|ICD|IDE|IFD|IHC|IMD|IND|INP|INV|IRQ|LAN|LIN|LOC|MEA|MEM|MKS|MOA|MSG|MTD|NAD|NAT|PAC|PAI|PAS|PCC|PCD|PCI|PDI|PER|PGI|PIA|PNA|POC|PRC|PRI|PRV|PSD|PTY|PYT|QRS|QTY|QUA|QVR|RCS|REL|RFF|RJL|RNG|ROD|RSL|RTE|SAL|SCC|SCD|SEG|SEL|SEQ|SFI|SGP|SGU|SPR|SPS|STA|STC|STG|STS|TAX|TCC|TDT|TEM|TMD|TMP|TOD|TPL|TRU|TSR|UNB|UNZ|UNT|UGH|UGT|UNS|VLI",e="UNH",n="null|Infinity|NaN|undefined",r="",s="BY|SE|ON|INV|JP|UNOA",o=this.createKeywordMapper({"variable.language":"this",keyword:s,"entity.name.segment":t,"entity.name.header":e,"constant.language":n,"support.function":r},"identifier");this.$rules={start:[{token:"punctuation.operator",regex:"\\+.\\+"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:o,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+"},{token:"punctuation.operator",regex:"\\:|'"},{token:"identifier",regex:"\\:D\\:"}]},this.embedRules(i,"doc-",[i.getEndRule("start")])};o.metaData={fileTypes:["edi"],keyEquivalent:"^~E",name:"Edifact",scopeName:"source.edifact"},r.inherits(o,s),t.EdifactHighlightRules=o}),ace.define("ace/mode/edifact",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/edifact_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./edifact_highlight_rules").EdifactHighlightRules,o=function(){this.HighlightRules=s};r.inherits(o,i),function(){this.$id="ace/mode/edifact",this.snippetFileId="ace/snippets/edifact"}.call(o.prototype),t.Mode=o}); (function() {
|
||||||
|
ace.require(["ace/mode/edifact"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/mode/eiffel_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e="across|agent|alias|all|attached|as|assign|attribute|check|class|convert|create|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|Precursor|redefine|rename|require|rescue|retry|select|separate|some|then|undefine|until|variant|when",t="and|implies|or|xor",n="Void",r="True|False",i="Current|Result",s=this.createKeywordMapper({"constant.language":n,"constant.language.boolean":r,"variable.language":i,"keyword.operator":t,keyword:e},"identifier",!0),o=/(?:[^"%\b\f\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)+?/;this.$rules={start:[{token:"string.quoted.other",regex:/"\[/,next:"aligned_verbatim_string"},{token:"string.quoted.other",regex:/"\{/,next:"non-aligned_verbatim_string"},{token:"string.quoted.double",regex:/"(?:[^%\b\f\n\r\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)*?"/},{token:"comment.line.double-dash",regex:/--.*/},{token:"constant.character",regex:/'(?:[^%\b\f\n\r\t\v]|%[A-DFHLNQR-V%'"()<>]|%\/(?:0[xX][\da-fA-F](?:_*[\da-fA-F])*|0[cC][0-7](?:_*[0-7])*|0[bB][01](?:_*[01])*|\d(?:_*\d)*)\/)'/},{token:"constant.numeric",regex:/\b0(?:[xX][\da-fA-F](?:_*[\da-fA-F])*|[cC][0-7](?:_*[0-7])*|[bB][01](?:_*[01])*)\b/},{token:"constant.numeric",regex:/(?:\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?[eE][+-]?)?\d(?:_*\d)*|\d(?:_*\d)*\.?/},{token:"paren.lparen",regex:/[\[({]|<<|\|\(/},{token:"paren.rparen",regex:/[\])}]|>>|\|\)/},{token:"keyword.operator",regex:/:=|->|\.(?=\w)|[;,:?]/},{token:"keyword.operator",regex:/\\\\|\|\.\.\||\.\.|\/[~\/]?|[><\/]=?|[-+*^=~]/},{token:function(e){var t=s(e);return t==="identifier"&&e===e.toUpperCase()&&(t="entity.name.type"),t},regex:/[a-zA-Z][a-zA-Z\d_]*\b/},{token:"text",regex:/\s+/}],aligned_verbatim_string:[{token:"string",regex:/]"/,next:"start"},{token:"string",regex:o}],"non-aligned_verbatim_string":[{token:"string.quoted.other",regex:/}"/,next:"start"},{token:"string.quoted.other",regex:o}]}};r.inherits(s,i),t.EiffelHighlightRules=s}),ace.define("ace/mode/eiffel",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/eiffel_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./eiffel_highlight_rules").EiffelHighlightRules,o=function(){this.HighlightRules=s,this.$behaviour=this.$defaultBehaviour};r.inherits(o,i),function(){this.lineCommentStart="--",this.$id="ace/mode/eiffel"}.call(o.prototype),t.Mode=o}); (function() {
|
||||||
|
ace.require(["ace/mode/eiffel"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
File diff suppressed because one or more lines are too long
+8
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/mode/elm_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){var e=this.createKeywordMapper({keyword:"as|case|class|data|default|deriving|do|else|export|foreign|hiding|jsevent|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|open|then|type|where|_|port|\u03bb"},"identifier"),t=/\\(\d+|['"\\&trnbvf])/,n=/[a-z_]/.source,r=/[A-Z]/.source,i=/[a-z_A-Z0-9']/.source;this.$rules={start:[{token:"string.start",regex:'"',next:"string"},{token:"string.character",regex:"'(?:"+t.source+"|.)'?"},{regex:/0(?:[xX][0-9A-Fa-f]+|[oO][0-7]+)|\d+(\.\d+)?([eE][-+]?\d*)?/,token:"constant.numeric"},{token:"comment",regex:"--.*"},{token:"keyword",regex:/\.\.|\||:|=|\\|"|->|<-|\u2192/},{token:"keyword.operator",regex:/[-!#$%&*+.\/<=>?@\\^|~:\u03BB\u2192]+/},{token:"operator.punctuation",regex:/[,;`]/},{regex:r+i+"+\\.?",token:function(e){return e[e.length-1]=="."?"entity.name.function":"constant.language"}},{regex:"^"+n+i+"+",token:function(e){return"constant.language"}},{token:e,regex:"[\\w\\xff-\\u218e\\u2455-\\uffff]+\\b"},{regex:"{-#?",token:"comment.start",onMatch:function(e,t,n){return this.next=e.length==2?"blockComment":"docComment",this.token}},{token:"variable.language",regex:/\[markdown\|/,next:"markdown"},{token:"paren.lparen",regex:/[\[({]/},{token:"paren.rparen",regex:/[\])}]/}],markdown:[{regex:/\|\]/,next:"start"},{defaultToken:"string"}],blockComment:[{regex:"{-",token:"comment.start",push:"blockComment"},{regex:"-}",token:"comment.end",next:"pop"},{defaultToken:"comment"}],docComment:[{regex:"{-",token:"comment.start",push:"docComment"},{regex:"-}",token:"comment.end",next:"pop"},{defaultToken:"doc.comment"}],string:[{token:"constant.language.escape",regex:t},{token:"text",regex:/\\(\s|$)/,next:"stringGap"},{token:"string.end",regex:'"',next:"start"},{defaultToken:"string"}],stringGap:[{token:"text",regex:/\\/,next:"string"},{token:"error",regex:"",next:"start"}]},this.normalizeRules()};r.inherits(s,i),t.ElmHighlightRules=s}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++n<s){t=e.getLine(n);var f=u.exec(t);if(!f)continue;f[1]?a--:a++;if(!a)break}var l=n;if(l>o)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/elm",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/elm_highlight_rules","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./elm_highlight_rules").ElmHighlightRules,o=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o,this.$behaviour=this.$defaultBehaviour};r.inherits(u,i),function(){this.lineCommentStart="--",this.blockComment={start:"{-",end:"-}",nestable:!0},this.$id="ace/mode/elm"}.call(u.prototype),t.Mode=u}); (function() {
|
||||||
|
ace.require(["ace/mode/elm"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
File diff suppressed because one or more lines are too long
+8
File diff suppressed because one or more lines are too long
+8
File diff suppressed because one or more lines are too long
+8
File diff suppressed because one or more lines are too long
+8
@@ -0,0 +1,8 @@
|
|||||||
|
ace.define("ace/mode/fsl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"punctuation.definition.comment.mn",regex:/\/\*/,push:[{token:"punctuation.definition.comment.mn",regex:/\*\//,next:"pop"},{defaultToken:"comment.block.fsl"}]},{token:"comment.line.fsl",regex:/\/\//,push:[{token:"comment.line.fsl",regex:/$/,next:"pop"},{defaultToken:"comment.line.fsl"}]},{token:"entity.name.function",regex:/\${/,push:[{token:"entity.name.function",regex:/}/,next:"pop"},{defaultToken:"keyword.other"}],comment:"js outcalls"},{token:"constant.numeric",regex:/[0-9]*\.[0-9]*\.[0-9]*/,comment:"semver"},{token:"constant.language.fslLanguage",regex:"(?:graph_layout|machine_name|machine_author|machine_license|machine_comment|machine_language|machine_version|machine_reference|npm_name|graph_layout|on_init|on_halt|on_end|on_terminate|on_finalize|on_transition|on_action|on_stochastic_action|on_legal|on_main|on_forced|on_validation|on_validation_failure|on_transition_refused|on_forced_transition_refused|on_action_refused|on_enter|on_exit|start_states|end_states|terminal_states|final_states|fsl_version)\\s*:"},{token:"keyword.control.transition.fslArrow",regex:/<->|<-|->|<=>|=>|<=|<~>|~>|<~|<-=>|<=->|<-~>|<~->|<=~>|<~=>/},{token:"constant.numeric.fslProbability",regex:/[0-9]+%/,comment:"edge probability annotation"},{token:"constant.character.fslAction",regex:/\'[^']*\'/,comment:"action annotation"},{token:"string.quoted.double.fslLabel.doublequoted",regex:/\"[^"]*\"/,comment:"fsl label annotation"},{token:"entity.name.tag.fslLabel.atom",regex:/[a-zA-Z0-9_.+&()#@!?,]/,comment:"fsl label annotation"}]},this.normalizeRules()};s.metaData={fileTypes:["fsl","fsl_state"],name:"FSL",scopeName:"source.fsl"},r.inherits(s,i),t.FSLHighlightRules=s}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);if(this.singleLineBlockCommentRe.test(r)&&!this.startRegionRe.test(r)&&!this.tripleStarBlockCommentRe.test(r))return"";var i=this._getFoldWidgetBase(e,t,n);return!i&&this.startRegionRe.test(r)?"start":i},this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n);if(this.startRegionRe.test(i))return this.getCommentRegionBlock(e,i,n);var s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)},this.getCommentRegionBlock=function(e,t,n){var r=t.search(/\s*$/),s=e.getLength(),o=n,u=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;while(++n<s){t=e.getLine(n);var f=u.exec(t);if(!f)continue;f[1]?a--:a++;if(!a)break}var l=n;if(l>o)return new i(o,r,l,t.length)}}.call(o.prototype)}),ace.define("ace/mode/fsl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/fsl_highlight_rules","ace/mode/folding/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./fsl_highlight_rules").FSLHighlightRules,o=e("./folding/cstyle").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o};r.inherits(u,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$id="ace/mode/fsl",this.snippetFileId="ace/snippets/fsl"}.call(u.prototype),t.Mode=u}); (function() {
|
||||||
|
ace.require(["ace/mode/fsl"], function(m) {
|
||||||
|
if (typeof module == "object" && typeof exports == "object" && module) {
|
||||||
|
module.exports = m;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
+8
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user