diff --git a/LICENSE b/LICENSE
index 511d5a2..2d37336 100644
--- a/LICENSE
+++ b/LICENSE
@@ -199,4 +199,3 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-
diff --git a/README.md b/README.md
index 68e9c12..3b982db 100644
--- a/README.md
+++ b/README.md
@@ -1,319 +1,6 @@
-# PictShare
-**[Live Demo](https://www.pictshare.net)**
-PictShare is a multi lingual, open source image hosting service with a simple resizing and upload API that you can host yourself.
-
----
-[](https://github.com/chrisiaut/pictshare/blob/master/LICENSE)
-
-
-
-
-Table of contents
-=================
-* [Installation](#installation)
- * [Docker](#docker)
- * [On nginx](#on-nginx)
- * [Docker Compose With Prebuild Image by hascheksolutions](#docker-compose-with-prebuild-image-by-hascheksolutions)
-* [Why would I want to host my own images?](#why-would-i-want-to-host-my-own-images)
-* [Features](#features)
-* [Smart query system](#smart-query-system)
- * [Available options](#available-options)
-* [How does the external-upload-API work?](#how-does-the-external-upload-api-work)
- * [Upload from external URL](#upload-from-external-url)
- * [Example:](#example)
- * [Upload via POST](#upload-via-post)
- * [Upload from base64 string](#upload-from-base64-string)
-* [Restriction settings](#restriction-settings)
- * [UPLOAD_CODE](#upload_code)
- * [IMAGE_CHANGE_CODE](#image_change_code)
-* [Security and privacy](#security-and-privacy)
-* [Requirements](#requirements)
-* [Upgrading](#upgrading)
-* [Addons](#addons)
-* [Traffic analysis](#traffic-analysis)
-* [Coming soon](#coming-soon)
-
-
-## Installation
-
-### Docker
-The fastest way to deploy PictShare is via the [official Docker repo](https://hub.docker.com/r/hascheksolutions/pictshare/)
-- [Source code & more examples](https://github.com/HaschekSolutions/PictShare-Docker)
-
-```bash
-docker run -d -p 80:80 -e "TITLE=My own PictShare" hascheksolutions/pictshare
-```
-
-[](https://www.pictshare.net/8a1dec0973.mp4)
-
-### Docker Compose With Prebuild Image by hascheksolutions
-
-Run container by docker-compose:
-- First, install docker compose:
-[Docker official docs](https://docs.docker.com/compose/install/)
-- Pull docker-compose file:
-```bash
-wget https://raw.githubusercontent.com/chrisiaut/pictshare/master/docker-compose.yml
-```
-- Edit docker-compose file:
-```bash
-vi docker-compose.yml
-```
-- Run container by docker-compose:
-```bash
-docker-compose up
-```
-
-By using this compose file, you should know that:
-- Will make a directory "volumes" in the same directory where compose file is.
-- Change `AUTOUPDATE` to false from true by defalt.
-- And...it is highly recommended to build your own image.
-
-### Without Docker
-
-- Make sure you have PHP5 GD libraries installed: ```apt-get install php5-gd```
-- Unpack the [PictShare zip](https://github.com/chrisiaut/pictshare/archive/master.zip)
-- Rename /inc/example.config.inc.php to /inc/config.inc.php
-- ```chmod +x bin/ffmpeg``` if you want to be able to use mp4 uploads
- - The provided ffmpeg binary (bin/ffmpeg) is from [here](http://johnvansickle.com/ffmpeg/) and it's a 64bit linux executable. If you need a different one, load yours and overwrite the one provided
-- (optional) You can and should put a [nginx](https://www.nginx.com/) proxy before the Apache server. That thing is just insanely fast with static content like images.
-- (optional) To secure your traffic I'd highly recommend getting an [SSL Cert](https://letsencrypt.org/) for your server if you don't already have one.
-
-## Why would I want to host my own images?
-If you own a server (even a home server) you can host your own PictShare instance so you have full control over your content and can delete images hasslefree.
-
-If you're an **app developer** or **sysadmin** you can use it for a centralized image hosting. With the simple upload API you can upload images to your PictShare instance and get a nice short URL
-
-If you're a blogger like myself, you can use it as storage for your images so the images will still work even if you change blog providers or servers
-
-## Features
-- Uploads without logins or validation (that's a good thing, right?)
-- Simple API to upload any image from remote servers to your instance [via URL](#upload-from-url) and [via Base64](#upload-from-base64-string)
-- 100% file based - no database needed
-- Simple album functions with embedding support
-- Converts gif to (much smaller) MP4
-- MP4 resizing
-- PictShare removes all exif data so you can upload photos from your phone and all GPS tags and camera model info get wiped
-- Smart [resize, filter and rotation](#smart-query-system) features
-- Generate gradients by specifying only a size. eg: https://pictshare.net/800x200
-- Duplicates don't take up space. If the exact same images is uploaded twice, the second upload will link to the first
-- You can control who can upload images or use filters/resizes by defining an [upload-code](#restriction-settings)
-- You can set a code in your ```/inc/config.inc.php``` (MASTER_DELETE_CODE) that, if appended to any URL of an Image, will delete the image and all cached versions of it from the server
-- Detailed traffic and view statistics of your images via [Pictshare stats](https://github.com/chrisiaut/pictshare_stats)
-- For more configuration possibilities check out the ```/inc/example.config.inc.php``` file
-
-## Smart query system
-PictShare images can be changed after upload just by modifying the URL. It works like this:
-
-https://base.domain/<options>/<image>
-
-For example: https://pictshare.net/100x100/negative/b260e36b60.jpg will show you the uploaded Image ```b260e36b60.jpg``` but resize it to 100x100 pixels and apply the "negative" filter. The original image will stay untouched.
-
-### Available options
-Original URL: ```https://www.pictshare.net/b260e36b60.jpg```
-
-Note: If an option needs a value it works like this: ```optionname_value```. Eg: ```pixelate_10```
-If there is some option that's not recognized by PictShare it's simply ignored, so this will work: https://www.pictshare.net/pictshare-is-awesome/b260e36b60.jpg and also even this will work: https://www.pictshare.net/b260e36b60.jpg/how-can-this-still/work/
-
-
-| Option | Parameter | Example URL | Result |
-| ------------- | ------------------- | ---------------------- | ----------- |
-**Resizing** | | | |
-<width>**x**<height> | -none- | https://pictshare.net/20x20/b260e36b60.jpg |  |
-forcesize | -none- | https://pictshare.net/100x400/forcesize/b260e36b60.jpg |  |
-**Albums** | | | |
-just add multiple image hashes | -none- | https://www.pictshare.net/b260e36b60.jpg/32c9cf77c5.jpg/163484b6b1.jpg | Takes the **images** you put in the URL and makes an album out of them. All filters are supported!
-embed | -none- | https://www.pictshare.net/b260e36b60.jpg/32c9cf77c5.jpg/163484b6b1.jpg/embed | Renders the album without CSS and with transparent background so you can embed them easily
-responsive | -none- | https://www.pictshare.net/b260e36b60.jpg/32c9cf77c5.jpg/163484b6b1.jpg/responsive | Renders all images responsive (max-width 100%) according to screen size
-<width>**x**<height> | -none- | https://www.pictshare.net/b260e36b60.jpg/32c9cf77c5.jpg/163484b6b1.jpg/150x150 | Sets the size for the thumbnails in the album
-forcesize | -none- | https://www.pictshare.net/b260e36b60.jpg/32c9cf77c5.jpg/163484b6b1.jpg/100x300/forcesize | Forces thumbnail sizes to the values you provided
-**GIF to mp4** | | |
-mp4 | -none- | https://www.pictshare.net/mp4/102687fe65.gif | Converts gif to mp4 and displays as that. Note that you can't include that mp4 in an img tag
-raw | -none- | https://www.pictshare.net/mp4/raw/102687fe65.gif | Renders the converted mp4 directly. Use with /mp4/
-preview | -none- | https://www.pictshare.net/mp4/preview/102687fe65.gif | Renders the first frame of generated MP4 as JPEG. Use with /mp4/
-**MP4 options** | | |
--none- | -none- | https://www.pictshare.net/65714d22f0.mp4 | Renders the mp4 embedded in a simple HTML template. This link can't be embedded into video tags, use /raw/ instead if you want to embed
-raw | -none- | https://www.pictshare.net/raw/65714d22f0.mp4 | Renders the mp4 video directly so you can link it
-preview | -none- | https://www.pictshare.net/preview/65714d22f0.mp4 | Renders the first frame of the MP4 as an JPEG image
-**Rotating** | | |
-left | -none- | https://pictshare.net/left/b260e36b60.jpg | 
-right | -none- | https://pictshare.net/right/b260e36b60.jpg | 
-upside | -none- | https://pictshare.net/upside/b260e36b60.jpg | 
-**Filters** | | |
-negative | -none- | https://pictshare.net/negative/b260e36b60.jpg | 
-grayscale | -none- | https://pictshare.net/grayscale/b260e36b60.jpg | 
-brightness | -255 to 255 | https://pictshare.net/brightness_100/b260e36b60.jpg | 
-edgedetect | -none- | https://pictshare.net/edgedetect/b260e36b60.jpg | 
-smooth | -10 to 2048 | https://pictshare.net/smooth_3/b260e36b60.jpg | 
-contrast | -100 to 100 | https://pictshare.net/contrast_40/b260e36b60.jpg | 
-pixelate | 0 to 100 | https://pictshare.net/pixelate_10/b260e36b60.jpg | 
-blur | -none- or 0 to 5 | https://pictshare.net/blur/b260e36b60.jpg | 
-sepia | -none- | https://pictshare.net/sepia/b260e36b60.jpg | 
-sharpen | -none- | https://pictshare.net/sharpen/b260e36b60.jpg | 
-emboss | -none- | https://pictshare.net/emboss/b260e36b60.jpg | 
-cool | -none- | https://pictshare.net/cool/b260e36b60.jpg | 
-light | -none- | https://pictshare.net/light/b260e36b60.jpg | 
-aqua | -none- | https://pictshare.net/aqua/b260e36b60.jpg | 
-fuzzy | -none- | https://pictshare.net/fuzzy/b260e36b60.jpg | 
-boost | -none- | https://pictshare.net/boost/b260e36b60.jpg | 
-gray | -none- | https://pictshare.net/gray/b260e36b60.jpg | 
-
-You can also combine as many options as you want. Even multiple times! Want your image to be negative, resized, grayscale , with increased brightness and negate it again? No problem: https://pictshare.net/500x500/grayscale/negative/brightness_100/negative/b260e36b60.jpg
-
-## How does the external-upload-API work?
-
-### Upload from external URL
-PictShare has a simple REST API to upload remote pictures. The API can be accessed via the backend.php file like this:
-
-```https://pictshare.net/backend.php?getimage=```.
-
-#### Example:
-
-Request: ```https://pictshare.net/backend.php?getimage=https://www.0xf.at/css/imgs/logo.png```
-
-The server will answer with the file name and the server path in JSON:
-
-```json
-{"status":"OK","type":"png","hash":"10ba188162.png","url":"https:\/\/pictshare.net\/10ba188162.png"}
-```
-
-### Upload via POST
-
-Send a POST request to ```https://pictshare.net/backend.php``` and send the image in the variable ```postimage```.
-
-Server will return JSON of uploaded data like this:
-
-```json
-{"status":"OK","type":"png","hash":"2f18a052c4.png","url":"https:\/\/pictshare.net\/2f18a052c4.png","domain":"https:\/\/pictshare.net\/"}
-```
-
-### Upload from base64 string
-
-Just send a POST request to ```https://pictshare.net/backend.php``` and send your image in base64 as the variable name ```base64```
-
-Server will automatically try to guess the file type (which should work in 90% of the cases) and if it can't figure it out it'll just upload it as png.
-
-## Restriction settings
-In your ```config.inc.php``` there are two values to be set: ```UPLOAD_CODE``` and ```IMAGE_CHANGE_CODE```
-
-Both can be set to strings or multiple strings semi;colon;separated. If there is a semicolon in the string, any of the elements will work
-
-### UPLOAD_CODE
-If set, will show users a code field in the upload form. If it doesn't match your setting, files won't be uploaded.
-
-If enabled, the Upload API will need the variable ```upload_code``` via GET (eg: ```https://pictshare.net/backend.php?getimage=https://www.0xf.at/css/imgs/logo.png&upload_code=YourUploadCodeHere```)
-
-### IMAGE_CHANGE_CODE
-If set,the [options](#available-options) will only work if the URL got the code in it. You can provide the code as option ```changecode_YourChangeCode```
-
-For example: If enabled the image ```https://www.pictshare.net/negative/b260e36b60.jpg``` won't show the negative version but the original.
-If you access the image with the code like this: ```https://www.pictshare.net/changecode_YourChangeCode/b260e36b60.jpg``` it gets cached on the server so the next time someone requests the link without providing the change-code, they'll see the inverted image (because you just created it before by accessing the image with the code)
-
-## Security and privacy
-- By hosting your own images you can delete them any time you want
-- You can enable or disable upload logging. Don't want to know who uploaded stuff? Just change the setting in inc/config.inc.php
-- No exif data is stored on the server, all jpegs get cleaned on upload
-- You have full control over your data. PictShare doesn't need remote libaries or tracking crap
-
-## Scaling
-You can use **Backblaze Buckets** for storage of images so you can use multiple instances of PictShare and if the image is not found on the instance, it will look in the bucket.
-
-Just add your credentials to the config.inc.php file as described in the ```example.config.inc.php``` file.
-
-## Requirements
-- Apache or Nginx Webserver with PHP
-- PHP 5 GD library
-- A domain or sub-domain since PictShare can't be run from a subfolder of some other domain
-
-## nginx config
-This is a simple config file that should make PictShare work on nginx
-
-- Install php fpm: ```apt-get install php-fpm```
-- Install php Graphics libraries: ```apt-get install php-gd```
-
-```
-server {
- listen 80 default_server;
- server_name your.awesome.domain.name;
-
- root /var/www/pictshare; # or where ever you put it
- index index.php;
-
- location / {
- try_files $uri $uri/ /index.php?url=$request_uri; # instead of htaccess mod_rewrite
- }
-
- location ~ \.php {
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_index index.php;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param PATH_INFO $fastcgi_script_name;
- }
-
- location ~ /(upload|tmp|bin) {
- deny all;
- return 404;
- }
-
-}
-```
-
-## Apache config
-This is a simple vHost config that should make PictShare work on Apache2.
-
-- Install php5: ```apt-get install php5 libapache2-mod-php5```
-- Install php Graphics libraries: ```apt-get install php5-gd```
-- enable mod_rewrite
-
-```
-
- ServerAdmin webmaster@sub.domain.tld
- ServerName sub.domain.tld
- ServerAlias sub.domain.tld
- DocumentRoot /var/www/html
-
-
- Options Indexes FollowSymLinks MultiViews
- AllowOverride All
- Order allow,deny
- Allow from All
-
- ErrorLog ${APACHE_LOG_DIR}/error.log
- LogLevel warn
- CustomLog ${APACHE_LOG_DIR}/access.log combined
-
-```
-
-
-## Upgrading
-- Just re-download the [PictShare zip](https://github.com/chrisiaut/pictshare/archive/master.zip) file and extract and overwrite existing pictshare files. Uploads and config won't be affected.
-- Check if your ```/inc/config.inc.php``` file has all settings required by the ```/inc/example.config.inc.php``` since new options might get added in new versions
-
-Or use these commands:
-
-```bash
-# to be run from the directory where your pictshare directory sits in
-git clone https://github.com/chrisiaut/pictshare.git temp
-cp -r temp/* pictshare/.
-rm -rf temp
-```
-
-## Addons
-- Chrome Browser extension: https://chrome.google.com/webstore/detail/pictshare-1-click-imagesc/mgomffcdpnohakmlhhjmiemlolonpafc
- - Source: https://github.com/chrisiaut/PictShare-Chrome-extension
-- Plugin to upload images with ShareX: https://github.com/ShareX/CustomUploaders/blob/master/pictshare.net.sxcu
-
-## Traffic analysis
-See [Pictshare stats](https://github.com/chrisiaut/pictshare_stats)
-
-## Coming soon
-- Delete codes for every uploaded image so users can delete images if no longer needed
-- Albums
-
----
-Design (c) by [Bernhard Moser](mailto://bernhard.moser91@gmail.com)
-
-This is a [HASCHEK SOLUTIONS](https://haschek.solutions) project
-
-[](https://haschek.solutions)
+# PictShare
+**[Live Demo](https://www.pictshare.net)**
+PictShare is a selfhostable, open source image, video and text hosting as well as URL shortening service with a simple API.
+
+---
+[](https://github.com/HaschekSolutions/pictshare/blob/master/LICENSE)
\ No newline at end of file
diff --git a/api/upload.php b/api/upload.php
new file mode 100644
index 0000000..55427df
--- /dev/null
+++ b/api/upload.php
@@ -0,0 +1,48 @@
+getRegisteredExtensions()))
+ {
+ $answer = (new ImageController())->handleUpload($_FILES['file']['tmp_name']);
+ }
+ //or, a text
+ else if($type=='text')
+ {
+ $answer = (new TextController())->handleUpload($_FILES['file']['tmp_name']);
+ }
+ //or, a video
+ else if(in_array($type,(new VideoController)->getRegisteredExtensions()))
+ {
+ $answer = (new VideoController())->handleUpload($_FILES['file']['tmp_name']);
+ }
+
+ if(!$answer)
+ $answer = array('status'=>'err','reason'=>'Unknown error');
+
+ echo json_encode($answer);
+}
\ No newline at end of file
diff --git a/backend.php b/backend.php
deleted file mode 100644
index de2ebe6..0000000
--- a/backend.php
+++ /dev/null
@@ -1,54 +0,0 @@
-uploadCodeExists($_REQUEST['upload_code']))
- exit(json_encode(array('status'=>'ERR','reason'=>'Wrong upload code provided')));
-
-if($_REQUEST['getimage'])
-{
- $url = $_REQUEST['getimage'];
-
- echo json_encode($pm->uploadImageFromURL($url));
-}
-else if($_FILES['postimage'])
-{
- $image = $_FILES['postimage'];
- echo json_encode($pm->processSingleUpload($file,'postimage'));
-}
-else if($_REQUEST['base64'])
-{
- $data = $_REQUEST['base64'];
- $format = $_REQUEST['format'];
- echo json_encode($pm->uploadImageFromBase64($data,$format));
-}
-else if($_REQUEST['geturlinfo'])
- echo json_encode($pm->getURLInfo($_REQUEST['geturlinfo']));
-else if($_REQUEST['a']=='oembed')
- echo json_encode($pm->oembed($_REQUEST['url'],$_REQUEST['t']));
-else
- echo json_encode(array('status'=>'ERR','reason'=>'NO_VALID_COMMAND'));
diff --git a/bin/ffmpeg b/bin/ffmpeg
index c6bdf90..cc29f44 100755
Binary files a/bin/ffmpeg and b/bin/ffmpeg differ
diff --git a/bin/guetzli_linux_x86-64 b/bin/guetzli_linux_x86-64
deleted file mode 100644
index ee4c667..0000000
Binary files a/bin/guetzli_linux_x86-64 and /dev/null differ
diff --git a/classes/backblaze.php b/classes/backblaze.php
deleted file mode 100644
index a995e45..0000000
--- a/classes/backblaze.php
+++ /dev/null
@@ -1,280 +0,0 @@
-
- */
-
-class Backblaze
-{
- private $token;
- private $apiURL;
- private $bucket;
- private $dlURL;
- private $ulURL;
- private $ulToken;
- private $bucket_name;
- private $files;
-
- function __construct()
- {
- if( BACKBLAZE !== true || !defined('BACKBLAZE_ID') || !defined('BACKBLAZE_KEY') || !defined('BACKBLAZE_BUCKET_ID'))
- return;
- $this->authorize();
- $this->bucket = BACKBLAZE_BUCKET_ID;
- $this->bucket_name = (( defined('BACKBLAZE_BUCKET_NAME') && BACKBLAZE_BUCKET_NAME != "")?BACKBLAZE_BUCKET_NAME:$this->bucketIdToName($bucket));
- }
-
- function authorize()
- {
- $account_id = BACKBLAZE_ID; // Obtained from your B2 account page
- $application_key = BACKBLAZE_KEY; // Obtained from your B2 account page
- $credentials = base64_encode($account_id . ":" . $application_key);
- $url = "https://api.backblazeb2.com/b2api/v1/b2_authorize_account";
-
- $session = curl_init($url);
-
- // Add headers
- $headers = array();
- $headers[] = "Accept: application/json";
- $headers[] = "Authorization: Basic " . $credentials;
- curl_setopt($session, CURLOPT_HTTPHEADER, $headers); // Add headers
-
- curl_setopt($session, CURLOPT_HTTPGET, true); // HTTP GET
- curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Receive server response
- $server_output = curl_exec($session);
- curl_close ($session);
- $data = json_decode($server_output,true);
-
- $this->token = $data['authorizationToken'];
- $this->apiURL = $data['apiUrl'];
- $this->dlURL = $data['downloadUrl'];
- }
-
- function upload($hash)
- {
- if(!$this->ulURL)
- $this->getUploadInfo();
- $file_name = $hash;
- $my_file = ROOT.DS.'upload'.DS.$hash.DS.$hash;
- $handle = fopen($my_file, 'r');
- $read_file = fread($handle,filesize($my_file));
-
- $upload_url = $this->ulURL; // Provided by b2_get_upload_url
- $upload_auth_token = $this->ulToken; // Provided by b2_get_upload_url
- $bucket_id = $this->bucket; // The ID of the bucket
- $content_type = "text/plain";
- $sha1_of_file_data = sha1_file($my_file);
-
- $session = curl_init($upload_url);
-
- // Add read file as post field
- curl_setopt($session, CURLOPT_POSTFIELDS, $read_file);
-
- // Add headers
- $headers = array();
- $headers[] = "Authorization: " . $upload_auth_token;
- $headers[] = "X-Bz-File-Name: " . $file_name;
- $headers[] = "Content-Type: " . $content_type;
- $headers[] = "X-Bz-Content-Sha1: " . $sha1_of_file_data;
- curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
-
- curl_setopt($session, CURLOPT_POST, true); // HTTP POST
- curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Receive server response
- $server_output = curl_exec($session); // Let's do this!
- curl_close ($session); // Clean up
- //var_dump($server_output); // Tell me about the rabbits, George!
- }
-
- function getUploadInfo()
- {
- $api_url = $this->apiURL; // From b2_authorize_account call
- $auth_token = $this->token; // From b2_authorize_account call
- $bucket_id = $this->bucket; // The ID of the bucket you want to upload to
-
- $session = curl_init($api_url . "/b2api/v1/b2_get_upload_url");
-
- // Add post fields
- $data = array("bucketId" => $bucket_id);
- $post_fields = json_encode($data);
- curl_setopt($session, CURLOPT_POSTFIELDS, $post_fields);
-
- // Add headers
- $headers = array();
- $headers[] = "Authorization: " . $auth_token;
- curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
-
- curl_setopt($session, CURLOPT_POST, true); // HTTP POST
- curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Receive server response
- $server_output = curl_exec($session); // Let's do this!
- curl_close ($session); // Clean up
- $data = json_decode($server_output,true); // Tell me about the rabbits, George!
- $this->ulURL = $data['uploadUrl'];
- //var_dump("upload url at load: ".$data['uploadUrl']);
- $this->ulToken = $data['authorizationToken'];
-
- //var_dump($data);
- }
-
- function download($hash)
- {
- if(file_exists(ROOT.DS.'upload'.DS.$hash.DS.$hash)) return false;
- $download_url = $this->dlURL; // From b2_authorize_account call
- $bucket_name = $this->bucket_name; // The NAME of the bucket you want to download from
- $file_name = $hash; // The name of the file you want to download
- $auth_token = $this->token; // From b2_authorize_account call
- $uri = $download_url . "/file/" . $bucket_name . "/" . $file_name;
-
- $session = curl_init($uri);
-
- // Add headers
- $headers = array();
- $headers[] = "Authorization: " . $auth_token;
- curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
-
- curl_setopt($session, CURLOPT_HTTPGET, true); // HTTP POST
- curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Receive server response
- $server_output = curl_exec($session); // Let's do this!
- curl_close ($session); // Clean up
- $is_binary = preg_match('~[^\x20-\x7E\t\r\n]~', $server_output); // Tell me about the rabbits, George!
- if(!$is_binary) return false;
-
- mkdir(ROOT.DS.'upload'.DS.$hash);
- $file = ROOT.DS.'upload'.DS.$hash.DS.$hash;
-
- file_put_contents($file, $server_output);
- return true;
- }
-
- function bucketIdToName($bucket)
- {
- $api_url = $this->apiURL; // From b2_authorize_account call
- $auth_token = $this->token; // From b2_authorize_account call
- $account_id = BACKBLAZE_ID;
-
- $session = curl_init($api_url . "/b2api/v1/b2_list_buckets");
-
- // Add post fields
- $data = array("accountId" => $account_id);
- $post_fields = json_encode($data);
- curl_setopt($session, CURLOPT_POSTFIELDS, $post_fields);
-
- // Add headers
- $headers = array();
- $headers[] = "Authorization: " . $auth_token;
- curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
-
- curl_setopt($session, CURLOPT_POST, true); // HTTP POST
- curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Receive server response
- $server_output = curl_exec($session); // Let's do this!
- curl_close ($session); // Clean up
- $data = json_decode($server_output,true); // Tell me about the rabbits, George!
- if(is_array($data))
- foreach($data['buckets'] as $bucket)
- {
- if($bucket['bucketId']==$this->bucket) return $bucket['bucketName'];
- }
- return false;
- }
-
- function deleteFile($hash,$file_id=false)
- {
- $api_url = $this->apiURL; // From b2_authorize_account call
- $auth_token = $this->token; // From b2_authorize_account call
- $file_name = $hash; // The file name of the file you want to delete
- if(!$file_id)
- $file_id = $this->fileExistsInBucket($hash);
-
- $session = curl_init($api_url . "/b2api/v1/b2_delete_file_version");
-
- // Add post fields
- $data = array("fileId" => $file_id, "fileName" => $file_name);
- $post_fields = json_encode($data);
- curl_setopt($session, CURLOPT_POSTFIELDS, $post_fields);
-
- // Add headers
- $headers = array();
- $headers[] = "Authorization: " . $auth_token;
- curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
-
- curl_setopt($session, CURLOPT_POST, true); // HTTP POST
- curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Receive server response
- $server_output = curl_exec($session); // Let's do this!
- curl_close ($session); // Clean up
- }
-
- function fileExistsInBucket($hash)
- {
- $api_url = $this->apiURL; // From b2_authorize_account call
- $auth_token = $this->token; // From b2_authorize_account call
- $bucket_id = $this->bucket; // The ID of the bucket
-
- $session = curl_init($api_url . "/b2api/v1/b2_list_file_names");
-
- // Add post fields
- $data = array("bucketId" => $bucket_id,
- "startFileName" => $hash);
- $post_fields = json_encode($data);
- curl_setopt($session, CURLOPT_POSTFIELDS, $post_fields);
-
- // Add headers
- $headers = array();
- $headers[] = "Authorization: " . $auth_token;
- curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
-
- curl_setopt($session, CURLOPT_POST, true); // HTTP POST
- curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Receive server response
- $server_output = curl_exec($session); // Let's do this!
- curl_close ($session); // Clean up
- $data = json_decode($server_output,true);
-
- foreach($data['files'] as $file)
- {
- //it's either the first one or it doesn't exist
- if($file['fileName']==$hash)
- return $file['fileId'];
- else return false;
- }
-
- return false;
- }
-
- function getAllFilesInBucket($startFileName=null)
- {
- $api_url = $this->apiURL; // From b2_authorize_account call
- $auth_token = $this->token; // From b2_authorize_account call
- $bucket_id = $this->bucket; // The ID of the bucket
-
- $session = curl_init($api_url . "/b2api/v1/b2_list_file_names");
-
- // Add post fields
- $data = array("bucketId" => $bucket_id,
- "startFileName" => $startFileName);
- $post_fields = json_encode($data);
- curl_setopt($session, CURLOPT_POSTFIELDS, $post_fields);
-
- // Add headers
- $headers = array();
- $headers[] = "Authorization: " . $auth_token;
- curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
-
- curl_setopt($session, CURLOPT_POST, true); // HTTP POST
- curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Receive server response
- $server_output = curl_exec($session); // Let's do this!
- curl_close ($session); // Clean up
- $data = json_decode($server_output,true);
-
- foreach($data['files'] as $file)
- {
- $name = $file['fileName'];
- $id = $file['fileId'];
- $this->files[$name] = $id;
- }
-
- if($data['nextFileName'])
- $this->getAllFilesInBucket($data['nextFileName']);
-
- return $this->files;
- }
-}
\ No newline at end of file
diff --git a/classes/crypto.php b/classes/crypto.php
deleted file mode 100644
index 6efc0ca..0000000
--- a/classes/crypto.php
+++ /dev/null
@@ -1,24 +0,0 @@
-image = $image;
-
- $this->assetDirectory = dirname(dirname(dirname(__FILE__))) . '/assets/';
- }
-
- /**
- * Get the current image resource
- *
- * @return resource
- */
-
- public function getImage()
- {
- return $this->image;
- }
-
- public function bubbles()
- {
- $dest = imagecreatefromjpeg($this->assetDirectory . "pattern4.jpg");
-
- $x = imagesx($this->image);
- $y = imagesy($this->image);
-
- $x2 = imagesx($dest);
- $y2 = imagesy($dest);
-
- $thumb = imagecreatetruecolor($x, $y);
- imagecopyresampled($thumb, $dest, 0, 0, 0, 0, $x, $y, $x2, $y2);
-
- imagecopymerge($this->image, $thumb, 0, 0, 0, 0, $x, $y, 20);
- imagefilter($this->image, IMG_FILTER_BRIGHTNESS, 40);
- imagefilter($this->image, IMG_FILTER_CONTRAST, -10);
-
- return $this;
- }
-
- public function colorise()
- {
- $dest = imagecreatefromjpeg($this->assetDirectory . "pattern5.jpg");
-
- $x = imagesx($this->image);
- $y = imagesy($this->image);
-
- $x2 = imagesx($dest);
- $y2 = imagesy($dest);
-
- $thumb = imagecreatetruecolor($x, $y);
- imagecopyresampled($thumb, $dest, 0, 0, 0, 0, $x, $y, $x2, $y2);
-
- imagecopymerge($this->image, $thumb, 0, 0, 0, 0, $x, $y, 40);
- imagefilter($this->image, IMG_FILTER_CONTRAST, -25);
-
- return $this;
- }
-
- public function sepia()
- {
- imagefilter($this->image, IMG_FILTER_GRAYSCALE);
- imagefilter($this->image, IMG_FILTER_COLORIZE, 100, 50, 0);
-
- return $this;
- }
-
- public function sharpen()
- {
- $gaussian = array(
- array(1.0, 1.0, 1.0),
- array(1.0, -7.0, 1.0),
- array(1.0, 1.0, 1.0)
- );
- imageconvolution($this->image, $gaussian, 1, 4);
-
- return $this;
- }
-
- public function emboss()
- {
- $gaussian = array(
- array(-2.0, -1.0, 0.0),
- array(-1.0, 1.0, 1.0),
- array(0.0, 1.0, 2.0)
- );
-
- imageconvolution($this->image, $gaussian, 1, 5);
-
- return $this;
- }
-
- public function cool()
- {
- imagefilter($this->image, IMG_FILTER_MEAN_REMOVAL);
- imagefilter($this->image, IMG_FILTER_CONTRAST, -50);
-
- return $this;
- }
-
- public function old2()
- {
- $dest = imagecreatefromjpeg($this->assetDirectory . "pattern1.jpg");
-
- $x = imagesx($this->image);
- $y = imagesy($this->image);
-
- $x2 = imagesx($dest);
- $y2 = imagesy($dest);
-
- $thumb = imagecreatetruecolor($x, $y);
- imagecopyresampled($thumb, $dest, 0, 0, 0, 0, $x, $y, $x2, $y2);
-
- imagecopymerge($this->image, $thumb, 0, 0, 0, 0, $x, $y, 40);
-
- return $this;
- }
-
- public function old3()
- {
- imagefilter($this->image, IMG_FILTER_CONTRAST, -30);
-
- $dest = imagecreatefromjpeg($this->assetDirectory . "pattern3.jpg");
-
- $x = imagesx($this->image);
- $y = imagesy($this->image);
-
- $x2 = imagesx($dest);
- $y2 = imagesy($dest);
-
- $thumb = imagecreatetruecolor($x, $y);
- imagecopyresampled($thumb, $dest, 0, 0, 0, 0, $x, $y, $x2, $y2);
-
- imagecopymerge($this->image, $thumb, 0, 0, 0, 0, $x, $y, 50);
-
- return $this;
- }
-
- public function old()
- {
- $dest = imagecreatefromjpeg($this->assetDirectory . "bg1.jpg");
-
- $x = imagesx($this->image);
- $y = imagesy($this->image);
-
- $x2 = imagesx($dest);
- $y2 = imagesy($dest);
-
- $thumb = imagecreatetruecolor($x, $y);
- imagecopyresampled($thumb, $dest, 0, 0, 0, 0, $x, $y, $x2, $y2);
-
- imagecopymerge($this->image, $thumb, 0, 0, 0, 0, $x, $y, 30);
-
- return $this;
- }
-
- public function light()
- {
- imagefilter($this->image, IMG_FILTER_BRIGHTNESS, 10);
- imagefilter($this->image, IMG_FILTER_COLORIZE, 100, 50, 0, 10);
-
- return $this;
- }
-
- public function aqua()
- {
- imagefilter($this->image, IMG_FILTER_COLORIZE, 0, 70, 0, 30);
-
- return $this;
- }
-
- public function fuzzy()
- {
- $gaussian = array(
- array(1.0, 1.0, 1.0),
- array(1.0, 1.0, 1.0),
- array(1.0, 1.0, 1.0)
- );
-
- imageconvolution($this->image, $gaussian, 9, 20);
-
- return $this;
- }
-
- public function boost()
- {
- imagefilter($this->image, IMG_FILTER_CONTRAST, -35);
- imagefilter($this->image, IMG_FILTER_BRIGHTNESS, 10);
-
- return $this;
- }
-
- public function gray()
- {
- imagefilter($this->image, IMG_FILTER_CONTRAST, -60);
- imagefilter($this->image, IMG_FILTER_GRAYSCALE);
-
- return $this;
- }
-}
\ No newline at end of file
diff --git a/classes/html.php b/classes/html.php
deleted file mode 100644
index e2d7c13..0000000
--- a/classes/html.php
+++ /dev/null
@@ -1,40 +0,0 @@
-= pow(1024, 2) and $byte < pow(1024, 3)) {
- $result = round($byte/pow(1024, 2), 2).' MB';
- }elseif($byte >= pow(1024, 3) and $byte < pow(1024, 4)) {
- $result = round($byte/pow(1024, 3), 2).' GB';
- }elseif($byte >= pow(1024, 4) and $byte < pow(1024, 5)) {
- $result = round($byte/pow(1024, 4), 2).' TB';
- }elseif($byte >= pow(1024, 5) and $byte < pow(1024, 6)) {
- $result = round($byte/pow(1024, 5), 2).' PB';
- }elseif($byte >= pow(1024, 6) and $byte < pow(1024, 7)) {
- $result = round($byte/pow(1024, 6), 2).' EB';
- }
-
- return $result;
- }
-
-}
\ No newline at end of file
diff --git a/classes/image.php b/classes/image.php
deleted file mode 100644
index c612542..0000000
--- a/classes/image.php
+++ /dev/null
@@ -1,215 +0,0 @@
-sizeStringToWidthHeight($size);
- $maxwidth = $sd['width'];
- $maxheight = $sd['height'];
-
-
-
- $width = imagesx($img);
- $height = imagesy($img);
-
- $maxwidth = ($maxwidth>$width?$width:$maxwidth);
- $maxheight = ($maxheight>$height?$height:$maxheight);
-
-
- $dst_img = imagecreatetruecolor($maxwidth, $maxheight);
- $src_img = $img;
-
- $palsize = ImageColorsTotal($img);
- for ($i = 0; $i < $palsize; $i++)
- {
- $colors = ImageColorsForIndex($img, $i);
- ImageColorAllocate($dst_img, $colors['red'], $colors['green'], $colors['blue']);
- }
-
- imagefill($dst_img, 0, 0, IMG_COLOR_TRANSPARENT);
- imagesavealpha($dst_img,true);
- imagealphablending($dst_img, true);
-
- $width_new = $height * $maxwidth / $maxheight;
- $height_new = $width * $maxheight / $maxwidth;
- //if the new width is greater than the actual width of the image, then the height is too large and the rest cut off, or vice versa
- if($width_new > $width){
- //cut point by height
- $h_point = (($height - $height_new) / 2);
- //copy image
- imagecopyresampled($dst_img, $src_img, 0, 0, 0, $h_point, $maxwidth, $maxheight, $width, $height_new);
- }else{
- //cut point by width
- $w_point = (($width - $width_new) / 2);
- imagecopyresampled($dst_img, $src_img, 0, 0, $w_point, 0, $maxwidth, $maxheight, $width_new, $height);
- }
-
- $img = $dst_img;
- }
-
- /**
- * From: https://stackoverflow.com/questions/4590441/php-thumbnail-image-resizing-with-proportions
- */
- function resize(&$img,$size)
- {
- $pm = new PictshareModel();
-
- $sd = $pm->sizeStringToWidthHeight($size);
- $maxwidth = $sd['width'];
- $maxheight = $sd['height'];
-
- $width = imagesx($img);
- $height = imagesy($img);
-
- if(!ALLOW_BLOATING)
- {
- if($maxwidth>$width)$maxwidth = $width;
- if($maxheight>$height)$maxheight = $height;
- }
-
- if ($height > $width)
- {
- $ratio = $maxheight / $height;
- $newheight = $maxheight;
- $newwidth = $width * $ratio;
- }
- else
- {
- $ratio = $maxwidth / $width;
- $newwidth = $maxwidth;
- $newheight = $height * $ratio;
- }
-
- $newimg = imagecreatetruecolor($newwidth,$newheight);
-
- $palsize = ImageColorsTotal($img);
- for ($i = 0; $i < $palsize; $i++)
- {
- $colors = ImageColorsForIndex($img, $i);
- ImageColorAllocate($newimg, $colors['red'], $colors['green'], $colors['blue']);
- }
-
- imagefill($newimg, 0, 0, IMG_COLOR_TRANSPARENT);
- imagesavealpha($newimg,true);
- imagealphablending($newimg, true);
-
- imagecopyresampled($newimg, $img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
-
- $img = $newimg;
- }
-
- /**
- * Strong Blur
- *
- * @param resource $gdImageResource
- * @param int $blurFactor optional
- * This is the strength of the blur
- * 0 = no blur, 3 = default, anything over 5 is extremely blurred
- * @return GD image resource
- * @author Martijn Frazer, idea based on http://stackoverflow.com/a/20264482
- */
- function blur(&$gdImageResource, $blurFactor = 3)
- {
- if(!$blurFactor)
- $blurFactor = 3;
- if($blurFactor>6)
- $blurFactor = 6;
- else if($blurFactor<0)
- $blurFactor = 0;
- // blurFactor has to be an integer
- $blurFactor = round($blurFactor);
-
- $originalWidth = imagesx($gdImageResource);
- $originalHeight = imagesy($gdImageResource);
-
- $smallestWidth = ceil($originalWidth * pow(0.5, $blurFactor));
- $smallestHeight = ceil($originalHeight * pow(0.5, $blurFactor));
-
- // for the first run, the previous image is the original input
- $prevImage = $gdImageResource;
- $prevWidth = $originalWidth;
- $prevHeight = $originalHeight;
-
- // scale way down and gradually scale back up, blurring all the way
- for($i = 0; $i < $blurFactor; $i += 1)
- {
- // determine dimensions of next image
- $nextWidth = $smallestWidth * pow(2, $i);
- $nextHeight = $smallestHeight * pow(2, $i);
-
- // resize previous image to next size
- $nextImage = imagecreatetruecolor($nextWidth, $nextHeight);
- imagecopyresized($nextImage, $prevImage, 0, 0, 0, 0,
- $nextWidth, $nextHeight, $prevWidth, $prevHeight);
-
- // apply blur filter
- imagefilter($nextImage, IMG_FILTER_GAUSSIAN_BLUR);
-
- // now the new image becomes the previous image for the next step
- $prevImage = $nextImage;
- $prevWidth = $nextWidth;
- $prevHeight = $nextHeight;
- }
-
- // scale back to original size and blur one more time
- imagecopyresized($gdImageResource, $nextImage,
- 0, 0, 0, 0, $originalWidth, $originalHeight, $nextWidth, $nextHeight);
- imagefilter($gdImageResource, IMG_FILTER_GAUSSIAN_BLUR);
-
- // clean up
- imagedestroy($prevImage);
-
- // return result
- return $gdImageResource;
- }
-
- function filter(&$im,$vars)
- {
-
- foreach($vars as $var)
- {
- if(strpos($var,'_'))
- {
- $a = explode('_',$var);
- $var = $a[0];
- $val = $a[1];
- }
- switch($var)
- {
- case 'negative': imagefilter($im,IMG_FILTER_NEGATE); break;
- case 'grayscale': imagefilter($im,IMG_FILTER_GRAYSCALE); break;
- case 'brightness': imagefilter($im,IMG_FILTER_BRIGHTNESS,$val); break;
- case 'edgedetect': imagefilter($im,IMG_FILTER_EDGEDETECT); break;
- case 'smooth': imagefilter($im,IMG_FILTER_SMOOTH,$val); break;
- case 'contrast': imagefilter($im,IMG_FILTER_CONTRAST,$val); break;
- case 'pixelate': imagefilter($im,IMG_FILTER_PIXELATE,$val); break;
- case 'blur': $this->blur($im,$val); break;
- case 'sepia': (new Filter($im))->sepia()->getImage();break;
- case 'sharpen':(new Filter($im))->sharpen()->getImage();break;
- case 'emboss':(new Filter($im))->emboss()->getImage();break;
- case 'cool':(new Filter($im))->cool()->getImage();break;
- case 'light':(new Filter($im))->light()->getImage();break;
- case 'aqua':(new Filter($im))->aqua()->getImage();break;
- case 'fuzzy':(new Filter($im))->fuzzy()->getImage();break;
- case 'boost':(new Filter($im))->boost()->getImage();break;
- case 'gray':(new Filter($im))->gray()->getImage();break;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/classes/model.php b/classes/model.php
deleted file mode 100644
index 79a69be..0000000
--- a/classes/model.php
+++ /dev/null
@@ -1,23 +0,0 @@
-_model = substr(get_class($this),0,-5);
- $this->_table = strtolower($this->_model);
- $this->_id = $id;
- }
-
- function __destruct()
- {
-
- }
-}
diff --git a/cli.php b/cli.php
deleted file mode 100644
index 03cfb11..0000000
--- a/cli.php
+++ /dev/null
@@ -1,29 +0,0 @@
-backend($params);
\ No newline at end of file
diff --git a/controllers/image/image.controller.php b/controllers/image/image.controller.php
new file mode 100644
index 0000000..0e664e2
--- /dev/null
+++ b/controllers/image/image.controller.php
@@ -0,0 +1,95 @@
+'err','reason'=>'Not a valid image');
+ }
+
+ if($hash===false)
+ {
+ $hash = getNewHash($ext,6);
+ }
+
+ mkdir(ROOT.DS.'data'.DS.$hash);
+ $file = ROOT.DS.'data'.DS.$hash.DS.$hash;
+
+ move_uploaded_file($tmpfile, $file);
+
+ if(defined('ALT_FOLDER') && ALT_FOLDER)
+ {
+ $altname=ALT_FOLDER.DS.$hash;
+ if(!file_exists($altname) && is_dir(ALT_FOLDER))
+ {
+ copy($file,$altname);
+ }
+ }
+
+ if(defined('LOG_UPLOADER') && LOG_UPLOADER)
+ {
+ $fh = fopen(ROOT.DS.'data'.DS.'uploads.txt', 'a');
+ fwrite($fh, time().';'.$url.';'.$hash.';'.getUserIP()."\n");
+ fclose($fh);
+ }
+
+ return array('status'=>'ok','hash'=>$hash,'url'=>URL.$hash);
+ }
+
+ public function handleHash($hash,$url)
+ {
+ $path = ROOT.DS.'data'.DS.$hash.DS.$hash;
+
+ $type = getExtensionOfFilename($hash);
+ switch($type)
+ {
+ case 'jpeg':
+ case 'jpg':
+ header ("Content-type: image/jpeg");
+ readfile($path);
+ break;
+
+ case 'png':
+ header ("Content-type: image/png");
+ readfile($path);
+ break;
+
+ case 'gif':
+ header ("Content-type: image/gif");
+ readfile($path);
+ break;
+
+ case 'webp':
+ header ("Content-type: image/webp");
+ readfile($path);
+ break;
+ }
+ }
+}
\ No newline at end of file
diff --git a/controllers/text/text.controller.php b/controllers/text/text.controller.php
new file mode 100644
index 0000000..ec99945
--- /dev/null
+++ b/controllers/text/text.controller.php
@@ -0,0 +1,70 @@
+$hash,'content'=>htmlentities(file_get_contents($path))));
+ }
+
+ public function handleUpload($tmpfile,$hash=false)
+ {
+ if($hash===false)
+ {
+ $hash = getNewHash('txt',6);
+ }
+
+ mkdir(ROOT.DS.'data'.DS.$hash);
+ $file = ROOT.DS.'data'.DS.$hash.DS.$hash;
+
+ move_uploaded_file($tmpfile, $file);
+
+ if(defined('ALT_FOLDER') && ALT_FOLDER)
+ {
+ $altname=ALT_FOLDER.DS.$hash;
+ if(!file_exists($altname) && is_dir(ALT_FOLDER))
+ {
+ copy($file,$altname);
+ }
+ }
+
+ if(defined('LOG_UPLOADER') && LOG_UPLOADER)
+ {
+ $fh = fopen(ROOT.DS.'data'.DS.'uploads.txt', 'a');
+ fwrite($fh, time().';'.$url.';'.$hash.';'.getUserIP()."\n");
+ fclose($fh);
+ }
+
+ return array('status'=>'ok','hash'=>$hash,'url'=>URL.$hash);
+ }
+
+ function getTypeOfText($hash)
+ {
+ return file_get_contents(ROOT.DS.'data'.DS.$hash.DS.'type');
+ }
+}
\ No newline at end of file
diff --git a/controllers/url/url.controller.php b/controllers/url/url.controller.php
new file mode 100644
index 0000000..537868e
--- /dev/null
+++ b/controllers/url/url.controller.php
@@ -0,0 +1,7 @@
+serveMP4($path,$hash);
+ else if(in_array('download',$url))
+ {
+ if (file_exists($path)) {
+ header('Content-Description: File Transfer');
+ header('Content-Type: application/octet-stream');
+ header('Content-Disposition: attachment; filename="'.basename($path).'"');
+ header('Expires: 0');
+ header('Cache-Control: must-revalidate');
+ header('Pragma: public');
+ header('Content-Length: ' . filesize($path));
+ readfile($path);
+ exit;
+ }
+ }
+ else
+ {
+ $data = array('url'=>implode('/',$url),'hash'=>$hash,'filesize'=>renderSize(filesize($path)),'content'=>htmlentities(file_get_contents($path)));
+ renderTemplate('video',$data);
+ }
+ }
+
+ public function handleUpload($tmpfile,$hash=false)
+ {
+ $fh = fopen(ROOT.DS.'log'.DS.'video.log', 'a'); //////
+ fwrite($fh, "[1] $tmpfile was uploaded\n");
+
+ if($hash===false)
+ $hash = getNewHash('mp4',6);
+
+ fwrite($fh, "[2] $tmpfile got the hash $hash\n");
+
+ mkdir(ROOT.DS.'data'.DS.$hash);
+ $file = ROOT.DS.'data'.DS.$hash.DS.$hash;
+
+ move_uploaded_file($tmpfile, $file);
+
+ fwrite($fh, "[3] Was it already correclty encoded? ".($this->rightEncodedMP4($file)?'yes':'no'));
+
+ if(!$this->rightEncodedMP4($file))
+ system("nohup php ".ROOT.DS.'tools'.DS.'re-encode_mp4.php force '.$hash." > /dev/null 2> /dev/null &");
+
+ fclose($fh);
+
+ if(defined('ALT_FOLDER') && ALT_FOLDER)
+ {
+ $altname=ALT_FOLDER.DS.$hash;
+ if(!file_exists($altname) && is_dir(ALT_FOLDER))
+ {
+ copy($file,$altname);
+ }
+ }
+
+ if(defined('LOG_UPLOADER') && LOG_UPLOADER)
+ {
+ $fh = fopen(ROOT.DS.'data'.DS.'uploads.txt', 'a');
+ fwrite($fh, time().';'.$url.';'.$hash.';'.getUserIP()."\n");
+ fclose($fh);
+ }
+
+ return array('status'=>'ok','hash'=>$hash,'url'=>URL.$hash);
+ }
+
+
+ //via gist: https://gist.github.com/codler/3906826
+ function serveMP4($path,$hash)
+ {
+ if ($fp = fopen($path, "rb"))
+ {
+ $size = filesize($path);
+ $length = $size;
+ $start = 0;
+ $end = $size - 1;
+ header('Content-type: video/mp4');
+ header("Accept-Ranges: 0-$length");
+ if (isset($_SERVER['HTTP_RANGE'])) {
+ $c_start = $start;
+ $c_end = $end;
+ list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
+ if (strpos($range, ',') !== false) {
+ header('HTTP/1.1 416 Requested Range Not Satisfiable');
+ header("Content-Range: bytes $start-$end/$size");
+ exit;
+ }
+ if ($range == '-') {
+ $c_start = $size - substr($range, 1);
+ } else {
+ $range = explode('-', $range);
+ $c_start = $range[0];
+ $c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $size;
+ }
+ $c_end = ($c_end > $end) ? $end : $c_end;
+ if ($c_start > $c_end || $c_start > $size - 1 || $c_end >= $size) {
+ header('HTTP/1.1 416 Requested Range Not Satisfiable');
+ header("Content-Range: bytes $start-$end/$size");
+ exit;
+ }
+ $start = $c_start;
+ $end = $c_end;
+ $length = $end - $start + 1;
+ fseek($fp, $start);
+ header('HTTP/1.1 206 Partial Content');
+ }
+ header("Content-Range: bytes $start-$end/$size");
+ header("Content-Length: ".$length);
+ $buffer = 1024 * 8;
+ while(!feof($fp) && ($p = ftell($fp)) <= $end) {
+ if ($p + $buffer > $end) {
+ $buffer = $end - $p + 1;
+ }
+ set_time_limit(0);
+ echo fread($fp, $buffer);
+ flush();
+ }
+ fclose($fp);
+ exit();
+ } else die('file not found');
+ }
+
+ function isProperMP4($filename)
+ {
+ $file = escapeshellarg($filename);
+ $tmp = ROOT.DS.'tmp'.DS.md5(time()+rand(1,10000)).'.'.rand(1,10000).'.log';
+ $bin = escapeshellcmd(FFMPEG_BINARY);
+
+
+
+ $cmd = "$bin -i $file > $tmp 2>> $tmp";
+
+ system($cmd);
+
+ //var_dump(system( "$bin -i $file "));
+
+ $answer = file($tmp);
+ unlink($tmp);
+ $ismp4 = false;
+ if(is_array($answer))
+ foreach($answer as $line)
+ {
+ $line = trim($line);
+ if(strpos($line,'Duration: 00:00:00')) return false;
+ if(strpos($line, 'Video: h264'))
+ $ismp4 = true;
+ }
+
+ return $ismp4;
+ }
+
+ function rightEncodedMP4($file)
+ {
+ $hash = md5($file);
+ $cmd = FFMPEG_BINARY." -i $file -hide_banner 2> ".ROOT.DS.'tmp'.DS.$hash.'.txt';
+ system($cmd);
+ $results = file(ROOT.DS.'tmp'.DS.$hash.'.txt');
+ foreach($results as $l)
+ {
+ $elements = explode(':',trim($l));
+ $key=trim(array_shift($elements));
+ $value = trim(implode(':',$elements));
+ if($key=='encoder')
+ {
+ if(startsWith(strtolower($value),'lav'))
+ {
+ return true;
+ } else return false;
+ }
+ }
+ unlink(ROOT.DS.'tmp'.DS.$hash.'.txt');
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/css/dropzone.css b/css/dropzone.css
new file mode 100644
index 0000000..0494d1c
--- /dev/null
+++ b/css/dropzone.css
@@ -0,0 +1,388 @@
+/*
+ * The MIT License
+ * Copyright (c) 2012 Matias Meno
+ */
+@-webkit-keyframes passing-through {
+ 0% {
+ opacity: 0;
+ -webkit-transform: translateY(40px);
+ -moz-transform: translateY(40px);
+ -ms-transform: translateY(40px);
+ -o-transform: translateY(40px);
+ transform: translateY(40px); }
+ 30%, 70% {
+ opacity: 1;
+ -webkit-transform: translateY(0px);
+ -moz-transform: translateY(0px);
+ -ms-transform: translateY(0px);
+ -o-transform: translateY(0px);
+ transform: translateY(0px); }
+ 100% {
+ opacity: 0;
+ -webkit-transform: translateY(-40px);
+ -moz-transform: translateY(-40px);
+ -ms-transform: translateY(-40px);
+ -o-transform: translateY(-40px);
+ transform: translateY(-40px); } }
+@-moz-keyframes passing-through {
+ 0% {
+ opacity: 0;
+ -webkit-transform: translateY(40px);
+ -moz-transform: translateY(40px);
+ -ms-transform: translateY(40px);
+ -o-transform: translateY(40px);
+ transform: translateY(40px); }
+ 30%, 70% {
+ opacity: 1;
+ -webkit-transform: translateY(0px);
+ -moz-transform: translateY(0px);
+ -ms-transform: translateY(0px);
+ -o-transform: translateY(0px);
+ transform: translateY(0px); }
+ 100% {
+ opacity: 0;
+ -webkit-transform: translateY(-40px);
+ -moz-transform: translateY(-40px);
+ -ms-transform: translateY(-40px);
+ -o-transform: translateY(-40px);
+ transform: translateY(-40px); } }
+@keyframes passing-through {
+ 0% {
+ opacity: 0;
+ -webkit-transform: translateY(40px);
+ -moz-transform: translateY(40px);
+ -ms-transform: translateY(40px);
+ -o-transform: translateY(40px);
+ transform: translateY(40px); }
+ 30%, 70% {
+ opacity: 1;
+ -webkit-transform: translateY(0px);
+ -moz-transform: translateY(0px);
+ -ms-transform: translateY(0px);
+ -o-transform: translateY(0px);
+ transform: translateY(0px); }
+ 100% {
+ opacity: 0;
+ -webkit-transform: translateY(-40px);
+ -moz-transform: translateY(-40px);
+ -ms-transform: translateY(-40px);
+ -o-transform: translateY(-40px);
+ transform: translateY(-40px); } }
+@-webkit-keyframes slide-in {
+ 0% {
+ opacity: 0;
+ -webkit-transform: translateY(40px);
+ -moz-transform: translateY(40px);
+ -ms-transform: translateY(40px);
+ -o-transform: translateY(40px);
+ transform: translateY(40px); }
+ 30% {
+ opacity: 1;
+ -webkit-transform: translateY(0px);
+ -moz-transform: translateY(0px);
+ -ms-transform: translateY(0px);
+ -o-transform: translateY(0px);
+ transform: translateY(0px); } }
+@-moz-keyframes slide-in {
+ 0% {
+ opacity: 0;
+ -webkit-transform: translateY(40px);
+ -moz-transform: translateY(40px);
+ -ms-transform: translateY(40px);
+ -o-transform: translateY(40px);
+ transform: translateY(40px); }
+ 30% {
+ opacity: 1;
+ -webkit-transform: translateY(0px);
+ -moz-transform: translateY(0px);
+ -ms-transform: translateY(0px);
+ -o-transform: translateY(0px);
+ transform: translateY(0px); } }
+@keyframes slide-in {
+ 0% {
+ opacity: 0;
+ -webkit-transform: translateY(40px);
+ -moz-transform: translateY(40px);
+ -ms-transform: translateY(40px);
+ -o-transform: translateY(40px);
+ transform: translateY(40px); }
+ 30% {
+ opacity: 1;
+ -webkit-transform: translateY(0px);
+ -moz-transform: translateY(0px);
+ -ms-transform: translateY(0px);
+ -o-transform: translateY(0px);
+ transform: translateY(0px); } }
+@-webkit-keyframes pulse {
+ 0% {
+ -webkit-transform: scale(1);
+ -moz-transform: scale(1);
+ -ms-transform: scale(1);
+ -o-transform: scale(1);
+ transform: scale(1); }
+ 10% {
+ -webkit-transform: scale(1.1);
+ -moz-transform: scale(1.1);
+ -ms-transform: scale(1.1);
+ -o-transform: scale(1.1);
+ transform: scale(1.1); }
+ 20% {
+ -webkit-transform: scale(1);
+ -moz-transform: scale(1);
+ -ms-transform: scale(1);
+ -o-transform: scale(1);
+ transform: scale(1); } }
+@-moz-keyframes pulse {
+ 0% {
+ -webkit-transform: scale(1);
+ -moz-transform: scale(1);
+ -ms-transform: scale(1);
+ -o-transform: scale(1);
+ transform: scale(1); }
+ 10% {
+ -webkit-transform: scale(1.1);
+ -moz-transform: scale(1.1);
+ -ms-transform: scale(1.1);
+ -o-transform: scale(1.1);
+ transform: scale(1.1); }
+ 20% {
+ -webkit-transform: scale(1);
+ -moz-transform: scale(1);
+ -ms-transform: scale(1);
+ -o-transform: scale(1);
+ transform: scale(1); } }
+@keyframes pulse {
+ 0% {
+ -webkit-transform: scale(1);
+ -moz-transform: scale(1);
+ -ms-transform: scale(1);
+ -o-transform: scale(1);
+ transform: scale(1); }
+ 10% {
+ -webkit-transform: scale(1.1);
+ -moz-transform: scale(1.1);
+ -ms-transform: scale(1.1);
+ -o-transform: scale(1.1);
+ transform: scale(1.1); }
+ 20% {
+ -webkit-transform: scale(1);
+ -moz-transform: scale(1);
+ -ms-transform: scale(1);
+ -o-transform: scale(1);
+ transform: scale(1); } }
+.dropzone, .dropzone * {
+ box-sizing: border-box; }
+
+.dropzone {
+ min-height: 150px;
+ border: 2px solid rgba(0, 0, 0, 0.3);
+ background: white;
+ padding: 20px 20px; }
+ .dropzone.dz-clickable {
+ cursor: pointer; }
+ .dropzone.dz-clickable * {
+ cursor: default; }
+ .dropzone.dz-clickable .dz-message, .dropzone.dz-clickable .dz-message * {
+ cursor: pointer; }
+ .dropzone.dz-started .dz-message {
+ display: none; }
+ .dropzone.dz-drag-hover {
+ border-style: solid; }
+ .dropzone.dz-drag-hover .dz-message {
+ opacity: 0.5; }
+ .dropzone .dz-message {
+ text-align: center;
+ margin: 2em 0; }
+ .dropzone .dz-preview {
+ position: relative;
+ display: inline-block;
+ vertical-align: top;
+ margin: 16px;
+ min-height: 100px; }
+ .dropzone .dz-preview:hover {
+ z-index: 1000; }
+ .dropzone .dz-preview:hover .dz-details {
+ opacity: 1; }
+ .dropzone .dz-preview.dz-file-preview .dz-image {
+ border-radius: 20px;
+ background: #999;
+ background: linear-gradient(to bottom, #eee, #ddd); }
+ .dropzone .dz-preview.dz-file-preview .dz-details {
+ opacity: 1; }
+ .dropzone .dz-preview.dz-image-preview {
+ background: white; }
+ .dropzone .dz-preview.dz-image-preview .dz-details {
+ -webkit-transition: opacity 0.2s linear;
+ -moz-transition: opacity 0.2s linear;
+ -ms-transition: opacity 0.2s linear;
+ -o-transition: opacity 0.2s linear;
+ transition: opacity 0.2s linear; }
+ .dropzone .dz-preview .dz-remove {
+ font-size: 14px;
+ text-align: center;
+ display: block;
+ cursor: pointer;
+ border: none; }
+ .dropzone .dz-preview .dz-remove:hover {
+ text-decoration: underline; }
+ .dropzone .dz-preview:hover .dz-details {
+ opacity: 1; }
+ .dropzone .dz-preview .dz-details {
+ z-index: 20;
+ position: absolute;
+ top: 0;
+ left: 0;
+ opacity: 0;
+ font-size: 13px;
+ min-width: 100%;
+ max-width: 100%;
+ padding: 2em 1em;
+ text-align: center;
+ color: rgba(0, 0, 0, 0.9);
+ line-height: 150%; }
+ .dropzone .dz-preview .dz-details .dz-size {
+ margin-bottom: 1em;
+ font-size: 16px; }
+ .dropzone .dz-preview .dz-details .dz-filename {
+ white-space: nowrap; }
+ .dropzone .dz-preview .dz-details .dz-filename:hover span {
+ border: 1px solid rgba(200, 200, 200, 0.8);
+ background-color: rgba(255, 255, 255, 0.8); }
+ .dropzone .dz-preview .dz-details .dz-filename:not(:hover) {
+ overflow: hidden;
+ text-overflow: ellipsis; }
+ .dropzone .dz-preview .dz-details .dz-filename:not(:hover) span {
+ border: 1px solid transparent; }
+ .dropzone .dz-preview .dz-details .dz-filename span, .dropzone .dz-preview .dz-details .dz-size span {
+ background-color: rgba(255, 255, 255, 0.4);
+ padding: 0 0.4em;
+ border-radius: 3px; }
+ .dropzone .dz-preview:hover .dz-image img {
+ -webkit-transform: scale(1.05, 1.05);
+ -moz-transform: scale(1.05, 1.05);
+ -ms-transform: scale(1.05, 1.05);
+ -o-transform: scale(1.05, 1.05);
+ transform: scale(1.05, 1.05);
+ -webkit-filter: blur(8px);
+ filter: blur(8px); }
+ .dropzone .dz-preview .dz-image {
+ border-radius: 20px;
+ overflow: hidden;
+ width: 120px;
+ height: 120px;
+ position: relative;
+ display: block;
+ z-index: 10; }
+ .dropzone .dz-preview .dz-image img {
+ display: block; }
+ .dropzone .dz-preview.dz-success .dz-success-mark {
+ -webkit-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
+ -moz-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
+ -ms-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
+ -o-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
+ animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1); }
+ .dropzone .dz-preview.dz-error .dz-error-mark {
+ opacity: 1;
+ -webkit-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
+ -moz-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
+ -ms-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
+ -o-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
+ animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1); }
+ .dropzone .dz-preview .dz-success-mark, .dropzone .dz-preview .dz-error-mark {
+ pointer-events: none;
+ opacity: 0;
+ z-index: 500;
+ position: absolute;
+ display: block;
+ top: 50%;
+ left: 50%;
+ margin-left: -27px;
+ margin-top: -27px; }
+ .dropzone .dz-preview .dz-success-mark svg, .dropzone .dz-preview .dz-error-mark svg {
+ display: block;
+ width: 54px;
+ height: 54px; }
+ .dropzone .dz-preview.dz-processing .dz-progress {
+ opacity: 1;
+ -webkit-transition: all 0.2s linear;
+ -moz-transition: all 0.2s linear;
+ -ms-transition: all 0.2s linear;
+ -o-transition: all 0.2s linear;
+ transition: all 0.2s linear; }
+ .dropzone .dz-preview.dz-complete .dz-progress {
+ opacity: 0;
+ -webkit-transition: opacity 0.4s ease-in;
+ -moz-transition: opacity 0.4s ease-in;
+ -ms-transition: opacity 0.4s ease-in;
+ -o-transition: opacity 0.4s ease-in;
+ transition: opacity 0.4s ease-in; }
+ .dropzone .dz-preview:not(.dz-processing) .dz-progress {
+ -webkit-animation: pulse 6s ease infinite;
+ -moz-animation: pulse 6s ease infinite;
+ -ms-animation: pulse 6s ease infinite;
+ -o-animation: pulse 6s ease infinite;
+ animation: pulse 6s ease infinite; }
+ .dropzone .dz-preview .dz-progress {
+ opacity: 1;
+ z-index: 1000;
+ pointer-events: none;
+ position: absolute;
+ height: 16px;
+ left: 50%;
+ top: 50%;
+ margin-top: -8px;
+ width: 80px;
+ margin-left: -40px;
+ background: rgba(255, 255, 255, 0.9);
+ -webkit-transform: scale(1);
+ border-radius: 8px;
+ overflow: hidden; }
+ .dropzone .dz-preview .dz-progress .dz-upload {
+ background: #333;
+ background: linear-gradient(to bottom, #666, #444);
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ width: 0;
+ -webkit-transition: width 300ms ease-in-out;
+ -moz-transition: width 300ms ease-in-out;
+ -ms-transition: width 300ms ease-in-out;
+ -o-transition: width 300ms ease-in-out;
+ transition: width 300ms ease-in-out; }
+ .dropzone .dz-preview.dz-error .dz-error-message {
+ display: block; }
+ .dropzone .dz-preview.dz-error:hover .dz-error-message {
+ opacity: 1;
+ pointer-events: auto; }
+ .dropzone .dz-preview .dz-error-message {
+ pointer-events: none;
+ z-index: 1000;
+ position: absolute;
+ display: block;
+ display: none;
+ opacity: 0;
+ -webkit-transition: opacity 0.3s ease;
+ -moz-transition: opacity 0.3s ease;
+ -ms-transition: opacity 0.3s ease;
+ -o-transition: opacity 0.3s ease;
+ transition: opacity 0.3s ease;
+ border-radius: 8px;
+ font-size: 13px;
+ top: 130px;
+ left: -10px;
+ width: 140px;
+ background: #be2626;
+ background: linear-gradient(to bottom, #be2626, #a92222);
+ padding: 0.5em 1.2em;
+ color: white; }
+ .dropzone .dz-preview .dz-error-message:after {
+ content: '';
+ position: absolute;
+ top: -6px;
+ left: 64px;
+ width: 0;
+ height: 0;
+ border-left: 6px solid transparent;
+ border-right: 6px solid transparent;
+ border-bottom: 6px solid #be2626; }
diff --git a/css/pictshare.css b/css/pictshare.css
index 0c1323d..119d5d4 100644
--- a/css/pictshare.css
+++ b/css/pictshare.css
@@ -25,4 +25,11 @@ body {
background: rgba(245, 245, 245, .8);
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.05);
box-shadow: inset 0 1px 1px rgba(0,0,0,.05);
+}
+
+.box__dragndrop,
+.box__uploading,
+.box__success,
+.box__error {
+ display: none;
}
\ No newline at end of file
diff --git a/upload/.gitignore b/data/.gitignore
similarity index 51%
rename from upload/.gitignore
rename to data/.gitignore
index 28eb9dd..86d0cb2 100755
--- a/upload/.gitignore
+++ b/data/.gitignore
@@ -1,6 +1,4 @@
# Ignore everything in this directory
*
# Except this file
-!.gitignore
-# And except deletecodes folder
-!deletecodes
\ No newline at end of file
+!.gitignore
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
deleted file mode 100644
index 0e8b94b..0000000
--- a/docker-compose.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-version: '2'
-
-services:
- pictshare:
- restart: always
- image: hascheksolutions/pictshare:latest
- volumes:
- - ./volumes/upload:/usr/share/nginx/html/upload
- ports:
- - "80:80"
- - "443:443"
- environment:
- - AUTOUPDATE=false
- - MAX_UPLOAD_SIZE=
- - TITLE=
- - PNG_COMPRESSION=
- - JPEG_COMPRESSION=
- - MASTER_DELETE_CODE=
- - MASTER_DELETE_IP=
- - UPLOAD_FORM_LOCATION=
- - LOW_PROFILE=
- - UPLOAD_CODE=
- - IMAGE_CHANGE_CODE=
- - LOG_UPLOADER=
- - MAX_RESIZED_IMAGES=
- - ALLOW_BLOATING=
- - FORCE_DOMAIN=
- - SHOW_ERRORS=
- - FFMPEG_BINARY=
diff --git a/inc/.gitignore b/inc/.gitignore
index f5f28e3..2b9ce0a 100644
--- a/inc/.gitignore
+++ b/inc/.gitignore
@@ -1,2 +1 @@
-# don#t track the active config
config.inc.php
\ No newline at end of file
diff --git a/inc/core.php b/inc/core.php
index c870592..aa9b240 100644
--- a/inc/core.php
+++ b/inc/core.php
@@ -1,538 +1,301 @@
- $va) {
- $sorter[$ii]=$va[$key];
- }
- asort($sorter);
- foreach ($sorter as $ii => $va) {
- $ret[$ii]=$array[$ii];
- }
- $array=$ret;
-}
-
-
-
-function callHook()
-{
- global $url;
-
- whatToDo($url);
-}
-
-function whatToDo($url)
-{
- $pm = new PictshareModel();
-
-
- $data = $pm->urlToData($url);
-
- if(!$data['hash'] && $data['size']) //if there is only a size but no hash, generate a pattern
- {
- $sd = $pm->sizeStringToWidthHeight($data['size']);
- $width = ($sd['width'] <= 2000)?$sd['width']:2000;
- $height = ($sd['height'] <= 2000)?$sd['height']:2000;
-
- $cachefile = ROOT.DS.'tmp'.DS.$width .'x'.$height.'.png';
- if(!file_exists($cachefile))
- {
- $image=$pm->gradient($width, $height, array('#A7FF78', '#A7FF78', '#78FFD4', '#78FFD4'));
- imagepng($image,$cachefile);
- }
- else
- $image = imagecreatefrompng($cachefile);
- header('Content-type: image/png');
- imagepng($image);
- imagedestroy($image);
- exit();
- }
- else if(!is_array($data) || !$data['hash'])
- {
- if((UPLOAD_FORM_LOCATION && $url==UPLOAD_FORM_LOCATION) || (!UPLOAD_FORM_LOCATION))
- {
- $upload_answer = $pm->ProcessUploads();
- if($upload_answer)
- $o=$upload_answer;
- else
- $o.= $pm->renderUploadForm();
-
- $vars['content'] = $o;
- $vars['slogan'] = $pm->translate(2);
-
- }
-
- if(!$vars && LOW_PROFILE)
- {
- header('HTTP/1.0 404 Not Found');
- exit();
- }
- else if(!$vars)
- {
- $vars['content'] = $pm->translate(12);
- $vars['slogan'] = $pm->translate(2);
- }
-
- render($vars);
- }
- else if($data['album'])
- renderAlbum($data);
- else
- renderImage($data);
-}
-
-function renderAlbum($data)
-{
- if($data['filter'])
- $filters = implode('/',$data['filter']).'/';
-
- if($data['size'])
- $size = $data['size'].'/';
- else if(!$data['responsive'])
- $size = '300x300/';
-
- $forcesize = ($data['forcesize']?'forcesize/':'');
-
- foreach($data['album'] as $hash)
- {
- $content.='
';
- }
-
- if($data['embed']===true)
- include (ROOT . DS . 'template_album_embed.php');
- else
- include (ROOT . DS . 'template_album.php');
-}
-
-function renderImage($data)
-{
- $hash = $data['hash'];
- if($data['changecode'])
- {
- $changecode = $data['changecode'];
- unset($data['changecode']);
- }
-
- $pm = new PictshareModel();
- $base_path = ROOT.DS.'upload'.DS.$hash.DS;
- $path = $base_path.$hash;
- $type = $pm->isTypeAllowed($pm->getTypeOfFile($path));
- $cached = false;
-
- //update last_rendered of this hash so we can later
- //sort out old, unused images easier
- @file_put_contents($base_path.'last_rendered.txt',time());
-
- $cachename = $pm->getCacheName($data);
- $cachepath = $base_path.$cachename;
- if(file_exists($cachepath))
- {
- $path = $cachepath;
- $cached = true;
- }
- else if(MAX_RESIZED_IMAGES > -1 && $pm->countResizedImages($hash)>MAX_RESIZED_IMAGES) //if the number of max resized images is reached, just show the real one
- $path = ROOT.DS.'upload'.DS.$hash.DS.$hash;
-
- switch($type)
- {
- case 'jpg':
- header ("Content-type: image/jpeg");
- $im = imagecreatefromjpeg($path);
- if(!$cached)
- {
- if($pm->changeCodeExists($changecode))
- {
- changeImage($im,$data);
- imagejpeg($im,$cachepath,(defined('JPEG_COMPRESSION')?JPEG_COMPRESSION:90));
- }
-
- }
- imagejpeg($im);
- break;
- case 'png':
- header ("Content-type: image/png");
- $im = imagecreatefrompng($path);
- if(!$cached)
- {
- if($pm->changeCodeExists($changecode))
- {
- changeImage($im,$data);
- imagepng($im,$cachepath,(defined('PNG_COMPRESSION')?PNG_COMPRESSION:6));
- }
- }
- imageAlphaBlending($im, true);
- imageSaveAlpha($im, true);
- imagepng($im);
- break;
- case 'gif':
- if($data['mp4'] || $data['webm'] || $data['ogg']) //user wants mp4 or webm or ogg
- {
- $gifpath = $path;
- $mp4path = $base_path.'mp4_1.'.$hash; //workaround.. find a better solution!
- $webmpath = $base_path.'webm_1.'.$hash;
- $oggpath = $base_path.'ogg_1.'.$hash;
-
- if(!file_exists($mp4path) && !$data['preview']) //if mp4 does not exist, create it
- $pm->gifToMP4($gifpath,$mp4path);
-
- if(!file_exists($webmpath) && $data['webm'] && !$data['preview'])
- $pm->saveAsWebm($gifpath,$webmpath);
-
- if(!file_exists($oggpath) && $data['ogg'] && !$data['preview'])
- $pm->saveAsOGG($gifpath,$oggpath);
-
- if($data['raw'])
- {
- if($data['webm'])
- serveFile($webmpath, $hash.'.webm','video/webm');
- if($data['ogg'])
- serveFile($oggpath, $hash.'.ogg','video/ogg');
- else
- serveMp4($mp4path, $hash.'.mp4','video/mp4');
- }
- else if($data['preview'])
- {
- $file = $mp4path;
- if(!file_exists($cachepath))
- $pm->saveFirstFrameOfMP4($mp4path,$cachepath);
- header ("Content-type: image/jpeg");
- readfile($cachepath);
- }
- else
- renderMP4($mp4path,$data);
- }
- else //user wants gif
- {
- if(!$cached && $data['size'])
- {
- $pm->resizeFFMPEG($data,$cachepath,'gif');
- }
- header ("Content-type: image/gif");
- if(file_exists($cachepath))
- readfile($cachepath);
- else
- readfile($path);
- }
-
- break;
- case 'mp4':
- if(!$cached && !$data['preview'])
- {
- $pm->resizeFFMPEG($data,$cachepath,'mp4');
- $path = $cachepath;
- }
-
- if(file_exists($cachepath) && filesize($cachepath)==0) //if there was an error and the file is 0 bytes, use the original
- $cachepath = ROOT.DS.'upload'.DS.$hash.DS.$hash;
-
- if($data['webm'])
- {
- $pm->saveAsWebm(ROOT.DS.'upload'.DS.$hash.DS.$hash,$cachepath);
- }
-
- if($data['ogg'])
- {
- $pm->saveAsOGG(ROOT.DS.'upload'.DS.$hash.DS.$hash,$cachepath);
- }
-
- if($data['raw'])
- {
- serveMP4($cachepath, $hash,'video/mp4');
- }
- else if($data['preview'])
- {
- if(!file_exists($cachepath))
- $pm->saveFirstFrameOfMP4($path,$cachepath);
- header ("Content-type: image/jpeg");
- readfile($cachepath);
- }
- else
- renderMP4($path,$data);
- break;
- }
-
- exit();
-}
-
-function changeImage(&$im,$data)
-{
- $image = new Image();
- foreach($data as $action=>$val)
- {
- switch($action)
- {
- case 'rotate': $image->rotate($im,$val);break;
- case 'size': (($data['forcesize']===true)?$image->forceResize($im,$val):$image->resize($im,$val));break;
- case 'filter': $image->filter($im,$val);break;
- }
- }
-}
-
-
-
-function render($variables=null)
-{
- if(is_array($variables))
- extract($variables);
- include (ROOT . DS . 'template.php');
-}
-
-function renderMP4($path,$data)
-{
- $pm = new PictshareModel;
- $hash = $data['hash'];
- $urldata = $pm->getURLInfo($path,true);
- if($data['size'])
- $hash = $data['size'].'/'.$hash;
- $info = $pm->getSizeOfMP4($path);
- $width = $info['width'];
- $height = $info['height'];
- $filesize = $urldata['humansize'];
- include (ROOT . DS . 'template_mp4.php');
-}
-
-//
-// from: https://stackoverflow.com/questions/25975943/php-serve-mp4-chrome-provisional-headers-are-shown-request-is-not-finished-ye
-//
-function serveFile($filename, $filename_output = false, $mime = 'application/octet-stream')
-{
- $buffer_size = 8192;
- $expiry = 90; //days
-
- if(!file_exists($filename))
- {
- throw new Exception('File not found: ' . $filename);
- }
- if(!is_readable($filename))
- {
- throw new Exception('File not readable: ' . $filename);
- }
-
- header_remove('Cache-Control');
- header_remove('Pragma');
-
- $byte_offset = 0;
- $filesize_bytes = $filesize_original = filesize($filename);
-
- header('Accept-Ranges: bytes', true);
- header('Content-Type: ' . $mime, true);
-
-/*
- if($filename_output)
- {
- header('Content-Disposition: attachment; filename="' . $filename_output . '"');
- }
-*/
-header("Content-Disposition: inline;");
- // Content-Range header for byte offsets
- if (isset($_SERVER['HTTP_RANGE']) && preg_match('%bytes=(\d+)-(\d+)?%i', $_SERVER['HTTP_RANGE'], $match))
- {
- $byte_offset = (int) $match[1];//Offset signifies where we should begin to read the file
- if (isset($match[2]))//Length is for how long we should read the file according to the browser, and can never go beyond the file size
- {
- $filesize_bytes = min((int) $match[2], $filesize_bytes - $byte_offset);
- }
- header("HTTP/1.1 206 Partial content");
- header(sprintf('Content-Range: bytes %d-%d/%d', $byte_offset, $filesize_bytes - 1, $filesize_original)); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent
- }
-
- $byte_range = $filesize_bytes - $byte_offset;
-
- header('Content-Length: ' . $byte_range);
- header('Expires: ' . date('D, d M Y H:i:s', time() + 60 * 60 * 24 * $expiry) . ' GMT');
-
- $buffer = '';
- $bytes_remaining = $byte_range;
-
- $handle = fopen($filename, 'r');
- if(!$handle)
- {
- throw new Exception("Could not get handle for file: " . $filename);
- }
- if (fseek($handle, $byte_offset, SEEK_SET) == -1)
- {
- throw new Exception("Could not seek to byte offset %d", $byte_offset);
- }
-
- while ($bytes_remaining > 0)
- {
- $chunksize_requested = min($buffer_size, $bytes_remaining);
- $buffer = fread($handle, $chunksize_requested);
- $chunksize_real = strlen($buffer);
- if ($chunksize_real == 0)
- {
- break;
- }
- $bytes_remaining -= $chunksize_real;
- echo $buffer;
- flush();
- }
-}
-
-
-//via gist: https://gist.github.com/codler/3906826
-function serveMP4($path,$hash,$null)
-{
- if ($fp = fopen($path, "rb")) {
- $size = filesize($path);
- $length = $size;
- $start = 0;
- $end = $size - 1;
- header('Content-type: video/mp4');
- header("Accept-Ranges: 0-$length");
- if (isset($_SERVER['HTTP_RANGE'])) {
- $c_start = $start;
- $c_end = $end;
- list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
- if (strpos($range, ',') !== false) {
- header('HTTP/1.1 416 Requested Range Not Satisfiable');
- header("Content-Range: bytes $start-$end/$size");
- exit;
- }
- if ($range == '-') {
- $c_start = $size - substr($range, 1);
- } else {
- $range = explode('-', $range);
- $c_start = $range[0];
- $c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $size;
- }
- $c_end = ($c_end > $end) ? $end : $c_end;
- if ($c_start > $c_end || $c_start > $size - 1 || $c_end >= $size) {
- header('HTTP/1.1 416 Requested Range Not Satisfiable');
- header("Content-Range: bytes $start-$end/$size");
- exit;
- }
- $start = $c_start;
- $end = $c_end;
- $length = $end - $start + 1;
- fseek($fp, $start);
- header('HTTP/1.1 206 Partial Content');
- }
- header("Content-Range: bytes $start-$end/$size");
- header("Content-Length: ".$length);
- $buffer = 1024 * 8;
- while(!feof($fp) && ($p = ftell($fp)) <= $end) {
- if ($p + $buffer > $end) {
- $buffer = $end - $p + 1;
- }
- set_time_limit(0);
- echo fread($fp, $buffer);
- flush();
- }
- fclose($fp);
- exit();
- } else {
- die('file not found');
- }
-}
-
-function cidr_match($ip, $range)
-{
- list ($subnet, $bits) = explode('/', $range);
- $ip = ip2long($ip);
- $subnet = ip2long($subnet);
- $mask = -1 << (32 - $bits);
- $subnet &= $mask; # nb: in case the supplied subnet wasn't correctly aligned
- return ($ip & $mask) == $subnet;
-}
-
-function isIP($ip)
-{
- return filter_var($ip, FILTER_VALIDATE_IP);
-}
-
-function getRandomString($length=32, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyz')
-{
- $str = '';
- $max = mb_strlen($keyspace, '8bit') - 1;
- for ($i = 0; $i < $length; ++$i) {
- $str .= $keyspace[rand(0, $max)];
- }
- return $str;
-}
-
-function startsWith($haystack,$needle)
-{
- $length = strlen($needle);
- return (substr($haystack,0,$length) === $needle);
-}
-
-function endswith($string, $test) {
- $strlen = strlen($string);
- $testlen = strlen($test);
- if ($testlen > $strlen) return false;
- return substr_compare($string, $test, $strlen - $testlen, $testlen) === 0;
-}
-
-function remote_filesize($url) {
- static $regex = '/^Content-Length: *+\K\d++$/im';
- if (!$fp = @fopen($url, 'rb')) {
- return false;
- }
- if (
- isset($http_response_header) &&
- preg_match($regex, implode("\n", $http_response_header), $matches)
- ) {
- return (int)$matches[0];
- }
- return strlen(stream_get_contents($fp));
+getRegisteredExtensions()))
+ {
+ (new ImageController())->handleHash($hash,$u);
+ }
+ //or, a url
+ else if(in_array($extension,(new UrlController)->getRegisteredExtensions()))
+ {
+ var_dump("Url");
+ }
+ //or, a text
+ else if(in_array($extension,(new TextController)->getRegisteredExtensions()))
+ {
+ (new TextController())->handleHash($hash,$u);
+ }
+ //or, a video
+ else if(in_array($extension,(new VideoController)->getRegisteredExtensions()))
+ {
+ (new VideoController())->handleHash($hash,$u);
+ }
+ //very odd. We know it's a valid hash but no controller says it's one of their kids
+ //oh well, just show the main website
+ else
+ {
+ var_dump("odd err");
+ }
+
+ }
+
+ //var_dump($u);
+}
+
+function getNewHash($type,$length=10)
+{
+ while(1)
+ {
+ $hash = getRandomString($length).'.'.$type;
+ if(!isExistingHash($hash)) return $hash;
+ $length++;
+ }
+}
+
+function isExistingHash($hash)
+{
+ return is_dir(ROOT.DS.'data'.DS.$hash);
+}
+
+
+function autoload($className)
+{
+ if (file_exists(ROOT . DS . 'controllers' . DS . strtolower($className) . '.php'))
+ require_once(ROOT . DS . 'controllers' . DS . strtolower($className) . '.php');
+}
+
+function renderTemplate($template,$vars=false)
+{
+ extract($vars);
+ include_once(ROOT.DS.'templates'.DS.$template.'.html');
+}
+
+function getExtensionOfFilename($file)
+{
+ return pathinfo($file, PATHINFO_EXTENSION);
+}
+
+function sizeStringToWidthHeight($size)
+{
+ if(!$size || !$this->isSize($size)) return false;
+ if(!is_numeric($size))
+ $size = explode('x',$size);
+
+ if(is_array($size))
+ {
+ $maxwidth = $size[0];
+ $maxheight = $size[1];
+ }
+ else if($size)
+ {
+ $maxwidth = $size;
+ $maxheight = $size;
+ }
+
+ return array('width'=>$maxwidth,'height'=>$maxheight);
+}
+
+//
+// from: https://stackoverflow.com/questions/25975943/php-serve-mp4-chrome-provisional-headers-are-shown-request-is-not-finished-ye
+//
+function serveFile($filename, $filename_output = false, $mime = 'application/octet-stream')
+{
+ $buffer_size = 8192;
+ $expiry = 90; //days
+ if(!file_exists($filename))
+ {
+ throw new Exception('File not found: ' . $filename);
+ }
+ if(!is_readable($filename))
+ {
+ throw new Exception('File not readable: ' . $filename);
+ }
+ header_remove('Cache-Control');
+ header_remove('Pragma');
+ $byte_offset = 0;
+ $filesize_bytes = $filesize_original = filesize($filename);
+ header('Accept-Ranges: bytes', true);
+ header('Content-Type: ' . $mime, true);
+
+ header("Content-Disposition: inline;");
+ // Content-Range header for byte offsets
+ if (isset($_SERVER['HTTP_RANGE']) && preg_match('%bytes=(\d+)-(\d+)?%i', $_SERVER['HTTP_RANGE'], $match))
+ {
+ $byte_offset = (int) $match[1];//Offset signifies where we should begin to read the file
+ if (isset($match[2]))//Length is for how long we should read the file according to the browser, and can never go beyond the file size
+ {
+ $filesize_bytes = min((int) $match[2], $filesize_bytes - $byte_offset);
+ }
+ header("HTTP/1.1 206 Partial content");
+ header(sprintf('Content-Range: bytes %d-%d/%d', $byte_offset, $filesize_bytes - 1, $filesize_original)); ### Decrease by 1 on byte-length since this definition is zero-based index of bytes being sent
+ }
+ $byte_range = $filesize_bytes - $byte_offset;
+ header('Content-Length: ' . $byte_range);
+ header('Expires: ' . date('D, d M Y H:i:s', time() + 60 * 60 * 24 * $expiry) . ' GMT');
+ $buffer = '';
+ $bytes_remaining = $byte_range;
+ $handle = fopen($filename, 'r');
+ if(!$handle)
+ {
+ throw new Exception("Could not get handle for file: " . $filename);
+ }
+ if (fseek($handle, $byte_offset, SEEK_SET) == -1)
+ {
+ throw new Exception("Could not seek to byte offset %d", $byte_offset);
+ }
+ while ($bytes_remaining > 0)
+ {
+ $chunksize_requested = min($buffer_size, $bytes_remaining);
+ $buffer = fread($handle, $chunksize_requested);
+ $chunksize_real = strlen($buffer);
+ if ($chunksize_real == 0)
+ {
+ break;
+ }
+ $bytes_remaining -= $chunksize_real;
+ echo $buffer;
+ flush();
+ }
+}
+
+function sanatizeString($string)
+{
+ return preg_replace("/[^a-zA-Z0-9._\-]+/", "", $string);
+}
+
+function renderSize($byte)
+{
+ if($byte < 1024) {
+ $result = round($byte, 2). ' Byte';
+ }elseif($byte < pow(1024, 2)) {
+ $result = round($byte/1024, 2).' KB';
+ }elseif($byte >= pow(1024, 2) and $byte < pow(1024, 3)) {
+ $result = round($byte/pow(1024, 2), 2).' MB';
+ }elseif($byte >= pow(1024, 3) and $byte < pow(1024, 4)) {
+ $result = round($byte/pow(1024, 3), 2).' GB';
+ }elseif($byte >= pow(1024, 4) and $byte < pow(1024, 5)) {
+ $result = round($byte/pow(1024, 4), 2).' TB';
+ }elseif($byte >= pow(1024, 5) and $byte < pow(1024, 6)) {
+ $result = round($byte/pow(1024, 5), 2).' PB';
+ }elseif($byte >= pow(1024, 6) and $byte < pow(1024, 7)) {
+ $result = round($byte/pow(1024, 6), 2).' EB';
+ }
+
+ return $result;
+}
+
+function getTypeOfFile($url)
+{
+ $fi = new finfo(FILEINFO_MIME);
+ $type = $fi->buffer(file_get_contents($url, false, null, -1, 1024));
+
+ //to catch a strange error for PHP7 and Alpine Linux
+ //if the file seems to be a stream, use unix file command
+ if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN' && startsWith($type,'application/octet-stream'))
+ {
+ $content_type = exec("file -bi " . escapeshellarg($url));
+ if($content_type && $content_type!=$type && strpos($content_type,'/')!==false && strpos($content_type,';')!==false)
+ $type = $content_type;
+ }
+ if(startsWith($type,'text')) return 'text';
+ $arr = explode(';', trim($type));
+ if(count($arr)>1)
+ {
+ $a2 = explode('/', $arr[0]);
+ $type = $a2[1];
+ }
+ else
+ {
+ $a2 = explode('/', $type);
+ $type = $a2[1];
+ }
+
+ if($type=='octet-stream' && (new VideoController())->isProperMP4($url)) return 'mp4';
+ if($type=='mp4' && !(new VideoController())->isProperMP4($url))
+ return false;
+
+ return $type;
+}
+
+function getRandomString($length=32, $keyspace = '0123456789abcdefghijklmnopqrstuvwxyz')
+{
+ $str = '';
+ $max = mb_strlen($keyspace, '8bit') - 1;
+ for ($i = 0; $i < $length; ++$i) {
+ $str .= $keyspace[rand(0, $max)];
+ }
+ return $str;
+}
+function startsWith($haystack,$needle)
+{
+ $length = strlen($needle);
+ return (substr($haystack,0,$length) === $needle);
+}
+function endswith($string, $test) {
+ $strlen = strlen($string);
+ $testlen = strlen($test);
+ if ($testlen > $strlen) return false;
+ return substr_compare($string, $test, $strlen - $testlen, $testlen) === 0;
+}
+
+function getUserIP()
+{
+ $client = @$_SERVER['HTTP_CLIENT_IP'];
+ $forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
+ $remote = $_SERVER['REMOTE_ADDR'];
+
+ if(strpos($forward,','))
+ {
+ $a = explode(',',$forward);
+ $forward = trim($a[0]);
+ }
+ if(filter_var($forward, FILTER_VALIDATE_IP))
+ {
+ $ip = $forward;
+ }
+ elseif(filter_var($client, FILTER_VALIDATE_IP))
+ {
+ $ip = $client;
+ }
+ else
+ {
+ $ip = $remote;
+ }
+ return $ip;
}
\ No newline at end of file
diff --git a/inc/example.config.inc.php b/inc/example.config.inc.php
deleted file mode 100644
index 2dec85f..0000000
--- a/inc/example.config.inc.php
+++ /dev/null
@@ -1,109 +0,0 @@
-use backblaze false=>don't
-//define('BACKBLAZE_ID','');
-//define('BACKBLAZE_KEY', '');
-//define('BACKBLAZE_BUCKET_ID', '');
-//define('BACKBLAZE_BUCKET_NAME', '');
-//define('BACKBLAZE_AUTODOWNLOAD', true); //if true, will download images from backblaze if not found local
-//define('BACKBLAZE_AUTOUPLOAD', true); //if true, will upload images to backblaze when they are uploaded to pictshare
-//define('BACKBLAZE_AUTODELETE', true); //if true, will delete images from backblaze if they are deleted from pictshare
-
-
-//Backup Folder
-//========
-//If you have a NAS or some cifs or nfs mounted drive, you can specify this here as a folder
-//if a requested hash is not found locally, its looked up on this location. This allows for mounted external spaces
-//or just backups on a second drive.
-//Also new hashes will be uploaded/copied there (just the originals, not resizes)
-//value should be a path **without tailing slash**!
-
-//define('ALT_FOLDER','/mnt');
-
-//FFMPEG
-//========
-//If you are using PictShare on some other machine than x64 linux (eg raspberry pi or windows) the builtin ffmpeg binary won't work
-//this is why you can define an alternative path to the ffmpeg binary here.
-
-//define('FFMPEG_BINARY','/usr/bin/ffmpeg');
-
diff --git a/index.php b/index.php
index d8146c4..fff5e0b 100644
--- a/index.php
+++ b/index.php
@@ -1,27 +1,21 @@
1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+
+ for (var _iterator = callbacks, _isArray = true, _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
+ var _ref;
+
+ if (_isArray) {
+ if (_i >= _iterator.length) break;
+ _ref = _iterator[_i++];
+ } else {
+ _i = _iterator.next();
+ if (_i.done) break;
+ _ref = _i.value;
+ }
+
+ var callback = _ref;
+
+ callback.apply(this, args);
+ }
+ }
+
+ return this;
+ }
+
+ // Remove event listener for given event. If fn is not provided, all event
+ // listeners for that event will be removed. If neither is provided, all
+ // event listeners will be removed.
+
+ }, {
+ key: "off",
+ value: function off(event, fn) {
+ if (!this._callbacks || arguments.length === 0) {
+ this._callbacks = {};
+ return this;
+ }
+
+ // specific event
+ var callbacks = this._callbacks[event];
+ if (!callbacks) {
+ return this;
+ }
+
+ // remove all handlers
+ if (arguments.length === 1) {
+ delete this._callbacks[event];
+ return this;
+ }
+
+ // remove specific handler
+ for (var i = 0; i < callbacks.length; i++) {
+ var callback = callbacks[i];
+ if (callback === fn) {
+ callbacks.splice(i, 1);
+ break;
+ }
+ }
+
+ return this;
+ }
+ }]);
+
+ return Emitter;
+}();
+
+var Dropzone = function (_Emitter) {
+ _inherits(Dropzone, _Emitter);
+
+ _createClass(Dropzone, null, [{
+ key: "initClass",
+ value: function initClass() {
+
+ // Exposing the emitter class, mainly for tests
+ this.prototype.Emitter = Emitter;
+
+ /*
+ This is a list of all available events you can register on a dropzone object.
+ You can register an event handler like this:
+ dropzone.on("dragEnter", function() { });
+ */
+ this.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "addedfiles", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"];
+
+ this.prototype.defaultOptions = {
+ /**
+ * Has to be specified on elements other than form (or when the form
+ * doesn't have an `action` attribute). You can also
+ * provide a function that will be called with `files` and
+ * must return the url (since `v3.12.0`)
+ */
+ url: null,
+
+ /**
+ * Can be changed to `"put"` if necessary. You can also provide a function
+ * that will be called with `files` and must return the method (since `v3.12.0`).
+ */
+ method: "post",
+
+ /**
+ * Will be set on the XHRequest.
+ */
+ withCredentials: false,
+
+ /**
+ * The timeout for the XHR requests in milliseconds (since `v4.4.0`).
+ */
+ timeout: 30000,
+
+ /**
+ * How many file uploads to process in parallel (See the
+ * Enqueuing file uploads* documentation section for more info)
+ */
+ parallelUploads: 2,
+
+ /**
+ * Whether to send multiple files in one request. If
+ * this it set to true, then the fallback file input element will
+ * have the `multiple` attribute as well. This option will
+ * also trigger additional events (like `processingmultiple`). See the events
+ * documentation section for more information.
+ */
+ uploadMultiple: false,
+
+ /**
+ * Whether you want files to be uploaded in chunks to your server. This can't be
+ * used in combination with `uploadMultiple`.
+ *
+ * See [chunksUploaded](#config-chunksUploaded) for the callback to finalise an upload.
+ */
+ chunking: false,
+
+ /**
+ * If `chunking` is enabled, this defines whether **every** file should be chunked,
+ * even if the file size is below chunkSize. This means, that the additional chunk
+ * form data will be submitted and the `chunksUploaded` callback will be invoked.
+ */
+ forceChunking: false,
+
+ /**
+ * If `chunking` is `true`, then this defines the chunk size in bytes.
+ */
+ chunkSize: 2000000,
+
+ /**
+ * If `true`, the individual chunks of a file are being uploaded simultaneously.
+ */
+ parallelChunkUploads: false,
+
+ /**
+ * Whether a chunk should be retried if it fails.
+ */
+ retryChunks: false,
+
+ /**
+ * If `retryChunks` is true, how many times should it be retried.
+ */
+ retryChunksLimit: 3,
+
+ /**
+ * If not `null` defines how many files this Dropzone handles. If it exceeds,
+ * the event `maxfilesexceeded` will be called. The dropzone element gets the
+ * class `dz-max-files-reached` accordingly so you can provide visual feedback.
+ */
+ maxFilesize: 256,
+
+ /**
+ * The name of the file param that gets transferred.
+ * **NOTE**: If you have the option `uploadMultiple` set to `true`, then
+ * Dropzone will append `[]` to the name.
+ */
+ paramName: "file",
+
+ /**
+ * Whether thumbnails for images should be generated
+ */
+ createImageThumbnails: true,
+
+ /**
+ * In MB. When the filename exceeds this limit, the thumbnail will not be generated.
+ */
+ maxThumbnailFilesize: 10,
+
+ /**
+ * If `null`, the ratio of the image will be used to calculate it.
+ */
+ thumbnailWidth: 120,
+
+ /**
+ * The same as `thumbnailWidth`. If both are null, images will not be resized.
+ */
+ thumbnailHeight: 120,
+
+ /**
+ * How the images should be scaled down in case both, `thumbnailWidth` and `thumbnailHeight` are provided.
+ * Can be either `contain` or `crop`.
+ */
+ thumbnailMethod: 'crop',
+
+ /**
+ * If set, images will be resized to these dimensions before being **uploaded**.
+ * If only one, `resizeWidth` **or** `resizeHeight` is provided, the original aspect
+ * ratio of the file will be preserved.
+ *
+ * The `options.transformFile` function uses these options, so if the `transformFile` function
+ * is overridden, these options don't do anything.
+ */
+ resizeWidth: null,
+
+ /**
+ * See `resizeWidth`.
+ */
+ resizeHeight: null,
+
+ /**
+ * The mime type of the resized image (before it gets uploaded to the server).
+ * If `null` the original mime type will be used. To force jpeg, for example, use `image/jpeg`.
+ * See `resizeWidth` for more information.
+ */
+ resizeMimeType: null,
+
+ /**
+ * The quality of the resized images. See `resizeWidth`.
+ */
+ resizeQuality: 0.8,
+
+ /**
+ * How the images should be scaled down in case both, `resizeWidth` and `resizeHeight` are provided.
+ * Can be either `contain` or `crop`.
+ */
+ resizeMethod: 'contain',
+
+ /**
+ * The base that is used to calculate the filesize. You can change this to
+ * 1024 if you would rather display kibibytes, mebibytes, etc...
+ * 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte` not `1 kilobyte`.
+ * You can change this to `1024` if you don't care about validity.
+ */
+ filesizeBase: 1000,
+
+ /**
+ * Can be used to limit the maximum number of files that will be handled by this Dropzone
+ */
+ maxFiles: null,
+
+ /**
+ * An optional object to send additional headers to the server. Eg:
+ * `{ "My-Awesome-Header": "header value" }`
+ */
+ headers: null,
+
+ /**
+ * If `true`, the dropzone element itself will be clickable, if `false`
+ * nothing will be clickable.
+ *
+ * You can also pass an HTML element, a CSS selector (for multiple elements)
+ * or an array of those. In that case, all of those elements will trigger an
+ * upload when clicked.
+ */
+ clickable: true,
+
+ /**
+ * Whether hidden files in directories should be ignored.
+ */
+ ignoreHiddenFiles: true,
+
+ /**
+ * The default implementation of `accept` checks the file's mime type or
+ * extension against this list. This is a comma separated list of mime
+ * types or file extensions.
+ *
+ * Eg.: `image/*,application/pdf,.psd`
+ *
+ * If the Dropzone is `clickable` this option will also be used as
+ * [`accept`](https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept)
+ * parameter on the hidden file input as well.
+ */
+ acceptedFiles: null,
+
+ /**
+ * **Deprecated!**
+ * Use acceptedFiles instead.
+ */
+ acceptedMimeTypes: null,
+
+ /**
+ * If false, files will be added to the queue but the queue will not be
+ * processed automatically.
+ * This can be useful if you need some additional user input before sending
+ * files (or if you want want all files sent at once).
+ * If you're ready to send the file simply call `myDropzone.processQueue()`.
+ *
+ * See the [enqueuing file uploads](#enqueuing-file-uploads) documentation
+ * section for more information.
+ */
+ autoProcessQueue: true,
+
+ /**
+ * If false, files added to the dropzone will not be queued by default.
+ * You'll have to call `enqueueFile(file)` manually.
+ */
+ autoQueue: true,
+
+ /**
+ * If `true`, this will add a link to every file preview to remove or cancel (if
+ * already uploading) the file. The `dictCancelUpload`, `dictCancelUploadConfirmation`
+ * and `dictRemoveFile` options are used for the wording.
+ */
+ addRemoveLinks: false,
+
+ /**
+ * Defines where to display the file previews – if `null` the
+ * Dropzone element itself is used. Can be a plain `HTMLElement` or a CSS
+ * selector. The element should have the `dropzone-previews` class so
+ * the previews are displayed properly.
+ */
+ previewsContainer: null,
+
+ /**
+ * This is the element the hidden input field (which is used when clicking on the
+ * dropzone to trigger file selection) will be appended to. This might
+ * be important in case you use frameworks to switch the content of your page.
+ *
+ * Can be a selector string, or an element directly.
+ */
+ hiddenInputContainer: "body",
+
+ /**
+ * If null, no capture type will be specified
+ * If camera, mobile devices will skip the file selection and choose camera
+ * If microphone, mobile devices will skip the file selection and choose the microphone
+ * If camcorder, mobile devices will skip the file selection and choose the camera in video mode
+ * On apple devices multiple must be set to false. AcceptedFiles may need to
+ * be set to an appropriate mime type (e.g. "image/*", "audio/*", or "video/*").
+ */
+ capture: null,
+
+ /**
+ * **Deprecated**. Use `renameFile` instead.
+ */
+ renameFilename: null,
+
+ /**
+ * A function that is invoked before the file is uploaded to the server and renames the file.
+ * This function gets the `File` as argument and can use the `file.name`. The actual name of the
+ * file that gets used during the upload can be accessed through `file.upload.filename`.
+ */
+ renameFile: null,
+
+ /**
+ * If `true` the fallback will be forced. This is very useful to test your server
+ * implementations first and make sure that everything works as
+ * expected without dropzone if you experience problems, and to test
+ * how your fallbacks will look.
+ */
+ forceFallback: false,
+
+ /**
+ * The text used before any files are dropped.
+ */
+ dictDefaultMessage: "Drop files here to upload",
+
+ /**
+ * The text that replaces the default message text it the browser is not supported.
+ */
+ dictFallbackMessage: "Your browser does not support drag'n'drop file uploads.",
+
+ /**
+ * The text that will be added before the fallback form.
+ * If you provide a fallback element yourself, or if this option is `null` this will
+ * be ignored.
+ */
+ dictFallbackText: "Please use the fallback form below to upload your files like in the olden days.",
+
+ /**
+ * If the filesize is too big.
+ * `{{filesize}}` and `{{maxFilesize}}` will be replaced with the respective configuration values.
+ */
+ dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",
+
+ /**
+ * If the file doesn't match the file type.
+ */
+ dictInvalidFileType: "You can't upload files of this type.",
+
+ /**
+ * If the server response was invalid.
+ * `{{statusCode}}` will be replaced with the servers status code.
+ */
+ dictResponseError: "Server responded with {{statusCode}} code.",
+
+ /**
+ * If `addRemoveLinks` is true, the text to be used for the cancel upload link.
+ */
+ dictCancelUpload: "Cancel upload",
+
+ /**
+ * The text that is displayed if an upload was manually canceled
+ */
+ dictUploadCanceled: "Upload canceled.",
+
+ /**
+ * If `addRemoveLinks` is true, the text to be used for confirmation when cancelling upload.
+ */
+ dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?",
+
+ /**
+ * If `addRemoveLinks` is true, the text to be used to remove a file.
+ */
+ dictRemoveFile: "Remove file",
+
+ /**
+ * If this is not null, then the user will be prompted before removing a file.
+ */
+ dictRemoveFileConfirmation: null,
+
+ /**
+ * Displayed if `maxFiles` is st and exceeded.
+ * The string `{{maxFiles}}` will be replaced by the configuration value.
+ */
+ dictMaxFilesExceeded: "You can not upload any more files.",
+
+ /**
+ * Allows you to translate the different units. Starting with `tb` for terabytes and going down to
+ * `b` for bytes.
+ */
+ dictFileSizeUnits: { tb: "TB", gb: "GB", mb: "MB", kb: "KB", b: "b" },
+ /**
+ * Called when dropzone initialized
+ * You can add event listeners here
+ */
+ init: function init() {},
+
+
+ /**
+ * Can be an **object** of additional parameters to transfer to the server, **or** a `Function`
+ * that gets invoked with the `files`, `xhr` and, if it's a chunked upload, `chunk` arguments. In case
+ * of a function, this needs to return a map.
+ *
+ * The default implementation does nothing for normal uploads, but adds relevant information for
+ * chunked uploads.
+ *
+ * This is the same as adding hidden input fields in the form element.
+ */
+ params: function params(files, xhr, chunk) {
+ if (chunk) {
+ return {
+ dzuuid: chunk.file.upload.uuid,
+ dzchunkindex: chunk.index,
+ dztotalfilesize: chunk.file.size,
+ dzchunksize: this.options.chunkSize,
+ dztotalchunkcount: chunk.file.upload.totalChunkCount,
+ dzchunkbyteoffset: chunk.index * this.options.chunkSize
+ };
+ }
+ },
+
+
+ /**
+ * A function that gets a [file](https://developer.mozilla.org/en-US/docs/DOM/File)
+ * and a `done` function as parameters.
+ *
+ * If the done function is invoked without arguments, the file is "accepted" and will
+ * be processed. If you pass an error message, the file is rejected, and the error
+ * message will be displayed.
+ * This function will not be called if the file is too big or doesn't match the mime types.
+ */
+ accept: function accept(file, done) {
+ return done();
+ },
+
+
+ /**
+ * The callback that will be invoked when all chunks have been uploaded for a file.
+ * It gets the file for which the chunks have been uploaded as the first parameter,
+ * and the `done` function as second. `done()` needs to be invoked when everything
+ * needed to finish the upload process is done.
+ */
+ chunksUploaded: function chunksUploaded(file, done) {
+ done();
+ },
+
+ /**
+ * Gets called when the browser is not supported.
+ * The default implementation shows the fallback input field and adds
+ * a text.
+ */
+ fallback: function fallback() {
+ // This code should pass in IE7... :(
+ var messageElement = void 0;
+ this.element.className = this.element.className + " dz-browser-not-supported";
+
+ for (var _iterator2 = this.element.getElementsByTagName("div"), _isArray2 = true, _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
+ var _ref2;
+
+ if (_isArray2) {
+ if (_i2 >= _iterator2.length) break;
+ _ref2 = _iterator2[_i2++];
+ } else {
+ _i2 = _iterator2.next();
+ if (_i2.done) break;
+ _ref2 = _i2.value;
+ }
+
+ var child = _ref2;
+
+ if (/(^| )dz-message($| )/.test(child.className)) {
+ messageElement = child;
+ child.className = "dz-message"; // Removes the 'dz-default' class
+ break;
+ }
+ }
+ if (!messageElement) {
+ messageElement = Dropzone.createElement("
");
+ this.element.appendChild(messageElement);
+ }
+
+ var span = messageElement.getElementsByTagName("span")[0];
+ if (span) {
+ if (span.textContent != null) {
+ span.textContent = this.options.dictFallbackMessage;
+ } else if (span.innerText != null) {
+ span.innerText = this.options.dictFallbackMessage;
+ }
+ }
+
+ return this.element.appendChild(this.getFallbackForm());
+ },
+
+
+ /**
+ * Gets called to calculate the thumbnail dimensions.
+ *
+ * It gets `file`, `width` and `height` (both may be `null`) as parameters and must return an object containing:
+ *
+ * - `srcWidth` & `srcHeight` (required)
+ * - `trgWidth` & `trgHeight` (required)
+ * - `srcX` & `srcY` (optional, default `0`)
+ * - `trgX` & `trgY` (optional, default `0`)
+ *
+ * Those values are going to be used by `ctx.drawImage()`.
+ */
+ resize: function resize(file, width, height, resizeMethod) {
+ var info = {
+ srcX: 0,
+ srcY: 0,
+ srcWidth: file.width,
+ srcHeight: file.height
+ };
+
+ var srcRatio = file.width / file.height;
+
+ // Automatically calculate dimensions if not specified
+ if (width == null && height == null) {
+ width = info.srcWidth;
+ height = info.srcHeight;
+ } else if (width == null) {
+ width = height * srcRatio;
+ } else if (height == null) {
+ height = width / srcRatio;
+ }
+
+ // Make sure images aren't upscaled
+ width = Math.min(width, info.srcWidth);
+ height = Math.min(height, info.srcHeight);
+
+ var trgRatio = width / height;
+
+ if (info.srcWidth > width || info.srcHeight > height) {
+ // Image is bigger and needs rescaling
+ if (resizeMethod === 'crop') {
+ if (srcRatio > trgRatio) {
+ info.srcHeight = file.height;
+ info.srcWidth = info.srcHeight * trgRatio;
+ } else {
+ info.srcWidth = file.width;
+ info.srcHeight = info.srcWidth / trgRatio;
+ }
+ } else if (resizeMethod === 'contain') {
+ // Method 'contain'
+ if (srcRatio > trgRatio) {
+ height = width / srcRatio;
+ } else {
+ width = height * srcRatio;
+ }
+ } else {
+ throw new Error("Unknown resizeMethod '" + resizeMethod + "'");
+ }
+ }
+
+ info.srcX = (file.width - info.srcWidth) / 2;
+ info.srcY = (file.height - info.srcHeight) / 2;
+
+ info.trgWidth = width;
+ info.trgHeight = height;
+
+ return info;
+ },
+
+
+ /**
+ * Can be used to transform the file (for example, resize an image if necessary).
+ *
+ * The default implementation uses `resizeWidth` and `resizeHeight` (if provided) and resizes
+ * images according to those dimensions.
+ *
+ * Gets the `file` as the first parameter, and a `done()` function as the second, that needs
+ * to be invoked with the file when the transformation is done.
+ */
+ transformFile: function transformFile(file, done) {
+ if ((this.options.resizeWidth || this.options.resizeHeight) && file.type.match(/image.*/)) {
+ return this.resizeImage(file, this.options.resizeWidth, this.options.resizeHeight, this.options.resizeMethod, done);
+ } else {
+ return done(file);
+ }
+ },
+
+
+ /**
+ * A string that contains the template used for each dropped
+ * file. Change it to fulfill your needs but make sure to properly
+ * provide all elements.
+ *
+ * If you want to use an actual HTML element instead of providing a String
+ * as a config option, you could create a div with the id `tpl`,
+ * put the template inside it and provide the element like this:
+ *
+ * document
+ * .querySelector('#tpl')
+ * .innerHTML
+ *
+ */
+ previewTemplate: "\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
",
+
+ // END OPTIONS
+ // (Required by the dropzone documentation parser)
+
+
+ /*
+ Those functions register themselves to the events on init and handle all
+ the user interface specific stuff. Overwriting them won't break the upload
+ but can break the way it's displayed.
+ You can overwrite them if you don't like the default behavior. If you just
+ want to add an additional event handler, register it on the dropzone object
+ and don't overwrite those options.
+ */
+
+ // Those are self explanatory and simply concern the DragnDrop.
+ drop: function drop(e) {
+ return this.element.classList.remove("dz-drag-hover");
+ },
+ dragstart: function dragstart(e) {},
+ dragend: function dragend(e) {
+ return this.element.classList.remove("dz-drag-hover");
+ },
+ dragenter: function dragenter(e) {
+ return this.element.classList.add("dz-drag-hover");
+ },
+ dragover: function dragover(e) {
+ return this.element.classList.add("dz-drag-hover");
+ },
+ dragleave: function dragleave(e) {
+ return this.element.classList.remove("dz-drag-hover");
+ },
+ paste: function paste(e) {},
+
+
+ // Called whenever there are no files left in the dropzone anymore, and the
+ // dropzone should be displayed as if in the initial state.
+ reset: function reset() {
+ return this.element.classList.remove("dz-started");
+ },
+
+
+ // Called when a file is added to the queue
+ // Receives `file`
+ addedfile: function addedfile(file) {
+ var _this2 = this;
+
+ if (this.element === this.previewsContainer) {
+ this.element.classList.add("dz-started");
+ }
+
+ if (this.previewsContainer) {
+ file.previewElement = Dropzone.createElement(this.options.previewTemplate.trim());
+ file.previewTemplate = file.previewElement; // Backwards compatibility
+
+ this.previewsContainer.appendChild(file.previewElement);
+ for (var _iterator3 = file.previewElement.querySelectorAll("[data-dz-name]"), _isArray3 = true, _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
+ var _ref3;
+
+ if (_isArray3) {
+ if (_i3 >= _iterator3.length) break;
+ _ref3 = _iterator3[_i3++];
+ } else {
+ _i3 = _iterator3.next();
+ if (_i3.done) break;
+ _ref3 = _i3.value;
+ }
+
+ var node = _ref3;
+
+ node.textContent = file.name;
+ }
+ for (var _iterator4 = file.previewElement.querySelectorAll("[data-dz-size]"), _isArray4 = true, _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
+ if (_isArray4) {
+ if (_i4 >= _iterator4.length) break;
+ node = _iterator4[_i4++];
+ } else {
+ _i4 = _iterator4.next();
+ if (_i4.done) break;
+ node = _i4.value;
+ }
+
+ node.innerHTML = this.filesize(file.size);
+ }
+
+ if (this.options.addRemoveLinks) {
+ file._removeLink = Dropzone.createElement("" + this.options.dictRemoveFile + "");
+ file.previewElement.appendChild(file._removeLink);
+ }
+
+ var removeFileEvent = function removeFileEvent(e) {
+ e.preventDefault();
+ e.stopPropagation();
+ if (file.status === Dropzone.UPLOADING) {
+ return Dropzone.confirm(_this2.options.dictCancelUploadConfirmation, function () {
+ return _this2.removeFile(file);
+ });
+ } else {
+ if (_this2.options.dictRemoveFileConfirmation) {
+ return Dropzone.confirm(_this2.options.dictRemoveFileConfirmation, function () {
+ return _this2.removeFile(file);
+ });
+ } else {
+ return _this2.removeFile(file);
+ }
+ }
+ };
+
+ for (var _iterator5 = file.previewElement.querySelectorAll("[data-dz-remove]"), _isArray5 = true, _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
+ var _ref4;
+
+ if (_isArray5) {
+ if (_i5 >= _iterator5.length) break;
+ _ref4 = _iterator5[_i5++];
+ } else {
+ _i5 = _iterator5.next();
+ if (_i5.done) break;
+ _ref4 = _i5.value;
+ }
+
+ var removeLink = _ref4;
+
+ removeLink.addEventListener("click", removeFileEvent);
+ }
+ }
+ },
+
+
+ // Called whenever a file is removed.
+ removedfile: function removedfile(file) {
+ if (file.previewElement != null && file.previewElement.parentNode != null) {
+ file.previewElement.parentNode.removeChild(file.previewElement);
+ }
+ return this._updateMaxFilesReachedClass();
+ },
+
+
+ // Called when a thumbnail has been generated
+ // Receives `file` and `dataUrl`
+ thumbnail: function thumbnail(file, dataUrl) {
+ if (file.previewElement) {
+ file.previewElement.classList.remove("dz-file-preview");
+ for (var _iterator6 = file.previewElement.querySelectorAll("[data-dz-thumbnail]"), _isArray6 = true, _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
+ var _ref5;
+
+ if (_isArray6) {
+ if (_i6 >= _iterator6.length) break;
+ _ref5 = _iterator6[_i6++];
+ } else {
+ _i6 = _iterator6.next();
+ if (_i6.done) break;
+ _ref5 = _i6.value;
+ }
+
+ var thumbnailElement = _ref5;
+
+ thumbnailElement.alt = file.name;
+ thumbnailElement.src = dataUrl;
+ }
+
+ return setTimeout(function () {
+ return file.previewElement.classList.add("dz-image-preview");
+ }, 1);
+ }
+ },
+
+
+ // Called whenever an error occurs
+ // Receives `file` and `message`
+ error: function error(file, message) {
+ if (file.previewElement) {
+ file.previewElement.classList.add("dz-error");
+ if (typeof message !== "String" && message.error) {
+ message = message.error;
+ }
+ for (var _iterator7 = file.previewElement.querySelectorAll("[data-dz-errormessage]"), _isArray7 = true, _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
+ var _ref6;
+
+ if (_isArray7) {
+ if (_i7 >= _iterator7.length) break;
+ _ref6 = _iterator7[_i7++];
+ } else {
+ _i7 = _iterator7.next();
+ if (_i7.done) break;
+ _ref6 = _i7.value;
+ }
+
+ var node = _ref6;
+
+ node.textContent = message;
+ }
+ }
+ },
+ errormultiple: function errormultiple() {},
+
+
+ // Called when a file gets processed. Since there is a cue, not all added
+ // files are processed immediately.
+ // Receives `file`
+ processing: function processing(file) {
+ if (file.previewElement) {
+ file.previewElement.classList.add("dz-processing");
+ if (file._removeLink) {
+ return file._removeLink.innerHTML = this.options.dictCancelUpload;
+ }
+ }
+ },
+ processingmultiple: function processingmultiple() {},
+
+
+ // Called whenever the upload progress gets updated.
+ // Receives `file`, `progress` (percentage 0-100) and `bytesSent`.
+ // To get the total number of bytes of the file, use `file.size`
+ uploadprogress: function uploadprogress(file, progress, bytesSent) {
+ if (file.previewElement) {
+ for (var _iterator8 = file.previewElement.querySelectorAll("[data-dz-uploadprogress]"), _isArray8 = true, _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
+ var _ref7;
+
+ if (_isArray8) {
+ if (_i8 >= _iterator8.length) break;
+ _ref7 = _iterator8[_i8++];
+ } else {
+ _i8 = _iterator8.next();
+ if (_i8.done) break;
+ _ref7 = _i8.value;
+ }
+
+ var node = _ref7;
+
+ node.nodeName === 'PROGRESS' ? node.value = progress : node.style.width = progress + "%";
+ }
+ }
+ },
+
+
+ // Called whenever the total upload progress gets updated.
+ // Called with totalUploadProgress (0-100), totalBytes and totalBytesSent
+ totaluploadprogress: function totaluploadprogress() {},
+
+
+ // Called just before the file is sent. Gets the `xhr` object as second
+ // parameter, so you can modify it (for example to add a CSRF token) and a
+ // `formData` object to add additional information.
+ sending: function sending() {},
+ sendingmultiple: function sendingmultiple() {},
+
+
+ // When the complete upload is finished and successful
+ // Receives `file`
+ success: function success(file) {
+ if (file.previewElement) {
+ return file.previewElement.classList.add("dz-success");
+ }
+ },
+ successmultiple: function successmultiple() {},
+
+
+ // When the upload is canceled.
+ canceled: function canceled(file) {
+ return this.emit("error", file, this.options.dictUploadCanceled);
+ },
+ canceledmultiple: function canceledmultiple() {},
+
+
+ // When the upload is finished, either with success or an error.
+ // Receives `file`
+ complete: function complete(file) {
+ if (file._removeLink) {
+ file._removeLink.innerHTML = this.options.dictRemoveFile;
+ }
+ if (file.previewElement) {
+ return file.previewElement.classList.add("dz-complete");
+ }
+ },
+ completemultiple: function completemultiple() {},
+ maxfilesexceeded: function maxfilesexceeded() {},
+ maxfilesreached: function maxfilesreached() {},
+ queuecomplete: function queuecomplete() {},
+ addedfiles: function addedfiles() {}
+ };
+
+ this.prototype._thumbnailQueue = [];
+ this.prototype._processingThumbnail = false;
+ }
+
+ // global utility
+
+ }, {
+ key: "extend",
+ value: function extend(target) {
+ for (var _len2 = arguments.length, objects = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
+ objects[_key2 - 1] = arguments[_key2];
+ }
+
+ for (var _iterator9 = objects, _isArray9 = true, _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) {
+ var _ref8;
+
+ if (_isArray9) {
+ if (_i9 >= _iterator9.length) break;
+ _ref8 = _iterator9[_i9++];
+ } else {
+ _i9 = _iterator9.next();
+ if (_i9.done) break;
+ _ref8 = _i9.value;
+ }
+
+ var object = _ref8;
+
+ for (var key in object) {
+ var val = object[key];
+ target[key] = val;
+ }
+ }
+ return target;
+ }
+ }]);
+
+ function Dropzone(el, options) {
+ _classCallCheck(this, Dropzone);
+
+ var _this = _possibleConstructorReturn(this, (Dropzone.__proto__ || Object.getPrototypeOf(Dropzone)).call(this));
+
+ var fallback = void 0,
+ left = void 0;
+ _this.element = el;
+ // For backwards compatibility since the version was in the prototype previously
+ _this.version = Dropzone.version;
+
+ _this.defaultOptions.previewTemplate = _this.defaultOptions.previewTemplate.replace(/\n*/g, "");
+
+ _this.clickableElements = [];
+ _this.listeners = [];
+ _this.files = []; // All files
+
+ if (typeof _this.element === "string") {
+ _this.element = document.querySelector(_this.element);
+ }
+
+ // Not checking if instance of HTMLElement or Element since IE9 is extremely weird.
+ if (!_this.element || _this.element.nodeType == null) {
+ throw new Error("Invalid dropzone element.");
+ }
+
+ if (_this.element.dropzone) {
+ throw new Error("Dropzone already attached.");
+ }
+
+ // Now add this dropzone to the instances.
+ Dropzone.instances.push(_this);
+
+ // Put the dropzone inside the element itself.
+ _this.element.dropzone = _this;
+
+ var elementOptions = (left = Dropzone.optionsForElement(_this.element)) != null ? left : {};
+
+ _this.options = Dropzone.extend({}, _this.defaultOptions, elementOptions, options != null ? options : {});
+
+ // If the browser failed, just call the fallback and leave
+ if (_this.options.forceFallback || !Dropzone.isBrowserSupported()) {
+ var _ret;
+
+ return _ret = _this.options.fallback.call(_this), _possibleConstructorReturn(_this, _ret);
+ }
+
+ // @options.url = @element.getAttribute "action" unless @options.url?
+ if (_this.options.url == null) {
+ _this.options.url = _this.element.getAttribute("action");
+ }
+
+ if (!_this.options.url) {
+ throw new Error("No URL provided.");
+ }
+
+ if (_this.options.acceptedFiles && _this.options.acceptedMimeTypes) {
+ throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");
+ }
+
+ if (_this.options.uploadMultiple && _this.options.chunking) {
+ throw new Error('You cannot set both: uploadMultiple and chunking.');
+ }
+
+ // Backwards compatibility
+ if (_this.options.acceptedMimeTypes) {
+ _this.options.acceptedFiles = _this.options.acceptedMimeTypes;
+ delete _this.options.acceptedMimeTypes;
+ }
+
+ // Backwards compatibility
+ if (_this.options.renameFilename != null) {
+ _this.options.renameFile = function (file) {
+ return _this.options.renameFilename.call(_this, file.name, file);
+ };
+ }
+
+ _this.options.method = _this.options.method.toUpperCase();
+
+ if ((fallback = _this.getExistingFallback()) && fallback.parentNode) {
+ // Remove the fallback
+ fallback.parentNode.removeChild(fallback);
+ }
+
+ // Display previews in the previewsContainer element or the Dropzone element unless explicitly set to false
+ if (_this.options.previewsContainer !== false) {
+ if (_this.options.previewsContainer) {
+ _this.previewsContainer = Dropzone.getElement(_this.options.previewsContainer, "previewsContainer");
+ } else {
+ _this.previewsContainer = _this.element;
+ }
+ }
+
+ if (_this.options.clickable) {
+ if (_this.options.clickable === true) {
+ _this.clickableElements = [_this.element];
+ } else {
+ _this.clickableElements = Dropzone.getElements(_this.options.clickable, "clickable");
+ }
+ }
+
+ _this.init();
+ return _this;
+ }
+
+ // Returns all files that have been accepted
+
+
+ _createClass(Dropzone, [{
+ key: "getAcceptedFiles",
+ value: function getAcceptedFiles() {
+ return this.files.filter(function (file) {
+ return file.accepted;
+ }).map(function (file) {
+ return file;
+ });
+ }
+
+ // Returns all files that have been rejected
+ // Not sure when that's going to be useful, but added for completeness.
+
+ }, {
+ key: "getRejectedFiles",
+ value: function getRejectedFiles() {
+ return this.files.filter(function (file) {
+ return !file.accepted;
+ }).map(function (file) {
+ return file;
+ });
+ }
+ }, {
+ key: "getFilesWithStatus",
+ value: function getFilesWithStatus(status) {
+ return this.files.filter(function (file) {
+ return file.status === status;
+ }).map(function (file) {
+ return file;
+ });
+ }
+
+ // Returns all files that are in the queue
+
+ }, {
+ key: "getQueuedFiles",
+ value: function getQueuedFiles() {
+ return this.getFilesWithStatus(Dropzone.QUEUED);
+ }
+ }, {
+ key: "getUploadingFiles",
+ value: function getUploadingFiles() {
+ return this.getFilesWithStatus(Dropzone.UPLOADING);
+ }
+ }, {
+ key: "getAddedFiles",
+ value: function getAddedFiles() {
+ return this.getFilesWithStatus(Dropzone.ADDED);
+ }
+
+ // Files that are either queued or uploading
+
+ }, {
+ key: "getActiveFiles",
+ value: function getActiveFiles() {
+ return this.files.filter(function (file) {
+ return file.status === Dropzone.UPLOADING || file.status === Dropzone.QUEUED;
+ }).map(function (file) {
+ return file;
+ });
+ }
+
+ // The function that gets called when Dropzone is initialized. You
+ // can (and should) setup event listeners inside this function.
+
+ }, {
+ key: "init",
+ value: function init() {
+ var _this3 = this;
+
+ // In case it isn't set already
+ if (this.element.tagName === "form") {
+ this.element.setAttribute("enctype", "multipart/form-data");
+ }
+
+ if (this.element.classList.contains("dropzone") && !this.element.querySelector(".dz-message")) {
+ this.element.appendChild(Dropzone.createElement("" + this.options.dictDefaultMessage + "
"));
+ }
+
+ if (this.clickableElements.length) {
+ var setupHiddenFileInput = function setupHiddenFileInput() {
+ if (_this3.hiddenFileInput) {
+ _this3.hiddenFileInput.parentNode.removeChild(_this3.hiddenFileInput);
+ }
+ _this3.hiddenFileInput = document.createElement("input");
+ _this3.hiddenFileInput.setAttribute("type", "file");
+ if (_this3.options.maxFiles === null || _this3.options.maxFiles > 1) {
+ _this3.hiddenFileInput.setAttribute("multiple", "multiple");
+ }
+ _this3.hiddenFileInput.className = "dz-hidden-input";
+
+ if (_this3.options.acceptedFiles !== null) {
+ _this3.hiddenFileInput.setAttribute("accept", _this3.options.acceptedFiles);
+ }
+ if (_this3.options.capture !== null) {
+ _this3.hiddenFileInput.setAttribute("capture", _this3.options.capture);
+ }
+
+ // Not setting `display="none"` because some browsers don't accept clicks
+ // on elements that aren't displayed.
+ _this3.hiddenFileInput.style.visibility = "hidden";
+ _this3.hiddenFileInput.style.position = "absolute";
+ _this3.hiddenFileInput.style.top = "0";
+ _this3.hiddenFileInput.style.left = "0";
+ _this3.hiddenFileInput.style.height = "0";
+ _this3.hiddenFileInput.style.width = "0";
+ Dropzone.getElement(_this3.options.hiddenInputContainer, 'hiddenInputContainer').appendChild(_this3.hiddenFileInput);
+ return _this3.hiddenFileInput.addEventListener("change", function () {
+ var files = _this3.hiddenFileInput.files;
+
+ if (files.length) {
+ for (var _iterator10 = files, _isArray10 = true, _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) {
+ var _ref9;
+
+ if (_isArray10) {
+ if (_i10 >= _iterator10.length) break;
+ _ref9 = _iterator10[_i10++];
+ } else {
+ _i10 = _iterator10.next();
+ if (_i10.done) break;
+ _ref9 = _i10.value;
+ }
+
+ var file = _ref9;
+
+ _this3.addFile(file);
+ }
+ }
+ _this3.emit("addedfiles", files);
+ return setupHiddenFileInput();
+ });
+ };
+ setupHiddenFileInput();
+ }
+
+ this.URL = window.URL !== null ? window.URL : window.webkitURL;
+
+ // Setup all event listeners on the Dropzone object itself.
+ // They're not in @setupEventListeners() because they shouldn't be removed
+ // again when the dropzone gets disabled.
+ for (var _iterator11 = this.events, _isArray11 = true, _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) {
+ var _ref10;
+
+ if (_isArray11) {
+ if (_i11 >= _iterator11.length) break;
+ _ref10 = _iterator11[_i11++];
+ } else {
+ _i11 = _iterator11.next();
+ if (_i11.done) break;
+ _ref10 = _i11.value;
+ }
+
+ var eventName = _ref10;
+
+ this.on(eventName, this.options[eventName]);
+ }
+
+ this.on("uploadprogress", function () {
+ return _this3.updateTotalUploadProgress();
+ });
+
+ this.on("removedfile", function () {
+ return _this3.updateTotalUploadProgress();
+ });
+
+ this.on("canceled", function (file) {
+ return _this3.emit("complete", file);
+ });
+
+ // Emit a `queuecomplete` event if all files finished uploading.
+ this.on("complete", function (file) {
+ if (_this3.getAddedFiles().length === 0 && _this3.getUploadingFiles().length === 0 && _this3.getQueuedFiles().length === 0) {
+ // This needs to be deferred so that `queuecomplete` really triggers after `complete`
+ return setTimeout(function () {
+ return _this3.emit("queuecomplete");
+ }, 0);
+ }
+ });
+
+ var noPropagation = function noPropagation(e) {
+ e.stopPropagation();
+ if (e.preventDefault) {
+ return e.preventDefault();
+ } else {
+ return e.returnValue = false;
+ }
+ };
+
+ // Create the listeners
+ this.listeners = [{
+ element: this.element,
+ events: {
+ "dragstart": function dragstart(e) {
+ return _this3.emit("dragstart", e);
+ },
+ "dragenter": function dragenter(e) {
+ noPropagation(e);
+ return _this3.emit("dragenter", e);
+ },
+ "dragover": function dragover(e) {
+ // Makes it possible to drag files from chrome's download bar
+ // http://stackoverflow.com/questions/19526430/drag-and-drop-file-uploads-from-chrome-downloads-bar
+ // Try is required to prevent bug in Internet Explorer 11 (SCRIPT65535 exception)
+ var efct = void 0;
+ try {
+ efct = e.dataTransfer.effectAllowed;
+ } catch (error) {}
+ e.dataTransfer.dropEffect = 'move' === efct || 'linkMove' === efct ? 'move' : 'copy';
+
+ noPropagation(e);
+ return _this3.emit("dragover", e);
+ },
+ "dragleave": function dragleave(e) {
+ return _this3.emit("dragleave", e);
+ },
+ "drop": function drop(e) {
+ noPropagation(e);
+ return _this3.drop(e);
+ },
+ "dragend": function dragend(e) {
+ return _this3.emit("dragend", e);
+ }
+
+ // This is disabled right now, because the browsers don't implement it properly.
+ // "paste": (e) =>
+ // noPropagation e
+ // @paste e
+ } }];
+
+ this.clickableElements.forEach(function (clickableElement) {
+ return _this3.listeners.push({
+ element: clickableElement,
+ events: {
+ "click": function click(evt) {
+ // Only the actual dropzone or the message element should trigger file selection
+ if (clickableElement !== _this3.element || evt.target === _this3.element || Dropzone.elementInside(evt.target, _this3.element.querySelector(".dz-message"))) {
+ _this3.hiddenFileInput.click(); // Forward the click
+ }
+ return true;
+ }
+ }
+ });
+ });
+
+ this.enable();
+
+ return this.options.init.call(this);
+ }
+
+ // Not fully tested yet
+
+ }, {
+ key: "destroy",
+ value: function destroy() {
+ this.disable();
+ this.removeAllFiles(true);
+ if (this.hiddenFileInput != null ? this.hiddenFileInput.parentNode : undefined) {
+ this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);
+ this.hiddenFileInput = null;
+ }
+ delete this.element.dropzone;
+ return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1);
+ }
+ }, {
+ key: "updateTotalUploadProgress",
+ value: function updateTotalUploadProgress() {
+ var totalUploadProgress = void 0;
+ var totalBytesSent = 0;
+ var totalBytes = 0;
+
+ var activeFiles = this.getActiveFiles();
+
+ if (activeFiles.length) {
+ for (var _iterator12 = this.getActiveFiles(), _isArray12 = true, _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) {
+ var _ref11;
+
+ if (_isArray12) {
+ if (_i12 >= _iterator12.length) break;
+ _ref11 = _iterator12[_i12++];
+ } else {
+ _i12 = _iterator12.next();
+ if (_i12.done) break;
+ _ref11 = _i12.value;
+ }
+
+ var file = _ref11;
+
+ totalBytesSent += file.upload.bytesSent;
+ totalBytes += file.upload.total;
+ }
+ totalUploadProgress = 100 * totalBytesSent / totalBytes;
+ } else {
+ totalUploadProgress = 100;
+ }
+
+ return this.emit("totaluploadprogress", totalUploadProgress, totalBytes, totalBytesSent);
+ }
+
+ // @options.paramName can be a function taking one parameter rather than a string.
+ // A parameter name for a file is obtained simply by calling this with an index number.
+
+ }, {
+ key: "_getParamName",
+ value: function _getParamName(n) {
+ if (typeof this.options.paramName === "function") {
+ return this.options.paramName(n);
+ } else {
+ return "" + this.options.paramName + (this.options.uploadMultiple ? "[" + n + "]" : "");
+ }
+ }
+
+ // If @options.renameFile is a function,
+ // the function will be used to rename the file.name before appending it to the formData
+
+ }, {
+ key: "_renameFile",
+ value: function _renameFile(file) {
+ if (typeof this.options.renameFile !== "function") {
+ return file.name;
+ }
+ return this.options.renameFile(file);
+ }
+
+ // Returns a form that can be used as fallback if the browser does not support DragnDrop
+ //
+ // If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided.
+ // This code has to pass in IE7 :(
+
+ }, {
+ key: "getFallbackForm",
+ value: function getFallbackForm() {
+ var existingFallback = void 0,
+ form = void 0;
+ if (existingFallback = this.getExistingFallback()) {
+ return existingFallback;
+ }
+
+ var fieldsString = "";
+
+ var fields = Dropzone.createElement(fieldsString);
+ if (this.element.tagName !== "FORM") {
+ form = Dropzone.createElement("");
+ form.appendChild(fields);
+ } else {
+ // Make sure that the enctype and method attributes are set properly
+ this.element.setAttribute("enctype", "multipart/form-data");
+ this.element.setAttribute("method", this.options.method);
+ }
+ return form != null ? form : fields;
+ }
+
+ // Returns the fallback elements if they exist already
+ //
+ // This code has to pass in IE7 :(
+
+ }, {
+ key: "getExistingFallback",
+ value: function getExistingFallback() {
+ var getFallback = function getFallback(elements) {
+ for (var _iterator13 = elements, _isArray13 = true, _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) {
+ var _ref12;
+
+ if (_isArray13) {
+ if (_i13 >= _iterator13.length) break;
+ _ref12 = _iterator13[_i13++];
+ } else {
+ _i13 = _iterator13.next();
+ if (_i13.done) break;
+ _ref12 = _i13.value;
+ }
+
+ var el = _ref12;
+
+ if (/(^| )fallback($| )/.test(el.className)) {
+ return el;
+ }
+ }
+ };
+
+ var _arr = ["div", "form"];
+ for (var _i14 = 0; _i14 < _arr.length; _i14++) {
+ var tagName = _arr[_i14];
+ var fallback;
+ if (fallback = getFallback(this.element.getElementsByTagName(tagName))) {
+ return fallback;
+ }
+ }
+ }
+
+ // Activates all listeners stored in @listeners
+
+ }, {
+ key: "setupEventListeners",
+ value: function setupEventListeners() {
+ return this.listeners.map(function (elementListeners) {
+ return function () {
+ var result = [];
+ for (var event in elementListeners.events) {
+ var listener = elementListeners.events[event];
+ result.push(elementListeners.element.addEventListener(event, listener, false));
+ }
+ return result;
+ }();
+ });
+ }
+
+ // Deactivates all listeners stored in @listeners
+
+ }, {
+ key: "removeEventListeners",
+ value: function removeEventListeners() {
+ return this.listeners.map(function (elementListeners) {
+ return function () {
+ var result = [];
+ for (var event in elementListeners.events) {
+ var listener = elementListeners.events[event];
+ result.push(elementListeners.element.removeEventListener(event, listener, false));
+ }
+ return result;
+ }();
+ });
+ }
+
+ // Removes all event listeners and cancels all files in the queue or being processed.
+
+ }, {
+ key: "disable",
+ value: function disable() {
+ var _this4 = this;
+
+ this.clickableElements.forEach(function (element) {
+ return element.classList.remove("dz-clickable");
+ });
+ this.removeEventListeners();
+ this.disabled = true;
+
+ return this.files.map(function (file) {
+ return _this4.cancelUpload(file);
+ });
+ }
+ }, {
+ key: "enable",
+ value: function enable() {
+ delete this.disabled;
+ this.clickableElements.forEach(function (element) {
+ return element.classList.add("dz-clickable");
+ });
+ return this.setupEventListeners();
+ }
+
+ // Returns a nicely formatted filesize
+
+ }, {
+ key: "filesize",
+ value: function filesize(size) {
+ var selectedSize = 0;
+ var selectedUnit = "b";
+
+ if (size > 0) {
+ var units = ['tb', 'gb', 'mb', 'kb', 'b'];
+
+ for (var i = 0; i < units.length; i++) {
+ var unit = units[i];
+ var cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10;
+
+ if (size >= cutoff) {
+ selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i);
+ selectedUnit = unit;
+ break;
+ }
+ }
+
+ selectedSize = Math.round(10 * selectedSize) / 10; // Cutting of digits
+ }
+
+ return "" + selectedSize + " " + this.options.dictFileSizeUnits[selectedUnit];
+ }
+
+ // Adds or removes the `dz-max-files-reached` class from the form.
+
+ }, {
+ key: "_updateMaxFilesReachedClass",
+ value: function _updateMaxFilesReachedClass() {
+ if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) {
+ if (this.getAcceptedFiles().length === this.options.maxFiles) {
+ this.emit('maxfilesreached', this.files);
+ }
+ return this.element.classList.add("dz-max-files-reached");
+ } else {
+ return this.element.classList.remove("dz-max-files-reached");
+ }
+ }
+ }, {
+ key: "drop",
+ value: function drop(e) {
+ if (!e.dataTransfer) {
+ return;
+ }
+ this.emit("drop", e);
+
+ // Convert the FileList to an Array
+ // This is necessary for IE11
+ var files = [];
+ for (var i = 0; i < e.dataTransfer.files.length; i++) {
+ files[i] = e.dataTransfer.files[i];
+ }
+
+ this.emit("addedfiles", files);
+
+ // Even if it's a folder, files.length will contain the folders.
+ if (files.length) {
+ var items = e.dataTransfer.items;
+
+ if (items && items.length && items[0].webkitGetAsEntry != null) {
+ // The browser supports dropping of folders, so handle items instead of files
+ this._addFilesFromItems(items);
+ } else {
+ this.handleFiles(files);
+ }
+ }
+ }
+ }, {
+ key: "paste",
+ value: function paste(e) {
+ if (__guard__(e != null ? e.clipboardData : undefined, function (x) {
+ return x.items;
+ }) == null) {
+ return;
+ }
+
+ this.emit("paste", e);
+ var items = e.clipboardData.items;
+
+
+ if (items.length) {
+ return this._addFilesFromItems(items);
+ }
+ }
+ }, {
+ key: "handleFiles",
+ value: function handleFiles(files) {
+ for (var _iterator14 = files, _isArray14 = true, _i15 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) {
+ var _ref13;
+
+ if (_isArray14) {
+ if (_i15 >= _iterator14.length) break;
+ _ref13 = _iterator14[_i15++];
+ } else {
+ _i15 = _iterator14.next();
+ if (_i15.done) break;
+ _ref13 = _i15.value;
+ }
+
+ var file = _ref13;
+
+ this.addFile(file);
+ }
+ }
+
+ // When a folder is dropped (or files are pasted), items must be handled
+ // instead of files.
+
+ }, {
+ key: "_addFilesFromItems",
+ value: function _addFilesFromItems(items) {
+ var _this5 = this;
+
+ return function () {
+ var result = [];
+ for (var _iterator15 = items, _isArray15 = true, _i16 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) {
+ var _ref14;
+
+ if (_isArray15) {
+ if (_i16 >= _iterator15.length) break;
+ _ref14 = _iterator15[_i16++];
+ } else {
+ _i16 = _iterator15.next();
+ if (_i16.done) break;
+ _ref14 = _i16.value;
+ }
+
+ var item = _ref14;
+
+ var entry;
+ if (item.webkitGetAsEntry != null && (entry = item.webkitGetAsEntry())) {
+ if (entry.isFile) {
+ result.push(_this5.addFile(item.getAsFile()));
+ } else if (entry.isDirectory) {
+ // Append all files from that directory to files
+ result.push(_this5._addFilesFromDirectory(entry, entry.name));
+ } else {
+ result.push(undefined);
+ }
+ } else if (item.getAsFile != null) {
+ if (item.kind == null || item.kind === "file") {
+ result.push(_this5.addFile(item.getAsFile()));
+ } else {
+ result.push(undefined);
+ }
+ } else {
+ result.push(undefined);
+ }
+ }
+ return result;
+ }();
+ }
+
+ // Goes through the directory, and adds each file it finds recursively
+
+ }, {
+ key: "_addFilesFromDirectory",
+ value: function _addFilesFromDirectory(directory, path) {
+ var _this6 = this;
+
+ var dirReader = directory.createReader();
+
+ var errorHandler = function errorHandler(error) {
+ return __guardMethod__(console, 'log', function (o) {
+ return o.log(error);
+ });
+ };
+
+ var readEntries = function readEntries() {
+ return dirReader.readEntries(function (entries) {
+ if (entries.length > 0) {
+ for (var _iterator16 = entries, _isArray16 = true, _i17 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) {
+ var _ref15;
+
+ if (_isArray16) {
+ if (_i17 >= _iterator16.length) break;
+ _ref15 = _iterator16[_i17++];
+ } else {
+ _i17 = _iterator16.next();
+ if (_i17.done) break;
+ _ref15 = _i17.value;
+ }
+
+ var entry = _ref15;
+
+ if (entry.isFile) {
+ entry.file(function (file) {
+ if (_this6.options.ignoreHiddenFiles && file.name.substring(0, 1) === '.') {
+ return;
+ }
+ file.fullPath = path + "/" + file.name;
+ return _this6.addFile(file);
+ });
+ } else if (entry.isDirectory) {
+ _this6._addFilesFromDirectory(entry, path + "/" + entry.name);
+ }
+ }
+
+ // Recursively call readEntries() again, since browser only handle
+ // the first 100 entries.
+ // See: https://developer.mozilla.org/en-US/docs/Web/API/DirectoryReader#readEntries
+ readEntries();
+ }
+ return null;
+ }, errorHandler);
+ };
+
+ return readEntries();
+ }
+
+ // If `done()` is called without argument the file is accepted
+ // If you call it with an error message, the file is rejected
+ // (This allows for asynchronous validation)
+ //
+ // This function checks the filesize, and if the file.type passes the
+ // `acceptedFiles` check.
+
+ }, {
+ key: "accept",
+ value: function accept(file, done) {
+ if (this.options.maxFilesize && file.size > this.options.maxFilesize * 1024 * 1024) {
+ return done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize));
+ } else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) {
+ return done(this.options.dictInvalidFileType);
+ } else if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) {
+ done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles));
+ return this.emit("maxfilesexceeded", file);
+ } else {
+ return this.options.accept.call(this, file, done);
+ }
+ }
+ }, {
+ key: "addFile",
+ value: function addFile(file) {
+ var _this7 = this;
+
+ file.upload = {
+ uuid: Dropzone.uuidv4(),
+ progress: 0,
+ // Setting the total upload size to file.size for the beginning
+ // It's actual different than the size to be transmitted.
+ total: file.size,
+ bytesSent: 0,
+ filename: this._renameFile(file),
+ chunked: this.options.chunking && (this.options.forceChunking || file.size > this.options.chunkSize),
+ totalChunkCount: Math.ceil(file.size / this.options.chunkSize)
+ };
+ this.files.push(file);
+
+ file.status = Dropzone.ADDED;
+
+ this.emit("addedfile", file);
+
+ this._enqueueThumbnail(file);
+
+ return this.accept(file, function (error) {
+ if (error) {
+ file.accepted = false;
+ _this7._errorProcessing([file], error); // Will set the file.status
+ } else {
+ file.accepted = true;
+ if (_this7.options.autoQueue) {
+ _this7.enqueueFile(file);
+ } // Will set .accepted = true
+ }
+ return _this7._updateMaxFilesReachedClass();
+ });
+ }
+
+ // Wrapper for enqueueFile
+
+ }, {
+ key: "enqueueFiles",
+ value: function enqueueFiles(files) {
+ for (var _iterator17 = files, _isArray17 = true, _i18 = 0, _iterator17 = _isArray17 ? _iterator17 : _iterator17[Symbol.iterator]();;) {
+ var _ref16;
+
+ if (_isArray17) {
+ if (_i18 >= _iterator17.length) break;
+ _ref16 = _iterator17[_i18++];
+ } else {
+ _i18 = _iterator17.next();
+ if (_i18.done) break;
+ _ref16 = _i18.value;
+ }
+
+ var file = _ref16;
+
+ this.enqueueFile(file);
+ }
+ return null;
+ }
+ }, {
+ key: "enqueueFile",
+ value: function enqueueFile(file) {
+ var _this8 = this;
+
+ if (file.status === Dropzone.ADDED && file.accepted === true) {
+ file.status = Dropzone.QUEUED;
+ if (this.options.autoProcessQueue) {
+ return setTimeout(function () {
+ return _this8.processQueue();
+ }, 0); // Deferring the call
+ }
+ } else {
+ throw new Error("This file can't be queued because it has already been processed or was rejected.");
+ }
+ }
+ }, {
+ key: "_enqueueThumbnail",
+ value: function _enqueueThumbnail(file) {
+ var _this9 = this;
+
+ if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1024 * 1024) {
+ this._thumbnailQueue.push(file);
+ return setTimeout(function () {
+ return _this9._processThumbnailQueue();
+ }, 0); // Deferring the call
+ }
+ }
+ }, {
+ key: "_processThumbnailQueue",
+ value: function _processThumbnailQueue() {
+ var _this10 = this;
+
+ if (this._processingThumbnail || this._thumbnailQueue.length === 0) {
+ return;
+ }
+
+ this._processingThumbnail = true;
+ var file = this._thumbnailQueue.shift();
+ return this.createThumbnail(file, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, true, function (dataUrl) {
+ _this10.emit("thumbnail", file, dataUrl);
+ _this10._processingThumbnail = false;
+ return _this10._processThumbnailQueue();
+ });
+ }
+
+ // Can be called by the user to remove a file
+
+ }, {
+ key: "removeFile",
+ value: function removeFile(file) {
+ if (file.status === Dropzone.UPLOADING) {
+ this.cancelUpload(file);
+ }
+ this.files = without(this.files, file);
+
+ this.emit("removedfile", file);
+ if (this.files.length === 0) {
+ return this.emit("reset");
+ }
+ }
+
+ // Removes all files that aren't currently processed from the list
+
+ }, {
+ key: "removeAllFiles",
+ value: function removeAllFiles(cancelIfNecessary) {
+ // Create a copy of files since removeFile() changes the @files array.
+ if (cancelIfNecessary == null) {
+ cancelIfNecessary = false;
+ }
+ for (var _iterator18 = this.files.slice(), _isArray18 = true, _i19 = 0, _iterator18 = _isArray18 ? _iterator18 : _iterator18[Symbol.iterator]();;) {
+ var _ref17;
+
+ if (_isArray18) {
+ if (_i19 >= _iterator18.length) break;
+ _ref17 = _iterator18[_i19++];
+ } else {
+ _i19 = _iterator18.next();
+ if (_i19.done) break;
+ _ref17 = _i19.value;
+ }
+
+ var file = _ref17;
+
+ if (file.status !== Dropzone.UPLOADING || cancelIfNecessary) {
+ this.removeFile(file);
+ }
+ }
+ return null;
+ }
+
+ // Resizes an image before it gets sent to the server. This function is the default behavior of
+ // `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with
+ // the resized blob.
+
+ }, {
+ key: "resizeImage",
+ value: function resizeImage(file, width, height, resizeMethod, callback) {
+ var _this11 = this;
+
+ return this.createThumbnail(file, width, height, resizeMethod, true, function (dataUrl, canvas) {
+ if (canvas == null) {
+ // The image has not been resized
+ return callback(file);
+ } else {
+ var resizeMimeType = _this11.options.resizeMimeType;
+
+ if (resizeMimeType == null) {
+ resizeMimeType = file.type;
+ }
+ var resizedDataURL = canvas.toDataURL(resizeMimeType, _this11.options.resizeQuality);
+ if (resizeMimeType === 'image/jpeg' || resizeMimeType === 'image/jpg') {
+ // Now add the original EXIF information
+ resizedDataURL = ExifRestore.restore(file.dataURL, resizedDataURL);
+ }
+ return callback(Dropzone.dataURItoBlob(resizedDataURL));
+ }
+ });
+ }
+ }, {
+ key: "createThumbnail",
+ value: function createThumbnail(file, width, height, resizeMethod, fixOrientation, callback) {
+ var _this12 = this;
+
+ var fileReader = new FileReader();
+
+ fileReader.onload = function () {
+
+ file.dataURL = fileReader.result;
+
+ // Don't bother creating a thumbnail for SVG images since they're vector
+ if (file.type === "image/svg+xml") {
+ if (callback != null) {
+ callback(fileReader.result);
+ }
+ return;
+ }
+
+ return _this12.createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback);
+ };
+
+ return fileReader.readAsDataURL(file);
+ }
+ }, {
+ key: "createThumbnailFromUrl",
+ value: function createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin) {
+ var _this13 = this;
+
+ // Not using `new Image` here because of a bug in latest Chrome versions.
+ // See https://github.com/enyo/dropzone/pull/226
+ var img = document.createElement("img");
+
+ if (crossOrigin) {
+ img.crossOrigin = crossOrigin;
+ }
+
+ img.onload = function () {
+ var loadExif = function loadExif(callback) {
+ return callback(1);
+ };
+ if (typeof EXIF !== 'undefined' && EXIF !== null && fixOrientation) {
+ loadExif = function loadExif(callback) {
+ return EXIF.getData(img, function () {
+ return callback(EXIF.getTag(this, 'Orientation'));
+ });
+ };
+ }
+
+ return loadExif(function (orientation) {
+ file.width = img.width;
+ file.height = img.height;
+
+ var resizeInfo = _this13.options.resize.call(_this13, file, width, height, resizeMethod);
+
+ var canvas = document.createElement("canvas");
+ var ctx = canvas.getContext("2d");
+
+ canvas.width = resizeInfo.trgWidth;
+ canvas.height = resizeInfo.trgHeight;
+
+ if (orientation > 4) {
+ canvas.width = resizeInfo.trgHeight;
+ canvas.height = resizeInfo.trgWidth;
+ }
+
+ switch (orientation) {
+ case 2:
+ // horizontal flip
+ ctx.translate(canvas.width, 0);
+ ctx.scale(-1, 1);
+ break;
+ case 3:
+ // 180° rotate left
+ ctx.translate(canvas.width, canvas.height);
+ ctx.rotate(Math.PI);
+ break;
+ case 4:
+ // vertical flip
+ ctx.translate(0, canvas.height);
+ ctx.scale(1, -1);
+ break;
+ case 5:
+ // vertical flip + 90 rotate right
+ ctx.rotate(0.5 * Math.PI);
+ ctx.scale(1, -1);
+ break;
+ case 6:
+ // 90° rotate right
+ ctx.rotate(0.5 * Math.PI);
+ ctx.translate(0, -canvas.width);
+ break;
+ case 7:
+ // horizontal flip + 90 rotate right
+ ctx.rotate(0.5 * Math.PI);
+ ctx.translate(canvas.height, -canvas.width);
+ ctx.scale(-1, 1);
+ break;
+ case 8:
+ // 90° rotate left
+ ctx.rotate(-0.5 * Math.PI);
+ ctx.translate(-canvas.height, 0);
+ break;
+ }
+
+ // This is a bugfix for iOS' scaling bug.
+ drawImageIOSFix(ctx, img, resizeInfo.srcX != null ? resizeInfo.srcX : 0, resizeInfo.srcY != null ? resizeInfo.srcY : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, resizeInfo.trgX != null ? resizeInfo.trgX : 0, resizeInfo.trgY != null ? resizeInfo.trgY : 0, resizeInfo.trgWidth, resizeInfo.trgHeight);
+
+ var thumbnail = canvas.toDataURL("image/png");
+
+ if (callback != null) {
+ return callback(thumbnail, canvas);
+ }
+ });
+ };
+
+ if (callback != null) {
+ img.onerror = callback;
+ }
+
+ return img.src = file.dataURL;
+ }
+
+ // Goes through the queue and processes files if there aren't too many already.
+
+ }, {
+ key: "processQueue",
+ value: function processQueue() {
+ var parallelUploads = this.options.parallelUploads;
+
+ var processingLength = this.getUploadingFiles().length;
+ var i = processingLength;
+
+ // There are already at least as many files uploading than should be
+ if (processingLength >= parallelUploads) {
+ return;
+ }
+
+ var queuedFiles = this.getQueuedFiles();
+
+ if (!(queuedFiles.length > 0)) {
+ return;
+ }
+
+ if (this.options.uploadMultiple) {
+ // The files should be uploaded in one request
+ return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength));
+ } else {
+ while (i < parallelUploads) {
+ if (!queuedFiles.length) {
+ return;
+ } // Nothing left to process
+ this.processFile(queuedFiles.shift());
+ i++;
+ }
+ }
+ }
+
+ // Wrapper for `processFiles`
+
+ }, {
+ key: "processFile",
+ value: function processFile(file) {
+ return this.processFiles([file]);
+ }
+
+ // Loads the file, then calls finishedLoading()
+
+ }, {
+ key: "processFiles",
+ value: function processFiles(files) {
+ for (var _iterator19 = files, _isArray19 = true, _i20 = 0, _iterator19 = _isArray19 ? _iterator19 : _iterator19[Symbol.iterator]();;) {
+ var _ref18;
+
+ if (_isArray19) {
+ if (_i20 >= _iterator19.length) break;
+ _ref18 = _iterator19[_i20++];
+ } else {
+ _i20 = _iterator19.next();
+ if (_i20.done) break;
+ _ref18 = _i20.value;
+ }
+
+ var file = _ref18;
+
+ file.processing = true; // Backwards compatibility
+ file.status = Dropzone.UPLOADING;
+
+ this.emit("processing", file);
+ }
+
+ if (this.options.uploadMultiple) {
+ this.emit("processingmultiple", files);
+ }
+
+ return this.uploadFiles(files);
+ }
+ }, {
+ key: "_getFilesWithXhr",
+ value: function _getFilesWithXhr(xhr) {
+ var files = void 0;
+ return files = this.files.filter(function (file) {
+ return file.xhr === xhr;
+ }).map(function (file) {
+ return file;
+ });
+ }
+
+ // Cancels the file upload and sets the status to CANCELED
+ // **if** the file is actually being uploaded.
+ // If it's still in the queue, the file is being removed from it and the status
+ // set to CANCELED.
+
+ }, {
+ key: "cancelUpload",
+ value: function cancelUpload(file) {
+ if (file.status === Dropzone.UPLOADING) {
+ var groupedFiles = this._getFilesWithXhr(file.xhr);
+ for (var _iterator20 = groupedFiles, _isArray20 = true, _i21 = 0, _iterator20 = _isArray20 ? _iterator20 : _iterator20[Symbol.iterator]();;) {
+ var _ref19;
+
+ if (_isArray20) {
+ if (_i21 >= _iterator20.length) break;
+ _ref19 = _iterator20[_i21++];
+ } else {
+ _i21 = _iterator20.next();
+ if (_i21.done) break;
+ _ref19 = _i21.value;
+ }
+
+ var groupedFile = _ref19;
+
+ groupedFile.status = Dropzone.CANCELED;
+ }
+ if (typeof file.xhr !== 'undefined') {
+ file.xhr.abort();
+ }
+ for (var _iterator21 = groupedFiles, _isArray21 = true, _i22 = 0, _iterator21 = _isArray21 ? _iterator21 : _iterator21[Symbol.iterator]();;) {
+ var _ref20;
+
+ if (_isArray21) {
+ if (_i22 >= _iterator21.length) break;
+ _ref20 = _iterator21[_i22++];
+ } else {
+ _i22 = _iterator21.next();
+ if (_i22.done) break;
+ _ref20 = _i22.value;
+ }
+
+ var _groupedFile = _ref20;
+
+ this.emit("canceled", _groupedFile);
+ }
+ if (this.options.uploadMultiple) {
+ this.emit("canceledmultiple", groupedFiles);
+ }
+ } else if (file.status === Dropzone.ADDED || file.status === Dropzone.QUEUED) {
+ file.status = Dropzone.CANCELED;
+ this.emit("canceled", file);
+ if (this.options.uploadMultiple) {
+ this.emit("canceledmultiple", [file]);
+ }
+ }
+
+ if (this.options.autoProcessQueue) {
+ return this.processQueue();
+ }
+ }
+ }, {
+ key: "resolveOption",
+ value: function resolveOption(option) {
+ if (typeof option === 'function') {
+ for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
+ args[_key3 - 1] = arguments[_key3];
+ }
+
+ return option.apply(this, args);
+ }
+ return option;
+ }
+ }, {
+ key: "uploadFile",
+ value: function uploadFile(file) {
+ return this.uploadFiles([file]);
+ }
+ }, {
+ key: "uploadFiles",
+ value: function uploadFiles(files) {
+ var _this14 = this;
+
+ this._transformFiles(files, function (transformedFiles) {
+ if (files[0].upload.chunked) {
+ // This file should be sent in chunks!
+
+ // If the chunking option is set, we **know** that there can only be **one** file, since
+ // uploadMultiple is not allowed with this option.
+ var file = files[0];
+ var transformedFile = transformedFiles[0];
+ var startedChunkCount = 0;
+
+ file.upload.chunks = [];
+
+ var handleNextChunk = function handleNextChunk() {
+ var chunkIndex = 0;
+
+ // Find the next item in file.upload.chunks that is not defined yet.
+ while (file.upload.chunks[chunkIndex] !== undefined) {
+ chunkIndex++;
+ }
+
+ // This means, that all chunks have already been started.
+ if (chunkIndex >= file.upload.totalChunkCount) return;
+
+ startedChunkCount++;
+
+ var start = chunkIndex * _this14.options.chunkSize;
+ var end = Math.min(start + _this14.options.chunkSize, file.size);
+
+ var dataBlock = {
+ name: _this14._getParamName(0),
+ data: transformedFile.webkitSlice ? transformedFile.webkitSlice(start, end) : transformedFile.slice(start, end),
+ filename: file.upload.filename,
+ chunkIndex: chunkIndex
+ };
+
+ file.upload.chunks[chunkIndex] = {
+ file: file,
+ index: chunkIndex,
+ dataBlock: dataBlock, // In case we want to retry.
+ status: Dropzone.UPLOADING,
+ progress: 0,
+ retries: 0 // The number of times this block has been retried.
+ };
+
+ _this14._uploadData(files, [dataBlock]);
+ };
+
+ file.upload.finishedChunkUpload = function (chunk) {
+ var allFinished = true;
+ chunk.status = Dropzone.SUCCESS;
+
+ // Clear the data from the chunk
+ chunk.dataBlock = null;
+ // Leaving this reference to xhr intact here will cause memory leaks in some browsers
+ chunk.xhr = null;
+
+ for (var i = 0; i < file.upload.totalChunkCount; i++) {
+ if (file.upload.chunks[i] === undefined) {
+ return handleNextChunk();
+ }
+ if (file.upload.chunks[i].status !== Dropzone.SUCCESS) {
+ allFinished = false;
+ }
+ }
+
+ if (allFinished) {
+ _this14.options.chunksUploaded(file, function () {
+ _this14._finished(files, '', null);
+ });
+ }
+ };
+
+ if (_this14.options.parallelChunkUploads) {
+ for (var i = 0; i < file.upload.totalChunkCount; i++) {
+ handleNextChunk();
+ }
+ } else {
+ handleNextChunk();
+ }
+ } else {
+ var dataBlocks = [];
+ for (var _i23 = 0; _i23 < files.length; _i23++) {
+ dataBlocks[_i23] = {
+ name: _this14._getParamName(_i23),
+ data: transformedFiles[_i23],
+ filename: files[_i23].upload.filename
+ };
+ }
+ _this14._uploadData(files, dataBlocks);
+ }
+ });
+ }
+
+ /// Returns the right chunk for given file and xhr
+
+ }, {
+ key: "_getChunk",
+ value: function _getChunk(file, xhr) {
+ for (var i = 0; i < file.upload.totalChunkCount; i++) {
+ if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].xhr === xhr) {
+ return file.upload.chunks[i];
+ }
+ }
+ }
+
+ // This function actually uploads the file(s) to the server.
+ // If dataBlocks contains the actual data to upload (meaning, that this could either be transformed
+ // files, or individual chunks for chunked upload).
+
+ }, {
+ key: "_uploadData",
+ value: function _uploadData(files, dataBlocks) {
+ var _this15 = this;
+
+ var xhr = new XMLHttpRequest();
+
+ // Put the xhr object in the file objects to be able to reference it later.
+ for (var _iterator22 = files, _isArray22 = true, _i24 = 0, _iterator22 = _isArray22 ? _iterator22 : _iterator22[Symbol.iterator]();;) {
+ var _ref21;
+
+ if (_isArray22) {
+ if (_i24 >= _iterator22.length) break;
+ _ref21 = _iterator22[_i24++];
+ } else {
+ _i24 = _iterator22.next();
+ if (_i24.done) break;
+ _ref21 = _i24.value;
+ }
+
+ var file = _ref21;
+
+ file.xhr = xhr;
+ }
+ if (files[0].upload.chunked) {
+ // Put the xhr object in the right chunk object, so it can be associated later, and found with _getChunk
+ files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr = xhr;
+ }
+
+ var method = this.resolveOption(this.options.method, files);
+ var url = this.resolveOption(this.options.url, files);
+ xhr.open(method, url, true);
+
+ // Setting the timeout after open because of IE11 issue: https://gitlab.com/meno/dropzone/issues/8
+ xhr.timeout = this.resolveOption(this.options.timeout, files);
+
+ // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179
+ xhr.withCredentials = !!this.options.withCredentials;
+
+ xhr.onload = function (e) {
+ _this15._finishedUploading(files, xhr, e);
+ };
+
+ xhr.onerror = function () {
+ _this15._handleUploadError(files, xhr);
+ };
+
+ // Some browsers do not have the .upload property
+ var progressObj = xhr.upload != null ? xhr.upload : xhr;
+ progressObj.onprogress = function (e) {
+ return _this15._updateFilesUploadProgress(files, xhr, e);
+ };
+
+ var headers = {
+ "Accept": "application/json",
+ "Cache-Control": "no-cache",
+ "X-Requested-With": "XMLHttpRequest"
+ };
+
+ if (this.options.headers) {
+ Dropzone.extend(headers, this.options.headers);
+ }
+
+ for (var headerName in headers) {
+ var headerValue = headers[headerName];
+ if (headerValue) {
+ xhr.setRequestHeader(headerName, headerValue);
+ }
+ }
+
+ var formData = new FormData();
+
+ // Adding all @options parameters
+ if (this.options.params) {
+ var additionalParams = this.options.params;
+ if (typeof additionalParams === 'function') {
+ additionalParams = additionalParams.call(this, files, xhr, files[0].upload.chunked ? this._getChunk(files[0], xhr) : null);
+ }
+
+ for (var key in additionalParams) {
+ var value = additionalParams[key];
+ formData.append(key, value);
+ }
+ }
+
+ // Let the user add additional data if necessary
+ for (var _iterator23 = files, _isArray23 = true, _i25 = 0, _iterator23 = _isArray23 ? _iterator23 : _iterator23[Symbol.iterator]();;) {
+ var _ref22;
+
+ if (_isArray23) {
+ if (_i25 >= _iterator23.length) break;
+ _ref22 = _iterator23[_i25++];
+ } else {
+ _i25 = _iterator23.next();
+ if (_i25.done) break;
+ _ref22 = _i25.value;
+ }
+
+ var _file = _ref22;
+
+ this.emit("sending", _file, xhr, formData);
+ }
+ if (this.options.uploadMultiple) {
+ this.emit("sendingmultiple", files, xhr, formData);
+ }
+
+ this._addFormElementData(formData);
+
+ // Finally add the files
+ // Has to be last because some servers (eg: S3) expect the file to be the last parameter
+ for (var i = 0; i < dataBlocks.length; i++) {
+ var dataBlock = dataBlocks[i];
+ formData.append(dataBlock.name, dataBlock.data, dataBlock.filename);
+ }
+
+ this.submitRequest(xhr, formData, files);
+ }
+
+ // Transforms all files with this.options.transformFile and invokes done with the transformed files when done.
+
+ }, {
+ key: "_transformFiles",
+ value: function _transformFiles(files, done) {
+ var _this16 = this;
+
+ var transformedFiles = [];
+ // Clumsy way of handling asynchronous calls, until I get to add a proper Future library.
+ var doneCounter = 0;
+
+ var _loop = function _loop(i) {
+ _this16.options.transformFile.call(_this16, files[i], function (transformedFile) {
+ transformedFiles[i] = transformedFile;
+ if (++doneCounter === files.length) {
+ done(transformedFiles);
+ }
+ });
+ };
+
+ for (var i = 0; i < files.length; i++) {
+ _loop(i);
+ }
+ }
+
+ // Takes care of adding other input elements of the form to the AJAX request
+
+ }, {
+ key: "_addFormElementData",
+ value: function _addFormElementData(formData) {
+ // Take care of other input elements
+ if (this.element.tagName === "FORM") {
+ for (var _iterator24 = this.element.querySelectorAll("input, textarea, select, button"), _isArray24 = true, _i26 = 0, _iterator24 = _isArray24 ? _iterator24 : _iterator24[Symbol.iterator]();;) {
+ var _ref23;
+
+ if (_isArray24) {
+ if (_i26 >= _iterator24.length) break;
+ _ref23 = _iterator24[_i26++];
+ } else {
+ _i26 = _iterator24.next();
+ if (_i26.done) break;
+ _ref23 = _i26.value;
+ }
+
+ var input = _ref23;
+
+ var inputName = input.getAttribute("name");
+ var inputType = input.getAttribute("type");
+ if (inputType) inputType = inputType.toLowerCase();
+
+ // If the input doesn't have a name, we can't use it.
+ if (typeof inputName === 'undefined' || inputName === null) continue;
+
+ if (input.tagName === "SELECT" && input.hasAttribute("multiple")) {
+ // Possibly multiple values
+ for (var _iterator25 = input.options, _isArray25 = true, _i27 = 0, _iterator25 = _isArray25 ? _iterator25 : _iterator25[Symbol.iterator]();;) {
+ var _ref24;
+
+ if (_isArray25) {
+ if (_i27 >= _iterator25.length) break;
+ _ref24 = _iterator25[_i27++];
+ } else {
+ _i27 = _iterator25.next();
+ if (_i27.done) break;
+ _ref24 = _i27.value;
+ }
+
+ var option = _ref24;
+
+ if (option.selected) {
+ formData.append(inputName, option.value);
+ }
+ }
+ } else if (!inputType || inputType !== "checkbox" && inputType !== "radio" || input.checked) {
+ formData.append(inputName, input.value);
+ }
+ }
+ }
+ }
+
+ // Invoked when there is new progress information about given files.
+ // If e is not provided, it is assumed that the upload is finished.
+
+ }, {
+ key: "_updateFilesUploadProgress",
+ value: function _updateFilesUploadProgress(files, xhr, e) {
+ var progress = void 0;
+ if (typeof e !== 'undefined') {
+ progress = 100 * e.loaded / e.total;
+
+ if (files[0].upload.chunked) {
+ var file = files[0];
+ // Since this is a chunked upload, we need to update the appropriate chunk progress.
+ var chunk = this._getChunk(file, xhr);
+ chunk.progress = progress;
+ chunk.total = e.total;
+ chunk.bytesSent = e.loaded;
+ var fileProgress = 0,
+ fileTotal = void 0,
+ fileBytesSent = void 0;
+ file.upload.progress = 0;
+ file.upload.total = 0;
+ file.upload.bytesSent = 0;
+ for (var i = 0; i < file.upload.totalChunkCount; i++) {
+ if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].progress !== undefined) {
+ file.upload.progress += file.upload.chunks[i].progress;
+ file.upload.total += file.upload.chunks[i].total;
+ file.upload.bytesSent += file.upload.chunks[i].bytesSent;
+ }
+ }
+ file.upload.progress = file.upload.progress / file.upload.totalChunkCount;
+ } else {
+ for (var _iterator26 = files, _isArray26 = true, _i28 = 0, _iterator26 = _isArray26 ? _iterator26 : _iterator26[Symbol.iterator]();;) {
+ var _ref25;
+
+ if (_isArray26) {
+ if (_i28 >= _iterator26.length) break;
+ _ref25 = _iterator26[_i28++];
+ } else {
+ _i28 = _iterator26.next();
+ if (_i28.done) break;
+ _ref25 = _i28.value;
+ }
+
+ var _file2 = _ref25;
+
+ _file2.upload.progress = progress;
+ _file2.upload.total = e.total;
+ _file2.upload.bytesSent = e.loaded;
+ }
+ }
+ for (var _iterator27 = files, _isArray27 = true, _i29 = 0, _iterator27 = _isArray27 ? _iterator27 : _iterator27[Symbol.iterator]();;) {
+ var _ref26;
+
+ if (_isArray27) {
+ if (_i29 >= _iterator27.length) break;
+ _ref26 = _iterator27[_i29++];
+ } else {
+ _i29 = _iterator27.next();
+ if (_i29.done) break;
+ _ref26 = _i29.value;
+ }
+
+ var _file3 = _ref26;
+
+ this.emit("uploadprogress", _file3, _file3.upload.progress, _file3.upload.bytesSent);
+ }
+ } else {
+ // Called when the file finished uploading
+
+ var allFilesFinished = true;
+
+ progress = 100;
+
+ for (var _iterator28 = files, _isArray28 = true, _i30 = 0, _iterator28 = _isArray28 ? _iterator28 : _iterator28[Symbol.iterator]();;) {
+ var _ref27;
+
+ if (_isArray28) {
+ if (_i30 >= _iterator28.length) break;
+ _ref27 = _iterator28[_i30++];
+ } else {
+ _i30 = _iterator28.next();
+ if (_i30.done) break;
+ _ref27 = _i30.value;
+ }
+
+ var _file4 = _ref27;
+
+ if (_file4.upload.progress !== 100 || _file4.upload.bytesSent !== _file4.upload.total) {
+ allFilesFinished = false;
+ }
+ _file4.upload.progress = progress;
+ _file4.upload.bytesSent = _file4.upload.total;
+ }
+
+ // Nothing to do, all files already at 100%
+ if (allFilesFinished) {
+ return;
+ }
+
+ for (var _iterator29 = files, _isArray29 = true, _i31 = 0, _iterator29 = _isArray29 ? _iterator29 : _iterator29[Symbol.iterator]();;) {
+ var _ref28;
+
+ if (_isArray29) {
+ if (_i31 >= _iterator29.length) break;
+ _ref28 = _iterator29[_i31++];
+ } else {
+ _i31 = _iterator29.next();
+ if (_i31.done) break;
+ _ref28 = _i31.value;
+ }
+
+ var _file5 = _ref28;
+
+ this.emit("uploadprogress", _file5, progress, _file5.upload.bytesSent);
+ }
+ }
+ }
+ }, {
+ key: "_finishedUploading",
+ value: function _finishedUploading(files, xhr, e) {
+ var response = void 0;
+
+ if (files[0].status === Dropzone.CANCELED) {
+ return;
+ }
+
+ if (xhr.readyState !== 4) {
+ return;
+ }
+
+ if (xhr.responseType !== 'arraybuffer' && xhr.responseType !== 'blob') {
+ response = xhr.responseText;
+
+ if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) {
+ try {
+ response = JSON.parse(response);
+ } catch (error) {
+ e = error;
+ response = "Invalid JSON response from server.";
+ }
+ }
+ }
+
+ this._updateFilesUploadProgress(files);
+
+ if (!(200 <= xhr.status && xhr.status < 300)) {
+ this._handleUploadError(files, xhr, response);
+ } else {
+ if (files[0].upload.chunked) {
+ files[0].upload.finishedChunkUpload(this._getChunk(files[0], xhr));
+ } else {
+ this._finished(files, response, e);
+ }
+ }
+ }
+ }, {
+ key: "_handleUploadError",
+ value: function _handleUploadError(files, xhr, response) {
+ if (files[0].status === Dropzone.CANCELED) {
+ return;
+ }
+
+ if (files[0].upload.chunked && this.options.retryChunks) {
+ var chunk = this._getChunk(files[0], xhr);
+ if (chunk.retries++ < this.options.retryChunksLimit) {
+ this._uploadData(files, [chunk.dataBlock]);
+ return;
+ } else {
+ console.warn('Retried this chunk too often. Giving up.');
+ }
+ }
+
+ for (var _iterator30 = files, _isArray30 = true, _i32 = 0, _iterator30 = _isArray30 ? _iterator30 : _iterator30[Symbol.iterator]();;) {
+ var _ref29;
+
+ if (_isArray30) {
+ if (_i32 >= _iterator30.length) break;
+ _ref29 = _iterator30[_i32++];
+ } else {
+ _i32 = _iterator30.next();
+ if (_i32.done) break;
+ _ref29 = _i32.value;
+ }
+
+ var file = _ref29;
+
+ this._errorProcessing(files, response || this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr);
+ }
+ }
+ }, {
+ key: "submitRequest",
+ value: function submitRequest(xhr, formData, files) {
+ xhr.send(formData);
+ }
+
+ // Called internally when processing is finished.
+ // Individual callbacks have to be called in the appropriate sections.
+
+ }, {
+ key: "_finished",
+ value: function _finished(files, responseText, e) {
+ for (var _iterator31 = files, _isArray31 = true, _i33 = 0, _iterator31 = _isArray31 ? _iterator31 : _iterator31[Symbol.iterator]();;) {
+ var _ref30;
+
+ if (_isArray31) {
+ if (_i33 >= _iterator31.length) break;
+ _ref30 = _iterator31[_i33++];
+ } else {
+ _i33 = _iterator31.next();
+ if (_i33.done) break;
+ _ref30 = _i33.value;
+ }
+
+ var file = _ref30;
+
+ file.status = Dropzone.SUCCESS;
+ this.emit("success", file, responseText, e);
+ this.emit("complete", file);
+ }
+ if (this.options.uploadMultiple) {
+ this.emit("successmultiple", files, responseText, e);
+ this.emit("completemultiple", files);
+ }
+
+ if (this.options.autoProcessQueue) {
+ return this.processQueue();
+ }
+ }
+
+ // Called internally when processing is finished.
+ // Individual callbacks have to be called in the appropriate sections.
+
+ }, {
+ key: "_errorProcessing",
+ value: function _errorProcessing(files, message, xhr) {
+ for (var _iterator32 = files, _isArray32 = true, _i34 = 0, _iterator32 = _isArray32 ? _iterator32 : _iterator32[Symbol.iterator]();;) {
+ var _ref31;
+
+ if (_isArray32) {
+ if (_i34 >= _iterator32.length) break;
+ _ref31 = _iterator32[_i34++];
+ } else {
+ _i34 = _iterator32.next();
+ if (_i34.done) break;
+ _ref31 = _i34.value;
+ }
+
+ var file = _ref31;
+
+ file.status = Dropzone.ERROR;
+ this.emit("error", file, message, xhr);
+ this.emit("complete", file);
+ }
+ if (this.options.uploadMultiple) {
+ this.emit("errormultiple", files, message, xhr);
+ this.emit("completemultiple", files);
+ }
+
+ if (this.options.autoProcessQueue) {
+ return this.processQueue();
+ }
+ }
+ }], [{
+ key: "uuidv4",
+ value: function uuidv4() {
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
+ var r = Math.random() * 16 | 0,
+ v = c === 'x' ? r : r & 0x3 | 0x8;
+ return v.toString(16);
+ });
+ }
+ }]);
+
+ return Dropzone;
+}(Emitter);
+
+Dropzone.initClass();
+
+Dropzone.version = "5.5.0";
+
+// This is a map of options for your different dropzones. Add configurations
+// to this object for your different dropzone elemens.
+//
+// Example:
+//
+// Dropzone.options.myDropzoneElementId = { maxFilesize: 1 };
+//
+// To disable autoDiscover for a specific element, you can set `false` as an option:
+//
+// Dropzone.options.myDisabledElementId = false;
+//
+// And in html:
+//
+//
+Dropzone.options = {};
+
+// Returns the options for an element or undefined if none available.
+Dropzone.optionsForElement = function (element) {
+ // Get the `Dropzone.options.elementId` for this element if it exists
+ if (element.getAttribute("id")) {
+ return Dropzone.options[camelize(element.getAttribute("id"))];
+ } else {
+ return undefined;
+ }
+};
+
+// Holds a list of all dropzone instances
+Dropzone.instances = [];
+
+// Returns the dropzone for given element if any
+Dropzone.forElement = function (element) {
+ if (typeof element === "string") {
+ element = document.querySelector(element);
+ }
+ if ((element != null ? element.dropzone : undefined) == null) {
+ throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");
+ }
+ return element.dropzone;
+};
+
+// Set to false if you don't want Dropzone to automatically find and attach to .dropzone elements.
+Dropzone.autoDiscover = true;
+
+// Looks for all .dropzone elements and creates a dropzone for them
+Dropzone.discover = function () {
+ var dropzones = void 0;
+ if (document.querySelectorAll) {
+ dropzones = document.querySelectorAll(".dropzone");
+ } else {
+ dropzones = [];
+ // IE :(
+ var checkElements = function checkElements(elements) {
+ return function () {
+ var result = [];
+ for (var _iterator33 = elements, _isArray33 = true, _i35 = 0, _iterator33 = _isArray33 ? _iterator33 : _iterator33[Symbol.iterator]();;) {
+ var _ref32;
+
+ if (_isArray33) {
+ if (_i35 >= _iterator33.length) break;
+ _ref32 = _iterator33[_i35++];
+ } else {
+ _i35 = _iterator33.next();
+ if (_i35.done) break;
+ _ref32 = _i35.value;
+ }
+
+ var el = _ref32;
+
+ if (/(^| )dropzone($| )/.test(el.className)) {
+ result.push(dropzones.push(el));
+ } else {
+ result.push(undefined);
+ }
+ }
+ return result;
+ }();
+ };
+ checkElements(document.getElementsByTagName("div"));
+ checkElements(document.getElementsByTagName("form"));
+ }
+
+ return function () {
+ var result = [];
+ for (var _iterator34 = dropzones, _isArray34 = true, _i36 = 0, _iterator34 = _isArray34 ? _iterator34 : _iterator34[Symbol.iterator]();;) {
+ var _ref33;
+
+ if (_isArray34) {
+ if (_i36 >= _iterator34.length) break;
+ _ref33 = _iterator34[_i36++];
+ } else {
+ _i36 = _iterator34.next();
+ if (_i36.done) break;
+ _ref33 = _i36.value;
+ }
+
+ var dropzone = _ref33;
+
+ // Create a dropzone unless auto discover has been disabled for specific element
+ if (Dropzone.optionsForElement(dropzone) !== false) {
+ result.push(new Dropzone(dropzone));
+ } else {
+ result.push(undefined);
+ }
+ }
+ return result;
+ }();
+};
+
+// Since the whole Drag'n'Drop API is pretty new, some browsers implement it,
+// but not correctly.
+// So I created a blacklist of userAgents. Yes, yes. Browser sniffing, I know.
+// But what to do when browsers *theoretically* support an API, but crash
+// when using it.
+//
+// This is a list of regular expressions tested against navigator.userAgent
+//
+// ** It should only be used on browser that *do* support the API, but
+// incorrectly **
+//
+Dropzone.blacklistedBrowsers = [
+// The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API.
+/opera.*(Macintosh|Windows Phone).*version\/12/i];
+
+// Checks if the browser is supported
+Dropzone.isBrowserSupported = function () {
+ var capableBrowser = true;
+
+ if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) {
+ if (!("classList" in document.createElement("a"))) {
+ capableBrowser = false;
+ } else {
+ // The browser supports the API, but may be blacklisted.
+ for (var _iterator35 = Dropzone.blacklistedBrowsers, _isArray35 = true, _i37 = 0, _iterator35 = _isArray35 ? _iterator35 : _iterator35[Symbol.iterator]();;) {
+ var _ref34;
+
+ if (_isArray35) {
+ if (_i37 >= _iterator35.length) break;
+ _ref34 = _iterator35[_i37++];
+ } else {
+ _i37 = _iterator35.next();
+ if (_i37.done) break;
+ _ref34 = _i37.value;
+ }
+
+ var regex = _ref34;
+
+ if (regex.test(navigator.userAgent)) {
+ capableBrowser = false;
+ continue;
+ }
+ }
+ }
+ } else {
+ capableBrowser = false;
+ }
+
+ return capableBrowser;
+};
+
+Dropzone.dataURItoBlob = function (dataURI) {
+ // convert base64 to raw binary data held in a string
+ // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
+ var byteString = atob(dataURI.split(',')[1]);
+
+ // separate out the mime component
+ var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
+
+ // write the bytes of the string to an ArrayBuffer
+ var ab = new ArrayBuffer(byteString.length);
+ var ia = new Uint8Array(ab);
+ for (var i = 0, end = byteString.length, asc = 0 <= end; asc ? i <= end : i >= end; asc ? i++ : i--) {
+ ia[i] = byteString.charCodeAt(i);
+ }
+
+ // write the ArrayBuffer to a blob
+ return new Blob([ab], { type: mimeString });
+};
+
+// Returns an array without the rejected item
+var without = function without(list, rejectedItem) {
+ return list.filter(function (item) {
+ return item !== rejectedItem;
+ }).map(function (item) {
+ return item;
+ });
+};
+
+// abc-def_ghi -> abcDefGhi
+var camelize = function camelize(str) {
+ return str.replace(/[\-_](\w)/g, function (match) {
+ return match.charAt(1).toUpperCase();
+ });
+};
+
+// Creates an element from string
+Dropzone.createElement = function (string) {
+ var div = document.createElement("div");
+ div.innerHTML = string;
+ return div.childNodes[0];
+};
+
+// Tests if given element is inside (or simply is) the container
+Dropzone.elementInside = function (element, container) {
+ if (element === container) {
+ return true;
+ } // Coffeescript doesn't support do/while loops
+ while (element = element.parentNode) {
+ if (element === container) {
+ return true;
+ }
+ }
+ return false;
+};
+
+Dropzone.getElement = function (el, name) {
+ var element = void 0;
+ if (typeof el === "string") {
+ element = document.querySelector(el);
+ } else if (el.nodeType != null) {
+ element = el;
+ }
+ if (element == null) {
+ throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector or a plain HTML element.");
+ }
+ return element;
+};
+
+Dropzone.getElements = function (els, name) {
+ var el = void 0,
+ elements = void 0;
+ if (els instanceof Array) {
+ elements = [];
+ try {
+ for (var _iterator36 = els, _isArray36 = true, _i38 = 0, _iterator36 = _isArray36 ? _iterator36 : _iterator36[Symbol.iterator]();;) {
+ if (_isArray36) {
+ if (_i38 >= _iterator36.length) break;
+ el = _iterator36[_i38++];
+ } else {
+ _i38 = _iterator36.next();
+ if (_i38.done) break;
+ el = _i38.value;
+ }
+
+ elements.push(this.getElement(el, name));
+ }
+ } catch (e) {
+ elements = null;
+ }
+ } else if (typeof els === "string") {
+ elements = [];
+ for (var _iterator37 = document.querySelectorAll(els), _isArray37 = true, _i39 = 0, _iterator37 = _isArray37 ? _iterator37 : _iterator37[Symbol.iterator]();;) {
+ if (_isArray37) {
+ if (_i39 >= _iterator37.length) break;
+ el = _iterator37[_i39++];
+ } else {
+ _i39 = _iterator37.next();
+ if (_i39.done) break;
+ el = _i39.value;
+ }
+
+ elements.push(el);
+ }
+ } else if (els.nodeType != null) {
+ elements = [els];
+ }
+
+ if (elements == null || !elements.length) {
+ throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");
+ }
+
+ return elements;
+};
+
+// Asks the user the question and calls accepted or rejected accordingly
+//
+// The default implementation just uses `window.confirm` and then calls the
+// appropriate callback.
+Dropzone.confirm = function (question, accepted, rejected) {
+ if (window.confirm(question)) {
+ return accepted();
+ } else if (rejected != null) {
+ return rejected();
+ }
+};
+
+// Validates the mime type like this:
+//
+// https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept
+Dropzone.isValidFile = function (file, acceptedFiles) {
+ if (!acceptedFiles) {
+ return true;
+ } // If there are no accepted mime types, it's OK
+ acceptedFiles = acceptedFiles.split(",");
+
+ var mimeType = file.type;
+ var baseMimeType = mimeType.replace(/\/.*$/, "");
+
+ for (var _iterator38 = acceptedFiles, _isArray38 = true, _i40 = 0, _iterator38 = _isArray38 ? _iterator38 : _iterator38[Symbol.iterator]();;) {
+ var _ref35;
+
+ if (_isArray38) {
+ if (_i40 >= _iterator38.length) break;
+ _ref35 = _iterator38[_i40++];
+ } else {
+ _i40 = _iterator38.next();
+ if (_i40.done) break;
+ _ref35 = _i40.value;
+ }
+
+ var validType = _ref35;
+
+ validType = validType.trim();
+ if (validType.charAt(0) === ".") {
+ if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {
+ return true;
+ }
+ } else if (/\/\*$/.test(validType)) {
+ // This is something like a image/* mime type
+ if (baseMimeType === validType.replace(/\/.*$/, "")) {
+ return true;
+ }
+ } else {
+ if (mimeType === validType) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+};
+
+// Augment jQuery
+if (typeof jQuery !== 'undefined' && jQuery !== null) {
+ jQuery.fn.dropzone = function (options) {
+ return this.each(function () {
+ return new Dropzone(this, options);
+ });
+ };
+}
+
+if (typeof module !== 'undefined' && module !== null) {
+ module.exports = Dropzone;
+} else {
+ window.Dropzone = Dropzone;
+}
+
+// Dropzone file status codes
+Dropzone.ADDED = "added";
+
+Dropzone.QUEUED = "queued";
+// For backwards compatibility. Now, if a file is accepted, it's either queued
+// or uploading.
+Dropzone.ACCEPTED = Dropzone.QUEUED;
+
+Dropzone.UPLOADING = "uploading";
+Dropzone.PROCESSING = Dropzone.UPLOADING; // alias
+
+Dropzone.CANCELED = "canceled";
+Dropzone.ERROR = "error";
+Dropzone.SUCCESS = "success";
+
+/*
+
+ Bugfix for iOS 6 and 7
+ Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios
+ based on the work of https://github.com/stomita/ios-imagefile-megapixel
+
+ */
+
+// Detecting vertical squash in loaded image.
+// Fixes a bug which squash image vertically while drawing into canvas for some images.
+// This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel
+var detectVerticalSquash = function detectVerticalSquash(img) {
+ var iw = img.naturalWidth;
+ var ih = img.naturalHeight;
+ var canvas = document.createElement("canvas");
+ canvas.width = 1;
+ canvas.height = ih;
+ var ctx = canvas.getContext("2d");
+ ctx.drawImage(img, 0, 0);
+
+ var _ctx$getImageData = ctx.getImageData(1, 0, 1, ih),
+ data = _ctx$getImageData.data;
+
+ // search image edge pixel position in case it is squashed vertically.
+
+
+ var sy = 0;
+ var ey = ih;
+ var py = ih;
+ while (py > sy) {
+ var alpha = data[(py - 1) * 4 + 3];
+
+ if (alpha === 0) {
+ ey = py;
+ } else {
+ sy = py;
+ }
+
+ py = ey + sy >> 1;
+ }
+ var ratio = py / ih;
+
+ if (ratio === 0) {
+ return 1;
+ } else {
+ return ratio;
+ }
+};
+
+// A replacement for context.drawImage
+// (args are for source and destination).
+var drawImageIOSFix = function drawImageIOSFix(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) {
+ var vertSquashRatio = detectVerticalSquash(img);
+ return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio);
+};
+
+// Based on MinifyJpeg
+// Source: http://www.perry.cz/files/ExifRestorer.js
+// http://elicon.blog57.fc2.com/blog-entry-206.html
+
+var ExifRestore = function () {
+ function ExifRestore() {
+ _classCallCheck(this, ExifRestore);
+ }
+
+ _createClass(ExifRestore, null, [{
+ key: "initClass",
+ value: function initClass() {
+ this.KEY_STR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
+ }
+ }, {
+ key: "encode64",
+ value: function encode64(input) {
+ var output = '';
+ var chr1 = undefined;
+ var chr2 = undefined;
+ var chr3 = '';
+ var enc1 = undefined;
+ var enc2 = undefined;
+ var enc3 = undefined;
+ var enc4 = '';
+ var i = 0;
+ while (true) {
+ chr1 = input[i++];
+ chr2 = input[i++];
+ chr3 = input[i++];
+ enc1 = chr1 >> 2;
+ enc2 = (chr1 & 3) << 4 | chr2 >> 4;
+ enc3 = (chr2 & 15) << 2 | chr3 >> 6;
+ enc4 = chr3 & 63;
+ if (isNaN(chr2)) {
+ enc3 = enc4 = 64;
+ } else if (isNaN(chr3)) {
+ enc4 = 64;
+ }
+ output = output + this.KEY_STR.charAt(enc1) + this.KEY_STR.charAt(enc2) + this.KEY_STR.charAt(enc3) + this.KEY_STR.charAt(enc4);
+ chr1 = chr2 = chr3 = '';
+ enc1 = enc2 = enc3 = enc4 = '';
+ if (!(i < input.length)) {
+ break;
+ }
+ }
+ return output;
+ }
+ }, {
+ key: "restore",
+ value: function restore(origFileBase64, resizedFileBase64) {
+ if (!origFileBase64.match('data:image/jpeg;base64,')) {
+ return resizedFileBase64;
+ }
+ var rawImage = this.decode64(origFileBase64.replace('data:image/jpeg;base64,', ''));
+ var segments = this.slice2Segments(rawImage);
+ var image = this.exifManipulation(resizedFileBase64, segments);
+ return "data:image/jpeg;base64," + this.encode64(image);
+ }
+ }, {
+ key: "exifManipulation",
+ value: function exifManipulation(resizedFileBase64, segments) {
+ var exifArray = this.getExifArray(segments);
+ var newImageArray = this.insertExif(resizedFileBase64, exifArray);
+ var aBuffer = new Uint8Array(newImageArray);
+ return aBuffer;
+ }
+ }, {
+ key: "getExifArray",
+ value: function getExifArray(segments) {
+ var seg = undefined;
+ var x = 0;
+ while (x < segments.length) {
+ seg = segments[x];
+ if (seg[0] === 255 & seg[1] === 225) {
+ return seg;
+ }
+ x++;
+ }
+ return [];
+ }
+ }, {
+ key: "insertExif",
+ value: function insertExif(resizedFileBase64, exifArray) {
+ var imageData = resizedFileBase64.replace('data:image/jpeg;base64,', '');
+ var buf = this.decode64(imageData);
+ var separatePoint = buf.indexOf(255, 3);
+ var mae = buf.slice(0, separatePoint);
+ var ato = buf.slice(separatePoint);
+ var array = mae;
+ array = array.concat(exifArray);
+ array = array.concat(ato);
+ return array;
+ }
+ }, {
+ key: "slice2Segments",
+ value: function slice2Segments(rawImageArray) {
+ var head = 0;
+ var segments = [];
+ while (true) {
+ var length;
+ if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 218) {
+ break;
+ }
+ if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 216) {
+ head += 2;
+ } else {
+ length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3];
+ var endPoint = head + length + 2;
+ var seg = rawImageArray.slice(head, endPoint);
+ segments.push(seg);
+ head = endPoint;
+ }
+ if (head > rawImageArray.length) {
+ break;
+ }
+ }
+ return segments;
+ }
+ }, {
+ key: "decode64",
+ value: function decode64(input) {
+ var output = '';
+ var chr1 = undefined;
+ var chr2 = undefined;
+ var chr3 = '';
+ var enc1 = undefined;
+ var enc2 = undefined;
+ var enc3 = undefined;
+ var enc4 = '';
+ var i = 0;
+ var buf = [];
+ // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
+ var base64test = /[^A-Za-z0-9\+\/\=]/g;
+ if (base64test.exec(input)) {
+ console.warn('There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, \'+\', \'/\',and \'=\'\nExpect errors in decoding.');
+ }
+ input = input.replace(/[^A-Za-z0-9\+\/\=]/g, '');
+ while (true) {
+ enc1 = this.KEY_STR.indexOf(input.charAt(i++));
+ enc2 = this.KEY_STR.indexOf(input.charAt(i++));
+ enc3 = this.KEY_STR.indexOf(input.charAt(i++));
+ enc4 = this.KEY_STR.indexOf(input.charAt(i++));
+ chr1 = enc1 << 2 | enc2 >> 4;
+ chr2 = (enc2 & 15) << 4 | enc3 >> 2;
+ chr3 = (enc3 & 3) << 6 | enc4;
+ buf.push(chr1);
+ if (enc3 !== 64) {
+ buf.push(chr2);
+ }
+ if (enc4 !== 64) {
+ buf.push(chr3);
+ }
+ chr1 = chr2 = chr3 = '';
+ enc1 = enc2 = enc3 = enc4 = '';
+ if (!(i < input.length)) {
+ break;
+ }
+ }
+ return buf;
+ }
+ }]);
+
+ return ExifRestore;
+}();
+
+ExifRestore.initClass();
+
+/*
+ * contentloaded.js
+ *
+ * Author: Diego Perini (diego.perini at gmail.com)
+ * Summary: cross-browser wrapper for DOMContentLoaded
+ * Updated: 20101020
+ * License: MIT
+ * Version: 1.2
+ *
+ * URL:
+ * http://javascript.nwbox.com/ContentLoaded/
+ * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE
+ */
+
+// @win window reference
+// @fn function reference
+var contentLoaded = function contentLoaded(win, fn) {
+ var done = false;
+ var top = true;
+ var doc = win.document;
+ var root = doc.documentElement;
+ var add = doc.addEventListener ? "addEventListener" : "attachEvent";
+ var rem = doc.addEventListener ? "removeEventListener" : "detachEvent";
+ var pre = doc.addEventListener ? "" : "on";
+ var init = function init(e) {
+ if (e.type === "readystatechange" && doc.readyState !== "complete") {
+ return;
+ }
+ (e.type === "load" ? win : doc)[rem](pre + e.type, init, false);
+ if (!done && (done = true)) {
+ return fn.call(win, e.type || e);
+ }
+ };
+
+ var poll = function poll() {
+ try {
+ root.doScroll("left");
+ } catch (e) {
+ setTimeout(poll, 50);
+ return;
+ }
+ return init("poll");
+ };
+
+ if (doc.readyState !== "complete") {
+ if (doc.createEventObject && root.doScroll) {
+ try {
+ top = !win.frameElement;
+ } catch (error) {}
+ if (top) {
+ poll();
+ }
+ }
+ doc[add](pre + "DOMContentLoaded", init, false);
+ doc[add](pre + "readystatechange", init, false);
+ return win[add](pre + "load", init, false);
+ }
+};
+
+// As a single function to be able to write tests.
+Dropzone._autoDiscoverFunction = function () {
+ if (Dropzone.autoDiscover) {
+ return Dropzone.discover();
+ }
+};
+contentLoaded(window, Dropzone._autoDiscoverFunction);
+
+function __guard__(value, transform) {
+ return typeof value !== 'undefined' && value !== null ? transform(value) : undefined;
+}
+function __guardMethod__(obj, methodName, transform) {
+ if (typeof obj !== 'undefined' && obj !== null && typeof obj[methodName] === 'function') {
+ return transform(obj, methodName);
+ } else {
+ return undefined;
+ }
+}
diff --git a/js/highlight.pack.js b/js/highlight.pack.js
new file mode 100644
index 0000000..cf559be
--- /dev/null
+++ b/js/highlight.pack.js
@@ -0,0 +1,2 @@
+/*! highlight.js v9.13.1 | BSD3 License | git.io/hljslicense */
+!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/&/g,"&").replace(//g,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function a(e){return k.test(e)}function i(e){var n,t,r,i,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",t=M.exec(o))return w(t[1])?t[1]:"no-highlight";for(o=o.split(/\s+/),n=0,r=o.length;r>n;n++)if(i=o[n],a(i)||w(i))return i}function o(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function c(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function u(e,r,a){function i(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset"}function c(e){l+=""+t(e)+">"}function u(e){("start"===e.event?o:c)(e.node)}for(var s=0,l="",f=[];e.length||r.length;){var g=i();if(l+=n(a.substring(s,g[0].offset)),s=g[0].offset,g===e){f.reverse().forEach(c);do u(g.splice(0,1)[0]),g=i();while(g===e&&g.length&&g[0].offset===s);f.reverse().forEach(o)}else"start"===g[0].event?f.push(g[0].node):f.pop(),u(g.splice(0,1)[0])}return l+n(a.substr(s))}function s(e){return e.v&&!e.cached_variants&&(e.cached_variants=e.v.map(function(n){return o(e,{v:null},n)})),e.cached_variants||e.eW&&[o(e)]||[e]}function l(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var o={},c=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");o[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?c("keyword",a.k):B(a.k).forEach(function(e){c(e,a.k[e])}),a.k=o}a.lR=t(a.l||/\w+/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.endSameAsBegin&&(a.e=a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),null==a.r&&(a.r=1),a.c||(a.c=[]),a.c=Array.prototype.concat.apply([],a.c.map(function(e){return s("self"===e?a:e)})),a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var u=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=u.length?t(u.join("|"),!0):{exec:function(){return null}}}}r(e)}function f(e,t,a,i){function o(e){return new RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function c(e,n){var t,a;for(t=0,a=n.c.length;a>t;t++)if(r(n.c[t].bR,e))return n.c[t].endSameAsBegin&&(n.c[t].eR=o(n.c[t].bR.exec(e)[0])),n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function s(e,n){return!a&&r(n.iR,e)}function p(e,n){var t=R.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function d(e,n,t,r){var a=r?"":j.classPrefix,i='',i+n+o}function h(){var e,t,r,a;if(!E.k)return n(k);for(a="",t=0,E.lR.lastIndex=0,r=E.lR.exec(k);r;)a+=n(k.substring(t,r.index)),e=p(E,r),e?(M+=e[1],a+=d(e[0],n(r[0]))):a+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(k);return a+n(k.substr(t))}function b(){var e="string"==typeof E.sL;if(e&&!L[E.sL])return n(k);var t=e?f(E.sL,k,!0,B[E.sL]):g(k,E.sL.length?E.sL:void 0);return E.r>0&&(M+=t.r),e&&(B[E.sL]=t.top),d(t.language,t.value,!1,!0)}function v(){y+=null!=E.sL?b():h(),k=""}function m(e){y+=e.cN?d(e.cN,"",!0):"",E=Object.create(e,{parent:{value:E}})}function N(e,n){if(k+=e,null==n)return v(),0;var t=c(n,E);if(t)return t.skip?k+=n:(t.eB&&(k+=n),v(),t.rB||t.eB||(k=n)),m(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var a=E;a.skip?k+=n:(a.rE||a.eE||(k+=n),v(),a.eE&&(k=n));do E.cN&&(y+=I),E.skip||E.sL||(M+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&(r.endSameAsBegin&&(r.starts.eR=r.eR),m(r.starts,"")),a.rE?0:n.length}if(s(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.cN||"")+'"');return k+=n,n.length||1}var R=w(e);if(!R)throw new Error('Unknown language: "'+e+'"');l(R);var x,E=i||R,B={},y="";for(x=E;x!==R;x=x.parent)x.cN&&(y=d(x.cN,"",!0)+y);var k="",M=0;try{for(var C,A,S=0;;){if(E.t.lastIndex=S,C=E.t.exec(t),!C)break;A=N(t.substring(S,C.index),C[0]),S=C.index+A}for(N(t.substr(S)),x=E;x.parent;x=x.parent)x.cN&&(y+=I);return{r:M,value:y,language:e,top:E}}catch(O){if(O.message&&-1!==O.message.indexOf("Illegal"))return{r:0,value:n(t)};throw O}}function g(e,t){t=t||j.languages||B(L);var r={r:0,value:n(e)},a=r;return t.filter(w).filter(x).forEach(function(n){var t=f(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}),a.language&&(r.second_best=a),r}function p(e){return j.tabReplace||j.useBR?e.replace(C,function(e,n){return j.useBR&&"\n"===e?"
":j.tabReplace?n.replace(/\t/g,j.tabReplace):""}):e}function d(e,n,t){var r=n?y[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function h(e){var n,t,r,o,s,l=i(e);a(l)||(j.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div"),n.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/
/g,"\n")):n=e,s=n.textContent,r=l?f(l,s,!0):g(s),t=c(n),t.length&&(o=document.createElementNS("http://www.w3.org/1999/xhtml","div"),o.innerHTML=r.value,r.value=u(t,c(o),s)),r.value=p(r.value),e.innerHTML=r.value,e.className=d(e.className,l,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function b(e){j=o(j,e)}function v(){if(!v.called){v.called=!0;var e=document.querySelectorAll("pre code");E.forEach.call(e,h)}}function m(){addEventListener("DOMContentLoaded",v,!1),addEventListener("load",v,!1)}function N(n,t){var r=L[n]=t(e);r.aliases&&r.aliases.forEach(function(e){y[e]=n})}function R(){return B(L)}function w(e){return e=(e||"").toLowerCase(),L[e]||L[y[e]]}function x(e){var n=w(e);return n&&!n.disableAutodetect}var E=[],B=Object.keys,L={},y={},k=/^(no-?highlight|plain|text)$/i,M=/\blang(?:uage)?-([\w-]+)\b/i,C=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,I="",j={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};return e.highlight=f,e.highlightAuto=g,e.fixMarkup=p,e.highlightBlock=h,e.configure=b,e.initHighlighting=v,e.initHighlightingOnLoad=m,e.registerLanguage=N,e.listLanguages=R,e.getLanguage=w,e.autoDetection=x,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.METHOD_GUARD={b:"\\.\\s*"+e.UIR,r:0},e});hljs.registerLanguage("objectivec",function(e){var t={cN:"built_in",b:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},_={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},i=/[a-zA-Z@][a-zA-Z0-9_]*/,n="@interface @class @protocol @implementation";return{aliases:["mm","objc","obj-c"],k:_,l:i,i:"",c:[t,e.CLCM,e.CBCM,e.CNM,e.QSM,{cN:"string",v:[{b:'@"',e:'"',i:"\\n",c:[e.BE]},{b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"}]},{cN:"meta",b:"#",e:"$",c:[{cN:"meta-string",v:[{b:'"',e:'"'},{b:"<",e:">"}]}]},{cN:"class",b:"("+n.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:n,l:i,c:[e.UTM]},{b:"\\."+e.UIR,r:0}]}});hljs.registerLanguage("sql",function(e){var t=e.C("--","$");return{cI:!0,i:/[<>{}*]/,c:[{bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment with",e:/;/,eW:!0,l:/[\w\.]+/,k:{keyword:"as abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias allocate allow alter always analyze ancillary and any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force foreign form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notnull notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second section securefile security seed segment select self sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unnest unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek",literal:"true false null unknown",built_in:"array bigint binary bit blob bool boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text time timestamp varchar varying void"},c:[{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[e.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[e.BE]},e.CNM,e.CBCM,t,e.HCM]},e.CBCM,t,e.HCM]}});hljs.registerLanguage("xml",function(s){var e="[A-Za-z0-9\\._:-]+",t={eW:!0,i:/,r:0,c:[{cN:"attr",b:e,r:0},{b:/=\s*/,r:0,c:[{cN:"string",endsParent:!0,v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/[^\s"'=<>`]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],cI:!0,c:[{cN:"meta",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},s.C("",{r:10}),{b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"meta",b:/<\?xml/,e:/\?>/,r:10},{b:/<\?(php)?/,e:/\?>/,sL:"php",c:[{b:"/\\*",e:"\\*/",skip:!0},{b:'b"',e:'"',skip:!0},{b:"b'",e:"'",skip:!0},s.inherit(s.ASM,{i:null,cN:null,c:null,skip:!0}),s.inherit(s.QSM,{i:null,cN:null,c:null,skip:!0})]},{cN:"tag",b:"",rE:!0,sL:["css","xml"]}},{cN:"tag",b:"",rE:!0,sL:["actionscript","javascript","handlebars","xml"]}},{cN:"tag",b:"?",e:"/?>",c:[{cN:"name",b:/[^\/><\s]+/,r:0},t]}]}});hljs.registerLanguage("markdown",function(e){return{aliases:["md","mkdown","mkd"],c:[{cN:"section",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"quote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"^```w*s*$",e:"^```s*$"},{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"string",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"symbol",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:/^\[[^\n]+\]:/,rB:!0,c:[{cN:"symbol",b:/\[/,e:/\]/,eB:!0,eE:!0},{cN:"link",b:/:\s*/,e:/$/,eB:!0}]}]}});hljs.registerLanguage("accesslog",function(T){return{c:[{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+\\b",r:0},{cN:"string",b:'"(GET|POST|HEAD|PUT|DELETE|CONNECT|OPTIONS|PATCH|TRACE)',e:'"',k:"GET POST HEAD PUT DELETE CONNECT OPTIONS PATCH TRACE",i:"\\n",r:10},{cN:"string",b:/\[/,e:/\]/,i:"\\n"},{cN:"string",b:'"',e:'"',i:"\\n"}]}});hljs.registerLanguage("perl",function(e){var t="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",r={cN:"subst",b:"[$@]\\{",e:"\\}",k:t},s={b:"->{",e:"}"},n={v:[{b:/\$\d/},{b:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{b:/[\$%@][^\s\w{]/,r:0}]},i=[e.BE,r,n],o=[n,e.HCM,e.C("^\\=\\w","\\=cut",{eW:!0}),s,{cN:"string",c:i,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[e.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[e.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"function",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",eE:!0,r:5,c:[e.TM]},{b:"-\\w\\b",r:0},{b:"^__DATA__$",e:"^__END__$",sL:"mojolicious",c:[{b:"^@@.*",e:"$",cN:"comment"}]}];return r.c=o,s.c=o,{aliases:["pl","pm"],l:/[\w\.]+/,k:t,c:o}});hljs.registerLanguage("java",function(e){var a="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",t=a+"(<"+a+"(\\s*,\\s*"+a+")*>)?",r="false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",s="\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",c={cN:"number",b:s,r:0};return{aliases:["jsp"],k:r,i:/<\/|#/,c:[e.C("/\\*\\*","\\*/",{r:0,c:[{b:/\w+@/,r:0},{cN:"doctag",b:"@[A-Za-z]+"}]}),e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw return else",r:0},{cN:"function",b:"("+t+"\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:r,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},c,{cN:"meta",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/\b-?[a-z\._]+\b/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"meta",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,s,a,t]}});hljs.registerLanguage("shell",function(s){return{aliases:["console"],c:[{cN:"meta",b:"^\\s{0,3}[\\w\\d\\[\\]()@-]*[>%$#]",starts:{e:"$",sL:"bash"}}]}});hljs.registerLanguage("json",function(e){var i={literal:"true false null"},n=[e.QSM,e.CNM],r={e:",",eW:!0,eE:!0,c:n,k:i},t={b:"{",e:"}",c:[{cN:"attr",b:/"/,e:/"/,c:[e.BE],i:"\\n"},e.inherit(r,{b:/:/})],i:"\\S"},c={b:"\\[",e:"\\]",c:[e.inherit(r)],i:"\\S"};return n.splice(n.length,0,t,c),{c:n,k:i,i:"\\S"}});hljs.registerLanguage("nginx",function(e){var r={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},b={eW:!0,l:"[a-z/_]+",k:{literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,r],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[r]},{cN:"regexp",c:[e.BE,r],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},r]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s+{",rB:!0,e:"{",c:[{cN:"section",b:e.UIR}],r:0},{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"attribute",b:e.UIR,starts:b}],r:0}],i:"[^\\s\\}]"}});hljs.registerLanguage("ini",function(e){var b={cN:"string",c:[e.BE],v:[{b:"'''",e:"'''",r:10},{b:'"""',e:'"""',r:10},{b:'"',e:'"'},{b:"'",e:"'"}]};return{aliases:["toml"],cI:!0,i:/\S/,c:[e.C(";","$"),e.HCM,{cN:"section",b:/^\s*\[+/,e:/\]+/},{b:/^[a-z0-9\[\]_-]+\s*=\s*/,e:"$",rB:!0,c:[{cN:"attr",b:/[a-z0-9\[\]_-]+/},{b:/=/,eW:!0,r:0,c:[{cN:"literal",b:/\bon|off|true|false|yes|no\b/},{cN:"variable",v:[{b:/\$[\w\d"][\w\d_]*/},{b:/\$\{(.*?)}/}]},b,{cN:"number",b:/([\+\-]+)?[\d]+_[\d_]+/},e.NM]}]}]}});hljs.registerLanguage("http",function(e){var t="HTTP/[0-9\\.]+";return{aliases:["https"],i:"\\S",c:[{b:"^"+t,e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{b:"^[A-Z]+ (.*?) "+t+"$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0},{b:t},{cN:"keyword",b:"[A-Z]+"}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{e:"$",r:0}},{b:"\\n\\n",starts:{sL:[],eW:!0}}]}});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",t={b:/[A-Z\_\.\-]+\s*:/,rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:/\S/,e:":",eE:!0,starts:{eW:!0,eE:!0,c:[{b:/[\w-]+\(/,rB:!0,c:[{cN:"built_in",b:/[\w-]+/},{b:/\(/,e:/\)/,c:[e.ASM,e.QSM]}]},e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"number",b:"#[0-9A-Fa-f]+"},{cN:"meta",b:"!important"}]}}]};return{cI:!0,i:/[=\/|'\$]/,c:[e.CBCM,{cN:"selector-id",b:/#[A-Za-z0-9_-]+/},{cN:"selector-class",b:/\.[A-Za-z0-9_-]+/},{cN:"selector-attr",b:/\[/,e:/\]/,i:"$"},{cN:"selector-pseudo",b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{b:"@",e:"[{;]",i:/:/,c:[{cN:"keyword",b:/\w+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[e.ASM,e.QSM,e.CSSNM]}]},{cN:"selector-tag",b:c,r:0},{b:"{",e:"}",i:/\S/,c:[e.CBCM,t]}]}});hljs.registerLanguage("javascript",function(e){var r="[A-Za-z$_][0-9A-Za-z$_]*",t={keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},a={cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},n={cN:"subst",b:"\\$\\{",e:"\\}",k:t,c:[]},c={cN:"string",b:"`",e:"`",c:[e.BE,n]};n.c=[e.ASM,e.QSM,c,a,e.RM];var s=n.c.concat([e.CBCM,e.CLCM]);return{aliases:["js","jsx"],k:t,c:[{cN:"meta",r:10,b:/^\s*['"]use (strict|asm)['"]/},{cN:"meta",b:/^#!/,e:/$/},e.ASM,e.QSM,c,e.CLCM,e.CBCM,a,{b:/[{,]\s*/,r:0,c:[{b:r+"\\s*:",rB:!0,r:0,c:[{cN:"attr",b:r,r:0}]}]},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{cN:"function",b:"(\\(.*?\\)|"+r+")\\s*=>",rB:!0,e:"\\s*=>",c:[{cN:"params",v:[{b:r},{b:/\(\s*\)/},{b:/\(/,e:/\)/,eB:!0,eE:!0,k:t,c:s}]}]},{b:/,e:/(\/\w+|\w+\/)>/,sL:"xml",c:[{b:/<\w+\s*\/>/,skip:!0},{b:/<\w+/,e:/(\/\w+|\w+\/)>/,skip:!0,c:[{b:/<\w+\s*\/>/,skip:!0},"self"]}]}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:r}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:s}],i:/\[|%/},{b:/\$[(.]/},e.METHOD_GUARD,{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]},{bK:"constructor",e:/\{/,eE:!0}],i:/#(?!!)/}});hljs.registerLanguage("makefile",function(e){var i={cN:"variable",v:[{b:"\\$\\("+e.UIR+"\\)",c:[e.BE]},{b:/\$[@%\^\+\*]/}]},r={cN:"string",b:/"/,e:/"/,c:[e.BE,i]},a={cN:"variable",b:/\$\([\w-]+\s/,e:/\)/,k:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},c:[i]},n={b:"^"+e.UIR+"\\s*[:+?]?=",i:"\\n",rB:!0,c:[{b:"^"+e.UIR,e:"[:+?]?=",eE:!0}]},t={cN:"meta",b:/^\.PHONY:/,e:/$/,k:{"meta-keyword":".PHONY"},l:/[\.\w]+/},l={cN:"section",b:/^[^\s]+:/,e:/$/,c:[i]};return{aliases:["mk","mak"],k:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath",l:/[\w-]+/,c:[e.HCM,i,r,a,n,t,l]}});hljs.registerLanguage("ruby",function(e){var b="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},c={cN:"doctag",b:"@[A-Za-z]+"},a={b:"#<",e:">"},s=[e.C("#","$",{c:[c]}),e.C("^\\=begin","^\\=end",{c:[c],r:10}),e.C("^__END__","\\n$")],n={cN:"subst",b:"#\\{",e:"}",k:r},t={cN:"string",c:[e.BE,n],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{b:/<<(-?)\w+$/,e:/^\s*\w+$/}]},i={cN:"params",b:"\\(",e:"\\)",endsParent:!0,k:r},d=[t,a,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{b:"<\\s*",c:[{b:"("+e.IR+"::)?"+e.IR}]}].concat(s)},{cN:"function",bK:"def",e:"$|;",c:[e.inherit(e.TM,{b:b}),i].concat(s)},{b:e.IR+"::"},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":(?!\\s)",c:[t,{b:b}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{cN:"params",b:/\|/,e:/\|/,k:r},{b:"("+e.RSR+"|unless)\\s*",k:"unless",c:[a,{cN:"regexp",c:[e.BE,n],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(s),r:0}].concat(s);n.c=d,i.c=d;var l="[>?]>",o="[\\w#]+\\(\\w+\\):\\d+:\\d+>",u="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",w=[{b:/^\s*=>/,starts:{e:"$",c:d}},{cN:"meta",b:"^("+l+"|"+o+"|"+u+")",starts:{e:"$",c:d}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,i:/\/\*/,c:s.concat(w).concat(d)}});hljs.registerLanguage("cs",function(e){var i={keyword:"abstract as base bool break byte case catch char checked const continue decimal default delegate do double enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long nameof object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while add alias ascending async await by descending dynamic equals from get global group into join let on orderby partial remove select set value var where yield",literal:"null false true"},r={cN:"number",v:[{b:"\\b(0b[01']+)"},{b:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{b:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],r:0},t={cN:"string",b:'@"',e:'"',c:[{b:'""'}]},a=e.inherit(t,{i:/\n/}),c={cN:"subst",b:"{",e:"}",k:i},n=e.inherit(c,{i:/\n/}),s={cN:"string",b:/\$"/,e:'"',i:/\n/,c:[{b:"{{"},{b:"}}"},e.BE,n]},b={cN:"string",b:/\$@"/,e:'"',c:[{b:"{{"},{b:"}}"},{b:'""'},c]},l=e.inherit(b,{i:/\n/,c:[{b:"{{"},{b:"}}"},{b:'""'},n]});c.c=[b,s,t,e.ASM,e.QSM,r,e.CBCM],n.c=[l,s,a,e.ASM,e.QSM,r,e.inherit(e.CBCM,{i:/\n/})];var o={v:[b,s,t,e.ASM,e.QSM]},d=e.IR+"(<"+e.IR+"(\\s*,\\s*"+e.IR+")*>)?(\\[\\])?";return{aliases:["csharp"],k:i,i:/::/,c:[e.C("///","$",{rB:!0,c:[{cN:"doctag",v:[{b:"///",r:0},{b:""},{b:"?",e:">"}]}]}),e.CLCM,e.CBCM,{cN:"meta",b:"#",e:"$",k:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},o,r,{bK:"class interface",e:/[{;=]/,i:/[^\s:,]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:"namespace",e:/[{;=]/,i:/[^\s:]/,c:[e.inherit(e.TM,{b:"[a-zA-Z](\\.?\\w)*"}),e.CLCM,e.CBCM]},{cN:"meta",b:"^\\s*\\[",eB:!0,e:"\\]",eE:!0,c:[{cN:"meta-string",b:/"/,e:/"/}]},{bK:"new return throw await else",r:0},{cN:"function",b:"("+d+"\\s+)+"+e.IR+"\\s*\\(",rB:!0,e:/\s*[{;=]/,eE:!0,k:i,c:[{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,k:i,r:0,c:[o,r,e.CBCM]},e.CLCM,e.CBCM]}]}});hljs.registerLanguage("coffeescript",function(e){var c={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super yield import export from as default await then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",built_in:"npm require console print module global window document"},n="[A-Za-z$_][0-9A-Za-z$_]*",r={cN:"subst",b:/#\{/,e:/}/,k:c},i=[e.BNM,e.inherit(e.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/"""/,e:/"""/,c:[e.BE,r]},{b:/"/,e:/"/,c:[e.BE,r]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[r,e.HCM]},{b:"//[gim]*",r:0},{b:/\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/}]},{b:"@"+n},{sL:"javascript",eB:!0,eE:!0,v:[{b:"```",e:"```"},{b:"`",e:"`"}]}];r.c=i;var s=e.inherit(e.TM,{b:n}),t="(\\(.*\\))?\\s*\\B[-=]>",o={cN:"params",b:"\\([^\\(]",rB:!0,c:[{b:/\(/,e:/\)/,k:c,c:["self"].concat(i)}]};return{aliases:["coffee","cson","iced"],k:c,i:/\/\*/,c:i.concat([e.C("###","###"),e.HCM,{cN:"function",b:"^\\s*"+n+"\\s*=\\s*"+t,e:"[-=]>",rB:!0,c:[s,o]},{b:/[:\(,=]\s*/,r:0,c:[{cN:"function",b:t,e:"[-=]>",rB:!0,c:[o]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[s]},s]},{b:n+":",e:":",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage("php",function(e){var c={b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},i={cN:"meta",b:/<\?(php)?|\?>/},t={cN:"string",c:[e.BE,i],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},a={v:[e.BNM,e.CNM]};return{aliases:["php","php3","php4","php5","php6","php7"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.HCM,e.C("//","$",{c:[i]}),e.C("/\\*","\\*/",{c:[{cN:"doctag",b:"@[A-Za-z]+"}]}),e.C("__halt_compiler.+?;",!1,{eW:!0,k:"__halt_compiler",l:e.UIR}),{cN:"string",b:/<<<['"]?\w+['"]?$/,e:/^\w+;?$/,c:[e.BE,{cN:"subst",v:[{b:/\$\w+/},{b:/\{\$/,e:/\}/}]}]},i,{cN:"keyword",b:/\$this\b/},c,{b:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",c,e.CBCM,t,a]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},t,a]}});hljs.registerLanguage("cpp",function(t){var e={cN:"keyword",b:"\\b[a-z\\d_]*_t\\b"},r={cN:"string",v:[{b:'(u8?|U|L)?"',e:'"',i:"\\n",c:[t.BE]},{b:'(u8?|U|L)?R"\\(',e:'\\)"'},{b:"'\\\\?.",e:"'",i:"."}]},s={cN:"number",v:[{b:"\\b(0b[01']+)"},{b:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{b:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],r:0},i={cN:"meta",b:/#\s*[a-z]+\b/,e:/$/,k:{"meta-keyword":"if else elif endif define undef warning error line pragma ifdef ifndef include"},c:[{b:/\\\n/,r:0},t.inherit(r,{cN:"meta-string"}),{cN:"meta-string",b:/<[^\n>]*>/,e:/$/,i:"\\n"},t.CLCM,t.CBCM]},a=t.IR+"\\s*\\(",c={keyword:"int float while private char catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and or not",built_in:"std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr",literal:"true false nullptr NULL"},n=[e,t.CLCM,t.CBCM,s,r];return{aliases:["c","cc","h","c++","h++","hpp"],k:c,i:"",c:n.concat([i,{b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:c,c:["self",e]},{b:t.IR+"::",k:c},{v:[{b:/=/,e:/;/},{b:/\(/,e:/\)/},{bK:"new throw return else",e:/;/}],k:c,c:n.concat([{b:/\(/,e:/\)/,k:c,c:n.concat(["self"]),r:0}]),r:0},{cN:"function",b:"("+t.IR+"[\\*&\\s]+)+"+a,rB:!0,e:/[{;=]/,eE:!0,k:c,i:/[^\w\s\*&]/,c:[{b:a,rB:!0,c:[t.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:c,r:0,c:[t.CLCM,t.CBCM,r,s,e,{b:/\(/,e:/\)/,k:c,r:0,c:["self",t.CLCM,t.CBCM,r,s,e]}]},t.CLCM,t.CBCM,i]},{cN:"class",bK:"class struct",e:/[{;:]/,c:[{b:/,e:/>/,c:["self"]},t.TM]}]),exports:{preprocessor:i,strings:r,k:c}}});hljs.registerLanguage("properties",function(r){var t="[ \\t\\f]*",e="[ \\t\\f]+",s="("+t+"[:=]"+t+"|"+e+")",n="([^\\\\\\W:= \\t\\f\\n]|\\\\.)+",a="([^\\\\:= \\t\\f\\n]|\\\\.)+",c={e:s,r:0,starts:{cN:"string",e:/$/,r:0,c:[{b:"\\\\\\n"}]}};return{cI:!0,i:/\S/,c:[r.C("^\\s*[!#]","$"),{b:n+s,rB:!0,c:[{cN:"attr",b:n,endsParent:!0,r:0}],starts:c},{b:a+s,rB:!0,r:0,c:[{cN:"meta",b:a,endsParent:!0,r:0}],starts:c},{cN:"attr",r:0,b:a+t+"$"}]}});hljs.registerLanguage("plaintext",function(e){return{disableAutodetect:!0}});hljs.registerLanguage("diff",function(e){return{aliases:["patch"],c:[{cN:"meta",r:10,v:[{b:/^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"comment",v:[{b:/Index: /,e:/$/},{b:/={3,}/,e:/$/},{b:/^\-{3}/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+{3}/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"addition",b:"^\\!",e:"$"}]}});hljs.registerLanguage("apache",function(e){var r={cN:"number",b:"[\\$%]\\d+"};return{aliases:["apacheconf"],cI:!0,c:[e.HCM,{cN:"section",b:"?",e:">"},{cN:"attribute",b:/\w+/,r:0,k:{nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"meta",b:"\\s\\[",e:"\\]$"},{cN:"variable",b:"[\\$%]\\{",e:"\\}",c:["self",r]},r,e.QSM]}}],i:/\S/}});hljs.registerLanguage("r",function(e){var r="([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*";return{c:[e.HCM,{b:r,l:r,k:{keyword:"function if in break next repeat else for return switch while try tryCatch stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass ...",literal:"NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10"},r:0},{cN:"number",b:"0[xX][0-9a-fA-F]+[Li]?\\b",r:0},{cN:"number",b:"\\d+(?:[eE][+\\-]?\\d*)?L\\b",r:0},{cN:"number",b:"\\d+\\.(?!\\d)(?:i\\b)?",r:0},{cN:"number",b:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{cN:"number",b:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{b:"`",e:"`",r:0},{cN:"string",c:[e.BE],v:[{b:'"',e:'"'},{b:"'",e:"'"}]}]}});hljs.registerLanguage("python",function(e){var r={keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},b={cN:"meta",b:/^(>>>|\.\.\.) /},c={cN:"subst",b:/\{/,e:/\}/,k:r,i:/#/},a={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[e.BE,b],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[e.BE,b],r:10},{b:/(fr|rf|f)'''/,e:/'''/,c:[e.BE,b,c]},{b:/(fr|rf|f)"""/,e:/"""/,c:[e.BE,b,c]},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},{b:/(fr|rf|f)'/,e:/'/,c:[e.BE,c]},{b:/(fr|rf|f)"/,e:/"/,c:[e.BE,c]},e.ASM,e.QSM]},s={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},i={cN:"params",b:/\(/,e:/\)/,c:["self",b,s,a]};return c.c=[a,s,b],{aliases:["py","gyp"],k:r,i:/(<\/|->|\?)|=>/,c:[b,s,a,e.HCM,{v:[{cN:"function",bK:"def"},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n,]/,c:[e.UTM,i,{b:/->/,eW:!0,k:"None"}]},{cN:"meta",b:/^[\t ]*@/,e:/$/},{b:/\b(print|exec)\(/}]}});
\ No newline at end of file
diff --git a/js/pictshare.js b/js/pictshare.js
new file mode 100644
index 0000000..73064a7
--- /dev/null
+++ b/js/pictshare.js
@@ -0,0 +1,19 @@
+Dropzone.autoDiscover = false;
+
+$(function() {
+ var myDropzone = new Dropzone("#dropzone");
+ myDropzone.on("success", function(file,response) {
+ console.log("raw response: "+response);
+ if(response==null || response =="null")
+ $("#uploadinfo").append("Error uploading "+file.name+"
Reason is unknown :(
")
+ else
+ {
+ var o = JSON.parse(response);
+ if(o.status=='ok')
+ $("#uploadinfo").append("")
+ else if(o.status=='err')
+ $("#uploadinfo").append("Error uploading "+file.name+"
Reason: "+o.reason+"
")
+ console.log(o)
+ }
+ });
+ })
\ No newline at end of file
diff --git a/js/styles/a11y-dark.css b/js/styles/a11y-dark.css
new file mode 100644
index 0000000..b93b742
--- /dev/null
+++ b/js/styles/a11y-dark.css
@@ -0,0 +1,99 @@
+/* a11y-dark theme */
+/* Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css */
+/* @author: ericwbailey */
+
+/* Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #d4d0ab;
+}
+
+/* Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-regexp,
+.hljs-deletion {
+ color: #ffa07a;
+}
+
+/* Orange */
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params,
+.hljs-meta,
+.hljs-link {
+ color: #f5ab35;
+}
+
+/* Yellow */
+.hljs-attribute {
+ color: #ffd700;
+}
+
+/* Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition {
+ color: #abe338;
+}
+
+/* Blue */
+.hljs-title,
+.hljs-section {
+ color: #00e0e0;
+}
+
+/* Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #dcc6e0;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #2b2b2b;
+ color: #f8f8f2;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
+
+@media screen and (-ms-high-contrast: active) {
+ .hljs-addition,
+ .hljs-attribute,
+ .hljs-built_in,
+ .hljs-builtin-name,
+ .hljs-bullet,
+ .hljs-comment,
+ .hljs-link,
+ .hljs-literal,
+ .hljs-meta,
+ .hljs-number,
+ .hljs-params,
+ .hljs-string,
+ .hljs-symbol,
+ .hljs-type,
+ .hljs-quote {
+ color: highlight;
+ }
+
+ .hljs-keyword,
+ .hljs-selector-tag {
+ font-weight: bold;
+ }
+}
diff --git a/js/styles/a11y-light.css b/js/styles/a11y-light.css
new file mode 100644
index 0000000..f1bf8f3
--- /dev/null
+++ b/js/styles/a11y-light.css
@@ -0,0 +1,99 @@
+/* a11y-light theme */
+/* Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css */
+/* @author: ericwbailey */
+
+/* Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #696969;
+}
+
+/* Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-regexp,
+.hljs-deletion {
+ color: #d91e18;
+}
+
+/* Orange */
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params,
+.hljs-meta,
+.hljs-link {
+ color: #aa5d00;
+}
+
+/* Yellow */
+.hljs-attribute {
+ color: #aa5d00;
+}
+
+/* Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition {
+ color: #008000;
+}
+
+/* Blue */
+.hljs-title,
+.hljs-section {
+ color: #007faa;
+}
+
+/* Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #7928a1;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #fefefe;
+ color: #545454;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
+
+@media screen and (-ms-high-contrast: active) {
+ .hljs-addition,
+ .hljs-attribute,
+ .hljs-built_in,
+ .hljs-builtin-name,
+ .hljs-bullet,
+ .hljs-comment,
+ .hljs-link,
+ .hljs-literal,
+ .hljs-meta,
+ .hljs-number,
+ .hljs-params,
+ .hljs-string,
+ .hljs-symbol,
+ .hljs-type,
+ .hljs-quote {
+ color: highlight;
+ }
+
+ .hljs-keyword,
+ .hljs-selector-tag {
+ font-weight: bold;
+ }
+}
diff --git a/js/styles/agate.css b/js/styles/agate.css
new file mode 100644
index 0000000..8d64547
--- /dev/null
+++ b/js/styles/agate.css
@@ -0,0 +1,108 @@
+/*!
+ * Agate by Taufik Nurrohman
+ * ----------------------------------------------------
+ *
+ * #ade5fc
+ * #a2fca2
+ * #c6b4f0
+ * #d36363
+ * #fcc28c
+ * #fc9b9b
+ * #ffa
+ * #fff
+ * #333
+ * #62c8f3
+ * #888
+ *
+ */
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #333;
+ color: white;
+}
+
+.hljs-name,
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-code,
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-tag {
+ color: #62c8f3;
+}
+
+.hljs-variable,
+.hljs-template-variable,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #ade5fc;
+}
+
+.hljs-string,
+.hljs-bullet {
+ color: #a2fca2;
+}
+
+.hljs-type,
+.hljs-title,
+.hljs-section,
+.hljs-attribute,
+.hljs-quote,
+.hljs-built_in,
+.hljs-builtin-name {
+ color: #ffa;
+}
+
+.hljs-number,
+.hljs-symbol,
+.hljs-bullet {
+ color: #d36363;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal {
+ color: #fcc28c;
+}
+
+.hljs-comment,
+.hljs-deletion,
+.hljs-code {
+ color: #888;
+}
+
+.hljs-regexp,
+.hljs-link {
+ color: #c6b4f0;
+}
+
+.hljs-meta {
+ color: #fc9b9b;
+}
+
+.hljs-deletion {
+ background-color: #fc9b9b;
+ color: #333;
+}
+
+.hljs-addition {
+ background-color: #a2fca2;
+ color: #333;
+}
+
+.hljs a {
+ color: inherit;
+}
+
+.hljs a:focus,
+.hljs a:hover {
+ color: inherit;
+ text-decoration: underline;
+}
diff --git a/js/styles/an-old-hope.css b/js/styles/an-old-hope.css
new file mode 100644
index 0000000..a6d56f4
--- /dev/null
+++ b/js/styles/an-old-hope.css
@@ -0,0 +1,89 @@
+/*
+
+An Old Hope – Star Wars Syntax (c) Gustavo Costa
+Original theme - Ocean Dark Theme – by https://github.com/gavsiu
+Based on Jesse Leite's Atom syntax theme 'An Old Hope' – https://github.com/JesseLeite/an-old-hope-syntax-atom
+
+*/
+
+/* Death Star Comment */
+.hljs-comment,
+.hljs-quote
+{
+ color: #B6B18B;
+}
+
+/* Darth Vader */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-regexp,
+.hljs-deletion
+{
+ color: #EB3C54;
+}
+
+/* Threepio */
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params,
+.hljs-meta,
+.hljs-link
+{
+ color: #E7CE56;
+}
+
+/* Luke Skywalker */
+.hljs-attribute
+{
+ color: #EE7C2B;
+}
+
+/* Obi Wan Kenobi */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition
+{
+ color: #4FB4D7;
+}
+
+/* Yoda */
+.hljs-title,
+.hljs-section
+{
+ color: #78BB65;
+}
+
+/* Mace Windu */
+.hljs-keyword,
+.hljs-selector-tag
+{
+ color: #B45EA4;
+}
+
+/* Millenium Falcon */
+.hljs
+{
+ display: block;
+ overflow-x: auto;
+ background: #1C1D21;
+ color: #c0c5ce;
+ padding: 0.5em;
+}
+
+.hljs-emphasis
+{
+ font-style: italic;
+}
+
+.hljs-strong
+{
+ font-weight: bold;
+}
diff --git a/js/styles/androidstudio.css b/js/styles/androidstudio.css
new file mode 100644
index 0000000..bc8e473
--- /dev/null
+++ b/js/styles/androidstudio.css
@@ -0,0 +1,66 @@
+/*
+Date: 24 Fev 2015
+Author: Pedro Oliveira
+*/
+
+.hljs {
+ color: #a9b7c6;
+ background: #282b2e;
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+}
+
+.hljs-number,
+.hljs-literal,
+.hljs-symbol,
+.hljs-bullet {
+ color: #6897BB;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-deletion {
+ color: #cc7832;
+}
+
+.hljs-variable,
+.hljs-template-variable,
+.hljs-link {
+ color: #629755;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #808080;
+}
+
+.hljs-meta {
+ color: #bbb529;
+}
+
+.hljs-string,
+.hljs-attribute,
+.hljs-addition {
+ color: #6A8759;
+}
+
+.hljs-section,
+.hljs-title,
+.hljs-type {
+ color: #ffc66d;
+}
+
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #e8bf6a;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/arduino-light.css b/js/styles/arduino-light.css
new file mode 100644
index 0000000..4b8b7fd
--- /dev/null
+++ b/js/styles/arduino-light.css
@@ -0,0 +1,88 @@
+/*
+
+Arduino® Light Theme - Stefania Mellai
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #FFFFFF;
+}
+
+.hljs,
+.hljs-subst {
+ color: #434f54;
+}
+
+.hljs-keyword,
+.hljs-attribute,
+.hljs-selector-tag,
+.hljs-doctag,
+.hljs-name {
+ color: #00979D;
+}
+
+.hljs-built_in,
+.hljs-literal,
+.hljs-bullet,
+.hljs-code,
+.hljs-addition {
+ color: #D35400;
+}
+
+.hljs-regexp,
+.hljs-symbol,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-link,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+ color: #00979D;
+}
+
+.hljs-type,
+.hljs-string,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-quote,
+.hljs-template-tag,
+.hljs-deletion {
+ color: #005C5F;
+}
+
+.hljs-title,
+.hljs-section {
+ color: #880000;
+ font-weight: bold;
+}
+
+.hljs-comment {
+ color: rgba(149,165,166,.8);
+}
+
+.hljs-meta-keyword {
+ color: #728E00;
+}
+
+.hljs-meta {
+ color: #728E00;
+ color: #434f54;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-function {
+ color: #728E00;
+}
+
+.hljs-number {
+ color: #8A7B52;
+}
diff --git a/js/styles/arta.css b/js/styles/arta.css
new file mode 100644
index 0000000..75ef3a9
--- /dev/null
+++ b/js/styles/arta.css
@@ -0,0 +1,73 @@
+/*
+Date: 17.V.2011
+Author: pumbur
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #222;
+}
+
+.hljs,
+.hljs-subst {
+ color: #aaa;
+}
+
+.hljs-section {
+ color: #fff;
+}
+
+.hljs-comment,
+.hljs-quote,
+.hljs-meta {
+ color: #444;
+}
+
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-regexp {
+ color: #ffcc33;
+}
+
+.hljs-number,
+.hljs-addition {
+ color: #00cc66;
+}
+
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-link {
+ color: #32aaee;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #6644aa;
+}
+
+.hljs-title,
+.hljs-variable,
+.hljs-deletion,
+.hljs-template-tag {
+ color: #bb1166;
+}
+
+.hljs-section,
+.hljs-doctag,
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
diff --git a/js/styles/ascetic.css b/js/styles/ascetic.css
new file mode 100644
index 0000000..48397e8
--- /dev/null
+++ b/js/styles/ascetic.css
@@ -0,0 +1,45 @@
+/*
+
+Original style from softwaremaniacs.org (c) Ivan Sagalaev
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: white;
+ color: black;
+}
+
+.hljs-string,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-section,
+.hljs-addition,
+.hljs-attribute,
+.hljs-link {
+ color: #888;
+}
+
+.hljs-comment,
+.hljs-quote,
+.hljs-meta,
+.hljs-deletion {
+ color: #ccc;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-section,
+.hljs-name,
+.hljs-type,
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
diff --git a/js/styles/atelier-cave-dark.css b/js/styles/atelier-cave-dark.css
new file mode 100644
index 0000000..65428f3
--- /dev/null
+++ b/js/styles/atelier-cave-dark.css
@@ -0,0 +1,83 @@
+/* Base16 Atelier Cave Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/cave) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Cave Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #7e7887;
+}
+
+/* Atelier-Cave Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-regexp,
+.hljs-link,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #be4678;
+}
+
+/* Atelier-Cave Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #aa573c;
+}
+
+/* Atelier-Cave Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #2a9292;
+}
+
+/* Atelier-Cave Blue */
+.hljs-title,
+.hljs-section {
+ color: #576ddb;
+}
+
+/* Atelier-Cave Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #955ae7;
+}
+
+.hljs-deletion,
+.hljs-addition {
+ color: #19171c;
+ display: inline-block;
+ width: 100%;
+}
+
+.hljs-deletion {
+ background-color: #be4678;
+}
+
+.hljs-addition {
+ background-color: #2a9292;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #19171c;
+ color: #8b8792;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-cave-light.css b/js/styles/atelier-cave-light.css
new file mode 100644
index 0000000..b419f9f
--- /dev/null
+++ b/js/styles/atelier-cave-light.css
@@ -0,0 +1,85 @@
+/* Base16 Atelier Cave Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/cave) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Cave Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #655f6d;
+}
+
+/* Atelier-Cave Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #be4678;
+}
+
+/* Atelier-Cave Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #aa573c;
+}
+
+/* Atelier-Cave Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #2a9292;
+}
+
+/* Atelier-Cave Blue */
+.hljs-title,
+.hljs-section {
+ color: #576ddb;
+}
+
+/* Atelier-Cave Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #955ae7;
+}
+
+.hljs-deletion,
+.hljs-addition {
+ color: #19171c;
+ display: inline-block;
+ width: 100%;
+}
+
+.hljs-deletion {
+ background-color: #be4678;
+}
+
+.hljs-addition {
+ background-color: #2a9292;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #efecf4;
+ color: #585260;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-dune-dark.css b/js/styles/atelier-dune-dark.css
new file mode 100644
index 0000000..1684f52
--- /dev/null
+++ b/js/styles/atelier-dune-dark.css
@@ -0,0 +1,69 @@
+/* Base16 Atelier Dune Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Dune Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #999580;
+}
+
+/* Atelier-Dune Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #d73737;
+}
+
+/* Atelier-Dune Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #b65611;
+}
+
+/* Atelier-Dune Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #60ac39;
+}
+
+/* Atelier-Dune Blue */
+.hljs-title,
+.hljs-section {
+ color: #6684e1;
+}
+
+/* Atelier-Dune Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #b854d4;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #20201d;
+ color: #a6a28c;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-dune-light.css b/js/styles/atelier-dune-light.css
new file mode 100644
index 0000000..547719d
--- /dev/null
+++ b/js/styles/atelier-dune-light.css
@@ -0,0 +1,69 @@
+/* Base16 Atelier Dune Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Dune Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #7d7a68;
+}
+
+/* Atelier-Dune Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #d73737;
+}
+
+/* Atelier-Dune Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #b65611;
+}
+
+/* Atelier-Dune Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #60ac39;
+}
+
+/* Atelier-Dune Blue */
+.hljs-title,
+.hljs-section {
+ color: #6684e1;
+}
+
+/* Atelier-Dune Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #b854d4;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #fefbec;
+ color: #6e6b5e;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-estuary-dark.css b/js/styles/atelier-estuary-dark.css
new file mode 100644
index 0000000..a5e5071
--- /dev/null
+++ b/js/styles/atelier-estuary-dark.css
@@ -0,0 +1,84 @@
+/* Base16 Atelier Estuary Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/estuary) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Estuary Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #878573;
+}
+
+/* Atelier-Estuary Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #ba6236;
+}
+
+/* Atelier-Estuary Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #ae7313;
+}
+
+/* Atelier-Estuary Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #7d9726;
+}
+
+/* Atelier-Estuary Blue */
+.hljs-title,
+.hljs-section {
+ color: #36a166;
+}
+
+/* Atelier-Estuary Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #5f9182;
+}
+
+.hljs-deletion,
+.hljs-addition {
+ color: #22221b;
+ display: inline-block;
+ width: 100%;
+}
+
+.hljs-deletion {
+ background-color: #ba6236;
+}
+
+.hljs-addition {
+ background-color: #7d9726;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #22221b;
+ color: #929181;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-estuary-light.css b/js/styles/atelier-estuary-light.css
new file mode 100644
index 0000000..1daee5d
--- /dev/null
+++ b/js/styles/atelier-estuary-light.css
@@ -0,0 +1,84 @@
+/* Base16 Atelier Estuary Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/estuary) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Estuary Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #6c6b5a;
+}
+
+/* Atelier-Estuary Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #ba6236;
+}
+
+/* Atelier-Estuary Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #ae7313;
+}
+
+/* Atelier-Estuary Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #7d9726;
+}
+
+/* Atelier-Estuary Blue */
+.hljs-title,
+.hljs-section {
+ color: #36a166;
+}
+
+/* Atelier-Estuary Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #5f9182;
+}
+
+.hljs-deletion,
+.hljs-addition {
+ color: #22221b;
+ display: inline-block;
+ width: 100%;
+}
+
+.hljs-deletion {
+ background-color: #ba6236;
+}
+
+.hljs-addition {
+ background-color: #7d9726;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #f4f3ec;
+ color: #5f5e4e;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-forest-dark.css b/js/styles/atelier-forest-dark.css
new file mode 100644
index 0000000..0ef4fae
--- /dev/null
+++ b/js/styles/atelier-forest-dark.css
@@ -0,0 +1,69 @@
+/* Base16 Atelier Forest Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Forest Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #9c9491;
+}
+
+/* Atelier-Forest Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #f22c40;
+}
+
+/* Atelier-Forest Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #df5320;
+}
+
+/* Atelier-Forest Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #7b9726;
+}
+
+/* Atelier-Forest Blue */
+.hljs-title,
+.hljs-section {
+ color: #407ee7;
+}
+
+/* Atelier-Forest Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #6666ea;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #1b1918;
+ color: #a8a19f;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-forest-light.css b/js/styles/atelier-forest-light.css
new file mode 100644
index 0000000..bbedde1
--- /dev/null
+++ b/js/styles/atelier-forest-light.css
@@ -0,0 +1,69 @@
+/* Base16 Atelier Forest Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Forest Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #766e6b;
+}
+
+/* Atelier-Forest Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #f22c40;
+}
+
+/* Atelier-Forest Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #df5320;
+}
+
+/* Atelier-Forest Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #7b9726;
+}
+
+/* Atelier-Forest Blue */
+.hljs-title,
+.hljs-section {
+ color: #407ee7;
+}
+
+/* Atelier-Forest Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #6666ea;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #f1efee;
+ color: #68615e;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-heath-dark.css b/js/styles/atelier-heath-dark.css
new file mode 100644
index 0000000..fe01ff7
--- /dev/null
+++ b/js/styles/atelier-heath-dark.css
@@ -0,0 +1,69 @@
+/* Base16 Atelier Heath Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Heath Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #9e8f9e;
+}
+
+/* Atelier-Heath Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #ca402b;
+}
+
+/* Atelier-Heath Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #a65926;
+}
+
+/* Atelier-Heath Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #918b3b;
+}
+
+/* Atelier-Heath Blue */
+.hljs-title,
+.hljs-section {
+ color: #516aec;
+}
+
+/* Atelier-Heath Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #7b59c0;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #1b181b;
+ color: #ab9bab;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-heath-light.css b/js/styles/atelier-heath-light.css
new file mode 100644
index 0000000..ee43786
--- /dev/null
+++ b/js/styles/atelier-heath-light.css
@@ -0,0 +1,69 @@
+/* Base16 Atelier Heath Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Heath Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #776977;
+}
+
+/* Atelier-Heath Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #ca402b;
+}
+
+/* Atelier-Heath Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #a65926;
+}
+
+/* Atelier-Heath Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #918b3b;
+}
+
+/* Atelier-Heath Blue */
+.hljs-title,
+.hljs-section {
+ color: #516aec;
+}
+
+/* Atelier-Heath Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #7b59c0;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #f7f3f7;
+ color: #695d69;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-lakeside-dark.css b/js/styles/atelier-lakeside-dark.css
new file mode 100644
index 0000000..a937d3b
--- /dev/null
+++ b/js/styles/atelier-lakeside-dark.css
@@ -0,0 +1,69 @@
+/* Base16 Atelier Lakeside Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Lakeside Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #7195a8;
+}
+
+/* Atelier-Lakeside Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #d22d72;
+}
+
+/* Atelier-Lakeside Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #935c25;
+}
+
+/* Atelier-Lakeside Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #568c3b;
+}
+
+/* Atelier-Lakeside Blue */
+.hljs-title,
+.hljs-section {
+ color: #257fad;
+}
+
+/* Atelier-Lakeside Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #6b6bb8;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #161b1d;
+ color: #7ea2b4;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-lakeside-light.css b/js/styles/atelier-lakeside-light.css
new file mode 100644
index 0000000..6c7e8f9
--- /dev/null
+++ b/js/styles/atelier-lakeside-light.css
@@ -0,0 +1,69 @@
+/* Base16 Atelier Lakeside Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Lakeside Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #5a7b8c;
+}
+
+/* Atelier-Lakeside Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #d22d72;
+}
+
+/* Atelier-Lakeside Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #935c25;
+}
+
+/* Atelier-Lakeside Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #568c3b;
+}
+
+/* Atelier-Lakeside Blue */
+.hljs-title,
+.hljs-section {
+ color: #257fad;
+}
+
+/* Atelier-Lakeside Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #6b6bb8;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #ebf8ff;
+ color: #516d7b;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-plateau-dark.css b/js/styles/atelier-plateau-dark.css
new file mode 100644
index 0000000..3bb0526
--- /dev/null
+++ b/js/styles/atelier-plateau-dark.css
@@ -0,0 +1,84 @@
+/* Base16 Atelier Plateau Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/plateau) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Plateau Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #7e7777;
+}
+
+/* Atelier-Plateau Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #ca4949;
+}
+
+/* Atelier-Plateau Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #b45a3c;
+}
+
+/* Atelier-Plateau Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #4b8b8b;
+}
+
+/* Atelier-Plateau Blue */
+.hljs-title,
+.hljs-section {
+ color: #7272ca;
+}
+
+/* Atelier-Plateau Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #8464c4;
+}
+
+.hljs-deletion,
+.hljs-addition {
+ color: #1b1818;
+ display: inline-block;
+ width: 100%;
+}
+
+.hljs-deletion {
+ background-color: #ca4949;
+}
+
+.hljs-addition {
+ background-color: #4b8b8b;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #1b1818;
+ color: #8a8585;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-plateau-light.css b/js/styles/atelier-plateau-light.css
new file mode 100644
index 0000000..5f0222b
--- /dev/null
+++ b/js/styles/atelier-plateau-light.css
@@ -0,0 +1,84 @@
+/* Base16 Atelier Plateau Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/plateau) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Plateau Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #655d5d;
+}
+
+/* Atelier-Plateau Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #ca4949;
+}
+
+/* Atelier-Plateau Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #b45a3c;
+}
+
+/* Atelier-Plateau Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #4b8b8b;
+}
+
+/* Atelier-Plateau Blue */
+.hljs-title,
+.hljs-section {
+ color: #7272ca;
+}
+
+/* Atelier-Plateau Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #8464c4;
+}
+
+.hljs-deletion,
+.hljs-addition {
+ color: #1b1818;
+ display: inline-block;
+ width: 100%;
+}
+
+.hljs-deletion {
+ background-color: #ca4949;
+}
+
+.hljs-addition {
+ background-color: #4b8b8b;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #f4ecec;
+ color: #585050;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-savanna-dark.css b/js/styles/atelier-savanna-dark.css
new file mode 100644
index 0000000..38f8314
--- /dev/null
+++ b/js/styles/atelier-savanna-dark.css
@@ -0,0 +1,84 @@
+/* Base16 Atelier Savanna Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/savanna) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Savanna Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #78877d;
+}
+
+/* Atelier-Savanna Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #b16139;
+}
+
+/* Atelier-Savanna Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #9f713c;
+}
+
+/* Atelier-Savanna Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #489963;
+}
+
+/* Atelier-Savanna Blue */
+.hljs-title,
+.hljs-section {
+ color: #478c90;
+}
+
+/* Atelier-Savanna Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #55859b;
+}
+
+.hljs-deletion,
+.hljs-addition {
+ color: #171c19;
+ display: inline-block;
+ width: 100%;
+}
+
+.hljs-deletion {
+ background-color: #b16139;
+}
+
+.hljs-addition {
+ background-color: #489963;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #171c19;
+ color: #87928a;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-savanna-light.css b/js/styles/atelier-savanna-light.css
new file mode 100644
index 0000000..1ccd7c6
--- /dev/null
+++ b/js/styles/atelier-savanna-light.css
@@ -0,0 +1,84 @@
+/* Base16 Atelier Savanna Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/savanna) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Savanna Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #5f6d64;
+}
+
+/* Atelier-Savanna Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #b16139;
+}
+
+/* Atelier-Savanna Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #9f713c;
+}
+
+/* Atelier-Savanna Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #489963;
+}
+
+/* Atelier-Savanna Blue */
+.hljs-title,
+.hljs-section {
+ color: #478c90;
+}
+
+/* Atelier-Savanna Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #55859b;
+}
+
+.hljs-deletion,
+.hljs-addition {
+ color: #171c19;
+ display: inline-block;
+ width: 100%;
+}
+
+.hljs-deletion {
+ background-color: #b16139;
+}
+
+.hljs-addition {
+ background-color: #489963;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #ecf4ee;
+ color: #526057;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-seaside-dark.css b/js/styles/atelier-seaside-dark.css
new file mode 100644
index 0000000..df29949
--- /dev/null
+++ b/js/styles/atelier-seaside-dark.css
@@ -0,0 +1,69 @@
+/* Base16 Atelier Seaside Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Seaside Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #809980;
+}
+
+/* Atelier-Seaside Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #e6193c;
+}
+
+/* Atelier-Seaside Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #87711d;
+}
+
+/* Atelier-Seaside Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #29a329;
+}
+
+/* Atelier-Seaside Blue */
+.hljs-title,
+.hljs-section {
+ color: #3d62f5;
+}
+
+/* Atelier-Seaside Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #ad2bee;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #131513;
+ color: #8ca68c;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-seaside-light.css b/js/styles/atelier-seaside-light.css
new file mode 100644
index 0000000..9d960f2
--- /dev/null
+++ b/js/styles/atelier-seaside-light.css
@@ -0,0 +1,69 @@
+/* Base16 Atelier Seaside Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Seaside Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #687d68;
+}
+
+/* Atelier-Seaside Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #e6193c;
+}
+
+/* Atelier-Seaside Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #87711d;
+}
+
+/* Atelier-Seaside Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #29a329;
+}
+
+/* Atelier-Seaside Blue */
+.hljs-title,
+.hljs-section {
+ color: #3d62f5;
+}
+
+/* Atelier-Seaside Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #ad2bee;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #f4fbf4;
+ color: #5e6e5e;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-sulphurpool-dark.css b/js/styles/atelier-sulphurpool-dark.css
new file mode 100644
index 0000000..c2ab793
--- /dev/null
+++ b/js/styles/atelier-sulphurpool-dark.css
@@ -0,0 +1,69 @@
+/* Base16 Atelier Sulphurpool Dark - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/sulphurpool) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Sulphurpool Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #898ea4;
+}
+
+/* Atelier-Sulphurpool Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #c94922;
+}
+
+/* Atelier-Sulphurpool Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #c76b29;
+}
+
+/* Atelier-Sulphurpool Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #ac9739;
+}
+
+/* Atelier-Sulphurpool Blue */
+.hljs-title,
+.hljs-section {
+ color: #3d8fd1;
+}
+
+/* Atelier-Sulphurpool Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #6679cc;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #202746;
+ color: #979db4;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atelier-sulphurpool-light.css b/js/styles/atelier-sulphurpool-light.css
new file mode 100644
index 0000000..96c47d0
--- /dev/null
+++ b/js/styles/atelier-sulphurpool-light.css
@@ -0,0 +1,69 @@
+/* Base16 Atelier Sulphurpool Light - Theme */
+/* by Bram de Haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/sulphurpool) */
+/* Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) */
+
+/* Atelier-Sulphurpool Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #6b7394;
+}
+
+/* Atelier-Sulphurpool Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-regexp,
+.hljs-link,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #c94922;
+}
+
+/* Atelier-Sulphurpool Orange */
+.hljs-number,
+.hljs-meta,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #c76b29;
+}
+
+/* Atelier-Sulphurpool Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet {
+ color: #ac9739;
+}
+
+/* Atelier-Sulphurpool Blue */
+.hljs-title,
+.hljs-section {
+ color: #3d8fd1;
+}
+
+/* Atelier-Sulphurpool Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #6679cc;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #f5f7ff;
+ color: #5e6687;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/atom-one-dark-reasonable.css b/js/styles/atom-one-dark-reasonable.css
new file mode 100644
index 0000000..fd41c99
--- /dev/null
+++ b/js/styles/atom-one-dark-reasonable.css
@@ -0,0 +1,77 @@
+/*
+
+Atom One Dark With support for ReasonML by Gidi Morris, based off work by Daniel Gamage
+
+Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
+
+*/
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ line-height: 1.3em;
+ color: #abb2bf;
+ background: #282c34;
+ border-radius: 5px;
+}
+.hljs-keyword, .hljs-operator {
+ color: #F92672;
+}
+.hljs-pattern-match {
+ color: #F92672;
+}
+.hljs-pattern-match .hljs-constructor {
+ color: #61aeee;
+}
+.hljs-function {
+ color: #61aeee;
+}
+.hljs-function .hljs-params {
+ color: #A6E22E;
+}
+.hljs-function .hljs-params .hljs-typing {
+ color: #FD971F;
+}
+.hljs-module-access .hljs-module {
+ color: #7e57c2;
+}
+.hljs-constructor {
+ color: #e2b93d;
+}
+.hljs-constructor .hljs-string {
+ color: #9CCC65;
+}
+.hljs-comment, .hljs-quote {
+ color: #b18eb1;
+ font-style: italic;
+}
+.hljs-doctag, .hljs-formula {
+ color: #c678dd;
+}
+.hljs-section, .hljs-name, .hljs-selector-tag, .hljs-deletion, .hljs-subst {
+ color: #e06c75;
+}
+.hljs-literal {
+ color: #56b6c2;
+}
+.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta-string {
+ color: #98c379;
+}
+.hljs-built_in, .hljs-class .hljs-title {
+ color: #e6c07b;
+}
+.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number {
+ color: #d19a66;
+}
+.hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-title {
+ color: #61aeee;
+}
+.hljs-emphasis {
+ font-style: italic;
+}
+.hljs-strong {
+ font-weight: bold;
+}
+.hljs-link {
+ text-decoration: underline;
+}
diff --git a/js/styles/atom-one-dark.css b/js/styles/atom-one-dark.css
new file mode 100644
index 0000000..1616aaf
--- /dev/null
+++ b/js/styles/atom-one-dark.css
@@ -0,0 +1,96 @@
+/*
+
+Atom One Dark by Daniel Gamage
+Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
+
+base: #282c34
+mono-1: #abb2bf
+mono-2: #818896
+mono-3: #5c6370
+hue-1: #56b6c2
+hue-2: #61aeee
+hue-3: #c678dd
+hue-4: #98c379
+hue-5: #e06c75
+hue-5-2: #be5046
+hue-6: #d19a66
+hue-6-2: #e6c07b
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ color: #abb2bf;
+ background: #282c34;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #5c6370;
+ font-style: italic;
+}
+
+.hljs-doctag,
+.hljs-keyword,
+.hljs-formula {
+ color: #c678dd;
+}
+
+.hljs-section,
+.hljs-name,
+.hljs-selector-tag,
+.hljs-deletion,
+.hljs-subst {
+ color: #e06c75;
+}
+
+.hljs-literal {
+ color: #56b6c2;
+}
+
+.hljs-string,
+.hljs-regexp,
+.hljs-addition,
+.hljs-attribute,
+.hljs-meta-string {
+ color: #98c379;
+}
+
+.hljs-built_in,
+.hljs-class .hljs-title {
+ color: #e6c07b;
+}
+
+.hljs-attr,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-type,
+.hljs-selector-class,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-number {
+ color: #d19a66;
+}
+
+.hljs-symbol,
+.hljs-bullet,
+.hljs-link,
+.hljs-meta,
+.hljs-selector-id,
+.hljs-title {
+ color: #61aeee;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-link {
+ text-decoration: underline;
+}
diff --git a/js/styles/atom-one-light.css b/js/styles/atom-one-light.css
new file mode 100644
index 0000000..d5bd1d2
--- /dev/null
+++ b/js/styles/atom-one-light.css
@@ -0,0 +1,96 @@
+/*
+
+Atom One Light by Daniel Gamage
+Original One Light Syntax theme from https://github.com/atom/one-light-syntax
+
+base: #fafafa
+mono-1: #383a42
+mono-2: #686b77
+mono-3: #a0a1a7
+hue-1: #0184bb
+hue-2: #4078f2
+hue-3: #a626a4
+hue-4: #50a14f
+hue-5: #e45649
+hue-5-2: #c91243
+hue-6: #986801
+hue-6-2: #c18401
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ color: #383a42;
+ background: #fafafa;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #a0a1a7;
+ font-style: italic;
+}
+
+.hljs-doctag,
+.hljs-keyword,
+.hljs-formula {
+ color: #a626a4;
+}
+
+.hljs-section,
+.hljs-name,
+.hljs-selector-tag,
+.hljs-deletion,
+.hljs-subst {
+ color: #e45649;
+}
+
+.hljs-literal {
+ color: #0184bb;
+}
+
+.hljs-string,
+.hljs-regexp,
+.hljs-addition,
+.hljs-attribute,
+.hljs-meta-string {
+ color: #50a14f;
+}
+
+.hljs-built_in,
+.hljs-class .hljs-title {
+ color: #c18401;
+}
+
+.hljs-attr,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-type,
+.hljs-selector-class,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-number {
+ color: #986801;
+}
+
+.hljs-symbol,
+.hljs-bullet,
+.hljs-link,
+.hljs-meta,
+.hljs-selector-id,
+.hljs-title {
+ color: #4078f2;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-link {
+ text-decoration: underline;
+}
diff --git a/js/styles/brown-paper.css b/js/styles/brown-paper.css
new file mode 100644
index 0000000..f0197b9
--- /dev/null
+++ b/js/styles/brown-paper.css
@@ -0,0 +1,64 @@
+/*
+
+Brown Paper style from goldblog.com.ua (c) Zaripov Yura
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background:#b7a68e url(./brown-papersq.png);
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal {
+ color:#005599;
+ font-weight:bold;
+}
+
+.hljs,
+.hljs-subst {
+ color: #363c69;
+}
+
+.hljs-string,
+.hljs-title,
+.hljs-section,
+.hljs-type,
+.hljs-attribute,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-built_in,
+.hljs-addition,
+.hljs-variable,
+.hljs-template-tag,
+.hljs-template-variable,
+.hljs-link,
+.hljs-name {
+ color: #2c009f;
+}
+
+.hljs-comment,
+.hljs-quote,
+.hljs-meta,
+.hljs-deletion {
+ color: #802022;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-doctag,
+.hljs-title,
+.hljs-section,
+.hljs-type,
+.hljs-name,
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
diff --git a/js/styles/brown-papersq.png b/js/styles/brown-papersq.png
new file mode 100644
index 0000000..3813903
Binary files /dev/null and b/js/styles/brown-papersq.png differ
diff --git a/js/styles/codepen-embed.css b/js/styles/codepen-embed.css
new file mode 100644
index 0000000..195c4a0
--- /dev/null
+++ b/js/styles/codepen-embed.css
@@ -0,0 +1,60 @@
+/*
+ codepen.io Embed Theme
+ Author: Justin Perry
+ Original theme - https://github.com/chriskempson/tomorrow-theme
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #222;
+ color: #fff;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #777;
+}
+
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag,
+.hljs-regexp,
+.hljs-meta,
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-params,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-link,
+.hljs-deletion {
+ color: #ab875d;
+}
+
+.hljs-section,
+.hljs-title,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-type,
+.hljs-attribute {
+ color: #9b869b;
+}
+
+.hljs-string,
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-addition {
+ color: #8f9c6c;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/color-brewer.css b/js/styles/color-brewer.css
new file mode 100644
index 0000000..7934d98
--- /dev/null
+++ b/js/styles/color-brewer.css
@@ -0,0 +1,71 @@
+/*
+
+Colorbrewer theme
+Original: https://github.com/mbostock/colorbrewer-theme (c) Mike Bostock
+Ported by Fabrício Tavares de Oliveira
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #fff;
+}
+
+.hljs,
+.hljs-subst {
+ color: #000;
+}
+
+.hljs-string,
+.hljs-meta,
+.hljs-symbol,
+.hljs-template-tag,
+.hljs-template-variable,
+.hljs-addition {
+ color: #756bb1;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #636363;
+}
+
+.hljs-number,
+.hljs-regexp,
+.hljs-literal,
+.hljs-bullet,
+.hljs-link {
+ color: #31a354;
+}
+
+.hljs-deletion,
+.hljs-variable {
+ color: #88f;
+}
+
+
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-title,
+.hljs-section,
+.hljs-built_in,
+.hljs-doctag,
+.hljs-type,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-strong {
+ color: #3182bd;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-attribute {
+ color: #e6550d;
+}
diff --git a/js/styles/darcula.css b/js/styles/darcula.css
new file mode 100644
index 0000000..be182d0
--- /dev/null
+++ b/js/styles/darcula.css
@@ -0,0 +1,77 @@
+/*
+
+Darcula color scheme from the JetBrains family of IDEs
+
+*/
+
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #2b2b2b;
+}
+
+.hljs {
+ color: #bababa;
+}
+
+.hljs-strong,
+.hljs-emphasis {
+ color: #a8a8a2;
+}
+
+.hljs-bullet,
+.hljs-quote,
+.hljs-link,
+.hljs-number,
+.hljs-regexp,
+.hljs-literal {
+ color: #6896ba;
+}
+
+.hljs-code,
+.hljs-selector-class {
+ color: #a6e22e;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-section,
+.hljs-attribute,
+.hljs-name,
+.hljs-variable {
+ color: #cb7832;
+}
+
+.hljs-params {
+ color: #b9b9b9;
+}
+
+.hljs-string {
+ color: #6a8759;
+}
+
+.hljs-subst,
+.hljs-type,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-symbol,
+.hljs-selector-id,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-template-tag,
+.hljs-template-variable,
+.hljs-addition {
+ color: #e0c46c;
+}
+
+.hljs-comment,
+.hljs-deletion,
+.hljs-meta {
+ color: #7f7f7f;
+}
diff --git a/js/styles/dark.css b/js/styles/dark.css
new file mode 100644
index 0000000..b4724f5
--- /dev/null
+++ b/js/styles/dark.css
@@ -0,0 +1,63 @@
+/*
+
+Dark style from softwaremaniacs.org (c) Ivan Sagalaev
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #444;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-section,
+.hljs-link {
+ color: white;
+}
+
+.hljs,
+.hljs-subst {
+ color: #ddd;
+}
+
+.hljs-string,
+.hljs-title,
+.hljs-name,
+.hljs-type,
+.hljs-attribute,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-built_in,
+.hljs-addition,
+.hljs-variable,
+.hljs-template-tag,
+.hljs-template-variable {
+ color: #d88;
+}
+
+.hljs-comment,
+.hljs-quote,
+.hljs-deletion,
+.hljs-meta {
+ color: #777;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-title,
+.hljs-section,
+.hljs-doctag,
+.hljs-type,
+.hljs-name,
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
diff --git a/js/styles/darkula.css b/js/styles/darkula.css
new file mode 100644
index 0000000..f4646c3
--- /dev/null
+++ b/js/styles/darkula.css
@@ -0,0 +1,6 @@
+/*
+ Deprecated due to a typo in the name and left here for compatibility purpose only.
+ Please use darcula.css instead.
+*/
+
+@import url('darcula.css');
diff --git a/js/styles/default.css b/js/styles/default.css
new file mode 100644
index 0000000..f1bfade
--- /dev/null
+++ b/js/styles/default.css
@@ -0,0 +1,99 @@
+/*
+
+Original highlight.js style (c) Ivan Sagalaev
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #F0F0F0;
+}
+
+
+/* Base color: saturation 0; */
+
+.hljs,
+.hljs-subst {
+ color: #444;
+}
+
+.hljs-comment {
+ color: #888888;
+}
+
+.hljs-keyword,
+.hljs-attribute,
+.hljs-selector-tag,
+.hljs-meta-keyword,
+.hljs-doctag,
+.hljs-name {
+ font-weight: bold;
+}
+
+
+/* User color: hue: 0 */
+
+.hljs-type,
+.hljs-string,
+.hljs-number,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-quote,
+.hljs-template-tag,
+.hljs-deletion {
+ color: #880000;
+}
+
+.hljs-title,
+.hljs-section {
+ color: #880000;
+ font-weight: bold;
+}
+
+.hljs-regexp,
+.hljs-symbol,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-link,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+ color: #BC6060;
+}
+
+
+/* Language color: hue: 90; */
+
+.hljs-literal {
+ color: #78A960;
+}
+
+.hljs-built_in,
+.hljs-bullet,
+.hljs-code,
+.hljs-addition {
+ color: #397300;
+}
+
+
+/* Meta color: hue: 200 */
+
+.hljs-meta {
+ color: #1f7199;
+}
+
+.hljs-meta-string {
+ color: #4d99bf;
+}
+
+
+/* Misc effects */
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/docco.css b/js/styles/docco.css
new file mode 100644
index 0000000..db366be
--- /dev/null
+++ b/js/styles/docco.css
@@ -0,0 +1,97 @@
+/*
+Docco style used in http://jashkenas.github.com/docco/ converted by Simon Madine (@thingsinjars)
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ color: #000;
+ background: #f8f8ff;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #408080;
+ font-style: italic;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-subst {
+ color: #954121;
+}
+
+.hljs-number {
+ color: #40a070;
+}
+
+.hljs-string,
+.hljs-doctag {
+ color: #219161;
+}
+
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-section,
+.hljs-type {
+ color: #19469d;
+}
+
+.hljs-params {
+ color: #00f;
+}
+
+.hljs-title {
+ color: #458;
+ font-weight: bold;
+}
+
+.hljs-tag,
+.hljs-name,
+.hljs-attribute {
+ color: #000080;
+ font-weight: normal;
+}
+
+.hljs-variable,
+.hljs-template-variable {
+ color: #008080;
+}
+
+.hljs-regexp,
+.hljs-link {
+ color: #b68;
+}
+
+.hljs-symbol,
+.hljs-bullet {
+ color: #990073;
+}
+
+.hljs-built_in,
+.hljs-builtin-name {
+ color: #0086b3;
+}
+
+.hljs-meta {
+ color: #999;
+ font-weight: bold;
+}
+
+.hljs-deletion {
+ background: #fdd;
+}
+
+.hljs-addition {
+ background: #dfd;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/dracula.css b/js/styles/dracula.css
new file mode 100644
index 0000000..d591db6
--- /dev/null
+++ b/js/styles/dracula.css
@@ -0,0 +1,76 @@
+/*
+
+Dracula Theme v1.2.0
+
+https://github.com/zenorocha/dracula-theme
+
+Copyright 2015, All rights reserved
+
+Code licensed under the MIT license
+http://zenorocha.mit-license.org
+
+@author Éverton Ribeiro
+@author Zeno Rocha
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #282a36;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-section,
+.hljs-link {
+ color: #8be9fd;
+}
+
+.hljs-function .hljs-keyword {
+ color: #ff79c6;
+}
+
+.hljs,
+.hljs-subst {
+ color: #f8f8f2;
+}
+
+.hljs-string,
+.hljs-title,
+.hljs-name,
+.hljs-type,
+.hljs-attribute,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition,
+.hljs-variable,
+.hljs-template-tag,
+.hljs-template-variable {
+ color: #f1fa8c;
+}
+
+.hljs-comment,
+.hljs-quote,
+.hljs-deletion,
+.hljs-meta {
+ color: #6272a4;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-title,
+.hljs-section,
+.hljs-doctag,
+.hljs-type,
+.hljs-name,
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
diff --git a/js/styles/far.css b/js/styles/far.css
new file mode 100644
index 0000000..2b3f87b
--- /dev/null
+++ b/js/styles/far.css
@@ -0,0 +1,71 @@
+/*
+
+FAR Style (c) MajestiC
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #000080;
+}
+
+.hljs,
+.hljs-subst {
+ color: #0ff;
+}
+
+.hljs-string,
+.hljs-attribute,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-template-tag,
+.hljs-template-variable,
+.hljs-addition {
+ color: #ff0;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-section,
+.hljs-type,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-variable {
+ color: #fff;
+}
+
+.hljs-comment,
+.hljs-quote,
+.hljs-doctag,
+.hljs-deletion {
+ color: #888;
+}
+
+.hljs-number,
+.hljs-regexp,
+.hljs-literal,
+.hljs-link {
+ color: #0f0;
+}
+
+.hljs-meta {
+ color: #008080;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-title,
+.hljs-section,
+.hljs-name,
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
diff --git a/js/styles/foundation.css b/js/styles/foundation.css
new file mode 100644
index 0000000..f1fe64b
--- /dev/null
+++ b/js/styles/foundation.css
@@ -0,0 +1,88 @@
+/*
+Description: Foundation 4 docs style for highlight.js
+Author: Dan Allen
+Website: http://foundation.zurb.com/docs/
+Version: 1.0
+Date: 2013-04-02
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #eee; color: black;
+}
+
+.hljs-link,
+.hljs-emphasis,
+.hljs-attribute,
+.hljs-addition {
+ color: #070;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong,
+.hljs-string,
+.hljs-deletion {
+ color: #d14;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-quote,
+.hljs-comment {
+ color: #998;
+ font-style: italic;
+}
+
+.hljs-section,
+.hljs-title {
+ color: #900;
+}
+
+.hljs-class .hljs-title,
+.hljs-type {
+ color: #458;
+}
+
+.hljs-variable,
+.hljs-template-variable {
+ color: #336699;
+}
+
+.hljs-bullet {
+ color: #997700;
+}
+
+.hljs-meta {
+ color: #3344bb;
+}
+
+.hljs-code,
+.hljs-number,
+.hljs-literal,
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #099;
+}
+
+.hljs-regexp {
+ background-color: #fff0ff;
+ color: #880088;
+}
+
+.hljs-symbol {
+ color: #990073;
+}
+
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #007700;
+}
diff --git a/js/styles/github-gist.css b/js/styles/github-gist.css
new file mode 100644
index 0000000..155f0b9
--- /dev/null
+++ b/js/styles/github-gist.css
@@ -0,0 +1,71 @@
+/**
+ * GitHub Gist Theme
+ * Author : Louis Barranqueiro - https://github.com/LouisBarranqueiro
+ */
+
+.hljs {
+ display: block;
+ background: white;
+ padding: 0.5em;
+ color: #333333;
+ overflow-x: auto;
+}
+
+.hljs-comment,
+.hljs-meta {
+ color: #969896;
+}
+
+.hljs-string,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-strong,
+.hljs-emphasis,
+.hljs-quote {
+ color: #df5000;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-type {
+ color: #a71d5d;
+}
+
+.hljs-literal,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-attribute {
+ color: #0086b3;
+}
+
+.hljs-section,
+.hljs-name {
+ color: #63a35c;
+}
+
+.hljs-tag {
+ color: #333333;
+}
+
+.hljs-title,
+.hljs-attr,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+ color: #795da3;
+}
+
+.hljs-addition {
+ color: #55a532;
+ background-color: #eaffea;
+}
+
+.hljs-deletion {
+ color: #bd2c00;
+ background-color: #ffecec;
+}
+
+.hljs-link {
+ text-decoration: underline;
+}
diff --git a/js/styles/github.css b/js/styles/github.css
new file mode 100644
index 0000000..791932b
--- /dev/null
+++ b/js/styles/github.css
@@ -0,0 +1,99 @@
+/*
+
+github.com style (c) Vasily Polovnyov
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ color: #333;
+ background: #f8f8f8;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #998;
+ font-style: italic;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-subst {
+ color: #333;
+ font-weight: bold;
+}
+
+.hljs-number,
+.hljs-literal,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag .hljs-attr {
+ color: #008080;
+}
+
+.hljs-string,
+.hljs-doctag {
+ color: #d14;
+}
+
+.hljs-title,
+.hljs-section,
+.hljs-selector-id {
+ color: #900;
+ font-weight: bold;
+}
+
+.hljs-subst {
+ font-weight: normal;
+}
+
+.hljs-type,
+.hljs-class .hljs-title {
+ color: #458;
+ font-weight: bold;
+}
+
+.hljs-tag,
+.hljs-name,
+.hljs-attribute {
+ color: #000080;
+ font-weight: normal;
+}
+
+.hljs-regexp,
+.hljs-link {
+ color: #009926;
+}
+
+.hljs-symbol,
+.hljs-bullet {
+ color: #990073;
+}
+
+.hljs-built_in,
+.hljs-builtin-name {
+ color: #0086b3;
+}
+
+.hljs-meta {
+ color: #999;
+ font-weight: bold;
+}
+
+.hljs-deletion {
+ background: #fdd;
+}
+
+.hljs-addition {
+ background: #dfd;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/gml.css b/js/styles/gml.css
new file mode 100644
index 0000000..ffb5e47
--- /dev/null
+++ b/js/styles/gml.css
@@ -0,0 +1,78 @@
+/*
+
+GML Theme - Meseta
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #222222;
+ color: #C0C0C0;
+}
+
+.hljs-keywords {
+ color: #FFB871;
+ font-weight: bold;
+}
+
+.hljs-built_in {
+ color: #FFB871;
+}
+
+.hljs-literal {
+ color: #FF8080;
+}
+
+.hljs-symbol {
+ color: #58E55A;
+}
+
+.hljs-comment {
+ color: #5B995B;
+}
+
+.hljs-string {
+ color: #FFFF00;
+}
+
+.hljs-number {
+ color: #FF8080;
+}
+
+.hljs-attribute,
+.hljs-selector-tag,
+.hljs-doctag,
+.hljs-name,
+.hljs-bullet,
+.hljs-code,
+.hljs-addition,
+.hljs-regexp,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-link,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-type,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-quote,
+.hljs-template-tag,
+.hljs-deletion,
+.hljs-title,
+.hljs-section,
+.hljs-function,
+.hljs-meta-keyword,
+.hljs-meta,
+.hljs-subst {
+ color: #C0C0C0;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/googlecode.css b/js/styles/googlecode.css
new file mode 100644
index 0000000..884ad63
--- /dev/null
+++ b/js/styles/googlecode.css
@@ -0,0 +1,89 @@
+/*
+
+Google Code style (c) Aahan Krish
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: white;
+ color: black;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #800;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-section,
+.hljs-title,
+.hljs-name {
+ color: #008;
+}
+
+.hljs-variable,
+.hljs-template-variable {
+ color: #660;
+}
+
+.hljs-string,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-regexp {
+ color: #080;
+}
+
+.hljs-literal,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-meta,
+.hljs-number,
+.hljs-link {
+ color: #066;
+}
+
+.hljs-title,
+.hljs-doctag,
+.hljs-type,
+.hljs-attr,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-params {
+ color: #606;
+}
+
+.hljs-attribute,
+.hljs-subst {
+ color: #000;
+}
+
+.hljs-formula {
+ background-color: #eee;
+ font-style: italic;
+}
+
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #9B703F
+}
+
+.hljs-addition {
+ background-color: #baeeba;
+}
+
+.hljs-deletion {
+ background-color: #ffc8bd;
+}
+
+.hljs-doctag,
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
diff --git a/js/styles/grayscale.css b/js/styles/grayscale.css
new file mode 100644
index 0000000..5376f34
--- /dev/null
+++ b/js/styles/grayscale.css
@@ -0,0 +1,101 @@
+/*
+
+grayscale style (c) MY Sun
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ color: #333;
+ background: #fff;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #777;
+ font-style: italic;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-subst {
+ color: #333;
+ font-weight: bold;
+}
+
+.hljs-number,
+.hljs-literal {
+ color: #777;
+}
+
+.hljs-string,
+.hljs-doctag,
+.hljs-formula {
+ color: #333;
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAJ0lEQVQIW2O8e/fufwYGBgZBQUEQxcCIIfDu3Tuwivfv30NUoAsAALHpFMMLqZlPAAAAAElFTkSuQmCC) repeat;
+}
+
+.hljs-title,
+.hljs-section,
+.hljs-selector-id {
+ color: #000;
+ font-weight: bold;
+}
+
+.hljs-subst {
+ font-weight: normal;
+}
+
+.hljs-class .hljs-title,
+.hljs-type,
+.hljs-name {
+ color: #333;
+ font-weight: bold;
+}
+
+.hljs-tag {
+ color: #333;
+}
+
+.hljs-regexp {
+ color: #333;
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAICAYAAADA+m62AAAAPUlEQVQYV2NkQAN37979r6yszIgujiIAU4RNMVwhuiQ6H6wQl3XI4oy4FMHcCJPHcDS6J2A2EqUQpJhohQDexSef15DBCwAAAABJRU5ErkJggg==) repeat;
+}
+
+.hljs-symbol,
+.hljs-bullet,
+.hljs-link {
+ color: #000;
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAKElEQVQIW2NkQAO7d+/+z4gsBhJwdXVlhAvCBECKwIIwAbhKZBUwBQA6hBpm5efZsgAAAABJRU5ErkJggg==) repeat;
+}
+
+.hljs-built_in,
+.hljs-builtin-name {
+ color: #000;
+ text-decoration: underline;
+}
+
+.hljs-meta {
+ color: #999;
+ font-weight: bold;
+}
+
+.hljs-deletion {
+ color: #fff;
+ background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAADCAYAAABS3WWCAAAAE0lEQVQIW2MMDQ39zzhz5kwIAQAyxweWgUHd1AAAAABJRU5ErkJggg==) repeat;
+}
+
+.hljs-addition {
+ color: #000;
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAALUlEQVQYV2N89+7dfwYk8P79ewZBQUFkIQZGOiu6e/cuiptQHAPl0NtNxAQBAM97Oejj3Dg7AAAAAElFTkSuQmCC) repeat;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/gruvbox-dark.css b/js/styles/gruvbox-dark.css
new file mode 100644
index 0000000..f563811
--- /dev/null
+++ b/js/styles/gruvbox-dark.css
@@ -0,0 +1,108 @@
+/*
+
+Gruvbox style (dark) (c) Pavel Pertsev (original style at https://github.com/morhetz/gruvbox)
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #282828;
+}
+
+.hljs,
+.hljs-subst {
+ color: #ebdbb2;
+}
+
+/* Gruvbox Red */
+.hljs-deletion,
+.hljs-formula,
+.hljs-keyword,
+.hljs-link,
+.hljs-selector-tag {
+ color: #fb4934;
+}
+
+/* Gruvbox Blue */
+.hljs-built_in,
+.hljs-emphasis,
+.hljs-name,
+.hljs-quote,
+.hljs-strong,
+.hljs-title,
+.hljs-variable {
+ color: #83a598;
+}
+
+/* Gruvbox Yellow */
+.hljs-attr,
+.hljs-params,
+.hljs-template-tag,
+.hljs-type {
+ color: #fabd2f;
+}
+
+/* Gruvbox Purple */
+.hljs-builtin-name,
+.hljs-doctag,
+.hljs-literal,
+.hljs-number {
+ color: #8f3f71;
+}
+
+/* Gruvbox Orange */
+.hljs-code,
+.hljs-meta,
+.hljs-regexp,
+.hljs-selector-id,
+.hljs-template-variable {
+ color: #fe8019;
+}
+
+/* Gruvbox Green */
+.hljs-addition,
+.hljs-meta-string,
+.hljs-section,
+.hljs-selector-attr,
+.hljs-selector-class,
+.hljs-string,
+.hljs-symbol {
+ color: #b8bb26;
+}
+
+/* Gruvbox Aqua */
+.hljs-attribute,
+.hljs-bullet,
+.hljs-class,
+.hljs-function,
+.hljs-function .hljs-keyword,
+.hljs-meta-keyword,
+.hljs-selector-pseudo,
+.hljs-tag {
+ color: #8ec07c;
+}
+
+/* Gruvbox Gray */
+.hljs-comment {
+ color: #928374;
+}
+
+/* Gruvbox Purple */
+.hljs-link_label,
+.hljs-literal,
+.hljs-number {
+ color: #d3869b;
+}
+
+.hljs-comment,
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-section,
+.hljs-strong,
+.hljs-tag {
+ font-weight: bold;
+}
diff --git a/js/styles/gruvbox-light.css b/js/styles/gruvbox-light.css
new file mode 100644
index 0000000..ff45468
--- /dev/null
+++ b/js/styles/gruvbox-light.css
@@ -0,0 +1,108 @@
+/*
+
+Gruvbox style (light) (c) Pavel Pertsev (original style at https://github.com/morhetz/gruvbox)
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #fbf1c7;
+}
+
+.hljs,
+.hljs-subst {
+ color: #3c3836;
+}
+
+/* Gruvbox Red */
+.hljs-deletion,
+.hljs-formula,
+.hljs-keyword,
+.hljs-link,
+.hljs-selector-tag {
+ color: #9d0006;
+}
+
+/* Gruvbox Blue */
+.hljs-built_in,
+.hljs-emphasis,
+.hljs-name,
+.hljs-quote,
+.hljs-strong,
+.hljs-title,
+.hljs-variable {
+ color: #076678;
+}
+
+/* Gruvbox Yellow */
+.hljs-attr,
+.hljs-params,
+.hljs-template-tag,
+.hljs-type {
+ color: #b57614;
+}
+
+/* Gruvbox Purple */
+.hljs-builtin-name,
+.hljs-doctag,
+.hljs-literal,
+.hljs-number {
+ color: #8f3f71;
+}
+
+/* Gruvbox Orange */
+.hljs-code,
+.hljs-meta,
+.hljs-regexp,
+.hljs-selector-id,
+.hljs-template-variable {
+ color: #af3a03;
+}
+
+/* Gruvbox Green */
+.hljs-addition,
+.hljs-meta-string,
+.hljs-section,
+.hljs-selector-attr,
+.hljs-selector-class,
+.hljs-string,
+.hljs-symbol {
+ color: #79740e;
+}
+
+/* Gruvbox Aqua */
+.hljs-attribute,
+.hljs-bullet,
+.hljs-class,
+.hljs-function,
+.hljs-function .hljs-keyword,
+.hljs-meta-keyword,
+.hljs-selector-pseudo,
+.hljs-tag {
+ color: #427b58;
+}
+
+/* Gruvbox Gray */
+.hljs-comment {
+ color: #928374;
+}
+
+/* Gruvbox Purple */
+.hljs-link_label,
+.hljs-literal,
+.hljs-number {
+ color: #8f3f71;
+}
+
+.hljs-comment,
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-section,
+.hljs-strong,
+.hljs-tag {
+ font-weight: bold;
+}
diff --git a/js/styles/hopscotch.css b/js/styles/hopscotch.css
new file mode 100644
index 0000000..32e60d2
--- /dev/null
+++ b/js/styles/hopscotch.css
@@ -0,0 +1,83 @@
+/*
+ * Hopscotch
+ * by Jan T. Sott
+ * https://github.com/idleberg/Hopscotch
+ *
+ * This work is licensed under the Creative Commons CC0 1.0 Universal License
+ */
+
+/* Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #989498;
+}
+
+/* Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-regexp,
+.hljs-link,
+.hljs-deletion {
+ color: #dd464c;
+}
+
+/* Orange */
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params {
+ color: #fd8b19;
+}
+
+/* Yellow */
+.hljs-class .hljs-title {
+ color: #fdcc59;
+}
+
+/* Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition {
+ color: #8fc13e;
+}
+
+/* Aqua */
+.hljs-meta {
+ color: #149b93;
+}
+
+/* Blue */
+.hljs-function,
+.hljs-section,
+.hljs-title {
+ color: #1290bf;
+}
+
+/* Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #c85e7c;
+}
+
+.hljs {
+ display: block;
+ background: #322931;
+ color: #b9b5b8;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/hybrid.css b/js/styles/hybrid.css
new file mode 100644
index 0000000..29735a1
--- /dev/null
+++ b/js/styles/hybrid.css
@@ -0,0 +1,102 @@
+/*
+
+vim-hybrid theme by w0ng (https://github.com/w0ng/vim-hybrid)
+
+*/
+
+/*background color*/
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #1d1f21;
+}
+
+/*selection color*/
+.hljs::selection,
+.hljs span::selection {
+ background: #373b41;
+}
+
+.hljs::-moz-selection,
+.hljs span::-moz-selection {
+ background: #373b41;
+}
+
+/*foreground color*/
+.hljs {
+ color: #c5c8c6;
+}
+
+/*color: fg_yellow*/
+.hljs-title,
+.hljs-name {
+ color: #f0c674;
+}
+
+/*color: fg_comment*/
+.hljs-comment,
+.hljs-meta,
+.hljs-meta .hljs-keyword {
+ color: #707880;
+}
+
+/*color: fg_red*/
+.hljs-number,
+.hljs-symbol,
+.hljs-literal,
+.hljs-deletion,
+.hljs-link {
+ color: #cc6666
+}
+
+/*color: fg_green*/
+.hljs-string,
+.hljs-doctag,
+.hljs-addition,
+.hljs-regexp,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+ color: #b5bd68;
+}
+
+/*color: fg_purple*/
+.hljs-attribute,
+.hljs-code,
+.hljs-selector-id {
+ color: #b294bb;
+}
+
+/*color: fg_blue*/
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-bullet,
+.hljs-tag {
+ color: #81a2be;
+}
+
+/*color: fg_aqua*/
+.hljs-subst,
+.hljs-variable,
+.hljs-template-tag,
+.hljs-template-variable {
+ color: #8abeb7;
+}
+
+/*color: fg_orange*/
+.hljs-type,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-quote,
+.hljs-section,
+.hljs-selector-class {
+ color: #de935f;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/idea.css b/js/styles/idea.css
new file mode 100644
index 0000000..3bf1892
--- /dev/null
+++ b/js/styles/idea.css
@@ -0,0 +1,97 @@
+/*
+
+Intellij Idea-like styling (c) Vasily Polovnyov
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ color: #000;
+ background: #fff;
+}
+
+.hljs-subst,
+.hljs-title {
+ font-weight: normal;
+ color: #000;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #808080;
+ font-style: italic;
+}
+
+.hljs-meta {
+ color: #808000;
+}
+
+.hljs-tag {
+ background: #efefef;
+}
+
+.hljs-section,
+.hljs-name,
+.hljs-literal,
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-type,
+.hljs-selector-id,
+.hljs-selector-class {
+ font-weight: bold;
+ color: #000080;
+}
+
+.hljs-attribute,
+.hljs-number,
+.hljs-regexp,
+.hljs-link {
+ font-weight: bold;
+ color: #0000ff;
+}
+
+.hljs-number,
+.hljs-regexp,
+.hljs-link {
+ font-weight: normal;
+}
+
+.hljs-string {
+ color: #008000;
+ font-weight: bold;
+}
+
+.hljs-symbol,
+.hljs-bullet,
+.hljs-formula {
+ color: #000;
+ background: #d0eded;
+ font-style: italic;
+}
+
+.hljs-doctag {
+ text-decoration: underline;
+}
+
+.hljs-variable,
+.hljs-template-variable {
+ color: #660e7a;
+}
+
+.hljs-addition {
+ background: #baeeba;
+}
+
+.hljs-deletion {
+ background: #ffc8bd;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/ir-black.css b/js/styles/ir-black.css
new file mode 100644
index 0000000..bd4c755
--- /dev/null
+++ b/js/styles/ir-black.css
@@ -0,0 +1,73 @@
+/*
+ IR_Black style (c) Vasily Mikhailitchenko
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #000;
+ color: #f8f8f8;
+}
+
+.hljs-comment,
+.hljs-quote,
+.hljs-meta {
+ color: #7c7c7c;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-tag,
+.hljs-name {
+ color: #96cbfe;
+}
+
+.hljs-attribute,
+.hljs-selector-id {
+ color: #ffffb6;
+}
+
+.hljs-string,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-addition {
+ color: #a8ff60;
+}
+
+.hljs-subst {
+ color: #daefa3;
+}
+
+.hljs-regexp,
+.hljs-link {
+ color: #e9c062;
+}
+
+.hljs-title,
+.hljs-section,
+.hljs-type,
+.hljs-doctag {
+ color: #ffffb6;
+}
+
+.hljs-symbol,
+.hljs-bullet,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-literal {
+ color: #c6c5fe;
+}
+
+.hljs-number,
+.hljs-deletion {
+ color:#ff73fd;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/isbl-editor-dark.css b/js/styles/isbl-editor-dark.css
new file mode 100644
index 0000000..2f1d95d
--- /dev/null
+++ b/js/styles/isbl-editor-dark.css
@@ -0,0 +1,112 @@
+/*
+
+ISBL Editor style dark color scheme (c) Dmitriy Tarasov
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #404040;
+ color: #f0f0f0;
+}
+
+/* Base color: saturation 0; */
+
+.hljs,
+.hljs-subst {
+ color: #f0f0f0;
+}
+
+.hljs-comment {
+ color: #b5b5b5;
+ font-style: italic;
+}
+
+.hljs-keyword,
+.hljs-attribute,
+.hljs-selector-tag,
+.hljs-meta-keyword,
+.hljs-doctag,
+.hljs-name {
+ color: #f0f0f0;
+ font-weight: bold;
+}
+
+
+/* User color: hue: 0 */
+
+.hljs-string {
+ color: #97bf0d;
+}
+
+.hljs-type,
+.hljs-number,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-quote,
+.hljs-template-tag,
+.hljs-deletion {
+ color: #f0f0f0;
+}
+
+.hljs-title,
+.hljs-section {
+ color: #df471e;
+}
+
+.hljs-title>.hljs-built_in {
+ color: #81bce9;
+ font-weight: normal;
+}
+
+.hljs-regexp,
+.hljs-symbol,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-link,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+ color: #e2c696;
+}
+
+/* Language color: hue: 90; */
+
+.hljs-built_in,
+.hljs-literal {
+ color: #97bf0d;
+ font-weight: bold;
+}
+
+.hljs-bullet,
+.hljs-code,
+.hljs-addition {
+ color: #397300;
+}
+
+.hljs-class {
+ color: #ce9d4d;
+ font-weight: bold;
+}
+
+/* Meta color: hue: 200 */
+
+.hljs-meta {
+ color: #1f7199;
+}
+
+.hljs-meta-string {
+ color: #4d99bf;
+}
+
+
+/* Misc effects */
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/isbl-editor-light.css b/js/styles/isbl-editor-light.css
new file mode 100644
index 0000000..633070d
--- /dev/null
+++ b/js/styles/isbl-editor-light.css
@@ -0,0 +1,112 @@
+/*
+
+ISBL Editor style light color schemec (c) Dmitriy Tarasov
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: white;
+ color: black;
+}
+
+/* Base color: saturation 0; */
+
+.hljs,
+.hljs-subst {
+ color: #000000;
+}
+
+.hljs-comment {
+ color: #555555;
+ font-style: italic;
+}
+
+.hljs-keyword,
+.hljs-attribute,
+.hljs-selector-tag,
+.hljs-meta-keyword,
+.hljs-doctag,
+.hljs-name {
+ color: #000000;
+ font-weight: bold;
+}
+
+
+/* User color: hue: 0 */
+
+.hljs-string {
+ color: #000080;
+}
+
+.hljs-type,
+.hljs-number,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-quote,
+.hljs-template-tag,
+.hljs-deletion {
+ color: #000000;
+}
+
+.hljs-title,
+.hljs-section {
+ color: #fb2c00;
+}
+
+.hljs-title>.hljs-built_in {
+ color: #008080;
+ font-weight: normal;
+}
+
+.hljs-regexp,
+.hljs-symbol,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-link,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+ color: #5e1700;
+}
+
+/* Language color: hue: 90; */
+
+.hljs-built_in,
+.hljs-literal {
+ color: #000080;
+ font-weight: bold;
+}
+
+.hljs-bullet,
+.hljs-code,
+.hljs-addition {
+ color: #397300;
+}
+
+.hljs-class {
+ color: #6f1C00;
+ font-weight: bold;
+}
+
+/* Meta color: hue: 200 */
+
+.hljs-meta {
+ color: #1f7199;
+}
+
+.hljs-meta-string {
+ color: #4d99bf;
+}
+
+
+/* Misc effects */
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/kimbie.dark.css b/js/styles/kimbie.dark.css
new file mode 100644
index 0000000..d139cb5
--- /dev/null
+++ b/js/styles/kimbie.dark.css
@@ -0,0 +1,74 @@
+/*
+ Name: Kimbie (dark)
+ Author: Jan T. Sott
+ License: Creative Commons Attribution-ShareAlike 4.0 Unported License
+ URL: https://github.com/idleberg/Kimbie-highlight.js
+*/
+
+/* Kimbie Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #d6baad;
+}
+
+/* Kimbie Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-regexp,
+.hljs-meta {
+ color: #dc3958;
+}
+
+/* Kimbie Orange */
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params,
+.hljs-deletion,
+.hljs-link {
+ color: #f79a32;
+}
+
+/* Kimbie Yellow */
+.hljs-title,
+.hljs-section,
+.hljs-attribute {
+ color: #f06431;
+}
+
+/* Kimbie Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition {
+ color: #889b4a;
+}
+
+/* Kimbie Purple */
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-function {
+ color: #98676a;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #221a0f;
+ color: #d3af86;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/kimbie.light.css b/js/styles/kimbie.light.css
new file mode 100644
index 0000000..04ff6ed
--- /dev/null
+++ b/js/styles/kimbie.light.css
@@ -0,0 +1,74 @@
+/*
+ Name: Kimbie (light)
+ Author: Jan T. Sott
+ License: Creative Commons Attribution-ShareAlike 4.0 Unported License
+ URL: https://github.com/idleberg/Kimbie-highlight.js
+*/
+
+/* Kimbie Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #a57a4c;
+}
+
+/* Kimbie Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-regexp,
+.hljs-meta {
+ color: #dc3958;
+}
+
+/* Kimbie Orange */
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params,
+.hljs-deletion,
+.hljs-link {
+ color: #f79a32;
+}
+
+/* Kimbie Yellow */
+.hljs-title,
+.hljs-section,
+.hljs-attribute {
+ color: #f06431;
+}
+
+/* Kimbie Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition {
+ color: #889b4a;
+}
+
+/* Kimbie Purple */
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-function {
+ color: #98676a;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #fbebd4;
+ color: #84613d;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/lightfair.css b/js/styles/lightfair.css
new file mode 100644
index 0000000..a247c8e
--- /dev/null
+++ b/js/styles/lightfair.css
@@ -0,0 +1,87 @@
+/*
+
+Lightfair style (c) Tristian Kelly
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+}
+
+.hljs-name {
+ color:#01a3a3;
+}
+
+.hljs-tag,.hljs-meta {
+ color:#778899;
+}
+
+.hljs,
+.hljs-subst {
+ color: #444
+}
+
+.hljs-comment {
+ color: #888888
+}
+
+.hljs-keyword,
+.hljs-attribute,
+.hljs-selector-tag,
+.hljs-meta-keyword,
+.hljs-doctag,
+.hljs-name {
+ font-weight: bold
+}
+
+.hljs-type,
+.hljs-string,
+.hljs-number,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-quote,
+.hljs-template-tag,
+.hljs-deletion {
+ color: #4286f4
+}
+
+.hljs-title,
+.hljs-section {
+ color: #4286f4;
+ font-weight: bold
+}
+
+.hljs-regexp,
+.hljs-symbol,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-link,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+ color: #BC6060
+}
+
+.hljs-literal {
+ color: #62bcbc
+}
+
+.hljs-built_in,
+.hljs-bullet,
+.hljs-code,
+.hljs-addition {
+ color: #25c6c6
+}
+
+.hljs-meta-string {
+ color: #4d99bf
+}
+
+.hljs-emphasis {
+ font-style: italic
+}
+
+.hljs-strong {
+ font-weight: bold
+}
diff --git a/js/styles/magula.css b/js/styles/magula.css
new file mode 100644
index 0000000..44dee5e
--- /dev/null
+++ b/js/styles/magula.css
@@ -0,0 +1,70 @@
+/*
+Description: Magula style for highligh.js
+Author: Ruslan Keba
+Website: http://rukeba.com/
+Version: 1.0
+Date: 2009-01-03
+Music: Aphex Twin / Xtal
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background-color: #f4f4f4;
+}
+
+.hljs,
+.hljs-subst {
+ color: black;
+}
+
+.hljs-string,
+.hljs-title,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-attribute,
+.hljs-addition,
+.hljs-variable,
+.hljs-template-tag,
+.hljs-template-variable {
+ color: #050;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #777;
+}
+
+.hljs-number,
+.hljs-regexp,
+.hljs-literal,
+.hljs-type,
+.hljs-link {
+ color: #800;
+}
+
+.hljs-deletion,
+.hljs-meta {
+ color: #00e;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-doctag,
+.hljs-title,
+.hljs-section,
+.hljs-built_in,
+.hljs-tag,
+.hljs-name {
+ font-weight: bold;
+ color: navy;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/mono-blue.css b/js/styles/mono-blue.css
new file mode 100644
index 0000000..884c97c
--- /dev/null
+++ b/js/styles/mono-blue.css
@@ -0,0 +1,59 @@
+/*
+ Five-color theme from a single blue hue.
+*/
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #eaeef3;
+}
+
+.hljs {
+ color: #00193a;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-title,
+.hljs-section,
+.hljs-doctag,
+.hljs-name,
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-comment {
+ color: #738191;
+}
+
+.hljs-string,
+.hljs-title,
+.hljs-section,
+.hljs-built_in,
+.hljs-literal,
+.hljs-type,
+.hljs-addition,
+.hljs-tag,
+.hljs-quote,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #0048ab;
+}
+
+.hljs-meta,
+.hljs-subst,
+.hljs-symbol,
+.hljs-regexp,
+.hljs-attribute,
+.hljs-deletion,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-link,
+.hljs-bullet {
+ color: #4c81c9;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
diff --git a/js/styles/monokai-sublime.css b/js/styles/monokai-sublime.css
new file mode 100644
index 0000000..2864170
--- /dev/null
+++ b/js/styles/monokai-sublime.css
@@ -0,0 +1,83 @@
+/*
+
+Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #23241f;
+}
+
+.hljs,
+.hljs-tag,
+.hljs-subst {
+ color: #f8f8f2;
+}
+
+.hljs-strong,
+.hljs-emphasis {
+ color: #a8a8a2;
+}
+
+.hljs-bullet,
+.hljs-quote,
+.hljs-number,
+.hljs-regexp,
+.hljs-literal,
+.hljs-link {
+ color: #ae81ff;
+}
+
+.hljs-code,
+.hljs-title,
+.hljs-section,
+.hljs-selector-class {
+ color: #a6e22e;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-name,
+.hljs-attr {
+ color: #f92672;
+}
+
+.hljs-symbol,
+.hljs-attribute {
+ color: #66d9ef;
+}
+
+.hljs-params,
+.hljs-class .hljs-title {
+ color: #f8f8f2;
+}
+
+.hljs-string,
+.hljs-type,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-selector-id,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-addition,
+.hljs-variable,
+.hljs-template-variable {
+ color: #e6db74;
+}
+
+.hljs-comment,
+.hljs-deletion,
+.hljs-meta {
+ color: #75715e;
+}
diff --git a/js/styles/monokai.css b/js/styles/monokai.css
new file mode 100644
index 0000000..775d53f
--- /dev/null
+++ b/js/styles/monokai.css
@@ -0,0 +1,70 @@
+/*
+Monokai style - ported by Luigi Maselli - http://grigio.org
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #272822; color: #ddd;
+}
+
+.hljs-tag,
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-strong,
+.hljs-name {
+ color: #f92672;
+}
+
+.hljs-code {
+ color: #66d9ef;
+}
+
+.hljs-class .hljs-title {
+ color: white;
+}
+
+.hljs-attribute,
+.hljs-symbol,
+.hljs-regexp,
+.hljs-link {
+ color: #bf79db;
+}
+
+.hljs-string,
+.hljs-bullet,
+.hljs-subst,
+.hljs-title,
+.hljs-section,
+.hljs-emphasis,
+.hljs-type,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-addition,
+.hljs-variable,
+.hljs-template-tag,
+.hljs-template-variable {
+ color: #a6e22e;
+}
+
+.hljs-comment,
+.hljs-quote,
+.hljs-deletion,
+.hljs-meta {
+ color: #75715e;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-doctag,
+.hljs-title,
+.hljs-section,
+.hljs-type,
+.hljs-selector-id {
+ font-weight: bold;
+}
diff --git a/js/styles/nord.css b/js/styles/nord.css
new file mode 100644
index 0000000..4240384
--- /dev/null
+++ b/js/styles/nord.css
@@ -0,0 +1,309 @@
+/*
+ * Copyright (c) 2017-present Arctic Ice Studio
+ * Copyright (c) 2017-present Sven Greb
+ *
+ * Project: Nord highlight.js
+ * Version: 0.1.0
+ * Repository: https://github.com/arcticicestudio/nord-highlightjs
+ * License: MIT
+ * References:
+ * https://github.com/arcticicestudio/nord
+ */
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #2E3440;
+}
+
+.hljs,
+.hljs-subst {
+ color: #D8DEE9;
+}
+
+.hljs-selector-tag {
+ color: #81A1C1;
+}
+
+.hljs-selector-id {
+ color: #8FBCBB;
+ font-weight: bold;
+}
+
+.hljs-selector-class {
+ color: #8FBCBB;
+}
+
+.hljs-selector-attr {
+ color: #8FBCBB;
+}
+
+.hljs-selector-pseudo {
+ color: #88C0D0;
+}
+
+.hljs-addition {
+ background-color: rgba(163, 190, 140, 0.5);
+}
+
+.hljs-deletion {
+ background-color: rgba(191, 97, 106, 0.5);
+}
+
+.hljs-built_in,
+.hljs-type {
+ color: #8FBCBB;
+}
+
+.hljs-class {
+ color: #8FBCBB;
+}
+
+.hljs-function {
+ color: #88C0D0;
+}
+
+.hljs-function > .hljs-title {
+ color: #88C0D0;
+}
+
+.hljs-keyword,
+.hljs-literal,
+.hljs-symbol {
+ color: #81A1C1;
+}
+
+.hljs-number {
+ color: #B48EAD;
+}
+
+.hljs-regexp {
+ color: #EBCB8B;
+}
+
+.hljs-string {
+ color: #A3BE8C;
+}
+
+.hljs-title {
+ color: #8FBCBB;
+}
+
+.hljs-params {
+ color: #D8DEE9;
+}
+
+.hljs-bullet {
+ color: #81A1C1;
+}
+
+.hljs-code {
+ color: #8FBCBB;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-formula {
+ color: #8FBCBB;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-link:hover {
+ text-decoration: underline;
+}
+
+.hljs-quote {
+ color: #4C566A;
+}
+
+.hljs-comment {
+ color: #4C566A;
+}
+
+.hljs-doctag {
+ color: #8FBCBB;
+}
+
+.hljs-meta,
+.hljs-meta-keyword {
+ color: #5E81AC;
+}
+
+.hljs-meta-string {
+ color: #A3BE8C;
+}
+
+.hljs-attr {
+ color: #8FBCBB;
+}
+
+.hljs-attribute {
+ color: #D8DEE9;
+}
+
+.hljs-builtin-name {
+ color: #81A1C1;
+}
+
+.hljs-name {
+ color: #81A1C1;
+}
+
+.hljs-section {
+ color: #88C0D0;
+}
+
+.hljs-tag {
+ color: #81A1C1;
+}
+
+.hljs-variable {
+ color: #D8DEE9;
+}
+
+.hljs-template-variable {
+ color: #D8DEE9;
+}
+
+.hljs-template-tag {
+ color: #5E81AC;
+}
+
+.abnf .hljs-attribute {
+ color: #88C0D0;
+}
+
+.abnf .hljs-symbol {
+ color: #EBCB8B;
+}
+
+.apache .hljs-attribute {
+ color: #88C0D0;
+}
+
+.apache .hljs-section {
+ color: #81A1C1;
+}
+
+.arduino .hljs-built_in {
+ color: #88C0D0;
+}
+
+.aspectj .hljs-meta {
+ color: #D08770;
+}
+
+.aspectj > .hljs-title {
+ color: #88C0D0;
+}
+
+.bnf .hljs-attribute {
+ color: #8FBCBB;
+}
+
+.clojure .hljs-name {
+ color: #88C0D0;
+}
+
+.clojure .hljs-symbol {
+ color: #EBCB8B;
+}
+
+.coq .hljs-built_in {
+ color: #88C0D0;
+}
+
+.cpp .hljs-meta-string {
+ color: #8FBCBB;
+}
+
+.css .hljs-built_in {
+ color: #88C0D0;
+}
+
+.css .hljs-keyword {
+ color: #D08770;
+}
+
+.diff .hljs-meta {
+ color: #8FBCBB;
+}
+
+.ebnf .hljs-attribute {
+ color: #8FBCBB;
+}
+
+.glsl .hljs-built_in {
+ color: #88C0D0;
+}
+
+.groovy .hljs-meta:not(:first-child) {
+ color: #D08770;
+}
+
+.haxe .hljs-meta {
+ color: #D08770;
+}
+
+.java .hljs-meta {
+ color: #D08770;
+}
+
+.ldif .hljs-attribute {
+ color: #8FBCBB;
+}
+
+.lisp .hljs-name {
+ color: #88C0D0;
+}
+
+.lua .hljs-built_in {
+ color: #88C0D0;
+}
+
+.moonscript .hljs-built_in {
+ color: #88C0D0;
+}
+
+.nginx .hljs-attribute {
+ color: #88C0D0;
+}
+
+.nginx .hljs-section {
+ color: #5E81AC;
+}
+
+.pf .hljs-built_in {
+ color: #88C0D0;
+}
+
+.processing .hljs-built_in {
+ color: #88C0D0;
+}
+
+.scss .hljs-keyword {
+ color: #81A1C1;
+}
+
+.stylus .hljs-keyword {
+ color: #81A1C1;
+}
+
+.swift .hljs-meta {
+ color: #D08770;
+}
+
+.vim .hljs-built_in {
+ color: #88C0D0;
+ font-style: italic;
+}
+
+.yaml .hljs-meta {
+ color: #D08770;
+}
diff --git a/js/styles/obsidian.css b/js/styles/obsidian.css
new file mode 100644
index 0000000..356630f
--- /dev/null
+++ b/js/styles/obsidian.css
@@ -0,0 +1,88 @@
+/**
+ * Obsidian style
+ * ported by Alexander Marenin (http://github.com/ioncreature)
+ */
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #282b2e;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-selector-id {
+ color: #93c763;
+}
+
+.hljs-number {
+ color: #ffcd22;
+}
+
+.hljs {
+ color: #e0e2e4;
+}
+
+.hljs-attribute {
+ color: #668bb0;
+}
+
+.hljs-code,
+.hljs-class .hljs-title,
+.hljs-section {
+ color: white;
+}
+
+.hljs-regexp,
+.hljs-link {
+ color: #d39745;
+}
+
+.hljs-meta {
+ color: #557182;
+}
+
+.hljs-tag,
+.hljs-name,
+.hljs-bullet,
+.hljs-subst,
+.hljs-emphasis,
+.hljs-type,
+.hljs-built_in,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-addition,
+.hljs-variable,
+.hljs-template-tag,
+.hljs-template-variable {
+ color: #8cbbad;
+}
+
+.hljs-string,
+.hljs-symbol {
+ color: #ec7600;
+}
+
+.hljs-comment,
+.hljs-quote,
+.hljs-deletion {
+ color: #818e96;
+}
+
+.hljs-selector-class {
+ color: #A082BD
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-doctag,
+.hljs-title,
+.hljs-section,
+.hljs-type,
+.hljs-name,
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/ocean.css b/js/styles/ocean.css
new file mode 100644
index 0000000..5901581
--- /dev/null
+++ b/js/styles/ocean.css
@@ -0,0 +1,74 @@
+/* Ocean Dark Theme */
+/* https://github.com/gavsiu */
+/* Original theme - https://github.com/chriskempson/base16 */
+
+/* Ocean Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #65737e;
+}
+
+/* Ocean Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-regexp,
+.hljs-deletion {
+ color: #bf616a;
+}
+
+/* Ocean Orange */
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params,
+.hljs-meta,
+.hljs-link {
+ color: #d08770;
+}
+
+/* Ocean Yellow */
+.hljs-attribute {
+ color: #ebcb8b;
+}
+
+/* Ocean Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition {
+ color: #a3be8c;
+}
+
+/* Ocean Blue */
+.hljs-title,
+.hljs-section {
+ color: #8fa1b3;
+}
+
+/* Ocean Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #b48ead;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #2b303b;
+ color: #c0c5ce;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/paraiso-dark.css b/js/styles/paraiso-dark.css
new file mode 100644
index 0000000..e729240
--- /dev/null
+++ b/js/styles/paraiso-dark.css
@@ -0,0 +1,72 @@
+/*
+ Paraíso (dark)
+ Created by Jan T. Sott (http://github.com/idleberg)
+ Inspired by the art of Rubens LP (http://www.rubenslp.com.br)
+*/
+
+/* Paraíso Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #8d8687;
+}
+
+/* Paraíso Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-regexp,
+.hljs-link,
+.hljs-meta {
+ color: #ef6155;
+}
+
+/* Paraíso Orange */
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params,
+.hljs-deletion {
+ color: #f99b15;
+}
+
+/* Paraíso Yellow */
+.hljs-title,
+.hljs-section,
+.hljs-attribute {
+ color: #fec418;
+}
+
+/* Paraíso Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition {
+ color: #48b685;
+}
+
+/* Paraíso Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #815ba4;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #2f1e2e;
+ color: #a39e9b;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/paraiso-light.css b/js/styles/paraiso-light.css
new file mode 100644
index 0000000..944857c
--- /dev/null
+++ b/js/styles/paraiso-light.css
@@ -0,0 +1,72 @@
+/*
+ Paraíso (light)
+ Created by Jan T. Sott (http://github.com/idleberg)
+ Inspired by the art of Rubens LP (http://www.rubenslp.com.br)
+*/
+
+/* Paraíso Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #776e71;
+}
+
+/* Paraíso Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-regexp,
+.hljs-link,
+.hljs-meta {
+ color: #ef6155;
+}
+
+/* Paraíso Orange */
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params,
+.hljs-deletion {
+ color: #f99b15;
+}
+
+/* Paraíso Yellow */
+.hljs-title,
+.hljs-section,
+.hljs-attribute {
+ color: #fec418;
+}
+
+/* Paraíso Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition {
+ color: #48b685;
+}
+
+/* Paraíso Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #815ba4;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #e7e9db;
+ color: #4f424c;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/pojoaque.css b/js/styles/pojoaque.css
new file mode 100644
index 0000000..2e07847
--- /dev/null
+++ b/js/styles/pojoaque.css
@@ -0,0 +1,83 @@
+/*
+
+Pojoaque Style by Jason Tate
+http://web-cms-designs.com/ftopict-10-pojoaque-style-for-highlight-js-code-highlighter.html
+Based on Solarized Style from http://ethanschoonover.com/solarized
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ color: #dccf8f;
+ background: url(./pojoaque.jpg) repeat scroll left top #181914;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #586e75;
+ font-style: italic;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-addition {
+ color: #b64926;
+}
+
+.hljs-number,
+.hljs-string,
+.hljs-doctag,
+.hljs-regexp {
+ color: #468966;
+}
+
+.hljs-title,
+.hljs-section,
+.hljs-built_in,
+.hljs-name {
+ color: #ffb03b;
+}
+
+.hljs-variable,
+.hljs-template-variable,
+.hljs-class .hljs-title,
+.hljs-type,
+.hljs-tag {
+ color: #b58900;
+}
+
+.hljs-attribute {
+ color: #b89859;
+}
+
+.hljs-symbol,
+.hljs-bullet,
+.hljs-link,
+.hljs-subst,
+.hljs-meta {
+ color: #cb4b16;
+}
+
+.hljs-deletion {
+ color: #dc322f;
+}
+
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #d3a60c;
+}
+
+.hljs-formula {
+ background: #073642;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/pojoaque.jpg b/js/styles/pojoaque.jpg
new file mode 100644
index 0000000..9c07d4a
Binary files /dev/null and b/js/styles/pojoaque.jpg differ
diff --git a/js/styles/purebasic.css b/js/styles/purebasic.css
new file mode 100644
index 0000000..5ce9b9e
--- /dev/null
+++ b/js/styles/purebasic.css
@@ -0,0 +1,96 @@
+/*
+
+PureBASIC native IDE style ( version 1.0 - April 2016 )
+
+by Tristano Ajmone
+
+Public Domain
+
+NOTE_1: PureBASIC code syntax highlighting only applies the following classes:
+ .hljs-comment
+ .hljs-function
+ .hljs-keywords
+ .hljs-string
+ .hljs-symbol
+
+ Other classes are added here for the benefit of styling other languages with the look and feel of PureBASIC native IDE style.
+ If you need to customize a stylesheet for PureBASIC only, remove all non-relevant classes -- PureBASIC-related classes are followed by
+ a "--- used for PureBASIC ... ---" comment on same line.
+
+NOTE_2: Color names provided in comments were derived using "Name that Color" online tool:
+ http://chir.ag/projects/name-that-color
+*/
+
+.hljs { /* Common set of rules required by highlight.js (don'r remove!) */
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #FFFFDF; /* Half and Half (approx.) */
+/* --- Uncomment to add PureBASIC native IDE styled font!
+ font-family: Consolas;
+*/
+}
+
+.hljs, /* --- used for PureBASIC base color --- */
+.hljs-type, /* --- used for PureBASIC Procedures return type --- */
+.hljs-function, /* --- used for wrapping PureBASIC Procedures definitions --- */
+.hljs-name,
+.hljs-number,
+.hljs-attr,
+.hljs-params,
+.hljs-subst {
+ color: #000000; /* Black */
+}
+
+.hljs-comment, /* --- used for PureBASIC Comments --- */
+.hljs-regexp,
+.hljs-section,
+.hljs-selector-pseudo,
+.hljs-addition {
+ color: #00AAAA; /* Persian Green (approx.) */
+}
+
+.hljs-title, /* --- used for PureBASIC Procedures Names --- */
+.hljs-tag,
+.hljs-variable,
+.hljs-code {
+ color: #006666; /* Blue Stone (approx.) */
+}
+
+.hljs-keyword, /* --- used for PureBASIC Keywords --- */
+.hljs-class,
+.hljs-meta-keyword,
+.hljs-selector-class,
+.hljs-built_in,
+.hljs-builtin-name {
+ color: #006666; /* Blue Stone (approx.) */
+ font-weight: bold;
+}
+
+.hljs-string, /* --- used for PureBASIC Strings --- */
+.hljs-selector-attr {
+ color: #0080FF; /* Azure Radiance (approx.) */
+}
+
+.hljs-symbol, /* --- used for PureBASIC Constants --- */
+.hljs-link,
+.hljs-deletion,
+.hljs-attribute {
+ color: #924B72; /* Cannon Pink (approx.) */
+}
+
+.hljs-meta,
+.hljs-literal,
+.hljs-selector-id {
+ color: #924B72; /* Cannon Pink (approx.) */
+ font-weight: bold;
+}
+
+.hljs-strong,
+.hljs-name {
+ font-weight: bold;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
diff --git a/js/styles/qtcreator_dark.css b/js/styles/qtcreator_dark.css
new file mode 100644
index 0000000..7aa56a3
--- /dev/null
+++ b/js/styles/qtcreator_dark.css
@@ -0,0 +1,83 @@
+/*
+
+Qt Creator dark color scheme
+
+*/
+
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #000000;
+}
+
+.hljs,
+.hljs-subst,
+.hljs-tag,
+.hljs-title {
+ color: #aaaaaa;
+}
+
+.hljs-strong,
+.hljs-emphasis {
+ color: #a8a8a2;
+}
+
+.hljs-bullet,
+.hljs-quote,
+.hljs-number,
+.hljs-regexp,
+.hljs-literal {
+ color: #ff55ff;
+}
+
+.hljs-code
+.hljs-selector-class {
+ color: #aaaaff;
+}
+
+.hljs-emphasis,
+.hljs-stronge,
+.hljs-type {
+ font-style: italic;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-function,
+.hljs-section,
+.hljs-symbol,
+.hljs-name {
+ color: #ffff55;
+}
+
+.hljs-attribute {
+ color: #ff5555;
+}
+
+.hljs-variable,
+.hljs-params,
+.hljs-class .hljs-title {
+ color: #8888ff;
+}
+
+.hljs-string,
+.hljs-selector-id,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-type,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-template-tag,
+.hljs-template-variable,
+.hljs-addition,
+.hljs-link {
+ color: #ff55ff;
+}
+
+.hljs-comment,
+.hljs-meta,
+.hljs-deletion {
+ color: #55ffff;
+}
diff --git a/js/styles/qtcreator_light.css b/js/styles/qtcreator_light.css
new file mode 100644
index 0000000..1efa2c6
--- /dev/null
+++ b/js/styles/qtcreator_light.css
@@ -0,0 +1,83 @@
+/*
+
+Qt Creator light color scheme
+
+*/
+
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #ffffff;
+}
+
+.hljs,
+.hljs-subst,
+.hljs-tag,
+.hljs-title {
+ color: #000000;
+}
+
+.hljs-strong,
+.hljs-emphasis {
+ color: #000000;
+}
+
+.hljs-bullet,
+.hljs-quote,
+.hljs-number,
+.hljs-regexp,
+.hljs-literal {
+ color: #000080;
+}
+
+.hljs-code
+.hljs-selector-class {
+ color: #800080;
+}
+
+.hljs-emphasis,
+.hljs-stronge,
+.hljs-type {
+ font-style: italic;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-function,
+.hljs-section,
+.hljs-symbol,
+.hljs-name {
+ color: #808000;
+}
+
+.hljs-attribute {
+ color: #800000;
+}
+
+.hljs-variable,
+.hljs-params,
+.hljs-class .hljs-title {
+ color: #0055AF;
+}
+
+.hljs-string,
+.hljs-selector-id,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-type,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-template-tag,
+.hljs-template-variable,
+.hljs-addition,
+.hljs-link {
+ color: #008000;
+}
+
+.hljs-comment,
+.hljs-meta,
+.hljs-deletion {
+ color: #008000;
+}
diff --git a/js/styles/railscasts.css b/js/styles/railscasts.css
new file mode 100644
index 0000000..008cdc5
--- /dev/null
+++ b/js/styles/railscasts.css
@@ -0,0 +1,106 @@
+/*
+
+Railscasts-like style (c) Visoft, Inc. (Damien White)
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #232323;
+ color: #e6e1dc;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #bc9458;
+ font-style: italic;
+}
+
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #c26230;
+}
+
+.hljs-string,
+.hljs-number,
+.hljs-regexp,
+.hljs-variable,
+.hljs-template-variable {
+ color: #a5c261;
+}
+
+.hljs-subst {
+ color: #519f50;
+}
+
+.hljs-tag,
+.hljs-name {
+ color: #e8bf6a;
+}
+
+.hljs-type {
+ color: #da4939;
+}
+
+
+.hljs-symbol,
+.hljs-bullet,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-attr,
+.hljs-link {
+ color: #6d9cbe;
+}
+
+.hljs-params {
+ color: #d0d0ff;
+}
+
+.hljs-attribute {
+ color: #cda869;
+}
+
+.hljs-meta {
+ color: #9b859d;
+}
+
+.hljs-title,
+.hljs-section {
+ color: #ffc66d;
+}
+
+.hljs-addition {
+ background-color: #144212;
+ color: #e6e1dc;
+ display: inline-block;
+ width: 100%;
+}
+
+.hljs-deletion {
+ background-color: #600;
+ color: #e6e1dc;
+ display: inline-block;
+ width: 100%;
+}
+
+.hljs-selector-class {
+ color: #9b703f;
+}
+
+.hljs-selector-id {
+ color: #8b98ab;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-link {
+ text-decoration: underline;
+}
diff --git a/js/styles/rainbow.css b/js/styles/rainbow.css
new file mode 100644
index 0000000..905eb8e
--- /dev/null
+++ b/js/styles/rainbow.css
@@ -0,0 +1,85 @@
+/*
+
+Style with support for rainbow parens
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #474949;
+ color: #d1d9e1;
+}
+
+
+.hljs-comment,
+.hljs-quote {
+ color: #969896;
+ font-style: italic;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-type,
+.hljs-addition {
+ color: #cc99cc;
+}
+
+.hljs-number,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+ color: #f99157;
+}
+
+.hljs-string,
+.hljs-doctag,
+.hljs-regexp {
+ color: #8abeb7;
+}
+
+.hljs-title,
+.hljs-name,
+.hljs-section,
+.hljs-built_in {
+ color: #b5bd68;
+}
+
+.hljs-variable,
+.hljs-template-variable,
+.hljs-selector-id,
+.hljs-class .hljs-title {
+ color: #ffcc66;
+}
+
+.hljs-section,
+.hljs-name,
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-symbol,
+.hljs-bullet,
+.hljs-subst,
+.hljs-meta,
+.hljs-link {
+ color: #f99157;
+}
+
+.hljs-deletion {
+ color: #dc322f;
+}
+
+.hljs-formula {
+ background: #eee8d5;
+}
+
+.hljs-attr,
+.hljs-attribute {
+ color: #81a2be;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
diff --git a/js/styles/routeros.css b/js/styles/routeros.css
new file mode 100644
index 0000000..ebe2399
--- /dev/null
+++ b/js/styles/routeros.css
@@ -0,0 +1,108 @@
+/*
+
+ highlight.js style for Microtik RouterOS script
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #F0F0F0;
+}
+
+/* Base color: saturation 0; */
+
+.hljs,
+.hljs-subst {
+ color: #444;
+}
+
+.hljs-comment {
+ color: #888888;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-meta-keyword,
+.hljs-doctag,
+.hljs-name {
+ font-weight: bold;
+}
+
+.hljs-attribute {
+ color: #0E9A00;
+}
+
+.hljs-function {
+ color: #99069A;
+}
+
+.hljs-builtin-name {
+ color: #99069A;
+}
+
+/* User color: hue: 0 */
+
+.hljs-type,
+.hljs-string,
+.hljs-number,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-quote,
+.hljs-template-tag,
+.hljs-deletion {
+ color: #880000;
+}
+
+.hljs-title,
+.hljs-section {
+ color: #880000;
+ font-weight: bold;
+}
+
+.hljs-regexp,
+.hljs-symbol,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-link,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+ color: #BC6060;
+}
+
+
+/* Language color: hue: 90; */
+
+.hljs-literal {
+ color: #78A960;
+}
+
+.hljs-built_in,
+.hljs-bullet,
+.hljs-code,
+.hljs-addition {
+ color: #0C9A9A;
+}
+
+
+/* Meta color: hue: 200 */
+
+.hljs-meta {
+ color: #1f7199;
+}
+
+.hljs-meta-string {
+ color: #4d99bf;
+}
+
+
+/* Misc effects */
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/school-book.css b/js/styles/school-book.css
new file mode 100644
index 0000000..964b51d
--- /dev/null
+++ b/js/styles/school-book.css
@@ -0,0 +1,72 @@
+/*
+
+School Book style from goldblog.com.ua (c) Zaripov Yura
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 15px 0.5em 0.5em 30px;
+ font-size: 11px;
+ line-height:16px;
+}
+
+pre{
+ background:#f6f6ae url(./school-book.png);
+ border-top: solid 2px #d2e8b9;
+ border-bottom: solid 1px #d2e8b9;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal {
+ color:#005599;
+ font-weight:bold;
+}
+
+.hljs,
+.hljs-subst {
+ color: #3e5915;
+}
+
+.hljs-string,
+.hljs-title,
+.hljs-section,
+.hljs-type,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-attribute,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-addition,
+.hljs-variable,
+.hljs-template-tag,
+.hljs-template-variable,
+.hljs-link {
+ color: #2c009f;
+}
+
+.hljs-comment,
+.hljs-quote,
+.hljs-deletion,
+.hljs-meta {
+ color: #e60415;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-doctag,
+.hljs-title,
+.hljs-section,
+.hljs-type,
+.hljs-name,
+.hljs-selector-id,
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
diff --git a/js/styles/school-book.png b/js/styles/school-book.png
new file mode 100644
index 0000000..956e979
Binary files /dev/null and b/js/styles/school-book.png differ
diff --git a/js/styles/shades-of-purple.css b/js/styles/shades-of-purple.css
new file mode 100644
index 0000000..c0e899e
--- /dev/null
+++ b/js/styles/shades-of-purple.css
@@ -0,0 +1,97 @@
+/**
+ * Shades of Purple Theme — for Highlightjs.
+ *
+ * @author (c) Ahmad Awais
+ * @link GitHub Repo → https://github.com/ahmadawais/Shades-of-Purple-HighlightJS
+ * @version 1.5.0
+ */
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ /* Custom font is optional */
+ /* font-family: 'Operator Mono', 'Fira Code', 'Menlo', 'Monaco', 'Courier New', 'monospace'; */
+ line-height: 1.45;
+ padding: 2rem;
+ background: #2d2b57;
+ font-weight: normal;
+}
+
+.hljs-title {
+ color: #fad000;
+ font-weight: normal;
+}
+
+.hljs-name {
+ color: #a1feff;
+}
+
+.hljs-tag {
+ color: #ffffff;
+}
+
+.hljs-attr {
+ color: #f8d000;
+ font-style: italic;
+}
+
+.hljs-built_in,
+.hljs-selector-tag,
+.hljs-section {
+ color: #fb9e00;
+}
+
+.hljs-keyword {
+ color: #fb9e00;
+}
+
+.hljs,
+.hljs-subst {
+ color: #e3dfff;
+}
+
+.hljs-string,
+.hljs-attribute,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition,
+.hljs-code,
+.hljs-regexp,
+.hljs-selector-class,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-template-tag,
+.hljs-quote,
+.hljs-deletion {
+ color: #4cd213;
+}
+
+.hljs-meta,
+.hljs-meta-string {
+ color: #fb9e00;
+}
+
+.hljs-comment {
+ color: #ac65ff;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-name,
+.hljs-strong {
+ font-weight: normal;
+}
+
+.hljs-literal,
+.hljs-number {
+ color: #fa658d;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/solarized-dark.css b/js/styles/solarized-dark.css
new file mode 100644
index 0000000..b4c0da1
--- /dev/null
+++ b/js/styles/solarized-dark.css
@@ -0,0 +1,84 @@
+/*
+
+Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #002b36;
+ color: #839496;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #586e75;
+}
+
+/* Solarized Green */
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-addition {
+ color: #859900;
+}
+
+/* Solarized Cyan */
+.hljs-number,
+.hljs-string,
+.hljs-meta .hljs-meta-string,
+.hljs-literal,
+.hljs-doctag,
+.hljs-regexp {
+ color: #2aa198;
+}
+
+/* Solarized Blue */
+.hljs-title,
+.hljs-section,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #268bd2;
+}
+
+/* Solarized Yellow */
+.hljs-attribute,
+.hljs-attr,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-class .hljs-title,
+.hljs-type {
+ color: #b58900;
+}
+
+/* Solarized Orange */
+.hljs-symbol,
+.hljs-bullet,
+.hljs-subst,
+.hljs-meta,
+.hljs-meta .hljs-keyword,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-link {
+ color: #cb4b16;
+}
+
+/* Solarized Red */
+.hljs-built_in,
+.hljs-deletion {
+ color: #dc322f;
+}
+
+.hljs-formula {
+ background: #073642;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/solarized-light.css b/js/styles/solarized-light.css
new file mode 100644
index 0000000..fdcfcc7
--- /dev/null
+++ b/js/styles/solarized-light.css
@@ -0,0 +1,84 @@
+/*
+
+Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #fdf6e3;
+ color: #657b83;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #93a1a1;
+}
+
+/* Solarized Green */
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-addition {
+ color: #859900;
+}
+
+/* Solarized Cyan */
+.hljs-number,
+.hljs-string,
+.hljs-meta .hljs-meta-string,
+.hljs-literal,
+.hljs-doctag,
+.hljs-regexp {
+ color: #2aa198;
+}
+
+/* Solarized Blue */
+.hljs-title,
+.hljs-section,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #268bd2;
+}
+
+/* Solarized Yellow */
+.hljs-attribute,
+.hljs-attr,
+.hljs-variable,
+.hljs-template-variable,
+.hljs-class .hljs-title,
+.hljs-type {
+ color: #b58900;
+}
+
+/* Solarized Orange */
+.hljs-symbol,
+.hljs-bullet,
+.hljs-subst,
+.hljs-meta,
+.hljs-meta .hljs-keyword,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-link {
+ color: #cb4b16;
+}
+
+/* Solarized Red */
+.hljs-built_in,
+.hljs-deletion {
+ color: #dc322f;
+}
+
+.hljs-formula {
+ background: #eee8d5;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/sunburst.css b/js/styles/sunburst.css
new file mode 100644
index 0000000..f56dd5e
--- /dev/null
+++ b/js/styles/sunburst.css
@@ -0,0 +1,102 @@
+/*
+
+Sunburst-like style (c) Vasily Polovnyov
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #000;
+ color: #f8f8f8;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #aeaeae;
+ font-style: italic;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-type {
+ color: #e28964;
+}
+
+.hljs-string {
+ color: #65b042;
+}
+
+.hljs-subst {
+ color: #daefa3;
+}
+
+.hljs-regexp,
+.hljs-link {
+ color: #e9c062;
+}
+
+.hljs-title,
+.hljs-section,
+.hljs-tag,
+.hljs-name {
+ color: #89bdff;
+}
+
+.hljs-class .hljs-title,
+.hljs-doctag {
+ text-decoration: underline;
+}
+
+.hljs-symbol,
+.hljs-bullet,
+.hljs-number {
+ color: #3387cc;
+}
+
+.hljs-params,
+.hljs-variable,
+.hljs-template-variable {
+ color: #3e87e3;
+}
+
+.hljs-attribute {
+ color: #cda869;
+}
+
+.hljs-meta {
+ color: #8996a8;
+}
+
+.hljs-formula {
+ background-color: #0e2231;
+ color: #f8f8f8;
+ font-style: italic;
+}
+
+.hljs-addition {
+ background-color: #253b22;
+ color: #f8f8f8;
+}
+
+.hljs-deletion {
+ background-color: #420e09;
+ color: #f8f8f8;
+}
+
+.hljs-selector-class {
+ color: #9b703f;
+}
+
+.hljs-selector-id {
+ color: #8b98ab;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/tomorrow-night-blue.css b/js/styles/tomorrow-night-blue.css
new file mode 100644
index 0000000..78e59cc
--- /dev/null
+++ b/js/styles/tomorrow-night-blue.css
@@ -0,0 +1,75 @@
+/* Tomorrow Night Blue Theme */
+/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
+/* Original theme - https://github.com/chriskempson/tomorrow-theme */
+/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
+
+/* Tomorrow Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #7285b7;
+}
+
+/* Tomorrow Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-regexp,
+.hljs-deletion {
+ color: #ff9da4;
+}
+
+/* Tomorrow Orange */
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params,
+.hljs-meta,
+.hljs-link {
+ color: #ffc58f;
+}
+
+/* Tomorrow Yellow */
+.hljs-attribute {
+ color: #ffeead;
+}
+
+/* Tomorrow Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition {
+ color: #d1f1a9;
+}
+
+/* Tomorrow Blue */
+.hljs-title,
+.hljs-section {
+ color: #bbdaff;
+}
+
+/* Tomorrow Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #ebbbff;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #002451;
+ color: white;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/tomorrow-night-bright.css b/js/styles/tomorrow-night-bright.css
new file mode 100644
index 0000000..e05af8a
--- /dev/null
+++ b/js/styles/tomorrow-night-bright.css
@@ -0,0 +1,74 @@
+/* Tomorrow Night Bright Theme */
+/* Original theme - https://github.com/chriskempson/tomorrow-theme */
+/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
+
+/* Tomorrow Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #969896;
+}
+
+/* Tomorrow Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-regexp,
+.hljs-deletion {
+ color: #d54e53;
+}
+
+/* Tomorrow Orange */
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params,
+.hljs-meta,
+.hljs-link {
+ color: #e78c45;
+}
+
+/* Tomorrow Yellow */
+.hljs-attribute {
+ color: #e7c547;
+}
+
+/* Tomorrow Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition {
+ color: #b9ca4a;
+}
+
+/* Tomorrow Blue */
+.hljs-title,
+.hljs-section {
+ color: #7aa6da;
+}
+
+/* Tomorrow Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #c397d8;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: black;
+ color: #eaeaea;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/tomorrow-night-eighties.css b/js/styles/tomorrow-night-eighties.css
new file mode 100644
index 0000000..08fd51c
--- /dev/null
+++ b/js/styles/tomorrow-night-eighties.css
@@ -0,0 +1,74 @@
+/* Tomorrow Night Eighties Theme */
+/* Original theme - https://github.com/chriskempson/tomorrow-theme */
+/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
+
+/* Tomorrow Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #999999;
+}
+
+/* Tomorrow Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-regexp,
+.hljs-deletion {
+ color: #f2777a;
+}
+
+/* Tomorrow Orange */
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params,
+.hljs-meta,
+.hljs-link {
+ color: #f99157;
+}
+
+/* Tomorrow Yellow */
+.hljs-attribute {
+ color: #ffcc66;
+}
+
+/* Tomorrow Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition {
+ color: #99cc99;
+}
+
+/* Tomorrow Blue */
+.hljs-title,
+.hljs-section {
+ color: #6699cc;
+}
+
+/* Tomorrow Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #cc99cc;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #2d2d2d;
+ color: #cccccc;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/tomorrow-night.css b/js/styles/tomorrow-night.css
new file mode 100644
index 0000000..ddd270a
--- /dev/null
+++ b/js/styles/tomorrow-night.css
@@ -0,0 +1,75 @@
+/* Tomorrow Night Theme */
+/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
+/* Original theme - https://github.com/chriskempson/tomorrow-theme */
+/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
+
+/* Tomorrow Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #969896;
+}
+
+/* Tomorrow Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-regexp,
+.hljs-deletion {
+ color: #cc6666;
+}
+
+/* Tomorrow Orange */
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params,
+.hljs-meta,
+.hljs-link {
+ color: #de935f;
+}
+
+/* Tomorrow Yellow */
+.hljs-attribute {
+ color: #f0c674;
+}
+
+/* Tomorrow Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition {
+ color: #b5bd68;
+}
+
+/* Tomorrow Blue */
+.hljs-title,
+.hljs-section {
+ color: #81a2be;
+}
+
+/* Tomorrow Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #b294bb;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: #1d1f21;
+ color: #c5c8c6;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/tomorrow.css b/js/styles/tomorrow.css
new file mode 100644
index 0000000..026a62f
--- /dev/null
+++ b/js/styles/tomorrow.css
@@ -0,0 +1,72 @@
+/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
+
+/* Tomorrow Comment */
+.hljs-comment,
+.hljs-quote {
+ color: #8e908c;
+}
+
+/* Tomorrow Red */
+.hljs-variable,
+.hljs-template-variable,
+.hljs-tag,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-regexp,
+.hljs-deletion {
+ color: #c82829;
+}
+
+/* Tomorrow Orange */
+.hljs-number,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-literal,
+.hljs-type,
+.hljs-params,
+.hljs-meta,
+.hljs-link {
+ color: #f5871f;
+}
+
+/* Tomorrow Yellow */
+.hljs-attribute {
+ color: #eab700;
+}
+
+/* Tomorrow Green */
+.hljs-string,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-addition {
+ color: #718c00;
+}
+
+/* Tomorrow Blue */
+.hljs-title,
+.hljs-section {
+ color: #4271ae;
+}
+
+/* Tomorrow Purple */
+.hljs-keyword,
+.hljs-selector-tag {
+ color: #8959a8;
+}
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ background: white;
+ color: #4d4d4c;
+ padding: 0.5em;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/vs.css b/js/styles/vs.css
new file mode 100644
index 0000000..c5d07d3
--- /dev/null
+++ b/js/styles/vs.css
@@ -0,0 +1,68 @@
+/*
+
+Visual Studio-like style based on original C# coloring by Jason Diamond
+
+*/
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: white;
+ color: black;
+}
+
+.hljs-comment,
+.hljs-quote,
+.hljs-variable {
+ color: #008000;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-built_in,
+.hljs-name,
+.hljs-tag {
+ color: #00f;
+}
+
+.hljs-string,
+.hljs-title,
+.hljs-section,
+.hljs-attribute,
+.hljs-literal,
+.hljs-template-tag,
+.hljs-template-variable,
+.hljs-type,
+.hljs-addition {
+ color: #a31515;
+}
+
+.hljs-deletion,
+.hljs-selector-attr,
+.hljs-selector-pseudo,
+.hljs-meta {
+ color: #2b91af;
+}
+
+.hljs-doctag {
+ color: #808080;
+}
+
+.hljs-attr {
+ color: #f00;
+}
+
+.hljs-symbol,
+.hljs-bullet,
+.hljs-link {
+ color: #00b0e8;
+}
+
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/js/styles/vs2015.css b/js/styles/vs2015.css
new file mode 100644
index 0000000..d1d9be3
--- /dev/null
+++ b/js/styles/vs2015.css
@@ -0,0 +1,115 @@
+/*
+ * Visual Studio 2015 dark style
+ * Author: Nicolas LLOBERA
+ */
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #1E1E1E;
+ color: #DCDCDC;
+}
+
+.hljs-keyword,
+.hljs-literal,
+.hljs-symbol,
+.hljs-name {
+ color: #569CD6;
+}
+.hljs-link {
+ color: #569CD6;
+ text-decoration: underline;
+}
+
+.hljs-built_in,
+.hljs-type {
+ color: #4EC9B0;
+}
+
+.hljs-number,
+.hljs-class {
+ color: #B8D7A3;
+}
+
+.hljs-string,
+.hljs-meta-string {
+ color: #D69D85;
+}
+
+.hljs-regexp,
+.hljs-template-tag {
+ color: #9A5334;
+}
+
+.hljs-subst,
+.hljs-function,
+.hljs-title,
+.hljs-params,
+.hljs-formula {
+ color: #DCDCDC;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #57A64A;
+ font-style: italic;
+}
+
+.hljs-doctag {
+ color: #608B4E;
+}
+
+.hljs-meta,
+.hljs-meta-keyword,
+.hljs-tag {
+ color: #9B9B9B;
+}
+
+.hljs-variable,
+.hljs-template-variable {
+ color: #BD63C5;
+}
+
+.hljs-attr,
+.hljs-attribute,
+.hljs-builtin-name {
+ color: #9CDCFE;
+}
+
+.hljs-section {
+ color: gold;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
+
+/*.hljs-code {
+ font-family:'Monospace';
+}*/
+
+.hljs-bullet,
+.hljs-selector-tag,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-selector-attr,
+.hljs-selector-pseudo {
+ color: #D7BA7D;
+}
+
+.hljs-addition {
+ background-color: #144212;
+ display: inline-block;
+ width: 100%;
+}
+
+.hljs-deletion {
+ background-color: #600;
+ display: inline-block;
+ width: 100%;
+}
diff --git a/js/styles/xcode.css b/js/styles/xcode.css
new file mode 100644
index 0000000..b305665
--- /dev/null
+++ b/js/styles/xcode.css
@@ -0,0 +1,104 @@
+/*
+
+XCode style (c) Angel Garcia
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #fff;
+ color: black;
+}
+
+/* Gray DOCTYPE selectors like WebKit */
+.xml .hljs-meta {
+ color: #c0c0c0;
+}
+
+.hljs-comment,
+.hljs-quote {
+ color: #007400;
+}
+
+.hljs-tag,
+.hljs-attribute,
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-literal,
+.hljs-name {
+ color: #aa0d91;
+}
+
+.hljs-variable,
+.hljs-template-variable {
+ color: #3F6E74;
+}
+
+.hljs-code,
+.hljs-string,
+.hljs-meta-string {
+ color: #c41a16;
+}
+
+.hljs-regexp,
+.hljs-link {
+ color: #0E0EFF;
+}
+
+.hljs-title,
+.hljs-symbol,
+.hljs-bullet,
+.hljs-number {
+ color: #1c00cf;
+}
+
+.hljs-section,
+.hljs-meta {
+ color: #643820;
+}
+
+
+.hljs-class .hljs-title,
+.hljs-type,
+.hljs-built_in,
+.hljs-builtin-name,
+.hljs-params {
+ color: #5c2699;
+}
+
+.hljs-attr {
+ color: #836C28;
+}
+
+.hljs-subst {
+ color: #000;
+}
+
+.hljs-formula {
+ background-color: #eee;
+ font-style: italic;
+}
+
+.hljs-addition {
+ background-color: #baeeba;
+}
+
+.hljs-deletion {
+ background-color: #ffc8bd;
+}
+
+.hljs-selector-id,
+.hljs-selector-class {
+ color: #9b703f;
+}
+
+.hljs-doctag,
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
diff --git a/js/styles/xt256.css b/js/styles/xt256.css
new file mode 100644
index 0000000..58df82c
--- /dev/null
+++ b/js/styles/xt256.css
@@ -0,0 +1,92 @@
+
+/*
+ xt256.css
+
+ Contact: initbar [at] protonmail [dot] ch
+ : github.com/initbar
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ color: #eaeaea;
+ background: #000;
+ padding: 0.5;
+}
+
+.hljs-subst {
+ color: #eaeaea;
+}
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
+
+.hljs-builtin-name,
+.hljs-type {
+ color: #eaeaea;
+}
+
+.hljs-params {
+ color: #da0000;
+}
+
+.hljs-literal,
+.hljs-number,
+.hljs-name {
+ color: #ff0000;
+ font-weight: bolder;
+}
+
+.hljs-comment {
+ color: #969896;
+}
+
+.hljs-selector-id,
+.hljs-quote {
+ color: #00ffff;
+}
+
+.hljs-template-variable,
+.hljs-variable,
+.hljs-title {
+ color: #00ffff;
+ font-weight: bold;
+}
+
+.hljs-selector-class,
+.hljs-keyword,
+.hljs-symbol {
+ color: #fff000;
+}
+
+.hljs-string,
+.hljs-bullet {
+ color: #00ff00;
+}
+
+.hljs-tag,
+.hljs-section {
+ color: #000fff;
+}
+
+.hljs-selector-tag {
+ color: #000fff;
+ font-weight: bold;
+}
+
+.hljs-attribute,
+.hljs-built_in,
+.hljs-regexp,
+.hljs-link {
+ color: #ff00ff;
+}
+
+.hljs-meta {
+ color: #fff;
+ font-weight: bolder;
+}
diff --git a/js/styles/zenburn.css b/js/styles/zenburn.css
new file mode 100644
index 0000000..07be502
--- /dev/null
+++ b/js/styles/zenburn.css
@@ -0,0 +1,80 @@
+/*
+
+Zenburn style from voldmar.ru (c) Vladimir Epifanov
+based on dark.css by Ivan Sagalaev
+
+*/
+
+.hljs {
+ display: block;
+ overflow-x: auto;
+ padding: 0.5em;
+ background: #3f3f3f;
+ color: #dcdcdc;
+}
+
+.hljs-keyword,
+.hljs-selector-tag,
+.hljs-tag {
+ color: #e3ceab;
+}
+
+.hljs-template-tag {
+ color: #dcdcdc;
+}
+
+.hljs-number {
+ color: #8cd0d3;
+}
+
+.hljs-variable,
+.hljs-template-variable,
+.hljs-attribute {
+ color: #efdcbc;
+}
+
+.hljs-literal {
+ color: #efefaf;
+}
+
+.hljs-subst {
+ color: #8f8f8f;
+}
+
+.hljs-title,
+.hljs-name,
+.hljs-selector-id,
+.hljs-selector-class,
+.hljs-section,
+.hljs-type {
+ color: #efef8f;
+}
+
+.hljs-symbol,
+.hljs-bullet,
+.hljs-link {
+ color: #dca3a3;
+}
+
+.hljs-deletion,
+.hljs-string,
+.hljs-built_in,
+.hljs-builtin-name {
+ color: #cc9393;
+}
+
+.hljs-addition,
+.hljs-comment,
+.hljs-quote,
+.hljs-meta {
+ color: #7f9f7f;
+}
+
+
+.hljs-emphasis {
+ font-style: italic;
+}
+
+.hljs-strong {
+ font-weight: bold;
+}
diff --git a/models/pictsharemodel.php b/models/pictsharemodel.php
deleted file mode 100644
index ac806c0..0000000
--- a/models/pictsharemodel.php
+++ /dev/null
@@ -1,1144 +0,0 @@
-isImage($hash))
- exit('[x] Hash not found'."\n");
- echo "[i] Converting $hash to mp4\n";
- $this->saveAsMP4($source,$path.'mp4_1.'.$hash);
- $this->saveAsMP4($source,$path.'ogg_1.'.$hash);
- break;
- }
-
- return array('status'=>'ok');
- }
-
- function getURLInfo($url,$ispath=false)
- {
- $url = rawurldecode($url);
- $data = $this->urlToData($url);
- $hash = $data['hash'];
- if(!$hash)
- return array('status'=>'ERR','Reason'=>'Image not found');
-
- $file = $this->getCacheName($data);
- $html = new HTML;
-
- $path = ROOT.DS.'upload'.DS.$hash.DS.$file;
- if(!file_exists($path))
- $path = ROOT.DS.'upload'.DS.$hash.DS.$hash;
- if(file_exists($path))
- {
- $type = $this->getType($path);
- if($ispath)
- $byte = filesize($url);
- else $byte = filesize($path);
-
-
- if($type=='mp4')
- {
- $info = $this->getSizeOfMP4($path);
- $width = intval($info['width']);
- $height = intval($info['height']);
- }
- else
- {
- list($width, $height) = getimagesize($path);
- }
- return array('status'=>'ok','hash'=>$hash,'cachename'=>$file,'size'=>$byte,'humansize'=>$html->renderSize($byte),'width'=>$width,'height'=>$height,'type'=>$type);
- }
-
- else
- return array('status'=>'ERR','Reason'=>'Image not found');
- }
-
- function couldThisBeAnImage($string)
- {
- $len = strlen($string);
- $dot = strpos($string,'.');
- if(!$dot) return false;
- if($dot<=10 && ( ($len-$dot) == 4 || ($len-$dot) == 5 ) )
- return true;
- }
-
- function urlToData($url)
- {
- $html = new HTML;
- $url = explode("/",$url);
- foreach($url as $el)
- {
- $el = $html->sanatizeString($el);
- $el = strtolower($el);
- if(!$el) continue;
-
- if(IMAGE_CHANGE_CODE && substr($el,0,10)=='changecode')
- $data['changecode'] = substr($el,11);
-
- if($this->isImage($el))
- {
- //if there are more than one hashes in url
- //make an album from them
- if($data['hash'])
- {
- if(!$data['album'])
- $data['album'][] = $data['hash'];
- $data['album'][] = $el;
- }
- $data['hash']=$el;
- }
- else if(defined('ALT_FOLDER') && ALT_FOLDER && $this->couldThisBeAnImage($el)) //check alternative folder for the hash
- {
- $altname=ALT_FOLDER.DS.$el;
- //var_dump($altname);
- if(file_exists($altname))
- {
- $this->uploadImageFromURL($altname,$el);
- $data['hash'] = $el;
- }
- }
- else if(BACKBLAZE === true && $this->couldThisBeAnImage($el) && BACKBLAZE_AUTODOWNLOAD ===true) //looks like it might be a hash but didn't find it here. Let's see
- {
- $b = new Backblaze();
- if($b->download($el)) //if the backblaze download function says it's an image, we'll take it
- $data['hash'] = $el;
- }
- else if($el=='mp4' || $el=='raw' || $el=='preview' || $el=='webm' || $el=='ogg')
- $data[$el] = 1;
- else if($this->isSize($el))
- $data['size'] = $el;
- else if($el=='embed')
- $data['embed'] = true;
- else if($el=='responsive')
- $data['responsive'] = true;
- else if($this->isRotation($el))
- $data['rotate'] = $el;
- else if($this->isFilter($el))
- $data['filter'][] = $el;
- else if($legacy = $this->isLegacyThumbnail($el)) //so old uploads will still work
- {
- $data['hash'] = $legacy['hash'];
- $data['size'] = $legacy['size'];
- }
- else if($el=='forcesize')
- $data['forcesize'] = true;
- else if(strlen(MASTER_DELETE_CODE)>10 && $el=='delete_'.strtolower(MASTER_DELETE_CODE))
- $data['delete'] = true;
- else if($el=='delete' && $this->mayDeleteImages()===true)
- $data['delete'] = true;
- else if((strlen(MASTER_DELETE_CODE)>10 && $el=='delete_'.strtolower(MASTER_DELETE_CODE)) || $this->deleteCodeExists($el))
- $data['delete'] = $this->deleteCodeExists($el)?$el:true;
-
- }
-
- if($data['delete'] && $data['hash'])
- {
- if($data['delete']===true || $this->isThisDeleteCodeForImage($data['delete'],$data['hash'],true))
- $this->deleteImage($data['hash']);
- return false;
- }
-
- if($data['mp4'])
- {
- $hash = $data['hash'];
- if(!$hash || $this->getTypeOfHash($hash)!='gif')
- unset($data['mp4']);
- }
-
- return $data;
- }
-
- function mayDeleteImages()
- {
- if(!defined('MASTER_DELETE_IP') || !MASTER_DELETE_IP) return false;
- $ip = getUserIP();
- $parts = explode(';',MASTER_DELETE_IP);
- foreach($parts as $part)
- {
- if(strpos($part,'/')!==false) //it's a CIDR address
- {
- if(cidr_match($ip, $part))
- return true;
- }
- else if(isIP($part)) //it's an IP address
- {
- if($part==$ip) return true;
- }
- else if(gethostbyname($part)==$ip) //must be a hostname
- {
- return true;
- }
-
- }
-
- return false;
- }
-
- function deleteImage($hash)
- {
- //delete hash from hashes.csv
- $tmpname = ROOT.DS.'upload'.DS.'delete_temp.csv';
- $csv = ROOT.DS.'upload'.DS.'hashes.csv';
- $fptemp = fopen($tmpname, "w");
- if (($handle = fopen($csv, "r")) !== FALSE)
- {
- while (($line = fgets($handle)) !== false)
- {
- $data = explode(';',$line);
- if ($hash != trim($data[1]) )
- {
- fwrite($fptemp, $line);
- }
- }
- }
- fclose($handle);
- fclose($fptemp);
- unlink($csv);
- rename($tmpname, $csv);
- //unlink($tmpname);
-
- //delete actual image
- $base_path = ROOT.DS.'upload'.DS.$hash.DS;
- if(!is_dir($base_path)) return false;
- if ($handle = opendir($base_path))
- {
- while (false !== ($entry = readdir($handle)))
- {
- if ($entry != "." && $entry != "..")
- {
- unlink($base_path.$entry);
- }
- }
- closedir($handle);
- }
-
- rmdir($base_path);
-
- //delete from alt folder if configured
- if(defined('ALT_FOLDER') && ALT_FOLDER)
- {
- $altname=ALT_FOLDER.DS.$hash;
- if(file_exists($altname))
- {
- unlink($altname);
- }
- }
-
- //delete from backblaze if configured
- if(BACKBLAZE===true && BACKBLAZE_AUTODELETE===true)
- {
- $b = new Backblaze();
- $b->deleteFile($hash);
- }
-
-
- return true;
- }
-
- function isLegacyThumbnail($val)
- {
- if(strpos($val,'_'))
- {
- $a = explode('_',$val);
- $size = $a[0];
- $hash = $a[1];
- if(!$this->isSize($size) || !$this->isImage($hash)) return false;
-
- return array('hash'=>$hash,'size'=>$size);
- }
- else return false;
- }
-
- function isFilter($var)
- {
- if(strpos($var,'_'))
- {
- $a = explode('_',$var);
- $var = $a[0];
- $val = $a[1];
- if(!is_numeric($val)) return false;
- }
-
- switch($var)
- {
- case 'negative':
- case 'grayscale':
- case 'brightness':
- case 'edgedetect':
- case 'smooth':
- case 'contrast':
- case 'blur':
- case 'sepia':
- case 'sharpen':
- case 'emboss':
- case 'cool':
- case 'light':
- case 'aqua':
- case 'fuzzy':
- case 'boost':
- case 'gray':
- case 'pixelate': return true;
-
- default: return false;
- }
- }
-
- function isRotation($var)
- {
- switch($var)
- {
- case 'upside':
- case 'left':
- case 'right': return true;
-
- default: return false;
- }
- }
-
- function renderLegacyResized($path)
- {
- $a = explode('_',$path);
- if(count($a)!=2) return false;
-
- $hash = $a[1];
- $size = $a[0];
-
- if(!$this->hashExists($hash)) return false;
-
-
-
- renderResizedImage($size,$hash);
- }
-
- function getCacheName($data)
- {
- ksort($data);
- unset($data['raw']);
- //unset($data['preview']);
- $name = false;
- foreach($data as $key=>$val)
- {
- if($key!='hash')
- {
- if(!is_array($val))
- $name[] = $key.'_'.$val;
- else
- foreach($val as $valdata)
- $name[] = $valdata;
- }
- }
-
- if(is_array($name))
- $name = implode('.',$name);
-
- return ($name?$name.'.':'').$data['hash'];
- }
-
- function isSize($var)
- {
- if(is_numeric($var)) return true;
- $a = explode('x',$var);
- if(count($a)!=2 || !is_numeric($a[0]) || !is_numeric($a[1])) return false;
-
- return true;
- }
-
- function isImage($hash)
- {
- if(!$hash) return false;
- return $this->hashExists($hash);
- }
-
- function renderUploadForm()
- {
- $maxfilesize = (int)(ini_get('upload_max_filesize'));
-
- if(UPLOAD_CODE)
- $upload_code_form = ''.$this->translate(20).': ';
-
- return '
-
- '.$this->translate(0).': '.$maxfilesize.'MB / File
- '.$this->translate(1).'
-
- ';
- }
-
- function getNewHash($type,$length=10)
- {
- while(1)
- {
- $hash = getRandomString($length).'.'.$type;
- if(!$this->hashExists($hash)) return $hash;
- }
- }
-
- function hashExists($hash)
- {
- return is_dir(ROOT.DS.'upload'.DS.$hash);
- }
-
- function countResizedImages($hash)
- {
- $fi = new FilesystemIterator(ROOT.DS.'upload'.DS.$hash.DS, FilesystemIterator::SKIP_DOTS);
- return iterator_count($fi);
- }
-
- function getTypeOfFile($url)
- {
- $fi = new finfo(FILEINFO_MIME);
- $type = $fi->buffer(file_get_contents($url, false, null, -1, 1024));
-
- //to catch a strange error for PHP7 and Alpine Linux
- //if the file seems to be a stream, use unix file command
- if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN' && startsWith($type,'application/octet-stream'))
- {
- $content_type = exec("file -bi " . escapeshellarg($url));
- if($content_type && $content_type!=$type && strpos($content_type,'/')!==false && strpos($content_type,';')!==false)
- $type = $content_type;
- }
-
- $arr = explode(';', trim($type));
- if(count($arr)>1)
- {
- $a2 = explode('/', $arr[0]);
- $type = $a2[1];
- }
- else
- {
- $a2 = explode('/', $type);
- $type = $a2[1];
- }
-
- if($type=='octet-stream' && $this->isProperMP4($url)) return 'mp4';
- if($type=='mp4' && !$this->isProperMP4($url))
- return false;
-
-
- return $type;
-
- }
-
- function isTypeAllowed($type)
- {
- $type=strtolower($type);
- switch($type)
- {
- case 'image/png': return 'png';
- case 'image/x-png': return 'png';
- case 'x-png': return 'png';
- case 'png': return 'png';
-
- case 'image/jpeg': return 'jpg';
- case 'jpeg': return 'jpg';
- case 'jpg': return 'jpg';
- case 'pjpeg': return 'jpg';
-
- case 'image/gif': return 'gif';
- case 'gif': return 'gif';
-
- case 'mp4': return 'mp4';
-
- default: return false;
- }
- }
-
- function getType($url)
- {
- return $this->isTypeAllowed($this->getTypeOfFile($url));
- }
-
- function uploadImageFromURL($url,$forcehash=false)
- {
- $type = $this->getTypeOfFile($url);
- $type = $this->isTypeAllowed($type);
-
- if(!$type)
- return array('status'=>'ERR','reason'=>'wrong filetype');
-
- $tempfile = ROOT.DS.'tmp'.DS.md5(rand(1,999)*rand(0,10000)+time());
- file_put_contents($tempfile, file_get_contents($url));
-
- //remove all exif data from jpeg
- if($type=='jpg')
- {
- $res = imagecreatefromjpeg($tempfile);
- imagejpeg($res, $tempfile, (defined('JPEG_COMPRESSION')?JPEG_COMPRESSION:90));
- }
- $url = $tempfile;
-
- $dup_id = $this->isDuplicate($url);
- if($dup_id)
- {
- $hash = $forcehash?$forcehash:$dup_id;
- $url = ROOT.DS.'upload'.DS.$hash.DS.$hash;
- }
- else
- {
- $hash = $forcehash?$forcehash:$this->getNewHash($type);
- $this->saveSHAOfFile($url,$hash);
- }
-
- if($dup_id)
- return array('status'=>'OK','type'=>$type,'hash'=>$hash,'url'=>DOMAINPATH.PATH.$hash,'domain'=>DOMAINPATH);
-
- mkdir(ROOT.DS.'upload'.DS.$hash);
- $file = ROOT.DS.'upload'.DS.$hash.DS.$hash;
-
- file_put_contents($file, file_get_contents($url));
- unlink($tempfile);
-
- //re-render new mp4 by calling the re-encode script
- if($type=='mp4')
- {
- system("nohup php ".ROOT.DS.'tools'.DS.'re-encode_mp4.php force '.$hash." > /dev/null 2> /dev/null &");
- }
-
- if(LOG_UPLOADER)
- {
- $fh = fopen(ROOT.DS.'upload'.DS.'uploads.txt', 'a');
- fwrite($fh, time().';'.$url.';'.$hash.';'.getUserIP()."\n");
- fclose($fh);
- }
-
- if(defined('ALT_FOLDER') && ALT_FOLDER)
- {
- $altname=ALT_FOLDER.DS.$hash;
- if(!file_exists($altname) && is_dir(ALT_FOLDER))
- {
- copy($file,$altname);
- }
- }
-
- if(BACKBLAZE===true && BACKBLAZE_AUTOUPLOAD===true)
- {
- $b = new Backblaze();
- $b->upload($hash);
- }
-
- return array('status'=>'OK','type'=>$type,'hash'=>$hash,'url'=>DOMAINPATH.PATH.$hash,'domain'=>DOMAINPATH,'deletecode'=>$this->generateDeleteCodeForImage($hash));
- }
-
- function generateDeleteCodeForImage($hash)
- {
- while(1)
- {
- $code = getRandomString(32);
- $file = ROOT.DS.'upload'.DS.'deletecodes'.DS.$code;
- if(!is_dir(ROOT.DS.'upload'.DS.'deletecodes'))
- mkdir(ROOT.DS.'upload'.DS.'deletecodes');
- if(file_exists($file)) continue;
- file_put_contents($file,$hash);
- return $code;
- }
- }
-
- function deleteCodeExists($code)
- {
- if(strpos($code,'_')) $code = substr($code,strpos($code,'_')+1);
- if(!$code || !ctype_alnum($code)) return false;
- $file = ROOT.DS.'upload'.DS.'deletecodes'.DS.$code;
- return file_exists($file);
- }
-
- function isThisDeleteCodeForImage($code,$hash,$deleteiftrue=false)
- {
- if(strpos($code,'_')) $code = substr($code,strpos($code,'_')+1);
- if(!ctype_alnum($code) || !$hash) return false;
- $file = ROOT.DS.'upload'.DS.'deletecodes'.DS.$code;
- if(!file_exists($file)) return false;
- $rhash = trim(file_get_contents($file));
-
- $result = ($rhash==$hash)?true:false;
-
- if($deleteiftrue===true && $result===true)
- unlink($file);
-
- return $result;
- }
-
- function uploadCodeExists($code)
- {
- if(strpos(UPLOAD_CODE,';'))
- {
- $codes = explode(';',UPLOAD_CODE);
- foreach($codes as $ucode)
- if($code==$ucode) return true;
- }
-
- if($code==UPLOAD_CODE) return true;
-
- return false;
- }
-
- function changeCodeExists($code)
- {
- if(!IMAGE_CHANGE_CODE) return true;
- if(strpos(IMAGE_CHANGE_CODE,';'))
- {
- $codes = explode(';',IMAGE_CHANGE_CODE);
- foreach($codes as $ucode)
- if($code==$ucode) return true;
- }
-
- if($code==IMAGE_CHANGE_CODE) return true;
-
- return false;
- }
-
- function processSingleUpload($file,$name)
- {
- if(UPLOAD_CODE && !$this->uploadCodeExists($_REQUEST['upload_code']))
- exit(json_encode(array('status'=>'ERR','reason'=>$this->translate(21))));
-
- $im = new Image();
- if ($_FILES[$name]["error"] == UPLOAD_ERR_OK)
- {
- $type = $this->getTypeOfFile($_FILES[$name]["tmp_name"]);
- $type = $this->isTypeAllowed($type);
- if(!$type) exit(json_encode(array('status'=>'ERR','reason'=>'Unsupported type')));
-
- $data = $this->uploadImageFromURL($_FILES[$name]["tmp_name"]);
- if($data['status']=='OK')
- {
- $hash = $data['hash'];
- $o = array('status'=>'OK','type'=>$type,'hash'=>$hash,'url'=>DOMAINPATH.'/'.$hash,'domain'=>DOMAINPATH);
- if($data['deletecode'])
- $o['deletecode'] = $data['deletecode'];
-
- return $o;
- }
- }
-
-
- return $o;
- }
-
- function ProcessUploads()
- {
- if($_POST['submit']!=$this->translate(3)) return false;
-
- if(UPLOAD_CODE && !$this->uploadCodeExists($_REQUEST['upload_code']))
- return '' . $this->translate(21) . '';
-
- $im = new Image();
- $i = 0;
- foreach ($_FILES["pic"]["error"] as $key => $error)
- {
- if ($error == UPLOAD_ERR_OK)
- {
- $data = $this->uploadImageFromURL($_FILES["pic"]["tmp_name"][$key]);
-
- if($data['status']=='OK')
- {
- if($data['deletecode'])
- $deletecode = '
Delete image';
- else $deletecode = '';
- if($data['type']=='mp4')
- $o.= '';
- else
- $o.= ''.$this->translate(4).' '.++$i.'

'.$deletecode.'
';
-
- $hashes[] = $data['hash'];
- }
- }
- }
-
- if($_REQUEST['picurl'])
- {
- $url = $_REQUEST['picurl'];
- if(startsWith($url,'http://') || startsWith($url,'https://'))
- {
- $size_mb = remote_filesize($url)*0.000001;
- $maxsize = (int)(ini_get('upload_max_filesize'));
- if(endswith($maxsize,'MB'))
- {
- $maxsize = substr($maxsize,0,strpos($maxsize,'MB'));
- }
- else $maxsize = 20;
- if($size_mb <= $maxsize) //if the file is within maxsize lets download it
- {
- $name = basename($url);//md5(rand(1,9999)*rand(1,99999));
- file_put_contents(ROOT.DS.'tmp'.DS.$name, file_get_contents($url));
- $data = $this->uploadImageFromURL(ROOT.DS.'tmp'.DS.$name);
- if($data['status']=='OK')
- {
- if($data['deletecode'])
- $deletecode = '
Delete image';
- else $deletecode = '';
- if($data['type']=='mp4')
- $o.= '';
- else
- $o.= ''.$this->translate(4).' '.++$i.'

'.$deletecode.'
';
-
- $hashes[] = $data['hash'];
- }
- unlink(ROOT.DS.'tmp'.DS.$name);
- }
- else
- $o.= 'Error
File '.$url.' is too large. Max upload size: '.$maxsize.'MB
';
- }
- }
-
- if(is_array($hashes) && count($hashes)>1)
- {
- $albumlink = DOMAINPATH.PATH.implode('/',$hashes);
- $o.='
Album link
'.$albumlink.'';
-
- $iframe = ' ';
- $o.='
Embed code
';
- }
-
- return $o;
- }
-
- function saveSHAOfFile($filepath,$hash)
- {
- $sha_file = ROOT.DS.'upload'.DS.'hashes.csv';
- $sha = sha1_file($filepath);
- $fp = fopen($sha_file,'a');
- fwrite($fp,"$sha;$hash\n");
- fclose($fp);
- }
-
- function isDuplicate($file)
- {
- $sha_file = ROOT.DS.'upload'.DS.'hashes.csv';
- $sha = sha1_file($file);
- if(!file_exists($sha_file)) return false;
- $fp = fopen($sha_file,'r');
- while (($line = fgets($fp)) !== false)
- {
- $line = trim($line);
- if(!$line) contine;
- $sha_upload = substr($line,0,40);
- if($sha_upload==$sha) //when it's a duplicate return the hash of the original file
- {
- fclose($fp);
- return substr($line,41);
- }
-
- }
-
- fclose($fp);
-
- return false;
- }
-
- function translate($index,$params="")
- {
- $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
- //$lang = 'en';
- switch ($lang){
- case "de":
- $words[0] = 'Maximale Dateigröße';
- $words[1] = 'Es können auch mehrere Bilder auf einmal ausgewählt werden!';
- $words[2] = 'einfach, gratis, genial';
- $words[3] = 'Foto hinaufladen';
- $words[4] = 'Bild';
- $words[5] = 'Die Datei '.$params[0].' kann nicht hinaufgeladen werden, da der Dateityp "'.$params[1].'" nicht unterstützt wird.';
- $words[6] = 'Fehler beim Upload von '.$params;
- $words[7] = 'Bild "'.$params.'"" wurde erfolgreich hochgeladen';
- $words[8] = 'Skaliert auf';
- $words[9] = 'Kleinansicht';
- $words[10] = 'für Verlinkungen und Miniaturvorschau in Foren';
- $words[11] = 'Allgemeiner Fehler';
- $words[12] = 'Fehler 404 - nicht gefunden';
- $words[13] = 'Fehler 403 - nicht erlaubt';
- $words[14] = 'Kein refferer';
- $words[15] = 'Verlinkte Seiten';
- $words[16] = 'Hinweis: Zugriffe über pictshare.net werden nicht gerechnet';
- $words[17] = 'Dieses Bild wurde '.$params[0].' mal von '.$params[1].' verschiedenen IPs gesehen und hat '.$params[2].' Traffic verursacht';
- $words[18] = 'Dieses Bild wurde von folgenden Ländern aufgerufen: ';
- $words[19] = $params[0].' Aufrufe aus '.$params[1];
- $words[20] = 'Upload-Code';
- $words[21] = 'Falscher Upload Code eingegeben. Upload abgebrochen';
- $words[22] = 'URL für den Upload';
-
- break;
-
- default:
- $words[0] = 'Max filesize';
- $words[1] = 'You can select multiple pictures at once!';
- $words[2] = 'easy, free, engenious';
- $words[3] = 'Upload';
- $words[4] = 'Picture';
- $words[5] = 'The file '.$params[0].' can\'t be uploaded since the filetype "'.$params[1].'" is not supported.';
- $words[6] = 'Error uploading '.$params;
- $words[7] = 'Picture "'.$params.'"" was uploaded successfully';
- $words[8] = 'Scaled to';
- $words[9] = 'Thumbnail';
- $words[10] = 'for pasting in Forums, etc..';
- $words[11] = 'Unspecified error';
- $words[12] = 'Error 404 - not found';
- $words[13] = 'Error 403 - not allowed';
- $words[14] = 'No referrer';
- $words[15] = 'Linked sites';
- $words[16] = 'Note: Views from pictshare.net will not be counted';
- $words[17] = 'Was seen '.$params[0].' times by '.$params[1].' unique IPs and produced '.$params[2].' traffic';
- $words[18] = 'This picture was seen from the following countries: ';
- $words[19] = $params[0].' views from '.$params[1];
- $words[20] = 'Upload code';
- $words[21] = 'Invalid upload code provided';
- $words[22] = 'URL to upload';
- }
-
- return $words[$index];
- }
-
- function uploadImageFromBase64($data,$type=false)
- {
- $type = $this->base64_to_type($data);
- if(!$type)
- return array('status'=>'ERR','reason'=>'wrong filetype','type'=>$type);
- $hash = $this->getNewHash($type);
- $picname = $hash;
- $file = ROOT.DS.'tmp'.DS.$hash;
- $this->base64_to_image($data,$file,$type);
-
- return $this->uploadImageFromURL($file);
- }
-
- function base64_to_type($base64_string)
- {
- $data = explode(',', $base64_string);
- $data = $data[1];
-
- $data = str_replace(' ','+',$data);
- $data = base64_decode($data);
-
- $info = getimagesizefromstring($data);
-
-
-
- trigger_error("########## FILETYPE: ".$info['mime']);
-
-
- $f = finfo_open();
- $type = $this->isTypeAllowed(finfo_buffer($f, $data, FILEINFO_MIME_TYPE));
-
- return $type;
- }
-
- function base64_to_image($base64_string, $output_file,$type)
- {
- $data = explode(',', $base64_string);
- $data = $data[1];
-
- $data = str_replace(' ','+',$data);
-
- $data = base64_decode($data);
-
- $source = imagecreatefromstring($data);
- switch($type)
- {
- case 'jpg':
- imagejpeg($source,$output_file,(defined('JPEG_COMPRESSION')?JPEG_COMPRESSION:90));
- trigger_error("========= SAVING AS ".$type." TO ".$output_file);
- break;
-
- case 'png':
- imagefill($source, 0, 0, IMG_COLOR_TRANSPARENT);
- imagesavealpha($source,true);
- imagepng($source,$output_file,(defined('PNG_COMPRESSION')?PNG_COMPRESSION:6));
- trigger_error("========= SAVING AS ".$type." TO ".$output_file);
- break;
-
- case 'gif':
- imagegif($source,$output_file);
- trigger_error("========= SAVING AS ".$type." TO ".$output_file);
- break;
-
- default:
- imagefill($source, 0, 0, IMG_COLOR_TRANSPARENT);
- imagesavealpha($source,true);
- imagepng($source,$output_file,(defined('PNG_COMPRESSION')?PNG_COMPRESSION:6));
- break;
- }
-
- //$imageSave = imagejpeg($source,$output_file,100);
- imagedestroy($source);
-
- return $type;
- }
-
- function getTypeOfHash($hash)
- {
- $base_path = ROOT.DS.'upload'.DS.$hash.DS;
- $path = $base_path.$hash;
- $type = $this->isTypeAllowed($this->getTypeOfFile($path));
-
- return $type;
- }
-
- function isProperMP4($filename)
- {
- $file = escapeshellarg($filename);
- $tmp = ROOT.DS.'tmp'.DS.md5(time()+rand(1,10000)).'.'.rand(1,10000).'.log';
- $bin = escapeshellcmd(FFMPEG_BINARY);
-
- $cmd = "$bin -i $file > $tmp 2>> $tmp";
-
- system($cmd);
-
- $answer = file($tmp);
- unlink($tmp);
- $ismp4 = false;
- if(is_array($answer))
- foreach($answer as $line)
- {
- $line = trim($line);
- if(strpos($line,'Duration: 00:00:00')) return false;
- if(strpos($line, 'Video: h264'))
- $ismp4 = true;
- }
-
- return $ismp4;
- }
-
- function resizeFFMPEG($data,$cachepath,$type='mp4')
- {
- $file = ROOT.DS.'upload'.DS.$data['hash'].DS.$data['hash'];
- $file = escapeshellarg($file);
- $tmp = '/dev/null';
- $bin = escapeshellcmd(FFMPEG_BINARY);
-
- $size = $data['size'];
-
- if(!$size) return $file;
-
- $sd = $this->sizeStringToWidthHeight($size);
- $maxwidth = $sd['width'];
- $maxheight = $sd['height'];
-
- switch($type)
- {
- case 'mp4':
- $addition = '-c:v libx264 -profile:v baseline -level 3.0 -pix_fmt yuv420p';
- break;
- }
-
- $maxheight = 'trunc(ow/a/2)*2';
-
- $cmd = "$bin -i $file -y -vf scale=\"$maxwidth:$maxheight\" $addition -f $type $cachepath";
-
- system($cmd);
-
- return $cachepath;
- }
-
- function gifToMP4($gifpath,$target)
- {
- $bin = escapeshellcmd(FFMPEG_BINARY);
- $file = escapeshellarg($gifpath);
-
- if(!file_exists($target)) //simple caching.. have to think of something better
- {
- $cmd = "$bin -f gif -y -i $file -c:v libx264 -f mp4 $target";
- system($cmd);
- }
-
-
- return $target;
- }
-
- function saveAsMP4($source,$target)
- {
- $bin = escapeshellcmd(FFMPEG_BINARY);
- $source = escapeshellarg($source);
- $target = escapeshellarg($target);
- $h265 = "$bin -y -i $source -an -c:v libx264 -qp 0 -f mp4 $target";
- system($h265);
- }
-
- function saveAsOGG($source,$target)
- {
- $bin = escapeshellcmd(FFMPEG_BINARY);
- $source = escapeshellarg($source);
- $target = escapeshellarg($target);
- $h265 = "$bin -y -i $source -vcodec libtheora -acodec libvorbis -qp 0 -f ogg $target";
- system($h265);
- }
-
- function saveAsWebm($source,$target)
- {
- return false;
- $bin = escapeshellcmd(FFMPEG_BINARY);
- $source = escapeshellarg($source);
- $target = escapeshellarg($target);
- $webm = "$bin -y -i $source -vcodec libvpx -acodec libvorbis -aq 5 -ac 2 -qmax 25 -f webm $target";
- system($webm);
- }
-
- function saveFirstFrameOfMP4($path,$target)
- {
- $bin = escapeshellcmd(FFMPEG_BINARY);
- $file = escapeshellarg($path);
- $cmd = "$bin -y -i $file -vframes 1 -f image2 $target";
-
- system($cmd);
- }
-
- //from https://stackoverflow.com/questions/4847752/how-to-get-video-duration-dimension-and-size-in-php
- function getSizeOfMP4($video)
- {
- $video = escapeshellarg($video);
- $bin = escapeshellcmd(FFMPEG_BINARY);
- $command = $bin . ' -i ' . $video . ' -vstats 2>&1';
- $output = shell_exec($command);
-
- $regex_sizes = "/Video: ([^,]*), ([^,]*), ([0-9]{1,4})x([0-9]{1,4})/";
- if (preg_match($regex_sizes, $output, $regs)) {
- $codec = $regs [1] ? $regs [1] : null;
- $width = $regs [3] ? $regs [3] : null;
- $height = $regs [4] ? $regs [4] : null;
- }
-
- $regex_duration = "/Duration: ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}).([0-9]{1,2})/";
- if (preg_match($regex_duration, $output, $regs)) {
- $hours = $regs [1] ? $regs [1] : null;
- $mins = $regs [2] ? $regs [2] : null;
- $secs = $regs [3] ? $regs [3] : null;
- $ms = $regs [4] ? $regs [4] : null;
- }
-
- return array ('codec' => $codec,
- 'width' => $width,
- 'height' => $height,
- 'hours' => $hours,
- 'mins' => $mins,
- 'secs' => $secs,
- 'ms' => $ms
- );
-
- }
-
- function oembed($url,$type)
- {
- $data = $this->getURLInfo($url);
- $rawurl = $url.'/raw';
- switch($type)
- {
- case 'json':
- header('Content-Type: application/json');
- return array( "version"=> "1.0",
- "type"=> "video",
- "thumbnail_url"=>$url.'/preview',
- "thumbnail_width"=>$data['width'],
- "thumbnail_height"=>$data['height'],
- "width"=> $data['width'],
- "height"=> $data['height'],
- "title"=> "PictShare",
- "provider_name"=> "PictShare",
- "provider_url"=> DOMAINPATH,
- "html"=> '');
- break;
-
- case 'xml':
-
- break;
- }
- }
-
- function sizeStringToWidthHeight($size)
- {
- if(!$size || !$this->isSize($size)) return false;
- if(!is_numeric($size))
- $size = explode('x',$size);
-
- if(is_array($size))
- {
- $maxwidth = $size[0];
- $maxheight = $size[1];
- }
- else if($size)
- {
- $maxwidth = $size;
- $maxheight = $size;
- }
-
- return array('width'=>$maxwidth,'height'=>$maxheight);
- }
-
-
- function gradient($w=100, $h=100, $c=array('#FFFFFF','#FF0000','#00FF00','#0000FF'), $hex=true)
- {
- /*
- Generates a gradient image
-
- Author: Christopher Kramer
-
- Parameters:
- w: width in px
- h: height in px
- c: color-array with 4 elements:
- $c[0]: top left color
- $c[1]: top right color
- $c[2]: bottom left color
- $c[3]: bottom right color
-
- if $hex is true (default), colors are hex-strings like '#FFFFFF' (NOT '#FFF')
- if $hex is false, a color is an array of 3 elements which are the rgb-values, e.g.:
- $c[0]=array(0,255,255);
-
- */
-
- $im=imagecreatetruecolor($w,$h);
-
- if($hex) { // convert hex-values to rgb
- for($i=0;$i<=3;$i++) {
- $c[$i]=$this->hex2rgb($c[$i]);
- }
- }
-
- $rgb=$c[0]; // start with top left color
- for($x=0;$x<=$w;$x++) { // loop columns
- for($y=0;$y<=$h;$y++) { // loop rows
- // set pixel color
- $col=imagecolorallocate($im,$rgb[0],$rgb[1],$rgb[2]);
- imagesetpixel($im,$x-1,$y-1,$col);
- // calculate new color
- for($i=0;$i<=2;$i++) {
- $rgb[$i]=
- $c[0][$i]*(($w-$x)*($h-$y)/($w*$h)) +
- $c[1][$i]*($x *($h-$y)/($w*$h)) +
- $c[2][$i]*(($w-$x)*$y /($w*$h)) +
- $c[3][$i]*($x *$y /($w*$h));
- }
- }
- }
- return $im;
- }
-
- function hex2rgb($hex)
- {
- $rgb[0]=hexdec(substr($hex,1,2));
- $rgb[1]=hexdec(substr($hex,3,2));
- $rgb[2]=hexdec(substr($hex,5,2));
- return($rgb);
- }
-
-}
-
diff --git a/rtfm/INSTALL.md b/rtfm/INSTALL.md
new file mode 100644
index 0000000..e69de29
diff --git a/template_album_embed.php b/template_album_embed.php
deleted file mode 100644
index 45b8d73..0000000
--- a/template_album_embed.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
- Album -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/template_album.php b/templates/main.html
similarity index 67%
rename from template_album.php
rename to templates/main.html
index 0ed010f..894a2b5 100644
--- a/template_album.php
+++ b/templates/main.html
@@ -8,10 +8,11 @@
-
+
-
+
+
@@ -29,42 +30,32 @@
-
-
-
+
-
-
+
+
+
-