Merge branch 'dev' into sabre32
This commit is contained in:
commit
86985b454f
@ -17,6 +17,8 @@ Hubzilla 1.8
|
||||
Show server role (identify UNO or basic sites as opposed to hubzilla pro) and link to statistics
|
||||
Documentation:
|
||||
Clarify privacy rights of commenters w/r/t conversation owners, as this policy is network dependent.
|
||||
Wiki (Git backed):
|
||||
Brand new feature. We'll call it experimental until it has undergone a bit more testing.
|
||||
Account Cloning:
|
||||
Regression on clone channel creation created a new channel name each time.
|
||||
New issue (fixed) with directory creation on cloned file content
|
||||
|
@ -215,6 +215,7 @@ class Apps {
|
||||
'Settings' => t('Settings'),
|
||||
'Files' => t('Files'),
|
||||
'Webpages' => t('Webpages'),
|
||||
'Wiki' => t('Wiki'),
|
||||
'Channel Home' => t('Channel Home'),
|
||||
'View Profile' => t('View Profile'),
|
||||
'Photos' => t('Photos'),
|
||||
|
436
Zotlabs/Module/Wiki.php
Normal file
436
Zotlabs/Module/Wiki.php
Normal file
@ -0,0 +1,436 @@
|
||||
<?php
|
||||
|
||||
namespace Zotlabs\Module;/** @file */
|
||||
|
||||
class Wiki extends \Zotlabs\Web\Controller {
|
||||
|
||||
function init() {
|
||||
// Determine which channel's wikis to display to the observer
|
||||
$nick = null;
|
||||
if (argc() > 1)
|
||||
$nick = argv(1); // if the channel name is in the URL, use that
|
||||
if (!$nick && local_channel()) { // if no channel name was provided, assume the current logged in channel
|
||||
$channel = \App::get_channel();
|
||||
if ($channel && $channel['channel_address']) {
|
||||
$nick = $channel['channel_address'];
|
||||
goaway(z_root() . '/wiki/' . $nick);
|
||||
}
|
||||
}
|
||||
if (!$nick) {
|
||||
notice(t('You must be logged in to see this page.') . EOL);
|
||||
goaway('/login');
|
||||
}
|
||||
}
|
||||
|
||||
function get() {
|
||||
require_once('include/wiki.php');
|
||||
require_once('include/acl_selectors.php');
|
||||
// TODO: Combine the interface configuration into a unified object
|
||||
// Something like $interface = array('new_page_button' => false, 'new_wiki_button' => false, ...)
|
||||
$wiki_owner = false;
|
||||
$showNewWikiButton = false;
|
||||
$showCommitMsg = false;
|
||||
$hidePageHistory = false;
|
||||
$pageHistory = array();
|
||||
$local_observer = null;
|
||||
$resource_id = '';
|
||||
|
||||
// init() should have forced the URL to redirect to /wiki/channel so assume argc() > 1
|
||||
$nick = argv(1);
|
||||
$channel = get_channel_by_nick($nick); // The channel who owns the wikis being viewed
|
||||
if(! $channel) {
|
||||
notice('Invalid channel' . EOL);
|
||||
goaway('/' . argv(0));
|
||||
}
|
||||
// Determine if the observer is the channel owner so the ACL dialog can be populated
|
||||
if (local_channel() === intval($channel['channel_id'])) {
|
||||
$local_observer = \App::get_channel();
|
||||
$wiki_owner = true;
|
||||
|
||||
// Obtain the default permission settings of the channel
|
||||
$channel_acl = array(
|
||||
'allow_cid' => $local_observer['channel_allow_cid'],
|
||||
'allow_gid' => $local_observer['channel_allow_gid'],
|
||||
'deny_cid' => $local_observer['channel_deny_cid'],
|
||||
'deny_gid' => $local_observer['channel_deny_gid']
|
||||
);
|
||||
// Initialize the ACL to the channel default permissions
|
||||
$x = array(
|
||||
'lockstate' => (( $local_observer['channel_allow_cid'] ||
|
||||
$local_observer['channel_allow_gid'] ||
|
||||
$local_observer['channel_deny_cid'] ||
|
||||
$local_observer['channel_deny_gid'])
|
||||
? 'lock' : 'unlock'),
|
||||
'acl' => populate_acl($channel_acl),
|
||||
'bang' => ''
|
||||
);
|
||||
} else {
|
||||
// Not the channel owner
|
||||
$channel_acl = $x = array();
|
||||
}
|
||||
|
||||
switch (argc()) {
|
||||
case 2:
|
||||
// Configure page template
|
||||
$wikiheader = t('Wiki Sandbox');
|
||||
$content = '"# Wiki Sandbox\n\nContent you **edit** and **preview** here *will not be saved*."';
|
||||
$hide_editor = false;
|
||||
$showPageControls = false;
|
||||
$showNewWikiButton = $wiki_owner;
|
||||
$showNewPageButton = false;
|
||||
$hidePageHistory = true;
|
||||
$showCommitMsg = false;
|
||||
break;
|
||||
case 3:
|
||||
// /wiki/channel/wiki -> No page was specified, so redirect to Home.md
|
||||
$wikiUrlName = urlencode(argv(2));
|
||||
goaway('/'.argv(0).'/'.argv(1).'/'.$wikiUrlName.'/Home');
|
||||
case 4:
|
||||
// GET /wiki/channel/wiki/page
|
||||
// Fetch the wiki info and determine observer permissions
|
||||
$wikiUrlName = urlencode(argv(2));
|
||||
$pageUrlName = urlencode(argv(3));
|
||||
$w = wiki_exists_by_name($channel['channel_id'], $wikiUrlName);
|
||||
if(!$w['resource_id']) {
|
||||
notice('Wiki not found' . EOL);
|
||||
goaway('/'.argv(0).'/'.argv(1));
|
||||
}
|
||||
$resource_id = $w['resource_id'];
|
||||
|
||||
if (!$wiki_owner) {
|
||||
// Check for observer permissions
|
||||
$observer_hash = get_observer_hash();
|
||||
$perms = wiki_get_permissions($resource_id, intval($channel['channel_id']), $observer_hash);
|
||||
if(!$perms['read']) {
|
||||
notice('Permission denied.' . EOL);
|
||||
goaway('/'.argv(0).'/'.argv(1));
|
||||
}
|
||||
if($perms['write']) {
|
||||
$wiki_editor = true;
|
||||
} else {
|
||||
$wiki_editor = false;
|
||||
}
|
||||
} else {
|
||||
$wiki_editor = true;
|
||||
}
|
||||
$wikiheader = urldecode($wikiUrlName) . ': ' . urldecode($pageUrlName); // show wiki name and page
|
||||
$p = wiki_get_page_content(array('resource_id' => $resource_id, 'pageUrlName' => $pageUrlName));
|
||||
if(!$p['success']) {
|
||||
notice('Error retrieving page content' . EOL);
|
||||
goaway('/'.argv(0).'/'.argv(1).'/'.$wikiUrlName);
|
||||
}
|
||||
$content = ($p['content'] !== '' ? $p['content'] : '"# New page\n"');
|
||||
$hide_editor = false;
|
||||
$showPageControls = $wiki_editor;
|
||||
$showNewWikiButton = $wiki_owner;
|
||||
$showNewPageButton = $wiki_editor;
|
||||
$hidePageHistory = false;
|
||||
$showCommitMsg = true;
|
||||
$pageHistory = wiki_page_history(array('resource_id' => $resource_id, 'pageUrlName' => $pageUrlName));
|
||||
break;
|
||||
default: // Strip the extraneous URL components
|
||||
goaway('/'.argv(0).'/'.argv(1).'/'.$wikiUrlName.'/'.$pageUrlName);
|
||||
}
|
||||
// Render the Markdown-formatted page content in HTML
|
||||
require_once('library/markdown.php');
|
||||
|
||||
$o .= replace_macros(get_markup_template('wiki.tpl'),array(
|
||||
'$wikiheader' => $wikiheader,
|
||||
'$hideEditor' => $hide_editor,
|
||||
'$showPageControls' => $showPageControls,
|
||||
'$showNewWikiButton'=> $showNewWikiButton,
|
||||
'$showNewPageButton'=> $showNewPageButton,
|
||||
'$hidePageHistory' => $hidePageHistory,
|
||||
'$showCommitMsg' => $showCommitMsg,
|
||||
'$channel' => $channel['channel_address'],
|
||||
'$resource_id' => $resource_id,
|
||||
'$page' => $pageUrlName,
|
||||
'$lockstate' => $x['lockstate'],
|
||||
'$acl' => $x['acl'],
|
||||
'$bang' => $x['bang'],
|
||||
'$content' => $content,
|
||||
'$renderedContent' => Markdown(json_decode($content)),
|
||||
'$wikiName' => array('wikiName', t('Enter the name of your new wiki:'), '', ''),
|
||||
'$pageName' => array('pageName', t('Enter the name of the new page:'), '', ''),
|
||||
'$commitMsg' => array('commitMsg', '', '', '', '', 'placeholder="(optional) Enter a custom message when saving the page..."'),
|
||||
'$pageHistory' => $pageHistory['history']
|
||||
));
|
||||
head_add_js('library/ace/ace.js'); // Ace Code Editor
|
||||
return $o;
|
||||
}
|
||||
|
||||
function post() {
|
||||
require_once('include/wiki.php');
|
||||
|
||||
// /wiki/channel/preview
|
||||
// Render mardown-formatted text in HTML for preview
|
||||
if((argc() > 2) && (argv(2) === 'preview')) {
|
||||
$content = $_POST['content'];
|
||||
require_once('library/markdown.php');
|
||||
$html = Markdown($content);
|
||||
json_return_and_die(array('html' => $html, 'success' => true));
|
||||
}
|
||||
|
||||
// Create a new wiki
|
||||
// /wiki/channel/create/wiki
|
||||
if ((argc() > 3) && (argv(2) === 'create') && (argv(3) === 'wiki')) {
|
||||
$nick = argv(1);
|
||||
$channel = get_channel_by_nick($nick);
|
||||
// Determine if observer has permission to create wiki
|
||||
$observer_hash = get_observer_hash();
|
||||
// Only the channel owner can create a wiki, at least until we create a
|
||||
// more detail permissions framework
|
||||
if (local_channel() !== intval($channel['channel_id'])) {
|
||||
goaway('/'.argv(0).'/'.$nick.'/');
|
||||
} else {
|
||||
/*
|
||||
$channel = get_channel_by_nick($nick);
|
||||
// Figure out who the page owner is.
|
||||
$perms = get_all_perms(intval($channel['channel_id']), $observer_hash);
|
||||
// TODO: Create a new permission setting for wiki analogous to webpages. Until
|
||||
// then, use webpage permissions
|
||||
if (!$perms['write_pages']) {
|
||||
notice(t('Permission denied.') . EOL);
|
||||
goaway('/'.argv(0).'/'.argv(1).'/');
|
||||
}
|
||||
*/
|
||||
}
|
||||
$wiki = array();
|
||||
// Generate new wiki info from input name
|
||||
$wiki['rawName'] = $_POST['wikiName'];
|
||||
$wiki['htmlName'] = escape_tags($_POST['wikiName']);
|
||||
$wiki['urlName'] = urlencode($_POST['wikiName']);
|
||||
if($wiki['urlName'] === '') {
|
||||
notice('Error creating wiki. Invalid name.');
|
||||
goaway('/wiki');
|
||||
}
|
||||
// Get ACL for permissions
|
||||
$acl = new \Zotlabs\Access\AccessList($channel);
|
||||
$acl->set_from_array($_POST);
|
||||
$r = wiki_create_wiki($channel, $observer_hash, $wiki, $acl);
|
||||
if ($r['success']) {
|
||||
$homePage = wiki_create_page('Home', $r['item']['resource_id']);
|
||||
if(!$homePage['success']) {
|
||||
notice('Wiki created, but error creating Home page.');
|
||||
goaway('/wiki/'.$nick.'/'.$wiki['urlName']);
|
||||
}
|
||||
goaway('/wiki/'.$nick.'/'.$wiki['urlName'].'/'.$homePage['page']['urlName']);
|
||||
} else {
|
||||
notice('Error creating wiki');
|
||||
goaway('/wiki');
|
||||
}
|
||||
}
|
||||
|
||||
// Delete a wiki
|
||||
if ((argc() > 3) && (argv(2) === 'delete') && (argv(3) === 'wiki')) {
|
||||
$nick = argv(1);
|
||||
$channel = get_channel_by_nick($nick);
|
||||
// Only the channel owner can delete a wiki, at least until we create a
|
||||
// more detail permissions framework
|
||||
if (local_channel() !== intval($channel['channel_id'])) {
|
||||
logger('Wiki delete permission denied.' . EOL);
|
||||
json_return_and_die(array('message' => 'Wiki delete permission denied.', 'success' => false));
|
||||
} else {
|
||||
/*
|
||||
$channel = get_channel_by_nick($nick);
|
||||
$observer_hash = get_observer_hash();
|
||||
// Figure out who the page owner is.
|
||||
$perms = get_all_perms(intval($channel['channel_id']), $observer_hash);
|
||||
// TODO: Create a new permission setting for wiki analogous to webpages. Until
|
||||
// then, use webpage permissions
|
||||
if (!$perms['write_pages']) {
|
||||
logger('Wiki delete permission denied.' . EOL);
|
||||
json_return_and_die(array('success' => false));
|
||||
}
|
||||
*/
|
||||
}
|
||||
$resource_id = $_POST['resource_id'];
|
||||
$deleted = wiki_delete_wiki($resource_id);
|
||||
if ($deleted['success']) {
|
||||
json_return_and_die(array('message' => '', 'success' => true));
|
||||
} else {
|
||||
logger('Error deleting wiki: ' . $resource_id);
|
||||
json_return_and_die(array('message' => 'Error deleting wiki', 'success' => false));
|
||||
}
|
||||
}
|
||||
|
||||
// Create a page
|
||||
if ((argc() === 4) && (argv(2) === 'create') && (argv(3) === 'page')) {
|
||||
$nick = argv(1);
|
||||
$resource_id = $_POST['resource_id'];
|
||||
// Determine if observer has permission to create a page
|
||||
$channel = get_channel_by_nick($nick);
|
||||
if (local_channel() !== intval($channel['channel_id'])) {
|
||||
$observer_hash = get_observer_hash();
|
||||
$perms = wiki_get_permissions($resource_id, intval($channel['channel_id']), $observer_hash);
|
||||
if(!$perms['write']) {
|
||||
logger('Wiki write permission denied. ' . EOL);
|
||||
json_return_and_die(array('success' => false));
|
||||
}
|
||||
}
|
||||
$name = $_POST['name']; //Get new page name
|
||||
if(urlencode(escape_tags($_POST['name'])) === '') {
|
||||
json_return_and_die(array('message' => 'Error creating page. Invalid name.', 'success' => false));
|
||||
}
|
||||
$page = wiki_create_page($name, $resource_id);
|
||||
if ($page['success']) {
|
||||
json_return_and_die(array('url' => '/'.argv(0).'/'.argv(1).'/'.$page['wiki']['urlName'].'/'.urlencode($page['page']['urlName']), 'success' => true));
|
||||
} else {
|
||||
logger('Error creating page');
|
||||
json_return_and_die(array('message' => 'Error creating page.', 'success' => false));
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch page list for a wiki
|
||||
if ((argc() === 5) && (argv(2) === 'get') && (argv(3) === 'page') && (argv(4) === 'list')) {
|
||||
$resource_id = $_POST['resource_id']; // resource_id for wiki in db
|
||||
$channel = get_channel_by_nick(argv(1));
|
||||
$observer_hash = get_observer_hash();
|
||||
if (local_channel() !== intval($channel['channel_id'])) {
|
||||
$perms = wiki_get_permissions($resource_id, intval($channel['channel_id']), $observer_hash);
|
||||
if(!$perms['read']) {
|
||||
logger('Wiki read permission denied.' . EOL);
|
||||
json_return_and_die(array('pages' => null, 'message' => 'Permission denied.', 'success' => false));
|
||||
}
|
||||
}
|
||||
$page_list_html = widget_wiki_pages(array(
|
||||
'resource_id' => $resource_id,
|
||||
'refresh' => true,
|
||||
'channel' => argv(1)));
|
||||
json_return_and_die(array('pages' => $page_list_html, 'message' => '', 'success' => true));
|
||||
}
|
||||
|
||||
// Save a page
|
||||
if ((argc() === 4) && (argv(2) === 'save') && (argv(3) === 'page')) {
|
||||
|
||||
$resource_id = $_POST['resource_id'];
|
||||
$pageUrlName = $_POST['name'];
|
||||
$pageHtmlName = escape_tags($_POST['name']);
|
||||
$content = escape_tags($_POST['content']); //Get new content
|
||||
$commitMsg = $_POST['commitMsg'];
|
||||
if ($commitMsg === '') {
|
||||
$commitMsg = 'Updated ' . $pageHtmlName;
|
||||
}
|
||||
$nick = argv(1);
|
||||
$channel = get_channel_by_nick($nick);
|
||||
// Determine if observer has permission to save content
|
||||
if (local_channel() !== intval($channel['channel_id'])) {
|
||||
$observer_hash = get_observer_hash();
|
||||
$perms = wiki_get_permissions($resource_id, intval($channel['channel_id']), $observer_hash);
|
||||
if(!$perms['write']) {
|
||||
logger('Wiki write permission denied. ' . EOL);
|
||||
json_return_and_die(array('success' => false));
|
||||
}
|
||||
}
|
||||
|
||||
$saved = wiki_save_page(array('resource_id' => $resource_id, 'pageUrlName' => $pageUrlName, 'content' => $content));
|
||||
if($saved['success']) {
|
||||
$ob = \App::get_observer();
|
||||
$commit = wiki_git_commit(array(
|
||||
'commit_msg' => $commitMsg,
|
||||
'resource_id' => $resource_id,
|
||||
'observer' => $ob,
|
||||
'files' => array($pageUrlName.'.md')
|
||||
));
|
||||
if($commit['success']) {
|
||||
json_return_and_die(array('message' => 'Wiki git repo commit made', 'success' => true));
|
||||
} else {
|
||||
json_return_and_die(array('message' => 'Error making git commit','success' => false));
|
||||
}
|
||||
} else {
|
||||
json_return_and_die(array('message' => 'Error saving page', 'success' => false));
|
||||
}
|
||||
}
|
||||
|
||||
// Update page history
|
||||
// /wiki/channel/history/page
|
||||
if ((argc() === 4) && (argv(2) === 'history') && (argv(3) === 'page')) {
|
||||
|
||||
$resource_id = $_POST['resource_id'];
|
||||
$pageUrlName = $_POST['name'];
|
||||
|
||||
$nick = argv(1);
|
||||
$channel = get_channel_by_nick($nick);
|
||||
// Determine if observer has permission to read content
|
||||
if (local_channel() !== intval($channel['channel_id'])) {
|
||||
$observer_hash = get_observer_hash();
|
||||
$perms = wiki_get_permissions($resource_id, intval($channel['channel_id']), $observer_hash);
|
||||
if(!$perms['read']) {
|
||||
logger('Wiki read permission denied.' . EOL);
|
||||
json_return_and_die(array('historyHTML' => '', 'message' => 'Permission denied.', 'success' => false));
|
||||
}
|
||||
}
|
||||
$historyHTML = widget_wiki_page_history(array(
|
||||
'resource_id' => $resource_id,
|
||||
'pageUrlName' => $pageUrlName
|
||||
));
|
||||
json_return_and_die(array('historyHTML' => $historyHTML, 'message' => '', 'success' => true));
|
||||
}
|
||||
|
||||
// Delete a page
|
||||
if ((argc() === 4) && (argv(2) === 'delete') && (argv(3) === 'page')) {
|
||||
$resource_id = $_POST['resource_id'];
|
||||
$pageUrlName = $_POST['name'];
|
||||
if ($pageUrlName === 'Home') {
|
||||
json_return_and_die(array('message' => 'Cannot delete Home','success' => false));
|
||||
}
|
||||
// Determine if observer has permission to delete pages
|
||||
$nick = argv(1);
|
||||
$channel = get_channel_by_nick($nick);
|
||||
if (local_channel() !== intval($channel['channel_id'])) {
|
||||
$observer_hash = get_observer_hash();
|
||||
$perms = wiki_get_permissions($resource_id, intval($channel['channel_id']), $observer_hash);
|
||||
if(!$perms['write']) {
|
||||
logger('Wiki write permission denied. ' . EOL);
|
||||
json_return_and_die(array('success' => false));
|
||||
}
|
||||
}
|
||||
$deleted = wiki_delete_page(array('resource_id' => $resource_id, 'pageUrlName' => $pageUrlName));
|
||||
if($deleted['success']) {
|
||||
$ob = \App::get_observer();
|
||||
$commit = wiki_git_commit(array(
|
||||
'commit_msg' => 'Deleted ' . $pageHtmlName,
|
||||
'resource_id' => $resource_id,
|
||||
'observer' => $ob,
|
||||
'files' => null
|
||||
));
|
||||
if($commit['success']) {
|
||||
json_return_and_die(array('message' => 'Wiki git repo commit made', 'success' => true));
|
||||
} else {
|
||||
json_return_and_die(array('message' => 'Error making git commit','success' => false));
|
||||
}
|
||||
} else {
|
||||
json_return_and_die(array('message' => 'Error deleting page', 'success' => false));
|
||||
}
|
||||
}
|
||||
|
||||
// Revert a page
|
||||
if ((argc() === 4) && (argv(2) === 'revert') && (argv(3) === 'page')) {
|
||||
$resource_id = $_POST['resource_id'];
|
||||
$pageUrlName = $_POST['name'];
|
||||
$commitHash = $_POST['commitHash'];
|
||||
// Determine if observer has permission to revert pages
|
||||
$nick = argv(1);
|
||||
$channel = get_channel_by_nick($nick);
|
||||
if (local_channel() !== intval($channel['channel_id'])) {
|
||||
$observer_hash = get_observer_hash();
|
||||
$perms = wiki_get_permissions($resource_id, intval($channel['channel_id']), $observer_hash);
|
||||
if(!$perms['write']) {
|
||||
logger('Wiki write permission denied.' . EOL);
|
||||
json_return_and_die(array('success' => false));
|
||||
}
|
||||
}
|
||||
$reverted = wiki_revert_page(array('commitHash' => $commitHash, 'observer' => \App::get_observer(), 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName));
|
||||
if($reverted['success']) {
|
||||
json_return_and_die(array('content' => $reverted['content'], 'message' => '', 'success' => true));
|
||||
} else {
|
||||
json_return_and_die(array('content' => '', 'message' => 'Error reverting page', 'success' => false));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//notice('You must be authenticated.');
|
||||
json_return_and_die(array('message' => 'You must be authenticated.', 'success' => false));
|
||||
|
||||
}
|
||||
}
|
@ -75,6 +75,15 @@ class GitRepo {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function initRepo() {
|
||||
if(!$this->path) return false;
|
||||
try {
|
||||
return $this->git->init($this->path);
|
||||
} catch (\PHPGit\Exception\GitException $ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function pull() {
|
||||
try {
|
||||
@ -118,6 +127,15 @@ class GitRepo {
|
||||
$repo['logs'] = $git->log(array('limit' => 50));
|
||||
return $repo;
|
||||
}
|
||||
|
||||
// Commit changes to the repo. Default is to stage all changes and commit everything.
|
||||
public function commit($msg, $options = array()) {
|
||||
try {
|
||||
return $this->git->commit($msg, $options);
|
||||
} catch (\PHPGit\Exception\GitException $ex) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static function isValidGitRepoURL($url) {
|
||||
if (validate_url($url) && strrpos(parse_url($url, PHP_URL_PATH), '.')) {
|
||||
|
4
app/wiki.apd
Normal file
4
app/wiki.apd
Normal file
@ -0,0 +1,4 @@
|
||||
url: $baseurl/wiki/$nick
|
||||
requires: local_channel
|
||||
name: Wiki
|
||||
photo: $baseurl/app/wiki.png
|
BIN
app/wiki.png
Normal file
BIN
app/wiki.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
1
boot.php
1
boot.php
@ -514,6 +514,7 @@ define ( 'ACTIVITY_OBJ_ALBUM', NAMESPACE_ACTIVITY_SCHEMA . 'photo-album' );
|
||||
define ( 'ACTIVITY_OBJ_EVENT', NAMESPACE_ACTIVITY_SCHEMA . 'event' );
|
||||
define ( 'ACTIVITY_OBJ_GROUP', NAMESPACE_ACTIVITY_SCHEMA . 'group' );
|
||||
define ( 'ACTIVITY_OBJ_GAME', NAMESPACE_ACTIVITY_SCHEMA . 'game' );
|
||||
define ( 'ACTIVITY_OBJ_WIKI', NAMESPACE_ACTIVITY_SCHEMA . 'wiki' );
|
||||
define ( 'ACTIVITY_OBJ_TAGTERM', NAMESPACE_ZOT . '/activity/tagterm' );
|
||||
define ( 'ACTIVITY_OBJ_PROFILE', NAMESPACE_ZOT . '/activity/profile' );
|
||||
define ( 'ACTIVITY_OBJ_THING', NAMESPACE_ZOT . '/activity/thing' );
|
||||
|
@ -1,16 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>$Projectname Doxygen API Documentation</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>$Projectname Doxygen API Documentation not rendered</h1>
|
||||
|
||||
To get the Doxygen API Documentation you must render it with the program <a href="http://www.doxygen.org">Doxygen</a> (included in most distributions).
|
||||
<pre>
|
||||
$ doxygen util/Doxyfile
|
||||
</pre>
|
||||
<br>
|
||||
<a href="javascript:history.back()">back</a>
|
||||
</body>
|
||||
</html>
|
@ -856,6 +856,78 @@ function widget_chatroom_members() {
|
||||
return $o;
|
||||
}
|
||||
|
||||
function widget_wiki_list($arr) {
|
||||
|
||||
require_once("include/wiki.php");
|
||||
$channel = null;
|
||||
if (argc() < 2 && local_channel()) {
|
||||
// This should not occur because /wiki should redirect to /wiki/channel ...
|
||||
$channel = \App::get_channel();
|
||||
} else {
|
||||
$channel = get_channel_by_nick(argv(1)); // Channel being viewed by observer
|
||||
}
|
||||
if (!$channel) {
|
||||
return '';
|
||||
}
|
||||
$wikis = wiki_list($channel, get_observer_hash());
|
||||
if ($wikis) {
|
||||
return replace_macros(get_markup_template('wikilist.tpl'), array(
|
||||
'$header' => t('Wiki List'),
|
||||
'$channel' => $channel['channel_address'],
|
||||
'$wikis' => $wikis['wikis'],
|
||||
// If the observer is the local channel owner, show the wiki controls
|
||||
'$showControls' => ((local_channel() === intval($channel['channel_id'])) ? true : false)
|
||||
));
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function widget_wiki_pages($arr) {
|
||||
|
||||
require_once("include/wiki.php");
|
||||
$channelname = ((array_key_exists('channel',$arr)) ? $arr['channel'] : '');
|
||||
$wikiname = '';
|
||||
if (array_key_exists('refresh', $arr)) {
|
||||
$not_refresh = (($arr['refresh']=== true) ? false : true);
|
||||
} else {
|
||||
$not_refresh = true;
|
||||
}
|
||||
$pages = array();
|
||||
if (!array_key_exists('resource_id', $arr)) {
|
||||
$hide = true;
|
||||
} else {
|
||||
$p = wiki_page_list($arr['resource_id']);
|
||||
if ($p['pages']) {
|
||||
$pages = $p['pages'];
|
||||
$w = $p['wiki'];
|
||||
// Wiki item record is $w['wiki']
|
||||
$wikiname = $w['urlName'];
|
||||
if (!$wikiname) {
|
||||
$wikiname = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
return replace_macros(get_markup_template('wiki_page_list.tpl'), array(
|
||||
'$hide' => $hide,
|
||||
'$not_refresh' => $not_refresh,
|
||||
'$header' => t('Wiki Pages'),
|
||||
'$channel' => $channelname,
|
||||
'$wikiname' => $wikiname,
|
||||
'$pages' => $pages
|
||||
));
|
||||
}
|
||||
|
||||
function widget_wiki_page_history($arr) {
|
||||
require_once("include/wiki.php");
|
||||
$pageUrlName = ((array_key_exists('pageUrlName', $arr)) ? $arr['pageUrlName'] : '');
|
||||
$resource_id = ((array_key_exists('resource_id', $arr)) ? $arr['resource_id'] : '');
|
||||
$pageHistory = wiki_page_history(array('resource_id' => $resource_id, 'pageUrlName' => $pageUrlName));
|
||||
|
||||
return replace_macros(get_markup_template('wiki_page_history.tpl'), array(
|
||||
'$pageHistory' => $pageHistory['history']
|
||||
));
|
||||
}
|
||||
|
||||
function widget_bookmarkedchats($arr) {
|
||||
|
||||
if(! feature_enabled(App::$profile['profile_uid'],'ajaxchat'))
|
||||
|
399
include/wiki.php
Normal file
399
include/wiki.php
Normal file
@ -0,0 +1,399 @@
|
||||
<?php
|
||||
/**
|
||||
* @file include/wiki.php
|
||||
* @brief Wiki related functions.
|
||||
*/
|
||||
|
||||
use \Zotlabs\Storage\GitRepo as GitRepo;
|
||||
define ( 'WIKI_ITEM_RESOURCE_TYPE', 'wiki' );
|
||||
|
||||
function wiki_list($channel, $observer_hash) {
|
||||
$sql_extra = item_permissions_sql($channel['channel_id'], $observer_hash);
|
||||
$wikis = q("SELECT * FROM item WHERE resource_type = '%s' AND mid = parent_mid AND uid = %d AND item_deleted = 0 $sql_extra",
|
||||
dbesc(WIKI_ITEM_RESOURCE_TYPE),
|
||||
intval($channel['channel_id'])
|
||||
);
|
||||
foreach($wikis as &$w) {
|
||||
$w['rawName'] = get_iconfig($w, 'wiki', 'rawName');
|
||||
$w['htmlName'] = get_iconfig($w, 'wiki', 'htmlName');
|
||||
$w['urlName'] = get_iconfig($w, 'wiki', 'urlName');
|
||||
$w['path'] = get_iconfig($w, 'wiki', 'path');
|
||||
}
|
||||
// TODO: query db for wikis the observer can access. Return with two lists, for read and write access
|
||||
return array('wikis' => $wikis);
|
||||
}
|
||||
|
||||
function wiki_page_list($resource_id) {
|
||||
// TODO: Create item table records for pages so that metadata like title can be applied
|
||||
$w = wiki_get_wiki($resource_id);
|
||||
if (!$w['path']) {
|
||||
return array('pages' => null, 'wiki' => null);
|
||||
}
|
||||
$pages = array();
|
||||
if (is_dir($w['path']) === true) {
|
||||
$files = array_diff(scandir($w['path']), array('.', '..', '.git'));
|
||||
// TODO: Check that the files are all text files
|
||||
|
||||
foreach($files as $file) {
|
||||
// strip the .md file extension and unwrap URL encoding to leave HTML encoded name
|
||||
$pages[] = array('title' => urldecode(substr($file, 0, -3)), 'url' => urlencode(substr($file, 0, -3)));
|
||||
}
|
||||
}
|
||||
|
||||
return array('pages' => $pages, 'wiki' => $w);
|
||||
}
|
||||
|
||||
function wiki_init_wiki($channel, $wiki) {
|
||||
// Store the path as a relative path, but pass absolute path to mkdir
|
||||
$path = 'store/[data]/git/'.$channel['channel_address'].'/wiki/'.$wiki['urlName'];
|
||||
if (!os_mkdir(__DIR__ . '/../' . $path, 0770, true)) {
|
||||
logger('Error creating wiki path: ' . $path);
|
||||
return null;
|
||||
}
|
||||
// Create GitRepo object
|
||||
$git = new GitRepo($channel['channel_address'], null, false, $name, __DIR__ . '/../' . $path);
|
||||
if(!$git->initRepo()) {
|
||||
logger('Error creating new git repo in ' . $git->path);
|
||||
return null;
|
||||
}
|
||||
|
||||
return array('path' => $path);
|
||||
}
|
||||
|
||||
function wiki_create_wiki($channel, $observer_hash, $wiki, $acl) {
|
||||
$wikiinit = wiki_init_wiki($channel, $wiki);
|
||||
if (!$wikiinit['path']) {
|
||||
notice('Error creating wiki');
|
||||
return array('item' => null, 'success' => false);
|
||||
}
|
||||
$path = $wikiinit['path'];
|
||||
// Generate unique resource_id using the same method as item_message_id()
|
||||
do {
|
||||
$dups = false;
|
||||
$resource_id = random_string();
|
||||
$r = q("SELECT mid FROM item WHERE resource_id = '%s' AND resource_type = '%s' AND uid = %d LIMIT 1",
|
||||
dbesc($resource_id),
|
||||
dbesc(WIKI_ITEM_RESOURCE_TYPE),
|
||||
intval($channel['channel_id'])
|
||||
);
|
||||
if (count($r))
|
||||
$dups = true;
|
||||
} while ($dups == true);
|
||||
$ac = $acl->get();
|
||||
$mid = item_message_id();
|
||||
$arr = array(); // Initialize the array of parameters for the post
|
||||
$item_hidden = 0; // TODO: Allow form creator to send post to ACL about new game automatically
|
||||
$wiki_url = z_root() . '/wiki/' . $channel['channel_address'] . '/' . $wiki['urlName'];
|
||||
$arr['aid'] = $channel['channel_account_id'];
|
||||
$arr['uid'] = $channel['channel_id'];
|
||||
$arr['mid'] = $mid;
|
||||
$arr['parent_mid'] = $mid;
|
||||
$arr['item_hidden'] = $item_hidden;
|
||||
$arr['resource_type'] = WIKI_ITEM_RESOURCE_TYPE;
|
||||
$arr['resource_id'] = $resource_id;
|
||||
$arr['owner_xchan'] = $channel['channel_hash'];
|
||||
$arr['author_xchan'] = $observer_hash;
|
||||
$arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $arr['mid'];
|
||||
$arr['llink'] = $arr['plink'];
|
||||
$arr['title'] = $wiki['htmlName']; // name of new wiki;
|
||||
$arr['allow_cid'] = $ac['allow_cid'];
|
||||
$arr['allow_gid'] = $ac['allow_gid'];
|
||||
$arr['deny_cid'] = $ac['deny_cid'];
|
||||
$arr['deny_gid'] = $ac['deny_gid'];
|
||||
$arr['item_wall'] = 1;
|
||||
$arr['item_origin'] = 1;
|
||||
$arr['item_thread_top'] = 1;
|
||||
$arr['item_private'] = intval($acl->is_private());
|
||||
$arr['verb'] = ACTIVITY_CREATE;
|
||||
$arr['obj_type'] = ACTIVITY_OBJ_WIKI;
|
||||
$arr['body'] = '[table][tr][td][h1]New Wiki[/h1][/td][/tr][tr][td][zrl=' . $wiki_url . ']' . $wiki['htmlName'] . '[/zrl][/td][/tr][/table]';
|
||||
// Save the path using iconfig. The file path should not be shared with other hubs
|
||||
if (!set_iconfig($arr, 'wiki', 'path', $path, false)) {
|
||||
return array('item' => null, 'success' => false);
|
||||
}
|
||||
// Save the wiki name information using iconfig. This is shareable.
|
||||
if (!set_iconfig($arr, 'wiki', 'rawName', $wiki['rawName'], true)) {
|
||||
return array('item' => null, 'success' => false);
|
||||
}
|
||||
if (!set_iconfig($arr, 'wiki', 'htmlName', $wiki['htmlName'], true)) {
|
||||
return array('item' => null, 'success' => false);
|
||||
}
|
||||
if (!set_iconfig($arr, 'wiki', 'urlName', $wiki['urlName'], true)) {
|
||||
return array('item' => null, 'success' => false);
|
||||
}
|
||||
$post = item_store($arr);
|
||||
$item_id = $post['item_id'];
|
||||
|
||||
if ($item_id) {
|
||||
proc_run('php', "include/notifier.php", "activity", $item_id);
|
||||
return array('item' => $arr, 'success' => true);
|
||||
} else {
|
||||
return array('item' => null, 'success' => false);
|
||||
}
|
||||
}
|
||||
|
||||
function wiki_delete_wiki($resource_id) {
|
||||
|
||||
$w = wiki_get_wiki($resource_id);
|
||||
$item = $w['wiki'];
|
||||
if (!$item || !$w['path']) {
|
||||
return array('item' => null, 'success' => false);
|
||||
} else {
|
||||
$drop = drop_item($item['id'], false, DROPITEM_NORMAL, true);
|
||||
$pathdel = rrmdir($w['path']);
|
||||
if ($pathdel) {
|
||||
info('Wiki files deleted successfully');
|
||||
}
|
||||
return array('item' => $item, 'success' => (($drop === 1 && $pathdel) ? true : false));
|
||||
}
|
||||
}
|
||||
|
||||
function wiki_get_wiki($resource_id) {
|
||||
$item = q("SELECT * FROM item WHERE resource_type = '%s' AND resource_id = '%s' AND item_deleted = 0 limit 1",
|
||||
dbesc(WIKI_ITEM_RESOURCE_TYPE),
|
||||
dbesc($resource_id)
|
||||
);
|
||||
if (!$item) {
|
||||
return array('wiki' => null, 'path' => null);
|
||||
} else {
|
||||
$w = $item[0]; // wiki item table record
|
||||
// Get wiki metadata
|
||||
$rawName = get_iconfig($w, 'wiki', 'rawName');
|
||||
$htmlName = get_iconfig($w, 'wiki', 'htmlName');
|
||||
$urlName = get_iconfig($w, 'wiki', 'urlName');
|
||||
$path = get_iconfig($w, 'wiki', 'path');
|
||||
if (!realpath(__DIR__ . '/../' . $path)) {
|
||||
return array('wiki' => null, 'path' => null);
|
||||
}
|
||||
// Path to wiki exists
|
||||
$abs_path = realpath(__DIR__ . '/../' . $path);
|
||||
return array( 'wiki' => $w,
|
||||
'path' => $abs_path,
|
||||
'rawName' => $rawName,
|
||||
'htmlName' => $htmlName,
|
||||
'urlName' => $urlName
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function wiki_exists_by_name($uid, $urlName) {
|
||||
$item = q("SELECT id,resource_id FROM item WHERE resource_type = '%s' AND title = '%s' AND uid = '%s' AND item_deleted = 0 limit 1",
|
||||
dbesc(WIKI_ITEM_RESOURCE_TYPE),
|
||||
dbesc(escape_tags(urldecode($urlName))),
|
||||
dbesc($uid)
|
||||
);
|
||||
if (!$item) {
|
||||
return array('id' => null, 'resource_id' => null);
|
||||
} else {
|
||||
return array('id' => $item[0]['id'], 'resource_id' => $item[0]['resource_id']);
|
||||
}
|
||||
}
|
||||
|
||||
function wiki_get_permissions($resource_id, $owner_id, $observer_hash) {
|
||||
// TODO: For now, only the owner can edit
|
||||
$sql_extra = item_permissions_sql($owner_id, $observer_hash);
|
||||
$r = q("SELECT * FROM item WHERE resource_type = '%s' AND resource_id = '%s' $sql_extra LIMIT 1",
|
||||
dbesc(WIKI_ITEM_RESOURCE_TYPE),
|
||||
dbesc($resource_id)
|
||||
);
|
||||
|
||||
if (!$r) {
|
||||
return array('read' => false, 'write' => false, 'success' => true);
|
||||
} else {
|
||||
$perms = get_all_perms($owner_id, $observer_hash);
|
||||
// TODO: Create a new permission setting for wiki analogous to webpages. Until
|
||||
// then, use webpage permissions
|
||||
if (!$perms['write_pages']) {
|
||||
$write = false;
|
||||
} else {
|
||||
$write = true;
|
||||
}
|
||||
return array('read' => true, 'write' => $write, 'success' => true);
|
||||
}
|
||||
}
|
||||
|
||||
function wiki_create_page($name, $resource_id) {
|
||||
$w = wiki_get_wiki($resource_id);
|
||||
if (!$w['path']) {
|
||||
return array('page' => null, 'wiki' => null, 'message' => 'Wiki not found.', 'success' => false);
|
||||
}
|
||||
$page = array('rawName' => $name, 'htmlName' => escape_tags($name), 'urlName' => urlencode(escape_tags($name)), 'fileName' => urlencode(escape_tags($name)).'.md');
|
||||
$page_path = $w['path'] . '/' . $page['fileName'];
|
||||
if (is_file($page_path)) {
|
||||
return array('page' => null, 'wiki' => null, 'message' => 'Page already exists.', 'success' => false);
|
||||
}
|
||||
// Create the page file in the wiki repo
|
||||
if(!touch($page_path)) {
|
||||
return array('page' => null, 'wiki' => null, 'message' => 'Page file cannot be created.', 'success' => false);
|
||||
} else {
|
||||
return array('page' => $page, 'wiki' => $w, 'message' => '', 'success' => true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function wiki_get_page_content($arr) {
|
||||
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
|
||||
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
|
||||
$w = wiki_get_wiki($resource_id);
|
||||
if (!$w['path']) {
|
||||
return array('content' => null, 'message' => 'Error reading wiki', 'success' => false);
|
||||
}
|
||||
$page_path = $w['path'].'/'.$pageUrlName.'.md';
|
||||
if (is_readable($page_path) === true) {
|
||||
if(filesize($page_path) === 0) {
|
||||
$content = '';
|
||||
} else {
|
||||
$content = file_get_contents($page_path);
|
||||
if(!$content) {
|
||||
return array('content' => null, 'message' => 'Error reading page content', 'success' => false);
|
||||
}
|
||||
}
|
||||
// TODO: Check that the files are all text files
|
||||
return array('content' => json_encode($content), 'message' => '', 'success' => true);
|
||||
}
|
||||
}
|
||||
|
||||
function wiki_page_history($arr) {
|
||||
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
|
||||
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
|
||||
$w = wiki_get_wiki($resource_id);
|
||||
if (!$w['path']) {
|
||||
return array('history' => null, 'message' => 'Error reading wiki', 'success' => false);
|
||||
}
|
||||
$page_path = $w['path'].'/'.$pageUrlName.'.md';
|
||||
if (!is_readable($page_path) === true) {
|
||||
return array('history' => null, 'message' => 'Cannot read wiki page: ' . $page_path, 'success' => false);
|
||||
}
|
||||
$reponame = ((array_key_exists('title', $w['wiki'])) ? $w['wiki']['title'] : 'repo');
|
||||
if($reponame === '') {
|
||||
$reponame = 'repo';
|
||||
}
|
||||
$git = new GitRepo('', null, false, $w['wiki']['title'], $w['path']);
|
||||
try {
|
||||
$gitlog = $git->git->log('', $page_path , array('limit' => 500));
|
||||
return array('history' => $gitlog, 'message' => '', 'success' => true);
|
||||
} catch (\PHPGit\Exception\GitException $e) {
|
||||
return array('history' => null, 'message' => 'GitRepo error thrown', 'success' => false);
|
||||
}
|
||||
}
|
||||
|
||||
function wiki_save_page($arr) {
|
||||
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
|
||||
$content = ((array_key_exists('content',$arr)) ? $arr['content'] : '');
|
||||
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
|
||||
$w = wiki_get_wiki($resource_id);
|
||||
if (!$w['path']) {
|
||||
return array('message' => 'Error reading wiki', 'success' => false);
|
||||
}
|
||||
$page_path = $w['path'].'/'.$pageUrlName.'.md';
|
||||
if (is_writable($page_path) === true) {
|
||||
if(!file_put_contents($page_path, $content)) {
|
||||
return array('message' => 'Error writing to page file', 'success' => false);
|
||||
}
|
||||
return array('message' => '', 'success' => true);
|
||||
} else {
|
||||
return array('message' => 'Page file not writable', 'success' => false);
|
||||
}
|
||||
}
|
||||
|
||||
function wiki_delete_page($arr) {
|
||||
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
|
||||
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
|
||||
$w = wiki_get_wiki($resource_id);
|
||||
if (!$w['path']) {
|
||||
return array('message' => 'Error reading wiki', 'success' => false);
|
||||
}
|
||||
$page_path = $w['path'].'/'.$pageUrlName.'.md';
|
||||
if (is_writable($page_path) === true) {
|
||||
if(!unlink($page_path)) {
|
||||
return array('message' => 'Error deleting page file', 'success' => false);
|
||||
}
|
||||
return array('message' => '', 'success' => true);
|
||||
} else {
|
||||
return array('message' => 'Page file not writable', 'success' => false);
|
||||
}
|
||||
}
|
||||
|
||||
function wiki_revert_page($arr) {
|
||||
$pageUrlName = ((array_key_exists('pageUrlName',$arr)) ? $arr['pageUrlName'] : '');
|
||||
$resource_id = ((array_key_exists('resource_id',$arr)) ? $arr['resource_id'] : '');
|
||||
$commitHash = ((array_key_exists('commitHash',$arr)) ? $arr['commitHash'] : null);
|
||||
if (! $commitHash) {
|
||||
return array('content' => $content, 'message' => 'No commit has provided', 'success' => false);
|
||||
}
|
||||
$w = wiki_get_wiki($resource_id);
|
||||
if (!$w['path']) {
|
||||
return array('content' => $content, 'message' => 'Error reading wiki', 'success' => false);
|
||||
}
|
||||
$page_path = $w['path'].'/'.$pageUrlName.'.md';
|
||||
if (is_writable($page_path) === true) {
|
||||
|
||||
$reponame = ((array_key_exists('title', $w['wiki'])) ? urlencode($w['wiki']['title']) : 'repo');
|
||||
if($reponame === '') {
|
||||
$reponame = 'repo';
|
||||
}
|
||||
$git = new GitRepo($observer['xchan_addr'], null, false, $w['wiki']['title'], $w['path']);
|
||||
$content = null;
|
||||
try {
|
||||
$git->setIdentity($observer['xchan_name'], $observer['xchan_addr']);
|
||||
foreach ($git->git->tree($commitHash) as $object) {
|
||||
if ($object['type'] == 'blob' && $object['file'] === $pageUrlName.'.md' ) {
|
||||
$content = $git->git->cat->blob($object['hash']);
|
||||
}
|
||||
}
|
||||
} catch (\PHPGit\Exception\GitException $e) {
|
||||
json_return_and_die(array('content' => $content, 'message' => 'GitRepo error thrown', 'success' => false));
|
||||
}
|
||||
return array('content' => $content, 'message' => '', 'success' => true);
|
||||
} else {
|
||||
return array('content' => $content, 'message' => 'Page file not writable', 'success' => false);
|
||||
}
|
||||
}
|
||||
|
||||
function wiki_git_commit($arr) {
|
||||
$files = ((array_key_exists('files', $arr)) ? $arr['files'] : null);
|
||||
$commit_msg = ((array_key_exists('commit_msg', $arr)) ? $arr['commit_msg'] : 'Repo updated');
|
||||
$resource_id = ((array_key_exists('resource_id', $arr)) ? $arr['resource_id'] : json_return_and_die(array('message' => 'Wiki resource_id required for git commit', 'success' => false)));
|
||||
$observer = ((array_key_exists('observer', $arr)) ? $arr['observer'] : json_return_and_die(array('message' => 'Observer required for git commit', 'success' => false)));
|
||||
$w = wiki_get_wiki($resource_id);
|
||||
if (!$w['path']) {
|
||||
return array('message' => 'Error reading wiki', 'success' => false);
|
||||
}
|
||||
$reponame = ((array_key_exists('title', $w['wiki'])) ? urlencode($w['wiki']['title']) : 'repo');
|
||||
if($reponame === '') {
|
||||
$reponame = 'repo';
|
||||
}
|
||||
$git = new GitRepo($observer['xchan_addr'], null, false, $w['wiki']['title'], $w['path']);
|
||||
try {
|
||||
$git->setIdentity($observer['xchan_name'], $observer['xchan_addr']);
|
||||
if ($files === null) {
|
||||
$options = array('all' => true); // git commit option to include all changes
|
||||
} else {
|
||||
$options = array(); // git commit options
|
||||
foreach ($files as $file) {
|
||||
if (!$git->git->add($file)) { // add specified files to the git repo stage
|
||||
if (!$git->git->reset->hard()) {
|
||||
json_return_and_die(array('message' => 'Error adding file to git stage: ' . $file . '. Error resetting git repo.', 'success' => false));
|
||||
}
|
||||
json_return_and_die(array('message' => 'Error adding file to git stage: ' . $file, 'success' => false));
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($git->commit($commit_msg, $options)) {
|
||||
json_return_and_die(array('message' => 'Wiki repo commit succeeded', 'success' => true));
|
||||
} else {
|
||||
json_return_and_die(array('message' => 'Wiki repo commit failed', 'success' => false));
|
||||
}
|
||||
} catch (\PHPGit\Exception\GitException $e) {
|
||||
json_return_and_die(array('message' => 'GitRepo error thrown', 'success' => false));
|
||||
}
|
||||
}
|
||||
|
||||
function wiki_generate_page_filename($name) {
|
||||
$file = urlencode(escape_tags($name));
|
||||
if( $file === '') {
|
||||
return null;
|
||||
} else {
|
||||
return $file . '.md';
|
||||
}
|
||||
}
|
11
library/ace/ace.js
Normal file
11
library/ace/ace.js
Normal file
File diff suppressed because one or more lines are too long
5
library/ace/ext-beautify.js
Normal file
5
library/ace/ext-beautify.js
Normal file
@ -0,0 +1,5 @@
|
||||
ace.define("ace/ext/beautify/php_rules",["require","exports","module","ace/token_iterator"],function(e,t,n){"use strict";var r=e("ace/token_iterator").TokenIterator;t.newLines=[{type:"support.php_tag",value:"<?php"},{type:"support.php_tag",value:"<?"},{type:"support.php_tag",value:"?>"},{type:"paren.lparen",value:"{",indent:!0},{type:"paren.rparen",breakBefore:!0,value:"}",indent:!1},{type:"paren.rparen",breakBefore:!0,value:"})",indent:!1,dontBreak:!0},{type:"comment"},{type:"text",value:";"},{type:"text",value:":",context:"php"},{type:"keyword",value:"case",indent:!0,dontBreak:!0},{type:"keyword",value:"default",indent:!0,dontBreak:!0},{type:"keyword",value:"break",indent:!1,dontBreak:!0},{type:"punctuation.doctype.end",value:">"},{type:"meta.tag.punctuation.end",value:">"},{type:"meta.tag.punctuation.begin",value:"<",blockTag:!0,indent:!0,dontBreak:!0},{type:"meta.tag.punctuation.begin",value:"</",indent:!1,breakBefore:!0,dontBreak:!0},{type:"punctuation.operator",value:";"}],t.spaces=[{type:"xml-pe",prepend:!0},{type:"entity.other.attribute-name",prepend:!0},{type:"storage.type",value:"var",append:!0},{type:"storage.type",value:"function",append:!0},{type:"keyword.operator",value:"="},{type:"keyword",value:"as",prepend:!0,append:!0},{type:"keyword",value:"function",append:!0},{type:"support.function",next:/[^\(]/,append:!0},{type:"keyword",value:"or",append:!0,prepend:!0},{type:"keyword",value:"and",append:!0,prepend:!0},{type:"keyword",value:"case",append:!0},{type:"keyword.operator",value:"||",append:!0,prepend:!0},{type:"keyword.operator",value:"&&",append:!0,prepend:!0}],t.singleTags=["!doctype","area","base","br","hr","input","img","link","meta"],t.transform=function(e,n,r){var i=e.getCurrentToken(),s=t.newLines,o=t.spaces,u=t.singleTags,a="",f=0,l=!1,c,h,p={},d,v={},m=!1,g="";while(i!==null){console.log(i);if(!i){i=e.stepForward();continue}i.type=="support.php_tag"&&i.value!="?>"?r="php":i.type=="support.php_tag"&&i.value=="?>"?r="html":i.type=="meta.tag.name.style"&&r!="css"?r="css":i.type=="meta.tag.name.style"&&r=="css"?r="html":i.type=="meta.tag.name.script"&&r!="js"?r="js":i.type=="meta.tag.name.script"&&r=="js"&&(r="html"),v=e.stepForward(),v&&v.type.indexOf("meta.tag.name")==0&&(d=v.value),p.type=="support.php_tag"&&p.value=="<?="&&(l=!0),i.type=="meta.tag.name"&&(i.value=i.value.toLowerCase()),i.type=="text"&&(i.value=i.value.trim());if(!i.value){i=v;continue}g=i.value;for(var y in o)i.type==o[y].type&&(!o[y].value||i.value==o[y].value)&&v&&(!o[y].next||o[y].next.test(v.value))&&(o[y].prepend&&(g=" "+i.value),o[y].append&&(g+=" "));i.type.indexOf("meta.tag.name")==0&&(c=i.value),m=!1;for(y in s)if(i.type==s[y].type&&(!s[y].value||i.value==s[y].value)&&(!s[y].blockTag||u.indexOf(d)===-1)&&(!s[y].context||s[y].context===r)){s[y].indent===!1&&f--;if(s[y].breakBefore&&(!s[y].prev||s[y].prev.test(p.value))){a+="\n",m=!0;for(y=0;y<f;y++)a+=" "}break}if(l===!1)for(y in s)if(p.type==s[y].type&&(!s[y].value||p.value==s[y].value)&&(!s[y].blockTag||u.indexOf(c)===-1)&&(!s[y].context||s[y].context===r)){s[y].indent===!0&&f++;if(!s[y].dontBreak&&!m){a+="\n";for(y=0;y<f;y++)a+=" "}break}a+=g,p.type=="support.php_tag"&&p.value=="?>"&&(l=!1),h=c,p=i,i=v;if(i===null)break}return a}}),ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator","ace/ext/beautify/php_rules"],function(e,t,n){"use strict";var r=e("ace/token_iterator").TokenIterator,i=e("./beautify/php_rules").transform;t.beautify=function(e){var t=new r(e,0,0),n=t.getCurrentToken(),s=e.$modeId.split("/").pop(),o=i(t,s);e.doc.setValue(o)},t.commands=[{name:"beautify",exec:function(e){t.beautify(e.session)},bindKey:"Ctrl-Shift-B"}]});
|
||||
(function() {
|
||||
ace.require(["ace/ext/beautify"], function() {});
|
||||
})();
|
||||
|
5
library/ace/ext-chromevox.js
Normal file
5
library/ace/ext-chromevox.js
Normal file
File diff suppressed because one or more lines are too long
5
library/ace/ext-elastic_tabstops_lite.js
Normal file
5
library/ace/ext-elastic_tabstops_lite.js
Normal file
@ -0,0 +1,5 @@
|
||||
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() {});
|
||||
})();
|
||||
|
5
library/ace/ext-emmet.js
Normal file
5
library/ace/ext-emmet.js
Normal file
File diff suppressed because one or more lines are too long
5
library/ace/ext-error_marker.js
Normal file
5
library/ace/ext-error_marker.js
Normal file
@ -0,0 +1,5 @@
|
||||
;
|
||||
(function() {
|
||||
ace.require(["ace/ext/error_marker"], function() {});
|
||||
})();
|
||||
|
5
library/ace/ext-keybinding_menu.js
Normal file
5
library/ace/ext-keybinding_menu.js
Normal file
@ -0,0 +1,5 @@
|
||||
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);-webkit-transition: all 0.5s;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: 1000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}";r.importCssString(i),n.exports.overlayPage=function(t,n,i,s,o,u){function l(e){e.keyCode===27&&a.click()}i=i?"top: "+i+";":"",o=o?"bottom: "+o+";":"",s=s?"right: "+s+";":"",u=u?"left: "+u+";":"";var a=document.createElement("div"),f=document.createElement("div");a.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; background-color: rgba(0, 0, 0, 0.3);",a.addEventListener("click",function(){document.removeEventListener("keydown",l),a.parentNode.removeChild(a),t.focus(),a=null}),document.addEventListener("keydown",l),f.style.cssText=i+s+o+u,f.addEventListener("click",function(e){e.stopPropagation()});var c=r.createElement("div");c.style.position="relative";var h=r.createElement("div");h.className="ace_closeButton",h.addEventListener("click",function(){a.click()}),c.appendChild(h),f.appendChild(c),f.appendChild(n),a.appendChild(f),document.body.appendChild(a),t.blur()}}),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,"0","0","0",null)}}var r=e("ace/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() {});
|
||||
})();
|
||||
|
5
library/ace/ext-language_tools.js
Normal file
5
library/ace/ext-language_tools.js
Normal file
File diff suppressed because one or more lines are too long
5
library/ace/ext-linking.js
Normal file
5
library/ace/ext-linking.js
Normal file
@ -0,0 +1,5 @@
|
||||
ace.define("ace/ext/linking",["require","exports","module","ace/editor","ace/config"],function(e,t,n){function i(e){var t=e.editor,n=e.getAccelKey();if(n){var t=e.editor,r=e.getDocumentPosition(),i=t.session,s=i.getTokenAt(r.row,r.column);t._emit("linkHover",{position:r,token:s})}}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("ace/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}})});
|
||||
(function() {
|
||||
ace.require(["ace/ext/linking"], function() {});
|
||||
})();
|
||||
|
5
library/ace/ext-modelist.js
Normal file
5
library/ace/ext-modelist.js
Normal file
@ -0,0 +1,5 @@
|
||||
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"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],AsciiDoc:["asciidoc|adoc"],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"],CSharp:["cs"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dockerfile:["^Dockerfile"],Dot:["dot"],Dummy:["dummy"],DummySyntax:["dummy"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Forth:["frt|fs|ldr"],Fortran:["f|f90"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],haXe:["hx"],HTML:["html|htm|xhtml"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Jack:["jack"],Jade:["jade"],Java:["java"],JavaScript:["js|jsm|jsx"],JSON:["json"],JSONiq:["jq"],JSP:["jsp"],JSX:["jsx"],Julia:["jl"],LaTeX:["tex|latex|ltx|bib"],Lean:["lean|hlean"],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"],MEL:["mel"],MUSHCode:["mc|mush"],MySQL:["mysql"],Nix:["nix"],NSIS:["nsi|nsh"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],pgSQL:["pgsql"],PHP:["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],Python:["py"],R:["r"],Razor:["cshtml"],RDoc:["Rd"],RHTML:["Rhtml"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala"],Scheme:["scm|sm|rkt|oak|scheme"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Smarty:["smarty|tpl"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],Twig:["twig|swig"],Typescript:["ts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Django:["html"]},u={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker"},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() {});
|
||||
})();
|
||||
|
5
library/ace/ext-old_ie.js
Normal file
5
library/ace/ext-old_ie.js
Normal file
File diff suppressed because one or more lines are too long
5
library/ace/ext-searchbox.js
Normal file
5
library/ace/ext-searchbox.js
Normal file
File diff suppressed because one or more lines are too long
5
library/ace/ext-settings_menu.js
Normal file
5
library/ace/ext-settings_menu.js
Normal file
File diff suppressed because one or more lines are too long
5
library/ace/ext-spellcheck.js
Normal file
5
library/ace/ext-spellcheck.js
Normal file
@ -0,0 +1,5 @@
|
||||
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="",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){console.log(e,a,n.selectionStart,n.selectionEnd);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() {});
|
||||
})();
|
||||
|
5
library/ace/ext-split.js
Normal file
5
library/ace/ext-split.js
Normal file
@ -0,0 +1,5 @@
|
||||
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";function l(e,t){this.$u=e,this.$doc=t}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();if(n){var r=new l(n,t);t.setUndoManager(r)}return t.$informUndoManager=i.delayedCall(function(){t.$deltas=[]}),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),function(){this.execute=function(e){this.$u.execute(e)},this.undo=function(){var e=this.$u.undo(!0);e&&this.$doc.selection.setSelectionRange(e)},this.redo=function(){var e=this.$u.redo(!0);e&&this.$doc.selection.setSelectionRange(e)},this.reset=function(){this.$u.reset()},this.hasUndo=function(){return this.$u.hasUndo()},this.hasRedo=function(){return this.$u.hasRedo()}}.call(l.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() {});
|
||||
})();
|
||||
|
5
library/ace/ext-static_highlight.js
Normal file
5
library/ace/ext-static_highlight.js
Normal file
@ -0,0 +1,5 @@
|
||||
ace.define("ace/ext/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/config","ace/lib/dom"],function(e,t,n){"use strict";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;}.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=function(){this.config={}};a.prototype=i.prototype;var f=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 l=0;for(var c=0;c<e.childNodes.length;c++){var h=e.childNodes[c];h.nodeType==3?(l+=h.data.length,o+=h.data):a.push(l,h)}}else o=u.getInnerText(e),t.trim&&(o=o.trim());f.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()})};f.render=function(e,t,n,i,s,u){function h(){var r=f.renderSync(e,t,n,i,s);return u?u(r):r}var a=1,l=r.prototype.$modes;typeof n=="string"&&(a++,o.loadModule(["theme",n],function(e){n=e,--a||h()}));var c;return t&&typeof t=="object"&&!t.getTokenizer&&(c=t,t=c.path),typeof t=="string"&&(a++,o.loadModule(["mode",t],function(e){if(!l[t]||c)l[t]=new e.Mode(c);t=l[t],--a||h()})),--a||h()},f.renderSync=function(e,t,n,i,o){i=parseInt(i||1,10);var u=new r("");u.setUseWorker(!1),u.setMode(t);var f=new a;f.setSession(u),u.setValue(e);var l=[],c=u.getLength();for(var h=0;h<c;h++)l.push("<div class='ace_line'>"),o||l.push("<span class='ace_gutter ace_gutter-cell' unselectable='on'></span>"),f.$renderLine(l,h,!0,!1),l.push("\n</div>");var p="<div class='"+n.cssClass+"'>"+"<div class='ace_static_highlight"+(o?"":" ace_show_gutter")+"' style='counter-reset:ace_line "+(i-1)+"'>"+l.join("")+"</div>"+"</div>";return f.destroy(),{css:s+n.cssText,html:p,session:u}},n.exports=f,n.exports.highlight=f});
|
||||
(function() {
|
||||
ace.require(["ace/ext/static_highlight"], function() {});
|
||||
})();
|
||||
|
5
library/ace/ext-statusbar.js
Normal file
5
library/ace/ext-statusbar.js
Normal file
@ -0,0 +1,5 @@
|
||||
ace.define("ace/ext/statusbar",["require","exports","module","ace/lib/dom","ace/lib/lang"],function(e,t,n){"use strict";var r=e("ace/lib/dom"),i=e("ace/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() {});
|
||||
})();
|
||||
|
5
library/ace/ext-textarea.js
Normal file
5
library/ace/ext-textarea.js
Normal file
File diff suppressed because one or more lines are too long
5
library/ace/ext-themelist.js
Normal file
5
library/ace/ext-themelist.js
Normal file
@ -0,0 +1,5 @@
|
||||
ace.define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"],function(e,t,n){"use strict";e("ace/lib/fixoldbrowsers");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"],["Cobalt","cobalt","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"],["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() {});
|
||||
})();
|
||||
|
5
library/ace/ext-whitespace.js
Normal file
5
library/ace/ext-whitespace.js
Normal file
@ -0,0 +1,5 @@
|
||||
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?-1:0;for(var s=0,o=r.length;s<o;s++){var u=r[s],a=u.search(/\s+$/);a>i&&n.removeInLine(s,a,u.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",exec:function(e){t.detectIndentation(e.session)}},{name:"trimTrailingSpace",exec:function(e){t.trimTrailingSpace(e.session)}},{name:"convertIndentation",exec:function(e,n){var r=t.$parseArg(n);t.convertIndentation(e.session,r.ch,r.length)}},{name:"setIndentation",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() {});
|
||||
})();
|
||||
|
1
library/ace/keybinding-emacs.js
Normal file
1
library/ace/keybinding-emacs.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/keybinding-vim.js
Normal file
1
library/ace/keybinding-vim.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-abap.js
Normal file
1
library/ace/mode-abap.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-abc.js
Normal file
1
library/ace/mode-abc.js
Normal file
@ -0,0 +1 @@
|
||||
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};r.inherits(u,i),function(){this.$id="ace/mode/abc"}.call(u.prototype),t.Mode=u})
|
1
library/ace/mode-actionscript.js
Normal file
1
library/ace/mode-actionscript.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-ada.js
Normal file
1
library/ace/mode-ada.js
Normal file
@ -0,0 +1 @@
|
||||
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};r.inherits(u,i),function(){this.lineCommentStart="--",this.$id="ace/mode/ada"}.call(u.prototype),t.Mode=u})
|
1
library/ace/mode-apache_conf.js
Normal file
1
library/ace/mode-apache_conf.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-applescript.js
Normal file
1
library/ace/mode-applescript.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-asciidoc.js
Normal file
1
library/ace/mode-asciidoc.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-assembly_x86.js
Normal file
1
library/ace/mode-assembly_x86.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-autohotkey.js
Normal file
1
library/ace/mode-autohotkey.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-batchfile.js
Normal file
1
library/ace/mode-batchfile.js
Normal file
@ -0,0 +1 @@
|
||||
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};r.inherits(u,i),function(){this.lineCommentStart="::",this.blockComment="",this.$id="ace/mode/batchfile"}.call(u.prototype),t.Mode=u})
|
1
library/ace/mode-c9search.js
Normal file
1
library/ace/mode-c9search.js
Normal file
@ -0,0 +1 @@
|
||||
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("");if(r.length<3)return"text";var s,u,a,f=0,l=[{value:r[f++]+"'",type:"text"},{value:u=r[f++],type:"text"},{value:"'"+r[f++],type:"text"}];r[2]!==" in"&&(a=r[f],l.push({value:"'"+r[f++]+"'",type:"text"},{value:r[f++],type:"text"})),l.push({value:" "+r[f++]+" ",type:"text"}),r[f+1]?(s=r[f+1],l.push({value:"("+r[f+1]+")",type:"text"}),f+=1):f-=1;while(f++<r.length)r[f]&&l.push({value:r[f],type:"text"});a&&(u=a,s=""),u&&(/regex/.test(s)||(u=i.escapeRegExp(u)),/whole/.test(s)&&(u="\\b"+u+"\\b"));var c=u&&o("("+u+")",/ sensitive/.test(s)?"g":"ig");return c&&(n[0]=t,n[1]=c),l}},{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})
|
1
library/ace/mode-c_cpp.js
Normal file
1
library/ace/mode-c_cpp.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-cirru.js
Normal file
1
library/ace/mode-cirru.js
Normal file
@ -0,0 +1 @@
|
||||
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};r.inherits(u,i),function(){this.lineCommentStart="--",this.$id="ace/mode/cirru"}.call(u.prototype),t.Mode=u})
|
1
library/ace/mode-clojure.js
Normal file
1
library/ace/mode-clojure.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-cobol.js
Normal file
1
library/ace/mode-cobol.js
Normal file
@ -0,0 +1 @@
|
||||
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","ace/range"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./cobol_highlight_rules").CobolHighlightRules,o=e("../range").Range,u=function(){this.HighlightRules=s};r.inherits(u,i),function(){this.lineCommentStart="*",this.$id="ace/mode/cobol"}.call(u.prototype),t.Mode=u})
|
1
library/ace/mode-coffee.js
Normal file
1
library/ace/mode-coffee.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-coldfusion.js
Normal file
1
library/ace/mode-coldfusion.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-csharp.js
Normal file
1
library/ace/mode-csharp.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-css.js
Normal file
1
library/ace/mode-css.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-curly.js
Normal file
1
library/ace/mode-curly.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-d.js
Normal file
1
library/ace/mode-d.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-dart.js
Normal file
1
library/ace/mode-dart.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-diff.js
Normal file
1
library/ace/mode-diff.js
Normal file
@ -0,0 +1 @@
|
||||
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 s.fromPoints(i,{row:n-1,column: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","index","\\+{3}","@@|\\*{5}"],"i")};r.inherits(u,i),function(){this.$id="ace/mode/diff"}.call(u.prototype),t.Mode=u})
|
1
library/ace/mode-django.js
Normal file
1
library/ace/mode-django.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-dockerfile.js
Normal file
1
library/ace/mode-dockerfile.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-dot.js
Normal file
1
library/ace/mode-dot.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-eiffel.js
Normal file
1
library/ace/mode-eiffel.js
Normal file
@ -0,0 +1 @@
|
||||
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","ace/range"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./eiffel_highlight_rules").EiffelHighlightRules,o=e("../range").Range,u=function(){this.HighlightRules=s};r.inherits(u,i),function(){this.lineCommentStart="--",this.$id="ace/mode/eiffel"}.call(u.prototype),t.Mode=u})
|
1
library/ace/mode-ejs.js
Normal file
1
library/ace/mode-ejs.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-elixir.js
Normal file
1
library/ace/mode-elixir.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-elm.js
Normal file
1
library/ace/mode-elm.js
Normal file
@ -0,0 +1 @@
|
||||
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"}],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};r.inherits(u,i),function(){this.lineCommentStart="--",this.blockComment={start:"{-",end:"-}",nestable:!0},this.$id="ace/mode/elm"}.call(u.prototype),t.Mode=u})
|
1
library/ace/mode-erlang.js
Normal file
1
library/ace/mode-erlang.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-forth.js
Normal file
1
library/ace/mode-forth.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-fortran.js
Normal file
1
library/ace/mode-fortran.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-ftl.js
Normal file
1
library/ace/mode-ftl.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-gcode.js
Normal file
1
library/ace/mode-gcode.js
Normal file
@ -0,0 +1 @@
|
||||
ace.define("ace/mode/gcode_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="IF|DO|WHILE|ENDWHILE|CALL|ENDIF|SUB|ENDSUB|GOTO|REPEAT|ENDREPEAT|CALL",t="PI",n="ATAN|ABS|ACOS|ASIN|SIN|COS|EXP|FIX|FUP|ROUND|LN|TAN",r=this.createKeywordMapper({"support.function":n,keyword:e,"constant.language":t},"identifier",!0);this.$rules={start:[{token:"comment",regex:"\\(.*\\)"},{token:"comment",regex:"([N])([0-9]+)"},{token:"string",regex:"([G])([0-9]+\\.?[0-9]?)"},{token:"string",regex:"([M])([0-9]+\\.?[0-9]?)"},{token:"constant.numeric",regex:"([-+]?([0-9]*\\.?[0-9]+\\.?))|(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)"},{token:r,regex:"[A-Z]"},{token:"keyword.operator",regex:"EQ|LT|GT|NE|GE|LE|OR|XOR"},{token:"paren.lparen",regex:"[\\[]"},{token:"paren.rparen",regex:"[\\]]"},{token:"text",regex:"\\s+"}]}};r.inherits(s,i),t.GcodeHighlightRules=s}),ace.define("ace/mode/gcode",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gcode_highlight_rules","ace/range"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./gcode_highlight_rules").GcodeHighlightRules,o=e("../range").Range,u=function(){this.HighlightRules=s};r.inherits(u,i),function(){this.$id="ace/mode/gcode"}.call(u.prototype),t.Mode=u})
|
1
library/ace/mode-gherkin.js
Normal file
1
library/ace/mode-gherkin.js
Normal file
@ -0,0 +1 @@
|
||||
ace.define("ace/mode/gherkin_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s="\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})",o=function(){var e=[{name:"en",labels:"Feature|Background|Scenario(?: Outline)?|Examples",keywords:"Given|When|Then|And|But"}],t=e.map(function(e){return e.labels}).join("|"),n=e.map(function(e){return e.keywords}).join("|");this.$rules={start:[{token:"constant.numeric",regex:"(?:(?:[1-9]\\d*)|(?:0))"},{token:"comment",regex:"#.*$"},{token:"keyword",regex:"(?:"+t+"):|(?:"+n+")\\b"},{token:"keyword",regex:"\\*"},{token:"string",regex:'"{3}',next:"qqstring3"},{token:"string",regex:'"',next:"qqstring"},{token:"text",regex:"^\\s*(?=@[\\w])",next:[{token:"text",regex:"\\s+"},{token:"variable.parameter",regex:"@[\\w]+"},{token:"empty",regex:"",next:"start"}]},{token:"comment",regex:"<[^>]+>"},{token:"comment",regex:"\\|(?=.)",next:"table-item"},{token:"comment",regex:"\\|$",next:"start"}],qqstring3:[{token:"constant.language.escape",regex:s},{token:"string",regex:'"{3}',next:"start"},{defaultToken:"string"}],qqstring:[{token:"constant.language.escape",regex:s},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],"table-item":[{token:"comment",regex:/$/,next:"start"},{token:"comment",regex:/\|/},{token:"string",regex:/\\./},{defaultToken:"string"}]},this.normalizeRules()};r.inherits(o,i),t.GherkinHighlightRules=o}),ace.define("ace/mode/gherkin",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gherkin_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("./gherkin_highlight_rules").GherkinHighlightRules,o=function(){this.HighlightRules=s};r.inherits(o,i),function(){this.lineCommentStart="#",this.$id="ace/mode/gherkin",this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=" ",s=this.getTokenizer().getLineTokens(t,e),o=s.tokens;return console.log(e),t.match("[ ]*\\|")&&(r+="| "),o.length&&o[o.length-1].type=="comment"?r:(e=="start"&&(t.match("Scenario:|Feature:|Scenario Outline:|Background:")?r+=i:t.match("(Given|Then).+(:)$|Examples:")?r+=i:t.match("\\*.+")&&(r+="* ")),r)}}.call(o.prototype),t.Mode=o})
|
1
library/ace/mode-gitignore.js
Normal file
1
library/ace/mode-gitignore.js
Normal file
@ -0,0 +1 @@
|
||||
ace.define("ace/mode/gitignore_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",regex:/^\s*#.*$/},{token:"keyword",regex:/^\s*!.*$/}]},this.normalizeRules()};s.metaData={fileTypes:["gitignore"],name:"Gitignore"},r.inherits(s,i),t.GitignoreHighlightRules=s}),ace.define("ace/mode/gitignore",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/gitignore_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./gitignore_highlight_rules").GitignoreHighlightRules,o=function(){this.HighlightRules=s};r.inherits(o,i),function(){this.lineCommentStart="#",this.$id="ace/mode/gitignore"}.call(o.prototype),t.Mode=o})
|
1
library/ace/mode-glsl.js
Normal file
1
library/ace/mode-glsl.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-gobstones.js
Normal file
1
library/ace/mode-gobstones.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-golang.js
Normal file
1
library/ace/mode-golang.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-groovy.js
Normal file
1
library/ace/mode-groovy.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-haml.js
Normal file
1
library/ace/mode-haml.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-handlebars.js
Normal file
1
library/ace/mode-handlebars.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-haskell.js
Normal file
1
library/ace/mode-haskell.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-haxe.js
Normal file
1
library/ace/mode-haxe.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-html.js
Normal file
1
library/ace/mode-html.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-html_elixir.js
Normal file
1
library/ace/mode-html_elixir.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-html_ruby.js
Normal file
1
library/ace/mode-html_ruby.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-ini.js
Normal file
1
library/ace/mode-ini.js
Normal file
@ -0,0 +1 @@
|
||||
ace.define("ace/mode/ini_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="\\\\(?:[\\\\0abtrn;#=:]|x[a-fA-F\\d]{4})",o=function(){this.$rules={start:[{token:"punctuation.definition.comment.ini",regex:"#.*",push_:[{token:"comment.line.number-sign.ini",regex:"$|^",next:"pop"},{defaultToken:"comment.line.number-sign.ini"}]},{token:"punctuation.definition.comment.ini",regex:";.*",push_:[{token:"comment.line.semicolon.ini",regex:"$|^",next:"pop"},{defaultToken:"comment.line.semicolon.ini"}]},{token:["keyword.other.definition.ini","text","punctuation.separator.key-value.ini"],regex:"\\b([a-zA-Z0-9_.-]+)\\b(\\s*)(=)"},{token:["punctuation.definition.entity.ini","constant.section.group-title.ini","punctuation.definition.entity.ini"],regex:"^(\\[)(.*?)(\\])"},{token:"punctuation.definition.string.begin.ini",regex:"'",push:[{token:"punctuation.definition.string.end.ini",regex:"'",next:"pop"},{token:"constant.language.escape",regex:s},{defaultToken:"string.quoted.single.ini"}]},{token:"punctuation.definition.string.begin.ini",regex:'"',push:[{token:"constant.language.escape",regex:s},{token:"punctuation.definition.string.end.ini",regex:'"',next:"pop"},{defaultToken:"string.quoted.double.ini"}]}]},this.normalizeRules()};o.metaData={fileTypes:["ini","conf"],keyEquivalent:"^~I",name:"Ini",scopeName:"source.ini"},r.inherits(o,i),t.IniHighlightRules=o}),ace.define("ace/mode/folding/ini",["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*\[([^\])]*)]\s*(?:$|[;#])/,this.getFoldWidgetRange=function(e,t,n){var r=this.foldingStartMarker,s=e.getLine(n),o=s.match(r);if(!o)return;var u=o[1]+".",a=s.length,f=e.getLength(),l=n,c=n;while(++n<f){s=e.getLine(n);if(/^\s*$/.test(s))continue;o=s.match(r);if(o&&o[1].lastIndexOf(u,0)!==0)break;c=n}if(c>l){var h=e.getLine(c).length;return new i(l,a,c,h)}}}.call(o.prototype)}),ace.define("ace/mode/ini",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ini_highlight_rules","ace/mode/folding/ini"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./ini_highlight_rules").IniHighlightRules,o=e("./folding/ini").FoldMode,u=function(){this.HighlightRules=s,this.foldingRules=new o};r.inherits(u,i),function(){this.lineCommentStart=";",this.blockComment=null,this.$id="ace/mode/ini"}.call(u.prototype),t.Mode=u})
|
1
library/ace/mode-io.js
Normal file
1
library/ace/mode-io.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-jack.js
Normal file
1
library/ace/mode-jack.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-jade.js
Normal file
1
library/ace/mode-jade.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-java.js
Normal file
1
library/ace/mode-java.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-javascript.js
Normal file
1
library/ace/mode-javascript.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-json.js
Normal file
1
library/ace/mode-json.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-jsoniq.js
Normal file
1
library/ace/mode-jsoniq.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-jsp.js
Normal file
1
library/ace/mode-jsp.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-jsx.js
Normal file
1
library/ace/mode-jsx.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-julia.js
Normal file
1
library/ace/mode-julia.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-latex.js
Normal file
1
library/ace/mode-latex.js
Normal file
@ -0,0 +1 @@
|
||||
ace.define("ace/mode/latex_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",regex:"%.*$"},{token:["keyword","lparen","variable.parameter","rparen","lparen","storage.type","rparen"],regex:"(\\\\(?:documentclass|usepackage|input))(?:(\\[)([^\\]]*)(\\]))?({)([^}]*)(})"},{token:["keyword","lparen","variable.parameter","rparen"],regex:"(\\\\(?:label|v?ref|cite(?:[^{]*)))(?:({)([^}]*)(}))?"},{token:["storage.type","lparen","variable.parameter","rparen"],regex:"(\\\\(?:begin|end))({)(\\w*)(})"},{token:"storage.type",regex:"\\\\[a-zA-Z]+"},{token:"lparen",regex:"[[({]"},{token:"rparen",regex:"[\\])}]"},{token:"constant.character.escape",regex:"\\\\[^a-zA-Z]?"},{token:"string",regex:"\\${1,2}",next:"equation"}],equation:[{token:"comment",regex:"%.*$"},{token:"string",regex:"\\${1,2}",next:"start"},{token:"constant.character.escape",regex:"\\\\(?:[^a-zA-Z]|[a-zA-Z]+)"},{token:"error",regex:"^\\s*$",next:"start"},{defaultToken:"string"}]}};r.inherits(s,i),t.LatexHighlightRules=s}),ace.define("ace/mode/folding/latex",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=e("../../token_iterator").TokenIterator,u=t.FoldMode=function(){};r.inherits(u,i),function(){this.foldingStartMarker=/^\s*\\(begin)|(section|subsection|paragraph)\b|{\s*$/,this.foldingStopMarker=/^\s*\\(end)\b|^\s*}/,this.getFoldWidgetRange=function(e,t,n){var r=e.doc.getLine(n),i=this.foldingStartMarker.exec(r);if(i)return i[1]?this.latexBlock(e,n,i[0].length-1):i[2]?this.latexSection(e,n,i[0].length-1):this.openingBracketBlock(e,"{",n,i.index);var i=this.foldingStopMarker.exec(r);if(i)return i[1]?this.latexBlock(e,n,i[0].length-1):this.closingBracketBlock(e,"}",n,i.index+i[0].length)},this.latexBlock=function(e,t,n){var r={"\\begin":1,"\\end":-1},i=new o(e,t,n),u=i.getCurrentToken();if(!u||u.type!="storage.type"&&u.type!="constant.character.escape")return;var a=u.value,f=r[a],l=function(){var e=i.stepForward(),t=e.type=="lparen"?i.stepForward().value:"";return f===-1&&(i.stepBackward(),t&&i.stepBackward()),t},c=[l()],h=f===-1?i.getCurrentTokenColumn():e.getLine(t).length,p=t;i.step=f===-1?i.stepBackward:i.stepForward;while(u=i.step()){if(!u||u.type!="storage.type"&&u.type!="constant.character.escape")continue;var d=r[u.value];if(!d)continue;var v=l();if(d===f)c.unshift(v);else if(c.shift()!==v||!c.length)break}if(c.length)return;var t=i.getCurrentTokenRow();return f===-1?new s(t,e.getLine(t).length,p,h):(i.stepBackward(),new s(p,h,t,i.getCurrentTokenColumn()))},this.latexSection=function(e,t,n){var r=["\\subsection","\\section","\\begin","\\end","\\paragraph"],i=new o(e,t,n),u=i.getCurrentToken();if(!u||u.type!="storage.type")return;var a=r.indexOf(u.value),f=0,l=t;while(u=i.stepForward()){if(u.type!=="storage.type")continue;var c=r.indexOf(u.value);if(c>=2){f||(l=i.getCurrentTokenRow()-1),f+=c==2?1:-1;if(f<0)break}else if(c>=a)break}f||(l=i.getCurrentTokenRow()-1);while(l>t&&!/\S/.test(e.getLine(l)))l--;return new s(t,e.getLine(t).length,l,e.getLine(l).length)}}.call(u.prototype)}),ace.define("ace/mode/latex",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/latex_highlight_rules","ace/mode/folding/latex","ace/range"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./latex_highlight_rules").LatexHighlightRules,o=e("./folding/latex").FoldMode,u=e("../range").Range,a=function(){this.HighlightRules=s,this.foldingRules=new o};r.inherits(a,i),function(){this.type="text",this.lineCommentStart="%",this.$id="ace/mode/latex"}.call(a.prototype),t.Mode=a})
|
1
library/ace/mode-lean.js
Normal file
1
library/ace/mode-lean.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-less.js
Normal file
1
library/ace/mode-less.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-liquid.js
Normal file
1
library/ace/mode-liquid.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-lisp.js
Normal file
1
library/ace/mode-lisp.js
Normal file
@ -0,0 +1 @@
|
||||
ace.define("ace/mode/lisp_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="case|do|let|loop|if|else|when",t="eq|neq|and|or",n="null|nil",r="cons|car|cdr|cond|lambda|format|setq|setf|quote|eval|append|list|listp|memberp|t|load|progn",i=this.createKeywordMapper({"keyword.control":e,"keyword.operator":t,"constant.language":n,"support.function":r},"identifier",!0);this.$rules={start:[{token:"comment",regex:";.*$"},{token:["storage.type.function-type.lisp","text","entity.name.function.lisp"],regex:"(?:\\b(?:(defun|defmethod|defmacro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)"},{token:["punctuation.definition.constant.character.lisp","constant.character.lisp"],regex:"(#)((?:\\w|[\\\\+-=<>'\"&#])+)"},{token:["punctuation.definition.variable.lisp","variable.other.global.lisp","punctuation.definition.variable.lisp"],regex:"(\\*)(\\S*)(\\*)"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"},{token:i,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"string",regex:'"(?=.)',next:"qqstring"}],qqstring:[{token:"constant.character.escape.lisp",regex:"\\\\."},{token:"string",regex:'[^"\\\\]+'},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"start"}]}};r.inherits(s,i),t.LispHighlightRules=s}),ace.define("ace/mode/lisp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lisp_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./lisp_highlight_rules").LispHighlightRules,o=function(){this.HighlightRules=s};r.inherits(o,i),function(){this.lineCommentStart=";",this.$id="ace/mode/lisp"}.call(o.prototype),t.Mode=o})
|
1
library/ace/mode-live_script.js
Normal file
1
library/ace/mode-live_script.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-livescript.js
Normal file
1
library/ace/mode-livescript.js
Normal file
@ -0,0 +1 @@
|
||||
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/livescript",["require","exports","module","ace/tokenizer","ace/mode/matching_brace_outdent","ace/mode/text"],function(e,t,n){function u(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,typeof t.extended=="function"&&t.extended(e),e}function a(e,t){var n={}.hasOwnProperty;for(var r in t)n.call(t,r)&&(e[r]=t[r]);return e}var r,i,s,o;r="(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*",t.Mode=i=function(t){function o(){var t;this.$tokenizer=new(e("../tokenizer").Tokenizer)(o.Rules);if(t=e("../mode/matching_brace_outdent"))this.$outdent=new t.MatchingBraceOutdent;this.$id="ace/mode/livescript"}var n,i=u((a(o,t).displayName="LiveScriptMode",o),t).prototype,s=o;return n=RegExp("(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*"+r+")?))\\s*$"),i.getNextLineIndent=function(e,t,r){var i,s;return i=this.$getIndent(t),s=this.$tokenizer.getLineTokens(t,e).tokens,(!s.length||s[s.length-1].type!=="comment")&&e==="start"&&n.test(t)&&(i+=r),i},i.lineCommentStart="#",i.blockComment={start:"###",end:"###"},i.checkOutdent=function(e,t,n){var r;return(r=this.$outdent)!=null?r.checkOutdent(t,n):void 8},i.autoOutdent=function(e,t,n){var r;return(r=this.$outdent)!=null?r.autoOutdent(t,n):void 8},o}(e("../mode/text").Mode),s="(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))",o={defaultToken:"string"},i.Rules={start:[{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)"+s},{token:"constant.language",regex:"(?:true|false|yes|no|on|off|null|void|undefined)"+s},{token:"invalid.illegal",regex:"(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)"+s},{token:"language.support.class",regex:"(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)"+s},{token:"language.support.function",regex:"(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)"+s},{token:"variable.language",regex:"(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)"+s},{token:"identifier",regex:r+"\\s*:(?![:=])"},{token:"variable",regex:r},{token:"keyword.operator",regex:"(?:\\.{3}|\\s+\\?)"},{token:"keyword.variable",regex:"(?:@+|::|\\.\\.)",next:"key"},{token:"keyword.operator",regex:"\\.\\s*",next:"key"},{token:"string",regex:"\\\\\\S[^\\s,;)}\\]]*"},{token:"string.doc",regex:"'''",next:"qdoc"},{token:"string.doc",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string",regex:"<\\[",next:"words"},{token:"string.regex",regex:"//",next:"heregex"},{token:"comment.doc",regex:"/\\*",next:"comment"},{token:"comment",regex:"#.*"},{token:"string.regex",regex:"\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}",next:"key"},{token:"constant.numeric",regex:"(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)"},{token:"lparen",regex:"[({[]"},{token:"rparen",regex:"[)}\\]]",next:"key"},{token:"keyword.operator",regex:"[\\^!|&%+\\-]+"},{token:"text",regex:"\\s+"}],heregex:[{token:"string.regex",regex:".*?//[gimy$?]{0,4}",next:"start"},{token:"string.regex",regex:"\\s*#{"},{token:"comment.regex",regex:"\\s+(?:#.*)?"},{defaultToken:"string.regex"}],key:[{token:"keyword.operator",regex:"[.?@!]+"},{token:"identifier",regex:r,next:"start"},{token:"text",regex:"",next:"start"}],comment:[{token:"comment.doc",regex:".*?\\*/",next:"start"},{defaultToken:"comment.doc"}],qdoc:[{token:"string",regex:".*?'''",next:"key"},o],qqdoc:[{token:"string",regex:'.*?"""',next:"key"},o],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"key"},o],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"key"},o],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"key"},o],words:[{token:"string",regex:".*?\\]>",next:"key"},o]}})
|
1
library/ace/mode-logiql.js
Normal file
1
library/ace/mode-logiql.js
Normal file
File diff suppressed because one or more lines are too long
1
library/ace/mode-lsl.js
Normal file
1
library/ace/mode-lsl.js
Normal file
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