Rabu 20 November 2019

This commit is contained in:
Damillora 2019-11-20 12:19:02 +07:00
parent 678dadb1ab
commit 32e983faba
98 changed files with 14782 additions and 205 deletions

View File

@ -0,0 +1,45 @@
<?php
namespace Application\Controllers;
use Application\HTTP\Request;
use Application\HTTP\Response;
use Application\Services\ServiceContainer;
use Application\Models\User;
use Application\Models\UserChange;
class AccountController {
public function __construct() {
}
public function profile(Request $request, Response $response) {
$user = User::find($request->id);
return $response->view('profile', [ 'user' => $user ] );
}
public function update(Request $request, Response $response) {
$user = ServiceContainer::Authentication()->user();
$updateData = [];
if($request->hasFile("avatar")) {
$file = $request->file("avatar");
$filename = "avatars/".$user->id."-".$file->name();
$file->move("Application/Storage/".$filename);
$updateData["avatar_path"] = $filename;
};
$updateData["about"] = $request->about;
$updateData["email_visible"] = $request->email_visible == "on" ? 1 : 0;
if(isset($request->username) && $user->username != $request->username) {
$updateData["username"] = $request->username;
UserChange::create([
'user_id' => $user->id,
'action_type' => 'username',
'best_before' => date('Y-m-d H:i:s'),
'is_confirmed' => 1,
]);
}
$user->update($updateData);
return $response->redirect("/me");
}
public function me(Request $request, Response $response) {
$user = ServiceContainer::Authentication()->user();
return $response->view('me', [ 'user' => $user ] );
}
}

View File

@ -5,15 +5,18 @@ use Application\HTTP\Request;
use Application\HTTP\Response;
use Application\Services\ServiceContainer;
use Application\Models\Category;
use Application\Models\Post;
use Application\Models\Thread;
use Application\Models\UserAction;
use Application\Models\UserFavorite;
use Application\Models\UserReport;
use Application\Foundations\QueryBuilder;
class ApiController {
public function __construct() {
}
public function categories(Request $request, Response $response) {
public function getBans() {
$bans = [];
if(ServiceContainer::Authentication()->isLoggedIn()) {
$where = new QueryBuilder();
@ -23,19 +26,74 @@ class ApiController {
return (int)$action->category_id;
}, $actions);
}
return $bans;
}
public function categories(Request $request, Response $response) {
$bans = $this->getBans();
$where = new QueryBuilder();
$where = $where->where('group_id',$request->id);
$categories = Category::select($where);
if(count($bans) > 0) {
$where = $where->whereNotIn('id',$bans);
}
$categories = Category::select($where);
return $response->json()->data($categories);
}
public function threads(Request $request, Response $response) {
$bans = $this->getBans();
if(in_array($request->id,$bans) ) {
return $response->json()->data([]);
}
$where = new QueryBuilder();
$where = $where->where('category_id',$request->id);
$threads = Thread::select($where);
usort($threads, function($a, $b) {
$a_view = ($a->view_count + ($a->post_count * 10)) / $a->thread_age;
$b_view = ($b->view_count + ($b->post_count * 10)) / $b->thread_age;
if($a->is_hot) {
$a_view += 500000;
} else if($b->is_hot) {
$b_view += 500000;
}
return ($a_view < $b_view) ? 1 : ($a_view == $b_view ? 0 : -1);
});
return $response->json()->data($threads);
}
public function reports(Request $request, Response $response) {
if(!ServiceContainer::Authentication()->isLoggedIn() || !ServiceContainer::Authentication()->user()->is_moderator) return [];
$where = new QueryBuilder();
$where = $where->select('post.id AS post')->from('thread')->join('post','post.thread_id = thread.id');
if(!isset($request->id) || $request->id != 0) {
$where = $where->where('category_id',$request->id);
}
$threads = ServiceContainer::Database()->select($where->build());
$posts = array_map(function($a) { return $a['post']; },$threads);
$where = new QueryBuilder();
$where = $where->whereIn('post_id',$posts);
return $response->json()->data(UserReport::select($where));
}
public function favorite(Request $request, Response $response) {
if(!ServiceContainer::Authentication()->isLoggedIn()) {
return $response->json()->data([ 'success' => false ]);
}
$query = new QueryBuilder();
$query = $query->where('user_id',ServiceContainer::Authentication()->user()->id)->where('post_id',$request->id);
$is_fav = UserFavorite::selectOne($query);
if(isset($is_fav)) {
$query = new QueryBuilder();
$query = $query->delete()->from('userfavorite')->where('user_id',ServiceContainer::Authentication()->user()->id)->where('post_id',$request->id);
$res = ServiceContainer::Database()->update($query->build());
return $response->json()->data([ 'success' => $res ]);
} else {
$is_fav = UserFavorite::create([
'user_id' => ServiceContainer::Authentication()->user()->id,
'post_id' => $request->id,
]);
return $response->json()->data([ 'success' => isset($is_fav) ]);
}
return $response->json()->data([ 'success' => true ]);
}
public function favorite_num(Request $request, Response $response) {
$post = Post::find($request->id);
return $response->json()->data([ "favorites" => $post->favorites ]);
}
}

View File

@ -107,7 +107,7 @@ class AuthController {
}
public function login_check(Request $request, Response $response) {
$query = new QueryBuilder();
$query = $query->where('username',$request->username)->orWhere('email',$request->username);
$query = $query->where('is_deactivated',0)->where('username',$request->username)->orWhere('email',$request->username)->where('is_deactivated',0);
$result = User::selectOne($query);
if($result == null) {
if(filter_var($request->username,FILTER_VALIDATE_EMAIL)) {

View File

@ -8,14 +8,33 @@ use Application\Models\Category;
use Application\Models\Post;
use Application\Models\Thread;
use Application\Models\UserAction;
use Application\Models\UserReport;
use Application\Foundations\QueryBuilder;
use Application\Foundations\MailBuilder;
class ForumThreadController {
public function __construct() {
}
public function getBans() {
$bans = [];
if(ServiceContainer::Authentication()->isLoggedIn()) {
$where = new QueryBuilder();
$where = $where->where('user_id',ServiceContainer::Session()->get('user_id'))->where('expired_at','>',date('Y-m-d H:i:s'))->where('action_type','ban')->orderBy('expired_at','desc');
$actions = UserAction::select($where);
$bans = array_map(function($action) {
return (int)$action->category_id;
}, $actions);
}
return $bans;
}
public function forum(Request $request, Response $response) {
$thread = Thread::find($request->id);
$bans = $this->getBans();
if(in_array($thread->category_id,$bans) ) {
return $response->body("");
}
$thread->update([ "view_count" => $thread->view_count + 1 ]);
return $response->view('thread', [ 'thread' => $thread ] );
}
public function process(Request $request, Response $response) {
@ -33,9 +52,64 @@ class ForumThreadController {
$thread = Thread::find($request->thread);
$reply = Post::find($request->reply);
$edit = Post::find($request->edit);
$delete = Post::find($request->delete);
$report = Post::find($request->report);
$time_stamp = false;
if(isset($edit)) {
$time_stamp = (time() - strtotime($edit->created_at)) > 300;
} else if(isset($delete)) {
$time_stamp = (time() - strtotime($delete->created_at)) > 300;
}
if($time_stamp) {
return $response->redirect('/?thread='.($edit->id ?? $delete->id));
}
if(isset($edit)) {
$edit->update([ 'post' => $request->content, 'updated_at' => date("Y-m-d H:i:s") ]);
return $response->redirect('/');
return $response->redirect('/?thread='.$thread->id);
} else if(isset($delete)) {
$cat_id = $delete->thread_id;
$delete->delete();
return $response->redirect('/?thread='.$cat_id);
} else if(isset($report)) {
$query = new QueryBuilder();
$query->where('user_id',$user->id)->where('report_date','>', date("Y-m-d H:i:s",strtotime("- 1 day")) );
$reports = UserReport::select($query);
if(count($reports) > 0 ) return $response->body('You cannot report again for a 24 hour period');
$category = Post::find($request->report)->thread()->category();
UserReport::create([
'user_id' => $user->id,
'reason' => $request->content,
'post_id' => $request->report,
'report_date' => date('Y-m-d H:i:s'),
]);
if($user->didIModerateThis($category->id)) {
$query = new QueryBuilder();
$query = $query->where('role','>=','100000');
$admins = User::select($query);
foreach($admins as $moderator) {
$email = new MailBuilder();
$body = "Dear ".$moderator->username."\n";
$body .= "Someone reported ".$report->user()->username.", a moderator for ".$category->category_name." for alleged violation of the rules.\n\n";
$body .= "Reason:\n\n";
$body .= $request->content."\n\n";
$body .= "Please resolve this via the moderation interface.\n";
$email->from("metaforums@nanao.moe")->to($moderator->email)->subject("New report: ".$user->username)->body($body);
ServiceContainer::Email()->send($email);
}
} else {
$moderators = Post::find($request->report)->thread()->category()->moderators;
foreach($moderators as $moderator) {
$email = new MailBuilder();
$body = "Dear ".$moderator->username."\n";
$body .= "Someone reported ".$report->user()->username." for alleged violation of the rules.\n\n";
$body .= "Reason:\n\n";
$body .= $request->content."\n\n";
$body .= "Please resolve this via the moderation interface.\n";
$email->from("metaforums@nanao.moe")->to($moderator->email)->subject("New report: ".$user->username)->body($body);
ServiceContainer::Email()->send($email);
}
}
return $response->redirect('/?thread='.$thread->id);
} else if (isset($thread) && isset($reply)) {
$title = $reply->title;
if(strpos($reply->title,"Re: ") != 0) {
@ -51,7 +125,7 @@ class ForumThreadController {
'updated_at' => date("Y-m-d H:i:s"),
]);
}
return $response->redirect('/');
return $response->redirect('/?thread='.$thread->id);
} else if (isset($category)) {
$title = $request->title;
$thread = Thread::create([
@ -69,7 +143,7 @@ class ForumThreadController {
'created_at' => date("Y-m-d H:i:s"),
'updated_at' => date("Y-m-d H:i:s"),
]);
return $response->redirect('/');
return $response->redirect('/?thread='.$thread->id);
}
}
public function editor(Request $request, Response $response) {
@ -78,15 +152,69 @@ class ForumThreadController {
$thread = Thread::find($request->thread);
$reply = Post::find($request->reply);
$edit = Post::find($request->edit);
$delete = Post::find($request->delete);
$report = Post::find($request->report);
if(isset($edit)) {
$title = "Editing post";
} else if(isset($report)) {
$title = "Reporting abuse by ".$report->user()->username;
} else if(isset($delete)) {
$title = "Are you sure to delete this post?";
} else if (isset($thread) && isset($reply) && $thread->main_post->id == $reply->id ) {
$title = "Replying to Main Post";
} else if (isset($thread) && isset($reply)) {
$title = "Replying to ".$reply->user()->username;
} else if (isset($category)) {
$title = "Creating Thread to ".$category->category_name;
$title = "Creating Thread in ".$category->category_name;
}
return $response->view('editor', [ 'title' => $title, 'category' => $request->category, 'thread' => $request->thread, 'edit' => $request->edit, 'reply' => $request->reply, 'edit_post' => $edit ] );
return $response->view('editor', [ 'title' => $title, 'category' => $category, 'thread' => $thread, 'edit' => $edit, 'reply' => $reply, 'delete' => $delete, "report" => $report, 'thread_post' => $thread ] );
}
public function moderating_editor(Request $request, Response $response) {
$post = Post::find($request->id);
$title = "Moderating ";
return $response->view('moderating-editor', [ 'title' => $title, 'post' => $post ]);
}
public function moderate(Request $request,Response $response) {
$user = ServiceContainer::Authentication()->user();
$post = Post::find($request->post);
$thread = Thread::find($request->thread);
$category = Category::find($request->category);
$action = $request->action;
UserAction::create([
'user_id' => $post->user()->id,
'thread_id' => $thread->id ?? 0,
'category_id' => $category->id ?? 0,
'action_type' => $action,
'reason' => $request->content,
'action_at' => date('Y-m-d H:i:s'),
'expired_at' => date('Y-m-d H:i:s',strtotime($request->duration)) ,
]);
if($action == "lock") {
Post::create([
'thread_id' => $thread->id,
'user_id' => $user->id,
'title' => "Locking ".$thread->title,
'post' => $request->content,
'created_at' => date("Y-m-d H:i:s"),
'updated_at' => date("Y-m-d H:i:s"),
]);
} else {
$offending_user = $post->user();
$email = new MailBuilder();
$body = "A moderator,".$user->username." has decided to apply a ".$action." to your account.\n";
$body .= "Reason:\n\n";
$body .= $request->content."\n\n";
$body .= "To appeal this decision, contact the moderator who applied the ".$action.".\n";
$email->from("metaforums@nanao.moe")->to($offending_user->email)->subject("A ".$action." was applied to your account")->body($body);
ServiceContainer::Email()->send($email);
}
return $response->redirect('/?thread='.$thread->id);
}
public function unlock(Request $request, Response $response) {
$thread = Thread::find($request->id);
if($thread->lock()) {
$thread->lock()->delete();
}
return $response->redirect('/?thread='.$thread->id);
}
}

View File

@ -11,6 +11,22 @@ use Application\Models\Thread;
class IndexController {
public function __construct() {
}
public function moderation(Request $request, Response $response) {
if(!ServiceContainer::Authentication()->isLoggedIn() || !ServiceContainer::Authentication()->user()->is_moderator) {
return $response->redirect("/");
}
$groups = Group::all();
$group = null;
$category = null;
if(isset($request->group)) {
$group = Group::find($request->group);
}
if(isset($request->category)) {
$category = Category::find($request->category);
$group = Group::find($category->group_id);
}
return $response->view('moderation', ['groups' => $groups, 'group' => $group, 'category' => $category ] );
}
public function index(Request $request, Response $response) {
$groups = Group::all();
@ -22,9 +38,12 @@ class IndexController {
}
if(isset($request->category)) {
$category = Category::find($request->category);
$group = Group::find($category->group_id);
}
if(isset($request->thread)) {
$thread = Thread::find($request->thread);
$category = Category::find($thread->category_id);
$group = Group::find($category->group_id);
}
return $response->view('index', ['groups' => $groups, 'group' => $group, 'category' => $category, 'thread' => $thread ] );
}

View File

@ -2,6 +2,28 @@
namespace Application\Foundations;
class DateHelper {
public static function durationString($then, $now) {
$dateDiff = $now - $then;
$measure = "";
$dateDiff = abs($dateDiff);
$seconds = $dateDiff;
$minutes = intval($dateDiff / 60);
$hours = intval($dateDiff / 3600);
$days = intval($dateDiff / 86400);
$years = intval($dateDiff / (365 * 86400));
if($years > 0) {
$measure = $years." years";
} else if($days > 0) {
$measure = $days." days";
} else if($hours > 0) {
$measure = $hours." hours";
} else if($minutes > 0) {
$measure = $minutes." minutes";
} else if($seconds > 0) {
$measure = $seconds." seconds";
}
return $measure;
}
public function elapsedString($date) {
$unixTimestamp = strtotime($date);
$now = time();
@ -12,6 +34,8 @@ class DateHelper {
$ago .= " ago";
} else if($dateDiff < 0) {
$ago .= " later";
} else {
return "just now";
}
$dateDiff = abs($dateDiff);
$seconds = $dateDiff;

View File

@ -13,6 +13,14 @@ class QueryBuilder {
}
return $this;
}
public function selectDistinct($fields) {
if(!is_array($fields)) {
$this->query .= "SELECT DISTINCT ".$fields;
} else {
$this->query .= "SELECT DISTINCT ".implode(",",SQLHelper::encode_list($fields));
}
return $this;
}
public function orderBy($column, $order = 'asc') {
$this->misc .= " ORDER BY ".$column." ".strtoupper($order);
return $this;
@ -40,6 +48,10 @@ class QueryBuilder {
$this->query .= " FROM `".$table."`";
return $this;
}
public function join($table, $condition) {
$this->query .= " JOIN ".$table." ON ".$condition;
return $this;
}
public function where($a, $b, $c = null) {
$field = "";
$value = "";
@ -102,6 +114,10 @@ class QueryBuilder {
}
return $this;
}
public function limit($limit) {
$this->misc .= " LIMIT ".$limit;
return $this;
}
public function build() {
return $this->query.$this->where.$this->misc;
}

18
Application/HTTP/File.php Normal file
View File

@ -0,0 +1,18 @@
<?php
namespace Application\HTTP;
class File {
private $data;
public function __construct($data) {
$this->data = $data;
}
public function move($path) {
move_uploaded_file($this->data["tmp_name"],$path);
}
public function name() {
return $this->data["name"];
}
public function extension() {
return pathinfo($this->data["name"],PATHINFO_EXTENSION);
}
}

View File

@ -6,16 +6,26 @@ class Request {
private $query;
public function __construct() {
$this->data = $_REQUEST;
$this->files = $_FILES;
$this->query = $_SERVER['QUERY_STRING'];
}
public function hasFile($name) {
return (array_key_exists($name,$this->files) && $this->files[$name]["name"] != "");
}
public function file($name) {
return new File($this->files[$name]);
}
function queryString() {
return $this->query;
}
function __get($prop) {
if(!array_key_exists($prop,$this->data)) return "";
if(!array_key_exists($prop,$this->data)) return null;
return $this->data[$prop];
}
function __set($prop, $val) {
$this->data[$prop] = $val;
}
function __isset($prop) {
return array_key_exists($prop,$this->data);
}
}

View File

@ -2,7 +2,22 @@
namespace Application\Models;
use Application\Foundations\Model as DBModel;
use Application\Foundations\QueryBuilder;
class Category extends DBModel {
public function moderators_attribute() {
$query = new QueryBuilder();
$query = $query->where('category_id',$this->id);
$moderators = ModeratorCategory::select($query);
if(count($moderators) == 0) return [];
$moderators = array_map(function($a) {
return $a->user_id;
}, $moderators);
$query = new QueryBuilder();
$query = $query->whereIn('id',$moderators);
return User::select($query);
}
public function group() {
return Group::find($this->group_id);
}
}

View File

@ -8,7 +8,7 @@ use Application\Services\ServiceContainer;
class Post extends DBModel {
public function user() {
$user = User::Find($this->user_id);
$user = User::find($this->user_id);
return $user;
}
public function elapsed_created_attribute() {
@ -20,6 +20,10 @@ class Post extends DBModel {
$result = ServiceContainer::Database()->select($query);
return $result[0]["count"];
}
public function thread() {
$thread = Thread::find($this->thread_id);
return $thread;
}
public function is_main() {
$id = Thread::find($this->thread_id)->main_post->id;
return ($id == $this->id);

View File

@ -19,6 +19,12 @@ class Thread extends DBModel {
public function elapsed_created_attribute() {
return DateHelper::elapsedString($this->created_at);
}
public function thread_age_attribute() {
$query = new QueryBuilder();
$query = $query->where('thread_id',$this->id)->orderBy('created_at','desc');
$post = Post::selectOne($query);
return time() - strtotime($post->created_at);
}
public function last_reply_attribute() {
$query = new QueryBuilder();
$query = $query->where('thread_id',$this->id)->orderBy('created_at','desc');
@ -43,7 +49,18 @@ class Thread extends DBModel {
return $post;
}
public function category() {
$category = Category::Find($this->category_id);
$category = Category::find($this->category_id);
return $category;
}
public function isLocked() {
$action = $this->lock();
return isset($action);
}
public function lock() {
$where = new QueryBuilder();
$where = $where->where('thread_id',$this->id)->where('action_type','lock')->where('expired_at','>',date('Y-m-d H:i:s'))->orderBy('expired_at','desc');
$actions = UserAction::selectOne($where);
return $actions;
}
}

View File

@ -3,6 +3,7 @@ namespace Application\Models;
use Application\Foundations\Model as DBModel;
use Application\Foundations\QueryBuilder;
use Application\Foundations\DateHelper;
use Application\Services\ServiceContainer;
class User extends DBModel {
public function is_moderator_attribute() {
@ -11,6 +12,9 @@ class User extends DBModel {
public function is_admin_attribute() {
return ($this->role >= 100000);
}
public function status_attribute() {
return $this->is_deactivated ? 'Deleted' : ($this->logged_in ? 'Online' : 'Offline');
}
public function role_string_attribute() {
if($this->is_admin) {
return "Site Admin";
@ -19,6 +23,10 @@ class User extends DBModel {
}
return "User";
}
public function elapsed_login_attribute() {
return DateHelper::elapsedString($this->last_login);
}
public function post_count_attribute() {
$query = new QueryBuilder();
$query = $query->select("COUNT(id) AS count")->from("post")->where("user_id",$this->id)->build();
@ -39,9 +47,49 @@ class User extends DBModel {
}
public function isPardoned($thread_id) {
$where = new QueryBuilder();
$where = $where->where('user_id',$this->id)->where('thread_id',$thread_id)->where('action_type','silence')->where('expired_at','>',date('Y-m-d H:i:s'))->orderBy('expired_at','desc');
$where = $where->where('user_id',$this->id)->where('thread_id',$thread_id)->where('action_type','pardon')->where('expired_at','>',date('Y-m-d H:i:s'))->orderBy('expired_at','desc');
$actions = UserAction::select($where);
return (count($actions) > 0);
}
public function didIModerateThis($category_id) {
$query = new QueryBuilder();
$query = $query->where('category_id',$category_id)->where('user_id',$this->id);
$moderator = ModeratorCategory::select($query);
return count($moderator) > 0;
}
public function hearts_attribute() {
$query = new QueryBuilder();
$query = $query->where('user_id',$this->id);
$posts = Post::select($query);
$posts = array_map(function($a) {
return $a->id;
}, $posts);
$query = new QueryBuilder();
$query = $query->select("COUNT(user_id) AS count")->from("userfavorite")->whereIn("post_id",$posts);
$result = ServiceContainer::Database()->select($query->build());
return $result[0]["count"] ?? 0;
}
public function most_active() {
$categorization = [];
$thread_ids = [];
$query = new QueryBuilder();
$query = $query->select('category.id AS category, COUNT(post.id) AS posts')->from('post')->join("thread","thread.id = post.thread_id")->join("category","category.id = thread.category_id")->where('user_id',$this->id)->build();
$result = ServiceContainer::Database()->select($query);
usort($result, function($a, $b) {
return $a['posts'] < $b['posts'];
});
$category = Category::find($result[0]["category"]);
return $category;
}
public function recent_posts($limit) {
$query = new QueryBuilder();
$query = $query->where('user_id',$this->id)->orderBy('created_at','desc')->limit($limit);
return Post::select($query);
}
public function hasChangedNameRecently() {
$where = new QueryBuilder();
$where = $where->where('user_id',$this->id)->where('action_type','username')->where('best_before','>',date('Y-m-d H:i:s',strtotime(" - 30 days")))->orderBy('best_before','desc');
$actions = UserChange::select($where);
return (count($actions) > 0);
}
}

View File

@ -2,7 +2,16 @@
namespace Application\Models;
use Application\Foundations\Model as DBModel;
use Application\Foundations\DateHelper;
class UserAction extends DBModel {
public function duration_attribute() {
if($this->expired_at == "2099-12-31 23:59:00") {
return "an indefinite amount of time";
}
$then = strtotime($this->action_at);
$now = strtotime($this->expired_at);
$measure = DateHelper::durationString($then, $now);
return $measure;
}
}

View File

@ -2,7 +2,23 @@
namespace Application\Models;
use Application\Foundations\Model as DBModel;
use Application\Foundations\DateHelper;
class UserReport extends DBModel {
public function post_attribute() {
return Post::Find($this->post_id);
}
public function post() {
return Post::Find($this->post_id);
}
public function reported_attribute() {
return User::find($this->post()->user_id);
}
public function reporter_attribute() {
return User::find($this->user_id);
}
public function elapsed_attribute() {
return DateHelper::elapsedString($this->report_date);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,91 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
/**
* Jquery integration plugin.
*
* @class tinymce.core.JqueryIntegration
* @private
*/
!function(){var f,c,u,p,d,s=[];d="undefined"!=typeof global?global:window,p=d.jQuery;function v(){
// Reference to tinymce needs to be lazily evaluated since tinymce
// might be loaded through the compressor or other means
return d.tinymce}p.fn.tinymce=function(o){var e,t,i,l=this,r="";
// No match then just ignore the call
if(!l.length)return l;
// Get editor instance
if(!o)return v()?v().get(l[0].id):null;l.css("visibility","hidden");function n(){var a=[],c=0;
// Apply patches to the jQuery object, only once
u||(m(),u=!0),
// Create an editor instance for each matched node
l.each(function(e,t){var n,i=t.id,r=o.oninit;
// Generate unique id for target element if needed
i||(t.id=i=v().DOM.uniqueId()),
// Only init the editor once
v().get(i)||(
// Create editor instance and render it
n=v().createEditor(i,o),a.push(n),n.on("init",function(){var e,t=r;l.css("visibility",""),
// Run this if the oninit setting is defined
// this logic will fire the oninit callback ones each
// matched editor instance is initialized
r&&++c==a.length&&("string"==typeof t&&(e=-1===t.indexOf(".")?null:v().resolve(t.replace(/\.\w+$/,"")),t=v().resolve(t)),
// Call the oninit function with the object
t.apply(e||v(),a))}))}),
// Render the editor instances in a separate loop since we
// need to have the full editors array used in the onInit calls
p.each(a,function(e,t){t.render()})}
// Load TinyMCE on demand, if we need to
if(d.tinymce||c||!(e=o.script_url))
// Delay the init call until tinymce is loaded
1===c?s.push(n):n();else{c=1,t=e.substring(0,e.lastIndexOf("/")),
// Check if it's a dev/src version they want to load then
// make sure that all plugins, themes etc are loaded in source mode as well
-1!=e.indexOf(".min")&&(r=".min"),
// Setup tinyMCEPreInit object this will later be used by the TinyMCE
// core script to locate other resources like CSS files, dialogs etc
// You can also predefined a tinyMCEPreInit object and then it will use that instead
d.tinymce=d.tinyMCEPreInit||{base:t,suffix:r},
// url contains gzip then we assume it's a compressor
-1!=e.indexOf("gzip")&&(i=o.language||"en",e=e+(/\?/.test(e)?"&":"?")+"js=true&core=true&suffix="+escape(r)+"&themes="+escape(o.theme||"modern")+"&plugins="+escape(o.plugins||"")+"&languages="+(i||""),
// Check if compressor script is already loaded otherwise setup a basic one
d.tinyMCE_GZ||(d.tinyMCE_GZ={start:function(){function n(e){v().ScriptLoader.markDone(v().baseURI.toAbsolute(e))}
// Add core languages
n("langs/"+i+".js"),
// Add themes with languages
n("themes/"+o.theme+"/theme"+r+".js"),n("themes/"+o.theme+"/langs/"+i+".js"),
// Add plugins with languages
p.each(o.plugins.split(","),function(e,t){t&&(n("plugins/"+t+"/plugin"+r+".js"),n("plugins/"+t+"/langs/"+i+".js"))})},end:function(){}}));var a=document.createElement("script");a.type="text/javascript",a.onload=a.onreadystatechange=function(e){e=e||window.event,2===c||"load"!=e.type&&!/complete|loaded/.test(a.readyState)||(v().dom.Event.domLoaded=1,c=2,
// Execute callback after mainscript has been loaded and before the initialization occurs
o.script_loaded&&o.script_loaded(),n(),p.each(s,function(e,t){t()}))},a.src=e,document.body.appendChild(a)}return l},
// Add :tinymce pseudo selector this will select elements that has been converted into editor instances
// it's now possible to use things like $('*:tinymce') to get all TinyMCE bound elements.
p.extend(p.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in d&&(t=v().get(e.id))&&t.editorManager===v())}});
// This function patches internal jQuery functions so that if
// you for example remove an div element containing an editor it's
// automatically destroyed by the TinyMCE API
var m=function(){function r(e){
// If the function is remove
"remove"===e&&this.each(function(e,t){var n=u(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=v().get(t.id.replace(/_parent$/,""));n&&n.remove()})}function o(i){var e,t=this;
// Handle set value
/*jshint eqnull:true */if(null!=i)r.call(t),
// Saves the contents before get/set value of textarea/div
t.each(function(e,t){var n;(n=v().get(t.id))&&n.setContent(i)});else if(0<t.length&&(e=v().get(t[0].id)))return e.getContent()}function l(e){return!!(e&&e.length&&d.tinymce&&e.is(":tinymce"))}
// Removes any child editor instances by looking for editor wrapper elements
var u=function(e){var t=null;return e&&e.id&&d.tinymce&&(t=v().get(e.id)),t},s={};
// Loads or saves contents from/to textarea if the value
// argument is defined it will set the TinyMCE internal contents
// Patch some setter/getter functions these will
// now be able to set/get the contents of editor instances for
// example $('#editorid').html('Content'); will update the TinyMCE iframe instance
p.each(["text","html","val"],function(e,t){var a=s[t]=p.fn[t],c="text"===t;p.fn[t]=function(e){var t=this;if(!l(t))return a.apply(t,arguments);if(e!==f)return o.call(t.filter(":tinymce"),e),a.apply(t.not(":tinymce"),arguments),t;// return original set for chaining
var i="",r=arguments;return(c?t:t.eq(0)).each(function(e,t){var n=u(t);i+=n?c?n.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):n.getContent({save:!0}):a.apply(p(t),r)}),i}}),
// Makes it possible to use $('#id').append("content"); to append contents to the TinyMCE editor iframe
p.each(["append","prepend"],function(e,t){var n=s[t]=p.fn[t],r="prepend"===t;p.fn[t]=function(i){var e=this;return l(e)?i!==f?("string"==typeof i&&e.filter(":tinymce").each(function(e,t){var n=u(t);n&&n.setContent(r?i+n.getContent():n.getContent()+i)}),n.apply(e.not(":tinymce"),arguments),e):void 0:n.apply(e,arguments)}}),
// Makes sure that the editor instance gets properly destroyed when the parent element is removed
p.each(["remove","replaceWith","replaceAll","empty"],function(e,t){var n=s[t]=p.fn[t];p.fn[t]=function(){return r.call(this,t),n.apply(this,arguments)}}),s.attr=p.fn.attr,
// Makes sure that $('#tinymce_id').attr('value') gets the editors current HTML contents
p.fn.attr=function(e,t){var n=this,i=arguments;if(!e||"value"!==e||!l(n))return s.attr.apply(n,i);if(t!==f)return o.call(n.filter(":tinymce"),t),s.attr.apply(n.not(":tinymce"),i),n;// return original set for chaining
var r=n[0],a=u(r);return a?a.getContent({save:!0}):s.attr.apply(p(r),i)}}}();

View File

@ -0,0 +1,3 @@
This is where language files should be placed.
Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/

View File

@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";function n(){}function o(n){return function(){return n}}function t(){return d}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(n,t,e){var r="UL"===t?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===e?null:{"list-style-type":e})},i=function(e){e.addCommand("ApplyUnorderedListStyle",function(n,t){l(e,"UL",t["list-style-type"])}),e.addCommand("ApplyOrderedListStyle",function(n,t){l(e,"OL",t["list-style-type"])})},c=function(n){var t=n.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return t?t.split(/[ ,]/):[]},s=function(n){var t=n.getParam("advlist_bullet_styles","default,circle,square");return t?t.split(/[ ,]/):[]},f=o(!1),a=o(!0),d=(e={fold:function(n,t){return n()},is:f,isSome:f,isNone:a,getOr:m,getOrThunk:p,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:m,orThunk:p,map:t,each:n,bind:t,exists:f,forall:a,filter:t,equals:g,equals_:g,toArray:function(){return[]},toString:o("none()")},Object.freeze&&Object.freeze(e),e);function g(n){return n.isNone()}function p(n){return n()}function m(n){return n}function y(n,t,e){var r=function(n,t){for(var e=0;e<n.length;e++){if(t(n[e]))return e}return-1}(t.parents,L),i=-1!==r?t.parents.slice(0,r):t.parents,o=u.grep(i,N(n));return 0<o.length&&o[0].nodeName===e}function O(n,t,e,r,i,o){0<o.length?function(e,n,t,r,i,o){e.ui.registry.addSplitButton(n,{tooltip:t,icon:"OL"===i?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(n){n(u.map(o,function(n){return{type:"choiceitem",value:"default"===n?"":n,icon:"list-"+("OL"===i?"num":"bull")+"-"+("disc"===n||"decimal"===n?"default":n),text:function(n){return n.replace(/\-/g," ").replace(/\b\w/g,function(n){return n.toUpperCase()})}(n)}}))},onAction:function(){return e.execCommand(r)},onItemAction:function(n,t){l(e,i,t)},select:function(t){return S(e).map(function(n){return t===n}).getOr(!1)},onSetup:function(t){function n(n){t.setActive(y(e,n,i))}return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}}})}(n,t,e,r,i,o):function(e,n,t,r,i){e.ui.registry.addToggleButton(n,{active:!1,tooltip:t,icon:"OL"===i?"ordered-list":"unordered-list",onSetup:function(t){function n(n){t.setActive(y(e,n,i))}return e.on("NodeChange",n),function(){return e.off("NodeChange",n)}},onAction:function(){return e.execCommand(r)}})}(n,t,e,r,i)}var v=function(e){function n(){return i}function t(n){return n(e)}var r=o(e),i={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:a,isNone:f,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return v(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?i:d},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(f,function(n){return t(e,n)})}};return i},h=function(n){return null===n||n===undefined?d:v(n)},L=function(n){return n&&/^(TH|TD)$/.test(n.nodeName)},N=function(t){return function(n){return n&&/^(OL|UL|DL)$/.test(n.nodeName)&&function(n,t){return n.$.contains(n.getBody(),t)}(t,n)}},S=function(n){var t=n.dom.getParent(n.selection.getNode(),"ol,ul"),e=n.dom.getStyle(t,"listStyleType");return h(e)},T=function(n){O(n,"numlist","Numbered list","InsertOrderedList","OL",c(n)),O(n,"bullist","Bullet list","InsertUnorderedList","UL",s(n))};!function b(){r.add("advlist",function(n){var t,e,r;e="lists",r=(t=n).settings.plugins?t.settings.plugins:"",-1!==u.inArray(r.split(/[ ,]/),e)&&(T(n),i(n))})}()}();

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";function e(o){return function(t){for(var e=0;e<t.length;e++)(n=t[e]).attr("href")||!n.attr("id")&&!n.attr("name")||n.firstChild||t[e].attr("contenteditable",o);var n}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t){return/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(t)},o=function(t){var e=t.selection.getNode();return"A"===e.tagName&&""===t.dom.getAttrib(e,"href")?e.getAttribute("id")||e.getAttribute("name"):""},r=function(t,e){var n=t.selection.getNode();"A"===n.tagName&&""===t.dom.getAttrib(n,"href")?(n.removeAttribute("name"),n.id=e,t.undoManager.add()):(t.focus(),t.selection.collapse(!0),t.execCommand("mceInsertContent",!1,t.dom.createHTML("a",{id:e})))},a=function(e){var t=o(e);e.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:function(t){!function(t,e){return n(e)?(r(t,e),!1):(t.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),!0)}(e,t.getData().id)&&t.close()}})},i=function(t){t.addCommand("mceAnchor",function(){a(t)})},c=function(t){t.on("PreInit",function(){t.parser.addNodeFilter("a",e("false")),t.serializer.addNodeFilter("a",e(null))})},d=function(e){e.ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return e.execCommand("mceAnchor")},onSetup:function(t){return e.selection.selectorChangedWithUnbind("a:not([href])",t.setActive).unbind}}),e.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return e.execCommand("mceAnchor")}})};!function u(){t.add("anchor",function(t){c(t),i(t),d(t)})}()}();

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";function i(t,e){if(e<0&&(e=0),3===t.nodeType){var n=t.data.length;n<e&&(e=n)}return e}function C(t,e,n){1!==e.nodeType||e.hasChildNodes()?t.setStart(e,i(e,n)):t.setStartBefore(e)}function m(t,e,n){1!==e.nodeType||e.hasChildNodes()?t.setEnd(e,i(e,n)):t.setEndAfter(e)}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.Env"),y=function(t){return t.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i)},k=function(t){return t.getParam("default_link_target",!1)},r=function(t,e,n){var i,o,r,f,a,s,d,c,l,u,g=y(t),h=k(t);if("A"!==t.selection.getNode().tagName){if((i=t.selection.getRng(!0).cloneRange()).startOffset<5){if(!(c=i.endContainer.previousSibling)){if(!i.endContainer.firstChild||!i.endContainer.firstChild.nextSibling)return;c=i.endContainer.firstChild.nextSibling}if(l=c.length,C(i,c,l),m(i,c,l),i.endOffset<5)return;o=i.endOffset,f=c}else{if(3!==(f=i.endContainer).nodeType&&f.firstChild){for(;3!==f.nodeType&&f.firstChild;)f=f.firstChild;3===f.nodeType&&(C(i,f,0),m(i,f,f.nodeValue.length))}o=1===i.endOffset?2:i.endOffset-1-e}for(r=o;C(i,f,2<=o?o-2:0),m(i,f,1<=o?o-1:0),o-=1," "!==(u=i.toString())&&""!==u&&160!==u.charCodeAt(0)&&0<=o-2&&u!==n;);!function(t,e){return t===e||" "===t||160===t.charCodeAt(0)}(i.toString(),n)?(0===i.startOffset?C(i,f,0):C(i,f,o),m(i,f,r)):(C(i,f,o),m(i,f,r),o+=1),"."===(s=i.toString()).charAt(s.length-1)&&m(i,f,r-1),(d=(s=i.toString().trim()).match(g))&&("www."===d[1]?d[1]="http://www.":/@$/.test(d[1])&&!/^mailto:/.test(d[1])&&(d[1]="mailto:"+d[1]),a=t.selection.getBookmark(),t.selection.setRng(i),t.execCommand("createlink",!1,d[1]+d[2]),!1!==h&&t.dom.setAttrib(t.selection.getNode(),"target",h),t.selection.moveToBookmark(a),t.nodeChanged())}},e=function(e){var n;e.on("keydown",function(t){if(13===t.keyCode)return function(t){r(t,-1,"")}(e)}),o.browser.isIE()?e.on("focus",function(){if(!n){n=!0;try{e.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}}):(e.on("keypress",function(t){if(41===t.keyCode)return function(t){r(t,-1,"(")}(e)}),e.on("keyup",function(t){if(32===t.keyCode)return function(t){r(t,0,"")}(e)}))};!function n(){t.add("autolink",function(t){e(t)})}()}();

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";function d(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))}function h(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o}var i=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return i(t())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),p=function(e){return e.fire("ResizeEditor")},y=function(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")},z=function(e){return e.getParam("max_height",0,"number")},n=function(e){return e.getParam("autoresize_overflow_padding",1,"number")},b=function(e){return e.getParam("autoresize_bottom_margin",50,"number")},o=function(e){return e.getParam("autoresize_on_init",!0,"boolean")},u=function(e,t,n,i,o){r.setEditorTimeout(e,function(){C(e,t),n--?u(e,t,n,i,o):o&&o()},i)},C=function(e,t){var n,i,o,r=e.dom,u=e.getDoc();if(u)if(function(e){return e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()}(e))d(e,!0);else{var s=u.documentElement,a=b(e);i=y(e);var f=h(r,s,"margin-top",!0),c=h(r,s,"margin-bottom",!0);(o=s.offsetHeight+f+c+a)<0&&(o=0);var g=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;o+g>y(e)&&(i=o+g);var l=z(e);if(l&&l<i?(i=l,d(e,!0)):d(e,!1),i!==t.get()){if(n=i-t.get(),r.setStyle(e.getContainer(),"height",i+"px"),t.set(i),p(e),v.browser.isSafari()&&v.mac){var m=e.getWin();m.scrollTo(m.pageXOffset,m.pageYOffset)}e.hasFocus()&&e.selection.scrollIntoView(e.selection.getNode()),v.webkit&&n<0&&C(e,t)}}},s={setup:function(t,e){t.on("init",function(){var e=n(t);t.dom.setStyles(t.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})}),t.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",function(){C(t,e)}),o(t)&&t.on("init",function(){u(t,e,20,100,function(){u(t,e,5,1e3)})})},resize:C},a=function(e,t){e.addCommand("mceAutoResize",function(){s.resize(e,t)})};!function t(){e.add("autoresize",function(e){if(e.settings.hasOwnProperty("resize")||(e.settings.resize=!1),!e.inline){var t=i(0);a(e,t),s.setup(e,t)}})}()}();

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(n){"use strict";function r(t,e){var n=t||e,r=/^(\d+)([ms]?)$/.exec(""+n);return(r[2]?{s:1e3,m:6e4}[r[2]]:1)*parseInt(n,10)}function o(t){var e=t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-");return e=(e=(e=(e=e.replace(/\{path\}/g,n.document.location.pathname)).replace(/\{query\}/g,n.document.location.search)).replace(/\{hash\}/g,n.document.location.hash)).replace(/\{id\}/g,t.id)}function a(t,e){var n=t.settings.forced_root_block;return""===(e=d.trim(void 0===e?t.getBody().innerHTML:e))||new RegExp("^<"+n+"[^>]*>((\xa0|&nbsp;|[ \t]|<br[^>]*>)+?|)</"+n+">|<br>$","i").test(e)}function i(t){var e=parseInt(v.getItem(o(t)+"time"),10)||0;return!((new Date).getTime()-e>function(t){return r(t.settings.autosave_retention,"20m")}(t))||(g(t,!1),!1)}function u(t){var e=o(t);!a(t)&&t.isDirty()&&(v.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),v.setItem(e+"time",(new Date).getTime().toString()),function(t){t.fire("StoreDraft")}(t))}function s(t){var e=o(t);i(t)&&(t.setContent(v.getItem(e+"draft"),{format:"raw"}),function(t){t.fire("RestoreDraft")}(t))}function c(t,e){var n=function(t){return r(t.settings.autosave_interval,"30s")}(t);e.get()||(m.setInterval(function(){t.removed||u(t)},n),e.set(!0))}function f(t){t.undoManager.transact(function(){s(t),g(t)}),t.focus()}var l=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return l(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),m=tinymce.util.Tools.resolve("tinymce.util.Delay"),v=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=function(t,e){var n=o(t);v.removeItem(n+"draft"),v.removeItem(n+"time"),!1!==e&&function(t){t.fire("RemoveDraft")}(t)};function y(r){for(var o=[],t=1;t<arguments.length;t++)o[t-1]=arguments[t];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=o.concat(t);return r.apply(null,n)}}function p(n,t){return function(t){t.setDisabled(!i(n));function e(){return t.setDisabled(!i(n))}return n.on("StoreDraft RestoreDraft RemoveDraft",e),function(){return n.off("StoreDraft RestoreDraft RemoveDraft",e)}}}var D=tinymce.util.Tools.resolve("tinymce.EditorManager");!function e(){t.add("autosave",function(t){var e=l(!1);return function(t){t.editorManager.on("BeforeUnload",function(t){var e;d.each(D.get(),function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&function(t){return t.getParam("autosave_ask_before_unload",!0)}(t)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e&&(t.preventDefault(),t.returnValue=e)})}(t),function(t,e){c(t,e),t.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){f(t)},onSetup:p(t)}),t.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){f(t)},onSetup:p(t)})}(t,e),t.on("init",function(){(function(t){return t.getParam("autosave_restore_when_empty",!1)})(t)&&t.dom.isEmpty(t.getBody())&&s(t)}),function(t){return{hasDraft:y(i,t),storeDraft:y(u,t),restoreDraft:y(s,t),removeDraft:y(g,t),isEmpty:y(a,t)}}(t)})}()}(window);

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(t){t=e.trim(t);function o(o,e){t=t.replace(o,e)}return o(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),o(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),o(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),o(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),o(/<font>(.*?)<\/font>/gi,"$1"),o(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),o(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),o(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),o(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),o(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),o(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),o(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),o(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),o(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),o(/<\/(strong|b)>/gi,"[/b]"),o(/<(strong|b)>/gi,"[b]"),o(/<\/(em|i)>/gi,"[/i]"),o(/<(em|i)>/gi,"[i]"),o(/<\/u>/gi,"[/u]"),o(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),o(/<u>/gi,"[u]"),o(/<blockquote[^>]*>/gi,"[quote]"),o(/<\/blockquote>/gi,"[/quote]"),o(/<br \/>/gi,"\n"),o(/<br\/>/gi,"\n"),o(/<br>/gi,"\n"),o(/<p>/gi,""),o(/<\/p>/gi,"\n"),o(/&nbsp;|\u00a0/gi," "),o(/&quot;/gi,'"'),o(/&lt;/gi,"<"),o(/&gt;/gi,">"),o(/&amp;/gi,"&"),t},i=function(t){t=e.trim(t);function o(o,e){t=t.replace(o,e)}return o(/\n/gi,"<br />"),o(/\[b\]/gi,"<strong>"),o(/\[\/b\]/gi,"</strong>"),o(/\[i\]/gi,"<em>"),o(/\[\/i\]/gi,"</em>"),o(/\[u\]/gi,"<u>"),o(/\[\/u\]/gi,"</u>"),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),o(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),o(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),o(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;'),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;'),t};!function n(){o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=i(o.content)}),o.on("PostProcess",function(o){o.set&&(o.content=i(o.content)),o.get&&(o.content=t(o.content))})})}()}();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e,n){e.focus(),e.undoManager.transact(function(){e.setContent(n)}),e.selection.setCursorLocation(),e.nodeChanged()},o=function(e){return e.getContent({source_view:!0})},n=function(n){var e=o(n);n.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){t(n,e.getData().code),e.close()}})},c=function(e){e.addCommand("mceCodeEditor",function(){n(e)})},i=function(e){e.ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return n(e)}}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return n(e)}})};!function u(){e.add("code",function(e){return c(e),i(e),{}})}()}();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("colorpicker",function(){o.console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window);

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(n){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager");!function e(){o.add("contextmenu",function(){n.console.warn("Context menu plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window);

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(i){"use strict";function n(){}function u(n){return function(){return n}}function t(){return a}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=function(n,t){var e,r=n.dom,o=n.selection.getSelectedBlocks();o.length&&(e=r.getAttrib(o[0],"dir"),c.each(o,function(n){r.getParent(n.parentNode,'*[dir="'+t+'"]',r.getRoot())||r.setAttrib(n,"dir",e!==t?t:null)}),n.nodeChanged())},d=function(n){n.addCommand("mceDirectionLTR",function(){o(n,"ltr")}),n.addCommand("mceDirectionRTL",function(){o(n,"rtl")})},f=u(!1),l=u(!0),a=(e={fold:function(n,t){return n()},is:f,isSome:f,isNone:l,getOr:s,getOrThunk:N,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:s,orThunk:N,map:t,each:n,bind:t,exists:f,forall:l,filter:t,equals:m,equals_:m,toArray:function(){return[]},toString:u("none()")},Object.freeze&&Object.freeze(e),e);function m(n){return n.isNone()}function N(n){return n()}function s(n){return n}function g(n,t){var e=n.dom(),r=i.window.getComputedStyle(e).getPropertyValue(t),o=""!==r||function(n){var t=A(n)?n.dom().parentNode:n.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}(n)?r:w(e,t);return null===o?undefined:o}function T(t,r){return function(e){function n(n){var t=p.fromDom(n.element);e.setActive(function(n){return"rtl"===g(n,"direction")?"rtl":"ltr"}(t)===r)}return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}}var E,O,y=function(e){function n(){return o}function t(n){return n(e)}var r=u(e),o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:l,isNone:f,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return y(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?o:a},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(f,function(n){return t(e,n)})}};return o},D=function(n){return null===n||n===undefined?a:y(n)},h=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:u(n)}},p={fromHtml:function(n,t){var e=(t||i.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throw i.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return h(e.childNodes[0])},fromTag:function(n,t){var e=(t||i.document).createElement(n);return h(e)},fromText:function(n,t){var e=(t||i.document).createTextNode(n);return h(e)},fromDom:h,fromPoint:function(n,t,e){var r=n.dom();return D(r.elementFromPoint(t,e)).map(h)}},_=(E="function",function(n){return function(n){if(null===n)return"null";var t=typeof n;return"object"==t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t}(n)===E}),v=Array.prototype.slice,C=(_(Array.from)&&Array.from,i.Node.ATTRIBUTE_NODE,i.Node.CDATA_SECTION_NODE,i.Node.COMMENT_NODE,i.Node.DOCUMENT_NODE,i.Node.DOCUMENT_TYPE_NODE,i.Node.DOCUMENT_FRAGMENT_NODE,i.Node.ELEMENT_NODE,i.Node.TEXT_NODE),A=(i.Node.PROCESSING_INSTRUCTION_NODE,i.Node.ENTITY_REFERENCE_NODE,i.Node.ENTITY_NODE,i.Node.NOTATION_NODE,"undefined"!=typeof i.window?i.window:Function("return this;")(),O=C,function(n){return function(n){return n.dom().nodeType}(n)===O}),w=function(n,t){return function(n){return n.style!==undefined&&_(n.style.getPropertyValue)}(n)?n.style.getPropertyValue(t):""},S=function(n){n.ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return n.execCommand("mceDirectionLTR")},onSetup:T(n,"ltr")}),n.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return n.execCommand("mceDirectionRTL")},onSetup:T(n,"rtl")})};!function R(){r.add("directionality",function(n){d(n),S(n)})}()}(window);

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"<hr />")})},t=function(n){n.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}}),n.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}})};!function e(){n.add("hr",function(n){o(n),t(n)})}()}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";function t(){}function n(t){return function(){return t}}function e(){return h}var r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.EditorManager"),l=tinymce.util.Tools.resolve("tinymce.Env"),m=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(t){return t.getParam("importcss_merge_classes")},i=function(t){return t.getParam("importcss_exclusive")},p=function(t){return t.getParam("importcss_selector_converter")},g=function(t){return t.getParam("importcss_selector_filter")},y=function(t){return t.getParam("importcss_groups")},v=function(t){return t.getParam("importcss_append")},d=function(t){return t.getParam("importcss_file_filter")},u=n(!1),s=n(!0),h=(r={fold:function(t,n){return t()},is:u,isSome:u,isNone:s,getOr:O,getOrThunk:x,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:n(null),getOrUndefined:n(undefined),or:O,orThunk:x,map:e,each:t,bind:e,exists:u,forall:s,filter:e,equals:_,equals_:_,toArray:function(){return[]},toString:n("none()")},Object.freeze&&Object.freeze(r),r);function _(t){return t.isNone()}function x(t){return t()}function O(t){return t}function T(n){return function(t){return function(t){if(null===t)return"null";var n=typeof t;return"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n}(t)===n}}function b(t,n){return function(t){for(var n=[],e=0,r=t.length;e<r;++e){if(!w(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);M.apply(n,t[e])}return n}(function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var i=t[o];r[o]=n(i,o)}return r}(t,n))}function k(n){return"string"==typeof n?function(t){return-1!==t.indexOf(n)}:n instanceof RegExp?function(t){return n.test(t)}:n}function S(i,t,u){var c=[],e={};function s(t,n){var e,r=t.href;if((r=function(t){var n=l.cacheSuffix;return"string"==typeof t&&(t=t.replace("?"+n,"").replace("&"+n,"")),t}(r))&&u(r,n)&&!function(t,n){var e=t.settings,r=!1!==e.skin&&(e.skin||"oxide");if(r){var o=e.skin_url?t.documentBaseURI.toAbsolute(e.skin_url):f.baseURL+"/skins/ui/"+r,i=f.baseURL+"/skins/content/";return n===o+"/content"+(t.inline?".inline":"")+".min.css"||-1!==n.indexOf(i)}return!1}(i,r)){m.each(t.imports,function(t){s(t,!0)});try{e=t.cssRules||t.rules}catch(o){}m.each(e,function(t){t.styleSheet?s(t.styleSheet,!0):t.selectorText&&m.each(t.selectorText.split(","),function(t){c.push(m.trim(t))})})}}m.each(i.contentCSS,function(t){e[t]=!0}),u=u||function(t,n){return n||e[t]};try{m.each(t.styleSheets,function(t){s(t)})}catch(n){}return c}function A(t,n){var e,r=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(n);if(r){var o=r[1],i=r[2].substr(1).split(".").join(" "),u=m.makeMap("a,img");return r[1]?(e={title:n},t.schema.getTextBlockElements()[o]?e.block=o:t.schema.getBlockElements()[o]||u[o.toLowerCase()]?e.selector=o:e.inline=o):r[2]&&(e={inline:"span",title:n.substr(1),classes:i}),!1!==c(t)?e.classes=i:e.attributes={"class":i},e}}function P(t,n){return null===n||!1!==i(t)}var w=T("array"),E=T("function"),I=Array.prototype.slice,M=Array.prototype.push,j=(E(Array.from)&&Array.from,A),D=function(s){s.on("init",function(t){function r(t,n){if(function(t,n,e,r){return!(P(t,e)?n in r:n in e.selectors)}(s,t,n,i)){!function(t,n,e,r){P(t,e)?r[n]=!0:e.selectors[n]=!0}(s,t,n,i);var e=function(t,n,e,r){return(r&&r.selector_converter?r.selector_converter:p(t)?p(t):function(){return A(t,e)}).call(n,e,r)}(s,s.plugins.importcss,t,n);if(e){var r=e.name||a.DOM.uniqueId();return s.formatter.register(r,e),m.extend({},{title:e.title,format:r})}}return null}var o=function(){var n=[],e=[],r={};return{addItemToGroup:function(t,n){r[t]?r[t].push(n):(e.push(t),r[t]=[n])},addItem:function(t){n.push(t)},toFormats:function(){return b(e,function(t){var n=r[t];return 0===n.length?[]:[{title:t,items:n}]}).concat(n)}}}(),i={},u=k(g(s)),c=function(t){return m.map(t,function(t){return m.extend({},t,{original:t,selectors:{},filter:k(t.filter),item:{text:t.title,menu:[]}})})}(y(s));m.each(S(s,s.getDoc(),k(d(s))),function(e){if(-1===e.indexOf(".mce-")&&(!u||u(e))){var t=function(t,n){return m.grep(t,function(t){return!t.filter||t.filter(n)})}(c,e);if(0<t.length)m.each(t,function(t){var n=r(e,t);n&&o.addItemToGroup(t.title,n)});else{var n=r(e,null);n&&o.addItem(n)}}});var n=o.toFormats();s.fire("addStyleModifications",{items:n,replace:!v(s)})})},R=function(n){return{convertSelectorToFormat:function(t){return j(n,t)}}};!function U(){o.add("importcss",function(t){return D(t),R(t)})}()}();

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";function n(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))}function r(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])}function a(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}function i(e,t,n){return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",a(n.getMonth()+1,2))).replace("%d",a(n.getDate(),2))).replace("%H",""+a(n.getHours(),2))).replace("%M",""+a(n.getMinutes(),2))).replace("%S",""+a(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(f[n.getMonth()]))).replace("%b",""+e.translate(d[n.getMonth()]))).replace("%A",""+e.translate(s[n.getDay()]))).replace("%a",""+e.translate(l[n.getDay()]))).replace("%%","%")}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d"))},o=n,u=r,c=function(e){var t=r(e);return 0<t.length?t[0]:n(e)},m=function(e){return e.getParam("insertdatetime_element",!1)},l="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),s="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),d="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),f="January February March April May June July August September October November December".split(" "),p=function(e,t){if(m(e)){var n=i(e,t),r=void 0;r=/%[HMSIp]/.test(t)?i(e,"%Y-%m-%dT%H:%M"):i(e,"%Y-%m-%d");var a=e.dom.getParent(e.selection.getStart(),"time");a?function(e,t,n,r){var a=e.dom.create("time",{datetime:n},r);t.parentNode.insertBefore(a,t),e.dom.remove(t),e.selection.select(a,!0),e.selection.collapse(!1)}(e,a,r,n):e.insertContent('<time datetime="'+r+'">'+n+"</time>")}else e.insertContent(i(e,t))},g=i,y=function(e){e.addCommand("mceInsertDate",function(){p(e,t(e))}),e.addCommand("mceInsertTime",function(){p(e,o(e))})},M=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return S(t())}}},v=function(n){var t=u(n),r=S(c(n));n.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===r.get()},fetch:function(e){e(M.map(t,function(e){return{type:"choiceitem",text:g(n,e),value:e}}))},onAction:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];p(n,r.get())},onItemAction:function(e,t){r.set(t),p(n,t)}});n.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return M.map(t,function(e){return{type:"menuitem",text:g(n,e),onAction:function(e){return function(){r.set(e),p(n,e)}}(e)}})}})};!function h(){e.add("insertdatetime",function(e){y(e),v(e)})}()}();

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(e){return e.getParam("font_formats")},i=function(e){return e.getParam("fontsize_formats")},n=function(e,t){e.settings.fontsize_formats=t},l=function(e,t){e.settings.font_formats=t},s=function(e){return e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")},o=function(e,t){e.settings.inline_styles=t},r=function(e){!function(e){o(e,!1),i(e)||n(e,"8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t(e)||l(e,"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats")}(e),e.on("init",function(){return function(e){var t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=a.explode(s(e)),n=e.schema;e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return a.inArray(i,e.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),a.each("b,i,u,strike".split(","),function(e){n.addValidElements(e+"[*]")}),n.getElementRule("font")||n.addValidElements("font[face|size|color|style]"),a.each(t.split(","),function(e){var t=n.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})}(e)})};!function c(){e.add("legacyoutput",function(e){r(e)})}()}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";function o(n,e){for(var t="",o=0;o<e;o++)t+=n;return t}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n){var e=n.getParam("nonbreaking_force_tab",0);return"boolean"==typeof e?!0===e?3:0:e},a=function(n){return n.getParam("nonbreaking_wrap",!0,"boolean")},r=function(n,e){var t=a(n)||n.plugins.visualchars?'<span class="'+(function(n){return!!n.plugins.visualchars&&n.plugins.visualchars.isEnabled()}(n)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap")+'" contenteditable="false">'+o("&nbsp;",e)+"</span>":o("&nbsp;",e);n.undoManager.transact(function(){return n.insertContent(t)})},e=function(n){n.addCommand("mceNonBreaking",function(){r(n,1)})},c=tinymce.util.Tools.resolve("tinymce.util.VK"),t=function(e){var t=i(e);0<t&&e.on("keydown",function(n){if(n.keyCode===c.TAB&&!n.isDefaultPrevented()){if(n.shiftKey)return;n.preventDefault(),n.stopImmediatePropagation(),r(e,t)}})},u=function(n){n.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:function(){return n.execCommand("mceNonBreaking")}}),n.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:function(){return n.execCommand("mceNonBreaking")}})};!function s(){n.add("nonbreaking",function(n){e(n),u(n),t(n)})}()}();

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";function c(n){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(n)}}function l(i,o,c){return function(t){var n=arguments,e=n[n.length-2],r=0<e?o.charAt(e-1):"";if('"'===r)return t;if(">"===r){var a=o.lastIndexOf("<",e);if(-1!==a)if(-1!==o.substring(a,e).indexOf('contenteditable="false"'))return t}return'<span class="'+c+'" data-mce-content="'+i.dom.encode(n[0])+'">'+i.dom.encode("string"==typeof n[1]?n[1]:n[0])+"</span>"}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},s=function(t){return t.getParam("noneditable_editable_class","mceEditable")},d=function(t){var n=t.getParam("noneditable_regexp",[]);return n&&n.constructor===RegExp?[n]:n},n=function(n){var t,e,r="contenteditable";t=" "+u.trim(s(n))+" ",e=" "+u.trim(f(n))+" ";var a=c(t),i=c(e),o=d(n);n.on("PreInit",function(){0<o.length&&n.on("BeforeSetContent",function(t){!function(t,n,e){var r=n.length,a=e.content;if("raw"!==e.format){for(;r--;)a=a.replace(n[r],l(t,a,f(t)));e.content=a}}(n,o,t)}),n.parser.addAttributeFilter("class",function(t){for(var n,e=t.length;e--;)n=t[e],a(n)?n.attr(r,"true"):i(n)&&n.attr(r,"false")}),n.serializer.addAttributeFilter(r,function(t){for(var n,e=t.length;e--;)n=t[e],(a(n)||i(n))&&(0<o.length&&n.attr("data-mce-content")?(n.name="#text",n.type=3,n.raw=!0,n.value=n.attr("data-mce-content")):n.attr(r,null))})})};!function e(){t.add("noneditable",function(t){n(t)})}()}();

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";function e(){return"mce-pagebreak"}function a(){return'<img src="'+t.transparentSrc+'" class="mce-pagebreak" data-mce-resize="false" data-mce-placeholder />'}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),r=function(e){return e.getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e")},i=function(e){return e.getParam("pagebreak_split_block",!1)},o=function(o){var c=r(o),n=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi");o.on("BeforeSetContent",function(e){e.content=e.content.replace(n,a())}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var n,a,t=e.length;t--;)if((a=(n=e[t]).attr("class"))&&-1!==a.indexOf("mce-pagebreak")){var r=n.parent;if(o.schema.getBlockElements()[r.name]&&i(o)){r.type=3,r.value=c,r.raw=!0,n.remove();continue}n.type=3,n.value=c,n.raw=!0}})})},c=a,u=e,g=function(e){e.addCommand("mcePageBreak",function(){e.settings.pagebreak_split_block?e.insertContent("<p>"+c()+"</p>"):e.insertContent(c())})},m=function(n){n.on("ResolveName",function(e){"IMG"===e.target.nodeName&&n.dom.hasClass(e.target,u())&&(e.name="pagebreak")})},s=function(e){e.ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:function(){return e.execCommand("mcePageBreak")}}),e.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:function(){return e.execCommand("mcePageBreak")}})};!function l(){n.add("pagebreak",function(e){g(e),s(e),o(e),m(e)})}()}();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),m=function(e){return e.getParam("content_style","")},u=function(e){return e.getParam("content_css_cors",!1,"boolean")},y=tinymce.util.Tools.resolve("tinymce.Env"),n=function(t){var n="",i=t.dom.encode,e=m(t);n+='<base href="'+i(t.documentBaseURI.getURI())+'">',e&&(n+='<style type="text/css">'+e+"</style>");var o=u(t)?' crossorigin="anonymous"':"";l.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+i(t.documentBaseURI.toAbsolute(e))+'"'+o+">"});var r=t.settings.body_id||"tinymce";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_id","","hash"))[t.id]||r);var a=t.settings.body_class||"";-1!==a.indexOf("=")&&(a=(a=t.getParam("body_class","","hash"))[t.id]||"");var c='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(y.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",s=t.getBody().dir,d=s?' dir="'+i(s)+'"':"";return"<!DOCTYPE html><html><head>"+n+'</head><body id="'+i(r)+'" class="mce-content-body '+i(a)+'"'+d+">"+t.getContent()+c+"</body></html>"},t=function(e){e.addCommand("mcePreview",function(){!function(e){var t=n(e);e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:t}}).focus("close")}(e)})},i=function(e){e.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:function(){return e.execCommand("mcePreview")}}),e.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:function(){return e.execCommand("mcePreview")}})};!function o(){e.add("preview",function(e){t(e),i(e)})}()}();

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),i=function(n){n.addCommand("mcePrint",function(){t.browser.isIE()?n.getDoc().execCommand("print",!1,null):n.getWin().print()})},e=function(n){n.ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:function(){return n.execCommand("mcePrint")}}),n.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:function(){return n.execCommand("mcePrint")}})};!function o(){n.add("print",function(n){i(n),e(n),n.addShortcut("Meta+P","","mcePrint")})}()}();

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";function t(n,e){n.notificationManager.open({text:e,type:"error"})}function e(t){return function(n){function e(){n.setDisabled(a(t)&&!t.isDirty())}return t.on("NodeChange dirty",e),function(){return t.off("NodeChange dirty",e)}}}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(n){return n.getParam("save_enablewhendirty",!0)},c=function(n){return!!n.getParam("save_onsavecallback")},r=function(n){return!!n.getParam("save_oncancelcallback")},u=function(n){var e;if(e=o.DOM.getParent(n.id,"form"),!a(n)||n.isDirty()){if(n.save(),c(n))return n.execCallback("save_onsavecallback",n),void n.nodeChanged();e?(n.setDirty(!1),e.onsubmit&&!e.onsubmit()||("function"==typeof e.submit?e.submit():t(n,"Error: Form submit field collision.")),n.nodeChanged()):t(n,"Error: No form element found.")}},l=function(n){var e=i.trim(n.startContent);r(n)?n.execCallback("save_oncancelcallback",n):n.resetContent(e)},s=function(n){n.addCommand("mceSave",function(){u(n)}),n.addCommand("mceCancel",function(){l(n)})},d=function(n){n.ui.registry.addButton("save",{icon:"save",tooltip:"Save",disabled:!0,onAction:function(){return n.execCommand("mceSave")},onSetup:e(n)}),n.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",disabled:!0,onAction:function(){return n.execCommand("mceCancel")},onSetup:e(n)}),n.addShortcut("Meta+S","","mceSave")};!function m(){n.add("save",function(n){d(n),s(n)})}()}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(c){"use strict";function t(e){e.keyCode!==d.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.VK"),m=function(e){return e.getParam("tab_focus",function(e){return e.getParam("tabfocus_elements",":prev,:next")}(e))},v=n.DOM,i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==d.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=f.explode(m(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):v.get(e[0]):":next"===e[1]?u(1):v.get(e[1]))){var t=s.get(o.id||o.name);o.id&&t?t.focus():y.setTimeout(function(){a.webkit||c.window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&s.get(n.id)&&-1!==e.tabIndex&&function t(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&t(e.parentNode)}(e)}if(o=v.select(":input:enabled,*[tabindex]:not(iframe)"),f.each(o,function(e,t){if(e.id===r.id)return i=t,!1}),0<e){for(l=i+1;l<o.length;l++)if(t(o[l]))return o[l]}else for(l=i-1;0<=l;l--)if(t(o[l]))return o[l];return null}}r.on("init",function(){r.inline&&v.setAttrib(r.getBody(),"tabIndex",null),r.on("keyup",t),a.gecko?r.on("keypress keydown",e):r.on("keydown",e)})};!function o(){e.add("tabfocus",function(e){i(e)})}()}(window);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("textcolor",function(){o.console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window);

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";function e(n){return function(t){function e(){return t.setDisabled(n.readonly||!v.hasHeaders(n))}return e(),n.on("LoadContent SetContent change",e),function(){return n.on("LoadContent SetContent change",e)}}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),l=tinymce.util.Tools.resolve("tinymce.util.I18n"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(t){return t.getParam("toc_class","mce-toc")},d=function(t){var e=t.getParam("toc_header","h2");return/^h[1-6]$/.test(e)?e:"h2"},a=function(t){var e=parseInt(t.getParam("toc_depth","3"),10);return 1<=e&&e<=9?e:3},s=function(e){var n=0;return function(){var t=(new Date).getTime().toString(32);return e+t+(n++).toString(32)}}("mcetoc_"),f=function f(t){var e,n=[];for(e=1;e<=t;e++)n.push("h"+e);return n.join(",")},m=function(n){var o=c(n),t=d(n),e=f(a(n)),r=n.$(e);return r.length&&/^h[1-9]$/i.test(t)&&(r=r.filter(function(t,e){return!n.dom.hasClass(e.parentNode,o)})),i.map(r,function(t){return{id:t.id?t.id:s(),level:parseInt(t.nodeName.replace(/^H/i,""),10),title:n.$.text(t),element:t}})},o=function(t){var e,n,o,r,i="",c=m(t),a=function(t){var e,n=9;for(e=0;e<t.length;e++)if(t[e].level<n&&(n=t[e].level),1===n)return n;return n}(c)-1;if(!c.length)return"";for(i+=function(t,e){var n="</"+t+">";return"<"+t+' contenteditable="true">'+u.DOM.encode(e)+n}(d(t),l.translate("Table of Contents")),e=0;e<c.length;e++){if((o=c[e]).element.id=o.id,r=c[e+1]&&c[e+1].level,a===o.level)i+="<li>";else for(n=a;n<o.level;n++)i+="<ul><li>";if(i+='<a href="#'+o.id+'">'+o.title+"</a>",r!==o.level&&r)for(n=o.level;r<n;n--)i+="</li></ul><li>";else i+="</li>",r||(i+="</ul>");a=o.level}return i},r=function(t){var e=c(t),n=t.$("."+e);n.length&&t.undoManager.transact(function(){n.html(o(t))})},v={hasHeaders:function(t){return 0<m(t).length},insertToc:function(t){var e=c(t),n=t.$("."+e);!function(t,e){return!e.length||0<t.dom.getParents(e[0],".mce-offscreen-selection").length}(t,n)?r(t):t.insertContent(function(t){var e=o(t);return'<div class="'+t.dom.encode(c(t))+'" contenteditable="false">'+e+"</div>"}(t))},updateToc:r},n=function(t){t.addCommand("mceInsertToc",function(){v.insertToc(t)}),t.addCommand("mceUpdateToc",function(){v.updateToc(t)})},g=function(t){var n=t.$,o=c(t);t.on("PreProcess",function(t){var e=n("."+o,t.node);e.length&&(e.removeAttr("contentEditable"),e.find("[contenteditable]").removeAttr("contentEditable"))}),t.on("SetContent",function(){var t=n("."+o);t.length&&(t.attr("contentEditable",!1),t.children(":first-child").attr("contentEditable",!0))})},h=function(t){t.ui.registry.addButton("toc",{icon:"toc",tooltip:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:e(t)}),t.ui.registry.addButton("tocupdate",{icon:"reload",tooltip:"Update",onAction:function(){return t.execCommand("mceUpdateToc")}}),t.ui.registry.addMenuItem("toc",{icon:"toc",text:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:e(t)}),t.ui.registry.addContextToolbar("toc",{items:"tocupdate",predicate:function(e){return function(t){return t&&e.dom.is(t,"."+c(e))&&e.getBody().contains(t)}}(t),scope:"node",position:"node"})};!function p(){t.add("toc",function(t){n(t),h(t),g(t)})}()}();

View File

@ -0,0 +1,9 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
* Version: 5.1.2 (2019-11-19)
*/
!function(){"use strict";function n(n,e){return function(o){o.setActive(e.get());function t(t){return o.setActive(t.state)}return n.on("VisualBlocks",t),function(){return n.off("VisualBlocks",t)}}}var e=function(t){function o(){return n}var n=t;return{get:o,set:function(t){n=t},clone:function(){return e(o())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t,o){t.fire("VisualBlocks",{state:o})},u=function(t,o,n){t.dom.toggleClass(t.getBody(),"mce-visualblocks"),n.set(!n.get()),i(t,n.get())},c=function(t,o,n){t.addCommand("mceVisualBlocks",function(){u(t,o,n)})},s=function(t){return t.getParam("visualblocks_default_state",!1,"boolean")},l=function(o,t,n){o.on("PreviewFormats AfterPreviewFormats",function(t){n.get()&&o.dom.toggleClass(o.getBody(),"mce-visualblocks","afterpreviewformats"===t.type)}),o.on("init",function(){s(o)&&u(o,t,n)}),o.on("remove",function(){o.dom.removeClass(o.getBody(),"mce-visualblocks")})},r=function(t,o){t.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:function(){return t.execCommand("mceVisualBlocks")},onSetup:n(t,o)}),t.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",onAction:function(){return t.execCommand("mceVisualBlocks")},onSetup:n(t,o)})};!function o(){t.add("visualblocks",function(t,o){var n=e(!1);c(t,o,n),r(t,n),l(t,o,n)})}()}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
body{background-color:#2f3742;color:#dfe0e4;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table td,table th{border:1px solid #6d737b;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}td[data-mce-selected],th[data-mce-selected]{color:#333}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem}

View File

@ -0,0 +1,7 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}

View File

@ -0,0 +1,7 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
@media screen{html{background:#f4f4f4}}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}@media screen{body{background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.15);box-sizing:border-box;margin:1rem auto 0;max-width:820px;min-height:calc(100vh - 1rem);padding:4rem 6rem 6rem 6rem}}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure figcaption{color:#999;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}

View File

@ -0,0 +1,7 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem auto;max-width:900px}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{background-color:green;display:inline-block;opacity:.5;position:absolute}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}body{font-family:sans-serif}table{border-collapse:collapse}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{background-color:green;display:inline-block;opacity:.5;position:absolute}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}body{font-family:sans-serif}table{border-collapse:collapse}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 438 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 KiB

View File

@ -1,13 +1,19 @@
<?php if (!$auth->isLoggedIn()) { ?>
<p class="">You need to be logged in to post. <a href="/login">Login</a></p>
<?php } else if($auth->user()->isBanned($category)) {?>
<?php } else if(!isset($report) && $auth->user()->isBanned($thread_post->category_id ?? $category->id)) {?>
<p class="">You have been banned from this category.</p>
<?php } else if($auth->user()->isSilenced($category)) {?>
<?php } else if(!isset($report) && $auth->user()->isSilenced($thread_post->category_id ?? $category->id)) {?>
<p class="">You have been silenced from this category. You cannot post new replies or threads at this moment.</p>
<?php } else if($auth->user()->isPardoned($thread)) {?>
<?php } else if(!isset($report) && isset($thread) && $auth->user()->isPardoned($thread->id)) {?>
<p class="">You have been pardoned from this thread. You cannot post new replies at this moment.</p>
<?php } else if(isset($edit_post) && (time() - strtotime($edit_post->created_at)) > 300) {?>
<?php } else if(isset($edit) && (time() - strtotime($edit->created_at)) > 300) {?>
<p class="">You cannot edit this post.</p>
<?php } else if(isset($delete) && (time() - strtotime($delete->created_at)) > 300) {?>
<p class="">You cannot delete this post.</p>
<?php } else if(isset($category) && $auth->user()->is_confirmed == 0 ) { ?>
<p class="">Please confirm your email address to create threads</p>
<?php } else if(isset($thread) && $thread->isLocked() ) { ?>
This thread has been locked.
<?php } else { ?>
<div id="editor-comp">
<div class="forum-post" id="forum-editor">
@ -19,49 +25,58 @@
<div class="forum-post-content">
<div class="forum-post-user">
<a href="/profile?id=<?php echo $auth->user()->id ?>">
<div class="flex flex-col justify-center items-center">
<img src="/noava.jpg">
<div class="forum-post-user-detail items-center">
<img src="/<?php echo $auth->user()->avatar_path != "" ? $auth->user()->avatar_path : "noava.jpg" ?>">
<p><?php echo $auth->user()->username ?></p>
</div>
</a>
<div class="flex flex-col justify-center items-center">
<p><?php echo $auth->user()->logged_in ? 'Online' : 'Offline' ?></p>
<div class="forum-post-user-detail items-center">
<p><?php echo $auth->user()->status ?></p>
</div>
<div class="flex flex-col justify-center items-start">
<div class="forum-post-user-detail items-start">
<p><?php echo $auth->user()->role_string ?></p>
</div>
<div class="flex flex-col justify-center items-start">
<div class="forum-post-user-detail items-start">
<p><?php echo $auth->user()->post_count ?> posts</p>
</div>
<div class="flex flex-col justify-center items-start">
<p><?php echo $auth->user()->last_login ?></p>
<div class="forum-post-user-detail items-start">
<p><?php echo $auth->user()->elapsed_login ?></p>
</div>
<div class="flex flex-col justify-center items-start">
<?php if($auth->user()->isBanned($category)) { ?>
<div class="forum-post-user-detail items-start">
<?php if($auth->user()->isBanned($category->id ?? 0)) { ?>
<p>Banned</p>
<?php } else if($auth->user()->isSilenced($category)) { ?>
<?php } else if($auth->user()->isSilenced($category->id ?? 0)) { ?>
<p>Silenced</p>
<?php } else {?>
<p>Active</p>
<?php } ?>
</div>
</div>
<div class="forum-post-text w-full h-full">
<form method="POST" action="/thread/process">
<input type="hidden" name="category" value="<?php echo $category ?>">
<input type="hidden" name="thread" value="<?php echo $thread ?>">
<input type="hidden" name="reply" value="<?php echo $reply ?>">
<input type="hidden" name="edit" value="<?php echo $edit ?>">
<textarea id="editor-text" class="w-full h-full" name="content"></textarea>
<div class="forum-post-text">
<form method="POST" action="/thread/process" id="editor-poster">
<input type="hidden" name="category" value="<?php echo $category->id ?? "" ?>">
<input type="hidden" name="thread" value="<?php echo $thread->id ?? "" ?>">
<input type="hidden" name="reply" value="<?php echo $reply->id ?? "" ?>">
<input type="hidden" name="edit" value="<?php echo $edit->id ?? ""?>">
<input type="hidden" name="delete" value="<?php echo $delete->id ?? ""?>">
<input type="hidden" name="report" value="<?php echo $report->id ?? ""?>">
<?php if(isset($category)) { ?>
<input type="text" name="title" placeholder="title">
<?php } ?>
<?php if(!isset($delete)) { ?>
<textarea id="<?php echo isset($report) ? "report-" : "" ?>editor-text" class="w-full h-full" name="content"><?php echo isset($edit) ? $edit->post : "" ; ?></textarea>
<?php } ?>
</form>
</div>
</div>
<div class="forum-post-footer">
<div class="forum-post-favorite">
<a class="cursor-pointer" @click="cancel()">Cancel</a>
<div class="forum-post-footer-left">
<a class="forum-post-footer-action" @click="cancel()">Cancel</a>
</div>
<div class="forum-post-actions">
<a class="cursor-pointer" @click="post()">Post</a>
<div class="forum-post-footer-mid">
</div>
<div class="forum-post-footer-right">
<a class="forum-post-footer-action" @click="post()">Confirm</a>
</div>
</div>
</div>
@ -71,15 +86,26 @@ var editorapp = new Vue({
el: "#editor-comp",
methods: {
cancel() {
confirm("Are you sure?");
if(confirm) {
var sure = confirm("Are you sure?");
if(sure) {
$("#editor").html("");
}
},
post() {
$("#editor-poster").submit();
}
}
});
</script>
<script src="/js/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
<script>tinymce.init({
selector:'#editor-text',
menubar: false,
height: "100%",
branding: false,
plugins: "lists",
toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | fontsizeselect",
});
</script>
<?php } ?>

View File

@ -1,39 +1,40 @@
<?php
$view->include('layouts/head');
?>
<h1 class="text-4xl py-4">Welcome to metaforums!</h1>
<div id="forumbrowser">
<div class="flex flex-col w-1/6">
<div :id="'group-'+group.id":class="'forumbrowser-group'+(current_group == group.id ? ' selected' : '')" v-for="(group, key) in groups" @click="current_group = group.id;">
<div class="forumbrowser-left">
<div :id="'group-'+group.id":class="'forumbrowser-item'+(current_group == group.id ? ' selected' : '')" v-for="(group, key) in groups" @click="change_group(group.id)">
{{ group.group_name }}
</div>
</div>
<div class="flex flex-col w-1/6">
<div :id="'category-'+category.id":class="'forumbrowser-category'+(current_category == category.id ? ' selected' : '')" v-for="(category, key) in categories" @click="current_category = category.id;">
<div class="forumbrowser-left">
<div :id="'category-'+category.id":class="'forumbrowser-item'+(current_category == category.id ? ' selected' : '')" v-for="(category, key) in categories" @click="change_category(category.id)">
{{ category.category_name }}
</div>
</div>
<div class="forumbrowser-thread-table w-4/6">
<div v-if="current_category > 0" id="thread-create" class="forumbrowser-thread" @click="new_thread(current_category)">
<div class="forumbrowser-thread-col"></div>
<div class="forumbrowser-thread-col">Create New Thread</div>
<div class="forumbrowser-thread-col"></div>
<div class="forumbrowser-thread-col"></div>
<div class="forumbrowser-thread-col"></div>
<div class="forumbrowser-right-table mx-4">
<div v-if="current_category > 0" id="thread-create" class="forumbrowser-right" @click="new_thread(current_category)">
<div class="forumbrowser-right-col"></div>
<div class="forumbrowser-right-col flex-grow">Create New Thread</div>
<div class="forumbrowser-right-col"></div>
<div class="forumbrowser-right-col"></div>
<div class="forumbrowser-right-col"></div>
</div>
<div :id="'thread-'+thread.id":class="'forumbrowser-thread'+(current_thread == thread.id ? ' selected' : '')" v-for="(thread, key) in threads" @click="current_thread = thread.id;">
<div class="forumbrowser-thread-col">
<div :id="'thread-'+thread.id":class="'forumbrowser-right'+(current_thread == thread.id ? ' selected' : '')" v-for="(thread, key) in threads" @click="change_thread(thread.id)">
<div class="forumbrowser-right-col">
<p v-if="thread.is_hot">[HOT]</p>
</div>
<div class="forumbrowser-thread-col">
<div class="forumbrowser-right-col flex-grow">
{{ thread.title }}
</div>
<div class="forumbrowser-thread-col">
<div class="forumbrowser-right-col">
by {{ thread.author_model.username }}
</div>
<div class="forumbrowser-thread-col">
<div class="forumbrowser-right-col">
View: {{ thread.view_count }} Post count: {{ thread.post_count }}
</div>
<div class="forumbrowser-thread-col">
<div class="forumbrowser-right-col">
{{ thread.last_reply }}
</div>
</div>
@ -59,25 +60,46 @@ var selectapp = new Vue({
},
methods: {
change_category(id) {
this.current_category = id;
this.threads = [];
this.current_thread = 0;
$("#threadreader").html("");
$("#editor").html("");
window.history.pushState('category-'+id,'','<?php echo $root; ?>/?category='+id+window.location.hash);
$.ajax("<?php echo $root; ?>/api/get_threads?id="+id)
.done(function(data) {
this.threads = data;
}.bind(this));
},
change_group(id) {
this.current_group = id;
this.categories = [];
this.current_category = 0;
this.threads = [];
this.current_thread = 0;
$("#threadreader").html("");
$("#editor").html("");
window.history.pushState('group-'+id,'','<?php echo $root; ?>/?group='+id+window.location.hash);
$.ajax("<?php echo $root; ?>/api/get_categories?id="+id)
.done(function(data) {
this.categories = data;
}.bind(this));
},
change_thread(id) {
if(this.current_thread != 0 && this.current_thread != id) {
window.location.hash = "#";
} else if(this.current_thread == id) return;
this.current_thread = id;
$("#editor").html("");
window.history.pushState('thread-'+id,'','<?php echo $root; ?>/?thread='+id+window.location.hash);
$.ajax("<?php echo $root; ?>/thread?id="+id)
.done(function(data) {
$("#threadreader").html(data);
$("#editor").html("");
window.location.hash = window.location.hash;
}.bind(this));
},
new_thread(id) {
this.current_thread = 0;
$.ajax("<?php echo $root; ?>/thread/editor?category="+id)
.done(function(data) {
$("#threadreader").html("");
@ -85,18 +107,21 @@ var selectapp = new Vue({
}.bind(this));
},
},
updated: function() {
if(this.current_thread > 0) {
this.change_thread(this.current_thread);
mounted: function() {
<?php
if(isset($group)) {
echo "this.change_group(".$group->id.")\n";
}
if(this.current_category > 0) {
this.change_category(this.current_category);
if(isset($category)) {
echo "this.change_category(".$category->id.")\n";
}
if(this.current_group > 0) {
this.change_group(this.current_group);
if(isset($thread)) {
echo "this.change_thread(".$thread->id.")\n";
}
?>
}
},
});
</script>
<?php
$view->include('layouts/foot');

View File

@ -1,26 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<link href="/css/metaforums.css" rel="stylesheet">
<script src="/js/vue.js"></script>
<script src="/js/jquery.min.js"></script>
<script src="<?php echo $root ?>/js/vue.js"></script>
<script src="<?php echo $root ?>/js/jquery.min.js"></script>
<title>Metaforums</title>
<link href="<?php echo $root ?>/css/metaforums.css" rel="stylesheet">
</head>
<body>
<header>
<div class="header-left">
<a href="/" class="header-link">Metaforums</a>
<a href="<?php echo $root ?>/" class="header-link">Metaforums</a>
</div>
<div class="header-middle">
</div>
<div class="header-left">
<?php if($auth->isModerator()) { ?>
<a href="/moderation" class="header-link">User Management</a>
<?php } ?>
<?php if($auth->isLoggedIn()) { ?>
<a href="/logout" class="header-link">Logout</a>
<?php if($auth->user()->is_moderator) { ?>
<a href="<?php echo $root ?>/moderation" class="header-link">User Management</a>
<?php } ?>
<a href="<?php echo $root ?>/logout" class="header-link">Logout</a>
<?php } else {?>
<a href="/login" class="header-link">Login</a>
<a href="/signup" class="header-link">Signup</a>
<a href="<?php echo $root ?>/login" class="header-link">Login</a>
<a href="<?php echo $root ?>/signup" class="header-link">Signup</a>
<?php } ?>
</div>
</header>

43
Application/Views/me.php Normal file
View File

@ -0,0 +1,43 @@
<?php
$view->include('layouts/head');
?>
<h1 class="text-4xl">Account Management</h1>
<div id="me">
<form method="POST" action="/me/update" enctype="multipart/form-data">
<div class="input-group">
<label for="DisplayName">Display Name</label>
<input id="DisplayName" type="text" name="username" value="<?php echo $user->username ?>" <?php echo $user->hasChangedNameRecently() ? "disabled" : "" ?>>
</div>
<div class="input-group">
<label for="About">About</label>
<textarea id="About" name="about" v-model="about" id="about"><?php echo $user->about ?></textarea>
</div>
<div class="input-group">
<input type="checkbox" name="email_visible" v-model="email_visible" value="<?php echo $user->email_visible ? "on" : "" ?>">
<label for="">Display Email on Profile</label>
</div>
<div class="input-group">
<p>Current avatar:</p>
<img class="w-64 object-contain" src="/<?php echo $auth->user()->avatar_path != "" ? $auth->user()->avatar_path : "noava.jpg" ?>">
</div>
<div class="input-group">
<label for="Avatar">Avatar</label>
<input type="file" name="avatar" id="Avatar">
</div>
<div class="input-group">
<button type="submit">Save</button>
</div>
</form>
</div>
<script src="/js/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
<script>tinymce.init({
selector:'#about',
menubar: false,
});
</script>
<?php
$view->include('layouts/foot');
?>

View File

@ -0,0 +1,67 @@
<div id="editor-comp">
<form method="POST" action="/thread/moderate" id="editor-poster">
<div class="forum-post" id="forum-editor">
<div class="forum-post-title">
<p class="text-lg flex-grow">
<?php echo $title ?>
</p>
</div>
<div class="forum-post-content">
<div class="forum-post-user">
<a href="/profile?id=<?php echo $auth->user()->id ?>">
<div class="forum-post-user-detail items-center">
<img src="/<?php echo $auth->user()->avatar_path != "" ? $auth->user()->avatar_path : "noava.jpg" ?>">
<p><?php echo $auth->user()->username ?></p>
</div>
</a>
</div>
<div class="forum-post-text">
<input type="hidden" name="post" value="<?php echo $post->id ?? ""?>">
<input type="hidden" name="thread" value="<?php echo $post->thread()->id ?? ""?>">
<input type="hidden" name="category" value="<?php echo $post->thread()->category()->id ?? ""?>">
<textarea id="moderating-editor-text" class="w-full h-full" name="content"><?php echo isset($edit) ? $edit->post : "" ; ?></textarea>
</div>
</div>
<div class="forum-post-footer">
<div class="forum-post-footer-left w-1/6">
<a class="forum-post-footer-action" @click="cancel()">Cancel</a>
</div>
<div class="forum-post-footer-mid">
<select name="duration">
<option value="+ 6 hour">6 hours</option>
<option value="2099-12-31 23:59">indefinitely</option>
</select>
<select name="action">
<?php if($auth->user()->didIModerateThis($post->thread()->category()->id) && $auth->user()->id != $post->user_id) { ?>
<option value="pardon">Pardon</option>
<option value="silence">Silence</option>
<option value="ban">Ban</option>
<?php } ?>
<?php if(!$post->thread()->isLocked()) { ?>
<option value="lock">Lock</option>
<?php } ?>
</select>
</div>
<div class="forum-post-footer-right">
<a class="forum-post-footer-action" @click="post()">Confirm</a>
</div>
</div>
</div>
</form>
</div>
<script>
var editorapp = new Vue({
el: "#editor-comp",
methods: {
cancel() {
var sure = confirm("Are you sure?");
if(sure) {
$("#editor").html("");
}
},
post() {
$("#editor-poster").submit();
}
}
});
</script>

View File

@ -0,0 +1,81 @@
<?php
$view->include('layouts/head');
?>
<h1 class="text-2xl">Recent Abuse Reports</h1>
<div id="forumbrowser">
<div class="forumbrowser-left">
<div :id="'group-'+group.id":class="'forumbrowser-item'+(current_group == group.id ? ' selected' : '')" v-for="(group, key) in groups" @click="change_group(group.id)">
{{ group.group_name }}
</div>
</div>
<div class="forumbrowser-left">
<div :id="'category-'+category.id":class="'forumbrowser-item'+(current_category == category.id ? ' selected' : '')" v-for="(category, key) in categories" @click="change_category(category.id)">
{{ category.category_name }}
</div>
</div>
<div class="forumbrowser-right-table">
<div :id="'report-'+report.id":class="'forumbrowser-right'+(current_report == report.id ? ' selected' : '')" v-for="(report, key) in reports" @click="change_report(report)">
<div class="forumbrowser-right-col flex-grow">{{ report.post.title }}</div>
<div class="forumbrowser-right-col">Reported by {{ report.reporter.username }}</div>
<div class="forumbrowser-right-col">Post by {{ report.reported.username }}</div>
<div class="forumbrowser-right-col">{{ report.elapsed }}</div>
</div>
</div>
</div>
<div id="reportreader">
</div>
<div id="editor">
</div>
<script>
var selectapp = new Vue({
el: "#forumbrowser",
data: {
groups: <?php echo json_encode($groups); ?>,
current_group: 0,
current_category: 0,
current_report: 0,
categories: [],
reports: [],
},
methods: {
change_category(id) {
this.current_category = id;
this.current_report = 0;
this.reports = [];
window.history.pushState('category-'+id,'','<?php echo $root; ?>/moderation?category='+id+window.location.hash);
$.ajax("<?php echo $root; ?>/api/get_reports?id="+id)
.done(function(data) {
this.reports = data;
}.bind(this));
},
change_group(id) {
this.current_group = id;
this.categories = [];
this.current_category = 0;
this.current_report = 0;
this.reports = [];
window.history.pushState('group-'+id,'','<?php echo $root; ?>/moderation?group='+id+window.location.hash);
$.ajax("<?php echo $root; ?>/api/get_categories?id="+id)
.done(function(data) {
this.categories = data;
}.bind(this));
},
change_report(report) {
this.current_report = report.id;
window.location.href = "<?php echo $root; ?>/?thread="+report.post.thread_id+"#forum-post-"+report.post.id;
}
},
mounted: function() {
<?php
if(isset($group)) {
echo "this.change_group(".$group->id.")\n";
}
echo "this.change_category(".($category->id ?? 0).")\n";
?>
}
});
</script>
<?php
$view->include('layouts/foot');
?>

View File

@ -0,0 +1,81 @@
<?php
$view->include('layouts/head');
?>
<div id="profile">
<div class="forum-post" id="forum-post-<?php echo $post->id ?>">
<div class="forum-post-title">
<p class="text-lg flex-grow"><?php echo $user->username ?>'s profile</p>
<?php if ($auth->isLoggedIn() && $auth->user()->id == $user->id) { ?>
<p class="text-lg px-2"><a href="/me">Edit</a></p>
<?php } ?>
</div>
<div class="forum-post-content">
<div class="forum-post-user">
<a href="/profile?id=<?php echo $user->id ?>">
<div class="forum-post-user-detail items-center">
<img src="/<?php echo $user->avatar_path != "" ? $user->avatar_path : "noava.jpg" ?>">
<p><?php echo $user->username ?></p>
</div>
</a>
<div class="forum-post-user-detail items-center">
<p><?php echo $user->status ?></p>
</div>
<div class="forum-post-user-detail items-start">
<p><?php echo $user->role_string ?></p>
</div>
<div class="forum-post-user-detail items-start">
<p><?php echo $user->post_count ?> posts</p>
</div>
<div class="forum-post-user-detail items-start">
<p><?php echo $user->elapsed_login ?></p>
</div>
<div class="forum-post-user-detail items-start">
<p>Active</p>
</div>
</div>
<div class="forum-post-profile">
<h1 class="text-4xl">About me</h1>
<p class="forum-post-profile-about"><?php echo $user->about ?></p>
<div class="forum-post-profile-detail">
<div class="w-1/3">
<h2 class="text-xl">Additional information</h2>
<table class="w-full">
<tr>
<td>Username</td>
<td><?php echo $user->username ?></td>
</tr>
<tr>
<td>Email</td>
<td><?php echo $user->email_visible ? $user->email : "hidden" ?></td>
</tr>
<tr>
<td>Most Active In</td>
<td><?php echo $user->most_active()->category_name ?> (<?php echo $user->most_active()->group()->group_name ?>)</td>
</tr>
<tr>
<td>Number of Hearts</td>
<td><?php echo $user->hearts ?></td>
</tr>
</table>
</div>
<div class="w-2/3">
<p>Recent posts</p>
<table class="w-full">
<?php foreach($user->recent_posts(5) as $post) { ?>
<tr class="h-12">
<td><a href="/?thread=<?php echo $post->thread_id ?>#forum-post-<?php echo $post->id ?>"><?php echo $post->title ?></a></td>
<td>by <?php echo $post->thread()->author_model->username ?></td>
<td><?php echo $post->elapsed_created ?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
$view->include('layouts/foot');
?>

View File

@ -1,3 +1,11 @@
<?php if($thread->isLocked()) { ?>
<div class="lock-message">
This thread has been locked for <?php echo $thread->lock()->duration ?>. See the last post for reason why.
<?php if($auth->user()->didIModerateThis($thread->category_id) ) { ?>
<a href="/thread/unlock?id=<?php echo $thread->id ?>">Unlock this thread</a>
<?php } ?>
</div>
<?php } ?>
<div id="forum">
<h1 class="text-2xl">Thread in: <?php echo $thread->category()->category_name ?></h1>
<p class="text-4xl"><?php echo $thread->title ?></p>
@ -13,24 +21,24 @@
<div class="forum-post-content">
<div class="forum-post-user">
<a href="/profile?id=<?php echo $post->user()->id ?>">
<div class="flex flex-col justify-center items-center">
<img src="/noava.jpg">
<div class="forum-post-user-detail items-center">
<img src="/<?php echo $post->user()->avatar_path != "" ? $post->user()->avatar_path : "noava.jpg" ?>">
<p><?php echo $post->user()->username ?></p>
</div>
</a>
<div class="flex flex-col justify-center items-center">
<p><?php echo $post->user()->logged_in ? 'Online' : 'Offline' ?></p>
<div class="forum-post-user-detail items-center">
<p><?php echo $post->user()->status ?></p>
</div>
<div class="flex flex-col justify-center items-start">
<div class="forum-post-user-detail items-start">
<p><?php echo $post->user()->role_string ?></p>
</div>
<div class="flex flex-col justify-center items-start">
<div class="forum-post-user-detail items-start">
<p><?php echo $post->user()->post_count ?> posts</p>
</div>
<div class="flex flex-col justify-center items-start">
<p><?php echo $post->user()->last_login ?></p>
<div class="forum-post-user-detail items-start">
<p><?php echo $post->user()->elapsed_login ?></p>
</div>
<div class="flex flex-col justify-center items-start">
<div class="forum-post-user-detail items-start">
<?php if($post->user()->isBanned($thread->category()->id)) { ?>
<p>Banned</p>
<?php } else if($post->user()->isSilenced($thread->category()->id)) { ?>
@ -45,19 +53,26 @@
</div>
</div>
<div class="forum-post-footer">
<div class="forum-post-favorite">
0 favorites
<div class="forum-post-footer-left">
<?php echo $post->favorites; ?> favorites
</div>
<div class="forum-post-actions">
<?php if(!$thread->lock_moderator && $auth->isLoggedIn()) { ?>
<div class="forum-post-footer-mid">
</div>
<div class="forum-post-footer-right">
<?php if($auth->isLoggedIn()) { ?>
<?php if($post->user_id == $auth->user()->id) { ?>
<a class="cursor-pointer" @click="reply(<?php echo $post->id ?>)">Reply</a>
<a class="cursor-pointer" @click="edit(<?php echo $post->id ?>)">Edit</a>
<a class="cursor-pointer" @click="delete_post(<?php echo $post->id ?>)">Delete</a>
<a class="forum-post-footer-action" @click="reply(<?php echo $post->id ?>)">Reply</a>
<a class="forum-post-footer-action" @click="edit(<?php echo $post->id ?>)">Edit</a>
<a class="forum-post-footer-action" @click="delete_post(<?php echo $post->id ?>)">Delete</a>
<?php } else { ?>
<a class="cursor-pointer" @click="favorite(<?php echo $post->id ?>)">Favorite</a>
<a class="cursor-pointer" @click="reply(<?php echo $post->id ?>)">Reply</a>
<a class="cursor-pointer" @click="report(<?php echo $post->id ?>)">Report Abuse</a>
<a class="forum-post-footer-action" @click="favorite(<?php echo $post->id ?>)">Favorite</a>
<a class="forum-post-footer-action" @click="reply(<?php echo $post->id ?>)">Reply</a>
<?php if(!$auth->user()->didIModerateThis($thread->category()->id) && $auth->user()->is_confirmed ) { ?>
<a class="forum-post-footer-action" @click="report(<?php echo $post->id ?>)">Report Abuse</a>
<?php } ?>
<?php } ?>
<?php if($auth->user()->didIModerateThis($thread->category()->id) ) { ?>
<a class="forum-post-footer-action" @click="moderate(<?php echo $post->id ?>)">Moderate</a>
<?php } ?>
<?php } ?>
</div>
@ -69,6 +84,9 @@
<script>
var threadapp = new Vue({
el: "#forum",
data: {
favorite_num: [],
},
methods: {
reply(post_id) {
$.ajax("<?php echo $root ?>/thread/editor?thread=<?php echo $thread->id ?>&reply="+post_id).done(function(data) {
@ -80,6 +98,27 @@ var threadapp = new Vue({
$("#editor").html(data);
});
},
delete_post(post_id) {
$.ajax("<?php echo $root ?>/thread/editor?thread=<?php echo $thread->id ?>&delete="+post_id).done(function(data) {
$("#editor").html(data);
});
},
favorite(post_id) {
$.ajax("<?php echo $root ?>/api/favorite?id="+post_id).done(function(data) {
console.log(data);
location.reload();
}.bind(this));
},
report(post_id) {
$.ajax("<?php echo $root ?>/thread/editor?thread=<?php echo $thread->id ?>&report="+post_id).done(function(data) {
$("#editor").html(data);
});
},
moderate(post_id) {
$.ajax("<?php echo $root ?>/thread/moderating_editor?id="+post_id).done(function(data) {
$("#editor").html(data);
});
}
},
});
</script>

View File

@ -9,6 +9,32 @@ An online web-based discussion forum application
3. Modify backend/config.php and adjust the configuration as needed.
4. Point the browser to `localhost`
## Sample database data
### Users
1. Username: Administrator
Password: yuikaadmin
Role: Site Admin
2. Username: YuikaMitsumine
Password: producertan
Role: Idolmaster Shiny Colors Moderator
3. Username: AsahiSerizawa
Password: asahizzu
Role: Idolmaster Shiny Colors Moderator
4. Username: YurikoNanao
Password: toumeinaprologue
Role: Idolmaster Million Live Moderator
5. Username: JunnaHoshimi
Password: shakespeare
Role: Revue Starlight Moderator
6. Username: SuddenVisitor
Password: omegadim
Role: User
7. Username: MusubiTendouji
Password: nanasisters
Role: User
### Post sources
## Project Structure
- index.php

View File

@ -23,10 +23,31 @@ $uri = substr($uri,strlen('/index.php'),strlen($uri)-strlen('/index.php'));
// Serve static files first
if(file_exists('Application/Static'.$uri) && $uri != '') {
$extension = pathinfo('Application/Static'.$uri, PATHINFO_EXTENSION);
if($extension == "js") {
header("Content-Type: text/javascript");
} else if($extension == "css") {
header("Content-Type: text/css");
} else {
header("Content-Type: ".mime_content_type('Application/Static'.$uri));
}
readfile('Application/Static'.$uri);
exit;
}
if(file_exists('Application/Storage'.$uri) && $uri != '') {
$extension = pathinfo('Application/Storage'.$uri, PATHINFO_EXTENSION);
if($extension == "js") {
header("Content-Type: text/javascript");
} else if($extension == "css") {
header("Content-Type: text/css");
} else {
header("Content-Type: ".mime_content_type('Application/Storage'.$uri));
}
readfile('Application/Storage'.$uri);
exit;
}
// Remove trailing slash
if(substr($uri,strlen($uri)-1,1) == '/') {
$uri = substr($uri,0,strlen($uri)-1);

View File

@ -39,10 +39,43 @@ return [
'GET:/api/get_threads' => [
'controller' => 'ApiController@threads',
],
'GET:/api/favorite' => [
'controller' => 'ApiController@favorite',
],
'GET:/api/favorite_num' => [
'controller' => 'ApiController@favorite_num',
],
'GET:/api/get_reports' => [
'controller' => 'ApiController@reports',
],
'GET:/thread' => [
'controller' => 'ForumThreadController@forum',
],
'GET:/thread/editor' => [
'controller' => 'ForumThreadController@editor',
],
'GET:/thread/moderating_editor' => [
'controller' => 'ForumThreadController@moderating_editor',
],
'POST:/thread/process' => [
'controller' => 'ForumThreadController@process',
],
'POST:/thread/moderate' => [
'controller' => 'ForumThreadController@moderate',
],
'GET:/thread/unlock' => [
'controller' => 'ForumThreadController@unlock',
],
'GET:/profile' => [
'controller' => 'AccountController@profile',
],
'GET:/me' => [
'controller' => 'AccountController@me',
],
'POST:/me/update' => [
'controller' => 'AccountController@update',
],
'GET:/moderation' => [
'controller' => 'IndexController@moderation',
],
];